@font-face{font-family:Instrument Serif;src:url(type/instrument-serif.woff2) format("woff2");font-display:swap}
@font-face{font-family:DM Sans;src:url(type/dm-sans.woff2) format("woff2");font-weight:100 1000;font-display:swap}
*{box-sizing:border-box}
:root{
  --bg:#0d1215;
  --surface:#12181c;
  --scene:#0d1316;
  --soft:#1b252a;
  --border:#263237;
  --border-hi:#3e4f55;
  --text:#eef1ea;
  --muted:#9aa7a2;
  --faint:#6e7f7a;
  --accent:#d5f56d;
  --on-accent:#161e0d;
  --cyan:#64cde5;
  --post:#f49a56;
  --glass:rgba(13,19,22,.84);
}
html{scrollbar-gutter:stable}
body{
  color-scheme:dark;margin:0;background:var(--bg);color:var(--text);
  font:14px/1.4 "DM Sans",-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  -webkit-font-smoothing:antialiased;
}
[hidden]{display:none!important}
.page{width:min(1560px,100%);margin:0 auto;padding:0 clamp(14px,2.4vw,42px)}
button,select{font:inherit;color:inherit;cursor:pointer}
button{background:none;border:0}
button:focus-visible,select:focus-visible,a:focus-visible,canvas:focus-visible,input:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
button:disabled{opacity:.36;cursor:default}
svg:not(.mark):not(.symbols):not(.taper-glyph){width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.55;stroke-linecap:round;stroke-linejoin:round;flex-shrink:0}
.symbols{display:none}
h1,h2,.scene-stat strong{font-family:"Instrument Serif",Georgia,serif;font-weight:400}
.mono,.season-tag,.micro,.stage-state,.orbit-hint,.timeline-heading span,#weeks,.week-tick,footer,.origin-number,.chance,.taper-key b{font-family:"IBM Plex Mono",ui-monospace,SFMono-Regular,Menlo,monospace}

/* Header */
.topbar{
  display:flex;align-items:center;justify-content:space-between;gap:14px;
  padding:8px 0 7px;flex-wrap:wrap;flex:0 0 auto;
}
.brand{display:flex;align-items:baseline;gap:9px}
.mark{width:21px;height:19px;color:var(--accent);align-self:center}
.brand h1{font-size:clamp(25px,2.1vw,31px);line-height:.96;letter-spacing:-.03em;margin:0}
.season-tag{font-size:10.5px;color:var(--faint);letter-spacing:.03em;padding-left:2px}

.mode-tabs{
  display:inline-flex;align-items:center;gap:2px;padding:2px;
  border:1px solid var(--border);border-radius:7px;background:var(--surface);
}
.mode-tabs button{
  padding:5px 14px;border-radius:5px;font-size:12.5px;font-weight:560;color:var(--muted);
  transition:background .15s,color .15s;white-space:nowrap;
}
.mode-tabs button:hover{color:var(--text)}
.mode-tabs button[aria-selected="true"]{
  background:var(--soft);color:var(--text);box-shadow:inset 0 0 0 1px var(--border-hi);
}

/* Main instrument shell */
.instrument{border:1px solid var(--border);border-radius:10px;overflow:hidden;background:var(--surface)}

.subbar{
  display:flex;align-items:center;flex-wrap:wrap;gap:6px 12px;
  padding:6px clamp(12px,1.5vw,20px);border-bottom:1px solid var(--border);
  background:rgba(15,21,25,.72);min-height:40px;flex:0 0 auto;
}
.sub-group{display:flex;align-items:center;flex-wrap:wrap;gap:6px 14px;flex:1 1 auto;min-width:0}

.back-link{
  display:inline-flex;align-items:center;gap:4px;padding:3px 2px;
  font-size:12px;font-weight:560;color:var(--muted);white-space:nowrap;
  transition:color .14s ease;margin-right:4px;
}
.back-link:hover{color:var(--accent)}

.inline-select{display:inline-flex;align-items:center;gap:6px;font-size:11px;color:var(--faint)}
.inline-select select{
  min-height:28px;appearance:none;border-radius:5px;border:1px solid var(--border);
  padding:2px 24px 2px 9px;background:var(--bg);color:var(--text);font-size:12px;font-weight:540;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none' stroke='%239aa7a2' stroke-width='1.5'%3E%3Cpath d='m3 4.5 3 3 3-3'/%3E%3C/svg%3E");
  background-size:12px;background-position:right 7px center;background-repeat:no-repeat;
  max-width:236px;text-overflow:ellipsis;
}
.inline-select select:hover{border-color:var(--border-hi)}

