:root {
  --navy: #06131f;
  --navy2: #081d2b;
  --gold: #ffd43b;
  --gold2: #b98b18;
  --red: #c1272d;
  --white: #ffffff;
  --muted: #c7d0dc;
  --card: rgba(255, 255, 255, 0.07);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: radial-gradient(circle at top, #10263b 0, #06131f 45%, #02080e 100%);
  color: var(--white);
  min-height: 100vh;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(3, 10, 18, 0.98);
  border-bottom: 1px solid rgba(255, 212, 59, 0.35);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 24px;
}

.brand {
  color: var(--gold);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 1.4px;
  text-decoration: none;
  font-size: clamp(18px, 3vw, 28px);
  white-space: nowrap;
}

.nav {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav a {
  color: var(--white);
  text-decoration: none;
  border: 1px solid rgba(255, 212, 59, 0.35);
  padding: 9px 14px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.95rem;
}

.nav a:hover,
.nav a.active {
  background: var(--gold);
  color: #06131f;
}

main {
  width: min(1180px, 94vw);
  margin: 0 auto;
}

.hero {
  display: grid;
  grid-template-columns: 1fr minmax(260px, 420px);
  gap: 28px;
  align-items: center;
  padding: 34px 0;
}

.home-hero h1 {
  font-size: clamp(36px, 7vw, 72px);
  line-height: 0.95;
  margin: 8px 0 18px;
  text-transform: uppercase;
}

.hero-copy p {
  font-size: 20px;
  color: var(--muted);
}

.poster {
  width: 100%;
  border: 1px solid rgba(255, 212, 59, 0.55);
  border-radius: 22px;
  box-shadow: 0 20px 60px rgba(0,0,0,.45);
}

.kicker {
  color: var(--gold);
  text-transform: uppercase;
  font-weight: 900;
  letter-spacing: 4px;
  margin: 0 0 10px;
}

.quick-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 26px;
}

.big-link {
  display: block;
  background: linear-gradient(135deg, rgba(255, 212, 59, .95), rgba(185, 139, 24, .9));
  color: #06131f;
  text-decoration: none;
  font-weight: 900;
  padding: 16px;
  border-radius: 16px;
  text-align: center;
  font-size: 19px;
}

.section {
  padding: 24px 0 34px;
  border-top: 1px solid rgba(255, 212, 59, 0.35);
}

.section-heading,
.page-title {
  padding: 24px 0 10px;
}

.section-heading h2,
.page-title h1 {
  margin: 0;
  text-transform: uppercase;
}

.section-heading h2 {
  font-size: clamp(32px, 6vw, 58px);
}

.page-title h1 {
  font-size: clamp(38px, 7vw, 68px);
  line-height: 1;
  border-bottom: 1px solid rgba(255, 212, 59, 0.4);
  padding-bottom: 18px;
}

.rules-grid,
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
}

.card,
.match-card,
.player-card {
  background: linear-gradient(180deg, rgba(255,255,255,.09), rgba(255,255,255,.035));
  border: 1px solid rgba(255, 212, 59, 0.38);
  border-radius: 16px;
  box-shadow: 0 12px 35px rgba(0,0,0,.25);
}

.card {
  padding: 18px;
  margin: 12px 0;
}

.card h3 {
  color: var(--gold);
  margin-top: 0;
}

.highlight {
  border-color: var(--gold);
  box-shadow: 0 0 0 1px rgba(255, 212, 59, .25);
}

.compact-table {
  width: 100%;
  border: 1px solid rgba(255, 212, 59, 0.35);
  border-radius: 14px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.035);
}

.table-header,
.table-row {
  display: grid;
  grid-template-columns: 76px 1fr 54px;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
}

.table-header {
  background: rgba(255, 212, 59, 0.16);
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.table-row {
  border-top: 1px solid rgba(255,255,255,0.08);
  font-size: 0.96rem;
}

.rank-cell {
  color: var(--gold);
  font-weight: 900;
}

.player-cell {
  font-weight: 800;
}

.points-cell {
  text-align: right;
  font-weight: 900;
}

.compact-match {
  display: grid;
  grid-template-columns: 1fr 76px;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  margin-bottom: 9px;
}

.teams {
  font-size: 1rem;
  font-weight: 850;
}

.match-no {
  color: var(--gold);
}

.score {
  text-align: right;
  color: var(--gold);
  font-weight: 900;
  font-size: 1.2rem;
}

.controls {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin-bottom: 18px;
}

.hint {
  color: var(--muted);
  margin-top: 0;
  font-size: 1rem;
}

input,
select {
  width: 100%;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255, 212, 59, .45);
  color: var(--white);
  padding: 14px 16px;
  border-radius: 14px;
  font-size: 1rem;
}

