:root {
  --stats-subtle: #f2f4f9;
  --stats-hover: #fafbfe;
  --stats-sort-muted: #9299a7;
  --stats-highlight: #eaf0ff;
  --card-shadow: rgba(20, 23, 31, 0.08);
  --snapshot-bg: #edf2ff;
  --snapshot-border: #c7d4fa;
  --snapshot-ink: #263d7e;
  --snapshot-strong: #18306f;
  --card-yellow: #e8b923;
  --card-red: #d0342c;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d1118;
  --panel: #151b24;
  --ink: #edf1f7;
  --muted: #a9b2c1;
  --line: #2b3442;
  --brand: #7ea4ff;
  --brand-ink: #0d1118;
  --win: #2f9f6b;
  --draw: #a98228;
  --loss: #c64b43;
  --pill-bg: #232d43;
  --pill-ink: #cbd8fa;
  --stats-subtle: #1b2330;
  --stats-hover: #1a222e;
  --stats-sort-muted: #758094;
  --stats-highlight: #1a2945;
  --card-shadow: rgba(0, 0, 0, 0.35);
  --snapshot-bg: #172444;
  --snapshot-border: #36558f;
  --snapshot-ink: #cad8ff;
  --snapshot-strong: #eef3ff;
  --card-yellow: #f0c33c;
  --card-red: #e05a50;
}

.stats-page {
  font-variant-numeric: tabular-nums;
}

.angle-jump {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin-top: 24px;
  font-weight: 700;
}

.angle-finder { margin-top: 22px; max-width: 460px; }
.angle-finder label { display: block; margin-bottom: 8px; font-weight: 700; }
.angle-finder input { box-sizing: border-box; width: 100%; min-height: 42px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--ink); font: inherit; }
.angle-finder p { margin: 8px 0 0; color: var(--muted); font-size: 0.9rem; }

.angle-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.angle-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  padding: 18px;
}

.angle-card[hidden], .stats-section[hidden] { display: none; }

.angle-card h3 { margin: 0 0 8px; font-size: 1.1rem; }
.angle-card p { margin: 0 0 10px; }
.angle-card .eyebrow { margin-bottom: 8px; }
.angle-card .angle-proof { margin-bottom: 0; font-size: 0.9rem; }
.angle-card a, .angle-jump a { color: var(--brand); }
.season-table tr:target { background: var(--stats-highlight); }

.stats-wrap {
  max-width: 1180px;
}

.stats-header {
  align-items: center;
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px 22px;
}

.product-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px 18px;
  font-size: 0.88rem;
  font-weight: 700;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--ink);
  padding: 6px 11px;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 750;
  white-space: nowrap;
  cursor: pointer;
}

.theme-toggle:hover {
  background: var(--stats-subtle);
}

.theme-toggle:focus-visible,
.sort-button:focus-visible,
.team-card:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 2px;
}

.theme-icon {
  font-size: 1rem;
  line-height: 1;
}

.product-nav a {
  color: var(--brand);
  text-underline-offset: 4px;
}

.product-nav span[aria-disabled="true"] {
  color: var(--muted);
  cursor: default;
}

