* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  user-select: none;
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
}

body, html {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: #0d1117;
  color: #fff;
}

#canvas-container {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
}

/* Crosshair & Dribble Sweetspot Meter */
#reticle-container {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  pointer-events: none;
  z-index: 10;
}

#crosshair {
  position: absolute;
  top: -6px;
  left: -6px;
  width: 12px;
  height: 12px;
  box-sizing: border-box;
  border: 2px solid rgba(255, 255, 255, 0.7);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  transform-origin: center center;
  transition: transform 0.08s ease, border-color 0.08s ease, background 0.08s ease, box-shadow 0.08s ease;
}

#crosshair.sweetspot {
  background: #00ff88 !important;
  border-color: #ffffff !important;
  box-shadow: 0 0 16px #00ff88, 0 0 32px #00ff88 !important;
  transform: scale(1.6);
}

#crosshair.targeting-player {
  border-color: #00ff88 !important;
  box-shadow: 0 0 14px #00ff88 !important;
  transform: scale(1.4);
}

#crosshair.aim-locked {
  border-color: #00ff88 !important;
  background: #00ff88 !important;
  box-shadow: 0 0 18px #00ff88, 0 0 36px #00ff88 !important;
  transform: scale(1.6);
}

#shot-aim-indicator {
  position: absolute;
  bottom: 34px;
  left: 0;
  transform: translateX(-50%);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  white-space: nowrap;
  padding: 4px 12px;
  border-radius: 6px;
  text-transform: uppercase;
  display: none;
  pointer-events: none;
  transition: all 0.1s ease;
}

#shot-aim-indicator.aim-locked {
  display: block;
  color: #00ff88;
  background: rgba(0, 36, 18, 0.88);
  border: 1px solid #00ff88;
  box-shadow: 0 0 16px rgba(0, 255, 136, 0.65);
  text-shadow: 0 0 8px #00ff88;
  animation: pulseAimLock 0.4s infinite alternate;
}

#shot-aim-indicator.aim-adjust {
  display: block;
  color: #ffcc00;
  background: rgba(38, 28, 0, 0.88);
  border: 1px solid #ffcc00;
  box-shadow: 0 0 12px rgba(255, 204, 0, 0.45);
  text-shadow: 0 0 6px rgba(255, 204, 0, 0.6);
}

@keyframes pulseAimLock {
  from { transform: translateX(-50%) scale(1.0); }
  to { transform: translateX(-50%) scale(1.06); }
}

#timing-ring {
  position: absolute;
  top: -25px;
  left: -25px;
  width: 50px;
  height: 50px;
  box-sizing: border-box;
  border: 2px dashed rgba(255, 140, 0, 0.6);
  border-radius: 50%;
  transform-origin: center center;
  transform: scale(1);
  transition: transform 0.04s linear, border-color 0.08s, box-shadow 0.08s;
}

#timing-ring.sweetspot {
  border-color: #00ff88 !important;
  border-style: solid !important;
  box-shadow: 0 0 16px rgba(0, 255, 136, 0.8), inset 0 0 12px rgba(0, 255, 136, 0.4) !important;
}

#timing-ring.in-green {
  border-color: #00ff88 !important;
  border-style: solid !important;
  box-shadow: 0 0 20px rgba(0, 255, 136, 0.95), inset 0 0 14px rgba(0, 255, 136, 0.5) !important;
}

#reticle-info-stack {
  position: absolute;
  top: 28px;
  left: 0;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  pointer-events: none;
  white-space: nowrap;
}

#timing-feedback {
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

#timing-feedback.show {
  opacity: 1;
  transform: translateY(0);
}

