:root {
  font-family: Inter, Pretendard, "Noto Sans KR", Arial, sans-serif;
  color: #EDF1F6;
  background: #0A0D12;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.035), transparent 36rem),
    #0A0D12;
  overscroll-behavior: none;
}

button,
input {
  font: inherit;
}

input,
textarea,
select,
.roster-inputs,
.roster-inputs label,
.slot-editor,
.slot-editor label,
.matchup-team,
.matchup-team label {
  touch-action: auto;
  user-select: text;
  -webkit-user-select: text;
  -webkit-touch-callout: default;
}

input,
textarea,
select {
  -webkit-tap-highlight-color: rgba(148, 163, 184, 0.14);
}

button {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

button,
.court-card,
.current-court-layout,
.overview-panel,
.drawing-layer,
.drawing-canvas,
.draggable-player,
.sideout-orb,
.rotation-step-buttons {
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.app-header,
main,
footer {
  width: min(1480px, calc(100% - 32px));
  margin-inline: auto;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 0 14px;
}

.header-brand {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, auto) minmax(180px, auto);
  align-items: center;
  column-gap: clamp(24px, 5vw, 72px);
  row-gap: 4px;
}

.header-credit {
  display: grid;
  gap: 2px;
  color: #7C8A9A;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-align: right;
  text-transform: uppercase;
}

.header-credit strong {
  color: #EDF1F6;
  font-size: 13px;
  font-weight: 950;
  letter-spacing: 0.08em;
}

.header-tools {
  display: grid;
  justify-items: end;
  gap: 8px;
}

.sync-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.game-mode-button {
  border: 1px solid #FFB37A;
  background: #FF7A29;
  color: #fff;
  box-shadow: 0 8px 18px rgba(255, 122, 41, 0.18);
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  color: #EDF1F6;
  font-size: clamp(28px, 5vw, 44px);
  font-weight: 900;
  letter-spacing: -0.06em;
}

h1 small {
  color: #7C8A9A;
  font-size: 0.46em;
  font-weight: 750;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.build-label {
  grid-column: 1 / -1;
  margin-top: 0;
  color: #7C8A9A;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.creator-label {
  margin-top: 4px;
  color: #7C8A9A;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

h2 {
  color: #EDF1F6;
  font-size: 21px;
  letter-spacing: -0.04em;
}

h3 {
  color: #EDF1F6;
  font-size: 19px;
  letter-spacing: -0.03em;
}

.eyebrow {
  color: #7C8A9A;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.status-badge,
.summary-pill {
  border: 1px solid #3A4553;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: #B9C4CF;
  font-size: 12px;
  font-weight: 800;
  padding: 8px 12px;
}

main {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  min-width: 0;
  padding-bottom: 32px;
}

section {
  min-width: 0;
  max-width: 100%;
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.045);
  box-shadow: 0 14px 35px rgba(35, 109, 113, 0.08);
  padding: 20px;
  transition:
    opacity 240ms ease,
    transform 240ms ease,
    padding 240ms ease;
}

.section-heading,
.team-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.current-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.save-placement-button {
  margin-left: auto;
}

.help-text {
  margin-top: 8px;
  color: #96A2AF;
  font-size: 13px;
  line-height: 1.6;
}

.help-text.compact {
  margin: 0;
}

.overview-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

.text-button {
  border: 0;
  border-radius: 999px;
  background: #182029;
  color: #8B96A3;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  padding: 8px 12px;
}

.text-button.active {
  background: #FF7A29;
  color: #fff;
}

.primary-button {
  border: 0;
  border-radius: 999px;
  background: #FF7A29;
  color: #fff;
  cursor: pointer;
  font-size: 13px;
  font-weight: 900;
  padding: 11px 16px;
}

.situation-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.situation-options input {
  position: absolute;
  opacity: 0;
}

.situation-options span {
  display: block;
  border: 1px solid #3A4553;
  border-radius: 999px;
  background: #1D242E;
  color: #8B96A3;
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
  padding: 9px 13px;
}

.situation-options input:checked + span {
  border-color: #FF7A29;
  background: #FF7A29;
  color: #fff;
}

.matchup-grid,
.roster-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.matchup-team,
.roster-team {
  min-width: 0;
  border-radius: 16px;
  overflow: visible;
  padding: 0 0 14px;
}

.matchup-team.home,
.roster-team.home {
  background: #182029;
}

.matchup-team.away,
.roster-team.away {
  background: #241C1A;
}

.roster-team-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 16px 16px 0 0;
  background: rgba(255, 255, 255, 0.045);
  padding: 12px 14px 10px;
}

.roster-team-header .eyebrow,
.matchup-team > .eyebrow {
  color: #C7D2DC;
  font-size: 14px;
  font-weight: 950;
  letter-spacing: 0.12em;
}

.matchup-team label,
.roster-inputs label {
  display: grid;
  gap: 6px;
  color: #96A2AF;
  font-size: 12px;
  font-weight: 800;
}

.matchup-team label {
  margin-top: 10px;
}

.matchup-team input,
.matchup-team select,
.roster-inputs input {
  width: 100%;
  min-height: 37px;
  border: 1px solid #313B48;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.045);
  color: #EDF1F6;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.25;
  outline: none;
  padding: 9px 10px;
}

.combo-input {
  position: relative;
  display: block;
  width: 100%;
}

.combo-input input {
  padding-right: 46px;
}

.combo-arrow {
  position: absolute;
  top: 50%;
  right: 1px;
  display: grid;
  width: 42px;
  min-width: 42px;
  height: calc(100% - 2px);
  min-height: 40px;
  place-items: center;
  border: 0;
  border-left: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 0 9px 9px 0;
  background: rgba(29, 36, 46, 0.96);
  color: #FF7A29;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  font-weight: 950;
  line-height: 1;
  touch-action: manipulation;
  transform: translateY(-50%);
  -webkit-tap-highlight-color: transparent;
}

.combo-arrow:active,
.combo-arrow:focus-visible {
  background: #182029;
  color: #FFB88A;
  outline: none;
}

.combo-menu {
  position: absolute;
  top: calc(100% + 5px);
  right: 0;
  left: 0;
  z-index: 80;
  display: none;
  max-height: 220px;
  overflow-y: auto;
  border: 1px solid #3A4553;
  border-radius: 12px;
  background: #1D242E;
  box-shadow: 0 14px 28px rgba(12, 76, 80, 0.16);
  padding: 4px;
  -webkit-overflow-scrolling: touch;
}

.combo-input.open .combo-menu {
  display: grid;
  gap: 0;
}

.combo-input.disabled {
  opacity: 0.72;
}

.combo-input.disabled .combo-arrow {
  pointer-events: none;
}

.combo-option {
  display: flex;
  align-items: center;
  min-height: 40px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #EDF1F6;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  font-weight: 800;
  padding: 9px 10px;
  text-align: left;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.combo-option-pair {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 0;
  padding: 0;
}

.combo-option-pair:last-child {
  border-bottom: 0;
}

.combo-cell {
  display: flex;
  align-items: center;
  min-height: 40px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  font-weight: 850;
  justify-content: center;
  padding: 9px 10px;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.combo-cell + .combo-cell {
  border-left: 1px solid rgba(148, 163, 184, 0.16);
}

.combo-option-pair:first-child .combo-cell:first-child {
  border-top-left-radius: 8px;
}

.combo-option-pair:first-child .combo-cell:last-child {
  border-top-right-radius: 8px;
}

.combo-option-pair:last-child .combo-cell:first-child {
  border-bottom-left-radius: 8px;
}

.combo-option-pair:last-child .combo-cell:last-child {
  border-bottom-right-radius: 8px;
}

.combo-cell:hover,
.combo-cell:focus-visible {
  background: #182029;
  color: #FF7A29;
  outline: none;
}

.combo-option:hover,
.combo-option:focus-visible,
.combo-option.selected {
  color: #FF7A29;
  outline: none;
}

.combo-option.selected .combo-cell {
  color: #FF7A29;
}

.combo-empty {
  min-height: 40px;
  color: #7C8A9A;
  cursor: default;
}

.matchup-team input::placeholder {
  color: rgba(154, 167, 181, 0.62);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.25;
}

.matchup-team select {
  appearance: auto;
}

.matchup-team input:focus,
.matchup-team select:focus,
.roster-inputs input:focus {
  border-color: #FF7A29;
  box-shadow: 0 0 0 3px rgba(255, 122, 41, 0.12);
}

.matchup-result {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  border-radius: 13px;
  background: #182029;
  color: #8B96A3;
  font-size: 13px;
  padding: 12px 14px;
}

.matchup-panel {
  border: 2px solid rgba(148, 163, 184, 0.46);
  background: rgba(255, 255, 255, 0.045);
}

.matchup-analysis-panel {
  border: 2px solid rgba(148, 163, 184, 0.46);
  background: rgba(255, 255, 255, 0.045);
}

.analysis-front-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.analysis-front-row .front-toggle {
  min-width: 182px;
}

.analysis-front-row .front-toggle input {
  accent-color: #FF7A29;
}

.analysis-jog-readout {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.analysis-jog-readout .rotation-jog-team {
  min-width: 0;
}

.analysis-jog-readout.interactive .rotation-jog-team {
  grid-template-columns: auto auto 1fr auto;
}

.matchup-result strong {
  color: #C7D2DC;
  font-size: 16px;
  font-weight: 950;
  line-height: 1.45;
  text-align: right;
  white-space: pre-line;
}

.analysis-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.analysis-tab {
  border: 1px solid #3A4553;
  border-radius: 999px;
  background: #1D242E;
  color: #8B96A3;
  cursor: pointer;
  font-size: 12px;
  font-weight: 950;
  padding: 9px 14px;
}

.analysis-tab.active {
  border-color: #FF7A29;
  background: #FF7A29;
  color: #fff;
}

.analysis-tab-panel {
  display: none;
  margin-top: 14px;
}

.analysis-tab-panel.active {
  display: block;
}

.analysis-form-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.analysis-form-grid.compact {
  grid-template-columns: minmax(105px, 0.8fr) minmax(105px, 0.8fr) minmax(188px, 1.4fr) minmax(126px, 1fr);
}

.analysis-form-grid.full-analysis-controls {
  grid-template-columns:
    minmax(82px, 0.75fr)
    minmax(82px, 0.75fr)
    minmax(155px, 1.25fr)
    minmax(105px, 0.9fr)
    auto;
  align-items: end;
  gap: 8px;
}

.analysis-form-grid label {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: #96A2AF;
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}

.analysis-form-grid select {
  width: 100%;
  min-width: 0;
  min-height: 37px;
  border: 1px solid #313B48;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.045);
  color: #EDF1F6;
  font-size: 13px;
  font-weight: 800;
  outline: none;
  padding: 8px 10px;
}

.analysis-form-grid .combo-input input {
  width: 100%;
  min-width: 0;
  min-height: 37px;
  border: 1px solid #313B48;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.045);
  color: #EDF1F6;
  font-family: inherit;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.25;
  outline: none;
  padding: 8px 46px 8px 10px;
}

.analysis-form-grid .combo-input input::placeholder {
  color: rgba(154, 167, 181, 0.62);
  font-family: inherit;
  font-size: 13px;
  font-weight: 800;
}

.analysis-form-grid .combo-input input:focus {
  border-color: #FF7A29;
  box-shadow: 0 0 0 3px rgba(255, 122, 41, 0.12);
}

.combo-option-full {
  display: block;
  min-height: 0;
  padding: 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 0;
}

.combo-cell-full {
  width: 100%;
  border-radius: 8px;
  color: #C7D2DC;
}

.analysis-form-grid.full-analysis-controls .primary-button {
  min-height: 37px;
  padding: 9px 15px;
  white-space: nowrap;
}

.analysis-form-grid select:focus {
  border-color: #FF7A29;
  box-shadow: 0 0 0 3px rgba(255, 122, 41, 0.12);
}

.analysis-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}

.analysis-results {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.analysis-result-row {
  display: grid;
  grid-template-columns: auto 1.1fr 1fr auto auto;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 12px;
  background: #171D25;
  color: #EDF1F6;
  cursor: pointer;
  font-size: 13px;
  font-weight: 850;
  padding: 10px 12px;
  text-align: left;
}

.analysis-result-row.selected {
  border-color: #FF7A29;
  background: #241C14;
  box-shadow: inset 0 0 0 1px rgba(255, 122, 41, 0.2);
}

.compact-analysis-results {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
}

.compact-analysis-results.single-analysis-result {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.compact-analysis-results > .analysis-empty {
  grid-column: 1 / -1;
}

.compact-analysis-results .analysis-result-row {
  grid-template-columns: minmax(150px, 1.2fr) minmax(150px, 1fr) minmax(90px, 0.7fr);
  grid-template-areas: "left signal summary";
  min-height: 66px;
  gap: 12px;
  border-radius: 14px;
  padding: 10px 14px;
  text-align: left;
}

.analysis-result-left {
  grid-area: left;
  display: grid;
  gap: 3px;
  min-width: 0;
}

.analysis-result-spacer {
  min-height: 66px;
  border-radius: 14px;
  visibility: hidden;
}

.compact-analysis-results .analysis-result-row .analysis-result-left > strong {
  color: #F5F8FB;
  font-size: 16px;
  font-weight: 950;
  letter-spacing: 0.01em;
  line-height: 1.08;
  white-space: nowrap;
}

.compact-analysis-results .analysis-result-row .analysis-mode-label {
  justify-self: start;
  font-size: 12px;
  line-height: 1.08;
}

.analysis-base-position-label {
  color: #FF7A29;
  font-size: 11px;
  font-weight: 950;
  line-height: 1.08;
  white-space: nowrap;
}

.compact-analysis-results .analysis-result-row .analysis-signal,
.compact-analysis-results .analysis-result-row .analysis-grid-signal {
  grid-area: signal;
  justify-self: center;
  align-self: center;
}

.compact-analysis-results .analysis-result-row .analysis-summary {
  grid-area: summary;
  justify-self: center;
  align-self: center;
  color: #C7D2DC;
  font-size: 18px;
  font-weight: 950;
}

.analysis-signal {
  display: grid;
  gap: 5px;
  min-width: 116px;
}

.analysis-signal-numbers,
.analysis-signal-dots {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 13px;
  justify-items: center;
}

.analysis-signal-numbers {
  color: #B9C4CF;
  font-size: 13px;
  font-weight: 950;
}

.analysis-signal-dot {
  display: block;
  width: 13px;
  height: 13px;
  border: 2px solid #FF7A29;
  border-radius: 999px;
  background: #1D242E;
}

.analysis-signal-dot.filled {
  background: #FF7A29;
  box-shadow: 0 0 0 2px rgba(255, 122, 41, 0.12);
}

.analysis-summary.large {
  color: #C7D2DC;
  font-size: 19px;
  font-weight: 950;
}

.analysis-summary {
  display: grid;
  justify-items: center;
  gap: 2px;
  line-height: 1.05;
  text-align: center;
}

.analysis-count {
  font-size: 1em;
  font-weight: 950;
  white-space: nowrap;
}

.analysis-range {
  font-size: 0.8em;
  font-weight: 950;
  white-space: nowrap;
}

.analysis-mode-label {
  color: #C7D2DC;
  font-size: 12px;
  font-weight: 950;
  white-space: nowrap;
}

.analysis-all-results {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.analysis-all-summary-grid {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.analysis-all-card {
  display: grid;
  gap: 5px;
  min-height: 78px;
  align-content: center;
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 13px;
  background: #1D242E;
  color: #EDF1F6;
  cursor: pointer;
  font-family: inherit;
  padding: 8px 10px;
  text-align: center;
}

.analysis-all-card-head {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 0;
}

.analysis-all-card strong {
  font-size: 17px;
  font-weight: 950;
  line-height: 1.05;
}

.analysis-all-card em {
  font-size: 15px;
  font-weight: 950;
  font-style: normal;
  line-height: 1.05;
}

.analysis-all-pairs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 6px;
  min-width: 0;
}

.analysis-all-pairs span {
  border-radius: 999px;
  background: #182029;
  color: #EDF1F6;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  padding: 4px 7px;
  white-space: nowrap;
}

.analysis-all-card:hover,
.analysis-all-card:focus-visible,
.analysis-all-card.selected {
  border-color: #FF7A29;
  background: #182029;
  outline: none;
}

.analysis-all-count-0 .analysis-all-card-head em {
  color: #8B96A3;
}

.analysis-all-count-1 .analysis-all-card-head em {
  color: #FBBF24;
}

.analysis-all-count-2 .analysis-all-card-head em {
  color: #60A5FA;
}

.analysis-all-count-3 .analysis-all-card-head em {
  color: #4ADE80;
}

.analysis-dot-pattern {
  font-size: 18px;
  font-weight: 950;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.analysis-empty {
  border-radius: 12px;
  background: #182029;
  color: #8B96A3;
  font-size: 13px;
  font-weight: 850;
  padding: 12px 14px;
}

.analysis-table-wrap {
  min-width: 0;
  max-width: 100%;
  margin-top: 12px;
  overflow-x: auto;
}

.analysis-mobile-grid {
  display: none;
}

.analysis-applied-context {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: max-content;
  max-width: 100%;
  margin: 0 auto 8px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 999px;
  background: #182029;
  color: #F5F8FB;
  font-size: 17px;
  font-weight: 950;
  letter-spacing: 0.02em;
  padding: 9px 16px;
  white-space: nowrap;
}

.analysis-applied-context > * + *::before {
  content: "·";
  margin-right: 10px;
  color: #7C8A9A;
  font-weight: 800;
}

.analysis-applied-context strong {
  color: #F5F8FB;
  font-weight: 950;
}

.analysis-context-muted {
  color: #7C8A9A;
  font-weight: 850;
}

.analysis-table {
  width: 100%;
  min-width: 1040px;
  border-collapse: separate;
  border-spacing: 0;
  color: #EDF1F6;
  table-layout: fixed;
  margin-left: auto;
  margin-right: auto;
}

.analysis-table th,
.analysis-table td {
  border-right: 1px solid rgba(148, 163, 184, 0.13);
  border-bottom: 3px solid rgba(148, 163, 184, 0.28);
  background: rgba(255, 255, 255, 0.045);
  padding: 5px;
  text-align: center;
  vertical-align: middle;
}

.analysis-table th {
  background: #182029;
  color: #C7D2DC;
  font-size: 15px;
  font-weight: 950;
}

.analysis-table th:first-child,
.analysis-table td:first-child {
  border-left: 1px solid rgba(148, 163, 184, 0.16);
  border-right: 3px solid rgba(148, 163, 184, 0.38);
  font-weight: 950;
  width: 250px;
}

.analysis-table tbody tr:nth-child(even) td {
  background: rgba(20, 25, 32, 0.92);
}

.analysis-rotation-pair-cell {
  background: #182029 !important;
  color: #F5F8FB;
  font-size: 16px;
  font-weight: 950;
  line-height: 1.1;
  padding-inline: 10px !important;
  text-align: center;
  white-space: nowrap;
}

.analysis-table tbody tr:hover td,
.analysis-table tbody tr.selected-row td {
  background: #182029;
}

.analysis-table tbody tr:hover .analysis-rotation-pair-cell,
.analysis-table tbody tr.selected-row .analysis-rotation-pair-cell {
  background: #182029 !important;
}

.analysis-table tbody tr.selected-row td:first-child {
  color: #F5F8FB;
  box-shadow: inset 4px 0 0 #FF7A29;
}

.analysis-table thead th {
  border-top: 1px solid rgba(148, 163, 184, 0.16);
}

.analysis-table thead th:first-child {
  border-radius: 12px 0 0 0;
}

.analysis-table thead th:last-child {
  border-radius: 0 12px 0 0;
}

.analysis-table tbody tr:last-child td:first-child {
  border-radius: 0 0 0 12px;
}

.analysis-table tbody tr:last-child td:last-child {
  border-radius: 0 0 12px 0;
}

.analysis-cell {
  display: grid;
  gap: 4px;
  justify-items: center;
  align-items: center;
  min-height: 100%;
  font-size: 16px;
  font-weight: 850;
  line-height: 1;
  text-align: center;
}

.analysis-grid-signal {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

.analysis-grid-circle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 2px solid #3A4553;
  border-radius: 999px;
  background: #20262F;
  color: #8B96A3;
  font-size: 15px;
  font-weight: 900;
  line-height: 1;
}

.analysis-grid-signal.count-1 .analysis-grid-circle.filled {
  border-color: #f59e0b;
  background: #f59e0b;
  color: #fff;
}

.analysis-grid-signal.count-2 .analysis-grid-circle.filled {
  border-color: #2563eb;
  background: #2563eb;
  color: #fff;
}

.analysis-grid-signal.count-3 .analysis-grid-circle.filled {
  border-color: #22C55E;
  background: #22C55E;
  color: #fff;
}

.analysis-grid-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  min-height: 20px;
  border-radius: 8px;
  color: #7C8A9A;
  background: transparent;
  font-size: 15px;
  font-weight: 800;
}

.analysis-grid-count-1 {
  color: #FBBF24;
  font-weight: 800;
}

.analysis-grid-count-2 {
  color: #60A5FA;
  font-weight: 900;
}

.analysis-grid-count-3 {
  color: #4ADE80;
  font-weight: 950;
}

.analysis-cell-button {
  display: block;
  width: 100%;
  min-height: 76px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 10px;
  background: #1D242E;
  color: #EDF1F6;
  cursor: pointer;
  padding: 7px 6px;
}

.analysis-cell-button:hover,
.analysis-cell-button:focus-visible {
  border-color: rgba(148, 163, 184, 0.46);
  background: #182029;
  outline: none;
}

.analysis-cell-button.selected {
  border-color: #FF7A29;
  background: #241C14;
  box-shadow: inset 0 0 0 2px rgba(255, 122, 41, 0.22);
}

.analysis-actions .text-button:disabled {
  cursor: default;
  opacity: 0.44;
}

.analysis-actions .text-button:not(:disabled) {
  border: 1px solid rgba(148, 163, 184, 0.24);
  transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, transform 0.12s ease;
}

.analysis-actions .text-button:not(:disabled):hover,
.analysis-actions .text-button:not(:disabled):focus-visible {
  border-color: rgba(148, 163, 184, 0.5);
  background: #182029;
  box-shadow: 0 6px 14px rgba(148, 163, 184, 0.12);
  outline: none;
  transform: translateY(-1px);
}

.analysis-actions .text-button:not(:disabled):active {
  transform: scale(0.985);
}

.selected-summary {
  display: grid;
  gap: 4px;
  justify-items: center;
  text-align: center;
}

.roster-inputs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 10px 14px 0;
}

.roster-inputs label {
  color: #C7D2DC;
  font-size: 14px;
  font-weight: 950;
}

.roster-inputs .libero-input {
  grid-column: 2 / 3;
}

.player-picker-field {
  position: relative;
  display: grid;
  gap: 6px;
  color: #C7D2DC;
  font-size: 14px;
  font-weight: 950;
}

.player-picker-field.libero-input {
  grid-column: 2 / 3;
}

.player-picker-label {
  display: block;
}

.player-picker-row {
  position: relative;
  display: block;
}

.player-picker-input,
.player-picker-toggle {
  border: 1px solid #313B48;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.045);
  color: #EDF1F6;
}

.player-picker-input {
  width: 100%;
  min-width: 0;
  padding: 9px 50px 9px 10px;
}

.player-picker-toggle {
  position: absolute;
  top: 1px;
  right: 1px;
  bottom: 1px;
  width: 44px;
  min-width: 44px;
  border: 0;
  border-left: 1px solid #313B48;
  border-radius: 0 8px 8px 0;
  background: transparent;
  cursor: pointer;
  font-size: 12px;
  font-weight: 950;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.player-picker-list {
  position: absolute;
  top: calc(100% + 5px);
  right: 0;
  left: 0;
  z-index: 40;
  display: none;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  max-height: 230px;
  overflow: auto;
  border: 1px solid #3A4553;
  border-radius: 14px;
  background: rgba(29, 36, 46, 0.98);
  box-shadow: 0 14px 28px rgba(35, 109, 113, 0.16);
  padding: 8px;
}

.player-picker-field.open .player-picker-list {
  display: grid;
}

.player-picker-option,
.player-picker-empty {
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 10px;
  background: #1D242E;
  color: #EDF1F6;
  font-size: 13.5px;
  font-weight: 900;
  height: 54px;
  padding: 6px 8px;
  text-align: center;
}

.player-picker-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  width: 100%;
  cursor: pointer;
}

.player-picker-option:hover,
.player-picker-option:focus-visible {
  background: #182029;
}

.player-picker-option.used {
  background: #20262F;
  color: #8B96A3;
}

.player-picker-option.selected {
  border-color: #FFA766;
  background: #241C14;
  color: #FFD9B8;
}

.player-picker-name {
  display: block;
  max-width: 100%;
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
  font-size: 13.5px;
  font-weight: 950;
  line-height: 1.1;
}

.player-picker-option.assigned .player-picker-name {
  font-size: 13px;
}

.player-picker-position {
  display: none;
  min-width: 24px;
  border: 1px solid #FF6B78;
  border-radius: 999px;
  background: #1D242E;
  color: #FF6B78;
  font-size: 10.5px;
  font-weight: 950;
  line-height: 1.1;
  padding: 1px 6px;
  text-align: center;
  white-space: nowrap;
}

.player-picker-option.assigned .player-picker-position {
  display: inline-block;
}

.player-picker-empty {
  grid-column: 1 / -1;
  text-align: center;
}

.slot-edit-popup-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  background: rgba(3, 6, 10, 0.72);
  padding: 16px;
}

.slot-edit-popup {
  display: grid;
  gap: 12px;
  width: min(720px, 100%);
  max-height: min(760px, calc(100vh - 32px));
  overflow: auto;
  border: 1px solid rgba(148, 163, 184, 0.4);
  border-radius: 22px;
  background: rgba(24, 29, 37, 0.98);
  box-shadow: 0 22px 48px rgba(0, 0, 0, 0.55);
  padding: 18px;
}

.slot-edit-popup-heading,
.slot-popup-player,
.squad-table-head {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) 132px;
  gap: 8px;
  align-items: center;
}

.slot-edit-popup-heading {
  display: flex;
  justify-content: space-between;
}

.slot-name-edit {
  display: grid;
  gap: 6px;
  color: #C7D2DC;
  font-size: 13px;
  font-weight: 950;
}

.slot-name-edit input {
  width: 100%;
  border: 1px solid #313B48;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.045);
  color: #EDF1F6;
  padding: 9px 10px;
}

.squad-table-head {
  color: #8B96A3;
  font-size: 12px;
  font-weight: 950;
  padding-inline: 4px;
}

.slot-popup-list {
  display: grid;
  gap: 7px;
}

.slot-popup-player {
  border-radius: 12px;
  background: rgba(24, 32, 41, 0.76);
  padding: 7px;
}

.slot-popup-actions,
.slot-popup-actions-footer {
  display: flex;
  gap: 5px;
  justify-content: flex-end;
}

.slot-popup-actions-footer {
  border-top: 1px solid rgba(148, 163, 184, 0.16);
  padding-top: 10px;
}

.slot-manager {
  display: grid;
  grid-template-columns: minmax(145px, 1.3fr) repeat(6, minmax(0, 0.72fr));
  align-items: center;
  gap: 4px;
  margin: 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
  padding: 9px 14px 7px;
}

.slot-tools {
  display: none;
}

.slot-manager select,
.slot-button {
  min-width: 0;
  border: 1px solid #3A4553;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
  color: #AEB9C4;
  font-size: 10px;
  font-weight: 900;
  min-height: 32px;
  padding: 5px 4px;
  line-height: 1.08;
  white-space: normal;
}

.slot-manager select {
  width: 100%;
  min-width: 0;
  max-width: none;
  font-size: 15.5px;
  font-weight: 900;
  text-align: center;
  text-align-last: center;
  white-space: nowrap;
}

.slot-manager .slot-button {
  width: 100%;
  min-width: 0;
}

.front-toggle {
  min-width: 182px;
  justify-content: center;
  padding-inline: 12px 10px;
  text-align: center;
}

.slot-button {
  cursor: pointer;
}

.slot-button.active {
  border-color: #FF7A29;
  background: #FF7A29;
  color: #fff;
}

.slot-editor {
  display: none;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin-top: 9px;
  border-top: 1px solid rgba(148, 163, 184, 0.16);
  padding-top: 9px;
}

.slot-editor.active {
  display: grid;
}

.slot-editor label {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  color: #8B96A3;
  font-size: 11px;
  font-weight: 900;
}

.slot-editor input {
  width: 100%;
  border: 1px solid #313B48;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
  color: #EDF1F6;
  padding: 7px 8px;
}

.squad-manager {
  display: grid;
  grid-column: 1 / -1;
  gap: 8px;
  margin-top: 6px;
  border-top: 1px solid rgba(148, 163, 184, 0.16);
  padding-top: 10px;
}

.squad-heading,
.squad-player {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.squad-heading {
  color: #8B96A3;
  font-size: 12px;
  font-weight: 900;
}

.squad-heading span {
  color: #7C8A9A;
  font-size: 11px;
}

.squad-add-row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  gap: 7px;
}

.squad-list {
  display: grid;
  gap: 6px;
  max-height: 168px;
  overflow: auto;
  padding-right: 2px;
}

.squad-player {
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.045);
  color: #EDF1F6;
  font-size: 12px;
  font-weight: 850;
  padding: 6px 7px;
}

.squad-player input {
  min-width: 0;
  border: 1px solid #313B48;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
  color: #EDF1F6;
  font-size: 12px;
  font-weight: 850;
  padding: 6px 7px;
}

.squad-row-number {
  width: 64px;
}

.squad-row-name {
  flex: 1;
}

.rotation-jog {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}

.current-rotation-jog {
  margin-top: 10px;
}

.rotation-jog-team {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 15px;
  padding: 7px 9px;
}

.rotation-jog-team.home {
  background: rgba(24, 32, 41, 0.92);
}

.rotation-jog-team.away {
  background: rgba(36, 28, 26, 0.94);
}

.rotation-jog-label {
  color: #8B96A3;
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0.08em;
}

.rotation-jog-label.away {
  margin-left: 0;
}

.rotation-jog strong {
  min-width: 34px;
  color: #EDF1F6;
  font-size: 14px;
  text-align: center;
}

.rotation-jog-button {
  display: inline-grid;
  width: 34px;
  min-width: 34px;
  height: 30px;
  place-items: center;
  border: 1px solid #3A4553;
  border-radius: 999px;
  background: #182029;
  color: #8B96A3;
  cursor: pointer;
  font-size: 13px;
  font-weight: 950;
}

.rotation-jog-button:disabled {
  cursor: default;
  opacity: 0.45;
}

.selection-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 14px;
  margin-top: 16px;
}

.team-selector {
  border-radius: 18px;
  padding: 16px;
}

.team-selector.home {
  background: #182029;
}

.team-selector.away {
  background: #241C1A;
}

.team-title strong {
  color: #C7D2DC;
  font-size: 23px;
  font-weight: 950;
}

.team-title h3 {
  font-size: 22px;
  font-weight: 950;
}

.team-title .eyebrow {
  font-size: 14px;
  font-weight: 950;
}

.versus {
  align-self: center;
  color: #7C8A9A;
  font-size: 13px;
  font-weight: 900;
}

.state-buttons {
  display: grid;
  grid-template-columns: repeat(6, minmax(40px, 1fr));
  gap: 7px;
  margin-top: 14px;
}

.state-button {
  border: 1px solid transparent;
  border-radius: 10px;
  background: #1D242E;
  color: #8B96A3;
  cursor: pointer;
  font-size: 13px;
  font-weight: 900;
  padding: 10px 4px;
  transition: 150ms ease;
}

.state-button:hover:not(:disabled) {
  border-color: #FF9E63;
  transform: translateY(-1px);
}

.state-button.selected {
  border-color: #FF7A29;
  background: #FF7A29;
  color: #fff;
}

.state-button:disabled {
  cursor: not-allowed;
  opacity: 0.22;
}

.mini-toggle {
  display: flex;
  align-items: center;
  gap: 7px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
  color: #8B96A3;
  cursor: pointer;
  font-size: 11px;
  font-weight: 900;
  padding: 6px 8px 6px 10px;
  white-space: nowrap;
}

.mini-toggle input {
  position: absolute;
  opacity: 0;
}

.mini-toggle i {
  position: relative;
  flex: 0 0 auto;
  width: 32px;
  height: 18px;
  border-radius: 999px;
  background: #2A323D;
  transition: 150ms ease;
}

.mini-toggle i::after {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  content: "";
  transition: 150ms ease;
}

.mini-toggle input:checked + i {
  background: #FF7A29;
}

.mini-toggle input:checked + i::after {
  transform: translateX(14px);
}

.court-align-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  background: #182029;
  color: #8B96A3;
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
  padding: 8px 10px;
}

.court-align-toggle input {
  position: absolute;
  opacity: 0;
}

.court-align-toggle i {
  position: relative;
  width: 34px;
  height: 20px;
  border-radius: 999px;
  background: #2A323D;
}

.court-align-toggle i::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  content: "";
  transition: 150ms ease;
}

