/* win1x2.app -- shared styles across all pages.
   Palette mirrors the Flutter app's AppColors (lib/core/theme/app_colors.dart),
   layout language borrows FotMob's compact, information-dense match list:
   edge-to-edge rows on mobile, sticky collapsible league headers, a
   horizontal date strip, and a bottom tab bar on small screens. */

:root {
  --bg-top: #1b1e2c;
  --bg-mid: #101219;
  --bg-bottom: #000000;
  --screen-bg: #0f1117;
  --card-bg: #181a24;
  --card-bg-live: #1c2118;
  --row-bg: #14161f;
  --nav-bg: #14161f;
  --glass-border: rgba(255, 255, 255, 0.07);
  --glass-overlay: rgba(255, 255, 255, 0.05);
  --accent: #d7f547;
  --accent-muted: #a9c23a;
  --live-amber: #ffb300;
  --live-green: #4caf50;
  --ucl-green: #3fb27f;
  --uel-blue: #4d8fdc;
  --rel-red: #e0575a;
  --ai-accent: #9b6bff;
  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.6);
  --text-tertiary: rgba(255, 255, 255, 0.4);
  --card-radius: 14px;
  --pill-radius: 999px;
  --bottom-nav-h: 58px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  background: var(--screen-bg);
  background-image: linear-gradient(to bottom, var(--bg-top) 0%, var(--bg-mid) 50%, var(--bg-bottom) 100%);
  background-attachment: fixed;
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
}

button {
  font-family: inherit;
}

/* Screen-reader/crawler-only text -- an invisible but real <h1> so a page
   whose visual heading is split across markup (e.g. two team names either
   side of a score) still has one proper, single heading for SEO/a11y. */
.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;
}

/* ---------------------------------------------------------------- Nav --- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--nav-bg);
  border-bottom: 1px solid var(--glass-border);
}

.nav-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 19px;
  letter-spacing: -0.02em;
}

.brand .dot {
  color: var(--accent);
}

.nav-links {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.nav-links a {
  padding: 7px 13px;
  border-radius: var(--pill-radius);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  transition: background 0.15s, color 0.15s;
}

.nav-links a:hover {
  background: var(--glass-overlay);
  color: var(--text-primary);
}

.nav-links a.active {
  background: var(--accent);
  color: #0f1117;
}

/* --------------------------------------------------------- Date strip --- */
/* FotMob-style horizontal day picker: arrow, scrollable day chips, arrow. */

.date-strip {
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: 1080px;
  margin: 0 auto;
  padding: 10px 12px;
  border-bottom: 1px solid var(--glass-border);
  background: var(--nav-bg);
  position: sticky;
  top: 49px;
  z-index: 40;
}

.date-strip-arrow {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--glass-overlay);
  color: var(--text-primary);
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.date-strip-arrow:hover {
  background: rgba(255, 255, 255, 0.1);
}

.date-strip-days {
  flex: 1;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}

.date-strip-days::-webkit-scrollbar {
  display: none;
}

.date-chip {
  flex-shrink: 0;
  padding: 6px 14px;
  border-radius: var(--pill-radius);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
}

.date-chip:hover {
  background: var(--glass-overlay);
}

.date-chip.active {
  background: var(--accent);
  color: #0f1117;
}

/* ------------------------------------------------------------- Layout --- */

.page {
  max-width: 1080px;
  margin: 0 auto;
  padding: 20px 0 calc(var(--bottom-nav-h) + 24px);
}

.page-inset {
  padding-left: 16px;
  padding-right: 16px;
}

/* ------------------------------------------------ Livescore sidebars ---- */
/* Desktop-only 3-column layout: leagues/table on the left, fixtures in the
   center, news on the right -- collapses to the plain single-column
   fixtures list (sidebars hidden) below the breakpoint, same as every
   other page on a phone. */

.sidebar {
  display: none;
}

@media (min-width: 1100px) {
  .livescore-grid {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr) 300px;
    align-items: start;
    gap: 20px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px 20px 24px;
  }

  .livescore-main.page {
    max-width: none;
    margin: 0;
    padding: 0;
  }

  .sidebar {
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: sticky;
    top: 108px;
  }
}

.sidebar-card {
  padding: 14px;
}

.sidebar-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
  margin-bottom: 10px;
}

.sidebar-league-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-league-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 4px;
  border-radius: 8px;
  color: inherit;
  text-decoration: none;
  font-size: 12.5px;
  font-weight: 600;
}

