/* ── Custom Properties ── */
:root {
  --bg: #0d0d12;
  --bg2: #17171f;
  --bg3: #1f1f2a;
  --border: #2a2a3c;
  --text: #f0f0f5;
  --text2: #9090aa;
  --text3: #6b6b88;
  --accent: #e63946;
  --accent2: #ff6b6b;
  --green: #2dd4bf;
  --yellow: #f5c518;
  --card-radius: 12px;
  --transition: 0.18s ease;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f2f2f6;
    --bg2: #ffffff;
    --bg3: #ebebf0;
    --border: #dddde8;
    --text: #0d0d12;
    --text2: #555570;
    --text3: #888898;
  }
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; -webkit-tap-highlight-color: transparent; }
body {
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.4;
  overscroll-behavior: none;
}

a { color: inherit; text-decoration: none; }
button { border: none; background: none; cursor: pointer; color: inherit; font: inherit; }
img { display: block; }

/* ── Layout ── */
#app { min-height: 100dvh; display: flex; flex-direction: column; }

.view {
  flex: 1;
  display: flex;
  flex-direction: column;
  animation: fadeIn 0.15s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Header / Nav bar ── */
.nav-bar {
  display: flex;
  align-items: center;
  height: 52px;
  padding: 0 16px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
  gap: 12px;
}

.nav-back {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text2);
  font-size: 14px;
  padding: 6px 0;
  min-width: 44px;
}

.nav-back svg { flex-shrink: 0; }

.nav-title {
  font-size: 16px;
  font-weight: 600;
  flex: 1;
  text-align: center;
  -webkit-tap-highlight-color: transparent;
}

.nav-title--tappable {
  cursor: pointer;
  opacity: 0.6;
}

.nav-title--tappable:active {
  opacity: 0.35;
}

.nav-spacer { min-width: 44px; }

/* ── Loading ── */
.loading-screen {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
}

.spinner {
  width: 28px;
  height: 28px;
  border: 2px solid var(--border);
  border-top-color: var(--text2);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

.inline-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--border);
  border-top-color: var(--text2);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: 24px auto;
}

/* ── Home View ── */
.home-view {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 0 0 env(safe-area-inset-bottom);
}

.home-header {
  padding: 40px 20px 24px;
  text-align: center;
}

.home-header h1 {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-size: 36px;
  font-weight: 700;
  letter-spacing: 4px;
  text-transform: uppercase;
  background: linear-gradient(135deg, #e63946 0%, #ff8c42 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.home-header p {
  font-size: 13px;
  color: var(--text3);
  margin-top: 4px;
}

.sport-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 0 16px;
}

.sport-tile {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--card-radius);
  padding: 24px 12px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: transform var(--transition), background var(--transition);
  -webkit-user-select: none;
  user-select: none;
}

.sport-tile:active { transform: scale(0.97); background: var(--bg3); }

.sport-tile-logo {
  width: 64px;
  height: 64px;
  object-fit: contain;
}

.sport-tile-logo-fallback {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--bg3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
}

.sport-tile-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text2);
  text-align: center;
  line-height: 1.3;
}

