@import url("https://fonts.googleapis.com/css2?family=Montserrat:wght@500;600;700;800;900&display=swap");

:root {
  --main: #522398;
  --accent: #754fad;
  --deep: #470a68;
  --cool: #a991cb;
  --sky: #b9c8d3;
  --gold: #e5def0;
  --cloud: #778692;
  --lightning: #b9c8d3;
  --purple-tint: #e5def0;
  --bg: #f8f6fb;
  --surface: #ffffff;
  --surface-2: #f0ecf7;
  --text: #23172f;
  --muted: #6c6178;
  --border: #d9cfe8;
  --shadow: 0 18px 50px rgba(71, 10, 104, 0.12);
}

:root.dark {
  --bg: #170421;
  --surface: #24112e;
  --surface-2: #311342;
  --text: #f7f2ff;
  --muted: #cdbedc;
  --border: rgba(185, 200, 211, 0.22);
  --shadow: 0 18px 55px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, rgba(229, 222, 240, 0.72), rgba(248, 246, 251, 0) 260px),
    var(--bg);
  color: var(--text);
  font-family: "Montserrat", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 500;
}

button,
select,
input {
  font: inherit;
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  align-items: center;
  background: rgba(255, 255, 255, 0.9);
  border-bottom: 3px solid var(--main);
  color: var(--text);
  display: flex;
  min-height: 104px;
  padding: 18px clamp(22px, 7vw, 140px);
}

.brand {
  align-items: center;
  color: inherit;
  display: flex;
  gap: 14px;
  text-decoration: none;
}

.brand-mark {
  align-items: center;
  background: #fff;
  border: 0;
  color: var(--main);
  display: grid;
  font-weight: 900;
  height: 52px;
  place-items: center;
  width: 52px;
}

:root.dark .brand-mark {
  background: #fff;
  color: var(--main);
}

.brand-mark img {
  display: block;
  max-height: 42px;
  max-width: 42px;
  object-fit: contain;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 20px;
  font-weight: 900;
  line-height: 1.1;
}

.topbar h1 {
  color: var(--main);
  font-size: clamp(24px, 3vw, 38px);
  letter-spacing: -0.04em;
}

.topbar p {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  margin-top: 4px;
}

h2 {
  font-size: clamp(24px, 3vw, 38px);
  font-weight: 900;
  line-height: 1.05;
}

p {
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
}

.top-actions {
  align-items: center;
  display: flex;
  gap: 12px;
}

.icon-button,
button {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
  min-height: 36px;
  padding: 8px 12px;
}

button:hover {
  border-color: var(--accent);
}

.theme-toggle input {
  display: none;
}

.theme-toggle span {
  background: rgba(255, 255, 255, 0.20);
  border: 1px solid rgba(255, 255, 255, 0.42);
  display: block;
  height: 24px;
  position: relative;
  width: 46px;
}

.theme-toggle span::after {
  background: #fff;
  content: "";
  height: 16px;
  left: 4px;
  position: absolute;
  top: 3px;
  transition: transform 160ms ease;
  width: 16px;
}

.theme-toggle input:checked + span::after {
  transform: translateX(20px);
}

.window-tabs {
  background: #fff;
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 10px clamp(18px, 4vw, 44px);
}

.tab {
  background: transparent;
  border: 1px solid transparent;
  color: var(--muted);
  font-weight: 800;
  min-width: 104px;
}

.tab.active {
  background: var(--main);
  border-color: var(--main);
  color: #fff;
}

:root.dark .tab.active {
  background: var(--accent);
  color: #170421;
}

.tab.disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

main {
  max-width: 1800px;
  margin: 0 auto;
  padding: clamp(22px, 3.2vw, 52px);
}

.page {
  display: none;
}

.page.active {
  display: block;
}

.hero-band,
.cards-header,
.stage-head {
  align-items: center;
  display: flex;
  gap: 14px;
  justify-content: space-between;
}

.card-header-right {
  align-items: center;
  display: flex;
  gap: 12px;
}

.download-card-btn {
  align-items: center;
  background: var(--accent);
  border: none;
  color: #17110c;
  cursor: pointer;
  display: flex;
  font-size: 13px;
  font-weight: 800;
  gap: 6px;
  height: 42px;
  letter-spacing: 0.04em;
  padding: 0 18px;
  white-space: nowrap;
}

.download-card-btn:hover {
  opacity: 0.85;
}

.download-card-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.hitting-coming-soon {
  align-items: center;
  color: var(--muted);
  display: flex;
  font-size: 18px;
  font-weight: 700;
  justify-content: center;
  min-height: 300px;
}

.score-controls,
.cards-header label,
.player-picker {
  align-items: end;
  display: flex;
  gap: 8px;
}

label {
  color: var(--muted);
  display: grid;
  font-size: 12px;
  font-weight: 800;
  gap: 6px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

input,
select {
  background: #f3eef8;
  border: 1px solid var(--border);
  color: var(--text);
  min-height: 38px;
  padding: 8px 10px;
}

:root.dark input,
:root.dark select {
  background: #2b1439;
  color: #f7f2ff;
}

.score-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  margin-top: 22px;
}

.score-card {
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 16px;
}

.score-row {
  align-items: center;
  display: flex;
  gap: 8px;
  justify-content: space-between;
  margin-top: 8px;
}

.score-logo {
  width: 20px;
  height: 20px;
  object-fit: contain;
  flex-shrink: 0;
}

.score-row strong {
  font-size: 15px;
  font-weight: 700;
}

.score-row span {
  font-variant-numeric: tabular-nums;
  font-weight: 900;
}

.score-conference {
  color: var(--muted);
  font-size: 12px;
  margin: 2px 0 0 0;
}

