/* The live session screen: header, player panels or team cards, the court,
   the actions, play-by-play and footer. The court and its on-court selectors
   are in live-court.css. Geometry depends only on the space the screen gets:
   nothing the coach opens (selectors, history) changes a region's size, and
   nothing on the screen wraps or overflows its box (one line with an ellipsis,
   the full text in a title). The court is sized from the width and height it
   can have and keeps its proportions; the side columns are equal, so the court
   sits on the screen's centre line, and the player panels are exactly the
   court's height. Designed for a landscape iPad (1180 x 820 baseline, 1024 x
   768 compact) and wider screens. */
.tracker-v2.lv-root {
  --lv-red: var(--team-red, var(--brand-ink));
  --lv-blue: var(--team-blue, var(--defense));
  --lv-us: var(--lv-red);
  --lv-opp: var(--lv-blue);
  --brand: var(--match-accent, var(--lv-us));
  --accent: var(--match-accent, var(--lv-us));
  /* Sizes (Session_Live_UI LIVE-63..75). */
  /* The header is the title bar over the scoreboard (or the practice row). */
  --lv-bar-h: 52px;
  --lv-board-h: 84px;
  --lv-head-h: calc(var(--lv-bar-h) + var(--lv-board-h) + 1px);
  --lv-foot-h: 68px;
  --lv-pad: 12px;
  --lv-gap: 12px;
  --lv-side: clamp(220px, 18.6vw, 260px);
  --lv-dock-h: 52px;
  --lv-card-h: 64px;
  --lv-card-gap: 6px;
  --lv-bench-h: 108px;
  --lv-target: 44px;
  container-type: size;
  display: grid;
  grid-template-rows: var(--lv-head-h) minmax(0, 1fr) var(--lv-foot-h);
  height: 100%;
  max-height: 100dvh;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  box-sizing: border-box;
  background: var(--sunken);
  color: var(--ink);
}
.tracker-v2.lv-root[data-layout="practice"] { --lv-board-h: 80px; }
.lv-root button { font: inherit; color: inherit; }
.lv-root button:disabled { opacity: 0.4; cursor: default; }
.lv-root button:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.lv-root :where(strong, span, small, b, p, h3, label, button) { min-width: 0; }
.lv-muted { margin: 0; color: var(--ink-muted); font-size: 12px; line-height: 1.35; }
.lv-root kbd { flex: none; font: 600 10px/1 var(--font-mono); padding: 2px 4px; border: 1px solid var(--line-strong); border-radius: 4px; background: color-mix(in srgb, var(--ink) 8%, transparent); color: var(--ink-muted); }
.lv-sr, .lv-root .lv-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* One line, ellipsis. */
.lv-title, .lv-eyebrow, .lv-instruction strong, .lv-instruction span, .lv-team small, .lv-context > span, .lv-owner, .lv-status, .lv-count,
.lv-tile span, .lv-action-label, .lv-action small, .lv-custom-btn span, .lv-play strong, .lv-play small, .lv-rail-title, .lv-role small, .lv-role strong,
.lv-preset-label, .lv-seg button span, .lv-stat small, .lv-leave span, .lv-link span, .lv-tool-label { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------------------------------------------------------------- header */
/* Two rows: the title bar (Sessions and the name on the left; Undo, Options
   and Finish my recording on the right), then the scoreboard or, in
   practice, the instruction, statistics and presets. */
.lv-head {
  display: grid;
  grid-template-rows: var(--lv-bar-h) minmax(0, 1fr);
  height: var(--lv-head-h);
  box-sizing: border-box;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  overflow: hidden;
}
.lv-head > * { min-width: 0; min-height: 0; }
.lv-head-bar {
  display: flex; align-items: center; gap: 12px; min-width: 0;
  padding: 0 max(var(--lv-pad), env(safe-area-inset-right, 0px)) 0 var(--lv-pad);
  border-bottom: 1px solid var(--line);
}
.lv-head-actions { display: flex; align-items: center; gap: 8px; flex: none; margin-left: auto; }
.lv-head-actions .lv-head-tools { flex: none; gap: 8px; }
.lv-head-actions .lv-tool { height: var(--lv-target); padding: 0 14px; font-size: 14px; }
.lv-head-actions .lv-finish { margin-left: 4px; padding: 0 20px; }
.lv-head-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr) minmax(0, 1.4fr);
  align-items: center;
  gap: 12px;
  padding: 6px var(--lv-pad);
}
.lv-head-row > * { min-width: 0; }
.lv-head-left { display: grid; gap: 6px; min-width: 0; }
.lv-head-id { display: flex; align-items: center; gap: 12px; flex: 1 1 auto; min-width: 0; }
.lv-leave {
  display: inline-flex; align-items: center; gap: 2px; flex: none;
  height: var(--lv-target); padding: 0 12px 0 8px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--raised); font-size: 14px; font-weight: 600; cursor: pointer;
}
.lv-identity { display: flex; align-items: baseline; gap: 10px; min-width: 0; flex: 0 1 auto; }
.lv-identity .rv-badge { flex: none; align-self: center; margin-left: 0; }
.lv-eyebrow { flex: none; font: 600 10px var(--font-display); letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-muted); }
.lv-title { flex: 0 1 auto; font: 700 clamp(15px, 1.3vw, 18px) var(--font-display); letter-spacing: 0.02em; }
.lv-instruction { display: grid; gap: 1px; min-width: 0; padding-left: 10px; border-left: 3px solid var(--match-accent, var(--lv-us)); }
.lv-instruction strong { font-size: clamp(13px, 1.1vw, 16px); line-height: 1.25; }
.lv-instruction span { font-size: 12px; line-height: 1.25; color: var(--ink-muted); min-height: 15px; }
.lv-root[data-side="defense"] .lv-instruction { border-left-color: var(--lv-opp); }
.lv-head-center { display: grid; justify-items: center; gap: 4px; min-width: 0; }
.lv-score { display: flex; align-items: center; justify-content: center; gap: 12px; min-width: 0; max-width: 100%; }
.lv-score i { color: var(--ink-subtle); font-style: normal; font-size: 24px; }
.lv-team { display: grid; justify-items: center; min-width: 0; max-width: clamp(70px, 9vw, 150px); }
.lv-score-edit { padding: 2px 8px; border: 1px solid transparent; border-radius: var(--radius-sm); background: none; cursor: pointer; }
.lv-score-edit:hover, .lv-score-edit:focus-visible { border-color: var(--line-strong); background: var(--raised); }
.lv-team small { max-width: 100%; font: 600 11px var(--font-display); letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-muted); }
.lv-team b { font: 700 clamp(30px, 2.8vw, 40px)/1 var(--font-display); font-variant-numeric: tabular-nums; }
.lv-us b { color: var(--team-red, var(--lv-us)); }
.lv-opp b { color: var(--team-blue, var(--lv-opp)); }
.score-correction-modal { min-width: min(480px, 82vw); }
.score-correction-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 16px 0 12px; }
.score-correction-fields label, .score-correction-reason { display: grid; gap: 5px; font: 700 11px var(--font-display); letter-spacing: .08em; color: var(--ink-muted); }
.score-correction-fields input, .score-correction-reason input { width: 100%; box-sizing: border-box; font: 700 24px var(--font-display); }
.score-correction-reason input { font: inherit; letter-spacing: 0; }
.score-correction-quick { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin: 8px 0 16px; color: var(--ink-muted); font-size: 12px; }
.score-correction-quick .btn { padding: 5px 8px; font-size: 12px; }
.score-correction-error { margin: 10px 0 0; color: var(--danger); font-size: 12px; }
.lv-context { display: flex; align-items: center; justify-content: center; gap: 10px; max-width: 100%; min-width: 0; font-size: 13px; color: var(--ink-muted); white-space: nowrap; overflow: hidden; }
.lv-context .possession-badge { flex: none; }
.lv-context b { color: var(--ink); }
.lv-owner { flex: 1 1 0; min-width: 0; }
.lv-head-right { display: grid; justify-items: end; align-content: center; gap: 6px; min-width: 0; container-type: inline-size; overflow: hidden; }
.lv-head-right .game-context { display: flex; align-items: center; justify-content: flex-end; flex-wrap: nowrap; gap: 8px; margin: 0; min-width: 0; max-width: 100%; }
.lv-head-right .game-context > * { flex: 0 1 auto; min-width: 0; white-space: nowrap; }
.lv-head-right .game-context .pending-period { overflow: hidden; text-overflow: ellipsis; max-width: 11em; }
.lv-head-right .recording-period { display: flex; align-items: center; gap: 6px; }
.lv-head-right select { max-width: 100px; }
.lv-head-tools { display: flex; align-items: center; justify-content: flex-end; gap: 6px; min-width: 0; max-width: 100%; }
.lv-tool {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; flex: none;
  height: 32px; padding: 0 10px; white-space: nowrap;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--raised); font-size: 13px; font-weight: 600; cursor: pointer;
}
.lv-tool.icon-only { padding: 0; width: 32px; }
.lv-tool:empty, .lv-tool-label:empty { display: none; }
.lv-tool.is-primary { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.lv-tool:hover:not(:disabled) { border-color: var(--ink-muted); }
@container (max-width: 330px) {
  #liveDashboard .lv-tool-label { display: none; }
  #liveDashboard { padding: 0; width: 32px; }
}
@container (max-width: 180px) {
  .lv-head-tools { gap: 3px; }
  .lv-head-tools .lv-tool { width: 28px; height: 28px; padding: 0; }
  .lv-head-tools .lv-tool-label { display: none; }
}

/* Practice header: statistics and presets */
.lv-practice-summary { display: flex; align-items: center; justify-content: center; gap: clamp(8px, 1vw, 16px); min-width: 0; max-width: 100%; }
.lv-seg { display: flex; align-items: stretch; min-width: 0; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); overflow: hidden; background: var(--raised); }
.lv-seg button { display: inline-flex; align-items: center; justify-content: center; gap: 3px; flex: 1 1 0; min-width: 0; padding: 0 5px; border: 0; border-right: 1px solid var(--line); background: none; font-size: 10.5px; font-weight: 600; cursor: pointer; }
.lv-seg button:last-child { border-right: 0; }
.lv-seg button .icon-svg { flex: none; }
.lv-seg button[aria-pressed="true"] { background: var(--brand); color: var(--on-brand); }
.lv-stat-switch { flex: none; height: 28px; }
.lv-stat-switch button { padding: 0 10px; font-size: 12px; }
.lv-stat { display: grid; justify-items: center; min-width: 0; }
.lv-stat b { font: 700 clamp(17px, 1.6vw, 22px)/1.05 var(--font-display); font-variant-numeric: tabular-nums; white-space: nowrap; }
.lv-stat b i { font-style: normal; font-size: 0.65em; color: var(--ink-muted); }
.lv-stat small { max-width: 100%; font-size: 9px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-muted); }
.lv-head-right.is-presets { justify-items: stretch; overflow: hidden; }
.lv-presets { display: grid; gap: 2px; min-width: 0; }
.lv-preset { display: grid; grid-template-columns: clamp(46px, 4.4vw, 62px) minmax(0, 1fr); align-items: center; gap: 6px; height: 20px; min-width: 0; }
.lv-preset-label { font: 700 9px var(--font-display); letter-spacing: 0.1em; color: var(--ink-muted); }
.lv-preset .lv-seg { height: 20px; }
.lv-preset .lv-seg button { font-size: 10px; padding: 0 3px; line-height: 1; }
.lv-seg button span { line-height: 1.1; }
.is-drop-ok { outline: 2px solid var(--success); outline-offset: -2px; }
/* An on-court practice card being dragged: its bench is the destination. */
.lv-bench.is-drop-hint { outline: 2px dashed color-mix(in srgb, var(--success) 70%, transparent); outline-offset: -2px; background: color-mix(in srgb, var(--success) 8%, transparent); }
.lv-bench.is-drop-hint.is-drop-ok { outline-style: solid; background: color-mix(in srgb, var(--success) 16%, transparent); }
/* A downward drag of an on-court practice card is a drag, never a scroll. */
.lv-root[data-practice="true"]:not([data-review]) .lv-floor-tile { touch-action: none; }
.is-drop-bad { outline: 2px solid var(--danger); outline-offset: -2px; }
.lv-drag-ghost {
  position: fixed; z-index: 60; width: 64px; padding: 6px 4px; display: grid; justify-items: center; gap: 2px;
  border: 2px solid var(--ink-muted); border-radius: var(--radius-md); background: var(--raised);
  box-shadow: var(--shadow-pop); opacity: 0.95; pointer-events: none;
}
.lv-drag-ghost b { font: 700 22px/1 var(--font-display); }
.lv-drag-ghost span { font-size: 10px; }
.lv-drag-ghost.is-ok { border-color: var(--success); }
.lv-drag-ghost.is-bad { border-color: var(--danger); }
.lv-drag-feedback { position: absolute; top: 100%; left: 50%; transform: translateX(-50%); margin-top: 4px; padding: 2px 8px; border-radius: var(--radius-pill); background: var(--raised); border: 1px solid var(--line-strong); white-space: nowrap; font-size: 11px; }
/* Play-by-play: scrolls sideways by design; each card is one line. */
.lv-strip {
  grid-column: 1 / -1; display: flex; align-items: stretch; gap: 8px; min-width: 0;
  overflow-x: auto; overflow-y: hidden; padding-bottom: 2px; scrollbar-width: thin;
}
.lv-play {
  flex: none; display: grid; align-content: center; gap: 0; width: clamp(150px, 14vw, 220px); padding: 2px 10px; overflow: hidden;
  border: 1px solid var(--line-strong); border-left: 3px solid var(--lv-us); border-radius: var(--radius-sm); background: var(--surface); text-align: left; cursor: pointer;
}
.lv-play strong { font-size: 11.5px; line-height: 1.25; }
.lv-play small { font-size: 9.5px; line-height: 1.2; color: var(--ink-muted); }
.lv-play.is-opp { border-left-color: var(--lv-opp); }
.lv-play.is-control { width: auto; max-width: 240px; padding: 2px 10px; border-style: dashed; border-left-width: 1px; background: none; color: var(--ink-muted); font-size: 11px; }
.lv-play.is-control span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lv-strip > .lv-muted { align-self: center; }
.lv-info { position: absolute; top: 10px; left: 50%; z-index: 5; transform: translateX(-50%); max-width: 80%; padding: 8px 14px; border: 1px solid var(--line-strong); border-radius: var(--radius-md); background: color-mix(in srgb, var(--surface) 94%, transparent); font-size: 12px; }
.lv-info ul { margin: 4px 0 0; padding-left: 16px; color: var(--ink-muted); }
/* ---------------------------------------------------------------- footer */
/* One row: the play history takes the remaining width and scrolls on its
   own; the session buttons never shrink or move. */
