/* The Werewolf Benchmark — "Dusk dashboard".
   Deep ink-blue night ground, cream/moonlight text, ember (wolf) + moonlight (village)
   poles. All color is OKLCH with tinted neutrals; no pure black/white. */

:root {
  /* Surfaces — tinted toward the night hue (255). */
  --ground: oklch(0.17 0.035 255);
  --surface: oklch(0.21 0.035 255);
  --surface-2: oklch(0.25 0.035 255);
  --line: oklch(0.32 0.03 255);
  --line-soft: oklch(0.28 0.03 255);

  /* Text — warm cream so it reads as moonlight, not blue. */
  --ink: oklch(0.94 0.012 85);
  --ink-soft: oklch(0.80 0.015 85);
  --ink-mute: oklch(0.64 0.02 90);

  /* Poles + highlight. */
  --wolf: oklch(0.68 0.17 47);
  --wolf-strong: oklch(0.62 0.19 40);
  --village: oklch(0.82 0.11 205);
  --village-strong: oklch(0.74 0.12 210);
  --gilt: oklch(0.85 0.11 90);
  --focus: oklch(0.80 0.12 205);

  --shadow: oklch(0.10 0.03 255 / 0.45);
  --wolf-wash: oklch(0.68 0.17 47 / 0.18);
  --village-wash: oklch(0.82 0.11 205 / 0.16);

  --font-display: ui-serif, "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --font-ui: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, monospace;

  --step-0: 0.75rem;
  --step-1: 0.875rem;
  --step-2: 1rem;
  --step-3: 1.25rem;
  --step-4: 1.5rem;
  --step-5: 2rem;
  --step-6: 2.75rem;

  --space-1: 0.35rem;
  --space-2: 0.6rem;
  --space-3: 1rem;
  --space-4: 1.5rem;
  --space-5: 2.5rem;

  --radius: 14px;
  --radius-sm: 8px;
  --maxw: 1140px;
}

* { box-sizing: border-box; }

/* `hidden` must win over class-level `display` (e.g. .layout's grid) so the
   router can fully swap the dashboard and the replay views. */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; overflow-x: clip; }

body {
  margin: 0;
  background:
    radial-gradient(120% 80% at 80% -10%, oklch(0.24 0.05 270) 0%, transparent 55%),
    radial-gradient(90% 70% at -10% 0%, oklch(0.2 0.045 255) 0%, transparent 50%),
    var(--ground);
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: var(--step-2);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2 { font-family: var(--font-display); font-weight: 600; line-height: 1.1; margin: 0; }

a { color: var(--village); }

code { font-family: var(--font-mono); font-size: 0.9em; }

.skip-link {
  position: absolute;
  left: var(--space-3);
  top: -3rem;
  background: var(--surface-2);
  color: var(--ink);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  z-index: 10;
  transition: top 120ms ease-out;
}
.skip-link:focus { top: var(--space-3); }

/* --- Masthead ------------------------------------------------------------ */

.masthead {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: var(--space-5) var(--space-4) var(--space-4);
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-3);
  border-bottom: 1px solid var(--line);
}
.masthead__brand { display: flex; align-items: center; gap: var(--space-3); min-width: 0; }
.masthead__brand > div { min-width: 0; }
.masthead__mark {
  font-size: clamp(2rem, 4vw + 1rem, 2.75rem);
  line-height: 1;
  color: var(--gilt);
  text-shadow: 0 0 24px oklch(0.85 0.11 90 / 0.35);
  flex: none;
}
.masthead__title { font-size: clamp(1.35rem, 4vw + 0.5rem, 2.75rem); letter-spacing: -0.01em; overflow-wrap: break-word; }
.masthead__tagline { margin: var(--space-1) 0 0; color: var(--ink-soft); font-size: var(--step-2); max-width: 46ch; }
.watch-cta {
  display: inline-flex; align-items: center; gap: 0.45rem;
  margin-top: var(--space-3);
  padding: var(--space-2) var(--space-3);
  background: var(--surface-2); color: var(--ink);
  border: 1px solid var(--gilt); border-radius: var(--radius-sm);
  text-decoration: none; font-size: var(--step-1); font-weight: 600;
  transition: background-color 120ms ease-out, transform 120ms ease-out;
}
.watch-cta:hover { background: oklch(0.85 0.11 90 / 0.14); transform: translateY(-1px); }
.watch-cta__glyph { color: var(--gilt); font-size: 0.85em; }
.dateline {
  margin: 0;
  font-family: var(--font-mono);
  font-size: var(--step-1);
  color: var(--ink-mute);
  letter-spacing: 0.02em;
}
.dateline b { color: var(--ink); font-weight: 600; }
.dateline__link { color: inherit; text-decoration: none; border-bottom: 1px dotted var(--line); }
.dateline__link:hover { color: var(--gilt); border-bottom-color: var(--gilt); }
.dateline__link:hover b { color: var(--gilt); }

