/* Layout: a touchline run sheet. One column, a sticky stage strip, and for each stage a chalk-board diagram, kit, plain description and coaching points. Orange is reserved for cones and the main action. */
:root {
  --ground: #F2F4EE;
  --ink: #13201A;
  --ink-2: #44524A;
  --line: #C9D1C6;
  --panel: #E3E9DF;
  --board: #17402B;
  --chalk: #EAF1E6;
  --cone: #F26A1B;
  --blue: #2F63E0;
  --on-blue: #FFFFFF;
  --yellow: #F5C518;
  --on-yellow: #13201A;
  --red: #D6403A;
  --on-red: #FFFFFF;
  --focus: #1A56DB;
  --display: 'Barlow Condensed', 'Arial Narrow', Arial, sans-serif;
  --body: 'Atkinson Hyperlegible', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground: #0E1612; --ink: #E8EFE7; --ink-2: #A6B4A9; --line: #2A3A30; --panel: #18241D;
    --board: #14392A; --chalk: #E8F1E4; --blue: #6E95FF; --on-blue: #0B1220; --red: #FF7A70; --on-red: #2A0B09; --focus: #8FB0FF;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --ground: #0E1612; --ink: #E8EFE7; --ink-2: #A6B4A9; --line: #2A3A30; --panel: #18241D;
  --board: #14392A; --chalk: #E8F1E4; --blue: #6E95FF; --on-blue: #0B1220; --red: #FF7A70; --on-red: #2A0B09; --focus: #8FB0FF;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
body { background: var(--ground); color: var(--ink); font: 400 17px/1.5 var(--body); -webkit-text-size-adjust: 100%; }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); background: var(--ground); z-index: 10; }
h1, h2, h3 { font-family: var(--display); font-weight: 700; margin: 0; line-height: 1.05; text-wrap: balance; }
p { margin: 0; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.wrap { max-width: 44rem; margin-inline: auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }

/* stage strip */
.nav { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 9; background: var(--ground); border-bottom: 1px solid var(--line); }
.nav .in { display: flex; gap: 8px; overflow-x: auto; padding-block: 10px; scrollbar-width: none; }
.nav .in::-webkit-scrollbar { display: none; }
.chip { flex: 0 0 auto; min-height: 44px; display: flex; align-items: center; gap: 8px; padding: 0 16px 0 6px; border: 2px solid var(--ink); border-radius: 999px; color: var(--ink); text-decoration: none; font: 700 15px var(--body); }
.chip .n { width: 30px; height: 30px; border-radius: 50%; background: var(--ink); color: var(--ground); display: grid; place-items: center; font: 700 19px var(--display); }
.chip[aria-current="true"] { background: var(--ink); color: var(--ground); }
.chip[aria-current="true"] .n { background: var(--cone); color: #13201A; }

/* top of page */
.hero { padding-top: 22px; display: flex; flex-direction: column; gap: 12px; }
.eyebrow { font: 600 15px var(--display); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-2); }
h1 { font-size: clamp(36px, 11.5vw, 68px); overflow-wrap: anywhere; text-transform: uppercase; letter-spacing: .01em; }
.sub { color: var(--ink-2); font-size: 18px; max-width: 34rem; }

.three { margin: 8px 0 0; padding: 0; list-style: none; border-top: 3px solid var(--ink); }
.three li { display: grid; grid-template-columns: 7.5rem 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); align-items: baseline; }
.three b { font: 700 24px var(--display); text-transform: uppercase; letter-spacing: .04em; }
@media (max-width: 420px) { .three li { grid-template-columns: 1fr; gap: 2px; } }

.block { margin-top: 32px; display: flex; flex-direction: column; gap: 12px; }
.label { font: 600 15px var(--display); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-2); }