.court-align-toggle input:checked + i {
  background: #FF7A29;
}

.court-align-toggle input:checked + i::after {
  transform: translateX(14px);
}

.court-card {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  background: #16233A;
}

.court-card.large {
  overflow: visible;
}

.court-card.empty {
  display: grid;
  min-height: 260px;
  place-items: center;
}

.empty-message {
  color: #8FA6C7;
  font-weight: 900;
}

.court-surface {
  display: grid;
  grid-template-rows: auto 1fr auto;
  border: 18px solid #16233A;
  background: #1B2A44;
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.9);
}

.court-field {
  position: relative;
  display: grid;
  grid-template-rows: repeat(2, minmax(44px, auto)) 8px repeat(2, minmax(44px, auto));
  border: 3px solid rgba(255, 255, 255, 0.98);
  background: #1B2A44;
}

.court-field::before,
.court-field::after {
  position: absolute;
  right: -10px;
  left: -10px;
  z-index: 1;
  height: 4px;
  background: rgba(255, 255, 255, 0.98);
  content: "";
}

.court-field::before {
  top: 33.333%;
}

.court-field::after {
  bottom: 33.333%;
}

.court-team {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  background: transparent;
}

.court-team.away {
  background: transparent;
}

.court-team.home {
  background: transparent;
}