select option { color: #06131f; }

.player-card {
  margin-bottom: 10px;
  overflow: hidden;
}

.prediction-summary {
  cursor: pointer;
  display: grid;
  grid-template-columns: 28px 1fr 76px 70px;
  gap: 8px;
  align-items: center;
  padding: 12px 14px;
  font-weight: 900;
  list-style: none;
}

.prediction-summary::-webkit-details-marker { display: none; }

.expand-icon {
  color: var(--gold);
  transition: transform 0.2s ease;
}

.player-card[open] .expand-icon { transform: rotate(180deg); }

.prediction-points,
.prediction-rank {
  text-align: right;
  color: var(--gold);
  font-size: 0.95rem;
}

.prediction-table-wrap { overflow-x: auto; }

.prediction-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  min-width: 560px;
}

.prediction-table th,
.prediction-table td {
  border-bottom: 1px solid rgba(255,255,255,.13);
  padding: 10px;
  text-align: left;
}

.prediction-table th {
  color: var(--gold);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.pill {
  display: inline-block;
  min-width: 44px;
  text-align: center;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(255, 212, 59, .14);
  border: 1px solid rgba(255, 212, 59, .35);
  color: var(--gold);
  font-weight: 900;
}

.empty {
  color: var(--muted);
  font-size: 18px;
}

.error {
  border: 1px solid var(--red);
  padding: 16px;
  border-radius: 14px;
  color: #fff;
  background: rgba(193,39,45,.16);
}

footer {
  text-align: center;
  color: var(--muted);
  padding: 32px 20px;
  border-top: 1px solid rgba(255, 212, 59, .25);
  margin-top: 30px;
}

@media (max-width: 760px) {
  .site-header {
    position: static;
    padding: 14px;
    flex-direction: column;
    align-items: stretch;
  }

  .brand {
    font-size: 1.15rem;
    text-align: center;
    white-space: normal;
  }

  .nav {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .nav a {
    text-align: center;
    border-radius: 12px;
    padding: 9px 8px;
    font-size: 0.9rem;
  }

  main { width: min(100% - 20px, 1180px); }

  .hero {
    grid-template-columns: 1fr;
    padding: 24px 0;
  }

  .poster { order: -1; border-radius: 16px; }

  .home-hero h1 {
    font-size: 2.4rem;
  }

  .quick-links { grid-template-columns: 1fr; }

  .page-title {
    padding-top: 22px;
  }

  .page-title h1 {
    font-size: 2.45rem;
    padding-bottom: 14px;
  }

  .kicker {
    letter-spacing: 3px;
    font-size: 0.82rem;
  }

  .table-header,
  .table-row {
    grid-template-columns: 64px 1fr 46px;
    padding: 9px 10px;
    font-size: 0.88rem;
  }

  .compact-match {
    grid-template-columns: 1fr 62px;
    font-size: 0.9rem;
    padding: 10px 11px;
  }

  .teams { font-size: 0.92rem; }
  .score { font-size: 1rem; }

  .prediction-summary {
    grid-template-columns: 22px 1fr 62px;
    padding: 11px 12px;
    font-size: 0.9rem;
  }

  .prediction-rank { display: none; }

  .prediction-table {
    min-width: 0;
    font-size: 0.82rem;
  }

  .prediction-table,
  .prediction-table tbody,
  .prediction-table tr,
  .prediction-table td {
    display: block;
    width: 100%;
  }

  .prediction-table thead { display: none; }

  .prediction-table tr {
    padding: 10px 0;
    border-top: 1px solid rgba(255,255,255,.12);
  }

  .prediction-table td {
    border: 0;
    padding: 4px 10px;
  }

  .prediction-table td::before {
    content: attr(data-label) ': ';
    color: var(--gold);
    font-weight: 900;
  }
}

/* v3 upgrades */
.last-updated {
  display: inline-block;
  color: var(--muted);
  border: 1px solid rgba(255, 212, 59, .32);
  border-radius: 999px;
  padding: 8px 12px;
  margin: 0 0 14px;
  background: rgba(255,255,255,.045);
  font-weight: 800;
}

.top10-table {
  max-width: 760px;
}

.pill.exact {
  background: rgba(46, 204, 113, .18);
  border-color: rgba(46, 204, 113, .8);
  color: #7dffad;
}

.pill.scored {
  background: rgba(255, 212, 59, .16);
}

.pill.zero {
  opacity: .72;
}

.prediction-table tr.exact td {
  background: rgba(46, 204, 113, .08);
}

.prediction-table tr.exact td:last-child {
  color: #7dffad;
}

.prediction-table tr.scored td:last-child {
  color: var(--gold);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 26px;
}

.stat-card {
  background: linear-gradient(180deg, rgba(255,255,255,.09), rgba(255,255,255,.035));
  border: 1px solid rgba(255, 212, 59, 0.38);
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 12px 35px rgba(0,0,0,.25);
}

.stat-card span {
  display: block;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-size: .78rem;
  font-weight: 900;
  margin-bottom: 10px;
}

.stat-card strong {
  display: block;
  font-size: clamp(1.4rem, 4vw, 2.2rem);
  line-height: 1.05;
}

.stat-card small {
  display: block;
  color: var(--muted);
  margin-top: 8px;
  font-weight: 800;
}

.mini-heading h2 {
  font-size: clamp(1.5rem, 4vw, 2.4rem);
}

.stats-table .table-header,
.stats-table .table-row {
  grid-template-columns: 1fr 140px;
}

.stats-table .table-header span,
.stats-table .table-row span {
  white-space: nowrap;
}

@media (max-width: 760px) {
  .nav {
    grid-template-columns: repeat(2, 1fr);
  }

  .nav a:last-child {
    grid-column: 1 / -1;
  }

  .stats-table .table-header,
  .stats-table .table-row {
    grid-template-columns: 1fr 74px 58px;
  }

  .last-updated {
    font-size: .85rem;
  }
}

/* ---- Cloudflare CSS fix: exact-score and points badges ---- */
/* Newer app.js uses these class names. Keep these even if older .pill.exact rules exist. */

.exact-score-row td {
  background: rgba(46, 204, 113, 0.10) !important;
}

.exact-score-row td:first-child {
  border-left: 4px solid #2ecc71;
}

.points-badge {
  display: inline-block;
  min-width: 34px;
  text-align: center;
  padding: 4px 8px;
  border-radius: 999px;
  font-weight: 900;
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.points-five {
  background: rgba(46, 204, 113, 0.20);
  border-color: rgba(46, 204, 113, 0.85);
  color: #7dffad;
}

.points-five::after {
  content: " ✅ Exact";
  white-space: nowrap;
}

.points-mid {
  background: rgba(255, 212, 59, 0.18);
  border-color: rgba(255, 212, 59, 0.65);
  color: var(--gold);
}

.points-one {
  background: rgba(52, 152, 219, 0.18);
  border-color: rgba(52, 152, 219, 0.65);
  color: #9ed6ff;
}

.points-zero {
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
  opacity: 0.85;
}

/* Also support the earlier v3 class names */
.prediction-table tr.exact-score-row td:last-child,
.prediction-table tr.exact td:last-child {
  color: #7dffad;
}

.prediction-table tr.exact-score-row td {
  background: rgba(46, 204, 113, .10);
}

/* Make mobile exact text fit better */
@media (max-width: 760px) {
  .points-badge {
    min-width: 30px;
    padding: 3px 7px;
  }

  .points-five::after {
    content: " Exact";
  }
}

.wrong-score-row td {
  background: rgba(220, 53, 69, 0.12) !important;
}

.wrong-score-row td:first-child {
  border-left: 4px solid #ff4d4d;
}

.partial-score-row td {
  background: rgba(255, 166, 0, 0.10) !important;
}

.partial-score-row td:first-child {
  border-left: 4px solid #ffb347;
}

.exact-score-row td {
  background: rgba(46, 204, 113, 0.12) !important;
}

.exact-score-row td:first-child {
  border-left: 4px solid #2ecc71;
}

.points-zero {
  background: rgba(220, 53, 69, 0.22);
  border-color: rgba(220, 53, 69, 0.85);
  color: #ffb3b3;
}

.points-mid {
  background: rgba(255, 166, 0, 0.22);
  border-color: rgba(255, 166, 0, 0.85);
  color: #ffd27a;
}

.points-five {
  background: rgba(46, 204, 113, 0.22);
  border-color: rgba(46, 204, 113, 0.9);
  color: #7dffad;
}

.points-five::after {
  content: "";
}

.fixture-card {
  background: linear-gradient(180deg, rgba(255,255,255,.09), rgba(255,255,255,.035));
  border: 1px solid rgba(255, 212, 59, 0.38);
  border-radius: 16px;
  padding: 14px 16px;
  margin-bottom: 10px;
}

.fixture-date {
  color: var(--gold);
  font-size: 0.82rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 6px;
}

.fixture-match {
  font-size: 1.05rem;
  font-weight: 900;
}

@media (max-width: 760px) {
  .fixture-card {
    padding: 12px 13px;
  }

  .fixture-match {
    font-size: 0.95rem;
  }

  .fixture-date {
    font-size: 0.78rem;
  }
}

.fixture-day {
  margin-bottom: 18px;
  border: 1px solid rgba(255, 212, 59, 0.35);
  border-radius: 14px;
  overflow: hidden;
  background: rgba(255,255,255,0.035);
}

.fixture-day-title {
  margin: 0;
  padding: 10px 14px;
  background: rgba(255, 212, 59, 0.16);
  color: var(--gold);
  font-size: 0.9rem;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.fixture-list {
  display: grid;
}

.fixture-row {
  display: grid;
  grid-template-columns: 76px 1fr;
  gap: 12px;
  align-items: center;
  padding: 10px 14px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.fixture-time {
  color: var(--gold);
  font-weight: 900;
}

.fixture-teams {
  font-weight: 600;
}

@media (max-width: 760px) {
  .fixture-row {
    grid-template-columns: 60px 1fr;
    padding: 9px 11px;
  }

  .fixture-day-title {
    font-size: 0.82rem;
  }

  .fixture-teams {
    font-size: 0.9rem;
  }
}

/* Homepage fun cards */
.fun-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin: 18px 0 24px;
}

.feature-card {
  background: linear-gradient(180deg, rgba(255,255,255,.09), rgba(255,255,255,.035));
  border: 1px solid rgba(255, 212, 59, 0.38);
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 12px 35px rgba(0,0,0,.25);
}

.feature-label {
  display: block;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-size: .78rem;
  font-weight: 900;
  margin-bottom: 10px;
}

.feature-card strong {
  display: block;
  font-size: clamp(1.25rem, 4vw, 2rem);
  line-height: 1.05;
}

.feature-card small {
  display: block;
  color: var(--muted);
  margin-top: 8px;
  font-weight: 800;
}

@media (max-width: 760px) {
  .feature-card { padding: 14px; }
  .feature-card strong { font-size: 1.35rem; }
}

.latest-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 18px;
}

.latest-stats div {
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255, 212, 59, .28);
  border-radius: 12px;
  padding: 12px;
  text-align: center;
}

.latest-stats b {
  display: block;
  color: var(--gold);
  font-size: 2rem;
  line-height: 1;
}

.latest-stats span {
  display: block;
  color: var(--muted);
  font-weight: 900;
  margin-top: 6px;
  font-size: .85rem;
}

@media (max-width: 760px) {
  .latest-stats {
    grid-template-columns: 1fr;
  }
}

.result-row {
  grid-template-columns: 76px 1fr 80px;
}

.result-score {
  color: var(--gold);
  font-weight: 900;
  text-align: right;
  font-size: 1.1rem;
}

@media (max-width: 760px) {
  .result-row {
    grid-template-columns: 58px 1fr 58px;
  }

  .result-score {
    font-size: 0.95rem;
  }
}

/* Fun stats page upgrade */
.stats-hero-card {
  background: linear-gradient(135deg, rgba(255, 212, 59, 0.18), rgba(255,255,255,.045));
  border: 1px solid rgba(255, 212, 59, 0.55);
  border-radius: 18px;
  padding: 22px;
  margin-bottom: 18px;
  box-shadow: 0 12px 35px rgba(0,0,0,.28);
}

.stats-hero-card strong {
  display: block;
  font-size: clamp(1.8rem, 5vw, 3rem);
  line-height: 1.05;
}

.stats-hero-card small {
  display: block;
  color: var(--muted);
  font-weight: 800;
  margin-top: 10px;
}

.fun-stats-grid .stat-card {
  min-height: 150px;
}

.stat-gold {
  background: linear-gradient(180deg, rgba(255, 212, 59, .15), rgba(255,255,255,.035));
}

.stat-green {
  background: linear-gradient(180deg, rgba(46, 204, 113, .15), rgba(255,255,255,.035));
}

.stat-red {
  background: linear-gradient(180deg, rgba(220, 53, 69, .15), rgba(255,255,255,.035));
}

.stat-blue {
  background: linear-gradient(180deg, rgba(52, 152, 219, .15), rgba(255,255,255,.035));
}

.mini-title {
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: 1.1rem;
  margin: 26px 0 12px;
}

.stats-leaderboard-section {
  margin-top: 20px;
}

@media (max-width: 760px) {
  .stats-hero-card {
    padding: 16px;
  }

  .stats-hero-card strong {
    font-size: 1.7rem;
  }

  .fun-stats-grid .stat-card {
    min-height: auto;
  }
}

.result-row {
  grid-template-columns: 76px 1fr 80px;
}

.result-score {
  color: var(--gold);
  font-weight: 900;
  text-align: right;
  font-size: 1.1rem;
}

@media (max-width: 760px) {
  .result-row {
    grid-template-columns: 58px 1fr 58px;
  }

  .result-score {
    font-size: 0.95rem;
  }
}

.round-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 16px;
  width: 100%;
}

.round-tab {
  background: rgba(255,255,255,0.08);
  color: #ffffff;
  border: 1px solid rgba(255,215,0,0.25);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.round-tab:hover {
  border-color: #ffd700;
  transform: translateY(-1px);
}

.round-tab.active {
  background: linear-gradient(
    135deg,
    #ffd700 0%,
    #f4c430 100%
  );
  color: #0b1f3a;
  border-color: #ffd700;
  box-shadow: 0 0 12px rgba(255,215,0,0.35);
}


@media (max-width: 760px) {
  .round-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .round-tab {
    width: 100%;
    min-width: 0;
    padding: 8px 6px;
    font-size: 0.78rem;
    text-align: center;
    white-space: nowrap;
  }
}

/* Interactive fixtures: click a fixture to see everyone’s predictions */
.fixture-detail-card {
  border-top: 1px solid rgba(255,255,255,0.08);
}

.fixture-detail-card:first-child {
  border-top: 0;
}

.fixture-detail-card summary::-webkit-details-marker {
  display: none;
}

.interactive-fixture-row {
  grid-template-columns: 76px 1fr 34px;
  cursor: pointer;
  list-style: none;
}

.interactive-fixture-row:hover {
  background: rgba(255, 212, 59, 0.08);
}

.fixture-open-icon {
  color: var(--gold);
  font-weight: 900;
  text-align: right;
  transition: transform 0.2s ease;
}

.fixture-detail-card[open] .fixture-open-icon {
  transform: rotate(180deg);
}

.fixture-prediction-panel {
  padding: 14px;
  border-top: 1px solid rgba(255,255,255,0.1);
  background: rgba(0,0,0,0.12);
}

.fixture-prediction-summaryline {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
  color: var(--muted);
  font-weight: 800;
}

.fixture-prediction-summaryline span {
  border: 1px solid rgba(255, 212, 59, 0.28);
  background: rgba(255,255,255,0.045);
  border-radius: 999px;
  padding: 7px 10px;
}

.fixture-prediction-summaryline b {
  color: var(--gold);
}

.fixture-tools {
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 10px;
  margin-bottom: 10px;
}

.fixture-filter-count {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 800;
  margin: 0 0 10px;
}

.fixture-prediction-table .table-header,
.fixture-prediction-table .table-row {
  grid-template-columns: 70px 1fr 96px 64px;
}

.fixture-pick-cell {
  text-align: right;
}

@media (max-width: 760px) {
  .interactive-fixture-row {
    grid-template-columns: 58px 1fr 24px;
  }

  .fixture-prediction-panel {
    padding: 11px;
  }

  .fixture-tools {
    grid-template-columns: 1fr;
  }

  .fixture-prediction-summaryline {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .fixture-prediction-summaryline span {
    border-radius: 12px;
  }

  .fixture-prediction-table .table-header,
  .fixture-prediction-table .table-row {
    grid-template-columns: 52px 1fr 70px 48px;
    gap: 7px;
  }

  .fixture-prediction-table .table-header,
  .fixture-prediction-table .table-row {
    font-size: 0.82rem;
  }

  .fixture-pick-cell .pill {
    min-width: 38px;
    padding: 4px 7px;
  }
}

/* Prize leaderboard tabs */
.leaderboard-tabs {
  display: flex;
  gap: 0.65rem;
  margin: 0 0 1.25rem;
  flex-wrap: wrap;
}

.leaderboard-tab {
  border: 1px solid rgba(255, 212, 59, 0.45);
  background: rgba(255,255,255,0.06);
  color: var(--white);
  padding: 0.75rem 1.2rem;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 900;
  font-size: 1rem;
  box-shadow: none;
}

.leaderboard-tab:hover {
  border-color: var(--gold);
  transform: translateY(-1px);
}

.leaderboard-tab.active {
  background: linear-gradient(135deg, var(--gold), var(--gold2));
  color: var(--navy);
  border-color: var(--gold);
  box-shadow: 0 0 18px rgba(255, 212, 59, 0.35);
}

@media (max-width: 760px) {
  .leaderboard-tabs {
    display: grid;
    grid-template-columns: 1fr;
  }

  .leaderboard-tab {
    width: 100%;
  }
}


/* Final round: first-goal-minute prediction */
.minute-badge {
  display: inline-block;
  min-width: 48px;
  text-align: center;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(52, 152, 219, 0.18);
  border: 1px solid rgba(52, 152, 219, 0.65);
  color: #b9e4ff;
  font-weight: 900;
}


/* Final-focused homepage */
.final-hero {
  text-align: center;
  padding: clamp(38px, 7vw, 86px) 0 42px;
}

.final-hero h1 {
  margin: 4px 0 16px;
  font-size: clamp(3rem, 10vw, 7.5rem);
  line-height: .9;
  text-transform: uppercase;
  letter-spacing: -0.055em;
}

.final-hero h1 span {
  display: inline-block;
  color: var(--gold);
  font-size: .45em;
  margin: 0 .18em;
  transform: translateY(-.18em);
}

.final-hero-copy {
  max-width: 760px;
  margin: 0 auto 28px;
  color: var(--muted);
  font-size: clamp(1rem, 2.4vw, 1.35rem);
  font-weight: 700;
}

.final-spotlight-loading {
  color: var(--muted);
  padding: 24px;
}

.final-match-card {
  max-width: 1040px;
  margin: 0 auto;
  padding: clamp(18px, 4vw, 34px);
  border: 1px solid rgba(255, 212, 59, .55);
  border-radius: 26px;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 212, 59, .16), transparent 42%),
    linear-gradient(180deg, rgba(255,255,255,.09), rgba(255,255,255,.035));
  box-shadow: 0 24px 70px rgba(0,0,0,.38), 0 0 0 1px rgba(255,212,59,.08) inset;
}

.final-match-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-weight: 800;
  font-size: .9rem;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.final-match-meta strong { color: var(--gold); }

.final-team-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: clamp(12px, 4vw, 36px);
  align-items: center;
  padding: clamp(24px, 5vw, 46px) 0;
}

