/* Taskmaster Points — shared styles
   Printed scoreboard: black stock, one red stamp, typewriter type throughout. */

:root {
  --ink: #0b0b0b;
  --ink-2: #0f0f0f;
  --panel: #141414;
  --paper: #f2efe9;
  --paper-soft: #cdc9c0;
  --muted: #9a9a9a;
  --muted-dim: #7d7d7d;
  --red: #c8102e;
  --red-hot: #d21f2b;
  --red-deep: #7d0a1d;
  --red-text: #ff6b72;
  --red-wash: rgba(200, 16, 46, 0.1);
  --brass: #c9a227;
  --brass-soft: #e6c877;
  --brass-dim: #8f7524;
  --cream: #f2e8d5;
  --cream-deep: #e7d8ba;
  --cream-ink: #1b1512;
  --line: #2a2a2a;
  --line-strong: rgba(255, 255, 255, 0.16);
  --focus: #ff6b72;
  --radius: 3px;
  --display: "Fraunces", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: "Instrument Sans", "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "Courier New", Courier, "Nimbus Mono PS", "Liberation Mono", monospace;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --shadow-panel: 0 30px 60px -46px #000, inset 0 1px 0 rgba(255, 255, 255, 0.04);
  --shadow-card: 0 2px 0 rgba(0, 0, 0, 0.35), 0 18px 44px -30px #000;
}

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

[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(900px 460px at 50% -12%, rgba(200, 16, 46, 0.12), transparent 62%),
    radial-gradient(820px 500px at 92% 108%, rgba(201, 162, 39, 0.07), transparent 62%),
    radial-gradient(760px 420px at 100% 0%, rgba(255, 255, 255, 0.035), transparent 64%),
    linear-gradient(180deg, #0b0b0b 0%, #090909 100%);
  color: var(--paper);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  letter-spacing: 0.005em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* halftone print grain */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 900;
  pointer-events: none;
  opacity: 0.5;
  background-image: radial-gradient(rgba(255, 255, 255, 0.05) 0.5px, transparent 0.6px);
  background-size: 4px 4px;
}

img,
svg {
  max-width: 100%;
}

h1,
h2,
h3,
h4,
p,
ul,
ol,
figure {
  margin-top: 0;
}

a {
  color: var(--red-text);
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

a:hover {
  color: var(--paper);
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

::selection {
  background: var(--red);
  color: #fff;
}

.skip-link {
  position: absolute;
  top: -60px;
  left: 16px;
  z-index: 1000;
  padding: 10px 16px;
  background: var(--red);
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  border-radius: var(--radius);
  transition: top 0.15s var(--ease);
}

.skip-link:focus {
  top: 12px;
  color: #fff;
}

.wrap {
  width: 100%;
  max-width: 1220px;
  margin-inline: auto;
  padding-inline: clamp(16px, 4vw, 40px);
}

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

.hint {
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.55;
  margin: 0;
}

.muted {
  color: var(--muted);
}

/* ---------- header ---------- */

.site-head {
  position: relative;
  border-bottom: 1px solid var(--line);
}

.site-head::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  width: clamp(56px, 12vw, 140px);
  height: 2px;
  background: var(--red);
}

.site-head__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-block: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--paper);
  text-decoration: none;
  min-width: 0;
}

.brand:hover {
  color: var(--paper);
}

.brand__seal {
  flex: none;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 3px;
  border: 1px solid var(--red);
  background: linear-gradient(160deg, #1c0c10, #120405);
  box-shadow: inset 0 0 0 3px var(--ink), inset 0 0 0 4px rgba(200, 16, 46, 0.35);
  font-family: var(--mono);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--red-text);
}

.brand__word {
  display: block;
  font-family: var(--mono);
  font-size: 1.02rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.28em;
  text-transform: uppercase;
}

.brand__sub {
  display: block;
  margin-top: 6px;
  font-size: 0.56rem;
  font-weight: 700;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--red-text);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 2px;
  color: var(--paper-soft);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  transition: border-color 0.18s var(--ease), color 0.18s var(--ease), background 0.18s var(--ease);
}

.nav-link:hover {
  border-color: var(--red);
  background: var(--red-wash);
  color: var(--paper);
}

.nav-link__arrow {
  color: var(--red-text);
}

/* ---------- hero ---------- */

.hero {
  padding-block: clamp(26px, 5vw, 56px) clamp(10px, 2vw, 20px);
}

.hero__frame {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(16px, 3vw, 40px);
  padding: clamp(26px, 4.6vw, 58px);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(200, 16, 46, 0.09), transparent 42%),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.018) 0 1px, transparent 1px 34px),
    linear-gradient(158deg, #171717 0%, #111 62%, #0d0d0d 100%);
  box-shadow: var(--shadow-panel);
}

.hero__frame::before {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 2px;
  pointer-events: none;
}

.hero__frame::after {
  content: "";
  position: absolute;
  top: 0;
  left: clamp(26px, 4.6vw, 58px);
  width: 64px;
  height: 3px;
  background: var(--red);
}

.hero__content {
  position: relative;
  min-width: 0;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--red-text);
}

.eyebrow::before {
  content: "";
  width: 24px;
  height: 1px;
  flex: none;
  background: linear-gradient(90deg, var(--red), rgba(200, 16, 46, 0));
}

.hero h1 {
  margin-bottom: 16px;
  font-family: var(--mono);
  font-weight: 700;
  font-size: clamp(2.3rem, 5.8vw, 4.15rem);
  line-height: 1;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.hero h1 em {
  font-style: italic;
  color: var(--red-text);
  text-shadow: 0 0 34px rgba(200, 16, 46, 0.45);
}

.lede {
  max-width: 54ch;
  margin-bottom: 0;
  color: var(--paper-soft);
  font-size: clamp(0.88rem, 1.3vw, 0.98rem);
  line-height: 1.7;
}

.hero__seal {
  width: clamp(120px, 16vw, 176px);
  color: var(--red);
  opacity: 0.9;
  filter: drop-shadow(0 18px 32px rgba(0, 0, 0, 0.55));
}

.hero__seal svg {
  display: block;
}

.seal-ring {
  animation: seal-spin 120s linear infinite;
  transform-origin: 80px 80px;
}

.stat-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin: 28px 0 0;
  padding: 18px 0 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.stat {
  min-width: 0;
  padding-inline: clamp(12px, 2.4vw, 22px);
  border-left: 1px solid var(--line);
}

.stat:first-child {
  padding-left: 0;
  border-left: 0;
}

.stat__value {
  display: block;
  font-family: var(--mono);
  font-weight: 700;
  font-size: clamp(1.15rem, 2vw, 1.55rem);
  line-height: 1.1;
  letter-spacing: -0.01em;
  font-variant-numeric: lining-nums tabular-nums;
  white-space: nowrap;
  color: var(--paper);
}

.stat__label {
  display: block;
  margin-top: 5px;
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- sections ---------- */

.section {
  margin-top: clamp(32px, 5vw, 54px);
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px 28px;
  margin-bottom: 14px;
}

.section-head .eyebrow {
  margin-bottom: 8px;
}

.section-head h2,
.panel-head h2 {
  margin: 0;
  font-family: var(--mono);
  font-weight: 700;
  font-size: clamp(1.3rem, 2.2vw, 1.7rem);
  line-height: 1.15;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.section-note {
  max-width: 46ch;
  margin: 0;
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.6;
}

.panel {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.024), rgba(255, 255, 255, 0) 44%),
    var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-panel);
}

.panel--flush {
  overflow: hidden;
}

.board-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(22px, 3vw, 34px);
  margin-top: clamp(30px, 5vw, 50px);
}

.board-col {
  display: grid;
  gap: clamp(22px, 3vw, 34px);
  align-content: start;
  min-width: 0;
}

.board-grid > *,
.board-col > * {
  min-width: 0;
}

.board-grid > .section,
.board-col > .section {
  margin-top: 0;
  animation: rise 0.55s var(--ease) both;
}

.board-col > .section:nth-child(2) {
  animation-delay: 0.08s;
}

.section--episodes {
  animation: rise 0.55s var(--ease) both;
  animation-delay: 0.14s;
}

.section--teams {
  animation: rise 0.55s var(--ease) both;
  animation-delay: 0.08s;
}

/* ---------- leaderboard ---------- */

.leaderboard {
  padding: 4px clamp(15px, 3vw, 28px) 6px;
}

.board-caption {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0 8px;
  border-bottom: 1px solid var(--line-strong);
  font-size: 0.53rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}

.rank-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.rank-row {
  position: relative;
  display: grid;
  grid-template-columns: 2.6rem minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(10px, 2.2vw, 20px);
  padding: 15px 0 14px;
  border-bottom: 1px solid var(--line);
}

.rank-row:last-child {
  border-bottom: 0;
}

.rank-num {
  font-family: var(--mono);
  font-weight: 700;
  font-size: clamp(1.6rem, 3.2vw, 2.2rem);
  line-height: 1;
  letter-spacing: -0.03em;
  font-variant-numeric: lining-nums tabular-nums;
  color: #4a4a4a;
  -webkit-text-stroke: 1px rgba(255, 255, 255, 0.18);
}

.rank-row.is-winner {
  background: linear-gradient(90deg, rgba(200, 16, 46, 0.13), rgba(200, 16, 46, 0.02) 58%, transparent 82%);
  box-shadow: inset 3px 0 0 var(--red);
}

.rank-row.is-winner .rank-num {
  color: var(--red);
  -webkit-text-stroke: 1px rgba(255, 91, 102, 0.6);
  text-shadow: 0 0 26px rgba(200, 16, 46, 0.55);
}

.rank-body {
  min-width: 0;
}

.rank-name {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
  font-family: var(--mono);
  font-size: clamp(0.95rem, 1.6vw, 1.08rem);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0.01em;
  color: var(--paper);
  overflow-wrap: anywhere;
}

