/* StatPlay Code: the coding suite. A dark workspace by default, so the video is the brightest thing on
   screen, with a light version for bright rooms. */
:root {
  color-scheme: light;
  --bg: #eef0f2;
  --surface-1: #ffffff;
  --surface-2: #f3f4f6;
  --surface-3: #e6e8eb;
  --border: #d6d9de;
  --text-primary: #0f1b2d;
  --text-secondary: #46505e;
  --text-muted: #6a7380;
  --brand: #0f1b2d;
  --accent: #1e846c;
  --accent-strong: #166653;
  --on-accent: #ffffff;
  --live: #d03b3b;
  --focus: #1e846c;
  --team-us: #1e846c;
  --team-opp: #6b7a8f;
  --neutral-code: #c08a1e;
  --on-code: #ffffff;
  --half-shade: rgb(30 132 108 / .06);
  --playhead: #d03b3b;
  --corner: 6px;
  --body-font: "Barlow", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --data-font: "Barlow Condensed", "Barlow", system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0b1320;
    --surface-1: #121c2b;
    --surface-2: #182435;
    --surface-3: #22304390;
    --border: #2a3a50;
    --text-primary: #eef2f6;
    --text-secondary: #b8c2cf;
    --text-muted: #8794a5;
    --accent: #2bd9a0;
    --accent-strong: #25b389;
    --on-accent: #08251c;
    --focus: #2bd9a0;
    --team-us: #25b389;
    --team-opp: #7d8ca3;
    --neutral-code: #d9a23a;
    --on-code: #08131f;
    --half-shade: rgb(43 217 160 / .05);
    --playhead: #ff5a5a;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b1320;
  --surface-1: #121c2b;
  --surface-2: #182435;
  --surface-3: #22304390;
  --border: #2a3a50;
  --text-primary: #eef2f6;
  --text-secondary: #b8c2cf;
  --text-muted: #8794a5;
  --accent: #2bd9a0;
  --accent-strong: #25b389;
  --on-accent: #08251c;
  --focus: #2bd9a0;
  --team-us: #25b389;
  --team-opp: #7d8ca3;
  --neutral-code: #d9a23a;
  --on-code: #08131f;
  --half-shade: rgb(43 217 160 / .05);
  --playhead: #ff5a5a;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--text-primary); font-family: var(--body-font); font-size: 15px;
  display: flex; flex-direction: column; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.muted, .hint { color: var(--text-muted); }
.hint { font-size: 13px; margin: 0; }
a { color: inherit; }

.mark { display: inline-block; width: 28px; height: 28px; flex: none; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Crect width='100' height='100' rx='23' fill='%230F1B2D'/%3E%3Crect x='18.25' y='57.25' width='11' height='22' rx='3.5' fill='%231E846C'/%3E%3Crect x='34.25' y='43.25' width='11' height='36' rx='3.5' fill='%2325B389'/%3E%3Cpath d='M52.25 23.25 L79.25 50 L52.25 76.75 Z' fill='%232BD9A0' stroke='%232BD9A0' stroke-width='5' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat; }
.mark.big { width: 72px; height: 72px; }

.loading-screen { display: none; }
body.booting .loading-screen { display: grid; justify-items: center; align-content: center; gap: 10px; flex: 1; }
body.booting .loading-screen p { margin: 0; }
body.booting > :not(.loading-screen):not(dialog):not(script) { display: none !important; }

/* Buttons and fields */
.btn { font: inherit; font-size: 14px; font-weight: 600; padding: 6px 12px; border-radius: var(--corner); cursor: pointer;
  background: var(--surface-2); color: var(--text-primary); border: 1px solid var(--border); white-space: nowrap; }
.btn:hover { background: var(--surface-3); }
.btn.primary { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.btn.primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
.btn.small { font-size: 13px; padding: 3px 9px; }
.btn.icon { width: 36px; padding: 6px 0; text-align: center; }
.btn:disabled { opacity: .45; cursor: default; }
.btn[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
input, select { font: inherit; color: var(--text-primary); }
label input, label select, .dlg-body select, .dlg-body input[type=file] { width: 100%; padding: 7px 9px; border: 1px solid var(--border);
  border-radius: var(--corner); background: var(--surface-2); font-size: 14px; }

/* Top bar */
.bar { display: flex; align-items: center; gap: 12px; padding: 8px 16px; background: var(--surface-1); border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; font-size: 17px; white-space: nowrap; }
.brand b { color: var(--accent); }
.pick { display: flex; align-items: center; gap: 6px; min-width: 0; }
.pick-label { font-family: var(--data-font); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); }
.pick select { padding: 6px 8px; border: 1px solid var(--border); border-radius: var(--corner); background: var(--surface-2); max-width: 340px; font-size: 14px; }
.spacer { flex: 1; }
.status { font-size: 13px; color: var(--text-muted); }
.menu-wrap { position: relative; }
.menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; display: grid; min-width: 200px; padding: 4px;
  background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--corner); box-shadow: 0 10px 28px rgb(0 0 0 / .25); }
