:root {
  --font-body: "PT Mono", "Courier New", monospace;
  font-synthesis: none;
  color-scheme: light;
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
html {
  scroll-padding-top: env(safe-area-inset-top, 0px);
}
img {
  max-width: 100%;
}
[hidden]:not([hidden="until-found" i]) {
  display: none !important;
}

/* Color tokens (--bg, --ink, --accent, etc., light + dark) live in
   newspaper.css, which loads after this file and is the app's only shipped
   theme — it redeclares every one of these for both themes. Verified via
   grep that the two tokens it doesn't redeclare in dark mode, --win and
   --shadow, are each only ever consumed by rules newspaper.css itself
   overrides outright, so they're unused; don't reintroduce a color block
   here without also giving it a consumer newspaper.css doesn't override. */

* {
  box-sizing: border-box;
}
body {
  margin: 0;
  padding: 0;
  font: 14px var(--font-body);
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}
.mono {
  font-family: var(--font-body);
}
.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding-inline: 20px;
}
h1,
h2,
h3 {
  margin: 0;
  text-wrap: balance;
}
button {
  font: inherit;
}

/* ---------- Nav ---------- */
nav {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-block: 14px;
  flex-wrap: wrap;
}
.wordmark {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 17px;
  letter-spacing: -0.02em;
}
.wordmark .dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
}
.nav-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.weekpills {
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: 42vw;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.weekpills::-webkit-scrollbar {
  display: none;
}
.weekpill {
  flex: none;
  font-family: var(--font-body);
  font-size: 11.5px;
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid transparent;
  color: var(--ink-faint);
  background: transparent;
  cursor: pointer;
}
.weekpill:hover {
  color: var(--ink-soft);
}
.weekpill:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.weekpill.active {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
  cursor: default;
}

.icon-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}
.icon-btn:hover {
  border-color: var(--ink-faint);
}
.icon-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.icon-btn svg {
  width: 16px;
  height: 16px;
}
.icon-btn .moon {
  display: none;
}
:root[data-theme="dark"] .icon-btn .sun {
  display: none;
}
:root[data-theme="dark"] .icon-btn .moon {
  display: block;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .icon-btn .sun {
    display: none;
  }
  :root:not([data-theme="light"]) .icon-btn .moon {
    display: block;
  }
}

/* ---------- Hero ---------- */
.hero {
  padding-block: 30px 26px;
}
.eyebrow {
  font-family: var(--font-body);
  font-size: 11.5px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}
.hero h1 {
  font-size: clamp(28px, 4.4vw, 40px);
  font-weight: 800;
  letter-spacing: -0.03em;
}

section {
  padding-block: 22px;
}
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.section-head h2 {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.section-head .sub {
  font-family: var(--font-body);
  font-size: 11px;
  color: var(--ink-faint);
  letter-spacing: 0.5px;
}
.data-status {
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font:
    700 9.5px var(--font-body);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.data-status.stale {
  background: color-mix(in srgb, var(--live) 12%, transparent);
  color: var(--live);
}

.section-head-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.filter-toggle {
  font-family: var(--font-body);
  font-size: 10.5px;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  padding: 7px 12px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-soft);
  cursor: pointer;
}
.filter-toggle:hover {
  border-color: var(--ink-faint);
}
.filter-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

/* layout switch */
.layout-switch {
  display: flex;
  gap: 2px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 2px;
}
.layout-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--ink-faint);
  font-family: var(--font-body);
  font-size: 10.5px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  cursor: pointer;
}
.layout-btn svg {
  width: 13px;
  height: 13px;
}
.layout-btn:hover {
  color: var(--ink-soft);
}
.layout-btn.active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 2px var(--shadow);
}
.layout-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

