/* ============================================================================
   doshaven.com — live theme stylesheet
   ----------------------------------------------------------------------------
   Built from design/tokens.css + design/site.css, followed by the components
   that exist only in the site theme (FAQ keys, game-page placard, the
   real download overlay, the /arcade band, the two-column hero). The engine
   serves this single file; there is no second stylesheet.

   Visual direction: retro-futurism + Fallout vault terminal.
   Editing this file = changing the look of the whole site. Hard-coding
   colors / sizes / fonts in HTML is not allowed. Media-query bounds cannot
   read these variables; the component layer writes 767px and 479px, one
   pixel below --bp-md and --bp-sm.

   Design principles:
     · Dark base + amber phosphor monochrome; green only for status,
       red only for alerts
     · Structure is expressed with panels + brackets + rules — not with
       rounded corners or soft shadows
     · Retro but not actually old: terminal monospace + modern typographic
       rhythm + a few hazard stripes
     · Tokens come in three layers: raw palette → semantic → components
   ========================================================================== */

:root {
  /* --------------------------------------------------------------------------
     1. Spacing scale (4px grid)
     -------------------------------------------------------------------------- */
  --px: 4px;

  --sp-1: calc(var(--px) * 1);                 /*  4px */
  --sp-2: calc(var(--px) * 2);                 /*  8px */
  --sp-3: calc(var(--px) * 3);                 /* 12px */
  --sp-4: calc(var(--px) * 4);                 /* 16px */
  --sp-5: calc(var(--px) * 5);                 /* 20px */
  --sp-6: calc(var(--px) * 6);                 /* 24px */
  --sp-8: calc(var(--px) * 8);                 /* 32px */
  --sp-10: calc(var(--px) * 10);               /* 40px */
  --sp-12: calc(var(--px) * 12);               /* 48px */
  --sp-16: calc(var(--px) * 16);               /* 64px */

  /* --------------------------------------------------------------------------
     2. Raw palette — "Vault Terminal"
        Real hex values appear only in this layer; components use semantics.
     -------------------------------------------------------------------------- */
  --vault-void:      #0a0906;   /* page base: warm near-black */
  --vault-panel:     #12100b;   /* panel surface */
  --vault-panel-2:   #191610;   /* raised surface (cards / strips) */
  --vault-screen:    #080704;   /* CRT screen well */
  --vault-black:     #000000;   /* pure black (edges / shadows) */

  --vault-amber:     #ffb000;   /* primary phosphor: terminal main color */
  --vault-amber-hi:  #ffd166;   /* bright amber: headings / focus */
  --vault-amber-dim: #8a5f00;   /* dim amber: secondary emphasis */
  --vault-amber-mid: #a87800;   /* mid amber: brackets / dividers */

  --vault-green:     #9ee34b;   /* status OK */
  --vault-red:       #ff5a3c;   /* alert / HOT */

  --vault-ink:       #e6d8ba;   /* body text (warm white, readability first) */
  --vault-ink-hi:    #ffe7bd;   /* headings / emphasized text */
  --vault-ink-dim:   #a2916a;   /* secondary text */
  --vault-ink-faint: #6b5f45;   /* faint text (placeholders, notes) */

  --vault-edge:      #3d3218;   /* panel border */
  --vault-edge-soft: #241d10;   /* softer divider */

  /* --------------------------------------------------------------------------
     3. Semantic colors — components use only this layer
     -------------------------------------------------------------------------- */
  --bg-desktop:      var(--vault-void);      /* page base (sticky top bar must use this) */
  --bg-panel:        var(--vault-panel);     /* panel surface */
  --bg-panel-raised: var(--vault-panel-2);   /* raised surface */
  --bg-screen:       var(--vault-screen);    /* screen well */
  --bg-inset:        #060503;                /* inset slot (forms / progress bars) */

  --text-strong:     var(--vault-ink-hi);
  --text-body:       var(--vault-ink);
  --text-muted:      var(--vault-ink-dim);
  --text-faint:      var(--vault-ink-faint);

  --text-accent:     var(--vault-amber);     /* primary terminal text color */
  --text-accent-hi:  var(--vault-amber-hi);
  --text-ok:         var(--vault-green);
  --text-alert:      var(--vault-red);

  --accent:          var(--vault-amber);
  --accent-hi:       var(--vault-amber-hi);
  --accent-dim:      var(--vault-amber-mid);

  --edge:            var(--vault-edge);      /* panel border */
  --edge-soft:       var(--vault-edge-soft); /* divider */
  --edge-strong:     var(--vault-amber-mid); /* brackets / emphasis border */

  --btn-text:        var(--vault-amber);
  --btn-text-on:     var(--vault-void);      /* text on amber fills */
  --btn-face:        transparent;
  --btn-face-hover:  var(--vault-amber);

  --link:            var(--vault-amber);
  --link-hover:      var(--vault-amber-hi);

  --focus:           var(--vault-amber-hi);  /* focus ring */

  /* Translucent overlays (no color literals in site.css) */
  --tint-amber:      rgba(255, 176, 0, 0.08);
  --tint-amber-mid:  rgba(255, 176, 0, 0.16);
  --tint-amber-hard: rgba(255, 176, 0, 0.30);
  --tint-black:      rgba(0, 0, 0, 0.55);
  --tint-black-hard: rgba(0, 0, 0, 0.78);
  --screen-fade:     rgba(0, 0, 0, 0.92);

  /* --------------------------------------------------------------------------
     4. Font stacks — terminal monospace + geometric display
        All Latin glyphs (the site UI is English); system fallbacks keep it
        readable offline.
     -------------------------------------------------------------------------- */
  /* Display: brand, headings, buttons — angular sci-fi geometry */
  --font-display: "Oxanium", "Avenir Next Condensed", "Helvetica Neue", system-ui, sans-serif;
  /* Terminal monospace: body, labels, metadata */
  --font-mono: "Share Tech Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace;

  --fs-display: clamp(30px, 7vw, 52px);
  --fs-h1: clamp(24px, 4.6vw, 34px);
  --fs-h2: 22px;
  --fs-h3: 17px;
  --fs-body: 15px;
  --fs-small: 13px;
  --fs-tiny: 12px;
  --fs-label: 12px;

  --lh-tight: 1.15;
  --lh-snug: 1.55;     /* secondary copy: card blurbs, jump text */
  --lh-body: 1.72;

  --ls-wide: 0.18em;    /* letter-spacing for terminal labels */
  --ls-mid: 0.08em;

  /* --------------------------------------------------------------------------
     5. Borders / shadows
     -------------------------------------------------------------------------- */
  --bw: 1px;                 /* standard border */
  --bw-strong: 2px;          /* emphasis border / buttons */
  --radius: 0px;             /* terminals have no rounded corners */
  --radius-pill: 999px;      /* only for genuinely round elements like status dots */

  --shadow-hard: 4px 4px 0 var(--vault-black);   /* hard shadow (no blur) */
  --shadow-hard-sm: 2px 2px 0 var(--vault-black);
  --shadow-glow: 0 0 18px rgba(255, 176, 0, 0.12); /* in-screen glow */

  /* Panel brackets (L-shaped corners) for key "device panel" blocks */
  --bracket-size: 14px;

  /* Component sizes that are not on the 4px grid (intrinsic asset sizes,
     one-off controls). Named here so site.css stays free of literals. */
  --size-icon-sm: 16px;   /* title-bar / taskbar mark */
  --size-icon-md: 32px;   /* header brand mark */
  --size-cover-w: 128px;  /* placeholder cover intrinsic width */
  --size-cover-h: 96px;   /* placeholder cover intrinsic height */
  --size-az: 34px;        /* A–Z index cell, desktop */
  --size-az-sm: 30px;     /* A–Z index cell, below --bp-sm */
  --size-wbtn: 10px;      /* decorative window control square */
  --size-card-min: 230px; /* catalog card min column */
  --size-jump-min: 210px; /* related-page card min column */
  --size-place-min: 240px;/* placeholder checklist item min column */
  --size-notes-k: 170px;  /* notes label column */
  --size-ledger-min: 520px; /* ledger table min width before it scrolls */
  --size-form-max: 560px;   /* comment form column */
  --size-stage-img: 256px;  /* stage cover max width */
  --size-stage-img-min: 160px; /* stage cover min width */
  --size-bar-w: 280px;      /* loading bar width */
  --size-bar-h: 12px;       /* loading bar height */
  --size-bar-inset: 2px;    /* loading bar inner offset */
  --size-bar-step: 17px;    /* hazard stripe period (6px stripe + 12px gap, off by 1 to avoid a seam) */
  --size-hazard-h: 5px;     /* taskbar hazard stripe height */
  --size-btn-min: 36px;     /* button min height — touch target */
  --size-glow: 48px;        /* stage inset glow radius */
  --bracket-corners:
    linear-gradient(var(--edge-strong), var(--edge-strong)) left top / var(--bracket-size) var(--bw) no-repeat,
    linear-gradient(var(--edge-strong), var(--edge-strong)) left top / var(--bw) var(--bracket-size) no-repeat,
    linear-gradient(var(--edge-strong), var(--edge-strong)) right top / var(--bracket-size) var(--bw) no-repeat,
    linear-gradient(var(--edge-strong), var(--edge-strong)) right top / var(--bw) var(--bracket-size) no-repeat,
    linear-gradient(var(--edge-strong), var(--edge-strong)) left bottom / var(--bracket-size) var(--bw) no-repeat,
    linear-gradient(var(--edge-strong), var(--edge-strong)) left bottom / var(--bw) var(--bracket-size) no-repeat,
    linear-gradient(var(--edge-strong), var(--edge-strong)) right bottom / var(--bracket-size) var(--bw) no-repeat,
    linear-gradient(var(--edge-strong), var(--edge-strong)) right bottom / var(--bw) var(--bracket-size) no-repeat;

  /* Hazard stripes (Vault-Tec style), decoration only — never carries meaning */
  --hazard: repeating-linear-gradient(
    45deg,
    var(--vault-amber) 0 6px,
    transparent 6px 12px
  );

  /* --------------------------------------------------------------------------
     6. z-index layers
     -------------------------------------------------------------------------- */
  --z-window: 1;      /* panels / cards */
  --z-chrome: 10;     /* sticky top bar */
  --z-vignette: 38;   /* CRT vignette */
  --z-scanlines: 40;  /* CRT scanlines */
  --z-skip: 60;       /* skip link */

  /* --------------------------------------------------------------------------
     7. Focus state
     -------------------------------------------------------------------------- */
  --focus-outline: 2px solid var(--focus);
  --focus-offset: 2px;

  /* --------------------------------------------------------------------------
     8. Layout & breakpoints
     -------------------------------------------------------------------------- */
  --layout-max: 1180px;
  /* Media queries cannot read custom properties, so the queries in site.css
     use these numbers literally. The query bound is one pixel below the
     token so a viewport exactly at the token still gets the wider layout:
       max-width: 767px  ==  below --bp-md (768px)
       max-width: 479px  ==  below --bp-sm (480px) */
  --bp-sm: 480px;
  --bp-md: 768px;
  --bp-lg: 1180px;

  /* --------------------------------------------------------------------------
     8b. Measure — readable line lengths (character units, not pixels)
     -------------------------------------------------------------------------- */
  --measure: 76ch;        /* body copy */
  --measure-lead: 64ch;   /* page-head lead */
  --measure-note: 52ch;   /* short notes / captions */
  --measure-hero: 62ch;   /* hero lead */

  /* --------------------------------------------------------------------------
     9. CRT layer — ON by default (the vault terminal is the core of this look)
        Toggled via body.crt in site.js; state in localStorage: doshaven:crt = '1' | '0'
     -------------------------------------------------------------------------- */
  --crt-scan-alpha: 0.16;      /* scanline opacity */
  --crt-vignette-alpha: 0.42;  /* vignette opacity */
  --crt-glow: 0 0 6px rgba(255, 176, 0, 0.55), 0 0 14px rgba(255, 176, 0, 0.25);
  --crt-glow-soft: 0 0 4px rgba(255, 176, 0, 0.45);
  --crt-scan-line: rgba(0, 0, 0, var(--crt-scan-alpha));
  --crt-vignette: rgba(0, 0, 0, var(--crt-vignette-alpha));

  /* Scanline raster. The overlay itself is a repeating gradient, so the stops
     stay here rather than as a size literal in site.css. 1px line, 2px gap. */
  --crt-scan-pitch: 3px;
  --crt-scan-on: 1px;
}

