/* House of Embers: the site's one stylesheet. The brand and type system is BRAND.md (decided 18 Oct 2026); this file is held to it.
   Dark only. Two colour layers: a warm ember ground for the chrome, and the game's own colours only for what they mean in game. */

:root {
  color-scheme: dark;

  /* ground, borders, text (BRAND.md section 2) */
  --bg: #0D0A08; --bg-raised: #15100D; --surface: #1B1512; --surface-2: #241C17;
  --border: rgba(255,214,180,.08); --border-strong: rgba(255,214,180,.14);
  --text: #F7EFE7; --text-2: #C9BCB0; --text-3: #968A7E;
  /* the edge of a text field or header control: 3:1 against its ground (WCAG 1.4.11); cards keep the quiet hairlines above */
  --control-border: rgba(255,214,180,.42); --control-border-hover: rgba(255,214,180,.6);

  /* ember, the one brand accent */
  --ember: #FF6A1A; --ember-hover: #FF8A3D; --ember-soft: #FFB27A;
  /* the logo's red to yellow: hero glow, progress bars and the active-nav underline only */
  --flame: linear-gradient(90deg, #FF3D1F, #FF7A1A 45%, #FFC53D);

  /* game semantics, AA tints on the dark ground */
  --chits: #F5B841; --embers: #E879F9; --xp: #86EFAC; --gems: #4DA6FF;
  --rarity-common: #E9E4DF; --rarity-uncommon: #6EE787; --rarity-rare: #8FA8FF; --rarity-radiant: #F07CF5; --rarity-legendary: #FFB547;
  /* trade accents: thin rules and dots only */
  --trade-mining: #F2A93B; --trade-fishing: #2EC4B6; --trade-farming: #7BCB4B; --trade-gathering: #F37BC0;

  /* type */
  --display: "Tektur", Impact, "Arial Black", system-ui, sans-serif;
  --sans: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;

  /* shape, space, motion */
  --radius: 16px; --radius-sm: 12px; --pill: 999px;
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 24px; --sp-6: 32px; --sp-7: 48px; --sp-8: 64px; --sp-9: 96px;
  --gutter: 16px; --content: 1200px; --read: 68ch; --header: 64px;
  --t-fast: 120ms; --t-mid: 200ms; --t-slow: 320ms; --ease: cubic-bezier(.2,.8,.2,1);
  --shadow-lift: 0 12px 32px rgba(0,0,0,.35);

  /* the game's own raw colours: they stay inside game cards and holograms (the HTML fallback of a card draws with these) */
  --tip-bg: rgba(16,0,16,.941); --tip-top: rgba(80,0,255,.314); --tip-bottom: rgba(40,0,127,.314);

  /* ---- aliases: the names the page modules still use, kept working until the per-module sweep (phase 2) retires them ---- */
  --ground: var(--bg); --panel: var(--surface); --panel-2: var(--surface-2); --line: var(--border);
  --muted: var(--text-2); --brand: var(--ember); --brand-line: var(--border-strong);
  --mc-white: var(--text); --mc-grey: var(--text-2); --mc-dark: var(--text-3);
  --mc-gold: var(--chits); --mc-yellow: var(--chits); --mc-pink: var(--embers); --mc-green: var(--xp); --mc-red: #FF6B6B;
  --mc-aqua: var(--ember-soft);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--header) + 24px); }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 17px/1.65 var(--sans); overflow-x: hidden;
  min-height: 100vh; display: flex; flex-direction: column; font-optical-sizing: auto; -webkit-font-smoothing: antialiased; }
::selection { background: var(--ember); color: #1A0D05; }
:focus-visible { outline: 2px solid var(--ember); outline-offset: 2px; border-radius: 4px; }
img, video, canvas { max-width: 100%; }
img, video { height: auto; }
p { margin: 0 0 var(--sp-4); }
html:not(.js) .js-only { display: none !important; }
.i { flex: none; vertical-align: -3px; }

/* ---- links (BRAND.md section 1) ----
   Colour: ember-soft. Underline: only in running prose (a paragraph, lead, caption, quote or the footer notes), 1px at 65% ember (3:1 on every ground), solid on hover.
   Links that are list items, table cells, grid and tile contents, tags, meta rows and breadcrumbs sit plain and take the underline on hover and
   keyboard focus. Nav and card titles are white (below). Module CSS needs no link rules of its own: a single-class text-decoration there still wins. */
a { color: var(--ember-soft); text-decoration: none; text-decoration-thickness: 1px; text-underline-offset: .2em;
  text-decoration-color: color-mix(in srgb, var(--ember) 65%, transparent); transition: text-decoration-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease); }
/* running prose: the one place a link rests underlined; a paragraph inside a list, table or grid is not prose */
:where(p, .lead, blockquote, figcaption, .prose, .ft-small, .ft-beta) a:not(:where(ul, ol, dl, table, .grid, .tiles, [class*="meta"], .wc-tag, .wc-foot, .crumbs) a, .btn, .tile, .card, .brand) { text-decoration-line: underline; }
/* hover and keyboard focus: everywhere a link is, at the lowest specificity so a module's own text-decoration: none on a block link still wins */
:where(a):is(:hover, :focus-visible) { text-decoration-line: underline; text-decoration-color: currentColor; }
/* chrome and block links: no underline even on hover (their colour, border or title carries the state) */
:is(.brand, .sb, .tile, .card, .skip, .btn, .copy, .fr-trade, .side a, .onpage a, .subnav a, .search-res a):is(:hover, :focus-visible) { text-decoration: none; }
/* chrome and titles: white, no resting underline, the title underlines on hover */
:is(.nav a, .wc-name a, .fr-st-t a, .ft-nav a, .tile .tt, .fr-trade-t):hover { text-decoration: underline; text-underline-offset: .22em; text-decoration-thickness: 1px; }
.tile:hover .tt, .fr-trade:hover .fr-trade-t { text-decoration: underline; text-underline-offset: .22em; text-decoration-thickness: 1px; }

/* every field: a placeholder at --text-3 (4.5:1 or better) instead of the browser's grey, and a 3:1 edge on text fields (the search palette draws its own) */
::placeholder { color: var(--text-3); opacity: 1; }
html input:is([type="search"], [type="text"], [type="email"], [type="url"], [type="number"], :not([type])), html textarea, html select { border-color: var(--control-border); }

/* a skip-link target takes focus without drawing a ring */
main:focus { outline: none; }
/* a table scroller that really overflows is a labelled region and a Tab stop (site.js); the ring sits inside so the page edge does not clip it */
.tbl:focus-visible { outline-offset: -2px; }

code, kbd { font-family: var(--mono); font-size: .88em; font-weight: 500; }
code { background: var(--surface-2); border-radius: 6px; padding: 1px 6px; color: var(--text); }
kbd { color: var(--text-3); }

