:root {
  --bg: #f3f2ed;
  --paper: #ffffff;
  --ink: #141a16;
  --ink-2: #4c544f;
  --muted: #7b827d;
  --line: #dcdcd4;
  --dark: #161b18;
  --dark-2: #232a26;
  --accent: #b8423a;
  --turf-a: #2f6b3b;
  --turf-b: #2b6236;
  --g: #3a9f4b;
  --y: #dcae1d;
  --o: #e5772a;
  --r: #cf3a33;
  --up: #2f9a45;
  --down: #c9372f;
  /* brand: the turf green and goalpost gold of the icon and share cards */
  --brand: #1d5231;
  --brand-hi: #2c7a46;
  --brand-lo: #123521;
  --gold: #f0c93a;
  --cta: #20673a;
  --cta-ink: #ffffff;
  --focus: #2f7de1;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 4px 14px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 2px 4px rgba(0, 0, 0, 0.05), 0 14px 34px rgba(18, 53, 33, 0.18);
  color-scheme: light dark;
  --display: 'Bebas Neue', 'Oswald', 'Arial Narrow', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --text: 'Inter', -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Segoe UI', sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111412;
    --paper: #1a1f1c;
    --ink: #eef0ec;
    --ink-2: #c3c8c3;
    --muted: #8d948f;
    --line: #2d3430;
    --dark: #e9ece7;
    --dark-2: #d5d9d3;
    --cta: #2a7d47;
    --focus: #f0c93a;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 2px 4px rgba(0, 0, 0, 0.3), 0 14px 34px rgba(0, 0, 0, 0.45);
  }
}

* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--text);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}
:focus-visible {
  outline: 2.5px solid var(--focus);
  outline-offset: 2px;
}
.muted {
  color: var(--muted);
}
.small {
  font-size: 12px;
}
.kicker {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--muted);
  text-transform: uppercase;
}

/* ---------- shared leaderboard ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.leaderboard .kicker { margin: 2px 0 5px; color: var(--brand-hi); }
.lb-intro { margin: 0 0 18px; color: var(--ink-2); font-size: 14px; }
.lb-tabs { display: flex; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); }
.lb-tabs button { flex: 1; padding: 10px 6px; border: 0; border-radius: 8px; background: transparent; color: var(--ink-2); font: 700 12px var(--text); }
.lb-tabs button[aria-pressed=true] { background: var(--brand); color: #fff; box-shadow: var(--shadow); }
.lb-filter { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin: 18px 0 12px; font-size: 12px; color: var(--ink-2); }
.lb-filter label, .lb-form label { display: grid; gap: 6px; font-size: 11px; font-weight: 700; letter-spacing: .03em; }
.lb-filter input, .lb-form input { min-width: 0; padding: 10px 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); color: var(--ink); font: 14px var(--text); }
.lb-count { color: var(--muted); font-size: 11px; margin: 10px 0; }
.lb-message, .lb-empty, .lb-error { padding: 18px 12px; font-size: 13px; line-height: 1.6; }
.lb-message { color: var(--ink-2); }
.lb-empty { text-align: center; background: var(--bg); border: 1px dashed var(--line); border-radius: 12px; padding: 30px 14px; }
.lb-empty b { font: 27px var(--display); }
.lb-empty p { margin: 8px 0 0; color: var(--ink-2); }
.lb-error { color: var(--down); }
.lb-table-wrap { overflow-x: auto; margin: 12px -3px; }
.lb-table { width: 100%; border-collapse: collapse; font-size: 12px; font-variant-numeric: tabular-nums; }
.lb-table thead th { font-size: 10px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 9px 7px; text-align: center; font-weight: 600; white-space: nowrap; }
.lb-table thead th:nth-child(2) { text-align: left; }
.lb-table td { padding: 12px 7px; border-top: 1px solid var(--line); text-align: center; }
.lb-table tbody th { padding: 12px 7px; border-top: 1px solid var(--line); text-align: left; max-width: 155px; overflow-wrap: anywhere; font-weight: 600; }
.lb-table .lb-rank { color: var(--muted); font-weight: 700; width: 26px; }
.lb-final { white-space: nowrap; color: var(--ink-2); }
.lb-you { background: color-mix(in srgb, var(--brand-hi) 9%, var(--paper)); }
.lb-you-tag { display: inline-block; margin-left: 6px; font-size: 8px; font-weight: 800; letter-spacing: .07em; color: var(--brand-hi); }
.lb-outcome { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 5px; background: var(--bg); color: var(--ink-2); font-weight: 800; }
.lb-outcome.is-win { background: var(--brand); color: #fff; }
.lb-divider { color: var(--muted); font-size: 10px; text-transform: uppercase; }
.lb-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: end; margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.lb-form .btn { margin: 0; font-size: 12px; padding: 11px 13px; white-space: nowrap; }
.lb-form button:disabled { opacity: .6; cursor: wait; }
.lb-form p { grid-column: 1 / -1; margin: 0; font-size: 11px; color: var(--ink-2); line-height: 1.5; }
.lb-form p.lb-error { color: var(--down); padding: 0; }
.lb-rules, .lb-privacy { font-size: 10px; line-height: 1.7; color: var(--muted); margin: 16px 0 0; }
.lb-privacy { margin-top: 8px; }
@media (max-width: 400px) {
  .topbar { padding-inline: 10px; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 6px; }
  .top-right { gap: 4px; }
  .top-right .icon-btn { width: 32px; height: 32px; }
  .brand-title { font-size: 21px; }
  .brand-sub { font-size: 10px; }
  .lb-table th, .lb-table td { padding-inline: 4px; }
  .lb-form { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 8px 16px;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.brand {
  text-align: center;
}
.brand-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--display);
  font-size: 28px;
  line-height: 1;
  letter-spacing: 0.02em;
}
.brand-title::before {
  content: '';
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: url('../favicon.svg') center / cover no-repeat;
  flex: none;
}
@media (max-width: 480px) {
  .brand-title {
    font-size: 25px;
  }
  .brand-title::before {
    display: none;
  }
}
.brand-sub {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.06em;
  margin-top: 2px;
}
.top-right {
  display: flex;
  gap: 6px;
  justify-self: end;
}
.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--paper);
  font-weight: 700;
  display: grid;
  place-items: center;
  padding: 0;
  box-shadow: var(--shadow);
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.icon-btn svg {
  fill: currentColor;
}
.icon-btn:hover {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--bg);
}

/* Daily / Survivor: one segmented switch */
.modes {
  display: flex;
  width: fit-content;
  gap: 2px;
  margin: 14px auto 4px;
  padding: 3px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: var(--shadow);
}
.modes button {
  border: 0;
  background: transparent;
  border-radius: 999px;
  padding: 6px 20px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  transition: background 0.15s, color 0.15s;
}
.modes button:hover {
  color: var(--ink);
}
.modes button.on {
  background: var(--dark);
  color: var(--bg);
}