.status {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.tool-layout {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(240px, 300px) minmax(0, 1fr);
}

.control-rail {
  align-content: start;
  background: var(--surface);
  border: 1px solid var(--border);
  display: grid;
  gap: 12px;
  padding: 14px;
}

.viz-stage {
  min-width: 0;
}

.stage-head {
  justify-content: flex-start;
  margin-bottom: 12px;
}

.stage-identity {
  align-items: center;
  display: grid;
  gap: 12px;
  grid-template-columns: 52px minmax(0, auto);
}

.stage-identity h2 {
  color: var(--accent);
  font-size: clamp(30px, 3.2vw, 52px);
  letter-spacing: 0;
  line-height: 0.92;
  margin: 0;
}

.stage-identity p {
  color: var(--muted);
  font-size: 13px;
  margin: 5px 0 0;
}

.control-rail select {
  font-weight: 800;
}

.sidebar-label {
  color: var(--accent);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.date-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.date-section-head {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

.date-all-label {
  align-items: center;
  cursor: pointer;
  display: flex;
  font-size: 12px;
  font-weight: 700;
  gap: 4px;
}

.date-check-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 260px;
  overflow-y: auto;
}

.date-check-list label {
  align-items: center;
  cursor: pointer;
  display: flex;
  font-size: 12px;
  font-weight: 600;
  gap: 6px;
  padding: 2px 0;
}

.hero-band h2,
.stage-head h2,
.cards-header h2 {
  font-weight: 900;
  text-transform: uppercase;
}

.stage-head p,
.cards-header p,
.hero-band p {
  font-weight: 600;
}

.segmented {
  border: 1px solid var(--border);
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.segmented.side-segment {
  grid-template-columns: repeat(3, 1fr);
}

.segmented button {
  border: 0;
  min-height: 36px;
}

.segmented button.active {
  background: var(--main);
  color: var(--accent);
}

:root.dark .segmented button.active {
  background: var(--accent);
  color: var(--main);
}

.range-row {
  grid-template-columns: 1fr auto;
}

.range-row input {
  grid-column: 1 / -1;
}

.viz-toolbar {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.toolbar-row {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.toolbar-select {
  display: block;
  position: relative;
}

.toolbar-select span {
  border: 0;
  clip: rect(0 0 0 0);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
}

.toolbar-select select,
.toolbar-button,
.toolbar-icon {
  appearance: none;
  background: var(--surface);
  border: 2px solid var(--lightning);
  border-radius: 6px;
  box-shadow: 0 0 0 1px rgba(71, 10, 104, 0.04);
  color: var(--text);
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0;
  min-height: 36px;
  padding: 5px 34px 5px 12px;
  text-transform: none;
}

.toolbar-select:not(:has(.custom-select-btn))::after {
  color: currentColor;
  content: "⌄";
  font-size: 13px;
  pointer-events: none;
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-52%);
}

.toolbar-select.primary select {
  background: var(--main);
  border-color: var(--main);
  color: #ffffff;
  font-weight: 800;
}

.toolbar-select.primary::after {
  color: #ffffff;
}

.heatmap-control,
.tunnel-control {
  display: none;
}

.heatmap-control.is-visible,
.tunnel-control.is-visible {
  display: block;
}

.toolbar-button {
  background: var(--deep);
  border-color: var(--deep);
  color: #ffffff;
  font-weight: 800;
  padding: 5px 16px;
}

.toolbar-icon {
  min-width: 48px;
  padding: 5px 10px;
}

.custom-select-btn {
  appearance: none;
  background: var(--surface);
  border: 2px solid var(--lightning);
  border-radius: 6px;
  color: var(--text);
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  min-height: 36px;
  padding: 5px 34px 5px 12px;
  position: relative;
  text-align: left;
  white-space: nowrap;
}

.toolbar-select.primary .custom-select-btn {
  background: var(--main);
  border-color: var(--main);
  color: #fff;
  font-weight: 800;
}

.custom-select-btn::after {
  content: "⌄";
  font-size: 13px;
  pointer-events: none;
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-52%);
}

.custom-select-list {
  background: var(--surface);
  border: 2px solid var(--lightning);
  border-radius: 6px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.14);
  left: 0;
  min-width: 100%;
  overflow: hidden;
  position: absolute;
  top: calc(100% + 4px);
  z-index: 200;
}

.custom-select-item {
  background: none;
  border: 0;
  color: var(--text);
  cursor: pointer;
  display: block;
  font-size: 14px;
  font-weight: 600;
  padding: 9px 16px;
  text-align: left;
  width: 100%;
}

.custom-select-item:hover {
  background: var(--purple-tint);
}

.custom-select-item.is-active {
  background: var(--main);
  color: #fff;
}

[data-theme="dark"] .custom-select-item:hover {
  background: #1e2a3a;
}

[data-theme="dark"] .custom-select-list {
  border-color: #3a4a5c;
}

.toolbar-segment {
  border: 0;
  display: flex;
  gap: 0;
}

.toolbar-segment button {
  background: var(--surface);
  border: 2px solid var(--lightning);
  color: var(--text);
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  min-height: 36px;
  padding: 5px 16px;
}

.toolbar-segment button + button {
  margin-left: -2px;
}

.toolbar-segment button.active {
  background: var(--main);
  border-color: var(--main);
  color: #ffffff;
}

.avg-select {
  display: none;
}

.avg-select.is-visible {
  display: block;
}

.is-hidden {
  display: none !important;
}

.avg-select input,
.avg-select output {
  display: none;
}

.filter-tray {
  align-items: flex-start;
  border-top: 1px solid var(--border);
  display: none;
  padding-top: 10px;
}

.filter-tray.is-open {
  display: flex;
}

.retag-panel {
  align-items: center;
  background: var(--surface);
  border: 2px dashed var(--accent);
  border-radius: 4px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
  padding: 10px 14px;
}

.retag-panel[hidden],
.retag-velo-panel[hidden] {
  display: none;
}

.retag-count {
  color: var(--text);
  flex: 1 1 100%;
  font-size: 13px;
  font-weight: 600;
}

.retag-velo-panel {
  align-items: center;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  display: grid;
  flex: 1 1 360px;
  gap: 7px;
  min-width: min(520px, 100%);
  padding: 8px 10px;
}

.retag-velo-head {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.retag-velo-head span {
  color: var(--accent);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.retag-velo-head output {
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
}

.retag-velo-sliders {
  display: grid;
  gap: 2px;
}

.retag-velo-sliders input[type="range"] {
  accent-color: var(--cool);
  width: 100%;
}

.retag-velo-clear {
  background: transparent;
  border: 0;
  color: var(--muted);
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
  justify-self: end;
  padding: 0;
  text-transform: uppercase;
}

.retag-label {
  align-items: center;
  color: var(--text);
  display: flex;
  font-size: 13px;
  font-weight: 700;
  gap: 6px;
}

.retag-label select {
  background: var(--surface);
  border: 1.5px solid var(--border);
  color: var(--text);
  font-size: 13px;
  padding: 3px 8px;
}

.retag-bulk-row {
  align-items: center;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  display: flex;
  flex: 1 1 100%;
  flex-wrap: wrap;
  gap: 10px;
  padding: 8px 10px;
}

.retag-btn {
  border: 0;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  padding: 5px 14px;
}

.retag-btn:disabled {
  cursor: not-allowed;
  opacity: 0.4;
}

.retag-btn--apply { background: var(--main); color: #fff; }
.retag-btn--delete { background: var(--deep); color: #fff; }
.retag-btn--reset { background: var(--border); color: var(--text); margin-left: auto; }

#retagToggle.is-active {
  background: var(--accent);
  color: #111827;
}

.filter-block {
  align-items: center;
  border: 2px solid var(--border);
  border-radius: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 7px 10px;
}

.filter-heading {
  color: var(--accent);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.06em;
  line-height: 1;
  margin-right: 2px;
  text-transform: uppercase;
}

.active-filter-row {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  min-height: 38px;
}

.filter-pill {
  align-items: center;
  background: var(--surface);
  border: 2px solid #e1e6ee;
  color: var(--text);
  display: inline-flex;
  font-size: 14px;
  font-weight: 700;
  gap: 7px;
  min-height: 34px;
  padding: 4px 10px;
}

.filter-pill strong {
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.filter-pill button {
  align-items: center;
  background: var(--accent);
  border: 0;
  border-radius: 999px;
  color: #111827;
  display: inline-flex;
  font-size: 15px;
  font-weight: 900;
  height: 24px;
  justify-content: center;
  min-height: 24px;
  padding: 0;
  width: 24px;
}

details {
  border-top: 1px solid var(--border);
  padding-top: 10px;
}

summary {
  color: var(--text);
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.check-grid,
.split-grid,
.metric-grid {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.split-grid {
  grid-template-columns: repeat(2, 1fr);
}

.check-grid label,
.split-grid label,
.metric-grid label {
  align-items: center;
  display: flex;
  font-size: 12px;
  gap: 8px;
  letter-spacing: 0;
  text-transform: none;
}

.chip-grid {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 0;
}

.chip-grid label {
  align-items: center;
  border: 2px solid var(--lightning);
  border-radius: 6px;
  color: var(--text);
  cursor: pointer;
  display: flex;
  font-size: 13px;
  font-weight: 700;
  gap: 5px;
  min-height: 30px;
  padding: 3px 10px;
  transition: border-color 0.12s, background 0.12s;
}

.chip-grid label:has(input:checked) {
  background: var(--main);
  border-color: var(--main);
  color: #fff;
}

.chip-grid label input {
  display: none;
}

.viz-choice-group {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.viz-choice-group label {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  cursor: pointer;
  display: flex;
  font-size: 12px;
  font-weight: 800;
  gap: 7px;
  min-height: 36px;
  padding: 6px 10px;
}

.viz-choice-group label:has(input:checked) {
  background: var(--main);
  border-color: var(--main);
  color: #fff;
}

.viz-choice-group input {
  display: none;
}

.range-filter {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 10px;
}

.range-filter-head,
.spray-filter-meta {
  align-items: center;
  color: var(--muted);
  display: flex;
  font-size: 11px;
  font-weight: 800;
  justify-content: space-between;
  letter-spacing: 0;
}

.range-filter-head span:first-child {
  color: var(--text);
}

.dual-range {
  display: grid;
  gap: 5px;
}

.dual-range input[type="range"] {
  accent-color: var(--accent);
  cursor: grab;
  width: 100%;
}

.dual-range input[type="range"]:active {
  cursor: grabbing;
}

.spray-filter-meta {
  border-top: 1px solid var(--border);
  justify-content: flex-start;
  margin-top: 12px;
  padding-top: 10px;
}

.team-badge {
  align-items: center;
  background: var(--surface);
  border: 1px solid color-mix(in srgb, var(--accent) 34%, var(--border));
  border-radius: 7px;
  display: grid;
  flex-shrink: 0;
  height: 52px;
  justify-items: center;
  overflow: hidden;
  width: 52px;
}

.team-badge:empty {
  display: none;
}

.team-badge img {
  max-height: 42px;
  max-width: 42px;
}

.chart {
  background: var(--surface);
  border: 1px solid var(--border);
  height: 560px;
  margin-top: 12px;
}

.stadium-builder-shell {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
}

.stadium-builder-rail {
  align-self: start;
  background: var(--surface);
  border: 1px solid var(--border);
  display: grid;
  gap: 16px;
  padding: 16px;
}

.stadium-builder-rail .team-filter-input + .team-filter-input {
  margin-top: 8px;
}

.stadium-mode-grid,
.stadium-action-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.stadium-trace-layer {
  display: grid;
  gap: 6px;
  margin: 8px 0;
}

.stadium-trace-layer span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.stadium-trace-layer select {
  width: 100%;
}

.stadium-toggle {
  align-items: center;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  display: flex;
  font-size: 12px;
  font-weight: 800;
  gap: 8px;
  margin: 8px 0;
  min-height: 38px;
  padding: 8px 10px;
}

.stadium-toggle input {
  accent-color: var(--main);
  min-height: auto;
  padding: 0;
}

.stadium-mode-grid button,
.stadium-action-grid button {
  border-radius: 6px;
  font-size: 12px;
  font-weight: 800;
  min-height: 38px;
  padding: 7px 9px;
}

.stadium-mode-grid button.active {
  background: var(--main);
  border-color: var(--main);
  color: #fff;
}

.stadium-builder-status {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
  padding: 10px;
}

.stadium-builder-results {
  display: grid;
  gap: 8px;
}

.stadium-result-row {
  align-items: center;
  border-bottom: 1px solid var(--border);
  display: flex;
  font-size: 13px;
  justify-content: space-between;
  padding: 7px 0;
}

.stadium-result-row span {
  color: var(--muted);
  font-weight: 800;
}

.stadium-result-row strong {
  color: var(--text);
  font-weight: 900;
}

.stadium-builder-main {
  min-width: 0;
}

.stadium-canvas-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  margin-top: 12px;
  overflow: auto;
  padding: 10px;
}

.stadium-trace-canvas {
  display: block;
  max-width: 100%;
}

.stadium-json-output {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  line-height: 1.45;
  margin: 12px 0 0;
  max-height: 340px;
  overflow: auto;
  padding: 12px;
  white-space: pre-wrap;
}

.chart.is-square {
  aspect-ratio: 1 / 1;
  height: auto;
  margin-left: auto;
  margin-right: auto;
  min-height: 420px;
  max-width: 720px;
  width: min(100%, 72vh, 720px);
}

.chart.is-polar {
  border: 0;
  height: clamp(620px, calc(100vh - 340px), 920px);
  margin-left: 0;
  margin-right: 0;
  max-width: none;
  width: 100%;
}

.chart.is-plate {
  max-width: 760px;
  width: min(100%, 78vh, 760px);
}

.chart.is-release {
  align-items: stretch;
  border: 0;
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, minmax(420px, 1fr));
  height: auto;
  max-width: 100%;
  min-height: 560px;
}

.release-point-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  min-height: 540px;
  min-width: 0;
}

.release-point-plot {
  height: 540px;
  width: 100%;
}

@media (max-width: 980px) {
  .chart.is-release {
    grid-template-columns: 1fr;
  }

  .stadium-builder-shell {
    grid-template-columns: 1fr;
  }
}

.chart.is-report {
  height: auto;
  margin-left: auto;
  margin-right: auto;
  max-width: 920px;
  min-height: 760px;
  width: min(100%, 920px);
}

.chart.is-report .radial-image-wrap img {
  display: block;
  height: auto;
  width: 100%;
}

.chart.is-multi {
  align-items: stretch;
  border: 0;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(420px, 1fr);
  gap: 14px;
  height: auto;
  max-width: 100%;
  min-height: 0;
  overflow-x: auto;
  padding-bottom: 6px;
}

.hitter-viz-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  min-height: 420px;
  min-width: 420px;
  overflow: hidden;
}

.hitter-viz-panel-title {
  border-bottom: 1px solid var(--border);
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
  padding: 9px 12px;
}

.hitter-viz-panel-body {
  flex: 1;
  min-height: 0;
}

.hitter-viz-panel-body.is-square {
  aspect-ratio: 1 / 1;
  min-height: 420px;
}

.hitter-viz-panel-body.is-contact {
  display: grid;
  grid-template-rows: minmax(360px, auto) auto;
  min-height: 560px;
}

.hitter-viz-panel-body.is-report {
  aspect-ratio: 15 / 11.5;
  min-height: 420px;
}

.hitter-viz-panel-body.is-report img,
.hitter-viz-panel-body.is-image img {
  display: block;
  height: auto;
  width: 100%;
}

.contact-bucket-table-wrap {
  border-top: 1px solid var(--border);
  max-height: 260px;
  overflow: auto;
}

.contact-bucket-actions {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 8px;
  position: sticky;
  top: 0;
  z-index: 2;
}

.contact-bucket-reset {
  background: #edf1f7;
  border: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
  padding: 7px 10px;
}

.contact-bucket-reset:hover {
  border-color: var(--accent);
}

.contact-bucket-table {
  border-collapse: collapse;
  color: var(--text);
  font-size: 12px;
  width: 100%;
}

.contact-bucket-table th,
.contact-bucket-table td {
  border-bottom: 1px solid var(--border);
  padding: 7px 9px;
  text-align: right;
  white-space: nowrap;
}

.contact-bucket-table tbody tr {
  cursor: pointer;
}

.contact-bucket-table tbody tr:hover,
.contact-bucket-table tbody tr.is-selected {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.contact-bucket-table th:first-child,
.contact-bucket-table td:first-child {
  text-align: left;
  white-space: normal;
}

.contact-bucket-table th {
  background: var(--surface-2);
  font-size: 11px;
  font-weight: 900;
  position: sticky;
  top: 0;
  z-index: 1;
}

.contact-bucket-empty {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  margin: 0;
  padding: 14px;
}

.chart.is-usage {
  height: auto;
  min-height: 0;
}

/* ── Usage chart ─────────────────────────────────────────── */
.usage-chart {
  padding: 14px 18px 20px;
  width: 100%;
  box-sizing: border-box;
}

.usage-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.usage-header-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted, #7c8a99);
}

.usage-header-label:last-child {
  text-align: right;
}

.usage-header-center {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted, #7c8a99);
  text-align: center;
  padding: 0 10px;
}

.usage-row {
  display: grid;
  grid-template-columns: 1fr 76px 1fr;
  align-items: center;
  gap: 8px;
  margin-bottom: 7px;
}

.usage-side {
  display: flex;
  align-items: center;
  gap: 6px;
}

.usage-side--left {
  flex-direction: row-reverse;
  justify-content: flex-start;
}

.usage-side--right {
  flex-direction: row;
  justify-content: flex-start;
}

.usage-bar-track {
  flex: 1;
  height: 24px;
  border-radius: 20px;
  overflow: hidden;
  background: var(--surface-raised, rgba(0,0,0,0.06));
}

.usage-bar-track--left {
  display: flex;
  justify-content: flex-end;
}

.usage-bar-track--right {
  display: flex;
  justify-content: flex-start;
}

.usage-bar {
  height: 100%;
  border-radius: 20px;
  min-width: 2px;
  opacity: 0.88;
  transition: width 0.3s ease;
}

.usage-pct {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted, #7c8a99);
  white-space: nowrap;
  min-width: 32px;
  text-align: center;
}

.usage-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 18px;
  padding: 4px 8px;
  gap: 1px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.18);
}

.usage-abbrev {
  font-size: 13px;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.03em;
  line-height: 1;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.usage-total-pct {
  font-size: 10px;
  font-weight: 600;
  color: rgba(255,255,255,0.85);
  line-height: 1;
}

/* ── Plinko chart ─────────────────────────────────────────── */
.chart.is-plinko {
  height: clamp(720px, calc(100vh - 250px), 980px);
}

.chart.is-tunnel {
  height: 650px;
}

.anchor-tunnel {
  background: #eeeeee;
  display: grid;
  gap: 22px;
  grid-template-columns: minmax(420px, 1fr) minmax(380px, 0.9fr);
  min-height: 650px;
  padding: 18px;
}

:root.dark .anchor-tunnel {
  background: #1b1024;
}

.anchor-field-panel,
.anchor-metrics-card,
.anchor-help-card {
  background: var(--surface);
  border: 1px solid rgba(0, 0, 0, 0.04);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.anchor-field-panel {
  display: grid;
  grid-template-rows: auto minmax(420px, 1fr) auto;
  min-height: 610px;
  padding: 18px;
}

.anchor-field-head {
  align-items: start;
  display: flex;
  gap: 16px;
  justify-content: space-between;
}

.anchor-field-head h3,
.anchor-metrics-card h3,
.anchor-help-card h3 {
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 0;
  margin: 0;
}

.anchor-field-head p {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  margin: 4px 0 0;
}

.anchor-select-label {
  display: grid;
  gap: 6px;
  min-width: 190px;
}

.anchor-select-label span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.anchor-select-label select {
  appearance: none;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  min-height: 34px;
  padding: 6px 10px;
}

.anchor-field-svg {
  height: 100%;
  min-height: 470px;
  touch-action: none;
  width: 100%;
}

.anchor-svg-bg {
  fill: var(--surface);
}

.anchor-zone rect {
  fill: transparent;
  stroke: color-mix(in srgb, var(--text), transparent 24%);
  stroke-width: 2.5;
}

.anchor-zone line {
  stroke: var(--border);
  stroke-width: 1.2;
}

.anchor-plate {
  fill: transparent;
  stroke: color-mix(in srgb, var(--text), transparent 18%);
  stroke-linejoin: round;
  stroke-width: 2.2;
}

.anchor-connector {
  opacity: 0.34;
  stroke-dasharray: 6 5;
  stroke-width: 2;
}

.anchor-separation-label {
  fill: var(--muted);
  font-size: 11px;
  font-weight: 900;
  paint-order: stroke;
  pointer-events: none;
  stroke: var(--surface);
  stroke-width: 4px;
  text-anchor: middle;
}

.anchor-bubble {
  cursor: grab;
}

.anchor-bubble:active {
  cursor: grabbing;
}

.anchor-bubble circle {
  opacity: 0.92;
  stroke: #ffffff;
  stroke-width: 3;
}

.anchor-bubble.is-anchor circle {
  stroke: var(--text);
  stroke-width: 3.5;
}

.anchor-bubble text {
  fill: #ffffff;
  font-size: 10px;
  font-weight: 900;
  pointer-events: none;
  text-anchor: middle;
}

.anchor-legend {
  display: grid;
  gap: 6px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding-top: 6px;
}

.anchor-legend span {
  align-items: center;
  color: var(--text);
  display: flex;
  font-size: 12px;
  font-weight: 800;
  gap: 7px;
  min-width: 0;
}

.anchor-legend i,
.anchor-dot {
  border-radius: 999px;
  display: inline-block;
  flex: 0 0 auto;
  height: 12px;
  width: 12px;
}

.anchor-side-panel {
  align-content: start;
  display: grid;
  gap: 18px;
}

.anchor-metrics-card h3 {
  background: #67ad3d;
  color: #ffffff;
  padding: 12px 16px;
  text-align: center;
}

.anchor-table-wrap {
  overflow-x: auto;
}

.anchor-metrics-card table {
  border-collapse: collapse;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  width: 100%;
}

.anchor-metrics-card th {
  background: #777777;
  color: #ffffff;
  font-weight: 900;
  padding: 7px 8px;
  text-align: left;
  white-space: nowrap;
}

.anchor-metrics-card td {
  border: 1px solid color-mix(in srgb, var(--text), transparent 72%);
  padding: 7px 8px;
  text-align: right;
  white-space: nowrap;
}

.anchor-metrics-card td:first-child {
  align-items: center;
  display: flex;
  gap: 7px;
  text-align: left;
}

.anchor-help-card {
  padding: 24px;
}

.anchor-help-card h3 {
  color: var(--muted);
  font-size: 17px;
  margin-bottom: 18px;
  text-transform: uppercase;
}

.anchor-help-card p {
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.55;
  margin: 0 0 14px;
}

@media (max-width: 980px) {
  .anchor-tunnel {
    grid-template-columns: 1fr;
    padding: 12px;
  }

  .anchor-field-panel {
    min-height: 560px;
  }

  .anchor-field-head {
    align-items: stretch;
    flex-direction: column;
  }

  .anchor-legend {
    grid-template-columns: 1fr;
  }
}

.plinko-wrap {
  padding: 16px;
  width: 100%;
  box-sizing: border-box;
  overflow-x: auto;
}

.usage-empty {
  padding: 40px;
  text-align: center;
  color: var(--text-muted, #7c8a99);
}

.radial-image-wrap {
  align-items: center;
  background: var(--surface);
  display: flex;
  height: 100%;
  justify-content: center;
  overflow: hidden;
}

.radial-image-wrap img {
  display: block;
  height: 100%;
  max-width: 100%;
  object-fit: contain;
}

.polar-package {
  align-items: stretch;
  background: var(--surface);
  border: 1px solid var(--border);
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(220px, 0.82fr) minmax(520px, 2.5fr) minmax(220px, 0.82fr);
  height: 100%;
  padding: 18px;
  width: 100%;
}

.polar-plot {
  min-height: 100%;
  min-width: 0;
}

.polar-side-panel {
  align-self: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.polar-side-title {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0;
  text-align: center;
}

.polar-overall {
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
  margin-top: 14px;
  text-align: center;
}

.polar-bar-scale {
  align-items: center;
  color: var(--muted);
  display: flex;
  font-size: 10px;
  font-weight: 900;
  justify-content: space-between;
  margin: 8px 0 5px;
}

.polar-bar-scale span:first-child {
  color: var(--cool);
}

.polar-bar-scale span:last-child {
  color: #dc2626;
}

.polar-bar-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.polar-bar-row {
  position: relative;
}

.polar-bar-row::after {
  background: var(--text);
  border-radius: 6px;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.18);
  color: var(--surface);
  content: attr(data-tooltip);
  font-size: 11px;
  font-weight: 800;
  left: 50%;
  line-height: 1.35;
  max-width: 220px;
  opacity: 0;
  padding: 8px 10px;
  pointer-events: none;
  position: absolute;
  top: -8px;
  transform: translate(-50%, -100%);
  transition: opacity 0.12s ease;
  white-space: pre-line;
  z-index: 20;
}

.polar-bar-row:hover::after {
  opacity: 1;
}

.polar-bar-meta {
  align-items: end;
  display: flex;
  font-size: 11px;
  font-weight: 900;
  justify-content: space-between;
  margin-bottom: 4px;
}

.polar-bar-meta strong {
  color: var(--text);
  font-size: 10px;
}

.polar-bar-track {
  background: color-mix(in srgb, var(--border) 55%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--border) 75%, var(--text));
  border-radius: 5px;
  height: 18px;
  overflow: hidden;
}

.polar-overall-track {
  height: 22px;
}

.polar-bar-track span {
  border-radius: inherit;
  display: block;
  height: 100%;
}

.polar-empty {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  margin-top: 12px;
  text-align: center;
}

@media (max-width: 900px) {
  .polar-package {
    grid-template-columns: 1fr;
    overflow: auto;
  }

  .polar-plot {
    min-height: 420px;
  }
}

/* ── Table column picker ─────────────────────────────────── */
.table-controls {
  margin-top: 16px;
}

.tcol-picker {
  background: var(--surface-2, var(--surface));
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0;
}

.tcol-picker summary {
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted, #7c8a99);
  padding: 8px 14px;
  user-select: none;
  list-style: none;
}

.tcol-picker summary::-webkit-details-marker { display: none; }
.tcol-picker summary::before { content: "▸ "; }
.tcol-picker[open] summary::before { content: "▾ "; }

.tcol-groups {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  padding: 10px 14px 14px;
  border-top: 1px solid var(--border);
}

.tcol-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tcol-group-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted, #7c8a99);
}

.tcol-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.tcol-chip {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  gap: 0;
  padding: 3px 4px 3px 8px;
  transition: border-color 0.15s, background 0.15s;
  user-select: none;
}

.tcol-chip:hover { border-color: var(--accent); }

.tcol-chip.active {
  background: color-mix(in srgb, var(--main) 14%, var(--surface));
  border-color: var(--main);
}

.tcol-name {
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.tcol-color {
  background: none;
  border: none;
  border-radius: 4px;
  color: var(--muted, #7c8a99);
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
  margin-left: 3px;
  opacity: 0.35;
  padding: 1px 3px;
  transition: opacity 0.15s, color 0.15s;
}

.tcol-color.on {
  color: var(--cool);
  opacity: 1;
}

.tcol-chip:not(.active) .tcol-color { visibility: hidden; }

.tcol-active-order {
  display: grid;
  gap: 6px;
  margin: 10px 0 12px;
}

.tcol-order-row {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 32px;
}

.tcol-order-chip {
  align-items: center;
  background: color-mix(in srgb, var(--main) 14%, var(--surface));
  border: 1px solid var(--main);
  border-radius: 6px;
  color: var(--text);
  cursor: grab;
  display: inline-flex;
  font-size: 11px;
  font-weight: 700;
  gap: 6px;
  padding: 5px 8px;
  user-select: none;
}

.tcol-order-chip:active {
  cursor: grabbing;
}

.tcol-order-chip.is-dragging {
  opacity: 0.45;
}

.tcol-order-chip.is-drop-target {
  box-shadow: inset 3px 0 0 var(--accent);
}

.tcol-drag-handle {
  color: var(--accent);
  font-size: 10px;
  line-height: 1;
}

/* Colored header indicator */
th.col-colored { border-bottom: 2px solid var(--cool); }

/* ── Table wrapper ───────────────────────────────────────── */
.table-wrap {
  border: 1px solid var(--border);
  margin-left: auto;
  margin-right: auto;
  margin-top: 10px;
  max-width: 100%;
  overflow-x: auto;
  width: fit-content;
}

#pitchviz .table-wrap {
  border-radius: 6px;
  margin-top: 14px;
  width: 100%;
}

#pitchStatsTable {
  min-width: 1120px;
  width: 100%;
}

#pitchStatsTable th,
#pitchStatsTable td {
  font-size: 14px;
  min-width: 78px;
  padding: 10px 12px;
}

#pitchStatsTable th {
  font-size: 11px;
}

#pitchStatsTable th:first-child,
#pitchStatsTable td:first-child {
  min-width: 128px;
}

table {
  border-collapse: collapse;
  width: max-content;
}

th,
td {
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
  font-size: 12px;
  padding: 7px 6px;
  text-align: center;
  white-space: nowrap;
}

th:last-child,
td:last-child {
  border-right: none;
}

/* Pitch type column — left-align, bold */
th:first-child,
td:first-child {
  text-align: left;
  border-right: 2px solid var(--border);
}

th {
  background: var(--surface-2);
  color: var(--muted);
  font-family: "Montserrat", sans-serif;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  font-size: 10px;
}

/* Data cells — Montserrat Light */
td {
  font-family: "Montserrat", sans-serif;
  font-weight: 300;
}

/* Pitch type cell stays bold */
td:first-child {
  font-weight: 700;
  font-family: inherit;
}

.metric-picker {
  display: inline-block;
  margin-top: 14px;
  max-width: min(980px, 100%);
  padding-top: 0;
  position: relative;
}

.metric-picker summary {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  display: inline-flex;
  gap: 8px;
  min-height: 38px;
  padding: 0 14px;
  transition: background 0.12s, border-color 0.12s;
}

.metric-picker summary::-webkit-details-marker {
  display: none;
}

.metric-picker summary::after {
  color: var(--muted);
  content: "▾";
  font-size: 12px;
}

.metric-picker[open] summary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--main);
}