.lv-foot { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 0 12px; border-top: 1px solid var(--line); background: var(--surface); font-size: 12px; color: var(--ink-muted); overflow: hidden; }
/* The strip keeps room under the cards for its scrollbar, so both lines of
   every card stay readable. */
.lv-foot .lv-strip { flex: 1 1 auto; align-items: flex-start; min-width: 0; height: 54px; padding: 0 0 10px; box-sizing: border-box; overflow-x: auto; overflow-y: hidden; }
.lv-foot .lv-play { height: 44px; }
.lv-foot-actions { display: flex; flex: 0 0 auto; align-items: center; gap: 8px; padding-left: 12px; border-left: 1px solid var(--line); }
.lv-foot .lv-tool { height: 36px; padding: 0 14px; font-size: 13px; }
.lv-save-error { display: inline-flex; align-items: center; gap: 4px; color: var(--danger); font-weight: 700; white-space: nowrap; }
.lv-chip.is-primary { background: var(--brand); border-color: var(--brand); color: var(--on-brand); display: inline-flex; align-items: center; gap: 6px; }
/* Starter tag in the players pickers */
.lineup-starter { display: inline-block; margin-left: 6px; padding: 0 6px; border: 1px solid var(--brand-ink); border-radius: var(--radius-pill); color: var(--brand-ink); font: 700 9px/15px var(--font-display); letter-spacing: 0.08em; text-transform: uppercase; vertical-align: middle; }