/* --------------------------------------------------------------------------
   10. Accessibility fallbacks
   -------------------------------------------------------------------------- */

/* Reduced motion: no looping animations at all, fainter scanlines */
@media (prefers-reduced-motion: reduce) {
  :root {
    --crt-scan-alpha: 0.10;
    --crt-vignette-alpha: 0.26;
  }
}

/* High contrast: zero out scanlines and glow entirely instead of painting a
   fully transparent layer, and brighten panel borders to amber */
@media (prefers-contrast: more) {
  :root {
    --crt-scan-alpha: 0;
    --crt-vignette-alpha: 0;
    --crt-glow: none;
    --crt-glow-soft: none;
    --edge: var(--vault-amber-dim);
    --edge-strong: var(--vault-amber);
  }
}

/* --------------------------------------------------------------------------
   11. Collection site v3 (2026-11-23) — cabinets, origin tags, attention
       states, motion vocabulary. See PHILOSOPHY.md.
   -------------------------------------------------------------------------- */
:root {
  /* Origin tags: resident (original) vs guest (embedded) vs classic */
  --tag-original-bg:  var(--vault-amber);
  --tag-original-fg:  var(--vault-void);
  --tag-classic-fg:   var(--vault-amber-hi);
  --tag-classic-edge: var(--vault-amber-mid);
  --tag-guest-fg:     var(--vault-ink-dim);
  --tag-guest-edge:   var(--vault-edge);

  /* Cabinet: the shared berth every game sits in */
  --cabinet-edge:       var(--vault-edge);
  --cabinet-edge-hot:   var(--vault-amber);
  --cabinet-screen:     var(--vault-screen);
  --cabinet-select-bg:  rgba(255, 176, 0, 0.10);

  /* Attention states: shell dims as the visitor moves BROWSE → BOOT → PLAY */
  --dim-boot: 0.45;
  --dim-playing: 0.15;

  /* Motion vocabulary: only three motions on the whole site */
  --t-afterglow: 150ms;          /* phosphor decay: light on instantly, off slowly */
  --t-power: 280ms;              /* power on/off of the stage */
  --t-cursor: 1060ms;            /* cursor blink period */

  /* Sizes */
  --size-feature-cover: 320px;   /* big cover in TODAY / PICK OF THE DIR */
  --size-chip-h: 28px;
  --size-recent-min: 180px;
  --size-cmd-w: 34ch;
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --t-afterglow: 0ms;
    --t-power: 0ms;
  }
}
/* ============================================================================
   doshaven.com — component styles (Retro-Futurism / Fallout terminal)
   ----------------------------------------------------------------------------
   ALL visual values come from tokens.css (single source of truth).
   No raw colors, sizes or fonts are declared in this file.

   Design language:
     · Warm-black panels + amber phosphor type; green = status, red = alerts
     · Structure via panels, L-brackets, hard shadows — no radius, no soft glow
     · Retro, not ancient: modern spacing rhythm, terminal type, hazard accents
   ========================================================================== */

/* ----------------------------------------------------------------------------
   0. Reset & base
   ------------------------------------------------------------------------- */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  color-scheme: dark;
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  background: var(--bg-desktop);
  color: var(--text-body);
  font-family: var(--font-mono);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
}

img {
  display: block;
  max-width: 100%;
}

h1, h2, h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
}

p { margin: 0; }

ul { margin: 0; padding: 0; list-style: none; }

a {
  color: var(--link);
  text-decoration: underline;
  text-decoration-thickness: var(--bw);
  text-underline-offset: var(--sp-1);
}
a:hover { color: var(--link-hover); }

code {
  font-family: var(--font-mono);
  font-size: 0.92em;
  color: var(--text-accent);
  background: var(--bg-inset);
  border: var(--bw) solid var(--edge-soft);
  padding: 0 var(--sp-1);
}

::selection {
  background: var(--accent);
  color: var(--btn-text-on);
}

:focus-visible {
  outline: var(--focus-outline);
  outline-offset: var(--focus-offset);
}

/* ----------------------------------------------------------------------------
   1. CRT overlay layers (body.crt is toggled by site.js, default ON)
   ------------------------------------------------------------------------- */
body.crt::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: var(--z-scanlines);
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    var(--crt-scan-line) 0 var(--crt-scan-on),
    transparent var(--crt-scan-on) var(--crt-scan-pitch)
  );
}

body.crt::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: var(--z-vignette);
  pointer-events: none;
  background: radial-gradient(
    ellipse at center,
    transparent 52%,
    var(--crt-vignette) 100%
  );
}

/* Phosphor glow is reserved for display type — never body copy */
body.crt .hero__title,
body.crt .stage__playing-title,
body.crt .brand__word {
  text-shadow: var(--crt-glow);
}

/* ----------------------------------------------------------------------------
   2. Layout shell
   ------------------------------------------------------------------------- */
.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.wrap {
  width: 100%;
  max-width: var(--layout-max);
  margin: 0 auto;
  padding: var(--sp-6) var(--sp-4) 0;
}

main .wrap > section { margin-bottom: var(--sp-6); }

/* ----------------------------------------------------------------------------
   3. Skip link
   ------------------------------------------------------------------------- */
.skip-link {
  position: absolute;
  left: var(--sp-3);
  top: var(--sp-3);
  z-index: var(--z-skip);
  transform: translateY(-300%);
  background: var(--bg-panel);
  color: var(--text-accent);
  border: var(--bw-strong) solid var(--accent);
  box-shadow: var(--shadow-hard-sm);
  padding: var(--sp-2) var(--sp-3);
  font-family: var(--font-display);
  font-size: var(--fs-small);
  letter-spacing: var(--ls-mid);
  text-transform: uppercase;
  text-decoration: none;
}
.skip-link:focus { transform: none; }

/* ----------------------------------------------------------------------------
   4. Device window: os-window / title bar / status bar
   ------------------------------------------------------------------------- */
