:root {
  --bg: #0d1117;
  --bg-card: #161b22;
  --bg-card-2: #1c2230;
  --border: #2d333b;
  --text: #e6edf3;
  --text-dim: #8b949e;
  --text-faint: #586069;
  --live: #f85149;
  --soon: #e3b341;
  --advance: #3fb950;
  --third: #d29922;
  --accent: #58a6ff;
  --win: #3fb950;
  --upset: #f0883e;
  --pa: #58a6ff;        /* prob bar: away win */
  --pd: #545d68;        /* prob bar: draw */
  --ph: #3fb950;        /* prob bar: home win */
  --zebra: rgba(255, 255, 255, 0.02);
  --table-line: rgba(45, 51, 59, 0.5);
  --topbar-bg: rgba(13, 17, 23, 0.95);
  --mstar-dim: rgba(88, 166, 255, 0.65);
  --yc: #e3b341;       /* yellow-card chip */
}

html[data-theme="light"] {
  --bg: #f6f8fa;
  --bg-card: #ffffff;
  --bg-card-2: #eaeef2;
  --border: #d0d7de;
  --text: #1f2328;
  --text-dim: #57606a;
  --text-faint: #8c959f;
  --live: #d1242f;
  --soon: #9a6700;
  --advance: #1a7f37;
  --third: #9a6700;
  --accent: #0969da;
  --win: #1a7f37;
  --upset: #bc4c00;
  --pa: #218bff;
  --pd: #afb8c1;
  --ph: #2da44e;
  --zebra: rgba(0, 0, 0, 0.03);
  --table-line: rgba(208, 215, 222, 0.6);
  --topbar-bg: rgba(246, 248, 250, 0.95);
  --mstar-dim: rgba(9, 105, 218, 0.55);
  --yc: #f2c100;
}

html[data-theme="pitch"] {
  --bg: #0a3d1e;
  --bg-card: #0e4a25;
  --bg-card-2: #14592e;
  --border: #1d7a3e;
  --text: #f0fff4;
  --text-dim: #a7d7b4;
  --text-faint: #6fae7f;
  --live: #ff5d5d;
  --soon: #ffd23f;
  --advance: #8effa9;
  --third: #ffd23f;
  --accent: #ffe14d;
  --win: #8effa9;
  --upset: #ff9d42;
  --pa: #5fb8ff;
  --pd: rgba(255, 255, 255, 0.28);
  --ph: #ffe14d;
  --zebra: rgba(255, 255, 255, 0.04);
  --table-line: rgba(29, 122, 62, 0.5);
  --topbar-bg: rgba(8, 51, 25, 0.95);
  --mstar-dim: rgba(255, 225, 77, 0.6);
  --yc: #ffd23f;
}

html[data-theme="party"] {
  --bg: #1a0b2e;
  --bg-card: #2a1245;
  --bg-card-2: #3b1a5e;
  --border: #5b2d91;
  --text: #fdf0ff;
  --text-dim: #d9a7f0;
  --text-faint: #9a6cc9;
  --live: #ff5c8a;
  --soon: #ffd166;
  --advance: #2dffb3;
  --third: #ffd166;
  --accent: #ff4ecd;
  --win: #2dffb3;
  --upset: #ff8c42;
  --pa: #29d2ff;
  --pd: #8d6ab8;
  --ph: #2dffb3;
  --zebra: rgba(255, 255, 255, 0.03);
  --table-line: rgba(91, 45, 145, 0.5);
  --topbar-bg: rgba(26, 11, 46, 0.95);
  --mstar-dim: rgba(255, 78, 205, 0.6);
  --yc: #ffd166;
}

/* mown-grass stripes */
html[data-theme="pitch"] body {
  background-image: repeating-linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.02) 0 90px,
    transparent 90px 180px
  );
}
/* ball bouncing behind the content — movement is JS-driven (app.js) so it
   can be kicked; clicks are hit-tested at the document level */
#pitch-ball {
  display: none;
  position: fixed;
  left: 0;
  top: 0;
  z-index: -1;
  pointer-events: none;
  user-select: none;
  font-size: 54px;
  line-height: 1;
  opacity: 0.22;
  will-change: transform;
}
html[data-theme="pitch"] #pitch-ball { display: block; }