.player {
  display: grid;
  min-height: 58px;
  place-items: center;
  font-size: 13px;
  font-weight: 900;
  text-align: center;
  white-space: nowrap;
}

.net-divider {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  border-block: 4px solid rgba(255, 255, 255, 1);
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.95) 0 2px, transparent 2px 10px),
    #101010;
}

.net-divider span {
  display: none;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.24em;
}

.position-layer {
  position: absolute;
  inset: 0;
  z-index: 4;
}

.drawing-layer {
  position: absolute;
  inset: 0;
  z-index: 3;
  overflow: hidden;
  pointer-events: none;
  touch-action: pan-x pan-y pinch-zoom;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.drawing-layer.active {
  z-index: 6;
  pointer-events: auto;
  touch-action: none;
}

.drawing-layer.active.move-mode {
  pointer-events: none;
  touch-action: pan-x pan-y pinch-zoom;
}

.drawing-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.drawing-layer.active.pen-cursor {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='0 0 28 28'%3E%3Cpath d='M4 24 L20 8 L24 12 L8 28 Z' fill='%23101010'/%3E%3Cpath d='M18 6 L21 3 L25 7 L22 10 Z' fill='%23f4c430'/%3E%3C/svg%3E") 4 24, crosshair;
}

.drawing-layer.active.eraser-cursor {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='30' height='24' viewBox='0 0 30 24'%3E%3Cpath d='M3 15 L14 4 L27 17 L20 24 L7 24 Z' fill='%23f8b4c4' stroke='%23104f54' stroke-width='2'/%3E%3Cpath d='M14 4 L27 17 L22 22 L9 9 Z' fill='%23fffaf5' stroke='%23104f54' stroke-width='2'/%3E%3C/svg%3E") 7 18, cell;
}

.overview-panel {
  position: relative;
}

.overview-drawing-layer {
  border-radius: 22px;
}

.draggable-player {
  position: absolute;
  left: calc(var(--grid-x) * 1%);
  top: calc(var(--grid-y) * 1%);
  display: inline-flex;
  width: 72px;
  min-width: 72px;
  height: 72px;
  min-height: 72px;
  align-items: center;
  justify-content: center;
  border: 3px solid rgba(148, 163, 184, 0.72);
  border-radius: 50%;
  background: #F7F5F0;
  color: #F5F8FB;
  cursor: grab;
  font-size: 32px;
  font-weight: 950;
  line-height: 1.05;
  padding: 4px;
  text-align: center;
  white-space: nowrap;
  touch-action: none;
  transform: translate(-50%, -50%);
  transition: background 120ms ease, box-shadow 120ms ease, transform 120ms ease;
  user-select: none;
  -webkit-user-select: none;
}

.draggable-player.dragging {
  z-index: 3;
  background: #fff;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
  cursor: grabbing;
  transform: translate(-50%, -50%) scale(1.08);
}

.rotation-card .state-strip {
  min-height: 24px;
  font-size: 11px;
}

.state-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 38px;
  background: #16233A;
  color: #EAF2FF;
  font-size: 18px;
  font-weight: 950;
}

.ball {
  display: inline-grid;
  width: 22px;
  height: 22px;
  place-items: center;
  font-size: 22px;
  line-height: 1;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.18));
}

.ball::before {
  content: "\1F3D0";
}

.large {
  width: min(390px, 100%);
  margin: 0;
}

.current-court-stage {
  position: relative;
  display: flex;
  width: min(640px, 100%);
  justify-content: flex-end;
}

.current-court-layout {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 640px) 180px;
  align-items: center;
  justify-content: center;
  gap: 118px;
  margin-top: 14px;
}

.current-drawing-layer {
  border-radius: 16px;
}

.drawing-mode-panel {
  position: sticky;
  right: 14px;
  bottom: 14px;
  z-index: 9;
  display: none;
  grid-template-columns: repeat(3, auto);
  gap: 7px;
  justify-self: end;
  align-self: end;
  margin-top: -62px;
  padding: 8px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 999px;
  background: rgba(17, 21, 28, 0.92);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.5);
}

.current-court-layout.drawing-active .drawing-mode-panel,
.current-court-layout:has(.drawing-layer.active) .drawing-mode-panel {
  display: grid;
}

.drawing-mode-panel button {
  border: 1px solid #3A4553;
  border-radius: 999px;
  background: #182029;
  color: #EDF1F6;
  cursor: pointer;
  font-size: 13px;
  font-weight: 950;
  padding: 9px 12px;
}

.drawing-mode-panel button.active {
  border-color: #FF7A29;
  background: #FF7A29;
  color: #fff;
}

.court-side-tools {
  position: relative;
  z-index: 7;
  display: grid;
  justify-items: center;
  gap: 16px;
}

.drawing-toolbar {
  display: grid;
  width: 260px;
  gap: 8px;
  justify-items: center;
  border: 1px solid #3A4553;
  border-radius: 22px;
  background: rgba(17, 21, 28, 0.9);
  padding: 10px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.4);
}

.text-note-toolbar {
  display: grid;
  width: 260px;
  grid-template-columns: repeat(4, auto);
  gap: 8px;
  align-items: center;
  justify-content: center;
  border: 1px solid #3A4553;
  border-radius: 22px;
  background: rgba(17, 21, 28, 0.9);
  padding: 10px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.4);
}

.drawing-toolbar-row {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
}

.toolbar-divider {
  width: calc(100% - 22px);
  height: 1px;
  background: rgba(148, 163, 184, 0.22);
}

.draw-tool {
  display: inline-grid;
  min-width: 48px;
  height: 42px;
  place-items: center;
  border: 2px solid rgba(148, 163, 184, 0.26);
  border-radius: 999px;
  background: #182029;
  color: #EDF1F6;
  cursor: pointer;
  font-size: 15px;
  font-weight: 950;
}

.draw-tool.red {
  color: #F43F5E;
}

.draw-tool.blue {
  color: #4C8DFF;
}

.draw-tool.active {
  border-color: rgba(255, 122, 41, 0.82);
  background: #FF8F42;
  color: #fff;
}

.draw-tool:disabled {
  cursor: default;
  opacity: 0.38;
}

.clear-tool {
  min-width: 62px;
  font-size: 12px;
}

.text-note-tool {
  min-width: 58px;
  font-size: 12px;
  line-height: 1.05;
}

.text-size-tool {
  min-width: 46px;
}

.color-dot {
  display: block;
  width: 22px;
  height: 22px;
  border: 2px solid rgba(255, 255, 255, 0.92);
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(148, 163, 184, 0.18);
}

.color-dot.black {
  background: #101010;
}

.color-dot.red {
  background: #e11d48;
}

.color-dot.blue {
  background: #2563eb;
}

.width-label {
  color: #96A2AF;
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0.08em;
}

.width-line {
  display: block;
  width: 26px;
  border-radius: 999px;
  background: #101010;
  box-shadow: 0 0 0 2px rgba(148, 163, 184, 0.16);
}

.width-line.thin {
  height: 3px;
}

.width-line.thick {
  height: 7px;
}

.eraser-icon {
  position: relative;
  display: block;
  width: 25px;
  height: 17px;
  transform: rotate(-28deg);
}

