/* Server-rendered pages (lane D): region/category hubs, tip pages, trending, legal.
   Tokens follow docs/DESIGN.md §1; layout follows §8. No scanlines, glow or animation here. */
:root {
  color-scheme: dark;
  --ink-950: #07051A;
  --ink-900: #0D0A2B;
  --ink-800: #15103D;
  --ink-700: #1F1857;
  --ink-600: #2C2372;
  --line: #3A2F8A;
  --line-hi: #7B6BE0;
  --text-hi: #F7F2FF;
  --text-mid: #CFC6EE;
  --text-low: #A69BD3;
  --pink: #FF3EA5;
  --teal: #19F0D8;
  --sun: #FFB23E;
  --gold: #FFD23F;
  --flare: #FF5A47;
  --violet: #B58CFF;
  --cat-collectible: #FFD23F;
  --cat-vehicle: #4CB8FF;
  --cat-weapon: #FF5A47;
  --cat-easter-egg: #B58CFF;
  --cat-secret: #FF5FC4;
  --cat-shop: #6BF07A;
  --cat-activity: #FF9A3D;
  --grad-cta: linear-gradient(100deg, #FF3EA5 0%, #FF7A6B 55%, #FFB23E 100%);
  --grad-hairline: linear-gradient(90deg, #FF3EA5 0%, #19F0D8 100%);
  --grad-chrome: linear-gradient(180deg, #FFFFFF 0%, #A5F7EE 40%, #19F0D8 52%, #2C2372 54%, #FF3EA5 62%, #FFB23E 100%);
  --grad-scrim-up: linear-gradient(0deg, rgba(7, 5, 26, 0.92) 0%, rgba(7, 5, 26, 0) 70%);
  --font-display: "Kanit", "Avenir Next Condensed", "Arial Narrow", sans-serif;
  --font-ui: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "Space Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --fs-h1: 1.75rem;
  --fs-h2: 1.375rem;
  --fs-h3: 1.125rem;
  --fs-meta: 0.8125rem;
  --fs-micro: 0.6875rem;
  --track-caps: 0.08em;
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 20px;
  --r-pill: 999px;
  --cut: 10px;
  --clip-cut: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut));
  --content-max: 720px;
  --gutter: 16px;
}

@font-face { font-family: "Kanit"; font-style: italic; font-weight: 800; font-display: swap; src: url("/fonts/kanit-latin-800-italic.woff2") format("woff2"); }
@font-face { font-family: "DM Sans"; font-style: normal; font-weight: 400 700; font-display: swap; src: url("/fonts/dm-sans-latin-var.woff2") format("woff2"); }
@font-face { font-family: "Space Mono"; font-style: normal; font-weight: 700; font-display: swap; src: url("/fonts/space-mono-latin-700.woff2") format("woff2"); }

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--ink-950); color: var(--text-mid); font: 400 1.0625rem/1.6 var(--font-ui); -webkit-text-size-adjust: 100%; }
body.page { margin: 0; min-height: 100vh; display: flex; flex-direction: column; }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
a { color: var(--teal); text-decoration: underline; text-underline-offset: 2px; }
a:hover { color: var(--pink); }
img { max-width: 100%; height: auto; }
.skip { position: absolute; left: -999px; top: 0; }
.skip:focus { left: var(--gutter); top: 8px; z-index: 10; background: var(--ink-800); padding: 8px 12px; }

/* Header: the top bar without the account button (§8). */
.site-header {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 56px; padding: 6px max(var(--gutter), env(safe-area-inset-right)) 6px max(var(--gutter), env(safe-area-inset-left));
  background: rgba(13, 10, 43, 0.92); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand {
  font: italic 800 1.25rem/1 var(--font-display); text-transform: uppercase; letter-spacing: 0.01em;
  color: var(--text-hi); text-decoration: none; padding: 12px 0.12em 12px 0; white-space: nowrap;
}
.brand .brand-hi { color: var(--pink); }
.brand:hover { color: var(--text-hi); }

/* Buttons (§7). */
.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 20px;
  font: 700 1rem/1 var(--font-ui); text-decoration: none; color: var(--ink-950);
  position: relative; isolation: isolate; background: none; border: 0; cursor: pointer;
}
/* Gradient and cut on ::before so the keyboard focus ring isn't clipped (UI critique #5). */
.btn::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--grad-cta); clip-path: var(--clip-cut); }
.btn:hover { color: var(--ink-950); filter: brightness(1.08); }
.btn-map, .btn-ghost {
  min-height: 44px; padding: 0 14px; font-size: 0.9375rem; color: var(--text-hi);
  background: var(--ink-700); border: 1px solid var(--line-hi); border-radius: var(--r-md); clip-path: none;
}
.btn-map::before, .btn-ghost::before { content: none; }
.btn-map:hover, .btn-ghost:hover { color: var(--text-hi); background: var(--ink-600); }

