/* ==========================================================================
   TRIPWIRE — base stylesheet
   Night, electric, kinetic, premium. Never retro-hacker.
   Compass mode is a full theme swap driven by html.compass.
   ========================================================================== */

/* ---------- Fonts (self-hosted so the app works with no network) --------- */
@font-face {
  font-family: 'General Sans';
  src: url('../fonts/general-sans-400.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'General Sans';
  src: url('../fonts/general-sans-500.woff2') format('woff2');
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'General Sans';
  src: url('../fonts/general-sans-600.woff2') format('woff2');
  font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Bespoke Sans';
  src: url('../fonts/bespoke-sans-500.woff2') format('woff2');
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Bespoke Sans';
  src: url('../fonts/bespoke-sans-700.woff2') format('woff2');
  font-weight: 700; font-style: normal; font-display: swap;
}

/* ---------- Tokens ------------------------------------------------------- */
:root {
  --ink:        #0B1026;
  --surface:    #141A38;
  --surface-2:  #1B2247;
  --line:       #2C3563;
  --line-soft:  #232B54;
  --text:       #E8EAF2;
  --muted:      #9AA1BC;
  --accent:     #FFB020;
  --accent-ink: #2A1B00;
  --good:       #5EE6A8;
  --miss:       #FF5C8A;
  --good-ink:   #05271A;
  --miss-ink:   #330714;

  --font-display: 'Bespoke Sans', 'General Sans', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-body:    'General Sans', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;

  --text-xs:   0.8125rem;
  --text-sm:   0.9375rem;
  --text-base: 1.0625rem;
  --text-lg:   1.25rem;
  --text-xl:   1.5rem;
  --text-2xl:  2rem;
  --text-3xl:  2.75rem;

  --sp-1: 0.25rem; --sp-2: 0.5rem;  --sp-3: 0.75rem; --sp-4: 1rem;
  --sp-5: 1.5rem; --sp-6: 2rem;  --sp-7: 3rem;  --sp-8: 4rem;

  --r-sm: 8px; --r-md: 14px; --r-lg: 22px; --r-xl: 34px;
  --dur: 200ms;
  --shadow: 0 18px 40px rgba(3, 6, 20, 0.55);
  --maxw: 1120px;
}

/* Compass: same structure, ~40% less saturation, no alarm colours. */
html.compass {
  --ink:       #171B2C;
  --surface:   #20263C;
  --surface-2: #262D46;
  --line:      #3B4361;
  --line-soft: #333A54;
  --text:      #E4E6EE;
  --muted:     #A7ADC2;
  --accent:     #E3C58A;
  --accent-ink: #22200F;
  --good:       #9BD9BC;
  --miss:       #8A93B5;
  --good-ink:   #142520;
  --miss-ink:   #171B2C;
  --dur: 1ms;
}

/* ---------- Reset ------------------------------------------------------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.6;
  font-variant-numeric: tabular-nums lining-nums;
  min-height: 100vh;
}
body::before {
  /* One quiet gradient wash. No imagery, no glitch, no noise. */
  content: '';
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(1100px 620px at 12% -10%, rgba(255, 176, 32, 0.10), transparent 60%),
    radial-gradient(900px 520px at 96% 4%, rgba(94, 230, 168, 0.07), transparent 62%);
}
html.compass body::before { background: radial-gradient(1200px 700px at 20% -10%, rgba(227, 197, 138, 0.06), transparent 65%); }

img, svg, video { max-width: 100%; }
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.15; margin: 0 0 var(--sp-3); font-weight: 700; letter-spacing: -0.01em; }
h1 { font-size: var(--text-3xl); }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-lg); }
p  { margin: 0 0 var(--sp-4); }
a  { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--text); }
code, kbd, .mono { font-family: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace; }

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