/* Quiet borderless text filter toggles (Makscape / Veturilo family) */
.quiet-seg{
  display:inline-flex;align-items:center;gap:2px;margin-left:auto;
}
.quiet-seg:not([hidden]) + .quiet-seg{margin-left:14px;padding-left:14px;border-left:1px solid var(--border)}
.quiet-seg button{
  position:relative;padding:4px 8px;border-radius:4px;
  font-size:12px;font-weight:520;color:var(--faint);white-space:nowrap;
  transition:color .14s ease;
}
.quiet-seg button:hover{color:var(--text)}
.quiet-seg button[aria-pressed="true"]{color:var(--text);font-weight:600}
.quiet-seg button[aria-pressed="true"]::after{
  content:"";position:absolute;left:8px;right:8px;bottom:0;height:1.5px;
  background:var(--accent);border-radius:2px;
}

/* Stage & 3D scene */
.stage-layout{display:grid;grid-template-columns:minmax(0,1fr)}
.stage-layout.inspecting{grid-template-columns:minmax(0,1fr) clamp(286px,26%,350px)}
.scene{position:relative;background:var(--scene);isolation:isolate;min-height:0}
#pitch{display:block;width:100%;height:clamp(420px,62vh,660px);cursor:grab;touch-action:none;outline-offset:-3px}
body.mode-keeper-panel #pitch{height:clamp(360px,50vh,520px)}
#pitch.dragging{cursor:grabbing}
#pitch.pointing{cursor:pointer}
.pitch-hud{position:absolute;inset:0;width:100%;height:100%;pointer-events:none;z-index:1}

.scene-heading{
  position:absolute;left:clamp(14px,1.8vw,24px);top:clamp(12px,1.6vh,18px);z-index:3;
  pointer-events:none;text-shadow:0 2px 14px rgba(0,0,0,.8);
}
.stage-state,.micro{
  font-size:10px;text-transform:uppercase;letter-spacing:.11em;color:var(--muted);font-weight:560;line-height:1.35;
}
.stage-state{display:flex;align-items:center;gap:7px}
.stage-state i{width:6px;height:6px;border-radius:50%;background:var(--accent);box-shadow:0 0 9px rgba(213,245,109,.45)}
.scene-stat{display:flex;align-items:baseline;gap:8px;line-height:1.05;margin-top:2px;color:var(--muted);font-size:13px}
.scene-stat strong{font-size:clamp(30px,2.8vw,44px);color:var(--text);font-variant-numeric:lining-nums tabular-nums;letter-spacing:-.025em}

.scene .event{
  position:absolute;left:clamp(14px,1.8vw,24px);bottom:12px;z-index:3;max-width:min(62%,520px);
  background:var(--glass);backdrop-filter:blur(6px);
  border:1px solid rgba(66,82,87,.36);border-left:2px solid var(--accent);border-radius:4px;
  padding:6px 11px 7px;pointer-events:none;contain:layout style;
}
.scene .event>*{display:block}
.scene .event .micro{margin-bottom:2px;color:var(--muted)}
.scene #event-title{font-size:14.5px;font-weight:600;line-height:1.25;color:var(--text)}
.scene #event-detail{font-size:11.5px;line-height:1.38;color:var(--muted)}
.scene #event-quality{margin-top:3px;color:var(--accent);font:550 11px/1.35 "IBM Plex Mono",monospace;font-variant-numeric:tabular-nums}
.inspecting .scene-heading,.inspecting .event{display:none}
.stage-layout.inspecting .scene::before{
  content:"Selected shot · turf origin to wall";position:absolute;top:14px;left:18px;pointer-events:none;
  color:var(--text);font:10px/1.4 "IBM Plex Mono",monospace;text-transform:uppercase;letter-spacing:.1em;
  text-shadow:0 1px 6px #000;
}