.sidebar-league-item:hover {
  background: var(--glass-overlay);
}

.sidebar-league-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.sidebar-mini-table td {
  padding: 5px 2px;
  border-bottom: 1px solid var(--glass-border);
}

.sidebar-mini-table tr:last-child td {
  border-bottom: none;
}

.sidebar-mini-pos {
  width: 18px;
  color: var(--text-tertiary);
  font-weight: 700;
}

.sidebar-mini-team {
  width: 100%;
}

.sidebar-mini-team .team-table-link {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
}

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

.sidebar-mini-pts {
  text-align: right;
  font-weight: 800;
  color: var(--accent);
  padding-left: 6px;
}

.sidebar-more-link {
  display: block;
  margin-top: 10px;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
}

.sidebar-news-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sidebar-news-item {
  display: flex;
  gap: 10px;
  color: inherit;
  text-decoration: none;
}

.sidebar-news-thumb {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  border-radius: 8px;
  background: var(--glass-overlay);
  object-fit: cover;
}

.sidebar-news-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.sidebar-news-headline {
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.sidebar-news-meta {
  font-size: 10.5px;
  color: var(--text-tertiary);
}

.page-title {
  font-size: 22px;
  font-weight: 800;
  margin: 0 0 4px;
  letter-spacing: -0.01em;
}

.page-subtitle {
  color: var(--text-secondary);
  font-size: 13px;
  margin: 0 0 18px;
}

.section {
  margin-bottom: 4px;
}

.section-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
  margin: 0 0 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
}

/* --------------------------------------------------------- Glass card --- */

.card {
  background: var(--card-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--card-radius);
  padding: 14px 16px;
}

/* Fixture rows and tip cards are <a> elements (they link to match.html) --
   this strips default link styling so they still read as plain rows/cards. */
a.card,
a.fixture-row {
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

.card + .card {
  margin-top: 8px;
}

/* --------------------------------------------------- League group/row --- */
/* Sticky, collapsible league header -- click to expand/collapse its
   fixtures, mirroring FotMob's per-competition grouping. */

.league-group {
  margin-bottom: 10px;
  border-bottom: 1px solid var(--glass-border);
}

.league-group-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  padding: 10px 16px;
  cursor: pointer;
  user-select: none;
  position: sticky;
  top: 97px;
  background: var(--row-bg);
  z-index: 20;
}

.league-emblem {
  width: 20px;
  height: 20px;
  border-radius: 5px;
  flex-shrink: 0;
  object-fit: contain;
}

span.league-emblem {
  background: linear-gradient(135deg, var(--accent), var(--ai-accent));
  color: #0f1117;
  font-size: 11px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

.league-group-names {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 6px;
  overflow: hidden;
}

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

.league-country {
  color: var(--text-tertiary);
  font-weight: 500;
  font-size: 12px;
  white-space: nowrap;
}

.league-chevron {
  flex-shrink: 0;
  color: var(--text-tertiary);
  font-size: 11px;
  transition: transform 0.15s;
}

.league-group.collapsed .league-chevron {
  transform: rotate(-90deg);
}

.league-group-rows {
  overflow: hidden;
}

.league-group.collapsed .league-group-rows {
  display: none;
}

/* ------------------------------------------------------- Fixture row --- */
/* Edge-to-edge compact row (no card padding/rounding on mobile), matching
   FotMob's dense match list. */

.fixture-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--glass-border);
  transition: background 0.1s;
}

.fixture-row:last-child {
  border-bottom: none;
}

.fixture-row:hover {
  background: var(--glass-overlay);
}

.fixture-row.is-live {
  background: var(--card-bg-live);
}

.fixture-status-col {
  flex-shrink: 0;
  width: 46px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

.fixture-time {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

.fixture-teams {
  flex: 1;
  min-width: 0;
}

.fixture-team-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 2px 0;
}

.team-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--glass-overlay);
  flex-shrink: 0;
}

/* Real team/league crest images (logo_url from Supabase), with a graceful
   fallback dot/initial shown until the image loads or if it 404s -- see
   crestImgHtml() in helpers.js. The <img> is hidden while loading/broken and
   the fallback stays visible underneath; onload swaps visibility. */
.team-crest {
  position: relative;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.team-crest img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: none;
}

.team-crest img.loaded {
  display: block;
}

.team-crest .crest-fallback {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--glass-overlay);
}