.os-window {
  background: var(--bg-panel);
  border: var(--bw) solid var(--edge);
  box-shadow: var(--shadow-hard);
}

.os-window__body {
  padding: var(--sp-4);
}

.os-window__status {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-1) var(--sp-4);
  padding: var(--sp-2) var(--sp-3);
  border-top: var(--bw) solid var(--edge);
  background: var(--bg-panel-raised);
  color: var(--text-muted);
  font-size: var(--fs-tiny);
  letter-spacing: var(--ls-mid);
  text-transform: uppercase;
}

.os-window__status .ok   { color: var(--text-ok); }
.os-window__status .warn { color: var(--text-alert); }

.title-bar {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-1) var(--sp-2);
  background: var(--bg-panel-raised);
  border-bottom: var(--bw) solid var(--edge);
}

.title-bar__icon {
  display: inline-flex;
  align-items: center;
}

.title-bar__icon img { width: var(--size-icon-sm); height: var(--size-icon-sm); }

.title-bar__text {
  flex: 1;
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: var(--ls-wide);
  color: var(--accent-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

h1.title-bar__text,
h3.title-bar__text {
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: var(--fs-label);
}

.title-bar__controls {
  display: inline-flex;
  gap: var(--px);
}

/* Window control studs — indicator lights, not buttons */
.wbtn {
  width: var(--size-wbtn);
  height: var(--size-wbtn);
  border: var(--bw) solid var(--accent-dim);
  background: var(--bg-inset);
}

.wbtn:nth-child(2) { background: var(--accent-dim); }
.wbtn:nth-child(3) { border-color: var(--edge); }

/* ----------------------------------------------------------------------------
   5. Header (sticky, must stay opaque — see README §4.5)
   ------------------------------------------------------------------------- */
.chrome--top {
  position: sticky;
  top: 0;
  z-index: var(--z-chrome);
  background: var(--bg-desktop);
  padding: var(--sp-2) 0;
  border-bottom: var(--bw) solid var(--edge);
}

.header-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--sp-3) var(--sp-4);
  padding: var(--sp-2) var(--sp-3);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  text-decoration: none;
}

.brand__mark { width: var(--size-icon-md); height: var(--size-icon-md); }

.brand__word {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--fs-h3);
  letter-spacing: 0.14em;
  color: var(--text-accent-hi);
}

.brand__tag {
  display: block;
  font-size: var(--fs-tiny);
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
  color: var(--accent-dim);
}

.menu-bar {
  flex: 1;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--sp-3);
}

.menu-bar__links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-1) var(--sp-4);
}

.menu-bar__links a {
  font-size: var(--fs-small);
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
  text-decoration: none;
  color: var(--text-accent);
  padding: var(--sp-1) 0;
}
.menu-bar__links a:hover {
  color: var(--text-accent-hi);
  text-decoration: underline;
  text-underline-offset: var(--sp-1);
}

.menu-bar__spacer { flex: 1; }

.menu-bar__toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-1) var(--sp-3);
  background: var(--bg-inset);
  border: var(--bw) solid var(--edge-strong);
  color: var(--text-accent);
  font-family: var(--font-mono);
  font-size: var(--fs-tiny);
  letter-spacing: var(--ls-wide);
  cursor: pointer;
}
.menu-bar__toggle:hover { border-color: var(--accent); }
.menu-bar__toggle .state { color: var(--text-ok); }
.menu-bar__toggle[aria-pressed="false"] .state { color: var(--text-faint); }

/* ----------------------------------------------------------------------------
   6. Hero
   ------------------------------------------------------------------------- */
.hero .os-window {
  background-image: var(--bracket-corners);
}

.hero__body {
  padding: var(--sp-8) var(--sp-6);
}

.hero__kicker {
  font-size: var(--fs-tiny);
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
  color: var(--accent-dim);
}

.hero__title {
  margin: var(--sp-3) 0 var(--sp-3);
  font-size: var(--fs-display);
  font-weight: 700;
  line-height: var(--lh-tight);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--text-accent-hi);
  text-wrap: balance;
}

.hero__lead {
  max-width: var(--measure-hero);
  color: var(--text-body);
}

.hero__meta {
  margin-top: var(--sp-3);
  color: var(--text-ok);
  font-size: var(--fs-small);
  letter-spacing: var(--ls-mid);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
  margin-top: var(--sp-5);
}

/* ----------------------------------------------------------------------------
   7. Section head
   ------------------------------------------------------------------------- */
.section-head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: var(--sp-2) var(--sp-3);
  margin-bottom: var(--sp-3);
}

.section-head__cmd {
  font-family: var(--font-mono);
  font-size: var(--fs-small);
  color: var(--text-ok);
}

.section-head__title {
  font-size: var(--fs-h2);
  letter-spacing: var(--ls-mid);
  text-transform: uppercase;
  color: var(--text-accent-hi);
}

.section-head__note {
  margin-left: auto;
  max-width: var(--measure-note);
  font-size: var(--fs-small);
  color: var(--text-muted);
  text-align: right;
}

/* ----------------------------------------------------------------------------
   8. Index grid: A–Z strip + genre counts
   ------------------------------------------------------------------------- */
.index-grid {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: var(--sp-6);
  align-items: start;
}

.az {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}

.az__item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--size-az);
  height: var(--size-az);
  background: var(--bg-inset);
  border: var(--bw) solid var(--edge);
  color: var(--text-accent);
  font-family: var(--font-mono);
  text-decoration: none;
}

a.az__item:hover {
  border-color: var(--accent);
  color: var(--text-accent-hi);
}

.az__item--off {
  background: transparent;
  border-color: var(--edge-soft);
  color: var(--text-faint);
}

.genres__item {
  display: flex;
  align-items: baseline;
  gap: var(--sp-2);
  padding: var(--sp-2) 0;
  border-bottom: var(--bw) solid var(--edge-soft);
  font-size: var(--fs-small);
}

.genres__item:last-child { border-bottom: 0; }

.genres__n {
  margin-left: auto;
  color: var(--text-accent);
}

/* ----------------------------------------------------------------------------
   9. Hot list
   ------------------------------------------------------------------------- */
.hot-list__item {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) 0;
  border-bottom: var(--bw) solid var(--edge-soft);
}

.hot-list__item:last-child { border-bottom: 0; }

.hot-list__badge {
  color: var(--text-alert);
  border: var(--bw) solid currentColor;
  padding: var(--bw) var(--sp-2);
  font-size: var(--fs-tiny);
  letter-spacing: var(--ls-wide);
}

.hot-list__name {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: var(--ls-mid);
}

.hot-list__meta {
  color: var(--text-muted);
  font-size: var(--fs-small);
}

.hot-list__size {
  color: var(--accent-dim);
  font-size: var(--fs-small);
}

/* ----------------------------------------------------------------------------
   10. Catalog cards
   ------------------------------------------------------------------------- */
.catalog {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(var(--size-card-min), 1fr));
  gap: var(--sp-4);
}

.card {
  display: flex;
  flex-direction: column;
  background: var(--bg-panel);
  border: var(--bw) solid var(--edge);
  box-shadow: var(--shadow-hard);
}

.card:hover,
.card:focus-within {
  border-color: var(--edge-strong);
}
.card:hover .title-bar__text,
.card:focus-within .title-bar__text { color: var(--text-accent); }

.cover {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-4);
  background: var(--bg-screen);
  border-bottom: var(--bw) solid var(--edge);
}

.cover img { width: var(--size-cover-w); height: var(--size-cover-h); }

.cover__stamp {
  position: absolute;
  right: var(--sp-2);
  bottom: var(--sp-2);
  padding: var(--bw) var(--sp-1);
  background: var(--tint-black);
  border: var(--bw) solid var(--edge);
  color: var(--text-accent);
  font-size: var(--fs-tiny);
  letter-spacing: var(--ls-wide);
}

.card__hot {
  position: absolute;
  left: var(--sp-2);
  top: var(--sp-2);
  padding: var(--bw) var(--sp-2);
  background: var(--tint-black-hard);
  border: var(--bw) solid var(--text-alert);
  color: var(--text-alert);
  font-size: var(--fs-tiny);
  letter-spacing: var(--ls-wide);
}

.card__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-4) var(--sp-4);
}

.card__desc {
  color: var(--text-muted);
  font-size: var(--fs-small);
  line-height: var(--lh-snug);
}

.card__actions {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
}

.card__slug {
  color: var(--text-faint);
  font-size: var(--fs-tiny);
}

.card > .os-window__status { box-shadow: none; }

/* ----------------------------------------------------------------------------
   11. Notes / FAQ / comments / forms
   ------------------------------------------------------------------------- */