.skip { position: absolute; left: 8px; top: -60px; z-index: 50; background: var(--ember); color: #1A0D05; padding: 8px 12px; border-radius: var(--radius-sm); font-weight: 600; }
.skip:focus { top: 8px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }

/* ---- the type scale (BRAND.md section 1) ----
   Display is Tektur, a variable face (400 to 900) that sets H1 to H3, card titles and stat numbers. Weights: H1 800, H2 and H3 and card titles 600, stat numbers 800.
   Tracking: -0.01em on H1 only (never negative below 32px); +0.015em on H2, H3 and card titles.
   H1 comes in two sizes. Hub pages (home, /wiki, /players, /updates, the start page, leaderboards) keep the big one, clamp(40px, 5vw, 60px). Wiki topic and
   entity pages (every page that has the docs sidebar, `.page.has-side`) take clamp(32px, 4vw, 46px). layout.render sets `has-side` on every /wiki/... page, and
   /wiki itself has no sidebar, so that class alone separates the two. */
h1, h2, h3, .wc-name, .tt, .stat-n { font-family: var(--display); color: var(--text); text-wrap: balance; }
h1 { font-weight: 800; letter-spacing: -.01em; font-size: clamp(40px, 5vw, 60px); line-height: 1.05; margin: 0 0 var(--sp-4); }
.page.has-side .main h1 { font-weight: 800; letter-spacing: -.01em; font-size: clamp(32px, 4vw, 46px); line-height: 1.05; }
h2 { font-weight: 600; letter-spacing: .015em; font-size: 28px; line-height: 1.15; margin: 56px 0 var(--sp-4); }
h3 { font-weight: 600; letter-spacing: .015em; font-size: 20px; line-height: 1.3; margin: var(--sp-6) 0 var(--sp-2); }
h4 { font: 600 17px/1.3 var(--sans); color: var(--text); margin: var(--sp-5) 0 var(--sp-2); }
.stat-n { font-weight: 800; font-variant-numeric: tabular-nums; }
.main > h1 { margin-top: var(--sp-2); }
/* the lead paragraph under every page title */
.lead, .main .lead { font-size: 20px; line-height: 1.55; color: var(--text-2); max-width: 60ch; margin: 0 0 var(--sp-6); text-wrap: pretty; }
.eyebrow { font: 600 12px/1.3 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); margin: 0 0 var(--sp-3); }
.eyebrow a { color: var(--text-3); }
.eyebrow a:hover { color: var(--text); }
.small, .note { font-size: 14px; color: var(--text-3); }
.main p, .main li { max-width: var(--read); }
.num, .tab { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); }

/* ---- colour words: a number takes the colour of what it counts ---- */
.chits { color: var(--chits); }
.embers { color: var(--embers); }
.xp { color: var(--xp); }
.gems { color: var(--gems); }
.lvl { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.ok { color: var(--xp); }
.no { color: var(--mc-red); }
.muted, .grey { color: var(--text-2); }

/* ---- pills: tags and meta chips (BRAND.md section 3; the game cards keep their [ brackets ]) ---- */
.pill { display: inline-flex; align-items: center; font: 600 12px/1.4 var(--sans); color: var(--text-2); background: var(--surface-2); border: 0; border-radius: var(--pill); padding: 2px 10px; white-space: nowrap; }
/* the word Admin beside an admin's name (admins.txt): an outline, not a fill, so it never reads as a game badge or a pill */
.admin-tag { display: inline-block; margin-left: 2px; font: 600 10px/1 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--ember-soft);
  border: 1px solid rgba(255,178,122,.4); border-radius: var(--pill); padding: 3px 7px; vertical-align: middle; white-space: nowrap; }
.meta { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin: 0 0 var(--sp-6); padding: 0; list-style: none; max-width: none; }

/* ---- the header: 64px, sticky, dark glass; its bottom border appears only after scrolling (site.js adds .scrolled) ---- */
.hd { position: sticky; top: 0; z-index: 30; height: var(--header); background: rgba(13,10,8,.72); border-bottom: 1px solid transparent;
  -webkit-backdrop-filter: blur(14px) saturate(140%); backdrop-filter: blur(14px) saturate(140%); transition: border-color var(--t-mid) var(--ease), background-color var(--t-mid) var(--ease); }
.hd.scrolled { border-bottom-color: var(--border); }
.has-hero .hd:not(.scrolled) { background: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; }
.hd-in { max-width: var(--content); margin: 0 auto; height: 100%; padding: 0 var(--gutter); display: flex; align-items: center; gap: var(--sp-5); }
body:has(.page.has-side) :is(.hd-in, .ft-in) { max-width: var(--docs, 1256px); }
.brand { display: flex; align-items: center; flex: none; color: var(--text); }
.sheet { display: flex; align-items: center; gap: var(--sp-5); flex: 1; min-width: 0; }
.nav { display: flex; gap: 2px; flex: 1; justify-content: center; align-self: stretch; }
.nav a { position: relative; display: inline-flex; align-items: center; padding: 0 12px; color: var(--text); font: 500 15px/1 var(--sans); }
.nav a[aria-current="page"]::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: 0; height: 2px; border-radius: 2px 2px 0 0; background: var(--flame); }
.hd-tools { display: flex; align-items: center; gap: var(--sp-3); flex: none; }
.sb { display: inline-flex; align-items: center; gap: var(--sp-2); height: 40px; padding: 0 12px; color: var(--text-2); background: var(--surface); border: 1px solid var(--control-border);
  border-radius: var(--radius-sm); font: 500 14px/1 var(--sans); transition: border-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease); }
.sb:hover { color: var(--text); border-color: var(--control-border-hover); }
/* the wiki hub's own search bar, under its lead: it opens the same dialog */
.wk-find { max-width: 640px; margin: var(--sp-5) 0 0; }
.wk-find a { display: flex; align-items: center; gap: var(--sp-3); min-height: 48px; padding: 0 var(--sp-4); font: 400 16px/1.4 var(--sans); color: var(--text-3); background: var(--surface);
  border: 1px solid var(--control-border); border-radius: var(--radius-sm); text-decoration: none; transition: border-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease); }
.wk-find a:hover, .wk-find a:focus-visible { color: var(--text-2); border-color: var(--control-border-hover); text-decoration: none; }
.wk-find-t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wk-find kbd { flex: none; font: 500 11px/1 var(--mono); color: var(--text-3); border: 1px solid var(--border-strong); border-radius: 5px; padding: 3px 6px; }
@media (max-width: 599px) { .wk-find-x, .wk-find kbd { display: none; } }
/* The wiki's front page is a directory (28 Nov 2026): the reading order as a numbered strip, then each row as its name on the left and its
   topics on the right, on the ground between hairlines. A topic is a small icon, its name and one line; its own pages follow as links. */