.camera{
  position:absolute;right:clamp(12px,1.5vw,20px);top:clamp(12px,1.6vh,18px);z-index:3;
  display:flex;border:1px solid var(--border);border-radius:6px;background:var(--glass);overflow:hidden;
}
.camera button{height:30px;display:grid;place-items:center;padding:0;color:var(--muted)}
.camera button:not(.cam-text){width:31px}
.camera button.cam-text{display:inline-flex;align-items:center;gap:5px;padding:0 10px;font-size:11px;font-weight:560;white-space:nowrap}
.camera button.cam-text[aria-pressed="true"]{background:color-mix(in srgb,var(--accent) 14%,var(--soft));color:var(--accent)}
.camera button.cam-accent{color:var(--accent)}
.camera button:hover{background:var(--soft);color:var(--text)}
.camera button + button{border-left:1px solid var(--border)}

.orbit-hint{
  display:flex;align-items:center;gap:6px;position:absolute;right:clamp(12px,1.5vw,20px);bottom:11px;z-index:3;
  color:var(--faint);font-size:9.8px;pointer-events:none;text-shadow:0 1px 5px #000;
}
.orbit-hint svg{width:13px!important;height:13px!important}

/* Compact inspection side panel (Sofascore-inspired facts) */
.inspection{
  background:var(--surface);border-left:1px solid var(--border);
  padding:12px 16px;display:flex;flex-direction:column;
  max-height:clamp(400px,62vh,660px);overflow-y:auto;
}
.sheet-handle{display:none}
body.mode-keeper-panel .inspection{max-height:clamp(340px,50vh,520px)}
.inspection-top,.list-label{display:flex;align-items:center;justify-content:space-between;gap:8px}
.inspection-top{margin-bottom:2px}
.inspection-top button{display:grid;place-items:center;width:28px;height:28px;border:1px solid var(--border);border-radius:50%;color:var(--muted)}
.inspection-top button:hover{color:var(--text);background:var(--soft)}
.inspection h2{margin:0;font-size:clamp(24px,2vw,30px);line-height:1.02;letter-spacing:-.025em}
.list-label{margin:10px 0 3px;color:var(--faint);font:10px/1.3 "IBM Plex Mono",monospace;text-transform:uppercase;letter-spacing:.05em}
#episodes button{
  display:grid;grid-template-columns:18px 1fr auto;align-items:center;gap:8px;width:100%;min-height:31px;
  text-align:left;border-top:1px solid var(--border);padding:4px 7px;font-size:12.5px;
}
#episodes button:last-child{border-bottom:1px solid var(--border)}
#episodes button:hover{background:var(--soft)}
#episodes button[aria-pressed="true"]{background:color-mix(in srgb,var(--accent) 9%,var(--surface));box-shadow:inset 2px 0 var(--accent)}
.origin-number,.chance{font-size:11px;font-variant-numeric:tabular-nums}
.origin-number{color:var(--faint)}.chance{color:var(--text)}
#episode-context{padding:10px 0 0}
.episode-time-row{display:flex;align-items:center;gap:6px}
.episode-dot{width:7px;height:7px;border-radius:50%;background:var(--ink,var(--muted));flex-shrink:0}
#episode-match{display:block;font-size:13.5px;font-weight:600;line-height:1.3;margin-top:4px;color:var(--text)}
#episode-description{margin:3px 0 0;color:var(--muted);font-size:12px;line-height:1.42}
#episode-source{display:inline-block;margin-top:5px;font-size:11.5px;color:var(--accent);text-underline-offset:3px}

#inspect-quality{margin-top:12px;padding-top:11px;border-top:1px solid var(--border)}
.shot-facts{display:grid;gap:10px}
.shot-facts__metrics{display:flex;gap:24px;align-items:baseline}
.shot-facts__metric{display:flex;flex-direction:column;gap:2px}
.shot-facts__label{font:560 9.5px/1.2 "IBM Plex Mono",ui-monospace,monospace;text-transform:uppercase;letter-spacing:.09em;color:var(--faint)}
.shot-facts__num{font:600 18px/1.15 "IBM Plex Mono",ui-monospace,monospace;font-variant-numeric:tabular-nums;color:var(--text)}
.shot-facts__num--xg{color:var(--text)}
.shot-facts__num--xgot{color:var(--accent)}
.shot-facts__rows{margin:0;display:grid;gap:6px;padding-top:8px;border-top:1px solid color-mix(in srgb,var(--border) 65%,transparent)}
.shot-facts__row{display:flex;justify-content:space-between;align-items:baseline;gap:12px;font-size:12px;line-height:1.35}
.shot-facts__row dt{color:var(--faint);font-size:11px;white-space:nowrap;flex:0 0 auto}
.shot-facts__row dd{margin:0;color:var(--text);text-align:right;font-weight:520}