.notes {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.notes__row {
  display: grid;
  grid-template-columns: var(--size-notes-k) 1fr;
  gap: var(--sp-3);
  padding-bottom: var(--sp-3);
  border-bottom: var(--bw) solid var(--edge-soft);
}

.notes__row:last-child { border-bottom: 0; padding-bottom: 0; }

.notes__k {
  font-size: var(--fs-tiny);
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
  color: var(--accent-dim);
  padding-top: var(--bw);
}

.notes__v {
  max-width: var(--measure);
  color: var(--text-body);
  font-size: var(--fs-body);
}

/* FAQ */
.faq details { border-bottom: var(--bw) solid var(--edge-soft); }
.faq details:last-child { border-bottom: 0; }

.faq summary {
  display: flex;
  align-items: baseline;
  gap: var(--sp-2);
  padding: var(--sp-3) 0;
  cursor: pointer;
  list-style: none;
  color: var(--text-accent);
  font-family: var(--font-display);
  font-size: var(--fs-h3);
  letter-spacing: var(--ls-mid);
}

.faq summary::-webkit-details-marker { display: none; }

.faq summary::before {
  content: "\25B8"; /* ▸ */
  color: var(--accent-dim);
  flex: none;
}

.faq details[open] summary::before { content: "\25BE"; /* ▾ */ }
.faq summary:hover { color: var(--text-accent-hi); }

.faq details p {
  padding: 0 0 var(--sp-3) var(--sp-4);
  max-width: var(--measure);
  color: var(--text-body);
}

/* Comments */
.comments__banner {
  padding: var(--sp-3);
  border: var(--bw) dashed var(--edge-strong);
  color: var(--text-muted);
  font-size: var(--fs-small);
}

.comment {
  padding: var(--sp-2) var(--sp-3);
  background: var(--bg-panel-raised);
  border: var(--bw) solid var(--edge-soft);
  border-left: var(--bw-strong) solid var(--accent-dim);
}

.comment__head {
  display: flex;
  justify-content: space-between;
  gap: var(--sp-3);
  font-size: var(--fs-tiny);
  color: var(--text-faint);
}

.comment__name { color: var(--accent-dim); }

.comment__text {
  margin-top: var(--sp-1);
  color: var(--text-body);
  font-size: var(--fs-small);
}

.comments__form {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  max-width: var(--size-form-max);
}

.comments__form label {
  font-size: var(--fs-tiny);
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
  color: var(--accent-dim);
}

.comments__form input,
.comments__form textarea {
  padding: var(--sp-2) var(--sp-3);
  background: var(--bg-inset);
  border: var(--bw) solid var(--edge);
  color: var(--text-body);
  font-family: var(--font-mono);
  font-size: var(--fs-body);
}

.comments__form input::placeholder,
.comments__form textarea::placeholder { color: var(--text-faint); }

.comments__form input:focus-visible,
.comments__form textarea:focus-visible {
  outline: var(--focus-outline);
  outline-offset: 0;
  border-color: var(--accent);
}

/* ----------------------------------------------------------------------------
   12. Game page: breadcrumb / stage / keys
   ------------------------------------------------------------------------- */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2);
  margin-bottom: var(--sp-3);
  font-size: var(--fs-small);
  color: var(--text-muted);
}

.breadcrumb__sep { color: var(--text-faint); }
.breadcrumb__path { color: var(--text-faint); }
.breadcrumb [aria-current="page"] { color: var(--text-body); }

.rotate-hint {
  display: none;
  margin-bottom: var(--sp-3);
  padding: var(--sp-2) var(--sp-3);
  border: var(--bw) dashed var(--edge-strong);
  color: var(--text-ok);
  font-size: var(--fs-small);
}

/* The stage itself is a CRT screen well */
.stage {
  position: relative;
  aspect-ratio: 4 / 3;
  background-color: var(--bg-screen);
  background-image: var(--bracket-corners);
  border: var(--bw) solid var(--edge);
  box-shadow: inset 0 0 var(--size-glow) var(--tint-amber);
}

.stage__cover,
.stage__loading,
.stage__playing {
  position: absolute;
  inset: 0;
  display: none;
}

/* State 1: cover */
.stage .stage__cover { display: flex; }
.stage__cover {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--sp-4);
}

.stage__cover img { width: clamp(var(--size-stage-img-min), 40%, var(--size-stage-img)); height: auto; }

.cover__stamp--stage { right: var(--sp-3); bottom: var(--sp-3); }

.stage__play { display: flex; }

/* State 2: loading */
.stage.is-loading .stage__cover { display: none; }
.stage.is-loading .stage__loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--sp-3);
  color: var(--text-accent);
  letter-spacing: var(--ls-wide);
}

.stage__bar {
  position: relative;
  width: min(var(--size-bar-w), 60%);
  height: var(--size-bar-h);
  background: var(--bg-inset);
  border: var(--bw) solid var(--edge-strong);
  overflow: hidden;
}

.stage__bar::before {
  content: "";
  position: absolute;
  inset: var(--size-bar-inset);
  background: var(--hazard);
  animation: stage-bar-crawl 0.9s linear infinite;
}

@keyframes stage-bar-crawl {
  to { background-position: var(--size-bar-step) 0; }
}

.stage__playing-note { color: var(--text-muted); font-size: var(--fs-small); }

/* State 3: in-place playback */
.stage.is-playing .stage__cover,
.stage.is-playing .stage__loading { display: none; }
.stage.is-playing .stage__playing {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: var(--sp-4);
  text-align: center;
  outline: none;
}

.stage__playing-title {
  font-size: var(--fs-h1);
  font-weight: 700;
  letter-spacing: var(--ls-mid);
  text-transform: uppercase;
  color: var(--text-accent-hi);
}

.stage__playing .stage__playing-note { max-width: 52ch; }

/* Keys table */
.keys {
  width: 100%;
  border-collapse: collapse;
  margin-top: var(--sp-4);
  font-size: var(--fs-small);
}

.keys caption {
  text-align: left;
  padding-bottom: var(--sp-2);
  font-size: var(--fs-tiny);
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
  color: var(--accent-dim);
}

.keys th {
  text-align: left;
  padding: var(--sp-2);
  border-bottom: var(--bw) solid var(--edge);
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: var(--fs-tiny);
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
  color: var(--accent-dim);
}

.keys td {
  padding: var(--sp-2);
  border-bottom: var(--bw) solid var(--edge-soft);
  color: var(--text-body);
}

.keys__key {
  display: inline-block;
  padding: var(--bw) var(--sp-2);
  background: var(--bg-inset);
  border: var(--bw) solid var(--edge-strong);
  color: var(--text-accent);
  font-family: var(--font-mono);
  white-space: nowrap;
}

/* ----------------------------------------------------------------------------
   13. Footer taskbar
   ------------------------------------------------------------------------- */
.taskbar {
  margin-top: var(--sp-8);
  background: var(--bg-panel);
  border-top: var(--bw) solid var(--edge-strong);
}

.taskbar::before {
  content: "";
  display: block;
  height: var(--size-hazard-h);
  background: var(--hazard);
  opacity: 0.45;
}

.taskbar__row {
  max-width: var(--layout-max);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2) var(--sp-4);
  padding: var(--sp-3) var(--sp-4);
}

.taskbar__brand {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  color: var(--text-accent);
  font-size: var(--fs-tiny);
  letter-spacing: var(--ls-wide);
}

.taskbar__brand img { width: var(--size-icon-sm); height: var(--size-icon-sm); }

.taskbar__note {
  flex: 1;
  min-width: var(--size-place-min);
  color: var(--text-faint);
  font-size: var(--fs-tiny);
}

.taskbar__links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
}

.taskbar__links a {
  font-size: var(--fs-tiny);
  letter-spacing: var(--ls-mid);
  text-transform: uppercase;
}

/* ----------------------------------------------------------------------------
   14. Buttons
   ------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--size-btn-min);
  padding: 0 var(--sp-4);
  background: var(--btn-face);
  border: var(--bw-strong) solid var(--accent);
  box-shadow: var(--shadow-hard-sm);
  color: var(--btn-text);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--fs-label);
  letter-spacing: var(--ls-mid);
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
}

.btn:hover {
  background: var(--btn-face-hover);
  color: var(--btn-text-on);
  border-color: var(--accent-hi);
}

.btn:active {
  transform: translate(var(--bw-strong), var(--bw-strong));
  box-shadow: none;
}

.btn[aria-disabled="true"],
.btn:disabled {
  opacity: 0.55;
  cursor: default;
}

/* Primary call to action: lit amber */
.btn--play {
  background: var(--accent);
  color: var(--btn-text-on);
}

.btn--play:hover {
  background: var(--accent-hi);
  color: var(--btn-text-on);
}

/* ----------------------------------------------------------------------------
   15. Static pages (About / Legal): page head / toc / callout / badge /
       steps / jump / ledger
   -------------------------------------------------------------------------- */
.page-head .os-window {
  background-image: var(--bracket-corners);
}

.page-head__body {
  position: relative;
  padding: var(--sp-6) var(--sp-5);
  background-image: var(--bracket-corners);
}

/* Decorative hazard stripe. Not a status indicator. */
.page-head__hazard {
  height: var(--size-hazard-h);
  margin: calc(var(--sp-6) * -1) calc(var(--sp-5) * -1) var(--sp-4);
  background: var(--hazard);
}

.page-head__kicker {
  font-size: var(--fs-tiny);
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
  color: var(--accent-dim);
}

.page-head__title {
  margin: var(--sp-2) 0 var(--sp-3);
  font-size: var(--fs-h1);
  font-weight: 700;
  letter-spacing: var(--ls-mid);
  text-transform: uppercase;
  color: var(--text-accent-hi);
}

.page-head__lead {
  max-width: var(--measure-lead);
  color: var(--text-body);
}