.feedback-perfect { color: #00ff88; text-shadow: 0 0 12px rgba(0, 255, 136, 0.8) !important; }
.feedback-good { color: #ffbb00; text-shadow: 0 0 10px rgba(255, 187, 0, 0.7) !important; }
.feedback-early { color: #ff9100; text-shadow: 0 0 10px rgba(255, 145, 0, 0.7) !important; }
.feedback-late { color: #ff3344; text-shadow: 0 0 10px rgba(255, 51, 68, 0.7) !important; }
.feedback-travel { color: #ff1100; font-size: 18px; text-shadow: 0 0 16px rgba(255, 17, 0, 0.9) !important; }

#pass-indicator {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1px;
  color: #33bbff;
  background: rgba(0, 30, 60, 0.75);
  border: 1px solid #33bbff;
  border-radius: 6px;
  padding: 3px 10px;
  text-transform: uppercase;
  display: none;
  text-shadow: 0 0 8px rgba(51, 187, 255, 0.8);
  box-shadow: 0 0 12px rgba(51, 187, 255, 0.35);
}

#shot-context-badge {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.8px;
  color: #ffaa00;
  background: rgba(20, 24, 34, 0.85);
  border: 1px solid rgba(255, 170, 0, 0.6);
  border-radius: 6px;
  padding: 3px 10px;
  text-transform: uppercase;
  display: none;
  text-shadow: 0 0 8px rgba(255, 170, 0, 0.6);
  box-shadow: 0 0 12px rgba(255, 170, 0, 0.25);
  transition: all 0.15s ease;
}

#shot-context-badge.pivot {
  color: #ff3344;
  border-color: #ff3344;
  background: rgba(50, 10, 15, 0.85);
  text-shadow: 0 0 10px rgba(255, 51, 68, 0.8);
  box-shadow: 0 0 14px rgba(255, 51, 68, 0.4);
}

#shot-context-badge.stepback {
  color: #ff00ea;
  border-color: #ff00ea;
  background: rgba(45, 10, 45, 0.85);
  text-shadow: 0 0 10px rgba(255, 0, 234, 0.8);
  box-shadow: 0 0 14px rgba(255, 0, 234, 0.4);
}

#shot-context-badge.eurostep {
  color: #00e5ff;
  border-color: #00e5ff;
  background: rgba(10, 40, 50, 0.85);
  text-shadow: 0 0 10px rgba(0, 229, 255, 0.8);
  box-shadow: 0 0 14px rgba(0, 229, 255, 0.4);
}

#shot-context-badge.layup {
  color: #00ff88;
  border-color: #00ff88;
  background: rgba(10, 45, 25, 0.85);
  text-shadow: 0 0 10px rgba(0, 255, 136, 0.8);
  box-shadow: 0 0 14px rgba(0, 255, 136, 0.4);
}

#shot-context-badge.floater {
  color: #ffbb00;
  border-color: #ffbb00;
  background: rgba(45, 30, 10, 0.85);
  text-shadow: 0 0 10px rgba(255, 187, 0, 0.8);
  box-shadow: 0 0 14px rgba(255, 187, 0, 0.4);
}

/* In-Game HUD Overlays */
#hud {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 24px 32px;
  box-sizing: border-box;
  z-index: 10;
}

/* Top Bar: Scoreboard & Stats */
.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  width: 100%;
}

.hud-panel {
  background: rgba(15, 20, 30, 0.75);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 14px 22px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.score-panel {
  display: flex;
  gap: 28px;
  align-items: center;
}

/* Multiplayer Match Scoreboard & Team Status */
.multiplayer-status-panel {
  display: flex;
  align-items: center;
  gap: 16px;
}

.match-scores {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(0, 0, 0, 0.4);
  padding: 6px 14px;
  border-radius: 8px;
}

.team-score {
  font-size: 20px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 6px;
}

.team-score.blue { color: #3399ff; }
.team-score.red { color: #ff4444; }

/* Dynamic Target Hoop Direction Tracker */
.hoop-tracker-hud {
  display: flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, rgba(0, 50, 130, 0.85), rgba(10, 20, 45, 0.9));
  border: 1px solid rgba(0, 180, 255, 0.6);
  border-radius: 20px;
  padding: 5px 14px;
  box-shadow: 0 4px 16px rgba(0, 140, 255, 0.3);
  pointer-events: none;
  font-family: inherit;
  transition: all 0.2s ease;
}

.hoop-tracker-arrow {
  font-size: 16px;
  line-height: 1;
  filter: drop-shadow(0 0 6px #00e5ff);
}

.hoop-tracker-text {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.8px;
  color: #cceeff;
  text-transform: uppercase;
  text-shadow: 0 0 8px rgba(0, 229, 255, 0.6);
  white-space: nowrap;
}

.hoop-tracker-hud.aligned {
  border-color: #00ff88;
  box-shadow: 0 4px 20px rgba(0, 255, 136, 0.45);
}

.hoop-tracker-hud.aligned .hoop-tracker-text {
  color: #aaffdd;
}

.team-badge-header {
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  border-radius: 6px;
  text-transform: uppercase;
}
.team-badge-header.blue {
  background: rgba(0, 102, 238, 0.25);
  border: 1px solid #0066ee;
  color: #66b2ff;
}
.team-badge-header.red {
  background: rgba(238, 34, 34, 0.25);
  border: 1px solid #ee2222;
  color: #ff7777;
}

.net-status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #ff4444;
  box-shadow: 0 0 8px #ff4444;
  display: inline-block;
  margin-right: 6px;
}

.net-status-dot.online {
  background: #00ff88;
  box-shadow: 0 0 8px #00ff88;
}


.score-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.score-label {
  font-size: 11px;
  font-weight: 700;
  color: #8da4be;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 2px;
}

.score-value {
  font-size: 26px;
  font-weight: 800;
  color: #fff;
  font-variant-numeric: tabular-nums;
}

.score-value.highlight {
  color: #ff9d00;
  text-shadow: 0 0 12px rgba(255, 157, 0, 0.6);
}

/* Shot Meter (Appears on shoot windup) */
#shot-meter-container {
  display: none;
  flex-direction: column;
  align-items: center;
  position: absolute;
  top: 42%;
  left: 50%;
  transform: translate(-50%, -100%);
}

#shot-meter-bar {
  width: 140px;
  height: 14px;
  background: rgba(0, 0, 0, 0.7);
  border: 2px solid #fff;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
}