.run { margin: 0; padding: 0; list-style: none; counter-reset: r; border-top: 1px solid var(--line); }
.run li { counter-increment: r; display: grid; grid-template-columns: 2rem 1fr; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.run li::before { content: counter(r); font: 700 26px/1 var(--display); }
.run b { display: block; }
.run span { color: var(--ink-2); font-size: 16px; }

.kit { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 16px; }
.kit > div { border-top: 3px solid var(--ink); padding-top: 10px; display: grid; grid-template-columns: 44px 1fr; gap: 4px 12px; align-items: center; }
.kit svg { width: 44px; height: 44px; grid-row: span 2; }
.kit b { font: 700 28px/1 var(--display); }
.kit span { font-size: 15px; color: var(--ink-2); grid-column: 2; line-height: 1.3; }

details { border-top: 3px solid var(--ink); padding-top: 4px; }
summary { min-height: 44px; display: flex; align-items: center; font: 700 22px var(--display); text-transform: uppercase; letter-spacing: .04em; cursor: pointer; }
.tw { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 16px; }
th, td { text-align: left; padding: 8px 8px 8px 0; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
th { font: 600 14px var(--display); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2); }
.note { font-size: 16px; color: var(--ink-2); margin-top: 8px; }

/* stages */
.stage { margin-top: 44px; padding-top: 18px; border-top: 5px solid var(--ink); display: flex; flex-direction: column; gap: 16px; scroll-margin-top: calc(env(safe-area-inset-top, 0px) + 64px); }
.sh { display: flex; gap: 14px; align-items: flex-end; }
.sh .big { font: 700 76px/.8 var(--display); }
.sh > div { min-width: 0; }
.sh h2 { font-size: clamp(28px, 9vw, 38px); overflow-wrap: anywhere; text-transform: uppercase; letter-spacing: .01em; }
.sh .tag { font: 600 15px var(--display); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-2); margin-top: 4px; }

