/* ============================================================
   HOT POTATO GAMES — brand guidelines document styles
   Reads tokens.css for every brand value. No hex here.
   ============================================================ */

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--text-body);
  line-height: 1.6;
  color: var(--ink);
  background: var(--surface);
  transition: background var(--dur-normal) var(--ease-out), color var(--dur-normal) var(--ease-out);
}

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

h1, h2, h3, h4 { line-height: 1.15; text-wrap: balance; margin: 0; }
p { max-width: 65ch; }

a { color: var(--flame-orange); }
a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--brand-orange);
  outline-offset: 2px;
}

.skip {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--ink);
  color: var(--surface);
  padding: var(--sp-2) var(--sp-4);
  z-index: 99;
}
.skip:focus { left: 0; }

/* ---- Shell: sidebar + document ---- */
.shell { display: grid; grid-template-columns: var(--nav-w) minmax(0, 1fr); }

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  padding: var(--sp-5) var(--sp-4);
  background: var(--dark-brown);
  color: var(--surface);
  display: flex;
  flex-direction: column;
  gap: var(--sp-5);
}
.sidebar-mark { display: flex; align-items: center; gap: var(--sp-2); }
.sidebar-mark img { width: 44px; height: 44px; border-radius: 50%; }
.sidebar-mark span {
  font-family: var(--font-display);
  font-size: 0.82rem;
  line-height: 1.2;
  color: var(--brand-gold);
}
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex;
  gap: var(--sp-2);
  align-items: baseline;
  padding: 0.4rem 0.55rem;
  border-radius: var(--r-sm);
  color: var(--surface);
  opacity: 0.75;
  text-decoration: none;
  font-size: var(--text-body-sm);
}
.nav a .n { font-family: var(--font-mono); font-size: var(--text-label); color: var(--brand-gold); }
.nav a:hover { opacity: 1; background: var(--ink); }
/* Selection is on fire — Tater Dash has a fiery theme; it is hot potato games coded.
   The flame ramp backs the active item; a slow background-position drift keeps the
   fire living (background-position only — no layout motion). */
.nav a.active {
  opacity: 1;
  background: var(--gradient-flame);
  background-size: 100% 200%;
  color: var(--ink-fixed);
  font-weight: 700;
  animation: flame-lick 2.6s var(--ease-out) infinite alternate;
}
.nav a.active .n { color: var(--ink-fixed); }
@keyframes flame-lick { from { background-position: 50% 0%; } to { background-position: 50% 100%; } }
@media (prefers-reduced-motion: reduce) { .nav a.active { animation: none; } }

.sidebar-actions { margin-top: auto; display: flex; flex-direction: column; gap: var(--sp-2); }
.btn {
  font: inherit;
  font-weight: 700;
  font-family: var(--font-body);
  cursor: pointer;
  border: var(--border);
  border-radius: var(--r-md);
  padding: 0.55rem 1rem;
  background: var(--brand-sienna);
  color: var(--ink);
  box-shadow: var(--sh-card);
  transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);
}
.btn:hover { background: var(--brand-gold); transform: translate(-1px, -1px); box-shadow: var(--sh-pop); }
.btn:active { transform: translate(2px, 2px); box-shadow: none; }
.btn--quiet { background: transparent; color: inherit; box-shadow: none; border-color: currentColor; }

.burger {
  display: none;
  position: fixed;
  top: var(--sp-3);
  right: var(--sp-3);
  z-index: 60;
}

/* ---- Sections ---- */
.sec { padding: var(--section-pad) clamp(1.25rem, 5vw, 5rem); }
.sec--warm { background: var(--surface-warm); }
.sec--dark { background: var(--ink); color: var(--surface); }
.sec--dark p { color: var(--surface); }
.sec-inner { max-width: var(--max-w); margin: 0 auto; }
.sec-inner--wide { max-width: var(--max-w-wide); }

.sec-head { margin-bottom: var(--sp-6); max-width: var(--max-w-narrow); }
.sec-head .kicker {
  font-family: var(--font-mono);
  font-size: var(--text-label);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--flame-orange);
  margin: 0 0 var(--sp-2);
}
.sec--dark .sec-head .kicker { color: var(--brand-gold); }
.sec-head h2 { font-family: var(--font-display); font-size: var(--text-h1); font-weight: 400; }
.sec-head .sub { color: var(--muted); font-size: var(--text-body-lg); margin: var(--sp-3) 0 0; }
.sec--dark .sec-head .sub { color: var(--surface); opacity: 0.8; }

.status {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: var(--text-label);
  letter-spacing: 0.1em;
  padding: 0.2rem 0.6rem;
  border: 2px solid var(--flame-orange);
  border-radius: var(--r-pill);
  color: var(--flame-orange);
  margin-bottom: var(--sp-3);
}
.sec--dark .status { border-color: var(--brand-gold); color: var(--brand-gold); }

