:root {
  --focus: #2f6fed;
  --navy: #0d1d3b;
  --navy-soft: #17305c;
  --brand: var(--navy);
  --brand-soft: var(--navy-soft);
  --heading: var(--navy);
  --ink: #122033;
  --muted: #5b6b80;
  --faint: #c5cedd;
  --line: #d7deea;
  --line-soft: #edf1f7;
  --paper: #f6f8fb;
  --card: #ffffff;
  --tint: #eef3fb;
  --tint-2: #f3f6fb;
  --chip: #e6ebf3;
  --accent: #c8102e;
  --accent-tint: #f8e6ea;
  --accent-line: #e8b4be;
  --good: #1b6b3a;
  --good-bg: #e7f6ed;
  --bad: #9b1c3a;
  --bad-bg: #fde8ec;
  --gold: #f2b705;
  --gold-tint: #fff8e1;
  --glow-1: #dfe8f7;
  --glow-2: #f3d6dc;
  --header-bg: rgba(246, 248, 251, 0.92);
  --nav-bg: rgba(255, 255, 255, 0.94);
  --shadow: 13 29 59;
  --logo-bg: #ffffff;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --focus: #8ab4ff;
  --brand: #2d5ba6;
  --brand-soft: #3a6bc0;
  --heading: #dbe6f7;
  --ink: #e2e8f1;
  --muted: #9aa9bd;
  --faint: #4b5b73;
  --line: #2a3a52;
  --line-soft: #223149;
  --paper: #0d1522;
  --card: #152032;
  --tint: #1b2a40;
  --tint-2: #182538;
  --chip: #23334b;
  --accent: #ff6b7d;
  --accent-tint: #3a1c27;
  --accent-line: #7a3445;
  --good: #7fd89d;
  --good-bg: #16331f;
  --bad: #ff9fb0;
  --bad-bg: #3b1a23;
  --gold: #f5c518;
  --gold-tint: #342c12;
  --glow-1: #14264a;
  --glow-2: #351a27;
  --header-bg: rgba(13, 21, 34, 0.9);
  --nav-bg: rgba(21, 32, 50, 0.94);
  --shadow: 0 0 0;
  /* Keep logo plates light so crests stay readable on dark UI. */
  --logo-bg: #ffffff;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0 auto;
  max-width: 1100px;
  padding: 28px 20px 64px;
  color: var(--ink);
  background:
    radial-gradient(1200px 400px at 10% -10%, var(--glow-1) 0%, transparent 60%),
    radial-gradient(900px 320px at 100% 0%, var(--glow-2) 0%, transparent 55%),
    var(--paper);
  background-repeat: no-repeat;
  font: 16px/1.45 "Titillium Web", "Trebuchet MS", "Segoe UI", sans-serif;
}

.top {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 24px;
}

.top-right {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.main-nav {
  display: flex;
  flex-wrap: nowrap;
  gap: 0;
  justify-content: flex-end;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: var(--card);
}

.main-nav a,
.main-nav a.tab {
  padding: 10px 18px;
  border-radius: 0;
  color: var(--heading);
  text-decoration: none;
  font-weight: 700;
  font-size: 15px;
  border-right: 1px solid var(--line);
}

.main-nav a:last-child {
  border-right: none;
}

.main-nav a.active,
.main-nav a:hover {
  background: var(--brand);
  color: white;
}

.sub-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 16px;
}

