:root {
  --next: #a78bfa;
  color-scheme: dark;
  --bg: #0b0b0c;
  --surface: #151517;
  --text: #ececee;
  --muted: #8b8b92;
  --line: #26262a;
  --hero-1: #050505;
  --hero-2: #2a2a2e;
  --accent: #f5c518;
  --r16: #e4e4e7;
  --po: #7c7c84;
  --out: #36363b;
  --win: #22c55e;
  --draw: #71717a;
  --loss: #ef4444;
  --draw-cell: #facc15;
  --row-hover: #1d1d20;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 1240px; margin: 0 auto; padding: 0 16px; }

/* Header */
.hero {
  background: radial-gradient(circle at 85% -20%, var(--hero-2), var(--hero-1) 60%);
  color: #fff;
  padding: 28px 0 0;
  margin-bottom: 24px;
}
.brand { display: flex; align-items: center; gap: 14px; }
.star {
  font-size: 34px; color: var(--accent);
  filter: drop-shadow(0 0 10px rgba(245, 197, 24, .45));
}
h1 { margin: 0; font-size: clamp(22px, 5vw, 32px); font-weight: 800; letter-spacing: -.02em; }
.sub { margin: 2px 0 0; color: #a1a1aa; font-size: 14px; }

/* Competition switch */
.comp-switch { display: inline-flex; flex-wrap: wrap; gap: 4px; margin-top: 18px; padding: 4px; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .12); border-radius: 999px; }
.comp-switch a { color: #a1a1aa; text-decoration: none; font-size: 13px; font-weight: 600; padding: 7px 14px; border-radius: 999px; white-space: nowrap; }
.comp-switch a:hover { color: #fff; }
.comp-switch a.active { color: #0b0b0c; background: var(--accent); }
.comp-switch .short { display: none; }
.opp-ha { font-size: 9px; font-weight: 700; color: var(--muted); margin-right: 1px; }
.tabs { display: flex; gap: 4px; margin-top: 12px; }
.tab {
  background: none; border: 0; color: #a1a1aa; cursor: pointer;
  font: inherit; font-weight: 600; font-size: 15px;
  padding: 12px 16px; border-bottom: 3px solid transparent;
}
.tab:hover { color: #fff; }
.tab.active { color: #fff; border-bottom-color: var(--accent); }

/* Card + table */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}
.table-scroll { overflow-x: auto; }

.standings { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.standings th {
  text-align: center; font-size: 12px; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: .04em;
  padding: 12px 6px; border-bottom: 1px solid var(--line);
}
.standings td { text-align: center; padding: 9px 6px; border-bottom: 1px solid var(--line); }
.standings tbody tr:last-child td { border-bottom: 0; }
.standings tbody tr:hover { background: var(--row-hover); }

.standings th.team, .standings td.team { text-align: left; }
/* Rank column has a fixed width; the sticky team column is pinned right next to it (same variable). */
.standings { --pos-w: 44px; }
.standings .pos { width: var(--pos-w); min-width: var(--pos-w); max-width: var(--pos-w); position: relative; font-weight: 600; }
.standings td.pos::before {
  content: ""; position: absolute; left: 0; top: 6px; bottom: 6px;
  width: 4px; border-radius: 0 3px 3px 0; background: var(--zone, transparent);
}
tr.z-r16 { --zone: var(--r16); }
tr.z-po  { --zone: var(--po); }
tr.z-out { --zone: var(--out); }
tr.cut td { border-bottom: 2px dashed var(--line); }

.team-cell { display: flex; align-items: center; gap: 10px; min-width: 150px; }
.crest { width: 22px; height: 22px; object-fit: contain; flex: none; }
.team-name { font-weight: 600; white-space: nowrap; }
.team-link { display: inline-flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; min-width: 0; }
.team-link:hover .team-name, .team-link:focus-visible .team-name { text-decoration: underline; text-underline-offset: 3px; }
.standings .pts { font-weight: 800; }
/* Goals are secondary to points and results */
.standings td.goals { color: var(--muted); font-size: 13px; }
.standings th.goals { opacity: .75; }

.form { display: inline-flex; gap: 3px; }
.form i {
  width: 18px; height: 18px; border-radius: 4px; font-style: normal;
  font-size: 10px; font-weight: 700; color: #fff; display: grid; place-items: center;
}
.form .W { background: var(--win); }
.form .D { background: var(--draw); }
.form .L { background: var(--loss); }

.empty { padding: 40px 16px !important; color: var(--muted); }

.legend {
  list-style: none; padding: 0; margin: 14px 2px 0;
  display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: 13px; color: var(--muted);
}
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.dot.z-r16 { background: var(--r16); }
.dot.z-po  { background: var(--po); }
.dot.z-out { background: var(--out); }

/* Matches */
.matchday-bar { display: flex; gap: 8px; margin-bottom: 14px; }
.matchday-bar select, .md-nav {
  font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px;
}
.matchday-bar select { flex: 1; font-weight: 600; cursor: pointer; }
.md-nav { width: 44px; font-size: 20px; line-height: 1; cursor: pointer; }
.md-nav:disabled { opacity: .4; cursor: default; }

.match-list { display: grid; gap: 18px; }
.day h3 { margin: 0 0 8px 2px; font-size: 13px; font-weight: 600; color: var(--muted); letter-spacing: .02em; }
.day.focus h3 { font-size: 16px; color: var(--text); }
.match {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px;
  padding: 12px 14px; border-bottom: 1px solid var(--line);
}
.match:last-child { border-bottom: 0; }
/* Wide screens: a day's matches in two columns, filled column by column (see dayCardHtml). */
.match-gap { display: none; }
@media (min-width: 900px) {
  .day-grid { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: repeat(var(--rows), auto); grid-auto-flow: column; }
  .day-grid .match-gap { display: block; }
  .day-grid .col-left { border-right: 1px solid var(--line); }
  .day-grid .match.col-end { border-bottom: 0; }
}
.side { display: flex; align-items: center; gap: 10px; min-width: 0; font-weight: 600; }
.side span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side.home { justify-content: flex-end; text-align: right; }
.score {
  min-width: 64px; text-align: center; font-weight: 800; font-size: 16px;
  font-variant-numeric: tabular-nums; padding: 4px 8px; border-radius: 8px; background: var(--bg);
}
.score.time { font-weight: 600; font-size: 14px; color: var(--muted); }
.score.live { background: var(--loss); color: #fff; }
.side .loser { color: var(--muted); font-weight: 500; }

/* Footer */
.foot {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px;
  color: var(--muted); font-size: 13px; padding-top: 24px; padding-bottom: 32px;
}
.foot a { color: inherit; }

@media (max-width: 600px) {
  .comp-switch a { padding: 6px 12px; font-size: 13px; }
  .comp-switch .long { display: none; }
  .comp-switch .short { display: inline; }
  .tabs { overflow-x: auto; scrollbar-width: none; }
  .tab { padding: 12px 10px; font-size: 14px; white-space: nowrap; }
  .hide-sm { display: none; }
  .standings { font-size: 13px; }
  .team-cell { min-width: 0; }
  .standings { --pos-w: 34px; }
  .crest { width: 18px; height: 18px; }
  .match { gap: 8px; padding: 10px; }
  .side { gap: 6px; font-size: 14px; }
  .score { min-width: 54px; font-size: 15px; }
}

/* Opponent-per-pot columns */
.standings th.pot-head { color: var(--text); border-bottom: 0; padding-bottom: 2px; }
.standings .ha-row th { padding-top: 2px; font-size: 11px; }
.standings .pot-start { border-left: 1px solid var(--line); }
.opp-cell { padding: 6px 4px !important; }
.opp { display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 50px; padding: 3px 2px; border-radius: 6px; }
.opp-cell.next .opp { box-shadow: 0 0 0 1px color-mix(in srgb, var(--next) 60%, transparent); }
.standings .ha-row th.next-md { color: var(--next); }
.table-tools { display: flex; justify-content: flex-end; }
.table-tools .seg-buttons { margin-bottom: 10px; }
.opp-team { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.opp-team .crest { width: 16px; height: 16px; }
.res {
  font-size: 11px; font-weight: 700; line-height: 1; padding: 3px 6px; border-radius: 4px;
  color: #fff; white-space: nowrap;
}
.res.win { background: var(--win); color: #04130a; }
.res.draw { background: var(--draw-cell); color: #1a1500; }
.res.loss { background: var(--loss); color: #1a0505; }
.res.live { background: var(--loss); animation: pulse 1.6s ease-in-out infinite; }
.res.up { color: var(--muted); background: none; font-weight: 500; padding: 3px 0; }
@keyframes pulse { 50% { opacity: .55; } }

/* Keep rank + team visible while scrolling sideways */
.standings .sticky { position: sticky; z-index: 1; background: var(--surface); }
.standings .pos.sticky { left: 0; }
.standings .team.sticky { left: var(--pos-w); box-shadow: 1px 0 0 var(--line); }
.standings tbody tr:hover .sticky { background: var(--row-hover); }

/* Season picker */
.season-select {
  margin-left: auto; font: inherit; font-weight: 600; font-size: 14px;
  color: #fff; background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .18); border-radius: 10px;
  padding: 8px 12px; cursor: pointer;
}
.season-select option { color: var(--text); background: var(--surface); }

/* Final result column (finished seasons only) */
.standings.no-result .result-col { display: none; }
.standings .result-col { text-align: left; padding-left: 14px; border-left: 1px solid var(--line); white-space: nowrap; }
.result { font-size: 12px; font-weight: 600; color: var(--muted); }
.result.res-strong { color: var(--text); }
.result.res-final { color: var(--text); font-weight: 700; border: 1px solid var(--text); border-radius: 4px; padding: 2px 6px; }
.result.res-winner { color: #1a1500; font-weight: 800; background: var(--accent); border-radius: 4px; padding: 2px 6px; }
.result.res-winner::before { content: "★ "; }

/* Prediction columns (current season, league phase only) */
.standings.no-pred .pred-col { display: none; }
.standings .pred-first { border-left: 1px solid var(--line); }
.standings td.pred-col { min-width: 56px; }
.pred-num { display: block; font-weight: 700; font-variant-numeric: tabular-nums; }
.pred-bar { display: block; height: 4px; margin: 3px auto 0; width: 40px; background: var(--bg); border-radius: 2px; overflow: hidden; }
.pred-bar span { display: block; height: 100%; background: var(--text); border-radius: 2px; }

/* Seasons without draw-pot data hide the opponent columns */
.standings.no-pots .pot-head,
.standings.no-pots .ha-row,
.standings.no-pots .opp-cell { display: none; }
#view-table:has(.standings.no-pots) .table-tools { display: none; }

/* Statistics */
body[data-view="stats"] .season-select,
body[data-view="sim"] .season-select { visibility: hidden; }

body[data-view="club"] .season-select,
body[data-view="match"] .season-select { visibility: hidden; }

/* Home/draw/away chance bar under upcoming matches */
.odds-bar { grid-column: 1 / -1; display: flex; gap: 2px; height: 4px; margin: 2px auto 0; width: min(100%, 260px); border-radius: 2px; overflow: hidden; }
.odds-bar .home-win { background: var(--win); }
.odds-bar .draw { background: var(--draw-cell); }
.odds-bar .away-win { background: var(--loss); }
.odds-bar.odds-empty { visibility: hidden; }
.match .score { line-height: 19px; } /* score and kick-off time boxes equally high */
.pr-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.pr-top .seg-buttons { margin: 0; flex-wrap: nowrap; }
.pr-top .seg-buttons button { padding: 4px 12px; font-size: 12px; }
.pr-odds { margin-top: 4px; }
.pr-odds-labels { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--muted); }
.pr-odds-labels b { color: var(--text); }
.odds-bar.pr-bar { width: 100%; height: 8px; margin-top: 6px; border-radius: 4px; }
.pr-xg { display: flex; flex-direction: column; align-items: center; gap: 6px; margin: 18px 0 6px; }
.pr-xg-label { font-size: 12px; color: var(--muted); }
.pr-xg-score { display: flex; align-items: center; gap: 10px; font-size: 26px; font-weight: 800; }
.pr-xg-score > span { color: var(--muted); font-weight: 400; }
.pr-xg-score .crest { width: 26px; height: 26px; }
.pr-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px 22px; margin-top: 14px; }
.pr-grid h3 { margin: 0 0 8px; font-size: 12px; font-weight: 600; color: var(--muted); }
.pr-score { display: flex; justify-content: space-between; font-size: 13px; padding: 3px 0; border-bottom: 1px solid var(--line); }
.pr-score span { color: var(--muted); }
.pr-dist-row { display: grid; grid-template-columns: 58px 1fr 40px; align-items: center; gap: 8px; font-size: 13px; padding: 2px 0; }
.pr-dist-row > span:first-child { color: var(--muted); }
.pr-dist-row b { text-align: right; font-weight: 600; }
.pr-dist-bar { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; }
.pr-dist-bar span { display: block; height: 100%; background: var(--muted); border-radius: 3px; }

/* Clickable match rows (Matches tab) */
.match.clickable, .fixture-row.clickable, .next-match.clickable { cursor: pointer; }
.fixture-row.clickable:hover, .fixture-row.clickable:focus-visible { background: var(--row-hover); outline: none; }
.next-match.clickable:hover, .next-match.clickable:focus-visible { background: var(--row-hover); outline: none; }
.match.clickable:hover, .match.clickable:focus-visible { background: var(--row-hover); outline: none; }

/* Match detail */
.back-btn {
  font: inherit; font-size: 14px; font-weight: 600; color: var(--muted); cursor: pointer;
  background: none; border: 0; padding: 0 0 14px;
}
.back-btn:hover { color: var(--text); }
.md-head { text-align: center; }
.md-round { color: var(--muted); font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.md-teams { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; margin: 18px 0 8px; }
.md-team { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; color: inherit; text-decoration: none; border-radius: 10px; padding: 8px 4px; }
.md-team:hover, .md-team:focus-visible { background: var(--row-hover); outline: none; }
.md-team:hover b { text-decoration: underline; text-underline-offset: 3px; }
.md-team img { width: 64px; height: 64px; object-fit: contain; }
.md-team b { font-size: 18px; }
.md-team span { color: var(--muted); font-size: 12px; }
.md-centre { min-width: 120px; }
.md-score { font-size: 40px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.md-score.live { color: var(--loss); }
.md-dash { margin: 0 .22em; }
.md-time { font-size: 32px; font-weight: 800; font-variant-numeric: tabular-nums; }
.md-sub { color: var(--muted); font-size: 12px; margin-top: 2px; }
.md-side { display: flex; flex-direction: column; align-items: center; gap: 10px; min-width: 0; }
.md-teams { align-items: start; }
.md-centre { align-self: center; }
.md-form { display: flex; justify-content: center; align-items: flex-start; }
.form-group { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 0 8px; }
.form-group + .form-group { border-left: 1px solid var(--line); }
.form-chips { display: flex; gap: 4px; }
.form-chips .res { display: inline-grid; place-items: center; width: 22px; height: 22px; padding: 0; font-size: 11px; }
.form-group small { color: var(--muted); font-size: 10px; font-weight: 600; letter-spacing: .03em; }
.facts { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.facts li { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--bg); border-radius: 8px; font-size: 14px; }
.facts .crest { width: 22px; height: 22px; }
.h2h-card .empty-note { margin-top: 6px; }
.h2h-wrap { display: grid; grid-template-columns: minmax(240px, 320px) 1fr; gap: 12px 28px; align-items: start; margin-top: 10px; }
.h2h-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; text-align: center; }
.h2h-list { min-width: 0; }
.cmp-wrap { max-width: 640px; margin: 0 auto; }
.cmp-wrap .seg-buttons { justify-content: center; }
@media (max-width: 700px) { .h2h-wrap { grid-template-columns: 1fr; } }
.h2h-summary div { background: var(--bg); border-radius: 8px; padding: 10px 6px; display: flex; flex-direction: column; }
.h2h-summary b { font-size: 22px; font-weight: 800; }
.h2h-summary span { color: var(--muted); font-size: 12px; }
.h2h-row { display: grid; grid-template-columns: 96px 1fr auto; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.h2h-row:last-child { border-bottom: 0; }
.h2h-teams b { padding: 0 4px; }
.cmp-head { display: flex; justify-content: space-between; margin: 4px 0 6px; font-size: 13px; font-weight: 700; }
.cmp-head span { display: flex; align-items: center; gap: 6px; }
.cmp-head .crest { width: 18px; height: 18px; }
.cmp-row { display: grid; grid-template-columns: 70px 1fr 70px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.cmp-row:last-child { border-bottom: 0; }
.cmp-label { text-align: center; color: var(--muted); font-size: 13px; }
.cmp-val { font-size: 16px; font-weight: 600; color: var(--muted); }
.cmp-val:last-child { text-align: right; }
.cmp-val.better { color: var(--text); font-weight: 800; }
@media (max-width: 600px) {
  .md-team img { width: 44px; height: 44px; }
  .md-team b { font-size: 15px; }
  .md-score { font-size: 32px; }
  .md-time { font-size: 24px; }
  .md-centre { min-width: 84px; }
  .md-teams { gap: 8px; }
  .form-group { padding: 0 4px; }
  .form-chips { gap: 2px; }
  .form-chips .res { width: 17px; height: 17px; font-size: 10px; }
  .h2h-row { grid-template-columns: 1fr; gap: 2px; }
}

/* Penalty shoot-out under a knockout score */
.score .pens { display: block; font-size: 10px; font-weight: 600; color: var(--muted); }

/* Club */
.club-picker { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.club-picker label { color: var(--muted); font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.club-picker select {
  flex: 1; max-width: 360px; font: inherit; font-weight: 600; color: var(--text); background: var(--surface);
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; cursor: pointer;
}
.stats-grid.club-grid { grid-template-columns: repeat(auto-fit, minmax(min(400px, 100%), 1fr)); }
.club-head { display: grid; grid-template-columns: auto 1fr; gap: 16px 20px; align-items: center; align-content: start; }
.club-crest { width: 72px; height: 72px; object-fit: contain; }
.club-title h2 { font-size: 24px; font-weight: 800; letter-spacing: -.01em; }
.club-title .hint { margin-bottom: 0; }
.club-now { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 16px 32px; padding-top: 14px; border-top: 1px solid var(--line); }
.club-pos { display: flex; align-items: center; gap: 12px; }
.club-pos .pchip { min-width: 40px; height: 40px; font-size: 18px; border-radius: 8px; }
.club-pos b { display: block; font-size: 16px; }
.club-pos span { color: var(--muted); font-size: 13px; }
.club-stats { display: flex; gap: 28px; }
.club-stats div { display: flex; flex-direction: column; }
.club-stats b { font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; }
.club-stats span { color: var(--muted); font-size: 12px; }
.club-result { color: var(--muted); font-size: 13px; }
.club-extra { grid-column: 1 / -1; display: grid; grid-template-columns: auto 1fr; gap: 12px 28px; padding-top: 14px; border-top: 1px solid var(--line); }
.club-extra .sub-head { margin-top: 0; }
.club-form { justify-content: flex-start; }
.club-fact { grid-column: 1 / -1; padding-top: 14px; border-top: 1px solid var(--line); }
.club-fact .sub-head { margin-top: 0; }
.club-fact p { margin: 4px 0 0; font-size: 14px; line-height: 1.45; }
.club-form .form-group:first-child { padding-left: 0; }
@media (max-width: 600px) { .club-extra { grid-template-columns: 1fr; } }
.next-match { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px; margin-top: 6px; background: var(--bg); border-radius: 10px; }
.next-opp { display: flex; align-items: center; gap: 12px; min-width: 0; }
.next-opp .crest { width: 40px; height: 40px; }
.next-name { font-weight: 700; font-size: 16px; }
.next-meta { color: var(--muted); font-size: 12px; margin-top: 2px; }
.next-when { display: flex; flex-direction: column; align-items: flex-end; white-space: nowrap; font-size: 13px; }
.next-when span { color: var(--muted); }
.sub-head.first { margin-top: 12px; }
.sub-head { margin: 16px 0 4px; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.fixture-row { display: grid; grid-template-columns: 92px 24px 1fr auto; align-items: center; gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.fixture-row:last-child { border-bottom: 0; }
.fx-when { color: var(--muted); }
.fx-ha { font-size: 11px; font-weight: 700; text-align: center; border: 1px solid var(--line); border-radius: 4px; padding: 1px 0; }
.fx-ha.h { color: var(--text); }
.fx-ha.a { color: var(--muted); }
.fx-opp { display: flex; align-items: center; gap: 6px; font-weight: 600; min-width: 0; }
.fx-opp .crest { width: 18px; height: 18px; }
.fx-extra { color: var(--muted); font-size: 12px; white-space: nowrap; }
.result-row { grid-template-columns: 64px 24px 1fr 64px 120px; }  /* fixed score + round columns so rows line up */
.fx-score { white-space: nowrap; text-align: center; }
.fx-score small { display: block; margin-top: 2px; font-size: 10px; }
.fx-score .res { display: inline-block; font-size: 12px; padding: 3px 7px; }
.honour { padding: 8px 0 10px; }
.honour + .honour { border-top: 1px solid var(--line); }
.honour-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 6px; }
.honour-head b { font-size: 22px; font-weight: 800; }
.honour.won .honour-head b { color: var(--accent); }
.honour-head span { font-weight: 600; font-size: 13px; }
.honour.lost .honour-head span { color: var(--muted); }
.final-years { display: flex; flex-wrap: wrap; gap: 4px; }
.final-year { font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; padding: 2px 6px; border-radius: 4px; cursor: default; }
.honour.won .final-year { background: var(--accent); color: #1a1500; }
.honour.lost .final-year { border: 1px solid var(--line); color: var(--muted); }
.past-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.past-row:last-child { border-bottom: 0; }
.past-season { width: 64px; font-weight: 700; }
.comp-sticker {
  flex: none; width: 132px; text-align: center; font-size: 11px; font-weight: 700; letter-spacing: .02em;
  padding: 3px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--text); white-space: nowrap;
}
.comp-sticker.cl { border-color: var(--accent); color: var(--accent); }
.comp-sticker.el { border-color: #a1a1aa; }
.comp-sticker.ecl { border-color: #52525b; color: #a1a1aa; }
.comp-sticker.none { color: var(--muted); }
.comp-sticker .short { display: none; }
@media (max-width: 600px) {
  .comp-sticker { width: 44px; padding: 3px 4px; }
  .comp-sticker .long { display: none; }
  .comp-sticker .short { display: inline; }
}
.cl-icon {
  width: 22px; height: 22px; flex: none; display: grid; place-items: center; border-radius: 50%;
  font-size: 12px; line-height: 1; color: var(--accent); border: 1px solid var(--accent); cursor: default;
}
.cl-icon.off { border-color: var(--line); color: transparent; }
.past-pts { color: var(--muted); font-size: 13px; width: 52px; }
.muted { color: var(--muted); font-size: 13px; }
.club-record tr.group td { text-align: left; padding-top: 16px; font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; border-bottom: 1px solid var(--line); }
.club-record tr.subtotal td { font-weight: 700; }
.club-record tr.group .comp-sticker { display: inline-block; width: auto; text-transform: none; letter-spacing: .02em; }
.club-record .goals { color: var(--muted); }
.club-record .goals-start { border-left: 1px solid var(--line); }
.club-record tr.total td { font-weight: 800; border-top: 2px solid var(--muted); padding-top: 12px; }
@media (max-width: 600px) {
  .club-stats { gap: 18px; }
  .fixture-row { grid-template-columns: 78px 22px 1fr; }
  .result-row { grid-template-columns: 52px 22px 1fr 64px; }
  .fx-extra { display: none; }
}

/* Simulation */
.sim-table { min-width: 680px; }
.sim-table td { padding: 7px 6px; }
.sim-table .rank { color: var(--muted); width: 28px; }
.sim-pct { font-weight: 700; font-variant-numeric: tabular-nums; }
.dist-head { text-align: left !important; }
.dist { display: flex; gap: 1px; height: 16px; min-width: 180px; }
.dist span { flex: 1; border-radius: 1px; }
.dist .z1 { background: var(--win); }
.dist .z2 { background: var(--draw-cell); }
.dist .z3 { background: var(--loss); }
.pick-row { padding: 10px 0; border-bottom: 1px solid var(--line); }
.pick-row:last-child { border-bottom: 0; }
.pick-teams { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: center; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.pick-teams .side { display: flex; align-items: center; gap: 6px; min-width: 0; color: var(--muted); }
.pick-teams .side.home { justify-content: flex-end; }
.pick-teams .side.fav { color: var(--text); }
.pick-teams .crest { width: 18px; height: 18px; }
.pick-teams .vs { color: var(--muted); }
.seg.picked { outline: 2px solid var(--text); outline-offset: -2px; }
.pick-label { margin-top: 5px; font-size: 12px; color: var(--muted); text-align: center; }
.pick-label b { color: var(--text); }
.sim-final td { padding: 6px; }
.sim-final .pos { position: relative; width: 36px; font-weight: 600; }
.sim-final td.pos::before {
  content: ""; position: absolute; left: 0; top: 5px; bottom: 5px;
  width: 3px; border-radius: 0 3px 3px 0; background: var(--zone, transparent);
}
.sim-final tr.cut td { border-bottom: 2px dashed var(--line); }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr)); gap: 16px; }
.stat-card { padding: 18px 20px; }
.stat-card.wide { grid-column: 1 / -1; }
.stat-card h2 { margin: 0; font-size: 17px; font-weight: 700; }
.stat-card .hint { margin: 4px 0 14px; color: var(--muted); font-size: 13px; }
.sim-asof { margin: 6px 0 0; font-size: 13px; font-weight: 600; color: var(--text); }
.stat-card .empty { padding: 16px 0 !important; }

.mini { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.mini th {
  font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase;
  letter-spacing: .04em; text-align: center; padding: 6px; border-bottom: 1px solid var(--line);
}
.mini td { text-align: center; padding: 10px 6px; border-bottom: 1px solid var(--line); }
.mini tr:last-child td { border-bottom: 0; }
.mini th:first-child, .mini td:first-child, .mini .team { text-align: left; }
.mini .big { font-size: 20px; font-weight: 800; }
.mini .season-cell { font-weight: 600; white-space: nowrap; }
.mini tr.ongoing td { color: var(--muted); }
.tag {
  font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
  color: var(--muted); border: 1px solid var(--line); border-radius: 4px; padding: 1px 4px; margin-left: 4px;
}

.hda-row { display: grid; grid-template-columns: 92px 1fr; align-items: center; gap: 12px; margin-bottom: 12px; }
.hda-label { font-weight: 600; font-size: 14px; display: flex; flex-direction: column; }
.hda-label small { color: var(--muted); font-weight: 400; font-size: 11px; }
.hda-bar { display: flex; height: 30px; border-radius: 8px; overflow: hidden; gap: 2px; }
.seg { display: grid; place-items: center; font-size: 12px; font-weight: 800; min-width: 34px; }
.seg.home-win, .pchip.z1 { background: var(--win); color: #04130a; }
.seg.draw, .pchip.z2 { background: var(--draw-cell); color: #1a1500; }
.seg.away-win, .pchip.z3 { background: var(--loss); color: #1a0505; }

.chart-table { margin-top: 10px; }
.chart-table summary { cursor: pointer; color: var(--muted); font-size: 13px; }
.chart-table .mini { margin-top: 8px; }
.chart-table small { font-weight: 400; text-transform: none; }

.seg-buttons { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.seg-buttons button {
  font: inherit; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer;
  background: transparent; border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px;
}
.seg-buttons button:hover { color: var(--text); }
.seg-buttons button.active { color: var(--bg); background: var(--text); border-color: var(--text); }

.pvp-scroll { overflow-x: auto; }
.pvp { width: 100%; min-width: 520px; border-collapse: separate; border-spacing: 6px; font-variant-numeric: tabular-nums; }
.pvp th { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.pvp thead th { padding-bottom: 2px; }
.pvp tbody th { text-align: left; white-space: nowrap; padding-right: 6px; width: 1%; }
.pvp .corner { text-align: left; font-size: 10px; text-transform: none; letter-spacing: 0; font-weight: 500; }
.pvp-cell { background: var(--bg); border-radius: 8px; padding: 8px; vertical-align: middle; }
.pvp-bar { display: flex; height: 24px; border-radius: 6px; overflow: hidden; gap: 2px; }
.pvp-bar .seg { min-width: 0; font-size: 11px; }
.pvp-meta { margin-top: 5px; font-size: 11px; color: var(--muted); text-align: center; }
.pvp-meta b { color: var(--text); }
.pvp-empty { color: var(--muted); }

.draw-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr)); gap: 12px 28px; }
.draw-cols h3 { margin: 0 0 4px; font-size: 14px; font-weight: 700; }
.draws td { padding: 7px 6px; }
.draws .rank { color: var(--muted); width: 28px; }
.draws th.draw-val, .draws td.draw-val { text-align: right; }
.draws .draw-val { white-space: nowrap; }
.draws .draw-val b { display: inline-block; width: 36px; font-variant-numeric: tabular-nums; }
.draw-bar { display: inline-block; vertical-align: middle; width: 90px; height: 8px; margin-right: 8px; background: var(--bg); border-radius: 4px; overflow: hidden; }
.draw-bar span { display: block; height: 100%; background: var(--text); border-radius: 4px; }
.draws tbody tr:hover td { background: var(--row-hover); }
.pot-badge { font-size: 11px; font-weight: 700; color: var(--muted); border: 1px solid var(--line); border-radius: 4px; padding: 1px 5px; }
.draws .pchip { display: inline-grid; }
.ongoing-note { margin-top: -4px; }

.status-badge {
  margin-left: 2px; font-size: 10px; font-weight: 700; white-space: nowrap; color: var(--text);
  border: 1px solid; border-radius: 4px; padding: 1px 5px; cursor: default;
}
.status-badge.z1 { border-color: var(--win); }
.status-badge.z2 { border-color: var(--draw-cell); }
.status-badge.z3 { border-color: var(--loss); color: var(--muted); }
.z1-dot { background: var(--win); }
.z2-dot { background: var(--draw-cell); }
.z3-dot { background: var(--loss); }
.status-group { padding: 10px 0; border-bottom: 1px solid var(--line); }
.status-group:last-of-type { border-bottom: 0; }
.status-group h3 { margin: 0 0 8px; font-size: 14px; font-weight: 700; display: flex; align-items: center; }
.status-group .count { margin-left: 8px; color: var(--muted); font-weight: 600; }
.status-teams { display: flex; flex-wrap: wrap; gap: 6px; }
.status-team {
  display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600;
  background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px 4px 6px;
}
.status-team .crest { width: 18px; height: 18px; }
.empty-note { color: var(--muted); font-size: 14px; margin: 0; }

.ko { min-width: 640px; table-layout: fixed; }
.ko thead th:first-child, .ko tbody th { width: 92px; }
.ko-cell { text-align: center; background: var(--bg); border-radius: 8px; padding: 8px 10px; }
.ko-cell.na { color: var(--muted); }
.ko-num { font-size: 12px; color: var(--muted); }
.ko-num b { font-size: 18px; font-weight: 800; color: var(--text); }
.ko-bar { height: 6px; margin-top: 6px; background: var(--surface); border-radius: 3px; overflow: hidden; }
.ko-bar span { display: block; height: 100%; background: var(--text); border-radius: 3px; }

.pot-seasons { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 12px 28px; }
.pot-season h3 { margin: 0 0 8px; font-size: 14px; font-weight: 700; }
.pot-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.pot-row:last-child { border-bottom: 0; }
.pot-label { width: 44px; flex: none; color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; }
.pchip {
  min-width: 26px; height: 24px; padding: 0 4px; border-radius: 5px; display: grid; place-items: center;
  font-size: 12px; font-weight: 800; font-variant-numeric: tabular-nums; cursor: default;
}

/* Club page: points vs expected chart */
.pc-summary { display: flex; flex-wrap: wrap; gap: 14px 28px; margin-bottom: 10px; }
.pc-summary > div { display: flex; align-items: center; gap: 8px; }
.pc-summary b { font-size: 20px; font-weight: 800; }
.pc-summary span { color: var(--muted); font-size: 12px; }
.pc-summary .pchip { color: #0b0b0c; font-size: 14px; font-weight: 800; min-width: 30px; height: 30px; display: inline-grid; place-items: center; border-radius: 6px; }
.pc-chart { width: 100%; max-width: 620px; height: auto; display: block; }
.pc-grid { stroke: var(--line); stroke-width: 1; }
.pc-axis { fill: var(--muted); font-size: 11px; }
.pc-act { fill: none; stroke: var(--text); stroke-width: 2.5; stroke-linejoin: round; }
.pc-exp { fill: none; stroke: var(--muted); stroke-width: 2; stroke-linejoin: round; }
.pc-proj { fill: none; stroke: var(--text); stroke-width: 2; stroke-dasharray: 5 5; opacity: .55; }
.pc-dot { stroke: var(--surface); stroke-width: 2; }
.pc-dot.win { fill: var(--win); } .pc-dot.draw { fill: var(--draw-cell); } .pc-dot.loss { fill: var(--loss); }
.pc-end { fill: var(--text); font-size: 12px; font-weight: 700; }
@media (max-width: 600px) { .pc-axis { font-size: 20px; } .pc-end { font-size: 20px; } }
.pc-legend { display: flex; gap: 18px; list-style: none; padding: 0; margin: 6px 0 0; font-size: 12px; color: var(--muted); }
.pc-legend li { display: flex; align-items: center; gap: 6px; }
.pc-key { width: 18px; height: 0; border-top: 2.5px solid var(--text); }
.pc-key.exp { border-top: 2px solid var(--muted); }
.pc-key.proj { border-top: 2px dashed var(--text); opacity: .55; }

/* Statistics: season comparison tables */
.cmp-seasons th, .cmp-seasons td { text-align: right; }
.cmp-seasons th:first-child, .cmp-seasons td.row-label { text-align: left; color: var(--muted); white-space: nowrap; }
.cmp-seasons .now { color: var(--text); font-weight: 700; }
.cmp-seasons td:not(.now):not(.row-label) { color: var(--muted); }