/* --- Layout / panels ----------------------------------------------------- */

.layout {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: var(--space-4);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}
.panel {
  background: linear-gradient(180deg, var(--surface) 0%, oklch(0.19 0.035 255) 100%);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: var(--space-4);
  box-shadow: 0 12px 30px -22px var(--shadow);
  min-width: 0;
}
.panel--wide, .panel--scatter { grid-column: 1 / -1; }
.panel__head { margin-bottom: var(--space-3); }
.panel__title {
  font-size: var(--step-4);
  text-transform: none;
}
.panel__title::before {
  content: "";
  display: inline-block;
  width: 0.6rem; height: 0.6rem;
  margin-right: var(--space-2);
  border-radius: 2px;
  background: var(--gilt);
  vertical-align: middle;
}
.panel__note { margin: var(--space-1) 0 0; color: var(--ink-mute); font-size: var(--step-1); max-width: 70ch; }

.banner {
  grid-column: 1 / -1;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: var(--space-3);
  margin-bottom: var(--space-3);
}
.banner--error { border-color: var(--wolf); color: var(--ink); }

.section-label {
  font-family: var(--font-ui);
  font-size: var(--step-0);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-mute);
}

/* --- Tables -------------------------------------------------------------- */

table { width: 100%; border-collapse: collapse; }
caption { text-align: left; color: var(--ink-mute); font-size: var(--step-1); padding-bottom: var(--space-2); }
th, td { text-align: left; padding: var(--space-2) var(--space-2); }
thead th {
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: var(--step-0);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-mute);
  border-bottom: 1px solid var(--line);
}
.num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; text-align: right; }

/* Leaderboard */
.lb tbody tr { border-bottom: 1px solid var(--line-soft); transition: background-color 120ms ease-out; }
.lb tbody tr:hover { background: var(--surface-2); }
.lb__rank { font-family: var(--font-display); font-size: var(--step-4); color: var(--ink-mute); width: 2.4rem; }
.lb tbody tr:first-child .lb__rank { color: var(--gilt); }
.model { display: inline-flex; align-items: baseline; gap: 0.15rem; font-family: var(--font-mono); }
.model__provider { color: var(--ink-mute); }
.model__name { color: var(--ink); font-weight: 600; }

.lb__skill { width: 46%; }
.skillcell { display: flex; align-items: center; gap: 0.7rem; }
.skillcell svg { flex: 1; min-width: 0; }
.skillcell__val { flex: none; width: 2.8rem; text-align: right; font-family: var(--font-mono); font-variant-numeric: tabular-nums; color: var(--ink); }
.lb tbody tr:first-child .skillcell__val { color: var(--gilt); }

.lb__wolf { color: var(--wolf); }
.lb__village { color: var(--village); }
thead th.lb__wolf, thead th.lb__village { font-weight: 600; }

/* Shared-scale skill dot plot: dot = conservative skill, line reaches optimistic mu */
.skillplot { position: relative; flex: 1; min-width: 4rem; height: 16px; }
.skillplot__track { position: absolute; inset: 50% 0 auto 0; height: 3px; transform: translateY(-50%); background: var(--surface-2); border-radius: 2px; }
.skillplot__range { position: absolute; top: 50%; height: 3px; transform: translateY(-50%); background: var(--village); opacity: 0.5; border-radius: 2px; }
.skillplot__dot { position: absolute; top: 50%; width: 9px; height: 9px; margin-left: -4.5px; transform: translateY(-50%); border-radius: 50%; background: var(--ink-soft); box-shadow: 0 0 0 2px var(--surface); }
.skillplot--top .skillplot__dot { background: var(--gilt); }
.bar-anim { transform-box: fill-box; transform-origin: left center; animation: grow 560ms cubic-bezier(0.22, 1, 0.36, 1) both; }

/* Head-to-head matrix */
.h2h th, .h2h td { text-align: center; border: 1px solid var(--line-soft); }
.h2h thead th, .h2h tbody th { font-family: var(--font-mono); font-size: var(--step-0); color: var(--ink-soft); text-transform: none; letter-spacing: 0; }
.h2h tbody th[scope="row"] { text-align: right; position: sticky; left: 0; background: var(--surface); white-space: nowrap; }
.h2h td { font-family: var(--font-mono); font-variant-numeric: tabular-nums; min-width: 3.6rem; }
.h2h__row-leads { background: var(--wolf-wash); color: var(--ink); }
.h2h__col-leads { background: var(--village-wash); color: var(--ink); }
.h2h__even { color: var(--ink-soft); }
.h2h__none { color: var(--ink-mute); }
.h2h__diag { color: var(--ink-mute); background: oklch(0.2 0.03 255); }
.h2h__diag a { color: var(--ink-mute); text-decoration: none; }
.h2h__diag a:hover { color: var(--village); }

