/* Territorium wiki: night green, emerald and gold. Light and dark. */
@font-face {
  font-family: "Chakra Petch";
  src: url("/assets/ChakraPetch-Bold.ttf") format("truetype");
  font-weight: 700;
  font-display: swap;
}
:root {
  --bg: #f3f9f5;
  --panel: #ffffff;
  --panel-2: #e6f2ea;
  --text: #11261c;
  --muted: #4b6558;
  --line: #cfe3d6;
  --emerald: #047857;
  --emerald-2: #059669;
  --gold: #b45309;
  --gold-bg: #fef3c7;
  --code: #e8f3ec;
  --shadow: 0 4px 18px rgba(4, 60, 40, 0.08);
}
:root[data-theme="dark"] {
  --bg: #0b1a14;
  --panel: #10251c;
  --panel-2: #163227;
  --text: #e4f3ea;
  --muted: #9bb7a8;
  --line: #214636;
  --emerald: #34d399;
  --emerald-2: #10b981;
  --gold: #fbbf24;
  --gold-bg: #3a2f10;
  --code: #17342a;
  --shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1a14;
    --panel: #10251c;
    --panel-2: #163227;
    --text: #e4f3ea;
    --muted: #9bb7a8;
    --line: #214636;
    --emerald: #34d399;
    --emerald-2: #10b981;
    --gold: #fbbf24;
    --gold-bg: #3a2f10;
    --code: #17342a;
    --shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
  }
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.65 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
a { color: var(--emerald); text-underline-offset: 2px; }
a:hover { color: var(--gold); }
h1, h2, h3, .brand span { font-family: "Chakra Petch", system-ui, sans-serif; font-weight: 700; letter-spacing: 0.01em; }
.skip { position: absolute; left: -999px; top: 0; background: var(--gold); color: #000; padding: 8px 12px; z-index: 100; }
.skip:focus { left: 8px; top: 8px; }
.ico { width: 20px; height: 20px; flex: none; }
.logo { width: 30px; height: 30px; flex: none; }

.top {
  position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: 12px;
  padding: 10px 16px; background: var(--panel); border-bottom: 2px solid var(--emerald-2);
}
.brand { display: flex; align-items: center; gap: 8px; color: var(--text); text-decoration: none; font-size: 1.1rem; white-space: nowrap; }
.search { position: relative; flex: 1; max-width: 460px; margin-left: auto; display: flex; align-items: center; }
.search .ico { position: absolute; left: 10px; color: var(--muted); }
.search input {
  width: 100%; padding: 8px 12px 8px 36px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--bg); color: var(--text); font: inherit;
}
.search input:focus { outline: 2px solid var(--emerald-2); }
.results {
  position: absolute; top: 100%; left: 0; right: 0; margin: 6px 0 0; padding: 4px; list-style: none;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow);
  max-height: 70vh; overflow: auto;
}
.results li a { display: block; padding: 8px 10px; border-radius: 6px; text-decoration: none; color: var(--text); }
.results li a:hover, .results li a.on { background: var(--panel-2); }
.results small { display: block; color: var(--muted); }
.results .none { padding: 10px; color: var(--muted); }
.lang { display: flex; gap: 4px; }
.lang a, .icon-btn {
  border: 1px solid var(--line); background: var(--bg); color: var(--text); border-radius: 8px;
  padding: 6px 10px; text-decoration: none; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center;
}
.icon-btn:hover, .lang a:hover { border-color: var(--emerald-2); }
.menu-btn { display: none; }
.play {
  background: linear-gradient(180deg, #fbbf24, #d97706); color: #1a1100; font-weight: 700; text-decoration: none;
  padding: 7px 14px; border-radius: 8px;
}
.play:hover { color: #000; filter: brightness(1.08); }

.shell { display: grid; grid-template-columns: 270px minmax(0, 1fr); max-width: 1180px; margin: 0 auto; }
.side { position: sticky; top: 58px; align-self: start; max-height: calc(100vh - 58px); overflow: auto; padding: 18px 10px 24px 16px; }
.side ul { list-style: none; margin: 0; padding: 0; }
.side a {
  display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; color: var(--text); text-decoration: none;
}
.side a:hover { background: var(--panel-2); }
.side a[aria-current="page"] { background: var(--panel-2); color: var(--emerald); font-weight: 700; box-shadow: inset 3px 0 0 var(--gold); }
.main { padding: 26px 24px 40px; min-width: 0; }
article { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 24px 28px; box-shadow: var(--shadow); }
h1 { font-size: 2.1rem; margin: 0 0 12px; color: var(--emerald); line-height: 1.2; }
h2 { font-size: 1.45rem; margin: 2rem 0 0.5rem; padding-bottom: 4px; border-bottom: 1px solid var(--line); }
h3 { font-size: 1.15rem; margin: 1.4rem 0 0.3rem; color: var(--gold); }
.anchor { margin-left: -1.1em; padding-right: 0.3em; opacity: 0; text-decoration: none; }
h2:hover .anchor, h3:hover .anchor { opacity: 0.6; }
p, ul, ol { margin: 0.7rem 0; }
li { margin: 0.25rem 0; }
code { background: var(--code); padding: 1px 6px; border-radius: 5px; font-size: 0.92em; border: 1px solid var(--line); }
hr { border: 0; border-top: 1px solid var(--line); margin: 1.6rem 0; }
.table-wrap { overflow-x: auto; margin: 1rem 0; }
table { border-collapse: collapse; width: 100%; font-size: 0.95rem; }
th, td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--panel-2); color: var(--emerald); white-space: nowrap; }
.callout { margin: 1.1rem 0; padding: 4px 16px; border-radius: 10px; border-left: 4px solid var(--emerald-2); background: var(--panel-2); }
.callout.tip { border-left-color: var(--gold); background: var(--gold-bg); }
.callout.warn { border-left-color: #dc2626; }
.toc { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px 16px; margin: 1rem 0; }
.toc ul { margin: 6px 0 0; padding-left: 18px; columns: 2; column-gap: 24px; }
.pager { display: flex; justify-content: space-between; gap: 12px; margin-top: 18px; }
.pager a {
  display: block; padding: 10px 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); text-decoration: none; color: var(--text);
}
.pager a:hover { border-color: var(--emerald-2); }
.pager small { display: block; color: var(--muted); }
.pager .next { margin-left: auto; text-align: right; }
.foot { color: var(--muted); font-size: 0.88rem; margin-top: 24px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; margin: 1rem 0; padding: 0; list-style: none; }
.cards li { margin: 0; }
.cards a { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); text-decoration: none; color: var(--text); font-weight: 600; }
.cards a:hover { border-color: var(--gold); }
.cards .ico { color: var(--emerald); }
kbd { background: var(--panel-2); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; padding: 0 6px; font: 0.9em ui-monospace, monospace; }