.skip-link {
  position: absolute; left: var(--sp-4); top: -60px; z-index: 60;
  background: var(--accent); color: var(--accent-ink);
  padding: var(--sp-2) var(--sp-4); border-radius: var(--r-sm); font-weight: 600;
  transition: top var(--dur) ease;
}
.skip-link:focus { top: var(--sp-4); }

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 var(--sp-5); }
.narrow { max-width: 760px; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

/* ---------- Header ------------------------------------------------------ */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(11, 16, 38, 0.92);
  border-bottom: 1px solid var(--line-soft);
  backdrop-filter: blur(10px);
}
html.compass .site-header { background: rgba(23, 27, 44, 0.97); backdrop-filter: none; }
.header-inner {
  display: flex; align-items: center; gap: var(--sp-4);
  min-height: 68px; padding: var(--sp-2) var(--sp-5);
  max-width: var(--maxw); margin: 0 auto;
}
.brand {
  display: inline-flex; align-items: center; gap: var(--sp-3);
  font-family: var(--font-display); font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; font-size: var(--text-sm); color: var(--text);
  text-decoration: none; flex: 0 0 auto;
}
.brand .logo { width: 30px; height: 30px; color: var(--accent); flex: 0 0 auto; }
.brand-tag { display: block; font-size: var(--text-xs); letter-spacing: 0.02em; text-transform: none; color: var(--muted); font-family: var(--font-body); font-weight: 400; }
.site-nav { margin-left: auto; }
.site-nav ul { display: flex; flex-wrap: wrap; gap: var(--sp-1); list-style: none; margin: 0; padding: 0; }
.site-nav a {
  display: inline-flex; align-items: center; min-height: 44px;
  padding: 0 var(--sp-3); border-radius: var(--r-sm);
  color: var(--muted); text-decoration: none; font-size: var(--text-sm); font-weight: 500;
}
.site-nav a:hover { color: var(--text); background: var(--surface); }
.site-nav a[aria-current="page"] { color: var(--accent); background: var(--surface); }
.nav-toggle {
  display: none; margin-left: auto; min-height: 44px; min-width: 44px;
  align-items: center; gap: var(--sp-2);
  background: var(--surface); color: var(--text);
  border: 1px solid var(--line); border-radius: var(--r-sm);
  font: inherit; font-size: var(--text-sm); font-weight: 500; padding: 0 var(--sp-3); cursor: pointer;
}
.header-meta { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; }

@media (max-width: 900px) {
  .nav-toggle { display: inline-flex; }
  .site-nav {
    display: none; width: 100%; margin: 0; order: 3;
    border-top: 1px solid var(--line-soft); padding-top: var(--sp-3);
  }
  .site-nav.open { display: block; }
  .site-nav ul { flex-direction: column; }
  .site-nav a { width: 100%; }
  .header-inner { flex-wrap: wrap; }
}

/* ---------- Badges, chips, buttons -------------------------------------- */
.badge {
  display: inline-flex; align-items: center; gap: var(--sp-1);
  padding: 4px 10px; border-radius: 999px;
  font-size: var(--text-xs); font-weight: 600; letter-spacing: 0.02em;
  border: 1px solid var(--line); color: var(--muted); background: var(--surface);
}
.badge-accent { color: var(--accent); border-color: rgba(255, 176, 32, 0.4); }
.badge-good { color: var(--good); border-color: rgba(94, 230, 168, 0.4); }
.badge-miss { color: var(--miss); border-color: rgba(255, 92, 138, 0.4); }
html.compass .badge-accent { border-color: var(--line); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  min-height: 48px; padding: 0 var(--sp-5);
  border-radius: var(--r-md); border: 1px solid var(--line);
  background: var(--surface-2); color: var(--text);
  font: inherit; font-weight: 600; font-size: var(--text-sm);
  text-decoration: none; cursor: pointer;
  transition: transform var(--dur) ease, background var(--dur) ease, border-color var(--dur) ease;
}
.btn:hover { background: var(--line-soft); color: var(--text); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn-primary:hover { background: #ffc352; color: var(--accent-ink); }
html.compass .btn-primary:hover { background: #edd6a8; }
.btn-quiet { background: transparent; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.btn-row { display: flex; flex-wrap: wrap; gap: var(--sp-3); }

.chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 34px;
  padding: 0 var(--sp-3); border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface);
  color: var(--muted); font-size: var(--text-xs); font-weight: 500; text-decoration: none;
}
a.chip:hover { color: var(--text); border-color: var(--accent); }

/* ---------- Cards & layout blocks -------------------------------------- */
.panel {
  background: var(--surface); border: 1px solid var(--line-soft);
  border-radius: var(--r-lg); padding: var(--sp-5);
}
.panel-tight { padding: var(--sp-4); }
.grid { display: grid; gap: var(--sp-4); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.stack > * + * { margin-top: var(--sp-4); }
.section { padding: var(--sp-7) 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-4); flex-wrap: wrap; margin-bottom: var(--sp-5); }
.eyebrow { font-size: var(--text-xs); letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent); font-weight: 600; margin: 0 0 var(--sp-2); }
.lede { font-size: var(--text-lg); color: var(--muted); max-width: 62ch; }
.muted { color: var(--muted); }
.small { font-size: var(--text-sm); }
.tiny { font-size: var(--text-xs); }
.num { font-variant-numeric: tabular-nums lining-nums; }

/* ---------- Hero ------------------------------------------------------- */
.hero { padding: var(--sp-8) 0 var(--sp-6); }
.hero h1 { max-width: 22ch; }
.hero-line {
  height: 2px; margin: var(--sp-5) 0; border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--accent) 42%, var(--accent) 58%, transparent);
  opacity: 0.7;
}