/* ── Now Entry (home page) ── */
.now-entry {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 16px 12px;
  padding: 14px 16px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--card-radius);
  width: calc(100% - 32px);
  text-align: left;
  cursor: pointer;
  transition: var(--transition);
}
.now-entry:active { transform: scale(0.98); background: var(--bg3); }
.now-entry-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
  animation: pulse 1.8s ease-in-out infinite;
}
.now-entry-text { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.now-entry-label { font-size: 15px; font-weight: 700; color: var(--text); }
.now-entry-sub { font-size: 12px; color: var(--text3); }
.now-entry-arrow { color: var(--text3); flex-shrink: 0; }

/* ── Today View ── */
.today-view { flex: 1; display: flex; flex-direction: column; }
.today-view .nav-bar { border-bottom: none; }

.today-pills {
  display: flex;
  gap: 8px;
  padding: 4px 16px 16px;
  overflow-x: auto;
  scrollbar-width: none;
}
.today-pills::-webkit-scrollbar { display: none; }

.today-pill {
  padding: 7px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  background: var(--bg2);
  border: 1px solid var(--border);
  color: var(--text3);
  transition: var(--transition);
  white-space: nowrap;
  cursor: pointer;
}
.today-pill--pl.active   { background: var(--accent); border-color: var(--accent); color: #fff; }
.today-pill--nrl.active  { background: var(--green);  border-color: var(--green);  color: var(--bg); }
.today-pill--wc.active   { background: var(--yellow); border-color: var(--yellow); color: var(--bg); }

.today-sport-tag {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 4px;
  line-height: 1;
}
.today-sport-tag--pl  { background: rgba(230,57,70,0.12);  color: var(--accent); }
.today-sport-tag--nrl { background: rgba(45,212,191,0.12); color: var(--green);  }
.today-sport-tag--wc  { background: rgba(245,197,24,0.12); color: var(--yellow); }

/* ── Scoreboard View ── */
.scoreboard-view { flex: 1; }
.scoreboard-view .nav-bar { border-bottom: none; }

/* ── Round Nav Row ── */
.round-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 44px;
  padding: 0 4px;
  background: var(--bg2);
  position: sticky;
  top: 52px;
  z-index: 9;
}

.round-nav-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text2);
  letter-spacing: 0.2px;
  flex: 1;
  text-align: center;
  pointer-events: none;
  user-select: none;
}

.round-nav-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  color: var(--text2);
  border-radius: 8px;
  transition: background var(--transition), opacity var(--transition);
  -webkit-tap-highlight-color: transparent;
}

.round-nav-btn:active { background: var(--bg3); }

.round-nav-btn--disabled,
.round-nav-btn:disabled {
  opacity: 0.25;
  pointer-events: none;
}

/* ── Round track (sliding panel approach) ── */
.round-track-wrap {
  overflow: hidden;
  width: 100%;
}

.round-track {
  display: flex;
  will-change: transform;
}

.round-panel {
  flex-shrink: 0;
  min-width: 0;
  padding: 8px 0 env(safe-area-inset-bottom);
}

.match-list {
  padding: 8px 0 env(safe-area-inset-bottom);
}

.match-date-group {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 0 12px 4px;
}

.match-date-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.9px;
  color: var(--text3);
  padding: 14px 4px 2px;
}

.empty-state {
  padding: 60px 20px;
  text-align: center;
  color: var(--text3);
  font-size: 14px;
}

/* ── Match Card (compact) ── */
.match-card {
  background: var(--bg2);
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition);
  -webkit-user-select: none;
  user-select: none;
}

.match-card:active {
  background: var(--bg3);
  transform: scale(0.982);
}

@media (prefers-color-scheme: light) {
  .match-card {
    box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  }
}

.match-card-compact {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 14px 16px;
  gap: 8px;
  min-height: 76px;
}

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

.mc-team.away {
  flex-direction: row-reverse;
  text-align: right;
}

.team-crest {
  width: 28px;
  height: 28px;
  object-fit: contain;
  flex-shrink: 0;
}

.team-crest-fallback {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--text2);
  flex-shrink: 0;
}

.team-name {
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mc-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  min-width: 80px;
}

.mc-score {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.5px;
  display: flex;
  gap: 8px;
  align-items: center;
  min-height: 24px;
}

.mc-score:empty { display: none; }

.mc-score-dash { color: var(--text3); font-weight: 400; }

.mc-status {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
  color: var(--text3);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
}

.kickoff-time {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.kickoff-date {
  font-size: 12px;
  font-weight: 500;
  color: var(--text2);
}

.mc-status.live {
  color: var(--accent);
  flex-direction: row;
  align-items: center;
  gap: 4px;
}

.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 1.4s ease-in-out infinite;
  flex-shrink: 0;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.7); }
}

/* ── Match Detail View (full page) ── */
.match-view { flex: 1; }