.inspect-actions{display:flex;flex-wrap:wrap;gap:6px 12px;margin-top:12px;padding-top:10px;border-top:1px solid var(--border)}
.inspect-actions:not(:has(> :not([hidden]))){display:none}
.inspect-actions button{
  padding:3px 0;color:var(--muted);font-size:11.8px;font-weight:540;
  transition:color .14s ease;
}
.inspect-actions button:hover{color:var(--accent)}

/* Transport bar + clickable matchweek ticks */
.transport{
  display:grid;grid-template-columns:auto minmax(140px,1fr);gap:clamp(12px,2vw,24px);
  align-items:center;padding:7px clamp(12px,1.5vw,20px) 6px;border-top:1px solid var(--border);
  flex:0 0 auto;
}
.play-controls{display:flex;align-items:center;gap:4px}
.play{
  display:inline-flex;align-items:center;justify-content:center;gap:6px;border-radius:5px;
  background:var(--accent);color:var(--on-accent);font-size:12.5px;font-weight:700;
  min-height:32px;min-width:112px;padding:5px 11px;
}
.play:hover{filter:brightness(1.06)}.play svg{width:12px!important;height:12px!important}
.step-shot{
  width:30px;min-height:32px;border:1px solid var(--border);border-radius:5px;
  font-size:19px;line-height:1;color:var(--muted);display:grid;place-items:center;
}
.step-shot:hover{background:var(--soft);border-color:var(--border-hi);color:var(--text)}
.timeline-heading{display:flex;justify-content:space-between;gap:8px;align-items:baseline}
.timeline-heading label{font-size:11px;font-weight:600;color:var(--muted)}
.timeline-heading span{font-size:10px;color:var(--faint)}
.track{position:relative;height:16px;margin:2px 0 0;border-bottom:1px solid var(--border)}
.track:focus-within{outline:1px solid var(--accent);outline-offset:3px}
#match-bars{position:absolute;inset:0;overflow:hidden}
.match-bar{position:absolute;bottom:0;min-height:2px;background:linear-gradient(to right,var(--accent) var(--fill),var(--border) var(--fill));opacity:.68}
#playhead{position:absolute;bottom:-2px;width:2px;top:0;border-radius:2px;background:var(--accent);transform:translateX(-50%);pointer-events:none}
#playhead:before{content:"";display:block;position:absolute;top:-2px;left:-2px;width:6px;height:6px;background:var(--accent);border-radius:50%}
#timeline{position:absolute;inset:-6px 0 auto;width:100%;height:26px;opacity:0;cursor:ew-resize;margin:0}

#weeks{height:18px;position:relative;margin:2px 0 0;color:var(--faint);font-size:9.5px;letter-spacing:.02em}
#weeks.is-row{display:flex;align-items:center;justify-content:space-between;gap:4px}
.week-label{position:absolute;top:2px;transform:translateX(-50%);pointer-events:none}
.week-tick{
  position:absolute;top:0;transform:translateX(-50%);
  display:inline-flex;align-items:center;gap:3px;
  padding:2px 4px;border-radius:3px;color:var(--faint);
  font-size:9.5px;line-height:1.2;white-space:nowrap;
  transition:color .14s ease;
}
#weeks.is-row .week-tick{position:static;transform:none;padding:2px 5px}
.week-tick:hover{color:var(--text)}
.week-tick.is-latest{color:var(--muted)}
.week-tick.is-latest:hover{color:var(--accent)}
.week-tick.is-active{color:var(--accent);font-weight:600}
.week-dot{width:4.5px;height:4.5px;border-radius:50%;background:var(--accent);box-shadow:0 0 6px rgba(213,245,109,.55);flex-shrink:0}

.match-context{
  display:flex;align-items:center;flex-wrap:wrap;gap:6px 14px;
  padding:2px clamp(12px,1.5vw,20px) 7px;flex:0 0 auto;
}
.match-context:not(:has(> :not([hidden]))){display:none}
.match-context button{
  padding:2px 0;color:var(--muted);font-size:11.5px;font-weight:540;
  transition:color .14s ease;
}
.match-context button:hover{color:var(--accent)}