/* ---------- Mode picker ------------------------------------------------ */
.mode-grid { display: grid; gap: var(--sp-4); grid-template-columns: repeat(auto-fit, minmax(255px, 1fr)); }
.mode-card {
  display: flex; flex-direction: column; gap: var(--sp-2);
  padding: var(--sp-5); text-align: left; text-decoration: none;
  background: var(--surface); border: 1px solid var(--line-soft);
  border-radius: var(--r-lg); color: var(--text);
  transition: transform var(--dur) ease, border-color var(--dur) ease;
}
.mode-card:hover { border-color: var(--accent); transform: translateY(-2px); color: var(--text); }
html.compass .mode-card:hover { transform: none; }
.mode-card[aria-pressed="true"], .mode-card.is-active { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.mode-card h3 { margin: 0; }
.mode-ages { font-size: var(--text-xs); letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); font-weight: 600; }
.mode-card p { margin: 0; color: var(--muted); font-size: var(--text-sm); }

/* ---------- Device frames --------------------------------------------- */
.stage { display: flex; justify-content: center; }
.device {
  width: 100%; max-width: 420px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow);
  overflow: hidden;
}
html.compass .device { box-shadow: none; }
.device-laptop { max-width: 720px; border-radius: var(--r-lg); }
.device-chrome {
  /* Fixed height on both device types: a laptop URL bar and a phone notch must
     occupy the same space, or the action row below shifts between cards. */
  display: flex; align-items: center; gap: var(--sp-2);
  height: 56px; box-sizing: border-box;
  padding: 0 var(--sp-4);
  border-bottom: 1px solid var(--line);
  background: rgba(11, 16, 38, 0.5);
  font-size: var(--text-xs); color: var(--muted);
}
.device-notch { width: 46px; height: 5px; border-radius: 999px; background: var(--line); }
.device-dots { display: inline-flex; gap: 6px; }
.device-dots i { width: 9px; height: 9px; border-radius: 999px; background: var(--line); display: block; }
.device-url {
  flex: 1; min-width: 0; padding: 4px 10px; border-radius: 999px;
  background: var(--ink); border: 1px solid var(--line);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.device-body { padding: var(--sp-4); }
.device-body-scroll { min-height: 260px; }
/* Compass: the card area is a fixed size and scrolls internally, so the three
   action buttons sit in exactly the same place on every card. */
html.compass .device-body-scroll { height: 340px; overflow-y: auto; }
@media (max-width: 560px) { html.compass .device-body-scroll { height: 300px; } }

.sender-row { display: flex; align-items: center; gap: var(--sp-3); padding-bottom: var(--sp-3); border-bottom: 1px solid var(--line-soft); }
.avatar {
  width: 42px; height: 42px; flex: 0 0 auto; border-radius: 999px;
  display: grid; place-items: center;
  background: var(--line-soft); color: var(--text);
  font-family: var(--font-display); font-weight: 700; font-size: var(--text-sm);
}
.sender-name { font-weight: 600; }
.sender-detail, .sender-time { color: var(--muted); font-size: var(--text-xs); word-break: break-word; }
/* The detail line sits inline next to the sender name on phone cards, so it needs
   its own separation rather than relying on whitespace in the markup. */
span.sender-detail { margin-left: 0.5rem; }
p.sender-detail { margin: 0.15rem 0 0; }
.sender-time { margin-left: auto; flex: 0 0 auto; white-space: nowrap; }

.bubble {
  margin-top: var(--sp-4);
  padding: var(--sp-4);
  border-radius: 18px 18px 18px 6px;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  font-size: var(--text-base);
  overflow-wrap: anywhere;
}
.bubble-subject { font-weight: 600; margin-bottom: var(--sp-2); font-family: var(--font-display); }
.bubble-link { margin-top: var(--sp-3); color: var(--accent); word-break: break-all; font-size: var(--text-sm); }
.bubble-link .fake-link { text-decoration: underline; }
.call-card { text-align: center; padding: var(--sp-6) var(--sp-4); }
.call-card .avatar { width: 68px; height: 68px; margin: 0 auto var(--sp-4); font-size: var(--text-lg); }

.media-holder {
  margin-top: var(--sp-4); padding: var(--sp-4);
  border: 1px dashed var(--line); border-radius: var(--r-md);
  background: rgba(11, 16, 38, 0.45);
}
.media-holder p { margin: 0 0 var(--sp-3); color: var(--muted); font-size: var(--text-sm); }
.media-holder video, .media-holder audio { width: 100%; margin-top: var(--sp-3); }

/* ---------- Play HUD -------------------------------------------------- */
.hud {
  display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap;
  padding: var(--sp-3) var(--sp-4); margin-bottom: var(--sp-4);
  background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--r-md);
}
.hud-item { display: flex; flex-direction: column; line-height: 1.25; }
.hud-label { font-size: var(--text-xs); color: var(--muted); letter-spacing: 0.08em; text-transform: uppercase; }
.hud-value { font-family: var(--font-display); font-weight: 700; font-size: var(--text-lg); }
.hud-right { margin-left: auto; display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; }