.team-crest img.loaded + .crest-fallback {
  display: none;
}

.fixture-team-name {
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}

.fixture-score-col {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  min-width: 18px;
}

.fixture-score {
  font-size: 14px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  padding: 2px 0;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: var(--pill-radius);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.badge-live {
  color: var(--live-green);
  background: rgba(76, 175, 80, 0.14);
}

.badge-live .live-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--live-green);
  animation: pulse 1.4s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

.badge-finished {
  color: var(--text-tertiary);
  background: rgba(255, 255, 255, 0.06);
}

/* -------------------------------------------------------------- Tips ---- */

.tip-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tip-teams {
  font-size: 15px;
  font-weight: 700;
}

.tip-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--text-tertiary);
}

.tip-bars {
  display: flex;
  height: 8px;
  border-radius: var(--pill-radius);
  overflow: hidden;
  background: rgba(255, 255, 255, 0.06);
}

.tip-bar-home { background: var(--accent); }
.tip-bar-draw { background: rgba(255, 255, 255, 0.35); }
.tip-bar-away { background: var(--ai-accent); }

.tip-legend {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 700;
}

.tip-legend .home { color: var(--accent); }
.tip-legend .draw { color: var(--text-secondary); }
.tip-legend .away { color: var(--ai-accent); }

.tip-pick {
  align-self: flex-start;
  padding: 4px 10px;
  border-radius: var(--pill-radius);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  background: rgba(155, 107, 255, 0.16);
  color: var(--ai-accent);
}

/* -------------------------------------------------------------- News ---- */

.news-card {
  display: flex;
  gap: 12px;
}

.news-thumb {
  width: 88px;
  height: 88px;
  border-radius: 10px;
  object-fit: cover;
  background: var(--glass-overlay);
  flex-shrink: 0;
}

.news-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.news-headline {
  font-size: 14.5px;
  font-weight: 700;
  line-height: 1.35;
}

.news-summary {
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-meta {
  font-size: 11.5px;
  color: var(--text-tertiary);
  font-weight: 600;
}

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

.league-picker {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 0 16px 4px;
  margin-bottom: 4px;
  scrollbar-width: none;
}

.league-picker::-webkit-scrollbar {
  display: none;
}

.league-chip {
  flex-shrink: 0;
  padding: 7px 15px;
  border-radius: var(--pill-radius);
  background: var(--card-bg);
  border: 1px solid var(--glass-border);
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
}

.league-chip.active {
  background: var(--accent);
  color: #0f1117;
  border-color: var(--accent);
}

.standings-wrap {
  padding: 0 16px;
}

.standings-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

.standings-table th {
  text-align: left;
  color: var(--text-tertiary);
  font-weight: 700;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 8px 6px;
  border-bottom: 1px solid var(--glass-border);
}

.standings-table td {
  padding: 8px 6px;
  border-bottom: 1px solid var(--glass-border);
  font-variant-numeric: tabular-nums;
}

.standings-table tr:last-child td {
  border-bottom: none;
}

.standings-table .col-pos {
  color: var(--text-tertiary);
  width: 26px;
  position: relative;
  padding-left: 12px;
}

/* Qualification-zone indicator: a thin colored bar in front of the
   position number, FotMob-style (green = continental spot, red =
   relegation). Purely a position-based heuristic since standings has no
   explicit zone column. */
.standings-table .col-pos::before {
  content: "";
  position: absolute;
  left: 0;
  top: 2px;
  bottom: 2px;
  width: 3px;
  border-radius: 2px;
  background: transparent;
}

.standings-table tr.zone-ucl .col-pos::before { background: var(--ucl-green); }
.standings-table tr.zone-uel .col-pos::before { background: var(--uel-blue); }
.standings-table tr.zone-rel .col-pos::before { background: var(--rel-red); }

.standings-table .col-team {
  font-weight: 600;
  white-space: nowrap;
}

.standings-table .col-team .team-crest {
  width: 18px;
  height: 18px;
  margin-right: 6px;
  vertical-align: middle;
}

.standings-table .col-team .team-name {
  vertical-align: middle;
}

.tip-teams {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.tip-teams .team-crest {
  width: 18px;
  height: 18px;
}

.standings-table .col-pts {
  font-weight: 800;
  color: var(--accent);
}

.standings-table td.num,
.standings-table th.num {
  text-align: center;
}

.standings-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  padding: 12px 16px 4px;
  font-size: 11px;
  color: var(--text-tertiary);
}

.standings-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.standings-legend .dot {
  width: 8px;
  height: 8px;
  border-radius: 2px;
}

.standings-legend .dot.ucl { background: var(--ucl-green); }
.standings-legend .dot.uel { background: var(--uel-blue); }
.standings-legend .dot.rel { background: var(--rel-red); }

/* --------------------------------------------------------- Utilities ---- */

.empty-state,
.loading-state,
.error-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-tertiary);
  font-size: 14px;
}