#shot-meter-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #ff9100, #ffee00, #00ff88);
  transition: none;
}

#shot-meter-target {
  position: absolute;
  top: 0;
  left: 80%;
  width: 18%;
  height: 100%;
  background: rgba(0, 255, 136, 0.45);
  border-left: 2px solid #00ff88;
  border-right: 2px solid #00ff88;
  transition: left 0.1s ease, width 0.1s ease;
}

.shot-meter-text {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1.5px;
  margin-top: 6px;
  text-transform: uppercase;
  color: #ffee00;
  text-shadow: 0 0 8px rgba(0, 0, 0, 0.8);
  transition: all 0.1s ease;
}

#shot-meter-container.in-green #shot-meter-bar {
  border-color: #00ff88;
  box-shadow: 0 0 20px rgba(0, 255, 136, 0.8), 0 0 40px rgba(0, 255, 136, 0.4);
}

#shot-meter-container.in-green #shot-meter-target {
  background: rgba(0, 255, 136, 0.75);
  box-shadow: 0 0 16px #00ff88;
}

#shot-meter-container.in-green .shot-meter-text {
  color: #00ff88;
  text-shadow: 0 0 12px rgba(0, 255, 136, 0.95);
  animation: pulseShotMeterText 0.3s infinite alternate;
}

@keyframes pulseShotMeterText {
  from { transform: scale(1.0); }
  to { transform: scale(1.06); }
}

/* Bottom HUD: Dribble Status, Hand, Steps, Momentum */
.bottom-bar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  width: 100%;
}

.dribble-status-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 260px;
}

.hand-indicator {
  display: flex;
  align-items: center;
  gap: 10px;
}

.hand-badge {
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 700;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #8da4be;
  transition: all 0.15s ease;
}

.hand-badge.active {
  background: #ff7700;
  border-color: #ffa142;
  color: #fff;
  box-shadow: 0 0 16px rgba(255, 119, 0, 0.5);
  transform: scale(1.05);
}

/* Step counter (travel violation warning) */
.travel-meter {
  display: flex;
  align-items: center;
  gap: 12px;
}

.step-dots {
  display: flex;
  gap: 6px;
}

.step-dot {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  transition: background 0.1s, box-shadow 0.1s;
}

.step-dot.taken {
  background: #ffcc00;
  box-shadow: 0 0 10px rgba(255, 204, 0, 0.6);
}

.step-dot.foul {
  background: #ff2222;
  box-shadow: 0 0 12px rgba(255, 34, 34, 0.8);
}