/* ---------- Crest (team mark) ---------- */
.crest {
  position: relative;
  flex: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-align: center;
  line-height: 1;
}
.team-logo {
  background: #fff;
  color: #343943;
  border-radius: 5px;
}
.team-logo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 1px;
  opacity: 0;
}
.team-logo.logo-loaded img { opacity: 1; }
.team-logo.logo-loaded span { visibility: hidden; }
.crest span {
  position: relative;
  z-index: 1;
  transform: translateY(0.5px);
}

/* ---------- Pin button ---------- */
.pin-btn {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--ink-faint);
  cursor: pointer;
  border-radius: 6px;
  flex: none;
}
/* Keep the 24px star but give thumbs a ~44px hit area without moving layout. */
.pin-btn {
  position: relative;
}
.pin-btn::before {
  content: "";
  position: absolute;
  inset: -10px;
}
.pin-btn:hover {
  color: var(--ink-soft);
  background: var(--surface-2);
}
.pin-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.pin-btn svg {
  width: 14px;
  height: 14px;
}
.pin-btn svg path {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.pin-btn.pinned {
  color: var(--accent);
}
.pin-btn.pinned svg path {
  fill: currentColor;
}

/* ---------- Games: shared ---------- */
.games {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.games.mode-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  align-items: start;
  gap: 14px;
}
/* An expanded card spans the full grid so detail tables get room. */
.games.mode-grid .grid-style.open {
  grid-column: 1 / -1;
}
.games.mode-condensed {
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: var(--surface);
}
.games.mode-condensed .game-card {
  border-radius: 0;
  border: none;
  border-bottom: 1px solid var(--line);
}
.games.mode-condensed .game-card:last-child {
  border-bottom: none;
}

.game-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  transition:
    box-shadow 0.18s ease,
    border-color 0.18s ease;
}
.game-card:hover {
  border-color: var(--ink-faint);
  box-shadow: 0 6px 18px var(--shadow);
}
.status {
  font-family: var(--font-body);
  font-size: 10.5px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--ink-faint);
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.status.live {
  color: var(--live);
  font-weight: 600;
}
.status .pulse {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--live);
  animation: pulse 1.4s ease-in-out infinite;
}
@media (prefers-reduced-motion: reduce) {
  .status .pulse {
    animation: none;
  }
}
@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.2;
  }
}
.box-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 9px 12px;
  background: var(--surface-2);
  border: none;
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  font-family: var(--font-body);
  font-size: 11px;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  cursor: pointer;
}
.box-toggle:hover {
  color: var(--ink);
}
.box-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}
.box-toggle svg {
  width: 12px;
  height: 12px;
  transition: transform 0.2s ease;
  flex: none;
}
.game-card.open .box-toggle svg {
  transform: rotate(180deg);
}

.box-panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.28s ease;
}
@media (prefers-reduced-motion: reduce) {
  .box-panel {
    transition: none;
  }
}
.box-panel-inner {
  padding: 18px 16px 20px;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
}
.box-block + .box-block {
  margin-top: 22px;
}
.box-label {
  font-family: var(--font-body);
  font-size: 10px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 10px;
}