.board { margin: 0; background: var(--board); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.board svg { display: block; width: 100%; height: auto; }
.phases { display: flex; gap: 8px; padding: 0 10px 12px; justify-content: center; flex-wrap: wrap; }
.phases span, .pills span { font: 600 14px var(--display); letter-spacing: .1em; text-transform: uppercase; padding: 6px 12px; border-radius: 999px; border: 1.5px solid var(--chalk); color: var(--chalk); opacity: .6; }
.phases span.on, .pills span.on { opacity: 1; background: var(--chalk); color: var(--board); }
.pills { display: flex; gap: 8px; padding: 0 10px 12px; justify-content: center; flex-wrap: wrap; }

/* svg parts */
.ln { fill: none; stroke: var(--chalk); stroke-opacity: .5; stroke-width: 1.5; }
.tri { fill: none; stroke: var(--chalk); stroke-opacity: .35; stroke-width: 1.5; stroke-dasharray: 4 5; }
.chain { fill: none; stroke: var(--chalk); stroke-opacity: .35; stroke-width: 1.5; stroke-dasharray: 3 5; }
.cone { fill: var(--cone); }
.conering { fill: none; stroke: var(--chalk); stroke-opacity: .7; stroke-width: 1.5; }
.pl { stroke: var(--board); stroke-width: 2; }
.pBlue { fill: var(--blue); }
.pYellow { fill: var(--yellow); }
.pRed { fill: var(--red); }
.pl.act { stroke: var(--chalk); stroke-width: 3; }
.ball { fill: #FFFFFF; stroke: #13201A; stroke-width: 1.5; }
.arw { fill: none; stroke: var(--chalk); stroke-width: 2; marker-end: url(#ah); }
.mk { fill: var(--chalk); }
.bdg { fill: var(--cone); }
.bdgt { font: 700 12px var(--display); fill: #13201A; }
.lbl { font: 600 13px var(--display); letter-spacing: .12em; fill: var(--chalk); text-transform: uppercase; }
.lbl.sm { font-size: 12px; letter-spacing: .06em; text-transform: none; opacity: .85; }
.nt { font: 700 11px var(--display); fill: var(--on-blue); }
.cnt { font: 700 22px var(--display); letter-spacing: .06em; fill: var(--chalk); }
.arrive { animation: arrive 3.4s ease-out infinite; }
@keyframes arrive { 0% { transform: translateX(-46px); opacity: 0; } 20% { opacity: 1; } 65%, 100% { transform: translateX(0); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .arrive { animation: none; } }

/* controls */
.controls { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.btn { min-height: 48px; padding: 0 18px; border: 2px solid var(--ink); background: transparent; color: var(--ink); font: 700 17px var(--body); border-radius: 8px; cursor: pointer; }
.btn.primary { background: var(--cone); border-color: var(--cone); color: #13201A; }
.btn:disabled { opacity: .45; cursor: default; }
.seg { display: inline-flex; border: 2px solid var(--ink); border-radius: 8px; overflow: hidden; }
.seg button { min-height: 44px; padding: 0 18px; background: transparent; border: 0; color: var(--ink); font: 700 16px var(--body); cursor: pointer; }
.seg button:disabled { opacity: .45; cursor: default; }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--ground); }

.kitline { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.kitline .label { margin-right: 4px; }
.kitline span.k { border: 1.5px solid var(--ink); border-radius: 4px; padding: 2px 10px; font-size: 15px; font-weight: 700; }

.gate { border: 3px solid var(--ink); background: var(--panel); padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; }
.gate b { font: 700 24px var(--display); text-transform: uppercase; letter-spacing: .04em; }

.cp { margin: 0; display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.cp div { padding: 10px 0; border-bottom: 1px solid var(--line); }
.cp dt { font: 700 24px var(--display); text-transform: uppercase; letter-spacing: .04em; }
.cp dd { margin: 0; }
.remind { font-size: 16px; color: var(--ink-2); }

/* timer */
.timer { display: flex; flex-direction: column; gap: 14px; }
.clock { display: flex; align-items: baseline; gap: 10px; }
.clock b { font: 700 96px/1 var(--display); font-variant-numeric: tabular-nums; min-width: 2ch; }
.clock span { font: 600 16px var(--display); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-2); }
.tcount { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tcount.three { grid-template-columns: repeat(3, 1fr); gap: 8px; }
.tcount.three .count .num { font-size: 52px; }
.cwrap { display: flex; flex-direction: column; gap: 6px; }
.count { min-height: 128px; border: 0; border-radius: 10px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; cursor: pointer; font-family: var(--body); }
.count.blue { background: var(--blue); color: var(--on-blue); }
.count.yellow { background: var(--yellow); color: var(--on-yellow); }
.count.red { background: var(--red); color: var(--on-red); }
.count:disabled { opacity: .4; cursor: default; }
.count .who { font: 600 16px var(--display); letter-spacing: .14em; text-transform: uppercase; }
.count .num { font: 700 64px/1 var(--display); font-variant-numeric: tabular-nums; }
.count .tb { font-size: 14px; min-height: 1.2em; }
.minus { min-height: 44px; border: 2px solid var(--ink); background: transparent; color: var(--ink); border-radius: 8px; font: 700 16px var(--body); cursor: pointer; }
.minus:disabled { opacity: .4; cursor: default; }
.res { font-weight: 700; min-height: 1.5em; }
.hist { margin: 0; padding: 0; list-style: none; font-variant-numeric: tabular-nums; color: var(--ink-2); font-size: 16px; }

/* score pads */
.pad { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.pad.three { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.pad.three .pcol { padding: 8px; }
.pad.three .pcol h3 { font-size: 16px; padding: 2px 8px; }
.pad.three .pcol .tot { font-size: 56px; }
.pcol { border: 2px solid var(--ink); border-radius: 10px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.pcol h3 { overflow-wrap: anywhere; font-size: 20px; text-transform: uppercase; letter-spacing: .08em; padding: 2px 10px; align-self: flex-start; border-radius: 4px; }
.pcol.blue h3 { background: var(--blue); color: var(--on-blue); }
.pcol.yellow h3 { background: var(--yellow); color: var(--on-yellow); }
.pcol.red h3 { background: var(--red); color: var(--on-red); }
.pcol .tot { font: 700 72px/1 var(--display); font-variant-numeric: tabular-nums; }
.pcol .row { display: flex; gap: 6px; }
.pcol .row button { flex: 1; min-width: 0; min-height: 56px; border: 0; border-radius: 8px; font: 700 22px var(--display); cursor: pointer; }
.pcol.blue .row button { background: var(--blue); color: var(--on-blue); }
.pcol.yellow .row button { background: var(--yellow); color: var(--on-yellow); }
.pcol.red .row button { background: var(--red); color: var(--on-red); }
.pcol .undo { align-self: flex-start; min-height: 44px; background: transparent; border: 0; color: var(--ink); text-decoration: underline; font: 400 16px var(--body); cursor: pointer; }

.foot { margin-top: 48px; padding-block: 18px 40px; border-top: 1px solid var(--line); color: var(--ink-2); font-size: 15px; }

/* block pages */
.weeks { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 6px; }
.weeks .label { margin-right: 4px; }
.weeks a, .weeks span.w { min-width: 44px; min-height: 44px; padding: 0 10px; display: inline-grid; place-items: center; border: 2px solid var(--ink); border-radius: 8px; font: 700 20px var(--display); color: var(--ink); text-decoration: none; }
.weeks [aria-current="page"] { background: var(--ink); color: var(--ground); }
.mins { display: inline-block; font: 700 14px var(--body); letter-spacing: .06em; text-transform: uppercase; padding: 2px 10px; border: 2px solid var(--ink); border-radius: 999px; margin: 6px 0 0; }
.plan { display: flex; gap: 3px; margin: 14px 0 4px; }
.plan span { display: grid; place-items: center; min-height: 40px; border-radius: 6px; background: var(--panel); border: 2px solid var(--ink); font: 700 16px var(--body); color: var(--ink); min-width: 0; }
.plan span.m { background: var(--cone); border-color: var(--cone); color: #1b1004; }
.plan span.c { background: transparent; border-style: dashed; border-color: var(--line); color: var(--ink-2); }
.plannote { font-size: 15px; color: var(--ink-2); margin: 0; }
.tally { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.tbtn { min-height: 76px; border: 2px solid var(--ink); border-radius: 10px; background: transparent; color: var(--ink); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; cursor: pointer; padding: 6px 4px; }
.tbtn .tn { font: 700 28px var(--display); }
.tbtn .tl { font: 700 13px var(--body); text-align: center; }
.tbtn.t0 { border-color: var(--red); } .tbtn.t1 { border-color: var(--yellow); } .tbtn.t2 { border-color: var(--board); }
.undo { background: none; border: 0; color: var(--ink); text-decoration: underline; font: 400 16px var(--body); min-height: 44px; cursor: pointer; justify-self: start; }
.srow { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.sname { margin: 0; font: 700 17px var(--body); }
.sbar { display: flex; gap: 2px; min-height: 36px; }
.sbar span { display: grid; place-items: center; min-width: 26px; font: 700 15px var(--body); border-radius: 4px; color: #fff; }
.sbar .s0 { background: var(--red); } .sbar .s1 { background: var(--yellow); color: #1b1b1b; } .sbar .s2 { background: var(--board); }
.sbar .se { flex: 1; background: var(--panel); color: var(--ink-2); font-weight: 400; }
.spct { margin: 0; font-size: 15px; color: var(--ink-2); }

/* brand: the Goalside wordmark (inline SVG, drawn as shapes, so it needs no font) */
.brand { color: var(--ink); text-decoration: none; display: inline-flex; align-items: center; line-height: 0; }
.brand svg { height: 24px; width: auto; display: block; }
.brand.big svg { width: min(100%, 560px); height: auto; }

/* Go deeper: closed by default, so the pitchside page is no longer */
.deep { margin-top: 0; }
.deep summary { font-size: 20px; }
.deep .short { margin: 4px 0 0; color: var(--ink-2); }
.deep .where { margin: 6px 0 0; font-size: 15px; color: var(--ink-2); }
.deep h3.label { margin: 18px 0 4px; }
.deep ul { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.deep .faults { list-style: none; padding-left: 0; border-top: 1px solid var(--line); gap: 0; }
.deep .faults li { padding: 8px 0; border-bottom: 1px solid var(--line); display: grid; gap: 2px; }
.deep .faults span { color: var(--ink-2); }
.deep p { margin: 6px 0 0; }