/* ── Match Hero (large crests + score) ── */
.match-hero {
  background: var(--bg2);
  border-radius: 14px;
  margin: 12px 12px 0;
  padding: 24px 16px 20px;
}

@media (prefers-color-scheme: light) {
  .match-hero {
    box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  }
}

.match-hero-teams {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
}

.hero-team {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 6px;
  border-radius: 10px;
  transition: background var(--transition);
}

.hero-team:active { background: var(--bg3); }

.hero-crest {
  width: 72px;
  height: 72px;
  object-fit: contain;
}

.hero-crest-fallback {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--bg3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
  color: var(--text2);
}

.hero-team-name {
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  color: var(--text2);
  max-width: 90px;
  line-height: 1.2;
}

.hero-score-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.hero-score {
  font-size: 38px;
  font-weight: 800;
  letter-spacing: -1px;
  line-height: 1;
}

.hero-score-dash { color: var(--text3); font-weight: 300; margin: 0 4px; }

.hero-status {
  font-size: 12px;
  font-weight: 600;
  color: var(--text3);
  letter-spacing: 0.4px;
}

.hero-status.live {
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ── Key Events (goals / red cards summary) ── */
.key-events {
  background: var(--bg2);
  border-radius: 14px;
  margin: 9px 12px 0;
  padding: 6px 0;
}

@media (prefers-color-scheme: light) {
  .key-events {
    box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  }
}

.key-event-row {
  display: grid;
  grid-template-columns: 1fr 36px 1fr;
  padding: 5px 16px;
  gap: 4px;
  align-items: center;
}

.key-event-icon {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 4px;
}

.key-event-col {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.key-event-col.away {
  align-items: flex-end;
  text-align: right;
}

.key-event-entry {
  font-size: 12px;
  color: var(--text2);
  line-height: 1.6;
}

/* ── Tabs ── */
.tabs-wrapper {
  display: flex;
  flex-direction: column;
  margin: 9px 12px 16px;
}

.tabs-bar {
  display: flex;
  background: var(--bg2);
  border-radius: 14px 14px 0 0;
  position: sticky;
  top: 52px;
  z-index: 9;
  overflow: hidden;
}

@media (prefers-color-scheme: light) {
  .tabs-bar {
    box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  }
}

.tab-indicator {
  position: absolute;
  inset: 0 auto 0 0;
  height: 100%;
  background: rgba(0, 0, 0, 0.04);
  pointer-events: none;
  will-change: transform;
}

.tab-btn {
  flex: 1;
  position: relative;
  z-index: 1;
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text3);
  transition: color 0.2s;
  white-space: nowrap;
}

.tab-btn.active {
  color: var(--text);
}

.tabs-track-wrap {
  overflow: hidden;
  border-radius: 0 0 14px 14px;
  background: var(--bg2);
}

@media (prefers-color-scheme: light) {
  .tabs-track-wrap {
    box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  }
}

.tabs-track {
  display: flex;
  will-change: transform;
}

.tab-panel {
  flex-shrink: 0;
  min-width: 0;
}

/* ── Events Timeline ── */
.events-panel { padding: 8px 0; }
.events-panel > *:nth-child(even) { background: var(--bg3); }

.event-row {
  display: flex;
  align-items: center;
  padding: 8px 16px;
  gap: 10px;
  font-size: 14px;
}

.event-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
}

.event-body { flex: 1; min-width: 0; }

.event-row.away .event-body { text-align: right; }

