:root {
  --bg: #EEF2EC;
  --surface: #FFFFFF;
  --surface-2: #F5F8F3;
  --line: #D5DDD2;
  --ink: #15201A;
  --muted: #5A695F;
  --accent: #1B7547;
  --accent-ink: #FFFFFF;
  --stage: #0B0F0D;
  --c-goal: #B97F00;
  --c-assist: #8A6A12;
  --c-conceded: #8C2E2E;
  --c-shot: #7349C9;
  --c-oppshot: #9A8BC4;
  --c-pass: #1B8A53;
  --c-lb: #2361CC;
  --c-miss: #CC4129;
  --c-turnover: #D6700F;
  --c-won: #0E7F86;
  --c-touch: #AE447B;
  --c-watch: #5864A3;
  --c-bunch: #66756B;
  --c-upfield: #B5473A;
  --c-counter: #2F8F4E;
  --c-sprint: #8A6D1E;
  --c-duel: #B5527A;
  --c-setpiece: #3F6F99;
  --c-note: #857F62;
  --c-shootout: #2F8F6F;
  --display: "Barlow Condensed", "Arial Narrow", system-ui, sans-serif;
  --body: "Barlow", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0D1310; --surface: #151E19; --surface-2: #1B2620; --line: #2A3830;
    --ink: #E3ECE6; --muted: #93A499; --accent: #3DB477; --accent-ink: #06130C; --stage: #000;
    --c-goal: #EDB22C; --c-assist: #D9BE6A; --c-conceded: #E07474; --c-shot: #A68AF0; --c-oppshot: #C9BEEA; --c-pass: #3FBF7F; --c-lb: #5C95F2;
    --c-miss: #F26B53; --c-turnover: #F59A44; --c-won: #3CC3C9; --c-touch: #E27DB2; --c-watch: #8F9CDC; --c-bunch: #95A59A; --c-upfield: #EE8577; --c-counter: #6FCB8C; --c-sprint: #D9BA5E; --c-duel: #E58BB0; --c-setpiece: #7CAEDB; --c-note: #BDB692; --c-shootout: #5FC9A4;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0D1310; --surface: #151E19; --surface-2: #1B2620; --line: #2A3830;
  --ink: #E3ECE6; --muted: #93A499; --accent: #3DB477; --accent-ink: #06130C; --stage: #000;
  --c-goal: #EDB22C; --c-assist: #D9BE6A; --c-conceded: #E07474; --c-shot: #A68AF0; --c-oppshot: #C9BEEA; --c-pass: #3FBF7F; --c-lb: #5C95F2;
  --c-miss: #F26B53; --c-turnover: #F59A44; --c-won: #3CC3C9; --c-touch: #E27DB2; --c-watch: #8F9CDC; --c-bunch: #95A59A; --c-upfield: #EE8577; --c-counter: #6FCB8C; --c-sprint: #D9BA5E; --c-duel: #E58BB0; --c-setpiece: #7CAEDB; --c-note: #BDB692; --c-shootout: #5FC9A4;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { min-height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.45 var(--body);
  padding-inline: 16px; padding-block: 12px 32px;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* Header / scoreboard: a full-width bar in the logo's navy, its contents lined up with the page below */
.top {
  --bar: #15243A; --bar-ink: #F2F5FA; --bar-muted: #AEBBD0; --bar-line: rgba(255,255,255,.16);
  margin: -12px -16px 12px; padding: 8px max(16px, calc(16px + (100% - 1400px) / 2));
  background: var(--bar); color: var(--bar-ink);
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; }
.brand-logo { height: 48px; width: auto; display: block; }   /* its navy background is the bar's */
@media (max-width: 600px) { .brand-logo { height: 40px; } }
.board {
  display: flex; align-items: center; gap: 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 6px 14px;
}
.board { min-width: 0; max-width: 100%; }
.board .team { font: 600 18px/1 var(--display); text-transform: uppercase; letter-spacing: .03em; max-width: 14ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board .score { font: 700 28px/1 var(--display); font-variant-numeric: tabular-nums; }
.board .clock { font-size: 13px; color: var(--muted); border-left: 1px solid var(--line); padding-left: 12px; }
.top .board { background: rgba(255,255,255,.08); border-color: var(--bar-line); color: var(--bar-ink); }
.top .board .clock { color: var(--bar-muted); border-left-color: var(--bar-line); }
/* the menu, top right: links to the app's other pages (only shown when it has some) */
.qhelp { border: 0; background: none; padding: 0 0 0 4px; margin: 0; color: var(--accent); font: inherit; line-height: inherit; letter-spacing: 0; vertical-align: baseline; cursor: pointer; }
.debuginfo { margin: 6px 0; }
.debuginfo summary { cursor: pointer; color: var(--muted); }
.topright { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.topmenu { position: relative; }
.menubtn { font: 600 14px/1 var(--body); padding: 8px 12px; border-radius: 6px; border: 1px solid var(--bar-line); background: rgba(255,255,255,.08); color: var(--bar-ink); cursor: pointer; }
.menubtn:hover, .menubtn[aria-expanded="true"] { background: rgba(255,255,255,.16); }
.menulist { position: absolute; right: 0; top: calc(100% + 6px); z-index: 80; min-width: 180px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.25); padding: 6px 0; display: flex; flex-direction: column; }
.menulist[hidden] { display: none; }
.menulist a { padding: 8px 14px; color: var(--ink); text-decoration: none; font-size: 14px; white-space: nowrap; }
.menulist a:hover, .menulist a:focus { background: var(--surface-2); outline: none; }
/* where the tags are saved: a small note at the bottom right of the page */
/* the experimental Ask panel (serve.py + jaxo/tools/coach_ai.py): bottom left, over the page */
.askbtn { font: 600 14px/1 var(--body); padding: 8px 12px; border-radius: 6px; border: 1px solid var(--bar-line); background: rgba(255,255,255,.08); color: var(--bar-ink); cursor: pointer; white-space: nowrap; }
.askbtn:hover { background: rgba(255,255,255,.16); }
.askbtn[aria-expanded="true"] { background: var(--accent); color: #fff; border-color: var(--accent); }
.askpanel { position: fixed; right: 12px; top: 64px; z-index: 41; width: min(460px, calc(100vw - 24px)); max-height: min(72vh, 680px, calc(100vh - 170px)); display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 28px rgba(0,0,0,.2); }
.askpanel .askhead { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.askpanel .askhead b { margin-right: auto; }
.askpanel .asklog { overflow: auto; padding: 10px 12px; display: flex; flex-direction: column; gap: 10px; }
.askpanel .askq { align-self: flex-end; max-width: 85%; background: var(--surface-2); border-radius: 10px; padding: 6px 10px; }
.askpanel .aska { line-height: 1.45; }
.askpanel .aska ul { margin: 4px 0; padding-left: 18px; }
.askpanel .aska p { margin: 4px 0; }
.askpanel .asklink { border: 0; background: none; padding: 0; color: var(--accent); font: 600 13px var(--mono, monospace); cursor: pointer; text-decoration: underline dotted; }
.askpanel .askform { border-top: 1px solid var(--line); padding: 8px 12px; display: flex; gap: 8px; align-items: flex-end; }
.askpanel textarea { flex: 1; resize: vertical; min-height: 44px; max-height: 160px; font: inherit; padding: 6px 8px; border-radius: 6px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); }
.savestatus { position: fixed; right: 12px; bottom: 8px; z-index: 40; font-size: 12px; padding: 3px 8px; border-radius: 6px; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 1px 4px rgba(0,0,0,.08); max-width: calc(100vw - 24px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 520px) { .board { gap: 8px; padding: 6px 10px; } .board .team { font-size: 15px; max-width: 9ch; } .board .score { font-size: 22px; } .board .clock { padding-left: 8px; font-size: 12px; } }
.filestatus { font-size: 13px; color: var(--muted); }
.procpill { font: 600 13px/1 var(--body); padding: 6px 10px; border-radius: 99px; border: 1px solid var(--accent); background: var(--surface); color: var(--accent); }
.procpill.bad { border-color: var(--c-miss); color: var(--c-miss); }
.proclog { font: 11px/1.4 var(--mono); color: var(--muted); background: var(--surface-2); border-radius: 6px; padding: 6px 8px; margin: 6px 0 0; white-space: pre-wrap; max-height: 9em; overflow: auto; }
.pagefoot { max-width: 1400px; margin: 16px auto 0; }
.version { font-size: 12px; color: var(--muted); }
.filestatus.bad { color: var(--c-miss); font-weight: 600; }
.pill { font: 600 11px/1 var(--body); letter-spacing: .08em; text-transform: uppercase; padding: 5px 8px; border-radius: 99px; background: var(--c-goal); color: #1b1300; }

/* Layout */
.app { max-width: 1400px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 16px; align-items: start; }
@media (max-width: 960px) { .app { grid-template-columns: minmax(0, 1fr); } }

/* Stage */
.stage { position: relative; background: var(--stage); border-radius: 8px; overflow: hidden; aspect-ratio: 16 / 9; max-width: 100%; }
.stage video { width: 100%; height: 100%; display: block; background: var(--stage); }
.drop {
  position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 24px;
  color: #DDE7E0; background:
    linear-gradient(transparent 49.8%, rgba(255,255,255,.12) 50%, transparent 50.2%) ,
    radial-gradient(circle at 50% 50%, transparent 17%, rgba(255,255,255,.12) 17.3%, transparent 17.6%),
    #123322;
}
.drop.over { outline: 3px dashed #7fe0a8; outline-offset: -12px; }
/* while a game's own video is on its way (files.js), a loading note instead of "Load a match video" */
.drop .droploading { display: none; }
.loadinggame .drop .droploading { display: block; }
.loadinggame .drop .droppick { display: none; }
.drop .spin { display: inline-block; width: 34px; height: 34px; border-radius: 50%; border: 3px solid rgba(255,255,255,.2); border-top-color: #7fe0a8; animation: dropspin .9s linear infinite; }
@keyframes dropspin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .drop .spin { animation-duration: 3s; } }
.drop h2 { font: 700 clamp(22px, 4vw, 34px)/1.05 var(--display); text-transform: uppercase; letter-spacing: .02em; margin: 0 0 8px; text-wrap: balance; }
.drop p { margin: 0 auto 16px; max-width: 46ch; color: #B8CBBF; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--line); background: var(--surface); border-radius: 6px; padding: 7px 12px; font-weight: 600;
}
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.danger { color: var(--c-miss); }
.btn.small { padding: 4px 9px; font-size: 13px; }
.drop .btn.primary { background: #3DB477; border-color: #3DB477; color: #06130C; font-size: 16px; padding: 10px 18px; }

/* Tag prompt over the video */
.prompt {
  margin-top: 10px;
  background: var(--surface); color: var(--ink); border-radius: 8px; padding: 12px 14px;
  box-shadow: 0 4px 16px rgba(0,0,0,.12); border: 1px solid var(--line); border-top: 4px solid var(--ptype, var(--accent));
}
.prompt-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.prompt-head b { font: 700 20px/1 var(--display); text-transform: uppercase; letter-spacing: .02em; }
.prompt-head .step { color: var(--muted); }
.prompt-entry { display: flex; align-items: center; gap: 10px; margin: 8px 0; flex-wrap: wrap; }
.numbox { font: 700 30px/1 var(--display); min-width: 3.2ch; padding: 4px 10px; border: 2px solid var(--line); border-radius: 6px; text-align: center; font-variant-numeric: tabular-nums; }
.numbox.empty { color: var(--muted); }
.suggest { color: var(--muted); }
.suggest b { color: var(--ink); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line); background: var(--surface-2); border-radius: 99px; padding: 3px 10px 3px 4px; font-size: 13px; display: inline-flex; align-items: center; gap: 6px; }
.chip .n { font: 700 13px/1 var(--display); background: var(--ink); color: var(--surface); border-radius: 99px; min-width: 22px; height: 22px; display: inline-grid; place-items: center; padding: 0 4px; }
.chip.on { box-shadow: inset 0 0 0 2px var(--ptype, var(--accent)); }
.chip:hover { border-color: var(--muted); }
.chip.busy { opacity: .4; text-decoration: line-through; }
.chip.likely { box-shadow: 0 0 0 2px var(--ptype, var(--accent)); font-weight: 700; }
.lrefs { display: flex; align-items: center; gap: 6px; margin: 8px 0; flex-wrap: wrap; }
.lgrid { display: flex; flex-wrap: wrap; gap: 6px; max-height: 420px; overflow: auto; padding: 3px; margin-bottom: 6px; }
/* confirming look-alikes: a sheet over the page, the pictures large, the player and the buttons beside them */
.prompt.sheet { position: fixed; inset: 12px; z-index: 60; margin: 0; display: flex; flex-direction: column; box-shadow: 0 0 0 100vmax rgba(0,0,0,.5), 0 8px 30px rgba(0,0,0,.4); }
body.sheet-open { overflow: hidden; }
.bsheet { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 16px; margin-top: 10px; }
.bpeek canvas { cursor: pointer; }
.bpctl { display: flex; align-items: center; gap: 6px; margin: 2px 0 4px; }
.bpctl input[type=range] { flex: 1; min-width: 60px; }
.bpctl .bptime { white-space: nowrap; }
.bmain { overflow: auto; min-height: 0; }
.bmain .lgrid { max-height: none; overflow: visible; gap: 8px; }
.bmain .lgrid .lthumb:hover { transform: none; box-shadow: 0 0 0 2px var(--muted); }
.bmain .lthumb.off { opacity: .6; filter: grayscale(.5); }
.bmain .lthumb.off:hover { opacity: 1; filter: none; }
.bside { overflow: auto; min-height: 0; display: flex; flex-direction: column; gap: 12px; border-left: 1px solid var(--line); padding-left: 16px; }
.bside .lrefs { margin: 0; }
.bside .lrefs .small { flex-basis: 100%; }
.bpeek canvas { width: 100%; height: auto; border-radius: 6px; background: #222; display: block; margin-bottom: 4px; }
.bcount b { font: 700 18px/1 var(--display); }
.sheet .lsplit { font-weight: 600; color: var(--muted); margin-top: 10px; }
.sheet .lsplit:first-child { margin-top: 0; }
@media (max-width: 760px) {
  .prompt.sheet { inset: 0; border-radius: 0; overflow: auto; }
  .bsheet { display: block; }
  .bmain { overflow: visible; }
  .bside { border-left: 0; padding-left: 0; margin-top: 12px; }
}
.lgrid .lthumb { transition: transform .12s; }
.lgrid .lthumb:hover { transform: scale(1.9); z-index: 3; box-shadow: 0 4px 14px rgba(0,0,0,.55); opacity: 1; filter: none; }
.lthumb.alt { outline-style: dashed; }
.lsplit { flex-basis: 100%; margin-top: 4px; }
.lmore { flex-basis: 100%; }
.lthumb { position: relative; flex: none; border-radius: 4px; background-repeat: no-repeat; background-color: #222; cursor: pointer; }
.lthumb.ref { cursor: default; outline: 1px solid var(--line); }
.lthumb.on { outline: 3px solid var(--ptype, var(--accent)); }
.lthumb.off { opacity: .35; filter: grayscale(1); }
.lthumb.peeked { box-shadow: 0 0 0 6px #ffd400; }
.lthumb .dur { position: absolute; left: 2px; top: 2px; font: 600 10px/1.3 var(--mono); background: rgba(0,0,0,.65); color: #fff; padding: 0 3px; border-radius: 3px; }
.lthumb.strong::after { content: ''; position: absolute; right: 3px; top: 3px; width: 8px; height: 8px; border-radius: 50%; background: #3cd27a; box-shadow: 0 0 0 1px #000; }
.lthumb .peek { position: absolute; right: 2px; bottom: 2px; font-size: 11px; line-height: 1.4; background: rgba(0,0,0,.65); color: #fff; border-radius: 3px; padding: 0 4px; }
.lookline { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 6px 0; }
.seg { display: flex; flex-wrap: wrap; gap: 4px; margin: 8px 0 4px; }
.btn.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
details.trails summary { cursor: pointer; margin: 4px 0; }
.suggest.bad { color: var(--c-miss); }
.prompt-foot { display: flex; gap: 8px; justify-content: space-between; align-items: center; flex-wrap: wrap; margin-top: 10px; font-size: 13px; color: var(--muted); }
.prompt input[type=text] { width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-2); }

.reelbar { position: absolute; top: 10px; left: 10px; right: 10px; display: flex; justify-content: space-between; align-items: center; gap: 8px; background: rgba(8,12,10,.8); color: #fff; padding: 6px 10px; border-radius: 6px; font-size: 14px; }
.drawbar { position: absolute; left: 10px; right: 10px; bottom: 10px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; background: rgba(8,12,10,.85); color: #fff; padding: 6px 10px; border-radius: 6px; font-size: 13px; }
.drawbar .btn { background: transparent; color: #fff; border-color: rgba(255,255,255,.4); }
.drawbar .btn.on { background: rgba(255,255,255,.22); border-color: #fff; }
.drawbar .btn.primary { background: var(--accent, #2c7a4b); border-color: transparent; }
.drawbar select { font-size: 13px; color: #111; background: #fff; border-radius: 4px; }
.dswatch { width: 22px; height: 22px; border-radius: 50%; border: 2px solid rgba(255,255,255,.35); padding: 0; cursor: pointer; }
.dswatch.on { border-color: #fff; box-shadow: 0 0 0 2px rgba(0,0,0,.6); }
.ovl.drawing { cursor: crosshair; touch-action: none; }
.shsvg .shedge { stroke: #fff; opacity: .75; stroke-linecap: round; }
.shsvg .shnode circle { stroke: #111; stroke-width: .25; }
.shsvg .shnode text { font-size: 1.3px; font-weight: 700; fill: #fff; paint-order: stroke; stroke: rgba(0,0,0,.6); stroke-width: .25px; font-family: var(--body); pointer-events: none; }
.shsvg .shdir { font-size: 1.6px; fill: #fff; opacity: .8; font-family: var(--body); }
.season-mode main.app, .season-mode .board, .season-mode #fileStatus, .season-mode #procStatus, .season-mode #samplePill { display: none !important; }
.booting main.app, .booting .board, .booting #fileStatus, .booting #procStatus, .booting #samplePill, .booting #drop { visibility: hidden !important; }
.seasonview { max-width: 1100px; margin: 0 auto; padding: 12px 16px 32px; }
.seasonview h2 { margin: 8px 0 4px; }
.seasonview .crumb { margin: 2px 0 0; }
.seasonview .yearbar { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 12px; }
.seasonview .yearbar .yr { padding: 4px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink);
  text-decoration: none; font: 600 14px/1.4 var(--body); }
.seasonview .yearbar .yr:hover { border-color: var(--accent); }
.seasonview .yearbar .yr.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.seasonview .seasons { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; margin: 10px 0; }
.seasonview .seasoncard { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); text-decoration: none; }
.seasonview .seasoncard:hover { border-color: var(--accent); }
.seasonview .seasoncard b { font: 700 20px/1.1 var(--display); letter-spacing: .03em; }
.seasonview .gamelist td a { font-weight: 600; }
.seasonview .res { display: inline-block; min-width: 1.6em; text-align: center; border-radius: 4px; padding: 0 4px; font-weight: 700; font-size: 12px; color: #fff; }
.seasonview .res.W { background: #2f8a4f; } .seasonview .res.D { background: #7b7b7b; } .seasonview .res.L { background: #b3403a; }
.seasonview .charts { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 360px)); gap: 12px; margin: 8px 0; }
.seasonview .chart { background: var(--surface, #fff); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
.seasonview .chart h4 { margin: 0 0 4px; font-size: 13px; color: var(--muted); font-weight: 600; }
.seasonview .chart svg { width: 100%; height: auto; display: block; }
.seasonview .stabs { display: flex; border-bottom: 1px solid var(--line); margin: 0 0 8px; }
.seasonview .stabs button { border: 0; background: none; padding: 11px 16px; font: 600 16px/1 var(--display); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); border-bottom: 3px solid transparent; cursor: pointer; }
.seasonview .stabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }
.seasonview .stabs { align-items: center; }
.seasonview .stabs .sadd { margin-left: auto; }
@media (max-width: 560px) { .seasonview .stabs { flex-wrap: wrap; } .seasonview .stabs button { padding: 10px 10px; font-size: 14px; } .seasonview .stabs .sadd { margin: 4px 0 6px auto; } }
.seasonview .dlstrip { display: flex; flex-wrap: wrap; gap: 6px; margin: -2px 0 8px; }
/* highlight reels: making them (Season tab), watching them (Highlights tab) */
.seasonview .ghead { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.seasonview .ghead h3 { margin-right: auto; }
.seasonview .hljob { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; margin: 6px 0 10px; background: var(--surface); }
.seasonview .hljob .dlrow { grid-template-columns: 1fr 44px; }
.seasonview .gamelist td.pick, .seasonview .gamelist th.pick { width: 28px; text-align: center; }
.seasonview .hlreels .btn.primary .small { color: inherit; opacity: .85; }
.seasonview .hlopen { margin-left: 6px; text-decoration: none; }
.seasonview .hlreels { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.seasonview .hlreport { max-width: 760px; margin: 14px 0 6px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.seasonview .hlreport h4 { margin: 0 0 6px; }
.seasonview .hlheat { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; margin: 8px 0 2px; }
.seasonview .hlheat figure { margin: 0; }
.seasonview .hlheat svg { display: block; width: 100%; height: auto; border-radius: 6px; }
.hlshots { margin: 8px 0 4px; max-width: 560px; }
.hlshots > svg { display: block; width: 100%; height: auto; border-radius: 6px; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.hlshots .shotlink { cursor: pointer; }
.hllanes { margin: 6px 0 8px; max-width: 560px; }
.hllanes figcaption { margin-bottom: 4px; }
.hllanes .lanerow { display: grid; grid-template-columns: minmax(70px, auto) 1fr; gap: 2px 10px; align-items: center; margin: 4px 0; }
.hllanes .lanerow > .small { grid-column: 2; }
.hllanes .lanebar { display: flex; gap: 2px; height: 12px; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.hllanes .lanebar span { display: block; height: 100%; min-width: 3px; }
.hllanes .lanebar span:first-child { border-radius: 4px 0 0 4px; }
.hllanes .lanebar span:last-child { border-radius: 0 4px 4px 0; }
.hllanes .lanebar span:only-child { border-radius: 4px; }
.hllanes .lanekey { display: inline-flex; gap: 10px; margin-left: 8px; font-size: 12px; font-weight: normal; }
.hllanes .lanekey i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 4px; vertical-align: -1px; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.hllanes .lanesecs { opacity: .75; }
.hlshots .shotlink:hover { filter: brightness(1.3); }
.hlshots .shotkey { display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 4px 0 2px; }
.hlshots .shotkey svg { display: inline-block; width: 14px; height: 14px; vertical-align: -2px; background: #2d6a3e; border-radius: 3px; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
/* the match report on paper (Print / save as PDF): only the report, a page for the team and one per player */
#printReport { display: none; }
@media print {
  body.printing > *:not(#printReport) { display: none !important; }
  body.printing { background: #fff !important; }
  body.printing #printReport { display: block; color: #111; font: 11pt/1.45 system-ui, sans-serif; }
  #printReport .ppage { break-after: page; }
  #printReport .ppage:last-child { break-after: auto; }
  #printReport .phead { display: flex; justify-content: space-between; font-size: 8.5pt; color: #666; border-bottom: 1px solid #ccc; padding-bottom: 4px; margin-bottom: 10px; }
  #printReport h1 { font-size: 18pt; margin: 0 0 8px; }
  #printReport h2 { font-size: 15pt; margin: 0 0 8px; }
  #printReport h3 { font-size: 11pt; margin: 12px 0 4px; }
  #printReport ul { margin: 0; padding-left: 18px; }
  #printReport .pnote, #printReport .small { font-size: 8.5pt; color: #555; }
  #printReport .pmoment { color: #1d6b3a; font-weight: 600; white-space: nowrap; }
  #printReport .hlheat { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 8px 0 2px; break-inside: avoid; }
  #printReport .hlheat figure { margin: 0; }
  #printReport .hlheat svg { display: block; width: 100%; height: auto; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  @page { margin: 14mm; }
}
.seasonview .hlreport h5 { margin: 12px 0 4px; font-size: 13px; }
.seasonview .hlreport p, .seasonview .hlreport li { line-height: 1.45; }
.seasonview .hlreport ul { margin: 0; padding-left: 20px; }
.seasonview .hlreport .asklink { border: 0; background: none; padding: 0; cursor: pointer; color: var(--accent); font: 600 13px var(--mono, monospace); text-decoration: underline dotted; }
.seasonview .hlplayer { display: grid; grid-template-columns: minmax(0, 2fr) minmax(200px, 1fr); gap: 14px; align-items: start; }
@media (max-width: 800px) { .seasonview .hlplayer { grid-template-columns: 1fr; } }
.seasonview .hlplayer video { width: 100%; background: #000; border-radius: 8px; }
.seasonview .hlcap { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.seasonview .hlicons { display: flex; gap: 2px; flex: none; }
.seasonview .hlicons .iconbtn, .seasonview .hlprint { display: grid; place-items: center; padding: 5px; cursor: pointer; }
.seasonview .hlhead { margin-bottom: 10px; }
.seasonview .hlwritten { margin-left: auto; }
.seasonview .hlclips { list-style: none; margin: 0; padding: 0; max-height: 420px; overflow: auto; }
.seasonview .hlclips button { width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--line); background: none; padding: 6px 4px; cursor: pointer; color: var(--ink); font: inherit; }
.seasonview .hlclips button:hover, .seasonview .hlclips button.on { background: var(--surface-2); }
.dlg { position: fixed; inset: 0; z-index: 70; background: rgba(0,0,0,.5); display: grid; place-items: center; padding: 16px; }
.dlg[hidden] { display: none; }
.dlgbox { background: var(--surface, #fff); color: var(--ink); border-radius: 10px; padding: 18px 20px; width: min(520px, 100%); box-shadow: 0 10px 40px rgba(0,0,0,.35); display: flex; flex-direction: column; gap: 10px; }
.dlgbox h3 { margin: 0 0 4px; }
.dlgbox p { margin: 0; }
.dlgbox label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; font-size: 14px; }
.dlgbox label.chk { flex-direction: row; align-items: flex-start; gap: 8px; font-weight: 400; }
.dlgbox input[type=text], .dlgbox input[type=date] { padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-2); color: var(--ink); font: inherit; }
.dlrow { display: grid; grid-template-columns: 140px 1fr 44px; align-items: center; gap: 10px; }
.dlrow .bar { display: block; height: 10px; border-radius: 5px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; }
.dlrow .bar i { display: block; height: 100%; background: var(--accent); }
.dlrow.up { grid-template-columns: 1fr 44px; }
.dlgbox .srcpick { display: flex; gap: 6px 18px; flex-wrap: wrap; }
.dlgbox h4 { margin: 8px 0 0; }
.dlgbox .row2 { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.dlgbox .row2 label { flex: 1 1 180px; }
.dlgbox select { padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-2); color: var(--ink); font: inherit; flex: 1 1 180px; }
.seasonview .gamelist td.gmore { width: 32px; text-align: right; padding-right: 0; }
.seasonview .gamelist td.gmore .iconbtn { font-size: 16px; line-height: 1; }
.seasonview .sdel { margin-top: 18px; }
.seasonview .deletedlist { display: grid; gap: 0; margin-bottom: 14px; }
.seasonview .delrow { display: flex; flex-wrap: wrap; gap: 6px 12px; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.dlgbox input[type=file] { font: inherit; font-weight: 400; }
.seasonview .gplayer { border-top: 1px solid var(--line); padding: 8px 0; }
.seasonview .gname { margin-bottom: 4px; }
.seasonview .ggame { margin: 4px 0 6px; }
.seasonview .glabel { margin-bottom: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seasonview .gstrip { display: flex; flex-wrap: wrap; gap: 3px; }
.seasonview .gthumb { position: relative; width: 40px; height: 80px; padding: 0; border: 0; border-radius: 4px; background: #222; cursor: pointer; transition: transform .12s; outline: 1px solid transparent; }
.seasonview .gthumb img { width: 40px; height: 80px; display: block; border-radius: 4px; }
.seasonview .gthumb:hover { transform: scale(1.9); z-index: 3; box-shadow: 0 4px 14px rgba(0,0,0,.55); }
.seasonview .gthumb.warn, .seasonview .gwarnkey { outline: 2px solid #e0a020; }
.seasonview .gwarnkey { display: inline-block; width: 10px; height: 16px; border-radius: 3px; vertical-align: -3px; }
.seasonview .gthumb.on { outline: 3px solid var(--accent); }
.seasonview .gbar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin: 6px 0; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; }
.seasonview .chart .ax { stroke: var(--line); stroke-width: 1; }
.seasonview .chart .ln { fill: none; stroke: var(--accent, #1E7A4C); stroke-width: 2; stroke-linejoin: round; }
.seasonview .chart .pt { fill: var(--accent, #1E7A4C); stroke: var(--surface, #fff); stroke-width: 2; }
.seasonview .chart .hit { fill: transparent; cursor: default; }
.seasonview .chart text { font-size: 11px; fill: var(--muted); font-family: var(--body); }
.seasonview tr.sel td { background: color-mix(in srgb, var(--accent, #1E7A4C) 12%, transparent); }
.seasonview tr.pl { cursor: pointer; }
.hlbox { border: 1px solid var(--line, #ccc); border-radius: 6px; padding: 6px 10px; margin: 6px 0; }
.reelbar .btn { background: transparent; color: #fff; border-color: rgba(255,255,255,.4); }

/* Transport + timeline */
.transport { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.transport .time { font-size: 14px; min-width: 13ch; }
.transport .spacer { flex: 1; }
.speed { font-weight: 600; min-width: 3ch; text-align: center; }
.timeline { position: relative; height: 34px; margin-top: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; cursor: pointer; overflow: hidden; }
.timeline .tick { position: absolute; top: 5px; bottom: 5px; width: 3px; margin-left: -1px; border-radius: 2px; }
.timeline .tick.tall { top: 1px; bottom: 1px; width: 5px; margin-left: -2px; }
.timeline .period { position: absolute; top: 0; bottom: 0; border-left: 1px dashed var(--muted); }
.timeline .period span { position: absolute; left: 4px; bottom: 1px; font-size: 10px; color: var(--muted); white-space: nowrap; }
.timeline .head { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--ink); pointer-events: none; }
.timeline .offplay { position: absolute; top: 0; bottom: 0; background: repeating-linear-gradient(135deg, transparent 0 4px, color-mix(in srgb, var(--muted) 22%, transparent) 4px 6px); pointer-events: none; }
.timeline .period.end span { left: auto; right: 4px; }
.tltip { position: fixed; z-index: 60; pointer-events: none; padding: 4px 8px; border-radius: 6px; background: var(--ink); color: var(--surface); font-size: 12px; line-height: 1.35; white-space: nowrap; box-shadow: 0 2px 8px rgba(0,0,0,.25); }
.tltip span { display: block; opacity: .75; font-size: 11px; }
.tltip[hidden] { display: none; }
.timeline .brk { position: absolute; top: 0; bottom: 0; width: 4px; margin-left: -2px; background: repeating-linear-gradient(0deg, var(--muted) 0 3px, transparent 3px 6px); pointer-events: none; }
/* goals and shots above the timeline: G ours, C conceded, S our shot, O theirs (shots smaller, under the goals) */
.goalrow { position: relative; height: 20px; margin-top: 8px; }
.goalrow + .timeline { margin-top: 2px; }
.goalrow[hidden] + .timeline { margin-top: 10px; }
.goalmark { position: absolute; top: 1px; width: 18px; height: 18px; margin-left: -9px; padding: 0; border-radius: 50%; border: 2px solid var(--surface);
  font: 700 10px/14px var(--body); color: var(--bg); text-align: center; cursor: pointer; box-shadow: 0 1px 2px rgba(0,0,0,.25); }
.goalmark.g { background: var(--c-goal); }
.goalmark.c { background: var(--c-conceded); }
.goalmark.shotmark { top: 3px; width: 14px; height: 14px; margin-left: -7px; font-size: 8px; line-height: 10px; }
.goalmark.s { background: var(--c-shot); }
.goalmark.o { background: var(--c-oppshot); }
.goalmark:hover, .goalmark:focus-visible { transform: scale(1.2); z-index: 1; }

/* Keypad */
.keypad { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-top: 12px; }
.key {
  display: flex; align-items: center; gap: 10px; text-align: left;
  background: var(--surface); border: 1px solid var(--line); border-left: 5px solid var(--kc); border-radius: 6px; padding: 8px 10px;
}
.key:hover { background: var(--surface-2); }
.key kbd { font: 700 16px/1 var(--display); min-width: 26px; height: 26px; display: inline-grid; place-items: center; border-radius: 4px; background: var(--kc); color: var(--surface); }
.key span { font-weight: 600; line-height: 1.15; }
.key.flash { background: var(--surface-2); box-shadow: inset 0 0 0 2px var(--kc); }
.hint { margin: 10px 0 0; font-size: 13px; color: var(--muted); }
.hint kbd { font: 500 12px/1 var(--mono); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; padding: 2px 5px; background: var(--surface); color: var(--ink); }

/* Side panel */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.tabs { display: flex; border-bottom: 1px solid var(--line); }
.tabs button { flex: 1; border: 0; background: none; padding: 11px 8px; font: 600 16px/1 var(--display); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); border-bottom: 3px solid transparent; }
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }
.tabs .count { font: 500 12px/1 var(--mono); color: var(--muted); margin-left: 4px; }
.pane { padding: 12px 14px 16px; }
.sample-note { font-size: 13px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; margin-bottom: 12px; }

.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.filters select { flex: 1; min-width: 120px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-2); }
.evlist { list-style: none; margin: 0; padding: 0; overflow: auto; border-top: 1px solid var(--line); max-height: min(42vh, 520px); overscroll-behavior: contain; position: relative; }
.drawlist { margin: 6px 0; }
.drawlist ul { max-height: 160px; overflow: auto; }
/* On wide screens the side panel scrolls on its own, so the video stays in view while you use it. */
@media (min-width: 961px) {
  .panel { position: sticky; top: calc(12px + env(safe-area-inset-top, 0px)); max-height: calc(100vh - 24px); display: flex; flex-direction: column; }
  .pane { overflow-y: auto; min-height: 0; }
}
.evlist li { display: grid; grid-template-columns: 62px 1fr auto; gap: 8px; align-items: center; padding: 7px 2px; border-bottom: 1px solid var(--line); }
/* room on the right for the scrollbar: a Mac draws its scrollbar over the list, on the Edit and ✕ buttons */
.evlist { scrollbar-gutter: stable; }
.evlist li { padding-right: 14px; }
.evlist li.current { background: var(--surface-2); }
.evlist .t { font: 500 12px/1.2 var(--mono); color: var(--muted); background: none; border: 0; padding: 0; text-align: left; }
.evlist .t:hover { color: var(--accent); }
.evlist .what { min-width: 0; }
.evlist .ty { font-weight: 600; }                       /* flows as one line of text, wrapping like one */
.evlist .ty .dot { display: inline-block; vertical-align: 1px; margin-right: 6px; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--kc); flex: none; }
.evlist .who { color: var(--muted); font-size: 13px; }
.evlist .note { font-size: 13px; font-style: italic; }
.evlist .acts { display: flex; gap: 2px; }
.sugbox { display: flex; gap: 10px; align-items: center; justify-content: space-between; border: 1px solid var(--line); background: var(--surface-2); border-radius: 8px; padding: 8px 10px; margin-bottom: 10px; }
.sugbox .small { margin-top: 2px; }
.sugmark { color: var(--accent); font-size: 12px; line-height: 1; margin-left: 4px; cursor: help; }
.sugbox .sugdone { color: var(--accent); font-weight: 600; }
.sugbox { flex-wrap: wrap; }
.rvpick { display: flex; gap: 6px; align-items: center; flex: 1 1 240px; justify-content: flex-end; }
.rvpick select { flex: 1; min-width: 0; max-width: 260px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
details.acc { margin: -4px 0 10px; }
details.acc summary { cursor: pointer; }
details.acc table { font-size: 13px; margin-top: 6px; }
details.acc th, details.acc td { padding: 4px 5px; }
.iconbtn { border: 0; background: none; color: var(--muted); padding: 4px 6px; border-radius: 4px; font-size: 13px; }
.iconbtn:hover { color: var(--ink); background: var(--surface-2); }
.empty { color: var(--muted); padding: 16px 0; }
.listfoot { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 6px 0 8px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }

.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 14px; }
.tile { background: var(--surface-2); border-radius: 6px; padding: 8px 10px; }
.tile .v { font: 700 26px/1 var(--display); font-variant-numeric: tabular-nums; }
.tile .l { font-size: 12px; color: var(--muted); line-height: 1.2; margin-top: 3px; }
.tile[title] { cursor: help; }
.gamelist .more { cursor: help; border-bottom: 1px dotted var(--muted); }
.tablewrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 13px; font-variant-numeric: tabular-nums; }
th, td { padding: 5px 5px; text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { font: 600 12px/1.1 var(--body); color: var(--muted); letter-spacing: .03em; }
th:nth-child(2), td:nth-child(2) { text-align: left; }
th:first-child, td:first-child { text-align: left; font-family: var(--display); font-weight: 700; font-size: 14px; }
tbody tr:hover { background: var(--surface-2); }
td.bad { color: var(--c-miss); font-weight: 600; }
td.zero { color: var(--line); }
.legend { font-size: 12px; color: var(--muted); margin: 8px 0 0; }
h3 { font: 700 15px/1.1 var(--display); text-transform: uppercase; letter-spacing: .06em; margin: 16px 0 8px; color: var(--muted); }
h3:first-child { margin-top: 0; }
.bars { display: grid; gap: 6px; }
.bar { display: grid; grid-template-columns: 44px 1fr 96px; gap: 8px; align-items: center; font-size: 13px; }
.bar .track { height: 10px; background: var(--surface-2); border-radius: 5px; overflow: hidden; }
.bar .fill { height: 100%; background: var(--c-pass); border-radius: 5px; }
.bar.poss { grid-template-columns: 44px 1fr 130px; }
.calerr { font: 600 12px var(--mono); margin-left: 4px; }
.calerr.ok, .calwarn.ok { color: var(--accent); }
.calerr.warn, .calwarn.warn { color: var(--c-goal); }
.calerr.bad, .calwarn.bad { color: var(--c-miss); }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.bar .track.split { display: flex; height: 12px; border-radius: 6px; }
/* each team's share in its kit colour, outlined: a white kit on the light background (or a black one on the dark)
   still shows */
.bar .track.split > div { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ink) 35%, transparent); }
.bar .track.split > div:first-child { border-radius: 6px 0 0 6px; }
.bar .track.split > div:last-child { border-radius: 0 6px 6px 0; }

.form { display: grid; gap: 10px; }
.form label { display: grid; gap: 4px; font-size: 13px; font-weight: 600; color: var(--muted); }
.form input[type=text], .form input[type=date], .form input[type=number], .form textarea, .form select {
  width: 100%; padding: 7px 9px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-2); font-weight: 400; color: var(--ink);
}
.form textarea { min-height: 150px; font-family: var(--mono); font-size: 13px; resize: vertical; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.check { display: flex !important; grid-template-columns: none; align-items: center; gap: 8px; color: var(--ink) !important; font-weight: 500 !important; }
.btnrow { display: flex; gap: 8px; flex-wrap: wrap; }
.periods { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 13px; }
.periods li { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.confirm { background: var(--surface-2); border: 1px solid var(--c-miss); border-radius: 6px; padding: 10px; font-size: 13px; display: grid; gap: 8px; }
.exportbox { width: 100%; min-height: 110px; font: 12px/1.4 var(--mono); padding: 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-2); color: var(--ink); }
.small { font-size: 13px; color: var(--muted); }

.found { max-width: 1400px; margin: 0 auto 12px; display: flex; align-items: center; justify-content: space-between; gap: 8px 12px; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--accent); border-radius: 8px; padding: 8px 12px; font-size: 14px; }
.ovl { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.ovl.active { pointer-events: auto; cursor: crosshair; }
/* the mini map: a see-through 2D map in the video's top right corner, sized from its bottom left corner */
.minimap { position: absolute; top: 10px; right: 10px; border-radius: 6px; overflow: hidden; box-shadow: 0 0 0 1px rgba(255,255,255,.35), 0 2px 8px rgba(0,0,0,.35); }
.minimap canvas { display: block; width: 100%; }
.minix { position: absolute; top: 2px; right: 2px; width: 22px; height: 22px; padding: 0; border: 0; border-radius: 4px; background: rgba(0,0,0,.35);
  color: #fff; font-size: 16px; line-height: 22px; cursor: pointer; opacity: 0; transition: opacity .15s; }
.minigrip { position: absolute; left: 0; bottom: 0; width: 16px; height: 16px; cursor: nesw-resize; touch-action: none;
  background: linear-gradient(45deg, transparent 0 50%, rgba(255,255,255,.75) 50% 58%, transparent 58% 70%, rgba(255,255,255,.75) 70% 78%, transparent 78%);
  transform: scaleX(-1); opacity: .6; }
.minimap:hover .minix, .minimap:hover .minigrip, .minix:focus-visible, .minigrip:focus-visible { opacity: 1; }
.pickbar { position: absolute; top: 10px; left: 10px; right: 10px; display: flex; justify-content: space-between; align-items: center; gap: 8px; background: rgba(8,12,10,.85); color: #fff; padding: 6px 10px; border-radius: 6px; font-size: 14px; }
.pickbar .btn { background: transparent; color: #fff; border-color: rgba(255,255,255,.4); }
.lochint { margin-top: 8px; font-size: 13px; color: var(--muted); }
.lochint.set { color: var(--accent); font-weight: 600; }
.mapbox { position: relative; }
.mapbox canvas { width: 100%; display: block; border-radius: 6px; }
.maptip { position: absolute; pointer-events: none; background: rgba(8,12,10,.88); color: #fff; font-size: 13px; padding: 4px 8px; border-radius: 5px; white-space: nowrap; transform: translate(-50%, calc(-100% - 12px)); }
.maptip small { color: #bbb; font-size: 11px; margin-left: 6px; }
.maplegend { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; color: var(--muted); margin-top: 6px; }
.maplegend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 5px; vertical-align: -1px; border: 1px solid rgba(0,0,0,.4); }
.maplegend i.view { border-radius: 2px; background: #6d9a78; }
.lmsvg { width: 100%; display: block; margin: 4px 0; }
.lmsvg .lmpitch { fill: #2d6a3e; stroke: #fff; stroke-width: .35; }
.lmsvg .lmline { stroke: #fff; stroke-width: .25; opacity: .8; }
.lmsvg .lmcam { fill: var(--muted); font-size: 2.2px; font-family: var(--body); }
.lmsvg .lm { cursor: pointer; }
.lmsvg .lm circle { fill: #fff; stroke: #000; stroke-width: .3; }
.lmsvg .lm.done circle { fill: #ff3cd2; }
.lmsvg .lm.active circle { fill: #ffd400; stroke-width: .6; }
.lmsvg .lm:hover circle, .lmsvg .lm:focus circle { stroke: #ffd400; stroke-width: .7; outline: none; }
.teamrows { display: grid; gap: 8px; }
.teamrow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.teamrow .tname { font-weight: 600; min-width: 8ch; }
.teamrow .namebtns { flex-basis: 100%; margin-bottom: 6px; }                  /* the naming buttons side by side, on a line of their own */
.swatches { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
.grows { display: grid; gap: 10px; margin-top: 6px; }
.grow { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.grow .strip { height: 48px; max-width: 100%; border-radius: 4px; background-image: var(--gsprite); background-repeat: no-repeat; flex: 0 1 auto; }
.grow .gbtns { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; width: 100%; max-width: 420px; }
.grow .gbtns .btn { display: block; text-align: center; padding-left: 4px; padding-right: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.swatch { width: 24px; height: 24px; border-radius: 4px; border: 1px solid var(--line); padding: 0; }
.swatch:hover { outline: 2px solid var(--c-miss); }
.progress { height: 8px; background: var(--surface-2); border-radius: 4px; overflow: hidden; }
.form + .progress, .form + .btnrow { margin-top: 14px; }   /* clear of the options above them */
.progress > div { height: 100%; background: var(--accent); }
.small.bad { color: var(--c-miss); font-weight: 600; }
.toast { position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--ink); color: var(--surface); padding: 8px 14px; border-radius: 6px; font-size: 14px; box-shadow: 0 6px 20px rgba(0,0,0,.25); max-width: calc(100% - 32px); z-index: 10; }
@media (prefers-reduced-motion: no-preference) { .toast { transition: opacity .2s; } }
#rvWho { font: inherit; font-weight: 600; padding: 1px 4px; border-radius: 4px; }   /* who shot, in the review's sentence */

/* the Join & split trails tool (trailfix.js): a full page over the app */
.tfx { --tfx-a: #b38f00; --tfx-b: #0b8db3; position: fixed; inset: 0; z-index: 70; background: var(--bg); color: var(--ink); display: flex; flex-direction: column; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tfx { --tfx-a: #ffd400; --tfx-b: #3cd2ff; } }
:root[data-theme="dark"] .tfx { --tfx-a: #ffd400; --tfx-b: #3cd2ff; }
.tfxhead { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 16px; border-bottom: 1px solid var(--line); background: var(--surface); }
.tfxhead h2 { margin: 0; font: 700 22px/1.1 var(--display); letter-spacing: .02em; }
.tfxopts select { max-width: 13em; }
.tfxopts { margin-left: auto; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tfxbody { flex: 1; min-height: 0; display: grid; grid-template-columns: 340px minmax(0, 1fr); }
.tfxlist { overflow: auto; border-right: 1px solid var(--line); padding: 8px; display: flex; flex-direction: column; gap: 6px; background: var(--surface-2); }
.tfxitem { display: grid; gap: 3px; text-align: left; font: inherit; color: inherit; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; cursor: pointer; }
.tfxitem:hover { border-color: var(--muted); }
.tfxitem.on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.tfxitem.skipped { opacity: .6; }
.tfxkind { font: 700 12px/1 var(--display); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.tfxkind.join { color: var(--c-pass); } .tfxkind.meet { color: var(--c-turnover); }
.tfxwho { font-size: 14px; }
.tfxu { height: 4px; border-radius: 2px; background: var(--line); overflow: hidden; }
.tfxu i { display: block; height: 100%; background: var(--c-turnover); }
.tfxmain { min-height: 0; display: flex; flex-direction: column; gap: 8px; padding: 12px 16px; overflow: auto; }
.tfxq p { margin: 0 0 4px; }
.tfxview { flex: 1; min-height: 240px; background: #000; border-radius: 8px; overflow: hidden; }
.tfxview canvas { width: 100%; height: 100%; display: block; }
.tfxctl { display: flex; align-items: center; gap: 8px; }
.tfxscrub { position: relative; flex: 1; display: flex; align-items: center; }
.tfxscrub input { width: 100%; }
.tfxmarks { position: absolute; left: 0; right: 0; top: 50%; height: 0; pointer-events: none; }
.tfxmarks i { position: absolute; top: -9px; height: 18px; width: 3px; border-radius: 2px; }
.tfxmarks .ma { background: var(--tfx-a); } .tfxmarks .mb { background: var(--tfx-b); }
.tfxmarks .mm { background: var(--c-turnover); opacity: .45; min-width: 3px; }
.tfxcut { margin-top: 6px; align-items: center; }
.tfx kbd { font: 600 11px/1 var(--mono); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; padding: 1px 4px; background: var(--surface-2); color: var(--ink); }
.tfx .muted { color: var(--muted); }
@media (max-width: 760px) {
  .tfxbody { display: flex; flex-direction: column; overflow: auto; }
  .tfxlist { max-height: 30vh; border-right: 0; border-bottom: 1px solid var(--line); }
  .tfxview { min-height: 200px; flex: none; aspect-ratio: 16 / 9; }
}
body.sheet-open .toast { z-index: 90; }

/* the match's stats on the Highlights & Reports tab, under the shot map */
.hlmatchstats { margin: 12px 0 16px; }
.hlmatchstats h5 { margin: 0 0 8px; }
.hlmatchstats .tiles { margin-bottom: 10px; }
.hlmatchstats table.hlstats td, .hlmatchstats table.hlstats th { padding: 4px 8px; }

/* a trail at a glance (trailsheet.js): pictures spread over the trail, in the trail tool and Who is this? */
.tsheet { display: grid; gap: 4px; }
.tshead { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; font-size: 14px; }
.tsrow { position: relative; display: flex; align-items: flex-start; }
.tstile { margin: 0; flex: 1 1 0; min-width: 0; max-width: var(--ts-w, 72px); display: grid; gap: 2px; cursor: zoom-in; }
.tstile canvas { width: 100%; aspect-ratio: 3 / 4; height: auto; display: block; border-radius: 4px; background: #111; }
.tstile figcaption, .tsbigview figcaption { font-size: 11px; color: var(--muted); text-align: center; }
.tsbigview { position: absolute; top: 0; z-index: 2; margin: 0; width: min(240px, 100%); padding: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 6px 20px rgba(0,0,0,.3); cursor: zoom-out; }
.tsbigview canvas { width: 100%; height: auto; display: block; border-radius: 4px; }
.tsgap { flex: 0 0 14px; align-self: stretch; margin: 0 1px 16px; padding: 0; border: 0; border-radius: 4px; background: transparent; color: var(--muted); font: 600 13px/1 var(--mono); cursor: pointer; }
.tsgap:hover, .tsgap:focus-visible { background: var(--surface-2); color: var(--ink); }
.tsgap.cut { color: var(--c-turnover); }
.tsgap.cut:hover, .tsgap.cut:focus-visible { background: var(--c-turnover); color: #fff; }
.tsgap.none { cursor: default; }
.tfxsheets { display: grid; gap: 10px; --ts-w: 70px; }
#namer .tsheet { margin: 8px 0 4px; --ts-w: 62px; }
.tfxname { border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 8px; padding: 8px 10px; background: var(--surface); display: grid; gap: 8px; }
.tfxname p { margin: 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tfxname .numbox { min-width: 2.2em; padding: 2px 8px; font-size: 18px; }
.tshead .btn.small { padding: 2px 8px; }

/* A team's parent (online): the games to watch and read, nothing to change (core.js viewOnly) */
.viewonly #keypad, .viewonly .hint, .viewonly #bKick, .viewonly #bFinish, .viewonly #bDraw, .viewonly #askBtn, .viewonly #procStatus,
.viewonly #tab-setup, .viewonly [data-trclear], .viewonly .evlist .acts, .viewonly [data-ddel], .viewonly [data-dedit], .viewonly #addMatch { display: none !important; }