.app {
  max-width: 1180px;
  margin: 0 auto;
  padding: 8px 16px 48px;
}

/* ---------- buttons ---------- */
.btn {
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 10px;
  padding: 10px 16px;
  font-weight: 600;
  transition: border-color 0.12s, filter 0.12s, transform 0.08s;
}
.btn:hover {
  border-color: var(--ink);
}
.btn.small {
  padding: 6px 12px;
  font-size: 13px;
  border-radius: 999px;
}
.btn.primary {
  display: block;
  width: 100%;
  background: var(--cta);
  color: var(--cta-ink);
  border: 0;
  border-radius: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
  padding: 16px;
  font-size: 15px;
  text-transform: uppercase;
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.18), 0 6px 18px color-mix(in srgb, var(--cta) 30%, transparent);
}
.btn.primary:hover {
  filter: brightness(1.15);
}
.btn.primary:active,
.cat:active,
.card:active {
  transform: translateY(1px);
}
.btn:disabled {
  cursor: progress;
}
.btn.primary.alt {
  background: var(--accent);
  color: #fff;
}
.btn.ghost {
  display: block;
  width: 100%;
  margin-top: 8px;
  background: transparent;
}
.btn.grow {
  flex: 1;
  display: flex;
  justify-content: space-between;
}

/* ---------- intro ---------- */
.intro {
  max-width: 560px;
  margin: 14px auto 0;
  text-align: center;
}
/* The situation sits on a strip of turf, like the share card. */
.hero {
  position: relative;
  overflow: hidden;
  padding: 20px 18px 20px;
  border-radius: 18px;
  color: #fff;
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.07) 0 2px, transparent 2px 10%),
    radial-gradient(120% 95% at 50% 0%, var(--brand-hi) 0%, var(--brand) 52%, var(--brand-lo) 100%);
  box-shadow: inset 0 -4px 0 var(--gold), var(--shadow-lg);
}
.hero .kicker {
  color: rgba(255, 255, 255, 0.66);
}
.matchup {
  font-weight: 700;
  margin-top: 6px;
}
.big-sit {
  font-family: var(--display);
  font-size: clamp(56px, 13vw, 84px);
  line-height: 0.95;
  margin: 10px 0 0;
  font-weight: 400;
  letter-spacing: 0.01em;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
}
.big-clock {
  font-family: var(--display);
  font-size: 28px;
  letter-spacing: 0.02em;
  color: var(--gold);
}
.ib-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(12px, 5vw, 34px);
  margin: 16px 0 16px;
}
.ib-team {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  min-width: 80px;
}
.ib-badge {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--tc);
  color: #fff;
  display: grid;
  place-items: center;
  font-family: var(--display);
  font-size: 20px;
  box-shadow: 0 0 0 3px #fff, 0 6px 16px rgba(0, 0, 0, 0.35);
}
.ib-name {
  font-weight: 700;
  font-size: 14px;
  margin-top: 2px;
}
.ib-you[hidden] {
  display: block;
  visibility: hidden;
}
.ib-you {
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.14em;
  line-height: 1;
  padding: 3px 7px 2px;
  border-radius: 999px;
  background: var(--gold);
  color: #1b1b1b;
}
.ib-score {
  font-family: var(--display);
  font-size: clamp(46px, 13vw, 56px);
  line-height: 1;
  white-space: nowrap;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
}
.chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}
.chip {
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 13px;
  font-weight: 500;
}
.hero .chip {
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(0, 0, 0, 0.2);
  color: #fff;
}
.surv-note {
  margin: 14px 0 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
}
.intro-q {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.35;
  margin: 18px auto 12px;
  max-width: 460px;
  text-wrap: balance;
}
/* The two numbers to beat */
.odds {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 0 0 14px;
}
.odd {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  text-align: left;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.odd b {
  flex: none;
  min-width: 52px;
  font-family: var(--display);
  font-size: 32px;
  font-weight: 400;
  line-height: 1;
}
.odd span {
  font-size: 12px;
  line-height: 1.3;
  color: var(--muted);
}
.odd .odds-calc {
  width: auto;
  flex: none;
  margin: 0;
  padding: 8px 10px;
  font-size: 12px;
  letter-spacing: 0;
}
.intro-help {
  margin: 12px 0;
  font-size: 13px;
}
.intro-help a {
  color: var(--ink-2);
}
@media (max-width: 480px) {
  .odd {
    flex-direction: column;
    gap: 4px;
    text-align: center;
  }
}
.fine {
  color: var(--muted);
  font-size: 12px;
  margin-top: 14px;
}
.done-box {
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 10px;
  box-shadow: var(--shadow);
}
.done-title {
  font-weight: 800;
}
.done-line {
  margin: 4px 0 8px;
}

/* ---------- game layout ---------- */
.game {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
  margin-top: 8px;
}
.g-left {
  position: sticky;
  top: 70px;
}
@media (max-width: 860px) {
  .game {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }
  /* Phone order: field, play call, then play-by-play. */
  .g-left {
    display: contents;
  }
  .g-right {
    order: 1;
    margin-bottom: 14px;
  }
  .pbp {
    order: 2;
  }
}

/* scorebug */
.scorebug {
  border-radius: 12px 12px 0 0;
  overflow: hidden;
}
.sb {
  display: grid;
  grid-template-columns: 1fr auto auto auto 1fr;
  align-items: center;
  background: #121614;
  color: #fff;
  padding: 6px 12px;
  gap: 12px;
}
.sb-team {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.sb-team.opp {
  align-items: flex-end;
}
.sb-abbr {
  font-family: var(--display);
  font-size: 22px;
  line-height: 1;
  display: flex;
  align-items: center;
  gap: 6px;
  padding-left: 7px;
  border-left: 4px solid var(--tc);
}
.sb-team.opp .sb-abbr {
  padding-left: 0;
  padding-right: 7px;
  border-left: 0;
  border-right: 4px solid var(--tc);
  flex-direction: row-reverse;
}
.sb-abbr em {
  font-style: normal;
  font-family: var(--text);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.12em;
  opacity: 0.6;
}
.sb-ball {
  width: 11px;
  height: 7px;
  border-radius: 50%;
  background: #a0582a;
  display: inline-block;
}
.sb-tos {
  display: flex;
  gap: 3px;
  padding-left: 11px;
}
.sb-team.opp .sb-tos {
  padding: 0 11px 0 0;
}
.sb-tos i {
  width: 14px;
  height: 3px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.18);
}
.sb-tos i.on {
  background: #f0c93a;
}
.sb-score {
  font-family: var(--display);
  font-size: 34px;
  line-height: 1;
}
.sb-clock {
  font-family: var(--display);
  font-size: 26px;
  line-height: 1;
  text-align: center;
  background: rgba(255, 255, 255, 0.08);
  padding: 4px 10px 3px;
  border-radius: 6px;
}
.sb-clock small {
  display: block;
  font-size: 11px;
  opacity: 0.6;
}
.sb-clock.run {
  color: #f6d96b;
}
.sb-sub {
  background: #1e2421;
  color: #d9dfda;
  font-size: 12.5px;
  padding: 6px 12px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}
.wp-chip {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  padding: 1px 9px;
  font-weight: 700;
  white-space: nowrap;
}

/* field */
.field-host {
  position: relative;
  aspect-ratio: 533 / 300;
  background: var(--turf-a);
  border-radius: 0 0 12px 12px;
  overflow: hidden;
}
.field-svg {
  display: block;
  width: 100%;
  height: 100%;
  user-select: none;
}
.turf-a {
  fill: var(--turf-a);
}
.turf-b {
  fill: var(--turf-b);
}
.ez {
  opacity: 0.88;
}
.ez-text {
  fill: rgba(255, 255, 255, 0.88);
  font-family: var(--display);
  font-size: 46px;
  letter-spacing: 10px;
  text-anchor: middle;
  dominant-baseline: middle;
}
.yl {
  stroke: rgba(255, 255, 255, 0.45);
  stroke-width: 1.5;
}
.goal {
  stroke: #fff;
  stroke-width: 3;
}
.hash {
  stroke: rgba(255, 255, 255, 0.5);
  stroke-width: 1.2;
}
.ynum {
  fill: rgba(255, 255, 255, 0.6);
  font-family: var(--display);
  font-size: 26px;
  text-anchor: middle;
  dominant-baseline: middle;
}
.post {
  stroke: #ffd84d;
  stroke-width: 5;
  stroke-linecap: round;
}
.los {
  stroke: #4f8df5;
  stroke-width: 3.5;
}
.fd {
  stroke: #f5d142;
  stroke-width: 3.5;
}
.route {
  fill: none;
  stroke: rgba(255, 255, 255, 0.82);
  stroke-width: 2.2;
  stroke-dasharray: 6 5;
  stroke-linejoin: round;
}
.route.hl {
  stroke: #ffd84d;
  stroke-dasharray: none;
  stroke-width: 3;
}
.pl circle {
  stroke-width: 3;
}
.pl .num {
  font: 700 10.5px var(--text);
  fill: #111;
  text-anchor: middle;
}
.pl .nm {
  font: 600 9px var(--text);
  fill: #fff;
  paint-order: stroke;
  stroke: rgba(0, 0, 0, 0.6);
  stroke-width: 2.5px;
}
.pl.clickable {
  cursor: pointer;
}
.pl.clickable:hover circle {
  stroke: #fff;
  stroke-width: 4;
}
.ball {
  fill: #8f4c1f;
  stroke: #fff;
  stroke-width: 1.2;
}
.field-flash {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
  font-family: var(--display);
  font-size: clamp(34px, 8vw, 64px);
  color: #fff;
  text-shadow: 0 3px 14px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transform: scale(0.85);
  transition: opacity 0.2s, transform 0.25s;
  letter-spacing: 0.04em;
}
.field-flash.show {
  opacity: 1;
  transform: scale(1);
}
.field-flash.good {
  color: #b8f5a6;
}
.field-flash.bad {
  color: #ffb3a8;
}

.under-field {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 8px 0;
  gap: 8px;
}
.legend {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}
.legend .grad {
  width: 64px;
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(90deg, rgb(210, 69, 47), rgb(229, 130, 44), rgb(232, 201, 58), rgb(88, 176, 79));
}

/* play-by-play */
.pbp details {
  border-top: 1px solid var(--line);
  padding-top: 6px;
}
.pbp summary {
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.1em;
  padding: 4px 0;
}
.pbp ol {
  list-style: none;
  margin: 6px 0 0;
  padding: 0;
  max-height: 340px;
  overflow: auto;
}
.pbp li {
  display: grid;
  grid-template-columns: 38px 22px 1fr;
  gap: 6px;
  align-items: start;
  font-size: 13px;
  padding: 6px 0;
  border-bottom: 1px dashed var(--line);
}
.pbp li.their .pl-text {
  color: var(--ink-2);
}
.pl-clock {
  font-family: var(--display);
  font-size: 16px;
  color: var(--muted);
}

/* grade squares */
.sq {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 5px;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  flex: none;
}
.sq.g {
  background: var(--g);
}
.sq.y {
  background: var(--y);
}
.sq.o {
  background: var(--o);
}
.sq.r {
  background: var(--r);
}
.sq.none {
  background: transparent;
}
.grid-sq {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px;
  margin: 8px 0;
}

/* ---------- panel ---------- */
.panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.result {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  box-shadow: var(--shadow);
  animation: rise 0.22s ease-out;
}
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}
.result.pending {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 14px;
}
.spinner {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2.5px solid var(--line);
  border-top-color: var(--ink);
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.res-top {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
.res-big {
  font-family: var(--display);
  font-size: 54px;
  line-height: 0.9;
  min-width: 64px;
  text-align: center;
  color: var(--muted);
}
.res-big.up {
  color: var(--up);
}
.res-big.down {
  color: var(--down);
}
.res-title {
  font-family: var(--display);
  font-size: 24px;
  line-height: 1.05;
  letter-spacing: 0.02em;
}
.res-desc {
  font-size: 14px;
  margin-top: 2px;
}
.res-wp {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 3px;
}
.res-real {
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
}
.real-box {
  text-align: left;
  margin: 12px auto 0;
  padding: 10px 12px;
  border-left: 3px solid var(--accent);
  background: var(--bg);
  border-radius: 0 10px 10px 0;
  max-width: 420px;
}
.real-box p {
  margin: 4px 0 0;
  font-size: 14px;
}
.site-foot {
  max-width: 760px;
  margin: 0 auto;
  padding: 24px 16px 32px;
  border-top: 1px solid var(--line);
  text-align: center;
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--muted);
}
.site-foot a {
  color: inherit;
}
.res-note {
  margin-top: 10px;
  padding-left: 10px;
  border-left: 3px solid var(--accent);
  font-size: 13px;
  font-weight: 600;
}
.res-grade {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin-top: 10px;
  font-size: 13.5px;
}
.res-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
.opts {
  margin-top: 10px;
}
.opts p {
  font-size: 12px;
  margin: 0 0 6px;
}
.opts ol {
  margin: 0;
  padding: 0;
  list-style: none;
  max-height: 260px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.opts li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 10px;
  font-size: 13px;
  border-bottom: 1px solid var(--line);
}
.opts li:last-child {
  border-bottom: 0;
}
.opts li.mine {
  background: color-mix(in srgb, var(--y) 22%, transparent);
  font-weight: 700;
}

.call {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.call-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  border-bottom: 2px solid var(--ink);
  padding-bottom: 6px;
}
.call-head .kicker {
  color: var(--ink);
  font-size: 13px;
}
.dd {
  font-size: 13px;
  color: var(--ink-2);
  text-align: right;
}
.def-look {
  font-size: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  align-items: baseline;
}
.def-look .muted {
  font-size: 12.5px;
}
.clock-note {
  font-size: 13px;
  color: var(--muted);
}
.clock-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-end;
  justify-content: space-between;
}
.tempo {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
}
.seg {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px;
  background: var(--paper);
}
.seg button {
  border: 0;
  background: transparent;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
}
.seg button.on {
  background: var(--dark);
  color: var(--bg);
}
.to-btn {
  border-color: var(--o);
  color: var(--o);
  font-size: 13px;
  padding: 7px 12px;
  border-radius: 999px;
}
.to-btn:hover {
  background: var(--o);
  color: #fff;
  border-color: var(--o);
}