.eraser-icon::before,
.eraser-icon::after {
  position: absolute;
  inset-block: 0;
  content: "";
}

.eraser-icon::before {
  left: 0;
  width: 15px;
  border: 2px solid rgba(148, 163, 184, 0.72);
  border-right-width: 1px;
  border-radius: 5px 2px 2px 5px;
  background: #f8b4c4;
}

.eraser-icon::after {
  right: 0;
  width: 11px;
  border: 2px solid rgba(148, 163, 184, 0.72);
  border-left-width: 1px;
  border-radius: 2px 5px 5px 2px;
  background: #F7F5F0;
}

.sideout-orb {
  display: grid;
  width: 180px;
  height: 180px;
  place-items: center;
  border: 6px solid rgba(148, 163, 184, 0.78);
  border-radius: 50%;
  background: linear-gradient(145deg, #FF7A29, #FF9354);
  box-shadow: 0 16px 35px rgba(255, 122, 41, 0.22);
  color: #fff;
  cursor: pointer;
  font-size: 28px;
  font-weight: 950;
  line-height: 1.08;
  text-align: center;
}

.sideout-orb:active {
  transform: scale(0.97);
}

.rotation-step-buttons {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.rotation-step-buttons button {
  border: 1px solid #3A4553;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
  color: #C7D2DC;
  cursor: pointer;
  font-size: 13px;
  font-weight: 950;
  padding: 9px 13px;
}

.large .court-surface {
  border-width: 17px;
}

.large .court-field {
  aspect-ratio: 1 / 2;
  grid-template-rows: repeat(2, 1fr) 12px repeat(2, 1fr);
  border-width: 4px;
}

.large .court-field::before,
.large .court-field::after {
  right: -12px;
  left: -12px;
  height: 4px;
}

.large .net-divider {
  border-block-width: 4px;
}

.large .player {
  min-height: 0;
  font-size: 15px;
}

.large .state-strip {
  min-height: 48px;
  font-size: 31px;
}

.large .ball {
  width: 26px;
  height: 26px;
}

.large .draggable-player {
  width: 72px;
  min-width: 72px;
  height: 72px;
  min-height: 72px;
  font-size: 21px;
  padding: 4px;
}

.court-service-ball {
  position: absolute;
  z-index: 4;
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  font-size: 38px;
  line-height: 1;
  filter: drop-shadow(0 5px 10px rgba(0, 0, 0, 0.16));
}

.court-service-ball::before {
  content: "\1F3D0";
}

.court-service-ball.away {
  top: -58px;
  left: 12%;
  transform: translateX(-50%);
}

.court-service-ball.home {
  right: 12%;
  bottom: -58px;
  transform: translateX(50%);
}

.rotation-overview {
  display: grid;
  grid-template-columns: repeat(6, minmax(148px, 1fr));
  column-gap: 8px;
  row-gap: 16px;
  margin-top: 16px;
  min-width: 936px;
}

.overview-panel {
  overflow-x: auto;
}

body.game-mode {
  background:
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.03), transparent 32rem),
    #0A0D12;
}

body.game-mode .app-header {
  justify-content: flex-end;
  padding: 12px 0 8px;
}

body.game-mode .app-header > div:first-child,
body.game-mode .header-tools > :not(#game-mode-toggle),
body.game-mode .roster-panel,
body.game-mode .matchup-panel,
body.game-mode .matchup-analysis-panel,
body.game-mode .control-panel,
body.game-mode footer {
  display: none;
}

body.game-mode .current-panel,
body.game-mode .overview-panel {
  background: rgba(17, 21, 28, 0.92);
  opacity: 1;
  transform: translateY(0);
}

body.game-mode .current-panel .help-text {
  display: none;
}

body.game-mode .drawing-toolbar,
body.game-mode .text-note-toolbar,
body.game-mode .drawing-mode-panel,
body.game-mode #matchup-line-toggle,
body.game-mode #matchup-line-edit,
body.game-mode .overview-actions .help-text {
  display: none;
}

body.game-mode .drawing-layer,
body.game-mode .text-note-layer {
  pointer-events: none;
}

body.game-mode .text-note-delete,
body.game-mode .text-note-move,
body.game-mode .text-note-resize {
  display: none;
}

body.game-mode .overview-panel .section-heading {
  margin-bottom: 2px;
}

body.game-mode .game-mode-button {
  background: #e11d48;
  border-color: rgba(225, 29, 72, 0.34);
  box-shadow: 0 8px 18px rgba(225, 29, 72, 0.18);
}

.rotation-card {
  position: relative;
  overflow: visible;
}

.rotation-card.current-overview {
  outline: 5px solid #e11d48;
  outline-offset: 3px;
  box-shadow: 0 0 0 7px rgba(225, 29, 72, 0.13);
}

.current-overview-badge {
  position: absolute;
  top: -14px;
  right: -6px;
  z-index: 12;
  display: inline-grid;
  min-width: 42px;
  min-height: 25px;
  place-items: center;
  border: 2px solid #F7F5F0;
  border-radius: 999px;
  background: #e11d48;
  color: #fff;
  font-size: 13px;
  font-weight: 950;
  box-shadow: 0 5px 12px rgba(108, 27, 54, 0.24);
}

.court-card.rotation-card,
.rotation-card .court-surface,
.rotation-card .court-field {
  overflow: visible;
}

.rotation-card:not(:nth-child(4n))::after {
  display: none;
}

.rotation-index {
  position: absolute;
  top: 8px;
  left: 9px;
  z-index: 1;
  color: rgba(17, 79, 84, 0.6);
  font-size: 11px;
  font-weight: 900;
}

.rotation-card .player {
  position: relative;
  z-index: 3;
  min-height: 0;
  overflow: visible;
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: flex;
  align-items: center;
  justify-content: center;
}

.rotation-card .player span {
  position: relative;
  z-index: 4;
  display: inline-grid;
  width: 48px;
  min-width: 48px;
  height: 48px;
  min-height: 48px;
  place-items: center;
  border: 2px solid rgba(148, 163, 184, 0.72);
  border-radius: 50%;
  background: #F7F5F0;
  box-shadow: 0 0 0 2px rgba(247, 245, 240, 0.95);
  font-size: 15px;
  font-weight: 950;
  line-height: 1;
  padding: 2px;
}

.matchup-line-layer {
  position: absolute;
  inset: 0;
  z-index: 6;
  overflow: visible;
  pointer-events: none;
}

.matchup-line-layer.editing {
  pointer-events: auto;
  touch-action: none;
}

.matchup-line-layer line {
  stroke: rgba(255, 122, 41, 0.82);
  stroke-width: 1.9;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}

.matchup-line-handle {
  cursor: grab;
  fill: #FFB37A;
  stroke: #F7F5F0;
  stroke-width: 1.6;
  pointer-events: auto;
  touch-action: none;
  vector-effect: non-scaling-stroke;
}

.matchup-line-handle:active {
  cursor: grabbing;
}

.text-note-layer {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: clamp(-420px, -24vw, -180px);
  z-index: 8;
  pointer-events: none;
}

.text-note-layer.editing {
  pointer-events: auto;
}

.text-note {
  position: absolute;
  left: calc(var(--note-x) * 1%);
  top: calc(var(--note-y) * 1%);
  width: calc(var(--note-w) * 1%);
  height: calc(var(--note-h) * 1%);
  min-width: 84px;
  min-height: 42px;
  border: 2px solid rgba(148, 163, 184, 0.56);
  border-radius: 12px;
  background: rgba(247, 245, 240, 0.92);
  box-shadow: 0 8px 18px rgba(28, 82, 91, 0.12);
  pointer-events: none;
}

.text-note textarea {
  width: 100%;
  height: 100%;
  overflow: hidden;
  border: 0;
  outline: 0;
  resize: none;
  background: transparent;
  color: #F5F8FB;
  font: inherit;
  font-size: calc(var(--note-size) * 1px);
  font-weight: 900;
  line-height: 1.2;
  padding: 8px 10px;
  text-align: center;
  align-content: center;
  touch-action: auto;
  user-select: text;
  -webkit-user-select: text;
  -webkit-touch-callout: default;
  -webkit-tap-highlight-color: rgba(148, 163, 184, 0.14);
}

.text-note:not(.editing) textarea {
  pointer-events: none;
}

.text-note.editing {
  cursor: move;
  border-color: rgba(255, 122, 41, 0.92);
  pointer-events: auto;
}

.text-note-resize {
  position: absolute;
  right: -7px;
  bottom: -7px;
  width: 18px;
  height: 18px;
  border: 2px solid #F7F5F0;
  border-radius: 50%;
  background: #FFB37A;
  cursor: nwse-resize;
  touch-action: none;
}

.text-note-delete {
  position: absolute;
  top: -11px;
  right: -11px;
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border: 2px solid #F7F5F0;
  border-radius: 50%;
  background: #e11d48;
  color: #fff;
  cursor: pointer;
  font-size: 16px;
  font-weight: 950;
  line-height: 1;
  touch-action: manipulation;
}

.text-note-move {
  position: absolute;
  top: -11px;
  left: -11px;
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border: 2px solid #F7F5F0;
  border-radius: 50%;
  background: #FFB37A;
  color: #fff;
  cursor: move;
  font-size: 13px;
  font-weight: 950;
  line-height: 1;
  touch-action: none;
}

.rotation-card .court-service-ball {
  width: 26px;
  height: 26px;
  font-size: 23px;
}

.rotation-card .court-service-ball.away {
  top: -29px;
  left: 12%;
  transform: translateX(-50%);
}

.rotation-card .court-service-ball.home {
  right: 12%;
  bottom: -29px;
  transform: translateX(50%);
}

.rotation-card .state-strip {
  min-height: 24px;
  font-size: 15px;
}

.rotation-card .court-surface {
  border-width: 6px;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.98);
}

.rotation-card .court-field {
  aspect-ratio: 1 / 1.18;
  grid-template-rows: repeat(2, 1fr) 4px repeat(2, 1fr);
}

.rotation-card .court-team {
  border-top-width: 0;
}

.rotation-card .player {
  border-right-width: 0;
}

.rotation-card .net-divider {
  border-block: 2px solid #101010;
  background: #101010;
}

.rotation-card .court-field {
  border-width: 2px;
}

.rotation-card .court-field::before,
.rotation-card .court-field::after {
  right: -5px;
  left: -5px;
  height: 2px;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 2px 0 24px;
  color: #7C8A9A;
  font-size: 12px;
}

@media (max-width: 1100px) and (min-width: 521px) {
  .current-court-layout {
    grid-template-columns: minmax(0, 560px) minmax(0, 260px);
    gap: 28px;
  }

  .current-court-stage {
    width: min(560px, 100%);
    justify-content: center;
  }
}

@media (max-width: 960px) {
  .rotation-overview {
    grid-template-columns: repeat(6, minmax(112px, 1fr));
  }

  .rotation-card:not(:nth-child(4n))::after {
    display: none;
  }

  .current-court-layout {
    grid-template-columns: minmax(0, 500px);
    gap: 16px;
  }

  .sideout-orb {
    width: 180px;
    height: 180px;
    justify-self: center;
    font-size: 28px;
  }

  .drawing-toolbar,
  .text-note-toolbar {
    width: min(260px, 100%);
  }

}