/* Quiet editorial strip (Makscape / Veturilo Closer look — zero boxed chips) */
.insight-strip{
  display:flex;align-items:center;flex-wrap:wrap;gap:4px 12px;
  padding:6px clamp(12px,1.5vw,20px);border-top:1px solid var(--border);
  background:rgba(14,20,24,.5);font-size:12px;flex:0 0 auto;
}
.ctx-group{display:inline-flex;align-items:center;flex-wrap:wrap;gap:4px 8px;min-width:0}
.ctx-label{
  font:600 9.5px/1.3 "IBM Plex Mono",ui-monospace,monospace;text-transform:uppercase;
  letter-spacing:.11em;color:var(--faint);white-space:nowrap;margin-right:4px;
}
.ctx-stat{
  font:500 11px/1.35 "IBM Plex Mono",ui-monospace,monospace;color:var(--muted);
  font-variant-numeric:tabular-nums;
}
.ctx-stat b{color:var(--text);font-weight:600}
.ctx-sep{color:var(--border-hi);user-select:none}
.ctx-divider{width:1px;height:13px;background:var(--border);flex-shrink:0;margin:0 2px}
.ctx-link{
  display:inline-flex;align-items:baseline;gap:5px;padding:1px 0;
  color:var(--text);font-size:12px;line-height:1.35;white-space:nowrap;
  transition:color .14s ease;
}
.ctx-kicker{
  font:560 9.5px/1.2 "IBM Plex Mono",ui-monospace,monospace;text-transform:uppercase;
  letter-spacing:.06em;color:var(--faint);
}
.ctx-title{font-weight:540;color:var(--text);transition:color .14s ease}
.ctx-meta{font-size:11.2px;color:var(--muted);font-variant-numeric:tabular-nums}
.ctx-arrow{font-size:11.5px;color:var(--faint);transition:transform .14s ease,color .14s ease}
.ctx-link--accent .ctx-title{color:var(--accent)}
.ctx-link:hover .ctx-title,.ctx-link:hover .ctx-kicker,.ctx-link:hover{color:var(--accent)}
.ctx-link:hover .ctx-arrow{color:var(--accent);transform:translateX(2px)}

.inline-ctx-link{
  padding:0;color:var(--text);font-weight:540;text-decoration:none;
  transition:color .14s ease;
}
.inline-ctx-link:hover{color:var(--accent)}

/* Key bar */
.key-bar{
  display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:6px 18px;
  padding:5px clamp(12px,1.5vw,20px);border-top:1px solid var(--border);
  font-size:11.5px;color:var(--muted);background:rgba(13,18,21,.42);flex:0 0 auto;
}
.colour-key{display:flex;align-items:center;gap:16px;flex-wrap:wrap}
.key-item{display:inline-flex;align-items:center;gap:6px}
.key-item i{display:inline-block;width:7.5px;height:7.5px;border-radius:50%;background:var(--ink)}
.style-bar{display:inline-flex;align-items:center;gap:10px;flex-wrap:wrap}
.taper-key{display:inline-flex;align-items:center;gap:8px;font-size:11px;color:var(--faint)}
.taper-key b{color:var(--muted);font-weight:600}
.taper-glyph{width:68px;height:14px;display:block;flex:none}

/* Rebound panel */
.rebound-panel{
  display:flex;align-items:center;justify-content:space-between;gap:8px 18px;
  padding:7px clamp(12px,1.5vw,20px);border-top:1px solid var(--border);
  background:color-mix(in srgb,var(--accent) 5%,var(--surface));flex:0 0 auto;
}
.rebound-heading{display:grid;gap:1px}.rebound-heading strong{font-weight:600;font-size:13.5px}
.rebound-actions{display:flex;align-items:center;gap:12px}
.rebound-actions a{font-size:11.5px;color:var(--muted);text-underline-offset:3px}
.rebound-button{
  min-height:29px;border:1px solid color-mix(in srgb,var(--accent) 45%,var(--border));
  border-radius:5px;padding:4px 10px;font-size:11.5px;font-weight:620;color:var(--accent);
}
.rebound-button:hover{background:var(--soft)}