.page-head__meta {
  margin-top: var(--sp-3);
  color: var(--text-ok);
  font-size: var(--fs-small);
  letter-spacing: var(--ls-mid);
}

/* On-page index — a terminal strip of section links. The page-head already
   sits in a window, so this strip is inset rather than a second window. */
.toc {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  padding: var(--sp-3);
  background: var(--bg-inset);
  border: var(--bw) solid var(--edge-soft);
  border-left: var(--bw-strong) solid var(--accent-dim);
}

.toc__item {
  display: inline-flex;
  align-items: baseline;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-3);
  background: var(--bg-inset);
  border: var(--bw) solid var(--edge);
  color: var(--text-accent);
  font-size: var(--fs-small);
  text-decoration: none;
}
.toc__item:hover {
  border-color: var(--accent);
  color: var(--text-accent-hi);
}

.toc__n {
  color: var(--accent-dim);
  font-size: var(--fs-tiny);
  letter-spacing: var(--ls-wide);
}

/* Callout — used for prototype / placeholder warnings */
.callout {
  display: flex;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  background: var(--bg-inset);
  border: var(--bw) solid var(--edge-strong);
  border-left: var(--bw-strong) solid var(--accent);
  font-size: var(--fs-small);
}
.callout--warn { border-left-color: var(--text-alert); }
.callout--info { border-left-color: var(--text-ok); }

.callout__k {
  flex: none;
  padding-top: var(--px);
  color: var(--accent-dim);
  font-size: var(--fs-tiny);
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
}
.callout--warn .callout__k { color: var(--text-alert); }
.callout--info .callout__k { color: var(--text-ok); }

.callout__v {
  max-width: var(--measure);
  color: var(--text-body);
}

/* Badge — status chip used in tables and note rows */
.badge {
  display: inline-block;
  padding: 0 var(--sp-2);
  border: var(--bw) solid currentColor;
  font-size: var(--fs-tiny);
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
  white-space: nowrap;
}
.badge--ok { color: var(--text-ok); }
.badge--warn { color: var(--text-alert); }
.badge--pending { color: var(--text-accent); }

/* Steps — numbered process blocks */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-4);
}

.steps__item {
  padding: var(--sp-4);
  background: var(--bg-inset);
  border: var(--bw) solid var(--edge-soft);
  border-top: var(--bw-strong) solid var(--accent-dim);
}

.steps__n {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--fs-h2);
  letter-spacing: var(--ls-mid);
  color: var(--accent-dim);
}

.steps__title {
  margin-top: var(--sp-2);
  font-size: var(--fs-h3);
  letter-spacing: var(--ls-mid);
  text-transform: uppercase;
  color: var(--text-accent-hi);
}

.steps__text {
  margin-top: var(--sp-2);
  color: var(--text-muted);
  font-size: var(--fs-small);
  line-height: var(--lh-snug);
}

/* Jump — related page cards */
.jump {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(var(--size-jump-min), 1fr));
  gap: var(--sp-3);
}

.jump__item {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
  padding: var(--sp-4);
  background: var(--bg-inset);
  border: var(--bw) solid var(--edge);
  text-decoration: none;
}
.jump__item:hover {
  border-color: var(--accent);
  background: var(--bg-panel-raised);
}

.jump__k {
  font-size: var(--fs-tiny);
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
  color: var(--accent-dim);
}

.jump__v {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--fs-h3);
  letter-spacing: var(--ls-mid);
  text-transform: uppercase;
  color: var(--text-accent);
}
.jump__item:hover .jump__v { color: var(--text-accent-hi); }

.jump__t {
  color: var(--text-muted);
  font-size: var(--fs-small);
  line-height: var(--lh-snug);
}

/* Prose — multi-paragraph body copy inside a window body */
.prose > * + * { margin-top: var(--sp-3); }

.prose p {
  max-width: var(--measure);
  color: var(--text-body);
}

.prose h3 {
  margin-top: var(--sp-4);
  font-size: var(--fs-h3);
  letter-spacing: var(--ls-mid);
  text-transform: uppercase;
  color: var(--text-accent-hi);
}

.prose ul {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  max-width: var(--measure);
  padding-left: var(--sp-5);
  list-style: square;
}

.prose li {
  color: var(--text-body);
}

.prose li::marker { color: var(--accent-dim); }

/* Ledger — asset / source registry table */
.ledger-scroll {
  overflow-x: auto;
}

.ledger {
  width: 100%;
  min-width: var(--size-ledger-min);
  border-collapse: collapse;
  font-size: var(--fs-small);
}

.ledger caption {
  text-align: left;
  padding-bottom: var(--sp-2);
  font-size: var(--fs-tiny);
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
  color: var(--accent-dim);
}

.ledger th {
  text-align: left;
  padding: var(--sp-2);
  border-bottom: var(--bw) solid var(--edge);
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: var(--fs-tiny);
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
  color: var(--accent-dim);
  white-space: nowrap;
}
.ledger tbody th {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: var(--ls-mid);
  color: var(--text-accent);
}

.ledger td {
  padding: var(--sp-2);
  border-bottom: var(--bw) solid var(--edge-soft);
  color: var(--text-body);
  vertical-align: top;
}

.ledger__name {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: var(--ls-mid);
  text-transform: uppercase;
  color: var(--text-accent);
  white-space: nowrap;
}

.ledger__empty {
  padding: var(--sp-4);
  border: var(--bw) dashed var(--edge-strong);
  color: var(--text-muted);
  font-size: var(--fs-small);
}

/* Placeholder key-value grid — "missing before launch" checklist */
.placeholders {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(var(--size-place-min), 1fr));
  gap: var(--sp-2);
}

.placeholders__item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-3);
  padding: var(--sp-2) var(--sp-3);
  background: var(--bg-inset);
  border: var(--bw) solid var(--edge-soft);
  border-left: var(--bw-strong) solid var(--text-alert);
}

.placeholders__k {
  font-size: var(--fs-tiny);
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
  color: var(--text-muted);
}

.placeholders__v {
  font-size: var(--fs-tiny);
  color: var(--text-alert);
  white-space: nowrap;
}

/* ----------------------------------------------------------------------------
   16. Responsive
   ------------------------------------------------------------------------- */
/* 767px = one pixel below --bp-md (768px). Custom properties cannot be used
   inside a media-query condition, so the bound is written literally. */
@media (max-width: 767px) {
  .wrap { padding: var(--sp-4) var(--sp-3) 0; }

  .hero__body { padding: var(--sp-6) var(--sp-4); }

  .section-head__note {
    margin-left: 0;
    text-align: left;
  }

  .index-grid { grid-template-columns: 1fr; gap: var(--sp-4); }

  .notes__row { grid-template-columns: 1fr; gap: var(--sp-1); }

  .hot-list__item {
    grid-template-columns: auto 1fr;
    row-gap: var(--sp-1);
  }
  .hot-list__meta { order: 3; }
  .hot-list__size { order: 2; }

  .card__actions { flex-wrap: wrap; }

  .os-window__body { padding: var(--sp-3); }

  /* Static pages: steps collapse to a single column */
  .steps { grid-template-columns: 1fr; }

  .page-head__body { padding: var(--sp-5) var(--sp-4); }
  .page-head__hazard {
    margin: calc(var(--sp-5) * -1) calc(var(--sp-4) * -1) var(--sp-3);
  }

  .placeholders { grid-template-columns: 1fr; }

  .callout { flex-direction: column; gap: var(--sp-1); }

  /* Portrait phones get the rotate hint on the game page */
  .page-game .rotate-hint { display: block; }
}

/* 479px = one pixel below --bp-sm (480px). See the note above. */
@media (max-width: 479px) {
  .catalog { grid-template-columns: 1fr; }

  .az__item { width: var(--size-az-sm); height: var(--size-az-sm); }

  .header-row { gap: var(--sp-2); }

  .hero__actions .btn { flex: 1 1 auto; }
}

/* ----------------------------------------------------------------------------
   17. Accessibility fallbacks beyond tokens
   ------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .stage__bar::before {
    animation: none;
    width: 55%;
  }
}

@media (prefers-contrast: more) {
  .btn { border-width: var(--bw-strong); }
  .card:hover { border-color: var(--accent); }
  .faq summary { color: var(--text-accent-hi); }
  .toc,
  .callout,
  .ledger { border-color: var(--edge-strong); }
}

/* ============================================================================
   16. Collection site v3 (2026-11-23)
       Cabinets, origin tags, DIR listings, filters, command line, attention
       states. Only tokens from tokens.css §11 / earlier — no literals.
   ========================================================================== */

/* ---- 16.1 Cursor: the one looping animation on the site ---------------- */
.cursor {
  display: inline-block;
  width: 0.6em;
  height: 1em;
  margin-left: var(--sp-1);
  vertical-align: text-bottom;
  background: var(--accent);
  animation: cursor-blink var(--t-cursor) steps(1) infinite;
}
@keyframes cursor-blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .cursor { animation: none; } }