.metric-picker[open] summary::after {
  color: var(--main);
  transform: rotate(180deg);
}

.metric-picker .metric-grid {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.28);
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(3, minmax(190px, 1fr));
  left: 0;
  margin-top: 8px;
  max-height: min(58vh, 560px);
  overflow: auto;
  padding: 14px;
  position: absolute;
  top: 100%;
  width: min(860px, calc(100vw - 84px));
  z-index: 30;
}

.metric-group {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px;
}

.metric-group-title {
  color: var(--accent);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.metric-group-options {
  display: grid;
  gap: 7px;
}

.metric-group-options label {
  align-items: center;
  color: var(--text);
  display: flex;
  font-size: 12px;
  font-weight: 800;
  gap: 8px;
  line-height: 1.15;
  min-height: 24px;
}

.metric-group-options input {
  accent-color: var(--accent);
  flex: 0 0 auto;
}

.card-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(320px, 620px);
  margin-top: 18px;
}

.card-grid--full {
  grid-template-columns: 1fr;
  max-width: 820px;
}

.card-grid--full .player-card {
  width: 100%;
}

.card-grid--full .pct-row {
  grid-template-columns: 150px 1fr 70px;
}

.card-grid--full .pct-track {
  height: 24px;
}

.card-grid--full .pct-bubble {
  height: 28px;
  width: 28px;
  font-size: 11px;
  top: -4px;
}

