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

body {
  font-family: system-ui, sans-serif;
  background: linear-gradient(135deg, #0a0a1a 0%, #1a0a2e 50%, #0a1a2e 100%);
  min-height: 100vh;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
}

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

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

/* Screens */
.screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: linear-gradient(135deg, rgba(10, 10, 26, 0.95) 0%, rgba(26, 10, 46, 0.95) 50%, rgba(10, 26, 46, 0.95) 100%);
  backdrop-filter: blur(10px);
  transition: opacity 0.3s ease;
}

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

/* Title */
.title {
  text-align: center;
  margin-bottom: 2rem;
}

.title h1 {
  font-size: 4rem;
  font-weight: 900;
  color: #00ffff;
  text-shadow:
    0 0 10px #00ffff,
    0 0 20px #00ffff,
    0 0 40px #00ffff,
    0 0 80px #00ffff;
  margin-bottom: 0.5rem;
  letter-spacing: 2px;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.subtitle {
  font-size: 1.2rem;
  color: #ff00ff;
  text-shadow: 0 0 10px #ff00ff;
  margin-bottom: 2rem;
}

/* Instructions */
.instructions {
  margin-bottom: 2rem;
}

.instruction {
  font-size: 1rem;
  color: #ffffff;
  margin: 0.5rem 0;
  opacity: 0.9;
  padding: 0.5rem 1.5rem;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Buttons */
.btn {
  font-size: 1.3rem;
  font-weight: 700;
  padding: 1rem 3rem;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  background: linear-gradient(135deg, #00ffff 0%, #0080ff 100%);
  color: #0a0a1a;
  text-transform: uppercase;
  letter-spacing: 2px;
  transition: all 0.3s ease;
  box-shadow:
    0 4px 15px rgba(0, 255, 255, 0.4),
    0 0 30px rgba(0, 255, 255, 0.2);
  margin: 0.5rem;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow:
    0 6px 20px rgba(0, 255, 255, 0.6),
    0 0 50px rgba(0, 255, 255, 0.4);
  background: linear-gradient(135deg, #00ccff 0%, #0066ff 100%);
}

.btn:active {
  transform: translateY(1px);
  box-shadow:
    0 2px 10px rgba(0, 255, 255, 0.4),
    0 0 20px rgba(0, 255, 255, 0.3);
}

/* High Score Display */
.high-score {
  margin-top: 2rem;
  font-size: 1.1rem;
  color: #ffff00;
  text-shadow: 0 0 10px #ffff00;
}

/* HUD */
.hud {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 30px;
  z-index: 100;
}

.score-container,
.rings-container,
.speed-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(0, 0, 0, 0.5);
  padding: 10px 20px;
  border-radius: 15px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
}

.score-label,
.rings-label,
.speed-label {
  font-size: 0.8rem;
  color: #aaaaaa;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.score-value,
.rings-value,
.speed-value {
  font-size: 1.5rem;
  font-weight: 700;
  margin-top: 5px;
}

#score {
  color: #00ffff;
  text-shadow: 0 0 10px #00ffff;
}

#rings {
  color: #ff00ff;
  text-shadow: 0 0 10px #ff00ff;
}

#speed {
  color: #ffff00;
  text-shadow: 0 0 10px #ffff00;
}

/* Speed Indicator */
.speed-indicator {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 2rem;
  font-weight: 900;
  color: #ff0000;
  text-shadow:
    0 0 10px #ff0000,
    0 0 20px #ff0000,
    0 0 40px #ff0000;
  opacity: 0;
  pointer-events: none;
  z-index: 200;
}

.speed-indicator.active {
  opacity: 1;
  animation: shake 0.3s ease-in-out infinite;
}

@keyframes shake {
  0%, 100% { transform: translate(-50%, -50%) rotate(-5deg); }
  50% { transform: translate(-50%, -50%) rotate(5deg); }
}

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

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

  .subtitle {
    font-size: 1rem;
  }

  .instruction {
    font-size: 0.85rem;
    padding: 0.4rem 1rem;
  }

  .btn {
    font-size: 1.1rem;
    padding: 0.8rem 2rem;
  }

  .hud {
    gap: 15px;
    top: 10px;
  }

  .score-container,
  .rings-container,
  .speed-container {
    padding: 8px 12px;
  }

  .score-label,
  .rings-label,
  .speed-label {
    font-size: 0.7rem;
  }

  .score-value,
  .rings-value,
  .speed-value {
    font-size: 1.1rem;
  }

  #speed-indicator {
    font-size: 1.5rem;
  }
}

/* Touch Device Optimization */
@media (max-width: 480px) {
  .title h1 {
    font-size: 2rem;
  }

  .instruction {
    font-size: 0.8rem;
  }

  .hud {
    width: 90%;
    justify-content: space-around;
  }
}