/* ---- 16.2 Command line (hero) ------------------------------------------ */
.cmd {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-top: var(--sp-4);
  padding: var(--sp-2) var(--sp-3);
  max-width: var(--size-cmd-w);
  background: var(--bg-inset);
  border: var(--bw) solid var(--edge);
  color: var(--text-accent);
  font-family: var(--font-mono);
}
.cmd:focus-within { border-color: var(--edge-strong); }
.cmd__prompt { white-space: nowrap; }
.cmd__input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: 0;
  color: var(--text-accent-hi);
  font: inherit;
  text-transform: uppercase;
  caret-color: var(--accent);
}
.cmd__input:focus { outline: none; }
.cmd__out {
  min-height: 1.4em;
  margin-top: var(--sp-2);
  color: var(--text-muted);
  font-size: var(--fs-small);
  white-space: pre-wrap;
}
.cmd__hint { color: var(--text-faint); font-size: var(--fs-tiny); letter-spacing: var(--ls-mid); }

/* ---- 16.3 Origin tags ---------------------------------------------------- */
.tag {
  display: inline-block;
  padding: 0 var(--sp-1);
  border: var(--bw) solid transparent;
  font-size: var(--fs-tiny);
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
  white-space: nowrap;
}
.tag--original { background: var(--tag-original-bg); color: var(--tag-original-fg); }
.tag--classic  { color: var(--tag-classic-fg); border-color: var(--tag-classic-edge); }
.tag--guest    { color: var(--tag-guest-fg); border-color: var(--tag-guest-edge); }
.tag--ads      { color: var(--text-alert); border-color: var(--text-alert); }

/* ---- 16.4 Cabinet card: every game sits in the same berth --------------- */
.cabs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(var(--size-card-min), 1fr));
  gap: var(--sp-4);
}
.cabs--rail { grid-template-columns: repeat(auto-fill, minmax(var(--size-recent-min), 1fr)); }
.more-link {
  margin-top: var(--sp-4);
  color: var(--text-muted);
  font-size: var(--fs-small);
  line-height: var(--lh-snug);
}
.more-link a { color: var(--text-accent); }
.more-link a:hover,
.more-link a:focus-visible { color: var(--text); }

/* ---- 16.5 Self-written game mount (tool-backed play pages) --------------- */
.playgame { margin-bottom: var(--sp-4); }
.playgame canvas { display: block; max-width: 100%; }

.cab {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--bg-panel);
  border: var(--bw) solid var(--cabinet-edge);
  box-shadow: var(--shadow-hard);
  color: var(--text-body);
  text-decoration: none;
  /* phosphor afterglow: off slowly … */
  transition: border-color var(--t-afterglow) linear, background-color var(--t-afterglow) linear;
}
.cab:hover,
.cab:focus-visible {
  /* … on instantly */
  transition-duration: 0s;
  border-color: var(--cabinet-edge-hot);
  background-color: var(--cabinet-select-bg);
  outline: none;
}
.cab:focus-visible { box-shadow: var(--shadow-hard), 0 0 0 var(--bw-strong) var(--focus); }
.cab:hover .title-bar__text,
.cab:focus-visible .title-bar__text { color: var(--text-accent); }

.cab .cover { border-bottom-color: var(--cabinet-edge); background: var(--cabinet-screen); }
.cab__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
  padding: var(--sp-3);
}
.cab__name {
  color: var(--text-strong);
  font-family: var(--font-display);
  font-size: var(--fs-h3);
  font-weight: 600;
  line-height: var(--lh-tight);
}
.cab__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2);
  color: var(--text-muted);
  font-size: var(--fs-small);
}
.cab__blurb { color: var(--text-muted); font-size: var(--fs-small); line-height: var(--lh-snug); }
.cab__foot {
  margin-top: auto;
  padding-top: var(--sp-2);
  border-top: var(--bw) dashed var(--edge-soft);
  color: var(--text-faint);
  font-size: var(--fs-tiny);
  letter-spacing: var(--ls-mid);
}
.cab__foot .ok { color: var(--text-ok); }

/* ---- 16.5 Feature block (TODAY.BAT / PICK OF THE DIR) ------------------- */
.feature {
  display: grid;
  grid-template-columns: minmax(0, var(--size-feature-cover)) 1fr;
  gap: var(--sp-6);
  align-items: center;
}
.feature__screen {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 4 / 3;
  background: var(--cabinet-screen);
  border: var(--bw) solid var(--cabinet-edge);
  box-shadow: inset 0 0 var(--size-glow) var(--tint-amber);
}
.feature__screen img { width: 70%; height: auto; image-rendering: pixelated; }
.feature__kicker { color: var(--text-ok); font-size: var(--fs-label); letter-spacing: var(--ls-wide); }
.feature__title {
  margin: var(--sp-2) 0;
  color: var(--text-strong);
  font-family: var(--font-display);
  font-size: var(--fs-h1);
  line-height: var(--lh-tight);
}
.feature__stats {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-4);
  margin: var(--sp-3) 0 var(--sp-4);
  color: var(--text-muted);
  font-size: var(--fs-small);
}
.feature__stats b { color: var(--text-accent-hi); font-weight: normal; }
@media (max-width: 767px) {
  .feature { grid-template-columns: 1fr; gap: var(--sp-4); }
}

/* ---- 16.6 Filter / sort chips ------------------------------------------ */
.chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2);
}
.chips__label {
  margin-right: var(--sp-1);
  color: var(--text-faint);
  font-size: var(--fs-tiny);
  letter-spacing: var(--ls-wide);
}
.chip {
  min-height: var(--size-chip-h);
  padding: 0 var(--sp-3);
  background: transparent;
  border: var(--bw) solid var(--edge);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: var(--fs-small);
  text-decoration: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  transition: border-color var(--t-afterglow) linear, color var(--t-afterglow) linear;
}
.chip:hover { transition-duration: 0s; border-color: var(--edge-strong); color: var(--text-accent); }
.chip[aria-pressed="true"],
.chip[aria-current="page"] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--btn-text-on);
}
.chip__n { opacity: 0.7; }
.toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
}
.empty-note {
  padding: var(--sp-6);
  border: var(--bw) dashed var(--edge);
  color: var(--text-muted);
  text-align: center;
}

/* ---- 16.7 DIR listing: plain-text catalog, keyboard selectable ---------- */
.dir {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: var(--fs-small);
}
.dir th {
  padding: var(--sp-1) var(--sp-2);
  color: var(--text-faint);
  font-weight: normal;
  letter-spacing: var(--ls-mid);
  text-align: left;
  border-bottom: var(--bw) solid var(--edge);
}
.dir td { padding: var(--sp-1) var(--sp-2); color: var(--text-body); white-space: nowrap; }
.dir td.num, .dir th.num { text-align: right; }
.dir a { color: var(--text-accent); text-decoration: none; }
.dir tr { transition: background-color var(--t-afterglow) linear; }
/* reverse video = terminal selection */
.dir tbody tr:hover,
.dir tbody tr:focus-within { transition-duration: 0s; background: var(--accent); }
.dir tbody tr:hover td,
.dir tbody tr:hover a,
.dir tbody tr:focus-within td,
.dir tbody tr:focus-within a { color: var(--btn-text-on); }
.dir a:focus { outline: none; }
.dir tfoot td { padding-top: var(--sp-2); color: var(--text-muted); border-top: var(--bw) solid var(--edge); }
.dir-scroll { overflow-x: auto; }
@media (max-width: 479px) { .dir .hide-sm { display: none; } }

/* ---- 16.8 Section head extras ------------------------------------------ */
.section-head__more { margin-left: auto; font-size: var(--fs-small); }
.genre-nav { margin-top: var(--sp-3); }

/* ---- 16.9 Placard (game page) ------------------------------------------- */
.placard {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: var(--sp-1) var(--sp-4);
  font-size: var(--fs-small);
}
.placard dt { color: var(--text-faint); letter-spacing: var(--ls-mid); }
.placard dd { margin: 0; min-width: 0; color: var(--text-body); overflow-wrap: anywhere; }
.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(var(--size-place-min), 1fr));
  gap: var(--sp-4);
}

/* ---- 16.10 Attention states: shell steps back while the game plays ------ */
.chrome--top,
.taskbar,
[data-shell] { transition: opacity var(--t-power) linear; }
body.state-boot .chrome--top,
body.state-boot .taskbar,
body.state-boot [data-shell] { opacity: var(--dim-boot); }
body.state-play .chrome--top,
body.state-play .taskbar,
body.state-play [data-shell] { opacity: var(--dim-playing); }
body.state-play .chrome--top:hover,
body.state-play [data-shell]:hover { opacity: 1; transition-duration: 0s; }
/* CRT overlay belongs to the shell, not to a guest's picture */
body.state-play.crt::before,
body.state-play.crt::after { opacity: 0; }

/* Boot log replaces the generic spinner */
.bootlog {
  margin: 0;
  color: var(--text-accent);
  font-family: var(--font-mono);
  font-size: var(--fs-small);
  line-height: var(--lh-snug);
  text-align: left;
  white-space: pre;
}
.bootlog .ok { color: var(--text-ok); }

