/* Alpha 0.39 interface-revamp workspace */
:root {
  --solo-gap: clamp(5px, 0.85dvh, 10px);
  --solo-radius: clamp(8px, 1.4dvh, 14px);
  --solo-blue: #2563eb;
  --solo-blue-dark: #1d4ed8;
  --solo-green: #15803d;
  --solo-green-soft: #dcfce7;
  --solo-red: #b91c1c;
  --solo-red-soft: #fee2e2;
  --solo-amber: #b45309;
  --solo-amber-soft: #fef3c7;
  --solo-ink: #10203b;
  --solo-muted: #607089;
  --solo-border: #d6deea;
  --solo-bg: #f4f7fb;
  --solo-team-a: var(--team-primary);
  --solo-team-a-border: var(--team-primary-dark);
  --solo-team-b: var(--opponent-primary);
  --solo-team-b-border: var(--opponent-primary-dark);
}

#tracker-interface.solo-ready {
  position: fixed;
  inset: 0;
  height: 100dvh;
  min-height: 0 !important;
  overflow: hidden;
  background: var(--solo-bg);
  color: var(--solo-ink);
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
  z-index: 40;
}

#legacy-tracker-ui { display: none !important; }

#solo-logger-root {
  width: min(100%, 760px);
  height: 100%;
  min-height: 0;
  box-sizing: border-box;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: var(--solo-gap);
  padding: clamp(6px, 1.1dvh, 12px) clamp(7px, 1.8vw, 15px);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.solo-phone-landscape-guard { display: none; }

.solo-viewer-mode [data-action="advance-quarter"],
.solo-viewer-mode [data-action="set-centre-pass"],
.solo-viewer-mode [data-action="open-player-picker"],
.solo-viewer-mode [data-action="initiate-shot"],
.solo-viewer-mode [data-action="record-turnover"],
.solo-viewer-mode [data-action="record-pass"],
.solo-viewer-mode [data-action="undo"],
.solo-viewer-mode [data-action="abort-match"],
.solo-viewer-mode [data-action="open-clock-editor"],
.solo-viewer-mode [data-action="cycle-centre-pass"],
.solo-viewer-mode [data-action="record-circle-feed"],
.solo-viewer-mode [data-action="toggle-quarter-clock"] {
  opacity: .58;
  cursor: not-allowed;
}

.solo-topbar,
.solo-context-row,
.solo-timer-actions,
.solo-actions-two,
.solo-bottom-nav {
  display: grid;
  gap: var(--solo-gap);
}
.solo-topbar { grid-template-columns: minmax(72px, 1fr) 1.35fr minmax(72px, 1fr); align-items: stretch; }
.solo-context-row,
.solo-timer-actions { grid-template-columns: 1fr 1fr; }
.solo-context-row > *,
.solo-timer-actions > * { min-width: 0; }
.solo-actions-two { grid-template-columns: 1fr 1fr; }
.solo-bottom-nav { grid-template-columns: repeat(3, 1fr); }