.cats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
@media (max-width: 420px) {
  .cats {
    grid-template-columns: repeat(2, 1fr);
  }
}
.cat {
  background: var(--dark);
  color: var(--bg);
  border: 0;
  border-radius: 14px;
  padding: 16px 6px 13px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 5px;
  font-family: var(--display);
  font-size: 32px;
  line-height: 1;
  letter-spacing: 0.02em;
  box-shadow: inset 0 -3px 0 rgba(255, 255, 255, 0.08), var(--shadow);
  transition: transform 0.12s, box-shadow 0.12s;
}
.cat small {
  font-family: var(--text);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  opacity: 0.6;
  text-wrap: balance;
}
.cat:hover {
  transform: translateY(-2px);
  box-shadow: inset 0 -4px 0 var(--gold), 0 8px 18px rgba(0, 0, 0, 0.18);
}
.specials {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
}
.sub-head {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--display);
  font-size: 22px;
}
.help {
  font-size: 13px;
  color: var(--ink-2);
  margin: 0;
}
.mods {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.mod {
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 13px;
  font-weight: 600;
}
.mod.on {
  background: var(--dark);
  color: var(--bg);
  border-color: var(--dark);
}
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 8px;
}
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 12px;
  cursor: pointer;
  transition: border-color 0.12s, transform 0.12s;
  box-shadow: var(--shadow);
}
.card:hover,
.card:focus-visible {
  border-color: var(--ink);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
  outline: none;
}
.card-title {
  font-weight: 800;
  font-size: 15px;
}
.card-desc {
  font-size: 12.5px;
  color: var(--ink-2);
  margin-top: 2px;
}
.card-stat {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}
.card.special {
  border-style: dashed;
}
.card.screen {
  background: #f0c93a;
  color: #1b1b1b;
  border-color: #d9b12b;
  text-align: center;
}
.card.screen .card-title {
  font-family: var(--display);
  font-size: 22px;
  font-weight: 400;
  letter-spacing: 0.04em;
}
.card.screen .card-desc {
  color: #3d3a2a;
}
.rcv-card {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.rc-pos {
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 3px solid var(--rc);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.05;
}
.rc-pos small {
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
}
.rc-body {
  min-width: 0;
  flex: 1;
}
.rc-name {
  font-weight: 800;
}
.rc-route {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-top: 2px;
  font-size: 13px;
  font-weight: 600;
}
.rc-route button {
  border: 1px solid var(--line);
  background: transparent;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  padding: 0;
  line-height: 1;
}
.rc-route button:hover {
  border-color: var(--ink);
}
.rc-route span {
  min-width: 46px;
  text-align: center;
}

/* end of game */
.end {
  --res: var(--muted);
  background: linear-gradient(180deg, color-mix(in srgb, var(--res) 12%, var(--paper)), var(--paper) 160px);
  border: 1px solid var(--line);
  border-top: 4px solid var(--res);
  border-radius: 14px;
  padding: 18px;
  text-align: center;
  box-shadow: var(--shadow-lg);
  animation: rise 0.25s ease-out;
}
.end.win {
  --res: var(--up);
}
.end.loss {
  --res: var(--down);
}
.end-res {
  font-family: var(--display);
  font-size: 60px;
  line-height: 1;
}
.end.win .end-res {
  color: var(--up);
}
.end.loss .end-res {
  color: var(--down);
}
.end-score {
  font-family: var(--display);
  font-size: 26px;
  color: var(--ink-2);
}
.end-stats {
  display: flex;
  justify-content: center;
  gap: 26px;
  margin: 10px 0;
}
.end-stats div {
  display: flex;
  flex-direction: column;
}
.end-stats b {
  font-family: var(--display);
  font-size: 34px;
  line-height: 1;
}
.end-stats span {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.06em;
}
.style {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 12px auto;
  padding: 10px;
  border-radius: 10px;
  background: var(--bg);
  max-width: 360px;
}
.style b {
  font-size: 18px;
}
.surv-line {
  font-weight: 700;
}
.end-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}
.end-actions .btn.ghost {
  margin-top: 0;
}