.timer { display: flex; align-items: center; gap: var(--sp-2); }
.timer-track { width: 92px; height: 6px; border-radius: 999px; background: var(--line-soft); overflow: hidden; }
.timer-fill { display: block; height: 100%; width: 100%; background: var(--accent); }
.timer.is-low .timer-fill { background: var(--miss); }

.actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-3); margin-top: var(--sp-5); }
.action {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: 66px; padding: var(--sp-3);
  border-radius: var(--r-md); border: 1px solid var(--line);
  background: var(--surface-2); color: var(--text);
  font: inherit; font-weight: 600; cursor: pointer;
  transition: border-color var(--dur) ease, background var(--dur) ease;
}
.action:hover { border-color: var(--accent); }
.action .key {
  font-size: var(--text-xs); color: var(--muted); font-weight: 500;
  border: 1px solid var(--line); border-radius: 5px; padding: 0 5px;
}
.action[disabled] { opacity: 0.55; }
@media (max-width: 420px) {
  .actions { grid-template-columns: 1fr; }
  .action { min-height: 52px; flex-direction: row; gap: var(--sp-2); }
}

/* ---------- Explain panel -------------------------------------------- */
.explain { margin-top: var(--sp-5); border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--surface); overflow: hidden; }
.explain-head { display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap; padding: var(--sp-4) var(--sp-5); border-bottom: 1px solid var(--line-soft); }
.explain-head h2 { margin: 0; font-size: var(--text-xl); }
.explain.is-good .explain-head { background: rgba(94, 230, 168, 0.10); }
.explain.is-miss .explain-head { background: rgba(255, 92, 138, 0.10); }
html.compass .explain.is-good .explain-head { background: rgba(155, 217, 188, 0.10); }
html.compass .explain.is-miss .explain-head { background: rgba(138, 147, 181, 0.12); }
.explain-body { padding: var(--sp-5); }
.explain-body > * + * { margin-top: var(--sp-4); }
.tells { list-style: none; margin: 0; padding: 0; }
.tells li { position: relative; padding-left: var(--sp-5); margin-bottom: var(--sp-3); }
.tells li::before { content: ''; position: absolute; left: 0; top: 0.62em; width: 12px; height: 2px; border-radius: 2px; background: var(--accent); }
.link-truth { display: grid; gap: var(--sp-2); }
.link-truth div { display: flex; gap: var(--sp-3); flex-wrap: wrap; align-items: baseline; padding: var(--sp-3); border-radius: var(--r-sm); background: var(--surface-2); }
.link-truth span:first-child { font-size: var(--text-xs); text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); min-width: 110px; }
.link-truth code { word-break: break-all; font-size: var(--text-sm); }
.link-truth .real { color: var(--miss); }
.subhead { font-family: var(--font-display); font-weight: 700; font-size: var(--text-sm); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin: 0 0 var(--sp-2); }

