/* Layout: election-night studio. One dark ground, highlighter-yellow for story/fun, lavender for exam, party colours only on data. */
:root {
  --ink: #0F1222;
  --ink-deep: #0B0E1B;
  --panel: #181C33;
  --panel-2: #1F2547;
  --line: #2A2F4D;
  --line-2: #3A4066;
  --fg: #F3F4F8;
  --soft: #C9CDE0;
  --muted: #A9AEC4;
  --faint: #7C82A3;
  --hi: #FFD447;
  --hi-soft: #FFE58A;
  --exam: #C4B5FF;
  --exam-bg: #1E1A3A;
  --exam-line: #4A3F86;
  --dem: #4C8DFF;
  --dem-text: #8DB5FF;
  --dem-bg: #1B2A52;
  --rep: #FF5A5F;
  --rep-text: #FF9396;
  --rep-bg: #4A2129;
  --teal: #2EC4B6;
  --teal-text: #5EE0D2;
  --teal-bg: #143B3F;
  --orange: #FF9F1C;
  --orange-text: #FFB45C;
  --orange-bg: #4A3214;
  --loss: #D9741C;
  --gain: #1E9C8E;
  --bad: #FF9396;
  --bad-bg: #3A1520;
  --font-display: 'Bricolage Grotesque', 'Avenir Next', 'Segoe UI', system-ui, sans-serif;
  --font-body: 'Figtree', 'Avenir Next', 'Segoe UI', system-ui, sans-serif;
  --r-lg: 24px;
  --r-md: 18px;
  --r-sm: 12px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--ink);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 40; background: var(--ink); }
a { color: var(--hi); }
a:hover { color: var(--hi-soft); }
button { font-family: inherit; font-size: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: default; }
:focus-visible { outline: 3px solid var(--hi); outline-offset: 2px; border-radius: 6px; }
h1, h2, h3 { font-family: var(--font-display); text-wrap: balance; margin: 0; letter-spacing: -0.02em; }
p { margin: 0; }

.wrap { max-width: 1200px; margin: 0 auto; padding-left: max(20px, env(safe-area-inset-left, 0px)); padding-right: max(20px, env(safe-area-inset-right, 0px)); }

/* ---------- top bar ---------- */
.topbar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 30; background: color-mix(in srgb, var(--ink) 92%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-block: 10px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--fg); font-family: var(--font-display); font-weight: 800; font-size: 19px; letter-spacing: -0.02em; }
.brand:hover { color: var(--fg); }
.topnav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.topnav a { color: var(--soft); text-decoration: none; font-weight: 600; font-size: 15px; padding: 10px 12px; border-radius: 10px; }
.topnav a[aria-current="page"] { color: var(--hi); }
.seg { display: inline-flex; background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 4px; gap: 4px; }
.seg button { min-height: 38px; padding: 0 14px; border-radius: 999px; border: 0; background: transparent; color: var(--soft); font-weight: 700; font-size: 14px; }
.seg button[aria-pressed="true"] { background: var(--hi); color: var(--ink); }
.seg button.exam[aria-pressed="true"] { background: var(--exam); }

/* bottom tabs on narrow screens */
.tabs { display: none; }
@media (max-width: 720px) {
  .topnav a { display: none; }
  .tabs { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--ink-deep); border-top: 1px solid var(--line); padding: 6px max(6px, env(safe-area-inset-left, 0px)) calc(6px + env(safe-area-inset-bottom, 0px)) max(6px, env(safe-area-inset-right, 0px)); }
  .tabs a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0; color: var(--muted); text-decoration: none; font-size: 12px; font-weight: 700; min-height: 48px; justify-content: center; }
  .tabs a[aria-current="page"] { color: var(--hi); }
  main { padding-bottom: 90px; }
}