.avatar {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 50%;
  border: 1px solid var(--avatar-color, var(--line-strong));
  background: #171717;
  color: var(--avatar-color, var(--paper-soft));
  font-family: var(--mono);
  font-size: 0.56rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  line-height: 1;
  text-transform: uppercase;
  box-shadow: inset 0 0 0 2px var(--ink);
}

.avatar--team {
  border-radius: 3px;
  border-style: double;
  border-width: 3px;
  letter-spacing: 0;
}

.badge-leader {
  flex: none;
  padding: 3px 7px 2px;
  border-radius: 2px;
  background: var(--red);
  color: #fff;
  font-family: var(--mono);
  font-size: 0.5rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  line-height: 1.4;
}

.rank-bar {
  height: 4px;
  margin-top: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
}

.rank-bar__fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--red-deep), var(--red));
  opacity: 0.65;
  transition: width 0.8s var(--ease);
}

.rank-row.is-winner .rank-bar__fill {
  opacity: 1;
  box-shadow: 0 0 14px rgba(200, 16, 46, 0.5);
}

.rank-points {
  display: inline-grid;
  place-items: center;
  min-width: 3.4rem;
  padding: 6px 10px 5px;
  border: 1px solid #333;
  border-radius: 6px;
  background: #171717;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.45);
  font-family: var(--mono);
  font-weight: 700;
  font-size: clamp(1.2rem, 2.2vw, 1.5rem);
  line-height: 1.05;
  font-variant-numeric: lining-nums tabular-nums;
  text-align: center;
  white-space: nowrap;
  color: var(--paper);
}

.rank-points small {
  margin-top: 3px;
  font-family: var(--mono);
  font-size: 0.48rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--red-text);
}

.rank-row.is-winner .rank-points {
  border-color: var(--red-hot);
  background: var(--red);
  color: #fff;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.28), 0 0 22px -6px rgba(200, 16, 46, 0.75);
}

.rank-row.is-winner .rank-points small {
  color: rgba(255, 255, 255, 0.8);
}

.rank-row.is-negative .rank-points {
  color: var(--red-text);
  border-color: var(--red-deep);
}

.rank-row.is-negative .rank-points small {
  color: var(--red-text);
  opacity: 0.85;
}

.rank-note {
  display: block;
  margin-top: 3px;
  font-size: 0.68rem;
  color: var(--muted);
}

/* ---------- team standings ---------- */

.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1px;
  background: var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.team-card {
  position: relative;
  padding: 16px 16px 15px;
  background: var(--panel);
}

.team-card.is-winner {
  background:
    radial-gradient(120% 120% at 0% 0%, rgba(200, 16, 46, 0.16), transparent 65%),
    var(--panel);
  box-shadow: inset 0 3px 0 var(--red);
}

.team-card__top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.team-rank {
  font-family: var(--mono);
  font-size: 1.15rem;
  color: var(--muted-dim);
  font-variant-numeric: tabular-nums;
}

.team-card.is-winner .team-rank {
  color: var(--red-text);
}

.team-name {
  flex: 1;
  min-width: 0;
  font-family: var(--mono);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--paper);
  overflow-wrap: anywhere;
}

.team-points {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 1.1rem;
  font-variant-numeric: tabular-nums;
  color: var(--paper);
  white-space: nowrap;
}

.team-card.is-negative .team-points {
  color: var(--red-text);
}

.team-members {
  margin: 7px 0 12px;
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.team-card .rank-bar {
  margin-top: 0;
}

/* ---------- chart ---------- */

.chart-panel {
  padding: clamp(14px, 2.4vw, 22px);
}

.legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 100%;
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: transparent;
  color: var(--paper-soft);
  font: inherit;
  font-size: 0.69rem;
  line-height: 1.7;
  cursor: pointer;
  transition: border-color 0.16s var(--ease), color 0.16s var(--ease), opacity 0.16s var(--ease);
}

.legend-item:hover {
  border-color: var(--red);
  color: var(--paper);
}

.legend-item[aria-pressed="false"] {
  opacity: 0.4;
}

.legend-swatch {
  flex: none;
  width: 15px;
  height: 3px;
  border-radius: 2px;
}