/* ---------- Row layout (single line, wide) ---------- */
.row-style .row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 16px 0;
}
.row-style .league-tag {
  font-size: 12.5px;
  color: var(--ink-soft);
}
.row-style .row-top-right {
  display: flex;
  align-items: center;
  gap: 6px;
}
.row-style .row-matchup {
  display: flex;
  align-items: center;
  gap: clamp(10px, 2.5vw, 20px);
  padding: 12px 16px 16px;
}
.row-style .row-side {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1 1 0;
  min-width: 0;
}
.row-style .row-side.home {
  flex-direction: row-reverse;
}
.row-style .row-side-text {
  min-width: 0;
}
.row-style .row-side.home .row-side-text {
  text-align: right;
}
.row-style .row-side-name {
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.row-style .row-side .rec {
  font-family: var(--font-body);
  font-size: 10.5px;
  color: var(--ink-faint);
  margin-top: 2px;
}
.row-style .row-score {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}
.row-style .row-num {
  font-family: var(--font-body);
  font-size: 24px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--ink-faint);
  min-width: 1.4em;
  text-align: center;
}
.row-style .row-num.winning {
  color: var(--ink);
}
.row-style .row-dash {
  font-size: 16px;
  color: var(--ink-faint);
}
@media (max-width: 560px) {
  /* Stack teams like a scoreboard: each score sits beside its own team. */
  .row-style .row-matchup {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    row-gap: 8px;
    column-gap: 12px;
  }
  .row-style .row-side,
  .row-style .row-side.home {
    grid-column: 1;
    flex-direction: row;
  }
  .row-style .row-side.home .row-side-text {
    text-align: left;
  }
  .row-style .row-side-name {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
  }
  .row-style .row-score {
    display: contents;
  }
  .row-style .row-dash {
    display: none;
  }
  .row-style .row-num {
    grid-column: 2;
    text-align: right;
  }
  .row-style .row-num:first-child {
    grid-row: 1;
  }
  .row-style .row-num:last-child {
    grid-row: 2;
  }
}

/* ---------- Grid layout (compact vertical card) ---------- */
.grid-style .grid-main {
  padding: 14px 16px;
}
.grid-style .grid-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  gap: 8px;
}
.grid-style .grid-top-right {
  display: flex;
  align-items: center;
  gap: 4px;
}
.team-row {
  display: grid;
  grid-template-columns: 26px 1fr auto;
  align-items: center;
  gap: 10px;
  padding-block: 5px;
}
.team-name {
  font-size: 14.5px;
}
.team-name b {
  font-weight: 600;
}
.team-name .rec {
  display: block;
  font-family: var(--font-body);
  font-size: 10.5px;
  color: var(--ink-faint);
  margin-top: 1px;
}
.score {
  font-family: var(--font-body);
  font-size: 20px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--ink-faint);
  min-width: 26px;
  text-align: right;
}
.score.winning {
  color: var(--ink);
}

/* ---------- Condensed layout ---------- */
.cond-style .cond-row {
  display: grid;
  grid-template-columns: 22px 18px 44px 28px 16px 18px 44px 28px 1fr 22px;
  align-items: center;
  gap: 7px;
  padding: 8px 10px;
  font-size: 12.5px;
}
.cond-abbr {
  font-weight: 600;
  margin-inline-start: 3px;
}
.cond-score {
  font-family: var(--font-body);
  font-variant-numeric: tabular-nums;
  color: var(--ink-faint);
  text-align: right;
  font-size: 13px;
}
.cond-score.winning {
  color: var(--ink);
  font-weight: 600;
}
.cond-at {
  color: var(--ink-faint);
  font-size: 11px;
  text-align: center;
}
.cond-status {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 8px;
}
.cond-toggle {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--ink-faint);
  cursor: pointer;
  border-radius: 5px;
}
.cond-toggle:hover {
  color: var(--ink);
  background: var(--surface-2);
}
.cond-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.cond-toggle svg {
  width: 11px;
  height: 11px;
  transition: transform 0.2s ease;
}
.mode-condensed .game-card.open .cond-toggle svg {
  transform: rotate(180deg);
}
.mode-condensed .box-toggle {
  display: none;
}

/* quarter-by-quarter table */
.qtable-scroll {
  overflow-x: auto;
}
table.qtable {
  border-collapse: collapse;
  font-family: var(--font-body);
  font-size: 12.5px;
  width: 100%;
  min-width: 380px;
}
table.qtable th {
  text-align: center;
  font-weight: 500;
  font-size: 10.5px;
  color: var(--ink-faint);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0 8px 6px;
}
table.qtable th:first-child,
table.qtable td:first-child {
  text-align: left;
}
table.qtable td {
  text-align: center;
  padding: 7px 8px;
  font-variant-numeric: tabular-nums;
  border-top: 1px solid var(--line);
}
table.qtable td.tname {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 13px;
}
table.qtable td.final {
  font-weight: 700;
  color: var(--ink);
}
table.qtable th.final {
  color: var(--ink-soft);
}