/* Power-on: the picture opens from a horizontal line */
.stage.is-playing .stage__playing { animation: power-on var(--t-power) linear; }
@keyframes power-on {
  0%   { transform: scaleY(0.02); filter: brightness(3); }
  60%  { transform: scaleY(1);    filter: brightness(1.6); }
  100% { transform: scaleY(1);    filter: none; }
}
.esc-hint { color: var(--text-faint); font-size: var(--fs-tiny); letter-spacing: var(--ls-mid); }
.esc-hint kbd,
.kbd-hint kbd {
  padding: 0 var(--sp-1);
  border: var(--bw) solid var(--edge);
  color: var(--text-muted);
  font-family: var(--font-mono);
}
.kbd-hint { color: var(--text-faint); font-size: var(--fs-tiny); letter-spacing: var(--ls-mid); }
@media (hover: none) { .kbd-hint, .esc-hint { display: none; } }

/* ---- 16.11 Compact sticky header on phones (keeps the stage in view) ---- */
@media (max-width: 767px) {
  .chrome--top { padding: 0; }
  .chrome--top .title-bar,
  .chrome--top .brand__tag { display: none; }
  .chrome--top .header-row { flex-wrap: nowrap; padding: var(--sp-2) var(--sp-3); }
  .chrome--top .brand__mark { width: var(--size-icon-sm); height: var(--size-icon-sm); }
  .chrome--top .menu-bar { flex-wrap: nowrap; justify-content: flex-end; min-width: 0; }
  .chrome--top .menu-bar__links { flex-wrap: nowrap; gap: var(--sp-3); overflow-x: auto; }
  .chrome--top .menu-bar__links a { font-size: var(--fs-tiny); letter-spacing: var(--ls-mid); }
  .chrome--top .menu-bar__spacer { display: none; }
}
@media (max-width: 479px) {
  .chrome--top .brand__word { display: none; }
  .chrome--top .menu-bar__links li:nth-child(n+3) { display: none; }   /* About/Legal stay in the footer */
}
/* Phones: two cabinets per row, blurb dropped — the grid is for scanning */
@media (max-width: 479px) {
  .cabs, .cabs--rail { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-2); }
  .cab .cover { padding: var(--sp-2); }
  .cab .cover img { width: 100%; height: auto; }
  .cab .cover__stamp,
  .cab .title-bar__controls,
  .cab__blurb { display: none; }
  .cab .title-bar__text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .cab__name { font-size: var(--fs-body); }
  .cab__body { padding: var(--sp-2); }
}
main section[id], main [id$="-title"] { scroll-margin-top: var(--sp-16); }

/* ============================================================================
   Theme layer (site-specific) — online-only components
   ----------------------------------------------------------------------------
   Everything above is the design system (tokens + site components). The rules
   below exist only in the live theme: FAQ keys, the game-page title and text
   mark, the real download-progress overlay from player.doshaven.com, the
   /arcade category band, and the two-column hero with its game preview.
   They are written against the same tokens — no raw colours.
   ========================================================================== */

/* ----------------------------------------------------------------------------
   FAQ: the engine templates use .faq__key / .faq__body around <details>.
   -------------------------------------------------------------------------- */
.faq {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
}

.faq__key {
  background: var(--bg-panel-raised);
  border: var(--bw) solid var(--edge);
  box-shadow: var(--shadow-hard-sm);
  min-width: 0;
}

.faq__key[open] {
  background: var(--bg-inset);
  border-color: var(--edge-strong);
  box-shadow: inset 0 2px 6px var(--tint-black-hard);
}

.faq summary {
  padding: var(--sp-2) var(--sp-3);
}

.faq summary:hover {
  background: var(--tint-amber);
  color: var(--text-accent-hi);
}

.faq summary h3 {
  margin: 0;
  padding: 0;
  min-width: 0;
  font: inherit;
  font-weight: 600;
  letter-spacing: inherit;
  color: inherit;
  overflow-wrap: anywhere;
}

/* Body text lines up with the question text, not the ▸ indicator. */
.faq__body {
  padding: var(--sp-2) var(--sp-3) var(--sp-3)
    calc(var(--sp-3) + var(--sp-4) + var(--sp-2));
  border-top: var(--bw) solid var(--edge-soft);
}

.faq__body p {
  max-width: var(--measure);
  padding: 0;
  color: var(--text-body);
  overflow-wrap: anywhere;
}

/* Trailing paragraph (home "More reading") stays outside the keys. */
.faq > p { margin-top: var(--sp-3); }

/* ----------------------------------------------------------------------------
   Game page: page title and the no-screenshot text mark.
   -------------------------------------------------------------------------- */
.game__title {
  margin: 0 0 var(--sp-3);
  font-family: var(--font-display);
  font-size: var(--fs-h1);
  font-weight: 700;
  letter-spacing: var(--ls-mid);
  text-transform: uppercase;
  color: var(--text-accent-hi);
}

.cover__textmark {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(22px, 5vw, 34px);
  font-weight: 700;
  letter-spacing: var(--ls-mid);
  text-transform: uppercase;
  color: var(--text-accent-hi);
  text-shadow: var(--crt-glow-soft);
  text-align: center;
}

.stage .cover__textmark { font-size: clamp(20px, 4vw, 30px); }

/* Real screenshots fill the cover well instead of sitting at 128×96. */
.cover img {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.cover__stamp { color: var(--text-accent); border-color: var(--accent-dim); }
.stage__cover img { width: clamp(var(--size-stage-img-min), 60%, 420px); }

/* ----------------------------------------------------------------------------
   Hero: copy on the left, the Doom Browser preview on the right.
   -------------------------------------------------------------------------- */
.hero__body {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: var(--sp-8);
  align-items: center;
}

.hero__col { min-width: 0; }

.hero__title {
  margin: var(--sp-3) 0;
  font-size: clamp(30px, 3.6vw, 46px);
}

.hero__lead + .hero__lead { margin-top: var(--sp-3); }

.hero__preview {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--bg-screen);
  border: var(--bw) solid var(--edge-strong);
  box-shadow: var(--shadow-hard);
  text-decoration: none;
  transition: border-color var(--t-afterglow) linear, transform var(--t-afterglow) linear;
}

.hero__preview:hover,
.hero__preview:focus-visible {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.hero__preview-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
  padding: var(--sp-1) var(--sp-2);
  background: var(--bg-panel-raised);
  border-bottom: var(--bw) solid var(--edge);
  font-family: var(--font-mono);
  font-size: var(--fs-tiny);
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
  color: var(--accent-dim);
}

.hero__preview-dots { display: inline-flex; gap: var(--sp-1); }

.hero__preview-dots i {
  width: 8px;
  height: 8px;
  border: var(--bw) solid var(--accent-dim);
}

.hero__preview-dots i:nth-child(2) { background: var(--accent-dim); }
.hero__preview-dots i:nth-child(3) { border-color: var(--edge); }

.hero__preview-screen {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  aspect-ratio: 4 / 3;
  padding: var(--sp-4);
  background-image: var(--bracket-corners);
  box-shadow: inset 0 0 var(--size-glow) var(--tint-amber);
  text-align: center;
}

.hero__preview-screen::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    var(--crt-scan-line) 0 1px,
    transparent 1px 3px
  );
}

.hero__preview-mark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(22px, 2.6vw, 34px);
  letter-spacing: var(--ls-mid);
  text-transform: uppercase;
  color: var(--text-accent-hi);
  text-shadow: var(--crt-glow-soft);
}

.hero__preview-sub {
  font-size: var(--fs-tiny);
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
  color: var(--text-muted);
}

.hero__preview-play {
  margin-top: var(--sp-2);
  padding: var(--sp-1) var(--sp-5);
  background: var(--accent);
  color: var(--btn-text-on);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--fs-label);
  letter-spacing: var(--ls-mid);
}

.hero__preview:hover .hero__preview-play,
.hero__preview:focus-visible .hero__preview-play { background: var(--accent-hi); }

/* ----------------------------------------------------------------------------
   Notes / prose rhythm used by the live pages.
   -------------------------------------------------------------------------- */
main p { max-width: 66ch; }

.notes__row {
  padding-block: var(--sp-5);
  border-bottom: 1px dashed var(--edge-soft);
}
.notes__row:first-child { padding-top: 0; }
.notes__row:last-child { border-bottom: 0; padding-bottom: 0; }

/* Legacy guide markup (kept for pages produced by the guide template). */
.notes p,
.readme p { line-height: var(--lh-body); }

.requirement-row p,
.requirement-row li { max-width: 65ch; line-height: var(--lh-body); }

.card__body { padding-bottom: var(--sp-5); }

/* Faint text that used to sit on a solid panel is lifted one step for
   readability; hierarchy still comes from size and letter-spacing. */
.card__slug,
.taskbar__note { color: var(--text-muted); }

/* ----------------------------------------------------------------------------
   Real download progress overlay (.stage__dl)
   ----------------------------------------------------------------------------
   The engine hides data-gf-loading when the iframe document loads — long before
   the game data is downloaded. player.doshaven.com reports real bytes over
   postMessage; script.js writes them here and only hides this layer on ready.
   The engine inserts its iframe last and without a z-index, so this layer needs
   a stacking order above it.
   -------------------------------------------------------------------------- */
.stage__dl {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--sp-3);
  padding: var(--sp-4);
  background: var(--bg-screen);
  background-image: var(--bracket-corners);
  box-shadow: inset 0 0 var(--size-glow) var(--tint-amber);
  text-align: center;
  color: var(--text-accent);
  letter-spacing: var(--ls-wide);
}

