:root {
  --bg: #0f172a;
  --card: #111c33;
  --line: #24324f;
  --text: #e5e7eb;
  --muted: #94a3b8;
  --blue: #3b82f6;
  /* The two teams' kits this match (set by the game; blue v red until then). */
  --home: #2563eb; --home-light: #93c5fd; --home-num: #fff;
  --away: #dc2626; --away-light: #fca5a5; --away-num: #fff;
  --red: #ef4444;
  --gold: #facc15;
  --green: #22c55e;
  --amber: #f59e0b;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}
header {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(8px + var(--safe-area-inset-top, env(safe-area-inset-top))) max(16px, var(--safe-area-inset-right, env(safe-area-inset-right))) 8px max(16px, var(--safe-area-inset-left, env(safe-area-inset-left)));
  border-bottom: 1px solid var(--line);
}
.brand { font-size: 19px; white-space: nowrap; }
/* Header: the score pill, your coach, settings — nothing else. */
.score-pill { display: inline-flex; align-items: baseline; gap: 4px; padding: 6px 12px; border-radius: 999px; min-height: 38px; }
.score-pill b { font-size: 16px; }
.score-pill small { color: var(--muted); font-size: 12px; }
.score-pill .streak { margin-left: 4px; font-weight: 700; font-size: 13px; }

main {
  display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 18px;
  padding: 18px 20px; max-width: 1600px; margin: 0 auto;
}
/* Narrower screens: upright, the panel goes under the pitch; sideways (tablets, phones on their
   side) it stays beside it, so the options never end up below the fold. */
@media (max-width: 1050px) and (orientation: portrait) { main { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 1050px) and (orientation: landscape) {
  main { grid-template-columns: minmax(0, 1fr) minmax(280px, 36%); gap: 12px; padding: 10px 12px; }
}

.pitch-wrap { position: relative; width: 100%; border-radius: 10px; overflow: hidden; box-shadow: 0 8px 30px rgba(0,0,0,.35); }
canvas { display: block; width: 100%; margin: 0 auto; touch-action: pan-x pan-y; } /* pinch is ours (zoom the pitch) */
button { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.banner {
  position: absolute; top: 12px; left: 50%; transform: translateX(-50%);
  background: rgba(15, 23, 42, .82); color: #fff; padding: 6px 14px; border-radius: 999px;
  font-weight: 600; font-size: 14px; pointer-events: none; white-space: nowrap;
}
.banner.ok { background: rgba(22, 101, 52, .92); }
.banner.bad { background: rgba(153, 27, 27, .92); }


button, select {
  font: inherit; color: var(--text); background: #1e293b; border: 1px solid var(--line);
  border-radius: 8px; padding: 7px 12px; cursor: pointer;
}
button:hover:not(:disabled) { border-color: #3b4d72; background: #243250; }
button:disabled { opacity: .45; cursor: default; }
button.primary { background: var(--blue); border-color: var(--blue); color: #fff; font-weight: 600; }
button.primary:hover { background: #2563eb; }
button.big { font-size: 17px; padding: 11px 22px; margin: 6px 0 10px; }
button.ghost { background: transparent; color: var(--muted); }
select { padding: 5px 8px; }

/* The vision-cone tip (first decision only) and its legend swatch. */
.tip { margin: 4px 0 8px; padding: 6px 10px; border-radius: 8px; font-size: 13px; color: #cbd5e1; background: rgba(255,255,255,.06); }
body.short.decide .tip { display: none; }
.legend .cone { width: 16px; height: 12px; background: radial-gradient(circle at 0 50%, rgba(255,255,255,.75), rgba(255,255,255,0) 75%);
  clip-path: polygon(0 50%, 100% 0, 100% 100%); }

/* The App Store / Google Play links on the web start screen (never shown inside the apps). */
.store-links { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.store-links p { margin: 0 0 8px; }
.store-row { display: flex; flex-wrap: wrap; gap: 8px; }
.store-link {
  display: inline-block; padding: 8px 14px; border-radius: 8px; font-size: 14px; font-weight: 600;
  color: var(--text); background: #1e293b; border: 1px solid var(--line); text-decoration: none;
}
.store-link:hover { border-color: var(--blue); color: #fff; }

.panel {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 18px 20px; align-self: start; max-height: calc(100vh - 110px); overflow-y: auto;
}
.panel h2 { font-size: 20px; line-height: 1.3; margin: 6px 0 8px; }
.panel h4 { margin: 16px 0 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: 12px; text-transform: none; letter-spacing: 0; }
.blue { color: var(--home-light); } /* your team's colour, whatever the kit */
kbd { background: #1e293b; border: 1px solid var(--line); border-radius: 4px; padding: 0 5px; font-size: 12px; }
.how { padding-left: 20px; }
.how li { margin: 6px 0; }

.phase { display: inline-block; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  color: #93c5fd; background: rgba(59,130,246,.15); padding: 3px 9px; border-radius: 999px; }
.phase.q { color: #fde68a; background: rgba(250,204,21,.15); }
.teams { line-height: 1.9; }
.dot { display: inline-block; width: 11px; height: 11px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; }
.dot.home { background: #2563eb; } .dot.away { background: #dc2626; }

.chips { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.chip { display: flex; flex-direction: column; align-items: center; padding: 6px 4px; font-size: 11px; color: var(--muted); }
.chip b { font-size: 17px; color: #fff; }
.chip:hover { border-color: var(--gold) !important; }
.chip.gk b { color: #fbbf24; }
.actions { display: flex; gap: 8px; }
.action { flex: 1; padding: 10px; font-weight: 600; }
.action:hover, .move:hover { border-color: var(--gold) !important; }
.moves { display: flex; flex-direction: column; gap: 8px; }
.move { text-align: left; padding: 10px 12px; display: flex; align-items: center; gap: 10px; }
.letter { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%;
  background: #fff; color: #111; font-weight: 800; font-size: 13px; flex: none; }

.verdict { font-size: 22px; font-weight: 800; padding: 10px 14px; border-radius: 10px; display: flex; justify-content: space-between; align-items: center; }
.verdict span { font-size: 16px; opacity: .9; }
.v-best { background: rgba(34,197,94,.18); color: #86efac; }
.v-good { background: rgba(59,130,246,.18); color: #93c5fd; }
.v-ok { background: rgba(245,158,11,.18); color: #fcd34d; }
.v-poor { background: rgba(239,68,68,.18); color: #fca5a5; }
.you { margin: 12px 0 2px; color: var(--muted); }
.you b { color: var(--text); }
.headline { font-size: 17px; font-weight: 600; margin: 4px 0; }
.why { padding-left: 18px; margin: 0; }
.why li { margin: 5px 0; }
.why li.trade::marker { content: '⚖  '; }
.why1 { margin: 6px 0 4px; font-size: 15px; line-height: 1.4; }
.principle { margin-top: 14px; padding: 10px 12px; border-left: 3px solid var(--gold); background: rgba(250,204,21,.08); border-radius: 0 8px 8px 0; }
.principle b { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--gold); margin-bottom: 2px; }
.buttons { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }

table.options { width: 100%; border-collapse: collapse; font-size: 13px; }
.options th { text-align: left; color: var(--muted); font-weight: 600; font-size: 11px; padding: 4px; }
.options td { padding: 6px 4px; border-top: 1px solid var(--line); }
.options tbody tr { cursor: pointer; }
.options tbody tr:hover { background: rgba(255,255,255,.04); }
.options tr.chosen td { background: rgba(255,255,255,.05); }
.options tr.focused td { box-shadow: inset 0 0 0 9999px rgba(250,204,21,.07); }
.options em { color: var(--muted); font-style: normal; }
.rank { font-weight: 800; width: 22px; text-align: center; }
.rank.gold { color: var(--gold); }
.succ { white-space: nowrap; }
.sw { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 5px; }
.bar { width: 70px; }
.bar div { height: 7px; border-radius: 4px; background: linear-gradient(90deg, #3b82f6, #22c55e); }

.detail { margin-top: 6px; }
.notes { list-style: none; padding: 0; margin: 0; }
.notes li { display: flex; gap: 8px; margin: 5px 0; }
.notes i { font-style: normal; font-weight: 800; width: 14px; flex: none; }
.notes .good i { color: var(--green); } .notes .bad i { color: var(--red); } .notes .neutral i { color: var(--muted); }

.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 16px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.legend i { display: inline-block; width: 14px; height: 4px; border-radius: 2px; margin-right: 5px; vertical-align: middle; }
.legend i.circle { width: 11px; height: 11px; border-radius: 50%; border: 1px dashed #fff; background: rgba(255,255,255,.1); }
.legend i.x { width: auto; height: auto; background: none; color: var(--red); font-style: normal; font-weight: 800; }

.phase.def { color: #fca5a5; background: rgba(239,68,68,.15); }
.tag { display: inline-block; margin: 6px 0 0 6px; font-size: 12px; color: var(--muted);
  border: 1px solid var(--line); border-radius: 999px; padding: 2px 9px; }
.record { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.rec { display: grid; grid-template-columns: 1fr auto; align-items: center; column-gap: 8px;
  background: #16223d; border: 1px solid var(--line); border-radius: 8px; padding: 6px 9px; font-size: 12px; }
.rec span { color: var(--text); }
.rec b { font-size: 16px; grid-row: span 2; }
.rec i { font-style: normal; color: var(--muted); font-size: 11px; }
.rec.empty { opacity: .55; }

/* Side-by-side "what happens next" */
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 12px 0 10px; }
.compare.single { grid-template-columns: 1fr; }
.mini { margin: 0; background: #0b1324; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.mini.best { border-color: rgba(250,204,21,.55); }
.mini figcaption { padding: 6px 9px 5px; font-size: 12px; font-weight: 600; line-height: 1.3; min-height: 44px; }
.mini figcaption span { display: block; font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.mini.best figcaption span { color: var(--gold); }
.mini-wrap { width: 100%; }
.mini canvas { display: block; width: 100%; margin: 0 auto; touch-action: pan-x pan-y; } /* pinch is ours (zoom the pitch) */
button { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.outcome { font-size: 12px; font-weight: 600; padding: 6px 9px; }
.outcome.ok { color: #86efac; } .outcome.bad { color: #fca5a5; }

.breakdown { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 10px; }
.breakdown summary { cursor: pointer; font-weight: 600; color: #cbd5e1; list-style: none; }
.breakdown summary::before { content: '▸ '; color: var(--muted); }
.breakdown[open] summary::before { content: '▾ '; }
.toggle { display: flex; align-items: center; gap: 8px; margin: 10px 0 6px; font-size: 13px; color: var(--muted); cursor: pointer; }
.legend i.dash { height: 0; background: none !important; border-top: 3px dashed; }
.legend i.dots { height: 0; background: none !important; border-top: 3px dotted; }

/* Possession: coloured frame around the pitch + an opening cue */
.pitch-wrap { transition: box-shadow .3s; }
.pitch-wrap.poss-home { box-shadow: 0 0 0 3px var(--home), 0 8px 30px rgba(0,0,0,.35); }
.pitch-wrap.poss-away { box-shadow: 0 0 0 3px var(--away), 0 8px 30px rgba(0,0,0,.35); }
.cue { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); pointer-events: none;
  opacity: 0; padding: 14px 28px; border-radius: 14px; text-align: center; color: #fff;
  box-shadow: 0 10px 40px rgba(0,0,0,.45); }
.cue b { display: block; font-size: 30px; line-height: 1.1; letter-spacing: .01em; }
.cue span { display: block; font-size: 15px; font-weight: 600; opacity: .9; margin-top: 4px; }
.cue.home { background: var(--home); color: var(--home-num); }
.cue.away { background: var(--away); color: var(--away-num); }
.cue.show { animation: cue 1.7s ease forwards; }
@keyframes cue {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(.85); }
  15% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  70% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.04); }
}

/* ── Phones ───────────────────────────────────────────────────────────────── */
.dock { display: none; }
.pitch-wrap { background: #2d6a37; }

@media (max-width: 699px) {
  body { font-size: 15px; }
  header { gap: 8px; padding-left: max(12px, var(--safe-area-inset-left, env(safe-area-inset-left))); padding-right: max(12px, var(--safe-area-inset-right, env(safe-area-inset-right))); }
  .brand { font-size: 17px; }
  main { padding: 8px; gap: 10px; }
  .pitch-wrap { border-radius: 8px; }
  .banner { top: 8px; font-size: 12px; padding: 4px 11px; }
  .cue { padding: 10px 20px; }
  .cue b { font-size: 22px; }
  .cue span { font-size: 13px; }


  .panel { padding: 14px; max-height: none; border-radius: 10px; }
  .panel h2 { font-size: 17px; }
  .chips { gap: 5px; }
  .chip { padding: 8px 2px; }
  .action, .move { min-height: 46px; }
  .compare { gap: 8px; }
  .mini figcaption { min-height: 0; }
  .buttons button { flex: 1 1 auto; min-height: 44px; }
  kbd { display: none; }
}

/* Portrait phones: vertical pitch + bottom action bar */
body.portrait { padding-bottom: calc(86px + var(--safe-area-inset-bottom, env(safe-area-inset-bottom))); }
body.portrait .dock {
  display: flex; align-items: center; gap: 8px;
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  padding: 10px 12px calc(10px + var(--safe-area-inset-bottom, env(safe-area-inset-bottom)));
  background: rgba(11, 19, 36, .97); border-top: 1px solid var(--line);
  box-shadow: 0 -8px 24px rgba(0,0,0,.35);
}
.dock button { min-height: 46px; padding: 0 14px; font-weight: 600; flex: none; }
.dock button.wide { flex: 1; }
.dock-text { flex: 1; min-width: 0; font-weight: 700; font-size: 15px; line-height: 1.25;
  overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.dock-text small { display: block; font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.dock-text.dv-best { color: #86efac; } .dock-text.dv-good { color: #93c5fd; }
.dock-text.dv-ok { color: #fcd34d; } .dock-text.dv-poor { color: #fca5a5; }
.letters { display: flex; gap: 6px; flex: 1; justify-content: flex-end; min-width: 0; }
.letters button { flex: 1 1 0; max-width: 48px; min-width: 34px; padding: 0; font-size: 17px; }
.dock-text.short { flex: 0 0 auto; max-width: 78px; }
/* A decision on a phone: the question and every option fit on screen with the (shorter) pitch.
   The scenario / system tags are dropped here: the team talk already said it. */
body.decide main { gap: 8px; }
body.decide .panel { padding: 10px 12px 12px; }
body.decide .panel .tag { display: none; }
body.decide .panel .context { margin: 6px 0 0; padding: 6px 10px; font-size: 13px; }
body.decide .panel h2 { font-size: 16px; margin: 6px 0; }
body.decide .moves { gap: 6px; }
body.decide .move { padding: 7px 10px; min-height: 40px; }
body.decide .show-all { display: none; } /* a tap on the pitch shows them all */
/* Sideways, the panel is beside the pitch: just the question and the options (the team talk gave the plan). */
body.side.decide .panel .phase, body.side.decide .context.sysx { display: none; }
body.portrait .stage { scroll-margin-top: 4px; }
body.portrait .panel { scroll-margin-top: 8px; }

/* Landscape phones / short screens: pitch and panel side by side, pitch fitted to the height */
@media (max-height: 520px) and (orientation: landscape) {
  header { padding: 4px max(12px, var(--safe-area-inset-left, env(safe-area-inset-left))); }
  .brand { font-size: 16px; }
  .score-pill, .coachbtn { padding-top: 3px; padding-bottom: 3px; }
  main { grid-template-columns: minmax(0, 1fr) minmax(260px, 40%); padding: 6px max(8px, var(--safe-area-inset-right, env(safe-area-inset-right))) 6px max(8px, var(--safe-area-inset-left, env(safe-area-inset-left))); gap: 8px; }
  .panel { max-height: calc(100vh - 56px); padding: 10px 12px; }
  .panel h2 { font-size: 16px; margin: 4px 0 6px; }
  .banner { top: 6px; font-size: 12px; padding: 3px 10px; }
  /* The coach's pop-up: smaller, so it doesn't bury the (short) pitch. */
  body.short .coach-pop { left: 8px; bottom: 8px; gap: 6px; max-width: min(360px, calc(100% - 16px)); }
  body.short .coach-pop img { width: 48px; height: 48px; }
  body.short .cp-bubble { padding: 7px 10px 8px; margin-bottom: 8px; }
  body.short .cp-cry { font-size: 15px; }
  body.short .cp-line { font-size: 13px; }
  /* The team talk: over the whole screen, wide and short. */
  body.short .brief { position: fixed; z-index: 60; padding: 8px; }
  body.short .brief-card { width: min(680px, 100%); max-height: calc(100vh - 16px); overflow-y: auto; padding: 10px 16px 12px; }
  body.short .brief-top img { width: 46px; height: 46px; }
  body.short .brief-cry { font-size: 17px; }
  body.short .brief-sit { margin: 6px 0 4px; }
  body.short .brief-lines { margin-bottom: 8px; }
  body.short .brief-lines li { font-size: 13px; padding: 3px 0; }
  body.short .brief-card button.big { padding: 8px 18px; font-size: 15px; }
  /* At a decision: just the question and the options. */
  body.decide .move { min-height: 36px; padding: 5px 10px; font-size: 14px; }
  body.decide .moves { gap: 5px; }
}
body.portrait .compare.single .mini { max-width: 240px; width: 100%; margin: 0 auto; }

/* Follow the play */
.context { margin: 10px 0 2px; padding: 8px 11px; border-radius: 8px; font-weight: 600; font-size: 14px; }
.context.bad { background: rgba(239,68,68,.15); color: #fca5a5; }
.context.good { background: rgba(34,197,94,.14); color: #86efac; }
.trail { display: flex; align-items: center; gap: 6px; margin: 10px 0 4px; }
.dot-v { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.dot-v.v-best { background: #22c55e; } .dot-v.v-good { background: #3b82f6; }
.dot-v.v-ok { background: #f59e0b; } .dot-v.v-poor { background: #ef4444; }
.sum-score { display: flex; align-items: baseline; gap: 10px; margin: 12px 0; }
.sum-score b { font-size: 40px; line-height: 1; }
.sum-score span { color: var(--muted); }
.sum-list { list-style: none; padding: 0; margin: 0 0 14px; }
.sum-list li { display: grid; grid-template-columns: 26px 1fr auto; gap: 10px; align-items: center;
  padding: 9px 10px; margin-bottom: 6px; border-radius: 8px; background: #16223d; border-left: 4px solid var(--line); }
.sum-list li.s-best { border-left-color: #22c55e; } .sum-list li.s-good { border-left-color: #3b82f6; }
.sum-list li.s-ok { border-left-color: #f59e0b; } .sum-list li.s-poor { border-left-color: #ef4444; }
.sum-list .n { font-weight: 800; color: var(--muted); text-align: center; }
.sum-list small { display: block; color: var(--muted); font-size: 11px; }
.sum-list b { display: block; font-size: 14px; }
.sum-list em { display: block; font-style: normal; font-size: 12px; color: #fcd34d; }
.sum-list .pts { font-weight: 700; }

.legend i.arrowi { width: auto; height: auto; background: none; font-style: normal; color: #bfdbfe; font-weight: 800; }

.zoom-btn { position: absolute; right: 8px; bottom: 8px; z-index: 5; min-height: 34px; padding: 4px 11px;
  font-size: 13px; font-weight: 600; background: rgba(15,23,42,.85); border-color: rgba(255,255,255,.25); }
.zoom-btn[hidden] { display: none; }

.header-right { display: flex; align-items: center; gap: 14px; }
.icon-btn { font-size: 18px; line-height: 1; padding: 7px 9px; min-width: 40px; }
@media (max-width: 699px) { .header-right { gap: 8px; } .icon-btn { font-size: 16px; padding: 6px 7px; min-width: 34px; } }

/* Scoreboard and clock */
/* (In the run-off below the court: the banner has the top.) */
.scoreboard { position: absolute; left: 10px; bottom: 8px; display: flex; align-items: center; gap: 7px;
  background: rgba(15, 23, 42, .88); color: #fff; font-size: 13px; padding: 4px 10px; border-radius: 8px;
  pointer-events: none; box-shadow: 0 2px 8px rgba(0,0,0,.3); font-variant-numeric: tabular-nums; }
.scoreboard[hidden] { display: none; }
.scoreboard .t { font-weight: 700; font-size: 11px; letter-spacing: .04em; text-transform: uppercase; }
.scoreboard .t.home { color: var(--home-light); }
.scoreboard .t.away { color: var(--away-light); }
.scoreboard b { font-size: 15px; }
.scoreboard .clock { margin-left: 4px; padding-left: 8px; border-left: 1px solid rgba(255,255,255,.25); color: #e2e8f0; }
.scoreboard.late .clock { color: #fbbf24; }
.context.gs.urgent { background: rgba(234, 88, 12, .14); border-color: rgba(234, 88, 12, .45); color: #fdba74; }
.context.gs.calm { background: rgba(14, 165, 233, .12); border-color: rgba(14, 165, 233, .4); color: #7dd3fc; }
.sum-board { margin: 4px 0 8px; font-size: 15px; color: #cbd5e1; }
.sum-board b { font-size: 18px; color: #fff; margin: 0 4px; }
.scoreboard b i { font-style: normal; }
/* Accumulated fouls: five dots per team (from the 6th, every foul is a 10m kick). */
.scoreboard .fouls { font-style: normal; font-size: 7px; letter-spacing: 1px; margin: 0 5px; color: #fbbf24; vertical-align: middle; }
body.portrait .scoreboard { top: auto; bottom: 8px; left: 8px; font-size: 11px; padding: 3px 8px; gap: 5px; }
body.portrait .scoreboard .t { display: none; }
body.portrait .scoreboard b { font-size: 13px; }
body.portrait .scoreboard b .h { color: var(--home-light); }
body.portrait .scoreboard b .a { color: var(--away-light); }
body.portrait .scoreboard .clock { margin-left: 0; padding-left: 6px; }
.context.sysx { background: rgba(148,163,184,.10); color: #cbd5e1; font-weight: 500; font-size: 13px; }
.tag.sys { color: #a5b4fc; }

/* The coach's "why": the best option's reasons, then the problem with yours */
.coachwhy { margin: 8px 0 4px; display: grid; gap: 8px; }
.coachwhy b { display: block; font-size: 12px; letter-spacing: .04em; text-transform: uppercase; margin-bottom: 3px; }
.coachwhy ul { margin: 0; padding-left: 18px; }
.coachwhy li { margin: 3px 0; font-size: 14.5px; line-height: 1.4; }
.cw-best b { color: #86efac; }
.cw-yours b { color: #fca5a5; }

/* ── Coaches ─────────────────────────────────────────────────────────────── */
.coachbtn { display: inline-flex; align-items: center; gap: 8px; padding: 3px 12px 3px 3px; min-height: 38px; border-radius: 999px; border: 2px solid var(--coach-ui, #22c55e); }
.coachbtn img { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; background: var(--coach); }
.coachbtn span { font-weight: 700; white-space: nowrap; }
.principle.coach-says { display: flex; gap: 12px; align-items: flex-start; border-left: 4px solid var(--coach-ui); }
.principle.coach-says img { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; flex: none; background: var(--coach); }
.principle.coach-says > div { min-width: 0; }
.principle .trial { display: block; margin-top: 6px; font-size: 12px; opacity: 0.8; }
.principle .trial a { color: #facc15; }
dialog.coaches, dialog.sheet { width: min(960px, 94vw); max-height: 90vh; padding: 0; border: 1px solid #334155; border-radius: 16px; background: #0f172a; color: #e2e8f0; }
dialog.coaches::backdrop, dialog.sheet::backdrop { background: rgba(2, 6, 23, 0.75); }
.coaches-head { position: sticky; top: 0; z-index: 1; padding: 18px 20px 10px; background: #0f172a; border-bottom: 1px solid #1e293b; }
.coaches-head h2 { margin: 0 0 4px; font-size: 20px; }
.coaches-head p { margin: 0; opacity: 0.75; font-size: 14px; }
.coaches-head .close { position: absolute; top: 12px; right: 12px; }
.coach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; padding: 16px 20px; }
.coach-card { display: flex; gap: 12px; padding: 12px; border-radius: 12px; background: #111c33; border: 2px solid transparent; }
.coach-card.active { border-color: var(--coach-ui); }
.coach-card img { width: 84px; height: 84px; border-radius: 12px; object-fit: cover; flex: none; background: var(--coach); }
.coach-body { min-width: 0; }
.coach-body h3 { margin: 0; font-size: 16px; }
.coach-body .school { font-size: 12px; font-weight: 700; color: var(--coach-ui); text-transform: uppercase; letter-spacing: 0.04em; }
.coach-body p { margin: 6px 0; font-size: 13px; line-height: 1.35; opacity: 0.85; }
.coach-body q { display: block; font-size: 12.5px; font-style: italic; opacity: 0.7; }
.coach-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.coach-actions button { padding: 5px 10px; font-size: 13px; }
.pill.on { display: inline-block; padding: 4px 10px; border-radius: 999px; background: var(--coach-ui); color: #0f172a; font-size: 12px; font-weight: 700; }
.unlock { grid-column: 1 / -1; max-width: 420px; margin: 0 auto; text-align: center; }
.unlock img { width: 140px; height: 140px; border-radius: 50%; object-fit: cover; }
.unlock ul { text-align: left; padding-left: 20px; line-height: 1.6; }
.unlock button { margin: 4px; }
.coach-fine { margin: 0; padding: 0 20px 16px; font-size: 12px; opacity: 0.55; }
@media (max-width: 560px) {
  .coachbtn { padding: 3px; }
  .coachbtn span { display: none; } /* just the face on phones */
  .coach-grid { grid-template-columns: 1fr; padding: 12px; }
  .coach-card img { width: 72px; height: 72px; }
}

/* ── Settings sheet ──────────────────────────────────────────────────────── */
dialog.sheet { width: min(520px, 94vw); }
.sheet-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; background: #0f172a; border-bottom: 1px solid #1e293b; }
.sheet-head h2 { margin: 0; font-size: 19px; }
.sheet-body { padding: 6px 18px 18px; }
.sheet-body section { padding: 10px 0 6px; border-bottom: 1px solid #1e293b; }
.sheet-body section:last-child { border-bottom: 0; }
.sheet-body h3 { margin: 6px 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.sheet-body .row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 46px; font-size: 15px; }
.sheet-body .row select { min-width: 0; max-width: 62%; min-height: 38px; }
.sheet-body .switch input { width: 22px; height: 22px; accent-color: var(--blue); }
.progress-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 8px; }
.progress-grid div { text-align: center; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .04em;
  background: #111c33; border-radius: 10px; padding: 8px 4px; }
.progress-grid b { display: block; color: var(--text); font-size: 20px; letter-spacing: 0; }
#reset-stats { margin-top: 10px; }
@media (max-width: 560px) {
  /* Phones: sheets fill the screen from the bottom, like a native sheet. */
  dialog.sheet, dialog.coaches { width: 100vw; max-width: 100vw; max-height: 92vh; margin: auto 0 0; border-radius: 16px 16px 0 0;
    padding-bottom: var(--safe-area-inset-bottom, env(safe-area-inset-bottom)); }
  .progress-grid { grid-template-columns: repeat(2, 1fr); }
}
/* Portrait phones: the bottom bar has these actions, so the panel doesn't repeat them. */
body.portrait .panel .dup { display: none; }
.icon-btn { font-size: 20px; }

/* Inside the iOS / Android app: no text-selection callouts or rubber-band page bounce. */
html.native body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; overscroll-behavior: none; }
html.native select, html.native input { -webkit-user-select: auto; user-select: auto; }

/* ── Store ───────────────────────────────────────────────────────────────── */
.unlock [data-buy] { display: block; width: 100%; max-width: 320px; margin: 8px auto; min-height: 46px; font-size: 16px; }
.store-msg { min-height: 1.4em; font-size: 14px; color: #fcd34d; }
.store-ok { grid-column: 1 / -1; margin: 0; padding: 10px 14px; border-radius: 10px; background: rgba(34,197,94,.15); color: #86efac; font-weight: 600; }
.grid-foot { grid-column: 1 / -1; padding: 0; text-align: right; }
.unlock .coach-fine { padding: 8px 0 0; }
.unlock a, .sheet-links a { color: #93c5fd; }
.sheet-links { display: flex; gap: 16px; justify-content: center; padding-top: 12px; font-size: 13px; }

/* The coach's reaction, in their own football language */
.principle .cry { display: block; font-size: 17px; font-weight: 800; font-style: italic; color: var(--coach-ui); margin-bottom: 4px; }
.principle .cry small { display: inline; margin-left: 8px; font-size: 12px; font-weight: 600; font-style: normal; color: var(--muted); }

/* ── The coach pops up: team talk, feedback, the hook ──────────────────────── */
.coach-pop { position: absolute; left: 12px; bottom: 12px; z-index: 6; display: flex; align-items: flex-end; gap: 10px;
  max-width: min(460px, calc(100% - 24px)); cursor: pointer; animation: cp-in .35s cubic-bezier(.2, 1.4, .4, 1); }
.coach-pop[hidden] { display: none; }
.coach-pop.out { animation: cp-out .25s ease-in forwards; }
.coach-pop img { width: 84px; height: 84px; border-radius: 50%; object-fit: cover; flex: none;
  border: 3px solid var(--coach-ui, #fff); background: var(--coach, #22c55e); box-shadow: 0 6px 18px rgba(0,0,0,.45); }
.cp-bubble { position: relative; background: #fff; color: #111; border-radius: 16px; padding: 10px 14px 11px;
  box-shadow: 0 6px 18px rgba(0,0,0,.4); margin-bottom: 18px; min-width: 0; }
.cp-bubble::before { content: ''; position: absolute; left: -9px; bottom: 14px; border: 9px solid transparent; border-right-color: #fff; border-left: 0; }
.cp-cry { display: block; font-weight: 800; font-style: italic; font-size: 18px; color: var(--coach, #111); filter: brightness(.85); }
.cp-en { display: block; font-size: 12px; color: #64748b; margin-top: -1px; }
.cp-en:empty { display: none; }
.cp-line { margin: 3px 0 0; font-size: 14.5px; line-height: 1.35; font-weight: 600; }
.coach-pop.subbed .cp-bubble { background: #fee2e2; }
.coach-pop.subbed .cp-bubble::before { border-right-color: #fee2e2; }
@keyframes cp-in { from { opacity: 0; transform: translateY(24px) scale(.9); } to { opacity: 1; transform: none; } }
@keyframes cp-out { to { opacity: 0; transform: translateY(16px) scale(.96); } }
/* Phones: above the bottom bar, across the screen. */
body.portrait .coach-pop { position: fixed; left: 10px; right: 10px; max-width: none;
  bottom: calc(96px + var(--safe-area-inset-bottom, env(safe-area-inset-bottom))); }
body.portrait .coach-pop img { width: 64px; height: 64px; }

/* ── The team talk before kick-off: over the pitch, the play waits for it ──── */
/* (A futsal court is 2:1 — too short to hold the card — so the team talk covers the screen.) */
.brief { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center;
  padding: 14px; background: rgba(2, 6, 23, .55); backdrop-filter: blur(2px); cursor: pointer; }
.brief[hidden] { display: none; }
.brief-card { position: relative; width: min(440px, 100%); max-height: calc(100vh - 28px); overflow-y: auto; background: #fff; color: #111; border-radius: 18px;
  padding: 16px 18px 18px; box-shadow: 0 12px 36px rgba(0,0,0,.5);
  animation: cp-in .35s cubic-bezier(.2, 1.4, .4, 1); }
.brief-top { display: flex; align-items: center; gap: 12px; }
.brief-top img { width: 68px; height: 68px; border-radius: 50%; object-fit: cover; flex: none;
  border: 3px solid var(--coach, #22c55e); background: var(--coach, #22c55e); }
.brief-who { display: block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: #64748b; }
.brief-cry { display: block; font-weight: 800; font-style: italic; font-size: 20px; color: var(--coach, #111); filter: brightness(.85); }
.brief-en { display: block; font-size: 12px; color: #64748b; }
.brief-en:empty { display: none; }
.brief-sit { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 8px; }
.brief-sit span { background: #0f172a; color: #fff; border-radius: 999px; padding: 4px 12px; font-weight: 700; font-size: 14px; }
.brief-sit b { margin: 0 3px; }
.brief-sit .th { color: var(--home-light); } .brief-sit .ta { color: var(--away-light); }
.brief-lines { list-style: none; margin: 0 0 12px; padding: 0; }
.brief-lines li { display: flex; gap: 8px; font-size: 14.5px; line-height: 1.35; font-weight: 600; padding: 5px 0; border-top: 1px solid #e2e8f0; }
.brief-lines li:first-child { border-top: 0; }
.brief-lines i { font-style: normal; flex: none; width: 20px; text-align: center; }
.brief-card button { width: 100%; margin: 0; }
/* Later team talks carry on by themselves: a bar runs down along the bottom. */
.brief-timer { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; display: none; background: #e2e8f0; }
.brief.auto .brief-timer { display: block; }
.brief.auto .brief-timer b { display: block; height: 100%; background: var(--coach, #22c55e); animation: brief-run var(--brief-s, 9s) linear forwards; }
@keyframes brief-run { from { width: 100%; } to { width: 0; } }
/* Phones: the dock has its own "Let's go" button, so the card's is hidden and there's more room. */
body.portrait .brief { align-items: flex-start; padding-top: 40px; }
body.portrait .brief-card button { display: none; }
@media (prefers-reduced-motion: reduce) { .brief-card { animation: none; } }

/* The coach's trust in you: a thin bar under his face on the coach button. */
.coachbtn { position: relative; }
.coachbtn .trust { position: absolute; left: 10px; right: 10px; bottom: -6px; height: 4px; border-radius: 3px; background: rgba(255,255,255,.15); overflow: hidden; }
.coachbtn .trust b { display: block; height: 100%; width: var(--trust, 70%); background: var(--trust-color, #22c55e); transition: width .5s, background .5s; }

/* Options appearing one at a time (each row / letter pops in on its cue). */
.stagger { animation: opt-in .35s cubic-bezier(.2, 1.5, .4, 1) both; }
@keyframes opt-in { from { opacity: 0; transform: translateY(8px) scale(.96); visibility: hidden; } to { opacity: 1; transform: none; visibility: visible; } }
.show-all { float: right; margin: -4px 0 6px; font-size: 13px; padding: 4px 10px; }
@media (prefers-reduced-motion: reduce) { .stagger { animation: none; } .coach-pop { animation: none; } }

/* The caption of the option that has just appeared, in the banner over the pitch. */
.banner.intro { background: rgba(250, 204, 21, .96); color: #111; white-space: normal; max-width: calc(100% - 24px); text-align: center; }