.sub-nav a,
.sub-nav .sub-nav-btn {
  padding: 6px 12px;
  border-radius: 8px;
  border: 0;
  background: transparent;
  color: var(--muted);
  text-decoration: none;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.sub-nav a.active,
.sub-nav a:hover,
.sub-nav .sub-nav-btn.active,
.sub-nav .sub-nav-btn:hover {
  background: var(--tint);
  color: var(--heading);
}

.brand-logo {
  flex: none;
  display: block;
  line-height: 0;
}

.brand-logo img {
  display: block;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  object-fit: contain;
  background: var(--logo-bg, transparent);
}

.top-title:has(.brand-logo.is-context) {
  align-items: flex-start;
}

.brand-logo.is-context {
  /* Sit beside the page title (below the kicker), not centered on both. */
  margin-top: calc(12px * 1.2 + 4px);
}

.brand-logo.is-context img {
  width: auto;
  height: auto;
  max-width: none;
  border: 0;
  background: transparent;
}

.site-foot {
  margin-top: 40px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.site-foot a {
  color: inherit;
}

.kicker {
  margin: 0 0 4px;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 12px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--brand);
  color: white;
  font-weight: 700;
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: none;
}

.staging-banner {
  padding: 8px 16px;
  background: var(--navy);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-align: center;
}

.staging-banner[hidden] {
  display: none;
}

.main-nav .tab.is-disabled,
.bottom-nav a.is-disabled,
a.landing-all-games.is-disabled {
  opacity: 0.45;
  pointer-events: none;
  cursor: default;
}

.tournament-list {
  display: grid;
  gap: 10px;
  margin: 0 0 20px;
}

.tournament-card {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  color: inherit;
  text-decoration: none;
}

.tournament-card:hover {
  border-color: var(--brand);
}

.tournament-card-host {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.tournament-card-name {
  color: var(--heading);
  font-size: 18px;
  font-weight: 700;
}

.tournament-card-meta {
  color: var(--muted);
  font-size: 13px;
}

.tournament-subhead {
  margin: 12px 0 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.tournament-event-name {
  margin: 4px 0 0;
  color: var(--heading);
  font-size: 22px;
  font-weight: 700;
}

.tournament-section {
  margin: 0 0 22px;
  padding: 14px 14px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
}

.tournament-section .section-title {
  margin-top: 0;
}

.tournament-section > .meta {
  margin: -4px 0 10px;
}

.tournament-seeding-note {
  margin: 0;
  color: var(--heading);
  font-size: 15px;
}

.tournament-flight-title {
  margin: 0 0 8px;
  color: var(--heading);
  font-size: 16px;
}

.tournament-pool {
  margin: 0 0 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}

.tournament-pool table {
  margin: 0;
}

.tournament-pool caption {
  caption-side: top;
  text-align: left;
  padding: 8px 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--tint-2);
  border-bottom: 1px solid var(--line-soft);
}

.tournament-teams {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 6px 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tournament-games,
.list-games {
  display: grid;
  gap: 8px;
  margin: 0 0 12px;
}

.tournament-games {
  gap: 12px;
}

.list-games .game.compact,
.tournament-games .game.compact {
  margin: 0;
}

.list-games .scoreboard,
.tournament-games .scoreboard {
  margin-top: 4px;
}

.list-games .scoreboard-ha,
.tournament-games .scoreboard-ha {
  color: var(--muted);
  opacity: 1;
}

.game.compact.is-cancelled {
  opacity: 0.72;
}

.tournament-team-cell a {
  color: inherit;
  text-decoration: none;
}

.tournament-team-cell a:hover {
  color: var(--accent);
}

@media (min-width: 721px) {
  .tournament-pool .pool-wlt-compact {
    display: none;
  }
}

/* Phone: keep long pool names inside the Team column so GP / W-L-T stay readable. */
@media (max-width: 720px) {
  .tournament-pool table {
    table-layout: fixed;
  }

  .tournament-pool th,
  .tournament-pool td {
    padding: 10px 6px;
  }

  .tournament-pool th.num,
  .tournament-pool td.num {
    width: 2.25rem;
    min-width: 2.25rem;
    white-space: nowrap;
  }

  .tournament-pool th.num:first-child,
  .tournament-pool td.num:first-child {
    width: 1.75rem;
    min-width: 1.75rem;
    padding-left: 8px;
  }

  /* W-L-T needs room for values like 10-10-10. */
  .tournament-pool th.num:nth-child(4),
  .tournament-pool td.num:nth-child(4) {
    width: 3.5rem;
    min-width: 3.5rem;
  }

  .tournament-team-cell {
    white-space: normal;
    overflow: hidden;
    min-width: 0;
  }

  .tournament-team-cell .team-with-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    max-width: 100%;
  }

  .tournament-team-cell .team-with-logo > :not(.team-logo) {
    min-width: 0;
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    white-space: normal;
    line-height: 1.2;
    font-weight: 700;
  }
}

.tournament-knockout {
  overflow: hidden;
}

.tournament-tier-block .tournament-knockout {
  margin-top: 4px;
}

.tournament-tier-subhead {
  margin: 16px 0 8px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

/* NDHSAA-style knockout board */
.bracket-board {
  display: flex;
  align-items: stretch;
  gap: 0;
  margin: 4px -4px 0;
  padding: 4px 4px 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.bracket-tiers {
  display: grid;
  gap: 22px;
}

.bracket-tier-title {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.bracket-bye-note {
  margin: 0 0 10px;
}

.bracket-consolation {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line-soft);
}

.bracket-consolation-title {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--muted);
}

.bracket-consolation-games {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.bracket-round {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  width: min(220px, 72vw);
}

.bracket-round-head {
  display: grid;
  gap: 2px;
  margin: 0 6px 12px;
  padding: 8px 10px;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  text-align: center;
}

.bracket-round-head.is-gold {
  background: #b8860b;
}

.bracket-round-head.is-bronze {
  background: #8a5a2b;
}

.bracket-round[data-kind="gold"] .bracket-round-games,
.bracket-round[data-kind="bronze"] .bracket-round-games {
  justify-content: center;
}

.bracket-round-name {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.bracket-round-sub {
  font-size: 11px;
  font-weight: 600;
  opacity: 0.9;
}

.bracket-round-games {
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: space-around;
  gap: 22px;
  padding: 0 6px;
}

.bracket-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  box-shadow: 0 1px 3px rgba(15, 30, 60, 0.08);
  overflow: hidden;
}

:root[data-theme="dark"] .bracket-card {
  background: #101a2b;
  border-color: #3a4d6a;
  box-shadow: none;
}

.bracket-card.is-gold {
  border-color: #c9a227;
  box-shadow: 0 0 0 1px color-mix(in srgb, #c9a227 55%, transparent);
}

.bracket-card.is-bronze {
  border-color: #a67c52;
  box-shadow: 0 0 0 1px color-mix(in srgb, #a67c52 45%, transparent);
}

.bracket-card-meta {
  padding: 6px 10px 2px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.3;
}

.bracket-card-body {
  display: grid;
  color: inherit;
  text-decoration: none;
}

a.bracket-card-body:hover .bracket-name {
  color: var(--accent);
}

.bracket-card-row {
  display: grid;
  grid-template-columns: 1.75rem minmax(0, 1fr) auto 2.25rem;
  gap: 6px 8px;
  align-items: center;
  min-height: 40px;
  padding: 6px 8px 6px 10px;
  border-top: 1px solid var(--line-soft);
  font-size: 13px;
}

.bracket-ha {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.bracket-card-row:first-of-type {
  border-top: 0;
}

.bracket-card-row:not(.is-winner):not(:only-child) .bracket-name {
  color: var(--muted);
  font-weight: 600;
}

.bracket-card-row.is-winner {
  background: color-mix(in srgb, var(--tint) 70%, transparent);
}

.bracket-card-row.is-winner .bracket-name {
  font-weight: 800;
  color: var(--heading);
}

.bracket-seed {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.bracket-seed-empty {
  visibility: hidden;
}

.bracket-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
}

/* High-contrast score chips (ESPN/NCAA style) — never light-on-light in dark mode */
.bracket-score {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  justify-self: end;
  min-width: 2.1rem;
  height: 2.1rem;
  border-radius: 6px;
  background: #0f1c2e;
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

:root[data-theme="dark"] .bracket-score {
  background: #f4f7fc;
  color: #0b1220;
}

.bracket-card-row.is-winner .bracket-score {
  background: var(--accent);
  color: #fff;
}

:root[data-theme="dark"] .bracket-card-row.is-winner .bracket-score {
  background: var(--accent);
  color: #fff;
}

.bracket-card-row:not(.is-winner) .bracket-score {
  opacity: 0.72;
}

.bracket-score.is-empty {
  background: transparent;
  opacity: 0;
}

.bracket-card-result {
  padding: 6px 10px 8px;
  border-top: 1px solid var(--line-soft);
  background: color-mix(in srgb, var(--tint-2) 80%, transparent);
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.bracket-card-result b {
  color: var(--heading);
  font-variant-numeric: tabular-nums;
}

.bracket-joins {
  position: relative;
  flex: 0 0 36px;
  width: 36px;
  align-self: stretch;
  margin-top: 52px; /* below round headers */
}

.bracket-join {
  position: absolute;
  top: calc(var(--a) * 100%);
  height: calc((var(--b) - var(--a)) * 100%);
  width: 14px;
  box-sizing: border-box;
}

.bracket-joins.is-right .bracket-join {
  left: 10px;
  border-top: 2px solid #1a1a1a;
  border-right: 2px solid #1a1a1a;
  border-bottom: 2px solid #1a1a1a;
}

.bracket-joins.is-left .bracket-join {
  right: 10px;
  border-top: 2px solid #1a1a1a;
  border-left: 2px solid #1a1a1a;
  border-bottom: 2px solid #1a1a1a;
}

:root[data-theme="dark"] .bracket-joins.is-right .bracket-join,
:root[data-theme="dark"] .bracket-joins.is-left .bracket-join {
  border-color: var(--heading);
}

.bracket-joins.is-right .bracket-join::after,
.bracket-joins.is-left .bracket-join::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 12px;
  border-top: 2px solid #1a1a1a;
  transform: translateY(-1px);
}

.bracket-joins.is-right .bracket-join::after {
  left: 14px;
}

.bracket-joins.is-left .bracket-join::after {
  right: 14px;
}

:root[data-theme="dark"] .bracket-joins.is-right .bracket-join::after,
:root[data-theme="dark"] .bracket-joins.is-left .bracket-join::after {
  border-color: var(--heading);
}

.tournament-stats {
  margin-bottom: 8px;
}

.tournament-leader-table {
  margin: 0 0 16px;
}

.tournament-leader-table .data-table {
  margin-top: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: var(--card);
}

.tournament-leader-table .stnd {
  margin-top: 4px;
}

.tournament-leader-table .data-table table {
  margin: 0;
}

.tournament-leader-table .data-table thead th {
  background: var(--tint-2);
  border-bottom: 1px solid var(--line);
}

.tournament-leader-table .table-footnote,
.table-footnote {
  margin: 6px 2px 0;
  font-size: 12px;
}

.tournament-leader-table .team-with-logo,
.tournament-leader-table .ct-sub .team-with-logo {
  max-width: 100%;
  min-width: 0;
}

/* The association shrinks. The age and tier stay in the cell at every width. */
.tournament-leader-table .team-name,
.tournament-leader-table .ct-sub .team-name {
  display: flex;
  align-items: baseline;
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: clip;
}

.tournament-leader-table .team-name-assoc {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tournament-leader-table .team-name-gap,
.tournament-leader-table .team-name-tail {
  flex: 0 0 auto;
  white-space: pre;
}

@media (max-width: 720px) {
  .tournament-leader-table,
  .tournament-leader-table .data-table,
  .tournament-leader-table .stnd {
    max-width: 100%;
  }
}

:root[data-theme="dark"] .staging-banner {
  background: #3a6bc0;
}

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

#main:focus,
#page-title:focus {
  outline: none;
}

.th-sort,
.ct-toggle {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: inherit;
  text-transform: inherit;
  letter-spacing: inherit;
  cursor: pointer;
}

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

h1 {
  margin: 0;
  color: var(--heading);
  font-size: 42px;
  letter-spacing: -0.03em;
}

.page-title-line {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
}

.page-title-line > h1 {
  min-width: 0;
}

/* First item on the title line. 9px centers the 42px star on the heading's first line. */
.page-title-line > .page-title-fav {
  flex: none;
  margin-top: 9px;
}

h2 {
  margin: 0 0 8px;
  color: var(--heading);
  font-size: 28px;
}

.source {
  color: var(--heading);
  font-size: 14px;
}

.top-links {
  display: flex;
  align-items: center;
  gap: 10px;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 34px;
  padding: 0 12px 0 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--heading);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.theme-label {
  min-width: 2.6em;
  text-align: left;
}

.theme-toggle svg {
  display: none;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.theme-toggle .icon-auto path,
.theme-toggle .icon-dark path {
  fill: currentColor;
}

.theme-toggle[data-choice="auto"] .icon-auto,
.theme-toggle[data-choice="light"] .icon-light,
.theme-toggle[data-choice="dark"] .icon-dark {
  display: block;
}

.filters {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

/* Author `display:grid` otherwise overrides the HTML hidden attribute. */
.filters[hidden],
form.filters[hidden] {
  display: none !important;
}

.schedule-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 0;
}

.league-picker {
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.league-picker summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--heading);
  padding: 8px 0;
}

.schedule-list button {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--heading);
  border-radius: 10px;
  padding: 8px 12px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
}

.schedule-list button:hover,
.schedule-list button.active {
  background: var(--brand);
  border-color: var(--brand);
  color: white;
}

.search-form {
  align-items: end;
}

.search-form .grow {
  grid-column: span 2;
}

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

select,
input[type="date"],
input[type="search"],
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
.btn {
  width: 100%;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  color: var(--ink);
  font: inherit;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
}

.btn {
  background: var(--brand);
  color: white;
  border-color: var(--brand);
  cursor: pointer;
  font-weight: 700;
}

.status {
  color: var(--muted);
  margin: 0 0 16px;
}

.status[data-loading="hidden"] {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skeleton {
  display: grid;
  gap: 12px;
}

.sk {
  display: block;
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--line) 25%, color-mix(in srgb, var(--line) 45%, var(--card)) 50%, var(--line) 75%);
  background-size: 300% 100%;
  animation: sk-shimmer 1.4s ease-in-out infinite;
}

@keyframes sk-shimmer {
  from {
    background-position: 100% 0;
  }
  to {
    background-position: 0 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sk {
    animation: none;
  }
}

.sk-card,
.sk-table {
  display: grid;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
}

.sk-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sk-logo {
  flex: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
}

.sk-logo-lg {
  width: 44px;
  height: 44px;
}

.sk-header {
  padding: 4px 0 12px;
}

.sk-head {
  height: 10px;
  width: 100%;
  opacity: 0.6;
}

.sk-num {
  flex: none;
  width: 24px;
}

.sk-score {
  flex: none;
  width: 22px;
  margin-left: auto;
}

.sk-grow {
  flex: 1;
}

.sk-w30 {
  width: 30%;
}

.sk-w40 {
  width: 40%;
}

.sk-w50 {
  width: 50%;
}

.sk-thin {
  height: 8px;
}

.sk-tall {
  height: 18px;
}

.games {
  display: grid;
  gap: 12px;
}

.game {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px 24px;
  padding: 16px 18px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.game.compact {
  padding: 12px 14px;
}

.meta {
  color: var(--muted);
  font-size: 13px;
}

.title {
  margin: 4px 0 6px;
  font-size: 18px;
  font-weight: 700;
}

.team-with-logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: inherit;
  text-decoration: none;
  min-width: 0;
}

.team-with-logo:hover .team-name {
  color: var(--accent);
  text-decoration: underline;
}

.team-name {
  min-width: 0;
}

.team-logo {
  flex: 0 0 auto;
  object-fit: contain;
  background: var(--logo-bg);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.team-logo-sm {
  width: 22px;
  height: 22px;
}

.team-logo-md {
  width: 28px;
  height: 28px;
}

.team-logo-lg {
  width: 44px;
  height: 44px;
}

.team-logo-xl {
  width: 72px;
  height: 72px;
  border-radius: 12px;
}

.team-logo-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--tint);
  color: var(--heading);
  font-weight: 700;
  font-size: 12px;
}

.team-logo-lg.team-logo-fallback {
  font-size: 18px;
}

.team-logo-xl.team-logo-fallback {
  font-size: 28px;
}

.team-heading,
.title.matchup {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.title.matchup {
  gap: 10px;
  font-size: 18px;
}

.title.matchup .at {
  color: var(--muted);
  font-weight: 600;
}

.recap-scoreboard {
  display: grid;
  gap: 10px;
  max-width: 560px;
}

.recap-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
}

.recap-pts {
  font-variant-numeric: tabular-nums;
  color: var(--heading);
  font-size: 30px;
  font-weight: 700;
  min-width: 1.4em;
  text-align: right;
}

.recap-row.is-loser .recap-pts {
  color: var(--muted);
}

td .team-with-logo {
  max-width: 320px;
}

td .team-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.title a,
.detail-header a:not(.sheet),
.table-wrap a,
.result strong {
  color: var(--heading);
  text-decoration: none;
}

.title a:hover,
.table-wrap a:hover,
.result:hover strong {
  color: var(--accent);
  text-decoration: underline;
}

.venue {
  color: var(--ink);
}

.score {
  font-variant-numeric: tabular-nums;
  color: var(--heading);
  font-weight: 700;
}

.scoreboard {
  display: grid;
  gap: 3px;
  margin-top: 6px;
  min-width: 0;
  font-variant-numeric: tabular-nums;
}

.scoreboard-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 6px 12px;
  align-items: center;
}

.scoreboard-compact.scoreboard .scoreboard-row {
  grid-template-columns: auto auto auto;
  justify-content: end;
}

.scoreboard-team {
  min-width: 0;
}

.scoreboard-team .team-with-logo {
  max-width: 100%;
}

.scoreboard-team .team-name {
  font-weight: 700;
  font-size: 15px;
  color: var(--ink);
}

.scoreboard-ha {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.scoreboard-pts {
  font-weight: 800;
  font-size: 16px;
  color: var(--heading);
  text-align: right;
  min-width: 1.6ch;
}

.team-with-logo.is-self .team-name,
.scoreboard-row.is-self .scoreboard-team .team-name {
  color: var(--accent);
}

.game.compact .scoreboard {
  margin-top: 4px;
}

.favorite-game .scoreboard,
.my-team-game .scoreboard {
  margin: 6px 0 4px;
}

.side .scoreboard {
  margin-top: 0;
  margin-bottom: 6px;
}

.officials {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--tint);
  color: var(--heading);
  font-size: 13px;
}

.chip.none {
  background: var(--tint-2);
  color: var(--muted);
}

.chip .pos {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.chip.need {
  background: var(--bad-bg);
  color: var(--bad);
}

.chip.mine {
  background: var(--good-bg);
  color: var(--good);
}

.chip.pay {
  background: var(--good-bg);
  color: var(--good);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.chip.open-slot {
  background: var(--bad-bg);
  color: var(--bad);
  font-weight: 700;
}

.field-hint {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
}

@media (max-width: 720px) {
  .filters .grow {
    grid-column: span 1;
  }
}

.side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.sheet {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--brand);
  color: white;
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
}

.sheet.ghost {
  background: transparent;
  color: var(--heading);
  border: 1px solid var(--line);
}

.sheet:hover {
  background: var(--brand-soft);
  color: white;
}

.update-banner {
  position: fixed;
  left: 50%;
  bottom: 20px;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: calc(100vw - 24px);
  padding: 8px 8px 8px 16px;
  border-radius: 999px;
  background: var(--brand);
  color: white;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 8px 24px rgb(0 0 0 / 25%);
  transform: translateX(-50%);
}

.update-banner[hidden] {
  display: none;
}

.update-banner button {
  flex: none;
  padding: 7px 14px;
  border: 0;
  border-radius: 999px;
  background: white;
  color: var(--brand);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

@media (max-width: 720px) {
  .update-banner {
    bottom: calc(74px + env(safe-area-inset-bottom));
    width: max-content;
  }
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--heading);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.share-btn svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.team-heading-row .share-btn {
  margin-left: auto;
  flex: none;
}

.pager {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin-top: 20px;
}

.pager button {
  min-width: 40px;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  color: var(--heading);
  cursor: pointer;
  font: inherit;
  font-weight: 600;
}

.pager button[disabled] {
  opacity: 0.4;
  cursor: default;
}

.pager .current {
  background: var(--brand);
  color: white;
  border-color: var(--brand);
}

.pager-ellipsis {
  min-width: 28px;
  text-align: center;
  color: var(--muted);
  font-weight: 700;
}

.list-toolbar {
  display: flex;
  justify-content: flex-end;
  margin: 4px 0 12px;
}

.page-size {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
}

.page-size select {
  min-width: 72px;
}

.section-title {
  margin: 28px 0 12px;
  font-size: 20px;
  color: var(--heading);
}

.section-heading-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  margin: 28px 0 12px;
}

.section-heading-row .section-title {
  margin: 0;
}

.fold {
  margin: 16px 0 8px;
  border: 0;
}

.fold-summary {
  list-style: none;
  cursor: pointer;
  user-select: none;
  padding: 4px 0;
}

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

.fold-summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.fold-summary-row::before {
  content: "";
  width: 0.45em;
  height: 0.45em;
  margin-right: 0.15em;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(-45deg);
  transition: transform 0.15s ease;
  flex: 0 0 auto;
}

.fold[open] > .fold-summary .fold-summary-row::before {
  transform: rotate(45deg);
}

.fold-summary .section-title,
.fold-summary .favorites-section-title {
  margin: 0;
  flex: 1 1 auto;
}

/* Same weight as the This week h2.favorites-section-title (user-agent bold). */
.fold-summary h2.favorites-section-title {
  font-weight: 700;
}

.fold-summary .stnd-open,
.fold-summary .btn-export {
  flex: 0 0 auto;
}

.fold-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 2px 12px;
  flex: 0 1 auto;
}

/* Toolbar beside the fold title, outside <details> so it stays visible when collapsed
   without nesting links/buttons in <summary> (nested-interactive).
   The open fold (table body included) must span the full shell width — otherwise the
   auto toolbar column squeezes the table on phones and team names collapse to 0px. */
.fold-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 12px;
  align-items: start;
  margin: 16px 0 8px;
}

.fold-shell > .fold {
  grid-column: 1 / -1;
  grid-row: 1;
  margin: 0;
  min-width: 0;
}

.fold-shell > .fold-toolbar {
  grid-column: 2;
  grid-row: 1;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 4px 10px;
  padding: 4px 0;
  justify-self: end;
  align-self: start;
}

/* Wide layouts: toolbar overlays column 2 beside the summary — keep title clear. */
.fold-shell > .fold > .fold-summary .fold-summary-row {
  padding-right: max(8px, 9rem);
}

/* Narrow (≤520px): no overlay / no 9rem reserve — toolbar on its own row under the
   summary, right-aligned. display:contents puts summary → toolbar → body in order. */
@media (max-width: 520px) {
  .fold-shell {
    grid-template-columns: minmax(0, 1fr);
    column-gap: 0;
  }

  .fold-shell > .fold {
    display: contents;
  }

  .fold-shell > .fold > .fold-summary {
    grid-column: 1;
    grid-row: 1;
  }

  .fold-shell > .fold-toolbar {
    grid-column: 1;
    grid-row: 2;
    justify-self: end;
    align-self: start;
    z-index: auto;
  }

  .fold-shell > .fold > .fold-summary .fold-summary-row {
    padding-right: 0;
  }
}

.fold-body {
  margin-top: 8px;
}

.fold > .meta {
  margin: 4px 0 0;
}

.fold-subhead {
  margin: 12px 0 6px;
  color: var(--heading);
  font-size: 14px;
}

.btn-export {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--heading);
  font: inherit;
  font-weight: 700;
  font-size: 13px;
  padding: 8px 14px;
  border-radius: 10px;
  cursor: pointer;
}

.btn-export:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.detail-header {
  margin-bottom: 8px;
}

[data-colored] {
  --team-shown: var(--team);
  --away-shown: var(--away, var(--line));
  --home-shown: var(--home, var(--line));
}

@supports (color: oklch(from red l c h)) {
  :root[data-theme="dark"] [data-colored] {
    --team-shown: oklch(from var(--team) max(l, 0.55) c h);
    --away-shown: oklch(from var(--away, var(--line)) max(l, 0.55) c h);
    --home-shown: oklch(from var(--home, var(--line)) max(l, 0.55) c h);
  }
}

#team-header[data-colored] {
  padding: 12px 16px 12px 18px;
  border: 1px solid var(--line);
  border-left: 6px solid var(--team-shown);
  border-radius: 14px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--team-shown) 16%, var(--card)), var(--card) 75%);
}