.card-grid--full .pct-label,
.card-grid--full .pct-value {
  font-size: 13px;
}

.player-picker {
  align-items: stretch;
  flex-direction: column;
  min-width: min(460px, 72vw);
  position: relative;
}

.sidebar-player-picker {
  min-width: 0;
  width: 100%;
}

.sidebar-player-picker .player-combobox-button {
  min-height: 48px;
}

.sidebar-player-picker .player-combobox-name {
  font-size: 13px;
}

.sidebar-player-picker .player-combobox-menu {
  min-width: min(420px, calc(100vw - 40px));
}

.picker-label {
  color: var(--accent);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.native-player-select {
  height: 1px;
  opacity: 0;
  pointer-events: none;
  position: absolute;
  width: 1px;
}

.player-combobox {
  position: relative;
}

.player-combobox-button {
  align-items: center;
  background: var(--surface);
  border: 2px solid var(--border);
  color: var(--text);
  display: grid;
  gap: 2px;
  grid-template-columns: 1fr auto;
  min-height: 54px;
  padding: 9px 42px 9px 14px;
  position: relative;
  text-align: left;
  width: 100%;
}

.player-combobox-button::after {
  color: var(--accent);
  content: "⌄";
  font-size: 18px;
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-54%);
}

.player-combobox-button[aria-expanded="true"] {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 28%, transparent);
}