@media (prefers-reduced-motion: reduce) {
  .lv-tile { transition: none; }
}
/* Period selector */
.lv-periods { flex: 1 1 auto; min-width: 0; max-width: 100%; height: 30px; }
.lv-periods button { padding: 0 8px; font-size: 12px; white-space: nowrap; }
.lv-periods button[data-period="skip"][aria-pressed="true"] { background: var(--warning); color: #000; }
.lv-periods button:disabled { opacity: 0.55; }
.lv-head-right .game-context { width: 100%; }
.lv-head-right .pending-period { flex: none; }
.lv-action:has(kbd) { padding-top: 14px; }
.lv-head-right .game-context > .lv-periods { flex: 1 1 auto; }
.lv-periods button { flex: 1 1 auto; }
.lv-fan-label.is-wrap { white-space: normal; text-align: center; line-height: 1.15; }
.lv-fan-hint { font-size: 10px; color: var(--ink-muted); text-shadow: 0 1px 3px #000, 0 0 6px #000; }
.lv-fan-chips .lv-choice.is-quiet { padding: 0 14px; white-space: nowrap; min-height: 44px; background: var(--surface, #1d1a1b); border: 2px dashed color-mix(in srgb, var(--ink) 58%, transparent); color: var(--ink); font-weight: 600; }
.lv-fan-chips .lv-choice.is-quiet:hover { color: var(--ink); background: color-mix(in srgb, var(--line-strong) 30%, var(--surface, #1d1a1b)); }
.lv-role .lv-optional { font: 600 9px/1 var(--font-body, inherit); font-style: normal; letter-spacing: 0.08em; text-transform: uppercase; padding: 2px 5px; border: 1px solid currentColor; border-radius: 999px; opacity: 0.85; }
/* Two-team recording: possession selects the accent of prompts and arcs; the
   player tiles keep their own team's colour (--panel-color). */
.lv-root[data-match-team="red"] { --match-accent: var(--lv-red); --match-tint: color-mix(in srgb, var(--lv-red) 18%, transparent); }
.lv-root[data-match-team="blue"] { --match-accent: var(--lv-blue); --match-tint: color-mix(in srgb, var(--lv-blue) 18%, transparent); }
.lv-root[data-match-team="red"] .match-possession,
.lv-root[data-match-team="blue"] .match-possession { color: var(--match-accent); }
.lv-root[data-match-team="red"] #posCourt,
.lv-root[data-match-team="blue"] #posCourt { --brand: var(--match-accent); --accent: var(--match-accent); }
.lv-play { border-left-color: var(--play-color, var(--lv-us)); }
.lv-play.is-opp { border-left-color: var(--play-color, var(--lv-opp)); }

.lv-team .lv-team-logo { display: inline-block; width: 16px; height: 16px; object-fit: contain; vertical-align: middle; margin-right: 5px; border-radius: 3px; }
/* Play history: no visible scrollbar or reserved track; still scrolls by
   trackpad, wheel (mapped sideways) and keyboard; edges fade. */
.lv-foot .lv-strip { align-items: center; padding: 0; scrollbar-width: none; -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 10px, #000 calc(100% - 14px), transparent 100%); mask-image: linear-gradient(90deg, transparent 0, #000 10px, #000 calc(100% - 14px), transparent 100%); }
.lv-foot .lv-strip::-webkit-scrollbar { display: none; }
.lv-foot .lv-play { height: 46px; padding: 4px 12px; gap: 2px; border-radius: var(--radius-md); }
.lv-foot .lv-play strong { font-size: 12px; }
.lv-foot .lv-play small { font-size: 10.5px; }
.lv-foot .lv-play.is-control { height: 34px; }

/* ---------------------------------------------------------------- game header
   Under the title bar, the scoreboard: left logo, left statistics, left
   score | periods, possession and events | right score, right statistics,
   right logo. The middle column is fixed and the two team panels are equal
   and fill their halves (the logo at the outer edge, the score beside the
   middle, the statistics spread out between them), so the middle stays on
   the centre line (over the basket) whatever the scores, names or
   statistics take. */
.lv-head.is-game > .lv-score {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(260px, 25vw, 320px) minmax(0, 1fr);
  align-items: stretch;
  gap: var(--lv-gap);
  height: 100%;
  max-width: none;
  padding: 6px max(var(--lv-pad), env(safe-area-inset-right, 0px)) 6px var(--lv-pad);
  box-sizing: border-box;
}
.lv-head-side { display: flex; align-items: stretch; min-width: 0; }
.lv-hteam { --hteam-color: var(--team-red, var(--lv-us)); display: flex; align-items: center; justify-content: space-between; gap: clamp(8px, 1.2vw, 18px); flex: 1 1 auto; min-width: 0; padding: 0 12px; border-radius: var(--radius-md); border-top: 3px solid transparent; }
.lv-hteam[data-team-key="blue"] { --hteam-color: var(--team-blue, var(--lv-opp)); }
.lv-hteam.has-ball { border-top-color: var(--hteam-color); background: color-mix(in srgb, var(--hteam-color) 9%, transparent); }
.lv-hteam.is-empty { visibility: hidden; }
.lv-hid { display: grid; justify-items: center; align-content: center; gap: 3px; flex: 0 1 auto; min-width: 48px; max-width: 140px; text-align: center; }
.lv-hid .lv-team-logo { width: 40px; height: 40px; object-fit: contain; border-radius: 8px; }
.lv-hmono { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--hteam-color, var(--tile-color, var(--panel-color))); color: #fff; font: 700 20px/1 var(--font-display); }
.lv-hid strong { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 700 12px/1.1 var(--font-display); letter-spacing: 0.05em; text-transform: uppercase; color: var(--hteam-color); }
.lv-hnote { font-size: 10px; color: var(--ink-muted); white-space: nowrap; }
.lv-hstats { display: grid; grid-template-columns: repeat(4, minmax(34px, 1fr)); gap: 2px 10px; margin: 0 auto; min-width: 0; flex: 1 1 auto; max-width: 340px; }
.lv-hstats.is-empty { display: none; }
.lv-hstats.is-readonly { opacity: 0.75; }
.lv-hstats div { display: grid; min-width: 0; }
.lv-hstats dt { font: 700 9px var(--font-display); letter-spacing: 0.08em; color: var(--ink-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lv-hstats dd { margin: 0; font: 700 15px/1.15 var(--font-display); font-variant-numeric: tabular-nums; white-space: nowrap; }
/* The score keeps one width, so the middle never moves as it changes. */
.lv-hteam .lv-team { display: grid; place-items: center; flex: none; min-width: 2.4ch; max-width: none; padding: 0 4px; border: 1px solid transparent; border-radius: var(--radius-sm); background: none; font: 700 clamp(36px, 4vw, 52px)/1 var(--font-display); font-variant-numeric: tabular-nums; }
.lv-hteam .lv-team b { font: inherit; color: var(--hteam-color); min-width: 2ch; text-align: center; }
.lv-hteam .lv-score-edit { cursor: pointer; }
.lv-hteam .lv-score-edit:hover, .lv-hteam .lv-score-edit:focus-visible { border-color: var(--line-strong); background: var(--raised); }
.lv-hteam .lv-team.is-readonly b { opacity: 0.7; }
.lv-hteam.is-untracked .lv-team b { color: var(--ink-subtle); }
.lv-head.is-game .lv-head-center { display: grid; align-content: center; justify-items: stretch; gap: 8px; min-width: 0; }
/* The period bar keeps one size (the fixed middle column, so it stays over the
   basket and the team statistics never move): its segments share the width
   equally (flex 1 1 0), so two halves get wider buttons and four quarters
   narrower ones, and an overtime never widens the header. The labels are
   compact (Skip, 1st..4th, OT, OT2; the full name is the aria-label); the
   most crowded bar (four quarters, four overtimes) tightens its type a step. */
.lv-head-periods { width: 100%; min-width: 0; }
.lv-head-periods .game-context { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 0; min-width: 0; }
.lv-head-periods .lv-periods { flex: 1 1 auto; width: 100%; max-width: none; height: 32px; }
.lv-head-periods .lv-periods button { flex: 1 1 0; min-width: 0; padding: 0 4px; }
.lv-head-periods .lv-periods:is([data-segments="8"], [data-segments="9"]) button { padding: 0 2px; font-size: 11px; }
.lv-head-periods .pending-period { flex: none; font-size: 11px; color: var(--ink-muted); white-space: nowrap; }
.lv-head.is-game .lv-context { font-size: 12px; line-height: 16px; }

/* ---------------------------------------------------------------- body
   The court's size comes from the space left once the side columns, gaps and
   (when the actions sit under the court) the dock are taken: as wide as it
   can be without being taller than the height allows. The row is exactly the
   court's height, so the side columns are too. */
.lv-body {
  --lv-dock-space: 0px;
  --lv-court-w: max(160px, min(100cqw - 2 * var(--lv-side) - 2 * var(--lv-gap) - 2 * var(--lv-pad), (100cqh - var(--lv-head-h) - var(--lv-foot-h) - 2 * var(--lv-pad) - var(--lv-dock-space)) * var(--lv-ratio)));
  --lv-court-h: calc(var(--lv-court-w) / var(--lv-ratio));
  display: grid;
  /* When the height limits the court, the spare width goes to the two side
     columns equally, so the panels and the dock span the whole width and the
     court stays on the centre line. */
  grid-template-columns: minmax(var(--lv-side), 1fr) var(--lv-court-w) minmax(var(--lv-side), 1fr);
  grid-template-rows: var(--lv-court-h);
  justify-content: center;
  align-content: center;
  gap: var(--lv-gap);
  min-height: 0;
  min-width: 0;
  padding: var(--lv-pad) max(var(--lv-pad), env(safe-area-inset-right, 0px)) var(--lv-pad) var(--lv-pad);
  overflow: hidden;
}
.lv-root[data-actions="dock"] .lv-body { --lv-dock-space: calc(var(--lv-dock-h) + var(--lv-gap)); grid-template-rows: var(--lv-court-h) var(--lv-dock-h); }
.lv-body > * { min-width: 0; min-height: 0; }
.lv-body > .lv-court-slot { grid-column: 2; grid-row: 1; }
.lv-body > .lv-players.is-left, .lv-body > .lv-teamcard.is-left, .lv-body > .lv-side.is-left { grid-column: 1; grid-row: 1; }
.lv-body > .lv-players.is-right, .lv-body > .lv-side.is-right { grid-column: 3; grid-row: 1; }
.lv-body > .lv-teamcard.is-left { align-self: start; }
.lv-side.is-right { display: flex; flex-direction: column; gap: 10px; overflow-x: hidden; overflow-y: auto; scrollbar-width: thin; }

/* ---------------------------------------------------------------- player panels
   Name and Ball, the players on court as large horizontal cards, then the
   bench as small numbered chips. The cards take what they need; the bench
   takes the rest (two rows of five where it can) and scrolls inside itself. */
.lv-players {
  --panel-tint: color-mix(in srgb, var(--panel-color) 14%, var(--surface));
  display: flex;
  flex-direction: column;
  gap: 4px;
  height: 100%;
  min-height: 0;
  padding: 8px;
  box-sizing: border-box;
  border: 1px solid color-mix(in srgb, var(--panel-color) 32%, var(--line));
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--panel-color) 5%, var(--surface));
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.lv-players.has-ball { border-color: var(--panel-color); box-shadow: 0 0 0 1px var(--panel-color), 0 0 18px color-mix(in srgb, var(--panel-color) 26%, transparent); }
.lv-players-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; min-width: 0; flex: none; }
.lv-players-head strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 700 14px/18px var(--font-display); letter-spacing: 0.1em; text-transform: uppercase; color: var(--panel-color); }
.lv-panel-ball { flex: none; padding: 0 8px; border-radius: var(--radius-pill); background: var(--panel-color, var(--tile-color)); color: #fff; font: 700 11px/18px var(--font-display); letter-spacing: 0.08em; text-transform: uppercase; }
.lv-players-sub { flex: none; font: 700 10px/14px var(--font-display); letter-spacing: 0.14em; color: var(--ink-muted); }
.lv-players-sub.is-bench { padding-top: 4px; border-top: 1px solid color-mix(in srgb, var(--panel-color) 22%, var(--line)); }
.lv-floor { flex: 1 0 auto; min-height: calc(5 * 52px + 4 * var(--lv-card-gap)); display: flex; flex-direction: column; }
.lv-floor .lv-rail-list { display: flex; flex-direction: column; gap: var(--lv-card-gap); flex: 1 1 auto; min-height: 0; overflow: hidden; }
.lv-floor.is-many { flex: 1 1 0; min-height: 0; }
.lv-floor.is-many .lv-rail-list { overflow-y: auto; scrollbar-width: thin; }
/* An on-court card. */
.lv-floor-tile {
  position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 10px;
  flex: 1 1 0; min-height: 52px; max-height: calc(var(--lv-card-h) + 12px); min-width: 0; padding: 4px 10px 4px 6px;
  border: 1px solid color-mix(in srgb, var(--panel-color) 35%, var(--line-strong)); border-radius: 10px;
  background: var(--panel-tint); color: var(--ink); text-align: left; cursor: pointer; overflow: hidden;
  transition: border-color 0.12s ease, background 0.12s ease;
}
.lv-floor.is-many .lv-floor-tile { flex: none; height: 56px; }
.lv-num { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--panel-color); color: #fff; font: 700 18px/1 var(--font-display); font-variant-numeric: tabular-nums; text-shadow: 0 1px 1px rgb(0 0 0 / 0.35); }
.lv-card-text { display: grid; gap: 2px; min-width: 0; }
.lv-card-name { display: flex; align-items: center; gap: 6px; min-width: 0; }
.lv-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 600 15px/1.2 var(--font-body); }
.lv-pill { flex: none; padding: 1px 7px; border-radius: var(--radius-pill); background: color-mix(in srgb, var(--panel-color) 70%, #000); color: #fff; font: 700 10px/15px var(--font-display); letter-spacing: 0.06em; text-transform: uppercase; white-space: nowrap; }
.lv-pill.is-question { background: var(--warning); color: #1b1300; }
.lv-card-stats { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; line-height: 1.2; color: var(--ink-muted); font-variant-numeric: tabular-nums; }
.lv-floor-tile:hover:not(.is-idle):not([aria-disabled="true"]) { border-color: var(--panel-color); }
.lv-floor-tile.is-armed { border-color: var(--panel-color); background: color-mix(in srgb, var(--panel-color) 34%, var(--surface)); box-shadow: inset 0 0 0 2px var(--panel-color); }
.lv-floor-tile.is-asking { border-color: var(--warning); box-shadow: inset 0 0 0 1px var(--warning); }
.lv-floor-tile.is-asking:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.lv-floor-tile.is-excluded { border-style: dashed; }
.lv-floor-tile.is-sub-target { border-style: dashed; border-color: var(--warning); }
.lv-floor-tile.is-ft-locked { border-color: var(--success); }
.lv-floor-tile[aria-disabled="true"] { opacity: 0.45; cursor: default; }
/* The team without the ball cannot be pressed: greyed and striped. */
.lv-floor-tile.is-idle { opacity: 0.42; filter: saturate(0.45); cursor: not-allowed; background-image: repeating-linear-gradient(135deg, transparent 0 7px, color-mix(in srgb, var(--ink) 5%, transparent) 7px 9px); }
.lv-add-court { display: flex; align-items: center; justify-content: center; gap: 6px; flex: none; min-height: var(--lv-target); padding: 0 8px; border: 1px dashed var(--line-strong); border-radius: 10px; background: none; font-size: 12px; font-weight: 600; cursor: pointer; }
.lv-add-court span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* The bench: 44px targets, small circles, short names; fewer columns when
   the panel is narrow; scrolls (with a visible bar) past what fits. */
.lv-bench { flex: 0 1 var(--lv-bench-h); min-height: 52px; overflow-x: hidden; overflow-y: auto; scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--panel-color) 60%, var(--line-strong)) transparent; touch-action: pan-y; }
.lv-bench .lv-rail-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(var(--lv-target), 1fr)); grid-auto-rows: 50px; gap: 2px; }
.lv-bench-tile { display: grid; justify-items: center; align-content: center; gap: 2px; min-width: var(--lv-target); min-height: var(--lv-target); padding: 2px 0; border: 0; border-radius: 8px; background: none; cursor: pointer; }
.lv-bench-tile b { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--panel-color); background: color-mix(in srgb, var(--panel-color) 16%, var(--surface)); font: 700 13px/1 var(--font-display); font-variant-numeric: tabular-nums; }
.lv-bench-tile span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10.5px; line-height: 1.1; color: var(--ink-muted); }
.lv-bench-tile:hover:not(:disabled) b { background: color-mix(in srgb, var(--panel-color) 36%, var(--surface)); }
.lv-bench-tile.is-lifted { background: color-mix(in srgb, var(--warning) 20%, transparent); }
.lv-bench-tile.is-lifted b { border-color: var(--warning); }
.lv-bench-tile.is-idle { opacity: 0.7; }
.lv-bench .lv-muted { grid-column: 1 / -1; align-self: center; }

/* ---------------------------------------------------------------- team cards
   A team recorded as a whole: logo, name, Ball and its team numbers. */
.lv-teamcard { --tile-color: var(--lv-opp); flex: none; min-width: 0; }
.lv-them {
  position: relative; display: grid; align-content: center; gap: 6px; width: 100%; min-height: 96px; padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--tile-color) 55%, var(--line-strong)); border-radius: var(--radius-md); text-align: left;
  background: color-mix(in srgb, var(--tile-color) 8%, var(--surface)); background-image: repeating-linear-gradient(135deg, transparent 0 9px, color-mix(in srgb, var(--tile-color) 9%, transparent) 9px 12px);
}
.lv-root .lv-them:disabled { opacity: 1; cursor: default; }
.lv-them.has-ball { border-color: var(--tile-color); background-color: color-mix(in srgb, var(--tile-color) 20%, var(--surface)); box-shadow: 0 0 0 1px var(--tile-color), 0 0 16px color-mix(in srgb, var(--tile-color) 30%, transparent); }
.lv-them.is-asking { border-color: var(--warning); cursor: pointer; }
.lv-teamcard-id { --hteam-color: var(--tile-color); display: flex; align-items: center; gap: 8px; min-width: 0; }
.lv-teamcard-id .lv-team-logo { width: 32px; height: 32px; object-fit: contain; border-radius: 6px; flex: none; }
.lv-teamcard-id .lv-hmono { width: 32px; height: 32px; font-size: 16px; flex: none; }
.lv-teamcard-id strong { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 700 14px/1.2 var(--font-display); letter-spacing: 0.1em; text-transform: uppercase; color: var(--tile-color); }
.lv-teamcard-facts { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; color: var(--ink-muted); }
/* The other team when this recorder records one side: name and score only, never tappable. */
.lv-them.is-readonly { min-height: 72px; opacity: 0.85; }
.lv-teamcard-score { flex: none; font: 700 22px/1 var(--font-display); color: var(--ink); font-variant-numeric: tabular-nums; }
.lv-teamcard-ask { display: block; padding: 3px 8px; border-radius: var(--radius-sm); background: var(--warning); color: #1b1300; font-size: 12px; font-weight: 600; }

/* ---------------------------------------------------------------- actions
   Three groups in a stable order: possession tools (Switch, Skip, Cancel,
   Flag, Notes), event actions (Turnover, Free throws, Tech / Flagrant) and
   event tags (Paint touch, Drive Right, Transition). In the dock they are one
   row under the court; in the right column they stack. Every target is at
   least 44px. */
.lv-acts { display: flex; gap: 10px; min-width: 0; }
.lv-acts-group { display: flex; gap: 8px; min-width: 0; }
.lv-act {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-width: var(--lv-target); min-height: var(--lv-target); padding: 0 12px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-md); background: var(--surface); color: var(--ink); font: 600 13px/1.1 var(--font-body); cursor: pointer;
}
.lv-act-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lv-act:hover:not(:disabled) { border-color: var(--ink-muted); }
.lv-act[aria-pressed="true"] { border-color: var(--match-accent, var(--lv-us)); background: color-mix(in srgb, var(--match-accent, var(--lv-us)) 22%, var(--surface)); }
.lv-act.is-flag[aria-pressed="true"] { border-color: var(--warning); color: var(--warning); background: color-mix(in srgb, var(--warning) 16%, var(--surface)); }
.lv-act.is-flag[aria-pressed="true"] svg { fill: currentColor; }
#playNote[aria-pressed="true"] { border-color: var(--warning); color: var(--warning); }
.lv-act.is-event { gap: 6px; padding: 0 8px; font: 600 13.5px/1.1 var(--font-body); border-color: color-mix(in srgb, var(--ink) 30%, var(--line-strong)); }
/* Event tags: a selected tag is filled, outlined and checked (never colour alone),
   in the app accent, not a team colour. */
.lv-tag {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: var(--lv-target); min-height: var(--lv-target); padding: 0 8px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-md); background: var(--surface); color: var(--ink); font: 600 12px/1.1 var(--font-body); cursor: pointer;
}
.lv-tag-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lv-tag-check { display: none; place-items: center; width: 16px; height: 16px; border-radius: 50%; background: var(--success); color: #062312; font-style: normal; flex: none; }
.lv-tag.is-on { border: 2px solid var(--success); background: color-mix(in srgb, var(--success) 18%, var(--surface)); }
.lv-tag.is-on .lv-tag-check { display: grid; }
.lv-tag:hover:not(:disabled) { border-color: var(--ink-muted); }
.lv-tag.is-on:hover:not(:disabled) { border-color: var(--success); }
.lv-tags-hint { font-size: 10.5px; color: var(--ink-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lv-root button.lv-act:disabled, .lv-root button.lv-tag:disabled { opacity: 0.4; }

/* The dock: one row under the panels and the court. */
.lv-acts.is-dock { grid-column: 1 / -1; grid-row: 2; align-items: stretch; height: var(--lv-dock-h); }
.lv-acts.is-dock .lv-act, .lv-acts.is-dock .lv-tag { height: var(--lv-dock-h); }
/* Every group stretches (the event actions a little more), and so does every
   button in it, so the row spans the whole width evenly. */
.lv-acts.is-dock .is-utility { flex: 1 1 0; }
.lv-acts.is-dock .is-utility .lv-act { flex: 1 1 0; flex-direction: column; gap: 3px; min-width: 52px; padding: 0 2px; font-size: 11px; }
.lv-acts.is-dock .is-events { flex: 1.4 1 0; padding: 0 8px; border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
.lv-acts.is-dock .is-events .lv-act { flex: 1 1 0; }
.lv-acts.is-dock .is-tags { flex: 1 1 0; position: relative; }
.lv-acts.is-dock .is-tags .lv-tag { flex: 1 1 0; }
.lv-acts.is-dock .lv-tags-hint { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
/* The right column: a two-column grid of tools, full-width event actions, the
   three tags side by side. */
.lv-acts.is-column { flex-direction: column; gap: 10px; flex: none; }
.lv-acts.is-column .lv-acts-group { flex-wrap: wrap; }
.lv-acts.is-column .is-utility { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.lv-acts.is-column .is-utility .lv-act { justify-content: flex-start; padding: 0 10px; }
.lv-acts.is-column .is-events { display: grid; gap: 8px; }
.lv-acts.is-column .is-events .lv-act { min-height: 50px; justify-content: flex-start; padding: 0 14px; }
.lv-acts.is-column .is-tags { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.lv-acts.is-column .lv-tag { flex-direction: column; gap: 3px; min-height: 54px; padding: 4px 2px; font-size: 11px; }
.lv-acts.is-column .lv-tag-check { position: absolute; top: 3px; right: 3px; }
.lv-acts.is-column .lv-tags-hint { grid-column: 1 / -1; text-align: center; }

/* ---------------------------------------------------------------- footer
   The recent-play strip across the whole width; a failed save at the right
   end. Leaving and Finish my recording are in the title bar. */
.lv-foot { height: var(--lv-foot-h); padding: 0 max(var(--lv-pad), env(safe-area-inset-right, 0px)) 0 var(--lv-pad); }
.lv-foot .lv-strip { height: 100%; touch-action: pan-x; }
.lv-foot .lv-play { height: 52px; width: clamp(170px, 15vw, 220px); }
.lv-foot-actions { gap: 16px; }
.lv-foot .lv-tool { height: 48px; padding: 0 16px; font-size: 14px; }

/* ---------------------------------------------------------------- compact
   Below about 1100 x 700 the three columns cannot all stay comfortable: the
   gaps go to 8px first, then the header, the strip and the cards slim down;
   the tags stack icon over a small label (as the iPad's compact dock)
   and the bench keeps at least one row and scrolls. Touch targets stay 44px. */
@media (max-width: 1100px), (max-height: 760px) {
  .tracker-v2.lv-root { --lv-bar-h: 48px; --lv-board-h: 72px; --lv-foot-h: 60px; --lv-pad: 8px; --lv-gap: 8px; --lv-side: clamp(200px, 21vw, 230px); --lv-card-h: 56px; --lv-card-gap: 4px; --lv-bench-h: 100px; }
  .lv-hstats { gap: 1px 8px; }
  .lv-hstats dd { font-size: 13px; }
  .lv-hid .lv-team-logo, .lv-hid .lv-hmono { width: 32px; height: 32px; }
  .lv-head-actions .lv-tool { padding: 0 12px; font-size: 13px; }
  .lv-head.is-game .lv-head-center { gap: 5px; }
  .lv-floor { min-height: calc(5 * 50px + 4 * var(--lv-card-gap)); }
  .lv-floor-tile { min-height: 50px; gap: 8px; }
  .lv-num { width: 34px; height: 34px; font-size: 16px; }
  .lv-name { font-size: 14px; }
  .lv-foot .lv-play { height: 48px; }
  .lv-foot .lv-tool { height: var(--lv-target); }
  .lv-acts.is-dock .lv-tag { min-width: 58px; padding: 0 2px; flex-direction: column; gap: 2px; }
  .lv-acts.is-dock .lv-tag-label { font-size: 11px; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  .lv-acts.is-dock .lv-tag-check { position: absolute; top: 2px; right: 2px; width: 14px; height: 14px; }
  .lv-acts.is-dock .is-utility .lv-act { min-width: 50px; }
  /* The right column packs tighter: tools three across, icon over label. */
  .lv-side.is-right { gap: 8px; }
  .lv-them { min-height: 80px; padding: 8px 10px; gap: 4px; }
  .lv-acts.is-column { gap: 8px; }
  .lv-acts.is-column .is-utility { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .lv-acts.is-column .is-utility .lv-act { flex-direction: column; justify-content: center; gap: 2px; padding: 2px; font-size: 11px; }
  .lv-acts.is-column .is-events { gap: 6px; }
  .lv-acts.is-column .is-events .lv-act { min-height: var(--lv-target); }
  .lv-acts.is-column .lv-tags-hint { display: none; }
}
/* Both stat rows stay on short screens too (LIVE-STAT-03). */

/* ---------------------------------------------------------------- navigation while tracking
   The tracker is full width with no navigation, like View / Edit and the iPad:
   ‹ Sessions in its title bar is the way out. The rail and its drawer stay
   hidden while tracking. */
.nav-rail, .nav-backdrop, .nav-close { display: none; }
.screen.is-tracking { grid-template-columns: minmax(0, 1fr); }
.screen.is-tracking > .content { grid-column: 1; }
.nav-toggle { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 1px solid var(--line-strong); border-radius: var(--radius-md); background: var(--raised); color: var(--ink); cursor: pointer; }
.nav-toggle:hover { border-color: var(--ink-muted); }
.nav-toggle:focus-visible, .nav-close:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.screen.is-tracking .nav { display: none; }
.screen.is-tracking.nav-open .nav { display: flex; position: fixed; z-index: 70; inset: 0 auto 0 0; width: min(280px, calc(100vw - 48px)); padding-top: max(12px, env(safe-area-inset-top, 0px)); padding-left: env(safe-area-inset-left, 0px); box-shadow: 8px 0 32px rgb(0 0 0 / 0.45); overflow-y: auto; }
.screen.is-tracking.nav-open .nav-backdrop { display: block; position: fixed; z-index: 69; inset: 0; background: rgb(0 0 0 / 0.5); }
.screen.is-tracking.nav-open .nav-close { display: grid; place-items: center; align-self: flex-end; width: 44px; height: 44px; margin: 0 8px 4px 0; padding: 0; border: 1px solid var(--line-strong); border-radius: var(--radius-md); background: var(--raised); color: var(--ink); cursor: pointer; }
/* In the drawer the navigation shows its labels at every width. */
.screen.is-tracking.nav-open .nav-brand { justify-content: flex-start; margin: 0 var(--space-3) var(--space-5); padding: 0 var(--space-3); }
.screen.is-tracking.nav-open .nav-brand span, .screen.is-tracking.nav-open .nav-label { display: inline; }
.screen.is-tracking.nav-open .nav-items { justify-items: stretch; padding: 0 var(--space-3); }
.screen.is-tracking.nav-open .nav button { justify-content: flex-start; width: auto; min-height: 44px; padding: 0 var(--space-3); gap: var(--space-3); }
@media (prefers-reduced-motion: no-preference) {
  .screen.is-tracking.nav-open .nav { animation: lv-drawer-in 0.18s ease-out; }
}
@keyframes lv-drawer-in { from { transform: translateX(-100%); } to { transform: none; } }

/* The opening jump ball (and the overtime tip): one question and two solid
   choices, each in its team's colour, Team 1 left and Team 2 right. */
#jumpBall .lv-choice[data-jump] { border: 2px solid var(--lv-tone); background: color-mix(in srgb, var(--lv-tone) 72%, #000); color: #fff; font-size: calc(20px * var(--lv-arc-scale, 1)); box-shadow: 0 6px 18px rgb(0 0 0 / 0.45); opacity: 1; }
#jumpBall .lv-choice[data-jump].is-suggested { outline: 3px solid var(--focus); outline-offset: 2px; }
#jumpBall .lv-bubble strong { font-size: 15px; letter-spacing: 0.04em; }

/* ---- Edit mode (tracker/edit-mode.js): a saved play on the court ----------
   A colour of its own (never a team's or the brand's) frames the court, so it
   can't be mistaken for recording. In the dock only Flag, Notes and the tags
   work (on the edited play); the rest is disabled until edit mode ends. */
.lv-root[data-edit-play] { --lv-edit: #3fb6e6; }
[data-theme="light"] .lv-root[data-edit-play], .screen.light .lv-root[data-edit-play] { --lv-edit: #0b6f99; }
.lv-court.is-editing { box-shadow: 0 0 0 3px var(--lv-edit), 0 0 24px color-mix(in srgb, var(--lv-edit) 35%, transparent); }
.lv-root[data-edit-play] .lv-acts button:disabled { opacity: 0.35; }
.lv-root[data-edit-play] .lv-players.is-idle { opacity: 1; }
.lv-edit-banner { position: absolute; z-index: 6; inset: auto 8px 8px 8px; display: flex; align-items: center; gap: 10px; padding: 6px 8px; border: 1.5px solid var(--lv-edit); border-radius: var(--radius-md); background: color-mix(in srgb, var(--lv-edit) 22%, var(--surface)); color: var(--ink); box-shadow: 0 6px 18px #00000055; }
.lv-edit-banner strong { flex: 1; min-width: 0; overflow: hidden; font: 700 14px var(--font-display); letter-spacing: 0.04em; text-transform: uppercase; white-space: nowrap; text-overflow: ellipsis; }
.lv-edit-back { display: inline-flex; align-items: center; gap: 4px; min-height: 36px; padding: 0 10px; border: 1.5px solid var(--lv-edit); border-radius: var(--radius-sm); background: var(--lv-edit); color: #04131b; font-weight: 700; cursor: pointer; }
.lv-edit-actions { display: inline-flex; gap: 6px; }
.lv-edit-actions .btn { min-height: 36px; }
/* The banner sits on the backcourt edge, where shots rarely are, so it never
   hides the play's spot; the hint goes just above it. */
/* Every other recorded shot fades back so the edited play's spot stands out. */
/* Only the edited play's dot shows (edit-mode.js draws no other shot; this is a safeguard). */
.lv-court.is-editing #posCourt .shot-marker { display: none; }
/* The edited play's spot: larger and draggable. */
.lv-court.is-editing #posCourt .pending-v2.is-edit-dot { r: 1.1px; fill: color-mix(in srgb, var(--lv-edit) 55%, transparent); stroke: var(--lv-edit); stroke-width: 0.3; stroke-dasharray: none; pointer-events: all; cursor: grab; touch-action: none; }
/* Badges on the players the play credits (Shooter, Assist, Rebound ...). */
.lv-edit-badges { display: inline-flex; flex-wrap: wrap; gap: 3px; }
.lv-edit-badge { display: inline-flex; align-items: center; min-height: 20px; padding: 0 7px; border: 1px solid var(--lv-edit); border-radius: var(--radius-pill); background: var(--lv-edit); color: #04131b; font: 700 10.5px var(--font-display); letter-spacing: 0.05em; text-transform: uppercase; cursor: grab; user-select: none; -webkit-user-drag: element; }
.lv-edit-badge.is-armed { outline: 2px solid var(--warning); outline-offset: 1px; }
/* On a player card the badges are a strip at its right edge, as tall as the
   card (the same width and look): the whole badge is the drag handle, and
   two badges share the height. */
.lv-floor-tile.is-edit.has-badges { grid-template-columns: auto minmax(0, 1fr) auto; }
.lv-floor-tile.is-edit > .lv-edit-badges { align-self: stretch; flex-direction: column; flex-wrap: nowrap; margin: -2px -7px -2px 0; }
.lv-floor-tile.is-edit > .lv-edit-badges .lv-edit-badge { flex: 1 1 0; min-height: 0; justify-content: center; border-radius: 8px; }
.lv-floor-tile.is-edit > .lv-edit-badges .lv-edit-badge.is-armed { outline-offset: -3px; }
.lv-bench-tile.is-edit { position: relative; }
.lv-bench-tile.is-edit .lv-edit-badges { position: absolute; top: -4px; right: -2px; }
.lv-floor-tile.is-edit.is-asking, .lv-bench-tile.is-edit.is-asking { outline: 2px dashed var(--warning); outline-offset: -2px; }
.lv-bench-tile.is-edit.is-lifted { outline: 2px solid var(--warning); outline-offset: -2px; }
/* Strip drag and drop (edit-mode.js bindStripReorder). */
.lv-strip .lv-play[draggable="true"] { cursor: grab; }
.lv-strip .lv-play.is-dragging { opacity: 0.5; }
.lv-strip .lv-play.is-drop-target { outline: 2px dashed var(--focus); outline-offset: 2px; }

/* The answer ring around the dot (edit-mode.js, laid out by arc-layout.js like the recording arc). */
.lv-edit-banner .lv-edit-title { flex: 1; min-width: 0; display: grid; gap: 1px; }
.lv-edit-banner .lv-edit-title strong { flex: none; }
.lv-edit-line { overflow: hidden; font-size: 12px; color: var(--ink-muted); white-space: nowrap; text-overflow: ellipsis; }
.lv-edit-line.is-error { color: var(--warning); font-weight: 600; }
.is-edit-ring .lv-edit-answer { gap: 0; padding: 2px 8px; }
.is-edit-ring .lv-edit-answer small { font-size: 0.72em; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; opacity: 0.75; }
.is-edit-ring .lv-edit-answer .lv-choice-label { max-width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.is-edit-ring .lv-edit-answer.is-missing { box-shadow: 0 0 0 2px color-mix(in srgb, var(--warning) 45%, transparent), 0 6px 18px #00000066; }
.is-edit-ring .lv-edit-answer.is-open { outline: 2px solid var(--lv-edit); outline-offset: 1px; }
.is-edit-ring .lv-choice.is-unavailable { border-style: dashed; opacity: 0.7; }
.is-edit-ring .lv-edit-close { cursor: pointer; border-color: var(--lv-edit); }
.is-edit-ring .lv-arc-stems line { stroke: color-mix(in srgb, var(--lv-edit) 55%, transparent); }

/* Box Score (CR-04, live): beside the possession / events line under the
   period bar, after a thin divider (tracker/live-screen.js). */
.lv-context-row { display: flex; align-items: center; justify-content: center; gap: 10px; min-width: 0; max-width: 100%; }
.lv-context-row .lv-context { flex: 0 1 auto; min-width: 0; }
.lv-context-sep { flex: none; width: 1px; height: 20px; background: var(--line-strong); }
.lv-tool.lv-box-score { height: 30px; padding: 0 12px; border-radius: var(--radius-md); background: transparent; color: var(--ink); }
.lv-tool.lv-box-score:hover { background: var(--hover); }