/* ---- Cover ---- */
.cover { min-height: 100vh; display: flex; align-items: center; }
.cover-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: var(--sp-7);
  align-items: center;
  max-width: var(--max-w);
  margin: 0 auto;
  width: 100%;
}
.cover-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--text-hero);
  line-height: 0.95;
  margin: 0;
}
.cover-title .accent { color: var(--brand-orange); }
.cover-tag { font-size: var(--text-body-lg); font-weight: 700; margin: var(--sp-4) 0 0; }
.cover-meta { font-family: var(--font-mono); font-size: var(--text-caption); color: var(--muted); margin-top: var(--sp-2); }
.cover-logo { width: min(280px, 60%); margin: 0 auto; }
.cover-logo img { width: 100%; height: auto; filter: drop-shadow(6px 6px 0 rgba(0, 0, 0, 0.18)); }

.toc { margin-top: var(--sp-6); columns: 2; column-gap: var(--sp-6); max-width: 40rem; }
.toc a {
  display: flex;
  gap: var(--sp-2);
  align-items: baseline;
  padding: 0.3rem 0;
  text-decoration: none;
  color: inherit;
  break-inside: avoid;
}
.toc a:hover { color: var(--flame-orange); }
.toc .n { font-family: var(--font-mono); font-size: var(--text-label); color: var(--flame-orange); }

/* ---- Prose & structure primitives ---- */
.duo { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-6); align-items: start; }
.lede { font-size: var(--text-body-lg); }

.deflist { margin: 0; }
.deflist > div { padding: var(--sp-3) 0; border-bottom: 2px solid var(--surface-warm); }
.sec--warm .deflist > div { border-bottom-color: var(--paper); }
.deflist dt { font-weight: 800; font-size: var(--text-h4); }
.deflist dd { margin: 0.25rem 0 0; color: var(--muted); }

.numbered { list-style: none; margin: 0; padding: 0; counter-reset: rule; }
.numbered li {
  counter-increment: rule;
  display: grid;
  grid-template-columns: 2.4rem minmax(0, 1fr);
  gap: var(--sp-3);
  padding: var(--sp-3) 0;
  border-bottom: 2px solid var(--surface-warm);
}
.numbered li::before {
  content: counter(rule, decimal-leading-zero);
  font-family: var(--font-mono);
  color: var(--flame-orange);
  font-size: var(--text-body-sm);
  padding-top: 0.2rem;
}
.numbered strong { display: block; }

/* ---- Spec tables ---- */
.spec { width: 100%; border-collapse: collapse; font-size: var(--text-body-sm); }
.spec th {
  text-align: left;
  font-family: var(--font-mono);
  font-size: var(--text-label);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0 var(--sp-3) var(--sp-2) 0;
  border-bottom: var(--border);
}
.spec td { padding: var(--sp-2) var(--sp-3) var(--sp-2) 0; border-bottom: 2px solid var(--surface-warm); vertical-align: top; }
.sec--dark .spec td { border-bottom-color: var(--dark-brown); }
.spec .mono { font-family: var(--font-mono); font-size: var(--text-caption); }
.pass, .fail { font-family: var(--font-mono); font-size: var(--text-label); letter-spacing: 0.06em; }
.pass { color: var(--flame-orange); }
.fail { color: var(--flame-red); text-decoration: underline; }
.sec--dark .pass { color: var(--brand-gold); }

/* ---- Cards (chunky, hard-shadow — the HPG surface language) ---- */
.card {
  background: var(--paper);
  border: var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-card);
  padding: var(--sp-4);
}

/* ---- Do / Don't ---- */
.dosdonts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-5); }
.dd-col h3 { font-family: var(--font-mono); font-size: var(--text-body-sm); letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: var(--sp-3); }
.dd-col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--sp-2); }
.dd-col li { padding-left: 1.6rem; position: relative; }
.dd-col li::before { position: absolute; left: 0; font-weight: 800; }
.dd-do li::before { content: '✓'; color: var(--flame-orange); }
.dd-dont li::before { content: '✕'; color: var(--flame-red); }
.sec--dark .dd-do li::before { color: var(--brand-gold); }
.sec--dark .dd-dont li::before { color: var(--brand-sienna); }

/* ---- Logo section — captions live OUTSIDE the bordered plate; no text
   ever sits inside the logo plate itself (Brett, 2026-08-03) ---- */
.logo-stage {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: var(--sp-4);
}
.logo-tile { margin: 0; }
.logo-plate {
  border: var(--border);
  border-radius: var(--r-lg);
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 3;
  padding: var(--sp-4);
}
.logo-plate img { width: min(160px, 70%); }
.logo-tile figcaption {
  font-family: var(--font-mono);
  font-size: var(--text-label);
  color: var(--muted);
  text-align: center;
  margin-top: var(--sp-2);
}
.logo-plate--cream { background: var(--surface); }
.logo-plate--dark { background: var(--dark-brown); }
.logo-plate--orange { background: var(--brand-orange); }
.logo-plate--gold { background: var(--brand-gold); }
.logo-plate--gradient { background: var(--gradient-launch); }

.clearspace {
  position: relative;
  display: inline-block;
  border: 2px dashed var(--subtle);
  padding: var(--sp-5);
}
.clearspace img { width: 140px; }
.clearspace .cs-label {
  position: absolute;
  font-family: var(--font-mono);
  font-size: var(--text-label);
  color: var(--muted);
}