.menu[hidden] { display: none; }
.menu-item { border: 0; background: none; color: inherit; font: inherit; text-align: left; padding: 8px 12px; border-radius: var(--corner);
  cursor: pointer; text-decoration: none; }
.menu-item:hover, .menu-item:focus-visible { background: var(--surface-2); outline: none; }

/* Sign in and messages */
.gate { flex: 1; display: grid; place-items: start center; padding: 48px 16px; }
.gate .card { width: min(440px, 100%); display: grid; gap: 12px; padding: 24px; background: var(--surface-1); border: 1px solid var(--border); border-radius: 12px; }
.gate h2 { margin: 0; font-size: 22px; }
.gate-brand { display: flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 700; }
.gate-brand b { color: var(--accent); }
.auth-form { display: grid; gap: 10px; }
.auth-form label { display: grid; gap: 4px; font-size: 13px; color: var(--text-secondary); }
.auth-form .btn { justify-self: start; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: var(--corner); overflow: hidden; justify-self: start; }
.seg button { border: 0; background: none; color: inherit; font: inherit; font-size: 14px; padding: 6px 12px; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }

/* Workspace */
.workspace { flex: 1; min-height: 0; display: grid; gap: 8px; padding: 8px;
  /* The code window runs the full height on the right; the timeline sits under the video, the same width. */
  grid-template-columns: minmax(0, 1.8fr) minmax(360px, 1fr); grid-template-rows: minmax(0, 1fr) minmax(220px, 40vh);
  grid-template-areas: "video window" "timeline window"; }
.video-pane { grid-area: video; }
.cw-pane { grid-area: window; display: flex; flex-direction: column; overflow: hidden; }
.tl-pane { grid-area: timeline; display: flex; flex-direction: column; overflow: hidden; }
.pane { background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--corner); min-width: 0; min-height: 0; }
.video-pane { display: flex; flex-direction: column; }
.video-box { position: relative; flex: 1; min-height: 160px; background: #000; border-radius: var(--corner) var(--corner) 0 0; display: grid; place-items: center; overflow: hidden; }
.video-box video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; display: block; }
.video-box video:not([src]) { display: none; }
.video-empty { color: #b8c2cf; margin: 0; padding: 24px; text-align: center; }
.transport { display: flex; align-items: center; gap: 10px; padding: 8px 10px; flex-wrap: wrap; border-top: 1px solid var(--border); }
.clock { font-family: var(--data-font); font-size: 16px; font-variant-numeric: tabular-nums; min-width: 120px; }
#scrub { flex: 1 1 200px; accent-color: var(--accent); }
.speed { padding: 5px 6px; border: 1px solid var(--border); border-radius: var(--corner); background: var(--surface-2); }
.angles { display: flex; gap: 4px; flex-wrap: wrap; }
.upload-bar { display: grid; gap: 6px; padding: 8px 10px; border-top: 1px solid var(--border); font-size: 13px; }
.upload-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; align-items: center; }
.progress { grid-column: 1 / -1; height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.progress i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .3s; }