/* Speed / Momentum gauge */
.momentum-container {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Stamina gauge */
.stamina-container {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stamina-bar-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #ffcc00, #00ff88);
  border-radius: 4px;
  transition: width 0.05s linear, background 0.2s ease;
  box-shadow: 0 0 10px rgba(0, 255, 136, 0.4);
}

.stamina-bar-fill.exhausted {
  background: #ff2222;
  box-shadow: 0 0 12px rgba(255, 34, 34, 0.8);
  animation: pulseExhausted 0.5s infinite alternate;
}

@keyframes pulseExhausted {
  from { opacity: 0.55; }
  to { opacity: 1.0; }
}

.gauge-bar-bg {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
}

.gauge-bar-fill {
  height: 100%;
  width: 20%;
  background: linear-gradient(90deg, #00bbff, #00ffaa);
  border-radius: 4px;
  transition: width 0.05s linear;
}

/* Right Panel: Controls cheat sheet mini */
.controls-panel {
  max-width: 300px;
  font-size: 12px;
  line-height: 1.6;
  color: #b5c7d8;
}

.controls-panel h4 {
  font-size: 13px;
  color: #fff;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.key-pill {
  display: inline-block;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 4px;
  padding: 1px 6px;
  font-weight: 700;
  font-size: 11px;
  color: #fff;
}

/* Big Notification Banner */
#announcement-banner {
  position: absolute;
  top: 18%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.8);
  font-size: 38px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 3px;
  text-align: center;
  color: #fff;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.9);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275), transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  z-index: 20;
}

#announcement-banner.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

/* Start / Pause / Instructions Modal */
#blocker {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(8, 12, 18, 0.88);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  cursor: default;
}

#lobby-modal,
#pause-modal {
  background: #101724;
  border: 2px solid #ff7700;
  box-shadow: 0 16px 64px rgba(255, 119, 0, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  max-width: 480px;
  width: 90%;
  padding: 32px 28px;
  text-align: center;
  pointer-events: auto;
  cursor: default;
}

#pause-modal {
  max-width: 460px;
  padding: 28px 24px;
}

#lobby-modal h1,
#pause-modal h1 {
  font-size: 36px;
  font-weight: 900;
  letter-spacing: 3px;
  color: #ff9100;
  margin: 0 0 6px 0;
  text-transform: uppercase;
}

#lobby-modal .tagline,
#pause-modal .tagline {
  color: #8da4be;
  font-size: 13.5px;
  margin: 0 0 20px 0;
  font-weight: 500;
}

.pause-room-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 8px 14px;
  margin-bottom: 16px;
}

.pause-room-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  color: #8da4be;
}

.pause-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.pause-actions .play-button {
  width: 100%;
  padding: 14px 20px;
  font-size: 16px;
  margin-top: 0;
}

.pause-leave-btn {
  width: 100%;
  padding: 11px 20px;
  font-size: 13px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #a0b6d0;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s;
}

.pause-leave-btn:hover {
  background: rgba(255, 60, 60, 0.15);
  border-color: rgba(255, 60, 60, 0.4);
  color: #ff6666;
}

/* Lobby Form */
.lobby-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  text-align: left;
}

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

.form-group label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  color: #8da4be;
  text-transform: uppercase;
}

.lobby-input {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 10px;
  padding: 12px 14px;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  outline: none;
  transition: all 0.15s ease;
}

.lobby-input:focus {
  border-color: #ff8800;
  background: rgba(255, 255, 255, 0.09);
  box-shadow: 0 0 12px rgba(255, 136, 0, 0.3);
}

.room-input-row,
.room-display-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.room-code-tag {
  flex: 1;
  background: rgba(0, 229, 255, 0.1);
  border: 1px solid rgba(0, 229, 255, 0.35);
  border-radius: 10px;
  padding: 10px 14px;
  color: #70f0ff;
  font-family: monospace, monospace;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-align: center;
  user-select: all;
}

.room-input-row .lobby-input {
  flex: 1;
}

.secondary-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  color: #ccd9e8;
  font-size: 13px;
  font-weight: 700;
  padding: 0 14px;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}

.secondary-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

/* Role Selector Pills */
.role-selector {
  display: flex;
  gap: 8px;
}

.role-pill-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  padding: 10px 8px;
  color: #a0b6d0;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}

.role-pill-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.role-pill-btn.active {
  background: rgba(255, 119, 0, 0.15);
  border-color: #ff8800;
  color: #fff;
  box-shadow: 0 0 12px rgba(255, 136, 0, 0.3);
}