.wk-start { list-style: none; margin: var(--sp-4) 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--border-strong); border-bottom: 1px solid var(--border-strong); }
.wk-start > li { margin: 0; max-width: none; min-width: 0; border-left: 1px solid var(--border); }
.wk-start > li:nth-child(2n + 1) { border-left: 0; }
.wk-start > li:nth-child(n + 3) { border-top: 1px solid var(--border); }
.wk-st { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0 var(--sp-3); align-items: baseline; height: 100%; padding: var(--sp-4) var(--sp-4); color: var(--text); }
.wk-start > li:nth-child(2n + 1) .wk-st { padding-left: 0; }
.wk-st:hover { text-decoration: none; background: linear-gradient(180deg, rgba(255,255,255,.03), transparent); }
.wk-st-n { grid-row: 1 / span 2; font: 800 24px/1 var(--display); color: var(--ember); font-variant-numeric: tabular-nums; }
.wk-st-t { font: 600 17px/1.3 var(--display); letter-spacing: .015em; }
.wk-st:hover .wk-st-t { text-decoration: underline; text-underline-offset: .22em; text-decoration-thickness: 1px; }
.wk-st-l { grid-column: 2; font-size: 14px; line-height: 1.45; color: var(--text-2); }
.wk-dir { margin-top: var(--sp-8); border-top: 1px solid var(--border-strong); }
.wk-row { padding: var(--sp-5) 0; border-bottom: 1px solid var(--border); }
.wk-row-h { margin: 0 0 var(--sp-3); font-size: 22px; }
.wk-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sp-2) var(--sp-5); }
.wk-it { margin: 0; max-width: none; min-width: 0; }
.wk-a { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 0 var(--sp-3); align-items: center; min-height: 56px; padding: 6px 0; color: var(--text); }
.wk-a:hover { text-decoration: none; }
.wk-a > .ic { grid-row: 1 / span 2; }
.wk-t { align-self: end; font: 600 17px/1.3 var(--display); letter-spacing: .015em; }
.wk-a:hover .wk-t { text-decoration: underline; text-underline-offset: .22em; text-decoration-thickness: 1px; }
.wk-l { align-self: start; font-size: 14px; line-height: 1.45; color: var(--text-2); }
.wk-subs { display: flex; flex-wrap: wrap; gap: 0 14px; margin: 0 0 var(--sp-2) calc(40px + var(--sp-3)); max-width: none; font-size: 14px; line-height: 1.7; color: var(--text-3); }
.wk-subs .sep { display: none; }
.wk-subs a { display: inline-block; padding: 4px 0; color: var(--text-2); text-decoration: underline; text-decoration-color: var(--border-strong); text-underline-offset: 3px; }
.wk-subs a:hover { color: var(--text); text-decoration-color: currentColor; }
@media (min-width: 620px) { .wk-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 900px) {
  .wk-start { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .wk-start > li:nth-child(n) { border-top: 0; border-left: 1px solid var(--border); }
  .wk-start > li:first-child { border-left: 0; }
  .wk-start > li:nth-child(n) .wk-st { padding-left: var(--sp-5); }
  .wk-start > li:first-child .wk-st { padding-left: 0; }
  .wk-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 10fr); column-gap: var(--sp-5); align-items: start; }
  .wk-row-h { margin: 14px 0 0; }
  .wk-list { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.sb kbd { font: 500 11px/1 var(--mono); color: var(--text-3); border: 1px solid var(--border-strong); border-radius: 5px; padding: 3px 6px; }
/* the address pill: Geist Mono 500 with a copy icon; "Copied" with a check for 1.5 s */
.addr { display: inline-grid; grid-template-columns: auto auto; align-items: center; column-gap: var(--sp-2); height: 40px; padding: 0 6px 0 16px; background: var(--surface);
  border: 1px solid var(--control-border); border-radius: var(--pill); max-width: 360px; overflow: hidden; position: relative;
  transition: max-width .25s var(--ease), opacity .2s var(--ease), border-color var(--t-fast) var(--ease); }
html.js .addr { cursor: pointer; }
html.js .addr:hover { border-color: var(--control-border-hover); }
.addr-t, .addr-ok { grid-row: 1; grid-column: 1; font: 500 13px/1 var(--mono); white-space: nowrap; }
.addr-t { color: var(--text); user-select: all; }
.addr-ok { visibility: hidden; color: var(--xp); }
.addr.done .addr-t { visibility: hidden; }
.addr.done .addr-ok { visibility: visible; }
.copy { display: inline-grid; place-items: center; width: 28px; height: 28px; padding: 0; color: var(--text-2); background: none; border: 0; border-radius: 50%; cursor: pointer; }
.copy:hover { color: var(--text); background: var(--surface-2); }
.copy .i-ok { display: none; }
.copy.done .i-copy { display: none; }
.copy.done .i-ok { display: block; color: var(--xp); }
.menu-btn { display: none; margin-left: auto; place-items: center; width: 44px; height: 44px; padding: 0; color: var(--text); background: none; border: 0; border-radius: var(--radius-sm); cursor: pointer; }
.menu-btn .mb-shut, .menu-btn[aria-expanded="true"] .mb-open { display: none; }
.menu-btn[aria-expanded="true"] .mb-shut { display: block; }
.menu-btn .i { width: 22px; height: 22px; vertical-align: middle; }

/* ---- search: a command palette (/ and Ctrl+K). Results in groups on the left, the lit result's card on the right (720 and wider), 44 px rows ---- */
.search-pop { position: fixed; inset: 0; z-index: 60; background: rgba(8,6,4,.62); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  display: flex; justify-content: center; align-items: flex-start; padding: 12vh var(--gutter) 24px; }
.search-pop[hidden] { display: none; }
.search-in { width: min(900px, 100%); background: var(--surface); border: 1px solid var(--control-border); border-radius: var(--radius); box-shadow: 0 24px 64px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,255,255,.04); overflow: hidden; }
.search-box { display: flex; align-items: center; gap: var(--sp-3); padding-left: var(--sp-4); color: var(--text-3); border-bottom: 1px solid var(--border); }
.search-box input { flex: 1; min-width: 0; font: 400 16px var(--sans); color: var(--text); background: transparent; border: 0; padding: 18px 0; }
.search-box input:focus { outline: none; }
/* the field has no outline of its own: an ember rule under the row while it has focus */
.search-box:has(input:focus-visible) { box-shadow: inset 0 -2px 0 var(--ember); }
.search-box input::placeholder { color: var(--text-3); }
.search-box input::-webkit-search-cancel-button, .search-box input::-webkit-search-decoration { -webkit-appearance: none; appearance: none; display: none; }
.search-x { font: 500 11px var(--mono); color: var(--text-3); background: none; border: 1px solid var(--control-border); border-radius: 5px; margin: 0 var(--sp-4) 0 0; padding: 4px 8px; cursor: pointer; }

.search-body { display: grid; grid-template-columns: minmax(0, 1fr); }
.sp-list { max-height: 56vh; overflow-y: auto; padding: 6px; min-width: 0; }
.sp-pane { display: none; padding: var(--sp-5); border-left: 1px solid var(--border); background: var(--bg-raised); min-width: 0; max-height: 56vh; overflow-y: auto; }

@media (min-width: 720px) {
  .search-body { grid-template-columns: minmax(0, 1fr) 340px; }
  .sp-pane { display: block; }
}