@media (max-width: 520px) {
  html,
  body {
    width: 100%;
  }

  body {
    min-width: 0;
  }

  body,
  button,
  input,
  textarea,
  select {
    word-break: keep-all;
    overflow-wrap: normal;
  }

  .app-header,
  main,
  footer,
  section,
  .matchup-team,
  .roster-team,
  .team-selector,
  .current-court-layout,
  .current-court-stage,
  .overview-panel,
  .rotation-overview,
  .analysis-table-wrap,
  .analysis-mobile-grid,
  .combo-input,
  .combo-menu,
  .player-picker-field,
  .player-picker-row,
  .player-picker-list {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  .app-header,
  main,
  footer {
    width: calc(100% - 12px);
  }

  .app-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    padding: 10px 0 8px;
  }

  .header-brand {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 3px;
  }

  h1 {
    display: flex;
    flex-wrap: wrap;
    gap: 3px 7px;
    font-size: clamp(25px, 8.4vw, 34px);
    line-height: 1;
    letter-spacing: -0.05em;
  }

  h1 span,
  h1 small,
  .state-button,
  .rotation-jog strong,
  .analysis-mobile-position,
  .analysis-grid-circle,
  .analysis-grid-count {
    white-space: nowrap;
  }

  .creator-label,
  .header-credit {
    font-size: 10px;
    line-height: 1.35;
  }

  .header-credit {
    justify-items: start;
    text-align: left;
  }

  .header-credit strong {
    font-size: 12px;
  }

  .build-label {
    font-size: 9px;
  }

  .header-tools,
  .sync-actions {
    justify-items: stretch;
    width: 100%;
  }

  .sync-actions,
  .slot-manager,
  .roster-inputs,
  .situation-options,
  .state-buttons,
  .current-actions,
  .overview-actions,
  .rotation-jog,
  .analysis-jog-readout,
  .analysis-mobile-cells,
  .analysis-all-summary-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  main {
    gap: 10px;
    padding-bottom: 18px;
  }

  section {
    border-radius: 16px;
    padding: 12px;
  }

  .section-heading {
    align-items: flex-start;
    gap: 8px;
    flex-wrap: wrap;
  }

  h2 {
    font-size: 18px;
    line-height: 1.15;
  }

  h3 {
    font-size: 17px;
    line-height: 1.15;
  }

  .eyebrow {
    font-size: 10px;
    line-height: 1.2;
    letter-spacing: 0.11em;
  }

  .help-text {
    font-size: 12px;
    line-height: 1.45;
  }

  .text-button,
  .primary-button,
  .slot-button,
  .status-badge,
  .summary-pill,
  .mini-toggle,
  .court-align-toggle,
  .analysis-applied-context,
  .rotation-jog-label,
  .analysis-mobile-row-title {
    white-space: normal;
  }

  .text-button,
  .primary-button,
  .slot-button {
    min-height: 40px;
    padding: 8px 10px;
    line-height: 1.15;
  }

  .status-badge,
  .summary-pill {
    padding: 7px 9px;
    font-size: 11px;
    line-height: 1.2;
  }

  .roster-grid,
  .matchup-grid,
  .selection-grid,
  .analysis-form-grid,
  .analysis-form-grid.compact,
  .analysis-form-grid.full-analysis-controls,
  .analysis-results,
  .compact-analysis-results,
  .analysis-result-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }

  .analysis-results,
  .compact-analysis-results {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    gap: 6px;
    margin-top: 8px;
  }

  .matchup-team,
  .roster-team,
  .team-selector {
    padding: 10px;
  }

  .roster-team-header,
  .team-title {
    align-items: center;
    gap: 8px;
    padding: 10px;
  }

  .slot-manager {
    padding-inline: 8px;
  }

  .slot-manager select,
  .player-picker-field.libero-input,
  .current-actions .summary-pill,
  .current-actions .save-placement-button,
  .overview-actions .rotation-jog,
  .overview-actions .help-text,
  .analysis-form-grid label,
  .analysis-form-grid label:nth-child(3),
  .analysis-form-grid.full-analysis-controls label,
  .analysis-form-grid.full-analysis-controls label:nth-child(3),
  .analysis-form-grid.full-analysis-controls .primary-button,
  .analysis-front-row .front-toggle,
  .analysis-actions .primary-button,
  .analysis-actions .text-button {
    grid-column: 1 / -1;
  }

  .slot-manager select,
  .combo-input input,
  .analysis-form-grid .combo-input input {
    width: 100%;
    min-width: 0;
  }

  .combo-input input,
  .analysis-form-grid .combo-input input {
    padding-right: 46px;
  }

  .combo-arrow {
    width: 42px;
    min-width: 42px;
  }

  .player-picker-list {
    display: none;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: 260px;
  }

  .player-picker-field.open .player-picker-list {
    display: grid;
  }

  .player-picker-option,
  .player-picker-empty {
    height: 52px;
    padding: 5px 6px;
  }

  .player-picker-name {
    font-size: 12.5px;
  }

  .matchup-result {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
    gap: 6px;
    font-size: 12px;
    line-height: 1.3;
  }

  .team-title h3,
  .team-title strong {
    font-size: 20px;
  }

  .state-buttons {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 10px;
  }

  .state-button {
    min-height: 38px;
    padding: 8px 2px;
  }

  .rotation-jog-team {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) 38px;
    justify-items: center;
    gap: 5px;
    padding: 7px 6px;
  }

  .current-actions,
  .current-rotation-jog {
    display: flex;
    width: 100%;
    max-width: 100%;
    justify-content: center;
    justify-items: center;
    align-items: center;
    flex-wrap: wrap;
    margin-inline: auto;
  }

  .current-actions > *,
  .current-rotation-jog > * {
    justify-self: center;
  }

  .rotation-jog-label {
    grid-column: 1 / -1;
    font-size: 10px;
    line-height: 1.2;
  }

  .current-court-layout {
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
    gap: 12px;
    margin-top: 10px;
  }

  .current-court-stage {
    justify-content: center;
  }

  .large {
    width: min(100%, 390px);
  }

  .large .state-strip {
    min-height: 40px;
    font-size: clamp(22px, 7vw, 28px);
  }

  .large .draggable-player {
    width: clamp(54px, 15vw, 68px);
    min-width: clamp(54px, 15vw, 68px);
    height: clamp(54px, 15vw, 68px);
    min-height: clamp(54px, 15vw, 68px);
    font-size: clamp(14px, 4vw, 19px);
  }

  .court-side-tools {
    width: 100%;
    justify-items: center;
    align-items: center;
    gap: 10px;
  }

  .drawing-toolbar,
  .text-note-toolbar {
    width: min(100%, 300px);
    margin-inline: auto;
    justify-items: center;
  }

  .text-note-toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .drawing-toolbar-row {
    width: 100%;
    flex-wrap: wrap;
    justify-content: center;
  }

  .draw-tool {
    min-width: 42px;
    height: 38px;
    font-size: 13px;
  }

  .sideout-orb {
    width: 132px;
    height: 132px;
    border-width: 5px;
    font-size: 21px;
    justify-self: center;
  }

  .rotation-step-buttons {
    width: min(100%, 260px);
    margin-inline: auto;
    flex-wrap: wrap;
  }

  .rotation-step-buttons button {
    flex: 1;
    min-height: 38px;
  }

  .overview-actions {
    display: flex;
    justify-content: center;
    justify-items: center;
    align-items: center;
    width: 100%;
    margin-inline: auto;
  }

  .overview-actions > * {
    justify-self: center;
  }

  .overview-panel,
  .analysis-table-wrap {
    overflow-x: visible;
  }

  .rotation-overview {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    min-width: 0;
    column-gap: 8px;
    row-gap: 12px;
  }

  .rotation-overview .rotation-card {
    grid-column: auto !important;
    grid-row: auto !important;
  }

  .rotation-card .state-strip {
    min-height: 30px;
    font-size: 15px;
  }

  .rotation-card .court-surface {
    padding: 6px;
  }

  .rotation-card .court-field {
    border-width: 2px;
  }

  .rotation-card .court-field::before,
  .rotation-card .court-field::after {
    height: 2px;
  }

  .rotation-card .player span {
    width: clamp(31px, 8.8vw, 42px);
    min-width: clamp(31px, 8.8vw, 42px);
    height: clamp(31px, 8.8vw, 42px);
    min-height: clamp(31px, 8.8vw, 42px);
    font-size: clamp(10px, 2.75vw, 13px);
  }

  .rotation-card .court-service-ball {
    width: 34px;
    height: 34px;
    font-size: 24px;
  }

  .analysis-result-row,
  .analysis-all-card {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  .analysis-result-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
    justify-items: stretch;
    padding: 8px;
  }

  .compact-analysis-results .analysis-result-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
    min-height: 0;
    padding: 8px;
  }

  .analysis-result-left,
  .analysis-result-row .analysis-signal,
  .analysis-result-row .analysis-grid-signal,
  .analysis-result-row .analysis-summary {
    max-width: 100%;
    min-width: 0;
  }

  .analysis-all-card {
    padding: 9px 7px;
  }

  .analysis-all-card-head {
    gap: 5px;
  }

  .analysis-all-pairs {
    font-size: 10px;
  }

  .analysis-applied-context {
    width: 100%;
    border-radius: 14px;
    flex-wrap: wrap;
    gap: 4px 8px;
    font-size: 13px;
    line-height: 1.25;
    padding: 8px 10px;
  }

  .analysis-applied-context > * + *::before {
    display: none;
  }

  .analysis-table {
    display: none;
  }

  .analysis-mobile-grid {
    display: grid;
    gap: 10px;
    margin-top: 10px;
  }

  .analysis-mobile-row {
    display: grid;
    gap: 8px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.045);
    padding: 9px;
  }

  .analysis-mobile-row.selected-row {
    box-shadow: inset 4px 0 0 #FF7A29;
    background: #182029;
  }

  .analysis-mobile-row-title {
    color: #F5F8FB;
    font-size: 13px;
    font-weight: 950;
    line-height: 1.2;
    text-align: center;
  }

  .analysis-mobile-cell {
    display: grid;
    min-width: 0;
    min-height: 96px;
    justify-items: center;
    align-content: center;
    gap: 5px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: 12px;
    background: #1D242E;
    color: #EDF1F6;
    padding: 7px 4px;
  }

  .analysis-mobile-cell.selected {
    border-color: #FF7A29;
    background: #241C14;
  }

  .analysis-mobile-position {
    color: #F5F8FB;
    font-size: 13px;
    font-weight: 950;
    line-height: 1;
  }

  .analysis-mobile-cell .analysis-grid-signal {
    gap: 4px;
  }

  .analysis-mobile-cell .analysis-grid-circle {
    width: 25px;
    height: 25px;
    font-size: 12px;
  }

  .analysis-mobile-cell .analysis-grid-count {
    min-width: 0;
    font-size: 12px;
  }

  footer {
    display: grid;
    gap: 4px;
    font-size: 11px;
    line-height: 1.3;
  }
}

@media (max-width: 380px) {
  .sync-actions,
  .slot-manager,
  .roster-inputs,
  .situation-options,
  .state-buttons,
  .current-actions,
  .overview-actions,
  .rotation-jog,
  .analysis-jog-readout,
  .analysis-front-row,
  .analysis-actions,
  .analysis-mobile-cells,
  .analysis-all-summary-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .rotation-overview {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .slot-manager select,
  .player-picker-field.libero-input,
  .analysis-form-grid label,
  .analysis-form-grid.full-analysis-controls label,
  .analysis-form-grid.full-analysis-controls .primary-button {
    grid-column: auto;
  }
}

/* ============================================================
   THEME COLOR CORRECTION · original CODEX v159 color sources
   ============================================================ */
:root[data-theme="light"] {
  --theme-bg: #DFF4F2;
  --theme-surface: rgba(255, 255, 255, 0.72);
  --theme-surface-elevated: #EDF9F8;
  --theme-text-primary: #174F54;
  --theme-text-secondary: #54787A;
  --theme-text-muted: #6C9EA0;
  --theme-border: #A7D7D4;
  --theme-accent: #0E747A;
  --theme-accent-text: #FFFFFF;
  --theme-input: rgba(255, 255, 255, 0.9);
  --theme-shadow: rgba(35, 109, 113, 0.08);
}

:root[data-theme="light"] body {
  background:
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.85), transparent 36rem),
    #DFF4F2;
  color: #16383C;
}

:root[data-theme="light"] .top-command-bar {
  border-color: #A7D7D4;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 12px 30px rgba(35, 109, 113, 0.12);
}

:root[data-theme="light"] .section-nav a,
:root[data-theme="light"] .theme-toggle {
  color: #1D7278;
}

:root[data-theme="light"] .section-nav a:hover,
:root[data-theme="light"] .section-nav a:focus-visible,
:root[data-theme="light"] .section-nav a.active {
  border-color: #0E747A;
  background: #E1F5F3;
  color: #0B5960;
}

:root[data-theme="light"] .theme-toggle {
  border-color: #A7D7D4;
  background: #EDF9F8;
}

:root[data-theme="light"] section,
:root[data-theme="light"] .overview-panel,
:root[data-theme="light"] .matchup-panel,
:root[data-theme="light"] .matchup-analysis-panel {
  border-color: rgba(91, 164, 166, 0.3);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 14px 35px rgba(35, 109, 113, 0.08);
}

:root[data-theme="light"] .roster-team.home,
:root[data-theme="light"] .matchup-team.home,
:root[data-theme="light"] .team-selector.home,
:root[data-theme="light"] .rotation-jog-team.home {
  background: #EDF9F8;
}

:root[data-theme="light"] .roster-team.away,
:root[data-theme="light"] .matchup-team.away,
:root[data-theme="light"] .team-selector.away,
:root[data-theme="light"] .rotation-jog-team.away {
  background: #FFF2E8;
}

:root[data-theme="light"] .primary-button,
:root[data-theme="light"] .text-button.active,
:root[data-theme="light"] .slot-button.active,
:root[data-theme="light"] .state-button.selected,
:root[data-theme="light"] .analysis-tab.active,
:root[data-theme="light"] .situation-options input:checked + span,
:root[data-theme="light"] .drawing-mode-panel button.active,
:root[data-theme="light"] .draw-tool.active,
:root[data-theme="light"] .current-overview-badge {
  border-color: #0E747A;
  background: #0E747A;
  color: #FFFFFF;
}

:root[data-theme="light"] .game-mode-button {
  border-color: #93CFCB;
  background: #0E747A;
  color: #FFFFFF;
}

:root[data-theme="light"] input,
:root[data-theme="light"] textarea,
:root[data-theme="light"] select,
:root[data-theme="light"] .combo-input input,
:root[data-theme="light"] .roster-inputs input,
:root[data-theme="light"] .matchup-team input,
:root[data-theme="light"] .matchup-team select,
:root[data-theme="light"] .player-picker-input {
  border-color: #C8E2E0;
  background: rgba(255, 255, 255, 0.9);
  color: #174F54;
}

:root[data-theme="light"] .text-button,
:root[data-theme="light"] .slot-button,
:root[data-theme="light"] .state-button,
:root[data-theme="light"] .analysis-tab,
:root[data-theme="light"] .rotation-jog-button,
:root[data-theme="light"] .draw-tool,
:root[data-theme="light"] .court-align-toggle,
:root[data-theme="light"] .status-badge,
:root[data-theme="light"] .summary-pill {
  border-color: #A7D7D4;
  background: #E1F5F3;
  color: #1D7278;
}

/* Domain colors: identical in dark and light themes. */
:root {
  --domain-court-apron: #BDD9EE;
  --domain-court-floor: #F8C9AA;
  --domain-court-line: rgba(255, 255, 255, 0.98);
  --domain-court-net: #101010;
  --domain-player-bg: #FFFAF5;
  --domain-player-text: #073945;
  --domain-player-border: rgba(13, 104, 112, 0.72);
  --domain-state-bg: #BDD9EE;
  --domain-state-text: #244F68;
  --domain-result-1: #F59E0B;
  --domain-result-2: #2563EB;
  --domain-result-3: #0F8A5F;
}

.court-surface {
  border-color: var(--domain-court-apron);
  background: var(--domain-court-floor);
  box-shadow: inset 0 0 0 3px var(--domain-court-line);
}

.court-field {
  border-color: var(--domain-court-line);
  background: var(--domain-court-floor);
}

.court-field::before,
.court-field::after {
  background: var(--domain-court-line);
}

.net-divider,
.rotation-card .net-divider {
  border-color: var(--domain-court-line);
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.95) 0 2px, transparent 2px 10px),
    var(--domain-court-net);
}

