/* Alpha 0.33 solo logger 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;
}

#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%;
  margin: 0 auto;
  display: grid;
  grid-template-rows: auto auto auto auto minmax(0, 1fr) auto auto auto;
  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-topbar,
.solo-row-two,
.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-row-two { grid-template-columns: 1fr 1fr; }
.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-secondary { 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-green-soft); color: #14532d; border-color: #86c98f; }
.solo-team-b { background: var(--solo-red-soft); color: #991b1b; border-color: #f49a9a; }
.solo-turnover { background: var(--solo-red-soft); color: #991b1b; border-color: #fb8f8f; }
.solo-feed { background: var(--solo-amber-soft); color: #92400e; border-color: #efc45c; }

.solo-clock {
  min-height: clamp(44px, 7dvh, 65px);
  padding: 0;
  border: 0;
  background: transparent;
  font: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: .95;
  color: #061027;
  cursor: pointer;
}
.solo-clock-time { font-size: clamp(24px, 5.1dvh, 42px); font-weight: 950; font-variant-numeric: tabular-nums; }
.solo-clock-quarter { margin-top: 4px; font-size: clamp(10px, 1.7dvh, 14px); font-weight: 900; }
.solo-clock.paused .solo-clock-time { color: #b45309; }
.solo-clock.expired .solo-clock-time { color: #b91c1c; }


.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-cp-selector { display: flex; align-items: center; justify-content: center; padding: 4px 10px; }
.solo-cp-line { font-size: clamp(12px, 2dvh, 18px); font-weight: 750; white-space: nowrap; }
.solo-cp-line strong { font-weight: 950; }

.solo-possession {
  min-height: clamp(52px, 8dvh, 76px);
  display: flex;
  align-items: center;
  justify-content: center;
  background: #e8f7e9;
  border-color: #83c88b;
  font-size: clamp(15px, 2.5dvh, 22px);
  text-transform: uppercase;
}
.solo-possession.team-b { background: #ffe9e9; border-color: #f3a0a0; color: #8f1717; }

.solo-screen {
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: var(--solo-gap);
  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: 1fr 1fr; gap: var(--solo-gap); }
.solo-player-action { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 3px; }
.solo-player-name { max-width: 95%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: clamp(9px, 1.65dvh, 14px); font-weight: 750; }
.solo-position { font-size: clamp(25px, 6.2dvh, 58px); font-weight: 950; line-height: .95; }
.solo-result { margin-top: 3px; font-size: clamp(11px, 2dvh, 18px); font-weight: 950; }

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

.solo-lower-stack { display: grid; gap: var(--solo-gap); }
.solo-lower-stack .solo-button { min-height: clamp(34px, 5.3dvh, 50px); }
.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);
  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: block; font-size: clamp(15px, 2.7dvh, 23px); margin-bottom: 2px; }

/* 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); }
.live-stats-panel { background: var(--solo-bg); border: 1px solid var(--solo-border); }
.live-stats-header { border-bottom: 1px solid var(--solo-border); }
.live-stats-header h2 { color: #1d4ed8; }
.live-stats-close { background: #fff; border: 1px solid var(--solo-border); color: var(--solo-ink); box-shadow: 0 2px 7px rgba(25, 48, 83, .08); }
.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-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 span { font-size: 13px; font-weight: 950; letter-spacing: .08em; }
.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-green-soft); border-color: #86c98f; color: #14532d; }
.live-stats-score-team.team-b { background: var(--solo-red-soft); border-color: #f49a9a; color: #991b1b; }
.live-stats-score-meta { min-width: 76px; flex-direction: column; }
.live-stats-score-meta strong { font-size: 19px; }
.live-stats-card { 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-super-card { border-color: #c4b5fd; background: #faf8ff; }
.live-stats-super-card > h3 { color: #6d28d9; border-color: #ddd6fe; }
.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; }
}

/* Netball court lineup */
.solo-lineup-wrap { min-height: 0; flex: 1; display: flex; align-items: stretch; justify-content: center; }
.solo-court {
  position: relative;
  height: 100%;
  width: min(100%, calc((100dvh - 245px) * .54));
  min-width: 205px;
  max-width: 390px;
  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(46px, 7.7dvh, 68px);
  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: 100px;
  color: #17223b;
  font-size: clamp(8px, 1.35dvh, 11px);
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
}
.pos-gs { left: 50%; top: 8%; 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: 88%; background: #29496f; }

@media (orientation: landscape) and (max-height: 600px) {
  #solo-logger-root {
    width: min(100%, 1050px);
    grid-template-columns: 1.05fr 1fr;
    grid-template-rows: auto auto auto minmax(0,1fr) auto;
    column-gap: 10px;
  }
  .solo-topbar { grid-column: 1 / -1; }
  .solo-score { grid-column: 1 / -1; }
  .solo-row-two { grid-column: 1; }
  .solo-possession { grid-column: 2; grid-row: 3; }
  .solo-screen { grid-column: 1 / -1; }
  .solo-lower-stack { grid-column: 1; }
  .solo-utility { grid-column: 2; }
  .solo-bottom-nav { grid-column: 1 / -1; }
  .solo-screen:not(.lineup-screen) { display: grid; grid-template-columns: 1.55fr 1fr; }
  .solo-screen-title { grid-column: 1 / -1; }
  .solo-receivers, .solo-shooting-stack { grid-column: 1; grid-row: 2 / span 3; }
  .solo-screen > .solo-lower-stack { grid-column: 2; }
  .solo-court { width: min(48vw, 285px); }
}

@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-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;
}