/* Keeper summary strip */
.keeper-summary{
  display:grid;grid-template-columns:minmax(220px,1.05fr) minmax(280px,1.4fr);
  gap:clamp(14px,3vw,42px);border-top:1px solid var(--border);
  padding:9px clamp(12px,1.5vw,20px);align-items:start;flex:0 0 auto;
}
.keeper-meta h2{margin:0;font-size:clamp(21px,1.7vw,26px);line-height:1.05;letter-spacing:-.02em}
.keeper-meta p,.keeper-zones p{margin:2px 0 0;font-size:11px;color:var(--muted)}
.keeper-metrics{display:grid;grid-template-columns:repeat(6,minmax(max-content,1fr));gap:6px 14px;margin-top:7px}
.keeper-metric{display:flex;flex-direction:column;gap:1px}
.keeper-metric span{font-size:9.2px;color:var(--faint);text-transform:uppercase;letter-spacing:.06em}
.keeper-metric strong{font:620 13.5px/1.15 "IBM Plex Mono",monospace;font-variant-numeric:tabular-nums;color:var(--text)}
.keeper-metric strong.pos{color:var(--accent)}.keeper-metric strong.neg{color:var(--post)}
.keeper-zone-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin-top:5px}
.keeper-zone{border:1px solid var(--border);border-radius:6px;padding:6px 9px;background:rgba(13,18,21,.52)}
.keeper-zone-head{display:flex;justify-content:space-between;align-items:baseline;font-size:10.5px;color:var(--muted)}
.keeper-zone-head strong{font:620 12.5px/1.2 "IBM Plex Mono",monospace;color:var(--text)}
.keeper-zone-bar{display:flex;height:4px;border-radius:3px;overflow:hidden;background:var(--border);margin:5px 0 4px}
.keeper-zone-bar .bar-save{background:var(--cyan)}.keeper-zone-bar .bar-goal{background:var(--accent)}
.keeper-zone-nums{font:10.5px/1.25 "IBM Plex Mono",monospace;color:var(--muted)}
.keeper-note{margin-top:4px!important;font-size:10px!important;color:var(--faint)!important}

/* Minimal Makscape footer matching warsaw.makscape.com */
footer{
  display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:6px 18px;
  padding:7px 0 9px;color:var(--faint);font-size:11px;line-height:1.4;flex:0 0 auto;
}
a{color:inherit}
.map-credits{margin-left:auto;display:flex;align-items:center;gap:12px;font-family:"DM Sans",-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;font-size:12px}
.map-signature{color:var(--muted);white-space:nowrap}
.map-signature a{color:inherit;text-decoration:none}
.map-signature a:hover{color:var(--text);text-decoration:underline;text-underline-offset:3px}
.text-button{
  border:0;background:none;padding:3px 0 3px 6px;color:var(--muted);font-size:inherit;
  transition:color .14s ease;
}
.text-button:hover{color:var(--accent)}