/* Cost summary strip — a wrap-safe grid of stat boxes (no overlap on narrow widths) */
.cost-totals {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr));
  gap: var(--space-3) var(--space-4);
  margin: 0 0 var(--space-4);
}
.stat { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }
.stat dt { font-size: var(--step-0); text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-mute); }
.stat dd { margin: 0; font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: var(--step-3); color: var(--ink); white-space: nowrap; }

/* Self-play — two aligned metric rows per model, no nested card chrome */
.selfplay { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: var(--space-4); }
.sp-card { min-width: 0; }
.sp-card__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.3rem var(--space-3); margin-bottom: var(--space-3); }
.sp-card__rounds { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: var(--step-1); color: var(--ink-mute); white-space: nowrap; }
.sp-metrics { display: grid; gap: var(--space-2); }
.sp-metric { display: grid; grid-template-columns: 5.25rem 1fr 2.75rem; align-items: center; gap: var(--space-2); }
.sp-metric__label { font-size: var(--step-0); text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-mute); }
.sp-metric__val { font-family: var(--font-mono); font-variant-numeric: tabular-nums; text-align: right; color: var(--ink); }
.sp-track { height: 10px; background: var(--surface-2); border-radius: 5px; overflow: hidden; }
.sp-fill { height: 100%; border-radius: 5px; transform-box: border-box; transform-origin: left center; }
.sp-fill--wolf { background: var(--wolf); }
.sp-fill--village { background: var(--village); }

/* --- Scatter ------------------------------------------------------------- */

.scatter-wrap { display: grid; grid-template-columns: 1fr; gap: var(--space-4); }
.scatter { width: 100%; max-width: 520px; margin: 0 auto; aspect-ratio: 1 / 1; display: block; }
.sc-axis { stroke: var(--line); stroke-width: 0.4; }
.sc-mid { stroke: var(--line); stroke-width: 0.3; stroke-dasharray: 1.5 1.5; }
.sc-mean { stroke: var(--gilt); stroke-width: 0.4; stroke-dasharray: 2 1.5; opacity: 0.7; }
.sc-diag { stroke: var(--line-soft); stroke-width: 0.3; stroke-dasharray: 1 2; }
.sc-leader { stroke: var(--ink-mute); stroke-width: 0.4; opacity: 0.5; }
.sc-anchor { fill: var(--ink-mute); opacity: 0.6; }
.sc-quad { fill: var(--ink-mute); font-size: 2.5px; font-family: var(--font-ui); letter-spacing: 0.02em; }
.sc-axislabel { fill: var(--ink-soft); font-size: 2.9px; font-family: var(--font-ui); }
.sc-tick { fill: var(--ink-mute); font-size: 2.4px; font-family: var(--font-mono); }
.sc-point { fill: var(--gilt); stroke: var(--ground); stroke-width: 0.6; }
.sc-num { fill: var(--ground); font-size: 3px; font-weight: 700; font-family: var(--font-mono); }
.sc-dot-anim { transform-box: fill-box; transform-origin: center; animation: pop 420ms cubic-bezier(0.22, 1, 0.36, 1) both; }

.sc-legend { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: var(--space-2) var(--space-4); }
.sc-legend__item { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: var(--space-2); align-items: baseline; }
.sc-legend__num {
  grid-row: 1 / span 2;
  align-self: center;
  display: inline-flex; align-items: center; justify-content: center;
  width: 1.4rem; height: 1.4rem;
  background: var(--gilt); color: var(--ground);
  border-radius: 50%;
  font-family: var(--font-mono); font-weight: 700; font-size: var(--step-0);
}
.sc-legend__name { min-width: 0; }
.sc-legend__stat { font-size: var(--step-1); color: var(--ink-mute); }
.sc-legend__stat b { color: var(--ink-soft); font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* --- About & support panel ---------------------------------------------- */

.support {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: var(--space-4) var(--space-5);
}
.support__col { min-width: 0; display: grid; gap: var(--space-2); align-content: start; }
.support__goals { margin: 0; padding-left: 1.1rem; display: grid; gap: var(--space-1); color: var(--ink-soft); font-size: var(--step-1); }
.support__goals li::marker { color: var(--gilt); }
.support__lead { margin: 0; color: var(--ink-mute); font-size: var(--step-1); }
.support__actions { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-1); }
.cta {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: var(--space-2) var(--space-3);
  background: var(--surface-2); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  text-decoration: none; font-size: var(--step-1); font-weight: 600;
  transition: border-color 120ms ease-out, transform 120ms ease-out;
}
.cta:hover { border-color: var(--gilt); transform: translateY(-1px); }
.cta--coffee { color: var(--ground); background: var(--gilt); border-color: var(--gilt); }
.cta--coffee:hover { filter: brightness(1.05); }

