:root {
  --bg: #000;
  --text: #fff;
  --muted: #c8c8c8;
  --axis: #666;
  --card: #fff;
  --border: #222;
  --shadow: 0 2px 10px rgba(0,0,0,.6);
}

* { box-sizing: border-box; }
body {
  margin: 24px;
  font: 14px/1.4 system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
}

.container { 
  max-width: 1080px; 
  margin: 0 auto 0 auto; 
}

body,
.container {
  padding-bottom: max(85px, env(safe-area-inset-bottom));
}

h2 { 
  margin: 0 0 10px; 
  font-weight: 700; 
  color: var(--text); 
}

.controls {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  margin: 8px 0 14px;
}
.controls label { display: inline-flex; align-items: center; gap: 6px; }
.checkbox { gap: 6px; }

.controls label, .controls select, .controls button, .checkbox {
  color: var(--text);
}
.controls select, .controls button {
  background: #111; color: var(--text);
  border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px;
}
.controls button:hover { background: #171717; }

.chart-wrap {
  background: #141414;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  box-shadow: var(--shadow);
}

svg#chart { width: 100%; height: 400px; display: block; background: #2e2c35; margin-bottom: 1px; border: 1px solid #f1f1f1; border-radius: 10px; }

.axis path, .axis line {
  stroke: var(--axis);
  shape-rendering: crispEdges;
}
.tick text { fill: var(--muted); }

.line { fill: none; stroke-width: 2px; opacity: 0.95; stroke-linecap: round; stroke-linejoin: round; }
.line.hidden, circle.hidden { opacity: 0; }

.team-dot { stroke: #000; stroke-width: 0.5px; }
.team-dot { filter: drop-shadow(0 0 1px rgba(255,255,255,.2)); }

.legend {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin: 10px 6px 6px;
}
.legend-item {
  display: flex; align-items: center; gap: 6px;
  background: #01015f;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 4px 8px;
  cursor: pointer;
  user-select: none;
  box-shadow: 0 1px 3px rgba(0,0,0,.5);
}
.legend-swatch {
  width: 12px; height: 12px; border-radius: 3px; border: 1px solid #ffffff33;
}
.legend-item.off { opacity: .35; text-decoration: line-through; }
.legend-item:hover {
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.473) inset,
    0 0 12px rgba(231, 231, 231, 0.18);
}

#legend .legend-item.is-focused {
  outline: 0;
  filter: none;
}

#legend .legend-logo {
  width: 30px;
  height: 30px;
  object-fit: contain;
  filter: drop-shadow(0 0 2px rgba(0,0,0,0.4));
  flex-shrink: 0;
  pointer-events: none;
}

#paceLayout {
  display: grid;
  grid-template-columns: 1fr 320px;
  align-items: start;
  margin-top: 8px;
}

#paceRight .legend {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  box-shadow: inset 0 -8px 10px -10px rgba(0,0,0,.3);
  scrollbar-width: thin;                         
  scrollbar-color: rgba(255,255,255,.35) #1b1b1b;
  scrollbar-gutter: stable both-edges;
}

#paceRight .legend .legend-item {
  display: grid;
  grid-template-columns: 18px 14px 1fr;
  align-items: center;
  gap: 8px;
}
#paceRight .legend .legend-swatch {
  width: 14px; height: 14px; border-radius: 3px;
  border: 1px solid rgba(0,0,0,.2);
}
#paceRight .legend .legend-pill {
  text-align: left;
  color: #fff;
  width: 60%;
  border: 1px solid #01015f;
  background: #01015f;
  border-radius: 999px;
  padding: 6px 10px;
  cursor: pointer;
}
#paceRight .legend .legend-item.off {
  text-decoration: line-through;
  filter: none;
}
#paceRight .legend .legend-item.is-focused .legend-pill {
  font-weight: 600;
}

#paceRight .legend .legend-item.is-dimmed {
  opacity: 0.50;
  filter: saturate(0.6);
}

#paceRight .legend.has-focus .legend-item:not(.is-focused) .legend-pill {
  opacity: 0.28;
  filter: saturate(0.6);
}

#paceLeft .chart-wrap,
#paceLeft svg {
  width: 100%;
}

#usMap image.team-logo {
  image-rendering: auto;
}

