/* game/styles/game.css — Quartermint: The Game shell styling.
 * Dark Ink game canvas; report card flips to Parchment. Editorial Treasury discipline:
 * hairline rules, near-square radii, zero gradients/bubbles, four-mark geometry.
 */

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { font-family: var(--font-body); line-height: 1.5; }
a { color: var(--ink-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── boot / loading skeleton + noscript ─────────────────────────────────────── */
[hidden] { display: none !important; } /* defensive: a fixed-overlay [hidden] must not eat clicks */
.boot { position: fixed; inset: 0; display: grid; place-content: center; gap: 16px; text-align: center; }
.boot-mark { font-size: 28px; letter-spacing: 6px; color: var(--ink-accent); }
.boot-text { color: var(--ink-text-muted); font-family: var(--font-mono); font-size: 13px; }
.ns-fallback { padding: 48px; text-align: center; color: var(--ink-text); }

#stage { max-width: 980px; margin: 0 auto; padding: 32px 24px 80px; }

/* ── topbar ──────────────────────────────────────────────────────────────────── */
.topbar { display: flex; align-items: baseline; justify-content: space-between;
  border-bottom: var(--hairline) solid var(--ink-rule); padding-bottom: 12px; margin-bottom: 28px; }
.wordmark { font-family: var(--font-display); font-weight: 500; font-size: 20px;
  font-variation-settings: "opsz" 36; }
.wordmark .marks { color: var(--ink-accent); letter-spacing: 4px; margin-right: 10px; font-size: 15px; }
.daychip { font-family: var(--font-mono); font-size: 12px; color: var(--ink-text-faint);
  border: var(--hairline) solid var(--ink-rule); border-radius: var(--radius); padding: 3px 8px; }

/* ── The Table on the axis (player select, VISION §7.8) ───────────────────────── */
.table-axis { position: relative; width: min(680px, 92vw); margin: 16px auto 0; padding: 24px 0; }
.axis-label { position: absolute; font-family: var(--font-mono); font-size: 11px;
  color: var(--ink-text-faint); text-transform: uppercase; letter-spacing: 1px; }
.axis-top { top: -4px; left: 50%; transform: translateX(-50%); }
.axis-bottom { bottom: -4px; left: 50%; transform: translateX(-50%); }
.axis-left { left: -8px; top: 50%; transform: translateY(-50%) rotate(-90deg); transform-origin: left; }
.axis-right { right: -8px; top: 50%; transform: translateY(-50%) rotate(90deg); transform-origin: right; }
/* Cross/plus grid: four seats at the N/S/E/W poles, center label in the middle.
 * Fully fluid — cards size to their cell and content, so they never overlap at any
 * width (the old absolute-pole model collided once card copy ran taller than the
 * fixed square). The empty corner cells preserve the diamond negative space. */
.diamond { display: grid; grid-template-columns: repeat(3, 1fr);
  grid-template-areas: ".  top  ." "left center right" ".  bottom ."; gap: 16px; align-items: start; }
.seat-node { padding: 16px;
  background: var(--ink-surface); border: var(--hairline) solid var(--ink-rule-strong);
  border-radius: var(--radius); cursor: pointer; transition: border-color .12s, transform .12s; }
.seat-node:hover, .seat-node:focus-visible { border-color: var(--ink-accent); transform: translateY(-2px); outline: none; }
.seat-node .mark { font-size: 22px; color: var(--ink-accent); }
.seat-node .seat-title { font-family: var(--font-display); font-weight: 500; font-size: 18px; margin: 4px 0 6px; }
.seat-node .seat-surface { font-family: var(--font-mono); font-size: 11px; color: var(--ink-text-faint); }
.seat-node .seat-stake { font-size: 13px; color: var(--ink-text-muted); margin-top: 8px; }
.node-top { grid-area: top; }
.node-bottom { grid-area: bottom; }
.node-left { grid-area: left; }
.node-right { grid-area: right; }
.table-center { grid-area: center; align-self: center; text-align: center;
  font-family: var(--font-mono); font-size: 12px; color: var(--ink-text-faint); }
.table-center .race { font-family: var(--font-display); font-size: 16px; color: var(--ink-text); }
.seat-node.disabled { opacity: .55; cursor: not-allowed; }
.seat-node.disabled:hover { transform: none; border-color: var(--ink-rule-strong); }
.coming-tag { font-family: var(--font-mono); font-size: 10px; color: var(--ink-text-faint);
  border: var(--hairline) solid var(--ink-rule); border-radius: var(--radius); padding: 1px 5px; float: right; }

/* Shared stack breakpoint — matches .board-grid below (was an ad-hoc 640 here vs
 * 720 there). Below it the cross collapses to a single readable column; the axis
 * labels are desktop-only chrome and hide. */
@media (max-width: 720px) {
  .table-axis { width: 100%; margin-top: 8px; padding: 0; }
  .axis-label { display: none; }
  .diamond { display: flex; flex-direction: column; gap: 12px; }
  .seat-node:hover, .seat-node:focus-visible { transform: none; }
  .table-center { order: -1; margin-bottom: 4px; }
}

.intro-lede { text-align: center; max-width: 640px; margin: 0 auto 8px; color: var(--ink-text-muted); font-size: 15px; }
.intro-h { text-align: center; font-family: var(--font-display); font-weight: 500;
  font-size: clamp(28px, 4vw, 40px); font-variation-settings: "opsz" 72; margin: 4px 0 4px; }

/* ── in-turn board ─────────────────────────────────────────────────────────────── */
.board-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 20px; }
@media (max-width: 720px) { .board-grid { grid-template-columns: 1fr; } }
.card { background: var(--ink-surface); border: var(--hairline) solid var(--ink-rule);
  border-radius: var(--radius); padding: 18px; }
.card h3 { font-family: var(--font-display); font-weight: 500; margin: 0 0 12px; font-size: 18px; }
.metric { display: flex; justify-content: space-between; padding: 8px 0;
  border-bottom: var(--hairline) solid var(--ink-rule); }
.metric:last-child { border-bottom: 0; }
.metric .label { color: var(--ink-text-muted); font-size: 13px; }
.metric .val { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* win-prob meter with the 50% win-line (VISION §7.14) */
.meter { position: relative; height: 14px; background: var(--ink-surface-subtle);
  border-radius: var(--radius); margin-top: 8px; overflow: hidden; }
.meter .fill { height: 100%; background: var(--ink-primary); transition: width .4s; }
.meter .winline { position: absolute; top: -4px; bottom: -4px; left: 50%; width: 2px;
  background: var(--ink-accent); }
.meter-cap { font-family: var(--font-mono); font-size: 11px; color: var(--ink-text-faint); margin-top: 4px; }

.feed-item { font-size: 13px; padding: 8px 0; border-bottom: var(--hairline) solid var(--ink-rule);
  color: var(--ink-text-muted); }
.feed-item:last-child { border-bottom: 0; }
.feed-item .tag { font-family: var(--font-mono); font-size: 10px; color: var(--ink-accent); margin-right: 6px; }

.deep-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.deep-link, .live-link { display: inline-block; font-family: var(--font-mono); font-size: 12px;
  border: var(--hairline) solid var(--ink-rule-strong); border-radius: var(--radius); padding: 6px 12px; }
.deep-link::before { content: "↗ "; }
/* The live CTA is the brighter, primary path; the cached snapshot is the always-reliable one. */
.live-link { border-color: var(--ink-primary); color: var(--ink-primary); }

.advance-row { display: flex; justify-content: flex-end; margin-top: 24px; }
button.btn { font-family: var(--font-body); font-weight: 500; font-size: 14px; cursor: pointer;
  border: var(--hairline) solid var(--ink-primary); background: var(--ink-primary);
  color: var(--ink-primary-text); border-radius: var(--radius); padding: 10px 22px; }
button.btn:disabled { opacity: .5; cursor: not-allowed; }
button.btn.ghost { background: transparent; color: var(--ink-text); border-color: var(--ink-rule-strong); }

/* ── decision card (modal over dimmed board) ─────────────────────────────────── */
.scrim { position: fixed; inset: 0; background: rgba(7, 11, 16, .78); display: grid;
  place-content: center; padding: 20px; z-index: 50; }
.decision { width: min(560px, 94vw); background: var(--ink-surface);
  border: var(--hairline) solid var(--ink-rule-strong); border-radius: var(--radius); padding: 24px; }
.decision .day { font-family: var(--font-mono); font-size: 11px; color: var(--ink-text-faint); }
.decision h2 { font-family: var(--font-display); font-weight: 500; font-size: 22px;
  font-variation-settings: "opsz" 48; margin: 6px 0 10px; }
.decision .beat { color: var(--ink-text-muted); font-size: 14px; margin-bottom: 18px; }
.choice { width: 100%; text-align: left; cursor: pointer; background: var(--ink-surface-subtle);
  border: var(--hairline) solid var(--ink-rule); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 10px; }
.choice:hover, .choice:focus-visible { border-color: var(--ink-accent); outline: none; }
.choice .clabel { font-size: 14px; color: var(--ink-text); }
.choice .deltas { margin-top: 6px; display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; }
.choice .flag-warn { color: var(--superpac-accent); font-family: var(--font-mono); font-size: 11px; }

/* FLAG beat — the rake (VISION §7.5) */
.flag-beat { width: min(560px, 94vw); background: var(--superpac-canvas);
  border: 1px solid var(--superpac-accent); border-radius: var(--radius); padding: 24px; }
.flag-beat .headline { font-family: var(--font-display); font-style: italic; font-weight: 500;
  color: var(--superpac-accent); font-size: 20px; margin-bottom: 10px; }
.flag-beat .why { font-size: 14px; color: var(--ink-text-muted); margin-bottom: 8px; }
.flag-beat .cite { font-family: var(--font-mono); font-size: 11px; color: var(--ink-text-faint);
  border-left: 2px solid var(--ink-rule-strong); padding-left: 10px; margin: 12px 0; }

/* ── defection transition — the one-way door cinematic (VISION §7.10, §7.15) ──── */
.defection-scrim { background: rgba(5, 7, 11, .92); }
.defection { width: min(560px, 94vw); background: var(--superpac-canvas);
  border: 1px solid var(--superpac-accent); border-radius: var(--radius); padding: 32px; text-align: center; }
.defection .def-slate { position: relative; display: inline-block; font-size: 22px; letter-spacing: 8px;
  color: var(--ink-text-muted); margin-bottom: 16px; }
.defection .def-strike { position: absolute; left: -4px; right: -4px; top: 50%; height: 2px;
  background: var(--superpac-accent); transform: scaleX(0); transform-origin: left;
  animation: def-strike 600ms ease-out 200ms forwards; }
@keyframes def-strike { to { transform: scaleX(1); } }
.defection .def-checks { font-family: var(--font-display); font-style: italic; font-size: 40px;
  color: var(--ink-accent); letter-spacing: 12px; animation: def-slam 500ms ease-out 500ms both; }
@keyframes def-slam { from { opacity: 0; transform: scale(1.6); } to { opacity: 1; transform: scale(1); } }
.defection .def-cap { font-family: var(--font-mono); font-size: 18px; color: var(--ink-text); margin: 12px 0 8px; }
.defection .def-cap .def-inf { color: var(--superpac-accent); font-size: 24px; }
.defection .def-cap .def-arrow { color: var(--ink-text-faint); }
.defection h2 { font-family: var(--font-display); font-style: italic; font-weight: 500;
  font-size: 24px; color: var(--ink-text); margin: 18px 0 10px; }
.defection .def-line { color: var(--ink-text-muted); font-size: 14px; margin-bottom: 22px; }

/* ── report card — the Parchment flip (VISION §7.6, §7.15) ────────────────────── */
.report-flip { min-height: 100vh; padding: 48px 24px 96px; }
.report-flip .rc-wrap { max-width: 760px; margin: 0 auto; }
.report-flip .rc-marks { color: var(--et-accent); letter-spacing: 6px; font-size: 18px; text-align: center; }
.report-flip h1 { text-align: center; font-size: clamp(32px, 5vw, 56px);
  font-variation-settings: "opsz" 96; margin: 12px 0 4px; }
.report-flip .verdict { text-align: center; font-style: italic; font-size: 22px; color: var(--et-primary); margin-bottom: 28px; }
.rc-grade { border-top: var(--hairline) solid var(--et-rule); padding: 18px 0; display: grid;
  grid-template-columns: 160px 1fr auto; gap: 16px; align-items: baseline; }
.rc-grade .g-name { font-family: var(--font-display); font-size: 18px; }
.rc-grade .g-note { color: var(--et-text-muted); font-size: 14px; }
.rc-grade .g-mark { font-family: var(--font-mono); font-weight: 500; }
.rc-grade .pass { color: var(--color-success-light); }
.rc-grade .fail { color: var(--color-error-light); }
.rc-deliverable { margin-top: 40px; border-top: 2px solid var(--et-primary); padding-top: 24px; text-align: center; }
.rc-deliverable h2 { font-size: 24px; }
.rc-deliverable .sub { color: var(--et-text-muted); font-size: 14px; margin: 6px 0 18px; }
.dl-btn { font-family: var(--font-body); font-weight: 500; font-size: 15px; cursor: pointer;
  border: var(--hairline) solid var(--et-primary); background: var(--et-primary); color: var(--et-primary-text);
  border-radius: var(--radius); padding: 12px 26px; }
.dl-btn:disabled { opacity: .5; cursor: not-allowed; }
.rc-fineprint { font-family: var(--font-mono); font-size: 11px; color: var(--et-text-faint); margin-top: 14px; }
.rc-replay { margin-top: 36px; text-align: center; }
.rc-replay a { color: var(--et-primary); font-size: 14px; cursor: pointer; }

/* ── game-feel amplification (CEO/Design/Eng review 2026-06-04) ────────────────
 * Editorial restraint preserved: motion via transform/opacity only, sound muted by
 * default, every cinematic degrades to its end-state under prefers-reduced-motion.    */

/* Topbar right group: daychip + SOUND toggle sit together, wrap below at 375 (Design D2). */
.topbar-right { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }

/* SOUND toggle — a mono chip matching the daychip, NOT a speaker icon (Design D2). */
.soundchip {
  font-family: var(--font-mono); font-size: 12px; color: var(--ink-text-faint);
  background: transparent; border: var(--hairline) solid var(--ink-rule); border-radius: var(--radius);
  padding: 3px 8px; min-height: 44px; cursor: pointer; letter-spacing: .5px;
  transition: border-color .12s, color .12s; }
.soundchip:hover { border-color: var(--ink-accent); color: var(--ink-text-muted); }
.soundchip:focus-visible { outline: none; border-color: var(--ink-accent);
  box-shadow: 0 0 0 2px var(--ink-accent); }
.soundchip[aria-checked="true"] { color: var(--ink-accent); border-color: var(--ink-rule-strong); }

/* 44px touch targets on the interactive controls (Design Pass 6 / DT7). */
button.btn, .dl-btn { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }
.choice { min-height: 44px; }

/* Tactile seat select (DT4): press-settle on click + a brief board settle-in on render. */
.seat-node:active { transform: translateY(0) scale(.99); }
.board-grid { animation: board-in 260ms ease-out both; }
@keyframes board-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* Meter settle pulse + FLAG-penalty shake (DT5). Transform/opacity only — no layout. */
.meter .fill { animation: fill-settle 420ms ease-out both; }
@keyframes fill-settle { from { opacity: .55; } to { opacity: 1; } }
.flag-beat .headline { animation: flag-shake 360ms ease-out 1; }
@keyframes flag-shake {
  0%, 100% { transform: translateX(0); }
  15% { transform: translateX(-4px); } 30% { transform: translateX(4px); }
  45% { transform: translateX(-3px); } 60% { transform: translateX(2px); } 80% { transform: translateX(-1px); } }

/* ── .fec stamp — the emotional peak, restrained editorial press-in (Design D4) ──
 * Upright (NO askew rotation, no ink-bleed). Aged Gold on Parchment. Presses in once,
 * scale-settles, rests. The sound 'stamp' cue fires on this element's animationstart,
 * so audio is synced to the visual press (Design Pass 3). The download NEVER depends on
 * this element (Eng ET2 / CEO CRITICAL) — it is decoration over a working download.    */
.rc-deliverable { position: relative; }
.rc-stamp {
  position: absolute; top: 14px; right: 8px; transform-origin: center;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 1.5px; line-height: 1.3;
  color: var(--et-accent); border: 2px solid var(--et-accent); border-radius: var(--radius);
  padding: 6px 10px; text-align: center; text-transform: uppercase; opacity: .9;
  animation: rc-stamp-in 320ms cubic-bezier(.2,.8,.2,1) 480ms both; }
.rc-stamp .rc-stamp-id { font-weight: 500; display: block; }
.rc-stamp .rc-stamp-tag { font-size: 9px; color: var(--et-text-faint); }
@keyframes rc-stamp-in {
  from { opacity: 0; transform: scale(1.18); }
  to { opacity: .9; transform: scale(1); } }
@media (max-width: 720px) {
  .rc-stamp { position: static; display: inline-block; margin: 0 auto 14px; }
}

/* ── prefers-reduced-motion: keep every narrative beat, drop the motion (Design D3) ──
 * Animations collapse to ~0 duration so keyframes (which use `forwards`/`both`) land on
 * their END frame instantly. Explicit end-states below for the cinematics that matter.
 * Sound is unaffected — it lives on its own muted-default toggle.                       */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 1ms !important; animation-delay: 0ms !important;
    animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
  .seat-node:hover, .seat-node:focus-visible { transform: none; }
  .defection .def-strike { transform: scaleX(1); }
  .defection .def-checks { opacity: 1; transform: none; }
  .rc-stamp { opacity: .9; transform: none; }
  .board-grid { opacity: 1; transform: none; }
}