/* Dialogs */
dialog { border: 1px solid var(--border); border-radius: 12px; padding: 0; background: var(--surface-1); color: var(--text-primary); width: min(560px, calc(100vw - 32px)); }
dialog::backdrop { background: rgb(0 0 0 / .5); }
.dlg-body { display: grid; gap: 12px; padding: 20px; }
.dlg-body h2 { margin: 0; font-size: 20px; }
.dlg-body label { display: grid; gap: 4px; font-size: 13px; color: var(--text-secondary); }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.angles-pick { border: 1px solid var(--border); border-radius: var(--corner); padding: 10px; display: grid; gap: 8px; margin: 0; }
.angles-pick legend { font-size: 13px; color: var(--text-secondary); padding: 0 4px; }
.angle-file { display: grid; grid-template-columns: 90px minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.angle-file input[type=text] { padding: 6px 8px; border: 1px solid var(--border); border-radius: var(--corner); background: var(--surface-2); width: 100%; }
.dlg-actions { display: flex; justify-content: flex-end; gap: 8px; }
.warn { font-size: 13px; background: color-mix(in srgb, var(--live) 16%, var(--surface-1)); border-radius: var(--corner); padding: 8px 10px; margin: 0; }
.keys { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; font-size: 14px; }
.keys dt { font-family: var(--data-font); font-weight: 600; }
.keys dd { margin: 0; color: var(--text-secondary); }
kbd { font-family: var(--data-font); font-size: 13px; padding: 1px 6px; border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 4px; background: var(--surface-2); }

@media (max-width: 640px) {
  .bar { gap: 8px; padding: 8px 12px; }
  .pick select { max-width: 100%; }
  .pick { flex: 1 1 100%; }
  .workspace { padding: 6px; }
  .angle-file { grid-template-columns: 1fr; }
}

/* Halves */
.halves { display: flex; gap: 4px; flex-wrap: wrap; }
.halves .btn.marked { border-color: var(--accent); }

/* Panes */
.pane-head { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.pane-head select, .pane-head input { padding: 4px 8px; border: 1px solid var(--border); border-radius: var(--corner); background: var(--surface-2); font-size: 14px; min-width: 0; }
.pane-head select { flex: 1; }
.edit-only { display: none !important; }
.cw-pane.editing .edit-only { display: flex !important; }
.cw-pane.editing p.edit-only { display: block !important; padding: 0 8px; }
.cw-pane.editing #cw-edit, .cw-pane.editing #cw-select { display: none; }
.cw-pane.editing .pane-head input { flex: 1; }
.edit-tools { gap: 6px; padding: 6px 8px; flex-wrap: wrap; align-items: center; }
.notice { margin: 8px 8px 0; padding: 8px 10px; font-size: 13px; background: var(--surface-2); border-radius: var(--corner); color: var(--text-secondary); }

/* Code window */
.cw-board { flex: 1; overflow: auto; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 6px; padding: 8px; align-content: start; }
.cw-btn { position: relative; display: flex; align-items: center; justify-content: center; gap: 6px; min-width: 0; padding: 4px 8px; border-radius: var(--corner);
  font: inherit; font-size: 14px; font-weight: 600; line-height: 1.15; cursor: pointer; user-select: none; touch-action: manipulation;
  border: 2px solid var(--btn, var(--border)); background: color-mix(in srgb, var(--btn, var(--surface-2)) 16%, var(--surface-1)); color: var(--text-primary); }
.cw-btn:hover { background: color-mix(in srgb, var(--btn, var(--surface-2)) 28%, var(--surface-1)); }
.cw-btn:active { transform: translateY(1px); }
.cw-btn.label { border-style: dashed; font-weight: 500; }
.cw-btn.on { background: var(--btn); color: var(--on-code); box-shadow: 0 0 0 3px color-mix(in srgb, var(--btn) 35%, transparent); }
.cw-btn.flash { animation: flash .4s ease-out; }
@keyframes flash { from { background: var(--btn, var(--accent)); color: var(--on-code); } }
@media (prefers-reduced-motion: reduce) { .cw-btn.flash { animation: none; } }
.cw-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cw-btn kbd { position: absolute; top: 2px; right: 3px; font-size: 10px; padding: 0 3px; opacity: .8; border-bottom-width: 1px; background: transparent; color: inherit; border-color: currentColor; }
.cw-time { font-family: var(--data-font); font-size: 13px; font-variant-numeric: tabular-nums; }
.cw-text { align-self: end; font-family: var(--data-font); font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); padding: 0 2px 2px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.cw-board.locked .cw-btn { opacity: .5; cursor: not-allowed; }
.cw-pane.editing .cw-board { background-image: linear-gradient(to right, var(--surface-2) 1px, transparent 1px); background-size: calc((100% - 16px) / 12) 100%; background-position: 8px 0; }
.cw-pane.editing [data-edit] { cursor: move; outline: 1px dashed var(--text-muted); outline-offset: 1px; }
.cw-resize { position: absolute; right: 0; bottom: 0; width: 12px; height: 12px; cursor: nwse-resize; background: linear-gradient(135deg, transparent 50%, var(--text-muted) 50%); border-bottom-right-radius: var(--corner); }

/* Timeline */
.tl-body { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 250px; }
.tl-wrap { position: relative; min-width: 0; min-height: 0; overflow: hidden; }
#tl-canvas { position: absolute; inset: 0; display: block; touch-action: none; }
.selected { border-left: 1px solid var(--border); padding: 10px; overflow: auto; display: grid; gap: 8px; align-content: start; font-size: 14px; }
.sel-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.sel-times { display: grid; gap: 4px; }
.sel-times label { display: flex; justify-content: space-between; align-items: center; color: var(--text-secondary); font-size: 13px; }
.nudge { display: inline-flex; align-items: center; gap: 6px; }
.nudge b { font-family: var(--data-font); font-size: 15px; font-variant-numeric: tabular-nums; color: var(--text-primary); min-width: 52px; text-align: center; }
.sel-labels { display: flex; flex-wrap: wrap; gap: 4px; }
.chip { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; padding: 2px 4px 2px 8px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); }
.chip button { border: 0; background: none; color: var(--text-muted); cursor: pointer; font-size: 14px; padding: 0 4px; }
.sel-add { display: grid; grid-template-columns: 1fr 1fr auto; gap: 4px; }
.sel-add input { min-width: 0; padding: 4px 6px; border: 1px solid var(--border); border-radius: var(--corner); background: var(--surface-2); font-size: 13px; }

/* Button settings */
#btn-dlg { width: min(620px, calc(100vw - 32px)); }
#btn-dlg .fields { display: grid; gap: 10px; max-height: 64vh; overflow: auto; padding-right: 4px; }
#btn-dlg details { border: 1px solid var(--border); border-radius: var(--corner); padding: 6px 10px; }
#btn-dlg summary { cursor: pointer; font-size: 14px; }
.link-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 2px 10px; margin-top: 6px; }
label.check { display: flex !important; flex-direction: row; align-items: center; gap: 6px; font-size: 13px; color: var(--text-primary); }
label.check input { width: auto; }
.color-pick { display: flex; gap: 10px; align-items: center; }
.color-pick input[type=color] { width: 44px; height: 32px; padding: 2px; }
.dlg-actions .spacer { flex: 1; }