.final-team {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  font-size: clamp(1.5rem, 5vw, 3.8rem);
  text-transform: uppercase;
}

/* CSS-drawn flags avoid unsupported emoji rendering as ES / AR on Windows. */
.final-flag {
  position: relative;
  display: block;
  width: clamp(108px, 14vw, 190px);
  aspect-ratio: 3 / 2;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid rgba(255,255,255,.72);
  box-shadow: 0 12px 28px rgba(0,0,0,.38), 0 0 0 1px rgba(255,212,59,.18);
}

.final-flag-spain {
  background: linear-gradient(to bottom, #aa151b 0 25%, #f1bf00 25% 75%, #aa151b 75% 100%);
}

.final-flag-spain::after {
  content: "";
  position: absolute;
  left: 30%;
  top: 42%;
  width: 11%;
  height: 23%;
  border-radius: 2px;
  background: linear-gradient(90deg, #aa151b 0 32%, #f1bf00 32% 68%, #aa151b 68%);
  box-shadow: 0 0 0 1px rgba(80,35,10,.45);
}

.final-flag-argentina {
  background: linear-gradient(to bottom, #74acdf 0 33.333%, #fff 33.333% 66.666%, #74acdf 66.666% 100%);
}

.final-flag-argentina::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 14%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: #f6b40e;
  box-shadow: 0 0 0 2px rgba(183,120,0,.45), 0 0 10px rgba(246,180,14,.55);
}

.final-versus {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--gold);
  font-size: clamp(1rem, 2vw, 1.5rem);
  font-weight: 1000;
}

.final-trophy {
  display: block;
  width: 92px;
  height: 92px;
  object-fit: cover;
  border-radius: 50%;
  border: 2px solid rgba(255,212,59,.75);
  box-shadow: 0 10px 26px rgba(0,0,0,.38), 0 0 24px rgba(255,212,59,.18);
}

.final-team strong {
  font-size: clamp(2rem, 5.5vw, 4.4rem);
  line-height: .95;
  letter-spacing: .02em;
}

.final-stat-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

.final-stat-grid article {
  padding: 14px 10px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.1);
  background: rgba(0,0,0,.18);
}