.search-res { list-style: none; margin: 0; padding: 0; }
.search-res:empty { display: none; }
.search-res ul { list-style: none; margin: 0; padding: 0; }
.search-res li { max-width: none; margin: 0; }
.search-res .grp { padding: 12px 12px 4px; font: 600 12px/1.3 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); }
.search-res a, .search-res .recent, .search-res .more { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 2px 12px; min-height: 44px; padding: 8px 12px; border-radius: var(--radius-sm); color: var(--text); cursor: pointer; }
.search-res a:hover, .search-res .recent:hover, .search-res .more:hover { background: var(--surface-2); }
/* the keyboard-selected result: a lit background and an ember bar on its left edge (6.3:1 on the panel), never colour alone */
.search-res [aria-selected="true"] { background: var(--surface-2); box-shadow: inset 3px 0 0 var(--ember); }
.search-res .t { font-weight: 500; }
.search-res .k { color: var(--text-3); font-size: 12px; font-weight: 600; letter-spacing: .04em; align-self: center; }
.search-res .x { grid-column: 1 / -1; color: var(--text-3); font-size: 13px; line-height: 1.4; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-res .more { display: block; color: var(--ember-soft); font-size: 14px; font-weight: 500; }
.search-res .none { padding: 14px 12px; color: var(--text-3); }

/* the field is empty: the last searches (this device only), then the places most readers go */
.sp-head { display: flex; align-items: center; justify-content: space-between; padding: 6px 12px 0; }
.sp-h { font: 600 12px/1.3 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); }
.sp-clear { min-height: 32px; padding: 0 8px; font: 500 13px var(--sans); color: var(--ember-soft); background: none; border: 0; border-radius: 6px; cursor: pointer; }
.sp-clear:hover { color: var(--text); }
.sp-pop { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); margin: 0; padding: 12px; max-width: none; }
.sp-pop .sp-h { margin-right: var(--sp-1); }
.sp-chip { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; color: var(--text); border: 1px solid var(--control-border); border-radius: var(--pill); font: 500 14px/1 var(--sans); }
.sp-pop a.sp-chip, .sp-pop a.sp-chip:hover { text-decoration: none; }
.sp-chip:hover { background: var(--surface-2); }
.sp-head[hidden], .sp-pop[hidden], .sp-prev[hidden], .search-hint[hidden] { display: none; }

/* the pane: the lit result, or (field empty) the shortcuts */
.sp-prev .eyebrow { margin: 0 0 var(--sp-3); }
.sp-id { display: flex; align-items: center; gap: var(--sp-3); margin-bottom: var(--sp-3); }
.sp-who { min-width: 0; }
.sp-t { margin: 0 0 6px; font: 600 22px/1.2 var(--display); letter-spacing: .015em; color: var(--text); text-wrap: balance; }
.sp-x { margin: 0 0 var(--sp-3); font-size: 14px; line-height: 1.5; color: var(--text-2); }
.sp-card { margin: 0 0 var(--sp-3); }
.sp-card .gc-box, .sp-card .tag { margin: 0; max-width: 100%; }
.sp-go { margin: var(--sp-2) 0 0; font-size: 13px; color: var(--text-3); max-width: none; }
.search-hint { margin: 0; padding: 0; max-width: none; font-size: 13px; line-height: 1.7; color: var(--text-3); }
.search-hint kbd { color: var(--text-2); }
.sp-list .search-hint { padding: 8px 12px 12px; }
.search-sw { display: block; margin: 10px 0 0; min-height: 32px; padding: 4px 0; font: inherit; color: var(--ember-soft); background: none; border: 0; cursor: pointer; text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--ember) 65%, transparent); text-underline-offset: .2em; }
.search-sw:hover { color: var(--text); text-decoration-color: currentColor; }
/* a phone has no keyboard to explain */
@media (hover: none) and (pointer: coarse) { .search-hint { display: none; } }
@media (max-width: 719px) { .search-pop { padding-top: 8vh; } .sp-list { max-height: 64vh; } }

/* ---- the page: content, with the wiki as a docs layout on wiki pages ---- */
.page { flex: 1 0 auto; width: 100%; max-width: var(--content); margin: 0 auto; padding: var(--sp-7) var(--gutter) var(--sp-9); }
.main { min-width: 0; }
.crumbs { margin-bottom: var(--sp-3); }
.crumbs .sep { color: var(--text-3); opacity: .6; margin: 0 4px; }
.crumbs .eyebrow, .crumbs.eyebrow { margin: 0 0 var(--sp-3); }
.subnav { display: flex; gap: var(--sp-2); flex-wrap: wrap; margin: var(--sp-1) 0 var(--sp-5); }
.subnav a { color: var(--text-2); border: 1px solid var(--border-strong); border-radius: var(--pill); padding: 6px 14px; font: 500 14px/1.2 var(--sans); }
.subnav a:hover { color: var(--text); }
.subnav a[aria-current="page"] { color: var(--text); background: var(--surface-2); border-color: rgba(255,214,180,.26); }
.sec { margin: 0; }
.ln { color: var(--ember-soft); }

.page.has-side { display: grid; grid-template-columns: 240px minmax(0, 1fr); column-gap: var(--sp-7); align-items: start; }
.side { position: sticky; top: calc(var(--header) + var(--sp-5)); max-height: calc(100vh - var(--header) - var(--sp-6)); overflow-y: auto; font-size: 14px; line-height: 1.4;
  padding-bottom: var(--sp-5); scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
.side-d > summary { display: none; }
.side-top { margin: 0 0 var(--sp-2); font: 600 15px/1.3 var(--sans); max-width: none; }
.side-top a { color: var(--text); }
.side-row { margin: var(--sp-5) 0 0; }
.side-h { margin: 0 0 var(--sp-2); font: 600 12px/1.3 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); max-width: none; }
.side ul { list-style: none; margin: 0; padding: 0; }
.side li { max-width: none; }
.side-row > ul { border-left: 1px solid var(--border); }
.side ul ul { margin: 0 0 4px; padding-left: var(--sp-3); }
.side a { display: block; color: var(--text-2); padding: 6px 0 6px var(--sp-3); margin-left: -1px; border-left: 1px solid transparent; }
.side ul ul a { padding-left: var(--sp-3); margin-left: calc(-1 * var(--sp-3) - 1px); padding-left: calc(var(--sp-3) * 2); }
.side a:hover { color: var(--text); }
.side a[aria-current="page"] { color: var(--text); font-weight: 600; border-left-color: var(--ember); }
.side-top a { padding: 0; margin: 0; border: 0; }
.side-top a:hover { text-decoration: underline; }
/* The wiki's side list on a wide screen (28 Nov 2026): it ran to 1,277 px in an 804 px box, so the lower rows sat under a scroll nobody saw.
   Now a topic shows its own pages only while you are in it, the rows are closer, and the list fades at its foot where there is more to
   scroll to. The phone's dropdown keeps every page. */