/* ---------- Compass extras ------------------------------------------- */
.compass-only { display: none; }
html.compass .compass-only { display: block; }
html.compass .no-compass, html.compass .hide-in-compass { display: none !important; }
.next-notice { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); padding: var(--sp-5); }
.next-notice ol { margin: 0 0 var(--sp-4); padding-left: 1.3em; }
.next-notice li { margin-bottom: var(--sp-2); }
.stop-bar { display: flex; justify-content: flex-end; margin-bottom: var(--sp-3); }

/* ---------- Wire ------------------------------------------------------ */
.wire-item { border: 1px solid var(--line-soft); border-radius: var(--r-md); background: var(--surface); padding: var(--sp-4); }
.wire-item h3 { margin-bottom: var(--sp-2); }
.wire-meta { display: flex; gap: var(--sp-2); flex-wrap: wrap; align-items: center; margin-bottom: var(--sp-3); }
.do-this { border-left: 3px solid var(--accent); padding-left: var(--sp-3); margin: var(--sp-3) 0; }
.words-strip { display: grid; gap: var(--sp-3); grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.word-card { border: 1px solid var(--line-soft); border-radius: var(--r-md); padding: var(--sp-4); background: var(--surface-2); }
.word-card h4 { margin: 0 0 var(--sp-2); font-size: var(--text-base); }

/* ---------- Deck ------------------------------------------------------ */
.deck-grid { display: grid; gap: var(--sp-4); grid-template-columns: repeat(auto-fill, minmax(258px, 1fr)); }
.deck-card {
  display: flex; flex-direction: column; gap: var(--sp-2);
  border: 1px solid var(--line-soft); border-radius: var(--r-md);
  background: var(--surface); padding: var(--sp-4);
  page-break-inside: avoid;
}
.deck-card.is-locked { opacity: 0.72; border-style: dashed; }
.deck-card h3 { font-size: var(--text-base); margin: 0; }
.deck-tier { font-size: var(--text-xs); letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); font-weight: 600; }
.deck-card p { margin: 0; font-size: var(--text-sm); color: var(--muted); }
.filter-bar { display: flex; gap: var(--sp-2); flex-wrap: wrap; align-items: center; margin-bottom: var(--sp-5); }
.filter-bar label { font-size: var(--text-sm); color: var(--muted); }
select, input[type="text"] {
  min-height: 44px; padding: 0 var(--sp-3);
  background: var(--surface-2); color: var(--text);
  border: 1px solid var(--line); border-radius: var(--r-sm);
  font: inherit; font-size: var(--text-sm);
}

/* ---------- Scenario -------------------------------------------------- */
.step-options { display: grid; gap: var(--sp-3); margin-top: var(--sp-4); }
.step-option {
  text-align: left; min-height: 56px; padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-md); border: 1px solid var(--line);
  background: var(--surface-2); color: var(--text); font: inherit; cursor: pointer;
}
.step-option:hover { border-color: var(--accent); }
.step-option.is-good { border-color: var(--good); }
.step-option.is-bad { border-color: var(--miss); }
.ladder { display: flex; gap: var(--sp-2); flex-wrap: wrap; list-style: none; margin: 0 0 var(--sp-4); padding: 0; }
.ladder li { font-size: var(--text-xs); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; }
.ladder li.done { color: var(--good); border-color: var(--good); }

