:root {
  --bg: #0b1220;
  --bg-2: #111a2e;
  --card: #152038;
  --card-2: #1b2846;
  --line: #26365a;
  --text: #eef2fb;
  --muted: #93a3c4;
  --accent: #f5b301;      /* goalpost gold */
  --accent-ink: #1a1300;
  --turf: #22c55e;
  --miss: #ef4444;
  --skip: #64748b;
  --team: #2563eb;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  background:
    radial-gradient(1200px 500px at 50% -200px, #1c2c55 0%, transparent 70%),
    repeating-linear-gradient(0deg, transparent 0 79px, rgba(255,255,255,.025) 79px 80px),
    var(--bg);
  color: var(--text);
  font: 16px/1.45 Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
button, input { font: inherit; color: inherit; }
img { max-width: 100%; }
.muted { color: var(--muted); }

/* ---------- top bar & steps ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; max-width: 720px; width: 100%; margin: 0 auto;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px;
  background: var(--accent); color: var(--accent-ink);
  font: 700 22px/1 Oswald, sans-serif;
}
.brand-name { font: 700 22px/1 Oswald, sans-serif; letter-spacing: .04em; text-transform: uppercase; }
.top-meta { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.score-chip {
  background: var(--card-2); border: 1px solid var(--line); border-radius: 999px;
  padding: 4px 12px; font: 600 15px/1.2 Oswald, sans-serif; letter-spacing: .03em;
}

.steps {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px;
  max-width: 720px; width: 100%; margin: 0 auto; padding: 0 16px 12px;
}
.step {
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px;
  padding: 6px 8px; font-size: 12px; color: var(--muted); display: flex; justify-content: space-between; gap: 4px;
  min-width: 0;
}
.step b { color: var(--text); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.step.active { border-color: var(--accent); color: var(--text); }
.step.done { background: var(--card); }
.step .pts { font-family: Oswald, sans-serif; color: var(--accent); }

.wrap { max-width: 720px; width: 100%; margin: 0 auto; padding: 0 16px 24px; flex: 1; }
.loading { padding: 60px 0; text-align: center; color: var(--muted); }

/* ---------- cards ---------- */
.card {
  background: linear-gradient(180deg, var(--card) 0%, var(--bg-2) 100%);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 18px; margin-bottom: 14px;
}
.round-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.kicker { font: 600 13px/1.2 Inter, sans-serif; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }
.round-title { font: 700 28px/1.1 Oswald, sans-serif; margin: 2px 0 0; letter-spacing: .01em; }
.worth { font-size: 14px; color: var(--muted); white-space: nowrap; }
.worth b { font: 700 20px/1 Oswald, sans-serif; color: var(--text); }
.lede { color: var(--muted); margin: 0 0 14px; }

/* ---------- buttons ---------- */
.btn {
  appearance: none; border: 1px solid var(--line); background: var(--card-2);
  border-radius: 12px; padding: 12px 16px; font-weight: 600; cursor: pointer;
  transition: transform .06s ease, background .15s ease, border-color .15s ease;
}
a.btn { color: var(--text); display: inline-flex; align-items: center; justify-content: center; }
.btn:hover { border-color: #3a4f80; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.ghost { background: transparent; }
.btn.block { width: 100%; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-row .btn { flex: 1 1 auto; }

/* ---------- intro ---------- */
.start-wrap { min-height: 60vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; text-align: center; }
.start-title { font: 700 clamp(48px, 13vw, 84px)/0.95 Oswald, sans-serif; text-transform: uppercase; letter-spacing: .02em; margin: 0; }
.downs-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; width: 100%; max-width: 560px; }
.downs-row img { width: 100%; aspect-ratio: 1; object-fit: cover; object-position: top; border-radius: 14px;
  background: linear-gradient(180deg, #003a8c, #001f4d); border: 2px solid var(--accent); }
.downs-row img:nth-child(odd) { transform: rotate(-3deg); }
.downs-row img:nth-child(even) { transform: rotate(3deg); }
.start-btn { max-width: 420px; padding: 18px 20px; font-size: 18px; box-shadow: var(--shadow); }
.hero h1 { font: 700 40px/1.02 Oswald, sans-serif; margin: 6px 0 8px; text-transform: uppercase; letter-spacing: .01em; }
.hero p { color: var(--muted); margin: 0 0 18px; }
.rounds { list-style: none; padding: 0; margin: 0 0 18px; display: grid; gap: 10px; }
.rounds li { display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; align-items: center;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.rounds .num { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center;
  background: var(--card-2); font: 700 20px/1 Oswald, sans-serif; color: var(--accent); }
.rounds strong { display: block; }
.rounds small { color: var(--muted); }
.rounds .max { font: 600 16px/1 Oswald, sans-serif; color: var(--muted); }

/* ---------- round 1: stat card ---------- */
.statcard { background: var(--bg); border: 1px solid var(--line); border-radius: 14px; padding: 14px; margin-bottom: 14px; }
.stat-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.pos-badge { font: 700 15px/1 Oswald, sans-serif; background: var(--accent); color: var(--accent-ink);
  padding: 5px 10px; border-radius: 8px; letter-spacing: .05em; }
.season { font-size: 13px; color: var(--muted); }
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat { background: var(--bg-2); border-radius: 10px; padding: 10px 8px; text-align: center; min-width: 0; }
.stat .v { font: 700 26px/1.05 Oswald, sans-serif; font-variant-numeric: tabular-nums; }
.stat .l { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-top: 3px; }

.hints { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 14px; }
.hint { border: 1px dashed var(--line); border-radius: 10px; padding: 8px 4px; text-align: center; min-height: 74px;
  display: flex; flex-direction: column; justify-content: center; gap: 4px; min-width: 0; }
.hint .hl { font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.hint .hv { font: 600 17px/1.1 Oswald, sans-serif; overflow-wrap: anywhere; }
.hint.locked .hv { color: var(--skip); font-size: 20px; }
.hint.open { border-style: solid; border-color: var(--accent); background: rgba(245, 179, 1, .07); }
.hint img { width: 100%; max-width: 70px; margin: 0 auto; border-radius: 8px; background: var(--bg-2); }
.photo-big { display: block; width: 100%; max-width: 260px; margin: 0 auto 12px; border-radius: 12px; background: var(--bg); }

/* ---------- guess input + autocomplete ---------- */
.guess-row { display: flex; gap: 8px; position: relative; }
.ac { position: relative; flex: 1; }
.ac input {
  width: 100%; padding: 13px 14px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--bg); outline: none; font-size: 16px;
}
.ac input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(245, 179, 1, .18); }
.ac-list { position: absolute; z-index: 1000; top: calc(100% + 4px); left: 0; right: 0; margin: 0; padding: 4px;
  list-style: none; background: var(--card-2); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow);
  max-height: 290px; overflow-y: auto; }
.ac-list li { padding: 10px 12px; border-radius: 8px; cursor: pointer; }
.ac-list li.hl, .ac-list li:hover { background: rgba(245, 179, 1, .15); }
.ac-list mark { background: none; color: var(--accent); font-weight: 700; }
.sub-row { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; gap: 8px; flex-wrap: wrap; }
.feedback { min-height: 22px; margin-top: 8px; font-size: 14px; color: var(--muted); }
.feedback.bad { color: #fca5a5; }
.feedback.good { color: #86efac; }

.guess-list { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 6px; }
.guess-list li { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 10px; background: var(--bg-2); font-size: 15px; }
.guess-list .tag { font: 600 12px/1 Inter, sans-serif; padding: 4px 7px; border-radius: 6px; }
.tag.miss { background: rgba(239, 68, 68, .18); color: #fca5a5; }
.tag.skip { background: rgba(100, 116, 139, .25); color: #cbd5e1; }
.tag.hit { background: rgba(34, 197, 94, .2); color: #86efac; }

/* ---------- reveal ---------- */
.reveal { display: grid; grid-template-columns: 96px 1fr; gap: 14px; align-items: center; margin-bottom: 14px;
  background: var(--bg); border: 1px solid var(--line); border-radius: 14px; padding: 12px; }
.reveal img { width: 96px; height: 70px; object-fit: cover; object-position: top; border-radius: 10px; background: var(--bg-2); }
.reveal .name { font: 700 24px/1.1 Oswald, sans-serif; }
.points-earned { font: 700 44px/1 Oswald, sans-serif; color: var(--accent); }
.points-earned small { font-size: 18px; color: var(--muted); }
.result-line { display: flex; justify-content: space-between; align-items: end; gap: 10px; margin: 6px 0 14px; }

/* ---------- round 2: roster ---------- */
.team-band { background: var(--team); border-radius: 14px; padding: 14px 16px; margin-bottom: 12px;
  display: flex; justify-content: space-between; align-items: center; color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.12); }
.team-band .tn { font: 700 30px/1 Oswald, sans-serif; text-transform: uppercase; letter-spacing: .03em; text-shadow: 0 1px 2px rgba(0,0,0,.4); }
.team-band small { opacity: .85; font-size: 13px; }
.slots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.slot { background: var(--bg); border: 1px dashed var(--line); border-radius: 12px; padding: 10px 8px; text-align: center;
  min-height: 108px; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 4px; min-width: 0; }
.slot .sl { font: 600 13px/1 Oswald, sans-serif; letter-spacing: .08em; color: var(--accent); }
.slot .sn { font-weight: 600; font-size: 14px; line-height: 1.2; overflow-wrap: anywhere; }
.slot .sq { font: 700 26px/1 Oswald, sans-serif; color: var(--skip); }
.slot img { width: 56px; height: 41px; object-fit: cover; object-position: top; border-radius: 6px; background: var(--bg-2); }
.slot.filled { border-style: solid; border-color: rgba(34,197,94,.6); background: rgba(34,197,94,.07); }
.slot.given { border-style: solid; border-color: var(--line); background: var(--card-2); }
.slot.missed { border-style: solid; border-color: rgba(239,68,68,.45); background: rgba(239,68,68,.06); }
.pips { display: flex; gap: 6px; align-items: center; font-size: 13px; color: var(--muted); }
.pip { width: 14px; height: 14px; border-radius: 50%; background: var(--accent); }
.pip.used { background: var(--line); }

/* ---------- round 3: map ---------- */
#map { height: min(62vh, 520px); border-radius: 14px; border: 1px solid var(--line); margin-bottom: 12px; background: #aad3df; }
.leaflet-container { font: inherit; }
.map-bar { display: flex; gap: 8px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.dist { font: 700 34px/1 Oswald, sans-serif; }
.pin-guess { width: 22px; height: 22px; border-radius: 50% 50% 50% 0; background: var(--accent); border: 3px solid #fff;
  transform: rotate(-45deg); box-shadow: 0 2px 6px rgba(0,0,0,.5); }
.pin-stadium { width: 26px; height: 26px; border-radius: 50%; background: var(--turf); border: 3px solid #fff;
  box-shadow: 0 0 0 6px rgba(34,197,94,.35), 0 2px 6px rgba(0,0,0,.5); }

/* ---------- round 4: deep cut ---------- */
.prompt { font: 600 24px/1.25 Oswald, sans-serif; margin: 4px 0 14px; letter-spacing: .01em; }
.timer-wrap { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.timer { position: relative; width: 72px; height: 72px; flex: none; }
.timer svg { transform: rotate(-90deg); }
.timer .t { position: absolute; inset: 0; display: grid; place-items: center; font: 700 26px/1 Oswald, sans-serif; }
.timer.low .t { color: var(--miss); }
.tier-legend { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin: 4px 0 16px; }
.tier-legend div { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 8px 4px; text-align: center; }
.tier-legend b { display: block; font: 700 20px/1 Oswald, sans-serif; color: var(--accent); }
.tier-legend span { display: block; font-size: 11px; line-height: 1.25; color: var(--muted); }
.answer-groups { display: grid; gap: 10px; margin-top: 10px; }
.answer-groups h4 { margin: 0 0 4px; font: 600 13px/1.2 Inter, sans-serif; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.answer-groups p { margin: 0; font-size: 14px; }
.shake { animation: shake .3s; }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

/* ---------- results ---------- */
.final { text-align: center; padding: 6px 0 14px; }
.final .big { font: 700 84px/1 Oswald, sans-serif; color: var(--accent); }
.final .of { font: 600 26px/1 Oswald, sans-serif; color: var(--muted); }
.final .verdict { font-size: 16px; margin-top: 6px; color: var(--muted); }
.breakdown { display: grid; gap: 8px; margin: 10px 0 16px; }
.brow { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; align-items: center; background: var(--bg); border: 1px solid var(--line);
  border-radius: 12px; padding: 10px 12px; }
.brow .bl { font-weight: 600; }
.brow .bl small { display: block; font-weight: 400; color: var(--muted); font-size: 13px; }
.brow .bp { font: 700 24px/1 Oswald, sans-serif; }
.bar { grid-column: 1 / -1; height: 6px; border-radius: 99px; background: var(--line); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.share-preview { white-space: pre-wrap; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 12px;
  font: 14px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; margin: 0 0 12px; }
.countdown { text-align: center; color: var(--muted); margin-top: 14px; font-size: 14px; }
.countdown b { font: 600 20px/1 Oswald, sans-serif; color: var(--text); letter-spacing: .04em; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--text); color: var(--bg);
  padding: 10px 16px; border-radius: 10px; font-weight: 600; box-shadow: var(--shadow); z-index: 2000; }


@media (max-width: 520px) {
  .hero h1 { font-size: 34px; }
  .stat .v { font-size: 22px; }
  .hints { gap: 4px; }
  .hint { min-height: 66px; padding: 6px 2px; }
  .hint .hv { font-size: 14px; }
  .hint .hl { font-size: 9px; }
  .step { flex-direction: column; align-items: flex-start; }
  .slot { min-height: 96px; }
  .slot .sn { font-size: 13px; }
  .final .big { font-size: 68px; }
  .prompt { font-size: 21px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