@media (min-width: 900px) {
  .side { -webkit-mask-image: linear-gradient(#000 calc(100% - 28px), transparent); mask-image: linear-gradient(#000 calc(100% - 28px), transparent); padding-bottom: var(--sp-6); }
  .side-row { margin-top: 14px; }
  .side-h { margin-bottom: 4px; }
  .side a { padding-top: 3.5px; padding-bottom: 3.5px; }
  .side-row li:not(.on) > ul { display: none; }
  .side ul ul { margin-bottom: 2px; }
}
/* "On this page": the page's h2s at 1200 and wider, the current one lit (site.js); under 1200 the same list is one row of chips under the
   lead (.onpage-in), swiped sideways on a phone so it stays one line */
.onpage { display: none; }
.onpage-in { margin: var(--sp-4) calc(-1 * var(--gutter)) var(--sp-2); }
.onpage-in .c-chips { flex-wrap: nowrap; overflow-x: auto; padding: 2px var(--gutter); scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.onpage-in .c-chips::-webkit-scrollbar { display: none; }
.onpage-in .c-chips > li { flex: none; }
.onpage-in .c-chip { white-space: nowrap; }
.onpage-in .eyebrow { margin: 0 var(--gutter) var(--sp-2); }
@media (min-width: 900px) { .onpage-in { margin-left: 0; margin-right: 0; } .onpage-in .c-chips { flex-wrap: wrap; overflow: visible; padding: 0; } .onpage-in .eyebrow { margin-left: 0; margin-right: 0; } }
.onpage ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--border); }
.onpage li { max-width: none; }
.onpage a { display: block; padding: 5px 0 5px var(--sp-3); margin-left: -1px; border-left: 1px solid transparent; color: var(--text-3); font-size: 14px; line-height: 1.4; }
.onpage a:hover { color: var(--text); }
.onpage a.on { color: var(--text); border-left-color: var(--ember); }

@media (min-width: 900px) and (max-width: 1199px) {
  .page.has-side { grid-template-columns: 220px minmax(0, 720px); column-gap: var(--sp-6); }
}
/* The docs layout (28 Nov 2026): the reading column was a fixed 720 px on every screen, so a 1920 px monitor left most of itself empty, the
   compare tables ran out of the column and a gallery showed three a row. From 1200 px it now grows with the window, to 912 px at 1440 and
   1008 px at 1680 and wider; prose keeps its 68ch measure inside it, and tables, tiles and galleries take the room. --docs is the whole
   page's width, which the header and footer follow so the logo stays over the sidebar. */
@media (min-width: 1200px) {
  :root { --docs: 1424px; }
  .page.has-side { max-width: var(--docs); grid-template-columns: 232px minmax(0, 1fr) 200px; column-gap: var(--sp-6); }
  .onpage { display: block; position: sticky; top: calc(var(--header) + var(--sp-5)); max-height: calc(100vh - var(--header) - var(--sp-6)); overflow-y: auto; }
  .onpage-in { display: none; }
  .onpage .eyebrow { margin-bottom: var(--sp-3); }
}
@media (min-width: 1680px) {
  :root { --docs: 1520px; }
}

/* ---- buttons (BRAND.md section 3): 44 high, radius 12; exactly one primary per screen ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2); height: 44px; padding: 0 20px; font: 600 15px/1 var(--sans); border-radius: var(--radius-sm);
  border: 1px solid transparent; cursor: pointer; white-space: nowrap;
  transition: background-color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), box-shadow var(--t-mid) var(--ease), color var(--t-fast) var(--ease); }
.btn-primary { background: var(--ember); color: #1A0D05; }
.btn-primary:hover { background: var(--ember-hover); box-shadow: 0 8px 24px rgba(255,106,26,.28); }
.btn-secondary, .btn-outline, .btn-ghost { background: transparent; color: var(--text); border-color: var(--border-strong); }
.btn-secondary:hover, .btn-outline:hover, .btn-ghost:hover { border-color: rgba(255,214,180,.3); background: var(--surface); }
.btn-tertiary { background: none; color: var(--ember-soft); padding: 0 8px; }
.btn-tertiary:hover { color: var(--text); }

/* ---- body helpers ---- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(var(--min, 260px), 100%), 1fr)); gap: var(--sp-4); margin: var(--sp-4) 0 var(--sp-5); }
/* cards: surface, a hairline border, radius 16, padding 24; links lift 2px on hover */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: var(--sp-5); box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
  transition: transform var(--t-mid) var(--ease), border-color var(--t-mid) var(--ease), box-shadow var(--t-mid) var(--ease); }
a.card:hover, .card.lift:hover { border-color: var(--border-strong); transform: translateY(-2px); box-shadow: var(--shadow-lift), inset 0 1px 0 rgba(255,255,255,.04); }
/* stat figures: the number in Tektur 800 with tabular figures, a small label under it, on the ground between two hairlines (28 Nov 2026: no
   boxes; the same strip as components.css .c-stats). `.stat-row` is the one row container (`.stats` is the same rule under its older name).
   The strip is pulled left by one cell's padding and clipped, so the first figure of each row starts at the page's edge and has no rule
   before it. Two across on a phone, three from 560px (a row of two or four stays in twos), four across for four from 720px, and five or six
   in one row from 1000px. */
.stat-row, .stats { --k: 2; --pad: 16px; display: grid; grid-template-columns: repeat(var(--k), minmax(0, 1fr)); gap: 0; margin: var(--sp-5) 0 var(--sp-6) calc(-1px - var(--pad));
  border-top: 1px solid var(--border-strong); border-bottom: 1px solid var(--border-strong); overflow: clip; clip-path: inset(0 0 0 calc(1px + var(--pad))); }
.stat-row > *, .stats > * { min-width: 0; }
.stat-tile { display: flex; flex-direction: column; gap: 2px; margin-bottom: -1px; padding: 14px var(--pad) 13px; border-left: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.stat-tile .stat-n { font-size: 22px; line-height: 1.2; letter-spacing: 0; overflow-wrap: anywhere; }
.stat-tile .stat-l { font-size: 13px; line-height: 1.4; color: var(--text-3); }
@media (min-width: 560px) {
  .stat-row, .stats { --k: 3; --pad: 20px; }
  .stat-row:has(> :nth-child(2):last-child), .stats:has(> :nth-child(2):last-child), .stat-row:has(> :nth-child(4):last-child), .stats:has(> :nth-child(4):last-child) { --k: 2; }
  .stat-tile .stat-n { font-size: 26px; }
}
@media (min-width: 720px) {
  .stat-row:has(> :nth-child(4):last-child), .stats:has(> :nth-child(4):last-child) { --k: 4; }
}
@media (min-width: 1000px) {
  .stat-row, .stats { --pad: 24px; }
  .stat-row:has(> :nth-child(5):last-child), .stats:has(> :nth-child(5):last-child) { --k: 5; }
  .stat-row:has(> :nth-child(6):last-child), .stats:has(> :nth-child(6):last-child) { --k: 6; }
  .stat-tile .stat-n { font-size: 28px; }
  .stat-row:has(> :nth-child(5)) .stat-n, .stats:has(> :nth-child(5)) .stat-n { font-size: 24px; }
}

/* ---- facts, meta pills and the hugging card grid: the web-UI forms of the game card's "* bullet" and "> SECTION" grammar ----
   `dl.facts`        a definition list of label and value, used wherever a game card has "* Label: value" lines or a "> SECTION" block.
                      <dl class="facts"><dt>Refill</dt><dd>every 3 days</dd> ... </dl>, or each pair wrapped in a <div>. dt is a 13px --text-3 label in a ~160px
                      left column, aligned to the top; dd is --text on the right; hairlines between rows. Stacks (label over value) below 560px.
                      No asterisks, arrows or brackets: the section name is an h3 or an eyebrow above the list.
   `.meta-pills`     a wrapping row of pills under a page header (<ul class="meta-pills"><li class="pill">Mining</li> ...</ul> or a div of spans);
                      same row as `.meta`, and its children may be links.
   `.cards-hug`      add to a card grid (beside .grid, or on its own) for cards that keep their own height instead of stretching to the tallest in the row;
                      the equal-height default of `.grid` is untouched. */
dl.facts { display: grid; grid-template-columns: 160px minmax(0, 1fr); column-gap: var(--sp-5); margin: var(--sp-3) 0 var(--sp-5); }
dl.facts > div { display: contents; }
dl.facts dt, dl.facts dd { margin: 0; padding: 10px 0; border-top: 1px solid var(--border); max-width: none; }
dl.facts dt { font: 500 13px/1.5 var(--sans); color: var(--text-3); padding-top: 14px; }
dl.facts dd { color: var(--text); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
dl.facts > :nth-last-child(-n+2):is(dt, dd), dl.facts > div:last-child > * { border-bottom: 1px solid var(--border); }
.meta-pills { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); margin: 0 0 var(--sp-6); padding: 0; list-style: none; max-width: none; }
.meta-pills > * { margin: 0; max-width: none; }
.cards-hug { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); align-items: start; grid-auto-flow: dense; gap: var(--sp-4); margin: var(--sp-4) 0 var(--sp-5); }
.cards-hug > * { min-width: 0; }