.tooltip {
  position: absolute;
  pointer-events: none;
  background: #555555;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,.6);
  font-size: 12px;
  opacity: 0;
  transform: translate(12px, 12px);
}

.line.dim, .team-dot.dim { opacity: 0.15; }
.line.highlight { stroke-width: 3.5px; filter: drop-shadow(0 0 1px rgba(255,255,255,.35)); }

.series-line.hidden { display: none; }

.comparison-container {
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    gap: 2rem;
    margin: 2rem 0;
    flex-wrap: wrap;
}

.player-card {
    flex: 1;
    min-width: 300px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    padding: 2rem;
    color: white;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    transition: transform 0.3s ease;
}

.player-card:hover {
    transform: translateY(-5px);
}

.year-2000 {
    background: linear-gradient(135deg, #ddd45c 0%, #8d8f10 100%);
}

.year-2025 {
    background: linear-gradient(135deg, #4b6af3 0%, #0d0c7a 100%);
}

.player-info .card-top .season {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.2;
  color: #ffffff;
}
.player-info .card-top .note {
  font-size: 12px;
  opacity: .85;
}

.vs-divider {
    display: flex;
    align-items: center;
    font-size: 2.5rem;
    font-weight: bold;
    color: #333;
    padding: 0 1rem;
}

.player-stats h4 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

.stat-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.stat-item {
    text-align: center;
    background: rgba(255,255,255,0.1);
    padding: 1rem;
    border-radius: 8px;
}

.stat-label {
    display: block;
    font-size: 0.9rem;
    opacity: 0.9;
    margin-bottom: 0.5rem;
}

.stat-value {
    display: block;
    font-size: 2rem;
    font-weight: bold;
}

.chart-section {
    margin: 3rem 0;
    text-align: center;
}

.chart-section h3 {
    margin-bottom: 2rem;
}

#comparisonChart {
    display: block;
    margin: 0 auto;
}

.placeholder, .error {
    text-align: center;
    padding: 2rem;
    opacity: 0.7;
}

.error {
    color: #ffebee;
}

.navigation {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.navigation a {
  padding: 0.5rem 1rem;
  color: var(--muted);
  text-decoration: none;
  border-radius: 6px;
  transition: all 0.2s;
}

.navigation a:hover {
  background: #171717;
  color: var(--text);
}

.navigation a.active {
  background: #222;
  color: var(--text);
  font-weight: 600;
}

.tab-panel { 
  display: none; 
}

.tab-panel.active { 
  display: block; 
}

.tabs { 
  position: fixed;
  left: 50%;
  bottom: max(16px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 1000;
  display: flex;
  gap: 10px;
  background: rgba(17,17,17,0.9);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 8px;
  backdrop-filter: blur(6px);
}

.tab { 
  padding: 10px 14px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, transform .05s ease-in-out;
}

.tab:hover {
  background: #1a1a1a;
}

.tab.active { 
  background: #222;
  border-color: #2b2b2b;
  font-weight: 600;
}

.side-btn {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #303030;
  color: #fff;
  font-size: 28px;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: var(--shadow);
  z-index: 1000;
  opacity: 0.85;
  transition: transform .15s ease, opacity .15s ease, background .15s ease;
}
.side-btn:hover { opacity: 1; background: #171717; transform: translateY(-50%) scale(1.05); }
.side-btn:active { transform: translateY(-50%) scale(0.98); }

.side-btn--left  { left: 16px; }
.side-btn--right { right: 16px; }

.side-btn.hidden { display: none; }
.side-btn[disabled] { opacity: .3; cursor: not-allowed; }

.anim-controls {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin: 4px 0 6px;
}

.anim-controls button {
  background: #616161;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 12px;
  cursor: pointer;
}

.anim-controls button:hover {
  background: #494949;
}

.video-wrap {
  height: 100svh; 
  height: 81dvh; 
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transform: translateY(10%);
}

#intro-video {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain; 
}

.shot-chart-wrap {
  background: #000000;
  padding: 0;
}

.shotchart-outer{
  background: radial-gradient(1200px 700px at 50% 65%, #0a0f1c 0%, #05070d 60%, #020306 100%);
  padding: 32px 0 48px;
  overflow: visible;
}

.shotchart-tilt{
  width: 100%;
  transform-style: preserve-3d;
  transform: perspective(900px) rotateX(55deg) translateY(-60px) scale(1.02);
  transform-origin: 50% 70%;
}


.overlay-2d {
  position: absolute;
  inset: 0;           
  pointer-events: none; 
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.legend-2d {
  pointer-events: auto;
  justify-self: end;
  margin: 8px 10px 0 0;
  background: rgba(20,20,20,.8);
  border: 1px solid #2a2a2a;
  border-radius: 10px;
  padding: 8px 10px;
  color: #e6e6e6;
  font-size: 12px;
}

.footer-2d {
  pointer-events: auto;
  justify-self: end;
  margin: 0 10px 10px 0;
  color: #aaa;
  font-size: 11px;
  font-style: italic;
  background: rgba(0,0,0,.4);
  border-radius: 8px;
  padding: 4px 8px;
}
#shotChart .court-line{
  stroke: #e6e6e6; stroke-width: 2; fill: none; opacity: .9;
  filter: url(#line-glow);
}

#shotChart .shot{
  filter: url(#dot-glow);
}

.shotchart-outer:after{
  content:""; position:absolute; inset:0; pointer-events:none;
  background: radial-gradient(80% 50% at 50% 30%, transparent 60%, rgba(0,0,0,.5) 100%);
}

.tilt-controls {
  display: grid;
  grid-template-columns: 140px auto 1fr;
  gap: 10px 14px;
  align-items: center;
  padding: 12px 14px;
  background: #111;
  border: 1px solid #222;
  border-radius: 12px;
}

#tiltResetBtn {
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid #3a3a3a;
  background: linear-gradient(180deg, #222 0%, #1a1a1a 100%);
  color: #f2f2f2;
  font-weight: 600;
  letter-spacing: .2px;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease, border-color .12s ease;
  cursor: pointer;
  user-select: none;
}
#tiltResetBtn:hover {   
  background: linear-gradient(180deg, #262626 0%, #1f1f1f 100%);
  border-color: #4a4a4a;
  box-shadow: 0 6px 16px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.05);
  transform: translateY(-1px);
}
#tiltResetBtn:active {
  transform: translateY(0);
  box-shadow: 0 3px 10px rgba(0,0,0,.25), inset 0 0 0 rgba(255,255,255,0);
}
#tiltResetBtn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(79, 140, 255, .45);
}

.tilt-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  background: linear-gradient(180deg, #2a2a2a, #202020);
  border: 1px solid #3a3a3a;
  border-radius: 999px;
  outline: none;
  transition: box-shadow .12s ease, border-color .12s ease, background .12s ease;
}
.tilt-slider:hover {
  border-color: #4a4a4a;
  box-shadow: 0 0 0 3px rgba(255,255,255,.03) inset;
}
.tilt-slider:focus-visible {
  box-shadow: 0 0 0 3px rgba(79, 140, 255, .35);
}

#lbTooltip {
  position: absolute;
  pointer-events: none;
  background: #111; 
  color: #fff;
  border: 1px solid #333;
  border-radius: 8px;
  padding: 8px 10px;
  box-shadow: 0 6px 20px rgba(0,0,0,.70);
  font-size: 12px;
  line-height: 1.35;
  opacity: 0;
  transform: translate(12px, 12px);
  backdrop-filter: blur(4px);
}
#tooltip .badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 999px;
  margin-left: 6px;
  background: #222; 
  border: 1px solid #444; 
}

.intro-wrap {
  height: 100svh;           
  height: 81dvh;          
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;          
  transform: translateY(10%);
}

.intro-img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;      
}

#threePtChart { width: 100%; height: 700px; display: block; }

#tab-defense .controls {
  margin-top: 0 !important;
  margin-bottom: 10px !important;
}

#defense-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(2, minmax(500px, 1fr));
}

#defense-grid > div:last-child {
  grid-column: 1 / -1; 
  justify-self: center; 
  width: clamp(280px, 50%, 640px);
}

#defense-grid > div:not(:last-child) {
  border: 1px solid #3a3a3a !important;
  border-radius: 12px !important;
}

#defense-grid > div:hover {
  border-color: #6b6b6b !important;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.08) inset,
              0 6px 18px rgba(0,0,0,0.55);
  transition: border-color .15s ease, box-shadow .15s ease;
}