.event-player {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.event-og {
  font-size: 11px;
  color: var(--text3);
  font-weight: 400;
}

.event-minute {
  font-size: 12px;
  color: var(--text3);
  flex-shrink: 0;
  min-width: 32px;
}

.sub-row {
  display: flex;
  align-items: center;
  padding: 5px 16px;
  gap: 10px;
  font-size: 13px;
  color: var(--text2);
}

.sub-icon { font-size: 14px; flex-shrink: 0; font-weight: 700; }
.sub-name { flex: 1; min-width: 0; }
.sub-row.away .sub-name { text-align: right; }

.sub-on  { color: #30d158; }
.sub-off { color: #ff453a; }

.sub-minute { font-size: 12px; color: var(--text3); min-width: 32px; flex-shrink: 0; }

.events-empty {
  padding: 32px 16px;
  text-align: center;
  font-size: 13px;
  color: var(--text3);
}

/* ── Stats Panel ── */
.stats-panel { padding: 12px 0; }

.stats-header {
  display: grid;
  grid-template-columns: 1fr 120px 1fr;
  padding: 0 16px 8px;
  gap: 8px;
}

.stats-header-team {
  font-size: 12px;
  font-weight: 600;
  color: var(--text3);
}

.stats-header-team.away { text-align: right; }

.stat-row {
  display: grid;
  grid-template-columns: 1fr 120px 1fr;
  padding: 7px 16px;
  gap: 8px;
  align-items: center;
}

.stat-row:nth-child(odd) { background: var(--bg3); }

.stat-val {
  font-size: 15px;
  font-weight: 600;
  display: flex;
  align-items: center;
}

.stat-val.away { justify-content: flex-end; }

.stat-highlight {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: #fff;
  border-radius: 50px;
  min-width: 28px;
  height: 28px;
  padding: 0 6px;
  font-size: 14px;
  font-weight: 700;
}

.stat-highlight--dark-bg {
  border: 1.5px solid rgba(255, 255, 255, 0.32);
}

@media (prefers-color-scheme: light) {
  .stat-highlight--dark-bg { border: none; }
}

.stat-name {
  font-size: 12px;
  color: var(--text3);
  text-align: center;
  line-height: 1.3;
}

.possession-bar-row {
  padding: 2px 16px 6px;
}

.possession-bar {
  display: flex;
  height: 4px;
  border-radius: 2px;
  overflow: hidden;
}

.possession-fill {
  height: 100%;
  transition: width 0.4s ease;
}

.stats-empty {
  padding: 32px 16px;
  text-align: center;
  font-size: 13px;
  color: var(--text3);
}

/* ── Lineups Panel ── */
.lineups-panel { padding: 12px 0; }

.lineups-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}

.lineup-col { padding: 0 4px 0 16px; }
.lineup-col.away { padding: 0 16px 0 4px; }

.lineup-team-name {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text3);
  padding: 8px 0 6px;
}

.lineup-divider {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text3);
  padding: 10px 0 4px;
  border-top: 1px solid var(--border);
  margin-top: 6px;
}

.lineup-player {
  font-size: 13px;
  color: var(--text);
  padding: 4px 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lineups-empty {
  padding: 32px 16px;
  text-align: center;
  font-size: 13px;
  color: var(--text3);
}

/* ── Player Stats Panel (NRL) ── */
.player-stats-panel { padding: 8px 0; }

.player-stats-team-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text3);
  padding: 12px 16px 6px;
}

.player-stat-table {
  overflow-x: auto;
  padding: 0 0 8px;
}

.player-stat-table table {
  min-width: 480px;
  width: 100%;
  border-collapse: collapse;
}

.player-stat-table th {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text3);
  padding: 4px 10px;
  text-align: right;
  white-space: nowrap;
}

.player-stat-table th:first-child { text-align: left; }

.player-stat-table td {
  font-size: 13px;
  padding: 7px 10px;
  text-align: right;
  border-top: 1px solid var(--border);
}

.player-stat-table td:first-child {
  text-align: left;
  font-weight: 500;
  color: var(--text);
}

/* ── Club Fixtures View ── */
.club-view { flex: 1; }

.club-hero {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 16px 16px;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
}

.club-hero-crest {
  width: 52px;
  height: 52px;
  object-fit: contain;
}

.club-hero-crest-fallback {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--bg3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  color: var(--text2);
}

.club-hero-name {
  font-size: 20px;
  font-weight: 700;
}

.club-hero-league {
  font-size: 12px;
  color: var(--text3);
  margin-top: 2px;
}

.fixtures-section-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text3);
  padding: 14px 16px 6px;
}

.fixture-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  gap: 8px;
  min-height: 50px;
}

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