.player-combobox-name {
  font-size: 14px;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.player-combobox-meta {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  grid-column: 1 / -1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-combobox-menu {
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: 0 22px 58px rgba(23, 32, 42, 0.18);
  left: 0;
  padding: 10px;
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 20;
}

:root.dark .player-combobox-menu {
  box-shadow: 0 22px 58px rgba(0, 0, 0, 0.36);
}

.player-combobox-search {
  border: 1px solid var(--border);
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 8px;
  width: 100%;
}

.player-combobox-options {
  display: grid;
  gap: 4px;
  max-height: min(440px, 54vh);
  overflow-y: auto;
  padding-right: 4px;
}

.player-option {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text);
  display: grid;
  gap: 2px;
  min-height: 48px;
  padding: 8px 10px;
  text-align: left;
}

.player-option:hover,
.player-option.is-selected {
  background: var(--surface-2);
  border-color: var(--accent);
}

.player-option.is-selected {
  box-shadow: inset 4px 0 0 var(--accent);
}

.player-option-name {
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

.player-option-meta {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.player-option-empty {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  padding: 14px 10px;
}

.player-card {
  background: var(--surface);
  border: 3px solid var(--accent);
  box-shadow: var(--shadow);
}

.card-top {
  align-items: center;
  background: var(--main);
  color: var(--accent);
  display: grid;
  gap: 12px;
  grid-template-columns: 54px 1fr auto;
  padding: 14px;
}

:root.dark .card-top {
  background: var(--accent);
  color: var(--main);
}

.card-top img,
.logo-fallback {
  display: grid;
  height: 46px;
  object-fit: contain;
  place-items: center;
  width: 46px;
}

.card-top img {
  background: transparent;
}

.logo-fallback {
  background: rgba(255, 255, 255, 0.18);
}

.card-top h3 {
  font-size: 17px;
  font-weight: 900;
  line-height: 1.1;
  margin: 0;
  text-transform: uppercase;
}

.card-top p {
  color: currentColor;
  font-size: 11px;
  font-weight: 600;
}

.pitch-count {
  font-size: 18px;
  font-weight: 900;
  text-align: right;
}

.percentile-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 14px;
}

.card-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.card-section + .card-section {
  margin-top: 6px;
}

.card-section-header {
  font-family: "Montserrat", sans-serif;
  font-weight: 800;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  padding: 4px 0 4px;
  border-bottom: 2px solid var(--accent);
  margin-bottom: 6px;
}

.pct-row {
  display: grid;
  gap: 8px;
  grid-template-columns: 116px 1fr 54px;
}

.pct-label,
.pct-value {
  font-size: 12px;
  font-weight: 700;
}

.pct-value {
  text-align: right;
}

.pct-track {
  background: var(--surface-2);
  border: 1px solid var(--border);
  height: 20px;
  position: relative;
}

.pct-guide {
  border-left: 1px dashed rgba(23, 32, 42, 0.42);
  bottom: -3px;
  pointer-events: none;
  position: absolute;
  top: -3px;
  z-index: 2;
}

:root.dark .pct-guide {
  border-left-color: rgba(185, 200, 211, 0.55);
}

.pct-guide-25 {
  left: 25%;
}

.pct-guide-50 {
  left: 50%;
}

.pct-guide-75 {
  left: 75%;
}

.pct-fill {
  height: 100%;
  min-width: 4px;
  position: relative;
  z-index: 1;
}

.pct-bubble {
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.82);
  color: #fff;
  display: flex;
  font-size: 10px;
  font-weight: 900;
  height: 24px;
  justify-content: center;
  position: absolute;
  top: -3px;
  transform: translateX(-50%);
  width: 24px;
  z-index: 3;
}

@media (max-width: 860px) {
  .topbar,
  .hero-band,
  .cards-header,
  .stage-head {
    align-items: stretch;
    flex-direction: column;
  }

  .tool-layout {
    grid-template-columns: 1fr;
  }

  .control-rail {
    grid-template-columns: 1fr;
  }

  .chart {
    height: 460px;
  }

  .chart.is-square {
    min-height: 0;
    width: 100%;
  }

  .toolbar-select select,
  .toolbar-button,
  .toolbar-icon,
  .toolbar-segment button {
    font-size: 16px;
    min-height: 42px;
  }

  .card-grid {
    grid-template-columns: 1fr;
  }
}

/* ── Leaderboard ──────────────────────────────────────────── */
.lb-header h2 {
  margin: 0 0 4px;
  font-size: 20px;
  font-weight: 800;
}

.lb-header p {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

.lb-table-wrap {
  overflow-x: auto;
  padding: 0 16px 32px;
}

#lbTable {
  border-collapse: collapse;
  font-family: "Montserrat", sans-serif;
  font-size: 12px;
  width: 100%;
  min-width: 600px;
}

#lbTable thead th {
  font-weight: 800;
  font-size: 11px;
  text-align: center;
  padding: 8px 10px;
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  cursor: default;
}

#lbTable thead th.lb-sortable {
  cursor: pointer;
}

#lbTable thead th.lb-sorted {
  color: var(--accent);
}

#lbTable tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
}

#lbTable tbody tr:hover {
  background: var(--surface-2);
}

#lbTable tbody td {
  padding: 7px 10px;
  text-align: center;
  font-weight: 300;
  white-space: nowrap;
}

#catchingTable {
  border-collapse: collapse;
  font-family: "Montserrat", sans-serif;
  font-size: 12px;
  min-width: 760px;
  width: 100%;
}

#catchingTable thead th {
  border-bottom: 2px solid var(--border);
  color: var(--muted);
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 8px 10px;
  text-align: center;
  text-transform: uppercase;
  white-space: nowrap;
}

#catchingTable thead th.is-sorted {
  color: var(--accent);
}

#catchingTable tbody tr {
  border-bottom: 1px solid var(--border);
}

#catchingTable tbody tr:hover {
  background: var(--surface-2);
}

#catchingTable tbody tr {
  cursor: pointer;
}

#catchingTable tbody td {
  font-weight: 500;
  padding: 7px 10px;
  text-align: center;
  white-space: nowrap;
}

#catchingTable .lb-name {
  align-items: center;
  display: grid;
  gap: 2px 8px;
  grid-template-columns: 32px minmax(140px, 1fr);
  text-align: left;
}

#catchingTable .lb-name .lb-logo,
#catchingTable .lb-name .lb-logo-fallback {
  grid-row: span 2;
}

.catching-num {
  font-variant-numeric: tabular-nums;
  font-weight: 700 !important;
}

.catching-num.positive {
  color: #1a6b3c;
}

.catching-num.negative {
  color: #c0392b;
}

.catching-detail {
  padding: 0 16px 36px;
}

.catching-detail-header {
  align-items: center;
  background: var(--main);
  color: #fff;
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  justify-content: space-between;
  margin: 0 0 16px;
  padding: 16px 20px;
  position: relative;
}

.catching-detail-title {
  align-items: center;
  display: flex;
  gap: 12px;
}

.catching-detail-title h3 {
  font-size: 20px;
  margin: 0;
}

.catching-detail-title p {
  color: rgba(255, 255, 255, 0.72);
  margin: 2px 0 0;
}

.catching-stat-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}

.catching-stat-strip div {
  min-width: 86px;
  text-align: center;
}

.catching-stat-strip span {
  display: block;
  font-size: 10px;
  letter-spacing: 0.05em;
  opacity: 0.72;
  text-transform: uppercase;
}

.catching-stat-strip strong {
  display: block;
  font-size: 20px;
  margin-top: 2px;
}

.catching-stat-strip .positive {
  color: #86efac;
}

.catching-stat-strip .negative {
  color: #fca5a5;
}

.catching-zone-row {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(4, minmax(260px, 1fr));
  justify-content: center;
  margin-bottom: 14px;
}

.catching-pocket-card {
  margin-bottom: 14px;
}

@media (max-width: 900px) {
  .catching-zone-row {
    grid-template-columns: 1fr;
  }
}

/* Used by the separate "Catching" leaderboard tab's drill-down section
   (#catchingDetail), which still shares this grid across its Strikes
   Lost/Gained cards and the full-width 9-Pocket Zone card -- unlike the
   Catcher Viz page, it's a single small row so auto-fit collapsing works
   fine here. */
.catching-detail-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.catching-detail-grid .catching-pocket-card {
  grid-column: 1 / -1;
}

.catcher-viz-controls {
  align-items: end;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 0 16px 16px;
}

.catcher-viz-smoothing {
  min-width: 220px;
}

.stat-info-link {
  background: #fff;
  border: none;
  border-radius: 999px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  color: var(--main);
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
  padding: 8px 16px;
}

.stat-info-link:hover {
  background: #f2eafc;
}

.stat-info-panel {
  background: var(--surface);
  border: 2px solid var(--main);
  border-radius: 12px;
  box-shadow: var(--shadow);
  margin: 0 0 16px;
  padding: 18px 22px;
}

.stat-info-row {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
}

.stat-info-item {
  flex: 1 1 220px;
  min-width: 0;
}

.stat-info-item strong {
  color: var(--main);
  display: block;
  font-size: 14px;
  font-weight: 800;
  margin-bottom: 6px;
}

.stat-info-item span {
  color: var(--text);
  display: block;
  font-size: 13.5px;
  line-height: 1.55;
}

.catching-divider-right {
  position: relative;
}

.catching-divider-right::after {
  content: "";
  position: absolute;
  top: 10px;
  bottom: 10px;
  right: -7px;
  width: 2px;
  background: var(--line);
}

@media (max-width: 900px) {
  .catching-divider-right::after {
    content: none;
  }
}

.catching-zone-chart {
  aspect-ratio: 1 / 1;
  height: auto;
  min-height: 270px;
  width: 100%;
}

.catching-throw-chart,
.catching-block-chart {
  aspect-ratio: 1 / 1;
  min-height: 270px;
  width: 100%;
}

.catching-throw-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(3, minmax(240px, 300px));
  justify-content: center;
  margin-top: 12px;
}

.catching-block-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
}

.catching-block-card {
  flex: 0 1 336px;
}

.catching-throw-title {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  margin-bottom: 4px;
  text-align: center;
}

.catching-pocket-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 12px;
}

.catching-pocket-cell {
  border: 1px solid var(--border);
  display: grid;
  min-height: 82px;
  place-items: center;
}

.catching-pocket-cell strong {
  font-size: 22px;
  font-variant-numeric: tabular-nums;
}

.catching-pocket-cell span {
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 900px) {
  .catching-throw-grid {
    grid-template-columns: 1fr;
  }

  .catching-detail-grid {
    grid-template-columns: 1fr;
  }
}