/* --- Footer -------------------------------------------------------------- */

.footer {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: var(--space-4);
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2) var(--space-4);
}
.footer__links { display: flex; flex-wrap: wrap; gap: var(--space-3); }
.footer__links a { color: var(--ink-soft); text-decoration: none; font-size: var(--step-1); }
.footer__links a:hover { color: var(--village); }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%);
  white-space: nowrap; border: 0;
}

:where(a, button, [tabindex]):focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: 3px;
}

@keyframes grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes pop { from { transform: scale(0); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* --- Responsive ---------------------------------------------------------- */

@media (max-width: 880px) {
  .layout { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .masthead { padding: var(--space-4) var(--space-3) var(--space-3); }
  .layout { padding: var(--space-3); gap: var(--space-3); }
  .panel { padding: var(--space-3); }
  /* Drop the inline skill plot on narrow screens; the numeric skill stays. */
  .skillcell .skillplot { display: none; }
  .skillcell__val { width: auto; }
}

.mount { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.mount--scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-delay: 0ms !important;
    transition-duration: 0.001ms !important;
  }
}

/* --- Faction sides & badges (shared by games list + replay) -------------- */

.side { display: inline-flex; align-items: center; gap: var(--space-1); min-width: 0; }
.side__pip { flex: none; }
.side--wolf .side__pip {
  width: 0; height: 0;
  border-left: 5px solid transparent; border-right: 5px solid transparent;
  border-bottom: 9px solid var(--wolf);
}
.side--village .side__pip {
  width: 9px; height: 9px; border-radius: 50%;
  border: 2px solid var(--village); box-sizing: border-box;
}
.badge {
  flex: none;
  font-family: var(--font-ui); font-size: var(--step-0); font-weight: 600;
  letter-spacing: 0.04em;
  padding: 0.15rem 0.5rem; border-radius: 999px; white-space: nowrap;
}
.badge--wolf { color: var(--wolf); background: var(--wolf-wash); }
.badge--village { color: var(--village); background: var(--village-wash); }

/* --- Games library ------------------------------------------------------- */

.games { display: grid; gap: var(--space-3); }
.games__filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--space-2) var(--space-3); }
.games__field { display: grid; gap: 0.25rem; }
.games__label { font-size: var(--step-0); text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-mute); }
.games__select {
  font-family: var(--font-ui); font-size: var(--step-1);
  padding: var(--space-2) var(--space-3);
  background: var(--surface-2); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--radius-sm); cursor: pointer;
}
.games__count { margin-left: auto; align-self: center; font-family: var(--font-mono); font-size: var(--step-1); color: var(--ink-mute); }
.games__list { display: grid; gap: var(--space-1); max-height: 30rem; overflow-y: auto; padding-right: var(--space-1); }
.game-row {
  display: grid; grid-template-columns: 1fr auto auto auto; align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  background: var(--surface-2); border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm); color: var(--ink); text-decoration: none;
  transition: border-color 120ms ease-out, transform 120ms ease-out;
}
.game-row:hover { border-color: var(--gilt); background: var(--surface); transform: translateX(2px); }
.game-row__matchup { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-2); min-width: 0; }
.game-row__vs { color: var(--ink-mute); font-size: var(--step-0); }
.game-row__rounds { font-family: var(--font-mono); font-size: var(--step-0); color: var(--ink-mute); white-space: nowrap; }
.game-row__watch {
  display: inline-flex; align-items: center; gap: 0.35rem; flex: none;
  font-size: var(--step-0); font-weight: 600; letter-spacing: 0.04em;
  color: var(--ink-mute); transition: color 120ms ease-out;
}
.game-row__play { color: var(--gilt); font-size: 0.85em; }
.game-row:hover .game-row__watch { color: var(--gilt); }
.game-row--current { border-color: var(--gilt); background: var(--surface); }
.game-row--current:hover { transform: none; }
.game-row__watch--current .game-row__watchlbl { color: var(--gilt); }

/* --- Replay screen ------------------------------------------------------- */

.replay { max-width: var(--maxw); margin: 0 auto; padding: var(--space-4); }
.rp-loading { color: var(--ink-mute); padding: var(--space-5); text-align: center; }
.rp-loading a { display: inline-block; margin-top: var(--space-2); }