/* ---- Color section ---- */
.swatch-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-4); }
.swatch {
  border: var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--sh-card);
  background: var(--paper);
}
.swatch .chip { height: 110px; }
.swatch .meta { padding: var(--sp-3); }
.swatch .meta .name { font-weight: 800; }
.swatch .meta .hex { font-family: var(--font-mono); font-size: var(--text-caption); color: var(--muted); }
.swatch-row--secondary .swatch .chip { height: 64px; }

.ramp { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border: var(--border); border-radius: var(--r-md); overflow: hidden; }
.ramp .step { height: 72px; display: flex; align-items: flex-end; padding: var(--sp-1); }
.ramp .step span { font-family: var(--font-mono); font-size: var(--text-label); background: var(--paper); color: var(--ink); padding: 0.05rem 0.3rem; border-radius: 3px; }

.gradient-strip { height: 72px; border: var(--border); border-radius: var(--r-md); }
.gradient-strip--brand { background: var(--gradient-brand); }
.gradient-strip--cta { background: var(--gradient-cta); }

/* ---- Typography section ---- */
.type-specimen { display: flex; flex-direction: column; gap: var(--sp-3); }
.type-row { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: var(--sp-4); align-items: baseline; padding: var(--sp-3) 0; border-bottom: 2px solid var(--surface-warm); }
.type-row .demo { overflow-wrap: anywhere; }
.type-row .spec-cell { font-family: var(--font-mono); font-size: var(--text-label); color: var(--muted); text-align: right; }
.t-hero { font-family: var(--font-display); font-size: var(--text-hero); line-height: 0.95; }
.t-h1 { font-family: var(--font-display); font-size: var(--text-h1); }
.t-h2 { font-family: var(--font-display); font-size: var(--text-h2); }
.t-h3 { font-weight: 800; font-size: var(--text-h3); }
.t-body-lg { font-size: var(--text-body-lg); }
.t-body { font-size: var(--text-body); }
.t-caption { font-size: var(--text-caption); color: var(--muted); }
.t-mark { font-family: var(--font-mark); font-size: var(--text-h1); }
.t-accent { font-family: var(--font-accent); font-size: var(--text-h2); }
.t-mono { font-family: var(--font-mono); font-size: var(--text-body-sm); }

/* ---- Iconography ---- */
.icon-grid { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: var(--sp-3); }
.icon-grid--seven { grid-template-columns: repeat(7, minmax(0, 1fr)); max-width: 56rem; }
.icon-cell {
  border: var(--border);
  border-radius: var(--r-md);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  background: var(--paper);
}
.icon-cell svg { width: 28px; height: 28px; stroke: var(--ink); }
.icon-cell--accent svg { stroke: var(--brand-orange); }
.icon-label { font-family: var(--font-mono); font-size: var(--text-label); color: var(--muted); text-align: center; margin-top: 0.35rem; }

/* ---- Photography / illustration ---- */
.art-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-4); }
.art-grid figure { margin: 0; border: var(--border); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--sh-card); background: var(--paper); }
.art-grid img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.art-grid figcaption { padding: var(--sp-2) var(--sp-3); font-family: var(--font-mono); font-size: var(--text-label); color: var(--muted); }

/* ---- Guard dots — the ONLY sanctioned form for guard color outside fight UI.
   No color strips on any card edge, ever (Brett, 2026-08-03). ---- */
.guard-dot {
  display: inline-block;
  width: 0.85em;
  height: 0.85em;
  border-radius: 50%;
  border: 2px solid var(--ink);
  flex: none;
  vertical-align: baseline;
}
.guard-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--sp-2); }
.guard-list li { display: flex; align-items: center; gap: var(--sp-2); padding: var(--sp-2) 0; border-bottom: 2px solid var(--surface-warm); }
.guard-list .guard-name { font-weight: 800; min-width: 5.5rem; }
.guard-list .guard-hex { font-family: var(--font-mono); font-size: var(--text-caption); color: var(--muted); }

/* ---- Story profiles (07) — cards proportioned to their content; sprites at
   native 2:3; guard color only as the ink-ringed dot beside the name. ---- */
.profiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--sp-4); align-items: start; }
.profile {
  border: var(--border);
  border-radius: var(--r-lg);
  background: var(--paper);
  box-shadow: var(--sh-card);
  overflow: hidden;
}
.profile-art { width: 100%; height: auto; padding: var(--sp-2) var(--sp-2) 0; }
.profile-body { padding: var(--sp-3); }
.profile-name { font-family: var(--font-display); font-size: var(--text-h4); display: flex; align-items: center; gap: 0.5rem; margin: 0; }
.profile-style { font-size: var(--text-body-sm); color: var(--muted); margin: 0.4rem 0 0; }
.profile-story { margin-top: var(--sp-3); border-top: 2px solid var(--surface-warm); padding-top: var(--sp-2); }
.story-k {
  font-family: var(--font-mono);
  font-size: var(--text-label);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--flame-orange);
  margin: 0 0 0.3rem;
}
.profile-story p { font-size: var(--text-body-sm); margin: 0; }
.story-open {
  font-family: var(--font-mono);
  font-size: var(--text-caption);
  color: var(--muted);
  border: 1px dashed var(--subtle);
  border-radius: var(--r-sm);
  padding: 0.4rem 0.6rem;
}