/* team stat comparison */
table.teamstat-table {
  border-collapse: collapse;
  width: 100%;
  font-size: 13px;
  max-width: 420px;
  margin: 0 auto;
}
table.teamstat-table th {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 13px;
  color: var(--ink);
  padding: 0 0 8px;
}
table.teamstat-table th.ts-val:first-child {
  text-align: left;
}
table.teamstat-table th.ts-val:last-child {
  text-align: right;
}
table.teamstat-table td {
  padding: 6px 0;
  border-top: 1px dotted var(--line);
}
table.teamstat-table tr:first-child td {
  border-top: none;
}
table.teamstat-table td.ts-val {
  width: 30%;
  font-family: var(--font-body);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--ink);
}
table.teamstat-table td.ts-val:first-child {
  text-align: left;
}
table.teamstat-table td.ts-val:last-child {
  text-align: right;
}
table.teamstat-table td.ts-label {
  text-align: center;
  font-family: var(--font-body);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--ink-faint);
}

/* ---------- Stat tables (shared: team tiles + box score) ---------- */
.stat-group + .stat-group {
  margin-top: 14px;
}
.stat-group-label {
  font-family: var(--font-body);
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 6px;
}
table.stat-table {
  border-collapse: collapse;
  width: 100%;
  font-size: 12px;
}
table.stat-table th {
  text-align: right;
  font-weight: 500;
  font-family: var(--font-body);
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--ink-faint);
  padding: 0 0 4px;
}
table.stat-table th:first-child,
table.stat-table td:first-child {
  text-align: left;
  width: 46%;
}
table.stat-table td {
  padding: 4px 0;
  border-top: 1px dotted var(--line);
  text-align: right;
  font-family: var(--font-body);
  font-variant-numeric: tabular-nums;
  color: var(--ink-soft);
}
table.stat-table tbody tr:first-child td {
  border-top: 1px solid var(--line);
}
table.stat-table td.pname {
  font-family: var(--font-body);
  font-weight: 600;
  color: var(--ink);
  text-align: left;
}

.player-state {
  padding: 12px 0;
  color: var(--ink-faint);
  font:
    11px var(--font-body);
}
.player-team + .player-team {
  margin-top: 20px;
}
.player-team-name {
  font-weight: 700;
  margin-bottom: 10px;
}
.player-team .stat-group {
  overflow-x: auto;
}
.player-team .stat-table {
  min-width: 420px;
}
.player-hint {
  display: none;
  color: var(--ink-faint);
  font:
    10px var(--font-body);
  margin-bottom: 10px;
}

.empty-state {
  padding: 32px 16px;
  text-align: center;
  color: var(--ink-faint);
  font-size: 12.5px;
  border: 1px dashed var(--line);
  border-radius: 14px;
}

/* ---------- Conference filter ---------- */
.conf-filter {
  display: flex;
  align-items: center;
  gap: 6px;
}
.conf-pill {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink-soft);
  transition:
    background 0.15s ease,
    color 0.15s ease;
}
.conf-pill:hover {
  color: var(--ink);
}
.conf-pill.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.conf-pill:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.conf-select {
  max-width: 160px;
  padding: 5px 28px 5px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-soft);
  font:
    600 11px var(--font-body);
  cursor: pointer;
}
.conf-select.active {
  border-color: var(--accent);
  color: var(--accent);
}
.conf-select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.game-card.conf-match {
  box-shadow: inset 3px 0 0 var(--accent);
}
.game-card.conf-match:hover {
  box-shadow:
    inset 3px 0 0 var(--accent),
    0 6px 18px var(--shadow);
}