.lb-rank {
  font-weight: 700 !important;
  color: var(--muted);
  width: 32px;
  text-align: center !important;
}

.lb-logo-cell {
  width: 36px;
  padding: 4px 6px !important;
  text-align: center !important;
}

.lb-logo {
  width: 28px;
  height: 28px;
  object-fit: contain;
  display: block;
  margin: auto;
}

.lb-logo-fallback {
  width: 28px;
  height: 28px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 800;
  margin: auto;
}

.lb-name {
  text-align: left !important;
  font-weight: 700 !important;
  min-width: 140px;
  white-space: nowrap;
}

.lb-team {
  display: block;
  font-size: 10px;
  font-weight: 400;
  color: var(--muted);
  margin-top: 1px;
}

.lb-header {
  align-items: center;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding: 20px 24px 8px;
}

.lb-pitch-filter {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 220px;
}

.lb-pitch-label {
  font-family: "Montserrat", sans-serif;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.lb-pitch-slider-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.lb-pitch-slider-row input[type="range"] {
  flex: 1;
  min-height: unset;
  height: 4px;
  padding: 0;
  border: none;
  background: var(--border);
  accent-color: var(--accent);
  cursor: pointer;
}

/* ── Hitter Leaderboard ─────────────────────────────────── */
.hitter-lb-shell {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  min-height: calc(100vh - 132px);
  background: var(--surface);
}

.hitter-lb-sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  height: calc(100vh - 132px);
  overflow-y: auto;
  padding: 16px 12px 28px;
  border-right: 1px solid var(--border);
  background: var(--surface-2);
}

.hitter-lb-main {
  min-width: 0;
}

.hitter-lb-topbar {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 24px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.hitter-lb-topbar h2 {
  margin: 0;
  font-size: 21px;
  font-weight: 800;
}

.hitter-lb-topbar p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.hitter-lb-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 24px;
  border-bottom: 1px solid var(--border);
}

.mode-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--border);
  background: var(--surface-2);
}

.mode-tab {
  border: none;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
  padding: 7px 12px;
  cursor: pointer;
}

.mode-tab.active {
  background: var(--main);
  color: #fff;
}

.hitter-lb-view-label,
.toggle-label,
.hitter-lb-slider-label,
.hitter-lb-slider-row > span {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.view-select {
  width: auto;
  min-width: 150px;
}

.hitter-lb-filter-block {
  margin-bottom: 14px;
}

.hitter-lb-slider-label,
.hitter-lb-slider-row > span {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.hitter-lb-slider,
.hitter-lb-slider-row input[type="range"] {
  width: 100%;
  min-height: unset;
  height: 4px;
  padding: 0;
  border: none;
  accent-color: var(--accent);
}

.hitter-lb-slider.is-off {
  opacity: 0.55;
}

.hitter-lb-filter-panel {
  border-top: 1px solid var(--border);
  padding: 8px 0;
}

.hitter-lb-filter-panel summary {
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  color: var(--text);
}

.hitter-lb-filter-panel-body {
  display: grid;
  gap: 10px;
  padding: 10px 0 2px;
}

.hitter-lb-table-wrap {
  overflow: auto;
  padding: 0 24px 32px;
}

#hitterLbTable {
  border-collapse: separate;
  border-spacing: 0;
  min-width: 1180px;
  width: 100%;
  font-family: "Montserrat", sans-serif;
  font-size: 12px;
}

#hitterLbTable th {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 8px 9px;
  border-bottom: 2px solid var(--border);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  white-space: nowrap;
}

#hitterLbTable .hitter-lb-group-row th {
  top: 0;
  z-index: 3;
  color: var(--text);
  text-align: center;
}

#hitterLbTable thead tr:nth-child(2) th {
  top: 32px;
}

#hitterLbTable tbody td {
  padding: 7px 9px;
  border-bottom: 1px solid var(--border);
  text-align: center;
  white-space: nowrap;
}

#hitterLbTable tbody tr:hover {
  background: var(--surface-2);
}

#hitterLbTable .lb-name {
  position: sticky;
  left: 72px;
  z-index: 1;
  background: var(--surface);
}

#hitterLbTable .lb-rank,
#hitterLbTable .lb-logo-cell {
  position: sticky;
  z-index: 1;
  background: var(--surface);
}

#hitterLbTable .lb-rank {
  left: 0;
}

#hitterLbTable .lb-logo-cell {
  left: 36px;
}

.hitter-lb-sort {
  cursor: pointer;
}

.hitter-lb-sort.is-sorted {
  color: var(--accent) !important;
}

.hitter-lb-num {
  font-weight: 700 !important;
}

.hitter-lb-team-code {
  color: var(--muted);
  font-weight: 700;
}

.hitter-lb-player-link {
  cursor: pointer;
  color: var(--accent);
}

.hitter-lb-player-link:hover {
  text-decoration: underline;
}

.hitter-lb-panel-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: rgba(0, 0, 0, 0.35);
}

.hitter-lb-panel-overlay.panel-open {
  display: block;
}

.hitter-lb-panel {
  position: fixed;
  inset: 0 0 0 22%;
  z-index: 9999;
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(.4, 0, .2, 1);
  background: var(--surface);
  border-left: 2px solid var(--border);
  box-shadow: -8px 0 40px rgba(0, 0, 0, .28);
}

.hitter-lb-panel.panel-open {
  transform: translateX(0);
}

.hitter-lb-panel-toolbar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 40px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.hitter-lb-panel-toolbar button {
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  padding: 2px 6px;
}

.hitter-lb-panel-body {
  max-width: 1390px;
  margin: 0 auto;
  padding: 10px 6px 28px;
  background: var(--surface-2);
}

.hlb-card-header {
  display: grid;
  grid-template-columns: 233px minmax(0, 1fr);
  align-items: start;
  column-gap: 16px;
  margin-bottom: 6px;
}

.hlb-card-logo-wrap {
  width: 233px;
  grid-row: span 2;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hlb-card-logo {
  width: 184px;
  height: 184px;
  object-fit: contain;
}

.hlb-card-logo-fallback {
  width: 170px;
  height: 170px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  background: var(--surface-2);
  font-weight: 900;
}

.hlb-card-header-main {
  flex: 1;
  min-width: 0;
}

.hlb-card-player {
  font-size: clamp(48px, 5.2vw, 62px);
  font-weight: 900;
  line-height: .9;
  color: var(--text);
  text-transform: uppercase;
  text-align: center;
}

.hlb-card-season {
  margin: 8px 0 16px;
  color: var(--text);
  font-size: 28px;
  line-height: 1.05;
  text-align: center;
}

.hlb-card-metric-groups {
  display: grid;
  grid-template-columns: 432px 324px 108px;
  gap: 12px;
  justify-content: start;
  width: 888px;
}

.hlb-card-metric-group {
  border: 1px solid rgba(72,122,161,.75);
  overflow: hidden;
}

.hlb-card-metric-group table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
}

.hlb-card-metric-group th {
  padding: 7px 4px 9px;
  border-bottom: 1px solid rgba(72,122,161,.45);
  color: var(--text);
  font-size: 21px;
  line-height: 1;
  white-space: nowrap;
  text-align: center;
}

.hlb-card-metric-group:first-child th:last-child,
.hlb-card-metric-group:nth-child(2) th:nth-child(2),
.hlb-card-metric-group:nth-child(2) th:nth-child(3) {
  font-size: 18px;
}

.hlb-card-value {
  position: relative;
  height: 80px;
  min-width: 108px;
  text-align: center;
  font-size: 23px;
  font-weight: 500;
  border-right: 1px solid rgba(128,128,128,.12);
  vertical-align: middle;
  line-height: 1.25;
  padding: 0 6px;
}

.hlb-card-value span {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hlb-card-value.has-delta span {
  inset: 0 0 22px;
}

.hlb-card-value small {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 18px;
  text-align: center;
  font-size: 19px;
  line-height: 1;
  color: inherit;
}

.hlb-card-section-title {
  display: none;
}

.hlb-card-section-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.hlb-card-table-wrap {
  overflow-x: visible;
  display: flex;
  justify-content: center;
  transform: translateX(34px);
}

.hlb-card-contact-table {
  width: auto;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
}

.hlb-card-contact-table tr {
  display: grid;
  grid-template-columns: 198px 55px 82px repeat(8, 111px);
  align-items: stretch;
}

.hlb-card-contact-table th {
  display: flex;
  align-items: end;
  justify-content: center;
  padding: 0 4px 9px;
  color: var(--text);
  font-size: 20px;
  font-weight: 500;
  line-height: 1.12;
  text-align: center;
}

.hlb-card-contact-table th:first-child {
  font-size: 23px;
}

.hlb-card-contact-table td {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 61px;
  padding: 0 6px;
  text-align: center;
  color: var(--text);
  font-size: 25px;
  line-height: 1.08;
}

.hlb-card-count-cell,
.hlb-card-pct-cell {
  font-size: 22px !important;
}

.hlb-card-ct-name {
  text-align: left !important;
  justify-content: flex-start !important;
  white-space: nowrap;
  font-weight: 500;
}

.hlb-card-ct-value {
  min-width: 0;
  height: 60px;
  font-weight: 500;
  flex-direction: column;
  gap: 2px;
}

.hlb-card-ct-value.has-delta span {
  font-size: 22px;
  line-height: 1;
}

.hlb-card-ct-value small {
  display: block;
  font-size: 18px;
  line-height: 1;
  color: inherit;
}

.hlb-card-total-row td {
  margin-top: 10px;
  font-weight: 500;
}

.hlb-card-total-row .hlb-card-ct-name,
.hlb-card-total-row td:nth-child(2),
.hlb-card-total-row td:nth-child(3) {
  font-weight: 800;
  font-size: 22px;
}

.hlb-card-legend {
  display: grid;
  grid-template-columns: 1fr 1fr 2fr 1fr 1fr 1fr;
  gap: 14px;
  margin: 14px 0 6px;
  transform: translateX(34px);
}

.hlb-card-legend div {
  display: flex;
  flex-direction: column;
  gap: 3px;
  color: var(--text);
  font-size: 22px;
  line-height: 1;
  text-align: center;
}

.hlb-card-legend i {
  height: 14px;
  border: 1px solid rgba(72,122,161,.25);
  background: linear-gradient(to right, rgb(164,117,151), rgb(239,231,218), rgb(168,145,58));
}

.hlb-card-footer {
  color: var(--muted);
  font-size: 18px;
  transform: translateX(34px);
}

@media (max-width: 900px) {
  .hitter-lb-shell {
    grid-template-columns: 1fr;
  }

  .hitter-lb-sidebar {
    position: relative;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .hitter-lb-panel {
    left: 0;
  }

  .hitter-lb-panel-body {
    padding: 24px 16px 44px;
  }

  .hlb-card-header,
  .hlb-card-metric-groups {
    display: flex;
    flex-direction: column;
    align-items: stretch;
  }

  .hlb-card-contact-table tr {
    grid-template-columns: 150px 58px 68px repeat(8, minmax(82px, 1fr));
  }
}

#lbPitchValue {
  font-family: "Montserrat", sans-serif;
  font-size: 14px;
  font-weight: 800;
  color: var(--accent);
  min-width: 36px;
  text-align: right;
}

#lbConfSelect {
  font-family: "Montserrat", sans-serif;
  font-size: 13px;
  font-weight: 600;
  min-height: 34px;
  padding: 4px 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  width: 100%;
}