.rp-topbar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: var(--space-3);
  padding-bottom: var(--space-3); margin-bottom: var(--space-4);
  border-bottom: 1px solid var(--line);
}
.rp-back { color: var(--ink-soft); text-decoration: none; font-size: var(--step-1); white-space: nowrap; }
.rp-back:hover { color: var(--village); }
.rp-matchup { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; min-width: 0; }
.rp-matchup__vs { color: var(--ink-mute); font-size: var(--step-0); }
.rp-topbar__right { display: flex; align-items: center; gap: var(--space-3); }
.rp-phase { display: inline-flex; align-items: baseline; gap: 0.4rem; font-family: var(--font-display); font-size: var(--step-3); color: var(--ink); }
.rp-phase__glyph { color: var(--gilt); }

/* In-replay game browser: same filters + list as the dashboard Replays panel,
   collapsed by default so you can switch games without going back. */
.rp-browse {
  margin-bottom: var(--space-4);
  border: 1px solid var(--line-soft); border-radius: var(--radius);
  background: linear-gradient(180deg, var(--surface) 0%, oklch(0.19 0.035 255) 100%);
  overflow: hidden;
}
.rp-browse__summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: center; gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  color: var(--ink-soft); font-size: var(--step-1); font-weight: 600;
}
.rp-browse__summary::-webkit-details-marker { display: none; }
.rp-browse__summary:hover { color: var(--ink); }
.rp-browse__hint { margin-left: auto; color: var(--ink-mute); transition: transform 160ms ease-out; }
.rp-browse[open] .rp-browse__hint { transform: rotate(180deg); }
.rp-browse[open] .rp-browse__summary { border-bottom: 1px solid var(--line-soft); }
.rp-browse .games { padding: var(--space-3); }

.rp-stage { display: grid; grid-template-columns: minmax(280px, 1.05fr) minmax(0, 0.95fr); gap: var(--space-4); align-items: start; }

/* The round table */
.rp-tablewrap { min-width: 0; }
.rp-table {
  position: relative; width: 100%; max-width: 520px; margin: 0 auto;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 42%, oklch(0.24 0.05 270 / 0.45) 0%, transparent 62%);
  transition: background 600ms ease-out;
}
.rp-table--day { background: radial-gradient(circle at 50% 42%, oklch(0.5 0.09 90 / 0.16) 0%, transparent 62%); }
.rp-arrows { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.rp-seats { position: absolute; inset: 0; }
.rp-hearth {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 30%; aspect-ratio: 1 / 1; border-radius: 50%;
  display: grid; place-items: center;
  border: 1px solid var(--line-soft);
  background: radial-gradient(circle, var(--surface) 0%, oklch(0.18 0.035 255) 100%);
  box-shadow: inset 0 0 18px -6px var(--shadow);
}
.rp-hearth__glyph { font-size: clamp(1.2rem, 6vw, 2rem); color: var(--gilt); opacity: 0.55; }
.rp-table--day .rp-hearth__glyph { color: oklch(0.85 0.13 80); }

.seat {
  position: absolute; transform: translate(-50%, -50%);
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: var(--space-1) var(--space-2);
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--radius-sm); color: var(--ink); cursor: pointer;
  font-family: var(--font-ui); min-width: 4.4rem;
  transition: border-color 120ms ease-out, box-shadow 120ms ease-out, transform 120ms ease-out;
}
.seat:hover { border-color: var(--ink-mute); }
.seat__name { font-size: var(--step-1); font-weight: 600; }
.seat__role {
  font-size: 0.6rem; text-transform: uppercase; letter-spacing: 0.06em;
  padding: 0.05rem 0.35rem; border-radius: 999px;
}
.role--wolf { color: var(--wolf); background: var(--wolf-wash); }
.role--village { color: var(--village); background: var(--village-wash); }
.seat--active { border-color: var(--gilt); box-shadow: 0 0 0 1px var(--gilt), 0 0 16px -4px var(--gilt); }
.seat--target { border-color: var(--wolf-strong); box-shadow: 0 0 14px -4px var(--wolf); }
.seat--selected { outline: 2px solid var(--focus); outline-offset: 2px; }
.seat--dead { opacity: 0.4; filter: grayscale(0.7); }
.seat--dead .seat__name { text-decoration: line-through; }