/* neon glow blobs + falling confetti + rainbow accents */
html[data-theme="party"] body {
  background-image:
    radial-gradient(circle at 12% 15%, rgba(255, 78, 205, 0.12), transparent 38%),
    radial-gradient(circle at 88% 35%, rgba(41, 210, 255, 0.11), transparent 42%),
    radial-gradient(circle at 45% 85%, rgba(45, 255, 179, 0.09), transparent 40%);
}
html[data-theme="party"] body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.55;
  background-image:
    radial-gradient(circle, #ff4ecd 2.2px, transparent 2.7px),
    radial-gradient(circle, #29d2ff 1.9px, transparent 2.4px),
    radial-gradient(circle, #ffd166 2.4px, transparent 2.9px),
    radial-gradient(circle, #2dffb3 1.7px, transparent 2.2px);
  background-size: 210px 230px, 170px 190px, 240px 260px, 150px 170px;
  background-position: 0 0, 60px 80px, 120px 40px, 30px 120px;
  animation: confetti-fall 16s linear infinite;
}
@keyframes confetti-fall {
  to { background-position: 0 230px, 60px 270px, 120px 300px, 30px 290px; }
}
html[data-theme="party"] .topbar h1 {
  background: linear-gradient(90deg, #ff4ecd, #ffd166, #2dffb3, #29d2ff, #ff4ecd);
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: rainbow-slide 6s linear infinite;
}
@keyframes rainbow-slide {
  to { background-position: 300% 0; }
}
html[data-theme="party"] .topbar {
  border-bottom: none;
}
html[data-theme="party"] .topbar::after {
  content: "";
  display: block;
  height: 2px;
  background: linear-gradient(90deg, #ff4ecd, #ffd166, #2dffb3, #29d2ff, #ff4ecd);
  background-size: 200% 100%;
  animation: rainbow-slide 8s linear infinite;
}
html[data-theme="party"] .live-card:not(.pre):not(.ft) {
  animation: party-glow 3s ease-in-out infinite;
}
@keyframes party-glow {
  0%, 100% { box-shadow: 0 0 14px rgba(255, 78, 205, 0.4); border-color: #ff4ecd; }
  50% { box-shadow: 0 0 18px rgba(41, 210, 255, 0.5); border-color: #29d2ff; }
}
html[data-theme="party"] .section h2::after {
  content: "🎉";
  font-size: 13px;
}
@media (prefers-reduced-motion: reduce) {
  html[data-theme="party"] body::before,
  html[data-theme="party"] .topbar h1,
  html[data-theme="party"] .topbar::after,
  html[data-theme="party"] .live-card:not(.pre) {
    animation: none;
  }
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; scroll-padding-top: 56px; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.4;
}

/* ---------- top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--topbar-bg);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  max-width: 1500px;
  margin: 0 auto;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.topbar h1 { font-size: 17px; white-space: nowrap; }
.tabs { display: flex; gap: 4px; }
.tabs a {
  color: var(--text-dim);
  text-decoration: none;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
}
.tabs a:hover { color: var(--text); background: var(--bg-card-2); }
.theme-wrap {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 14px;
}
.theme-select {
  background: var(--bg-card);
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 3px 6px;
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
}
.theme-select:hover { border-color: var(--text-faint); }
.status {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--text-faint);
}
.live-count {
  color: var(--live);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 5px;
}
.live-count::before {
  content: "";
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--live);
  animation: pulse 1.5s infinite;
}

main { max-width: 1500px; margin: 0 auto; padding: 12px 16px 40px; }

.section { margin-bottom: 28px; }
.section h2 {
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.section h2 .sub {
  font-size: 11px;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text-faint);
}
.hidden { display: none !important; }

.loading {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--text-faint);
  font-size: 13px;
  padding: 14px 2px;
}
.spinner {
  width: 14px;
  height: 14px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .spinner { animation-duration: 2.5s; }
}

.pulse-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--live);
  animation: pulse 1.5s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(248, 81, 73, 0.6); }
  70% { box-shadow: 0 0 0 7px rgba(248, 81, 73, 0); }
  100% { box-shadow: 0 0 0 0 rgba(248, 81, 73, 0); }
}

/* ---------- live games ---------- */
.live-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 10px;
}
.live-card {
  background: var(--bg-card);
  border: 1px solid var(--live);
  border-radius: 10px;
  padding: 12px 14px;
  box-shadow: 0 0 12px rgba(248, 81, 73, 0.15);
}
.live-card.pre {
  border-color: var(--soon);
  box-shadow: 0 0 12px rgba(227, 179, 65, 0.12);
}
.live-card .clock.soon { color: var(--soon); }
.soon-banner {
  background: rgba(227, 179, 65, 0.1);
  border-radius: 5px;
  padding: 3px 8px;
  margin-bottom: 7px;
  color: var(--soon);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-variant-numeric: tabular-nums;
}
.live-card .score.zero { color: var(--text-faint); }
.live-card.ft {
  border-color: var(--border);
  box-shadow: none;
}
.live-card .clock.ft {
  color: var(--win);
  font-size: 10.5px;
  letter-spacing: 0.06em;
}
.live-card .team-row.winner .score { color: var(--win); }
.live-card .team-row.loser { color: var(--text-dim); }
.live-card .team-row.loser .score { font-weight: 600; }
.live-card .match-meta {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-dim);
  margin-bottom: 8px;
}
.live-card .clock {
  color: var(--live);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.live-card .team-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 0;
  font-size: 16px;
  font-weight: 600;
}
.live-card .team-row .score {
  margin-left: auto;
  font-size: 20px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.no-live {
  color: var(--text-faint);
  font-size: 13px;
  padding: 10px 0;
}

.flag {
  width: 22px; height: 22px;
  object-fit: contain;
  flex-shrink: 0;
}
.flag.small { width: 17px; height: 17px; }

/* ---------- upcoming ---------- */
/* ---------- upcoming filters ---------- */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.filter-bar select {
  background: var(--bg-card);
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 12.5px;
  font-family: inherit;
  cursor: pointer;
  max-width: 180px;
}
.filter-bar select:hover { border-color: var(--text-faint); }
.filter-bar select:has(option:checked:not([value=""])) {
  color: var(--accent);
  border-color: var(--accent);
}
.filter-clear {
  background: none;
  border: none;
  color: var(--text-faint);
  font-size: 12px;
  cursor: pointer;
  padding: 4px 6px;
}
.filter-clear:hover { color: var(--text); }

.day-header {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 14px 0 4px;
  padding-bottom: 3px;
  border-bottom: 1px solid var(--border);
}
.day-header:first-child { margin-top: 0; }

.up-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 10px;
  border-radius: 7px;
  border: 1px solid transparent;
  font-size: 13.5px;
}
.up-row:nth-child(even) { background: var(--zebra); }
.up-row.soon {
  background: rgba(227, 179, 65, 0.09);
  border-color: rgba(227, 179, 65, 0.45);
}
.up-row.mq1 { box-shadow: inset 3px 0 0 rgba(88, 166, 255, 0.55); }
.up-row.mq2 {
  box-shadow: inset 3px 0 0 rgba(88, 166, 255, 0.9);
  background: rgba(88, 166, 255, 0.06);
}
.up-row.mq2.soon { background: rgba(227, 179, 65, 0.09); }
.mstar {
  color: var(--mstar-dim);
  font-size: 11px;
  flex-shrink: 0;
}
.mstar.mq2 { color: var(--accent); }
.up-row .kick {
  width: 62px;
  flex-shrink: 0;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
  font-size: 12.5px;
  white-space: nowrap;
}
.up-row .countdown {
  width: 88px;
  flex-shrink: 0;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text-dim);
  font-size: 12.5px;
}
.up-row.soon .countdown { color: var(--soon); }
.up-row .matchup {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  min-width: 0;
  flex: 1 1 auto;
}
.up-row .matchup .vs { color: var(--text-faint); font-weight: 400; font-size: 11px; }
.up-row .matchup span.tname {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.up-row .tag {
  flex-shrink: 0;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-dim);
  background: var(--bg-card-2);
  border-radius: 4px;
  padding: 2px 6px;
  white-space: nowrap;
}
.up-row .extra {
  flex-shrink: 0;
  font-size: 11.5px;
  color: var(--text-faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 30%;
}

/* ---------- goal details ---------- */
.goals {
  display: flex;
  flex-wrap: wrap;
  column-gap: 12px;
  row-gap: 2px;
  margin-top: 7px;
  font-size: 11px;
  color: var(--text-dim);
}
.goals.col { flex-direction: column; margin-top: 0; }
.goal-line { white-space: nowrap; }
.goal-line b {
  color: var(--text-faint);
  font-weight: 700;
  font-size: 10px;
}
.goals-pop {
  display: none;
  position: absolute;
  top: calc(100% + 3px);
  left: 0;
  min-width: 100%;
  z-index: 70;
  background: var(--bg-card-2);
  border: 1px solid var(--border);
  border-radius: 7px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
  padding: 7px 10px;
}
.result-card:hover .goals-pop,
.bracket-match:hover .goals-pop { display: block; }
.goals-pop .pop-meta {
  font-size: 10.5px;
  color: var(--text-faint);
  margin-bottom: 4px;
}
.goals-pop .pop-upset { color: var(--upset); font-weight: 700; }

/* ---------- booking chips ---------- */
.cards {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}
.cards i {
  display: inline-block;
  width: 8px;
  height: 11px;
  border-radius: 2px;
}
.cards .yc { background: var(--yc); }
.cards .rc { background: var(--live); }
.cards b {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-dim);
  margin-right: 2px;
}

/* ---------- win probability bars ---------- */
.prob {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  width: 156px;
}
.pbar {
  display: inline-flex;
  width: 70px;
  height: 6px;
  border-radius: 3px;
  overflow: hidden;
  background: var(--bg-card-2);
  flex-shrink: 0;
}
.pbar.wide { flex: 1 1 auto; width: auto; min-width: 0; height: 7px; }
.pbar i { display: block; height: 100%; }
.pbar .pa { background: var(--pa); }
.pbar .pd { background: var(--pd); }
.pbar .ph { background: var(--ph); }
.pfav {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.live-prob {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}
.live-prob .plab {
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.live-prob .pa-t { color: var(--pa); }
.live-prob .ph-t { color: var(--ph); }
.psrc {
  font-size: 9px;
  font-weight: 700;
  font-style: normal;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  flex-shrink: 0;
  position: relative;
  cursor: help;
  /* enlarge the hover target without shifting layout */
  padding: 6px;
  margin: -6px;
}
.psrc:hover { color: var(--text-dim); }
.psrc .ptip {
  visibility: hidden;
  opacity: 0;
  /* keep the tooltip alive briefly after mouseout so an imperfect
     path into it can recover (it stays hoverable during the delay) */
  transition: opacity 0.12s ease, visibility 0s linear 0.4s;
  position: absolute;
  bottom: 100%;
  right: -4px;
  z-index: 60;
  background: var(--bg-card-2);
  border: 1px solid var(--border);
  border-radius: 7px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
  padding: 7px 10px;
  white-space: nowrap;
  font-size: 11px;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text-dim);
  line-height: 1.6;
}
.psrc:hover .ptip,
.psrc .ptip:hover {
  visibility: visible;
  opacity: 1;
  transition-delay: 0s;
}
/* invisible bridge below the tooltip so diagonal mouse paths stay inside */
.psrc .ptip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: -14px;
  right: -14px;
  height: 18px;
}
.psrc .ptip a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}
.psrc .ptip a:hover { text-decoration: underline; }

.show-more {
  margin-top: 8px;
  background: var(--bg-card);
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 14px;
  font-size: 12.5px;
  cursor: pointer;
}
.show-more:hover { color: var(--text); border-color: var(--text-faint); }

/* ---------- results ---------- */
.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 6px;
}
.result-card {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 6px 10px;
  font-size: 13px;
  position: relative;
}
.result-card.upset { border-color: var(--upset); }
.upset-pill {
  position: absolute;
  top: -8px;
  right: 8px;
  background: var(--bg);
  border: 1px solid var(--upset);
  border-radius: 5px;
  color: var(--upset);
  font-size: 8.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding: 1px 6px;
  line-height: 1.4;
}
.bm-upset { color: var(--upset); font-weight: 800; }
.result-card .res-team {
  display: flex;
  align-items: center;
  gap: 5px;
  font-weight: 600;
  flex: 1;
  min-width: 0;
}
.result-card .res-team span {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.result-card .res-team.right { justify-content: flex-end; }
.result-card .res-score {
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  padding: 1px 7px;
  background: var(--bg-card-2);
  border-radius: 5px;
}
.result-card .res-team.loser { color: var(--text-dim); font-weight: 500; }

/* ---------- groups ---------- */
.groups-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(255px, 1fr));
  gap: 10px;
}
.group-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 9px;
  overflow: hidden;
}
.group-card h3 {
  font-size: 12.5px;
  padding: 6px 10px;
  background: var(--bg-card-2);
  color: var(--accent);
  letter-spacing: 0.04em;
}
.group-card table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}
.group-card th {
  font-size: 10px;
  color: var(--text-faint);
  font-weight: 600;
  text-align: center;
  padding: 3px 2px;
}
.group-card th.tcol { text-align: left; padding-left: 10px; }
.group-card td {
  padding: 4px 2px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  color: var(--text-dim);
  border-top: 1px solid var(--table-line);
}
.group-card td.tcol {
  text-align: left;
  padding-left: 10px;
  color: var(--text);
  font-weight: 600;
}
.group-card td.tcol .cell {
  display: flex;
  align-items: center;
  gap: 6px;
}
.group-card td.pts { color: var(--text); font-weight: 700; }
.group-card tr.adv td.tcol { box-shadow: inset 3px 0 0 var(--advance); }
.group-card tr.third td.tcol { box-shadow: inset 3px 0 0 var(--third); }