.final-stat-grid span,
.final-stat-grid small {
  display: block;
  color: var(--muted);
  font-weight: 800;
}

.final-stat-grid span {
  min-height: 2.1em;
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .07em;
}

.final-stat-grid strong {
  display: block;
  margin: 7px 0 3px;
  color: var(--gold);
  font-size: clamp(1.25rem, 2.7vw, 2rem);
  line-height: 1;
}

.final-stat-grid small { font-size: .72rem; }

.final-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 300px));
  justify-content: center;
  gap: 14px;
  margin-top: 22px;
}

.final-live-section { padding-top: 34px; }
.final-section-heading { display: flex; justify-content: space-between; align-items: end; gap: 20px; }

@media (max-width: 900px) {
  .final-stat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 600px) {
  .final-hero { padding-top: 34px; }
  .final-hero h1 span { display: block; margin: .32em 0; transform: none; }
  .final-match-meta { display: grid; grid-template-columns: 1fr; }
  .final-team-row { gap: 8px; }
  .final-team { font-size: 1.35rem; }
  .final-flag { width: min(34vw, 132px); border-radius: 7px; }
  .final-team strong { font-size: clamp(1.45rem, 8vw, 2.25rem); }
  .final-trophy { width: 64px; height: 64px; }
  .final-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .final-actions { grid-template-columns: 1fr; }
  .final-section-heading { display: block; }
  .final-section-heading .last-updated { margin-top: 12px; }
}