.legend-name {
  max-width: 14ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.legend-total {
  color: var(--muted);
  font-size: 0.62rem;
  font-variant-numeric: tabular-nums;
}

.legend-reset {
  padding: 4px 6px;
  border: 0;
  background: transparent;
  color: var(--red-text);
  font: inherit;
  font-size: 0.66rem;
  letter-spacing: 0.04em;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.chart-wrap {
  position: relative;
  width: 100%;
  height: clamp(250px, 33vw, 356px);
  border-radius: 2px;
  touch-action: pan-y;
}

.chart-wrap svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.axis-text {
  fill: #8f8f8f;
  font-family: var(--mono);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.axis-text--title {
  fill: #b9b5ae;
  font-size: 9.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.grid-line {
  stroke: rgba(255, 255, 255, 0.08);
  stroke-width: 1;
}

.grid-line--zero {
  stroke: rgba(255, 255, 255, 0.24);
  stroke-dasharray: 3 4;
}

.series-line {
  transition: opacity 0.18s var(--ease);
}

.chart-wrap.is-highlighting .series-line {
  opacity: 0.14;
}

.chart-wrap.is-highlighting .series-line.is-highlighted {
  opacity: 1;
}

.hover-line {
  stroke: rgba(200, 16, 46, 0.6);
  stroke-width: 1;
  stroke-dasharray: 3 4;
}

.chart-tip {
  position: absolute;
  top: 8px;
  z-index: 3;
  min-width: 150px;
  max-width: min(268px, calc(100% - 16px));
  padding: 9px 11px;
  border: 1px solid rgba(200, 16, 46, 0.42);
  border-radius: 2px;
  background: #0c0c0c;
  box-shadow: 0 20px 44px -20px #000;
  transform: translateX(-50%);
  pointer-events: none;
}

.chart-tip__title {
  margin-bottom: 6px;
  overflow: hidden;
  color: var(--red-text);
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.chart-tip__list {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.chart-tip__list--dense {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 3px 12px;
}

.chart-tip__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
  min-width: 0;
  font-size: 0.68rem;
  line-height: 1.45;
}

.chart-tip__name {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  color: var(--paper-soft);
}

.chart-tip__name span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chart-tip__val {
  flex: none;
  color: var(--paper);
  font-variant-numeric: tabular-nums;
}

.chart-tip__val.is-neg {
  color: var(--red-text);
}

.chart-help {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1.55;
}

.chart-note {
  margin: 8px 0 0;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  color: var(--red-text);
  font-size: 0.7rem;
}

/* ---------- episode breakdown ---------- */

.episode-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px;
  padding: clamp(14px, 2.6vw, 22px);
  border-bottom: 1px solid var(--line);
}

.episode-bar .field {
  flex: 1 1 230px;
  max-width: 400px;
}

.episode-nav {
  display: flex;
  gap: 5px;
  flex: none;
}

.episode-meta {
  flex: 1 1 100%;
  margin: 0;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.55;
}

@media (min-width: 700px) {
  .episode-meta {
    flex: 0 1 auto;
    margin-left: auto;
    text-align: right;
  }
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  background: transparent;
  color: var(--paper);
  font: inherit;
  font-size: 0.95rem;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.16s var(--ease), background 0.16s var(--ease), color 0.16s var(--ease);
}

.icon-btn:hover:not(:disabled) {
  border-color: var(--red);
  background: var(--red-wash);
  color: var(--paper);
}

.icon-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.icon-btn--sm {
  width: 30px;
  height: 30px;
  font-size: 0.9rem;
}

.table-scroll {
  width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  -webkit-overflow-scrolling: touch;
}

.score-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  font-variant-numeric: lining-nums tabular-nums;
}

.score-table th,
.score-table td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
  text-align: center;
  vertical-align: middle;
}

.score-table thead th {
  border-bottom-color: var(--line-strong);
  color: var(--muted);
  font-size: 0.53rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.score-table thead th.task-col {
  letter-spacing: 0;
}

.score-table th[scope="row"] {
  position: sticky;
  left: 0;
  z-index: 1;
  width: 46%;
  max-width: 260px;
  padding-left: clamp(14px, 2.6vw, 24px);
  background: var(--panel);
  text-align: left;
  font-family: var(--mono);
  font-size: 0.86rem;
  font-weight: 700;
  white-space: nowrap;
}

.score-table tbody tr:hover th[scope="row"],
.score-table tbody tr:hover td {
  background: rgba(255, 255, 255, 0.03);
}

.score-table tbody tr:last-child th,
.score-table tbody tr:last-child td {
  border-bottom: 0;
}

.task-col {
  width: 54px;
  min-width: 46px;
}

.task-tag {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1px solid rgba(200, 16, 46, 0.5);
  border-radius: 2px;
  color: var(--red-text);
  font-size: 0.62rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.score-cell {
  color: var(--paper-soft);
}

.score-cell.is-missing {
  color: #8a8a8a;
}

.score-cell.is-neg {
  color: var(--red-text);
}

.row-total {
  color: var(--red-text) !important;
  font-weight: 700;
}

.row-total.is-neg {
  color: var(--red-text) !important;
  opacity: 0.85;
}

.subject-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.subject-cell .avatar {
  width: 1.6rem;
  height: 1.6rem;
  font-size: 0.5rem;
}

.subject-cell > span:not(.avatar):not(.tag-team) {
  overflow: hidden;
  text-overflow: ellipsis;
}

.tag-team {
  flex: none;
  padding: 1px 4px;
  border: 1px solid rgba(200, 16, 46, 0.5);
  border-radius: 2px;
  color: var(--red-text);
  font-family: var(--mono);
  font-size: 0.46rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.score-table .team-group th {
  position: static;
  padding-block: 8px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.53rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  text-align: left;
}

.task-key {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 22px;
  margin: 0;
  padding: 12px clamp(14px, 2.6vw, 24px) 15px;
  border-top: 1px solid var(--line);
  list-style: none;
}

.task-key li {
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1.55;
}

.task-key b {
  margin-right: 6px;
  color: var(--red-text);
  font-weight: 700;
}

.table-hint {
  display: none;
  padding: 0 clamp(14px, 2.6vw, 24px) 12px;
  color: var(--muted);
  font-size: 0.64rem;
}

@media (max-width: 640px) {
  .table-hint {
    display: block;
  }
}

/* ---------- inline empties, boot, errors ---------- */

.empty-inline {
  padding: clamp(22px, 4vw, 34px);
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.65;
  text-align: center;
}

.empty-inline strong {
  color: var(--paper-soft);
}

.empty-state {
  position: relative;
  padding: clamp(34px, 7vw, 74px) clamp(20px, 4vw, 48px);
  text-align: center;
  overflow: hidden;
}

.empty-state::before {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  pointer-events: none;
}

.empty-state__art {
  width: clamp(76px, 12vw, 108px);
  margin: 0 auto 18px;
  color: var(--red);
  opacity: 0.9;
}

.empty-state h2 {
  margin-bottom: 10px;
  font-family: var(--mono);
  font-weight: 700;
  font-size: clamp(1.4rem, 3.6vw, 2.1rem);
  line-height: 1.14;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.empty-state p {
  max-width: 52ch;
  margin-inline: auto;
  color: var(--paper-soft);
  font-size: 0.88rem;
  line-height: 1.7;
}

.steps {
  display: grid;
  gap: 10px;
  max-width: 430px;
  margin: 24px auto;
  padding: 0;
  list-style: none;
  text-align: left;
}

.steps li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  color: var(--paper-soft);
  font-size: 0.84rem;
  line-height: 1.6;
}

.steps .n {
  flex: none;
  width: 1.5em;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 1rem;
  color: var(--red-text);
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 22px;
}

.boot {
  display: grid;
  place-items: center;
  gap: 14px;
  padding: clamp(70px, 14vh, 140px) 20px;
  color: var(--muted);
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: center;
}

.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.16);
  border-top-color: var(--red);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.error-panel {
  border-color: rgba(200, 16, 46, 0.4);
}

.error-panel .empty-inline {
  color: var(--paper-soft);
}

/* ---------- footer ---------- */

.site-foot {
  margin-top: clamp(48px, 8vw, 88px);
  border-top: 1px solid var(--line);
  padding-block: 26px 40px;
  color: var(--muted);
  font-size: 0.68rem;
}

.site-foot__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 24px;
}

.site-foot p {
  margin: 0;
}

.site-foot__version {
  color: var(--muted);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.site-foot__version::before {
  content: "";
  display: inline-block;
  width: 5px;
  height: 5px;
  margin-right: 7px;
  background: var(--red);
  vertical-align: 1px;
}

.site-foot__version:empty {
  display: none;
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55em;
  min-height: 42px;
  padding: 0.66em 1.15em;
  border: 1px solid var(--red-deep);
  border-radius: 3px;
  background: linear-gradient(180deg, var(--red-hot), var(--red));
  color: #fff;
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 0.16s var(--ease), filter 0.16s var(--ease), box-shadow 0.16s var(--ease);
}

.btn:hover:not(:disabled) {
  filter: brightness(1.08);
  transform: translateY(-1px);
  box-shadow: 0 10px 24px -14px rgba(200, 16, 46, 0.9);
}

.btn:active:not(:disabled) {
  transform: none;
  background: var(--red-deep);
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn--block {
  width: 100%;
}

.btn--ghost {
  border-color: var(--line-strong);
  background: transparent;
  color: var(--paper);
}

.btn--ghost:hover:not(:disabled) {
  border-color: var(--red);
  background: var(--red-wash);
  color: var(--paper);
  box-shadow: none;
}

.btn--danger {
  border-color: rgba(200, 16, 46, 0.55);
  background: transparent;
  color: var(--red-text);
}

.btn--danger:hover:not(:disabled) {
  border-color: var(--red);
  background: var(--red-wash);
  color: var(--paper);
  box-shadow: none;
}

.btn--danger-solid {
  border-color: var(--red-hot);
  background: linear-gradient(180deg, var(--red-deep), #5c0615);
  color: #fff;
}

.btn--sm {
  min-height: 34px;
  padding: 0.42em 0.75em;
  font-size: 0.68rem;
}

.btn.is-busy {
  pointer-events: none;
}

.btn.is-busy::before {
  content: "";
  width: 12px;
  height: 12px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* ---------- forms ---------- */

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.field > label,
.subject-field legend {
  color: var(--muted);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.field--action {
  justify-content: flex-end;
}

input[type="text"],
input[type="password"],
input[type="number"],
input[type="date"],
select,
textarea {
  width: 100%;
  min-height: 42px;
  padding: 9px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  background: var(--ink-2);
  color: var(--paper);
  font-family: var(--mono);
  font-size: 0.86rem;
  line-height: 1.45;
  transition: border-color 0.16s var(--ease), background 0.16s var(--ease);
}

textarea {
  min-height: 132px;
  resize: vertical;
  font-family: var(--mono);
  font-size: 0.76rem;
  line-height: 1.6;
}

input:hover,
select:hover,
textarea:hover {
  border-color: rgba(255, 255, 255, 0.3);
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  border-color: var(--red);
  outline-offset: 1px;
}

select {
  appearance: none;
  padding-right: 34px;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--red) 50%),
    linear-gradient(135deg, var(--red) 50%, transparent 50%);
  background-repeat: no-repeat;
  background-position:
    calc(100% - 17px) calc(50% + 1px),
    calc(100% - 12px) calc(50% + 1px);
  background-size: 5px 5px, 5px 5px;
  cursor: pointer;
}

input[type="date"] {
  color-scheme: dark;
}

input::placeholder,
textarea::placeholder {
  color: #7f7f7f;
}

input[type="checkbox"],
input[type="radio"] {
  accent-color: var(--red);
  width: 16px;
  height: 16px;
  flex: none;
  cursor: pointer;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.form-grid--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.span-2 {
  grid-column: span 2;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
  margin-top: 14px;
}

.form-actions .hint {
  margin-left: auto;
}

.form-error {
  margin: 12px 0 0;
  padding: 9px 11px;
  border-left: 2px solid var(--red);
  background: var(--red-wash);
  color: #ffb4b9;
  font-size: 0.76rem;
  line-height: 1.55;
}

.form-error:empty {
  display: none;
}

.radio-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  min-height: 42px;
  align-items: center;
  padding: 8px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  background: var(--ink-2);
}

.radio {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--paper-soft);
  font-size: 0.8rem;
  cursor: pointer;
}

.subject-field {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.subject-field legend {
  padding: 0;
  margin-bottom: 6px;
}

.code-hint {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.3);
  color: var(--paper-soft);
  font-family: var(--mono);
  font-size: 0.7rem;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.hint-block {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.hint-block p {
  margin: 0;
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.65;
}

.hint-block code {
  padding: 1px 4px;
  border: 1px solid var(--line);
  border-radius: 2px;
  color: var(--red-text);
  font-family: var(--mono);
  font-size: 0.66rem;
}

/* ---------- admin ---------- */

.login-view {
  display: grid;
  place-items: center;
  min-height: min(72vh, 700px);
  padding-block: clamp(32px, 7vw, 72px);
}

.login-card {
  position: relative;
  width: 100%;
  max-width: 430px;
  padding: clamp(28px, 5vw, 44px);
}

.login-card::before {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 2px;
  pointer-events: none;
}

.login-seal {
  width: 64px;
  margin-bottom: 20px;
  color: var(--red);
}

.login-card h1 {
  margin-bottom: 8px;
  font-family: var(--mono);
  font-weight: 700;
  font-size: clamp(1.6rem, 3.4vw, 2.1rem);
  line-height: 1.1;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.login-card .lede {
  font-size: 0.84rem;
  color: var(--muted);
}

.login-form {
  display: grid;
  gap: 14px;
  margin-top: 24px;
}

.login-foot {
  margin: 20px 0 0;
  font-size: 0.72rem;
}

.console-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  padding-block: clamp(28px, 5vw, 48px) 0;
}

.console-head h1 {
  margin: 0 0 6px;
  font-family: var(--mono);
  font-weight: 700;
  font-size: clamp(1.7rem, 3.8vw, 2.5rem);
  line-height: 1.05;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.console-sub {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.console-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.console-banner {
  margin-top: 16px;
  padding: 10px 12px;
  border-left: 2px solid var(--red);
  background: var(--red-wash);
  color: #ffb4b9;
  font-size: 0.78rem;
}

.console-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(16px, 2.4vw, 24px);
  align-items: start;
  margin-top: clamp(20px, 3vw, 30px);
}

.panel--form {
  padding: clamp(18px, 3vw, 26px);
  min-width: 0;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  margin-bottom: 18px;
}

.panel-index {
  flex: none;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 1.9rem;
  line-height: 0.9;
  letter-spacing: -0.02em;
  color: transparent;
  -webkit-text-stroke: 1px rgba(200, 16, 46, 0.7);
}

.panel-head h2 {
  font-size: 1.12rem;
}

.panel-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.6;
}

.score-form {
  display: grid;
  gap: 14px;
}

.score-form > .field {
  max-width: 420px;
}

.episode-hint {
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.55;
}

.draft {
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.draft-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.draft-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.draft-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
  font-size: 0.78rem;
}

.draft-subject {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.draft-task {
  display: block;
  color: var(--muted);
  font-size: 0.66rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.draft-points {
  color: var(--red-text);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.draft-points.is-neg {
  color: var(--red-text);
  opacity: 0.85;
}

.row-remove {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 2px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}

.row-remove:hover {
  border-color: rgba(200, 16, 46, 0.5);
  background: var(--red-wash);
  color: var(--red-text);
}

.row-remove:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.row-remove.is-busy {
  pointer-events: none;
  opacity: 0.5;
}

.draft-empty {
  margin: 0;
  padding: 12px;
  border: 1px dashed var(--line-strong);
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.55;
}

.callout {
  margin: 14px 0 0;
  padding: 9px 12px;
  border-left: 2px solid rgba(200, 16, 46, 0.6);
  background: var(--red-wash);
  color: var(--paper-soft);
  font-size: 0.72rem;
  line-height: 1.6;
}

.callout strong {
  color: var(--red-text);
}

.csv-result {
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.025);
  font-size: 0.77rem;
  line-height: 1.6;
}

.csv-result h3 {
  margin: 0 0 4px;
  color: var(--red-text);
  font-family: var(--mono);
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.csv-result p {
  margin: 0;
  color: var(--paper-soft);
}

.csv-result .skipped {
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 3px;
  color: var(--muted);
  font-size: 0.71rem;
}

.csv-result .skipped b {
  color: var(--red-text);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.sep {
  margin: 22px 0;
  height: 1px;
  border: 0;
  background: var(--line);
}

.admin-list {
  display: grid;
  gap: 8px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.admin-item {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
}

.admin-item__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 9px;
}

.admin-item__title {
  min-width: 0;
  font-family: var(--mono);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--paper);
  overflow-wrap: anywhere;
}

.admin-item__meta {
  color: var(--muted);
  font-size: 0.66rem;
  font-variant-numeric: tabular-nums;
}

.admin-item__actions {
  display: flex;
  gap: 5px;
  margin-left: auto;
}

.badge {
  flex: none;
  padding: 2px 5px;
  border: 1px solid rgba(200, 16, 46, 0.5);
  border-radius: 2px;
  color: var(--red-text);
  font-size: 0.52rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
}

.badge--person {
  border-color: var(--line-strong);
  color: var(--muted);
}

.badge--team {
  border-color: rgba(200, 16, 46, 0.6);
  color: var(--red-text);
}

.sub-list {
  display: grid;
  gap: 4px;
  margin: 8px 0 0;
  padding: 0 0 0 12px;
  border-left: 1px solid var(--line);
  list-style: none;
}

.sub-item {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: var(--paper-soft);
  font-size: 0.76rem;
  line-height: 1.55;
}

.sub-item > span:first-child {
  min-width: 0;
  overflow-wrap: anywhere;
}

.sub-item .row-remove {
  margin-left: auto;
  flex: none;
}

.sub-empty {
  color: var(--muted);
  font-size: 0.72rem;
}

.task-add {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}

.task-add input {
  min-height: 34px;
  padding: 6px 9px;
  font-size: 0.78rem;
}

.task-add .btn {
  flex: none;
}

.inline-form {
  display: grid;
  gap: 10px;
}

.inline-form .field {
  max-width: 420px;
}

.check-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(136px, 1fr));
  gap: 6px;
  max-height: 150px;
  padding: 10px;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  background: var(--ink-2);
  overflow-y: auto;
}

.check {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: var(--paper-soft);
  font-size: 0.78rem;
  cursor: pointer;
}

.check span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.check-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.7rem;
}

.ledger-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px 18px;
  margin-bottom: 14px;
}

.ledger-head .field {
  flex: 1 1 240px;
  max-width: 360px;
}

.list-scroll {
  max-height: 360px;
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(200, 16, 46, 0.45) transparent;
}

.ledger-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ledger-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
  font-size: 0.78rem;
}

.ledger-subject {
  min-width: 0;
  overflow-wrap: anywhere;
}

.ledger-task {
  display: block;
  color: var(--muted);
  font-size: 0.64rem;
  line-height: 1.45;
}

.ledger-points {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--red-text);
  white-space: nowrap;
}

.ledger-points.is-neg {
  color: var(--red-text);
  opacity: 0.85;
}

/* ---------- toasts ---------- */

.toasts {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 1000;
  display: grid;
  gap: 8px;
  width: min(360px, calc(100vw - 32px));
}

.toast {
  padding: 11px 14px;
  border: 1px solid var(--line-strong);
  border-left: 3px solid var(--paper-soft);
  border-radius: 2px;
  background: #101010;
  box-shadow: 0 18px 44px -22px #000;
  color: var(--paper);
  font-size: 0.78rem;
  line-height: 1.55;
  animation: toast-in 0.24s var(--ease) both;
}

.toast--error {
  border-left-color: var(--red);
  background: #140b0d;
}

.toast--success {
  border-left-color: var(--paper-soft);
}

/* ---------- dialog ---------- */

.dialog {
  width: calc(100vw - 32px);
  max-width: 440px;
  padding: 0;
  border: 1px solid rgba(200, 16, 46, 0.5);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--paper);
  box-shadow: 0 40px 100px -30px #000;
}

.dialog::backdrop {
  background: rgba(0, 0, 0, 0.76);
  backdrop-filter: blur(2px);
}

.dialog__body {
  padding: clamp(20px, 4vw, 26px);
}

.dialog__body h2 {
  margin-bottom: 8px;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 1.2rem;
  line-height: 1.2;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.dialog__body p {
  margin: 0;
  color: var(--paper-soft);
  font-size: 0.82rem;
  line-height: 1.65;
}

.dialog__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  padding: 13px clamp(20px, 4vw, 26px);
  border-top: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.2);
}

/* ---------- motion ---------- */

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes seal-spin {
  to {
    transform: rotate(360deg);
  }
}

/* ---------- responsive ---------- */

@media (max-width: 760px) {
  .hero__seal {
    display: none;
  }

  .stat-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px 0;
  }

  .stat:nth-child(odd) {
    padding-left: 0;
    border-left: 0;
  }

  .stat:nth-child(even) {
    padding-right: 0;
  }
}

@media (max-width: 600px) {
  .form-grid,
  .form-grid--3 {
    grid-template-columns: minmax(0, 1fr);
  }

  .span-2 {
    grid-column: auto;
  }

  .brand__word {
    font-size: 0.9rem;
    letter-spacing: 0.2em;
  }

  .brand__sub {
    font-size: 0.52rem;
    letter-spacing: 0.26em;
  }

  .nav-link {
    padding: 7px 10px;
  }

  .rank-row {
    grid-template-columns: 2.1rem minmax(0, 1fr) auto;
    gap: 10px;
  }

  .rank-points {
    padding: 5px 8px 4px;
    min-width: 2.9rem;
  }

  .rank-points small {
    display: none;
  }

  .score-table th[scope="row"] {
    width: auto;
    max-width: 150px;
  }

  .episode-bar .field {
    max-width: none;
  }

  .episode-nav {
    order: 3;
  }

  .episode-meta {
    order: 4;
    flex: 1 1 100%;
  }

  .ledger-row {
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    gap: 7px;
  }

  .form-actions .hint {
    width: 100%;
    margin-left: 0;
  }
}

@media (min-width: 1000px) {
  .board-grid {
    grid-template-columns: minmax(0, 0.96fr) minmax(0, 1.04fr);
    align-items: start;
  }

  .console-grid {
    grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  }

  .panel--wide {
    grid-column: 1 / -1;
  }
}

@media (max-width: 380px) {
  .brand__seal {
    width: 34px;
    height: 34px;
    font-size: 0.74rem;
  }

  .brand__word {
    font-size: 0.84rem;
    letter-spacing: 0.16em;
  }

  .brand__sub {
    display: none;
  }

  .site-head__inner {
    gap: 10px;
  }

  .nav-link {
    font-size: 0.66rem;
  }

  .hero__frame {
    padding: 22px 18px;
  }

  .score-table {
    font-size: 0.78rem;
  }

  .score-table th,
  .score-table td {
    padding: 9px 6px;
  }

  .task-col {
    width: 48px;
    min-width: 42px;
  }
}

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

/* ============================================================
   Seal & parchment layer
   Fraunces for the bill, Instrument Sans for the prose,
   JetBrains Mono for the numbers. Cream stock on dark ink.
   ============================================================ */

h1, h2, h3 {
  font-optical-sizing: auto;
}

.hero h1,
.section-head h2,
.panel-head h2,
.console-head h1,
.login-card h1,
.empty-state h2,
.dialog__body h2,
.team-card--rich .team-name,
.rank-row--rich .rank-name,
.admin-item__title,
.setting-block h3,
.history-head h3 {
  font-family: var(--display);
  font-weight: 600;
  letter-spacing: -0.012em;
  text-transform: none;
}

.hero h1 {
  font-size: clamp(2.6rem, 6.4vw, 4.7rem);
  line-height: 0.98;
}

.hero h1 em {
  font-weight: 500;
}

.section-head h2 {
  font-size: clamp(1.55rem, 2.6vw, 2.1rem);
}

.panel-head h2 {
  font-size: 1.28rem;
}

.console-head h1 {
  font-size: clamp(2rem, 4.4vw, 3rem);
}

.login-card h1 {
  font-size: clamp(1.8rem, 3.8vw, 2.4rem);
}

.team-card--rich .team-name {
  font-size: clamp(1.15rem, 1.9vw, 1.4rem);
  line-height: 1.15;
  color: #251b12;
}

.rank-row--rich .rank-name {
  font-size: clamp(1.02rem, 1.7vw, 1.18rem);
  font-weight: 600;
}

.brand__word {
  font-family: var(--display);
  font-weight: 650;
  letter-spacing: 0.05em;
}

.stat--wide .stat__value {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.05rem, 1.8vw, 1.35rem);
  line-height: 1.15;
  white-space: normal;
  overflow-wrap: anywhere;
  color: var(--cream);
}