/* ---------- Family ---------------------------------------------------- */
.player-row { display: grid; gap: var(--sp-3); grid-template-columns: minmax(140px, 1fr) minmax(150px, 1fr) auto; align-items: end; }
.player-row .field { display: grid; gap: var(--sp-1); }
.player-row label { font-size: var(--text-xs); color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
.scoreboard { width: 100%; border-collapse: collapse; }
.scoreboard th, .scoreboard td { text-align: left; padding: var(--sp-3); border-bottom: 1px solid var(--line-soft); font-size: var(--text-sm); }
.scoreboard thead th { color: var(--muted); font-size: var(--text-xs); text-transform: uppercase; letter-spacing: 0.08em; }
.scoreboard tbody th { color: var(--text); font-weight: 600; }
.scoreboard tr.is-turn td { background: var(--surface-2); }
@media (max-width: 560px) {
  .player-row { grid-template-columns: 1fr; }
  /* Fixed layout so four columns can never push past a narrow screen. */
  .scoreboard { table-layout: fixed; }
  .scoreboard th, .scoreboard td { padding: var(--sp-2); font-size: var(--text-xs); overflow-wrap: anywhere; }
}

/* ---------- Empty / error states -------------------------------------- */
.empty {
  border: 1px dashed var(--line); border-radius: var(--r-lg);
  padding: var(--sp-6) var(--sp-5); text-align: center; color: var(--muted);
  background: var(--surface);
}
.empty h2 { color: var(--text); }

/* ---------- Footer ---------------------------------------------------- */
.site-footer { border-top: 1px solid var(--line-soft); margin-top: var(--sp-8); padding: var(--sp-6) 0 var(--sp-7); background: rgba(11, 16, 38, 0.6); }
.footer-grid { display: grid; gap: var(--sp-5); grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.site-footer h2 { font-size: var(--text-sm); letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: var(--sp-2); }
.site-footer a { color: var(--text); text-decoration: none; font-size: var(--text-sm); }
.site-footer a:hover { color: var(--accent); }
.disclaimer { margin-top: var(--sp-5); padding-top: var(--sp-4); border-top: 1px solid var(--line-soft); color: var(--muted); font-size: var(--text-xs); max-width: 90ch; }

/* ---------- Motion ---------------------------------------------------- */
@keyframes deal-in {
  from { opacity: 0; transform: translateY(14px) scale(0.985); }
  to   { opacity: 1; transform: none; }
}
.deal { animation: deal-in 220ms cubic-bezier(0.22, 0.9, 0.3, 1) both; }
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; scroll-behavior: auto !important; }
}
html.compass .deal { animation: none; }
html.compass *, html.compass *::before, html.compass *::after {
  animation-duration: 1ms !important; transition-duration: 1ms !important; animation-iteration-count: 1 !important;
}

@media (max-width: 640px) {
  :root { --text-3xl: 2.05rem; --text-2xl: 1.6rem; }
  .wrap { padding: 0 var(--sp-4); }
  .section { padding: var(--sp-6) 0; }
}

/* ---------- Golden band: unhurried, larger type ------------------------ */
html.band-golden { font-size: 118%; }
html.band-golden .bubble, html.band-golden .explain-body { line-height: 1.7; }
html.band-sprouts { font-size: 108%; }

/* ---------- Motion cards -----------------------------------------------
   Believable full-screen scam chrome built from real text, not video, so
   every word stays crisp. Static in Compass and under reduced motion.
   ---------------------------------------------------------------------- */
.motion-card {
  position: relative;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: #10152f;
  overflow: hidden;
  isolation: isolate;
}
.motion-card-bar {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4);
  padding: var(--sp-2) var(--sp-4);
  background: #7a1330; color: #ffe9ef;
  font-size: var(--text-xs); font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
}
html.compass .motion-card-bar { background: #3d4463; color: var(--text); }
.motion-card-body { padding: var(--sp-5) var(--sp-5) var(--sp-6); text-align: center; }
.motion-card-brand {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  font-family: var(--font-display); font-weight: 700; letter-spacing: 0.04em;
  color: var(--text); margin-bottom: var(--sp-3);
}
.motion-card-brand .mark {
  width: 22px; height: 22px; border-radius: 6px;
  background: var(--accent); color: var(--accent-ink);
  display: grid; place-items: center; font-size: 12px;
}
.motion-card h3 { font-size: var(--text-xl); margin-bottom: var(--sp-2); }
.motion-card p { color: var(--muted); font-size: var(--text-sm); margin: 0 auto var(--sp-3); max-width: 46ch; }
.motion-card-code { color: var(--text); font-size: var(--text-sm); }
.motion-cta {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  min-height: 52px; padding: 0 var(--sp-6); margin-top: var(--sp-3);
  border-radius: var(--r-md); border: 0;
  background: var(--accent); color: var(--accent-ink);
  font: inherit; font-family: var(--font-display); font-weight: 700; font-size: var(--text-lg);
  letter-spacing: 0.02em; cursor: default;
}
.motion-card-fineprint { margin-top: var(--sp-4); font-size: var(--text-xs); color: var(--muted); }
.motion-cursor {
  position: absolute; width: 26px; height: 26px; left: 50%; top: 62%;
  color: var(--text); pointer-events: none;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.6));
  animation: cursor-drift 3.4s ease-in-out infinite alternate;
}
@keyframes cursor-drift {
  from { transform: translate(46px, 46px) rotate(-6deg); }
  to   { transform: translate(-6px, -6px) rotate(0deg); }
}
html.compass .motion-cursor { animation: none; transform: translate(6px, 6px); }
@media (prefers-reduced-motion: reduce) {
  .motion-cursor { animation: none; transform: translate(6px, 6px); }
}