/* ---------- share ---------- */
.modal-card [hidden] {
  display: none !important;
}
.sh-preview {
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 9;
  margin-bottom: 12px;
  border-radius: 10px;
  background: #1a4a2b;
  overflow: hidden;
}
.sh-preview img {
  display: block;
  width: 100%;
  height: auto;
}
.sh-preview .spinner {
  border-color: rgba(255, 255, 255, 0.25);
  border-top-color: #fff;
}
.sh-label {
  margin: 14px 0 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--muted);
  text-transform: uppercase;
}
.sh-plat {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}
.sh-btn {
  display: block;
  padding: 10px 6px;
  border-radius: 10px;
  background: var(--brand);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  text-align: center;
  text-decoration: none;
}
.sh-btn:hover {
  filter: brightness(1.15);
}
.sh-x {
  --brand: #000;
}
.sh-facebook {
  --brand: #1877f2;
}
.sh-reddit {
  --brand: #ff4500;
}
.sh-threads {
  --brand: #101010;
}
.sh-bluesky {
  --brand: #0a7aff;
}
.sh-whatsapp {
  --brand: #1a9e4b;
}
@media (prefers-color-scheme: dark) {
  .sh-x,
  .sh-threads {
    box-shadow: inset 0 0 0 1px #3a403c;
  }
}
.sh-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.sh-tools .btn:disabled {
  opacity: 0.5;
  cursor: default;
}

