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

body {
  overflow: hidden;
  background: linear-gradient(135deg, #0a0a1a 0%, #1a0a2e 100%);
  font-family: system-ui, sans-serif;
  color: #fff;
}

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

/* Loading Screen */
#loading {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0a0a1a 0%, #1a0a2e 100%);
  z-index: 1000;
}

.loading-text {
  font-size: 1.5rem;
  color: #00ffff;
  text-transform: uppercase;
  letter-spacing: 0.3em;
  animation: pulse 1.5s ease-in-out infinite;
}

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

/* Menu Screens */
.menu {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0a0a1a 0%, #1a0a2e 50%, #0a1a2a 100%);
  z-index: 100;
  transition: opacity 0.5s ease;
}

.menu.hidden {
  opacity: 0;
  pointer-events: none;
}

.game-title {
  font-size: 3rem;
  font-weight: bold;
  background: linear-gradient(45deg, #ff00ff, #00ffff, #ff00ff);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradient 3s ease infinite;
  text-shadow: 0 0 30px rgba(255, 0, 255, 0.5);
  margin-bottom: 0.5rem;
}

@keyframes gradient {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.game-subtitle {
  font-size: 1.5rem;
  color: #00ffff;
  margin-bottom: 2rem;
  text-shadow: 0 0 20px rgba(0, 255, 255, 0.5);
}

.menu-buttons {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 300px;
}

.menu-btn {
  padding: 1rem 2rem;
  font-size: 1rem;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border: 2px solid #00ffff;
  background: transparent;
  color: #00ffff;
  cursor: pointer;
  border-radius: 5px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

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

.menu-btn:hover::before {
  left: 100%;
}

.menu-btn:hover {
  background: rgba(0, 255, 255, 0.1);
  box-shadow: 0 0 30px rgba(0, 255, 255, 0.5);
  transform: scale(1.05);
}

.menu-btn:active {
  transform: scale(0.98);
}

/* Score Display */
.score-display,
.highscore-display {
  text-align: center;
  margin-bottom: 2rem;
}

.score-label,
.highscore-label {
  font-size: 1rem;
  color: #888;
  margin-bottom: 0.5rem;
}

.score-value,
.highscore-value {
  font-size: 3rem;
  font-weight: bold;
  color: #00ffff;
  text-shadow: 0 0 30px rgba(0, 255, 255, 0.5);
}

.score-value {
  color: #ff00ff;
  text-shadow: 0 0 30px rgba(255, 0, 255, 0.5);
}

/* HUD */
.hud {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  padding: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  pointer-events: none;
  z-index: 50;
}

.hud.hidden {
  display: none;
}

.hud-left,
.hud-right {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.hud-score,
.hud-highscore,
.hud-coins,
.hud-distance {
  font-size: 1.2rem;
  font-weight: bold;
  color: #fff;
  text-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

.hud-score {
  color: #ff00ff;
}

.hud-coins {
  color: #ffd700;
}

.hud-distance {
  color: #00ffff;
}

/* Power-up Indicator */
.powerup-indicator {
  position: absolute;
  top: 5rem;
  left: 50%;
  transform: translateX(-50%);
  padding: 0.5rem 2rem;
  background: rgba(0, 0, 0, 0.7);
  border: 2px solid;
  border-radius: 5px;
  font-weight: bold;
  animation: glow 1s ease-in-out infinite alternate;
}

@keyframes glow {
  from { box-shadow: 0 0 10px currentColor; }
  to { box-shadow: 0 0 30px currentColor; }
}

.powerup-indicator.invincible {
  color: #00ffff;
  border-color: #00ffff;
}

.powerup-indicator.magnet {
  color: #ff00ff;
  border-color: #ff00ff;
}

.powerup-indicator.giant {
  color: #ffd700;
  border-color: #ffd700;
}

.powerup-indicator.hidden {
  display: none;
}

#powerup-text {
  font-size: 1.2rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* Responsive */
@media (max-width: 768px) {
  .game-title {
    font-size: 2rem;
  }

  .game-subtitle {
    font-size: 1rem;
  }

  .menu-buttons {
    width: 250px;
  }

  .menu-btn {
    padding: 0.8rem 1.5rem;
    font-size: 0.9rem;
  }

  .score-value,
  .highscore-value {
    font-size: 2.5rem;
  }

  .hud {
    padding: 0.5rem;
  }

  .hud-score,
  .hud-highscore,
  .hud-coins,
  .hud-distance {
    font-size: 1rem;
  }

  .powerup-indicator {
    font-size: 1rem;
    padding: 0.3rem 1.5rem;
  }
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Particle Effects CSS */
.particle {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  animation: particleFade 1s ease-out forwards;
}

@keyframes particleFade {
  from {
    opacity: 1;
    transform: scale(1);
  }
  to {
    opacity: 0;
    transform: scale(0);
  }
}