/* ── Data Refresh Progress Overlay ─────────────────────────────────── */
.reload-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
}
.reload-overlay[hidden] { display: none !important; }

.reload-modal {
  background: var(--surface, #fff);
  border: 1px solid var(--border, #ddd);
  border-radius: 12px;
  padding: 32px 40px;
  width: min(420px, 90vw);
  box-shadow: 0 12px 48px rgba(0,0,0,0.35);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.reload-modal-title {
  font-family: "Montserrat", sans-serif;
  font-size: 16px;
  font-weight: 800;
  color: var(--text, #111);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.reload-step-label {
  font-family: "Montserrat", sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent, #9ac4fe);
  min-height: 18px;
}

.reload-progress-track {
  width: 100%;
  height: 8px;
  border-radius: 99px;
  background: var(--border, #e2e8f0);
  overflow: hidden;
}

.reload-progress-bar {
  height: 100%;
  border-radius: 99px;
  background: var(--accent, #9ac4fe);
  transition: width 0.35s ease;
}

.reload-meta {
  display: flex;
  justify-content: space-between;
  font-family: "Montserrat", sans-serif;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted, #888);
}

/* Make the reload button a little more prominent */
#reloadData {
  font-size: 12px;
  font-weight: 700;
  padding: 6px 12px;
  gap: 4px;
}

.reload-log {
  font-family: "Courier New", monospace;
  font-size: 10px;
  color: var(--muted, #888);
  background: var(--bg, #f5f5f5);
  border-radius: 6px;
  padding: 8px 10px;
  min-height: 20px;
  max-height: 48px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  word-break: break-all;
}

/* ── Team Filter + Date Range Sidebar Controls ───────────────────────── */
/* ── Team Filter + Date Range Sidebar Controls ───────────────────────── */
.team-filter-section,
.date-range-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.team-filter-input {
  width: 100%;
  padding: 7px 10px;
  font-family: "Montserrat", sans-serif;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  box-sizing: border-box;
}
.team-filter-input::placeholder { color: var(--muted); font-weight: 400; }
.team-filter-input:focus { outline: none; border-color: var(--accent); }

.date-range-row {
  display: flex;
  align-items: center;
  gap: 5px;
  width: 100%;
}

.date-range-input {
  flex: 1;
  min-width: 0;
  padding: 6px 6px;
  font-family: "Montserrat", sans-serif;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  box-sizing: border-box;
}
.date-range-input:focus { outline: none; border-color: var(--accent); }

.date-range-sep {
  font-size: 12px;
  color: var(--muted);
  flex-shrink: 0;
  line-height: 1;
}

.date-range-clear {
  flex-shrink: 0;
  background: none;
  border: 1px solid var(--border);
  cursor: pointer;
  color: var(--muted);
  font-size: 11px;
  padding: 5px 7px;
  border-radius: 6px;
  line-height: 1;
  font-family: "Montserrat", sans-serif;
}
.date-range-clear:hover { color: var(--text); background: var(--border); }

/* ── Umpire Report ───────────────────────────────────────────────────── */
.umpire-shell {
  background: var(--bg);
  color: var(--text);
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: calc(100vh - 190px);
  margin: calc(clamp(18px, 4vw, 44px) * -1);
}

.umpire-sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.umpire-brand,
.umpire-filter-block,
.umpire-calls {
  border-bottom: 1px solid var(--border);
  padding: 18px 20px;
}

.umpire-eyebrow,
.umpire-card-title,
.umpire-tabs button,
.umpire-lb-head h3 {
  letter-spacing: 2px;
  text-transform: uppercase;
}

.umpire-eyebrow {
  color: #f0b429;
  font-size: 9px;
  font-weight: 800;
  margin-bottom: 5px;
}

.umpire-title {
  color: var(--text);
  font-size: 22px;
  font-weight: 900;
  line-height: 1.05;
}

.umpire-filter-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.umpire-shell .sidebar-label {
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 2px;
}

.umpire-shell .team-filter-input,
.umpire-game-select,
.umpire-shell .date-range-input,
.umpire-shell .date-range-clear {
  background: var(--surface-2);
  border-color: var(--border);
  color: var(--text);
}

.umpire-game-select {
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  min-height: 36px;
  padding: 7px 8px;
  width: 100%;
}

.umpire-calls {
  flex: 1;
}

.umpire-side-card,
.umpire-top-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-top: 12px;
  padding: 12px;
}

.umpire-side-card h4,
.umpire-top-card h4 {
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 2px;
  margin: 0 0 8px;
  text-transform: uppercase;
}

.umpire-side-card p,
.umpire-top-card p {
  color: var(--muted);
  font-size: 12px;
  margin: 0;
}

.umpire-side-card strong,
.umpire-top-card strong {
  color: var(--text);
}

.umpire-metric {
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 22px;
  font-weight: 800;
  margin-top: 8px;
}

.umpire-pill {
  border-radius: 4px;
  display: inline-flex;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
  font-weight: 800;
  margin-top: 7px;
  padding: 3px 8px;
}

.umpire-pill.bad { background: rgba(248, 113, 113, .12); color: #f87171; }
.umpire-pill.good { background: rgba(74, 222, 128, .10); color: #4ade80; }

.umpire-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.umpire-topbar {
  align-items: center;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 20px;
  justify-content: space-between;
  padding: 16px 28px;
}

.umpire-topbar-left {
  min-width: 0;
}

.umpire-topbar h2 {
  color: var(--text);
  font-size: 24px;
  margin: 0 0 2px;
}

.umpire-topbar p,
.umpire-lb-head p {
  color: var(--muted);
}

.umpire-matchup-logos {
  align-items: center;
  display: flex;
  flex: 1;
  gap: 10px;
  justify-content: center;
}

.umpire-team-chip {
  align-items: center;
  display: flex;
  flex-direction: column;
  gap: 5px;
  text-align: center;
}

.umpire-team-chip span {
  color: var(--text);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.5px;
  max-width: 100px;
  line-height: 1.2;
}

.umpire-team-logo {
  height: 48px;
  object-fit: contain;
  width: 48px;
}

.umpire-at {
  color: var(--muted);
  font-size: 18px;
  font-weight: 900;
  padding: 0 4px;
}

.umpire-favor {
  background: rgba(240, 180, 41, .12);
  border: 1px solid rgba(240, 180, 41, .24);
  border-radius: 4px;
  color: #f0b429;
  display: inline-flex;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  font-weight: 800;
  margin-top: 8px;
  padding: 4px 10px;
}

.umpire-top-calls {
  display: flex;
  gap: 10px;
}

.umpire-top-card {
  margin-top: 0;
  min-width: 150px;
}

.umpire-tabs {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 8px;
  padding: 10px 24px 0;
}

.umpire-tabs button {
  background: transparent;
  border: 1px solid transparent;
  border-bottom: none;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.umpire-tabs button.active {
  background: var(--bg);
  border-color: var(--border);
  color: #f0b429;
}

.umpire-view {
  display: none;
  padding: 18px 24px 28px;
}

.umpire-view.active {
  display: block;
}

.umpire-legend {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  font-size: 12px;
  font-weight: 700;
  gap: 14px;
  margin-bottom: 14px;
  padding: 9px 14px;
  width: fit-content;
}

.umpire-legend span {
  align-items: center;
  display: inline-flex;
  gap: 6px;
}

.umpire-dot {
  border-radius: 999px;
  display: inline-block;
  height: 10px;
  width: 10px;
}

.umpire-report-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: 1.05fr 1fr 1.1fr;
}

.umpire-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  min-width: 0;
  padding: 14px;
}

.umpire-card-title {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  margin-bottom: 8px;
}

.umpire-zone-plot {
  height: 340px;
}

.umpire-heat-plot {
  height: 700px;
}

.umpire-accuracy-plot {
  padding: 8px 4px 4px;
}

/* ── Accuracy chart (matches hitter card PNG bar style) ── */
.acc-chart {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.acc-row {
  align-items: center;
  display: grid;
  gap: 0 12px;
  grid-template-columns: 110px 1fr 58px;
  padding: 10px 0;
}

.acc-raw {
  font-size: 11px;
  font-weight: 600;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  white-space: nowrap;
}

.acc-label {
  font-size: 12px;
  font-weight: 700;
  text-align: right;
  white-space: nowrap;
}

.acc-track {
  align-items: center;
  position: relative;
  height: 32px;
}

.acc-track-line {
  left: 0;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 100%;
}

.acc-bar {
  border-radius: 3px;
  height: 14px;
  left: 0;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
}

.acc-bubble {
  align-items: center;
  border: 2px solid rgba(255,255,255,0.8);
  border-radius: 999px;
  display: flex;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  font-weight: 800;
  height: 30px;
  justify-content: center;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 30px;
}

.umpire-lb-head {
  align-items: flex-end;
  background: var(--surface);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: 10px 10px 0 0;
  display: flex;
  justify-content: space-between;
  padding: 18px 20px;
}

.umpire-lb-head h3 {
  color: var(--text);
  font-size: 20px;
  margin: 0 0 4px;
}

#umpireLeaderboardTable {
  background: var(--surface);
  color: var(--text);
}

#umpireLeaderboardTable th {
  background: var(--surface-2);
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

#umpireLeaderboardTable th.lb-sortable {
  cursor: pointer;
  user-select: none;
}

#umpireLeaderboardTable th.lb-sortable:hover {
  background: var(--border);
  color: var(--text);
}

#umpireLeaderboardTable .lb-sort-arrow {
  margin-left: 4px;
  font-style: normal;
}

#umpireLeaderboardTable .lb-sort-none {
  opacity: 0.35;
}

#umpireLeaderboardTable td,
#umpireLeaderboardTable th {
  border-bottom: 1px solid var(--border);
  padding: 10px 12px;
  white-space: nowrap;
}

.adv-stage {
  min-width: 0;
}

.adv-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(520px, 1.15fr) minmax(380px, 0.85fr);
  margin-top: 14px;
}

.adv-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  min-width: 0;
  padding: 12px;
}