.error-state {
  color: var(--live-amber);
}

.site-footer {
  text-align: center;
  padding: 28px 20px calc(var(--bottom-nav-h) + 24px);
  color: var(--text-tertiary);
  font-size: 12px;
}

/* ------------------------------------------------------- Bottom nav ---- */
/* Mobile-only fixed tab bar, FotMob-style. Desktop keeps the top nav-links
   instead (hidden below via media query on .bottom-nav). */

.bottom-nav {
  display: none;
}

@media (max-width: 720px) {
  .nav-links {
    display: none;
  }

  .date-strip {
    top: 57px;
  }

  .league-group-title {
    top: 105px;
  }

  .bottom-nav {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: var(--bottom-nav-h);
    background: var(--nav-bg);
    border-top: 1px solid var(--glass-border);
    z-index: 50;
    padding-bottom: env(safe-area-inset-bottom);
  }

  .bottom-nav a {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    font-size: 10.5px;
    font-weight: 700;
    color: var(--text-tertiary);
  }

  .bottom-nav a .nav-icon {
    font-size: 18px;
    line-height: 1;
  }

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

  .news-thumb {
    width: 72px;
    height: 72px;
  }
}

/* ------------------------------------------------------- Match detail --- */

.match-loading {
  padding: 60px 16px;
  text-align: center;
}

.match-header {
  background: linear-gradient(180deg, rgba(155, 107, 255, 0.22), var(--bg-mid) 85%);
  border-bottom: 1px solid var(--glass-border);
  padding-bottom: 4px;
}

.match-header-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px 4px;
}

.match-header-league {
  flex: 1;
  text-align: center;
  font-weight: 700;
  font-size: 14px;
  color: var(--text-primary);
}

.match-teams-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
  padding: 18px 16px 20px;
}

.match-team-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 110px;
}

.match-team-col .team-crest {
  width: 56px;
  height: 56px;
}

.match-team-name {
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  text-align: center;
}

.match-center-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 70px;
}

.match-score {
  font-size: 30px;
  font-weight: 800;
}

.match-time {
  font-size: 26px;
  font-weight: 800;
}

.match-day {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 600;
}

.match-tabs {
  display: flex;
  gap: 8px;
  padding: 0 16px 14px;
  overflow-x: auto;
}

.match-tab {
  flex-shrink: 0;
  border: none;
  background: var(--glass-overlay);
  color: var(--text-secondary);
  font-weight: 700;
  font-size: 13px;
  padding: 9px 16px;
  border-radius: 20px;
  cursor: pointer;
}

.match-tab.active {
  background: var(--accent);
  color: #0f1117;
}

.match-tab-ai.active {
  background: var(--ai-accent);
  color: #fff;
}

.match-page {
  padding-top: 16px;
}

.match-countdown-card,
.match-vote-card {
  text-align: center;
}

.match-countdown-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-bottom: 10px;
}

.match-countdown {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.countdown-box {
  background: var(--glass-overlay);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 22px;
  font-weight: 800;
  min-width: 44px;
}

.countdown-sep {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-tertiary);
}

.match-vote-title {
  font-weight: 800;
  font-size: 16px;
  margin-bottom: 14px;
}

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

.match-vote-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--glass-overlay);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 12px 10px;
  font-weight: 700;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
}

.match-vote-btn span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.match-vote-btn.picked {
  border-color: var(--ai-accent);
  background: rgba(155, 107, 255, 0.16);
}

.match-vote-draw {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--text-secondary);
}

.match-vote-draw.picked {
  border-color: var(--ai-accent);
  color: var(--ai-accent);
  background: rgba(155, 107, 255, 0.16);
}

.match-vote-hint {
  margin-top: 12px;
  font-size: 12px;
  color: var(--text-tertiary);
}

.match-details-card {
  padding: 4px 16px;
}

.match-detail-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--glass-border);
  font-size: 13.5px;
  font-weight: 600;
}

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