#game-header[data-colored] {
  position: relative;
  overflow: hidden;
  padding: 16px 16px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
}

#game-header[data-colored]::before,
.game[data-colored]::before {
  content: "";
  position: absolute;
  background: linear-gradient(90deg, var(--away-shown) 50%, var(--home-shown) 50%);
}

#game-header[data-colored]::before {
  inset: 0 0 auto;
  height: 5px;
}

.game[data-colored] {
  position: relative;
  overflow: hidden;
}

.game[data-colored]::before {
  inset: 0 auto 0 0;
  width: 5px;
  background: linear-gradient(180deg, var(--away-shown) 50%, var(--home-shown) 50%);
}

/* Shared schedule / This week card. One scoreboard everywhere. */
.game.game-card {
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  min-width: 0;
  padding: 12px 14px 12px 18px;
  border-radius: 18px;
  box-shadow:
    0 1px 2px rgb(var(--shadow) / 0.05),
    0 8px 22px rgb(var(--shadow) / 0.07);
}

:root[data-theme="dark"] .game.game-card {
  box-shadow:
    0 1px 0 rgb(255 255 255 / 0.04),
    0 10px 28px rgb(0 0 0 / 0.32);
}

.game-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px 12px;
  min-width: 0;
}

.game-card .meta {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  font-size: 12px;
  line-height: 1.35;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  margin-left: auto;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1.2;
  white-space: nowrap;
}

.status-chip.is-live {
  background: var(--accent-tint);
  color: var(--accent);
  letter-spacing: 0.08em;
}

.status-chip.is-live .live-clock {
  color: var(--heading);
  font-weight: 700;
  letter-spacing: 0;
}

.status-chip.is-final {
  gap: 0;
  background: var(--tint);
  color: var(--muted);
  letter-spacing: 0.01em;
  font-weight: 700;
}

.status-chip.is-final .status-extra {
  color: var(--heading);
  font-weight: 800;
}

.status-chip.is-upcoming {
  background: var(--tint);
  color: var(--heading);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 60%, transparent);
  animation: live-dot-pulse 1.6s ease-out infinite;
}

@keyframes live-dot-pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 55%, transparent); }
  70% { box-shadow: 0 0 0 7px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

.game-card .scoreboard {
  grid-template-columns: minmax(0, 1fr);
  gap: 2px;
  margin: 2px 0 0;
}

.game-card .scoreboard-row {
  grid-template-columns: minmax(0, 1fr) 3.4em 2.8ch;
  gap: 6px 10px;
  align-items: center;
  padding: 3px 0;
}

.game-card .scoreboard-team .team-with-logo {
  align-items: center;
}

.game-card .team-logo-md {
  width: 34px;
  height: 34px;
}

.game-card .scoreboard-team .team-name {
  font-size: 16px;
  line-height: 1.25;
  white-space: normal;
  overflow-wrap: anywhere;
}

.game-card .scoreboard-ha {
  justify-self: end;
  text-align: right;
}

.game-card .scoreboard-pts {
  justify-self: end;
  font-size: 30px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
}

.game-card .scoreboard-row.is-leading .scoreboard-pts {
  color: var(--heading);
}

.game-card .scoreboard-row.is-trailing .scoreboard-pts {
  color: var(--muted);
  font-weight: 600;
}

.game-card .scoreboard-row.is-unplayed .scoreboard-pts {
  color: var(--muted);
  font-weight: 600;
  font-size: 22px;
}

.game-card .venue {
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.35;
}

.game-card .venue a {
  color: inherit;
  text-decoration: none;
}

.game-card .venue a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.game-card .officials {
  display: block;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.45;
}

.game-card .game-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.game-card .game-actions .sheet {
  min-height: 30px;
  padding: 4px 11px;
  font-size: 12px;
  line-height: 1.2;
}

.game-card .game-actions a.sheet.is-live {
  background: #c8102e;
  border-color: transparent;
  color: #fff;
}

.game-card .game-actions a.sheet.is-live .live-badge {
  background: transparent;
  color: inherit;
  padding: 0;
  animation: none;
  letter-spacing: 0.06em;
}

.game-card .game-actions a.sheet.is-live:hover {
  background: #a50d26;
  color: #fff;
}

.game-card .game-actions .sheet.ghost:hover {
  background: var(--tint);
  color: var(--heading);
  border-color: var(--faint);
}

@media (hover: hover) and (pointer: fine) {
  .game-card {
    transition: transform 160ms ease, box-shadow 160ms ease;
  }

  .game-card:hover {
    transform: translateY(-2px);
    box-shadow:
      0 2px 4px rgb(var(--shadow) / 0.06),
      0 14px 32px rgb(var(--shadow) / 0.12);
  }

  :root[data-theme="dark"] .game-card:hover {
    box-shadow:
      0 1px 0 rgb(255 255 255 / 0.05),
      0 16px 36px rgb(0 0 0 / 0.42);
  }
}

@media (prefers-reduced-motion: reduce) {
  .live-dot,
  .game-card,
  .game-card:hover {
    animation: none;
    transition: none;
    transform: none;
  }
}

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  overscroll-behavior-x: contain;
}

.data-table {
  min-width: 100%;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

th,
td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

th {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
  background: var(--tint);
  position: sticky;
  top: 0;
  z-index: 1;
}

th.num,
td.num {
  text-align: right;
}

tr.clickable {
  cursor: pointer;
}

tr.clickable:hover {
  background: var(--tint-2);
}

.card-label {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-right: 6px;
}

.tag {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 6px;
  border-radius: 6px;
  background: var(--accent-tint);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
}

.live-badge {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 4px;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  vertical-align: middle;
  animation: live-pulse 2.4s ease-in-out infinite;
}

.live-badge-lg {
  font-size: 12px;
  padding: 2px 8px;
}

.unofficial-badge {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 4px;
  background: var(--warn-tint, rgba(180, 120, 0, 0.15));
  color: var(--warn, #9a6700);
  font-size: 11px;
  font-weight: 600;
  vertical-align: middle;
}

.live-clock {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--heading);
}

.live-scoreline {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

a.sheet.is-live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
}

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

@media (prefers-reduced-motion: reduce) {
  .live-badge {
    animation: none;
  }
}

.leaders-grid {
  display: grid;
  gap: 8px;
}

.leader-board .table-wrap {
  margin-bottom: 8px;
}

.splits {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin: 12px 0 8px;
}

.split {
  padding: 14px 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.search-results {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.result-list {
  display: grid;
  gap: 8px;
}

.result {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
}

.result.result-with-fav {
  flex-direction: row;
  align-items: center;
  gap: 10px;
}

.result.result-with-fav > a,
.result.result-with-fav > .result-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
  text-decoration: none;
  color: inherit;
}

.result.result-with-fav > a.team-result {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 12px;
}

.result-schedules {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px;
}

.result .sched-tag {
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--tint);
  color: var(--heading);
  font-size: 12px;
  white-space: nowrap;
}

.result-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  color: var(--muted);
  font-size: 13px;
}

.result-meta .team-name {
  font-size: 13px;
  font-weight: 600;
}

.result span {
  color: var(--muted);
  font-size: 13px;
}

.vs-prefix {
  color: var(--muted);
  font-weight: 600;
  font-size: 12px;
  margin-right: 2px;
}

.section-title .team-with-logo {
  display: inline-flex;
  vertical-align: middle;
}

.section-title .scoreboard-ha {
  margin-left: 6px;
  vertical-align: middle;
}

.lineups-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.team-staff {
  margin-top: 12px;
  padding: 10px 12px;
  background: var(--tint);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
}

.team-staff-title {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.team-staff-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 4px;
}

.team-staff-list li {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  font-size: 14px;
  line-height: 1.35;
}

.team-staff-role {
  color: var(--muted);
  min-width: 7.5rem;
}

.team-staff-name {
  font-weight: 600;
  color: var(--ink);
}

.team-staff-games {
  font-size: 12px;
}

.recap-officials {
  margin: 0 0 8px;
}

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

.follow-btn {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--faint);
  width: 34px;
  height: 34px;
  border-radius: 10px;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  flex: 0 0 auto;
  padding: 0;
}

.follow-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.follow-btn.on {
  background: var(--accent-tint);
  border-color: var(--accent-line);
  color: var(--accent);
}

.follow-btn.lg {
  width: 42px;
  height: 42px;
  font-size: 20px;
}