.fixture-team.away { flex-direction: row-reverse; text-align: right; }

.fixture-crest {
  width: 22px;
  height: 22px;
  object-fit: contain;
  flex-shrink: 0;
}

.fixture-team-name {
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fixture-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 64px;
}

.fixture-score {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.fixture-time {
  font-size: 12px;
  color: var(--text3);
  font-weight: 500;
  text-align: center;
}

.show-all-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 14px 16px;
  font-size: 14px;
  color: var(--text2);
  border-top: 1px solid var(--border);
  width: 100%;
  text-align: center;
  transition: color var(--transition);
}

.show-all-btn:active { color: var(--text); }

.show-all-chevron {
  display: inline-block;
  transition: transform 0.2s ease;
}

.show-all-btn.is-expanded .show-all-chevron { transform: rotate(180deg); }

/* ── Error state ── */
.error-state {
  padding: 40px 20px;
  text-align: center;
}

.error-state p { color: var(--text3); font-size: 14px; margin-bottom: 16px; }

.retry-btn {
  display: inline-block;
  padding: 10px 20px;
  background: var(--bg3);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
}

/* ── WC Mode Toggle Bar ── */
.sport-mode-bar {
  display: flex;
  justify-content: center;
  padding: 10px 16px 0;
  background: var(--bg);
}

.sport-mode-pill {
  flex: 1;
  max-width: 140px;
  padding: 7px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text2);
  background: none;
  transition: color var(--transition), background var(--transition);
  -webkit-tap-highlight-color: transparent;
}

.sport-mode-pill.active {
  background: var(--bg2);
  color: var(--text);
}

/* ── Group label on fixture cards ── */
.mc-group-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--text3);
  line-height: 1;
  margin-bottom: 1px;
}

/* ── WC Standings View ── */
.wcs-host {
  padding: 12px 12px env(safe-area-inset-bottom);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.wcs-groups-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

@media (max-width: 480px) {
  .wcs-groups-grid { grid-template-columns: 1fr; }
}

.wcs-group {
  background: var(--bg2);
  border-radius: 14px;
  overflow: hidden;
}

@media (prefers-color-scheme: light) {
  .wcs-group {
    box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  }
}

.wcs-group-header {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.7px;
  text-transform: uppercase;
  color: var(--text2);
  padding: 10px 12px 8px;
  border-bottom: 1px solid var(--border);
}

.wcs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.wcs-table thead th {
  color: var(--text3);
  font-weight: 600;
  padding: 5px 6px;
  text-align: right;
  white-space: nowrap;
}

.wcs-table tbody tr {
  border-top: 1px solid var(--border);
}

.wcs-table tbody td {
  padding: 7px 6px;
  text-align: right;
  color: var(--text);
  white-space: nowrap;
}

.wcs-th-team,
.wcs-table tbody td:has(.wcs-team-cell) {
  text-align: left;
}

/* fallback for browsers without :has() */
.wcs-table thead th:first-child { text-align: left; }
.wcs-table tbody tr > td:first-child { text-align: left; }

.wcs-team-cell {
  display: flex;
  align-items: center;
  gap: 5px;
}

.wcs-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  flex-shrink: 0;
}

.wcs-crest {
  object-fit: contain;
  border-radius: 2px;
  flex-shrink: 0;
}

.wcs-crest-fb {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg3);
  border-radius: 3px;
  font-size: 7px;
  font-weight: 700;
  color: var(--text2);
  flex-shrink: 0;
}

.wcs-name {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 88px;
}

.wcs-pts {
  font-weight: 700;
  color: var(--text) !important;
}

.wcs-th-grp,
.wcs-grp-col {
  color: var(--text2);
  font-weight: 600;
  font-size: 11px;
}

.wcs-section-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.7px;
  text-transform: uppercase;
  color: var(--text2);
  padding: 4px 2px 0;
}

.wcs-third-note {
  font-size: 11px;
  color: var(--text3);
  padding: 3px 2px 6px;
}

/* ── Utilities ── */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
}