.ad-slot {
  margin-top: 28px;
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.ad-slot .adsbygoogle {
  width: 100%;
}

footer {
  padding-block: 30px 44px;
  text-align: center;
  font-family: var(--font-body);
  font-size: 11px;
  color: var(--ink-faint);
}

@media (max-width: 620px) {
  .wrap { padding-inline: 12px; }
  .nav-inner { padding-block: 8px; gap: 6px; flex-wrap: nowrap; }
  .wordmark { font-size: 15px; gap: 5px; }
  .nav-right { gap: 4px; }
  .nav-right .weekpills { max-width: none; gap: 3px; }
  .nav-right .weekpill { padding: 6px; font-size: 10px; }
  .nav-right #gameDate { max-width: 112px; font-size: 10px; }
  .hero { padding-block: 14px 8px; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 6px; }
  .hero .eyebrow { grid-column: 1 / -1; margin: 0; font-size: 10px; letter-spacing: .8px; }
  .hero h1 { font-size: 22px; }
  .hero .weekpills { max-width: none; gap: 0; }
  .hero .weekpill { padding: 7px 8px; color: var(--ink-soft); }
  .hero .weekpill.active { color: var(--bg); }
  #scores { padding-block: 8px; }
  .section-head { margin-bottom: 10px; }
  .section-head h2 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .section-head .section-head-right { display: grid; grid-template-columns: auto 1fr auto; gap: 7px; }
  #freshness { grid-column: 1 / 3; font-size: 10px; letter-spacing: 0; color: var(--ink-soft); }
  #refreshScores { grid-column: 3; grid-row: 1; }
  #dataStatus { grid-column: 1; grid-row: 2; font-size: 8px; }
  .layout-switch { grid-column: 2 / 4; grid-row: 2; justify-self: end; }
  .layout-btn { padding: 7px 5px; font-size: 9px; gap: 3px; }
  .section-head-right .conf-filter { grid-column: 1 / -1; grid-row: 3; }
  .conf-pill { flex: none; }
  .grid-style.open .team-name { font-size: 14px; }
  .grid-style.open .score { font-size: 22px; }
  .games.mode-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .grid-style { min-width: 0; }
  .grid-style .grid-main { padding: 10px 8px; }
  .grid-style .grid-top { gap: 2px; align-items: flex-start; }
  .grid-style .status { font-size: 9px; letter-spacing: 0; white-space: normal; }
  .grid-style .team-row { grid-template-columns: 22px minmax(0, 1fr) auto; gap: 5px; }
  .grid-style .team-row .crest { width: 22px !important; height: 22px !important; }
  .grid-style .team-name { min-width: 0; font-size: 11px; overflow-wrap: anywhere; }
  .grid-style .team-name .rec { font-size: 9px; }
  .grid-style .score { font-size: 17px; min-width: 0; }
  .grid-style .box-toggle { padding: 10px 3px; font-size: 9px; letter-spacing: 0; }
  .grid-style .box-panel-inner { padding: 16px 12px; }
  .box-panel table.teamstat-table { max-width: none; font-size: 13px; }
  .box-panel table.teamstat-table .ts-label { width: 35%; text-align: left; font-size: 10px; color: var(--ink-soft); }
  .box-panel table.teamstat-table .ts-val { width: auto; text-align: right; }
  .box-panel table.qtable { min-width: 0; font-size: 11px; }
  .box-panel table.qtable th, .box-panel table.qtable td { padding-inline: 3px; }
  .box-panel table.qtable td.tname { font-size: 11px; gap: 4px; }
  .player-state { color: var(--ink-soft); line-height: 1.6; }
  .box-label { color: var(--ink-soft); }
  .grid-style .teamstat-table .ts-val { overflow-wrap: anywhere; }
  .cond-style .cond-row {
    grid-template-columns: 20px 16px 34px 24px 14px 16px 34px 24px 1fr 20px;
    font-size: 11.5px;
  }
  .section-head-right {
    width: 100%;
  }
  .conf-filter {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 2px;
  }
  .player-hint {
    display: block;
  }
  .detail-tabs { margin-bottom: 14px; }
  .detail-tab { padding: 7px 6px; font-size: 9.5px; letter-spacing: 0.2px; }
  .cmp-vals { font-size: 12px; }
  .cmp-label { font-size: 10px; }
  .leaders-block { margin-bottom: 16px; }
  .leader-name { font-size: 12px; }
  .leader-line { font-size: 10px; }
}
@media (max-width: 420px) {
  .cond-style .cond-row {
    grid-template-columns: 20px 16px minmax(26px, 1fr) 24px 10px 16px minmax(26px, 1fr) 24px 20px;
    gap: 4px;
  }
  .cond-status {
    grid-row: 2;
    grid-column: 2 / -1;
  }
  .cond-toggle {
    grid-row: 1;
    grid-column: 9;
  }
  .weekpills {
    max-width: 56vw;
  }
}
#gameDate {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 5px;
  background: var(--surface);
  color: var(--ink);
  font:
    11px var(--font-body);
  max-width: 135px;
}
.quality-details summary {
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  padding: 10px 0;
}
.quality-table {
  border-collapse: collapse;
  width: 100%;
  min-width: 450px;
  font-size: 11px;
}
.quality-table th,
.quality-table td {
  text-align: left;
  padding: 8px;
  border-bottom: 1px solid var(--line);
}
.quality-table small {
  display: block;
  color: var(--ink-soft);
  margin-top: 4px;
}
.quality-details .player-state {
  line-height: 1.6;
}

