: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;
  }
}

