:root {
  --bg: #0f1a14;
  --surface: #17251d;
  --text: #eef3ef;
  --muted: #9db3a5;
  --accent: #f5c542;
  --grass: #2e7d4f;
  --grass-stripe: #2a7348;
  --line: rgba(255, 255, 255, 0.85);
  --att: #e5484d;
  --def: #3b82f6;
  --you: #f5c542;
  --best: #22c55e;
  --ok: #f59e0b;
  --bad: #e5484d;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif;
}

.app { max-width: 560px; margin: 0 auto; padding: 16px; }

.app-header h1 { margin: 0; font-size: 1.8rem; letter-spacing: -0.02em; }
.tagline, .hint { color: var(--muted); margin-top: 4px; }
h2 { font-size: 1.1rem; margin: 20px 0 8px; }

.screen[hidden], .feedback[hidden] { display: none; }

.field { display: grid; gap: 6px; margin: 16px 0; }
.field input {
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #2f4a3a;
  background: var(--surface);
  color: var(--text);
  font-size: 1rem;
}

.mode-picker { display: flex; gap: 8px; border: 0; padding: 0; margin: 0 0 16px; }
.mode-picker legend { padding: 0; margin-bottom: 6px; }
.mode { flex: 1; }
.mode input { position: absolute; opacity: 0; }
.mode span {
  display: block;
  text-align: center;
  padding: 10px;
  border-radius: 8px;
  border: 2px solid #2f4a3a;
  background: var(--surface);
  cursor: pointer;
  font-weight: 600;
}
.mode input:checked + span { border-color: var(--accent); color: var(--accent); }
.mode input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

.btn {
  border: 0;
  border-radius: 8px;
  padding: 12px 18px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}
.btn-primary { background: var(--accent); color: #1a1a1a; width: 100%; }

.leaderboard { padding-left: 24px; margin: 0; }
.leaderboard li { padding: 4px 0; color: var(--muted); }
.leaderboard li strong { color: var(--text); }
.leaderboard .is-new strong { color: var(--accent); }

.play-meta { display: flex; justify-content: space-between; color: var(--muted); }

.timer { height: 6px; background: var(--surface); border-radius: 3px; margin: 8px 0; overflow: hidden; }
.timer-bar { height: 100%; width: 100%; background: var(--accent); transform-origin: left; }
/* duration must match TIME_LIMIT_MS in game.js */
.timer-bar.is-running { animation: countdown 20s linear forwards; }
.timer-bar.is-paused { animation-play-state: paused; }
@keyframes countdown { from { transform: scaleX(1); } to { transform: scaleX(0); } }

.pitch svg { display: block; width: 100%; border-radius: 8px; }
.pitch .grass { fill: var(--grass); }
.pitch .stripe { fill: var(--grass-stripe); }
.pitch .mark { fill: none; stroke: var(--line); stroke-width: 0.25; }
.pitch .spot { fill: var(--line); }
.pitch .net { fill: rgba(255, 255, 255, 0.25); stroke: var(--line); stroke-width: 0.25; }
/* the 5-a-side pitch is scaled up ~2.7x, so thin its lines to match */
.pitch .marks-5 .mark, .pitch .marks-5 .net { stroke-width: 0.09; }
.pitch .arrow-run { stroke: #fff; stroke-width: 0.7; fill: none; }
.pitch .arrow-pass { stroke: var(--accent); stroke-width: 0.7; stroke-dasharray: 1.4 0.9; fill: none; }
.pitch .head-run { fill: #fff; }
.pitch .head-pass { fill: var(--accent); }
.pitch .player { stroke: #fff; stroke-width: 0.35; }
.pitch .player-att { fill: var(--att); }
.pitch .player-def { fill: var(--def); }
.pitch .player-gk { stroke: #111; stroke-width: 0.7; }
.pitch .player-you { fill: var(--you); stroke: #000; }
.pitch .you-ring { fill: none; stroke: var(--you); stroke-width: 0.3; }
.pitch .you-label { fill: var(--you); font: 700 2.2px system-ui, sans-serif; text-anchor: middle; }
.pitch .ball { fill: #fff; stroke: #000; stroke-width: 0.2; }

.legend { display: flex; flex-wrap: wrap; gap: 12px; list-style: none; padding: 0; margin: 8px 0; color: var(--muted); font-size: 0.85rem; }
.legend li { display: flex; align-items: center; gap: 6px; }
.dot { width: 12px; height: 12px; border-radius: 50%; border: 1px solid #fff; }
.dot-you { background: var(--you); }
.dot-def { background: var(--def); }
.dot-att { background: var(--att); }
.dot-gk { background: transparent; border: 3px solid #111; outline: 1px solid #fff; }
.line { width: 22px; height: 0; border-top: 2px solid #fff; }
.line-pass { border-top: 2px dashed var(--accent); }

.prompt { font-weight: 600; }

.options { display: grid; gap: 8px; }
.option {
  text-align: left;
  background: var(--surface);
  color: var(--text);
  border: 2px solid transparent;
  border-radius: 8px;
  padding: 12px;
  font-size: 0.95rem;
  cursor: pointer;
}
.option:hover:not(:disabled) { border-color: var(--accent); }
.option:disabled { cursor: default; opacity: 0.7; }
.option .key { color: var(--muted); margin-right: 8px; font-weight: 700; }
.option.is-best { border-color: var(--best); opacity: 1; }
.option.is-ok { border-color: var(--ok); }
.option.is-picked { opacity: 1; }
.option.is-picked.is-bad { border-color: var(--bad); }

.feedback { margin-top: 12px; padding: 12px; background: var(--surface); border-radius: 8px; }
.verdict { font-weight: 700; margin: 0 0 4px; }
.verdict.best { color: var(--best); }
.verdict.ok { color: var(--ok); }
.verdict.bad { color: var(--bad); }

.tip { border-left: 3px solid var(--accent); padding-left: 10px; color: var(--muted); font-size: 0.9rem; }

.final-score { font-size: 3rem; font-weight: 800; margin: 8px 0; color: var(--accent); }

.publish { margin: 16px 0; padding: 12px; background: var(--surface); border-radius: 8px; }
.publish h2 { margin-top: 0; }
.publish .field { margin-top: 0; }
.consent { display: flex; gap: 10px; align-items: flex-start; font-size: 0.9rem; color: var(--muted); margin-bottom: 12px; }
.consent input { margin-top: 3px; flex: none; width: 18px; height: 18px; }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-link { background: none; border: 0; padding: 0; color: var(--muted); text-decoration: underline; cursor: pointer; font-size: 0.9rem; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.site-footer { margin-top: 32px; padding-top: 12px; border-top: 1px solid #2f4a3a; color: var(--muted); font-size: 0.85rem; text-align: center; }
a { color: var(--accent); }

/* legal pages */
.legal h1 { font-size: 1.6rem; }
.legal h2 { margin-top: 24px; }
.legal p, .legal li { color: var(--text); }
.legal .placeholder { background: #3a2f12; color: var(--accent); padding: 0 4px; border-radius: 4px; }