/* tables: an eyebrow header, 48 px rows, hairlines only, no outer box, numbers right-aligned in tabular Geist */
.tbl { overflow-x: auto; margin: var(--sp-4) 0 var(--sp-5); }
.tbl table, .main table { border-collapse: collapse; width: 100%; font-size: 15px; }
.tbl th, .tbl td, .main table th, .main table td { text-align: left; padding: 0 var(--sp-4); height: 48px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl tbody td, .main table tbody td { padding-top: 10px; padding-bottom: 10px; }
.tbl th:first-child, .tbl td:first-child, .main table th:first-child, .main table td:first-child { padding-left: 0; }
.tbl th:last-child, .tbl td:last-child, .main table th:last-child, .main table td:last-child { padding-right: 0; }
.tbl th, .main table th { font: 600 12px/1.35 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); height: 40px; border-bottom-color: var(--border-strong); white-space: nowrap; }
.tbl tbody tr:hover td, .main table tbody tr:hover td { background: var(--surface-2); }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .num, .main table .num { text-align: right; white-space: nowrap; }
/* tabular figures so columns of numbers line up; :where() keeps this at the lowest specificity, so a cell that is deliberately code can set its own face */
:where(.tbl, .main table) :is(td, th) { font-family: var(--sans); font-variant-numeric: tabular-nums; }
.tbl .num, .main table .num, .main table .mono, .tbl .mono { font-family: var(--sans); font-variant-numeric: tabular-nums; }
.chips { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin: var(--sp-2) 0 var(--sp-3); }
.chip { font: 500 14px/1 var(--sans); color: var(--text-2); background: none; border: 1px solid var(--border-strong); border-radius: var(--pill); height: 36px; padding: 0 14px; cursor: pointer;
  transition: background-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease); }
.chip:hover { color: var(--text); }
.chip[aria-pressed="true"] { color: var(--text); background: var(--surface-2); border-color: rgba(255,214,180,.3); }

/* ---- the web card: lists and grids in the card grammar ---- */
.wc { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: var(--sp-5); font-size: 15px; line-height: 1.5; min-width: 0;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04); transition: transform var(--t-mid) var(--ease), border-color var(--t-mid) var(--ease), box-shadow var(--t-mid) var(--ease); }
.wc:has(.wc-name a):hover { border-color: var(--border-strong); transform: translateY(-2px); box-shadow: var(--shadow-lift), inset 0 1px 0 rgba(255,255,255,.04); }
.wc--mining { box-shadow: inset 3px 0 0 var(--trade-mining); }
.wc--fishing { box-shadow: inset 3px 0 0 var(--trade-fishing); }
.wc--farming { box-shadow: inset 3px 0 0 var(--trade-farming); }
.wc--gathering { box-shadow: inset 3px 0 0 var(--trade-gathering); }
.wc-head { display: flex; gap: var(--sp-3); align-items: center; margin-bottom: var(--sp-2); }
.wc-head > div { min-width: 0; }
.wc-name { font-weight: 600; font-size: 18px; line-height: 1.3; letter-spacing: .015em; margin: 0; }
.wc-name a { color: var(--text); }
.wc-tag { display: flex; flex-wrap: wrap; align-items: center; gap: 6px var(--sp-2); margin: 6px 0 0; color: var(--text-2); font-size: 13px; }
.br { color: var(--text-3); }
.wc-sec { margin-top: var(--sp-3); }
.wc-sec > :first-child { font: 600 12px/1.35 var(--sans); letter-spacing: .1em; color: var(--text-3); margin: 0 0 4px; }
.wc-sec ul { list-style: none; margin: 0; padding: 0; }
.wc-sec li { margin: 0; overflow-wrap: anywhere; max-width: none; }
.st, .co { color: var(--chits); }
.lb { color: var(--text-2); }
.vl { color: var(--text); }
.tx { color: var(--text-2); }
.wc-foot { margin: var(--sp-3) 0 0; color: var(--text-3); font-size: 14px; }
.wc-foot.go { color: var(--ember-soft); }
.wc-foot.ok { color: var(--xp); }
.wc-foot.no { color: var(--mc-red); }

/* ---- the icon slot: a cell of static/gen/icons.png (96 px cells, 8 a row, shown at --s) ---- */
.ic { position: relative; display: inline-block; flex: none; width: var(--s, 48px); height: var(--s, 48px); border-radius: 8px; vertical-align: middle;
  background-color: var(--surface-2); box-shadow: inset 0 0 0 1px var(--border); image-rendering: pixelated; }
.ic:not(.ic-off) { background-image: url(/static/gen/icons.png); background-repeat: no-repeat; background-size: calc(8 * var(--s, 48px)) auto;
  background-position: calc(var(--x, 0) * var(--s, 48px) * -1) calc(var(--y, 0) * var(--s, 48px) * -1); }
.ic-glint::after { content: ""; position: absolute; inset: 0; pointer-events: none; background-image: url(/static/gen/glint.png); background-size: 256px 256px;
  mix-blend-mode: plus-lighter; opacity: .7; animation: glint 6s linear infinite;
  -webkit-mask-image: url(/static/gen/icons.png); mask-image: url(/static/gen/icons.png); -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  -webkit-mask-size: calc(8 * var(--s, 48px)) auto; mask-size: calc(8 * var(--s, 48px)) auto;
  -webkit-mask-position: calc(var(--x, 0) * var(--s, 48px) * -1) calc(var(--y, 0) * var(--s, 48px) * -1); mask-position: calc(var(--x, 0) * var(--s, 48px) * -1) calc(var(--y, 0) * var(--s, 48px) * -1); }
