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

body {
  background: #0a0a0a;
  overflow: hidden;
  font-family: 'Orbitron', sans-serif;
  color: white;
}

#game-container {
  width: 100vw;
  height: 100vh;
  position: relative;
}

#game-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

#ui-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

#ui-overlay * {
  pointer-events: auto;
}

/* Menu Styles */
.menu-container {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  z-index: 100;
}

.menu-container.wide {
  width: 90%;
  max-width: 1000px;
}

.title-container {
  margin-bottom: 60px;
}

.game-title {
  font-size: clamp(2rem, 8vw, 5rem);
  font-weight: 900;
  color: #00ffff;
  text-shadow: 
    0 0 10px #00ffff,
    0 0 20px #00ffff,
    0 0 40px #00ffff,
    0 0 80px #00ffff;
  letter-spacing: 0.2em;
  animation: pulse 2s ease-in-out infinite;
}

.game-subtitle {
  font-size: clamp(1.5rem, 5vw, 3rem);
  font-weight: 700;
  color: #ff00ff;
  text-shadow: 
    0 0 10px #ff00ff,
    0 0 20px #ff00ff;
  letter-spacing: 0.3em;
  margin-top: -10px;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.8; }
}

.glitch {
  position: relative;
}

.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0.8;
}

.glitch::before {
  color: #ff00ff;
  animation: glitch1 2s infinite linear alternate-reverse;
  clip-path: polygon(0 0, 100% 0, 100% 35%, 0 35%);
}

.glitch::after {
  color: #ffff00;
  animation: glitch2 3s infinite linear alternate-reverse;
  clip-path: polygon(0 65%, 100% 65%, 100% 100%, 0 100%);
}

@keyframes glitch1 {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-2px); }
  40% { transform: translateX(2px); }
  60% { transform: translateX(-1px); }
  80% { transform: translateX(1px); }
}

@keyframes glitch2 {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(1px); }
  50% { transform: translateX(-1px); }
  75% { transform: translateX(2px); }
}

.menu-buttons {
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-items: center;
}

.neon-button {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  padding: 15px 50px;
  background: transparent;
  border: 2px solid #00ffff;
  color: #00ffff;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.neon-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(0, 255, 255, 0.3), transparent);
  transition: left 0.5s ease;
}

.neon-button:hover {
  background: rgba(0, 255, 255, 0.1);
  box-shadow: 
    0 0 10px #00ffff,
    0 0 20px #00ffff,
    inset 0 0 10px rgba(0, 255, 255, 0.2);
  transform: scale(1.05);
}

.neon-button:hover::before {
  left: 100%;
}

.neon-button.secondary {
  border-color: #ff00ff;
  color: #ff00ff;
}

.neon-button.secondary:hover {
  background: rgba(255, 0, 255, 0.1);
  box-shadow: 
    0 0 10px #ff00ff,
    0 0 20px #ff00ff;
}

.footer {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.8rem;
  color: #666;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.footer a {
  color: #00ffff;
  text-decoration: none;
}

.weather-credit {
  font-size: 0.7rem;
  opacity: 0.6;
}

/* Section Title */
.section-title {
  font-size: 2rem;
  color: #00ffff;
  text-shadow: 0 0 20px #00ffff;
  margin-bottom: 40px;
  letter-spacing: 0.2em;
}

/* Player Select */
.player-select {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 40px;
  margin-bottom: 40px;
}

.arrow-btn {
  font-size: 2rem;
  background: transparent;
  border: 2px solid #00ffff;
  color: #00ffff;
  width: 60px;
  height: 60px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.arrow-btn:hover {
  background: rgba(0, 255, 255, 0.2);
  box-shadow: 0 0 20px #00ffff;
}

.player-count {
  text-align: center;
}

.big-number {
  font-size: 6rem;
  font-weight: 900;
  color: #00ffff;
  text-shadow: 0 0 30px #00ffff;
  display: block;
  line-height: 1;
}

.label {
  font-size: 1.2rem;
  color: #ff00ff;
  letter-spacing: 0.3em;
}

.split-preview {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 5px;
  margin-bottom: 30px;
  width: 200px;
  height: 120px;
  margin: 0 auto 30px;
}

.split-preview.full .preview-screen {
  width: 100%;
  height: 100%;
}

.split-preview.split-v .preview-screen {
  width: 48%;
  height: 100%;
}

.split-preview.split-3 .preview-screen:nth-child(1),
.split-preview.split-3 .preview-screen:nth-child(2) {
  width: 48%;
  height: 48%;
}

.split-preview.split-3 .preview-screen:nth-child(3) {
  width: 48%;
  height: 48%;
}

.split-preview.quad .preview-screen {
  width: 48%;
  height: 48%;
}

.preview-screen {
  background: rgba(0, 0, 0, 0.5);
  border: 2px solid;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 1.5rem;
}

.player-colors {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-bottom: 40px;
}

.player-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  color: #000;
  box-shadow: 0 0 15px currentColor;
}

/* Vehicle Select */
.vehicle-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.vehicle-card {
  background: rgba(0, 0, 0, 0.8);
  border: 2px solid #333;
  padding: 20px;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
}

.vehicle-card:hover,
.vehicle-card.selected {
  border-color: var(--accent, #00ffff);
  box-shadow: 0 0 20px var(--accent, #00ffff);
}

.vehicle-card.selected::after {
  content: '✓';
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 1.5rem;
  color: var(--accent);
}

.vehicle-preview {
  width: 80px;
  height: 40px;
  margin: 0 auto 15px;
  clip-path: polygon(20% 0%, 80% 0%, 100% 50%, 80% 100%, 20% 100%, 0% 50%);
  box-shadow: 0 0 20px currentColor;
}

.vehicle-name {
  font-size: 1rem;
  color: #fff;
  margin-bottom: 5px;
}

.vehicle-desc {
  font-size: 0.75rem;
  color: #888;
  font-family: 'Share Tech Mono', monospace;
  margin-bottom: 15px;
}

.stat-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  font-size: 0.7rem;
}

.stat-bar span {
  width: 60px;
  text-align: left;
  color: #888;
}

.stat-bar .bar {
  flex: 1;
  height: 6px;
  background: #222;
  border-radius: 3px;
  overflow: hidden;
}

.stat-bar .fill {
  height: 100%;
  background: linear-gradient(90deg, #00ffff, #ff00ff);
  border-radius: 3px;
}

/* Track Select */
.track-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.track-card {
  background: rgba(0, 0, 0, 0.8);
  border: 2px solid #333;
  padding: 20px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.track-card:hover,
.track-card.selected {
  border-color: #00ffff;
  box-shadow: 0 0 20px #00ffff;
}

.track-minimap {
  height: 100px;
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.track-minimap canvas {
  background: transparent;
}

.track-name {
  font-size: 1.2rem;
  margin-bottom: 10px;
}

.difficulty-badge {
  font-size: 0.8rem;
  font-weight: bold;
  letter-spacing: 0.2em;
}

.track-stats {
  margin-top: 15px;
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: #888;
  font-family: 'Share Tech Mono', monospace;
}

/* Loading Screen */
.loading-container {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  width: 80%;
  max-width: 500px;
}

.signal-waves {
  width: 100px;
  height: 100px;
  margin: 0 auto 30px;
  position: relative;
}

.wave {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  border: 2px solid #00ffff;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  animation: wave 1.5s ease-out infinite;
}

.wave:nth-child(2) { animation-delay: 0.5s; }
.wave:nth-child(3) { animation-delay: 1s; }

@keyframes wave {
  0% { width: 20px; height: 20px; opacity: 1; }
  100% { width: 100px; height: 100px; opacity: 0; }
}

.loading-title {
  font-size: 1.5rem;
  color: #00ffff;
  text-shadow: 0 0 20px #00ffff;
  margin-bottom: 30px;
  animation: flicker 0.5s infinite;
}

@keyframes flicker {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.9; }
}

.progress-bar {
  width: 100%;
  height: 4px;
  background: #222;
  margin-bottom: 40px;
  position: relative;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #00ffff, #ff00ff);
  transition: width 0.1s ease;
  box-shadow: 0 0 10px #00ffff;
}

.weather-data {
  display: flex;
  justify-content: center;
  gap: 40px;
  margin-bottom: 30px;
  flex-wrap: wrap;
}

.weather-stat {
  text-align: center;
}

.weather-stat .icon {
  font-size: 2rem;
  display: block;
  margin-bottom: 5px;
}

.weather-stat .value {
  font-size: 1.5rem;
  font-family: 'Share Tech Mono', monospace;
  color: #00ffff;
}

.simulated-badge {
  background: rgba(255, 255, 0, 0.2);
  border: 1px solid #ffff00;
  color: #ffff00;
  padding: 5px 15px;
  font-size: 0.7rem;
  margin-top: 20px;
  display: inline-block;
}

.effects-panel {
  margin-bottom: 30px;
}

.effects-panel h3 {
  color: #ff00ff;
  margin-bottom: 15px;
  font-size: 0.9rem;
  letter-spacing: 0.2em;
}

.effect-row {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.9rem;
  color: #ccc;
  margin-bottom: 8px;
}

.countdown-text {
  margin-top: 30px;
}

.countdown-number {
  font-size: 8rem;
  font-weight: 900;
  color: #00ffff;
  text-shadow: 0 0 50px #00ffff;
  animation: countPulse 1s ease-out;
}

.countdown-go {
  font-size: 6rem;
  font-weight: 900;
  color: #00ff00;
  text-shadow: 0 0 50px #00ff00;
  animation: goPulse 0.5s ease-out;
}

@keyframes countPulse {
  0% { transform: scale(0.5); opacity: 0; }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes goPulse {
  0% { transform: scale(2); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

/* Race HUD */
.player-hud {
  position: absolute;
  padding: 10px;
  pointer-events: none;
}

.hud-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.hud-left, .hud-center, .hud-right {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.hud-center {
  align-items: center;
}

.hud-right {
  align-items: flex-end;
}

.position-badge {
  padding: 5px 12px;
  font-weight: bold;
  font-size: 1rem;
  color: #000;
  box-shadow: 0 0 10px currentColor;
}

.lap-counter {
  font-size: 0.8rem;
  color: #fff;
  font-family: 'Share Tech Mono', monospace;
}

.race-timer {
  font-size: 1.2rem;
  font-family: 'Share Tech Mono', monospace;
  color: #00ffff;
  text-shadow: 0 0 10px #00ffff;
}

.checkpoint-bar {
  width: 100px;
  height: 4px;
  background: #333;
  border-radius: 2px;
  overflow: hidden;
}

.checkpoint-fill {
  height: 100%;
  background: #ff00ff;
  transition: width 0.3s ease;
}

.speedometer {
  font-size: 2rem;
  font-weight: 900;
  color: #ffff00;
  text-shadow: 0 0 15px #ffff00;
  font-family: 'Share Tech Mono', monospace;
}

.speed-unit {
  font-size: 0.7rem;
  color: #888;
}

.hud-bottom {
  position: absolute;
  bottom: 10px;
  left: 10px;
  display: flex;
  align-items: center;
  gap: 15px;
}

.weather-icons {
  font-size: 1.2rem;
}

.drift-indicator {
  background: linear-gradient(90deg, #ff00ff, #ffff00);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 900;
  font-size: 1.5rem;
  animation: driftPulse 0.3s infinite;
}

@keyframes driftPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.8; transform: scale(1.1); }
}

.minimap-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 150px;
  height: 150px;
  background: rgba(0, 0, 0, 0.8);
  border: 2px solid #00ffff;
  border-radius: 5px;
  z-index: 100;
}

.minimap-container canvas {
  display: block;
}

/* Controls Overlay */
.controls-overlay {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.95);
  border: 2px solid #00ffff;
  padding: 30px;
  z-index: 200;
  box-shadow: 0 0 30px rgba(0, 255, 255, 0.3);
}

.controls-overlay h3 {
  color: #00ffff;
  margin-bottom: 20px;
  text-align: center;
  letter-spacing: 0.2em;
}

.control-row {
  display: flex;
  gap: 20px;
  padding: 10px;
  border-left: 3px solid;
  margin-bottom: 10px;
  font-family: 'Share Tech Mono', monospace;
}

.player-label {
  font-weight: bold;
  width: 30px;
}

.controls-overlay .hint {
  text-align: center;
  margin-top: 20px;
  color: #666;
  font-size: 0.8rem;
}

/* Results Screen */
.results-container {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  width: 90%;
  max-width: 800px;
}

.results-title {
  font-size: 3rem;
  color: #00ffff;
  text-shadow: 0 0 30px #00ffff;
  margin-bottom: 40px;
  letter-spacing: 0.2em;
}

.podium {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 30px;
  flex-wrap: wrap;
}

.podium-place {
  background: rgba(0, 0, 0, 0.8);
  border: 2px solid var(--color);
  padding: 30px 40px;
  position: relative;
  transition: all 0.3s ease;
}

.podium-place.first {
  transform: scale(1.1);
  box-shadow: 0 0 30px var(--color);
}

.place-number {
  font-size: 3rem;
  font-weight: 900;
  color: var(--color);
  text-shadow: 0 0 20px var(--color);
}

.player-name {
  font-size: 1.2rem;
  margin: 10px 0;
}

.player-vehicle {
  font-size: 0.8rem;
  color: #888;
  margin-bottom: 15px;
}

.player-time {
  font-size: 1.5rem;
  font-family: 'Share Tech Mono', monospace;
  color: #00ffff;
}

.best-lap {
  font-size: 0.8rem;
  color: #ff00ff;
  margin-top: 10px;
}

.weather-summary {
  font-size: 1rem;
  color: #888;
  margin-bottom: 30px;
  font-family: 'Share Tech Mono', monospace;
}

.result-buttons {
  display: flex;
  justify-content: center;
  gap: 20px;
}

/* Options */
.options-panel {
  margin-bottom: 40px;
}

.option-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 30px;
  border-bottom: 1px solid #333;
}

.toggle-btn {
  font-family: 'Orbitron', sans-serif;
  background: rgba(0, 255, 255, 0.2);
  border: 1px solid #00ffff;
  color: #00ffff;
  padding: 8px 20px;
  cursor: pointer;
}

.toggle-btn.active {
  background: #00ffff;
  color: #000;
}

/* Credits */
.credits-panel {
  margin-bottom: 40px;
}

.credit-line {
  margin-bottom: 15px;
  font-family: 'Share Tech Mono', monospace;
  color: #888;
}

.glow-text {
  color: #ff00ff !important;
  text-shadow: 0 0 20px #ff00ff;
  font-style: italic;
  margin-top: 30px;
}

/* Responsive */
@media (max-width: 768px) {
  .game-title {
    font-size: 2rem;
  }
  
  .game-subtitle {
    font-size: 1.2rem;
  }
  
  .neon-button {
    padding: 12px 30px;
    font-size: 1rem;
  }
  
  .vehicle-grid,
  .track-grid {
    grid-template-columns: 1fr;
  }
  
  .weather-data {
    gap: 20px;
  }
  
  .podium {
    flex-direction: column;
    align-items: center;
  }
  
  .podium-place.first {
    transform: none;
  }
  
  .minimap-container {
    width: 100px;
    height: 100px;
    bottom: 10px;
    right: 10px;
  }
  
  .hud-top {
    flex-wrap: wrap;
  }
  
  .speedometer {
    font-size: 1.5rem;
  }
}