.role-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.role-dot.blue { background: #0077ff; box-shadow: 0 0 6px #0077ff; }
.role-dot.red { background: #ff3344; box-shadow: 0 0 6px #ff3344; }
.role-dot.spec { background: #00e5ff; box-shadow: 0 0 6px #00e5ff; }

.modal-controls-summary {
  margin-top: 18px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  font-size: 11px;
  color: #8da4be;
  display: flex;
  flex-direction: column;
  gap: 6px;
  line-height: 1.4;
}

.play-button {
  background: linear-gradient(135deg, #ff7700, #ff9e00);
  border: none;
  border-radius: 12px;
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 1.5px;
  padding: 14px 28px;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(255, 119, 0, 0.5);
  transition: transform 0.15s, box-shadow 0.15s;
  text-transform: uppercase;
  margin-top: 6px;
}

.play-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(255, 119, 0, 0.7);
}

/* Spectator Mode Active - keep mouse visible and free */
body.spectator-active {
  cursor: default !important;
}

body.spectator-active button,
body.spectator-active .cam-btn,
body.spectator-active .join-court-btn {
  cursor: pointer !important;
}

/* Spectator Overlay Styles */
.spectator-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 24px 32px;
  box-sizing: border-box;
  z-index: 50;
}

.broadcast-scorebug {
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(10, 16, 26, 0.88);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 14px;
  padding: 10px 22px;
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.6);
  align-self: flex-start;
  pointer-events: auto;
}

.live-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 1.5px;
  color: #00ffaa;
  background: rgba(0, 255, 170, 0.15);
  border: 1px solid rgba(0, 255, 170, 0.5);
  border-radius: 20px;
  padding: 4px 10px;
  text-transform: uppercase;
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #00ffaa;
  box-shadow: 0 0 8px #00ffaa;
  animation: livePulse 1.2s infinite alternate;
}

@keyframes livePulse {
  from { opacity: 1; transform: scale(1); }
  to { opacity: 0.3; transform: scale(0.7); }
}

.broadcast-teams {
  display: flex;
  align-items: center;
  gap: 16px;
}

.b-team {
  display: flex;
  align-items: center;
  gap: 8px;
}

.b-team-name {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 1px;
}
.b-team.blue .b-team-name { color: #4da6ff; }
.b-team.red .b-team-name { color: #ff5555; }

.b-score {
  font-size: 24px;
  font-weight: 900;
  color: #fff;
  font-variant-numeric: tabular-nums;
}

.b-vs {
  font-size: 12px;
  font-weight: 800;
  color: #718299;
}

.broadcast-room-badge {
  background: rgba(0, 229, 255, 0.15);
  border: 1px solid rgba(0, 229, 255, 0.4);
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 800;
  color: #70f0ff;
  letter-spacing: 0.8px;
}

.broadcast-toolbar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  align-self: center;
  pointer-events: auto;
}

.camera-pills {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(12, 18, 30, 0.85);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 30px;
  padding: 6px 14px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.cam-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #ccd9e8;
  border-radius: 18px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.8px;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}

.cam-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  transform: translateY(-1px);
}