@keyframes glint { from { background-position: 0 0; } to { background-position: -256px 256px; } }

/* ---- the game card: crisp pixels inside soft chrome. card.js draws it in the game font; this is the HTML fallback ---- */
.gc { margin: var(--sp-3) 0 var(--sp-5); display: flex; gap: var(--sp-3); align-items: flex-start; flex-wrap: wrap; max-width: 100%; }
.gc-icon { flex: none; padding-top: 6px; }
.gc-icon:has(> .ic-off:only-child) { display: none; }
.gc figcaption { flex-basis: 100%; color: var(--text-2); font-size: 14px; max-width: var(--read); }
.grid > .gc { margin: 0; }
.gc-box { display: inline-flex; flex-direction: column; max-width: 100%; overflow-x: auto; padding: 8px 10px; background: var(--tip-bg);
  border: 2px solid transparent; border-radius: 2px; background-clip: padding-box;
  box-shadow: 0 0 0 2px var(--tip-bg), inset 0 2px 0 var(--tip-top), inset 0 -2px 0 var(--tip-bottom), inset 2px 0 0 rgba(60,0,190,.314), inset -2px 0 0 rgba(60,0,190,.314);
  font: 14px/1.5 var(--mono); }
.gl { display: block; white-space: pre; min-height: 1.5em; }
.gl > span { text-shadow: .12em .12em 0 #0008; text-shadow: .12em .12em 0 color-mix(in srgb, currentColor 25%, black); }
.gl .b { font-weight: 700; }
.gl .i { font-style: italic; }
.gl .s { text-decoration: line-through; }
.gl .u { text-decoration: underline; }
.gl .s.u { text-decoration: line-through underline; }
.gl.rule > span { text-decoration: line-through; text-decoration-thickness: 2px; letter-spacing: -.1em; }
.gc-box.drawn { background: none; box-shadow: none; padding: 0; border: 0; overflow: visible; }
.gc-box.drawn > .gl, .tag.drawn > .gl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); }
.gc-box, .tag, .wm-gc { position: relative; }
.gc-box canvas, .tag canvas, .wm-gc canvas { display: block; image-rendering: pixelated; }
.wm-gc { display: inline-block; line-height: 0; }

/* the hologram tag over an NPC: lines centred and shadowed, no box */
.tag { display: inline-flex; flex-direction: column; align-items: center; text-align: center; padding: 10px 16px; margin: var(--sp-2) 0 var(--sp-4);
  background: radial-gradient(closest-side, rgba(0,0,0,.35), transparent); font: 15px/1.45 var(--mono); }

/* a badge: [Name] in its gradient */
.badge { font-family: var(--mono); font-size: .92em; white-space: nowrap; }

/* spoilers: a fold that opens on a click, with or without JS */
.spoiler { border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); padding: 6px 12px; margin: 10px 0; }
.spoiler > summary { cursor: pointer; color: var(--text-2); font-size: 14px; }
.spoiler[open] > summary { margin-bottom: var(--sp-2); }
.spl { position: relative; display: inline; cursor: pointer; }
.spl-t { position: absolute; opacity: 0; width: 1px; height: 1px; }
.spl-l { color: var(--text-2); border: 1px dashed var(--border-strong); border-radius: 6px; padding: 0 6px; font-size: .9em; }
.spl-c { display: none; }
.spl-t:checked ~ .spl-l { display: none; }
.spl-t:checked ~ .spl-c { display: inline; }
.spl-t:focus-visible ~ .spl-l { outline: 2px solid var(--ember); outline-offset: 2px; }

/* tiles: a left-aligned grid under its heading (the wiki index and every hub); the icon sits beside the name and its line */
.tiles { list-style: none; margin: var(--sp-3) 0 var(--sp-5); padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(230px, 100%), 1fr)); gap: var(--sp-3); justify-content: start; }
.tiles li { margin: 0; max-width: none; min-width: 0; }
.tile { display: grid; grid-template-columns: minmax(0, 1fr); align-content: center; column-gap: var(--sp-3); row-gap: 1px; height: 100%; padding: var(--sp-4) var(--sp-5); text-align: left;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
  transition: transform var(--t-mid) var(--ease), border-color var(--t-mid) var(--ease), box-shadow var(--t-mid) var(--ease); }
.tile:hover { border-color: var(--border-strong); transform: translateY(-2px); box-shadow: var(--shadow-lift), inset 0 1px 0 rgba(255,255,255,.04); }
.tile:has(> .ic:not(.ic-off)) { grid-template-columns: auto minmax(0, 1fr); }
.tile > .ic:not(.ic-off) { grid-row: 1 / 3; align-self: center; }
.tile:has(> .ic:not(.ic-off)) > .tt { grid-column: 2; align-self: end; }
.tile:has(> .ic:not(.ic-off)) > .tl { grid-column: 2; align-self: start; }
.tt { font-weight: 600; font-size: 18px; line-height: 1.3; letter-spacing: .015em; }
.tl { color: var(--text-3); font-size: 14px; line-height: 1.45; }

/* video: plays only when visible (site.js), never under reduced motion */
.loop { width: 100%; border-radius: var(--radius); border: 1px solid rgba(255,255,255,.06); background: #000; }

/* ---- the footer (E6): the logo, then Play, Wiki, Community and House in four columns; Geist only ---- */
.ft { border-top: 1px solid var(--border); background: var(--bg-raised); color: var(--text-3); font: 400 14px/1.5 var(--sans); }
.ft-in { max-width: var(--content); margin: 0 auto; padding: var(--sp-7) var(--gutter) var(--sp-6); }
.ft-cols { display: grid; grid-template-columns: 136px repeat(4, minmax(0, 1fr)); gap: var(--sp-6) var(--sp-5); align-items: start; }
.ft-brand { display: block; width: 120px; line-height: 0; }
.ft .wm-logo.wm-sm { width: 120px; height: auto; }
.ft-col { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; }
.ft-h { margin: 0 0 var(--sp-2); font: 600 12px/1.3 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); }
.ft-nav a { display: inline-flex; align-items: center; min-height: 32px; padding: 2px 0; font: 500 15px/1.4 var(--sans); color: var(--text-2); }
.ft-nav a:hover { color: var(--text); }
.ft-addr { display: flex; flex-wrap: wrap; align-items: center; gap: 4px var(--sp-3); margin: 0; padding: 2px 0; font: 500 15px/1.4 var(--sans); color: var(--text-2); }
.ft-addr > span { user-select: all; overflow-wrap: anywhere; }
.ft-copy { min-height: 32px; padding: 0 12px; font: 500 14px/1 var(--sans); color: var(--text-2); background: none; border: 1px solid var(--border); border-radius: 999px; cursor: pointer; }
.ft-copy:hover { color: var(--text); border-color: var(--control-border-hover); }
.ft-copy.done { color: var(--xp); border-color: var(--xp); }
.ft-live { display: contents; }
.ft-state { display: flex; align-items: center; gap: var(--sp-2); margin: var(--sp-2) 0 0; font: 400 14px/1.4 var(--sans); color: var(--text-2); }
.ft-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); }
.ft-dot-on { background: var(--xp); box-shadow: 0 0 0 3px rgba(134,239,172,.16); }
.ft-built { margin: var(--sp-1) 0 0; font: 400 14px/1.4 var(--sans); color: var(--text-3); }
.ft-base { margin-top: var(--sp-6); padding-top: var(--sp-4); border-top: 1px solid var(--border); }
.ft-beta { margin: 0 0 var(--sp-3); max-width: var(--read); }
.ft-beta p { margin: 0; }
.ft-small { font-size: 13px; margin: 6px 0 0; max-width: none; }
@media (max-width: 900px) {
  .ft-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-5) var(--sp-4); }
  .ft-brand, .ft-house { grid-column: 1 / -1; }
  .ft-nav a { min-height: 44px; padding: 0; }
  .ft-addr { padding: 10px 0; }
  .ft-copy { min-height: 44px; padding: 0 16px; }
}