.stat__sub {
  display: block;
  margin-top: 5px;
  color: var(--muted-dim);
  font-family: var(--mono);
  font-size: 0.56rem;
  line-height: 1.5;
  letter-spacing: 0.02em;
  overflow-wrap: anywhere;
}

.stat--wide .stat__sub {
  color: var(--brass-soft);
  opacity: 0.8;
}

/* ---------- shared bars / segmented controls ---------- */

.panel-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 18px;
  padding: 14px clamp(15px, 3vw, 26px);
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.022), transparent);
}

.panel-bar__note {
  margin: 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.03em;
  line-height: 1.5;
}

.seg {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0;
  padding: 3px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.28);
}

.seg__btn {
  padding: 7px 11px 6px;
  border: 0;
  border-radius: 2px;
  background: transparent;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.35;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.16s var(--ease), color 0.16s var(--ease), box-shadow 0.16s var(--ease);
}

.seg__btn:hover {
  color: var(--cream);
}

.seg__btn[aria-pressed="true"] {
  background: linear-gradient(180deg, var(--red-hot), var(--red));
  color: #fff;
  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.4);
}

.chart-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.section-head--stacked {
  align-items: flex-start;
}

/* ---------- avatars with photos ---------- */

.avatar {
  overflow: hidden;
}