/* ---- Portrait figures (Ohm · Sally) — pixel sheets at native square aspect,
   captions readable on the dark plates they sit inside. ---- */
.portrait-figure { margin: 0; max-width: 260px; }
.portrait-figure img { width: 100%; height: auto; border: var(--border); border-radius: var(--r-md); image-rendering: pixelated; }
.portrait-figure figcaption {
  font-family: var(--font-mono);
  font-size: var(--text-label);
  color: var(--surface);
  opacity: 0.85;
  margin-top: var(--sp-2);
}

/* ---- UI components ---- */
.ui-demo { display: flex; flex-wrap: wrap; gap: var(--sp-3); align-items: center; }
.chip-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: var(--text-caption);
  border: 2px solid var(--ink);
  border-radius: var(--r-pill);
  padding: 0.15rem 0.7rem;
  background: var(--brand-gold);
  color: var(--ink);
}
.input-demo {
  font: inherit;
  border: var(--border);
  border-radius: var(--r-md);
  padding: 0.55rem 0.9rem;
  background: var(--paper);
  color: var(--ink);
  width: min(280px, 100%);
}
.input-demo:focus-visible { outline: 3px solid var(--brand-orange); outline-offset: 2px; }

.game-tile {
  width: 240px;
  border: var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--paper);
  box-shadow: var(--sh-card);
  transition: transform var(--dur-fast) var(--ease-bounce), box-shadow var(--dur-fast) var(--ease-out);
}
.game-tile:hover { transform: translate(-2px, -2px) rotate(-0.5deg); box-shadow: var(--sh-pop); }
.game-tile img { aspect-ratio: 16 / 10; object-fit: cover; }
.game-tile .body { padding: var(--sp-3); }
.game-tile .body .name { font-family: var(--font-display); font-size: 0.95rem; }
.game-tile .body p { margin: 0.2rem 0 0; font-size: var(--text-caption); color: var(--muted); }

/* ---- The overhauled components (08) — ButtonFactory geometry:
   cornerRadius 10, lineWidth 2; press-to-flat; half-height pills. ---- */
.td-btn {
  font-family: var(--font-display);
  font-size: var(--text-body-sm);
  letter-spacing: 0.04em;
  cursor: pointer;
  border: 2px solid var(--ink);
  border-radius: 10px;
  padding: 0.7rem 1.4rem;
  background: var(--paper);
  color: var(--ink);
  box-shadow: var(--sh-card);
  transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);
}
.td-btn--primary { background: var(--brand-orange); color: var(--ink-fixed); border-color: var(--ink-fixed); }
.td-btn--secondary { background: var(--paper); }
.td-btn:hover:not(:disabled):not(.is-pressed) { transform: translate(-1px, -1px); box-shadow: var(--sh-pop); }
.td-btn:active:not(:disabled),
.td-btn.is-pressed { transform: translate(4px, 4px); box-shadow: none; }
.td-btn:disabled {
  cursor: not-allowed;
  background: var(--surface-warm);
  color: var(--muted);
  box-shadow: none;
  border-color: var(--subtle);
}

/* The leaderboard panel — an actual board: rank / chip slot / player / score,
   a gold you-row, and the YOUR BEST ghost row (you vs you, visible). */
.lb-panel {
  border: var(--border);
  border-radius: var(--r-lg);
  background: var(--paper);
  box-shadow: var(--sh-pop);
  overflow: hidden;
  max-width: 30rem;
}
.lb-title {
  font-family: var(--font-display);
  font-size: 0.8rem;
  text-align: center;
  background: var(--dark-brown);
  color: var(--brand-gold);
  padding: 0.6rem var(--sp-3);
  margin: 0;
}
.lb-head,
.lb-row {
  display: grid;
  grid-template-columns: 2.2rem 2.6rem minmax(0, 1fr) auto;
  gap: var(--sp-2);
  align-items: center;
  padding: 0.45rem var(--sp-3);
}
.lb-head {
  font-family: var(--font-mono);
  font-size: var(--text-label);
  letter-spacing: 0.1em;
  color: var(--muted);
  border-bottom: 2px solid var(--ink);
  padding-top: var(--sp-2);
}
.lb-row { border-bottom: 2px solid var(--surface-warm); font-size: var(--text-body-sm); }
.lb-row:last-child { border-bottom: none; }
.lb-rank { font-family: var(--font-arcade); font-size: 0.85rem; }
/* The card is a circular VIPotato avatar (matches the app's 40×40 round avatar). */
.lb-chip {
  width: 2.4rem;
  height: 2.4rem;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: radial-gradient(circle at 50% 38%, var(--surface), var(--surface-warm));
  display: grid;
  place-items: center;
  overflow: hidden;
}
.lb-chip img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.lb-chip--empty { border-style: dashed; border-color: var(--subtle); background: transparent; }
.lb-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-score { font-family: var(--font-arcade); font-size: 0.85rem; }
.lb-row--you { background: var(--brand-gold); color: var(--ink-fixed); }
.lb-row--you .lb-name::after { content: ' ◄'; }
.lb-row--ghost { color: var(--muted); background: var(--surface); }
.lb-row--ghost .lb-name { font-weight: 400; font-style: italic; }