td.follow-cell,
th.follow-cell {
  width: 44px;
  padding-left: 8px;
  padding-right: 4px;
}

.team-heading-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.my-teams-list,
.favorites-list {
  display: grid;
  gap: 14px;
}

.favorites-grid {
  display: grid;
  gap: 14px;
  margin-bottom: 22px;
}

.favorites-section-title {
  margin: 8px 0 10px;
  font-size: 18px;
  color: var(--heading);
}

.tournament-follow-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.tournament-follow-head .favorites-section-title {
  min-width: 0;
}

.tournament-follow-head .favorites-section-title a {
  color: inherit;
  text-decoration: none;
}

.tournament-follow-head .favorites-section-title a:hover {
  color: var(--accent);
}

.my-team-card,
.favorite-card {
  display: grid;
  gap: 14px;
  padding: 16px 18px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.my-team-card-top,
.favorite-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.my-team-card-top .team-with-logo,
.favorite-card-top .team-with-logo {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--heading);
}

.favorite-player-name {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--heading);
  text-decoration: none;
}

.favorite-player-name:hover {
  color: var(--accent);
  text-decoration: underline;
}

.my-team-meta,
.favorite-meta {
  color: var(--muted);
  font-size: 14px;
}

.my-team-games,
.favorite-games {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
}

.my-team-game,
.favorite-game {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--tint-2);
}

.my-team-game .label,
.favorite-game .label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  font-weight: 700;
  margin-bottom: 4px;
}

.my-team-game .score,
.favorite-game .score {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--heading);
}

.home-card[data-colored] {
  border-left: 6px solid var(--team-shown);
}

.home-card .favorite-meta b {
  color: var(--heading);
}

.home-games {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
}

.home-next,
.home-recent {
  display: grid;
  align-content: start;
  gap: 6px;
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--tint-2);
}

.home-recent {
  gap: 12px;
}

.home-last {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.home-card .label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  font-weight: 700;
}

.home-next-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.countdown {
  flex: none;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--accent-tint);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

a.countdown.is-live,
a.status-chip.is-live {
  text-decoration: none;
  color: inherit;
}

/* Square 44×44 ::before hit slab; visible pill uses .countdown on the inner span only. */
.home-next-head a.home-live-link {
  position: relative;
  display: inline;
  padding: 0;
  margin: -1px 0;
  border: none;
  border-radius: 0;
  background: transparent;
  text-decoration: none;
  vertical-align: baseline;
}

.home-next-head a.home-live-link::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 44px;
  height: 44px;
  transform: translate(-50%, -50%);
  border-radius: 0;
}

.home-next-head a.home-live-link.is-live:hover .live-pill-surface {
  background: color-mix(in srgb, var(--accent) 18%, var(--accent-tint));
}

a.countdown.is-live:focus-visible,
a.home-live-link.is-live:focus-visible,
a.status-chip.is-live:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.home-when {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--heading);
}

.home-opp {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.home-opp .team-with-logo {
  min-width: 0;
}

.home-opp .team-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-vs {
  flex: none;
  color: var(--muted);
  font-weight: 600;
}

.home-arena,
.game-venue,
.arena-address {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 6px;
  min-height: 24px;
  margin: 0;
  color: var(--heading);
  font-size: 14px;
}

.home-arena svg,
.game-venue svg,
.arena-address svg {
  flex: none;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
}

.venue-link {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--faint);
  text-underline-offset: 2px;
}

.venue-link:hover {
  color: var(--accent);
  text-decoration-color: currentColor;
}

