/* Too Early to Call — design system
   Palette: midnight newsroom + Lantern amber + Harbor teal + retraction red. */
:root {
  --bg: #0c1220;
  --bg2: #111a2d;
  --card: #162039;
  --card2: #1b2747;
  --line: #2a3756;
  --text: #ecf0f7;
  --muted: #9ba8c2;
  --lantern: #f2a516;
  --lantern-ink: #ffc04d;
  --lantern-soft: rgba(242, 165, 22, 0.14);
  --harbor: #18b5a7;
  --harbor-ink: #4fe0d2;
  --harbor-soft: rgba(24, 181, 167, 0.14);
  --bad: #ff5d62;
  --good: #44d18a;
  --meh: #c9b45a;
  --uncounted: #2b3756;
  --focus: #8fb8ff;
  --paper: #f3ecdc;
  --paper-ink: #1b1a17;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --serif: "Playfair Display", Georgia, "Times New Roman", serif;
  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  color-scheme: dark;
}
[data-theme="light"] {
  --bg: #f5f2ea;
  --bg2: #ebe5d8;
  --card: #ffffff;
  --card2: #f8f5ee;
  --line: #d8d0bf;
  --text: #151a24;
  --muted: #586174;
  --lantern: #e69a00;
  --lantern-ink: #8f5600;
  --lantern-soft: rgba(230, 154, 0, 0.14);
  --harbor: #0f9a8d;
  --harbor-ink: #08695f;
  --harbor-soft: rgba(15, 154, 141, 0.13);
  --bad: #c62828;
  --good: #1e7d4f;
  --meh: #8a7520;
  --uncounted: #dcd6c9;
  --focus: #1f5fd1;
  --shadow: 0 8px 24px rgba(40, 30, 10, 0.12);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
}
img, svg { max-width: 100%; }
a { color: var(--harbor-ink); }
a:hover { color: var(--lantern-ink); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
h1, h2, h3 { line-height: 1.15; }
kbd {
  font-family: var(--mono); font-size: 0.8em; padding: 1px 6px; border-radius: 5px;
  border: 1px solid var(--line); background: var(--card2);
}
.skip { position: absolute; left: -999px; top: 8px; background: var(--lantern); color: #000; padding: 8px 12px; z-index: 100; border-radius: 8px; }
.skip:focus { left: 8px; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 18px; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
.center { text-align: center; }
.t-l { color: var(--lantern-ink); }
.t-h { color: var(--harbor-ink); }
.error { background: var(--bad); color: #fff; padding: 10px 14px; border-radius: 10px; }
[hidden] { display: none !important; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 18px;
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font-weight: 700; letter-spacing: -0.01em; margin-right: auto; }
.brand:hover { color: var(--text); }
.brand-mark {
  width: 26px; height: 26px; border-radius: 50%;
  background: conic-gradient(var(--lantern) 0 50%, var(--harbor) 50% 100%);
  box-shadow: inset 0 0 0 3px var(--bg), 0 0 0 2px var(--line);
}
.brand-text { font-family: var(--serif); font-size: 1.2rem; }
.brand-text em { font-style: italic; color: var(--lantern-ink); }
.site-nav { display: flex; gap: 4px; }
.site-nav a { text-decoration: none; color: var(--muted); padding: 8px 10px; border-radius: 8px; font-weight: 500; font-size: 0.95rem; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--text); background: var(--card); }
.nav-toggle { display: none; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--card); color: var(--text); font-size: 1.1rem; cursor: pointer;
}
@media (max-width: 860px) {
  .nav-toggle {
    display: inline-flex; align-items: center; height: 40px; padding: 0 12px; border-radius: 10px;
    border: 1px solid var(--line); background: var(--card); color: var(--text); font: inherit; font-weight: 600; cursor: pointer;
  }
  .site-nav {
    display: none; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column;
    background: var(--bg2); border-bottom: 1px solid var(--line); padding: 8px 12px 14px;
  }
  .site-nav.open { display: flex; }
  .site-nav a { padding: 12px; }
  .brand-text { font-size: 1.05rem; }
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 18px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--card); color: var(--text);
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
  transition: transform 0.12s ease, background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover { border-color: var(--muted); color: var(--text); }
.btn:active { transform: translateY(1px) scale(0.99); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary { background: var(--lantern); border-color: var(--lantern); color: #1a1200; }
.btn-primary:hover { background: var(--lantern-ink); border-color: var(--lantern-ink); color: #1a1200; }
[data-theme="light"] .btn-primary:hover { color: #fff; }
.btn-ghost { background: transparent; }
.btn-big { font-size: 1.1rem; padding: 14px 26px; min-height: 54px; }
.btn-small { min-height: 36px; padding: 6px 12px; font-size: 0.9rem; }
.btn-call-l { background: var(--lantern); border-color: var(--lantern); color: #1a1200; }
.btn-call-h { background: var(--harbor); border-color: var(--harbor); color: #00201d; }
[data-theme="light"] .btn-call-h { color: #fff; }
.btn-call-l:hover, .btn-call-h:hover { filter: brightness(1.08); color: inherit; }
.btn-call-l:hover { color: #1a1200; }
.btn-tctc { background: transparent; border: 2px dashed var(--muted); }
.linkish { background: none; border: 0; color: var(--harbor-ink); font: inherit; text-decoration: underline; cursor: pointer; padding: 0; }

/* ---------- typography blocks ---------- */
.kicker { font-family: var(--mono); text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.8rem; color: var(--lantern-ink); margin: 0 0 6px; }
.page-title { font-family: var(--serif); font-size: clamp(2.1rem, 6vw, 3.4rem); margin: 0 0 10px; font-weight: 900; letter-spacing: -0.01em; }
.lede { font-size: 1.12rem; color: var(--muted); max-width: 46rem; margin: 0 0 20px; }
.section-title { font-family: var(--serif); font-size: clamp(1.5rem, 4vw, 2.1rem); margin: 40px 0 14px; }
.prose { max-width: 46rem; }
.prose p, .prose li { color: var(--text); }
.badge {
  display: inline-block; font-family: var(--mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em;
  padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); background: var(--card2); color: var(--muted); vertical-align: middle;
}

/* ---------- home ---------- */
.hero { padding: 34px 0 24px; }
.hero-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 34px; align-items: center; }
.hero h1 { font-family: var(--serif); font-size: clamp(2.5rem, 7.4vw, 4.6rem); line-height: 1.02; margin: 0 0 14px; font-weight: 900; }
.hero h1 .strike { position: relative; color: var(--muted); }
.hero h1 .strike::after { content: ""; position: absolute; left: -2%; right: -2%; top: 52%; height: 0.09em; background: var(--bad); transform: rotate(-3deg); }
.hero h1 em { color: var(--lantern-ink); font-style: italic; }
.cta-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0 8px; }
.hero-note { color: var(--muted); font-size: 0.92rem; }
.demo {
  background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 16px; box-shadow: var(--shadow);
  position: relative; overflow: hidden;
}
.demo-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 10px; }
.demo-state { font-family: var(--serif); font-size: 1.4rem; font-weight: 700; }
.demo-row { display: grid; grid-template-columns: 80px 1fr 64px; align-items: center; gap: 10px; margin: 8px 0; font-weight: 600; }
.demo-row .track { height: 14px; background: var(--uncounted); border-radius: 99px; overflow: hidden; }
.demo-row .fill { height: 100%; border-radius: 99px; transition: width 0.6s ease; }
.demo-row .fill.l { background: var(--lantern); }
.demo-row .fill.h { background: var(--harbor); }
.demo-row .num { font-family: var(--mono); text-align: right; }
.demo-meta { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 0.85rem; color: var(--muted); margin: 8px 0; }
.demo .lead-chart { display: block; width: 100%; height: auto; }
.demo-call {
  position: absolute; right: 14px; bottom: 14px; font-family: var(--mono); font-weight: 600; font-size: 0.8rem;
  padding: 6px 10px; border-radius: 8px; background: var(--bad); color: #fff; letter-spacing: 0.08em; opacity: 0; transform: scale(0.9);
  transition: opacity 0.3s, transform 0.3s;
}
.demo-call.on { opacity: 1; transform: scale(1); }
.facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 26px 0; }
.fact { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.fact-n { font-family: var(--mono); font-size: 1.8rem; font-weight: 600; color: var(--lantern-ink); display: block; }
.fact-k { color: var(--muted); font-size: 0.92rem; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
.tile {
  display: block; text-decoration: none; color: var(--text); background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px; transition: transform 0.15s, border-color 0.15s;
}
.tile:hover { transform: translateY(-3px); border-color: var(--lantern); color: var(--text); }
.tile-emoji { font-size: 1.8rem; }
.tile h3 { font-family: var(--serif); font-size: 1.3rem; margin: 6px 0; }
.tile p { margin: 0; color: var(--muted); font-size: 0.95rem; }
.tile.feature { border-color: var(--lantern); background: linear-gradient(135deg, var(--lantern-soft), var(--card) 60%); }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; counter-reset: step; }
.step { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; position: relative; }
.step::before {
  counter-increment: step; content: counter(step); position: absolute; top: -14px; left: 16px;
  width: 30px; height: 30px; border-radius: 50%; background: var(--harbor); color: #002320; font-weight: 700;
  display: grid; place-items: center; font-family: var(--mono);
}
.step h3 { margin: 8px 0 6px; font-size: 1.1rem; }
.step p { margin: 0; color: var(--muted); }
.band {
  margin: 40px 0; padding: 26px; border-radius: 18px; border: 1px solid var(--line);
  background: linear-gradient(120deg, var(--lantern-soft), var(--harbor-soft));
  display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between;
}
.band h2 { margin: 0; font-family: var(--serif); }
@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; }
  .facts { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: 1fr; gap: 24px; }
}

/* ---------- setup ---------- */
.setup { padding-top: 28px; padding-bottom: 40px; }
.mode-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 18px 0; }
.mode-card { position: relative; cursor: pointer; }
.mode-card input { position: absolute; opacity: 0; pointer-events: none; }
.mode-body {
  display: block; height: 100%; padding: 16px; border-radius: var(--radius); border: 2px solid var(--line); background: var(--card);
  transition: border-color 0.15s, background 0.15s;
}
.mode-card input:checked + .mode-body { border-color: var(--lantern); background: linear-gradient(135deg, var(--lantern-soft), var(--card) 70%); }
.mode-card input:focus-visible + .mode-body { outline: 3px solid var(--focus); outline-offset: 2px; }
.mode-name { display: block; font-weight: 700; font-size: 1.1rem; margin-bottom: 4px; }
.mode-desc { color: var(--muted); font-size: 0.95rem; }
.diff-pick { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px 14px; margin: 0 0 14px; background: var(--card); }
.diff-pick legend { font-weight: 700; padding: 0 6px; }
.diff-pick label { display: block; padding: 6px 0; cursor: pointer; }
.diff-pick label span { color: var(--muted); font-size: 0.92rem; }
.diff-pick input { accent-color: var(--lantern); width: 18px; height: 18px; vertical-align: -3px; }
.rules { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; margin-bottom: 18px; }
.rules summary { cursor: pointer; font-weight: 700; }
.rules li { margin: 8px 0; color: var(--muted); }
.rules li strong { color: var(--text); }
.setup-actions { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.shared-banner {
  border: 1px solid var(--lantern); background: var(--lantern-soft); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 18px;
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px; justify-content: space-between;
}
.shared-banner p { margin: 0; }
@media (max-width: 640px) { .mode-pick { grid-template-columns: 1fr; } }

/* ---------- game shell ---------- */
.game { max-width: 1240px; margin: 0 auto; padding: 12px 14px 30px; }
.game-bar {
  position: sticky; top: 61px; z-index: 20;
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px;
  background: var(--bg2); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 12px; margin-bottom: 10px;
  box-shadow: var(--shadow);
}
.clock { font-family: var(--mono); font-weight: 600; font-size: 1.25rem; min-width: 128px; }
.clock-day { color: var(--muted); font-size: 0.9rem; }
.speed { display: flex; gap: 4px; flex-wrap: wrap; }
.sp {
  min-width: 40px; min-height: 36px; padding: 4px 8px; border-radius: 9px; border: 1px solid var(--line);
  background: var(--card); color: var(--text); font: inherit; font-family: var(--mono); font-weight: 600; cursor: pointer;
}
.sp.wide { padding: 4px 14px; }
.sp.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.score-box { margin-left: auto; font-family: var(--mono); }
.score-k { color: var(--muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; }
.score-v { font-size: 1.25rem; font-weight: 600; color: var(--lantern-ink); }
.night-strip { display: grid; grid-template-columns: 1fr 300px; gap: 10px; margin-bottom: 10px; }
.chips { display: flex; gap: 6px; overflow-x: auto; padding: 8px 6px 6px; scrollbar-width: thin; min-width: 0; }
.chip {
  position: relative; flex: 0 0 auto; min-width: 66px; padding: 8px 10px 6px; border-radius: 12px; border: 2px solid var(--line);
  background: var(--card); color: var(--text); cursor: pointer; font: inherit; text-align: left;
  display: flex; flex-direction: column; gap: 0;
}
.chip-abbr { font-family: var(--mono); font-weight: 600; font-size: 1.05rem; }
.chip-sub { font-family: var(--mono); font-size: 0.75rem; color: var(--muted); }
.chip.st-wait { opacity: 0.6; }
.chip.st-live .chip-sub::before { content: "● "; color: var(--bad); }
.chip.lean-l { box-shadow: inset 0 -4px 0 var(--lantern); }
.chip.lean-h { box-shadow: inset 0 -4px 0 var(--harbor); }
.chip.sel { border-color: var(--text); }
.chip-call {
  position: absolute; top: -7px; right: -5px; width: 20px; height: 20px; border-radius: 50%; font-size: 0.7rem; font-weight: 700;
  display: grid; place-items: center; font-family: var(--mono); border: 2px solid var(--bg);
}
.chip-call.c-l { background: var(--lantern); color: #1a1200; }
.chip-call.c-h { background: var(--harbor); color: #00201d; }
.chip-call.c-tctc { background: var(--muted); color: var(--bg); }
.chip-res { position: absolute; bottom: 4px; right: 6px; font-weight: 700; }
.chip-res.ok { color: var(--good); }
.chip-res.bad { color: var(--bad); }
.chamber { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; font-size: 0.9rem; }
.ch-head { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.ch-title { font-weight: 700; }
.ch-need { color: var(--muted); font-size: 0.8rem; }
.seatbar { display: flex; gap: 4px; margin: 8px 0; }
.seat { flex: 1; height: 14px; border-radius: 4px; background: var(--uncounted); position: relative; }
.seat.s-l { background: var(--lantern); }
.seat.s-h { background: var(--harbor); }
.seat.line::after { content: ""; position: absolute; right: -3px; top: -4px; bottom: -4px; width: 2px; background: var(--text); }
.ch-line, .ch-wire, .ch-you { margin: 4px 0; }
.ch-wire { color: var(--muted); }
.ch-btns { display: flex; flex-wrap: wrap; gap: 6px; }
.game-main { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 10px; align-items: start; }
.ticker-wrap { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; position: sticky; top: 132px; max-height: calc(100vh - 150px); overflow: auto; }
.ticker-title { margin: 0 0 6px; font-family: var(--mono); text-transform: uppercase; letter-spacing: 0.1em; font-size: 0.8rem; color: var(--muted); }
.ticker { list-style: none; margin: 0; padding: 0; font-size: 0.88rem; }
.tk { padding: 6px 0 6px 8px; border-bottom: 1px solid var(--line); border-left: 3px solid transparent; animation: tkIn 0.4s ease; }
.tk-time { font-family: var(--mono); color: var(--muted); font-size: 0.78rem; }
.tk.wire { border-left-color: var(--muted); }
.tk.w-l { border-left-color: var(--lantern); }
.tk.w-h { border-left-color: var(--harbor); }
.tk.bad { border-left-color: var(--bad); color: var(--bad); }
.tk.you { font-weight: 600; }
.tk.final { font-weight: 600; }
.tk.big { font-size: 0.95rem; }
@keyframes tkIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@media (max-width: 980px) {
  .night-strip { grid-template-columns: 1fr; }
  .game-main { grid-template-columns: 1fr; }
  .ticker-wrap { position: static; max-height: 260px; }
}
@media (max-width: 640px) {
  .game { padding: 8px 8px 30px; }
  .game-bar { top: 61px; padding: 6px 8px; gap: 6px 10px; }
  .clock { font-size: 1.05rem; min-width: 0; }
  .sp { min-width: 36px; padding: 4px 6px; }
}

/* ---------- race panel ---------- */
.race-panel { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 16px; min-width: 0; position: relative; }
.race-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.eyebrow { margin: 0; font-family: var(--mono); font-size: 0.78rem; color: var(--muted); letter-spacing: 0.06em; text-transform: uppercase; }
.race-title { margin: 2px 0 2px; font-family: var(--serif); font-size: clamp(1.6rem, 5vw, 2.3rem); }
.race-nick { margin: 0; color: var(--muted); font-size: 0.92rem; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 0.78rem; font-weight: 600; padding: 4px 10px; border-radius: 99px; white-space: nowrap; border: 1px solid var(--line); }
.pill-live { color: var(--bad); border-color: var(--bad); }
.pill-live .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--bad); animation: pulse 1.2s infinite; }
.pill-final { background: var(--text); color: var(--bg); border-color: var(--text); }
.pill-wait { color: var(--muted); }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }
.cands { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 14px 0 8px; }
.cand { position: relative; border-radius: 12px; padding: 10px 12px; border: 2px solid var(--line); background: var(--card2); overflow: hidden; }
.cand-l.leading { border-color: var(--lantern); background: linear-gradient(160deg, var(--lantern-soft), var(--card2) 70%); }
.cand-h.leading { border-color: var(--harbor); background: linear-gradient(160deg, var(--harbor-soft), var(--card2) 70%); }
.cand.won { box-shadow: 0 0 0 3px var(--good); }
.cand-top { display: flex; align-items: center; gap: 6px; font-size: 0.8rem; color: var(--muted); }
.swatch { width: 12px; height: 12px; border-radius: 3px; }
.cand-l .swatch { background: var(--lantern); }
.cand-h .swatch { background: var(--harbor); }
.won-tag { margin-left: auto; color: var(--good); font-weight: 700; }
.cand-name { font-weight: 700; font-size: 1.05rem; margin: 2px 0; }
.cand-num { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.cand-pct { font-family: var(--mono); font-size: 1.7rem; font-weight: 600; }
.cand-l .cand-pct { color: var(--lantern-ink); }
.cand-h .cand-pct { color: var(--harbor-ink); }
.cand-votes { font-family: var(--mono); color: var(--muted); font-size: 0.85rem; }
.stamp {
  position: absolute; top: 8px; right: 8px; transform: rotate(8deg);
  font-family: var(--mono); font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em;
  border: 2px solid currentColor; padding: 2px 6px; border-radius: 4px; color: var(--text); background: var(--card);
}
.vote-bar { position: relative; display: flex; height: 16px; border-radius: 99px; overflow: hidden; background: var(--uncounted); }
.vb-l { background: var(--lantern); transition: width 0.5s ease; }
.vb-h { background: var(--harbor); transition: width 0.5s ease; }
.vb-mid { position: absolute; left: 50%; top: -2px; bottom: -2px; width: 2px; background: var(--text); opacity: 0.8; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 12px 0; }
.stat { background: var(--card2); border: 1px solid var(--line); border-radius: 12px; padding: 10px; display: flex; flex-direction: column; min-width: 0; }
.stat-k { font-size: 0.76rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.stat-v { font-family: var(--mono); font-size: 1.2rem; font-weight: 600; overflow-wrap: anywhere; }
.stat-sub { font-family: var(--mono); font-size: 0.78rem; color: var(--muted); }
.meter { display: block; height: 6px; border-radius: 99px; background: var(--uncounted); margin-top: 6px; overflow: hidden; }
.meter span { display: block; height: 100%; background: var(--text); transition: width 0.5s ease; }
.analyst { border: 1px dashed var(--line); border-radius: 12px; padding: 10px 12px; margin: 10px 0; background: var(--bg2); }
.an-title { margin: 0; font-family: var(--mono); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); }
.an-big { margin: 4px 0 8px; font-size: 1.08rem; }
.an-modes { display: flex; flex-wrap: wrap; gap: 6px; }
.mchip { display: inline-flex; gap: 6px; padding: 4px 9px; border-radius: 99px; border: 1px solid var(--line); background: var(--card); font-family: var(--mono); font-size: 0.82rem; }
.chip-k { color: var(--muted); font-family: var(--sans); }
.an-hint, .an-model { margin: 8px 0 0; font-size: 0.9rem; color: var(--muted); }
.an-model strong { font-family: var(--mono); }
.legend-note p { margin: 4px 0 0; color: var(--muted); }
.viz { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 10px 0; }
.viz-card { margin: 0; background: var(--card2); border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; min-width: 0; }
.viz-card figcaption { font-size: 0.8rem; font-weight: 600; margin-bottom: 4px; }
.bubble-map { display: block; width: 100%; height: 190px; }
.county-dot { stroke: var(--card2); stroke-width: 1; transition: fill-opacity 0.4s ease; }
.county-ring-bg { fill: none; stroke: var(--line); stroke-width: 2; }
.county-ring { fill: none; stroke: var(--text); stroke-width: 2.4; stroke-linecap: round; }
.county-label { font-family: var(--sans); font-size: 9px; font-weight: 600; text-anchor: middle; fill: var(--text); paint-order: stroke; stroke: var(--card2); stroke-width: 2.5px; pointer-events: none; }
.lead-chart { display: block; width: 100%; height: auto; }
.half-l { fill: var(--lantern-soft); }
.half-h { fill: var(--harbor-soft); }
.zero { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; }
.lead-line { fill: none; stroke: var(--text); stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; }
.lead-dot.l { fill: var(--lantern); stroke: var(--text); }
.lead-dot.h { fill: var(--harbor); stroke: var(--text); }
.final-line { stroke: var(--good); stroke-width: 1.6; stroke-dasharray: 6 4; }
.ch-lab { font-family: var(--mono); font-size: 9px; fill: var(--muted); }
.ch-lab.end { text-anchor: end; }
.ch-lab.mid { text-anchor: middle; }
.ch-lab.strong { fill: var(--good); font-weight: 600; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 6px; align-items: center; }
.actions .btn { flex: 1 1 160px; }
.called-note { margin: 0; flex: 1 1 260px; }
.desk-log { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.desk-call { font-family: var(--mono); font-size: 0.78rem; padding: 4px 9px; border-radius: 99px; border: 1px solid var(--line); background: var(--bg2); }
.desk-call.l { border-color: var(--lantern); }
.desk-call.h { border-color: var(--harbor); }
.desk-call.retracted { text-decoration: line-through; color: var(--bad); border-color: var(--bad); }
.county-table { margin: 10px 0 0; }
.county-table summary { cursor: pointer; font-weight: 600; padding: 6px 0; }
.table-wrap { overflow-x: auto; }
.county-table table { width: 100%; border-collapse: collapse; font-size: 0.86rem; }
.county-table th, .county-table td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.county-table td { font-family: var(--mono); }
.county-table thead th { color: var(--muted); font-weight: 600; font-size: 0.78rem; }
.profile-tip { font-size: 0.86rem; color: var(--muted); margin: 10px 0 0; }
.verdict { position: relative; margin: 12px 0; padding: 14px 16px; border-radius: 12px; border: 2px solid var(--line); background: var(--bg2); overflow: hidden; animation: pop 0.35s ease; }
.verdict.v-ok { border-color: var(--good); }
.verdict.v-bad { border-color: var(--bad); }
.verdict.v-meh { border-color: var(--meh); }
.verdict-final { margin: 0 0 4px; font-family: var(--mono); font-weight: 600; }
.verdict-msg { margin: 0; }
.verdict-pts { margin: 6px 0 0; font-family: var(--mono); font-size: 1.4rem; font-weight: 600; }
.v-ok .verdict-pts { color: var(--good); }
.v-bad .verdict-pts { color: var(--bad); }
.verdict-actions { margin-top: 10px; }
.retraction-stamp {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%) rotate(-12deg);
  font-family: var(--mono); font-weight: 700; font-size: clamp(1rem, 4vw, 1.6rem); letter-spacing: 0.1em;
  color: var(--bad); border: 3px solid var(--bad); padding: 4px 10px; border-radius: 6px; opacity: 0.9; pointer-events: none;
  animation: stamp 0.45s cubic-bezier(.2, 1.6, .4, 1);
}
@keyframes pop { from { transform: scale(0.97); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes stamp { from { transform: translateY(-50%) rotate(-12deg) scale(2.2); opacity: 0; } to { transform: translateY(-50%) rotate(-12deg) scale(1); opacity: 0.9; } }
@media (max-width: 640px) {
  .race-panel { padding: 12px; }
  .stats { grid-template-columns: 1fr 1fr; }
  .stats .stat:last-child { grid-column: 1 / -1; }
  .viz { grid-template-columns: 1fr; }
  .cand-pct { font-size: 1.35rem; }
  .cand-name { font-size: 0.95rem; }
  .actions .btn { flex: 1 1 100%; }
  .retraction-stamp { position: static; display: inline-block; transform: rotate(-6deg); margin-top: 8px; animation: none; }
}

/* ---------- overlay & toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 22px; transform: translate(-50%, 30px); opacity: 0; z-index: 90;
  background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 12px; font-weight: 600;
  transition: opacity 0.25s, transform 0.25s; pointer-events: none; max-width: calc(100vw - 30px); text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.ff-overlay { position: fixed; inset: 0; z-index: 80; background: rgba(8, 12, 22, 0.92); display: grid; place-items: center; padding: 20px; animation: fadeIn 0.3s ease; }
.ff-in { text-align: center; color: #fff; }
.ff-k { font-family: var(--mono); color: var(--lantern); letter-spacing: 0.2em; margin: 0; }
.ff-t { font-family: var(--serif); font-size: clamp(1.8rem, 6vw, 3rem); margin: 6px 0; }
.ff-days { color: #b7c1d6; margin: 0; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ---------- newspaper ---------- */
.summary { padding-top: 26px; padding-bottom: 40px; }
.best-flag { display: inline-block; background: var(--lantern); color: #1a1200; font-weight: 700; padding: 4px 12px; border-radius: 99px; margin: 0 0 12px; }
.paper {
  background: var(--paper); color: var(--paper-ink); border-radius: 6px; padding: 22px 24px 18px; box-shadow: var(--shadow);
  font-family: Georgia, "Times New Roman", serif; max-width: 980px; margin: 0 auto;
  background-image: radial-gradient(rgba(0,0,0,0.035) 1px, transparent 1px); background-size: 4px 4px;
}
.paper-mast { text-align: center; border-bottom: 3px double var(--paper-ink); padding-bottom: 8px; }
.paper-ears { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; }
.paper-name { font-family: var(--serif); font-weight: 900; font-size: clamp(2rem, 7vw, 3.6rem); margin: 4px 0 0; line-height: 1; }
.paper-date { font-family: var(--mono); font-size: 0.75rem; margin: 6px 0 0; text-transform: uppercase; letter-spacing: 0.06em; }
.paper-banner-wrap { position: relative; text-align: center; padding: 12px 0 6px; border-bottom: 1px solid var(--paper-ink); }
.paper-banner { font-family: var(--serif); font-weight: 900; font-size: clamp(1.7rem, 6.4vw, 3.4rem); line-height: 1.02; margin: 0; letter-spacing: -0.01em; }
.paper-stamp {
  position: absolute; right: 2%; top: 30%; transform: rotate(-14deg); font-family: var(--sans); font-weight: 700;
  color: #c62828; border: 4px solid #c62828; padding: 2px 12px; font-size: clamp(1.1rem, 4vw, 2rem); letter-spacing: 0.08em; background: rgba(243, 236, 220, 0.75);
}
.paper-deck { font-style: italic; text-align: center; margin: 10px auto; max-width: 48rem; font-size: 1.02rem; }
.paper-cols { display: grid; grid-template-columns: 1.6fr 1fr; gap: 18px; border-top: 1px solid var(--paper-ink); padding-top: 12px; }
.paper-races { list-style: none; margin: 0; padding: 0; columns: 2; column-gap: 18px; column-rule: 1px solid rgba(0,0,0,0.25); }
.pr { break-inside: avoid; display: flex; gap: 8px; padding: 6px 0 8px; border-bottom: 1px solid rgba(0,0,0,0.15); }
.pr-mark { font-family: var(--sans); font-weight: 700; font-size: 1.2rem; width: 20px; flex: 0 0 20px; }
.pr-mark.ok { color: #1e7d4f; }
.pr-mark.bad { color: #c62828; }
.pr-mark.na { color: #8a8577; }
.pr-body { display: flex; flex-direction: column; }
.pr-state { font-family: var(--serif); font-weight: 700; font-size: 1.08rem; }
.pr-call { font-family: var(--sans); font-weight: 600; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.02em; }
.pr-out { text-transform: none; font-weight: 400; color: #5d584c; }
.pr-final { font-size: 0.86rem; color: #5d584c; }
.paper-side { border-left: 1px solid rgba(0,0,0,0.25); padding-left: 16px; }
.arch-emoji { font-size: 2.2rem; }
.arch-k { font-family: var(--mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.1em; margin: 4px 0 0; }
.arch-name { font-family: var(--serif); font-weight: 900; font-size: 1.5rem; margin: 2px 0 6px; line-height: 1.1; }
.arch-desc { margin: 0 0 10px; font-size: 0.95rem; }
.paper-score { font-family: var(--mono); font-size: 0.9rem; }
.paper-score span { font-size: 1.8rem; font-weight: 600; color: #a35f00; }
.paper-stats { list-style: none; padding: 0; margin: 8px 0 0; font-family: var(--sans); font-size: 0.88rem; }
.paper-stats li { padding: 2px 0; }
.corrections { margin-top: 14px; border: 2px solid #c62828; padding: 8px 12px; background: rgba(198, 40, 40, 0.05); }
.corr-title { font-family: var(--sans); font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: #c62828; margin: 0 0 4px; font-size: 0.85rem; }
.corrections p { margin: 4px 0; font-size: 0.92rem; }
.summary-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 20px 0; }
.replays { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.replay { margin: 0; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px; }
.replay figcaption { margin-bottom: 6px; }
@media (max-width: 720px) {
  .paper { padding: 14px 12px; }
  .paper-cols { grid-template-columns: 1fr; }
  .paper-races { columns: 1; }
  .paper-side { border-left: 0; border-top: 1px solid rgba(0,0,0,0.25); padding: 12px 0 0; }
  .paper-stamp { position: static; display: inline-block; margin-top: 6px; }
}

/* ---------- snap ---------- */
.snap-wrap { max-width: 980px; margin: 0 auto; padding: 22px 14px 40px; }
.snap-hud { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; margin-bottom: 8px; font-family: var(--mono); }
.snap-hud .score-v { font-size: 1.2rem; }
.timer { height: 8px; background: var(--uncounted); border-radius: 99px; overflow: hidden; margin-bottom: 10px; }
.timer span { display: block; height: 100%; width: 100%; background: var(--lantern); transform-origin: left; }
.timer.low span { background: var(--bad); }
.snap-actions { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin: 10px 0; }
.snap-actions .btn { min-height: 56px; font-size: 1.02rem; }
.btn-wait { background: var(--card2); border: 2px solid var(--text); }
.snap-fb { border-radius: 14px; padding: 14px 16px; margin: 10px 0; border: 2px solid var(--line); background: var(--card); animation: pop 0.3s ease; }
.snap-fb.ok { border-color: var(--good); }
.snap-fb.bad { border-color: var(--bad); }
.snap-fb.meh { border-color: var(--meh); }
.snap-fb h3 { margin: 0 0 4px; }
.snap-fb p { margin: 4px 0; }
.snap-list { list-style: none; padding: 0; margin: 14px 0; display: grid; gap: 6px; }
.snap-list li { display: flex; gap: 10px; align-items: baseline; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; }
.snap-list .pts { margin-left: auto; font-family: var(--mono); font-weight: 600; }
.snap-list .pts.neg { color: var(--bad); }
.snap-list .pts.pos { color: var(--good); }
.snap-big { font-family: var(--mono); font-size: clamp(2.6rem, 10vw, 4rem); font-weight: 600; color: var(--lantern-ink); margin: 0; }
@media (max-width: 560px) {
  .snap-actions { grid-template-columns: 1fr 1fr; }
  .snap-actions .btn-wait { grid-column: 1 / -1; order: 3; }
}

/* ---------- learn ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 18px; margin: 16px 0; }
.card h2 { margin-top: 0; font-family: var(--serif); }
.controls { display: flex; flex-wrap: wrap; gap: 14px 22px; align-items: flex-end; margin: 10px 0 14px; }
.ctl { display: flex; flex-direction: column; gap: 4px; font-size: 0.9rem; min-width: 180px; flex: 1 1 200px; }
.ctl label, .ctl .ctl-k { font-weight: 600; }
.ctl output { font-family: var(--mono); color: var(--lantern-ink); }
input[type="range"] { width: 100%; accent-color: var(--lantern); min-height: 30px; }
.seg { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.seg button { border: 0; background: var(--card2); color: var(--text); padding: 9px 12px; font: inherit; font-size: 0.9rem; cursor: pointer; border-right: 1px solid var(--line); min-height: 42px; }
.seg button:last-child { border-right: 0; }
.seg button[aria-pressed="true"] { background: var(--text); color: var(--bg); font-weight: 600; }
.mirage-out { display: grid; grid-template-columns: 1.4fr 1fr; gap: 14px; align-items: start; }
.mirage-out .lead-chart { background: var(--card2); border-radius: 12px; border: 1px solid var(--line); padding: 6px; }
.readout { font-size: 0.95rem; }
.readout p { margin: 6px 0; }
.readout .big { font-family: var(--mono); font-size: 1.3rem; font-weight: 600; }
.calc-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field label { font-weight: 600; font-size: 0.9rem; }
.field input {
  font: inherit; font-family: var(--mono); padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--card2); color: var(--text); min-height: 44px; width: 100%;
}
.gauge { margin: 16px 0 6px; position: relative; height: 26px; border-radius: 99px; background: linear-gradient(90deg, var(--harbor) 0%, var(--meh) 38%, var(--bad) 78%, #7a1216 100%); opacity: 0.9; }
.gauge-needle { position: absolute; top: -6px; bottom: -6px; width: 4px; background: var(--text); border-radius: 2px; transition: left 0.4s ease; }
.gauge-labels { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 0.75rem; color: var(--muted); }
.calc-verdict { font-size: 1.1rem; margin: 10px 0 0; }
.quiz-q { font-size: 1.15rem; font-weight: 600; margin: 8px 0 12px; }
.quiz-opts { display: grid; gap: 8px; }
.quiz-opt { text-align: left; justify-content: flex-start; }
.quiz-opt.correct { border-color: var(--good); background: rgba(68, 209, 138, 0.15); }
.quiz-opt.wrong { border-color: var(--bad); background: rgba(255, 93, 98, 0.12); }
.quiz-x { margin: 10px 0; color: var(--muted); }
.quiz-progress { font-family: var(--mono); color: var(--muted); font-size: 0.85rem; }
@media (max-width: 760px) {
  .mirage-out { grid-template-columns: 1fr; }
  .calc-grid { grid-template-columns: 1fr; }
}

/* ---------- history ---------- */
.timeline { list-style: none; margin: 20px 0; padding: 0 0 0 26px; position: relative; }
.timeline::before { content: ""; position: absolute; left: 8px; top: 6px; bottom: 6px; width: 3px; background: linear-gradient(var(--lantern), var(--harbor)); border-radius: 3px; }
.tl-item { position: relative; margin: 0 0 18px; }
.tl-item::before { content: ""; position: absolute; left: -24px; top: 18px; width: 15px; height: 15px; border-radius: 50%; background: var(--bg); border: 3px solid var(--lantern); }
.tl-card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 16px; }
.tl-year { font-family: var(--mono); color: var(--lantern-ink); font-weight: 600; }
.tl-tag { margin-left: 8px; }
.tl-card h3 { font-family: var(--serif); font-size: 1.4rem; margin: 4px 0 6px; }
.tl-card p { margin: 6px 0; }
.tl-src { font-size: 0.82rem; }
.dilemma { margin-top: 12px; border-top: 1px dashed var(--line); padding-top: 10px; }
.dilemma-q { font-weight: 600; }
.dilemma-opts { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.dilemma-opts .btn { flex: 1 1 220px; }
.dilemma-v { background: var(--bg2); border-radius: 10px; padding: 10px 12px; border-left: 4px solid var(--harbor); animation: pop 0.3s ease; }
.tb-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tb-methods { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 8px; margin: 12px 0; }
.tb-method { text-align: left; flex-direction: column; align-items: flex-start; gap: 2px; }
.tb-method[aria-pressed="true"] { border-color: var(--lantern); background: var(--lantern-soft); }
.tb-method small { color: var(--muted); font-weight: 400; }
.tb-stage { min-height: 190px; display: grid; place-items: center; background: var(--bg2); border-radius: 14px; border: 1px solid var(--line); margin: 12px 0; padding: 14px; text-align: center; overflow: hidden; }
.tb-result { font-family: var(--serif); font-size: 1.5rem; font-weight: 700; margin: 8px 0 0; }
.coin {
  width: 120px; height: 120px; border-radius: 50%; display: grid; place-items: center; font-size: 3rem;
  background: radial-gradient(circle at 35% 30%, #fff3c4, #d9a520 60%, #9b6f0c); box-shadow: 0 6px 16px rgba(0,0,0,0.35);
  border: 4px solid #b98a14;
}
.coin-face { font-family: var(--mono); font-size: 1.05rem; font-weight: 600; color: #5a3d00; }
.coin.spin { animation: coinspin 1.6s cubic-bezier(.3, .1, .3, 1); }
@keyframes coinspin { 0% { transform: rotateY(0) translateY(0); } 50% { transform: rotateY(1440deg) translateY(-40px); } 100% { transform: rotateY(2880deg) translateY(0); } }
.bowl-row { display: flex; gap: 18px; justify-content: center; align-items: flex-end; }
.canister {
  width: 54px; height: 74px; border-radius: 8px 8px 12px 12px; background: linear-gradient(90deg, #222, #555 40%, #222); position: relative;
  display: grid; place-items: center; color: #fff; font-size: 0.6rem; font-family: var(--mono);
}
.canister::before { content: ""; position: absolute; top: -8px; left: -3px; right: -3px; height: 12px; border-radius: 5px; background: #888; }
.canister.shake { animation: shake 0.25s linear infinite; }
.canister.picked { animation: rise 0.8s ease forwards; }
.bowl { width: 180px; height: 60px; border-radius: 0 0 90px 90px; background: repeating-linear-gradient(90deg, #f5f7fb 0 14px, #2e5aa8 14px 18px); margin: -18px auto 0; box-shadow: 0 6px 14px rgba(0,0,0,0.3); }
@keyframes shake { 0%, 100% { transform: translateX(0) rotate(0); } 25% { transform: translateX(-3px) rotate(-4deg); } 75% { transform: translateX(3px) rotate(4deg); } }
@keyframes rise { to { transform: translateY(-30px) scale(1.15); } }
.cards-row { display: flex; gap: 20px; justify-content: center; }
.pcard {
  width: 84px; height: 120px; border-radius: 10px; background: #fff; color: #111; border: 1px solid #ccc; display: flex; flex-direction: column;
  justify-content: space-between; padding: 6px 8px; font-family: var(--serif); font-weight: 700; font-size: 1.4rem; box-shadow: 0 6px 14px rgba(0,0,0,0.3);
  animation: deal 0.5s ease backwards;
}
.pcard.red { color: #c62828; }
.pcard .pc-b { align-self: flex-end; transform: rotate(180deg); }
.pcard-name { font-family: var(--sans); font-size: 0.8rem; margin-top: 6px; }
@keyframes deal { from { transform: translateY(-40px) rotate(-10deg); opacity: 0; } }
.piece { width: 46px; height: 60px; border-radius: 50% 50% 8px 8px; display: inline-block; margin: 0 6px; animation: deal 0.5s ease backwards; }
.piece.red { background: #d33a2c; }
.piece.blue { background: #2e5aa8; }
.bag { width: 120px; height: 120px; border-radius: 40% 40% 50% 50%; background: #8a6a43; margin: 0 auto; position: relative; }
.bag.shake { animation: shake 0.25s linear infinite; }
@media (max-width: 560px) { .tb-grid { grid-template-columns: 1fr; } }

/* ---------- about ---------- */
.sources { padding-left: 18px; }
.sources li { margin: 6px 0; overflow-wrap: anywhere; }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--line); margin-top: 40px; padding: 20px 0 30px; color: var(--muted); font-size: 0.9rem; }
.footer-in p { margin: 6px 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}