/* The fight menu — one thumb, one stack, brand chrome */
.fight-menu {
  border: var(--border);
  border-radius: var(--r-lg);
  background: var(--gradient-launch);
  box-shadow: var(--sh-pop);
  padding: var(--sp-4);
  max-width: 20rem;
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}
.fm-plaque {
  font-family: var(--font-display);
  font-size: 1.2rem;
  text-align: center;
  color: var(--paper);
  -webkit-text-stroke: 1px var(--ink-fixed);
  text-shadow: 2px 2px 0 var(--ink-fixed);
  margin: 0 0 var(--sp-2);
}
.fm-item { width: 100%; }
.fm-foot { display: flex; justify-content: space-between; align-items: center; margin-top: var(--sp-2); }
.fm-pill {
  font-family: var(--font-mono);
  font-size: var(--text-caption);
  line-height: 1;
  border: 2px solid var(--ink);
  border-radius: 13px; /* half of the 26px pill height — the HUD's own radius law */
  height: 26px;
  padding: 0 0.8rem;
  display: inline-flex;
  align-items: center;
  background: var(--paper);
  color: var(--ink);
}

/* Fighter cards — sized by their content; sprites native 2:3; no strips */
/* Every fighter card is the SAME size — a fixed-height image box + a body that
   fills the rest. Cards never proportion to their content (Brett, 2026-08-26). */
.fcards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--sp-4); align-items: stretch; }
.fcard {
  display: flex;
  flex-direction: column;
  border: var(--border);
  border-radius: var(--r-lg);
  background: var(--paper);
  box-shadow: var(--sh-card);
  overflow: hidden;
}
.fcard img { width: 100%; height: 160px; object-fit: contain; padding: var(--sp-2) var(--sp-2) 0; }
.fcard-body { padding: var(--sp-2) var(--sp-3) var(--sp-3); margin-top: auto; }
.fcard-name { font-family: var(--font-display); font-size: var(--text-h4); display: flex; align-items: center; gap: 0.5rem; margin: 0; }
.fcard-tag { font-family: var(--font-mono); font-size: var(--text-label); color: var(--muted); margin: 0.25rem 0 0; }

/* ---- Layout section ---- */
.container-diagram { display: flex; flex-direction: column; gap: var(--sp-2); }
.container-diagram .bar {
  border: 2px dashed var(--muted);
  border-radius: var(--r-sm);
  padding: 0.4rem var(--sp-3);
  font-family: var(--font-mono);
  font-size: var(--text-label);
  color: var(--muted);
}
.spacing-ruler { display: flex; align-items: flex-end; gap: var(--sp-3); }
.spacing-ruler .block { background: var(--brand-orange); border: 2px solid var(--ink); border-radius: 3px; width: 34px; }
.spacing-ruler .lbl { font-family: var(--font-mono); font-size: var(--text-label); color: var(--muted); text-align: center; margin-top: 0.3rem; }

/* ---- AI policy ---- */
.stance {
  font-family: var(--font-display);
  font-size: var(--text-h2);
  max-width: 24ch;
  margin: 0 0 var(--sp-5);
}
.callout {
  border: var(--border);
  border-radius: var(--r-lg);
  background: var(--paper);
  box-shadow: var(--sh-card);
  padding: var(--sp-4);
  max-width: var(--max-w-narrow);
}
.sec--dark .callout { background: var(--dark-brown); }

/* ---- Placeholders & invitation zones ---- */
.placeholder {
  border: 3px dashed var(--flame-orange);
  border-radius: var(--r-md);
  padding: var(--sp-3) var(--sp-4);
  font-family: var(--font-mono);
  font-size: var(--text-caption);
  color: var(--flame-orange);
  background: transparent;
}
.placeholder::before { content: 'PLACEHOLDER — '; font-weight: 700; }

.invite {
  border: 1px dashed var(--subtle);
  border-radius: var(--r-md);
  padding: var(--sp-3) var(--sp-4);
  font-family: var(--font-mono);
  font-size: var(--text-caption);
  color: var(--muted);
  max-width: 34rem;
}
.js .invite { opacity: 0; transition: opacity var(--dur-slow) var(--ease-out) 2s; }
.js .invite.vis { opacity: 1; }

/* ---- Alternate toggles (the A/B controls) ---- */
.alt-control {
  display: inline-flex;
  gap: var(--sp-2);
  align-items: center;
  font-family: var(--font-mono);
  font-size: var(--text-caption);
  border: 2px dashed var(--subtle);
  border-radius: var(--r-md);
  padding: var(--sp-2) var(--sp-3);
}
.alt-control .btn { font-size: var(--text-caption); padding: 0.3rem 0.7rem; box-shadow: none; }
.alt-control .btn[aria-pressed='true'] { background: var(--ink); color: var(--surface); }