/* About <dialog> in the warsaw.makscape.com family */
dialog{
  width:min(520px,calc(100% - 32px));max-height:calc(100svh - 32px);
  overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;
  border:1px solid var(--border-hi);border-radius:10px;
  padding:26px 28px 22px;background:#10191e;color:var(--text);
  font-size:14px;line-height:1.5;box-shadow:0 24px 80px rgba(0,0,0,.68);
  scrollbar-width:thin;scrollbar-color:#586873 transparent;
}
dialog::backdrop{background:rgba(5,10,14,.82);backdrop-filter:blur(4px)}
.about-header{display:flex;align-items:baseline;justify-content:space-between;gap:16px;margin-bottom:16px}
dialog h2{font:400 32px/1.06 "Instrument Serif",Georgia,serif;letter-spacing:-.025em;margin:0;color:var(--text)}
.about-action{
  border:0;background:none;padding:4px 0;min-height:28px;color:var(--muted);
  font-size:13px;text-decoration:none;transition:color 140ms ease;
}
.about-action:hover,.about-action:focus-visible{color:var(--accent)}
.about-story p{margin:0;font-size:14px;line-height:1.56;color:#dde4e0}
.about-story p + p{margin-top:11px;color:#b8c5be;font-size:13.2px}
.about-story code{
  font-family:"IBM Plex Mono",ui-monospace,monospace;font-size:12px;
  color:var(--text);background:rgba(255,255,255,.06);padding:1px 5px;border-radius:3px;
}
.about-footer{
  display:flex;align-items:baseline;justify-content:space-between;flex-wrap:wrap;gap:6px 14px;
  border-top:1px solid var(--border);margin-top:20px;padding-top:14px;
}
.about-footer p{margin:0}
.about-footer .about-action{font-size:12px;flex:none}
.about-inspiration{font-size:12px;color:var(--muted);flex:1 1 240px}
dialog a{color:#dde4e0;text-decoration:none;transition:color 140ms ease}
dialog a:hover,dialog a:focus-visible{color:var(--accent)}
.about-sources{flex-basis:100%;padding-top:8px}
.about-sources p{font-size:12px;line-height:1.62;color:var(--muted)}
.about-sources p + p{margin-top:8px}
.about-author{
  flex-basis:100%;display:flex;flex-wrap:wrap;align-items:baseline;justify-content:space-between;
  gap:8px 16px;border-top:1px solid var(--border);margin-top:12px;padding-top:12px;
  font-size:13px;color:var(--muted);
}
.author-links{display:flex;align-items:baseline;flex-wrap:wrap;gap:4px 16px}
.author-links a{color:#dde4e0;white-space:nowrap}
.author-links a:hover{color:var(--accent)}

/* First-screen zero-scroll fit on standard desktop viewports (1280×800, 1440×900, etc.) */
@media (min-width:861px) and (min-height:680px){
  .page{height:100dvh;display:flex;flex-direction:column;overflow:hidden}
  .instrument{flex:1 1 auto;min-height:0;display:flex;flex-direction:column}
  .stage-layout{flex:1 1 auto;min-height:0}
  .scene{height:100%;min-height:0}
  #pitch,body.mode-keeper-panel #pitch{height:100%;max-height:none}
  .inspection,body.mode-keeper-panel .inspection{height:100%;max-height:100%}
}

@media (max-width:1180px){
  .keeper-metrics{grid-template-columns:repeat(3,minmax(78px,max-content));gap:6px 16px}
}

@media (max-width:860px){
  .topbar{gap:9px}
  .mode-tabs{order:3;width:100%}
  .mode-tabs button{flex:1;text-align:center}
  .quiet-seg{margin-left:0}
  .quiet-seg:not([hidden]) + .quiet-seg{margin-left:8px;padding-left:8px}
  .ctx-divider{display:none}
  .orbit-hint{display:none}
}

@keyframes sheet-up{
  from{transform:translateY(28px);opacity:0}
  to{transform:translateY(0);opacity:1}
}

@media (max-width:720px){
  .page{padding:0}
  .instrument{border-left:0;border-right:0;border-radius:0}
  .topbar{padding:8px 12px 7px;gap:7px 10px}
  .brand{gap:7px}
  .mark{width:19px;height:17px}
  .brand h1{font-size:24px}
  .season-tag{font-size:10px}
  .mode-tabs{
    order:3;width:100%;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));
    padding:2px;gap:2px;
  }
  .mode-tabs button{padding:6px 4px;font-size:12px;text-align:center}

  .subbar{
    flex-wrap:nowrap;overflow-x:auto;-webkit-overflow-scrolling:touch;
    scrollbar-width:none;padding:6px 12px;gap:8px;min-height:40px;
  }
  .subbar::-webkit-scrollbar{display:none}
  .sub-group{flex-wrap:nowrap;flex:0 0 auto;gap:8px}
  .inline-select{flex:0 0 auto}
  .inline-select span{display:none}
  .inline-select select{max-width:186px;height:29px;min-height:29px;font-size:11.5px;padding:2px 22px 2px 8px;white-space:nowrap;overflow:hidden}
  .quiet-seg{flex:0 0 auto}
  .quiet-seg button{padding:4px 7px;font-size:11.5px}

  .stage-layout.inspecting,.keeper-summary{grid-template-columns:minmax(0,1fr)}
  #pitch{height:clamp(420px,64dvh,620px)}
  body.mode-keeper-panel #pitch{height:clamp(370px,55dvh,520px)}

  .scene-heading{left:10px;top:10px;max-width:44%}
  .stage-state{font-size:9.2px;gap:5px}
  .scene-stat{font-size:11.5px;gap:6px;flex-wrap:wrap;margin-top:2px}
  .scene-stat strong{font-size:27px}

  .camera{
    right:10px;top:10px;max-width:54%;
    flex-wrap:wrap;justify-content:flex-end;gap:4px;
    border:0;background:none;overflow:visible;
  }
  .camera button{
    height:31px;border:1px solid var(--border);border-radius:6px;
    background:var(--glass);backdrop-filter:blur(6px);-webkit-backdrop-filter:blur(6px);
  }
  .camera button + button{border-left:1px solid var(--border)}
  .camera button.cam-text{padding:0 8px;font-size:11px;gap:4px}
  .camera button:not(.cam-text){width:31px}

  .scene .event{left:10px;right:10px;bottom:10px;max-width:none;padding:6px 10px 7px}
  .scene .event .micro{font-size:9.3px}
  .scene #event-title{font-size:13.5px}
  .scene #event-detail{font-size:11px;line-height:1.35}
  .stage-layout.inspecting .scene::before{content:"Selected shot";top:13px;left:10px;font-size:9.5px;max-width:40%}
  .orbit-hint{display:none}

  /* Mobile inspection bottom sheet */
  .sheet-handle{
    display:flex;justify-content:center;align-items:center;
    padding:2px 0 8px;margin:-2px 0 2px;touch-action:none;cursor:grab;
  }
  .sheet-handle span{width:38px;height:4px;border-radius:99px;background:var(--border-hi)}
  .inspection{
    position:fixed;left:0;right:0;bottom:0;z-index:40;
    border-left:0;border-top:1px solid var(--border-hi);border-radius:16px 16px 0 0;
    background:rgba(15,22,26,.96);backdrop-filter:blur(14px);-webkit-backdrop-filter:blur(14px);
    box-shadow:0 -14px 44px rgba(0,0,0,.68);
    max-height:48dvh;padding:8px 15px calc(14px + env(safe-area-inset-bottom,0px));
    overscroll-behavior:contain;
    animation:sheet-up .22s cubic-bezier(.22,1,.36,1);
    will-change:transform;
  }
  body.mode-keeper-panel .inspection{max-height:48dvh}
  .inspection h2{font-size:23px}
  .inspection-top button{width:32px;height:32px}
  #episodes button{min-height:35px}
  .inspect-actions button{min-height:30px;font-size:12px}

  .transport{grid-template-columns:minmax(0,1fr);gap:7px 10px;padding:8px 12px 7px}
  .timeline-box{grid-column:1/-1;grid-row:1}
  .play{min-width:106px;padding:5px 10px;font-size:12px}
  #weeks{font-size:8.5px;height:20px}
  .week-tick{font-size:8.5px;padding:2px 2px;gap:2px}
  .week-dot{width:4px;height:4px}

  .match-context{padding:2px 12px 8px}
  .insight-strip{padding:7px 12px;gap:5px 10px}
  .ctx-group{flex-wrap:wrap;gap:4px 7px}
  .ctx-link{font-size:11.5px;white-space:normal;text-align:left}
  .rebound-panel{padding:8px 12px;flex-wrap:wrap}
  .key-bar{padding:7px 12px;gap:6px 12px;font-size:11px}
  .colour-key{gap:12px}
  .style-bar{gap:8px;width:100%;justify-content:space-between}
  .taper-key{font-size:10.5px;gap:6px}
  .taper-glyph{width:60px;height:13px}

  .keeper-summary{gap:11px;padding:10px 12px}
  .keeper-metrics{grid-template-columns:repeat(3,minmax(0,1fr));gap:7px 10px}
  .keeper-zone-grid{gap:6px}
  .keeper-zone{padding:6px 7px}
  .keeper-zone-head{font-size:10px}
  .keeper-zone-head strong{font-size:12px}
  .keeper-zone-nums{font-size:10px}

  footer{padding:9px 12px 18px;font-size:10px}
  dialog{padding:20px 20px 18px;max-height:calc(100svh - 24px)}
  dialog h2{font-size:27px}
}
@media (max-width:520px){
  .season-tag{display:none}
}
@media (max-height:520px) and (orientation:landscape){
  #pitch,body.mode-keeper-panel #pitch{height:clamp(240px,70dvh,360px)}
  .inspection{max-height:66dvh}
}

/* Keep the WebGL scene interactive while hiding controls, captions and the HUD. */
body.clean-view{overflow:hidden}
body.clean-view .page{visibility:hidden}
body.clean-view #pitch{
  position:fixed;inset:0;width:100vw;height:100dvh;max-height:none;
  visibility:visible;outline:none;
}