/* ---------- Game detail tabs (Box score / Team stats) ---------- */
.detail-tabs {
  display: flex;
  gap: 2px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 2px;
  margin-bottom: 18px;
}
.detail-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 10px;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--ink-faint);
  font-family: var(--font-body);
  font-size: 10.5px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  cursor: pointer;
}
.detail-tab:hover {
  color: var(--ink);
}
.detail-tab.active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 2px var(--shadow);
}
.detail-tab:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

/* ---------- Team stats comparison (paired bars) ---------- */
.cmp-table {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.cmp-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.cmp-vals {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 13px;
}
.cmp-val {
  min-width: 32px;
  flex: none;
}
.cmp-val.away {
  text-align: left;
}
.cmp-val.home {
  text-align: right;
}
.cmp-label {
  flex: 1;
  text-align: center;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 11px;
  color: var(--ink-soft);
}
.cmp-bar {
  display: flex;
  height: 5px;
  border-radius: 3px;
  overflow: hidden;
  background: var(--line);
}
.cmp-bar-away {
  background: var(--accent);
}
.cmp-bar-home {
  background: var(--ink-faint);
}
.cmp-table + .quality-details {
  margin-top: 18px;
}

/* ---------- Game leaders (shown above the tabs, when player data exists) ---------- */
.leaders-block {
  margin-bottom: 20px;
}
.leaders-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.leader-label {
  font-family: var(--font-body);
  font-size: 10px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--ink-faint);
  text-align: center;
  margin-bottom: 6px;
}
.leader-pair {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.leader-side {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}
.leader-side.home {
  align-items: flex-end;
  text-align: right;
}
.leader-name {
  font-weight: 600;
  font-size: 13px;
  color: var(--ink);
  overflow-wrap: anywhere;
}
.leader-line {
  font-family: var(--font-body);
  font-size: 11px;
  color: var(--ink-soft);
}

/* Mark an observed score change without moving cards or restarting the page. */
@keyframes score-update { from { background-color: rgba(34, 197, 94, .22); } to { background-color: transparent; } }
.score-updated .row-num, .score-updated .score, .score-updated .cond-score { animation: score-update 1.8s ease-out; border-radius: 4px; }
@media (prefers-reduced-motion: reduce) { .score-updated .row-num, .score-updated .score, .score-updated .cond-score { animation: none; } }

/* Scores announce meaningful changes without reading every freshness update. */
.sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }
