:root {
  --neon-cyan: #00e5ff;
  --neon-pink: #ff00f6;
  --neon-yellow: #ffd500;
  --bg: #05050c;
  --text: #e8faff;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: radial-gradient(circle at 20% 20%, #101028, #04040a 70%);
  color: var(--text);
  font-family: "Orbitron", "Eurostile", "Bank Gothic", system-ui, sans-serif;
}

#scene {
  display: block;
  width: 100vw;
  height: 100vh;
}

.hidden {
  display: none !important;
}

#splash {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  background: radial-gradient(circle at 50% 20%, rgba(0, 229, 255, 0.1), rgba(4, 4, 10, 0.9) 70%);
}

.splash-image {
  width: min(720px, 90vw);
  height: auto;
  filter: drop-shadow(0 0 24px rgba(0, 229, 255, 0.5));
}

.splash-btn {
  padding: 12px 26px;
  font-size: 13px;
}

#intro {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 20%, rgba(0, 229, 255, 0.08), rgba(4, 4, 10, 0.85) 65%);
  backdrop-filter: blur(2px);
}

.small {
  padding: 8px 12px;
  font-size: 11px;
}

.intro-panel {
  width: min(420px, 92vw);
  padding: 28px;
  border: 1px solid rgba(0, 229, 255, 0.65);
  background: rgba(5, 5, 12, 0.78);
  box-shadow: 0 0 28px rgba(0, 229, 255, 0.35), inset 0 0 24px rgba(255, 0, 246, 0.08);
  text-align: center;
}

.intro-logo {
  width: min(300px, 70vw);
  height: auto;
  filter: drop-shadow(0 0 12px rgba(0, 229, 255, 0.5));
}

.intro-sub {
  margin-top: 10px;
  font-size: 12px;
  color: rgba(232, 250, 255, 0.8);
}

.intro-name {
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.intro-name-label {
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(232, 250, 255, 0.7);
}

.intro-name-edit {
  min-width: 160px;
  padding: 4px 6px;
  border-bottom: 1px solid rgba(255, 0, 246, 0.7);
  color: var(--text);
  font-size: 12px;
  letter-spacing: 1px;
  text-align: center;
  outline: none;
}

.intro-name-edit:empty::before {
  content: "Player";
  color: rgba(232, 250, 255, 0.4);
}

.intro-audio {
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.audio-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(232, 250, 255, 0.7);
}

#musicToggle {
  accent-color: #00e5ff;
}

#musicVolume {
  width: 140px;
  accent-color: #ff00f6;
}

.intro-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 20px;
  flex-wrap: wrap;
}

.neon-btn {
  border: 1px solid rgba(0, 229, 255, 0.8);
  background: rgba(0, 229, 255, 0.15);
  color: var(--text);
  padding: 10px 18px;
  font-size: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.35);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.neon-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 0, 246, 0.85);
  box-shadow: 0 0 16px rgba(255, 0, 246, 0.4);
}

.neon-btn.ghost {
  border-color: rgba(255, 0, 246, 0.7);
  background: rgba(255, 0, 246, 0.12);
}

.intro-join {
  margin-top: 16px;
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

#joinCodeInput {
  width: 160px;
  padding: 10px 12px;
  background: rgba(5, 5, 12, 0.8);
  border: 1px solid rgba(0, 229, 255, 0.7);
  color: var(--text);
  font-size: 12px;
  letter-spacing: 2px;
  text-align: center;
}

.intro-error {
  margin-top: 12px;
  font-size: 12px;
  color: var(--neon-yellow);
}

#lobby {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 20%, rgba(255, 0, 246, 0.08), rgba(4, 4, 10, 0.88) 65%);
  backdrop-filter: blur(2px);
}

.lobby-panel {
  width: min(460px, 94vw);
  padding: 28px;
  border: 1px solid rgba(255, 0, 246, 0.6);
  background: rgba(5, 5, 12, 0.8);
  box-shadow: 0 0 30px rgba(255, 0, 246, 0.35), inset 0 0 20px rgba(0, 229, 255, 0.08);
  text-align: center;
}

.lobby-title {
  font-size: 20px;
  letter-spacing: 3px;
  color: var(--neon-cyan);
  text-shadow: 0 0 10px rgba(0, 229, 255, 0.7);
}

.lobby-code-row {
  margin-top: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.lobby-code-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: rgba(232, 250, 255, 0.7);
}

.lobby-code {
  font-size: 18px;
  letter-spacing: 4px;
  color: var(--neon-yellow);
  text-shadow: 0 0 10px rgba(255, 213, 0, 0.6);
}

.lobby-list-wrap {
  margin-top: 18px;
  text-align: left;
}

.lobby-list-title {
  font-size: 12px;
  letter-spacing: 2px;
  color: rgba(232, 250, 255, 0.7);
  text-transform: uppercase;
  margin-bottom: 8px;
}

.lobby-list {
  list-style: none;
  max-height: 160px;
  overflow-y: auto;
  padding-right: 6px;
}

.lobby-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 2px;
  font-size: 12px;
  letter-spacing: 1px;
}

.lobby-color {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  box-shadow: 0 0 8px currentColor;
}

.lobby-tag {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 2px 6px;
  border: 1px solid rgba(0, 229, 255, 0.6);
  color: rgba(0, 229, 255, 0.9);
  margin-left: auto;
}

.lobby-status {
  margin: 14px 0 10px;
  font-size: 12px;
  color: rgba(232, 250, 255, 0.8);
}

#scoreboard {
  position: fixed;
  inset: 0;
  z-index: 18;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(4, 4, 10, 0.35);
  backdrop-filter: blur(2px);
  pointer-events: none;
}

#scoreboard.interactive {
  pointer-events: auto;
}

.score-panel {
  width: min(360px, 90vw);
  padding: 20px 22px;
  border: 1px solid rgba(255, 213, 0, 0.6);
  background: rgba(5, 5, 12, 0.85);
  box-shadow: 0 0 24px rgba(255, 213, 0, 0.3);
  text-align: center;
}

.score-title {
  font-size: 16px;
  letter-spacing: 3px;
  color: var(--neon-yellow);
  text-shadow: 0 0 8px rgba(255, 213, 0, 0.6);
}

.score-list {
  list-style: none;
  margin-top: 14px;
  margin-bottom: 16px;
}

.score-countdown {
  margin: 6px 0 12px;
  font-size: 12px;
  letter-spacing: 1px;
  color: rgba(232, 250, 255, 0.85);
}

.score-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 2px;
  font-size: 12px;
  letter-spacing: 1px;
}

.score-item strong {
  margin-left: auto;
  font-size: 13px;
}

#hud {
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 10;
  padding: 12px 16px;
  border: 1px solid rgba(0, 229, 255, 0.6);
  background: rgba(5, 5, 12, 0.7);
  box-shadow: 0 0 16px rgba(0, 229, 255, 0.35);
  backdrop-filter: blur(4px);
}

#hud .title {
  display: flex;
  align-items: center;
}

.hud-logo {
  width: 150px;
  height: auto;
  filter: drop-shadow(0 0 10px rgba(0, 229, 255, 0.5));
}

#hud .stats {
  margin-top: 6px;
  font-size: 12px;
}

#hud .hint {
  margin-top: 6px;
  font-size: 11px;
  color: rgba(232, 250, 255, 0.7);
}

.speed-meter {
  margin-top: 10px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
}

.speed-label {
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(232, 250, 255, 0.7);
}

.speed-bar {
  height: 6px;
  width: 110px;
  border: 1px solid rgba(0, 229, 255, 0.6);
  background: rgba(0, 229, 255, 0.08);
  overflow: hidden;
}

.speed-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, rgba(0, 229, 255, 0.2), rgba(0, 229, 255, 0.9));
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.7);
  transition: width 0.08s linear;
}

.speed-status {
  font-size: 10px;
  color: rgba(232, 250, 255, 0.8);
}