@media (max-width: 1000px) {
  .workspace { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; grid-auto-rows: max-content; grid-template-areas: "video" "window" "timeline"; overflow: auto; }
  .workspace > .pane { min-height: auto; }
  .video-box { aspect-ratio: 16 / 9; flex: none; }
  .cw-pane { min-height: 320px; }
  .tl-pane { height: 360px; }
  .tl-body { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; }
  .selected { border-left: 0; border-top: 1px solid var(--border); max-height: 180px; }
}
.keys .keys-title { grid-column: 1 / -1; margin-top: 8px; font-family: var(--data-font); text-transform: uppercase; letter-spacing: .06em; font-size: 12px; color: var(--text-muted); }
#keys-dlg .keys { max-height: 60vh; overflow: auto; }

/* A row's clips */
.clips-actions { display: flex; gap: 6px; }
.clip-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.clip { width: 100%; display: grid; grid-template-columns: 26px 1fr auto; gap: 2px 8px; align-items: center; text-align: left; padding: 6px 8px;
  border: 1px solid transparent; border-radius: var(--corner); background: none; color: inherit; font: inherit; font-size: 13px; cursor: pointer; }
.clip:hover { background: var(--surface-2); }
.clip.playing { border-color: var(--playhead); background: var(--surface-2); }
.clip-n { color: var(--text-muted); font-family: var(--data-font); }
.clip-when { font-family: var(--data-font); font-size: 14px; font-weight: 600; }
.clip-len { color: var(--text-muted); font-size: 12px; }
.clip-labels { grid-column: 2 / -1; color: var(--text-secondary); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link-btn { justify-self: start; border: 0; background: none; color: var(--accent); font: inherit; font-size: 13px; padding: 0; cursor: pointer; }

.script-fields { display: grid; gap: 8px; margin-top: 8px; }
#btn-dlg textarea { width: 100%; font: 13px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; padding: 8px; border: 1px solid var(--border);
  border-radius: var(--corner); background: var(--surface-2); color: var(--text-primary); resize: vertical; }