.crumbs { width: 100%; max-width: var(--content-max); margin: 0 auto; padding: 12px var(--gutter) 0; }
.crumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px; font: 700 var(--fs-micro)/1.6 var(--font-mono); letter-spacing: var(--track-caps); text-transform: uppercase; color: var(--text-low); }
.crumbs li { display: flex; align-items: center; }
.crumbs li + li::before { content: "/"; margin-right: 4px; color: var(--line-hi); }
.crumbs a { color: var(--text-low); text-decoration: none; display: inline-block; padding: 6px 0; }
.crumbs a:hover { color: var(--teal); }
.crumbs [aria-current] { color: var(--text-mid); display: inline-block; padding: 6px 0; max-width: 60vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }

main { flex: 1; width: 100%; max-width: var(--content-max); margin: 0 auto; padding: 8px var(--gutter) 40px; }
h1, h2, h3 { color: var(--text-hi); }
h1 {
  font: italic 800 var(--fs-h1)/1.1 var(--font-display); text-transform: uppercase; letter-spacing: 0.01em;
  margin: 12px 0 12px; padding-right: 0.12em; overflow-wrap: anywhere;
  background: var(--grad-chrome); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
@supports not ((background-clip: text) or (-webkit-background-clip: text)) { h1 { -webkit-text-fill-color: currentColor; background: none; } }
h2 { font: 700 var(--fs-h2)/1.3 var(--font-ui); margin: 36px 0 12px; }
h2::before { content: ""; display: block; width: 24px; height: 2px; margin-bottom: 12px; background: var(--grad-hairline); }
h3 { font: 700 var(--fs-h3)/1.3 var(--font-ui); margin: 24px 0 8px; }
p { margin: 0 0 14px; }
.muted { color: var(--text-low); }
.small { font-size: 0.9375rem; }
.intro p, p.intro { color: var(--text-mid); }
.counts { color: var(--text-mid); }
.counts strong { font-family: var(--font-mono); color: var(--teal); font-weight: 700; }
.actions { margin: 20px 0; }
.eyebrow { margin: 8px 0 0; font: 700 var(--fs-micro)/1.6 var(--font-mono); letter-spacing: var(--track-caps); text-transform: uppercase; }
.eyebrow a { color: var(--text-low); text-decoration: none; padding: 8px 0; display: inline-block; }
.eyebrow a:hover { color: var(--teal); }

/* Static map crop: our own schematic, never presented as the game map. */
.map-crop { margin: 16px 0; position: relative; border-radius: var(--r-lg); overflow: hidden; background: #0A0726; border: 1px solid var(--line); max-height: 320px; }
.map-crop img { display: block; width: 100%; height: 100%; max-height: 320px; object-fit: cover; }
/* Lane X1: region picture from the release's tiles (src/worker/pages/v2.ts). Height capped at 320px by width. */
.map-mosaic { max-height: none; }
.map-mosaic .mosaic-frame { position: relative; overflow: hidden; width: 100%; max-width: var(--mosaic-max, 100%); margin: 0 auto; }
.map-mosaic .mosaic-grid { position: absolute; display: grid; }
.map-mosaic .mosaic-grid img, .map-mosaic .mosaic-sea { display: block; width: 100%; height: auto; max-height: none; aspect-ratio: 1; object-fit: fill; }
.map-crop::after { content: ""; position: absolute; inset: 0; background: var(--grad-scrim-up); pointer-events: none; }

/* Chips (§7.3) and cross-links (§8). */
.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border-radius: var(--r-pill);
  background: var(--ink-800); border: 1px solid var(--line-hi); color: var(--text-mid);
  font: 700 0.875rem/1 var(--font-ui); text-decoration: none;
}
a.chip:hover { color: var(--text-hi); background: var(--ink-700); }
.chip-current { background: var(--text-hi); color: var(--ink-950); border-color: var(--text-hi); }
.chip.cat-collectible { border-color: var(--cat-collectible); }
.chip.cat-vehicle { border-color: var(--cat-vehicle); }
.chip.cat-weapon { border-color: var(--cat-weapon); }
.chip.cat-easter-egg { border-color: var(--cat-easter-egg); }
.chip.cat-secret { border-color: var(--cat-secret); }
.chip.cat-shop { border-color: var(--cat-shop); }
.chip.cat-activity { border-color: var(--cat-activity); }

.cat-counts { list-style: none; margin: 0; padding: 0; }
.cat-counts li { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 48px; border-bottom: 1px solid var(--line); color: var(--text-hi); }
.cat-counts a { padding: 12px 0; }
.cat-counts .muted { font: 700 var(--fs-meta)/1 var(--font-mono); white-space: nowrap; }

/* Tip list: the Trending card without the rank (§8). */
.tips { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.tip { background: var(--ink-800); border-radius: var(--r-lg); padding: 14px 16px; border-top: 1px solid transparent; border-image: var(--grad-hairline) 1 0 0 0; }
.tip > a { display: block; font-weight: 700; color: var(--text-hi); text-decoration: none; line-height: 1.35; padding: 4px 0; }
.tip > a:hover { color: var(--teal); text-decoration: underline; }
.tip-spoiler > a { color: var(--text-mid); font-style: italic; }
.tip-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-top: 6px; font-size: var(--fs-meta); color: var(--text-low); }
.badge {
  display: inline-block; padding: 3px 8px; font: 700 var(--fs-micro)/1.4 var(--font-mono); letter-spacing: var(--track-caps); text-transform: uppercase;
  color: var(--text-hi); background: var(--ink-700); border: 1px dashed var(--line-hi); border-radius: 4px;
}
.badge-confirmed { color: var(--teal); border: 1px solid var(--teal); background: transparent; }
.badge-disputed { color: var(--sun); border: 1px solid var(--sun); background: transparent; }
.official { color: var(--violet); }

/* Tip page (the message slip). */
.find h1 { font-size: 1.5rem; }
.find .status { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.find-title { margin-top: 8px; }
.find-title::before { display: none; }
.find-body p { color: var(--text-mid); }
.find-shot { margin: 16px 0; }
.find-shot img { display: block; border-radius: var(--r-md); }
.byline, .source { font-size: 0.9375rem; color: var(--text-low); }
.spoiler-box { position: relative; margin: 16px 0; padding: 16px; background: var(--ink-800); border-radius: var(--r-lg); }
.reveal-toggle { position: absolute; opacity: 0; width: 1px; height: 1px; }
.reveal-toggle:focus-visible + .reveal-label { outline: 2px solid var(--teal); outline-offset: 2px; }
.reveal-label { margin-bottom: 12px; }
.spoiler-content { filter: blur(8px); user-select: none; pointer-events: none; }
.reveal-toggle:checked + .reveal-label { display: none; }
.reveal-toggle:checked ~ .spoiler-content { filter: none; user-select: auto; pointer-events: auto; }

/* Trending (§7.8). */
.trending { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; counter-reset: trend; }
.trend { display: flex; gap: 12px; align-items: flex-start; background: var(--ink-800); border-radius: var(--r-lg); padding: 16px; }
.trend > div { min-width: 0; }
.trend-title { margin: 0 0 4px; font-weight: 700; }
.trend-title a, .trend-title span { color: var(--text-hi); text-decoration: none; }
.trend-title a:hover { color: var(--teal); text-decoration: underline; }
.trend-line { margin: 0 0 6px; color: var(--text-mid); font-size: 0.9375rem; }
.trend-meta { margin: 0 0 6px; color: var(--text-low); font-size: var(--fs-meta); }
.trend-countdown { border: 1px solid rgba(255, 178, 62, 0.4); }
.trend-countdown .trend-title span { color: var(--sun); font-family: var(--font-mono); }
.thumb { flex: 0 0 auto; }
.thumb img { display: block; width: 112px; height: 63px; object-fit: cover; border-radius: var(--r-sm); }
.src { font: 700 var(--fs-micro)/1.6 var(--font-mono); letter-spacing: var(--track-caps); text-transform: uppercase; color: var(--violet); }
.src-crowd { color: var(--teal); }
a.src-youtube { color: var(--text-hi); text-decoration: none; display: inline-block; padding: 6px 0; }
a.src-youtube span { color: #FF0033; }

/* Legal and about. */
.doc h2 { font-size: 1.25rem; }
.doc ul, .doc ol { padding-left: 1.25em; margin: 0 0 14px; }
.doc li { margin-bottom: 6px; }
.doc strong { color: var(--text-hi); }
.doc code { font-family: var(--font-mono); font-size: 0.9em; color: var(--text-hi); background: var(--ink-800); padding: 1px 5px; border-radius: 4px; }
.doc blockquote { margin: 0 0 14px; padding: 12px 16px; background: var(--ink-800); border-left: 3px solid var(--pink); color: var(--text-hi); }
.doc blockquote p { margin: 0; }
.table-wrap { overflow-x: auto; margin: 0 0 18px; border: 1px solid var(--line); border-radius: var(--r-md); }
.doc table { border-collapse: collapse; width: 100%; min-width: 560px; font-size: 0.9375rem; }
.doc th, .doc td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.doc th { color: var(--text-hi); background: var(--ink-800); font-weight: 700; }
.doc tr:last-child td { border-bottom: 0; }

/* Footer (§8). */
.site-footer { border-top: 1px solid var(--line); background: var(--ink-900); padding: 20px max(var(--gutter), env(safe-area-inset-left)) calc(24px + env(safe-area-inset-bottom)); font-size: var(--fs-meta); color: var(--text-low); line-height: 1.5; }
.site-footer > * { max-width: var(--content-max); margin-left: auto; margin-right: auto; }
.site-footer nav { margin: 8px auto; display: flex; flex-wrap: wrap; gap: 0 4px; align-items: center; }
.site-footer nav a { color: var(--text-mid); display: inline-block; padding: 10px 2px; }
.site-footer p { margin-bottom: 8px; }

@media (min-width: 720px) {
  h1 { font-size: 2.25rem; }
  .find h1 { font-size: 1.875rem; }
}
@media (max-width: 359px) {
  .brand { font-size: 1.05rem; }
  .btn-map { padding: 0 10px; font-size: 0.875rem; }
}

/* ===== Lane X1: design system v2 on the SSR pages (html.ds2, set per request by src/worker/lib/flags.ts) ===== */
.brand-mark { display: none; }
.ds2-only { display: none; }
html.ds2 .ds2-only { display: block; }
html.ds2 .v1-only { display: none; }
/* Header mark (UI critique #12). */
html.ds2 .brand { display: inline-flex; align-items: center; gap: 6px; }
html.ds2 .brand-mark { display: block; width: 38px; height: 30px; flex: none; }
/* Chrome type only on short display lines of 32px and up, never on pages like these: solid --text-hi (critique #13). */
html.ds2 h1 { background: none; -webkit-text-fill-color: currentColor; color: var(--text-hi); }
/* 404 in the copy deck's voice (critique #21): mono label, the title, one plain button on its own line. */
html.ds2 .notfound .kicker { margin: 0 0 8px; font: 700 var(--fs-micro)/1.3 var(--font-mono); letter-spacing: var(--track-caps); text-transform: uppercase; color: var(--sun); }
html.ds2 .notfound .actions { margin-top: 20px; }
/* Tables stack as cards under 600px: each cell gets its column name (critique #20). */
@media (max-width: 599px) {
  html.ds2 .table-wrap { overflow: visible; border: 0; }
  html.ds2 .doc table, html.ds2 .doc tbody, html.ds2 .doc tr, html.ds2 .doc td { display: block; min-width: 0; width: auto; }
  html.ds2 .doc thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  html.ds2 .doc tr { margin: 0 0 12px; padding: 4px 14px; background: var(--ink-800); border: 1px solid var(--line); border-radius: var(--r-md); }
  html.ds2 .doc td { padding: 8px 0; border-bottom: 1px solid var(--line); }
  html.ds2 .doc tr td:last-child { border-bottom: 0; }
  html.ds2 .doc td::before { content: attr(data-label); display: block; margin-bottom: 2px; font: 700 var(--fs-micro)/1.3 var(--font-mono); letter-spacing: var(--track-caps); text-transform: uppercase; color: var(--text-low); }
  html.ds2 .doc td:first-child { color: var(--text-hi); font-weight: 700; }
  html.ds2 .doc td:first-child::before { content: none; }
}
html.ds2 .btn-map { white-space: nowrap; }
@media (max-width: 429px) { html.ds2 .brand { font-size: 1.05rem; gap: 4px; } html.ds2 .brand-mark { width: 30px; height: 24px; } html.ds2 .btn-map { padding: 0 12px; font-size: 0.875rem; } }
