:root {
  --pitch-900: #07140b;
  --pitch-800: #0b1f10;
  --pitch-700: #123419;
  --line: #1e4527;
  --ink: #eef5ee;
  --ink-dim: #9fb8a4;
  --gold: #e8c452;
  --gold-deep: #b8922f;
  --danger: #e25b4a;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Inter", system-ui, sans-serif;
  color: var(--ink);
  background:
    repeating-linear-gradient(90deg, transparent 0 120px, rgb(255 255 255 / 0.015) 120px 240px),
    radial-gradient(1200px 600px at 50% -10%, #16401f 0%, var(--pitch-900) 60%);
  background-attachment: fixed;
  min-height: 100vh;
}

header { text-align: center; padding: 40px 16px 12px; }
.kicker { letter-spacing: 0.35em; font-size: 12px; font-weight: 700; color: var(--gold); }
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.hero {
  display: block;
  width: min(680px, calc(100% - 16px));
  margin: 14px auto 16px;
  border-radius: 14px;
  border: 1px solid var(--gold-deep);
  box-shadow: 0 12px 40px rgb(0 0 0 / 0.5);
}
.toolbar {
  display: flex; gap: 12px; justify-content: center; align-items: center;
  color: var(--ink-dim); font-size: 14px;
}
#refresh {
  background: var(--pitch-700); color: var(--ink);
  border: 1px solid var(--line); border-radius: 999px;
  padding: 6px 16px; font: inherit; cursor: pointer;
}
#refresh:hover { border-color: var(--gold); color: var(--gold); }
#refresh.spinning { opacity: 0.6; pointer-events: none; }
.stale { margin-top: 10px; color: var(--gold); font-size: 13px; }