.gate { display: grid; place-items: center; min-height: 100vh; }
.gate-box { text-align: center; padding: 32px; }
.gate-box .logo { width: 72px; height: 72px; }
.gate-box h1 { font-size: 2.4rem; }
.gate-links { display: flex; gap: 12px; justify-content: center; }

@media (max-width: 860px) {
  .shell { display: block; }
  .menu-btn { display: inline-flex; }
  .side {
    position: fixed; inset: 58px 0 0 0; z-index: 40; background: var(--bg); transform: translateX(-100%); transition: transform 0.2s; max-height: none; padding: 16px;
  }
  .side.open { transform: none; }
  .brand span { display: none; }
  .main { padding: 14px 16px 32px; }
  article { padding: 16px 16px; }
  .toc ul { columns: 1; }
  .play { display: none; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .side { transition: none; } }

/* Press kit additions to the wiki style. */
.wrap { max-width: 980px; margin: 0 auto; padding: 24px 20px 12px; }
.press .top { gap: 14px; }
.press .brand { margin-right: auto; }
.press section { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 8px 26px 22px; margin: 18px 0; box-shadow: var(--shadow); }
.press section.hero { text-align: center; padding: 30px 20px 20px; background: linear-gradient(180deg, var(--panel-2), var(--panel)); }
.hero-logo { max-width: min(560px, 90%); height: auto; }
.lead { font-size: 1.2rem; max-width: 720px; margin: 14px auto; }
.jump { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 12px; }
.jump a { border: 1px solid var(--line); border-radius: 999px; padding: 4px 14px; text-decoration: none; background: var(--bg); }
.jump a:hover { border-color: var(--gold); }
.facts th { width: 34%; background: transparent; color: var(--muted); font-weight: 600; white-space: normal; }
.tbc { color: var(--gold); font-style: italic; }
ul.plain { padding-left: 20px; }
.video-box { aspect-ratio: 16 / 9; display: grid; place-items: center; text-align: center; background: #07110d; color: #cfe3d6; border-radius: 12px; border: 1px dashed var(--emerald-2); padding: 20px; }
.video iframe { width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: 12px; display: block; }
.video-box button { cursor: pointer; border: 0; font: inherit; }
.assets { list-style: none; padding: 0; margin: 12px 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.asset { display: flex; gap: 12px; align-items: center; border: 1px solid var(--line); border-radius: 10px; padding: 10px; background: var(--bg); margin: 0; }
.asset .thumb { flex: none; width: 96px; height: 64px; display: grid; place-items: center; background: #0b1a14; border-radius: 8px; padding: 6px; }
.asset img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }
.asset small { display: block; color: var(--muted); }
.colors { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 14px; }
.colors li { display: flex; align-items: center; gap: 8px; margin: 0; }
.sw { width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--line); display: inline-block; }
.sw-night { background: #0b1a14; }
.sw-panel { background: #10251c; }
.sw-emerald { background: #10b981; }
.sw-gold { background: #fbbf24; }
.foot { text-align: center; }
@media (max-width: 860px) { .press .top .brand span { display: inline; font-size: 0.95rem; } .press section { padding: 6px 16px 16px; } .play { display: inline-block; } }