/* Drawing */
.draw-overlay { position: absolute; pointer-events: none; z-index: 2; }
.video-box.drawing .draw-overlay { pointer-events: auto; cursor: crosshair; touch-action: none; }
.video-box.drawing { outline: 2px solid var(--accent); outline-offset: -2px; }
.draw-bar { display: grid; gap: 6px; padding: 8px 10px; border-top: 1px solid var(--border); background: var(--surface-2); }
.draw-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.draw-row .inline { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-secondary); }
.draw-row .grow { flex: 1; min-width: 200px; }
.draw-row select { padding: 4px 6px; border: 1px solid var(--border); border-radius: var(--corner); background: var(--surface-1); font-size: 13px; min-width: 0; }
.draw-row .grow select { flex: 1; }
.swatches { display: inline-flex; gap: 4px; }
.swatch { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--border); background: var(--c); cursor: pointer; padding: 0; }
.swatch[aria-pressed="true"] { border-color: var(--text-primary); box-shadow: 0 0 0 2px var(--surface-2), 0 0 0 4px var(--text-primary); }
.draw-text { position: absolute; z-index: 3; font: 700 18px var(--body-font); background: rgb(0 0 0 / .65); border: 1px dashed currentColor; padding: 2px 6px; border-radius: 4px; min-width: 160px; }
.sel-drawings { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; font-size: 12px; }

/* Live */
.source-pick { margin-top: 2px; }
.live-pick { border: 1px solid var(--border); border-radius: var(--corner); padding: 10px; display: grid; gap: 8px; margin: 0; }
.live-pick legend { font-size: 13px; color: var(--text-secondary); padding: 0 4px; }
#cam-preview { width: 100%; max-height: 200px; background: #000; border-radius: var(--corner); object-fit: contain; }
.live-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 8px 10px; border-top: 1px solid var(--border); font-size: 13px;
  background: color-mix(in srgb, var(--live) 10%, var(--surface-1)); }