.rp-arrow {
  stroke-width: 0.9; fill: none;
  stroke-dasharray: 1; stroke-dashoffset: 1;
  animation: rp-draw 420ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.rp-arrow--seer { stroke: var(--village); }
.rp-arrow--doctor { stroke: var(--village-strong); }
.rp-arrow--accuse { stroke: var(--wolf); }
.rp-arrow--defend { stroke: var(--ink-mute); }
.rp-arrow--kill { stroke: var(--wolf-strong); stroke-width: 1.1; }
.rp-arrow--vote { stroke: var(--gilt); stroke-width: 0.7; opacity: 0.85; }
.rp-head--seer path { fill: var(--village); }
.rp-head--doctor path { fill: var(--village-strong); }
.rp-head--accuse path { fill: var(--wolf); }
.rp-head--defend path { fill: var(--ink-mute); }
.rp-head--kill path { fill: var(--wolf-strong); }
.rp-head--vote path { fill: var(--gilt); }
@keyframes rp-draw { to { stroke-dashoffset: 0; } }

/* Reasoning ticker: surfaces the acting agent's thought during playback */
.rp-feedcol { display: grid; grid-template-rows: auto 1fr; gap: var(--space-2); min-width: 0; }
.rp-now {
  display: flex; align-items: baseline; gap: var(--space-3); width: 100%; min-width: 0; max-width: 100%; text-align: left;
  padding: var(--space-2) var(--space-3);
  background: var(--surface-2); border: 1px solid var(--line-soft); border-radius: var(--radius-sm);
  color: var(--ink-soft); font-family: var(--font-ui); cursor: default;
}
.rp-now--has { cursor: pointer; }
.rp-now--has:hover { border-color: var(--ink-mute); }
.rp-now__phase { flex: none; display: inline-flex; align-items: baseline; gap: 0.35rem; font-family: var(--font-display); color: var(--ink); }
.rp-now__glyph { color: var(--gilt); }
.rp-now__who { flex: 1 1 auto; min-width: 0; display: flex; align-items: baseline; gap: var(--space-2); overflow: hidden; }
.rp-now__name { flex: none; font-weight: 600; background: transparent; padding: 0; }
.rp-now__thought { flex: 1 1 auto; min-width: 0; color: var(--ink-mute); font-style: italic; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rp-now__who--idle { color: var(--ink-mute); font-style: italic; }
.role--wolf.rp-now__name { color: var(--wolf); }
.role--village.rp-now__name { color: var(--village); }

/* The dialogue feed */
.rp-feed {
  display: flex; flex-direction: column; gap: var(--space-2); min-width: 0;
  max-height: min(64vh, 520px); overflow-y: auto;
  padding: var(--space-3);
  background: linear-gradient(180deg, var(--surface) 0%, oklch(0.19 0.035 255) 100%);
  border: 1px solid var(--line-soft); border-radius: var(--radius);
}
.feed-item { font-size: var(--step-1); }
.feed-item.is-current { position: relative; }
.feed-item--say .say__msg {
  margin: 0; padding: var(--space-2) var(--space-3);
  background: var(--surface-2); border-radius: var(--radius-sm);
  border: 1px solid transparent;
}
.feed-item--wolf .say__msg { background: var(--wolf-wash); }
.feed-item--village .say__msg { background: var(--village-wash); }
.feed-item--pack .say__msg { background: var(--wolf-wash); border-color: oklch(0.68 0.17 47 / 0.4); }
.say__head { display: flex; align-items: baseline; gap: var(--space-2); margin-bottom: 0.2rem; }
.say__name { font-weight: 600; }
.feed-item--wolf .say__name { color: var(--wolf); }
.feed-item--village .say__name { color: var(--village); }
.say__tag { font-size: var(--step-0); text-transform: uppercase; letter-spacing: 0.08em; color: var(--wolf); }
.say__msg { color: var(--ink); line-height: 1.45; }

.feed-item--act .act__line { margin: 0; color: var(--ink); }
.feed-item--act .act__line b { font-weight: 600; }
.feed-item--accuse .act__line b:first-child { color: var(--wolf); }
.act__reason { margin: 0.2rem 0 0; color: var(--ink-mute); font-size: var(--step-0); line-height: 1.45; }

.feed-item--secret {
  display: flex; flex-direction: column; gap: 0.1rem;
  padding: var(--space-2) var(--space-3);
  border: 1px dashed var(--line); border-radius: var(--radius-sm);
  background: oklch(0.2 0.03 255 / 0.5);
}
.secret__head { font-family: var(--font-mono); font-size: var(--step-0); color: var(--ink-mute); text-transform: uppercase; letter-spacing: 0.05em; }
.feed-item--seer .secret__detail { color: var(--village); font-weight: 600; }
.feed-item--doctor .secret__head { color: var(--village-strong); }

.feed-item--stage { text-align: center; padding: var(--space-1) 0; }
.stage__text { font-family: var(--font-display); color: var(--ink-soft); font-size: var(--step-2); }
.feed-item--kill .stage__text { color: var(--wolf); }
.feed-item--exile .stage__text { color: var(--village); }
.feed-item--order .stage__text { font-family: var(--font-mono); font-size: var(--step-0); color: var(--ink-mute); text-transform: uppercase; letter-spacing: 0.06em; }
.feed-item--over .stage__text { font-size: var(--step-4); color: var(--gilt); }

.is-current .say__msg,
.is-current.feed-item--secret { box-shadow: 0 0 0 1px var(--gilt); }
.is-current.feed-item--stage .stage__text { text-shadow: 0 0 18px oklch(0.85 0.11 90 / 0.4); }

/* Transport */
.rp-transport { margin-top: var(--space-4); display: grid; gap: var(--space-3); }
.rp-controls { display: flex; align-items: center; gap: var(--space-2); }
.rp-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 2.3rem; height: 2.3rem; padding: 0 var(--space-2);
  background: var(--surface-2); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--radius-sm); cursor: pointer;
  font-size: var(--step-1); transition: border-color 120ms ease-out, background 120ms ease-out;
}
.rp-btn:hover { border-color: var(--ink-mute); }
.rp-btn--play { min-width: 3rem; color: var(--gilt); font-size: var(--step-3); }
.rp-btn--play.is-playing { color: var(--ink); }
.rp-counter { margin-left: auto; font-family: var(--font-mono); font-variant-numeric: tabular-nums; color: var(--ink-mute); font-size: var(--step-1); }
.rp-scrub { display: grid; gap: var(--space-1); }
.rp-segs { display: flex; gap: 2px; }
.rp-seg {
  flex: 1 1 0; min-width: 0;
  display: inline-flex; align-items: center; justify-content: center; gap: 0.3rem;
  padding: var(--space-1) var(--space-2);
  background: var(--surface-2); border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm); color: var(--ink-mute); cursor: pointer;
  font-size: var(--step-0); white-space: nowrap; overflow: hidden;
  transition: color 120ms ease-out, border-color 120ms ease-out;
}
.rp-seg__glyph { flex: none; }
.rp-seg__label { overflow: hidden; text-overflow: ellipsis; }
.rp-seg--active { color: var(--ink); border-color: var(--gilt); background: var(--surface); }
.rp-seg:hover { color: var(--ink-soft); }
.rp-range { width: 100%; accent-color: var(--gilt); cursor: pointer; }
.rp-btn--speed { min-width: 2.8rem; font-family: var(--font-mono); font-size: var(--step-0); font-variant-numeric: tabular-nums; }
.rp-progress { height: 2px; border-radius: 2px; background: var(--line-soft); overflow: hidden; opacity: 0; transition: opacity 160ms ease-out; }
.rp-progress.is-running { opacity: 1; }
.rp-progress__bar { height: 100%; width: 0%; background: var(--gilt); }