.miss code { overflow-wrap: anywhere; }

/* ---- the logo (Ross's artwork): 28 px tall in the header, 40 in the footer, never recoloured ---- */
.wm-logo { display: block; width: auto; height: 38px; }
.hd .wm-logo { height: 28px; }
.wm-logo.wm-sm { height: 40px; }
.fr-h1 .wm-logo { width: min(760px, 92vw); height: auto; margin: 0 auto; filter: drop-shadow(0 6px 24px rgba(0,0,0,.55)); }

/* ---- tablets and phones: below 900 the header folds into a menu and the wiki nav into the "Wiki pages" sheet ---- */
@media (max-width: 1100px) {
  .sb .sb-t { display: none; }
}
@media (max-width: 900px) {
  .hd-in { gap: var(--sp-3); }
  .menu-btn { display: inline-grid; }
  html.js .sheet { display: none; position: absolute; left: 0; right: 0; top: var(--header); flex-direction: column; align-items: stretch; gap: var(--sp-4);
    padding: var(--sp-3) var(--gutter) var(--sp-5); background: var(--bg); border-bottom: 1px solid var(--border); box-shadow: 0 24px 48px rgba(0,0,0,.6); max-height: calc(100vh - var(--header)); max-height: calc(100dvh - var(--header)); overflow-y: auto; }
  html.js .sheet.open { display: flex; }
  html:not(.js) .hd { height: auto; position: static; }
  html:not(.js) .hd-in { flex-wrap: wrap; padding-top: var(--sp-2); padding-bottom: var(--sp-2); }
  html:not(.js) .sheet { flex-wrap: wrap; }
  /* without JS the tools row sits in the wrapping header: let it shrink to the page (its search and address pill wrap), not run past the edge */
  html:not(.js) .hd-tools { flex: 0 1 auto; }
  .nav { flex-direction: column; align-self: auto; gap: 0; }
  .nav a { height: 48px; padding: 0 4px; font-size: 17px; border-bottom: 1px solid var(--border); }
  .nav a[aria-current="page"]::after { left: 4px; right: auto; width: 24px; }
  .hd-tools { flex-wrap: wrap; }
  .sb .sb-t { display: inline; }
  .page.has-side { display: block; }
  /* the wiki's page list on a phone (28 Nov 2026): one quiet ruled row over the page, where a boxed control stood before the page's own name */
  .side { position: static; max-height: none; margin-bottom: var(--sp-4); padding: 0; overflow: visible; border-bottom: 1px solid var(--border); }
  .side-d > summary { display: flex; align-items: center; justify-content: space-between; cursor: pointer; min-height: 44px; padding: 0; font: 600 14px var(--sans); color: var(--text-2); list-style: none; }
  .side-d > summary::-webkit-details-marker { display: none; }
  .side-d > summary::after { content: ""; width: 8px; height: 8px; border: solid var(--text-2); border-width: 0 1.75px 1.75px 0; transform: rotate(45deg) translate(-2px, -2px); transition: transform var(--t-mid) var(--ease); }
  .side-d[open] > summary::after { transform: rotate(-135deg); }
  .side-d[open] > summary { border-bottom: 1px solid var(--border); }
  .side-d > :not(summary) { margin-left: 0; margin-right: 0; }
  .side-d > .side-top { margin-top: var(--sp-3); }
  .side-d > .side-row:last-child { padding-bottom: var(--sp-3); }
}
@media (min-width: 900px) and (max-width: 971px) {
  .page.has-side .stat-row:has(> :nth-child(4):last-child), .page.has-side .stats:has(> :nth-child(4):last-child) { --k: 2; }
}
@media (max-width: 559px) {
  dl.facts { grid-template-columns: minmax(0, 1fr); }
  dl.facts dt { border-bottom: 0; padding-bottom: 0; padding-top: 12px; }
  dl.facts dd { border-top: 0; padding-top: 2px; }
  dl.facts > :nth-last-child(-n+2):is(dt, dd) { border-bottom: 0; }
  dl.facts > dd:last-child, dl.facts > div:last-child > dd { border-bottom: 1px solid var(--border); }
}
@media (max-width: 760px) {
  .page { padding-top: var(--sp-6); padding-bottom: var(--sp-8); }
  h2 { margin-top: 48px; font-size: 26px; }
  .lead, .main .lead { font-size: 18px; }
  .grid { grid-template-columns: 1fr; }
  .wc { padding: var(--sp-4) var(--sp-5); }
}
@media (max-width: 480px) {
  body { font-size: 16px; }
  .gc-box { font-size: 12px; }
  .addr { max-width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .wc:has(.wc-name a):hover, a.card:hover, .tile:hover { transform: none; }
}

/* ---- smooth page changes: cross-document View Transitions, CSS only (the h1 keeps one name so it glides, the rest fades in 160 ms) ---- */
@view-transition { navigation: auto; }
.main h1 { view-transition-name: page-title; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .16s; animation-timing-function: ease-out; }
::view-transition-group(page-title) { animation-duration: .22s; animation-timing-function: var(--ease); }
@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}

/* ---- the Updates dot: site.js unhides it while an update is newer than the reader's last visit; it never moves or flashes ---- */
.nav .dot { position: relative; display: inline-block; width: 7px; height: 7px; margin: 0 0 0 6px; vertical-align: top; border-radius: 50%; background: var(--ember); }
.nav .dot[hidden] { display: none; }



/* back to the top (site.js makes the button): a round button in the corner of a long page, under the header and every popover */
.totop { position: fixed; right: max(16px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom)); z-index: 19; display: grid; place-items: center;
  width: 44px; height: 44px; padding: 0; color: var(--text); background: color-mix(in srgb, var(--surface-2) 92%, transparent); border: 1px solid var(--border-strong);
  border-radius: 50%; box-shadow: 0 6px 20px rgba(0, 0, 0, .45); cursor: pointer; transition: border-color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease); }
.totop[hidden] { display: none; }
.totop:hover { border-color: var(--ember); transform: translateY(-2px); }
.totop:focus-visible { outline: 2px solid var(--ember); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .totop { transition: none; } .totop:hover { transform: none; } }
@media print { .totop { display: none; } }