.stakes {
  max-width: 760px; margin: 4px auto 0; padding: 10px 18px 12px;
  background: linear-gradient(180deg, var(--pitch-800), var(--pitch-900));
  border: 1px solid var(--gold-deep); border-radius: 14px;
  text-align: center;
}
.stakes-title {
  font-family: "Archivo Black", sans-serif; font-size: 13px;
  letter-spacing: 0.2em; color: var(--gold); margin: 2px 0 8px;
}
.stake-line { padding: 6px 0; font-size: 13px; font-weight: 600; border-top: 1px solid rgb(255 255 255 / 0.05); }
.stake-line:first-of-type { border-top: none; }
.stake-when { color: var(--ink-dim); font-size: 12px; font-weight: 700; margin-right: 10px; }
.stake-line.live .stake-when { color: #ff5a5a; }
.stake-vs { color: var(--ink-dim); font-weight: 400; margin: 0 8px; }
.stake-note { margin-top: 3px; font-size: 12px; font-weight: 600; color: var(--gold); }

main {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: 20px; padding: 24px;
  max-width: 1800px; margin: 0 auto;
}

.pot {
  /* basis ≈ widest pot table, so a row never holds a pot it must squash;
     min-width: 0 lets a lone pot shrink on phones (table-wrap scrolls) */
  flex: 0 1 560px; min-width: 0;
  background: linear-gradient(180deg, var(--pitch-800), var(--pitch-900));
  border: 1px solid var(--line); border-radius: 14px;
}
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.pot-head { padding: 14px 16px 10px; border-bottom: 1px solid var(--line); }
.pot-head h2 { margin: 0; font-family: "Archivo Black", sans-serif; font-size: 17px; }
.pot-stakes { margin-top: 4px; font-size: 12px; color: var(--ink-dim); }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th {
  text-align: left; font-size: 10px; text-transform: uppercase;
  letter-spacing: 0.12em; color: var(--ink-dim); padding: 8px 6px;
}
td { padding: 8px 6px; border-top: 1px solid rgb(255 255 255 / 0.04); }
.num { text-align: center; width: 26px; }
td.num { color: var(--ink-dim); }
.team { font-weight: 600; white-space: nowrap; }
.flag {
  margin-right: 7px;
  vertical-align: -2px;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgb(255 255 255 / 0.12);
}
.owner { color: var(--gold); font-weight: 600; }
td.pts { color: var(--ink); font-weight: 700; }
.mv { display: block; font-size: 9px; line-height: 1; margin-top: 2px; }
.mv.up { color: #6ecf73; }
.mv.down { color: var(--danger); }
.mv.same { color: var(--ink-dim); opacity: 0.5; }
.status { font-size: 12px; color: var(--ink-dim); white-space: nowrap; }

tr.eliminated { opacity: 0.45; }
tr.eliminated .team { text-decoration: line-through; text-decoration-color: rgb(255 255 255 / 0.4); }
tr.zone-danger { background: rgb(226 91 74 / 0.10); box-shadow: inset 3px 0 0 var(--danger); }

.badge {
  display: inline-block; margin-left: 8px; padding: 2px 8px;
  border-radius: 999px; font-size: 10px; font-weight: 700; letter-spacing: 0.05em;
}
.badge.gold { background: rgb(232 196 82 / 0.15); color: var(--gold); border: 1px solid var(--gold-deep); }
.badge.danger { background: rgb(226 91 74 / 0.15); color: var(--danger); border: 1px solid var(--danger); }
.badge.soft { background: rgb(255 255 255 / 0.06); color: var(--ink-dim); border: 1px solid var(--line); }

.tracker { max-width: 1100px; margin: 0 auto; padding: 8px 24px 0; }
.tracker-title {
  font-family: "Archivo Black", sans-serif; font-size: 22px;
  text-align: center; margin: 24px 0 14px;
}
.tracker-filters {
  display: flex; flex-wrap: wrap; gap: 10px 14px; justify-content: center;
  margin-bottom: 14px; color: var(--ink-dim); font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.1em;
}
.tracker-filters label { display: flex; flex-direction: column; gap: 4px; }
.tracker-filters select {
  background: var(--pitch-700); color: var(--ink);
  border: 1px solid var(--line); border-radius: 8px;
  padding: 6px 10px; font: 13px "Inter", system-ui, sans-serif;
}
.tracker-filters select:focus { outline: none; border-color: var(--gold); }
.match-list {
  background: linear-gradient(180deg, var(--pitch-800), var(--pitch-900));
  border: 1px solid var(--line); border-radius: 14px; padding: 6px 16px 14px;
}
.match-day {
  margin: 16px 2px 4px; font-size: 11px; font-weight: 700;
  letter-spacing: 0.15em; text-transform: uppercase; color: var(--ink-dim);
}
.match-day.today { color: var(--gold); }
.match-row {
  display: grid; grid-template-columns: 110px 1fr auto 1fr;
  gap: 10px; align-items: center; padding: 8px 2px;
  border-top: 1px solid rgb(255 255 255 / 0.04); font-size: 13px;
}
.match-tag { font-size: 10px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-dim); }
.match-home { text-align: right; font-weight: 600; }
.match-away { text-align: left; font-weight: 600; }
.match-mid { text-align: center; font-weight: 700; white-space: nowrap; }
.kickoff { color: var(--ink-dim); font-weight: 600; font-size: 12px; }
.match-row .owner { font-size: 11px; }
.tbd { color: var(--ink-dim); font-style: italic; font-weight: 400; }
.live-badge {
  margin-left: 8px; color: #ff5a5a; font-size: 10px; font-weight: 800;
  letter-spacing: 0.1em; animation: pulse 1.2s ease-in-out infinite;
}
@keyframes pulse { 50% { opacity: 0.3; } }
.no-matches { padding: 18px; text-align: center; color: var(--ink-dim); }
@media (max-width: 600px) {
  .match-row { grid-template-columns: 1fr auto 1fr; }
  .match-tag { display: none; }
}

footer { text-align: center; padding: 28px 16px 40px; color: var(--ink-dim); font-size: 13px; }
#house-rules { color: var(--gold); font-weight: 600; font-size: 13px; margin-top: 10px; }