.rotation-card .net-divider {
  border-block-color: var(--domain-court-net);
  background: var(--domain-court-net);
}

.court-field .player {
  color: var(--domain-player-text);
}

.draggable-player,
.draggable-player.dragging {
  border-color: var(--domain-player-border);
  background: var(--domain-player-bg);
  color: var(--domain-player-text);
}

.state-strip,
:root[data-theme="light"] .state-strip,
:root[data-theme="dark"] .state-strip {
  background: var(--domain-state-bg);
  color: var(--domain-state-text);
}

.state-strip span,
.state-strip strong,
.state-strip b,
:root[data-theme="light"] .state-strip span,
:root[data-theme="light"] .state-strip strong,
:root[data-theme="light"] .state-strip b,
:root[data-theme="dark"] .state-strip span,
:root[data-theme="dark"] .state-strip strong,
:root[data-theme="dark"] .state-strip b {
  color: var(--domain-state-text);
}

.rotation-card .court-surface {
  box-shadow: inset 0 0 0 2px var(--domain-court-line);
}

.analysis-signal-dot {
  border-color: #0E747A;
  background: #FFFFFF;
}

.analysis-signal-dot.filled {
  background: #0E747A;
  box-shadow: 0 0 0 2px rgba(14, 116, 122, 0.12);
}

.analysis-grid-circle {
  border-color: #CFD8DC;
  background: #F3F5F5;
  color: #6F7F82;
}

.analysis-grid-signal.count-1 .analysis-grid-circle.filled {
  border-color: var(--domain-result-1);
  background: var(--domain-result-1);
  color: #FFFFFF;
}

.analysis-grid-signal.count-2 .analysis-grid-circle.filled {
  border-color: var(--domain-result-2);
  background: var(--domain-result-2);
  color: #FFFFFF;
}

.analysis-grid-signal.count-3 .analysis-grid-circle.filled {
  border-color: var(--domain-result-3);
  background: var(--domain-result-3);
  color: #FFFFFF;
}

.analysis-grid-count {
  color: #5D7D7E;
}

