/* LeaderLab gameplay page: Build a US President.
   Palette tokens copied from docs/STYLE.md (styles.css belongs to the landing page). */

:root {
  --bg: #0a0e1a;
  --surface: #121829;
  --surface-2: #171f35;
  --border: #232c45;
  --text: #e9ecf5;
  --muted: #8a93ad;

  --gold: #f2b53a;
  --red: #e2433b;
  --blue: #3b7bff;
  --green: #3ecf7a;
  --purple: #a970ff;

  --r-common: #8a93ad;
  --r-rare: #3b7bff;
  --r-epic: #f2b53a;
  --r-legend: #a970ff;

  --display: "Oswald", "Bebas Neue", "Arial Narrow", Impact, sans-serif;
  --body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --radius: 14px;

  /* Reel geometry (play.js reads the real sizes from the DOM, so these can change freely) */
  --card-w: 148px;
  --card-gap: 14px;
}

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

body {
  margin: 0;
  background:
    radial-gradient(900px 520px at 50% -80px, rgba(242, 181, 58, 0.14), transparent 70%),
    radial-gradient(700px 420px at 85% 220px, rgba(59, 123, 255, 0.09), transparent 70%),
    var(--bg);
  background-repeat: no-repeat;
  color: var(--text);
  font: 400 16px/1.55 var(--body);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip; /* safety net only; the reel is clipped inside its own box */
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; }
button, input { font: inherit; color: inherit; }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4, p, dl, dd, fieldset, legend { margin: 0; }
fieldset { border: 0; padding: 0; min-width: 0; }

.container { width: 100%; max-width: 1060px; margin: 0 auto; padding: 0 20px; }
.accent { color: var(--gold); }
.muted { color: var(--muted); }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

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

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--gold); color: #1a1204; padding: 8px 14px; border-radius: 8px;
  font-weight: 700; text-decoration: none;
}
.skip-link:focus { top: 12px; }

.meta { font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.sub-label {
  display: flex; align-items: center; gap: 12px;
  font: 600 12px/1 var(--display); letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--muted); margin: 26px 0 12px;
}
.sub-label::after { content: ""; flex: 1; height: 1px; background: var(--border); }

.chip {
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  border: 1px solid var(--border); border-radius: 999px;
  padding: 6px 12px; font: 600 12px/1 var(--display); letter-spacing: 0.14em;
  background: rgba(18, 24, 41, 0.8);
}
.chip--mode { color: var(--gold); border-color: rgba(242, 181, 58, 0.5); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 26px; border-radius: 10px; cursor: pointer;
  font: 600 16px/1 var(--display); letter-spacing: 0.14em; text-transform: uppercase;
  text-decoration: none; border: 1px solid transparent;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, opacity 0.15s ease;
}
.btn--primary {
  background: linear-gradient(180deg, #ffd06a, var(--gold) 55%, #d99a1e);
  color: #1d1405;
  box-shadow: 0 6px 24px rgba(242, 181, 58, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}
.btn--primary:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 10px 30px rgba(242, 181, 58, 0.4), inset 0 1px 0 rgba(255,255,255,0.4); }
.btn--ghost { border-color: var(--border); background: var(--surface); color: var(--text); }
.btn--ghost:hover { border-color: var(--muted); }
.btn:disabled { cursor: not-allowed; opacity: 0.4; box-shadow: none; transform: none; }

.icon-btn {
  display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--border); cursor: pointer; color: var(--text);
}
.icon-btn:hover { border-color: var(--muted); }
#sound-btn .sound-off { display: none; }
#sound-btn[aria-pressed="false"] .sound-on { display: none; }
#sound-btn[aria-pressed="false"] .sound-off { display: block; }
#sound-btn[aria-pressed="false"] { color: var(--muted); }