/* Feed scene dividers */
.feed-divider {
  display: flex; align-items: center; gap: var(--space-2);
  margin: var(--space-2) 0 0; color: var(--ink-mute);
  font-family: var(--font-display); font-size: var(--step-1);
}
.feed-divider::after { content: ""; flex: 1; height: 1px; background: var(--line-soft); }
.feed-divider__glyph { color: var(--gilt); }
.feed-divider--night .feed-divider__glyph { color: var(--village); }
.feed-divider--day .feed-divider__glyph { color: var(--gilt); }

/* Vote / bid tally panels */
.feed-item--panel { padding: var(--space-2) var(--space-3); background: var(--surface-2); border: 1px solid var(--line-soft); border-radius: var(--radius-sm); }
.feed-item--vote { background: var(--village-wash); border-color: oklch(0.82 0.11 205 / 0.35); }
.panel-row__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--space-1) var(--space-3); margin-bottom: var(--space-2); }
.panel-row__title { font-family: var(--font-ui); font-size: var(--step-0); text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-mute); }
.panel-row__out { font-family: var(--font-mono); font-size: var(--step-0); color: var(--ink-soft); }
.vote__rows { display: grid; gap: 0.3rem; }
.vote-row { display: grid; grid-template-columns: 4.5rem 1fr auto; align-items: center; column-gap: var(--space-2); font-size: var(--step-1); }
.vote-row__who { font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vote-row__bar { height: 8px; background: var(--surface); border-radius: 4px; overflow: hidden; }
.vote-row__fill { display: block; height: 100%; background: var(--ink-mute); border-radius: 4px; transform-box: border-box; transform-origin: left center; }
.vote-row__fill--win { background: var(--village); }
.feed-item--bids .vote-row__fill--win { background: var(--gilt); }
.feed-item--pack .vote-row__fill, .feed-item--pack .vote-row__fill--win { background: var(--wolf); }
.vote-row__count { font-family: var(--font-mono); font-variant-numeric: tabular-nums; color: var(--ink); }
.vote-row__voters { grid-column: 2 / -1; font-size: var(--step-0); color: var(--ink-mute); }
.vote-row__tag { font-size: var(--step-0); text-transform: uppercase; letter-spacing: 0.06em; color: var(--gilt); }
.vote-row--out .vote-row__who { color: var(--village); }
.feed-item--pack .vote-row--out .vote-row__who { color: var(--wolf); }
.vote-row--abstain .vote-row__who { color: var(--ink-mute); font-weight: 400; }

/* Each newly-revealed line eases in (current item only) */
.feed-item.is-current { animation: feed-enter 280ms cubic-bezier(0.22, 1, 0.36, 1) both; }
@keyframes feed-enter { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* Player drawer */
.rp-drawer {
  position: fixed; top: 0; right: 0; height: 100vh; width: min(420px, 92vw); z-index: 20;
  padding: var(--space-4); overflow-y: auto;
  background: linear-gradient(180deg, var(--surface-2) 0%, var(--surface) 100%);
  border-left: 1px solid var(--line);
  box-shadow: -20px 0 40px -28px var(--shadow);
  transform: translateX(100%); transition: transform 240ms cubic-bezier(0.22, 1, 0.36, 1);
}
.rp-drawer--open { transform: translateX(0); }
.drawer__head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-3); padding-bottom: var(--space-3); margin-bottom: var(--space-3); border-bottom: 1px solid var(--line); }
.drawer__id { display: flex; flex-direction: column; gap: 0.3rem; min-width: 0; }
.drawer__id .role { align-self: flex-start; font-size: 0.6rem; text-transform: uppercase; letter-spacing: 0.06em; padding: 0.05rem 0.4rem; border-radius: 999px; }
.drawer__name { font-family: var(--font-display); font-size: var(--step-4); color: var(--ink); }
.drawer__model { font-size: var(--step-0); }
.drawer__close { flex: none; background: none; border: none; color: var(--ink-mute); font-size: var(--step-4); line-height: 1; cursor: pointer; padding: 0 var(--space-1); }
.drawer__close:hover { color: var(--ink); }
.drawer__section { margin-top: var(--space-4); }
.drawer__h { font-family: var(--font-ui); font-size: var(--step-0); font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-mute); margin: 0 0 var(--space-2); }
.drawer__empty { color: var(--ink-mute); font-size: var(--step-1); }