/* Final kickoff countdown */
.kickoff-countdown {
  max-width: 820px;
  margin: 0 auto 26px;
  padding: clamp(18px, 3vw, 28px);
  border: 2px solid var(--gold);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255, 212, 59, .18), rgba(255,255,255,.045));
  box-shadow: 0 18px 55px rgba(0,0,0,.42), 0 0 30px rgba(255, 212, 59, .12);
  text-align: center;
}

.countdown-label {
  margin: 0 0 14px;
  color: var(--gold);
  font-size: clamp(.85rem, 2vw, 1.05rem);
  font-weight: 1000;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.countdown-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(8px, 2vw, 16px);
}

.countdown-grid > div {
  padding: clamp(12px, 3vw, 22px) 8px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 16px;
  background: rgba(0,0,0,.32);
}

.countdown-grid strong {
  display: block;
  color: var(--white);
  font-size: clamp(2.2rem, 8vw, 5.2rem);
  line-height: .9;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 22px rgba(255, 212, 59, .3);
}

.countdown-grid span {
  display: block;
  margin-top: 10px;
  color: var(--gold);
  font-size: clamp(.65rem, 1.8vw, .85rem);
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.countdown-status {
  margin: 15px 0 0;
  color: var(--white);
  font-size: clamp(.9rem, 2vw, 1.15rem);
  font-weight: 900;
}

.countdown-grid.is-live > div {
  border-color: #7dffad;
  background: rgba(46, 204, 113, .16);
}

.countdown-grid.is-live strong,
.countdown-grid.is-live span { color: #7dffad; }

@media (max-width: 520px) {
  .kickoff-countdown { padding: 16px 10px; }
  .countdown-grid { gap: 7px; }
  .countdown-grid > div { border-radius: 12px; }
}


/* Cache-proof Final assets */
.final-flag::before,
.final-flag::after,
.final-team::before,
.final-team::after,
.flag-spain::before,
.flag-spain::after,
.flag-argentina::before,
.flag-argentina::after {
  content: none !important;
  display: none !important;
}

img.final-flag {
  display: block !important;
  width: 180px !important;
  height: 112px !important;
  object-fit: cover !important;
  border-radius: 14px !important;
  border: 2px solid rgba(255, 212, 59, 0.8) !important;
  background: #fff !important;
  box-shadow: 0 10px 28px rgba(0,0,0,.42) !important;
}

img.final-trophy {
  display: block !important;
  width: 92px !important;
  height: 132px !important;
  object-fit: contain !important;
  margin: 0 auto 8px !important;
  filter: drop-shadow(0 8px 16px rgba(0,0,0,.45)) !important;
}

.final-versus {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
}

.final-versus strong {
  display: block !important;
  margin-top: 0 !important;
}

@media (max-width: 760px) {
  img.final-flag {
    width: 108px !important;
    height: 68px !important;
  }

  img.final-trophy {
    width: 60px !important;
    height: 88px !important;
  }
}

/* Mobile final team-name alignment fix */
.final-team {
  min-width: 0;
  width: 100%;
  text-align: center;
}

.final-team strong {
  display: block;
  width: 100%;
  text-align: center;
  white-space: nowrap;
}

@media (max-width: 760px) {
  .final-team strong {
    font-size: clamp(1.2rem, 6.2vw, 1.75rem) !important;
    line-height: 1 !important;
    letter-spacing: 0 !important;
  }
}

/* Mobile final team alignment fix */
@media (max-width: 600px) {
  .final-team-row {
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    column-gap: 8px;
  }

  .final-team {
    width: 100%;
    min-width: 0;
    align-items: center;
    text-align: center;
  }

  .final-team strong {
    display: block;
    width: 100%;
    max-width: 100%;
    margin: 0;
    font-size: clamp(1.1rem, 5.4vw, 1.45rem);
    line-height: 1;
    letter-spacing: 0;
    text-align: center;
    white-space: nowrap;
  }

  img.final-flag {
    margin-left: auto !important;
    margin-right: auto !important;
  }
}

/* FINAL MOBILE OVERFLOW FIX — keep both team names inside the card */
@media (max-width: 600px) {
  .final-match-card {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    padding-left: 12px;
    padding-right: 12px;
  }

  .final-team-row {
    width: 100%;
    min-width: 0;
    grid-template-columns: minmax(0, 1fr) 52px minmax(0, 1fr) !important;
    column-gap: 4px !important;
  }

  .final-team {
    width: 100%;
    min-width: 0;
    overflow: hidden;
  }

  .final-team strong {
    display: block;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    margin: 0;
    font-size: clamp(0.95rem, 4.35vw, 1.1rem) !important;
    line-height: 1 !important;
    letter-spacing: 0 !important;
    text-align: center;
    white-space: nowrap;
  }

  img.final-flag {
    width: min(27vw, 96px) !important;
    height: auto !important;
    aspect-ratio: 3 / 2;
  }

  img.final-trophy {
    width: 48px !important;
    height: 72px !important;
  }
}

@media (max-width: 360px) {
  .final-team-row {
    grid-template-columns: minmax(0, 1fr) 46px minmax(0, 1fr) !important;
    column-gap: 2px !important;
  }

  .final-team strong {
    font-size: 0.88rem !important;
  }

  img.final-flag {
    width: 84px !important;
  }

  img.final-trophy {
    width: 42px !important;
    height: 64px !important;
  }
}