.solo-button,
.solo-select,
.solo-indicator {
  min-height: clamp(38px, 6.1dvh, 58px);
  border-radius: var(--solo-radius);
  border: 1px solid var(--solo-border);
  font-weight: 850;
  letter-spacing: .01em;
  line-height: 1.05;
  box-shadow: 0 2px 7px rgba(25, 48, 83, .08);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.solo-button:active { transform: scale(.98); }
.solo-button:disabled { opacity: .48; filter: grayscale(.2); }

.solo-back,
.solo-quarter,
.solo-neutral { background: #fff; color: #14213a; }
.solo-complete,
.solo-pause { background: linear-gradient(180deg, #4f83ee, var(--solo-blue)); color: #fff; border-color: #1d4ed8; }
.solo-team-a { background: var(--solo-team-a); color: var(--team-foreground); border-color: var(--solo-team-a-border); }
.solo-team-b { background: var(--solo-team-b); color: var(--opponent-foreground); border-color: var(--solo-team-b-border); }
.solo-miss { background: var(--solo-red-soft); color: #991b1b; border-color: #f49a9a; }
.solo-turnover { background: var(--solo-red-soft); color: #991b1b; border-color: #fb8f8f; }
.solo-feed {
  min-height: clamp(51px, 7.95dvh, 75px);
  font-size: clamp(15px, 2.4dvh, 21px);
  font-weight: 950;
}

.solo-clock {
  min-height: clamp(38px, 5.25dvh, 49px);
  padding: 0;
  border: 1px solid #15803d;
  border-radius: var(--solo-radius);
  background: #16a34a;
  font: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: .95;
  color: #fff;
  cursor: pointer;
}
.solo-clock-time { font-size: clamp(23px, 4.3dvh, 38px); font-weight: 950; font-variant-numeric: tabular-nums; }
.solo-clock.paused,
.solo-clock.expired { background: #dc2626; border-color: #b91c1c; color: #fff; }


.solo-score {
  min-height: clamp(40px, 6.3dvh, 58px);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .12em;
  width: 100%;
  border: 1px solid var(--solo-border);
  border-radius: var(--solo-radius);
  background: #fff;
  color: #14213a;
  box-shadow: 0 2px 7px rgba(25, 48, 83, .08);
  font-size: clamp(18px, 3.2dvh, 28px);
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  letter-spacing: .015em;
  line-height: 1;
}
.solo-score strong { font-weight: 950; }
.solo-score-separator { font-weight: 650; }
.solo-score-number { color: #111827; font-weight: 950; }
.solo-score-team-a { color: var(--solo-team-a-border); font-weight: 950; }
.solo-score-team-b { color: var(--solo-team-b-border); font-weight: 950; }

.solo-cp-selector { display: flex; align-items: center; justify-content: center; padding: 4px 10px; }
.solo-cp-line { font-size: clamp(13px, 3.8vw, 18px); font-weight: 750; white-space: nowrap; }
.solo-cp-line strong { font-weight: 950; }

.solo-possession {
  min-height: clamp(38px, 6.1dvh, 58px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px 8px;
  font-size: clamp(13px, 3.8vw, 18px);
  white-space: nowrap;
}

.solo-screen {
  min-height: 0;
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  gap: var(--solo-gap);
  overflow: hidden;
}
.solo-screen.lineup-screen {
  min-height: 0;
  overflow: hidden;
}
.solo-screen-title {
  text-align: center;
  font-size: clamp(11px, 1.8dvh, 16px);
  font-weight: 950;
  text-transform: uppercase;
  line-height: 1;
}

.solo-receivers,
.solo-shooters { min-height: 0; flex: 1; display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: repeat(2, minmax(72px, 1fr)); gap: var(--solo-gap); }
.solo-player-action { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 3px; }
.solo-position { font-size: clamp(25px, 6.2dvh, 58px); font-weight: 950; line-height: .95; }
.solo-result { margin-top: 1px; font-size: clamp(14px, 2.4dvh, 21px); font-weight: 950; line-height: .95; }

/* Shooting has an extra control row, so its labels must scale from each
   button's actual height rather than from the viewport. */
.solo-shooters .solo-player-action { container-type: size; min-height: 72px; padding-block: 3px; overflow: hidden; }
.solo-shooters .solo-position { font-size: clamp(22px, 4.3dvh, 38px); line-height: .88; }
.solo-shooters .solo-result { margin-top: 1px; font-size: clamp(13px, 2dvh, 18px); line-height: .95; }

@supports (font-size: 1cqh) {
  .solo-shooters .solo-position { font-size: clamp(22px, 48cqh, 38px); }
  .solo-shooters .solo-result { font-size: clamp(13px, 24cqh, 18px); }
}

.solo-shooting-stack { min-height: 190px; flex: 1; display: grid; grid-template-rows: minmax(152px, 1fr) auto; gap: var(--solo-gap); }
.solo-shooter-team { text-align: center; font-size: clamp(12px, 2dvh, 18px); font-weight: 950; text-transform: uppercase; }

.solo-utility .solo-button { min-height: clamp(33px, 5dvh, 46px); font-size: clamp(10px, 1.7dvh, 14px); }

.solo-bottom-nav {
  border-top: 1px solid #cad4e2;
  padding-top: max(3px, .5dvh);
}
.solo-nav {
  min-height: clamp(42px, 6.4dvh, 60px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: #fff;
  color: #17223b;
  border: 1px solid #d7deea;
  border-radius: 8px;
  font-size: clamp(9px, 1.45dvh, 12px);
  font-weight: 900;
  text-transform: uppercase;
}
.solo-nav.active { color: #164bb9; border: 2px solid #2f65e5; background: #edf3ff; }
.solo-nav-icon { display: flex; align-items: center; justify-content: center; width: 100%; height: clamp(20px, 3.5dvh, 30px); margin-bottom: 1px; }
.solo-nav-icon svg { width: clamp(25px, 4.4dvh, 38px); height: 100%; fill: none; stroke: currentColor; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.solo-nav-icon .solo-icon-fill { fill: currentColor; stroke: none; }

/* Live Stats uses the same light visual language as the solo logger. */
.live-stats-modal {
  background: rgba(226, 232, 240, .96);
  color: var(--solo-ink);
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
  box-sizing: border-box;
  padding: max(12px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom));
}
.live-stats-panel {
  background: var(--solo-bg);
  border: 1px solid var(--solo-border);
  width: 100%;
  min-width: 0;
  max-width: 42rem;
  max-height: calc(100dvh - max(24px, env(safe-area-inset-top)) - max(24px, env(safe-area-inset-bottom)));
  margin: auto;
  overflow-y: auto;
  overflow-x: hidden;
  box-sizing: border-box;
  overscroll-behavior: contain;
}

.match-modal {
  position: fixed;
  inset: 0;
  z-index: 220;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
  padding: max(14px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
  background: rgba(15, 23, 42, .78);
  backdrop-filter: blur(7px);
}
.match-modal.hidden { display: none; }
.match-modal-panel {
  width: min(100%, 430px);
  max-height: min(88dvh, 720px);
  overflow: auto;
  border: 1px solid #cbd5e1;
  border-radius: 20px;
  background: #fff;
  color: var(--solo-ink);
  box-shadow: 0 24px 70px rgba(15, 23, 42, .3);
  padding: 20px;
}
.match-modal-panel h2 { margin: 3px 0 8px; color: #14213a; font-size: 23px; font-weight: 950; line-height: 1.08; }
.match-modal-panel p { color: var(--solo-muted); font-size: 14px; font-weight: 700; line-height: 1.4; }
.match-modal-eyebrow { color: var(--solo-blue); font-size: 11px; font-weight: 950; letter-spacing: .12em; text-transform: uppercase; }
.match-modal-actions { display: grid; gap: 10px; margin-top: 18px; }
.match-modal-actions button {
  min-height: 48px;
  border: 1px solid #bfdbfe;
  border-radius: 12px;
  background: #eff6ff;
  color: #1e3a8a;
  font-size: 15px;
  font-weight: 900;
}
.miss-possession-panel { width: min(100%, 390px); text-align: center; }
.miss-possession-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 18px; }
.miss-possession-actions button {
  min-height: 62px;
  border: 2px solid #1d4ed8;
  border-radius: 14px;
  background: #2563eb;
  color: #fff;
  font-size: 18px;
  font-weight: 950;
}
.miss-possession-actions button + button { border-color: #6d28d9; background: #7c3aed; }
.score-correction-card { width: min(100%, 390px); }
.score-correction-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 18px; }
.score-correction-fields label { display: grid; gap: 6px; color: #334155; font-size: 12px; font-weight: 950; text-transform: uppercase; }
.score-correction-fields input {
  width: 100%;
  min-height: 54px;
  box-sizing: border-box;
  border: 1px solid #94a3b8;
  border-radius: 12px;
  background: #f8fafc;
  color: #0f172a;
  font: 950 25px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  text-align: center;
}
.score-correction-actions { grid-template-columns: 1fr 1fr; }
.score-correction-actions button:last-child { border-color: #1d4ed8; background: #2563eb; color: #fff; }
@media (max-height: 620px) {
  .match-modal-panel { max-height: 94dvh; padding: 14px; }
  .match-modal-panel h2 { font-size: 20px; }
  .match-modal-actions { gap: 7px; margin-top: 10px; }
  .match-modal-actions button { min-height: 42px; }
}
.live-stats-header {
  position: sticky;
  top: -16px;
  z-index: 3;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px;
  margin: -16px -16px 0;
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--solo-border);
  background: rgba(244, 247, 252, .97);
  backdrop-filter: blur(10px);
}
.live-stats-header h2 { position: absolute; left: 50%; width: min(48%, 280px); color: #1d4ed8; font-size: clamp(15px, 4.2vw, 22px); font-weight: 950; text-align: center; line-height: 1.1; transform: translateX(-50%); white-space: nowrap; pointer-events: none; }
.live-stats-close, .live-stats-back, .live-stats-share {
  min-height: 44px;
  padding: 8px 11px;
  border: 1px solid var(--solo-border);
  border-radius: 12px;
  background: #fff;
  color: var(--solo-ink);
  box-shadow: 0 2px 7px rgba(25, 48, 83, .08);
  font-size: 14px;
  font-weight: 950;
}
.live-stats-back { grid-column: 1; grid-row: 1; justify-self: start; }
.live-stats-header-actions { grid-column: 2; grid-row: 1; display: flex; justify-self: end; gap: 6px; }
.live-stats-share { color: #1d4ed8; white-space: nowrap; }
.live-stats-close { justify-self: end; }
@media (max-width: 470px) {
  .live-stats-header-actions { gap: 4px; }
  .live-stats-close, .live-stats-back, .live-stats-share { padding: 7px 8px; font-size: 12px; }
}
.live-stats-panel #results-content, .live-stats-body { width: 100%; min-width: 0; max-width: 100%; }
.live-stats-body { display: grid; gap: 14px; padding-bottom: max(12px, env(safe-area-inset-bottom)); }
.live-stats-scoreboard { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: stretch; }
.live-stats-scoreboard.without-clock { grid-template-columns: 1fr 1fr; }
.live-stats-score-team, .live-stats-score-meta { display: flex; align-items: center; justify-content: center; border-radius: 13px; border: 1px solid var(--solo-border); background: #fff; min-height: 72px; }
.live-stats-score-team { flex-direction: column; }
.live-stats-score-team .live-stats-score-name { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 7px; font-size: 13px; font-weight: 950; letter-spacing: .01em; }
.live-stats-score-team .live-stats-score-abbrev { font-size: 10px; font-weight: 900; letter-spacing: .1em; opacity: .82; }
.live-stats-score-team strong { font-size: 36px; line-height: 1; font-variant-numeric: tabular-nums; }
.live-stats-score-team.team-a { background: var(--solo-team-a); border-color: var(--solo-team-a-border); color: var(--team-foreground); text-shadow: var(--team-text-shadow); }
.live-stats-score-team.team-b { background: var(--solo-team-b); border-color: var(--solo-team-b-border); color: var(--opponent-foreground); text-shadow: var(--opponent-text-shadow); }
.live-stats-score-meta { min-width: 82px; flex-direction: column; gap: 2px; }
.live-stats-score-meta span { color: #64748b; font-size: 11px; font-weight: 950; letter-spacing: .08em; text-transform: uppercase; }
.live-stats-score-meta strong { color: #10203b; font-size: 23px; font-variant-numeric: tabular-nums; letter-spacing: -.03em; line-height: 1; }
.live-stats-score-meta.is-running { border-color: #86c99a; background: #f0fdf4; }
.live-stats-score-meta.is-paused { border-color: #cbd5e1; background: #f8fafc; }
.live-stats-card { min-width: 0; max-width: 100%; box-sizing: border-box; background: #fff; border: 1px solid var(--solo-border); border-radius: 13px; padding: 12px; box-shadow: 0 2px 7px rgba(25, 48, 83, .06); }
.live-stats-card > h3 { color: #1e3a8a; border-bottom: 1px solid #dbe3ee; padding-bottom: 8px; margin-bottom: 8px; font-size: 16px; font-weight: 950; text-transform: uppercase; letter-spacing: .03em; }
.live-stats-section-menu { display: grid; gap: 10px; }
.live-stats-section-menu button {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 10px;
  align-items: center;
  min-height: 78px;
  padding: 14px 18px;
  border: 2px solid #cad5e5;
  border-radius: 14px;
  background: #fff;
  color: var(--solo-ink);
  text-align: left;
  box-shadow: 0 2px 7px rgba(25, 48, 83, .06);
}
.live-stats-section-menu button span { font-size: 19px; font-weight: 950; }
.live-stats-section-menu button small { grid-column: 1; color: #64748b; font-size: 13px; font-weight: 750; }
.live-stats-section-menu button b { grid-column: 2; grid-row: 1 / span 2; color: #1d4ed8; font-size: 30px; line-height: 1; }
.live-stats-table-scroll { width: 100%; min-width: 0; max-width: 100%; overflow-x: auto; }
.live-stats-quarter-table { width: 100%; min-width: 320px; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.live-stats-quarter-table th, .live-stats-quarter-table td { padding: 9px 5px; border-bottom: 1px solid #e2e8f0; font-size: 13px; text-align: center; white-space: nowrap; }
.live-stats-quarter-table thead th { color: #64748b; font-size: 12px; font-weight: 950; }
.live-stats-quarter-table tbody th { max-width: 132px; color: #334155; font-weight: 900; text-align: left; white-space: normal; }
.live-stats-quarter-table tbody td { color: #334155; font-weight: 850; }
.live-stats-stacked-value { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; line-height: 1.05; }
.live-stats-stacked-value strong { font-size: 13px; font-weight: 950; }
.live-stats-stacked-value small { font-size: 11px; font-weight: 850; opacity: .82; }
.live-stats-quarter-table tbody tr.team-a th, .live-stats-quarter-table tbody tr.team-a td { color: var(--solo-team-a-border); }
.live-stats-quarter-table tbody tr.team-b th, .live-stats-quarter-table tbody tr.team-b td { color: var(--solo-team-b-border); }
.live-stats-zone-card .six-zone-card { border: 0; background: transparent; padding: 0; box-shadow: none; }
.live-stats-zone-card .six-zone-card > p { font-size: 11px; }
.live-stats-zone-strip { display: flex; width: 100%; min-width: 0; max-width: 100%; contain: inline-size; gap: 12px; overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; scroll-snap-type: x mandatory; padding: 2px 2px 8px; box-sizing: border-box; overscroll-behavior-inline: contain; }
.live-stats-zone-strip > .six-zone-card { flex: 0 0 clamp(250px, 82vw, 310px); min-width: 0; max-width: calc(100% - 12px); box-sizing: border-box; scroll-snap-align: start; border: 1px solid #dbe3ee; border-radius: 12px; background: #f8fafc; padding: 10px; }
.live-stats-heatmap-strip { display: flex; width: 100%; min-width: 0; gap: 12px; overflow-x: auto; -webkit-overflow-scrolling: touch; scroll-snap-type: x mandatory; padding: 2px 2px 8px; }
.live-stats-heatmap-card { flex: 0 0 clamp(250px, 82vw, 310px); max-width: calc(100% - 12px); scroll-snap-align: start; border: 1px solid #dbe3ee; border-radius: 12px; padding: 10px; background: linear-gradient(180deg, #f8fafc, #eaf1f8); color: #0f172a; text-align: center; box-sizing: border-box; }
.live-stats-heatmap-card h4 { margin: 0 0 7px; font-size: 12px; font-weight: 950; text-transform: uppercase; }
.live-stats-heatmap-card small { display: block; margin-top: 6px; color: #64748b; font-size: 10px; font-weight: 800; }
.live-stats-heatmap-court { position: relative; width: 100%; aspect-ratio: 2 / 1; overflow: hidden; border-radius: 8px; background: #fff; }
.live-stats-heatmap-court svg, .live-stats-heatmap-court canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.live-stats-heatmap-court svg { fill: #f8fafc; stroke: #64748b; stroke-width: .65; }
.live-stats-heatmap-court canvas { z-index: 1; pointer-events: none; }
.live-stats-heatmap-court .live-stats-distance-line { fill: none; stroke: #94a3b8; stroke-dasharray: 2 1.5; }
.live-stats-heatmap-court .live-stats-goal-post { fill: #0f172a; stroke: none; }
.live-stats-column-heads { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr) minmax(0, 1fr); gap: 8px; align-items: center; text-align: center; padding: 3px 0 7px; font-size: 13px; font-weight: 950; text-transform: uppercase; letter-spacing: .01em; }
.live-stats-column-heads span:first-child { color: #64748b; text-align: left; }
.live-stats-column-heads span:nth-child(2), .live-stats-column-heads span:nth-child(3) { color: #475569; }
.live-stats-comparison-row { border-top: 1px solid #e2e8f0; padding: 10px 0; }
.live-stats-comparison-row > h4 { color: #0f172a; font-size: 15px; font-weight: 950; margin-bottom: 7px; }
.live-stats-team-line { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr) minmax(0, 1fr); gap: 8px; align-items: center; min-height: 25px; }
.live-stats-team-line > strong { font-size: 14px; font-weight: 900; }
.live-stats-team-line > div { display: contents; }
.live-stats-quarter-value, .live-stats-match-value { min-width: 0; color: #334155; font-size: 14px; font-weight: 950; text-align: center; white-space: nowrap; }
.live-stats-team-line.team-a, .live-stats-team-line.team-a .live-stats-quarter-value, .live-stats-team-line.team-a .live-stats-match-value,
.live-stats-detail-row.team-a, .live-stats-detail-row.team-a .live-stats-quarter-value, .live-stats-detail-row.team-a .live-stats-match-value,
.live-stats-distribution-grid .team-a .live-stats-quarter-value, .live-stats-distribution-grid .team-a .live-stats-match-value { color: #15803d; }
.live-stats-team-line.team-b, .live-stats-team-line.team-b .live-stats-quarter-value, .live-stats-team-line.team-b .live-stats-match-value,
.live-stats-distribution-grid .team-b .live-stats-quarter-value, .live-stats-distribution-grid .team-b .live-stats-match-value { color: #b91c1c; }
.live-stats-detail-row { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr) minmax(0, 1fr); gap: 8px; align-items: center; border-top: 1px solid #e2e8f0; padding: 10px 0; }
.live-stats-detail-row:first-of-type { border-top: 0; }
.live-stats-detail-row > strong { color: inherit; font-size: 14px; }
.live-stats-detail-row > strong small { color: #64748b; font-size: 12px; margin-left: 3px; }
.live-stats-detail-row > div:not(.live-stats-substat) { display: contents; }
.live-stats-detail-row > .live-stats-empty { grid-column: 2 / -1; font-size: 13px; }
.live-stats-substat { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr) minmax(0, 1fr); gap: 8px; align-items: center; margin-top: 2px; }
.live-stats-substat > strong { color: inherit; font-size: 13px; }
.live-stats-empty { color: #64748b; font-size: 13px; font-style: italic; line-height: 1.4; }
.live-stats-distribution-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; border-top: 1px solid #eef2f7; margin-top: 5px; padding-top: 10px; }
.live-stats-distribution-grid h4 { color: #475569; font-size: 13px; font-weight: 950; text-transform: uppercase; letter-spacing: .01em; margin-bottom: 5px; }
.live-stats-distribution-row { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr) minmax(0, 1fr); gap: 6px; align-items: center; border-top: 1px solid #e2e8f0; padding: 7px 0; }
.live-stats-distribution-row > span { color: #334155; font-size: 13px; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.live-stats-distribution-row > div { display: contents; }

@media (max-width: 430px) {
  .live-stats-distribution-grid { grid-template-columns: 1fr; }
  .live-stats-column-heads, .live-stats-team-line, .live-stats-detail-row, .live-stats-substat { gap: 5px; }
  .live-stats-quarter-value, .live-stats-match-value { font-size: 13px; }
  .live-stats-panel { padding: 12px; }
  .live-stats-header { top: -12px; margin: -12px -12px 0; padding: 12px 12px 10px; }
  .live-stats-scoreboard { gap: 7px; }
  .live-stats-score-team, .live-stats-score-meta { min-height: 64px; }
  .live-stats-score-team strong { font-size: 31px; }
  .live-stats-score-meta { min-width: 58px; }
  .live-stats-quarter-table th, .live-stats-quarter-table td { padding-inline: 4px; font-size: 12px; }
}

/* Netball court lineup. The fixed 1.6:1 display ratio is 25% wider than the
   geometric 2:1 court and is fitted without independent axis compression. */
.solo-lineup-wrap {
  min-height: 0;
  flex: 1 1 0;
  display: grid;
  place-items: center;
  box-sizing: border-box;
  padding: 2px 0 8px;
}
.solo-court {
  position: relative;
  width: min(56vw, 21dvh, 390px);
  height: auto;
  min-width: 128px;
  aspect-ratio: 5 / 8;
  container-type: inline-size;
  border: clamp(2px, .35dvh, 4px) solid #9aa1aa;
  border-radius: 4px;
  background: linear-gradient(90deg, #fff, #f8fafc 50%, #fff);
  overflow: hidden;
}
.solo-third-line { position: absolute; left: 0; right: 0; height: 2px; background: #9aa1aa; }
.solo-third-one { top: 33.333%; }
.solo-third-two { top: 66.666%; }
.solo-goal-circle { position: absolute; left: 50%; width: 62%; aspect-ratio: 1/1; border: 2px solid #a1a1aa; border-radius: 50%; transform: translate(-50%, -50%); }
.solo-goal-top { top: 0; }
.solo-goal-bottom { top: 100%; }
.solo-court-player {
  position: absolute;
  width: clamp(38px, 6.6dvh, 64px);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border: 0;
  border-radius: 50%;
  color: #fff;
  font-size: clamp(14px, 2.5dvh, 22px);
  font-weight: 950;
  box-shadow: 0 3px 8px rgba(15,23,42,.2);
}
.solo-court-player::after {
  content: attr(data-name);
  position: absolute;
  left: 50%; top: calc(100% + 3px);
  transform: translateX(-50%);
  width: clamp(72px, 24dvh, 100px);
  color: #17223b;
  font-size: clamp(9px, 1.5dvh, 12px);
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
}

.solo-court-player { width: clamp(40px, 18cqw, 68px); }
.solo-court-player::after {
  width: clamp(72px, 42cqw, 100px);
  font-size: clamp(9px, 3.6cqw, 12px);
}
.pos-gs { left: 50%; top: 10%; background: #ed174c; }
.pos-ga { left: 75%; top: 27%; background: #ed7148; }
.pos-wa { left: 23%; top: 27%; background: #f7a928; }
.pos-c  { left: 50%; top: 50%; background: #4e9a47; }
.pos-wd { left: 77%; top: 73%; background: #7849ad; }
.pos-gd { left: 25%; top: 73%; background: #258f81; }
.pos-gk { left: 50%; top: 84%; background: #29496f; }

/* Tablets have enough vertical room to restore the larger coaching court. */
@media (min-width: 700px) and (min-height: 800px) and (orientation: portrait) {
  .solo-court { width: min(48vw, 29dvh, 390px); }
}

@media (orientation: landscape) and (max-height: 600px) {
  #solo-logger-root {
    width: min(100%, 1050px);
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    grid-template-rows: auto auto auto auto minmax(0,1fr) auto auto auto;
    column-gap: 10px;
  }
  .solo-topbar { grid-column: 1 / -1; }
  .solo-score { grid-column: 1 / -1; }
  .solo-context-row { grid-column: 1 / -1; }
  .solo-screen { grid-column: 1 / -1; }
  .solo-timer-actions { grid-column: 1; }
  .solo-utility { grid-column: 2; grid-row: 6; }
  .solo-bottom-nav { grid-column: 1 / -1; }
  .solo-court { width: min(48vw, 285px); }
}

/* A compact touch screen is treated as a phone. Its logger deliberately stops
   in landscape rather than compressing the controls into an unsafe tap area.
   Larger touch screens and pointer-driven computers retain landscape access. */
@media (orientation: landscape) {
  #solo-logger-root.solo-phone-device {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: max(16px, env(safe-area-inset-top)) max(22px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(22px, env(safe-area-inset-left));
  }
  #solo-logger-root.solo-phone-device > :not(.solo-phone-landscape-guard) {
    display: none !important;
  }
  #solo-logger-root.solo-phone-device .solo-phone-landscape-guard {
    display: flex;
    max-width: 560px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-align: center;
  }
  .solo-phone-landscape-guard-icon {
    font-size: clamp(34px, 10dvh, 58px);
    line-height: 1;
    color: var(--solo-blue);
  }
  .solo-phone-landscape-guard h2 {
    margin: 0;
    font-size: clamp(22px, 6dvh, 34px);
    font-weight: 950;
    line-height: 1.05;
    color: var(--solo-ink);
  }
  .solo-phone-landscape-guard p {
    margin: 0;
    font-size: clamp(14px, 3.6dvh, 18px);
    font-weight: 750;
    line-height: 1.25;
    color: var(--solo-muted);
  }
  .solo-compact-touch-device .live-stats-modal { display: none !important; }
}

@media (max-height: 650px) and (orientation: portrait) {
  #solo-logger-root { --solo-gap: 4px; padding-top: 4px; padding-bottom: 4px; }
  .solo-button, .solo-select { min-height: 33px; }
  .solo-player-action .solo-position { font-size: clamp(23px, 5.4dvh, 38px); }
}

/* Alpha 0.33 locked UI refinements */
.solo-quarter {
  text-align: center;
  text-align-last: center;
  padding-inline: clamp(8px, 2vw, 16px);
  font-size: clamp(17px, 2.8dvh, 24px);
  font-weight: 950;
}
.solo-back {
  font-size: clamp(16px, 2.7dvh, 23px);
  font-weight: 950;
}
.solo-utility .solo-button {
  font-size: clamp(13px, 2.05dvh, 18px);
  font-weight: 950;
}
.solo-midcourt-turnover {
  min-height: clamp(42px, 6.2dvh, 58px);
  flex: 0 0 auto;
}

/* The site advertisement owns the device safe area. Every full-screen app
   surface uses the same lower boundary, so it can scroll beneath the fixed ad
   without placing controls behind it. */
#main-dashboard:not(.hidden),
#team-manager-screen:not(.hidden),
#player-cards-screen:not(.hidden),
#opponent-history-screen:not(.hidden),
.dashboard-perspective-overlay:not(.hidden),
.history-association-overlay:not(.hidden),
.team-manager-modal:not(.hidden),
.league-editor-modal:not(.hidden),
.match-setup-overlay:not(.hidden),
.confirmation-overlay:not(.hidden),
.fixed.inset-0,
.match-modal {
  top: var(--site-banner-height);
  bottom: 0;
}

#tracker-interface.solo-ready {
  inset: var(--site-banner-height) 0 0;
  height: calc(100dvh - var(--site-banner-height));
  padding-top: 0;
}

#main-dashboard:not(.hidden) { padding-top: 18px; }
#team-manager-screen:not(.hidden),
#player-cards-screen:not(.hidden),
#opponent-history-screen:not(.hidden),
.team-manager-modal:not(.hidden) { padding-top: 14px; }
.dashboard-perspective-overlay:not(.hidden),
.history-association-overlay:not(.hidden),
.league-editor-modal:not(.hidden) { padding-top: 18px; }
.match-setup-overlay:not(.hidden),
.confirmation-overlay:not(.hidden) { padding-top: 16px; }
.live-stats-modal { padding-top: 12px; }
.match-modal { padding-top: 14px; }
.live-stats-panel {
  max-height: calc(100dvh - var(--site-banner-height) - 24px - env(safe-area-inset-bottom, 0px));
}
.match-modal-panel {
  max-height: min(calc(100dvh - var(--site-banner-height) - 28px), 720px);
}