.react-step { padding: var(--space-2); margin-bottom: var(--space-2); background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--radius-sm); }
.react-step__thought { margin: 0 0 0.3rem; color: var(--ink-soft); font-style: italic; font-size: var(--step-1); line-height: 1.45; }
.react-step__act { margin: 0; font-family: var(--font-mono); font-size: var(--step-0); }
.react-step__tool { color: var(--gilt); font-weight: 600; }
.react-step__args { color: var(--ink-mute); }
.react-step__obs { margin: 0.3rem 0 0; color: var(--ink-mute); font-family: var(--font-mono); font-size: var(--step-0); line-height: 1.4; }
.telemetry { margin: var(--space-2) 0 0; font-family: var(--font-mono); font-size: var(--step-0); color: var(--ink-mute); }
.telemetry b { color: var(--ink-soft); }

.plan { margin: 0 0 var(--space-2); color: var(--ink-soft); font-size: var(--step-1); line-height: 1.5; }
.beliefs { display: grid; gap: var(--space-2); }
.belief { display: grid; grid-template-columns: 1fr auto auto; align-items: baseline; column-gap: var(--space-2); padding: var(--space-2); background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--radius-sm); }
.belief__subj { font-weight: 600; color: var(--ink); }
.belief__guess { font-family: var(--font-mono); font-size: var(--step-0); }
.belief__guess--wolf { color: var(--wolf); }
.belief__guess--village { color: var(--village); }
.conf { font-size: 0.6rem; text-transform: uppercase; letter-spacing: 0.06em; }
.conf--low { color: var(--ink-mute); }
.conf--medium { color: var(--ink-soft); }
.conf--high { color: var(--gilt); }
.belief__evidence { grid-column: 1 / -1; margin: 0.3rem 0 0; color: var(--ink-mute); font-size: var(--step-0); line-height: 1.45; }
.notes { margin: 0; padding: 0; list-style: none; display: grid; gap: var(--space-2); }
.note { color: var(--ink-soft); font-size: var(--step-1); line-height: 1.45; }
.note__round { font-family: var(--font-mono); font-size: var(--step-0); color: var(--ink-mute); margin-right: var(--space-2); }

@media (max-width: 880px) {
  .rp-stage { grid-template-columns: 1fr; }
  .rp-table { max-width: 440px; }
  .rp-feed { max-height: 50vh; }
}
@media (max-width: 560px) {
  .replay { padding: var(--space-3); }
  .rp-seg__label { display: none; }
  .seat { min-width: 3.6rem; padding: 2px var(--space-1); }
  .seat__name { font-size: var(--step-0); }
  .rp-drawer { width: 100vw; }
}