.adv-panel--wide {
  grid-column: 1 / -1;
}

.adv-panel-title {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  margin-bottom: 10px;
  text-transform: uppercase;
}

.adv-table-wrap {
  margin-top: 0;
  width: 100%;
}

.adv-table {
  background: #ffffff;
  color: #0f172a;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  width: max-content;
}

.adv-table th {
  background: #0f172a;
  color: #f8fafc;
  font-family: Montserrat, sans-serif;
  font-size: 10px;
  font-weight: 900;
  padding: 7px 8px;
}

.adv-table td {
  color: #0f172a;
  font-size: 11px;
  font-weight: 800;
  padding: 6px 8px;
}

.adv-table .adv-pitch-name {
  font-family: Montserrat, sans-serif;
  font-weight: 900;
}

.adv-table .adv-split,
.adv-table td:nth-child(12) {
  border-right: 3px solid #475569;
}

.adv-movement-chart {
  height: clamp(560px, calc(100vh - 330px), 820px);
  min-height: 560px;
}

.adv-export-actions {
  align-items: center;
  display: flex;
  gap: 10px;
}

.adv-export-toggle {
  align-items: center;
  color: var(--muted);
  display: flex;
  font-size: 12px;
  font-weight: 800;
  gap: 6px;
  white-space: nowrap;
}

.adv-export-toggle input {
  accent-color: var(--accent);
}

.adv-standalone-plot {
  background: var(--surface);
  border: 1px solid var(--border);
  height: 100%;
  min-height: 560px;
  width: 100%;
}

.adv-movement-chart .radial-image-wrap,
.adv-heatmaps .radial-image-wrap {
  border: 1px solid var(--border);
}

.adv-count-matrix {
  min-height: 360px;
  position: relative;
}

.adv-matrix-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: 32px repeat(3, minmax(82px, 1fr));
}

.adv-matrix-label,
.adv-matrix-corner {
  align-items: center;
  color: var(--muted);
  display: flex;
  font-size: 12px;
  font-weight: 900;
  justify-content: center;
}

.adv-matrix-cell {
  align-items: center;
  border: 2px solid #ffffff;
  color: #ffffff;
  display: grid;
  min-height: 74px;
  padding: 8px 4px;
  text-align: center;
}

.adv-matrix-cell strong {
  font-size: 12px;
  font-weight: 900;
}

.adv-matrix-cell span,
.adv-matrix-cell small {
  color: rgba(255,255,255,0.88);
  font-weight: 800;
}

.adv-matrix-axis {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.adv-matrix-top {
  margin: 0 0 4px 40px;
  text-align: center;
}

.adv-matrix-left {
  bottom: 120px;
  left: -14px;
  position: absolute;
  transform: rotate(-90deg);
  transform-origin: left center;
}

.adv-heatmaps {
  min-height: 360px;
}

.adv-heatmap-wrap {
  min-height: 360px;
}

.adv-heatmap-wrap img {
  height: auto;
  width: 100%;
}

@media (max-width: 1100px) {
  .adv-grid {
    grid-template-columns: 1fr;
  }
}
/* Retagging now lives exclusively in the pitcher Data Processing app. */
#retagToggle, #autoRetagButton, #retagPanel { display: none !important; }
.catching-block-chart .usage-empty{display:grid;place-items:center;min-height:220px;text-align:center;padding:20px}

.catcher-plan-section{padding:14px;margin-top:14px;background:#fff;border:1px solid var(--line);border-radius:8px}.catcher-plan-section .toolbar{display:flex;align-items:center;justify-content:space-between;gap:14px}.catcher-plan-section .toolbar h2{margin:0;font-size:22px}.catcher-plan-section .toolbar .eyebrow{margin:0 0 4px}.catcher-plan-header{border-top:0;padding-top:0}.catcher-plan-grid{display:grid;grid-template-columns:minmax(0,1.25fr) minmax(320px,.75fr);gap:14px}.catcher-plan-section .plan-card{padding:14px;background:#fff;border:1px solid var(--line);border-radius:8px}.catcher-plan-section .plan-card h3{margin:0 0 12px;font-size:18px}.catcher-plan-section .fill-table{width:100%;border-collapse:collapse}.catcher-plan-section .fill-table th,.catcher-plan-section .fill-table td{padding:9px 10px;border:1px solid var(--line);text-align:left;vertical-align:top;font-size:12px}.catcher-plan-section .fill-table th{background:var(--purple2,#35116f);color:#fff;font-size:10px;font-weight:900;letter-spacing:.05em;text-transform:uppercase}.catcher-plan-section .fill-table td.fill-label{font-weight:900}.catcher-plan-section .fill-table td.rule-cell{font-weight:600;color:var(--muted)}.catcher-plan-section .fill-table input,.catcher-plan-section textarea{width:100%;box-sizing:border-box;border:1px solid var(--line);border-radius:6px;background:#f5f5f7;color:inherit;font:inherit;font-weight:700;padding:8px}.catcher-plan-section .fill-table input[type=number]{min-width:78px;max-width:86px;text-align:center}.catcher-plan-priorities{display:grid;align-content:start;gap:12px}.catcher-plan-field{display:grid;gap:5px}.catcher-plan-field span{font-size:10px;font-weight:900;letter-spacing:.05em;text-transform:uppercase;color:var(--muted)}.catcher-plan-section .catcher-plan-weekly{display:block}.catcher-plan-section + .catcher-plan-section{margin-top:14px}.catcher-plan-section .weekly-plan-table input{min-width:130px}.catcher-plan-save-status{color:#237a43;font-size:12px;font-weight:800}@media(max-width:900px){.catcher-plan-grid{grid-template-columns:1fr}.catcher-plan-section .toolbar{align-items:flex-start}.catcher-plan-section .table-wrap{overflow-x:auto}}
.catcher-plan-summary{display:flex;align-items:center;gap:16px}.catcher-development-score{display:grid;min-width:118px;padding:8px 12px;border-left:4px solid var(--gold,#d3a51d);background:#f5f2fa}.catcher-development-score span{color:var(--muted);font-size:9px;font-weight:900;letter-spacing:.05em;text-transform:uppercase}.catcher-development-score strong{color:#35116f;font-size:28px;line-height:1}.catcher-plan-section .fill-table td.catcher-plan-score-cell,.catcher-plan-section .fill-table td.catcher-plan-read-cell{font-weight:900;transition:background-color .15s ease,color .15s ease}.catcher-plan-section .fill-table td.catcher-plan-score-cell{padding:6px 8px}.catcher-plan-section .fill-table td.catcher-plan-score-cell input{border-color:rgba(53,17,111,.18);background:rgba(255,255,255,.72);color:#20163d}@media(max-width:640px){.catcher-plan-header{display:grid!important}.catcher-plan-summary{width:100%;justify-content:space-between}}

.catcher-plan-section{display:grid;gap:14px;margin-top:16px}.catcher-plan-header{align-items:end;border-top:1px solid var(--line);padding-top:16px}.catcher-plan-header h3{margin:0;font-size:17px}.catcher-plan-header p{margin:4px 0 0;color:var(--muted)}.catcher-plan-save-status{color:#237a43;font-size:12px;font-weight:800}.catcher-plan-grid{display:grid;grid-template-columns:minmax(0,1.25fr) minmax(300px,.75fr);gap:14px}.catcher-plan-section .score-card{padding:14px}.catcher-plan-section .data-table{width:100%;border-collapse:collapse}.catcher-plan-section .data-table th,.catcher-plan-section .data-table td{padding:8px 9px;border-bottom:1px solid var(--line);text-align:left;vertical-align:top;font-size:12px}.catcher-plan-section .data-table th{color:var(--muted);font-size:10px;letter-spacing:.05em;text-transform:uppercase}.catcher-plan-section .data-table input,.catcher-plan-section textarea{width:100%;box-sizing:border-box;border:1px solid var(--line);border-radius:5px;background:#fff;color:inherit;font:inherit;padding:7px 8px}.catcher-plan-section .data-table input[type=number]{min-width:72px}.catcher-plan-priorities{display:grid;align-content:start;gap:12px}.catcher-plan-field{display:grid;gap:5px}.catcher-plan-field span{color:var(--muted);font-size:10px;font-weight:800;letter-spacing:.04em;text-transform:uppercase}.catcher-plan-weekly h3{margin:5px 0 12px;font-size:16px}.catcher-plan-weekly .table-wrap{overflow-x:auto}.catcher-plan-weekly input{min-width:130px}@media(max-width:900px){.catcher-plan-grid{grid-template-columns:1fr}.catcher-plan-header{align-items:start}}