.home-directions {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.game-venue {
  margin: 2px 0 8px;
}

.arena-filter input {
  width: 100%;
  max-width: 420px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  color: var(--ink);
  font: inherit;
}

.arenas-list,
.arena-games {
  display: grid;
  margin: 0 0 18px;
  padding: 0;
  list-style: none;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.arena-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "name busy"
    "meta busy";
  column-gap: 12px;
  padding: 10px 14px;
  color: var(--ink);
  text-decoration: none;
}

.arena-row + .arena-row,
.arena-game + .arena-game {
  border-top: 1px solid var(--line-soft);
}

.arena-row:hover .arena-row-name {
  color: var(--accent);
  text-decoration: underline;
}

.arena-row-name {
  grid-area: name;
  font-weight: 700;
  color: var(--heading);
}

.arena-row-meta {
  grid-area: meta;
  color: var(--muted);
  font-size: 13px;
}

.arena-row-busy {
  grid-area: busy;
  align-self: center;
  color: var(--muted);
  font-size: 13px;
  text-align: right;
}

.arena-rinks {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.arena-day-head {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
}

.arena-day-head .section-title {
  text-align: center;
}

.arena-day-nav {
  min-height: 24px;
  color: var(--heading);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

.arena-day-nav[rel="next"] {
  justify-self: end;
}

.arena-day-nav:hover {
  color: var(--accent);
  text-decoration: underline;
}

.arena-game {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr) auto;
  grid-template-areas:
    "when teams outcome"
    "when league outcome";
  align-items: center;
  column-gap: 12px;
  row-gap: 2px;
  padding: 10px 14px;
}

.arena-game.is-final {
  grid-template-columns: 84px minmax(0, 1fr);
  grid-template-areas:
    "when board"
    "when league";
  align-items: start;
}

.arena-game-board {
  grid-area: board;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.arena-game-board .scoreboard {
  margin: 0;
}

.arena-game-board:hover .scoreboard-pts {
  text-decoration: underline;
}

.arena-game.is-cancelled .arena-game-teams {
  opacity: 0.6;
  text-decoration: line-through;
}

.arena-game-when {
  grid-area: when;
  display: grid;
  color: var(--muted);
  font-size: 13px;
}

.arena-game-when b {
  color: var(--heading);
}

.arena-game-teams {
  grid-area: teams;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  min-width: 0;
  font-weight: 600;
}

.arena-game-home {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.arena-game-league {
  grid-area: league;
  color: var(--muted);
  font-size: 13px;
}

.arena-game-outcome {
  grid-area: outcome;
}

.arena-score {
  color: var(--heading);
  font-size: 1.05rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  text-decoration: none;
}

.arena-score:hover {
  text-decoration: underline;
}

.arena-cancelled {
  color: var(--bad);
  font-size: 13px;
  font-weight: 700;
}

.arena-home-teams {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 8px;
}

.arena-home-team {
  display: grid;
  gap: 2px;
  padding: 8px 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.arena-home-team small {
  color: var(--muted);
}

@media (max-width: 720px) {
  .arena-game {
    grid-template-columns: 64px minmax(0, 1fr) auto;
    padding: 10px 12px;
  }

  .arena-game.is-final {
    grid-template-columns: 64px minmax(0, 1fr);
  }

  .arena-game-teams {
    flex-direction: column;
    align-items: flex-start;
  }
}

.association-row .arena-row-name {
  grid-row: 1 / 3;
  align-self: center;
}

.team-association {
  font-weight: 700;
  color: var(--heading);
  text-decoration: none;
}

.team-association:hover {
  color: var(--accent);
  text-decoration: underline;
}

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

.team-association-line {
  margin: 0;
  font-size: 16px;
  line-height: 1.3;
}

.team-association-line .team-association::after {
  content: " ›";
  color: var(--muted);
  font-weight: 600;
  color: var(--heading);
  text-decoration: none;
}

.team-association:hover {
  color: var(--accent);
  text-decoration: underline;
}

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

.team-association-line {
  margin: 0;
  font-size: 16px;
  line-height: 1.3;
}

.team-association-line .team-association::after {
  content: " ›";
  color: var(--muted);
  font-weight: 600;
}

.search-associations {
  grid-column: 1 / -1;
}

.assoc-season {
  display: inline;
}

.assoc-season select {
  width: auto;
  min-height: 0;
  margin-left: 2px;
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
}

#association-teams .section-title small {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.assoc-teams {
  display: grid;
  margin: 0 0 18px;
  padding: 0;
  list-style: none;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.assoc-team {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "name links"
    "meta record";
  align-items: center;
  column-gap: 12px;
  row-gap: 2px;
  padding: 10px 14px;
}

.assoc-team + .assoc-team {
  border-top: 1px solid var(--line-soft);
}

.assoc-team > .team-with-logo {
  grid-area: name;
  min-width: 0;
  font-weight: 700;
}

.assoc-team-meta {
  grid-area: meta;
  color: var(--muted);
  font-size: 13px;
}

.assoc-team-record {
  grid-area: record;
  color: var(--heading);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.assoc-team-links {
  grid-area: links;
  display: flex;
  gap: 4px;
  justify-content: flex-end;
}

.assoc-team-links a {
  padding: 3px 8px;
  border-radius: 6px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}

.assoc-team-links a:hover {
  background: var(--tint);
}

.assoc-day {
  margin: 12px 0 6px;
  color: var(--heading);
  font-size: 14px;
}

.assoc-results {
  display: grid;
  gap: 8px;
  margin: 0 0 8px;
}

.assoc-results .game.compact {
  margin: 0;
}

.assoc-leaders {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 12px;
  margin: 0 0 18px;
}

.assoc-tier-tabs {
  margin-top: -6px;
}

.assoc-leaders-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin: 0 0 18px;
}

.assoc-leaders-grid .leader-board .section-title {
  margin: 0 0 6px;
  font-size: 16px;
}

.assoc-leader-card {
  padding: 12px 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.assoc-leader-card h3,
.assoc-leader-card h4 {
  margin: 0 0 6px;
  color: var(--heading);
}

.assoc-leader-card h4 {
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

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

.assoc-leader-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "name stat"
    "team detail";
  column-gap: 10px;
}

.assoc-leader-name,
.assoc-leader-team {
  line-height: 24px;
}

.assoc-leader-name {
  grid-area: name;
  color: var(--heading);
  font-weight: 700;
  text-decoration: none;
}

.assoc-leader-team {
  grid-area: team;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.assoc-leader-name:hover,
.assoc-leader-team:hover {
  color: var(--accent);
  text-decoration: underline;
}

.assoc-leader-stat {
  grid-area: stat;
  color: var(--heading);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.assoc-leader-detail {
  grid-area: detail;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.assoc-arena {
  color: inherit;
  text-decoration: none;
}

.assoc-arena:hover b {
  color: var(--accent);
  text-decoration: underline;
}

.news-day {
  margin: 14px 0 6px;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.about-text {
  margin: 2px 0 0;
  max-width: 70ch;
}

.guide-inline {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 4px;
  margin-right: 4px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}

.guide-inline:hover {
  text-decoration: underline;
}

.landing {
  display: grid;
  gap: 12px;
}

.landing-title {
  margin: 0;
  font-size: 22px;
  line-height: 1.2;
  color: var(--heading);
}

.landing-search label {
  text-transform: none;
  letter-spacing: 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--heading);
}

.landing-games .section-heading-row {
  margin-top: 4px;
}

.landing-all-games {
  color: var(--heading);
  font-weight: 700;
  text-decoration: none;
}

.landing-all-games:hover {
  color: var(--accent);
}

.landing-games .status:empty {
  display: none;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(76px + env(safe-area-inset-bottom));
  z-index: 70;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  max-width: calc(100vw - 24px);
  padding: 10px 14px;
  border-radius: 999px;
  background: var(--brand);
  color: white;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 8px 24px rgb(0 0 0 / 25%);
  transform: translateX(-50%);
}

.toast[hidden] {
  display: none;
}

.toast a {
  color: white;
  font-weight: 800;
  text-decoration: underline;
}

@media (min-width: 721px) {
  .toast {
    bottom: 20px;
  }
}

@media (max-width: 720px) {
  .landing-search input[type="search"] {
    min-height: 44px;
    font-size: 16px;
  }
}

.highlights {
  margin: 8px 0 12px;
}

.highlight-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}

.highlight-tile {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.highlight-tile strong {
  color: var(--heading);
  font-size: 26px;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.highlight-tile span {
  color: var(--muted);
  font-size: 13px;
}

.highlight-tile small {
  display: block;
  font-size: 11px;
}

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

.highlight-moments li {
  line-height: 24px;
}

.highlight-moments a {
  font-weight: 600;
}

.week-highlights {
  margin: 4px 0 16px;
}

.week-card .assoc-leader-list li {
  grid-template-areas:
    "name stat"
    "team team"
    "detail detail";
}

.week-card .assoc-leader-stat {
  line-height: 24px;
  text-decoration: none;
  white-space: nowrap;
}

.week-card .assoc-leader-stat:hover {
  color: var(--accent);
  text-decoration: underline;
}

.week-card .assoc-leader-detail {
  text-align: left;
}

.week-card summary {
  min-height: 24px;
  margin-top: 8px;
  color: var(--accent);
  line-height: 24px;
  cursor: pointer;
}

.week-card details .assoc-leader-list {
  margin-top: 6px;
}

@media (max-width: 720px) {
  .assoc-team {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "name name"
      "meta meta"
      "record links";
    padding: 10px 12px;
  }

  .assoc-team-record {
    text-align: left;
  }
}

.home-cancelled {
  margin: 0;
  color: var(--bad);
  font-size: 13px;
}

.home-last-result {
  display: flex;
  align-items: center;
  gap: 8px;
}

.home-last-board {
  display: block;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.home-last-board .scoreboard {
  margin: 0;
}

.home-last-board:hover .scoreboard-pts {
  text-decoration: underline;
}

.home-last .game-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}

.home-last .game-actions .sheet {
  min-height: 30px;
  padding: 4px 11px;
  font-size: 12px;
  line-height: 1.2;
}

.h2h-other-meetings {
  display: grid;
  gap: 8px;
  margin: 0 0 12px;
}

.h2h-other-meetings .game.compact {
  margin: 0;
}

.wlt {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 800;
  background: var(--chip);
  color: var(--muted);
}

.wlt-w {
  background: var(--good-bg);
  color: var(--good);
}

.wlt-l {
  background: var(--bad-bg);
  color: var(--bad);
}

.home-form {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.form-strip {
  display: inline-flex;
  gap: 4px;
}

.home-agenda {
  margin-bottom: 8px;
}

.home-agenda .games {
  margin-bottom: 14px;
}

.my-team-actions,
.favorite-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.my-team-actions a,
.favorite-actions a {
  color: var(--heading);
  font-weight: 600;
  text-decoration: none;
}

.my-team-actions a:hover,
.favorite-actions a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.my-teams-empty,
.favorites-empty {
  padding: 28px 22px;
  border: 1px dashed var(--line);
  border-radius: 14px;
  background: var(--card);
  display: grid;
  gap: 10px;
}

.my-teams-empty h2,
.favorites-empty h2 {
  margin: 0;
  font-size: 24px;
}

.my-teams-empty p,
.favorites-empty p {
  margin: 0;
  color: var(--muted);
  max-width: 36rem;
}

.favorites-empty-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.my-teams-empty a.btn-link,
.favorites-empty a.btn-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-height: 42px;
  padding: 8px 16px;
  border-radius: 10px;
  background: var(--brand);
  color: #fff;
  text-decoration: none;
  font-weight: 700;
}

.favorites-empty a.btn-link.secondary {
  background: var(--card);
  color: var(--heading);
  border: 1px solid var(--line);
}

@media (max-width: 720px) {
  body {
    padding: 16px 12px 56px;
  }

  .game,
  .side {
    grid-template-columns: 1fr;
    align-items: flex-start;
  }

  h1 {
    font-size: 28px;
  }

  .top {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
  }

  .top-right {
    align-items: flex-start;
    width: 100%;
  }

  .main-nav {
    width: 100%;
  }

  .main-nav a,
  .main-nav a.tab {
    flex: 1;
    text-align: center;
    padding: 10px 12px;
    font-size: 14px;
  }

  .filters {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 14px;
  }

  #standings-filters label:nth-child(4) {
    grid-column: 1 / -1;
  }

  select {
    text-overflow: ellipsis;
  }

  .search-form .grow {
    grid-column: span 2;
  }

  th,
  td {
    padding: 8px 8px;
    font-size: 13px;
  }

  th {
    font-size: 11px;
  }

  /* Sticky team column so stats stay comparable while scrolling sideways */
  th:first-child,
  td:first-child {
    position: sticky;
    left: 0;
    z-index: 2;
    background: var(--card);
    max-width: min(46vw, 180px);
    box-shadow: 4px 0 8px -6px rgb(var(--shadow) / 0.35);
  }

  th:first-child {
    z-index: 3;
    background: var(--tint);
  }

  /* When follow column is first, sticky the team column (2nd) instead */
  th.follow-cell,
  td.follow-cell {
    position: sticky;
    left: 0;
    z-index: 2;
    background: var(--card);
    max-width: none;
    box-shadow: none;
  }

  th.follow-cell {
    z-index: 3;
    background: var(--tint);
  }

  th.follow-cell + th,
  td.follow-cell + td {
    position: sticky;
    left: 44px;
    z-index: 2;
    background: var(--card);
    max-width: min(42vw, 160px);
    box-shadow: 4px 0 8px -6px rgb(var(--shadow) / 0.35);
  }

  th.follow-cell + th {
    z-index: 3;
    background: var(--tint);
  }

  tr.clickable:hover td:first-child,
  tr:nth-child(even) td:first-child {
    background: var(--card);
  }

  tr.clickable:active {
    background: var(--tint-2);
  }

  td .team-with-logo {
    max-width: min(42vw, 160px);
  }

  td .team-name {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .status {
    font-size: 13px;
    margin: 0 0 10px;
  }

  .section-title {
    font-size: 17px;
    margin: 20px 0 10px;
  }
}

.standings-stack + .standings-stack {
  margin-top: 1.75rem;
}

.standings-stack .section-title {
  margin-bottom: 0.5rem;
}

/* ---- Phone app layout --------------------------------------------------- */

.top-title {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.phone-only,
.nav-back,
.bottom-nav,
.filter-bar,
.sheet-head,
.ptr,
.sheet-backdrop {
  display: none;
}

@media (max-width: 720px) {
  html,
  body {
    overscroll-behavior-y: contain;
  }

  body {
    padding: 0 12px calc(84px + env(safe-area-inset-bottom));
    -webkit-tap-highlight-color: transparent;
  }

  body.sheet-lock {
    overflow: hidden;
  }

  input:not([type="checkbox"]):not([type="radio"]),
  select,
  textarea {
    font-size: 16px;
  }

  /* Compact sticky header — table heads stick just below this (see --sticky-chrome). */
  .top {
    position: sticky;
    top: 0;
    z-index: 40;
    flex-direction: row;
    align-items: center;
    margin: 0 -12px 12px;
    padding: calc(10px + env(safe-area-inset-top)) 14px 10px;
    background: var(--header-bg);
    backdrop-filter: saturate(1.6) blur(14px);
    -webkit-backdrop-filter: saturate(1.6) blur(14px);
    border-bottom: 1px solid var(--line);
  }

  /* Fallback until JS measures .top; matches logo row + safe area. */
  :root {
    --sticky-chrome: calc(50px + env(safe-area-inset-top, 0px));
  }

  .top .kicker,
  .top .main-nav,
  .top .source {
    display: none;
  }

  .brand-logo img {
    width: 30px;
    height: 30px;
    border-radius: 7px;
  }

  .brand-logo.is-context {
    margin-top: 0;
  }

  .brand-logo.is-context img {
    width: auto;
    height: auto;
  }

  .top-title {
    flex: 1;
  }

  .top-right {
    flex: none;
    width: auto;
  }

  .theme-toggle {
    padding: 0 8px 0 6px;
    gap: 4px;
    border-color: transparent;
    background: transparent;
    font-size: 12px;
  }

  .top h1 {
    font-size: 21px;
    line-height: 1.2;
    letter-spacing: -0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* Title gets the full row. The theme control sits on the row above it. */
  body[data-view="team"] .top {
    display: grid;
    grid-template-columns: auto auto minmax(0, 1fr);
    grid-template-areas:
      "back logo tools"
      "title title title";
    align-items: center;
    column-gap: 8px;
    row-gap: 6px;
  }

  body[data-view="team"] .top-title,
  body[data-view="team"] .top-title > div {
    display: contents;
  }

  body[data-view="team"] #nav-back {
    grid-area: back;
    align-self: center;
  }

  body[data-view="team"] .brand-logo {
    grid-area: logo;
    align-self: center;
  }

  body[data-view="team"] .top-right {
    grid-area: tools;
    justify-self: end;
    align-self: center;
    width: auto;
    min-width: 0;
  }

  body[data-view="team"] .page-title-line {
    grid-area: title;
    align-items: flex-start;
    gap: 8px;
    min-width: 0;
    width: 100%;
  }

  body[data-view="team"] .page-title-line > h1 {
    flex: 1 1 auto;
    min-width: 0;
    margin-top: 2px;
    font-size: 20px;
    line-height: 1.25;
    letter-spacing: -0.015em;
    white-space: normal;
    text-wrap: balance;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  body[data-view="team"] .page-title-line > .page-title-fav {
    width: 30px;
    height: 30px;
    margin-top: 0;
    font-size: 17px;
  }

  .top-title > div {
    min-width: 0;
  }

  .nav-back:not([hidden]) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    width: 36px;
    height: 36px;
    margin-left: -8px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--heading);
  }

  .nav-back:active {
    background: var(--chip);
  }

  .nav-back svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.4;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  .detail-header .crumb {
    display: none;
  }

  .detail-header .team-heading-row {
    flex-wrap: nowrap;
    gap: 10px;
    margin-top: 4px;
  }

  .team-heading-row .share-btn {
    padding: 9px;
  }

  .team-heading-row .share-btn span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .detail-header .team-heading-row h2 {
    min-width: 0;
    margin: 0;
    font-size: 20px;
    line-height: 1.2;
  }

  .detail-header .meta {
    margin: 0;
  }

  .detail-header .recap-scoreboard {
    font-size: 16px;
  }

  .recap-pts {
    font-size: 26px;
  }

  body[data-view="team"] .sub-nav,
  body[data-view="player"] .sub-nav,
  body[data-view="game"] .sub-nav {
    display: none;
  }

  /* Bottom tab bar */
  .bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 50;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    background: var(--nav-bg);
    backdrop-filter: saturate(1.6) blur(14px);
    -webkit-backdrop-filter: saturate(1.6) blur(14px);
    border-top: 1px solid var(--line);
  }

  .bottom-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 4px 0;
    color: var(--muted);
    text-decoration: none;
    font-size: 11px;
    font-weight: 700;
  }

  .bottom-nav svg {
    width: 25px;
    height: 25px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  .bottom-nav a.active {
    color: var(--heading);
  }

  .bottom-nav a.active svg {
    stroke-width: 2.4;
  }

  .bottom-nav a[data-nav="favorites"].active svg {
    fill: var(--accent);
    stroke: var(--accent);
  }

  /* Sub-tabs as a segmented control */
  .sub-nav {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    gap: 2px;
    padding: 3px;
    margin: 0 0 12px;
    background: var(--chip);
    border-radius: 10px;
  }

  .sub-nav a,
  .sub-nav .sub-nav-btn {
    padding: 7px 4px;
    text-align: center;
    font-size: 13px;
    border-radius: 8px;
    white-space: nowrap;
  }

  .sub-nav a.active,
  .sub-nav .sub-nav-btn.active,
  .sub-nav a:hover,
  .sub-nav .sub-nav-btn:hover {
    background: var(--card);
    color: var(--heading);
    box-shadow: 0 1px 3px rgb(var(--shadow) / 0.12);
  }

  /* Filter bar + bottom sheet */
  .filter-bar:not([hidden]) {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 12px;
    cursor: pointer;
  }

  .filter-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex: none;
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--card);
    color: var(--heading);
    font: inherit;
    font-size: 14px;
    font-weight: 700;
  }

  .filter-toggle svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.2;
    stroke-linecap: round;
  }

  .filter-chips {
    display: flex;
    gap: 6px;
    overflow: hidden;
    mask-image: linear-gradient(to right, #000 85%, transparent);
    -webkit-mask-image: linear-gradient(to right, #000 85%, transparent);
  }

  .fchip {
    flex: none;
    max-width: 150px;
    padding: 5px 10px;
    border-radius: 999px;
    background: var(--chip);
    color: var(--heading);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .fchip.more {
    background: transparent;
    color: var(--muted);
  }

  form.filters:not(.search-form) {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 70;
    grid-template-columns: 1fr;
    gap: 12px;
    max-height: 82vh;
    margin: 0;
    padding: 0 16px calc(20px + env(safe-area-inset-bottom));
    overflow-y: auto;
    background: var(--card);
    border-radius: 18px 18px 0 0;
    box-shadow: 0 -12px 40px rgb(var(--shadow) / 0.25);
    transform: translateY(105%);
    visibility: hidden;
    transition: transform 0.25s ease, visibility 0s linear 0.25s;
  }

  form.filters.sheet-open {
    transform: none;
    visibility: visible;
    transition: transform 0.25s ease;
  }

  form.filters .sheet-head {
    position: sticky;
    top: 0;
    z-index: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0 -16px;
    padding: 16px 16px 10px;
    background: var(--card);
    color: var(--heading);
    font-size: 18px;
  }

  form.filters .sheet-head::before {
    content: "";
    position: absolute;
    top: 6px;
    left: 50%;
    width: 38px;
    height: 4px;
    margin-left: -19px;
    border-radius: 2px;
    background: var(--line);
  }

  .sheet-done {
    padding: 6px 14px;
    border: 0;
    border-radius: 999px;
    background: var(--brand);
    color: white;
    font: inherit;
    font-size: 14px;
    font-weight: 700;
  }

  form.filters select,
  form.filters input:not([type="checkbox"]):not([type="radio"]) {
    min-height: 44px;
    font-size: 16px;
  }

  .filters .field-hint {
    display: none;
  }

  #standings-filters label:nth-child(4) {
    grid-column: auto;
  }

  .sheet-backdrop:not([hidden]) {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: block;
    background: rgb(var(--shadow) / 0.35);
  }

  .search-form {
    grid-template-columns: 1fr auto;
  }

  .search-form label:not(.grow) {
    display: none;
  }

  .search-form .grow {
    grid-column: auto;
  }

  .search-form input[type="search"] {
    min-height: 44px;
    font-size: 16px;
  }

  .search-form .btn {
    align-self: end;
    min-height: 44px;
  }

  /* Card lists (tables on phones) */
  .table-wrap {
    overflow: visible;
    background: transparent;
    border: 0;
    border-radius: 0;
  }

  .card-toolbar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 6px;
    margin: -4px 0 6px;
    font-size: 12px;
    color: var(--muted);
  }

  .card-toolbar label {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
  }

  .card-toolbar select {
    width: auto;
    min-height: 30px;
    padding: 2px 6px;
    font-size: 13px;
  }

  .card-toolbar button {
    width: 30px;
    height: 30px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--card);
    color: var(--heading);
    font-weight: 700;
  }

  .card-list {
    overflow: hidden;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 14px;
  }

  .card-list > .muted {
    margin: 0;
    padding: 14px;
  }

  .card-group {
    padding: 8px 14px 6px;
    background: var(--tint);
    color: var(--heading);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
  }

  .row-card {
    padding: 10px 14px;
    border-top: 1px solid var(--line-soft);
  }

  .row-card:first-child,
  .card-group + .row-card {
    border-top: 0;
  }

  .row-card.clickable:active {
    background: var(--tint-2);
  }

  .row-card-main {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
  }

  .row-card-actions {
    display: flex;
    flex: none;
    gap: 4px;
  }

  .row-card-text {
    flex: 1;
    min-width: 0;
  }

  .row-card-title {
    color: var(--heading);
    font-weight: 700;
    font-size: 15px;
    line-height: 1.25;
  }

  .row-card-title a {
    color: inherit;
    text-decoration: none;
  }

  .row-card-title .team-with-logo {
    max-width: none;
  }

  .row-card-title .team-name {
    white-space: normal;
    overflow: visible;
  }

  .row-card-sub {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px 6px;
    margin-top: 2px;
    color: var(--muted);
    font-size: 12.5px;
  }

  .row-card-sub a {
    color: var(--heading);
  }

  .row-card-sub .dot {
    opacity: 0.6;
  }

  .row-card-stats {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(31px, 1fr);
    gap: 2px;
    margin-top: 8px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .row-card-stats::-webkit-scrollbar {
    display: none;
  }

  .row-card-stats .stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 4px 2px;
    border-radius: 8px;
    background: var(--tint-2);
    font-variant-numeric: tabular-nums;
  }

  .row-card-stats .stat b {
    color: var(--ink);
    font-size: 15px;
    line-height: 1.1;
  }

  .row-card-stats .stat small {
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.03em;
  }

  .row-card-stats .stat.on {
    background: var(--brand);
  }

  .row-card-stats .stat.on b,
  .row-card-stats .stat.on small {
    color: white;
  }

  .leader-board .section-title {
    margin-top: 16px;
  }

  /* Game cards */
  .game {
    gap: 8px;
    padding: 12px 14px;
  }

  .game .meta {
    font-size: 12px;
    line-height: 1.35;
  }

  .phone-only {
    display: block;
  }

  #games .title.matchup,
  #view-favorites .home-agenda .title.matchup,
  #games .side > .scoreboard,
  #view-favorites .home-agenda .side > .scoreboard {
    display: none;
  }

  #games .phone-only .scoreboard,
  #view-favorites .home-agenda .phone-only .scoreboard {
    margin: 6px 0 4px;
  }

  .title.matchup {
    display: grid;
    gap: 2px;
    margin: 6px 0 4px;
    font-size: 15px;
    line-height: 1.25;
  }

  .title.matchup .at {
    font-size: 11px;
    line-height: 1;
    padding-left: 2px;
  }

  .game .venue {
    color: var(--muted);
    font-size: 12.5px;
  }

  .officials {
    gap: 4px;
  }

  .officials .chip {
    padding: 3px 8px;
    font-size: 12px;
  }

  .list-toolbar .page-size {
    white-space: nowrap;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    text-transform: none;
    letter-spacing: 0;
  }

  .list-toolbar select {
    min-height: 30px;
    padding: 2px 6px;
  }

  .game .side {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
  }

  .game-card .team-logo-md {
    width: 30px;
    height: 30px;
  }

  .game-card .scoreboard-team .team-name {
    font-size: 15px;
  }

  .game-card .scoreboard-pts {
    font-size: 26px;
  }

  .game-card .scoreboard-row.is-unplayed .scoreboard-pts {
    font-size: 20px;
  }

  .game-card .game-actions {
    justify-content: stretch;
  }

  .game-card .game-actions .sheet {
    flex: 1 1 auto;
    justify-content: center;
  }

  .sheet {
    min-height: 36px;
  }

  .splits {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .split {
    padding: 10px 12px;
    font-size: 13px;
  }

  .search-results {
    gap: 16px;
  }

  .list-toolbar {
    margin: 0 0 8px;
  }

  /* Pull to refresh */
  .ptr {
    position: fixed;
    top: calc(8px + env(safe-area-inset-top));
    left: 50%;
    z-index: 45;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--card);
    box-shadow: 0 2px 10px rgb(var(--shadow) / 0.2);
    opacity: 0;
    transform: translate(-50%, -60px);
    pointer-events: none;
  }

  .ptr span {
    width: 18px;
    height: 18px;
    border: 2.5px solid var(--line);
    border-top-color: var(--brand);
    border-radius: 50%;
    transition: transform 0.2s;
  }

  .ptr.ready span {
    border-color: var(--brand);
    border-top-color: var(--accent);
  }

  .ptr.refreshing span {
    animation: ptr-spin 0.8s linear infinite;
  }

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

/* ---- Standings ---------------------------------------------------------- */

.stnd-group + .stnd-group {
  border-top: 1px solid var(--line);
}

.stnd-group-title {
  margin: 0;
  padding: 10px 12px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--heading);
  background: var(--chip);
  border-bottom: 1px solid var(--line);
}

.stnd-table th[data-key] {
  cursor: pointer;
}

.stnd-table .stnd-rank {
  width: 32px;
  padding-right: 4px;
  text-align: center;
  color: var(--muted);
  font-weight: 700;
}

.stnd-move {
  display: block;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.02em;
}

.stnd-move.up {
  color: var(--good);
}

.stnd-move.down {
  color: var(--bad);
}

.stnd-table td.stnd-form {
  padding-left: 12px;
}

.stnd-form .form-strip {
  gap: 3px;
}

.stnd-form .wlt {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  font-size: 10px;
}

.stnd-detail-form {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  font-size: 12px;
  color: var(--muted);
}

.stnd-table .stnd-pts {
  font-weight: 800;
  color: var(--heading);
}

.stnd-table .stnd-pts-pct {
  border-right: 1px solid var(--line);
}

.stnd-table td.pos {
  color: var(--good);
}

.stnd-table td.neg {
  color: var(--accent);
}

.stnd-table .stnd-fav {
  width: 44px;
  padding: 4px 8px;
}

.stnd-row {
  cursor: pointer;
}

.stnd-row:hover {
  background: var(--tint-2);
}

.stnd-row.is-fav,
.stnd-row.is-fav:hover {
  background: var(--gold-tint);
}

.stnd-row.is-fav td.stnd-rank {
  box-shadow: inset 3px 0 0 var(--gold);
}

.stnd-star,
.stnd-detail {
  display: none;
}

.stnd-group:last-child tbody tr.stnd-row:last-of-type td {
  border-bottom: 0;
}

.stnd-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin: 0;
  padding: 10px 12px;
  font-size: 12px;
  color: var(--muted);
  border-top: 1px solid var(--line);
}

.stnd-legend b {
  color: var(--ink);
}

@media (max-width: 720px) {
  .stnd {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 14px;
    /* visible so thead can stick to the page (overflow:hidden kills sticky) */
    overflow: visible;
  }

  .stnd .stnd-extra,
  .stnd .stnd-fav,
  .stnd-legend .stnd-extra,
  .tournament-pool .stnd-extra {
    display: none;
  }

  .stnd-table {
    table-layout: fixed;
  }

  .stnd-table th,
  .stnd-table td {
    padding: 11px 0;
    font-size: 14px;
  }

  .stnd-table th {
    font-size: 11px;
    position: sticky;
    top: var(--sticky-chrome);
    z-index: 5;
    background: var(--tint);
    box-shadow: 0 1px 0 var(--line);
  }

  /* Keep row cells from using the phone sticky-left team column; headers stay sticky-top. */
  .stnd-table td:first-child {
    position: static;
    max-width: none;
    box-shadow: none;
    background: transparent;
  }

  .stnd-table th:first-child {
    position: sticky;
    left: auto;
    max-width: none;
    z-index: 5;
    background: var(--tint);
    box-shadow: 0 1px 0 var(--line);
  }

  .stnd-table .num {
    width: 28px;
    text-align: center;
    color: var(--muted);
  }

  .stnd-table .stnd-rank {
    width: 30px;
    padding-left: 2px;
    font-size: 13px;
  }

  .stnd-table .stnd-pts {
    width: 36px;
    font-size: 16px;
    color: var(--heading);
    padding-right: 8px;
    border-right: 0;
  }

  .stnd-table .stnd-sp {
    width: 28px;
  }

  .stnd-table td.stnd-team {
    white-space: normal;
    padding-right: 6px;
  }

  .stnd-team .team-with-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    max-width: none;
    color: var(--ink);
  }

  .stnd-team .team-with-logo:hover {
    text-decoration: none;
  }

  .stnd-team .team-name {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    white-space: normal;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
  }

  .stnd-row.is-fav .stnd-star {
    display: inline;
    flex: none;
    color: var(--gold);
    font-size: 12px;
  }

  .stnd-row.is-fav td.stnd-rank {
    box-shadow: inset 3px 0 0 var(--gold);
  }

  .stnd-row:hover {
    background: transparent;
  }

  .stnd-row.is-open {
    background: var(--tint);
  }

  .stnd-row.is-open td {
    border-bottom-color: transparent;
  }

  .stnd-detail:not([hidden]) {
    display: table-row;
  }

  .stnd-table .stnd-detail td {
    padding: 0 12px 14px;
    white-space: normal;
    background: var(--tint);
  }

  .stnd-detail-name {
    font-weight: 700;
    color: var(--heading);
  }

  .stnd-detail-record {
    margin: 2px 0 10px;
    font-size: 13px;
    color: var(--muted);
  }

  .stnd-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(58px, 1fr));
    gap: 6px;
  }

  .ct .stnd-table th.ct-sort {
    cursor: pointer;
  }

  .ct .stnd-table th.on,
  .ct .stnd-table td.on {
    color: var(--heading);
    font-weight: 800;
  }

  .ct .stnd-table td.on {
    font-size: 15px;
  }

  .ct .stnd-table .num.wide {
    width: 40px;
  }

  .ct .stnd-table td.num:last-child,
  .ct .stnd-table th.num:last-child {
    padding-right: 8px;
  }

  .ct .stnd-table td.stnd-team,
  .ct .stnd-table th.stnd-team {
    padding-left: 10px;
    padding-right: 6px;
  }

  .ct .stnd-table .stnd-rank {
    width: max(30px, calc(var(--ct-lead, 0ch) + 10px));
    white-space: nowrap;
  }

  .ct .stnd-table td.stnd-rank + td.stnd-team,
  .ct .stnd-table th.stnd-rank + th.stnd-team {
    padding-left: 0;
  }

  .ct-name {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.2;
  }

  .ct-name > a,
  .ct-name > .ct-toggle {
    display: block;
    min-width: 0;
    padding: 4px 0;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--ink);
  }

  .ct-name > .ct-inline {
    flex: 1 1 auto;
    min-width: 0;
    padding: 4px 0;
    overflow-wrap: anywhere;
  }

  .ct-name > .ct-inline a {
    display: inline;
    color: var(--ink);
  }

  .ct-name .team-with-logo {
    display: flex;
    align-items: center;
    gap: 6px;
    max-width: none;
  }

  .ct-name .team-name {
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .ct-sub {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 2px;
    overflow: hidden;
    font-size: 11px;
    color: var(--muted);
    white-space: nowrap;
  }

  .ct-sub-inline {
    flex: none;
    display: flex;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
    color: var(--muted);
  }

  .ct-sub > span:not(.dot),
  .ct-sub .team-with-logo {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .ct-sub .team-with-logo {
    display: flex;
    align-items: center;
    gap: 4px;
    min-height: 24px;
    max-width: none;
    color: var(--muted);
    font-weight: 600;
  }

  .ct-sub .team-logo {
    width: 16px;
    height: 16px;
    flex: none;
  }

  .ct-sub .team-name {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .ct-facts {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    font-size: 13px;
  }

  .ct .stnd-detail .stnd-stats + .ct-facts {
    margin-top: 10px;
  }

  .ct .stnd-detail td {
    padding-top: 2px;
  }

  .stnd-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 8px 2px;
    background: var(--card);
    border-radius: 10px;
    text-align: center;
  }

  .stnd-stat b {
    font-size: 16px;
    color: var(--ink);
  }

  .stnd-stat small {
    font-size: 10px;
    line-height: 1.15;
    color: var(--muted);
  }

  .stnd-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
  }

  .stnd-actions .favorite-btn {
    width: auto;
    padding: 0 12px;
    font-size: 14px;
    font-weight: 700;
  }

  .stnd-actions .favorite-btn::after {
    content: " Favorite";
    color: var(--ink);
  }

  .stnd-actions .favorite-btn.on::after {
    content: " Favorited";
  }

  .table-wrap .stnd-open {
    margin-left: auto;
    font-weight: 700;
    color: var(--accent);
  }

  .stnd-legend {
    gap: 2px 10px;
    padding: 10px 4px 0;
    border-top: 0;
    font-size: 11px;
  }
}