.avatar--photo {
  border-color: var(--brass);
  background: #1b1712;
}

.avatar-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

.avatar--lg {
  width: 2.9rem;
  height: 2.9rem;
  font-size: 0.72rem;
}

/* ---------- standings / team board ---------- */

.standings-panel {
  overflow: hidden;
}

.standings-divider {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px clamp(15px, 3vw, 28px) 2px;
  color: var(--brass-soft);
  font-family: var(--mono);
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.standings-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, rgba(201, 162, 39, 0.4), transparent);
}

.team-board {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  padding: clamp(14px, 2.4vw, 22px);
}

@media (min-width: 920px) {
  .team-board {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.team-card.team-card--rich {
  padding: 16px 16px 14px;
  border: 1px solid #d7c6a4;
  border-radius: 3px;
  background:
    radial-gradient(rgba(27, 21, 18, 0.045) 0.5px, transparent 0.6px) 0 0 / 5px 5px,
    linear-gradient(160deg, #f6eedd 0%, #efe2c9 100%);
  color: var(--cream-ink);
  box-shadow: var(--shadow-card);
}

.team-card--rich.is-winner {
  border-color: var(--brass);
  background:
    radial-gradient(rgba(27, 21, 18, 0.045) 0.5px, transparent 0.6px) 0 0 / 5px 5px,
    linear-gradient(160deg, #fbf4e3 0%, #f0e0bd 100%);
  box-shadow: inset 0 3px 0 var(--red), var(--shadow-card);
}

.team-card__head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
}

.rank-badge {
  flex: none;
  display: inline-grid;
  place-items: center;
  min-width: 1.9rem;
  height: 1.9rem;
  padding: 0 6px;
  border: 1px solid #b59a63;
  border-radius: 3px;
  background: #2a2119;
  color: var(--cream);
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.rank-badge--first {
  border-color: var(--brass);
  background: linear-gradient(180deg, #d9b64f, #a97f1f);
  color: #20170a;
  box-shadow: 0 0 18px -6px rgba(201, 162, 39, 0.8);
}

.rank-badge--tied {
  font-size: 0.66rem;
}

.team-card--rich .avatar {
  background: #e7d7b7;
  color: #7a1b26;
  border-color: var(--brass-dim);
  box-shadow: inset 0 0 0 2px #f4ead7;
}

.team-card__identity {
  flex: 1;
  min-width: 0;
}

.team-card__members {
  margin: 3px 0 0;
  color: #6c5c45;
  font-family: var(--sans);
  font-size: 0.73rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.team-card__score {
  flex: none;
  display: grid;
  justify-items: end;
  text-align: right;
}

.team-card__points {
  font-family: var(--mono);
  font-size: clamp(1.5rem, 2.6vw, 1.9rem);
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: lining-nums tabular-nums;
  color: #8f1d2c;
}

.team-card__points-label {
  margin-top: 3px;
  color: #7b6850;
  font-family: var(--mono);
  font-size: 0.48rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.team-card--rich .badge-leader {
  align-self: flex-start;
  border: 1px solid rgba(27, 21, 18, 0.2);
  background: #8f1d2c;
  color: #f8efdd;
}

.team-card__metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin: 12px 0 9px;
  padding-top: 9px;
  border-top: 1px solid rgba(27, 21, 18, 0.16);
  color: #6b5b45;
  font-family: var(--mono);
  font-size: 0.58rem;
  line-height: 1.5;
}

.team-card__metrics .metric b {
  color: #2c2117;
  font-weight: 700;
}

.team-card--rich .rank-bar {
  height: 5px;
  margin-top: 0;
  background: rgba(27, 21, 18, 0.16);
}

.team-card--rich .rank-bar__fill {
  background: linear-gradient(90deg, #7d1420, #b02535 60%, var(--brass));
  opacity: 1;
}

.team-card--rich.is-winner .rank-bar__fill {
  box-shadow: 0 0 12px rgba(143, 29, 44, 0.35);
}

.member-list {
  display: grid;
  gap: 0;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.member-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border-top: 1px solid rgba(27, 21, 18, 0.13);
  min-width: 0;
}

.member-row .avatar {
  width: 1.55rem;
  height: 1.55rem;
  font-size: 0.48rem;
}

.member-row__name {
  flex: 1;
  min-width: 0;
  color: #2a2119;
  font-family: var(--sans);
  font-size: 0.8rem;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.member-row__pts {
  flex: none;
  color: #8f1d2c;
  font-family: var(--mono);
  font-size: 0.74rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.member-row__pts small {
  color: #7b6850;
  font-size: 0.5rem;
  font-weight: 400;
  letter-spacing: 0.06em;
}

.member-empty {
  margin: 12px 0 0;
  padding-top: 10px;
  border-top: 1px dashed rgba(27, 21, 18, 0.2);
  color: #76664f;
  font-size: 0.74rem;
}

/* ---------- individual rows, richer ---------- */

.rank-list--rich {
  padding: 4px clamp(15px, 3vw, 28px) 6px;
}

.rank-row--rich {
  padding: 16px 0 15px;
}

.rank-row--rich .rank-name {
  gap: 8px;
}

.rank-row--rich .rank-name .avatar {
  width: 2.1rem;
  height: 2.1rem;
  font-size: 0.6rem;
}

.team-badge {
  flex: none;
  padding: 3px 7px 2px;
  border: 1px solid rgba(201, 162, 39, 0.55);
  border-radius: 2px;
  background: rgba(201, 162, 39, 0.08);
  color: var(--brass-soft);
  font-family: var(--mono);
  font-size: 0.5rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  line-height: 1.4;
  text-transform: uppercase;
  white-space: nowrap;
}

.team-badge--none {
  border-color: var(--line-strong);
  background: transparent;
  color: var(--muted);
}

.ep-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 8px;
}

.ep-pill {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.52rem;
  line-height: 1.55;
  letter-spacing: 0.03em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.ep-pill b {
  color: var(--cream);
  font-weight: 700;
}

.ep-pill.is-zero {
  opacity: 0.45;
}

.rank-row.is-winner .ep-pill {
  border-color: rgba(255, 107, 114, 0.3);
}

/* ---------- chart additions ---------- */

.chart-panel .seg {
  background: rgba(0, 0, 0, 0.22);
}

.series-bar {
  transition: opacity 0.18s var(--ease);
}

.chart-wrap.is-highlighting .series-bar {
  opacity: 0.2;
}

.chart-wrap.is-highlighting .series-bar.is-highlighted {
  opacity: 1;
}

.chart-tip__val small {
  color: var(--brass-soft);
  font-size: 0.55rem;
  font-weight: 400;
  letter-spacing: 0.02em;
}

.dist-summary {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.018);
}

.dist-summary__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 14px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.dist-summary__progression {
  color: var(--brass-soft);
  font-weight: 400;
  letter-spacing: 0.03em;
  text-transform: none;
}

.dist-list {
  display: grid;
  gap: 0;
  max-height: 232px;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  list-style: none;
  scrollbar-width: thin;
  scrollbar-color: rgba(201, 162, 39, 0.4) transparent;
}

.dist-row {
  display: grid;
  grid-template-columns: 2.6rem minmax(0, 1fr) 3rem auto;
  align-items: center;
  gap: 10px;
  padding: 7px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-family: var(--mono);
  font-size: 0.66rem;
  line-height: 1.5;
}

.dist-row:last-child {
  border-bottom: 0;
}

.dist-row__ep {
  color: var(--brass-soft);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.dist-row__leader {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  color: var(--paper-soft);
}

.dist-row__leader span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dist-row__leader b {
  flex: none;
  color: var(--cream);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.dist-row__share {
  color: var(--red-text);
  font-weight: 700;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.dist-row__range {
  color: var(--muted-dim);
  font-size: 0.58rem;
  text-align: right;
  white-space: nowrap;
}

/* ---------- episode team strip ---------- */

.episode-teams {
  padding: clamp(14px, 2.6vw, 22px) clamp(14px, 2.6vw, 24px) 4px;
  border-bottom: 1px solid var(--line);
}

.episode-teams__title {
  margin: 0 0 8px;
  color: var(--brass-soft);
  font-family: var(--mono);
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.episode-teams__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 8px;
}

.episode-team {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border: 1px solid #d7c6a4;
  border-radius: 3px;
  background:
    radial-gradient(rgba(27, 21, 18, 0.045) 0.5px, transparent 0.6px) 0 0 / 5px 5px,
    linear-gradient(160deg, #f5ecda 0%, #eee0c6 100%);
  color: var(--cream-ink);
  min-width: 0;
}

.episode-team .avatar {
  width: 2.1rem;
  height: 2.1rem;
  background: #e7d7b7;
  color: #7a1b26;
  border-color: var(--brass-dim);
  box-shadow: inset 0 0 0 2px #f4ead7;
}

.episode-team__body {
  min-width: 0;
  flex: 1;
}

.episode-team__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.episode-team__name {
  font-family: var(--display);
  font-size: 0.9rem;
  font-weight: 600;
  color: #251b12;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.episode-team__points {
  flex: none;
  color: #8f1d2c;
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.episode-team__points small {
  color: #7b6850;
  font-size: 0.5rem;
  font-weight: 400;
}

.episode-team__members {
  margin: 1px 0 0;
  color: #6c5c45;
  font-family: var(--sans);
  font-size: 0.67rem;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- score table additions ---------- */

.subject-cell__text {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.subject-cell__name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.subject-cell__sub {
  color: var(--muted);
  font-family: var(--sans);
  font-size: 0.62rem;
  font-weight: 400;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.subject-cell--indent {
  padding-left: 10px;
}

.tag-team--quiet {
  border-color: rgba(201, 162, 39, 0.38);
  color: var(--brass-soft);
  letter-spacing: 0.04em;
  text-transform: none;
}

/* ---------- all-episodes history ---------- */

.history {
  padding-bottom: 4px;
}

.history-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px 20px;
  padding: clamp(16px, 2.8vw, 22px) clamp(14px, 2.6vw, 24px) 12px;
}

.history-head .eyebrow {
  margin-bottom: 6px;
}

.history-head h3 {
  margin: 0;
  font-size: clamp(1.25rem, 2.1vw, 1.6rem);
}

.history-note {
  max-width: 42ch;
  margin: 0;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.55;
}

.history-scroll {
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line);
}

.history-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--mono);
  font-size: 0.76rem;
  font-variant-numeric: lining-nums tabular-nums;
}

.history-table th,
.history-table td {
  padding: 8px 7px;
  border-bottom: 1px solid var(--line);
  text-align: center;
  white-space: nowrap;
}

.history-table thead th {
  color: var(--muted);
  font-size: 0.52rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.history-table th[scope="row"] {
  position: sticky;
  left: 0;
  z-index: 1;
  width: 34%;
  max-width: 300px;
  padding-left: clamp(14px, 2.6vw, 24px);
  background: var(--panel);
  text-align: left;
  white-space: normal;
}

.history-table tbody tr:hover th[scope="row"],
.history-table tbody tr:hover td {
  background: rgba(255, 255, 255, 0.03);
}

.history-team-row th[scope="row"],
.history-team-row td {
  background: rgba(201, 162, 39, 0.07);
}

.history-team-row:hover th[scope="row"],
.history-team-row:hover td {
  background: rgba(201, 162, 39, 0.11);
}

.history-team-row .subject-cell__name {
  font-family: var(--display);
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--cream);
}

.history-member-row th[scope="row"] {
  background: #121212;
}

.history-member-row .subject-cell__name {
  font-family: var(--sans);
  font-size: 0.76rem;
  font-weight: 500;
  color: var(--paper-soft);
}

.history-table .team-group th {
  position: static;
  padding-block: 7px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
  font-size: 0.52rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-align: left;
}

.history-episodes {
  padding: clamp(16px, 2.8vw, 22px) clamp(14px, 2.6vw, 24px);
}

.history-episodes__title {
  margin: 0 0 8px;
  color: var(--brass-soft);
  font-family: var(--mono);
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.history-ep {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.018);
}

.history-ep + .history-ep {
  margin-top: 6px;
}

.history-ep summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  padding: 9px 11px;
  cursor: pointer;
  list-style: none;
}

.history-ep summary::-webkit-details-marker {
  display: none;
}

.history-ep summary::after {
  content: "+";
  margin-left: auto;
  color: var(--red-text);
  font-family: var(--mono);
  font-size: 0.95rem;
  line-height: 1;
}

.history-ep[open] summary::after {
  content: "−";
}

.history-ep summary:hover {
  background: rgba(255, 255, 255, 0.025);
}

.history-ep__name {
  color: var(--paper);
  font-family: var(--display);
  font-size: 0.92rem;
  font-weight: 600;
}

.history-ep__meta {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.58rem;
  letter-spacing: 0.02em;
}

.history-ep__body {
  border-top: 1px solid var(--line);
}

.history-ep__body .episode-teams {
  border-bottom: 0;
}

.history-ep__body .table-scroll {
  border-top: 1px solid var(--line);
}

/* ---------- admin: login reset ---------- */

.login-reset-toggle {
  margin: 14px 0 0;
  text-align: center;
}

.link-btn {
  padding: 2px;
  border: 0;
  background: transparent;
  color: var(--brass-soft);
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.06em;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.link-btn:hover {
  color: var(--cream);
}

.login-form--reset {
  margin-top: 14px;
  padding-top: 16px;
  border-top: 1px dashed var(--line-strong);
}

.login-form--reset .hint {
  margin: 0;
}

.login-form--reset code {
  color: var(--brass-soft);
  font-family: var(--mono);
  font-size: 0.64rem;
}

/* ---------- admin: people + teams ---------- */

.admin-item__main {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.admin-item--person .admin-item__head,
.admin-item--team .admin-item__head {
  align-items: center;
}

.admin-item .avatar {
  width: 2rem;
  height: 2rem;
  font-size: 0.55rem;
}

.email-badge {
  max-width: 100%;
  color: var(--brass-soft);
  font-family: var(--mono);
  font-size: 0.61rem;
  line-height: 1.4;
  letter-spacing: 0.01em;
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.email-badge:hover {
  color: var(--cream);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.item-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 9px;
}

.item-tools .btn {
  min-height: 30px;
  padding: 0.3em 0.62em;
  font-size: 0.6rem;
  letter-spacing: 0.05em;
}

.inline-edit {
  margin-top: 11px;
  padding-top: 12px;
  border-top: 1px dashed var(--line-strong);
}

.inline-edit .field {
  max-width: none;
}

.inline-edit .form-actions {
  margin-top: 10px;
}

.member-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 9px 0 0;
  padding: 0;
  list-style: none;
}

.member-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  padding: 2px 7px 2px 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--paper-soft);
  font-family: var(--sans);
  font-size: 0.7rem;
  line-height: 1.5;
}

.member-pill .avatar {
  width: 1.35rem;
  height: 1.35rem;
  font-size: 0.44rem;
}

.member-pill span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- admin: security + analytics ---------- */

.settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(20px, 3vw, 32px);
}

@media (min-width: 860px) {
  .settings-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.setting-block {
  min-width: 0;
}

.setting-block h3 {
  margin: 0 0 4px;
  color: var(--cream);
  font-size: 1.2rem;
}

.setting-lede {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.6;
}

.setting-block .inline-form {
  gap: 12px;
}

.setting-block .inline-form .field {
  max-width: none;
}

.check--block {
  min-height: 42px;
  padding: 9px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  background: var(--ink-2);
}

.check--block:hover {
  border-color: rgba(255, 255, 255, 0.3);
}

.setting-block .hint {
  margin-top: 2px;
}

/* ---------- responsive adjustments for the new layer ---------- */

@media (max-width: 700px) {
  .panel-bar {
    padding: 12px 14px;
  }

  .panel-bar__note {
    flex: 1 1 100%;
  }

  .chart-controls {
    width: 100%;
  }

  .chart-controls .seg {
    width: 100%;
  }

  .chart-controls .seg__btn {
    flex: 1 1 auto;
    text-align: center;
  }

  .dist-row {
    grid-template-columns: 2.3rem minmax(0, 1fr) auto;
  }

  .dist-row__range {
    grid-column: 2 / -1;
    text-align: left;
    white-space: normal;
  }

  .rank-row--rich .rank-points {
    min-width: 3rem;
  }

  .history-table th[scope="row"] {
    width: auto;
    max-width: 180px;
  }
}

@media (max-width: 520px) {
  .team-card__head {
    flex-wrap: wrap;
  }

  .team-card__score {
    margin-left: auto;
  }

  .team-card__identity {
    flex-basis: calc(100% - 7rem);
  }

  .episode-teams__grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ============================================================
   Records, player profiles, live mode, recaps
   Same stock, same inks — only the scale changes.
   ============================================================ */

/* ---------- restrained secondary record line ---------- */

.record {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 7px;
  margin: 7px 0 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.6rem;
  line-height: 1.5;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}

.record b {
  color: var(--paper-soft);
  font-weight: 700;
}

.record > span[aria-hidden="true"] {
  color: var(--muted-dim);
}

.record__streak b {
  color: var(--brass-soft);
}

.record__best {
  color: var(--muted-dim);
}

.record--cream {
  margin-top: 0;
  color: #6b5b45;
}

.record--cream b {
  color: #2c2117;
}

.record--cream .record__streak b {
  color: #8f1d2c;
}

.record--cream .record__best {
  color: #7b6850;
}

.record--cream > span[aria-hidden="true"] {
  color: rgba(27, 21, 18, 0.35);
}

/* ---------- whole-row profile trigger ---------- */

.row-open {
  position: absolute;
  inset: 0;
  z-index: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: inherit;
  background: transparent;
  color: transparent;
  font: inherit;
  cursor: pointer;
}

.row-open:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: -2px;
}

.rank-row--rich {
  transition: background 0.16s var(--ease);
}

.rank-row--rich:hover {
  background: rgba(255, 255, 255, 0.028);
}

.rank-row--rich > :not(.row-open) {
  position: relative;
  z-index: 1;
  pointer-events: none;
}

.member-row {
  position: relative;
  transition: background 0.16s var(--ease);
}

.member-row:hover {
  background: rgba(27, 21, 18, 0.05);
}

.member-row > :not(.row-open) {
  position: relative;
  z-index: 1;
  pointer-events: none;
}

.member-row:hover .member-row__name {
  color: #6d1622;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.member-row .row-open {
  border-radius: 2px;
}

.member-row .row-open:focus-visible {
  outline-color: #8f1d2c;
}

.recap-open {
  flex: none;
  align-self: center;
}

/* ---------- player profile dialog ---------- */

html.is-modal {
  overflow: hidden;
}

.profile-dialog {
  width: min(640px, calc(100vw - 24px));
  max-height: min(88vh, 900px);
  padding: 0;
  border: 1px solid rgba(201, 162, 39, 0.42);
  border-radius: 4px;
  background: var(--panel);
  color: var(--paper);
  box-shadow: 0 50px 130px -40px #000;
  overflow: hidden;
}

.profile-dialog[open] {
  display: flex;
  flex-direction: column;
}

.profile-dialog::backdrop {
  background: rgba(3, 3, 3, 0.78);
  backdrop-filter: blur(3px);
}

.profile__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: clamp(18px, 3vw, 24px);
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(90deg, rgba(200, 16, 46, 0.12), transparent 62%),
    var(--panel);
}

.profile__identity {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.profile__identity .avatar {
  width: 4.2rem;
  height: 4.2rem;
  font-size: 1rem;
  border-color: var(--brass);
}

.profile__names {
  min-width: 0;
}

.profile__names .eyebrow {
  margin-bottom: 6px;
}

.profile__names h2 {
  margin: 0;
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.5rem, 3.4vw, 2rem);
  line-height: 1.04;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}

.profile__meta {
  margin: 6px 0 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.62rem;
  line-height: 1.55;
  letter-spacing: 0.02em;
}

.profile-close {
  flex: none;
}

.profile__body {
  display: grid;
  gap: clamp(18px, 3vw, 26px);
  padding: clamp(16px, 3vw, 24px);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(201, 162, 39, 0.4) transparent;
}

.profile__stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--line);
  overflow: hidden;
}

.profile__stats > div {
  min-width: 0;
  padding: 12px 14px;
  background: #121212;
}

.profile__stats dt {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.52rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  line-height: 1.4;
  text-transform: uppercase;
}

.profile__stats dd {
  margin: 6px 0 0;
  color: var(--cream);
  font-family: var(--mono);
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: lining-nums tabular-nums;
}

.profile__stats dd small {
  display: block;
  margin-top: 4px;
  color: var(--brass-soft);
  font-size: 0.52rem;
  font-weight: 400;
  letter-spacing: 0.04em;
}

.profile__section h3 {
  margin: 0 0 10px;
  color: var(--brass-soft);
  font-family: var(--mono);
  font-size: 0.56rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.profile__picks {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.pick {
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid #d7c6a4;
  border-radius: 3px;
  background:
    radial-gradient(rgba(27, 21, 18, 0.045) 0.5px, transparent 0.6px) 0 0 / 5px 5px,
    linear-gradient(160deg, #f6eedd 0%, #efe2c9 100%);
  color: var(--cream-ink);
}

.pick__label {
  display: block;
  color: #7b6850;
  font-family: var(--mono);
  font-size: 0.48rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.pick__points {
  display: block;
  margin-top: 4px;
  color: #8f1d2c;
  font-family: var(--mono);
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.pick__points small {
  color: #7b6850;
  font-size: 0.5rem;
  font-weight: 400;
}

.pick__title {
  margin: 7px 0 0;
  font-family: var(--display);
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.22;
  overflow-wrap: anywhere;
}

.pick__meta {
  margin: 3px 0 0;
  color: #6c5c45;
  font-family: var(--mono);
  font-size: 0.56rem;
}

.pick--empty p {
  margin: 7px 0 0;
  color: #6c5c45;
  font-size: 0.76rem;
  line-height: 1.5;
}

.spark {
  margin: 0;
}

.spark svg {
  display: block;
  width: 100%;
  height: auto;
}

.spark__area {
  fill: rgba(201, 162, 39, 0.14);
}

.spark__line {
  fill: none;
  stroke: var(--brass);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.spark__dot {
  fill: var(--brass);
}

.spark__dot--last {
  fill: var(--red);
  stroke: #12100e;
  stroke-width: 2;
}

.spark__caption {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-top: 6px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.55rem;
  letter-spacing: 0.03em;
  font-variant-numeric: tabular-nums;
}

.spark__caption span:nth-child(2) {
  color: var(--brass-soft);
}

.profile__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px clamp(16px, 3vw, 24px);
  border-top: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.24);
}

.profile__foot .hint {
  max-width: 34ch;
}

@media (max-width: 520px) {
  .profile__stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .profile__stats > div:last-child {
    grid-column: 1 / -1;
  }

  .profile__picks {
    grid-template-columns: minmax(0, 1fr);
  }

  .profile__identity .avatar {
    width: 3.4rem;
    height: 3.4rem;
  }

  .profile__foot {
    flex-wrap: wrap;
  }
}

/* ---------- live / TV mode ---------- */

.page--live .site-head,
.page--live .site-foot,
.page--live .hero,
.page--recap .site-head,
.page--recap .site-foot,
.page--recap .hero {
  display: none;
}

.page--live .wrap {
  max-width: none;
  padding-inline: 0;
}

.live-shell {
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: clamp(10px, 2vh, 26px);
  min-height: 100vh;
  min-height: 100svh;
  padding: clamp(14px, 2.4vw, 32px) clamp(16px, 3vw, 46px) clamp(12px, 2vh, 26px);
}

.live-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: clamp(8px, 1.4vh, 16px);
  border-bottom: 1px solid var(--line);
}

.live-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  color: var(--cream);
  font-family: var(--display);
  font-weight: 650;
  font-size: clamp(0.85rem, 1.5vw, 1.15rem);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.live-seal {
  display: inline-grid;
  place-items: center;
  width: 1.75em;
  height: 1.75em;
  border: 1px solid var(--red);
  border-radius: 2px;
  background: #150a0c;
  color: var(--red-text);
  font-family: var(--mono);
  font-size: 0.58em;
  letter-spacing: 0.04em;
  box-shadow: inset 0 0 0 2px var(--ink), inset 0 0 0 3px rgba(200, 16, 46, 0.32);
}

.live-status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: clamp(0.58rem, 0.85vw, 0.74rem);
  letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--red-hot);
  box-shadow: 0 0 10px rgba(210, 31, 43, 0.8);
  animation: live-pulse 2.6s var(--ease) infinite;
}

.live-status.is-stale .live-dot {
  background: var(--brass);
  box-shadow: none;
  animation: none;
}

@keyframes live-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

.live-title {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.live-eyebrow {
  margin: 0;
  color: var(--red-text);
  font-family: var(--mono);
  font-size: clamp(0.58rem, 0.95vw, 0.8rem);
  font-weight: 700;
  letter-spacing: 0.24em;
  line-height: 1.4;
  text-transform: uppercase;
}

.live-heading {
  margin: 0;
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.35rem, 3vw, 2.5rem);
  line-height: 1.02;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}

.live-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(16px, 2.4vw, 40px);
  align-content: safe center;
  align-items: start;
  min-height: 0;
}

@media (min-width: 900px) {
  .live-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.live-col {
  min-width: 0;
}

.live-col__title {
  margin: 0 0 clamp(8px, 1.4vh, 14px);
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line-strong);
  color: var(--brass-soft);
  font-family: var(--mono);
  font-size: clamp(0.58rem, 0.9vw, 0.74rem);
  font-weight: 700;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.live-list {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.live-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(10px, 1.6vw, 22px);
  height: clamp(58px, 8.2vh, 96px);
  padding: 0 clamp(8px, 1.4vw, 16px);
  border-bottom: 1px solid var(--line);
  will-change: transform;
}

.live-row.is-leader {
  background: linear-gradient(90deg, rgba(200, 16, 46, 0.16), transparent 74%);
  box-shadow: inset 3px 0 0 var(--red);
}

.live-rank {
  min-width: 1.4em;
  color: #4a4a4a;
  font-family: var(--mono);
  font-weight: 700;
  font-size: clamp(1.3rem, 2.4vw, 2.2rem);
  line-height: 1;
  font-variant-numeric: lining-nums tabular-nums;
  -webkit-text-stroke: 1px rgba(255, 255, 255, 0.16);
}

.live-row.is-leader .live-rank {
  color: var(--red);
  -webkit-text-stroke: 1px rgba(255, 91, 102, 0.6);
}

.live-name {
  min-width: 0;
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.1rem, 2.4vw, 2.05rem);
  line-height: 1.05;
  letter-spacing: -0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live-sub {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: clamp(0.48rem, 0.72vw, 0.62rem);
  font-weight: 400;
  letter-spacing: 0.06em;
}

.live-points {
  color: var(--cream);
  font-family: var(--mono);
  font-weight: 700;
  font-size: clamp(1.6rem, 3.6vw, 3.2rem);
  line-height: 1;
  font-variant-numeric: lining-nums tabular-nums;
}

.live-row.is-negative .live-points {
  color: var(--red-text);
}

.live-empty {
  padding: clamp(20px, 5vh, 48px) 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: clamp(0.8rem, 1.2vw, 1rem);
}

.live-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 18px;
  padding-top: clamp(8px, 1.4vh, 14px);
  border-top: 1px solid var(--line);
  color: var(--muted-dim);
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.05em;
}

.live-foot p {
  margin: 0;
}

.live-foot a {
  color: var(--brass-soft);
  text-decoration: none;
}

.live-foot a:hover {
  color: var(--cream);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.live-error {
  display: grid;
  place-content: center;
  justify-items: start;
  gap: 10px;
  min-height: 100vh;
  min-height: 100svh;
  padding: clamp(24px, 6vw, 64px);
}

.live-error p {
  margin: 0;
  color: var(--paper-soft);
}

@media (max-width: 560px) {
  .live-shell {
    gap: 14px;
  }

  .live-head {
    flex-wrap: wrap;
  }

  .live-row {
    height: auto;
    min-height: 58px;
    padding-block: 8px;
  }

  .live-name {
    white-space: normal;
  }
}

/* ---------- episode recap ---------- */

.recap {
  padding-block: clamp(18px, 4vw, 40px) 0;
}

.recap__head {
  padding-bottom: clamp(16px, 3vw, 26px);
  border-bottom: 1px solid var(--line-strong);
}

.recap__head .eyebrow {
  margin-bottom: 10px;
}

.recap__head h1 {
  margin: 0;
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(2rem, 5vw, 3.4rem);
  line-height: 1;
  letter-spacing: -0.025em;
}

.recap__head h1 span {
  display: block;
  margin-top: 10px;
  color: var(--paper-soft);
  font-size: clamp(0.98rem, 1.7vw, 1.3rem);
  font-weight: 400;
  line-height: 1.3;
  letter-spacing: 0;
}

.recap__meta {
  margin: 10px 0 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.68rem;
  line-height: 1.6;
  letter-spacing: 0.03em;
}

.recap__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.recap-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(16px, 2.6vw, 26px);
  margin-top: clamp(20px, 3vw, 30px);
}

@media (min-width: 960px) {
  .recap-grid {
    grid-template-columns: minmax(0, 1.02fr) minmax(0, 0.98fr);
    align-items: start;
  }
}

.recap-block {
  padding: clamp(16px, 3vw, 26px);
}

.recap-block h2 {
  margin: 0 0 4px;
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.15rem, 2.2vw, 1.5rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.recap-block__lede {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.6;
}

.recap-winners {
  display: grid;
  gap: 8px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.recap-winner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid #d7c6a4;
  border-radius: 3px;
  background:
    radial-gradient(rgba(27, 21, 18, 0.045) 0.5px, transparent 0.6px) 0 0 / 5px 5px,
    linear-gradient(160deg, #f6eedd 0%, #efe2c9 100%);
  color: var(--cream-ink);
}

.recap-winner .avatar {
  width: 2.6rem;
  height: 2.6rem;
  background: #e7d7b7;
  color: #7a1b26;
  border-color: var(--brass-dim);
  box-shadow: inset 0 0 0 2px #f4ead7;
}

.recap-winner__name {
  flex: 1;
  min-width: 0;
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.05rem;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recap-winner__pts {
  flex: none;
  color: #8f1d2c;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 1.15rem;
  font-variant-numeric: tabular-nums;
}

.recap-winner__pts small {
  margin-left: 3px;
  color: #7b6850;
  font-size: 0.5rem;
  font-weight: 400;
}

.recap-note {
  margin: 12px 0 0;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  color: var(--paper-soft);
  font-size: 0.74rem;
  line-height: 1.6;
}

.recap-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--mono);
  font-size: 0.76rem;
  font-variant-numeric: lining-nums tabular-nums;
}

.recap-table th,
.recap-table td {
  padding: 8px 6px;
  border-bottom: 1px solid var(--line);
  text-align: right;
  white-space: nowrap;
}

.recap-table thead th {
  color: var(--muted);
  font-size: 0.52rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.recap-table thead th:nth-child(2),
.recap-table tbody th {
  text-align: left;
}

.recap-table tbody th {
  font-family: var(--display);
  font-size: 0.88rem;
  font-weight: 600;
  white-space: normal;
  overflow-wrap: anywhere;
}

.recap-table tbody tr:last-child th,
.recap-table tbody tr:last-child td {
  border-bottom: 0;
}

.recap-pos {
  width: 2.6rem;
  color: var(--muted-dim);
}

.recap-gain {
  color: var(--brass-soft);
}

.recap-total {
  color: var(--cream);
  font-weight: 700;
}

.recap-table__caption {
  padding: 0 0 8px;
  color: var(--brass-soft);
  font-family: var(--mono);
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-align: left;
  text-transform: uppercase;
  caption-side: top;
}

.move {
  display: inline-grid;
  place-items: center;
  min-width: 2.1rem;
  padding: 2px 5px;
  border: 1px solid var(--line);
  border-radius: 2px;
  font-size: 0.62rem;
  font-weight: 700;
  line-height: 1.5;
}

.move--up {
  border-color: rgba(201, 162, 39, 0.5);
  color: var(--brass-soft);
}

.move--down {
  border-color: rgba(200, 16, 46, 0.45);
  color: var(--red-text);
}

.move--flat {
  color: var(--muted-dim);
}

.recap-scorecard {
  margin-top: clamp(18px, 3vw, 28px);
  overflow: hidden;
}

.recap-scorecard .recap-block {
  padding-bottom: 0;
}

.recap-scorecard .table-scroll {
  border-top: 1px solid var(--line);
}

.recap-foot {
  margin: clamp(18px, 3vw, 26px) 0 0;
  color: var(--muted-dim);
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.04em;
}

.recap-hold {
  padding: clamp(40px, 10vh, 96px) 0;
  text-align: center;
}

.recap-hold .eyebrow {
  justify-content: center;
}

.recap-hold h1 {
  margin-bottom: 10px;
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
}

.recap-hold p {
  color: var(--paper-soft);
}

.recap-hold .btn {
  margin-top: 8px;
}

/* ---------- admin: backups, data, toasts ---------- */

.backup-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
}

.backup-toolbar .hint {
  flex: 1 1 180px;
}

.backup-list {
  display: grid;
  gap: 6px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.backup-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
}

.backup-row__main {
  display: grid;
  gap: 2px;
  flex: 1 1 190px;
  min-width: 0;
}

.backup-row__name {
  color: var(--paper);
  font-family: var(--mono);
  font-size: 0.74rem;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-decoration: none;
}

.backup-row__name:hover {
  color: var(--cream);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.backup-row__meta {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.62rem;
  font-variant-numeric: tabular-nums;
}

.import-summary {
  margin-top: 12px;
  padding: 11px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.025);
}

.import-summary__title {
  margin: 0 0 8px;
  color: var(--cream);
  font-family: var(--mono);
  font-size: 0.72rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.import-counts {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin: 0 0 8px;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.64rem;
}

.import-counts b {
  color: var(--brass-soft);
  font-weight: 700;
}

.import-summary .hint {
  margin: 0;
}

input[type="file"] {
  width: 100%;
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--paper-soft);
}

input[type="file"]::file-selector-button {
  margin-right: 10px;
  padding: 8px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  background: var(--ink-2);
  color: var(--paper);
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
}

input[type="file"]::file-selector-button:hover {
  border-color: var(--red);
  color: var(--cream);
}

.toast--with-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.toast__text {
  min-width: 0;
}

.toast__action {
  flex: none;
  padding: 3px 8px;
  border: 1px solid var(--brass-dim);
  border-radius: 2px;
  background: transparent;
  color: var(--brass-soft);
  font-family: var(--mono);
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}

.toast__action:hover {
  border-color: var(--brass);
  color: var(--cream);
  background: rgba(201, 162, 39, 0.1);
}

.toast--info {
  border-left-color: var(--brass-dim);
}

.undo-btn {
  margin-left: auto;
}

/* ---------- print: recaps only ---------- */

@media print {
  @page {
    margin: 14mm;
  }

  body {
    background: #fff !important;
    color: #111 !important;
    font-size: 11pt;
  }

  body::after,
  .skip-link,
  .site-head,
  .site-foot,
  .hero,
  .toasts,
  .profile-dialog,
  .recap__actions,
  .recap-foot,
  .table-hint {
    display: none !important;
  }

  .page--recap .wrap {
    max-width: none;
    padding: 0;
  }

  a {
    color: #111 !important;
    text-decoration: none;
  }

  .eyebrow,
  .recap__head h1,
  .recap__head h1 span,
  .recap__meta,
  .recap-block h2,
  .recap-block__lede,
  .recap-note,
  .recap-hold p {
    color: #111 !important;
  }

  .recap__head,
  .recap-block,
  .recap-scorecard {
    border-color: #999 !important;
  }

  .panel {
    background: #fff !important;
    border-color: #999 !important;
    box-shadow: none !important;
  }

  .recap-winner {
    background: #f5f5f5 !important;
    border-color: #999 !important;
    color: #111 !important;
    break-inside: avoid;
  }

  .recap-winner .avatar,
  .avatar {
    background: #fff !important;
    border-color: #666 !important;
    color: #111 !important;
    box-shadow: none !important;
  }

  .recap-winner__name,
  .recap-winner__pts,
  .recap-winner__pts small {
    color: #111 !important;
  }

  .recap-table,
  .score-table {
    font-size: 9pt;
  }

  .recap-table th,
  .recap-table td,
  .score-table th,
  .score-table td {
    border-color: #ccc !important;
    color: #111 !important;
    background: #fff !important;
  }

  .recap-table thead th,
  .score-table thead th {
    color: #333 !important;
  }

  .recap-table__caption {
    color: #333 !important;
  }

  .subject-cell__sub,
  .recap-winner__pts small,
  .pick__meta,
  .pick__label,
  .spark__caption {
    color: #444 !important;
  }

  .score-table th[scope="row"] {
    background: #fff !important;
  }

  .score-table .team-group th {
    background: #eee !important;
    color: #333 !important;
  }

  .recap-total,
  .row-total,
  .recap-gain,
  .score-cell.is-neg {
    color: #111 !important;
  }

  .tag-team,
  .tag-team--quiet,
  .task-tag,
  .move {
    border-color: #999 !important;
    color: #333 !important;
    background: transparent !important;
  }

  .task-key li {
    color: #333 !important;
  }

  .task-key b {
    color: #111 !important;
  }

  .table-scroll {
    overflow: visible !important;
  }

  .recap-section,
  .recap-scorecard,
  .recap-grid {
    break-inside: avoid;
  }
}

/* Two nav links need a second row before the header gets cramped. */
@media (max-width: 460px) {
  .site-head__inner {
    flex-wrap: wrap;
    gap: 10px;
  }

  .site-nav {
    width: 100%;
    gap: 6px;
  }

  .site-nav .nav-link {
    flex: 1 1 0;
    justify-content: center;
    min-width: 0;
  }
}

@media (max-width: 899px) {
  .live-grid {
    align-content: start;
  }
}