.match-detail-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--glass-overlay);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.match-standings-highlight {
  background: rgba(215, 245, 71, 0.08);
}

.match-standings-highlight .col-team .team-name {
  color: var(--accent);
}

/* -------------------------------------------------------- Team detail --- */

.team-header {
  border-bottom: 1px solid var(--glass-border);
  padding-bottom: 4px;
}

.team-identity-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px 16px 4px;
}

.team-identity-row .team-crest {
  width: 64px;
  height: 64px;
  flex-shrink: 0;
}

.team-identity-text {
  min-width: 0;
}

.team-country {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.65);
  margin-bottom: 2px;
}

.team-name-lg {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
  line-height: 1.15;
}

.team-form-section {
  padding: 14px 16px 4px;
}

.team-form-label {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 8px;
}

.team-form-row {
  display: flex;
  gap: 8px;
}

.form-badge-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.form-badge {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  color: #fff;
}

.form-badge-sm {
  width: 20px;
  height: 20px;
  border-radius: 5px;
  font-size: 11px;
  display: inline-flex;
}

.form-win {
  background: #2e9e73;
}

.form-draw {
  background: rgba(255, 255, 255, 0.16);
}

.form-loss {
  background: var(--rel-red);
}

.form-badge-underline {
  width: 18px;
  height: 2px;
  background: transparent;
  border-radius: 2px;
}

.form-badge-underline.active {
  background: #fff;
}

.team-tabs {
  margin-top: 8px;
}

/* --------------------------------------------------- Team fixture rows --- */

.team-fixture-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 4px;
  border-bottom: 1px solid var(--glass-border);
}

.team-fixture-row:last-child {
  border-bottom: none;
}

.team-fixture-indicator {
  width: 3px;
  height: 22px;
  border-radius: 2px;
  background: var(--glass-overlay);
  flex-shrink: 0;
}

.indicator-win {
  background: #2e9e73;
}

.indicator-loss {
  background: var(--rel-red);
}

.indicator-live {
  background: var(--accent);
}

.team-fixture-opponent {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

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

.team-fixture-homeaway {
  font-size: 11px;
  color: var(--text-tertiary);
}

.team-fixture-trailing {
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.team-fixture-trailing.is-live {
  color: var(--accent);
}

/* ---------------------------------------------- Team fixture card strip --- */

.fixture-card-strip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 4px 0 16px;
  scrollbar-width: none;
}

.fixture-card-strip::-webkit-scrollbar {
  display: none;
}

.fixture-card {
  flex-shrink: 0;
  width: 140px;
  background: var(--card-bg);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
}

.fixture-card-team {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  max-width: 100%;
}

.fixture-card-team span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fixture-card-opponent {
  font-weight: 500;
  color: var(--text-secondary);
  font-size: 11px;
}

.fixture-card-score {
  font-size: 16px;
  font-weight: 800;
}

.fixture-card-live {
  font-size: 10px;
  font-weight: 800;
  color: var(--accent);
}

.fixture-card-date {
  font-size: 11px;
  color: var(--text-secondary);
}

.team-detail-label {
  color: var(--text-tertiary);
  font-size: 11.5px;
  font-weight: 600;
}

/* --------------------------------------------------- Table tab filters --- */

.table-filter-row {
  display: flex;
  gap: 8px;
  padding: 4px 0 14px;
  overflow-x: auto;
}

.table-filter-chip {
  flex-shrink: 0;
  border: 1px solid var(--glass-border);
  background: var(--glass-overlay);
  color: var(--text-primary);
  font-weight: 700;
  font-size: 12.5px;
  padding: 7px 15px;
  border-radius: 20px;
  cursor: pointer;
}

.table-filter-chip.active {
  background: var(--accent);
  color: #0f1117;
  border-color: var(--accent);
}

.team-table-card {
  padding-top: 14px;
}

.team-table-league-name {
  font-weight: 800;
  font-size: 15px;
  margin-bottom: 10px;
}

.team-table-link {
  display: inline-flex;
  align-items: center;
}

.team-form-cell {
  display: flex;
  gap: 4px;
  justify-content: flex-end;
  padding-top: 8px;
  padding-bottom: 8px;
}

/* ------------------------------------------------------------ Players --- */

.player-list {
  padding: 4px 16px;
}

.player-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--glass-border);
}

.player-row:last-child {
  border-bottom: none;
}