/* ---------- generic pieces ---------- */
.eyebrow { font-size: 13px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; }
.muted { color: var(--muted); }
.soft { color: var(--soft); }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 24px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack-s { display: flex; flex-direction: column; gap: 8px; }
.row { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.grow { flex: 999 1 560px; min-width: 0; }
.side { flex: 1 1 320px; min-width: 0; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; padding: 0 22px; border-radius: 14px; border: 0; background: var(--hi); color: var(--ink); font-weight: 800; font-size: 16px; text-decoration: none; }
.btn:hover { color: var(--ink); filter: brightness(1.06); }
.btn.ghost { background: transparent; color: var(--fg); border: 1.5px solid var(--line-2); }
.btn.ghost:hover { color: var(--fg); border-color: var(--hi); }
.btn.dark { background: var(--ink); color: var(--hi); }
.btn.exam { background: var(--exam); }
.btn.small { min-height: 42px; padding: 0 16px; font-size: 14px; border-radius: 12px; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 44px; padding: 0 18px; border-radius: 999px; border: 1.5px solid var(--line-2); background: var(--panel); color: var(--fg); font-weight: 700; font-size: 15px; }
.chip[aria-pressed="true"] { background: var(--hi); border-color: var(--hi); color: var(--ink); }
.choice { text-align: left; padding: 18px 20px; border-radius: 20px; border: 1.5px solid var(--line-2); background: var(--ink); display: flex; flex-direction: column; gap: 6px; min-height: 100px; transition: transform .12s ease, border-color .12s ease; }
.choice:hover { transform: translateY(-2px); border-color: var(--hi); }
.choice b { font-family: var(--font-display); font-size: 20px; font-weight: 700; }
.choice span { font-size: 15px; color: var(--muted); line-height: 1.45; }
.choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.tnum { font-variant-numeric: tabular-nums; }
.term { background: none; border: 0; padding: 0; font: inherit; color: inherit; font-weight: 700; border-bottom: 2px dotted var(--hi); cursor: help; }

/* boxes */
.story { background: var(--hi); color: var(--ink); border-radius: var(--r-lg); padding: 22px 24px; display: flex; flex-direction: column; gap: 8px; text-decoration: none; }
.story:hover { color: var(--ink); }
.story h3 { font-size: 22px; line-height: 1.15; }
.story p { font-size: 16px; line-height: 1.55; }
.examedge { background: var(--exam-bg); border: 1.5px solid var(--exam-line); border-radius: var(--r-lg); padding: 22px 24px; display: flex; flex-direction: column; gap: 10px; }
.examedge .eyebrow { color: var(--exam); font-size: 12px; }
.examedge p { font-size: 15px; line-height: 1.55; color: #E3E5EF; }
.examedge .terms { font-size: 14px; color: var(--exam); font-weight: 700; }
.examedge summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.examedge summary::-webkit-details-marker { display: none; }
.examedge summary::after { content: "+"; font-family: var(--font-display); font-weight: 800; font-size: 22px; color: var(--exam); }
.examedge[open] summary::after { content: "−"; }
.uk { background: var(--panel); border: 1px dashed var(--line-2); border-radius: var(--r-md); padding: 16px 18px; font-size: 15px; line-height: 1.55; }
.uk b { color: var(--hi); }
.verdict { background: var(--ink); border-radius: 16px; padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; }
.verdict strong { font-family: var(--font-display); font-weight: 800; font-size: 22px; line-height: 1.15; }
.source { font-size: 13px; color: var(--muted); }

/* ---------- chapter frame ---------- */
.chhead { padding-block: 28px 8px; display: flex; flex-direction: column; gap: 12px; }
.chnum { font-family: var(--font-display); font-weight: 800; font-size: 20px; color: var(--hi); }
.chhead h1 { font-size: clamp(40px, 6vw, 68px); line-height: 0.98; font-weight: 800; letter-spacing: -0.035em; }
.chhead .lede { font-size: 19px; color: var(--soft); max-width: 62ch; }
.progressline { display: flex; align-items: center; gap: 10px; min-width: 220px; }
.bar { flex: 1; height: 8px; background: #252A47; border-radius: 4px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--hi); border-radius: 4px; }
.section { padding-block: 20px; }
.chfoot { padding-block: 24px 60px; display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center; }

/* check-in quiz */
.checkin { background: var(--panel); border: 1.5px solid var(--hi); border-radius: var(--r-lg); padding: 24px; display: flex; flex-direction: column; gap: 14px; }
.qopts { display: flex; flex-direction: column; gap: 8px; }
.qopt { text-align: left; min-height: 54px; padding: 12px 16px; border-radius: 14px; border: 2px solid var(--line); background: var(--ink); font-weight: 600; font-size: 16px; }
.qopt.right { border-color: var(--teal-text); background: var(--teal-bg); }
.qopt.wrong { border-color: var(--bad); background: var(--bad-bg); }

/* ---------- home ---------- */
.hero { padding-block: 36px 20px; display: grid; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); gap: 36px; align-items: center; }
.hero h1 { font-size: clamp(44px, 6.4vw, 80px); line-height: 0.94; font-weight: 800; letter-spacing: -0.04em; }
.hero h1 em { font-style: normal; color: var(--hi); }
.hero .lede { font-size: 19px; color: var(--soft); max-width: 50ch; }
.tag { align-self: flex-start; background: var(--hi); color: var(--ink); font-weight: 800; font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; padding: 6px 12px; border-radius: 6px; }
.tag.exam { background: var(--exam); }
.count { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.count div { background: var(--ink); border-radius: 14px; padding: 14px 6px; text-align: center; }
.count b { display: block; font-family: var(--font-display); font-weight: 800; font-size: clamp(30px, 4vw, 44px); line-height: 1.1; font-variant-numeric: tabular-nums; }
.count span { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.1em; }
.ctrl { display: flex; flex-direction: column; gap: 6px; }
.ctrl .split { display: flex; height: 14px; border-radius: 7px; overflow: hidden; gap: 2px; }
.ctrl .lbl { display: flex; justify-content: space-between; font-size: 14px; gap: 8px; }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; padding-block: 12px; }
.feature { text-decoration: none; color: var(--fg); background: var(--panel); border: 1.5px solid var(--line); border-radius: 20px; padding: 22px; display: flex; flex-direction: column; gap: 8px; transition: transform .15s ease, border-color .15s ease; }
.feature:hover { transform: translateY(-3px); border-color: var(--hi); color: var(--fg); }
.feature h3 { font-size: 23px; line-height: 1.1; font-weight: 800; }
.feature p { font-size: 15px; color: var(--muted); }
.feature.yellow { background: var(--hi); border-color: var(--hi); color: var(--ink); }
.feature.yellow p { color: #2A2F4D; }
.feature.purple { background: var(--exam-bg); border-color: var(--exam-line); }
.feature.purple p { color: var(--soft); }
.act { display: flex; flex-direction: column; gap: 14px; padding-block: 14px; }
.acthead { display: flex; flex-wrap: wrap; align-items: baseline; gap: 12px; }
.acthead h3 { font-size: 24px; font-weight: 700; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.tile { text-decoration: none; color: var(--fg); background: var(--panel); border: 1.5px solid var(--line); border-radius: 18px; padding: 20px; display: flex; flex-direction: column; gap: 8px; min-height: 170px; transition: transform .15s ease, border-color .15s ease; }
.tile:hover { transform: translateY(-3px); border-color: var(--hi); color: var(--fg); }
.tile.next { border-color: var(--hi); background: var(--panel-2); }
.tile .n { font-family: var(--font-display); font-weight: 800; font-size: 26px; color: var(--hi); }
.tile.done .n { color: var(--faint); }
.tile h4 { margin: 0; font-family: var(--font-display); font-weight: 700; font-size: 20px; line-height: 1.15; }
.tile p { font-size: 14px; color: var(--muted); line-height: 1.45; }
.tile .play { margin-top: auto; font-size: 13px; font-weight: 700; color: var(--hi); }
.tile .ex { font-size: 13px; color: var(--exam); background: var(--exam-bg); border-radius: 10px; padding: 7px 10px; line-height: 1.4; }
.badges { display: flex; flex-wrap: wrap; gap: 10px; }
.badge { padding: 10px 14px; border-radius: 12px; font-weight: 700; font-size: 14px; border: 1.5px dashed var(--line-2); color: var(--muted); }
.badge.got { background: var(--hi); border: 1.5px solid var(--hi); color: var(--ink); }

/* toast + glossary popover */
.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%) translateY(140%); background: var(--hi); color: var(--ink); font-weight: 800; padding: 14px 22px; border-radius: 16px; z-index: 60; transition: transform .35s cubic-bezier(.2,.9,.3,1.2); max-width: calc(100vw - 32px); box-shadow: 0 10px 30px rgba(0,0,0,.4); opacity: 0; visibility: hidden; }
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; visibility: visible; }
@media (max-width: 720px) { .toast { bottom: calc(90px + env(safe-area-inset-bottom, 0px)); } }
.pop { position: fixed; z-index: 70; inset: auto 0 0 0; display: flex; justify-content: center; padding: 16px max(16px, env(safe-area-inset-left, 0px)) calc(16px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-right, 0px)); pointer-events: none; }
.pop .card { pointer-events: auto; max-width: 560px; width: 100%; background: var(--panel); border: 1.5px solid var(--hi); border-radius: 20px; padding: 20px 22px; box-shadow: 0 20px 50px rgba(0,0,0,.5); display: flex; flex-direction: column; gap: 8px; }
.pop .card h3 { font-size: 22px; color: var(--hi); }
.pop .card .x { align-self: flex-end; min-height: 40px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line-2); background: transparent; font-weight: 700; font-size: 14px; }