/* ---------- bracket ---------- */
.bracket-scroll { overflow-x: auto; padding-bottom: 8px; }
.bracket {
  display: flex;
  gap: 18px;
  min-width: max-content;
  align-items: stretch;
}
.round-col {
  display: flex;
  flex-direction: column;
  width: 210px;
  flex-shrink: 0;
}
.round-col h3 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  text-align: center;
  margin-bottom: 8px;
}
.round-col .matches {
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  flex: 1;
  gap: 8px;
}
.bracket-match {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 9px;
  font-size: 12.5px;
  position: relative;
}
.bracket-match.live {
  border-color: var(--live);
  box-shadow: 0 0 10px rgba(248, 81, 73, 0.15);
}
.bracket-match.soon { border-color: rgba(227, 179, 65, 0.55); }
.bracket-match .bm-meta {
  font-size: 10px;
  color: var(--text-faint);
  display: flex;
  justify-content: space-between;
  margin-bottom: 3px;
}
.bracket-match .bm-meta .bm-live { color: var(--live); font-weight: 700; }
.bracket-match .bm-team {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 2px 0;
  font-weight: 600;
}
.bracket-match .bm-team .bm-score {
  margin-left: auto;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.bracket-match .bm-team.placeholder { color: var(--text-faint); font-weight: 500; }
.bracket-match .bm-team.loser { color: var(--text-dim); font-weight: 500; }
.bracket-match .bm-team.winner .bm-score { color: var(--win); }

/* ---------- footer ---------- */
footer {
  text-align: center;
  font-size: 11.5px;
  color: var(--text-faint);
  padding: 14px;
  border-top: 1px solid var(--border);
}
.error-note { color: var(--live); margin-left: 8px; }
footer a {
  color: var(--text-dim);
  text-decoration: none;
}
footer a:hover { color: var(--accent); text-decoration: underline; }

/* ---------- mobile ---------- */
@media (max-width: 640px) {
  body { font-size: 13px; }
  .topbar-inner { padding: 6px 10px; gap: 8px; }
  .topbar h1 { font-size: 15px; }
  .status { display: none; }
  .tabs { margin-left: auto; }
  .tabs a { padding: 4px 7px; font-size: 12px; }
  main { padding: 10px 10px 30px; }
  /* deterministic two-line layout: teams on the first line, all metadata
     on the second — identical wrapping for every row */
  .up-row {
    display: grid;
    grid-template-columns: auto auto minmax(0, 1fr) auto;
    grid-template-areas:
      "matchup matchup matchup matchup"
      "kick countdown prob tag";
    row-gap: 4px;
    padding: 6px 8px;
  }
  .up-row .extra { display: none; }
  .up-row .kick { grid-area: kick; width: auto; font-size: 11.5px; }
  .up-row .countdown { grid-area: countdown; width: auto; }
  .up-row .matchup { grid-area: matchup; }
  .up-row .prob { grid-area: prob; width: auto; justify-self: start; min-width: 0; }
  .up-row .tag { grid-area: tag; justify-self: end; }
  /* keep the filter controls on one line: share the row equally and let
     the selects ellipsize their labels */
  .filter-bar { flex-wrap: nowrap; gap: 6px; }
  .filter-bar select {
    flex: 1 1 0;
    min-width: 0;
    max-width: none;
    font-size: 11.5px;
    padding: 4px 3px;
  }
  .filter-clear { font-size: 0; padding: 4px 2px; flex-shrink: 0; }
  .filter-clear::after { content: "✕"; font-size: 14px; }
  .up-row .countdown { width: 76px; }
  .live-grid { grid-template-columns: 1fr; }
  .round-col { width: 185px; }
}