/* [hidden] must beat display:flex above (and .btn's inline-flex). */
.stage__dl[hidden] { display: none; }
.stage__dl .btn[hidden] { display: none; }

.stage__dl [data-gf-dl-text] {
  max-width: 100%;
  font-size: var(--fs-small);
  overflow-wrap: anywhere;
}

/* Games that draw their own progress (data-gf-progress="builtin") only get a
   status line here — no second bar. */
.stage__dl.is-builtin .stage__dl__track { display: none; }

.stage__dl__track {
  position: relative;
  width: min(var(--size-bar-w), 60%);
  height: var(--size-bar-h);
  background: var(--bg-inset);
  border: var(--bw) solid var(--edge-strong);
  overflow: hidden;
}

.stage__dl__fill {
  display: block;
  width: 0%;
  height: 100%;
  background: var(--accent);
  transition: width var(--t-afterglow) linear;
}

/* Runtime phase with unknown total size: the same hazard crawl as the stage. */
.stage__dl__track.is-indeterminate .stage__dl__fill {
  width: 100%;
  background: var(--hazard);
  animation: stage-bar-crawl 0.9s linear infinite;
}

/* Failure / timeout: alert copy, a retry button, no bar. */
.stage__dl.is-error { color: var(--text-alert); }
.stage__dl.is-error [data-gf-dl-text] { color: var(--text-alert); }
.stage__dl.is-error .stage__dl__track { display: none; }

.stage__dl .btn {
  min-height: var(--size-btn-min);
  padding: 0 var(--sp-3);
}

@media (prefers-reduced-motion: reduce) {
  .stage__dl__fill { transition: none; }
  .stage__dl__track.is-indeterminate .stage__dl__fill {
    animation: none;
    width: 55%;
  }
}

@media (max-width: 479px) {
  .stage__dl { gap: var(--sp-2); padding: var(--sp-3); }
  .stage__dl [data-gf-dl-text] { font-size: var(--fs-tiny); }
  .stage__dl__track { width: min(var(--size-bar-w), 80%); }
}

/* ----------------------------------------------------------------------------
   /arcade category band: the only real category page. Full-width terminal
   directory row, not a ninth game card.
   -------------------------------------------------------------------------- */
.category-band {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  margin-top: var(--sp-6);
  padding: var(--sp-3) var(--sp-4) var(--sp-3) var(--sp-5);
  background: var(--bg-inset);
  border: var(--bw) solid var(--edge-strong);
  box-shadow: var(--shadow-hard);
}

.category-band:hover { border-color: var(--accent); }

.category-band::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: var(--sp-1);
  background: var(--hazard);
}

.category-band__top {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--sp-1) var(--sp-4);
}

.category-band__cmd {
  font-family: var(--font-mono);
  font-size: var(--fs-small);
  letter-spacing: var(--ls-mid);
  color: var(--text-ok);
}

.category-band__meta {
  margin-left: auto;
  font-size: var(--fs-tiny);
  letter-spacing: var(--ls-mid);
  text-transform: uppercase;
  color: var(--text-muted);
}

.category-band__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2) var(--sp-3);
}

.category-band__tag {
  padding: var(--bw) var(--sp-2);
  border: var(--bw) solid var(--accent-dim);
  color: var(--text-accent);
  font-size: var(--fs-tiny);
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
  white-space: nowrap;
}

.category-band__link {
  display: inline-flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: var(--sp-2) var(--sp-3);
  min-width: 0;
  color: var(--text-accent-hi);
  text-decoration: none;
}

.category-band__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--fs-h2);
  letter-spacing: var(--ls-mid);
  text-transform: uppercase;
  text-shadow: var(--crt-glow-soft);
}

.category-band__go {
  padding: var(--bw) var(--sp-2);
  border: var(--bw) solid var(--accent-dim);
  color: var(--text-accent);
  font-family: var(--font-mono);
  font-size: var(--fs-tiny);
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
  white-space: nowrap;
}

.category-band__link:hover .category-band__go,
.category-band__link:focus-visible .category-band__go {
  background: var(--accent);
  border-color: var(--accent-hi);
  color: var(--btn-text-on);
}

.category-band__link:hover .category-band__title,
.category-band__link:focus-visible .category-band__title { color: var(--accent-hi); }

.category-band__desc {
  max-width: none;
  color: var(--text-body);
  font-size: var(--fs-small);
  line-height: var(--lh-snug);
}

@media (max-width: 767px) {
  .category-band {
    padding: var(--sp-3) var(--sp-3) var(--sp-3) var(--sp-4);
  }
  .category-band__title { font-size: var(--fs-h3); }
  .category-band__meta { margin-left: 0; }
}

/* ----------------------------------------------------------------------------
   Responsive tuning for the live header and hero.
   -------------------------------------------------------------------------- */
@media (max-width: 1023px) {
  .catalog { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 767px) {
  .header-row { flex-wrap: wrap; row-gap: var(--sp-2); }
  .brand { flex: 0 0 auto; }
  .menu-bar { width: 100%; flex-wrap: wrap; gap: var(--sp-2) var(--sp-3); }
  .menu-bar__links {
    flex-wrap: nowrap;
    overflow-x: auto;
    max-width: 100%;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    gap: var(--sp-3);
  }
  .menu-bar__links::-webkit-scrollbar { display: none; }
  .menu-bar__links a { white-space: nowrap; }
  .menu-bar__spacer { display: none; }
  .menu-bar__toggle { margin-left: auto; flex: 0 0 auto; white-space: nowrap; }

  .hero__body {
    grid-template-columns: 1fr;
    gap: var(--sp-5);
    padding: var(--sp-5) var(--sp-4);
  }
  .hero__title { font-size: clamp(28px, 7.6vw, 36px); }
  .hero__actions {
    flex-direction: column;
    align-items: stretch;
    gap: var(--sp-2);
  }
  .hero__actions .btn { width: 100%; }
  .cmd { max-width: 100%; }
  .catalog { grid-template-columns: 1fr; }
}

@media (max-width: 479px) {
  .catalog { grid-template-columns: 1fr; }
  .hero__actions .btn { flex: 1 1 auto; }
}

/* Long control strings must never push the table wider than the phone. */
.keys td,
.keys th { overflow-wrap: anywhere; }

/* ============================================================================
   Third-party embed (open-and-play page, 2026-11-26)
   ----------------------------------------------------------------------------
   /games/legend-of-kage-play embeds RetroGames.cz's own player page. That page
   is not ours to restyle, so the frame keeps its full 1200x820 document and the
   viewport crops the game canvas out of it: inside their document the canvas
   sits at (299.5, 306) and measures 512x460 (measured in a real Chrome against
   the live page, not guessed). The frame is 1200 wide because their layout puts
   the console card and the keyboard table to the right of the screen.
   --tp-scale is the crop factor: script.js sets it to viewportWidth / 512, and
   the offsets shrink with it, so the crop stays exact at every width. Until the
   script runs the scale is 1, which still shows the canvas at natural size.
   ========================================================================== */

.tp-embed {
  margin: 0 0 var(--sp-4);
  max-width: 960px;
}

.tp-embed__viewport {
  position: relative;
  width: 100%;
  aspect-ratio: 512 / 460;
  overflow: hidden;
  background: var(--bg-screen);
  border: var(--bw) solid var(--edge);
  --tp-scale: 1;
}

.tp-embed__frame {
  position: absolute;
  left: calc(-299.5px * var(--tp-scale));
  top: calc(-306px * var(--tp-scale));
  width: 1200px;
  height: 820px;
  transform: scale(var(--tp-scale));
  transform-origin: top left;
  border: 0;
}

.tp-embed__note {
  margin-top: var(--sp-3);
  color: var(--text-muted);
  font-size: 14px;
}

/* ---- 17. New on the shelf: the arrivals band on every game page (2026-11-25) ----
   The templates render this band from the site's game records (game.meta.arrival),
   so a newly added game shows up on every game page without editing each page's
   own card list. The cards themselves reuse the cabinet rules in 16.4. */
.section-head--sub { margin-top: var(--sp-6); }
.section-head--sub .section-head__title { font-size: var(--fs-h3); }
.cabs--new { margin-top: var(--sp-4); }

/* ---- 18. Archive games: a fixed-size game frame, scaled to the stage (2026-11-26) ----
   Once started, the Archive's emulator draws the game at the game's own size and never
   scales it, so a frame stretched to the stage leaves the game small in a corner
   (desktop) or cut off (phones). The frame is therefore 640x480 (the largest picture
   the emulator produces: 640x400 for DOS games, 640x480 for the Windows game), taken
   from data-gf-fw / data-gf-fh on the stage, and scaled to the stage width; script.js
   sets the scale and the offsets. The engine writes width/height/inset inline on the
   frame, hence the !important here. */
.stage[data-gf-progress="none"] { overflow: hidden; }
.stage[data-gf-progress="none"] > iframe {
  inset: auto !important;
  top: var(--gf-top, 0px);
  left: 0;
  width: var(--gf-fw, 640px) !important;
  height: var(--gf-fh, 480px) !important;
  transform: scale(var(--gf-scale, 1));
  transform-origin: 0 0;
}