/* ---------- specific widgets ---------- */
.dots { display: grid; gap: 3px; }
.dots i { aspect-ratio: 1; border-radius: 50%; display: block; }
.flipgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.flip { perspective: 1200px; border: 0; padding: 0; background: none; text-align: left; min-height: 360px; }
.flip .inner { position: relative; width: 100%; height: 100%; min-height: 360px; transition: transform .6s cubic-bezier(.3,.8,.3,1); transform-style: preserve-3d; }
.flip[aria-pressed="true"] .inner { transform: rotateY(180deg); }
.flip .face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: var(--r-lg); padding: 26px; display: flex; flex-direction: column; gap: 10px; }
.flip .front { background: var(--panel); border: 1.5px solid var(--line-2); }
.flip .back { background: var(--hi); color: var(--ink); transform: rotateY(180deg); }
.flip .big { font-family: var(--font-display); font-weight: 800; font-size: 64px; line-height: 1; }
.flip ul { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; font-size: 16px; }
.timeline { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.year { border-radius: 16px; padding: 14px 10px; background: var(--panel); border: 1.5px solid var(--line); text-align: center; font-family: var(--font-display); font-weight: 800; font-size: 22px; }
.year.on { border-color: var(--hi); background: var(--panel-2); color: var(--hi); }
.ballot { background: #F3F1EA; color: #14161F; border-radius: 6px; padding: 22px 24px; font-family: 'Courier Prime', 'Courier New', monospace; box-shadow: 6px 6px 0 var(--line-2); display: flex; flex-direction: column; gap: 10px; }
.ballot h3 { font-family: 'Courier Prime', 'Courier New', monospace; font-size: 20px; letter-spacing: 0.02em; border-bottom: 2px solid #14161F; padding-bottom: 8px; }
.ballot li { list-style: none; display: flex; gap: 10px; align-items: flex-start; font-size: 16px; }
.ballot ul { padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.ballot .box { width: 20px; height: 20px; border: 2px solid #14161F; border-radius: 3px; flex-shrink: 0; margin-top: 2px; }
.ballot .no { opacity: 0.35; text-decoration: line-through; }

.gm-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); max-width: 460px; width: 100%; }
.gm-cell { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; position: relative; padding: 0; border-style: solid; border-width: 4px; }
.gm-cell .v { width: 44%; height: 44%; box-shadow: 0 0 0 3px var(--ink); }
.gm-cell .d { position: absolute; top: 4px; left: 6px; font-size: 11px; font-weight: 800; color: var(--soft); }

.tilemap { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 5px; }
.st { aspect-ratio: 1; border-radius: 9px; border: 3px solid transparent; font-weight: 800; font-size: clamp(9px, 1.1vw, 13px); padding: 0; min-width: 0; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 14px; color: var(--soft); }
.legend span { display: inline-flex; gap: 8px; align-items: center; }
.legend i { width: 14px; height: 14px; border-radius: 4px; display: inline-block; }
.cand { border-radius: 16px; padding: 14px; display: flex; flex-direction: column; gap: 4px; }
.cand .who { font-weight: 800; font-size: 16px; line-height: 1.25; }

.chart { position: relative; display: flex; gap: 2px; }
.chart .col { flex: 1; min-width: 0; border: 0; padding: 0; background: transparent; border-radius: 4px; display: flex; flex-direction: column; }
.chart .col[aria-pressed="true"] { background: #252A47; }
.chart .col .up, .chart .col .dn { display: flex; justify-content: center; }
.chart .col .up { align-items: flex-end; }
.chart .col .dn { align-items: flex-start; }
.chart .col i { width: 70%; display: block; transition: height .6s cubic-bezier(.3,.8,.3,1); }
.chart .col:hover i { filter: brightness(1.25); }
.chart .line { position: absolute; left: 0; right: 0; pointer-events: none; }
.chart .line span { position: absolute; font-size: 13px; font-weight: 800; background: var(--panel); padding: 2px 6px; border-radius: 6px; top: 4px; }
.axis { display: flex; gap: 2px; }
.axis span { flex: 1; min-width: 0; text-align: center; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.datatable { width: 100%; border-collapse: collapse; font-size: 15px; }
.datatable th, .datatable td { text-align: left; padding: 8px 14px; border-top: 1px solid var(--line); }
.datatable th { color: var(--muted); border-top: 0; }
.scroll-x { overflow-x: auto; }

.meter { display: flex; flex-direction: column; gap: 6px; }
.meter .trk { height: 12px; background: var(--ink); border-radius: 6px; overflow: hidden; }
.meter .trk i { display: block; height: 100%; transition: width .4s ease; border-radius: 6px; }
.stepdots { display: flex; gap: 6px; }
.stepdots i { flex: 1; height: 6px; border-radius: 3px; background: #252A47; display: block; }
.stepdots i.done { background: var(--hi); }
.stepdots i.cur { background: var(--faint); }
.path { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.path li { min-height: 40px; display: inline-flex; align-items: center; padding: 0 16px; border-radius: 999px; font-weight: 700; font-size: 14px; border: 1.5px solid var(--line); color: var(--faint); background: var(--panel); }
.path li.done { background: #22324F; color: var(--dem-text); border-color: #22324F; }
.path li.cur { background: var(--hi); color: var(--ink); border-color: var(--hi); }
.path li.dead { background: var(--bad); color: var(--ink); border-color: var(--bad); }
.ending { border-radius: 28px; padding: 32px; color: var(--ink); display: flex; flex-direction: column; gap: 14px; }
.ending h2 { font-size: clamp(34px, 5vw, 48px); line-height: 1; font-weight: 800; }
.ending .real { background: var(--ink); color: var(--fg); border-radius: 18px; padding: 16px 20px; display: flex; flex-direction: column; gap: 6px; }
.ending .real .eyebrow { color: var(--hi); font-size: 12px; }
.ending .exl { background: var(--exam-bg); color: var(--fg); border-radius: 18px; padding: 14px 20px; font-size: 15px; }

.issue { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 24px; display: flex; flex-direction: column; gap: 14px; }
.sides { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.sides > div { border-radius: 16px; padding: 16px; display: flex; flex-direction: column; gap: 6px; font-size: 15px; line-height: 1.5; }
.headline { background: var(--fg); color: var(--ink); border-radius: 20px; padding: 22px; display: flex; flex-direction: column; gap: 6px; }
.headline b { font-family: var(--font-display); font-weight: 800; font-size: 25px; line-height: 1.1; }
.headline .eyebrow { color: #4A4F6A; font-size: 12px; }
.myth { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-md); padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.myth .claim { font-family: var(--font-display); font-weight: 700; font-size: 20px; line-height: 1.2; }
.myth .ans { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.myth .ans button { min-height: 46px; border-radius: 12px; border: 1.5px solid var(--line-2); background: var(--ink); font-weight: 700; font-size: 14px; }
.myth .ans button.right { border-color: var(--teal-text); background: var(--teal-bg); }
.myth .ans button.wrong { border-color: var(--bad); background: var(--bad-bg); }

.tl { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.tl li { display: flex; gap: 18px; }
.tl .when { width: 74px; flex-shrink: 0; display: flex; flex-direction: column; align-items: center; }
.tl .when b { font-family: var(--font-display); font-weight: 800; font-size: 22px; font-variant-numeric: tabular-nums; color: var(--hi); }
.tl .when small { font-size: 12px; color: var(--muted); }
.tl .when i { flex: 1; width: 2px; background: var(--line); margin-top: 8px; min-height: 20px; display: block; }
.tl .what { flex: 1; min-width: 0; background: var(--panel); border: 1px solid var(--line-2); border-radius: 18px; padding: 16px 18px; margin-bottom: 14px; display: flex; flex-direction: column; gap: 6px; }
.tl li.asleep { opacity: 0.45; }
.tl li.asleep .when b { color: var(--faint); }
.tl li.now .what { border-color: var(--hi); box-shadow: 0 0 0 2px var(--hi) inset; }

.scen { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.scen button { min-height: 88px; text-align: left; padding: 14px 16px; border-radius: 18px; border: 2px solid var(--line); background: var(--panel); display: flex; flex-direction: column; gap: 8px; }
.scen button[aria-pressed="true"] { border-color: var(--hi); background: var(--panel-2); }
.power { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 16px 20px; display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-start; }
.power .status { min-width: 104px; text-align: center; padding: 6px 10px; border-radius: 8px; color: var(--ink); font-size: 12px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; }

.cards3 { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.ev { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 16px; display: flex; flex-direction: column; gap: 10px; font-size: 15px; line-height: 1.5; }
.ev .two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.ev .two button { min-height: 44px; border-radius: 10px; border: 0; font-weight: 800; font-size: 14px; color: var(--ink); }
.placed { border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 8px; font-size: 14px; line-height: 1.45; }
.placed .undo { align-self: flex-start; min-height: 36px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--line-2); background: transparent; font-size: 13px; }

.bingo { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; max-width: 640px; }
.bingo button { aspect-ratio: 1; padding: 4px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--panel); font-weight: 700; font-size: clamp(10px, 1.6vw, 14px); line-height: 1.15; display: flex; align-items: center; justify-content: center; text-align: center; min-width: 0; }
.bingo button[aria-pressed="true"] { border-color: var(--hi); background: #2B3366; }
.bingo button.win { background: var(--hi); color: var(--ink); }

.tale { background: var(--hi); color: var(--ink); border-radius: 28px; padding: 32px; display: flex; flex-direction: column; gap: 16px; }
.tale h2 { font-size: clamp(30px, 4.4vw, 48px); line-height: 1; font-weight: 800; }
.tale .body p + p { margin-top: 12px; }
.tale .sowhat { background: var(--ink); color: var(--fg); border-radius: 18px; padding: 16px 20px; display: flex; flex-direction: column; gap: 4px; }
.talelist { display: flex; flex-direction: column; gap: 8px; }
.talelist button { text-align: left; min-height: 56px; padding: 10px 14px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--panel); display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.talelist button[aria-current="true"] { border-color: var(--hi); }

.pred { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 10px; }
.pred .race { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.pred .race .two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.pred .race .two button { min-height: 46px; border-radius: 10px; border: 2px solid var(--line); font-weight: 700; font-size: 14px; line-height: 1.2; padding: 4px 6px; }
.pred .race .two button.d { background: var(--dem-bg); }
.pred .race .two button.r { background: var(--rep-bg); }
.pred .race .two button[aria-pressed="true"].d { border-color: var(--dem-text); }
.pred .race .two button[aria-pressed="true"].r { border-color: var(--rep-text); }
.stepper { display: flex; align-items: center; justify-content: space-between; background: var(--ink); border-radius: 14px; padding: 8px; }
.stepper button { width: 50px; height: 50px; border-radius: 12px; border: 0; background: #252A47; font-size: 24px; font-weight: 800; }

textarea.notes { width: 100%; min-height: 120px; resize: vertical; background: var(--ink); color: var(--fg); border: 1px solid var(--line); border-radius: 12px; padding: 12px; font: inherit; font-size: 16px; line-height: 1.5; }
input[type=range] { accent-color: var(--hi); width: 100%; height: 32px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
