/* VAR Ref — football family. The kid is the referee: look at the incident,
   make the call, learn the law. Standalone static page; see ../_GAMES_CONTRACT.md. */
:root {
  --brand: #2C3A43;
  --brand-2: #517485;
  --accent: #E84E0F;
  --green: #2E9E4F;
  --gold: #FFD700;
  --danger: #D2434D;
  --bg: #eaf2f6;
  --card: #ffffff;
  --ink: #1e2b33;
  --radius: 18px;
  --shadow: 0 6px 18px rgba(44, 58, 67, 0.14);
  /* friendly pitch green for illustrations */
  --pitch: #59b25f;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}
.grad-bg { background: linear-gradient(180deg, #eaf2f6 0%, #dcebf2 100%); min-height: 100vh; }

.app {
  max-width: 640px; margin: 0 auto; min-height: 100vh;
  padding: 16px 16px 32px; display: flex; flex-direction: column; gap: 16px;
}

/* ---------- top bar ---------- */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.back-link {
  font-weight: 800; color: var(--brand-2); text-decoration: none; font-size: 16px;
  white-space: nowrap; padding: 8px 0;
}
.back-link:active { opacity: .6; }
.topbar-title { font-weight: 800; color: var(--brand); font-size: 16px; }

/* ---------- header ---------- */
.game-head { text-align: center; }
.game-emoji { font-size: 52px; line-height: 1; }
.game-title { font-size: 26px; font-weight: 800; color: var(--brand); margin: 6px 0 2px; }
.game-sub { color: var(--brand-2); font-weight: 600; font-size: 15px; margin: 0; }

/* ---------- score strip ---------- */
.strip { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.chip {
  background: var(--card); border-radius: 999px; box-shadow: var(--shadow);
  padding: 8px 16px; font-weight: 800; color: var(--brand); font-size: 15px;
  display: inline-flex; align-items: center; gap: 7px;
}
.chip .v { color: var(--accent); }
.chip.fire { background: #fff3e8; }
.chip.round-progress { color: var(--brand-2); }

/* ---------- incident stage ---------- */
.stage {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 12px; overflow: hidden;
}
.stage svg { display: block; width: 100%; height: auto; border-radius: 12px; }
.incident-title {
  font-size: 18px; font-weight: 800; color: var(--brand);
  text-align: center; margin: 2px 0 0; padding: 0 4px;
}

/* ---------- prompt ---------- */
.prompt {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px; text-align: center;
}
.prompt-q { font-size: 18px; font-weight: 800; color: var(--brand); margin: 0; }
.prompt-hint { color: var(--brand-2); font-weight: 600; font-size: 14px; margin: 6px 0 0; }

/* ---------- verdict grid ---------- */
.verdicts {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
}
.verdict {
  display: flex; align-items: center; justify-content: center; gap: 9px;
  background: var(--card); border: 3px solid transparent; border-radius: 14px;
  box-shadow: var(--shadow); padding: 12px 13px; min-height: 62px;
  font: inherit; font-weight: 800; font-size: 16px; color: var(--brand);
  text-align: center; cursor: pointer;
  transition: transform .1s ease, border-color .1s ease;
}
.verdict:active { transform: scale(0.97); }
.verdict .ico { font-size: 22px; line-height: 1; }
.verdict.picked { border-color: var(--green); background: #eefaf1; }
.verdict.picked::after { content: "✅"; font-size: 16px; }
.verdict.missed { border-color: var(--danger); background: #fdeef0; animation: shake .32s ease; }
.verdict.missed::after { content: "❌"; font-size: 16px; }
.verdict.disabled { pointer-events: none; opacity: .92; }

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}
@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.06); }
  100% { transform: scale(1); }
}
.pulse { animation: pulse .3s ease; }

/* ---------- feedback / explanation ---------- */
.feedback {
  min-height: 30px; text-align: center; font-weight: 800; font-size: 17px;
}
.feedback.ok { color: var(--green); }
.feedback.no { color: var(--danger); }

.explain {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px; border-left: 8px solid var(--brand-2);
  display: flex; flex-direction: column; gap: 8px;
}
.explain.ok { border-left-color: var(--green); }
.explain.no { border-left-color: var(--danger); }
.explain .verdict-line { font-weight: 800; font-size: 17px; color: var(--brand); margin: 0; }
.explain .why { font-weight: 700; font-size: 16px; margin: 0; color: var(--ink); }
.explain .law { font-weight: 600; font-size: 14px; margin: 0; color: var(--brand-2); }
.explain .law b { color: var(--brand); }

/* ---------- buttons ---------- */
.btn {
  min-height: 58px; padding: 12px 20px; border: none; border-radius: 14px;
  background: var(--brand-2); color: #fff; font: inherit; font-weight: 700;
  font-size: 17px; cursor: pointer; box-shadow: var(--shadow); min-width: 80px;
}
.btn:active { transform: scale(0.97); }
.btn.primary { background: var(--accent); }
.btn.ghost { background: #fff; color: var(--brand-2); border: 2px solid var(--brand-2); }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; pointer-events: none; }

.actions { display: flex; gap: 10px; flex-wrap: wrap; }
.actions .btn { flex: 1; }

/* ---------- end card ---------- */
.endcard {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 22px 18px; text-align: center; display: flex; flex-direction: column; gap: 12px;
}
.endcard .big { font-size: 56px; line-height: 1; }
.endcard h2 { margin: 0; color: var(--brand); font-size: 23px; }
.endcard .score { font-size: 40px; font-weight: 800; color: var(--accent); }
.endcard p { margin: 0; color: var(--brand-2); font-weight: 600; }

/* ---------- misc ---------- */
.center { text-align: center; }
.muted { color: var(--brand-2); font-weight: 600; }
.loading { text-align: center; color: var(--brand-2); font-weight: 700; padding: 28px 0; }
.legend-note { text-align: center; color: var(--brand-2); font-weight: 600; font-size: 13px; margin: 0; }