.product-nav small {
  display: block;
  color: var(--muted);
  font-size: 0.63rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.competition-heading {
  padding: 52px 0 34px;
}

.competition-heading h1 {
  max-width: none;
  font-size: clamp(2rem, 5vw, 3.5rem);
}

.competition-heading h1 span {
  color: var(--brand);
  white-space: nowrap;
}

.competition-intro {
  max-width: 690px;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.snapshot-banner {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 14px;
  width: fit-content;
  margin-top: 24px;
  border: 1px solid var(--snapshot-border);
  border-radius: 9px;
  background: var(--snapshot-bg);
  color: var(--snapshot-ink);
  padding: 10px 13px;
  font-size: 0.88rem;
}

.snapshot-banner strong {
  color: var(--snapshot-strong);
}

.stats-section {
  margin-bottom: 26px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  padding: 22px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px 24px;
  margin-bottom: 18px;
}

.section-heading h2,
.methodology h2 {
  margin: 0;
  font-size: 1.38rem;
  letter-spacing: -0.02em;
}

.section-heading .eyebrow {
  margin-bottom: 5px;
}

.section-heading > p {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  text-align: right;
}

.table-scroll {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.stats-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}

.stats-table caption {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

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

.stats-table tbody tr:last-child td {
  border-bottom: 0;
}

.stats-table th {
  background: var(--stats-subtle);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.025em;
  text-transform: uppercase;
}

.stats-table th:first-child,
.stats-table td:first-child,
.stats-table th[data-key="team"],
.stats-table th[data-key="player"],
.stats-table th[data-key="opponent"],
.stats-table .team-cell,
.stats-table .player-cell {
  text-align: left;
}

.stats-table .team-cell,
.stats-table .player-cell {
  color: var(--ink);
  font-weight: 700;
}

.stats-table .muted-cell {
  color: var(--muted);
  font-size: 0.8rem;
}

.stats-table tbody tr:hover {
  background: var(--stats-hover);
}

.sort-button {
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  cursor: pointer;
}

.sort-button::after {
  content: " ↕";
  color: var(--stats-sort-muted);
}

th[aria-sort="ascending"] .sort-button::after { content: " ↑"; color: var(--brand); }
th[aria-sort="descending"] .sort-button::after { content: " ↓"; color: var(--brand); }

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

.form-result {
  display: inline-grid;
  place-items: center;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  color: #fff;
  font-size: 0.64rem;
  font-weight: 800;
}

.form-result.win { background: var(--win); }
.form-result.draw { background: var(--draw); }
.form-result.loss { background: var(--loss); }

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

.compact-heading {
  margin-bottom: 10px;
}

.fixture-list {
  border-top: 1px solid var(--line);
}

.match-row {
  display: grid;
  grid-template-columns: minmax(92px, 0.75fr) minmax(0, 1.7fr) auto;
  align-items: center;
  gap: 8px 14px;
  border-bottom: 1px solid var(--line);
  padding: 13px 0;
}

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

.match-meta {
  color: var(--muted);
  font-size: 0.76rem;
}

.match-meta span {
  display: block;
}

.match-teams {
  min-width: 0;
  font-size: 0.88rem;
  font-weight: 650;
}

.match-team {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.match-team span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.match-score {
  font-size: 1.02rem;
  font-weight: 800;
}

.match-round {
  border-radius: 999px;
  background: var(--pill-bg);
  color: var(--pill-ink);
  padding: 3px 7px;
  font-size: 0.67rem;
  font-weight: 750;
  white-space: nowrap;
}

.fixture-note {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.8rem;
}

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

.leaderboard-card {
  min-width: 0;
}

.leaderboard-card h3 {
  margin: 0 0 9px;
  font-size: 1rem;
}

.leaderboard-card .table-scroll {
  border-radius: 7px;
}

.leaderboard-card .stats-table {
  font-size: 0.8rem;
}

.methodology {
  border-top: 1px solid var(--line);
  padding: 24px 0 8px;
}

.methodology h2 {
  font-size: 1rem;
}

.methodology p {
  max-width: 850px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.stats-page .site-footer a {
  color: var(--brand);
  font-weight: 700;
}

/* Team pages */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 0.8rem;
}

.breadcrumb li + li::before {
  content: "›";
  margin-right: 8px;
  color: var(--stats-sort-muted);
}

.breadcrumb a {
  color: var(--brand);
  text-underline-offset: 3px;
}

.team-heading {
  padding-top: 26px;
}

.team-identity {
  display: flex;
  align-items: center;
  gap: 18px;
}

.team-identity .eyebrow {
  margin-bottom: 6px;
}

.team-badge {
  display: inline-grid;
  flex: none;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--brand);
  color: var(--brand-ink);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0.04em;
}

.team-badge-large {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  font-size: 1.1rem;
}

.team-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 30px;
  margin: 22px 0 0;
}

.team-fact dt {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 750;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.team-fact dd {
  margin: 2px 0 0;
  font-weight: 700;
}

.team-fact dd.unknown-value {
  color: var(--muted);
  font-weight: 500;
}

.stat-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}

.stat-tile {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--stats-subtle);
  padding: 12px 13px;
}

.stat-label {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 750;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.stat-value {
  font-size: 1.45rem;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.stat-detail {
  color: var(--muted);
  font-size: 0.76rem;
}

.team-match-opponent {
  display: flex;
  align-items: center;
  gap: 9px;
}

.team-match-opponent a,
.stats-table .team-cell a {
  color: var(--ink);
  text-decoration: none;
}

.team-match-opponent a:hover,
.stats-table .team-cell a:hover {
  color: var(--brand);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.venue-tag {
  display: inline-grid;
  flex: none;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 800;
}

.result-chip {
  border-radius: 999px;
  color: #fff;
  padding: 3px 9px;
  font-size: 0.8rem;
  font-weight: 800;
  white-space: nowrap;
}

.result-chip.win { background: var(--win); }
.result-chip.draw { background: var(--draw); }
.result-chip.loss { background: var(--loss); }

.empty-note {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.stats-table tbody tr.is-current-team,
.stats-table tbody tr.is-current-team:hover {
  background: var(--stats-highlight);
  box-shadow: inset 3px 0 0 var(--brand);
}

.squad-groups {
  display: grid;
  gap: 22px;
}

.squad-group h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 9px;
  font-size: 1rem;
}

.squad-count {
  border-radius: 999px;
  background: var(--pill-bg);
  color: var(--pill-ink);
  padding: 1px 8px;
  font-size: 0.7rem;
  font-weight: 750;
}

/* Teams index */

.teams-directory {
  margin-bottom: 26px;
}

.team-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.team-grid > li {
  min-width: 0;
}

.team-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  height: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  color: var(--ink);
  padding: 18px;
  text-decoration: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.team-card:hover {
  border-color: var(--snapshot-border);
  box-shadow: 0 8px 22px var(--card-shadow);
  transform: translateY(-1px);
}

.team-card-head {
  display: flex;
  align-items: center;
  gap: 13px;
}

.team-card-name {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.team-card-name strong {
  font-size: 1.06rem;
  letter-spacing: -0.01em;
}

.team-card-ground {
  color: var(--muted);
  font-size: 0.8rem;
}

.team-card-arrow {
  flex: none;
  color: var(--stats-sort-muted);
  font-weight: 700;
  transition: color 0.15s ease, transform 0.15s ease;
}

.team-card:hover .team-card-arrow,
.team-card:focus-visible .team-card-arrow {
  color: var(--brand);
  transform: translateX(2px);
}

.team-card-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.team-card-stats div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.team-card-label {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 750;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.team-card-value {
  font-size: 1.28rem;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

/* Players */

.stats-table .player-cell a {
  color: var(--ink);
  text-decoration: none;
}

.stats-table .player-cell a:hover {
  color: var(--brand);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.player-subtitle {
  margin: 6px 0 0;
  color: var(--muted);
  font-weight: 650;
}

.player-notes {
  margin: 18px 0 20px;
  border: 1px solid var(--snapshot-border);
  border-radius: 10px;
  background: var(--snapshot-bg);
  color: var(--snapshot-ink);
  padding: 12px 16px;
  font-size: 0.86rem;
}

.player-notes ul {
  display: grid;
  gap: 4px;
  margin: 0;
  padding-left: 18px;
}

.player-filter {
  display: grid;
  grid-template-columns: minmax(0, 2fr) repeat(2, minmax(0, 1fr));
  align-items: end;
  gap: 12px;
  margin: 0 0 20px;
}

.player-filter-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 750;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.player-filter input,
.player-filter select {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  padding: 7px 10px;
  font: inherit;
  font-size: 0.9rem;
  letter-spacing: normal;
  text-transform: none;
}

.player-filter input:focus-visible,
.player-filter select:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 1px;
}

.player-filter-count {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.player-groups {
  display: grid;
  gap: 26px;
}

.player-group h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 9px;
  font-size: 1rem;
}

.player-group h3 a {
  color: var(--ink);
  text-decoration: none;
}

.player-group h3 a:hover {
  color: var(--brand);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.player-group-note {
  margin: -4px 0 9px;
  color: var(--muted);
  font-size: 0.82rem;
}

.stat-tiles > .empty-note {
  grid-column: 1 / -1;
  margin: 0;
}

.table-scroll > .empty-note {
  margin: 0;
  padding: 12px 13px;
}

.player-group[hidden],
.player-directory-table tr[hidden] {
  display: none;
}

/* Match links from result lists */
a.result-chip {
  text-decoration: none;
}

a.result-chip:hover,
a.result-chip:focus-visible {
  box-shadow: 0 0 0 2px var(--panel), 0 0 0 4px var(--brand);
}

a.match-link {
  display: block;
  border-radius: 6px;
  color: var(--ink);
  text-decoration: none;
}

a.match-link:hover .match-team span:first-child {
  color: var(--brand);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Matches directory */
.match-filter {
  grid-template-columns: minmax(0, 280px) minmax(0, 1fr);
}

.match-groups {
  display: grid;
  gap: 22px;
}

.match-group h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 9px;
  font-size: 1rem;
}

.section-heading h2 .squad-count {
  vertical-align: middle;
  font-size: 0.72rem;
  letter-spacing: normal;
}

.match-list {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.match-card {
  display: grid;
  grid-template-columns: minmax(150px, 0.9fr) minmax(0, 1fr) 64px minmax(0, 1fr) minmax(0, 1.1fr);
  align-items: center;
  gap: 6px 12px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  padding: 11px 6px;
  text-decoration: none;
}

a.match-card:hover {
  background: var(--stats-hover);
}

a.match-card:hover .match-card-team {
  color: var(--brand);
}

a.match-card:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: -3px;
}

.match-card-when,
.match-card-meta {
  color: var(--muted);
  font-size: 0.78rem;
}

.match-card-team {
  min-width: 0;
  overflow: hidden;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.match-card-home {
  text-align: right;
}

.match-card-score {
  justify-self: center;
  border-radius: 7px;
  background: var(--stats-subtle);
  padding: 3px 9px;
  font-size: 1rem;
  font-weight: 850;
  white-space: nowrap;
}

.match-card-status {
  background: none;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
}

.match-card.is-unlinked .match-card-team {
  font-weight: 600;
}

.match-group[hidden],
.match-item[hidden] {
  display: none;
}

/* Match page header */
.match-heading {
  padding-top: 26px;
}

.scoreboard {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 18px;
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  padding: 22px;
}

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

.scoreboard-home {
  flex-direction: row-reverse;
  text-align: right;
}

.scoreboard-name {
  min-width: 0;
  color: var(--ink);
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.scoreboard-name:hover {
  color: var(--brand);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.scoreboard-result {
  text-align: center;
}

.scoreboard-score {
  margin: 0;
  font-size: 2.8rem;
  font-weight: 850;
  line-height: 1;
  letter-spacing: -0.03em;
  white-space: nowrap;
}

.scoreboard-score span {
  margin: 0 0.14em;
  color: var(--muted);
}

.scoreboard-status {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
}

.match-facts {
  margin-top: 18px;
}

/* Goals */
.match-goals,
.match-lineups {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

.match-player-stats {
  display: grid;
  gap: 22px;
}

.match-goals h3,
.lineup-side h3,
.match-player-side h3 {
  margin: 0 0 8px;
  font-size: 1rem;
}

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

.goal-list li {
  padding: 4px 0;
}

.goal-list a,
.timeline-body a,
.lineup-name a {
  color: var(--ink);
  font-weight: 650;
  text-decoration: none;
}

.goal-list a:hover,
.timeline-body a:hover,
.lineup-name a:hover,
.lineup-side h3 a:hover {
  color: var(--brand);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.goal-minutes,
.event-note {
  color: var(--muted);
}

.unknown-value {
  color: var(--muted);
  font-style: italic;
}

.match-goals .empty-note {
  margin: 0;
}

/* Timeline: home events on the left, away on the right, minute in the middle */
.match-timeline {
  margin: 0;
  padding: 0;
  list-style: none;
}

.timeline-divider {
  margin: 8px 0;
  border-radius: 999px;
  background: var(--stats-subtle);
  color: var(--muted);
  padding: 5px 12px;
  font-size: 0.74rem;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-align: center;
  text-transform: uppercase;
}

.timeline-event {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 58px minmax(0, 1fr);
  align-items: start;
  border-bottom: 1px solid var(--line);
  padding: 9px 0;
}

.timeline-event:last-of-type {
  border-bottom: 0;
}

.timeline-minute {
  grid-column: 2;
  grid-row: 1;
  justify-self: center;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.timeline-body {
  grid-row: 1;
  min-width: 0;
  font-size: 0.88rem;
}

.timeline-event.is-home .timeline-body {
  grid-column: 1;
  text-align: right;
}

.timeline-event.is-away .timeline-body {
  grid-column: 3;
}

.timeline-head {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.timeline-event.is-home .timeline-head {
  flex-direction: row-reverse;
}

.timeline-team {
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--muted);
  padding: 0 4px;
  font-size: 0.62rem;
  font-weight: 800;
}

.timeline-score {
  border-radius: 6px;
  background: var(--brand);
  color: var(--brand-ink);
  padding: 1px 7px;
  font-size: 0.78rem;
  font-weight: 800;
}

.timeline-detail {
  color: var(--muted);
  font-size: 0.78rem;
}

.timeline-detail a {
  font-weight: 600;
}

.sub-on,
.sub-off {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 750;
  text-transform: uppercase;
}

.event-icon {
  display: inline-block;
  flex: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--muted);
}

.event-goal,
.event-penalty {
  background: var(--win);
}

.event-own_goal {
  background: var(--loss);
}

.event-missed_penalty {
  border: 2px solid var(--loss);
  background: transparent;
}

.event-yellow_card,
.event-second_yellow,
.event-red_card,
.lineup-mark.mark-yellow::before,
.lineup-mark.mark-red::before {
  width: 8px;
  height: 11px;
  border-radius: 2px;
}

.event-yellow_card { background: var(--card-yellow); }
.event-second_yellow { background: linear-gradient(135deg, var(--card-yellow) 50%, var(--card-red) 50%); }
.event-red_card { background: var(--card-red); }

.event-substitution {
  border: 2px solid var(--brand);
  background: transparent;
}

.event-var {
  border-radius: 2px;
  background: var(--brand);
}

/* Team comparison */
.match-comparison {
  display: grid;
  gap: 14px;
  max-width: 720px;
  margin: 0 auto;
}

.comparison-teams {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.9rem;
}

.comparison-row {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) 64px;
  align-items: center;
  gap: 4px 10px;
}

.comparison-label {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 750;
  letter-spacing: 0.05em;
  text-align: center;
  text-transform: uppercase;
}

.comparison-value {
  font-size: 1.1rem;
  font-weight: 800;
}

.comparison-away {
  text-align: right;
}

.comparison-bar {
  display: flex;
  grid-column: 1 / -1;
  gap: 3px;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--stats-subtle);
}

.comparison-fill-home {
  background: var(--brand);
}

.comparison-fill-away {
  background: var(--stats-sort-muted);
}

/* Lineups */
.lineup-side h4 {
  margin: 16px 0 6px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 750;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.lineup-side h3 a {
  color: var(--ink);
  text-decoration: none;
}

.lineup-list {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.lineup-player {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  padding: 6px 0;
  font-size: 0.87rem;
}

.lineup-player.is-unused {
  color: var(--muted);
}

.lineup-player.is-unused .lineup-name a {
  color: var(--muted);
  font-weight: 500;
}

.lineup-number {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
  text-align: right;
}

.lineup-name {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  min-width: 0;
}

.lineup-marks {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
}

.lineup-mark {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: 5px;
  background: var(--stats-subtle);
  color: var(--muted);
  padding: 1px 6px;
  font-size: 0.68rem;
  font-weight: 750;
  white-space: nowrap;
}

.lineup-mark.mark-captain {
  background: var(--pill-bg);
  color: var(--pill-ink);
}

.lineup-mark.mark-goal {
  background: var(--win);
  color: #fff;
}

.lineup-mark.mark-own-goal {
  background: var(--loss);
  color: #fff;
}

.lineup-mark.mark-yellow::before,
.lineup-mark.mark-red::before {
  content: "";
  display: inline-block;
}

.lineup-mark.mark-yellow::before { background: var(--card-yellow); }
.lineup-mark.mark-red::before { background: var(--card-red); }

.lineup-position {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 750;
}

.match-player-side .stats-table {
  font-size: 0.82rem;
}

@media (prefers-reduced-motion: reduce) {
  .team-card,
  .team-card-arrow {
    transition: none;
  }

  .team-card:hover,
  .team-card:hover .team-card-arrow,
  .team-card:focus-visible .team-card-arrow {
    transform: none;
  }
}

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

@media (max-width: 600px) {
  .team-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .team-card {
    padding: 16px;
  }

  .player-filter {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .stats-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .header-actions {
    width: 100%;
    align-items: flex-start;
    justify-content: space-between;
  }

  .product-nav {
    justify-content: flex-start;
  }

  .header-actions {
    gap: 10px;
  }

  .theme-toggle {
    padding-inline: 9px;
  }

  .theme-label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .competition-heading {
    padding-top: 38px;
  }

  .stats-section {
    padding: 17px;
  }

  .fixture-grid,
  .leaderboard-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .match-goals,
  .match-lineups {
    grid-template-columns: 1fr;
  }

  .match-card {
    grid-template-columns: minmax(0, 1fr) 58px minmax(0, 1fr);
  }

  .match-card-when,
  .match-card-meta {
    grid-column: 1 / -1;
    text-align: center;
  }

  .match-card-meta {
    grid-row: 3;
  }

  .scoreboard {
    gap: 10px;
    padding: 18px 12px;
  }

  .scoreboard-team,
  .scoreboard-home {
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }

  .scoreboard-name {
    font-size: 1.02rem;
  }

  .scoreboard-score {
    font-size: 2.2rem;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .section-heading > p {
    text-align: left;
  }
}

@media (max-width: 480px) {
  .product-nav {
    gap: 7px 12px;
  }

  .product-nav small {
    display: none;
  }

  .snapshot-banner {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .team-identity {
    gap: 13px;
  }

  .team-badge-large {
    width: 54px;
    height: 54px;
    border-radius: 14px;
    font-size: 0.92rem;
  }

  .stat-tiles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .team-facts {
    gap: 10px 22px;
  }

  .match-filter {
    grid-template-columns: 1fr;
  }

  .timeline-event {
    grid-template-columns: 44px minmax(0, 1fr);
  }

  .timeline-minute {
    grid-column: 1;
    justify-self: start;
  }

  .timeline-event.is-home .timeline-body,
  .timeline-event.is-away .timeline-body {
    grid-column: 2;
    text-align: left;
  }

  .timeline-event.is-home .timeline-head {
    flex-direction: row;
  }

  .scoreboard .team-badge-large {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    font-size: 0.78rem;
  }
}