/* ---------- Top bar (static: nothing fixed covers the game) ---------- */
.topbar { border-bottom: 1px solid var(--border); background: rgba(10, 14, 26, 0.7); }
.topbar__inner { min-height: 60px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.topbar__right { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; min-width: 0; }
.brand__word { font: 700 26px/1 var(--display); letter-spacing: 0.08em; }
.brand__crest svg { width: 30px; height: 30px; }

/* ---------- Page head ---------- */
.play { padding: 18px 0 40px; }
.play__head { text-align: center; margin-bottom: 14px; }
.play__title { font: 700 clamp(28px, 4.4vw, 38px)/1 var(--display); text-transform: uppercase; letter-spacing: 0.02em; }
.play__sub { color: #c5cbe0; margin-top: 6px; font-size: 14.5px; }
.load-error {
  margin: 0 auto 16px; max-width: 520px; padding: 12px 16px; border-radius: 10px; text-align: center;
  border: 1px solid rgba(226, 67, 59, 0.6); background: rgba(226, 67, 59, 0.1);
}

/* ---------- Reel ---------- */
.reel {
  position: relative; overflow: hidden; /* the strip never widens the page */
  border: 1px solid var(--border); border-radius: 18px;
  background:
    radial-gradient(260px 200px at 50% 50%, rgba(242, 181, 58, 0.10), transparent 70%),
    linear-gradient(180deg, #0f1526, #0b101d);
  padding: 22px 0;
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.5), 0 12px 40px rgba(0, 0, 0, 0.35);
}
/* Soft fade at the edges */
.reel::before, .reel::after {
  content: ""; position: absolute; top: 0; bottom: 0; width: 12%; z-index: 2; pointer-events: none;
}
.reel::before { left: 0; background: linear-gradient(90deg, #0b101d, transparent); }
.reel::after { right: 0; background: linear-gradient(270deg, #0b101d, transparent); }

.reel__pointer {
  position: absolute; left: 50%; z-index: 3; width: 0; height: 0; transform: translateX(-50%);
  border-left: 10px solid transparent; border-right: 10px solid transparent;
  filter: drop-shadow(0 0 6px rgba(242, 181, 58, 0.8));
}
.reel__pointer--top { top: 0; border-top: 12px solid var(--gold); }
.reel__pointer--bottom { bottom: 0; border-bottom: 12px solid var(--gold); }

.reel__strip {
  display: flex; gap: var(--card-gap); width: max-content;
  will-change: transform;
}

/* ---------- Card ---------- */
.card {
  --rar: var(--r-common);
  flex: none; width: var(--card-w); position: relative; text-align: center;
  background: linear-gradient(180deg, var(--surface-2), var(--bg));
  border: 1.5px solid var(--rar); border-radius: 12px; padding: 12px 8px 12px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.3), 0 0 16px color-mix(in srgb, var(--rar) 32%, transparent);
  transition: opacity 0.3s ease, transform 0.3s ease, filter 0.3s ease;
}
.card--rare { --rar: var(--r-rare); }
.card--epic { --rar: var(--r-epic); }
.card--legend { --rar: var(--r-legend); background: linear-gradient(180deg, rgba(169, 112, 255, 0.2), var(--bg) 72%); }
.card__rarity {
  position: absolute; top: 8px; left: 8px; font: 700 8.5px/1 var(--body); letter-spacing: 0.12em;
  color: var(--rar); text-transform: uppercase;
}
.card__num { position: absolute; top: 7px; right: 8px; font: 600 10px/1 var(--display); letter-spacing: 0.06em; color: var(--muted); max-width: 52%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card__prime {
  position: absolute; top: 22px; left: 50%; transform: translateX(-50%); z-index: 1;
  font: 700 8.5px/1 var(--body); letter-spacing: 0.14em; padding: 3px 6px; border-radius: 4px;
  background: var(--gold); color: #1d1405;
}
.avatar {
  --av: #3a4a6b;
  width: 64px; height: 64px; margin: 10px auto 8px; border-radius: 50%; position: relative; overflow: hidden;
  background: radial-gradient(circle at 50% 30%, color-mix(in srgb, var(--av) 75%, #fff 8%), color-mix(in srgb, var(--av) 40%, var(--bg)));
  border: 1.5px solid color-mix(in srgb, var(--rar, var(--muted)) 60%, transparent);
}
.avatar svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.avatar__initials {
  position: absolute; inset: 0; display: grid; place-items: center; padding-top: 12px;
  font: 700 16px/1 var(--display); letter-spacing: 0.06em; color: var(--text); text-shadow: 0 1px 4px rgba(0,0,0,0.6);
}
/* AI-generated portraits (docs/specs/character-pipeline.md): one shared treatment so the set reads as a
   single illustrated style: slightly muted and warmed, a navy-to-gold wash, and a soft navy vignette.
   The image covers the initials only once loaded; on error it is removed and the initials remain. */
.portrait {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: inherit;
  filter: saturate(0.72) sepia(0.16) contrast(1.05) brightness(0.97);
  opacity: 0; transition: opacity 0.25s ease;
}
.avatar.has-portrait .portrait { opacity: 1; }
.avatar.has-portrait::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background:
    radial-gradient(circle at 50% 42%, transparent 52%, rgba(10, 14, 26, 0.55) 100%),
    linear-gradient(180deg, rgba(242, 181, 58, 0.12), rgba(35, 44, 69, 0.28));
  box-shadow: inset 0 0 0 1px rgba(242, 181, 58, 0.14);
}
.card__name {
  font: 600 13.5px/1.12 var(--display); letter-spacing: 0.03em; text-transform: uppercase;
  min-height: 2.3em; display: grid; place-items: center;
}
.card__ovr {
  font: 700 38px/1 var(--display); color: var(--rar); margin: 4px 0 2px;
  text-shadow: 0 0 16px color-mix(in srgb, var(--rar) 45%, transparent);
}
.card--common .card__ovr { color: var(--text); text-shadow: none; }
.card__yrs { font-size: 10.5px; font-weight: 600; color: var(--gold); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Multi-term ranges show a compact form ("1885–89, 93–97"); the full range is in the title and sr-only text. */
.card__meta { font-size: 10px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }

/* Reel states */
.reel.has-landed .card:not(.is-center) { opacity: 0.5; filter: saturate(0.7); }
.card.is-center { z-index: 1; }
.card.is-landed {
  border-color: color-mix(in srgb, var(--rar) 60%, #fff);
  animation: land 0.55s cubic-bezier(0.2, 1.4, 0.4, 1) both, land-glow 1.6s ease-out both;
  transform: scale(1.07);
}
.card--legend.is-landed { animation: land 0.55s cubic-bezier(0.2, 1.4, 0.4, 1) both, land-glow-legend 2.2s ease-out both; }
.card.is-drafted { opacity: 0.35 !important; filter: grayscale(1) !important; transform: scale(0.96); }
.card.is-drafted::after {
  content: "DRAFTED"; position: absolute; left: 50%; top: 44%; transform: translate(-50%, -50%) rotate(-12deg);
  font: 700 14px/1 var(--display); letter-spacing: 0.2em; color: var(--gold);
  border: 2px solid var(--gold); padding: 4px 8px; border-radius: 6px; background: rgba(10, 14, 26, 0.8);
}
@keyframes land {
  0% { transform: scale(0.94); }
  55% { transform: scale(1.12); }
  100% { transform: scale(1.07); }
}
@keyframes land-glow {
  0% { box-shadow: 0 0 0 1px rgba(0,0,0,0.3), 0 0 0 color-mix(in srgb, var(--rar) 0%, transparent); }
  25% { box-shadow: 0 0 0 3px color-mix(in srgb, var(--rar) 70%, transparent), 0 0 48px color-mix(in srgb, var(--rar) 85%, transparent); }
  100% { box-shadow: 0 0 0 1px rgba(0,0,0,0.3), 0 0 28px color-mix(in srgb, var(--rar) 55%, transparent); }
}
@keyframes land-glow-legend {
  0% { box-shadow: 0 0 0 0 transparent; }
  20% { box-shadow: 0 0 0 4px rgba(169,112,255,0.8), 0 0 70px rgba(169,112,255,0.95), 0 0 120px rgba(242,181,58,0.35); }
  100% { box-shadow: 0 0 0 1px rgba(0,0,0,0.3), 0 0 34px rgba(169,112,255,0.65); }
}

/* ---------- Controls ---------- */
.controls { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-top: 16px; }
.btn--spin { min-width: 180px; min-height: 54px; font-size: 20px; letter-spacing: 0.24em; }
.btn--spin.is-spinning { animation: pulse 0.6s ease-in-out infinite alternate; opacity: 0.85; }
@keyframes pulse { to { box-shadow: 0 0 36px rgba(242, 181, 58, 0.6); } }

.lifelines { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.lifeline {
  min-height: 36px; padding: 0 14px; border-radius: 999px; cursor: pointer;
  font: 600 13px/1 var(--display); letter-spacing: 0.12em; text-transform: uppercase;
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}
.lifeline:hover:not(:disabled) { border-color: var(--gold); color: var(--gold); }
.lifeline:disabled { cursor: not-allowed; opacity: 0.45; }
.lifeline.is-ready { border-color: rgba(242, 181, 58, 0.55); }
.lifeline.is-used { text-decoration: line-through; text-decoration-thickness: 2px; opacity: 0.35; }
.lifeline-help { font-size: 12.5px; color: var(--muted); text-align: center; max-width: 560px; }
.lifeline-help b { color: var(--text); }

/* ---------- Panels ---------- */
.panel {
  position: relative; background: linear-gradient(180deg, rgba(23, 31, 53, 0.85), rgba(18, 24, 41, 0.85));
  border: 1px solid var(--border); border-radius: var(--radius); padding: 18px;
}
/* Corner ticks, like the reference, in gold */
.panel::before {
  content: ""; position: absolute; top: 8px; left: 8px; width: 12px; height: 12px;
  border-top: 2px solid var(--gold); border-left: 2px solid var(--gold); border-radius: 2px 0 0 0; opacity: 0.8;
}

.draft-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; margin-top: 18px; align-items: start; }

/* Landed */
.landed__body { min-height: 104px; }
.landed__empty { text-align: center; padding: 18px 0 6px; }
.landed__big { font: 700 30px/1 var(--display); letter-spacing: 0.06em; text-transform: uppercase; color: var(--gold); margin-bottom: 6px; }
.landed__card { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: center; }
.landed__card .avatar { width: 84px; height: 84px; margin: 0; border-radius: 14px; }
.landed__card .avatar__initials { font-size: 20px; padding-top: 16px; }
.landed__name { font: 700 24px/1.1 var(--display); letter-spacing: 0.02em; }
.landed__tag {
  display: inline-block; margin-left: 6px; vertical-align: 3px; font: 700 9.5px/1 var(--body); letter-spacing: 0.12em;
  padding: 3px 6px; border-radius: 4px; text-transform: uppercase; color: var(--rar); border: 1px solid var(--rar);
}
.landed__tag--prime { background: var(--gold); color: #1d1405; border-color: var(--gold); }
.landed__meta { margin-top: 4px; }
.landed__ovr { font: 700 44px/1 var(--display); color: var(--rar); margin-top: 4px; text-shadow: 0 0 18px color-mix(in srgb, var(--rar) 45%, transparent); }
.landed__card.r-common .landed__ovr { color: var(--text); text-shadow: none; }
.landed__blurb { grid-column: 1 / -1; font-size: 13px; color: #c5cbe0; }
.r-common { --rar: var(--r-common); }
.r-rare { --rar: var(--r-rare); }
.r-epic { --rar: var(--r-epic); }
.r-legend { --rar: var(--r-legend); }
.landed__hint {
  margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border);
  text-align: center; font-size: 14px; color: var(--muted);
}
.landed.is-active .landed__hint { color: var(--gold); font-weight: 600; }
.landed:not(.is-active) .landed__hint { visibility: hidden; }

/* Board */
.board__head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.board__title { font: 700 20px/1 var(--display); letter-spacing: 0.14em; text-transform: uppercase; }
.board__left { font-size: 13px; color: var(--muted); margin-top: 6px; }
.board__ovr { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 4px; }
.board__ovr-label { font: 600 11px/1 var(--display); letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); }
.board__ovr-num {
  display: grid; place-items: center; width: 74px; height: 74px; border-radius: 50%;
  border: 3px solid var(--gold); font: 700 36px/1 var(--display); color: var(--gold); background: rgba(10, 14, 26, 0.7);
  box-shadow: 0 0 20px rgba(242, 181, 58, 0.25), inset 0 0 12px rgba(242, 181, 58, 0.15);
}
.board__ovr-num.bump { animation: bump 0.4s ease; }
@keyframes bump { 50% { transform: scale(1.15); } }

.pips { display: grid; grid-template-columns: repeat(9, 1fr); gap: 4px; margin: 14px 0; }
.pips li { height: 5px; border-radius: 3px; background: var(--border); transition: background 0.3s ease; }
.pips li.is-on { background: var(--gold); box-shadow: 0 0 8px rgba(242, 181, 58, 0.5); }

.slot {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left;
  min-height: 84px; padding: 10px 10px 9px; border-radius: 10px; cursor: default;
  background: rgba(10, 14, 26, 0.6); border: 1.5px dashed var(--border); color: var(--text);
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}
.slot__label { display: flex; align-items: center; gap: 6px; font: 600 11px/1.1 var(--display); letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.slot__icon { font-size: 14px; }
.slot__val { font: 700 28px/1.05 var(--display); color: var(--muted); margin-top: 4px; }
.slot__who { display: flex; align-items: center; gap: 6px; max-width: 100%; min-width: 0; font-size: 11px; line-height: 1.25; color: var(--muted); }
.slot__av:empty { display: none; }
.slot__av .avatar { width: 22px; height: 22px; margin: 0; flex: none; border-width: 1px; border-color: color-mix(in srgb, var(--rar, var(--muted)) 70%, transparent); }
.slot__av .avatar__initials { font-size: 8.5px; padding-top: 2px; letter-spacing: 0.02em; }
.slot__name {
  /* Long names wrap at word boundaries (up to two lines) instead of clipping mid-word; full name in title/aria-label. */
  min-width: 0;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden;
  overflow-wrap: normal; word-break: normal; hyphens: none;
}
.slot:disabled { opacity: 1; }
.slot.is-filled { border-style: solid; border-color: color-mix(in srgb, var(--rar) 55%, var(--border)); background: linear-gradient(180deg, rgba(23,31,53,0.9), rgba(10,14,26,0.8)); }
.slot.is-filled .slot__val { color: var(--rar); }
.slot.is-filled.r-common .slot__val { color: var(--text); }
.slot.is-filled .slot__who { color: #c5cbe0; }
.slot.is-fresh { animation: fresh 0.6s ease; }
@keyframes fresh { 0% { transform: scale(1.06); box-shadow: 0 0 30px color-mix(in srgb, var(--rar) 70%, transparent); } 100% { transform: none; } }

/* Assignable: glowing, shows the value this president would give */
.slot.is-open {
  cursor: pointer; border-style: solid; border-color: var(--gold);
  background: linear-gradient(180deg, rgba(242, 181, 58, 0.12), rgba(10, 14, 26, 0.7));
  animation: slot-glow 1.4s ease-in-out infinite alternate;
}
.slot.is-open .slot__val { color: var(--gold); }
.slot.is-open .slot__label { color: var(--text); }
.slot.is-open:hover, .slot.is-open:focus-visible { transform: translateY(-2px); background: linear-gradient(180deg, rgba(242, 181, 58, 0.22), rgba(10, 14, 26, 0.7)); }
.slot.is-open.is-best::after {
  content: "BEST"; position: absolute; top: -7px; right: 8px; box-shadow: 0 0 0 2px var(--bg); font: 700 8.5px/1 var(--body); letter-spacing: 0.12em;
  color: #1d1405; background: var(--gold); padding: 3px 5px; border-radius: 4px;
}
@keyframes slot-glow {
  from { box-shadow: 0 0 0 0 rgba(242, 181, 58, 0), 0 0 8px rgba(242, 181, 58, 0.25); }
  to { box-shadow: 0 0 0 2px rgba(242, 181, 58, 0.25), 0 0 22px rgba(242, 181, 58, 0.55); }
}

/* ---------- Silhouette stage (spec Addendum A) ----------
   Mobile first: figure on top, tiles in a 3-column grid, no connectors. 720px+: two tile columns around the figure. */
.stage { position: relative; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 8px; margin-top: 4px; }
.stage__col { display: contents; }
.stage__wires { display: none; }
.fig { grid-column: 1 / -1; order: -1; width: min(55%, 260px); justify-self: center; margin: 0 0 8px; position: relative; }
.fig__svg { display: block; width: 100%; height: auto; overflow: visible; -webkit-tap-highlight-color: transparent; }

.rg__hit { fill: #000; fill-opacity: 0; pointer-events: all; }
.rg__tint { fill: url(#rg-g-gold); opacity: 0; transition: opacity 0.25s ease; pointer-events: none; will-change: opacity; }
.rg-g--gold stop { stop-color: var(--gold); }
.rg-g--common stop { stop-color: #b9c0d6; }
.rg-g--rare stop { stop-color: var(--r-rare); }
.rg-g--epic stop { stop-color: var(--r-epic); }
.rg-g--legend stop { stop-color: var(--r-legend); }
.rg[data-state="open"] { cursor: pointer; }
.rg[data-state="open"] .rg__tint { opacity: 0.5; animation: rg-pulse 1.4s ease-in-out infinite alternate; }
.rg[data-state="open"].is-hover .rg__tint { opacity: 0.95; animation: none; }
.rg[data-state="filled"] .rg__tint { opacity: 0.6; }
.rg[data-state="filled"].is-hover .rg__tint { opacity: 0.95; }
.rg[data-key="stamina"] .rg__tint { fill-opacity: 0.7; }
.rg[data-tier="common"] .rg__tint { fill: url(#rg-g-common); }
.rg[data-tier="rare"] .rg__tint { fill: url(#rg-g-rare); }
.rg[data-tier="epic"] .rg__tint { fill: url(#rg-g-epic); }
.rg[data-tier="legend"] .rg__tint { fill: url(#rg-g-legend); }
.rg.is-fresh .rg__tint { animation: rg-fresh 0.7s ease; }
@keyframes rg-pulse { from { opacity: 0.22; } to { opacity: 0.68; } }
@keyframes rg-fresh { 0% { opacity: 1; } 100% { opacity: 0.6; } }

.slot.is-hover.is-open { background: linear-gradient(180deg, rgba(242, 181, 58, 0.22), rgba(10, 14, 26, 0.7)); }
.slot.is-hover.is-filled { border-color: var(--rar); }

/* Final slot flourish, then a settled glow while the build is complete */
.stage.is-complete .fig__svg { filter: drop-shadow(0 0 14px rgba(242, 181, 58, 0.28)); }
.stage.is-flourish .fig__svg { animation: fig-flourish 0.95s ease-out; }
@keyframes fig-flourish {
  0% { filter: drop-shadow(0 0 0 rgba(242, 181, 58, 0)); transform: scale(1); }
  45% { filter: drop-shadow(0 0 26px rgba(242, 181, 58, 0.85)) brightness(1.35); transform: scale(1.03); }
  100% { filter: drop-shadow(0 0 14px rgba(242, 181, 58, 0.28)); transform: scale(1); }
}

@media (min-width: 720px) {
  .stage {
    grid-template-columns: minmax(0, 1fr) clamp(220px, 36%, 330px) minmax(0, 1fr);
    gap: 0 clamp(26px, 4vw, 48px); align-items: center; margin-top: 10px;
  }
  .stage__col { display: flex; flex-direction: column; gap: 10px; position: relative; z-index: 1; }
  .stage__col--left { align-items: flex-end; }
  .stage__col--right { align-items: flex-start; }
  .fig { grid-column: 2; order: 0; width: 100%; margin: 0; z-index: 1; }
  .stage__wires { display: block; position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 2; overflow: visible; }
  .wire__line { fill: none; stroke: var(--border); stroke-width: 1.2; transition: stroke 0.2s ease, stroke-width 0.2s ease, opacity 0.2s ease; }
  .wire__dot { fill: var(--bg); stroke: var(--border); stroke-width: 1.4; }
  .wire__end { fill: var(--border); }
  .wire[data-state="open"] .wire__line { stroke: rgba(242, 181, 58, 0.55); stroke-dasharray: 3 4; animation: wire-flow 1.2s linear infinite; }
  .wire[data-state="open"] .wire__dot { stroke: var(--gold); fill: rgba(242, 181, 58, 0.35); }
  .wire[data-state="open"] .wire__end { fill: var(--gold); }
  .wire[data-state="filled"] { --wc: var(--r-common); }
  .wire[data-tier="rare"] { --wc: var(--r-rare); }
  .wire[data-tier="epic"] { --wc: var(--r-epic); }
  .wire[data-tier="legend"] { --wc: var(--r-legend); }
  .wire[data-state="filled"] .wire__line { stroke: color-mix(in srgb, var(--wc) 60%, transparent); }
  .wire[data-state="filled"] .wire__dot { stroke: var(--wc); fill: var(--wc); }
  .wire[data-state="filled"] .wire__end { fill: var(--wc); }
  .wire.is-hover .wire__line { stroke: var(--gold); stroke-width: 2; stroke-dasharray: none; }
  .wire.is-hover .wire__dot { stroke: var(--gold); fill: var(--gold); }
  .wire[data-state="filled"].is-hover .wire__line { stroke: var(--wc); }
  @keyframes wire-flow { to { stroke-dashoffset: -14; } }

  /* Tiles beside the figure: near-square, spread evenly over the figure's full height. Both columns share a
     10-row half-step grid: the left five tiles fill it, the right four sit staggered between them. */
  .stage { align-items: stretch; }
  .stage__col { display: grid; grid-template-rows: repeat(10, minmax(0, 1fr)); row-gap: 14px; height: 0; min-height: max(100%, 516px); }
  .stage__col--left { justify-items: end; }
  .stage__col--right { justify-items: start; }
  .stage__col > .slot { grid-row: span 2; }
  .stage__col--right > .slot:first-child { grid-row: 2 / span 2; }
  .fig { align-self: center; }
  .stage .slot {
    width: auto; height: 100%; min-width: 0; min-height: 92px; aspect-ratio: 1.12 / 1; max-width: 100%; overflow: visible;
    display: flex; flex-direction: column; align-items: center; justify-content: space-between; text-align: center;
    gap: 2px; padding: 8px 8px 8px;
  }
  .stage .slot > * { flex-shrink: 0; }
  .stage .slot__label { justify-content: center; font-size: 10px; letter-spacing: 0.08em; gap: 5px; line-height: 1.15; text-wrap: balance; }
  .stage .slot__val { margin: 0; font-size: 33px; line-height: 1; }
  .stage .slot__who { justify-content: center; width: 100%; overflow: hidden; }
  .stage .slot__name { -webkit-line-clamp: 1; line-clamp: 1; text-overflow: ellipsis; }
}

/* ---------- Complete ---------- */
.complete { margin-top: 22px; text-align: center; padding: 26px 18px; border-color: rgba(242, 181, 58, 0.45); }
.complete__title { font: 700 clamp(24px, 4vw, 32px)/1 var(--display); letter-spacing: 0.06em; text-transform: uppercase; }
.complete__title:focus { outline: none; }
.complete__ovr {
  font: 700 88px/1 var(--display); color: var(--gold); margin-top: 8px;
  text-shadow: 0 0 40px rgba(242, 181, 58, 0.45); font-variant-numeric: tabular-nums;
}
.complete__arch { margin-top: 16px; font: 700 18px/1.2 var(--display); letter-spacing: 0.14em; text-transform: uppercase; color: var(--red); }
.complete__arch-desc { margin: 4px auto 0; max-width: 480px; font-size: 14px; color: #c5cbe0; }
.complete__comp { margin-top: 12px; font: 600 13px/1.3 var(--display); letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.complete__comp b { color: var(--text); }
.complete__comp .match { color: var(--gold); }

.setup { max-width: 460px; margin: 22px auto 0; display: grid; gap: 16px; text-align: left; }
.field label, .parties legend { display: block; font: 600 12px/1 var(--display); letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.field__row { display: flex; gap: 8px; }
.field input {
  flex: 1; min-width: 0; height: 46px; padding: 0 14px; border-radius: 10px;
  background: var(--bg); border: 1px solid var(--border); font-size: 16px;
}
.field input:focus-visible { outline-offset: 1px; border-color: var(--gold); }
.field__row .icon-btn { width: 46px; height: 46px; font-size: 18px; }
.field__note { font-size: 12.5px; color: var(--gold); min-height: 1em; margin-top: 6px; }
.field__note:empty { display: none; }

.parties { display: flex; flex-wrap: wrap; gap: 8px; }
.parties legend { width: 100%; }
.party { position: relative; flex: 1 1 110px; cursor: pointer; }
.party input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.party span {
  display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 10px;
  border-radius: 999px; border: 1.5px solid var(--border); background: var(--surface);
  font: 600 13px/1 var(--display); letter-spacing: 0.12em; text-transform: uppercase;
}
.party span::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--pc); box-shadow: 0 0 8px var(--pc); }
.party--blue { --pc: var(--blue); }
.party--red { --pc: var(--red); }
.party--ind { --pc: #b9a24a; }
.party input:checked + span { border-color: var(--pc); background: color-mix(in srgb, var(--pc) 18%, var(--surface)); }
.party input:focus-visible + span { outline: 2px solid var(--gold); outline-offset: 3px; }

.complete__btns, .result__btns { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.complete__btns .btn--primary { flex: 1 1 220px; }

/* ---------- Result ---------- */
.result { margin-top: 22px; padding: 0; overflow: hidden; }
.result::before { z-index: 1; }
.result__head {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 14px;
  padding: 22px 20px 18px; background: linear-gradient(180deg, rgba(242,181,58,0.06), transparent);
  border-bottom: 1px solid var(--border);
}
.result__who { font: 600 15px/1.3 var(--display); letter-spacing: 0.1em; text-transform: uppercase; margin-top: 6px; }
.result__who .dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }
.result__verdict { text-align: right; max-width: 460px; margin-left: auto; }
.result__verdict-label {
  font: 700 clamp(26px, 5vw, 40px)/1 var(--display); text-transform: uppercase; letter-spacing: 0.02em;
  color: var(--vc, var(--text)); text-shadow: 0 0 30px color-mix(in srgb, var(--vc, var(--text)) 40%, transparent);
}
.result__verdict-label:focus { outline: none; }
.result__verdict-blurb { font-size: 14px; color: #c5cbe0; margin-top: 6px; }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-bottom: 1px solid var(--border); }
.stats div { padding: 14px 8px; text-align: center; display: flex; flex-direction: column-reverse; } /* dt first in markup, number shown on top */
.stats div + div { border-left: 1px solid var(--border); }
.stats dd { font: 700 28px/1 var(--display); color: var(--gold); font-variant-numeric: tabular-nums; }
.stats dt { font-size: 10.5px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin-top: 6px; }
.result__end { padding: 12px 20px 0; text-align: center; font-size: 14px; color: #c5cbe0; }
.result > .sub-label, .result > .table-wrap, .result__cols, .result__btns { margin-left: 20px; margin-right: 20px; }
.result__btns { margin-top: 24px; margin-bottom: 22px; }

.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; }
.years { width: 100%; border-collapse: collapse; font-size: 14px; }
.years th {
  text-align: left; padding: 10px 12px; font: 600 11px/1 var(--display); letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--muted); background: rgba(10, 14, 26, 0.6); border-bottom: 1px solid var(--border);
}
.years td { padding: 9px 12px; border-top: 1px solid var(--border); vertical-align: middle; }
.years tr:first-child td { border-top: 0; }
.years .y { font: 700 15px/1 var(--display); color: var(--gold); white-space: nowrap; }
.years .appr { min-width: 150px; }
.bar { display: flex; align-items: center; gap: 8px; }
.bar__track { flex: 1; height: 8px; border-radius: 4px; background: var(--border); overflow: hidden; min-width: 60px; }
.bar__fill { display: block; height: 100%; border-radius: 4px; background: var(--bc); }
.bar b { font-variant-numeric: tabular-nums; width: 3.2ch; text-align: right; }
.years .econ { font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 600; }
.years .note { color: #c5cbe0; min-width: 160px; }
.up { color: var(--green); }
.down { color: var(--red); }

.result__cols { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 20px; }
.feed { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.feed li { display: grid; grid-template-columns: 52px 1fr; gap: 10px; padding: 10px 12px; font-size: 14px; border-left: 3px solid var(--muted); }
.feed li + li { border-top: 1px solid var(--border); }
.feed .y { font: 700 13px/1.5 var(--display); letter-spacing: 0.08em; color: var(--gold); }
.feed .tone-good { border-left-color: var(--green); }
.feed .tone-bad { border-left-color: var(--red); }
.feed .tone-neutral { border-left-color: var(--blue); }
.feed .tone-milestone { border-left-color: var(--gold); background: rgba(242, 181, 58, 0.07); font-weight: 600; }

.elections { display: grid; gap: 8px; }
.elections li { border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; background: rgba(10, 14, 26, 0.5); }
.elections .ev { font: 700 26px/1 var(--display); font-variant-numeric: tabular-nums; }
.elections .won { color: var(--green); }
.elections .lost { color: var(--red); }
.ev-bar { display: flex; height: 8px; border-radius: 4px; overflow: hidden; margin: 8px 0 6px; background: var(--border); position: relative; }
.ev-bar span { display: block; height: 100%; }
.ev-bar::after { content: ""; position: absolute; left: 50%; top: -2px; bottom: -2px; width: 2px; background: var(--text); opacity: 0.7; }
.elections p { font-size: 13px; color: #c5cbe0; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--border); padding: 26px 0 34px; text-align: center; font-size: 13px; color: var(--muted); }
.footer__links a { color: var(--text); font-weight: 600; }
.footer__disclaimer { margin: 10px auto 6px; max-width: 620px; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .draft-grid { grid-template-columns: 1fr; }
  .result__cols { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  :root { --card-w: 118px; --card-gap: 10px; }
  .container { padding: 0 14px; }
  .brand__word { font-size: 22px; }
  .chip--mode { padding: 6px 9px; font-size: 11px; }
  .play { padding-top: 18px; }
  .play__sub { font-size: 14px; }
  .reel { padding: 18px 0; border-radius: 14px; }
  .avatar { width: 52px; height: 52px; margin-top: 12px; }
  .avatar__initials { font-size: 14px; padding-top: 10px; }
  .card { padding: 10px 6px; }
  .card__name { font-size: 12px; }
  .card__ovr { font-size: 32px; }
  .card__meta { font-size: 9px; letter-spacing: 0.06em; }
  .panel { padding: 16px 12px; }
  .stage { gap: 10px 6px; } /* extra row gap leaves room for the BEST tag */
  .slot { min-height: 78px; padding: 9px 8px 8px; }
  .slot__label { font-size: 10px; letter-spacing: 0.06em; gap: 4px; }
  .slot__val { font-size: 24px; }
  .slot.is-open.is-best::after { right: 6px; }
  .landed__card .avatar { width: 68px; height: 68px; }
  .landed__name { font-size: 20px; }
  .landed__ovr { font-size: 38px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats div:nth-child(3) { border-left: 0; }
  .stats div:nth-child(n+3) { border-top: 1px solid var(--border); }
  .result__verdict { text-align: left; margin-left: 0; }
  .result > .sub-label, .result > .table-wrap, .result__cols, .result__btns { margin-left: 12px; margin-right: 12px; }
  .result__head { padding: 20px 14px 16px; }
  .complete__ovr { font-size: 72px; }
  /* Year table fits the phone: tighter cells, flexible bar, note wraps */
  .years { font-size: 13px; }
  .years th, .years td { padding: 8px 7px; }
  .years .appr { min-width: 0; width: 38%; }
  .bar { gap: 5px; }
  .bar__track { min-width: 28px; }
  .years .note { min-width: 0; font-size: 12px; }
  .btn { padding: 0 18px; }
}
@media (max-width: 480px) {
  /* Lifelines: tidy 2x2 grid of equal pills (Re-spin | Prime, Snag left | Snag right). */
  .lifelines { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: min(100%, 340px); }
  .lifeline { width: 100%; padding: 0 10px; min-height: 40px; }
}
@media (max-width: 400px) {
  :root { --card-w: 104px; }
  .brand__crest { display: none; }
  .slot__icon { display: none; }
}

/* =================================================================
   Career timeline player (docs/specs/career-timeline.md)
   ================================================================= */
:root {
  --c-war: #e2433b; --c-treaty: #3b7bff; --c-law: #f2b53a;
  --c-moonshot: #a970ff; --c-crisis: #ff8a3d; --c-economy: #3ecf7a;
  --rail-top: 100px; --pin: 34px; --lane-step: 30px;
}
.cat-war { --cc: var(--c-war); }
.cat-treaty { --cc: var(--c-treaty); }
.cat-law { --cc: var(--c-law); }
.cat-moonshot { --cc: var(--c-moonshot); }
.cat-crisis { --cc: var(--c-crisis); }
.cat-economy { --cc: var(--c-economy); }
.cat-election, .cat-end { --cc: var(--gold); }
.cat-none { --cc: var(--muted); }

.tl { margin-top: 22px; padding: 0; }
.tl::before { z-index: 1; }
.tl__head {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px;
  padding: 22px 20px 16px; border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(242,181,58,0.06), transparent);
  border-radius: var(--radius) var(--radius) 0 0;
}
.tl__who { font: 700 clamp(22px, 3.6vw, 30px)/1.05 var(--display); letter-spacing: 0.04em; text-transform: uppercase; margin-top: 4px; }
.tl__who:focus { outline: none; }
.tl__party { font: 600 13px/1.3 var(--display); letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin-top: 4px; }
.tl__party .dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }
.tl__live { display: flex; align-items: center; gap: 22px; }

.gauge { position: relative; display: grid; justify-items: center; gap: 4px; }
.gauge svg { width: 64px; height: 64px; transform: rotate(-90deg); }
.gauge__track, .gauge__fill { fill: none; stroke-width: 6; }
.gauge__track { stroke: var(--border); }
.gauge__fill {
  stroke: var(--gold); stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: 50;
  transition: stroke-dashoffset 0.6s cubic-bezier(0.3, 0.8, 0.3, 1), stroke 0.4s ease;
  filter: drop-shadow(0 0 4px currentColor);
}
.gauge__num {
  position: absolute; top: 0; left: 0; right: 0; height: 64px; display: grid; place-items: center;
  font: 700 21px/1 var(--display); font-variant-numeric: tabular-nums;
}
.gauge__num small { font-size: 11px; color: var(--muted); margin-left: 1px; }
.gauge__num { grid-auto-flow: column; justify-content: center; align-items: center; }
.gauge__label, .tl__stat-label { font: 600 10.5px/1 var(--display); letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); }
.gauge__delta {
  position: absolute; top: 4px; right: -16px; font: 700 15px/1 var(--display); pointer-events: none;
  animation: float-up 1.2s ease-out forwards;
}
@keyframes float-up { 0% { opacity: 0; transform: translateY(8px) scale(0.8); } 20% { opacity: 1; transform: translateY(0) scale(1.15); } 100% { opacity: 0; transform: translateY(-22px); } }
.tl__stat { display: grid; gap: 6px; justify-items: center; min-width: 88px; }
.tl__stat-num { font: 700 24px/1 var(--display); letter-spacing: 0.03em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tl__stat--ach .tl__stat-num { color: var(--gold); }
.tl__stat.is-pop .tl__stat-num { animation: ach-pop 0.6s cubic-bezier(0.2, 1.6, 0.4, 1); }
@keyframes ach-pop { 0% { transform: scale(1); } 40% { transform: scale(1.45); text-shadow: 0 0 20px var(--gold); } 100% { transform: scale(1); } }

/* ---- Track ---- */
.tl__track-wrap { padding: 8px 26px 4px; }
.tl__track { position: relative; height: calc(var(--rail-top) + 36px); }
.tl__lanes { position: absolute; left: 0; right: 0; top: 0; height: var(--rail-top); }
.tl__rail {
  position: absolute; left: 0; right: 0; top: var(--rail-top); height: 8px; border-radius: 4px;
  background: var(--rail-live); overflow: hidden;
}
.tl__fill {
  position: absolute; left: 0; top: 0; bottom: 0; width: 0;
  background: linear-gradient(90deg, rgba(242,181,58,0.35), var(--gold));
  box-shadow: 0 0 12px rgba(242,181,58,0.6);
}
.tl { --rail-live: #4a5572; --rail-locked: #151a2a; }
/* Second term (2033–2036): always drawn. Locked = darker grey with a lock; re-elected = in-play grey. */
.tl__band {
  position: absolute; top: 0; bottom: 0; width: 0; overflow: hidden;
  background-color: var(--rail-locked); box-shadow: inset 1px 0 0 #2e3857;
  transition: background-color 0.4s ease calc(0.175s / var(--k, 1));
}
.tl__band::before {
  content: ""; position: absolute; inset: 0; transition: opacity 0.3s ease;
  background: repeating-linear-gradient(135deg, rgba(138,147,173,0.16) 0 5px, transparent 5px 10px);
}
.tl.is-t2-open .tl__band { background-color: var(--rail-live); box-shadow: none; }
.tl.is-t2-open .tl__band::before { opacity: 0; }
.tl.is-t2-lost .tl__band::before, .tl.is-t2-none .tl__band::before {
  background: repeating-linear-gradient(135deg, rgba(226,67,59,0.22) 0 4px, transparent 4px 9px);
}
.tl__lock {
  position: absolute; top: calc(var(--rail-top) + 4px); left: 50%; z-index: 1;
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px 3px 7px; white-space: nowrap;
  transform: translate(-50%, -50%); border-radius: 999px; pointer-events: none;
  background: #0f1422; border: 1px solid #2e3857; color: var(--muted);
  font: 600 11px/1 var(--display); letter-spacing: 0.14em; text-transform: uppercase;
}
.tl__lock-ico { font-size: 11px; letter-spacing: 0; }
.tl.is-t2-open .tl__lock { opacity: 0; visibility: hidden; }
.tl.is-t2-lost .tl__lock, .tl.is-t2-none .tl__lock { color: #e8a09b; border-color: rgba(226,67,59,0.5); }
.tl__ylab--t2 { color: #566080; transition: color 0.3s ease; }
.tl.is-t2-open .tl__ylab--t2 { color: var(--muted); }
.tl.is-t2-lost .tl__ylab--t2, .tl.is-t2-none .tl__ylab--t2 { color: #444c66; text-decoration: line-through; }
/* Re-election won: the lock pops open, a light sweeps the segment and it turns in-play. */
.tl__track.is-unlocking .tl__lock { visibility: visible; animation: lock-pop calc(0.55s / var(--k, 1)) cubic-bezier(0.3, 1.4, 0.5, 1) both; }
.tl__track.is-unlocking .tl__band::after {
  content: ""; position: absolute; top: 0; bottom: 0; width: 40%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.9), transparent);
  animation: sweep calc(0.45s / var(--k, 1)) ease-out calc(0.15s / var(--k, 1)) both;
}
@keyframes lock-pop {
  0% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  30% { opacity: 1; transform: translate(-50%, -50%) scale(1.35); color: var(--gold); border-color: var(--gold); box-shadow: 0 0 18px rgba(242,181,58,0.6); }
  100% { opacity: 0; transform: translate(-50%, -110%) scale(0.7); }
}
.tl__dots { position: absolute; inset: 0; }
.tl__dot {
  position: absolute; top: 1px; width: 6px; height: 6px; margin-left: -3px; border-radius: 50%;
  background: #c5cbe0; opacity: 0.75; animation: dot-in 0.3s ease-out;
}
.tl__dot--gold { background: #fff; box-shadow: 0 0 6px #fff; opacity: 1; }
@keyframes dot-in { from { transform: scale(0); } }

.tl__marker {
  position: absolute; top: calc(var(--rail-top) - 30px); left: 0; width: 2px; height: 42px; margin-left: -1px;
  background: linear-gradient(180deg, transparent, var(--gold)); pointer-events: none; z-index: 2;
}
.tl__marker span {
  position: absolute; left: 50%; bottom: -3px; width: 16px; height: 16px; margin-left: -8px;
  background: var(--gold); border: 3px solid var(--bg); border-radius: 50%;
  box-shadow: 0 0 0 2px var(--gold), 0 0 18px 4px rgba(242,181,58,0.7);
  animation: marker-pulse 1.4s ease-in-out infinite;
}
@keyframes marker-pulse { 50% { box-shadow: 0 0 0 2px var(--gold), 0 0 28px 8px rgba(242,181,58,0.45); } }
.tl.is-summary .tl__marker span { animation: none; }

.tl__years { position: absolute; left: 0; right: 0; top: calc(var(--rail-top) + 14px); height: 20px; }
.tl__ylab {
  position: absolute; top: 2px; transform: translateX(-50%); white-space: nowrap;
  font: 600 12px/1 var(--display); letter-spacing: 0.1em; color: var(--muted);
}
.tl__ylab--first { transform: none; }
.tl__track.is-tight .tl__ylab--first { visibility: hidden; }
.tl__tick { position: absolute; top: -18px; width: 1px; height: 16px; background: #3a4566; }
.tl__tick--term { width: 2px; background: var(--purple); box-shadow: 0 0 8px var(--purple); }
@keyframes sweep { from { left: -40%; } to { left: 100%; } }

/* The 2028 start banner (about 1s, then play). */
.tl-start {
  display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-radius: var(--radius);
  background: color-mix(in srgb, var(--green) 10%, var(--surface)); border: 1px solid color-mix(in srgb, var(--green) 45%, transparent);
  box-shadow: 0 0 24px rgba(62,207,122,0.18);
}
.tl-start.is-in { animation: card-in 0.35s ease-out both; }
.tl-start__icon { font-size: 30px; line-height: 1; }
.tl-start__k { font: 700 20px/1.1 var(--display); letter-spacing: 0.08em; text-transform: uppercase; color: var(--green); }
.tl-start__ev { margin-top: 4px; font-size: 14px; color: var(--muted); }
.tl-start__ev b { color: var(--text); font: 700 18px/1 var(--display); font-variant-numeric: tabular-nums; }

/* ---- Pins ---- */
.pin {
  --cc: var(--gold);
  position: absolute; bottom: calc(10px + var(--lane, 0) * var(--lane-step));
  width: var(--pin); height: var(--pin); margin-left: calc(var(--pin) / -2);
  display: grid; place-items: center; padding: 0; border-radius: 10px; cursor: default;
  background: color-mix(in srgb, var(--cc) 22%, var(--surface));
  border: 2px solid var(--cc); color: var(--text);
  box-shadow: 0 0 14px color-mix(in srgb, var(--cc) 55%, transparent);
  animation: pin-pop 0.5s cubic-bezier(0.2, 1.6, 0.4, 1) both;
  transition: bottom 0.4s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.pin:disabled { opacity: 1; }
.pin::after { /* stem down to the rail */
  content: ""; position: absolute; left: 50%; top: 100%; width: 2px; margin-left: -1px;
  height: calc(10px + var(--lane, 0) * var(--lane-step)); background: color-mix(in srgb, var(--cc) 60%, transparent);
}
.pin__icon { font-size: calc(var(--pin) * 0.48); line-height: 1; }
.pin--election { --cc: #e9ecf5; border-radius: 50%; }
.pin.is-pending { animation: pin-pop 0.5s cubic-bezier(0.2, 1.6, 0.4, 1) both, pin-ring 1s ease-in-out 0.5s infinite alternate; }
@keyframes pin-pop { 0% { transform: translateY(12px) scale(0); } 70% { transform: scale(1.22); } 100% { transform: none; } }
@keyframes pin-ring { to { box-shadow: 0 0 0 4px color-mix(in srgb, var(--cc) 40%, transparent), 0 0 24px var(--cc); } }
.pin.is-fail { background: var(--surface); filter: saturate(0.35); border-style: dashed; }
.pin.is-fail::before {
  content: "✕"; position: absolute; top: -7px; right: -7px; width: 16px; height: 16px; border-radius: 50%;
  display: grid; place-items: center; font: 800 9px/1 var(--body); background: var(--red); color: #fff;
  box-shadow: 0 0 0 2px var(--bg);
}
.pin.is-success::before {
  content: "✓"; position: absolute; top: -7px; right: -7px; width: 16px; height: 16px; border-radius: 50%;
  display: grid; place-items: center; font: 800 10px/1 var(--body); background: var(--green); color: #07210f;
  box-shadow: 0 0 0 2px var(--bg);
}
.tl.is-summary .pin:not(:disabled) { cursor: pointer; }
.tl.is-summary .pin:not(:disabled):hover { transform: translateY(-3px); box-shadow: 0 0 22px var(--cc); }
.pin.is-active { transform: translateY(-3px) scale(1.1); box-shadow: 0 0 0 3px var(--text), 0 0 24px var(--cc); z-index: 3; }

/* ---- Controls ---- */
.tl__controls { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; padding: 6px 20px 16px; }
.tl__controls[hidden] { display: none; }
.tl-speed { display: inline-flex; border: 1px solid var(--border); border-radius: 999px; padding: 2px; background: var(--bg); }
.tl-btn {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 16px; border-radius: 999px; cursor: pointer;
  font: 600 13px/1 var(--display); letter-spacing: 0.12em; text-transform: uppercase;
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}
.tl-btn:hover { border-color: var(--gold); color: var(--gold); }
.tl-speed .tl-btn { min-height: 34px; padding: 0 12px; border-color: transparent; background: transparent; }
.tl-speed .tl-btn[aria-pressed="true"] { background: var(--gold); color: #1d1405; }
.tl-btn--play { min-width: 112px; justify-content: center; border-color: rgba(242,181,58,0.6); }
.tl-ico { position: relative; width: 12px; height: 12px; }
.tl-ico::before, .tl-ico::after { content: ""; position: absolute; top: 0; bottom: 0; width: 4px; background: currentColor; border-radius: 1px; }
.tl-ico::before { left: 1px; }
.tl-ico::after { right: 1px; }
.tl-btn--play.is-paused .tl-ico::before { left: 1px; width: 0; height: 0; background: none; border-style: solid; border-width: 6px 0 6px 11px; border-color: transparent transparent transparent currentColor; border-radius: 0; }
.tl-btn--play.is-paused .tl-ico::after { display: none; }
.tl-btn--play.is-paused { background: color-mix(in srgb, var(--gold) 18%, var(--surface)); }
.tl-switch { position: relative; width: 28px; height: 16px; border-radius: 999px; background: var(--border); transition: background 0.2s ease; }
.tl-switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; border-radius: 50%; background: var(--muted); transition: transform 0.2s ease, background 0.2s ease; }
.tl-btn--auto[aria-pressed="true"] .tl-switch { background: color-mix(in srgb, var(--green) 45%, var(--border)); }
.tl-btn--auto[aria-pressed="true"] .tl-switch::after { transform: translateX(12px); background: var(--green); }
.tl__hint { text-align: center; font-size: 13.5px; color: var(--gold); padding: 4px 20px 14px; font-weight: 600; }

/* ---- Stage + feed ---- */
.tl__body { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 18px; padding: 0 20px 22px; align-items: start; }
.tl__feed-wrap .sub-label { margin-top: 0; }
.stage-idle {
  min-height: 200px; display: grid; place-content: center; text-align: center; gap: 6px; padding: 20px;
  border: 1.5px dashed var(--border); border-radius: 14px; background: rgba(10,14,26,0.4);
}
.stage-idle__big { font: 700 24px/1.1 var(--display); letter-spacing: 0.06em; text-transform: uppercase; color: var(--gold); }

.ev-card {
  --cc: var(--gold);
  position: relative; border: 1.5px solid var(--cc); border-radius: 14px; padding: 18px;
  background: linear-gradient(170deg, color-mix(in srgb, var(--cc) 16%, var(--surface)), var(--bg) 75%);
  box-shadow: 0 0 0 1px rgba(0,0,0,0.3), 0 14px 40px rgba(0,0,0,0.35), 0 0 30px color-mix(in srgb, var(--cc) 25%, transparent);
}
.ev-card.is-in { animation: card-in 0.45s cubic-bezier(0.2, 1.1, 0.3, 1) both; }
@keyframes card-in { from { opacity: 0; transform: translateY(18px) scale(0.97); } }
.ev-card__top { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: center; }
.ev-card__icon {
  display: grid; place-items: center; width: 56px; height: 56px; border-radius: 14px; font-size: 28px;
  background: color-mix(in srgb, var(--cc) 20%, var(--bg)); border: 1px solid color-mix(in srgb, var(--cc) 60%, transparent);
  box-shadow: 0 0 20px color-mix(in srgb, var(--cc) 35%, transparent);
}
.ev-card__meta { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; font: 600 11px/1 var(--display); letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.cat-chip { color: var(--bg); background: var(--cc); padding: 4px 7px; border-radius: 4px; }
.ev-card__title { font: 700 clamp(22px, 3vw, 28px)/1.05 var(--display); text-transform: uppercase; letter-spacing: 0.02em; margin-top: 7px; }
.ev-card__title:focus { outline: none; }

.ev-intro { margin-top: 12px; font-size: 14px; color: #c5cbe0; font-style: italic; }
.evs { display: grid; gap: 8px; margin-top: 16px; }
.evs li { display: grid; grid-template-columns: minmax(96px, 36%) 1fr 2.4ch; gap: 10px; align-items: center; font-size: 13px; }
.evs__label { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.evs__label small { color: var(--muted); font-weight: 500; }
.evs__bar { position: relative; height: 8px; border-radius: 4px; background: var(--border); }
.evs__fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 4px; background: var(--cc); box-shadow: 0 0 8px color-mix(in srgb, var(--cc) 60%, transparent); }
.evs__diff { position: absolute; top: -4px; bottom: -4px; width: 2px; margin-left: -1px; background: var(--text); box-shadow: 0 0 0 1px var(--bg); }
.evs__val { font: 700 16px/1 var(--display); text-align: right; font-variant-numeric: tabular-nums; }
.ev-vs { margin-top: 10px; font-size: 13px; color: #c5cbe0; }
.ev-vs b { font: 700 16px/1 var(--display); color: var(--text); }
.ev-vs__diff { box-shadow: inset 0 -2px 0 var(--text); }

.roll { margin-top: 14px; padding: 14px 14px 12px; border-radius: 12px; background: rgba(10,14,26,0.6); border: 1px solid color-mix(in srgb, var(--gold) 28%, var(--border)); }
.roll__top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.roll__chance { font-size: 15px; font-weight: 600; color: #d6dbeb; }
.roll__chance b { font: 700 40px/1 var(--display); color: var(--text); margin-right: 4px; font-variant-numeric: tabular-nums; }
.roll__state { font: 600 12px/1 var(--display); letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); visibility: hidden; }
.ev-card.is-rolling .roll__state, .ev-card.is-resolved .roll__state { visibility: visible; }
.ev-card.is-rolling .roll__state { color: var(--gold); animation: blink 0.5s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0.4; } }
.roll__meter { position: relative; height: 22px; margin-top: 12px; border-radius: 11px; background: linear-gradient(90deg, rgba(226,67,59,0.35), rgba(226,67,59,0.55)); }
.roll__win { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 11px 0 0 11px; background: linear-gradient(90deg, rgba(62,207,122,0.45), rgba(62,207,122,0.8)); box-shadow: 2px 0 0 var(--bg); }
.roll__needle {
  position: absolute; top: -7px; left: 50%; width: 5px; height: 36px; margin-left: -2.5px; border-radius: 3px;
  background: #fff; box-shadow: 0 0 10px #fff, 0 0 0 1px var(--bg); opacity: 0;
}
.ev-card.is-rolling .roll__needle, .ev-card.is-resolved .roll__needle { opacity: 1; }
.ev-card.is-success .roll__needle { box-shadow: 0 0 12px var(--green), 0 0 0 1px var(--bg); }
.ev-card.is-fail .roll__needle { box-shadow: 0 0 12px var(--red), 0 0 0 1px var(--bg); }
.roll__legend { display: flex; justify-content: space-between; margin-top: 8px; font: 600 11.5px/1 var(--display); letter-spacing: 0.14em; text-transform: uppercase; }
.roll__legend span:first-child { color: var(--green); }
.roll__legend span:last-child { color: var(--red); }

.ev-result { margin-top: 14px; visibility: hidden; }
.ev-card.is-resolved .ev-result { visibility: visible; }
.stamp {
  display: inline-block; padding: 6px 16px 5px; border: 3px solid currentColor; border-radius: 8px;
  font: 700 30px/1 var(--display); letter-spacing: 0.2em; text-transform: uppercase; transform: rotate(-6deg);
  text-shadow: 0 0 18px currentColor; box-shadow: 0 0 22px color-mix(in srgb, currentColor 35%, transparent), inset 0 0 12px color-mix(in srgb, currentColor 25%, transparent);
  background: rgba(10,14,26,0.6);
}
.stamp--ok { color: var(--green); }
.stamp--fail { color: var(--red); }
.ev-card.is-resolved:not(.is-quiet) .stamp { animation: stamp 0.5s cubic-bezier(0.2, 1.5, 0.4, 1) both; }
@keyframes stamp { 0% { opacity: 0; transform: scale(2.8) rotate(-18deg); } 55% { opacity: 1; transform: scale(0.9) rotate(-5deg); } 100% { transform: scale(1) rotate(-6deg); } }
.ev-card.is-success:not(.is-quiet) { animation: win-flash 0.9s ease-out both; }
.ev-card.is-fail:not(.is-quiet) { animation: fail-shake 0.5s ease 0.18s both; }
@keyframes win-flash { 25% { box-shadow: 0 0 0 3px var(--green), 0 0 60px rgba(62,207,122,0.7); } }
@keyframes fail-shake { 20% { transform: translateX(-7px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(2px); } }
.ev-text { margin-top: 12px; font-size: 15px; line-height: 1.5; }
.ev-sub { margin-top: 8px; font-size: 13.5px; color: #c5cbe0; }
.ev-out { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; align-items: center; }
.ev-delta { font: 700 14px/1 var(--display); letter-spacing: 0.08em; text-transform: uppercase; padding: 7px 10px; border-radius: 999px; border: 1px solid var(--border); color: var(--muted); }
.ev-delta.up { color: var(--green); border-color: rgba(62,207,122,0.5); background: rgba(62,207,122,0.1); }
.ev-delta.down { color: var(--red); border-color: rgba(226,67,59,0.5); background: rgba(226,67,59,0.1); }
.ev-badge {
  position: relative; overflow: hidden; display: inline-flex; align-items: center; gap: 6px;
  font: 700 14px/1 var(--display); letter-spacing: 0.1em; text-transform: uppercase; padding: 7px 12px; border-radius: 999px;
  color: #1d1405; background: linear-gradient(180deg, #ffd978, var(--gold) 60%, #d99a1e);
  box-shadow: 0 0 18px rgba(242,181,58,0.55);
}
.ev-badge--term { color: var(--text); background: color-mix(in srgb, var(--purple) 35%, var(--surface)); box-shadow: 0 0 16px rgba(169,112,255,0.5); }
.ev-card.is-resolved:not(.is-quiet) .ev-badge { animation: badge-pop 0.6s cubic-bezier(0.2, 1.7, 0.4, 1) 0.35s both; }
.ev-card.is-resolved:not(.is-quiet) .ev-badge::after {
  content: ""; position: absolute; top: 0; bottom: 0; width: 40%; left: -60%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,0.85), transparent);
  animation: shine 0.9s ease-out 0.8s both;
}
@keyframes badge-pop { 0% { opacity: 0; transform: scale(0) rotate(-12deg); } 100% { opacity: 1; transform: none; } }
@keyframes shine { to { left: 130%; } }
.ev-card__actions { display: flex; justify-content: flex-end; margin-top: 16px; }
.ev-go { position: relative; overflow: hidden; min-width: 170px; }
.ev-go.is-counting::after {
  content: ""; position: absolute; left: 0; bottom: 0; height: 4px; width: 100%; background: rgba(29,20,5,0.55);
  transform-origin: left; animation: countdown var(--auto-ms, 2000ms) linear both;
}
@keyframes countdown { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* Election card: live tally */
.elx { margin-top: 16px; }
.elx__nums { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 12px; align-items: end; }
.elx__nums p { display: grid; gap: 4px; min-width: 0; }
.elx__nums b { font: 700 46px/1 var(--display); font-variant-numeric: tabular-nums; }
.elx__us { color: var(--pc); text-shadow: 0 0 18px color-mix(in srgb, var(--pc) 50%, transparent); }
.elx__them { color: var(--oc); text-shadow: 0 0 18px color-mix(in srgb, var(--oc) 40%, transparent); }
.elx__nums span { font-size: 12px; color: #c5cbe0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.elx__r { text-align: right; }
.elx__mid { text-align: center; font: 700 18px/1 var(--display); color: var(--text); }
.elx__mid small { display: block; font: 600 10px/1.4 var(--display); letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.elx__bar { position: relative; display: flex; justify-content: space-between; height: 16px; margin-top: 10px; border-radius: 8px; background: var(--border); overflow: hidden; }
.elx__usbar { display: block; height: 100%; width: 0; background: var(--pc); box-shadow: 0 0 12px var(--pc); transition: width 0.18s ease-out; }
.elx__thembar { display: block; height: 100%; width: 0; background: var(--oc); box-shadow: 0 0 12px var(--oc); transition: width 0.18s ease-out; }
.elx__bar i { position: absolute; left: 50.19%; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--text); box-shadow: 0 0 6px #fff; }
.elx__status { margin-top: 8px; min-height: 1.5em; font-size: 13px; color: #c5cbe0; text-align: center; }
.ev-card.is-counting .elx__status { color: var(--text); }
.elx__tctc {
  display: inline-block; margin-right: 6px; padding: 3px 7px; border-radius: 4px; background: var(--gold); color: #1d1405;
  font: 700 11px/1 var(--display); letter-spacing: 0.14em; text-transform: uppercase; animation: blink 0.6s steps(2) infinite;
}
.elx__tctc::before { content: "\2696\FE0E  "; } /* scales glyph: "undecided", distinct from the red lost/DEFEATED beat */
.elx__map { display: grid; grid-template-columns: repeat(auto-fill, minmax(38px, 1fr)); gap: 4px; margin-top: 12px; }
.st {
  display: grid; place-items: center; padding: 4px 0 3px; border-radius: 6px; border: 1px solid var(--border);
  font: 700 11px/1 var(--display); letter-spacing: 0.06em; color: var(--muted); background: rgba(10,14,26,0.5);
  transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}
.st small { font: 500 9px/1.3 var(--body); opacity: 0.8; }
.st.is-us { background: var(--pc); border-color: var(--pc); color: #fff; animation: st-pop 0.35s ease-out; }
.st.is-them { background: color-mix(in srgb, var(--oc) 75%, var(--bg)); border-color: var(--oc); color: #fff; animation: st-pop 0.35s ease-out; }
.st.is-close {
  border-color: var(--gold); border-style: dashed; color: var(--gold); --cc: var(--gold);
  background: repeating-linear-gradient(135deg, rgba(242,181,58,0.22) 0 4px, rgba(10,14,26,0.6) 4px 8px);
  animation: pin-ring 0.6s ease-in-out infinite alternate;
}
@keyframes st-pop { 0% { transform: scale(1.35); box-shadow: 0 0 14px #fff; } 100% { transform: none; } }
.ev-card.is-quiet .st { animation: none; }

/* Feed */
.tl__feed { max-height: 420px; overflow-y: auto; border: 1px solid var(--border); border-radius: 12px; background: rgba(10,14,26,0.4); }
.tl__feed:empty::before { content: "Headlines will appear here as the years pass."; display: block; padding: 16px; color: var(--muted); font-size: 13.5px; }
.tf { display: grid; grid-template-columns: 50px 1fr auto; gap: 8px; padding: 9px 12px; font-size: 13.5px; line-height: 1.45; border-left: 3px solid #3a4566; }
.tf + .tf { border-top: 1px solid var(--border); }
.tf.is-new { animation: tf-in 0.4s ease-out both; }
@keyframes tf-in { from { opacity: 0; transform: translateY(-8px); background: rgba(242,181,58,0.12); } }
.tf__d { font: 700 12px/1.6 var(--display); letter-spacing: 0.06em; color: var(--gold); white-space: nowrap; }
.tf__i { margin-right: 6px; }
.tf__delta { font: 700 13px/1.5 var(--display); font-variant-numeric: tabular-nums; }
.tf--critical, .tf--election { border-left-color: var(--cc); background: color-mix(in srgb, var(--cc) 7%, transparent); }
.tf--inauguration, .tf--end { border-left-color: #fff; }
.tf__res { font: 700 11px/1 var(--display); letter-spacing: 0.14em; text-transform: uppercase; padding: 3px 6px; border-radius: 4px; margin-right: 4px; vertical-align: 1px; }
.tf.is-success .tf__res { background: var(--green); color: #07210f; }
.tf.is-fail .tf__res { background: var(--red); color: #fff; }
.tf__badge { display: inline-block; font: 700 11px/1 var(--display); letter-spacing: 0.1em; text-transform: uppercase; color: var(--gold); white-space: nowrap; }

/* Achievements shelf (result) */
.result > .shelf { margin-left: 20px; margin-right: 20px; }
.shelf { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.medal {
  display: grid; justify-items: center; gap: 6px; text-align: center; padding: 14px 10px 12px; border-radius: 12px;
  border: 1.5px solid var(--cc); background: linear-gradient(180deg, color-mix(in srgb, var(--cc) 16%, var(--surface)), var(--bg));
  box-shadow: 0 0 18px color-mix(in srgb, var(--cc) 30%, transparent);
  animation: badge-pop 0.55s cubic-bezier(0.2, 1.6, 0.4, 1) calc(var(--i, 0) * 0.08s) both;
}
.medal__icon {
  display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; font-size: 24px;
  background: radial-gradient(circle at 40% 35%, color-mix(in srgb, var(--cc) 45%, #fff 5%), color-mix(in srgb, var(--cc) 25%, var(--bg)));
  border: 2px solid var(--cc);
}
.medal__badge { font: 700 15px/1.15 var(--display); letter-spacing: 0.08em; text-transform: uppercase; }
.medal__meta { font-size: 11.5px; color: var(--muted); }
.medal--fail { filter: grayscale(1); opacity: 0.5; border-style: dashed; box-shadow: none; animation: none; }
.medal--fail .medal__badge { text-decoration: line-through; text-decoration-thickness: 2px; }
.shelf__empty { grid-column: 1 / -1; color: var(--muted); font-size: 14px; }
/* Earned vs. attempted: a labelled rule between the two groups */
.shelf__sep {
  grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; margin: 8px 0 0;
  font: 600 11px/1 var(--display); letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted);
}
.shelf__sep::before, .shelf__sep::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.shelf__sep::before { flex: 0 0 18px; }

@media (max-width: 900px) {
  .tl__body { grid-template-columns: 1fr; gap: 24px; }
  .stage-idle { min-height: 0; padding: 18px 16px; border-color: color-mix(in srgb, var(--gold) 40%, var(--border)); background: color-mix(in srgb, var(--gold) 7%, var(--surface)); }
  .tl__feed-wrap .sub-label { color: var(--text); font-size: 13px; }
  .tl__feed-wrap .sub-label::after { height: 2px; background: linear-gradient(90deg, var(--gold), var(--border) 60%); }
  .tl__feed { max-height: 320px; }
}
@media (max-width: 600px) {
  :root { --rail-top: 92px; --pin: 28px; --lane-step: 27px; }
  .tl__head { padding: 18px 14px 14px; }
  .tl__live { width: 100%; justify-content: space-between; gap: 10px; }
  .tl__stat { min-width: 0; }
  .tl__stat-num { font-size: 20px; }
  .tl__track-wrap { padding: 6px 18px 2px; }
  .tl__ylab { font-size: 11px; letter-spacing: 0.04em; }
  .tl__controls { padding: 4px 12px 14px; gap: 6px; }
  .tl-btn { padding: 0 12px; min-height: 40px; }
  .tl-speed .tl-btn { padding: 0 10px; }
  .tl-btn--play { min-width: 96px; }
  .tl__body { padding: 0 12px 16px; }
  .ev-card { padding: 14px; }
  .ev-card__icon { width: 46px; height: 46px; font-size: 23px; border-radius: 12px; }
  .evs li { grid-template-columns: minmax(84px, 38%) 1fr 2.4ch; gap: 8px; font-size: 12.5px; }
  .stamp { font-size: 26px; }
  .elx__nums b { font-size: 34px; }
  .elx__mid { font-size: 15px; }
  .elx__map { grid-template-columns: repeat(auto-fill, minmax(34px, 1fr)); gap: 3px; }
  .st { font-size: 10px; }
  .ev-go { width: 100%; }
  .result > .shelf { margin-left: 12px; margin-right: 12px; }
  .shelf { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tf { grid-template-columns: 46px 1fr auto; padding: 8px 10px; font-size: 13px; }
}
@media (max-width: 400px) {
  .tl__controls .tl-btn--skip { flex: 1 1 100%; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; animation-delay: 0s !important; transition-duration: 0.001ms !important; transition-delay: 0s !important; }
  .slot.is-open { box-shadow: 0 0 0 2px rgba(242, 181, 58, 0.3), 0 0 16px rgba(242, 181, 58, 0.45); }
  .rg[data-state="open"] .rg__tint { opacity: 0.6; }
}