.cam-btn.active {
  background: linear-gradient(135deg, #0077ff, #00ccff);
  border-color: #00e5ff;
  color: #fff;
  box-shadow: 0 0 16px rgba(0, 200, 255, 0.6);
}

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

.cam-hint {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: rgba(255, 255, 255, 0.55);
  text-transform: uppercase;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

.join-court-btn {
  background: linear-gradient(135deg, #0077ff, #00bbff);
  border: 1px solid #00d9ff;
  border-radius: 20px;
  color: #fff;
  padding: 7px 18px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.8px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 119, 255, 0.4);
  transition: transform 0.15s, box-shadow 0.15s;
  font-family: inherit;
}

.join-court-btn.red {
  background: linear-gradient(135deg, #ff2233, #ff6644);
  border-color: #ff7766;
  box-shadow: 0 4px 14px rgba(255, 34, 51, 0.4);
}

.join-court-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(0, 119, 255, 0.6);
}

#freecam-hud {
  position: absolute;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  padding: 6px 16px;
  font-size: 11px;
  font-weight: 700;
  color: #00ffaa;
  display: none;
  pointer-events: none;
  letter-spacing: 0.5px;
}

/* Mode Selector and Practice Mode HUD Styles */
.mode-panel {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mode-toggle-btn {
  background: linear-gradient(135deg, rgba(255, 119, 0, 0.25), rgba(255, 160, 0, 0.15));
  border: 1px solid #ff9100;
  color: #ffb74d;
  font-size: 12px;
  font-weight: 800;
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  transition: all 0.15s ease;
  box-shadow: 0 2px 10px rgba(255, 145, 0, 0.2);
}

.mode-toggle-btn:hover {
  background: linear-gradient(135deg, rgba(255, 119, 0, 0.4), rgba(255, 160, 0, 0.3));
  border-color: #ffaa00;
  color: #fff;
  transform: translateY(-1px);
}

.mode-toggle-btn.practice-active {
  background: linear-gradient(135deg, rgba(0, 230, 140, 0.25), rgba(0, 180, 255, 0.15));
  border-color: #00ffaa;
  color: #00ffaa;
  box-shadow: 0 2px 12px rgba(0, 255, 170, 0.3);
}

.mode-toggle-btn.practice-active:hover {
  background: linear-gradient(135deg, rgba(0, 230, 140, 0.4), rgba(0, 180, 255, 0.3));
  color: #fff;
}

.auto-return-btn {
  background: rgba(0, 102, 238, 0.2);
  border: 1px solid #0099ff;
  color: #66ccff;
  font-size: 11px;
  font-weight: 700;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  transition: all 0.15s ease;
}

.auto-return-btn:hover {
  background: rgba(0, 102, 238, 0.35);
  color: #fff;
}

.auto-return-btn.off {
  border-color: #667e99;
  color: #8da4be;
  background: rgba(255, 255, 255, 0.05);
}

.practice-stats-panel {
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(14, 25, 38, 0.85);
  border: 1px solid rgba(0, 255, 170, 0.4);
  box-shadow: 0 4px 20px rgba(0, 255, 170, 0.15);
}

.practice-badge {
  background: rgba(0, 255, 170, 0.2);
  border: 1px solid #00ffaa;
  color: #00ffaa;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  border-radius: 6px;
  text-transform: uppercase;
}

.practice-metrics {
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(0, 0, 0, 0.45);
  padding: 6px 14px;
  border-radius: 8px;
}

.practice-metric {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.practice-metric .p-label {
  font-size: 10px;
  font-weight: 700;
  color: #8da4be;
  letter-spacing: 0.8px;
}

.practice-metric .p-value {
  font-size: 16px;
  font-weight: 800;
  color: #fff;
  font-variant-numeric: tabular-nums;
}

.practice-metric .p-value.highlight {
  color: #00ffaa;
  text-shadow: 0 0 10px rgba(0, 255, 170, 0.5);
}

.practice-metric .p-value.zone {
  color: #ffbb00;
  font-size: 13px;
  max-width: 120px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mode-select-container {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin-top: 16px;
  flex-wrap: wrap;
}

.practice-button {
  background: linear-gradient(135deg, #00aa66, #00d288) !important;
  box-shadow: 0 8px 24px rgba(0, 210, 136, 0.4) !important;
}

.practice-button:hover {
  box-shadow: 0 12px 30px rgba(0, 210, 136, 0.6) !important;
}

.spectate-tab-btn {
  background: rgba(0, 150, 255, 0.18);
  border: 1px solid rgba(0, 180, 255, 0.55);
  color: #70d0ff;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  transition: all 0.15s ease;
  font-family: inherit;
}

.spectate-tab-btn:hover {
  background: rgba(0, 180, 255, 0.35);
  color: #ffffff;
  border-color: #00e5ff;
  box-shadow: 0 0 16px rgba(0, 229, 255, 0.5);
  transform: translateY(-1px);
}

.spectate-button {
  background: linear-gradient(135deg, #0066cc, #00aaff) !important;
  box-shadow: 0 8px 24px rgba(0, 170, 255, 0.45) !important;
}

.spectate-button:hover {
  box-shadow: 0 12px 30px rgba(0, 200, 255, 0.7) !important;
  transform: translateY(-2px);
}

/* ==========================================================================
   Command Palette & Room HUD Styles
   ========================================================================== */
.command-palette-btn {
  background: linear-gradient(135deg, rgba(255, 140, 0, 0.3), rgba(255, 70, 0, 0.2));
  border: 1px solid #ff8800;
  color: #ffaa33;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  transition: all 0.15s ease;
  font-family: inherit;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 0 12px rgba(255, 136, 0, 0.25);
}

.command-palette-btn:hover {
  background: linear-gradient(135deg, rgba(255, 140, 0, 0.5), rgba(255, 70, 0, 0.35));
  color: #ffffff;
  border-color: #ffa500;
  box-shadow: 0 0 18px rgba(255, 140, 0, 0.5);
  transform: translateY(-1px);
}

.hud-room-badge {
  background: rgba(0, 229, 255, 0.12);
  border: 1px solid rgba(0, 229, 255, 0.4);
  color: #70f0ff;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.hud-room-badge:hover {
  background: rgba(0, 229, 255, 0.25);
  border-color: #00e5ff;
  color: #ffffff;
  box-shadow: 0 0 14px rgba(0, 229, 255, 0.4);
  transform: translateY(-1px);
}

.hud-room-badge span {
  color: #ffffff;
  font-weight: 900;
}

/* Command Palette Overlay */
.cp-modal {
  position: fixed;
  inset: 0;
  background: rgba(4, 8, 16, 0.78);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 10000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 10vh;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}

.cp-modal.active {
  opacity: 1;
  pointer-events: auto;
}

.cp-dialog {
  width: 90%;
  max-width: 680px;
  background: #0c1322;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(0, 229, 255, 0.15);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: cpPopIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes cpPopIn {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(-10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.cp-header {
  display: flex;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(16, 26, 44, 0.7);
  gap: 12px;
}

.cp-search-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 6px 12px;
}

.cp-search-icon {
  font-size: 16px;
  opacity: 0.8;
}

.cp-search-input {
  background: transparent;
  border: none;
  outline: none;
  color: #ffffff;
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  width: 100%;
}

.cp-search-input::placeholder {
  color: #6a82a0;
  font-size: 13.5px;
}

.cp-key-badge {
  font-size: 10px;
  font-weight: 700;
  color: #8da4be;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  padding: 3px 6px;
  white-space: nowrap;
}

.cp-room-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: #8da4be;
  background: rgba(0, 229, 255, 0.08);
  border: 1px solid rgba(0, 229, 255, 0.25);
  border-radius: 8px;
  padding: 6px 10px;
  white-space: nowrap;
}

.cp-room-indicator strong {
  color: #00e5ff;
  letter-spacing: 0.6px;
}

.cp-close-btn {
  background: transparent;
  border: none;
  color: #8da4be;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
  transition: color 0.15s;
}

.cp-close-btn:hover {
  color: #ffffff;
}

/* Category Pills */
.cp-categories {
  display: flex;
  gap: 8px;
  padding: 10px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(8, 14, 26, 0.5);
  overflow-x: auto;
}

.cp-cat-pill {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #92a8c2;
  font-size: 11.5px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.12s ease;
  white-space: nowrap;
  font-family: inherit;
}

.cp-cat-pill:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.cp-cat-pill.active {
  background: #0066ee;
  border-color: #3388ff;
  color: #ffffff;
  box-shadow: 0 0 12px rgba(0, 102, 238, 0.4);
}

/* Action Items List */
.cp-action-list {
  max-height: 380px;
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cp-action-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 11px 14px;
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
  transition: all 0.12s ease;
  border: 1px solid transparent;
}

.cp-action-item:hover {
  background: rgba(0, 102, 238, 0.15);
  border-color: rgba(0, 102, 238, 0.4);
  transform: translateX(4px);
}

.cp-action-icon {
  font-size: 22px;
  width: 32px;
  text-align: center;
  flex-shrink: 0;
}

.cp-action-details {
  flex: 1;
  min-width: 0;
}

.cp-action-title {
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.3px;
  margin-bottom: 2px;
}

.cp-action-desc {
  color: #7e95b0;
  font-size: 12px;
  line-height: 1.3;
}

.cp-action-badge {
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.8px;
  color: #70d0ff;
  background: rgba(0, 180, 255, 0.12);
  border: 1px solid rgba(0, 180, 255, 0.25);
  border-radius: 6px;
  padding: 3px 8px;
  text-transform: uppercase;
}

.cp-no-results {
  text-align: center;
  padding: 36px 16px;
  color: #6a82a0;
  font-size: 13.5px;
}

.cp-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 18px;
  background: rgba(6, 11, 20, 0.85);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 11px;
  color: #6c839f;
}

/* Toast Notification */
.cp-toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(10, 20, 36, 0.95);
  border: 1px solid #00e5ff;
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  padding: 10px 20px;
  border-radius: 10px;
  box-shadow: 0 8px 30px rgba(0, 229, 255, 0.3);
  pointer-events: none;
  opacity: 0;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 10001;
  display: flex;
  align-items: center;
  gap: 8px;
}

.cp-toast.active {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.cp-toast.error {
  border-color: #ff3344;
  box-shadow: 0 8px 30px rgba(255, 51, 68, 0.3);
}