.live-bar b { color: var(--live); letter-spacing: .06em; }
.live-clock { font-family: var(--data-font); font-size: 16px; font-variant-numeric: tabular-nums; }
.live-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--live); animation: live-pulse 1.4s ease-in-out infinite; }
.live-dot.off { animation: none; background: var(--text-muted); }
@keyframes live-pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .live-dot { animation: none; } }
.live-bar { gap: 10px; }
.live-cam { width: 96px; height: 54px; background: #000; border-radius: 4px; object-fit: cover; flex: none; }
.live-info { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.sync { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px; }
.sync-text { color: var(--text-secondary); }

/* Field position */
.pitch-panel { padding: 6px 8px 4px; border-bottom: 1px solid var(--border); }
.pitch-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13px; margin-bottom: 4px; }
.pitch-head .seg button { font-size: 12px; padding: 3px 9px; }
.pitch-hint { color: var(--text-muted); font-size: 12px; }
.pitch-svg { display: block; width: 100%; max-height: 190px; cursor: crosshair; color: rgb(255 255 255 / .7); border-radius: var(--corner); }
.pitch-grass { fill: #2f6b3a; }
.pitch-zone { fill: transparent; stroke: rgb(255 255 255 / .25); stroke-width: .3; }
.pitch-zone:hover { fill: rgb(255 255 255 / .12); }
.pitch-end { fill: rgb(255 255 255 / .75); font: 600 3px var(--data-font); }
.pitch-now { stroke: #fff; stroke-width: .6; }
.pitch-panel.asking .pitch-svg { outline: 3px solid var(--accent); outline-offset: 2px; }
.pitch-panel.asking .pitch-hint { color: var(--accent); font-weight: 600; }

/* Shared coding links */
.share-form { display: flex; gap: 8px; }
.share-form input { flex: 1; padding: 7px 9px; border: 1px solid var(--border); border-radius: var(--corner); background: var(--surface-2); }
.share-list { display: grid; gap: 6px; }
.share-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--corner); }
.share-row small { display: block; color: var(--text-muted); font-size: 12px; }

/* The helper's page: the code window, big */
.link-page .link-main { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 8px; padding: 8px; min-height: 0; }
.link-page .cw-board { background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--corner); grid-auto-rows: 56px; }
.link-page .cw-btn { font-size: 16px; }
.link-start { grid-column: 1 / -1; display: flex; gap: 12px; align-items: center; padding: 12px; background: var(--surface-1); border: 1px solid var(--accent); border-radius: var(--corner); }
.link-start p { margin: 0; flex: 1; }
.link-recent { background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--corner); overflow: auto; }
.link-recent ol { margin: 0; padding: 8px 12px 8px 28px; display: grid; gap: 4px; font-size: 14px; }
.link-clock { font-family: var(--data-font); font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.link-game { color: var(--text-secondary); font-size: 14px; }
@media (max-width: 800px) { .link-page .link-main { grid-template-columns: minmax(0, 1fr); } }

/* StatPlay Review: playlists */
.pl-actions, .pl-add { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px 8px; align-items: center; }
.pl-add { border-bottom: 1px solid var(--border); }
.pl-clips { flex: 1; overflow: auto; padding: 6px 8px; }
.pl-clips li { display: flex; align-items: center; gap: 4px; }
.pl-clips li .clip { flex: 1; }
.pl-clips li.playing .clip { border-color: var(--playhead); background: var(--surface-2); }
.pl-move { display: flex; gap: 2px; }

/* StatPlay Review: the timeline runs the full width under the video and the playlists. */
body.review .workspace { grid-template-areas: "video window" "timeline timeline"; }
@media (max-width: 1000px) { body.review .workspace { grid-template-areas: "video" "window" "timeline"; } }
.pl-clip { flex: 1; min-width: 0; }
.pl-note-text { margin: 2px 0 4px 34px; font-size: 13px; color: var(--text-muted); white-space: pre-wrap; }
.pl-note { position: absolute; left: 12px; right: 12px; bottom: 12px; margin: 0; padding: 8px 12px; border-radius: 6px;
  background: rgba(0, 0, 0, .72); color: #fff; font-size: 15px; white-space: pre-wrap; pointer-events: none; }
#pl-share { max-width: 230px; }