@media (max-width: 720px) and (display-mode: standalone) {
  .top {
    padding-top: calc(6px + env(safe-area-inset-top));
  }
}

.trend {
  margin: 4px 0 8px;
}

.trend-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.trend-legend {
  display: inline-flex;
  gap: 12px;
  font-size: 12px;
  color: var(--muted);
}

.trend-legend .key::before {
  content: "";
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 5px;
  border-radius: 50%;
  background: var(--muted);
}

.trend-legend .key-w::before {
  background: var(--good);
}

.trend-legend .key-l::before {
  background: var(--bad);
}

.trend-legend .key-g::before,
.trend-legend .key-a::before {
  border-radius: 2px;
  background: var(--accent);
}

.trend-legend .key-a::before {
  opacity: 0.4;
}

.chart {
  display: block;
  width: 100%;
  height: auto;
  padding: 8px 4px 2px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.chart-grid {
  stroke: var(--line);
  stroke-width: 1;
}

.chart-tick {
  font-size: 11px;
  fill: var(--muted);
}

.chart-bar-g {
  fill: var(--accent);
}

.chart-bar-a {
  fill: var(--accent);
  opacity: 0.4;
}

.chart-bar-for {
  fill: var(--good);
}

.chart-bar-against {
  fill: var(--bad);
}

.team-tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 4px;
  margin: 4px 0 14px;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.team-tabs a {
  flex: 0 0 auto;
  white-space: nowrap;
  padding: 8px 14px;
  margin-bottom: -1px;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
}

.team-tabs a:hover {
  color: var(--heading);
}

.team-tabs a[aria-current="page"] {
  color: var(--heading);
  border-bottom-color: var(--accent);
}

.stream-manage-help {
  margin: 0 0 12px;
}

.stream-manage-season {
  display: grid;
  gap: 4px;
  margin: 8px 0;
  font-size: 13px;
  color: var(--muted);
  max-width: 220px;
}

.stream-manage-season select {
  font: inherit;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  color: var(--ink);
}

.stream-manage-games {
  display: grid;
  gap: 10px;
}

.stream-manage-row {
  display: grid;
  gap: 8px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.stream-manage-meta {
  display: grid;
  gap: 2px;
}

.stream-manage-url input {
  width: 100%;
  font: inherit;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  color: var(--ink);
}

.stream-manage-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

a.watch-link {
  font-weight: 700;
}

.team-schedule-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  margin: 0 0 10px;
}

.team-schedule-toolbar .status {
  margin: 0;
}

#team-schedule-games .game.is-next {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

#team-schedule-games .game.is-cancelled {
  opacity: 0.72;
}