/* ---- Reveal (js-gated; fails visible) ---- */
.rv { /* visible by default */ }
.js .rv { opacity: 0; transform: translateY(16px); transition: opacity var(--dur-slow) var(--ease-out), transform var(--dur-slow) var(--ease-out); }
.js .rv.vis { opacity: 1; transform: none; }
.js .rv-d1.vis { transition-delay: 60ms; }
.js .rv-d2.vis { transition-delay: 120ms; }
.js .rv-d3.vis { transition-delay: 180ms; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .rv, .js .invite { opacity: 1; transform: none; transition: none; }
  .game-tile, .btn, .td-btn, .sticker { transition: none; }
}

/* ---- Responsive ---- */
@media (max-width: 1024px) {
  .duo, .dosdonts, .art-grid { grid-template-columns: 1fr; }
  .profiles, .fcards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .icon-grid, .icon-grid--seven { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .swatch-row, .logo-stage { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cover-grid { grid-template-columns: 1fr; }
  .cover-logo { order: -1; width: min(200px, 50%); margin: 0; }
}
@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 30% 0 0; z-index: 50; transform: translateX(-100%); transition: transform var(--dur-normal) var(--ease-out); height: 100dvh; }
  .sidebar.open { transform: none; }
  .burger { display: inline-block; }
  .swatch-row, .logo-stage, .profiles, .fcards { grid-template-columns: 1fr; }
  .type-row { grid-template-columns: 1fr; }
  .type-row .spec-cell { text-align: left; }
  .toc { columns: 1; }
}

/* ---- Print ---- */
@media print {
  .sidebar, .burger, .invite, .alt-control, .skip { display: none !important; }
  .shell { display: block; }
  .rv { opacity: 1 !important; transform: none !important; }
  .sec { break-before: page; padding: 1.5cm 0; }
  .cover { min-height: auto; break-before: auto; }
  body { background: white; }
  .sec--dark { background: var(--ink); -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .chip, .ramp .step, .gradient-strip, .guard-dot, .logo-plate,
  .sleep-canon, .moon-feature, .moon-diagram, .lb-title, .lb-row--you,
  .td-btn, .fight-menu, .fm-pill, .hp-bar span, .sticker, .art-law
    { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ============================================================
   Tater Dash — arcade-specific additions
   ============================================================ */

.t-arcade { font-family: var(--font-arcade); font-size: 0.9em; }

/* The P/A/O/T sticker verbs — round thumb buttons from Versus */
.stickers { display: flex; gap: var(--sp-3); align-items: center; }
.sticker {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: var(--border);
  box-shadow: var(--sh-card);
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 1.4rem;
  cursor: pointer;
  transition: transform var(--dur-fast) var(--ease-bounce), box-shadow var(--dur-fast) var(--ease-out);
}
.sticker:hover { transform: translate(-1px, -1px); box-shadow: var(--sh-pop); }
.sticker:active { transform: translate(2px, 2px); box-shadow: none; }
.sticker--p { background: var(--brand-orange); color: var(--paper); }
.sticker--a { background: var(--brand-sienna); color: var(--paper); }
.sticker--o { background: var(--brand-gold); color: var(--ink); }
.sticker--t { background: var(--paper); color: var(--ink); }
.sticker-label { font-family: var(--font-mono); font-size: var(--text-label); color: var(--muted); text-align: center; margin-top: 0.35rem; }

/* HP bar — the semantic ramp in one strip */
.hp-bar { display: flex; height: 26px; border: var(--border); border-radius: var(--r-pill); overflow: hidden; max-width: 26rem; }
.hp-bar span { flex: 1; }

/* ---- Illustration (06) — asymmetric composition on the dark surface.
   NATIVE ASPECT RATIOS ARE LAW: no forced aspect-ratio, no object-fit crops;
   every img carries its measured width/height and renders height:auto. ---- */
.art-law {
  font-size: var(--text-body-lg);
  font-weight: 700;
  color: var(--surface);
  max-width: var(--max-w-narrow);
  border-left: 6px solid var(--brand-gold);
  padding-left: var(--sp-4);
  margin: 0 0 var(--sp-6);
}
.art-feature {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
  gap: var(--sp-6);
  align-items: start;
}
.art-fig { margin: 0; }
.art-fig img {
  width: 100%;
  height: auto; /* native ratio from the width/height attributes */
  border: var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-card);
  background: var(--paper);
}
.art-fig figcaption {
  font-family: var(--font-mono);
  font-size: var(--text-label);
  color: var(--surface);
  opacity: 0.85;
  margin-top: var(--sp-2);
}
/* dark-surface contrast for the qualities list — no muted-on-ink text */
.art-notes .deflist > div { border-bottom-color: var(--dark-brown); }
.art-notes .deflist dt { color: var(--brand-gold); }
.art-notes .deflist dd { color: var(--surface); opacity: 0.85; }
.art-support {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 0.6fr);
  gap: var(--sp-6);
  align-items: end;
  margin-top: var(--sp-6);
}
.art-north {
  font-size: var(--text-caption);
  color: var(--surface);
  opacity: 0.8;
  margin-top: var(--sp-5);
  max-width: var(--max-w-narrow);
}

@media (max-width: 820px) {
  .art-feature, .art-support { grid-template-columns: 1fr; align-items: start; }
}

/* The playable Classic-mode demo (section 01) — token-drawn, JS-gated.
   Without JS the .demo-fallback stays visible; JS swaps in the canvas. */
.demo-stage {
  border: var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--sh-card);
  background: var(--paper);
  max-width: var(--max-w-narrow);
}
.demo-stage canvas {
  display: block;
  width: 100%;
  height: auto;
  cursor: pointer;
  touch-action: manipulation;
}
.demo-fallback { display: flex; gap: var(--sp-4); align-items: center; padding: var(--sp-4); }
.demo-fallback img { width: 96px; height: auto; flex: none; /* native 2:3 from attributes */ }
.demo-fallback p { margin: 0; font-size: var(--text-body-sm); color: var(--muted); }
@media (max-width: 820px) {
  .demo-fallback { flex-direction: column; align-items: flex-start; }
}

/* The sleep canon (01) — the emotional spine gets its own night plate */
.sleep-canon {
  background: var(--dark-brown);
  color: var(--surface);
  border: var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-pop);
  padding: var(--sp-5);
  max-width: var(--max-w-narrow);
}
.sleep-canon .kicker {
  font-family: var(--font-mono);
  font-size: var(--text-label);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brand-gold);
  margin: 0 0 var(--sp-2);
}
.sleep-canon h3 { color: var(--brand-gold); margin-bottom: var(--sp-3); }
.sleep-canon p { color: var(--surface); }
.sleep-canon p + p { margin-top: var(--sp-3); }
.sleep-canon .t-caption { color: var(--surface); opacity: 0.75; }

/* The moon — two dominions (07). The diagram is the one sanctioned circle
   in this book: one large hemisphere-split disc, light vs dark. */
.moon-feature {
  background: var(--dark-brown);
  color: var(--surface);
  border: var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-card);
  padding: var(--sp-5);
  display: grid;
  grid-template-columns: minmax(0, 320px) minmax(0, 1fr);
  gap: var(--sp-6);
  align-items: start;
}
.moon-feature h3 { color: var(--brand-gold); margin-bottom: var(--sp-3); }
.moon-feature p { color: var(--surface); }
.moon-feature .deflist > div { border-bottom-color: var(--ink); }
.moon-feature .deflist dd { color: var(--surface); opacity: 0.82; }
.moon-diagram {
  position: relative;
  width: min(280px, 100%);
  aspect-ratio: 1;
  margin: var(--sp-3) auto 0;
  border-radius: 50%;
  border: var(--border);
  background: linear-gradient(90deg, var(--cream) 50%, var(--ink-fixed) 50%);
  box-shadow: var(--sh-pop);
}
.moon-label {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44%;
  text-align: center;
  font-family: var(--font-mono);
  font-size: var(--text-label);
  letter-spacing: 0.08em;
  line-height: 1.6;
}
.moon-label--bright { left: 3%; color: var(--ink-fixed); }
.moon-label--dark { right: 3%; color: var(--cream); }
.moon-caption {
  font-family: var(--font-mono);
  font-size: var(--text-label);
  text-align: center;
  color: var(--surface);
  opacity: 0.7;
  margin: var(--sp-3) auto 0;
  max-width: 280px;
}
@media (max-width: 820px) {
  .moon-feature { grid-template-columns: 1fr; }
}

/* The lore card — the story block reads like night; inverts with the dusk alt */
.lore {
  background: var(--dark-brown);
  color: var(--surface);
  border: var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-card);
  padding: var(--sp-4) var(--sp-5);
}
.lore h3 { color: var(--brand-gold); margin-bottom: var(--sp-3); }
.lore p { color: var(--surface); }
.lore p + p { margin-top: var(--sp-3); }

/* The demo is interactive-only — it has no print form */
@media print {
  .demo-block { display: none !important; }
}

/* ---- 07 · roster gallery — the whole 32-fighter cast, main 4 + aux 4 per world ---- */
.roster-gallery { display: flex; flex-direction: column; gap: var(--sp-5); margin: var(--sp-5) 0 0; }
.rg-world {
  border: var(--border);
  border-radius: var(--r-lg);
  background: var(--paper);
  box-shadow: var(--sh-card);
  padding: var(--sp-3) var(--sp-4) var(--sp-4);
}
.rg-title { font-family: var(--font-display); font-size: var(--text-h4); margin: 0 0 var(--sp-2); }
.rg-sub { color: var(--muted); font-weight: 400; font-size: var(--text-body-sm); font-family: var(--font-body); }
.rg-lane {
  font-family: var(--font-mono);
  font-size: var(--text-label);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: var(--sp-3) 0 var(--sp-2);
  display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap;
}
.rg-lane--aux { color: var(--brand-orange); }
.rg-iap {
  font-size: var(--text-label);
  letter-spacing: 0;
  text-transform: none;
  color: var(--paper);
  background: var(--brand-orange);
  border: 2px solid var(--ink);
  border-radius: var(--r-pill);
  padding: 0.05rem 0.5rem;
}
/* Fighters are 171×256 native — pack many per row and never scale past native,
   so they stay crisp instead of blurring up to fill a 4-wide grid. */
.rg-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: var(--sp-3) var(--sp-4); }
.rf { margin: 0; text-align: center; }
.rf img {
  display: block;
  width: 100%; height: 132px; object-fit: contain;
  margin: 0 auto;
  background: var(--surface-warm);
  border: 2px solid var(--ink);
  border-radius: var(--r-md);
}
.rf--aux img { background: #FBF1DF; box-shadow: 3px 3px 0 var(--brand-orange); }
.rf figcaption {
  font-family: var(--font-display);
  font-size: var(--text-caption);
  margin-top: 0.4rem;
  display: flex; align-items: center; justify-content: center; gap: 0.4rem;
}

/* ---- 08 · versus control HUD — the real fight menu, played landscape ---- */
.versus { margin: 0; }
.vs-arena {
  position: relative;
  width: 100%; max-width: 560px;
  aspect-ratio: 16 / 9;
  border: var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-card);
  background: linear-gradient(180deg, #3A2F22 0%, #1E1811 72%);
  overflow: hidden;
}
.vs-hp { position: absolute; top: 14px; width: 34%; height: 14px; border: 2px solid var(--ink); border-radius: 5px; background: rgba(28,25,23,0.55); overflow: hidden; }
.vs-hp--l { left: 16px; }
.vs-hp--r { right: 16px; }
.vs-hp--r .vs-hp-fill { margin-left: auto; }
.vs-hp-fill { display: block; height: 100%; background: #4DC759; }
.vs-hp-fill--low { background: #DB332E; }
.vs-fighter { position: absolute; bottom: 26%; height: 48%; width: auto; filter: drop-shadow(2px 3px 0 rgba(0,0,0,0.4)); }
.vs-fighter--l { left: 19%; }
.vs-fighter--r { right: 19%; transform: scaleX(-1); }
.vs-center { position: absolute; top: 13px; left: 50%; transform: translateX(-50%); display: flex; gap: 8px; }
.vs-pill { font-family: var(--font-mono); font-weight: 700; font-size: 0.58rem; letter-spacing: 0.06em; color: var(--cream); background: rgba(0,0,0,0.42); border: 2px solid var(--ink); border-radius: var(--r-pill); padding: 2px 10px; }
.vs-stick { position: absolute; left: 22px; bottom: 20px; width: 66px; height: 66px; border-radius: 50%; border: 3px solid var(--ink); background: radial-gradient(circle at 50% 38%, rgba(255,255,255,0.18), rgba(0,0,0,0.28)); display: grid; place-items: center; }
.vs-nub { width: 30px; height: 30px; border-radius: 50%; background: var(--cream); border: 2px solid var(--ink); }
.vs-pad { position: absolute; right: 22px; bottom: 14px; width: 118px; height: 118px; }
.vs-shield { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); font-family: var(--font-mono); font-weight: 700; font-size: 0.5rem; letter-spacing: 0.06em; color: var(--ink); background: rgba(158,196,232,0.72); border: 2px solid rgba(255,255,255,0.6); border-radius: var(--r-pill); padding: 1px 8px; white-space: nowrap; }
.vs-diamond { position: absolute; inset: 0; }
.vs-verb { position: absolute; width: 38px; height: 38px; border-radius: 50%; border: 3px solid var(--ink); font-family: 'Arial Black', var(--font-display); font-weight: 900; font-size: 0.92rem; box-shadow: 3px 4px 0 rgba(0,0,0,0.35); cursor: default; padding: 0; }
.vs-verb--o { top: 0; left: 50%; transform: translateX(-50%); background: #E1C916; color: var(--ink); }
.vs-verb--p { right: 0; top: 50%; transform: translateY(-50%); background: #E16416; color: #fff; }
.vs-verb--a { bottom: 0; left: 50%; transform: translateX(-50%); background: #E19816; color: #fff; }
.vs-verb--t { left: 0; top: 50%; transform: translateY(-50%); background: #fff; color: var(--ink); }

/* ---- 18 · current-state gallery — the pre-revamp baseline screenshots ---- */
.cs-group { margin-top: var(--sp-5); }
.cs-title {
  font-family: var(--font-display);
  font-size: var(--text-h4);
  margin: 0 0 var(--sp-3);
  display: flex; align-items: baseline; gap: 0.6rem; flex-wrap: wrap;
}
.cs-tag {
  font-family: var(--font-mono);
  font-size: var(--text-label);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--brand-gold);
}
.cs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--sp-4); }
.shot { margin: 0; }
.shot img {
  width: 100%; height: auto;
  border: 2px solid var(--ink);
  border-radius: var(--r-md);
  box-shadow: var(--sh-card);
  background: var(--dark-brown);
}
.shot figcaption {
  font-size: var(--text-caption);
  color: var(--surface);
  opacity: 0.85;
  margin-top: 0.4rem;
}

@media (max-width: 640px) {
  .rg-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cs-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