/* ---------- embed builder and compact player ---------- */
.sh-embed {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 12px;
}
.foot-embed {
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.embed-builder .kicker { margin: 0 40px 5px 0; color: var(--brand-hi); }
.embed-builder h2 { padding-right: 28px; }
.embed-intro { margin: 0 0 20px; color: var(--ink-2); font-size: 14px; line-height: 1.65; }
.embed-options { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 18px; }
.embed-options label, .embed-code-label { display: grid; gap: 7px; font-size: 12px; font-weight: 700; }
.embed-options select, .embed-options input {
  width: 100%;
  min-width: 0;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  font: 14px var(--text);
}
.embed-code {
  display: block;
  width: 100%;
  height: 220px;
  margin-top: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  color: var(--ink-2);
  font: 12px/1.65 ui-monospace, SFMono-Regular, Consolas, monospace;
  resize: vertical;
  white-space: pre;
}
.embed-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.embed-actions .btn, .embed-full-site { text-align: center; text-decoration: none; }
.embed-note { margin: 16px 0 0; color: var(--muted); font-size: 11px; line-height: 1.7; }
.embed-full-site { display: inline-block; }
.embed-foot { padding: 16px; border-top: 1px solid var(--line); text-align: center; font-size: 11px; color: var(--muted); }
.embed-foot > a { font-size: 13px; font-weight: 700; color: var(--brand-hi); }
.embed-foot a { color: var(--ink-2); text-underline-offset: 3px; }
.embed-foot p { margin: 7px 0 0; }
html[data-embed] .app { padding-bottom: 24px; }
@media (max-width: 480px) {
  html[data-embed] .topbar { grid-template-columns: 30px minmax(0, 1fr) auto; gap: 6px; padding: 10px; }
  html[data-embed] .brand-title { font-size: clamp(18px, 5.3vw, 25px); }
  html[data-embed] .brand-sub { font-size: 9px; letter-spacing: 0; }
  html[data-embed] .top-right { gap: 4px; }
  html[data-embed] .icon-btn { width: 30px; height: 30px; }
}

/* ---------- modal ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(10, 14, 12, 0.55);
  backdrop-filter: blur(3px);
  display: grid;
  place-items: center;
  padding: 16px;
}
.modal.hidden {
  display: none;
}
.modal-card {
  position: relative;
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 22px 22px 18px;
  width: min(560px, 100%);
  max-height: 88vh;
  overflow: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: pop 0.18s ease-out;
}
@keyframes pop {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
}
.modal-card h2 {
  font-family: var(--display);
  font-weight: 400;
  font-size: 30px;
  margin: 0 0 10px;
  letter-spacing: 0.02em;
}
.modal-card h4 {
  margin: 16px 0 6px;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.modal-x {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  padding: 0 0 2px;
  border: 0;
  border-radius: 50%;
  background: var(--bg);
  font-size: 22px;
  line-height: 1;
}
.modal-x:hover {
  background: var(--line);
}
.help-body p,
.help-body li {
  font-size: 14px;
}
.help-body ul {
  padding-left: 18px;
}
.legend-sq {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  align-items: center;
}
.legend-sq .sq {
  margin-right: 4px;
}
.stat-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.stat {
  flex: 1;
  min-width: 80px;
  text-align: center;
  background: var(--bg);
  border-radius: 10px;
  padding: 10px 4px;
}
.stat b {
  display: block;
  font-family: var(--display);
  font-size: 32px;
  line-height: 1;
}
.stat span {
  font-size: 11px;
  color: var(--muted);
}
.r-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
@media (max-width: 560px) {
  .r-cols {
    grid-template-columns: 1fr;
  }
}
.r-col h4 {
  border-left: 4px solid var(--tc);
  padding-left: 8px;
  text-transform: none;
  letter-spacing: 0;
  font-size: 15px;
}
.r-col h5 {
  margin: 10px 0 4px;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.ratings {
  list-style: none;
  margin: 0;
  padding: 0;
}
.ratings li {
  display: grid;
  grid-template-columns: 30px 32px 1fr 60px 24px;
  gap: 6px;
  align-items: center;
  font-size: 12.5px;
  padding: 2px 0;
}
.r-pos {
  font-weight: 800;
  font-size: 11px;
}
.r-num {
  color: var(--muted);
}
.r-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.r-bar {
  height: 6px;
  background: var(--bg);
  border-radius: 3px;
  overflow: hidden;
}
.r-bar i {
  display: block;
  height: 100%;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 20px);
  background: var(--dark);
  color: var(--bg);
  padding: 10px 18px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 60;
}
.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ---------- text content: guide under the game, static pages ---------- */
.prose {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 16px;
  font-size: 15.5px;
  line-height: 1.65;
  color: var(--ink-2);
}
.prose h1,
.prose h2,
.prose h3 {
  color: var(--ink);
  line-height: 1.15;
}
.prose h1 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(40px, 8vw, 56px);
  letter-spacing: 0.01em;
  margin: 8px 0 12px;
}
.prose h2 {
  font-size: 21px;
  font-weight: 800;
  margin: 36px 0 10px;
}
.prose h3 {
  font-size: 16.5px;
  font-weight: 700;
  margin: 24px 0 6px;
}
.prose p,
.prose ul,
.prose ol {
  margin: 0 0 12px;
}
.prose ul,
.prose ol {
  padding-left: 22px;
}
.prose li {
  margin-bottom: 6px;
}
.prose b,
.prose strong {
  color: var(--ink);
}
.prose a {
  color: var(--ink);
  text-underline-offset: 2px;
}
.prose .lead {
  font-size: 17.5px;
  color: var(--ink);
}
.prose .updated {
  font-size: 13px;
  color: var(--muted);
}
.prose details {
  border-top: 1px solid var(--line);
  padding: 0;
}
.prose details:last-of-type {
  border-bottom: 1px solid var(--line);
}
.prose summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  cursor: pointer;
  font-weight: 700;
  color: var(--ink);
  list-style: none;
}
.prose summary::-webkit-details-marker {
  display: none;
}
.prose summary::after {
  content: '+';
  flex: none;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--paper);
  border: 1px solid var(--line);
  font-size: 17px;
  font-weight: 600;
  line-height: 1;
  color: var(--ink-2);
}
.prose details[open] summary::after {
  content: '−';
}
.prose summary:hover::after {
  border-color: var(--ink);
}
.prose details p {
  margin: -4px 0 0;
  padding-bottom: 14px;
}
/* numbered steps */
.prose .steps {
  list-style: none;
  padding: 0;
  counter-reset: step;
  display: grid;
  gap: 8px;
}
.prose .steps li {
  counter-increment: step;
  position: relative;
  margin: 0;
  padding: 12px 14px 12px 54px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.prose .steps li::before {
  content: counter(step);
  position: absolute;
  left: 14px;
  top: 12px;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--cta);
  color: #fff;
  font-family: var(--display);
  font-size: 18px;
  line-height: 1;
  padding-top: 2px;
}
.prose .steps b {
  display: block;
}
.prose .mode-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 0 0 12px;
}
@media (max-width: 560px) {
  .prose .mode-cards {
    grid-template-columns: 1fr;
  }
}
.prose .mode-card {
  padding: 14px 16px 4px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-top: 4px solid var(--cta);
  border-radius: 12px;
}
.prose .mode-card + .mode-card {
  border-top-color: var(--accent);
}
.prose .mode-card h3 {
  margin: 0 0 4px;
  font-family: var(--display);
  font-weight: 400;
  font-size: 26px;
  letter-spacing: 0.02em;
}
.prose a.more {
  font-weight: 700;
  text-decoration: none;
}
.prose a.more::after {
  content: ' →';
}
.prose a.more:hover {
  text-decoration: underline;
}
.prose .cta {
  display: inline-block;
  width: auto;
  margin: 8px 0 4px;
  padding: 13px 28px;
  border-radius: 10px;
  text-decoration: none;
}
.prose .table-wrap {
  overflow-x: auto;
  margin: 0 0 12px;
}
.prose table {
  border-collapse: collapse;
  width: 100%;
  font-size: 14.5px;
}
.prose th,
.prose td {
  text-align: left;
  vertical-align: top;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
}
.prose th {
  color: var(--ink);
}
.guide {
  border-top: 1px solid var(--line);
  margin-top: 16px;
  padding-top: 32px;
  padding-bottom: 48px;
}
.page {
  padding-top: 24px;
  padding-bottom: 48px;
}
a.brand {
  color: inherit;
  text-decoration: none;
}
.top-play {
  display: inline-block;
  width: auto;
  padding: 8px 16px;
  font-size: 12px;
  border-radius: 999px;
  text-decoration: none;
}
.foot-nav {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px 18px;
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 600;
}
.foot-nav a {
  color: var(--ink-2);
  text-decoration: none;
}
.foot-nav a:hover {
  color: var(--ink);
  text-decoration: underline;
}

/* ---------- cookie choice (EEA / UK / CH visitors) ---------- */
.consent {
  position: fixed;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  width: min(560px, calc(100% - 32px));
  z-index: 70;
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.18);
  font-size: 13px;
}
.consent p {
  margin: 0;
  flex: 1;
}
.consent a {
  color: inherit;
}
.consent-btns {
  display: flex;
  gap: 6px;
}
.consent-btns .btn {
  display: inline-block;
  width: auto;
  margin: 0;
  padding: 8px 14px;
  font-size: 12px;
  letter-spacing: 0.04em;
}
@media (max-width: 520px) {
  .consent {
    flex-direction: column;
    align-items: stretch;
  }
  .consent-btns .btn {
    flex: 1;
  }
}

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

.leaderboard .lb-filter .btn { width: auto; flex: none; margin: 0; }
.leaderboard .lb-filter label { flex: 1; max-width: 220px; }
.leaderboard .lb-filter input { width: 100%; }
.leaderboard .lb-form .btn { width: auto; }
@media (max-width: 400px) {
  .topbar { padding-inline: 10px; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 6px; }
  .brand-title { font-size: 21px; }
}