.ts-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin-bottom: 8px;
}

.ts-card {
  display: grid;
  gap: 2px;
  padding: 12px 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  font-size: 13px;
}

.ts-big {
  font-size: 22px;
  font-weight: 800;
  color: var(--heading);
  font-variant-numeric: tabular-nums;
}

.ts-note {
  margin: 0 0 8px;
  font-size: 12px;
}

.ts-periods {
  display: grid;
  gap: 10px;
  margin: 0 0 8px;
  padding: 12px 14px;
  list-style: none;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.ts-period {
  display: grid;
  grid-template-columns: 36px 1fr;
  align-items: center;
  gap: 10px;
}

.ts-period-label {
  font-weight: 800;
  color: var(--heading);
}

.ts-bars {
  display: grid;
  gap: 3px;
}

.ts-bar-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.ts-bar {
  display: inline-block;
  min-width: 2px;
  height: 10px;
  border-radius: 3px;
}

.ts-for {
  background: var(--good);
}

.ts-against {
  background: var(--bad);
}

.ts-pim-line {
  margin: 0 0 8px;
  font-size: 13px;
  color: var(--muted);
}

.ts-pim-line b {
  color: var(--heading);
}

.chart-bar-pim {
  fill: var(--accent);
}

.chart-bar-opp {
  fill: var(--muted);
  opacity: 0.5;
}

.trend-legend .key-pim::before,
.trend-legend .key-opp::before {
  border-radius: 2px;
  background: var(--accent);
}

.trend-legend .key-opp::before {
  background: var(--muted);
  opacity: 0.5;
}

.ts-lists {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.ts-list {
  padding: 12px 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.ts-list h3 {
  margin: 0 0 8px;
  font-size: 13px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.ts-list ol {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 14px;
}

.ts-list li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.home-series {
  font-size: 13px;
  color: var(--muted);
}

.h2h-summary {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.h2h-side {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.h2h-side:last-child {
  flex-direction: row-reverse;
  text-align: right;
}

.h2h-side .team-with-logo {
  min-width: 0;
  font-weight: 700;
  color: var(--heading);
}

.h2h-side:last-child .team-with-logo {
  flex-direction: row-reverse;
}

.h2h-wins {
  font-size: 32px;
  font-weight: 800;
  line-height: 1;
  color: var(--heading);
  font-variant-numeric: tabular-nums;
}

.h2h-mid {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.h2h-detail {
  margin: 6px 0 12px;
  text-align: center;
  font-size: 13px;
}

.h2h-subtitle {
  margin: 14px 0 8px;
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.h2h-upcoming,
.h2h-meetings {
  display: grid;
  gap: 6px;
  margin: 0 0 12px;
  padding: 0;
  list-style: none;
  font-size: 14px;
}

.h2h-upcoming .is-cancelled b {
  text-decoration: line-through;
}

@media (max-width: 720px) {
  .h2h-summary {
    padding: 12px;
    gap: 8px;
  }

  .h2h-side {
    flex-direction: column-reverse;
    align-items: flex-start;
  }

  .h2h-side:last-child {
    flex-direction: column-reverse;
    align-items: flex-end;
  }

  .h2h-side .team-name {
    font-size: 13px;
  }
}

.stnd-row.is-current,
.stnd-row.is-current:hover {
  background: var(--accent-tint);
}

.stnd-row.is-current td.stnd-rank {
  box-shadow: inset 3px 0 0 var(--accent);
}

.stnd-row.is-current .team-name {
  font-weight: 800;
}

/* Push highlight on the game-page recap (one scoreboard; no second card). */
.recap-scoreboard.card--changed,
:root[data-theme="dark"] .recap-scoreboard.card--changed {
  box-shadow: 0 0 0 2px var(--accent-line);
  border-radius: 12px;
}
.recap-pts.is-changed,
.scoreboard-pts.is-changed {
  border-radius: 8px; padding: 2px 6px; margin-right: -6px;
  background: var(--accent-tint); color: var(--accent) !important; font-weight: 900 !important;
  animation: pts-flash 2.4s ease-out 1;
}
@keyframes pts-flash { 0% { background: var(--accent); color: #fff; } 100% { background: var(--accent-tint); } }
.event-tag {
  display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: 6px;
  font-size: 10.5px; font-weight: 800; letter-spacing: 0.06em; line-height: 1.5;
  vertical-align: 2px; white-space: nowrap;
}
.event-tag.tag-goal { background: var(--accent); color: #fff; }
.event-tag.tag-penalty { background: #fff1d6; color: #8a5a00; border: 1px solid #f0c36a; }
:root[data-theme="dark"] .event-tag.tag-penalty { background: #3b2c0d; color: #ffcf6e; border-color: #7a5a1c; }
#game-goals tr.is-push-event,
#game-penalties tr.is-push-event,
#game-goals .row-card.is-push-event,
#game-penalties .row-card.is-push-event {
  background: var(--accent-tint);
  box-shadow: inset 3px 0 0 var(--accent);
}
.event-note { color: var(--muted); font-size: 12.5px; line-height: 1.35; }
.event-note b { color: var(--heading); }

.push-opt-in {
  display: grid;
  gap: 8px;
  margin: 0 0 14px;
  padding: 12px 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
}
.push-opt-toggle {
  appearance: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.push-opt-toggle .push-notifications-title {
  flex: 1 1 auto;
}
.push-opt-chevron {
  flex: none;
  width: 0.55em;
  height: 0.55em;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  transition: transform 120ms ease;
}
.push-opt-toggle[aria-expanded="true"] .push-opt-chevron {
  transform: rotate(-135deg);
  margin-top: 0.2em;
}
.push-opt-summary {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
  font-weight: 600;
}
.push-opt-body {
  display: grid;
  gap: 8px;
}
.push-opt-body[hidden] {
  display: none !important;
}
.push-opt-summary[hidden] {
  display: none !important;
}
.push-enable {
  appearance: none;
  width: fit-content;
  border: 0;
  background: var(--accent);
  color: #fff;
  border-radius: 999px;
  padding: 8px 14px;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.push-enable[aria-pressed="true"] {
  background: var(--card);
  color: var(--heading);
  border: 1px solid var(--line);
}
.push-ios-help,
.push-status {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
}
.push-settings-link {
  color: var(--accent);
  font-size: 14px;
  font-weight: 700;
  width: fit-content;
}
.push-tester {
  display: grid;
  gap: 12px;
  margin: 0 0 14px;
  padding: 12px 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
}
.push-notifications-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--heading);
}
.push-alert-kinds {
  margin: 0;
  padding: 0;
  border: 0;
  display: grid;
  gap: 6px;
}
.push-alert-kinds-legend {
  padding: 0;
  margin: 0 0 2px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}
.push-alert-kinds-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  align-items: center;
  gap: 6px 12px;
}
/* Beat the global `label { flex-direction: column; text-transform: uppercase }` rule. */
.push-alert-kind {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  flex: 0 1 auto;
  white-space: nowrap;
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  cursor: pointer;
}
/* When four no longer fit on one row, prefer a 2×2 wrap. */
@media (max-width: 340px) {
  .push-alert-kind {
    flex: 1 1 calc(50% - 6px);
    min-width: 0;
  }
}
.push-alert-kind-input {
  width: 16px;
  height: 16px;
  margin: 0;
  flex: none;
  accent-color: var(--accent);
}
.push-token-input {
  display: block;
  width: 100%;
  min-height: 42px;
  margin-top: 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  color: var(--ink);
  font: inherit;
  font-weight: 500;
}
.push-token-form {
  margin: 0;
}
.push-token-save {
  appearance: none;
  margin-top: 8px;
  border: 0;
  background: var(--accent);
  color: #fff;
  border-radius: 999px;
  padding: 8px 14px;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.push-token-change {
  appearance: none;
  border: 0;
  background: none;
  padding: 0;
  color: var(--accent);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  width: fit-content;
}
.push-access {
  margin: 0;
}
.push-access summary {
  cursor: pointer;
  width: fit-content;
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
}
.push-access-form {
  display: grid;
  gap: 10px;
  margin: 10px 0 0;
}
.push-access-note {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}
.push-access-form label {
  text-transform: none;
  letter-spacing: 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--heading);
}
.push-access-form input,
.push-access-form textarea {
  width: 100%;
  min-height: 42px;
  margin-top: 4px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-weight: 500;
}
.push-access-form textarea {
  min-height: 72px;
  resize: vertical;
}
.push-access-submit {
  appearance: none;
  justify-self: start;
  border: 0;
  background: var(--accent);
  color: #fff;
  border-radius: 999px;
  padding: 8px 14px;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.push-access-status {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
}
.push-access-status:empty {
  display: none;
}
.push-access-thanks {
  margin: 0;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.4;
}
.push-paused {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}
.notify-btn {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--faint);
  width: 34px;
  height: 34px;
  border-radius: 10px;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  flex: 0 0 auto;
  padding: 0;
}
.notify-btn.on {
  background: var(--accent-tint);
  border-color: var(--accent-line);
  color: var(--accent);
}
.fav-tools {
  display: inline-flex;
  align-items: flex-start;
  gap: 6px;
  flex: 0 0 auto;
}
.page-title-line > .page-title-bell {
  flex: none;
  margin-top: 9px;
}
@media (max-width: 720px) {
  body[data-view="team"] .page-title-line > .page-title-bell {
    width: 30px;
    height: 30px;
    margin-top: 0;
    font-size: 15px;
  }
}

/* NHL-style scoring cards on game recaps (same game-card shell). */
.scoring-list {
  display: grid;
  gap: 16px;
  margin: 0 0 18px;
}
.scoring-period-title {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 800;
  color: var(--heading);
  letter-spacing: 0.01em;
}
.scoring-period-cards {
  display: grid;
  gap: 10px;
}
.goal-card.game-card {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--card);
  box-shadow:
    0 1px 2px rgb(var(--shadow) / 0.05),
    0 8px 22px rgb(var(--shadow) / 0.07);
}
:root[data-theme="dark"] .goal-card.game-card {
  box-shadow:
    0 1px 0 rgb(255 255 255 / 0.04),
    0 10px 28px rgb(0 0 0 / 0.32);
}
.goal-card-scorer {
  margin: 0;
  font-size: 16px;
  line-height: 1.3;
  color: var(--heading);
}
.goal-card-scorer-name,
.goal-card-scorer-name a {
  font-weight: 800;
  color: inherit;
  text-decoration: none;
}
.goal-card-scorer-name a:hover {
  text-decoration: underline;
}
.goal-card-total {
  font-weight: 600;
  color: var(--muted);
}
.goal-card-milestone {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--accent-tint);
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.02em;
  vertical-align: 1px;
}
.goal-card-assists {
  margin: 4px 0 0;
  font-size: 13.5px;
  line-height: 1.35;
  color: var(--muted);
}
.goal-card-assists a {
  color: inherit;
  text-decoration: none;
  font-weight: 600;
}
.goal-card-assists a:hover {
  text-decoration: underline;
  color: var(--heading);
}
.goal-card-scoreboard {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: center;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}
.goal-card-side {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.goal-card-team {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.goal-card-pts {
  font-size: 18px;
  font-weight: 700;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.goal-card-side.is-scoring .goal-card-team,
.goal-card-side.is-scoring .goal-card-pts {
  color: var(--heading);
  font-weight: 800;
}
.goal-card-side.is-other .goal-card-team,
.goal-card-side.is-other .goal-card-pts {
  /* Keep non-scoring side quieter without opacity (fails color-contrast). */
  color: var(--muted);
  font-weight: 600;
}
.goal-card-time {
  display: grid;
  gap: 1px;
  margin-left: auto;
  text-align: right;
  justify-items: end;
}
.goal-card-time-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.goal-card-time-value {
  font-size: 14px;
  font-weight: 700;
  color: var(--heading);
  font-variant-numeric: tabular-nums;
}
#game-goals .goal-card.is-push-event {
  box-shadow: inset 3px 0 0 var(--accent);
  background: var(--accent-tint);
}
@media (max-width: 720px) {
  .goal-card.game-card {
    padding: 12px 12px 12px 14px;
    border-radius: 16px;
  }
  .goal-card-scorer {
    font-size: 15px;
  }
  .goal-card-pts {
    font-size: 17px;
  }
}

/* Viewer's own clock after the rink (UTC-7) time; only rendered off UTC-7. */
.viewer-time {
  color: var(--muted);
  font-size: 0.85em;
  font-weight: 400;
  overflow-wrap: anywhere;
}

.tournament-list-section .section-title {
  margin: 4px 0 10px;
}

/* Spordle schedule status "Conflict" (informational, amber). */
.tag.sched-conflict-tag {
  background: #fff4d6;
  color: #7a4b00;
  border: 1px solid #f0c36d;
}
:root[data-theme="dark"] .tag.sched-conflict-tag {
  background: #3a2c0a;
  color: #f5d48a;
  border-color: #7a5a17;
}

/* Team schedule List | Calendar toggle + month grid (team page only). */
.team-sched-view {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--card);
}
.team-sched-view button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.85rem;
  padding: 4px 12px;
  cursor: pointer;
}
.team-sched-view button + button { border-left: 1px solid var(--line); }
.team-sched-view button[aria-pressed="true"] { background: var(--tint); color: var(--ink); font-weight: 600; }
.team-cal { margin: 0 0 12px; max-width: 100%; }
.team-cal-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 8px; }
.team-cal-title { margin: 0; font-size: 1rem; color: var(--heading); }
.team-cal-nav {
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  border-radius: 8px;
  width: 36px;
  height: 32px;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
}
.team-cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; }
.team-cal-wd { text-align: center; font-size: 0.72rem; color: var(--muted); padding: 2px 0; }
.team-cal-cell {
  min-width: 0;
  min-height: 56px;
  padding: 2px 3px;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: var(--card);
  color: var(--ink);
  font: inherit;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
}
.team-cal-cell.is-pad { background: transparent; border-color: transparent; }
button.team-cal-cell { cursor: pointer; }
.team-cal-cell.has-games { border-color: var(--line); background: var(--tint-2); }
.team-cal-cell.is-today .team-cal-num { color: var(--accent); font-weight: 700; }
.team-cal-cell.is-selected { outline: 2px solid var(--focus); outline-offset: -1px; }
.team-cal-num { font-size: 0.75rem; color: var(--muted); }
.team-cal-mark {
  display: block;
  font-size: 0.68rem;
  line-height: 1.2;
  padding: 1px 2px;
  border-radius: 4px;
  background: var(--chip);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.team-cal-mark.tag.sched-conflict-tag { margin: 0; }
.team-cal-mark.is-cancelled { text-decoration: line-through; color: var(--muted); }
.team-cal-res.res-w { color: var(--good); }
.team-cal-res.res-l { color: var(--bad); }
.team-cal-day-title { margin: 12px 0 6px; font-size: 0.95rem; color: var(--heading); }
.team-cal-time-short { display: none; }
@media (max-width: 480px) {
  .team-cal-opp,
  .team-cal-time { display: none; }
  .team-cal-time-short { display: inline; }
  .team-cal-mark { text-overflow: clip; padding: 1px; }
  .team-cal-cell { min-height: 48px; padding: 2px; }
  .team-cal-mark { font-size: 0.62rem; }
}

#team-schedule-games[hidden],
.team-cal[hidden] {
  display: none;
}

/* Event-format pools + bracket cards (web/tournament_events/*.json) */
.event-standings-note {
  margin: 0 0 12px;
  padding: 8px 12px;
  border-left: 3px solid var(--gold);
  background: var(--gold-tint);
  color: var(--ink);
  font-size: 14px;
  border-radius: 6px;
}
.pool-seed-tag {
  display: inline-block;
  min-width: 2.1em;
  margin-right: 6px;
  padding: 1px 4px;
  border-radius: 4px;
  background: var(--chip);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  vertical-align: middle;
}
.tournament-team-cell .pool-seed-tag + a,
.tournament-team-cell .pool-seed-tag + .team-with-logo {
  display: inline-flex;
}
.event-tie-mark {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--accent-tint);
  color: var(--bad);
  border: 1px solid var(--accent-line);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  vertical-align: middle;
}
.event-tie-note .event-tie-mark {
  margin: 0 4px 0 0;
}
.event-bracket-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}
.event-bracket-card {
  border: 1px solid var(--line);
  border-top: 6px solid var(--bracket-color, var(--faint));
  border-radius: 10px;
  background: var(--card);
  padding: 10px 12px 12px;
  min-width: 0;
}
.event-bracket-black { --bracket-color: #111111; }
.event-bracket-red { --bracket-color: #c8102e; }
.event-bracket-gray { --bracket-color: #8a94a3; }
.event-bracket-pool { --bracket-color: var(--brand); }
.event-bracket-white { border-top: 6px double var(--faint); }
.event-bracket-title {
  margin: 0 0 8px;
  font-size: 16px;
  color: var(--heading);
}
.event-bracket-games {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.event-bracket-game {
  min-width: 0;
}

/* Tournament live extras: live strip, rink board, highlights, team cards, age leaders. Mobile first. */
.tournament-live-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 8px;
  border-radius: 50%;
  background: #d92d20;
  vertical-align: middle;
}
.tournament-live-card { display: grid; gap: 4px; min-width: 0; }
.tournament-overlay-link { justify-self: end; font-size: 13px; }
.tournament-rink-controls { display: grid; gap: 8px; margin: 0 0 10px; }
.tournament-rink-controls label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.tournament-rink-controls select { width: 100%; min-height: 40px; font-size: 16px; }
.tournament-rink-row { display: grid; gap: 4px; }
.tournament-state-chip {
  justify-self: start;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: var(--tint-2);
}
.tournament-state-chip[data-state="live"] { background: #d92d20; color: #fff; }
.tournament-highlight-list, .tournament-team-results { margin: 0 0 8px; padding-left: 18px; }
.tournament-highlight-list li, .tournament-team-results li { margin: 2px 0; overflow-wrap: anywhere; }
.tournament-team-grid { display: grid; gap: 10px; grid-template-columns: 1fr; }
.tournament-team-card { padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; min-width: 0; }
.tournament-team-card .meta, .tournament-team-next { margin: 4px 0; }
.tournament-res { display: inline-block; min-width: 1.4em; font-weight: 700; }
.tournament-leader-toggle { margin: 0 0 10px; }
.tournament-leader-cols { display: grid; gap: 12px; grid-template-columns: 1fr; }
.tournament-leader-col ol { margin: 0; padding-left: 20px; }
.tournament-leader-col li { margin: 2px 0; overflow-wrap: anywhere; }
@media (min-width: 720px) {
  .tournament-rink-controls { grid-template-columns: 2fr 1fr; }
  .tournament-team-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
  .tournament-leader-cols { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
}