.analysis-grid-count-1 { color: #B85F00; }
.analysis-grid-count-2 { color: #1F5FBF; }
.analysis-grid-count-3 { color: #087047; }

.analysis-table th,
.analysis-table td {
  border-right-color: rgba(14, 116, 122, 0.13);
  border-bottom-color: rgba(14, 116, 122, 0.28);
  background: rgba(255, 255, 255, 0.86);
  color: #174F54;
}

.analysis-table th {
  background: #E7F4F4;
  color: #0E6770;
}

.analysis-table tbody tr:nth-child(even) td {
  background: rgba(247, 252, 251, 0.92);
}

.analysis-table tbody tr:hover td,
.analysis-table tbody tr.selected-row td {
  background: #EDF9F8;
  color: #174F54;
}

.analysis-table tbody tr:hover .analysis-rotation-pair-cell,
.analysis-table tbody tr.selected-row .analysis-rotation-pair-cell {
  background: #DFF3F1 !important;
}

.analysis-cell-button,
.analysis-mobile-cell {
  border-color: rgba(14, 116, 122, 0.14);
  background: #FFFFFF;
  color: #174F54;
}

.analysis-cell-button:hover,
.analysis-cell-button:focus-visible,
.analysis-cell-button.selected,
.analysis-mobile-cell.selected {
  border-color: #0E747A;
  background: #E2F5F3;
  color: #174F54;
}

.analysis-mobile-row {
  border-color: rgba(14, 116, 122, 0.18);
  background: rgba(255, 255, 255, 0.86);
  color: #174F54;
}

.analysis-mobile-row.selected-row {
  background: #EDF9F8;
  box-shadow: inset 4px 0 0 #0E747A;
}

.analysis-mobile-row-title,
.analysis-mobile-position {
  color: #0B5960;
}

/* Semantic analysis colors outrank theme text rules in both modes. */
:root[data-theme] .analysis-grid-count { color: #5D7D7E; }
:root[data-theme] .analysis-grid-count-1 { color: #B85F00; }
:root[data-theme] .analysis-grid-count-2 { color: #1F5FBF; }
:root[data-theme] .analysis-grid-count-3 { color: #087047; }

:root[data-theme] .analysis-table th,
:root[data-theme] .analysis-table td {
  border-right-color: rgba(14, 116, 122, 0.13);
  border-bottom-color: rgba(14, 116, 122, 0.28);
  background: rgba(255, 255, 255, 0.86);
  color: #174F54;
}

:root[data-theme] .analysis-table th {
  background: #E7F4F4;
  color: #0E6770;
}

:root[data-theme] .analysis-table tbody tr:nth-child(even) td {
  background: rgba(247, 252, 251, 0.92);
}

:root[data-theme] .analysis-table tbody tr:hover td,
:root[data-theme] .analysis-table tbody tr.selected-row td {
  background: #EDF9F8;
  color: #174F54;
}

:root[data-theme] .analysis-table tbody tr:hover .analysis-rotation-pair-cell,
:root[data-theme] .analysis-table tbody tr.selected-row .analysis-rotation-pair-cell {
  background: #DFF3F1 !important;
}

:root[data-theme] .analysis-cell-button,
:root[data-theme] .analysis-mobile-cell {
  border-color: rgba(14, 116, 122, 0.14);
  background: #FFFFFF;
  color: #174F54;
}

:root[data-theme] .analysis-cell-button:hover,
:root[data-theme] .analysis-cell-button:focus-visible,
:root[data-theme] .analysis-cell-button.selected,
:root[data-theme] .analysis-mobile-cell.selected {
  border-color: #0E747A;
  background: #E2F5F3;
  color: #174F54;
}

:root[data-theme] .analysis-mobile-row {
  border-color: rgba(14, 116, 122, 0.18);
  background: rgba(255, 255, 255, 0.86);
  color: #174F54;
}

:root[data-theme] .analysis-mobile-row.selected-row {
  background: #EDF9F8;
  box-shadow: inset 4px 0 0 #0E747A;
}

:root[data-theme] .analysis-mobile-row-title,
:root[data-theme] .analysis-mobile-position {
  color: #0B5960;
}

/* ============================================================
   PREMIUM POLISH LAYER — added for the VOLLEY ROTATION dark
   redesign. Purely additive/cosmetic; no structural or
   functional selectors are introduced here.
   ============================================================ */

::selection {
  background: rgba(255, 122, 41, 0.35);
  color: #fff;
}

* {
  scrollbar-color: #3A4553 #10141A;
  scrollbar-width: thin;
}

*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

*::-webkit-scrollbar-track {
  background: transparent;
}

*::-webkit-scrollbar-thumb {
  background: #2A323D;
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

*::-webkit-scrollbar-thumb:hover {
  background: #3A4553;
  background-clip: padding-box;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid #FF7A29;
  outline-offset: 2px;
}

.header-brand {
  position: relative;
}

.header-brand::before {
  content: "";
  position: absolute;
  left: -14px;
  top: 4px;
  bottom: 10px;
  width: 3px;
  border-radius: 999px;
  background: linear-gradient(180deg, #FF7A29, rgba(255, 122, 41, 0));
}

h1 span {
  background: linear-gradient(120deg, #FFFFFF 45%, #C7D2DC 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.eyebrow {
  position: relative;
  padding-left: 12px;
}

.eyebrow::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 6px;
  height: 6px;
  transform: translateY(-50%);
  border-radius: 2px;
  background: #FF7A29;
}

.roster-team-header .eyebrow::before,
.matchup-team > .eyebrow::before,
.team-title .eyebrow::before {
  display: none;
}

.roster-team.home .roster-team-header {
  box-shadow: inset 3px 0 0 #4C8DFF;
}

.roster-team.away .roster-team-header {
  box-shadow: inset 3px 0 0 #FF5C7A;
}

.matchup-team.home,
.team-selector.home,
.rotation-jog-team.home {
  box-shadow: inset 3px 0 0 rgba(76, 141, 255, 0.55);
}

.matchup-team.away,
.team-selector.away,
.rotation-jog-team.away {
  box-shadow: inset 3px 0 0 rgba(255, 92, 122, 0.55);
}

section {
  transition:
    opacity 240ms ease,
    transform 240ms ease,
    padding 240ms ease,
    border-color 180ms ease;
}

.primary-button,
.text-button,
.slot-button,
.state-button,
.analysis-tab,
.rotation-jog-button,
.mini-toggle,
.court-align-toggle {
  transition:
    background 160ms ease,
    border-color 160ms ease,
    color 160ms ease,
    box-shadow 160ms ease,
    transform 120ms ease;
}

.primary-button:hover:not(:disabled) {
  background: #FF8F42;
  box-shadow: 0 8px 20px rgba(255, 122, 41, 0.28);
  transform: translateY(-1px);
}

.primary-button:active:not(:disabled) {
  transform: scale(0.98);
}

.text-button:hover:not(:disabled),
.slot-button:hover:not(:disabled) {
  background: #232C38;
}

.state-button.selected,
.slot-button.active,
.analysis-tab.active,
.drawing-mode-panel button.active {
  box-shadow: 0 6px 16px rgba(255, 122, 41, 0.25);
}

.sideout-orb {
  background: linear-gradient(145deg, #FF7A29, #FF9354);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* ============================================================================
   VOLLEY ROTATION 2.0 — INFORMATION ARCHITECTURE LAYER
   Everything above this line is the shared visual/token system.
   Everything below reworks page structure, navigation, and the
   HOME/AWAY · Court · Matchup workspaces into the new IA.
   ============================================================================ */

/* ---------- reset native disclosure styling ---------- */
summary {
  list-style: none;
  cursor: pointer;
}
summary::-webkit-details-marker,
summary::marker {
  display: none;
  content: "";
}

/* ---------- header 2.0 ---------- */
.app-header {
  display: block;
  padding: 14px 0 10px;
}

.header-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 22px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  border-radius: 11px;
  background: linear-gradient(150deg, #FF7A29, #FF9354);
  color: #12161D;
  font-size: 14px;
  font-weight: 950;
  letter-spacing: -0.02em;
  box-shadow: 0 6px 16px rgba(255, 122, 41, 0.28);
}

.brand-text {
  min-width: 0;
}

h1 {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 21px;
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.brand-name {
  color: #F5F8FB;
  background: none;
  -webkit-text-fill-color: initial;
}

.brand-by {
  color: #FF9E63;
  font-size: 0.56em;
  font-weight: 800;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.brand-tagline {
  margin-top: 1px;
  color: #7C8A9A;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.header-brand::before {
  display: none;
}

.section-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.section-nav::-webkit-scrollbar {
  display: none;
}

.section-nav a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 7px 13px;
  color: #8B96A3;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-decoration: none;
  white-space: nowrap;
  transition: background 150ms ease, color 150ms ease;
}

.section-nav a:hover,
.section-nav a:focus-visible {
  background: rgba(255, 255, 255, 0.05);
  color: #EDF1F6;
}

.nav-index {
  color: #FF7A29;
  font-size: 10px;
  font-weight: 950;
}

.header-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.header-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #1B222C;
}

.creator-label {
  color: #6E7887;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.02em;
}

.creator-label strong {
  color: #9AA7B5;
  font-weight: 900;
}

.build-label {
  color: #4B5563;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.14em;
}

body.game-mode .brand,
body.game-mode .section-nav,
body.game-mode .header-meta,
body.game-mode .header-tools > :not(#game-mode-toggle) {
  display: none;
}

/* ---------- generic eyebrow index chip ---------- */
.eyebrow-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  margin-right: 6px;
  color: #FF7A29;
  font-size: 10px;
  font-weight: 950;
}

/* ---------- shared "card" surface for section AND details.workspace-card ---------- */
.workspace-card {
  min-width: 0;
  max-width: 100%;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
  overflow: hidden;
}

.workspace-card > summary {
  padding: 18px 20px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

.workspace-card[open] > summary {
  border-bottom-color: rgba(148, 163, 184, 0.16);
}

.workspace-card-body {
  padding: 18px 20px 20px;
}

.details-caret {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: #8B96A3;
  font-size: 12px;
  transition: transform 180ms ease;
}

.workspace-card[open] .details-caret {
  transform: rotate(180deg);
}

/* ---------- main scaffold ---------- */
main {
  gap: 20px;
}

/* ============================================================
   01 · TEAM & ROTATION WORKSPACE
   ============================================================ */
.workspace-teams {
  padding: 22px;
}

.team-columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 18px;
  margin-top: 16px;
  align-items: start;
}

.team-column {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.team-column-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.side-tag {
  display: inline-flex;
  align-items: center;
  border-radius: 8px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0.1em;
}

.side-tag--home {
  background: rgba(76, 141, 255, 0.14);
  color: #7FB0FF;
  box-shadow: inset 0 0 0 1px rgba(76, 141, 255, 0.35);
}

.side-tag--away {
  background: rgba(255, 92, 122, 0.14);
  color: #FF93A9;
  box-shadow: inset 0 0 0 1px rgba(255, 92, 122, 0.35);
}

.side-readout {
  color: #F5F8FB;
  font-size: 15px;
  font-weight: 900;
}

.tactical-card {
  min-width: 0;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(148, 163, 184, 0.12);
  padding: 14px;
}

.tactical-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.side-home .tactical-card {
  box-shadow: inset 3px 0 0 rgba(76, 141, 255, 0.45);
}

.side-away .tactical-card {
  box-shadow: inset 3px 0 0 rgba(255, 92, 122, 0.45);
}

.vs-rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  align-self: stretch;
  padding: 4px 6px;
}

.vs-line {
  flex: 1;
  width: 1px;
  min-height: 24px;
  background: linear-gradient(180deg, transparent, rgba(148, 163, 184, 0.35), transparent);
}

.vs-badge {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border-radius: 50%;
  border: 1px solid rgba(255, 122, 41, 0.5);
  background: rgba(255, 122, 41, 0.1);
  color: #FF9E63;
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0.04em;
}

/* ============================================================
   QUICK MATCHUP CALCULATOR
   ============================================================ */
.quick-matchup {
  padding: 18px 22px;
}

/* ============================================================
   02 · CURRENT COURT (hero)
   ============================================================ */
.court-stage {
  padding: 22px;
  border: 1px solid rgba(255, 122, 41, 0.22);
  background:
    radial-gradient(circle at 15% 0%, rgba(255, 122, 41, 0.05), transparent 55%),
    rgba(255, 255, 255, 0.03);
  box-shadow: 0 22px 55px rgba(0, 0, 0, 0.45);
}

.court-toolrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 14px;
}

.court-toolrow-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

/* rotation jog control — the product's core dial */
.rotation-jog-team {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(148, 163, 184, 0.16);
  padding: 6px 8px 6px 14px;
}

.court-toolrow .rotation-jog-team strong,
.current-rotation-jog .rotation-jog-team strong {
  min-width: 46px;
  font-size: 18px;
  font-weight: 950;
  letter-spacing: 0.01em;
  color: #F5F8FB;
}

.current-rotation-jog .rotation-jog-button {
  width: 30px;
  height: 30px;
  font-size: 15px;
}

/* ============================================================
   03 · MATCHUP WORKSPACE
   ============================================================ */
.matchup-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

/* step flow (Matchup Setting) */
.step-flow {
  display: grid;
  gap: 4px;
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
}

.step-flow-item {
  position: relative;
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 12px;
  padding-bottom: 16px;
}

.step-flow-item:last-child {
  padding-bottom: 0;
}

.step-flow-item:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 26px;
  bottom: 0;
  width: 1px;
  background: rgba(148, 163, 184, 0.18);
}

.step-num {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: rgba(255, 122, 41, 0.12);
  border: 1px solid rgba(255, 122, 41, 0.4);
  color: #FF9E63;
  font-size: 12px;
  font-weight: 950;
  z-index: 1;
}

.step-flow-controls {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.step-label {
  color: #6E7887;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.14em;
}

.step-flow .analysis-front-row,
.step-flow .analysis-form-grid {
  margin-top: 0;
}

.analysis-form-grid.base-row,
.analysis-form-grid.mode-row,
.analysis-form-grid.count-row {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

/* apply-to-court action — visually distinct "execution" tier */
.apply-action {
  border: 1px solid rgba(79, 163, 255, 0.4);
  background: rgba(79, 163, 255, 0.1);
  color: #7FB0FF;
}

.apply-action:not(:disabled):hover {
  background: rgba(79, 163, 255, 0.18);
}

.apply-action:disabled {
  border-color: rgba(148, 163, 184, 0.18);
  background: transparent;
  color: #4B5563;
}

/* slot-button hierarchy */
.slot-button--primary {
  border-color: rgba(255, 122, 41, 0.5);
  background: rgba(255, 122, 41, 0.14);
  color: #FF9E63;
}

.slot-button--accent {
  border-color: rgba(34, 197, 94, 0.4);
  background: rgba(34, 197, 94, 0.12);
  color: #4ADE80;
}

.slot-button--ghost {
  border-color: transparent;
  background: transparent;
  color: #6E7887;
}

/* enlarge the 4/3/2 tactical circles for stronger match-count signal */
.analysis-grid-circle {
  width: 38px;
  height: 38px;
  font-size: 17px;
  font-weight: 950;
}

.analysis-signal-dot {
  width: 15px;
  height: 15px;
}

.analysis-grid-count {
  font-size: 17px;
  font-weight: 950;
}

/* 12-court timeline touches */
.rotation-index {
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  border-radius: 5px;
  background: rgba(255, 122, 41, 0.14);
  color: #FF9E63;
  font-size: 10px;
  font-weight: 950;
}

.rotation-card.current-overview {
  outline-color: #FF7A29;
  box-shadow: 0 0 0 7px rgba(255, 122, 41, 0.14);
}

.current-overview-badge {
  background: #FF7A29;
  border-color: #12161D;
  box-shadow: 0 5px 12px rgba(255, 122, 41, 0.35);
}

/* ============================================================
   RESPONSIVE — tablet
   ============================================================ */
@media (max-width: 1100px) {
  .header-row {
    grid-template-columns: auto 1fr;
  }
  .header-tools {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
  .team-columns {
    grid-template-columns: minmax(0, 1fr);
  }
  .vs-rail {
    flex-direction: row;
    padding: 0;
  }
  .vs-line {
    min-height: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(148, 163, 184, 0.35), transparent);
  }
  .matchup-workspace {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ============================================================
   RESPONSIVE — mobile portrait
   ============================================================ */
@media (max-width: 520px) {
  .header-row {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 8px;
  }
  .section-nav {
    justify-content: flex-start;
    width: 100%;
  }
  .header-tools {
    width: 100%;
    justify-content: flex-start;
  }
  .header-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
  }
  .workspace-teams,
  .quick-matchup,
  .court-stage {
    padding: 14px;
  }
  .team-columns {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }
  .court-toolrow {
    flex-direction: column;
    align-items: stretch;
  }
  .court-toolrow-actions {
    justify-content: center;
  }
  .workspace-card > summary {
    padding: 14px;
  }
  .workspace-card-body {
    padding: 12px 14px 16px;
  }
  .matchup-workspace {
    gap: 12px;
  }
}

/* CODEX v159 structure guardrails: Claude skin, original layout. */
.matchup-team {
  padding-inline: 14px;
}

.matchup-team > .eyebrow {
  margin-inline: -14px;
  padding-inline: 14px;
}

.matchup-team label {
  min-width: 0;
  padding-left: clamp(10px, 1.2vw, 16px);
  white-space: normal;
  word-break: keep-all;
  overflow-wrap: normal;
}

.matchup-team label .combo-input,
.matchup-team label select {
  margin-left: calc(-1 * clamp(10px, 1.2vw, 16px));
  width: calc(100% + clamp(10px, 1.2vw, 16px));
}

select option {
  background-color: #FFFFFF;
  color: #171A1F;
}

select:disabled,
input:disabled,
button:disabled {
  opacity: 0.66;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid #FFB37A;
  outline-offset: 2px;
}

/* Contrast pairs for light and accent surfaces. */
.draggable-player,
.draggable-player.dragging {
  color: #171A1F;
}

.game-mode-button,
.text-button.active,
.primary-button,
.situation-options input:checked + span,
.analysis-tab.active,
.slot-button.active,
.state-button.selected,
.drawing-mode-panel button.active,
.draw-tool.active,
.current-overview-badge {
  color: #171A1F;
}

.build-label {
  color: #7C8A9A;
}

/* ============================================================
   DESIGN UPDATE 02 · shared dark/light theme tokens
   ============================================================ */
:root[data-theme="dark"] {
  color-scheme: dark;
  --theme-bg: #0A0D12;
  --theme-surface: #12171E;
  --theme-surface-elevated: #1A212B;
  --theme-text-primary: #F7F9FC;
  --theme-text-secondary: #D7DCE3;
  --theme-text-muted: #A9B3BF;
  --theme-border: #35404D;
  --theme-accent: #FF7A29;
  --theme-accent-text: #171A1F;
  --theme-input: #202832;
  --theme-shadow: rgba(0, 0, 0, 0.34);
}

:root[data-theme="light"] {
  color-scheme: light;
  --theme-bg: #F2F4F7;
  --theme-surface: #FFFFFF;
  --theme-surface-elevated: #F7F8FA;
  --theme-text-primary: #171A1F;
  --theme-text-secondary: #3E4651;
  --theme-text-muted: #687383;
  --theme-border: #D5DAE1;
  --theme-accent: #F36A1D;
  --theme-accent-text: #171A1F;
  --theme-input: #FFFFFF;
  --theme-shadow: rgba(31, 41, 55, 0.1);
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 78px;
}

body {
  color: var(--theme-text-primary);
  background:
    radial-gradient(circle at 86% 0, color-mix(in srgb, var(--theme-accent) 8%, transparent), transparent 34rem),
    var(--theme-bg);
  transition: background-color 180ms ease, color 180ms ease;
}

.top-command-bar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  width: min(1480px, calc(100% - 32px));
  min-height: 52px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 auto 16px;
  border: 1px solid var(--theme-border);
  border-radius: 16px;
  background: color-mix(in srgb, var(--theme-surface) 90%, transparent);
  box-shadow: 0 12px 30px var(--theme-shadow);
  padding: 7px;
  backdrop-filter: blur(16px);
}

.section-nav {
  display: grid;
  grid-template-columns: repeat(4, minmax(76px, 1fr));
  gap: 5px;
  min-width: min(440px, 100%);
}

.section-nav a,
.theme-toggle {
  min-height: 36px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--theme-text-secondary);
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
}

.section-nav a {
  display: grid;
  place-items: center;
  padding: 0 12px;
}

.section-nav a:hover,
.section-nav a:focus-visible,
.section-nav a.active {
  border-color: color-mix(in srgb, var(--theme-accent) 70%, var(--theme-border));
  background: color-mix(in srgb, var(--theme-accent) 15%, var(--theme-surface-elevated));
  color: var(--theme-text-primary);
}

.section-nav a.active {
  box-shadow: inset 0 -2px 0 var(--theme-accent);
}

.theme-toggle {
  flex: 0 0 auto;
  min-width: 100px;
  border-color: var(--theme-border);
  background: var(--theme-surface-elevated);
  color: var(--theme-text-primary);
  cursor: pointer;
  padding: 0 14px;
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
  border-color: var(--theme-accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--theme-accent) 16%, transparent);
}

.nav-section {
  scroll-margin-top: 78px;
}

:root[data-theme="dark"] h1,
:root[data-theme="dark"] h2,
:root[data-theme="dark"] h3,
:root[data-theme="dark"] .header-credit strong,
:root[data-theme="dark"] .team-title strong,
:root[data-theme="dark"] .matchup-result strong,
:root[data-theme="dark"] .state-strip,
:root[data-theme="dark"] .rotation-jog-team strong,
:root[data-theme="dark"] .analysis-grid-count,
:root[data-theme="dark"] .analysis-count,
:root[data-theme="dark"] .court-card,
:root[data-theme="dark"] .court-card strong,
:root[data-theme="dark"] .court-card b,
:root[data-theme="dark"] .court-card .player-name,
:root[data-theme="dark"] .rotation-card,
:root[data-theme="dark"] .rotation-card strong,
:root[data-theme="dark"] .rotation-card b {
  color: var(--theme-text-primary);
}

:root[data-theme="dark"] .help-text,
:root[data-theme="dark"] .creator-label,
:root[data-theme="dark"] .header-credit,
:root[data-theme="dark"] .eyebrow,
:root[data-theme="dark"] label,
:root[data-theme="dark"] .rotation-jog-label,
:root[data-theme="dark"] footer {
  color: var(--theme-text-secondary);
}

:root[data-theme="dark"] .game-mode-button {
  color: #FFFFFF;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.4);
}

:root[data-theme="dark"] .game-mode-button.active,
:root[data-theme="dark"].game-mode .game-mode-button,
:root[data-theme="dark"] body.game-mode .game-mode-button {
  border-color: #FFB37A;
  background: var(--theme-accent);
  color: #FFFFFF;
}

:root[data-theme="light"] body {
  color: var(--theme-text-primary);
}

:root[data-theme="light"] .app-header,
:root[data-theme="light"] h1,
:root[data-theme="light"] h2,
:root[data-theme="light"] h3,
:root[data-theme="light"] .header-credit strong,
:root[data-theme="light"] .team-title strong {
  color: var(--theme-text-primary);
}

:root[data-theme="light"] h1 span {
  background: none;
  color: var(--theme-text-primary);
  -webkit-text-fill-color: currentColor;
}

:root[data-theme="light"] section,
:root[data-theme="light"] .overview-panel,
:root[data-theme="light"] .matchup-panel,
:root[data-theme="light"] .matchup-analysis-panel {
  border-color: var(--theme-border);
  background: var(--theme-surface);
  box-shadow: 0 14px 34px var(--theme-shadow);
  color: var(--theme-text-primary);
}

:root[data-theme="light"] .roster-team.home,
:root[data-theme="light"] .matchup-team.home,
:root[data-theme="light"] .team-selector.home,
:root[data-theme="light"] .rotation-jog-team.home {
  background: #EDF4FF;
}

:root[data-theme="light"] .roster-team.away,
:root[data-theme="light"] .matchup-team.away,
:root[data-theme="light"] .team-selector.away,
:root[data-theme="light"] .rotation-jog-team.away {
  background: #FFF1EB;
}

:root[data-theme="light"] .roster-team-header,
:root[data-theme="light"] .team-title,
:root[data-theme="light"] .matchup-result,
:root[data-theme="light"] .analysis-summary,
:root[data-theme="light"] .analysis-result,
:root[data-theme="light"] .current-actions,
:root[data-theme="light"] .rotation-jog,
:root[data-theme="light"] .drawing-toolbar,
:root[data-theme="light"] .text-note-toolbar {
  border-color: var(--theme-border);
  background: var(--theme-surface-elevated);
  color: var(--theme-text-primary);
}

:root[data-theme="light"] .help-text,
:root[data-theme="light"] .creator-label,
:root[data-theme="light"] .header-credit,
:root[data-theme="light"] .build-label,
:root[data-theme="light"] .eyebrow,
:root[data-theme="light"] label,
:root[data-theme="light"] footer {
  color: var(--theme-text-secondary);
}

:root[data-theme="light"] input,
:root[data-theme="light"] textarea,
:root[data-theme="light"] select,
:root[data-theme="light"] .combo-input input,
:root[data-theme="light"] .roster-inputs input,
:root[data-theme="light"] .matchup-team input,
:root[data-theme="light"] .matchup-team select {
  border-color: var(--theme-border);
  background: var(--theme-input);
  color: var(--theme-text-primary);
}

:root[data-theme="light"] input::placeholder,
:root[data-theme="light"] textarea::placeholder,
:root[data-theme="light"] .matchup-team input::placeholder {
  color: var(--theme-text-muted);
}

:root[data-theme="light"] .combo-menu,
:root[data-theme="light"] .slot-editor,
:root[data-theme="light"] .modal,
:root[data-theme="light"] [role="dialog"],
:root[data-theme="light"] .tooltip {
  border-color: var(--theme-border);
  background: #FFFFFF;
  color: var(--theme-text-primary);
  box-shadow: 0 16px 34px var(--theme-shadow);
}

:root[data-theme="light"] .combo-menu button,
:root[data-theme="light"] .slot-editor button,
:root[data-theme="light"] .text-button,
:root[data-theme="light"] .slot-button,
:root[data-theme="light"] .state-button,
:root[data-theme="light"] .analysis-tab,
:root[data-theme="light"] .rotation-jog-button,
:root[data-theme="light"] .draw-tool {
  border-color: var(--theme-border);
  background: var(--theme-surface-elevated);
  color: var(--theme-text-primary);
}

:root[data-theme="light"] .primary-button,
:root[data-theme="light"] .text-button.active,
:root[data-theme="light"] .slot-button.active,
:root[data-theme="light"] .state-button.selected,
:root[data-theme="light"] .analysis-tab.active,
:root[data-theme="light"] .situation-options input:checked + span,
:root[data-theme="light"] .drawing-mode-panel button.active,
:root[data-theme="light"] .draw-tool.active,
:root[data-theme="light"] .current-overview-badge {
  border-color: var(--theme-accent);
  background: var(--theme-accent);
  color: var(--theme-accent-text);
}

:root[data-theme="light"] .game-mode-button {
  border-color: #C54F10;
  background: #FFF0E6;
  color: #171A1F;
  text-shadow: none;
}

:root[data-theme="light"] .court-card,
:root[data-theme="light"] .rotation-card,
:root[data-theme="light"] .analysis-table th,
:root[data-theme="light"] .analysis-table td,
:root[data-theme="light"] .analysis-mobile-cell {
  border-color: var(--theme-border);
  background: #FFFFFF;
  color: var(--theme-text-primary);
}

:root[data-theme="light"] .court-card strong,
:root[data-theme="light"] .court-card b,
:root[data-theme="light"] .court-card span,
:root[data-theme="light"] .rotation-card strong,
:root[data-theme="light"] .rotation-card b,
:root[data-theme="light"] .rotation-card span,
:root[data-theme="light"] .state-strip,
:root[data-theme="light"] .analysis-table th,
:root[data-theme="light"] .analysis-table td {
  color: var(--theme-text-primary);
}

:root[data-theme="light"] .analysis-table tbody tr:nth-child(even) td {
  background: #F7F8FA;
}

:root[data-theme="light"] .analysis-table tbody tr:hover td,
:root[data-theme="light"] .analysis-table tbody tr.selected-row td {
  background: #FFF0E6;
  color: var(--theme-text-primary);
}

:root[data-theme="light"] .status-badge,
:root[data-theme="light"] .summary-pill,
:root[data-theme="light"] .matchup-result strong,
:root[data-theme="light"] .player-picker-label,
:root[data-theme="light"] .player-picker-toggle,
:root[data-theme="light"] .rotation-jog-team strong,
:root[data-theme="light"] .rotation-jog-label,
:root[data-theme="light"] .rotation-step-buttons button,
:root[data-theme="light"] .width-label,
:root[data-theme="light"] .court-align-toggle,
:root[data-theme="light"] .court-align-toggle span {
  color: var(--theme-text-primary);
}

:root[data-theme="light"] .status-badge,
:root[data-theme="light"] .summary-pill,
:root[data-theme="light"] .player-picker-toggle,
:root[data-theme="light"] .rotation-step-buttons button,
:root[data-theme="light"] .court-align-toggle {
  border-color: var(--theme-border);
  background: var(--theme-surface-elevated);
}

:root[data-theme="light"] .state-strip {
  border-color: var(--theme-border);
  background: #EEF1F5;
  color: var(--theme-text-primary);
}

:root[data-theme="light"] .state-strip span,
:root[data-theme="light"] .state-strip strong,
:root[data-theme="light"] .state-strip b {
  color: var(--theme-text-primary);
}

:root[data-theme="light"] footer {
  border-color: var(--theme-border);
  color: var(--theme-text-secondary);
}

@media (max-width: 700px) {
  .top-command-bar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px;
    min-height: 48px;
    padding: 5px;
  }

  .section-nav {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    min-width: 0;
  }

  .section-nav a {
    min-width: 0;
    padding: 0 4px;
    font-size: 11px;
    word-break: keep-all;
  }

  .theme-toggle {
    min-width: 68px;
    padding: 0 8px;
    font-size: 11px;
  }
}

@media (max-width: 380px) {
  .top-command-bar {
    grid-template-columns: minmax(0, 1fr);
  }

  .theme-toggle {
    width: 100%;
    min-height: 32px;
  }
}

/* Final color authority: original CODEX palette over Premium geometry. */
:root[data-theme] .analysis-rotation-pair-cell {
  background: #E7F4F4 !important;
  color: #0B5960;
}

:root[data-theme] .analysis-grid-count { color: #5D7D7E; }
:root[data-theme] .analysis-grid-count-1 { color: #B85F00; }
:root[data-theme] .analysis-grid-count-2 { color: #1F5FBF; }
:root[data-theme] .analysis-grid-count-3 { color: #087047; }

:root[data-theme] .analysis-table th,
:root[data-theme] .analysis-table td {
  background: rgba(255, 255, 255, 0.86);
  color: #174F54;
}

:root[data-theme] .analysis-table th {
  background: #E7F4F4;
  color: #0E6770;
}

:root[data-theme] .analysis-table tbody tr:nth-child(even) td {
  background: rgba(247, 252, 251, 0.92);
}

:root[data-theme] .analysis-table tbody tr:hover td,
:root[data-theme] .analysis-table tbody tr.selected-row td {
  background: #EDF9F8;
  color: #174F54;
}

:root[data-theme] .analysis-cell-button,
:root[data-theme] .analysis-mobile-cell {
  background: #FFFFFF;
  color: #174F54;
}

:root[data-theme] .analysis-cell-button.selected,
:root[data-theme] .analysis-mobile-cell.selected {
  background: #E2F5F3;
  color: #174F54;
}
:root[data-theme="light"] {
  --theme-bg: #DFF4F2;
  --theme-surface: rgba(255, 255, 255, 0.72);
  --theme-surface-elevated: #EDF9F8;
  --theme-text-primary: #174F54;
  --theme-text-secondary: #54787A;
  --theme-text-muted: #6C9EA0;
  --theme-border: #A7D7D4;
  --theme-accent: #0E747A;
  --theme-accent-text: #FFFFFF;
  --theme-input: rgba(255, 255, 255, 0.9);
  --theme-shadow: rgba(35, 109, 113, 0.08);
}

:root[data-theme="light"] body {
  background:
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.85), transparent 36rem),
    #DFF4F2;
  color: #16383C;
}

:root[data-theme="light"] .top-command-bar {
  border-color: #A7D7D4;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 12px 30px rgba(35, 109, 113, 0.12);
}

:root[data-theme="light"] .section-nav a,
:root[data-theme="light"] .theme-toggle {
  color: #1D7278;
}

:root[data-theme="light"] .section-nav a:hover,
:root[data-theme="light"] .section-nav a:focus-visible,
:root[data-theme="light"] .section-nav a.active {
  border-color: #0E747A;
  background: #E1F5F3;
  color: #0B5960;
}

:root[data-theme="light"] .theme-toggle {
  border-color: #A7D7D4;
  background: #EDF9F8;
}

:root[data-theme="light"] section,
:root[data-theme="light"] .overview-panel,
:root[data-theme="light"] .matchup-panel,
:root[data-theme="light"] .matchup-analysis-panel {
  border-color: rgba(91, 164, 166, 0.3);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 14px 35px rgba(35, 109, 113, 0.08);
}

:root[data-theme="light"] .roster-team.home,
:root[data-theme="light"] .matchup-team.home,
:root[data-theme="light"] .team-selector.home,
:root[data-theme="light"] .rotation-jog-team.home {
  background: #EDF9F8;
}

:root[data-theme="light"] .roster-team.away,
:root[data-theme="light"] .matchup-team.away,
:root[data-theme="light"] .team-selector.away,
:root[data-theme="light"] .rotation-jog-team.away {
  background: #FFF2E8;
}

:root[data-theme="light"] .primary-button,
:root[data-theme="light"] .text-button.active,
:root[data-theme="light"] .slot-button.active,
:root[data-theme="light"] .state-button.selected,
:root[data-theme="light"] .analysis-tab.active,
:root[data-theme="light"] .situation-options input:checked + span,
:root[data-theme="light"] .drawing-mode-panel button.active,
:root[data-theme="light"] .draw-tool.active,
:root[data-theme="light"] .current-overview-badge,
:root[data-theme="light"] .game-mode-button {
  border-color: #0E747A;
  background: #0E747A;
  color: #FFFFFF;
}

:root[data-theme="light"] input,
:root[data-theme="light"] textarea,
:root[data-theme="light"] select,
:root[data-theme="light"] .combo-input input,
:root[data-theme="light"] .roster-inputs input,
:root[data-theme="light"] .matchup-team input,
:root[data-theme="light"] .matchup-team select,
:root[data-theme="light"] .player-picker-input {
  border-color: #C8E2E0;
  background: rgba(255, 255, 255, 0.9);
  color: #174F54;
}

:root[data-theme="light"] .text-button,
:root[data-theme="light"] .slot-button,
:root[data-theme="light"] .state-button,
:root[data-theme="light"] .analysis-tab,
:root[data-theme="light"] .rotation-jog-button,
:root[data-theme="light"] .draw-tool,
:root[data-theme="light"] .court-align-toggle,
:root[data-theme="light"] .status-badge,
:root[data-theme="light"] .summary-pill {
  border-color: #A7D7D4;
  background: #E1F5F3;
  color: #1D7278;
}

.court-surface {
  border-color: #BDD9EE;
  background: #F8C9AA;
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.98);
}

.court-field {
  border-color: rgba(255, 255, 255, 0.98);
  background: #F8C9AA;
}

.court-field::before,
.court-field::after {
  background: rgba(255, 255, 255, 0.98);
}

.net-divider {
  border-block-color: #FFFFFF;
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.95) 0 2px, transparent 2px 10px),
    #101010;
}

.rotation-card .net-divider {
  border-block-color: #101010;
  background: #101010;
}

.court-field .player {
  color: #073945;
}

.draggable-player,
.draggable-player.dragging {
  border-color: rgba(13, 104, 112, 0.72);
  background: #FFFAF5;
  color: #073945;
}

.state-strip,
:root[data-theme="light"] .state-strip,
:root[data-theme="dark"] .state-strip {
  background: #BDD9EE;
  color: #244F68;
}

.state-strip span,
.state-strip strong,
.state-strip b,
:root[data-theme="light"] .state-strip span,
:root[data-theme="light"] .state-strip strong,
:root[data-theme="light"] .state-strip b,
:root[data-theme="dark"] .state-strip span,
:root[data-theme="dark"] .state-strip strong,
:root[data-theme="dark"] .state-strip b {
  color: #244F68;
}

.rotation-card .court-surface {
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.98);
}

.analysis-signal-dot {
  border-color: #0E747A;
  background: #FFFFFF;
}

.analysis-signal-dot.filled {
  background: #0E747A;
  box-shadow: 0 0 0 2px rgba(14, 116, 122, 0.12);
}

.analysis-grid-circle {
  border-color: #CFD8DC;
  background: #F3F5F5;
  color: #6F7F82;
}

.analysis-grid-signal.count-1 .analysis-grid-circle.filled {
  border-color: #F59E0B;
  background: #F59E0B;
  color: #FFFFFF;
}

.analysis-grid-signal.count-2 .analysis-grid-circle.filled {
  border-color: #2563EB;
  background: #2563EB;
  color: #FFFFFF;
}

.analysis-grid-signal.count-3 .analysis-grid-circle.filled {
  border-color: #0F8A5F;
  background: #0F8A5F;
  color: #FFFFFF;
}

.analysis-grid-count { color: #5D7D7E; }
.analysis-grid-count-1 { color: #B85F00; }
.analysis-grid-count-2 { color: #1F5FBF; }
.analysis-grid-count-3 { color: #087047; }

.analysis-table th,
.analysis-table td {
  border-right-color: rgba(14, 116, 122, 0.13);
  border-bottom-color: rgba(14, 116, 122, 0.28);
  background: rgba(255, 255, 255, 0.86);
  color: #174F54;
}

.analysis-table th {
  background: #E7F4F4;
  color: #0E6770;
}

.analysis-table tbody tr:nth-child(even) td {
  background: rgba(247, 252, 251, 0.92);
}

.analysis-table tbody tr:hover td,
.analysis-table tbody tr.selected-row td {
  background: #EDF9F8;
  color: #174F54;
}

.analysis-table tbody tr:hover .analysis-rotation-pair-cell,
.analysis-table tbody tr.selected-row .analysis-rotation-pair-cell {
  background: #DFF3F1 !important;
}

.analysis-cell-button,
.analysis-mobile-cell {
  border-color: rgba(14, 116, 122, 0.14);
  background: #FFFFFF;
  color: #174F54;
}

.analysis-cell-button:hover,
.analysis-cell-button:focus-visible,
.analysis-cell-button.selected,
.analysis-mobile-cell.selected {
  border-color: #0E747A;
  background: #E2F5F3;
  color: #174F54;
}

.analysis-mobile-row {
  border-color: rgba(14, 116, 122, 0.18);
  background: rgba(255, 255, 255, 0.86);
  color: #174F54;
}

.analysis-mobile-row.selected-row {
  background: #EDF9F8;
  box-shadow: inset 4px 0 0 #0E747A;
}

.analysis-mobile-row-title,
.analysis-mobile-position {
  color: #0B5960;
}