.player-number {
  width: 22px;
  text-align: center;
  font-weight: 800;
  color: var(--text-tertiary);
  font-size: 13px;
  flex-shrink: 0;
}

.player-avatar {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--glass-overlay);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.player-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  inset: 0;
}

.player-avatar-fallback {
  font-size: 15px;
  opacity: 0.4;
}

.player-avatar:not(.no-photo) img + .player-avatar-fallback {
  display: none;
}

.player-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.player-name {
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-position {
  font-size: 11px;
  color: var(--text-tertiary);
}

.player-age {
  font-size: 12px;
  color: var(--text-secondary);
  flex-shrink: 0;
}

/* ------------------------------------------------------ League detail --- */

.league-group-link {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.league-page-link {
  display: inline-block;
  margin: 0 16px 12px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--accent);
}

.match-header-league {
  color: inherit;
  text-decoration: none;
}

.league-identity {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 8px 16px 18px;
  text-align: center;
}

.league-identity .team-crest {
  width: 76px;
  height: 76px;
}

.league-name-lg {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  max-width: 90%;
}

.league-country-lg {
  font-size: 13.5px;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 600;
}

.league-fixture-card {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 10px;
  padding: 12px 14px;
}

.league-fixture-card.is-live {
  background: rgba(215, 245, 71, 0.08);
  border-color: rgba(215, 245, 71, 0.25);
}

.lfc-pill {
  flex-shrink: 0;
  width: 48px;
  background: var(--glass-overlay);
  border-radius: 8px;
  padding: 6px 4px;
  text-align: center;
}

.lfc-date {
  display: block;
  font-size: 9px;
  font-weight: 600;
  color: var(--text-tertiary);
  margin-bottom: 2px;
}

.lfc-status {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
}

.lfc-status.is-live {
  color: var(--accent);
}

.lfc-teams {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.lfc-team-line {
  display: flex;
  align-items: center;
  gap: 8px;
}

.lfc-team-name {
  flex: 1;
  min-width: 0;
  font-size: 13.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lfc-score {
  font-weight: 800;
  font-size: 14px;
}

/* Section titles inside league/team detail pages sit directly above a card
   or fixture list without the page's own left padding (the page-inset
   already provides it), so give them a touch of top space between blocks. */
.league-tab-panel .section-title,
.team-tab-panel .section-title,
.match-tab-panel .section-title {
  padding: 0 0 8px;
  margin-top: 18px;
}

.league-tab-panel .section-title:first-child,
.team-tab-panel .section-title:first-child,
.match-tab-panel .section-title:first-child {
  margin-top: 0;
}

/* ----------------------------------------------- Player of the Match --- */

.potm-card {
  position: relative;
  overflow: hidden;
}

.potm-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1.4;
  margin-bottom: 10px;
}

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

.potm-photo {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--glass-overlay);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  font-size: 18px;
}

.potm-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.potm-info {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

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

.potm-team {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  color: var(--text-secondary);
}

.potm-rating {
  background: #2faee0;
  color: #fff;
  font-weight: 800;
  font-size: 12.5px;
  padding: 5px 10px;
  border-radius: 20px;
  flex-shrink: 0;
}

.potm-goals {
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

/* --------------------------------------------------------------- Events -- */

.events-card {
  padding: 6px 8px;
}

.event-row {
  display: grid;
  grid-template-columns: 1fr 44px 1fr;
  align-items: center;
  padding: 8px 4px;
  border-bottom: 1px solid var(--glass-border);
}

.event-row:last-child {
  border-bottom: none;
}

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

.event-side-home {
  justify-content: flex-end;
  text-align: right;
}

.event-side-away {
  justify-content: flex-start;
  text-align: left;
}

.event-minute {
  text-align: center;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-tertiary);
}

.event-icon {
  font-size: 14px;
  flex-shrink: 0;
}

.event-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.event-title {
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.event-subtitle {
  font-size: 11px;
  color: var(--text-tertiary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* -------------------------------------------------------------- Lineups -- */

.lineup-managers-row,
.lineup-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.lineup-managers-label {
  font-size: 11px;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.lineup-header-team {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 13px;
}

.lineup-header-away {
  flex-direction: row-reverse;
}

.lineup-formation {
  color: var(--text-tertiary);
  font-weight: 600;
  font-size: 12px;
}

.pitch {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  background: linear-gradient(180deg, #171a24 0%, #12141c 50%, #171a24 100%);
  border: 1px solid var(--glass-border);
  border-radius: var(--card-radius);
  margin-bottom: 16px;
  overflow: hidden;
}

.pitch::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  border-top: 1px dashed var(--glass-border);
}

.pitch-marker {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  width: 46px;
}

.pitch-marker-circle {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--card-bg);
  border: 2px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  color: var(--text-primary);
}

.marker-home {
  border-color: var(--accent);
}

.marker-away {
  border-color: var(--ai-accent);
}

.pitch-marker-name {
  font-size: 9px;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 46px;
}

.lineup-subs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 16px;
}

.lineup-sub-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 0;
  border-bottom: 1px solid var(--glass-border);
  font-size: 12.5px;
}

.lineup-sub-row:last-child {
  border-bottom: none;
}

.lineup-sub-number {
  width: 18px;
  color: var(--text-tertiary);
  font-weight: 700;
  flex-shrink: 0;
}

.lineup-sub-name {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lineup-sub-pos {
  color: var(--text-tertiary);
  font-size: 10.5px;
  flex-shrink: 0;
}

.lineup-sub-empty {
  color: var(--text-tertiary);
  font-style: italic;
}

/* ---------------------------------------------------------------- Stats -- */

.stats-header-row {
  display: flex;
  justify-content: space-between;
  font-weight: 800;
  font-size: 13px;
  margin-bottom: 14px;
}

.stat-row {
  margin-bottom: 14px;
}

.stat-row:last-child {
  margin-bottom: 0;
}

.stat-values {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.stat-value-home,
.stat-value-away {
  font-weight: 800;
  font-size: 13px;
  flex-shrink: 0;
}

.stat-label {
  flex: 1;
  text-align: center;
  font-size: 11.5px;
  color: var(--text-tertiary);
}

.stat-bar {
  display: flex;
  height: 5px;
  border-radius: 3px;
  overflow: hidden;
  background: var(--glass-overlay);
}

.stat-bar-home {
  background: var(--accent);
}

.stat-bar-away {
  background: var(--ai-accent);
}

/* ------------------------------------------------------------------ H2H -- */

.h2h-record-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  align-items: center;
  text-align: center;
  margin-bottom: 10px;
}

.h2h-record-count {
  font-size: 20px;
  font-weight: 800;
}

.h2h-record-label {
  font-size: 10.5px;
  color: var(--text-tertiary);
  padding: 0 10px;
}

.h2h-record-bar {
  display: flex;
  height: 6px;
  border-radius: 3px;
  overflow: hidden;
}

.h2h-group-card {
  padding: 4px 16px;
}

.h2h-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--glass-border);
  color: inherit;
  text-decoration: none;
}

.h2h-row:last-child {
  border-bottom: none;
}

.h2h-date-pill {
  flex-shrink: 0;
  width: 48px;
  font-size: 11px;
  color: var(--text-tertiary);
  font-weight: 600;
}

.h2h-teams {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.h2h-teams span {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.h2h-scores {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: right;
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 700;
}

.h2h-winner {
  color: var(--text-primary) !important;
}

/* ----------------------------------------------------------------- Odds -- */

.odds-chip-row {
  display: flex;
  gap: 8px;
  padding: 0 0 14px;
  overflow-x: auto;
}

.odds-chip {
  flex-shrink: 0;
  border: 1px solid var(--glass-border);
  background: var(--glass-overlay);
  color: var(--text-primary);
  font-weight: 700;
  font-size: 12.5px;
  padding: 7px 15px;
  border-radius: 20px;
  cursor: pointer;
}

.odds-chip.active {
  background: var(--accent);
  color: #0f1117;
  border-color: var(--accent);
}

.odds-market-card {
  margin-bottom: 10px;
}

.odds-market-name {
  font-weight: 700;
  font-size: 13px;
  margin-bottom: 10px;
}

.odds-tile-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.odds-tile {
  width: 92px;
  background: var(--glass-overlay);
  border-radius: 8px;
  padding: 7px 6px;
  text-align: center;
}

.odds-tile-label {
  display: block;
  font-size: 10.5px;
  color: var(--text-tertiary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.odds-tile-odd {
  display: block;
  font-weight: 800;
  font-size: 13px;
  margin-top: 2px;
}

.odds-favorite {
  background: rgba(62, 178, 127, 0.18);
}

.odds-favorite .odds-tile-odd {
  color: #3fb27f;
}
