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

body {
  font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: linear-gradient(135deg, #0a0a15 0%, #0d1525 25%, #0a1a35 50%, #0d1020 75%, #0a0a15 100%);
  background-size: 400% 400%;
  animation: gradientShift 25s ease infinite;
  color: white;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
  position: relative;
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(circle at 20% 80%, rgba(0, 200, 255, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(255, 50, 150, 0.06) 0%, transparent 50%),
    radial-gradient(circle at 50% 50%, rgba(100, 50, 255, 0.04) 0%, transparent 40%);
  pointer-events: none;
  z-index: 0;
}

/* Scanline effect for AAA feel */
body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.03) 2px,
    rgba(0, 0, 0, 0.03) 4px
  );
  pointer-events: none;
  z-index: 1000;
}

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

/* Floating orbs for depth - more subtle */
.orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.25;
  pointer-events: none;
  z-index: 0;
}

.orb-1 {
  width: 500px;
  height: 500px;
  background: linear-gradient(135deg, rgba(0, 150, 255, 0.4), rgba(100, 50, 255, 0.2));
  top: -200px;
  left: -200px;
  animation: float1 15s ease-in-out infinite;
}

.orb-2 {
  width: 400px;
  height: 400px;
  background: linear-gradient(135deg, rgba(255, 50, 150, 0.3), rgba(255, 100, 50, 0.2));
  bottom: -5%;
  right: -150px;
  animation: float2 18s ease-in-out infinite;
}

.orb-3 {
  width: 250px;
  height: 250px;
  background: linear-gradient(135deg, rgba(0, 255, 200, 0.25), rgba(0, 200, 255, 0.15));
  top: 45%;
  left: 3%;
  animation: float3 20s ease-in-out infinite;
}

.orb-4 {
  width: 300px;
  height: 250px;
  background: linear-gradient(135deg, rgba(255, 200, 100, 0.2), rgba(255, 100, 150, 0.15));
  top: 20%;
  right: 10%;
  animation: float4 14s ease-in-out infinite;
}

@keyframes float1 {
  0%, 100% { transform: translate(0, 0) scale(1) rotate(0deg); }
  33% { transform: translate(40px, 30px) scale(1.1) rotate(5deg); }
  66% { transform: translate(-20px, 50px) scale(0.95) rotate(-3deg); }
}

@keyframes float2 {
  0%, 100% { transform: translate(0, 0) scale(1) rotate(0deg); }
  50% { transform: translate(-40px, -60px) scale(0.9) rotate(-5deg); }
}

@keyframes float3 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(60px, -30px) scale(1.1); }
}

@keyframes float4 {
  0%, 100% { transform: translate(0, 0) scale(1) rotate(0deg); }
  50% { transform: translate(-30px, 40px) scale(1.05) rotate(3deg); }
}

/* Header with glass effect */
.header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 12px 0;
  padding: 12px 25px;
  background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.05) 100%);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.15);
  z-index: 10;
  position: relative;
}

.header-logo {
  font-size: 2rem;
  animation: carBounce 2s ease-in-out infinite;
}

@keyframes carBounce {
  0%, 100% { transform: translateY(0) rotate(-5deg); }
  50% { transform: translateY(-3px) rotate(5deg); }
}

h1 {
  text-align: center;
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #fff 0%, rgba(255,255,255,0.9) 50%, #64c8ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.sound-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.1);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.sound-btn:hover {
  background: rgba(255,255,255,0.2);
}

.sound-btn.muted {
  opacity: 0.5;
}

.game-container {
  position: relative;
  width: 95%;
  max-width: 480px;
  height: 68vh;
  overflow: hidden;
  border-radius: 30px;
  z-index: 10;
  
  /* Premium Glass Effect */
  background: linear-gradient(
    145deg,
    rgba(20, 20, 35, 0.95) 0%,
    rgba(15, 15, 25, 0.98) 50%,
    rgba(10, 10, 20, 0.99) 100%
  );
  backdrop-filter: blur(30px) saturate(200%);
  -webkit-backdrop-filter: blur(30px) saturate(200%);
  
  /* Neon glow border */
  border: 2px solid transparent;
  background-clip: padding-box;
  box-shadow: 
    0 0 0 2px rgba(0, 200, 255, 0.3),
    0 10px 40px rgba(0, 0, 0, 0.5),
    0 0 80px rgba(0, 150, 255, 0.15),
    0 0 120px rgba(100, 50, 255, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.game-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.05) 0%,
    transparent 100%
  );
  border-radius: 30px 30px 0 0;
  pointer-events: none;
  z-index: 5;
}

/* Corner accent lights */
.game-container::after {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  border-radius: 32px;
  background: linear-gradient(
    135deg,
    rgba(0, 255, 200, 0.4) 0%,
    transparent 20%,
    transparent 80%,
    rgba(255, 0, 150, 0.3) 100%
  );
  z-index: -1;
  animation: borderGlow 4s ease-in-out infinite alternate;
}

@keyframes borderGlow {
  0% { opacity: 0.5; }
  100% { opacity: 1; }
}

#gameCanvas {
  background: transparent;
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 30px;
}

/* Premium Glass UI Elements */
.glass-panel {
  background: linear-gradient(
    145deg,
    rgba(20, 15, 35, 0.85) 0%,
    rgba(15, 10, 30, 0.9) 100%
  );
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  border: 1px solid rgba(100, 200, 255, 0.15);
  border-radius: 16px;
  box-shadow: 
    0 0 15px rgba(100, 200, 255, 0.08),
    0 4px 20px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.score-container {
  position: absolute;
  top: 12px;
  left: 12px;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 10px 16px;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 8px;
  color: rgba(255, 255, 255, 0.9);
  text-shadow: 0 0 10px rgba(0, 200, 255, 0.3);
}

.score-container .icon {
  font-size: 1rem;
  filter: drop-shadow(0 0 6px rgba(0, 200, 255, 0.5));
}

.top-score {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 10px 16px;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 8px;
  color: rgba(255, 215, 0, 0.9);
  text-shadow: 0 0 10px rgba(255, 200, 0, 0.3);
  border-color: rgba(255, 200, 0, 0.2);
}

.top-score .icon {
  font-size: 1rem;
  animation: crownPulse 2s ease-in-out infinite;
  filter: drop-shadow(0 0 8px rgba(255, 200, 0, 0.6));
}

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

/* Stats panel */
.stats-panel {
  position: absolute;
  bottom: 12px;
  left: 12px;
  right: 12px;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 10px 14px;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-color: rgba(100, 200, 255, 0.1);
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 5px;
}

.stat-item .stat-icon {
  font-size: 0.9rem;
  filter: drop-shadow(0 0 4px rgba(100, 200, 255, 0.4));
}

.stat-value {
  font-weight: 700;
  background: linear-gradient(135deg, #00d4ff, #64ff8a);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Coin counter */
.coins-display {
  position: absolute;
  top: 55px;
  left: 12px;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 8px 14px;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(145deg, rgba(40, 30, 10, 0.8) 0%, rgba(30, 25, 10, 0.85) 100%);
  border: 1px solid rgba(255, 200, 0, 0.3);
  box-shadow: 
    0 0 15px rgba(255, 200, 0, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.coins-display .coin-icon {
  font-size: 1rem;
  animation: coinSpin 3s linear infinite;
  filter: drop-shadow(0 0 8px rgba(255, 200, 0, 0.6));
}

@keyframes coinSpin {
  0% { transform: rotateY(0deg); }
  100% { transform: rotateY(360deg); }
}

/* Combo display */
.combo-display {
  position: absolute;
  top: 55px;
  right: 12px;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 8px 14px;
  z-index: 10;
  display: none;
  align-items: center;
  gap: 6px;
  background: linear-gradient(145deg, rgba(60, 20, 30, 0.85) 0%, rgba(40, 15, 25, 0.9) 100%);
  border: 1px solid rgba(255, 100, 150, 0.4);
  box-shadow: 0 0 15px rgba(255, 100, 150, 0.2);
  animation: comboGlow 0.5s ease-in-out infinite alternate;
}

.combo-display.active {
  display: flex;
}

@keyframes comboGlow {
  from { box-shadow: 0 0 15px rgba(255, 100, 150, 0.3); }
  to { box-shadow: 0 0 25px rgba(255, 100, 150, 0.5), 0 0 40px rgba(255, 50, 100, 0.2); }
}

/* Nitro Bar */
.nitro-bar-container {
  position: absolute;
  top: 140px;
  left: 12px;
  right: 12px;
  padding: 8px 12px;
  z-index: 10;
  display: none;
  flex-direction: column;
  gap: 4px;
  background: linear-gradient(145deg, rgba(30, 20, 10, 0.85) 0%, rgba(20, 15, 10, 0.9) 100%);
  border: 1px solid rgba(255, 150, 50, 0.3);
  box-shadow: 0 0 15px rgba(255, 150, 50, 0.15);
}

.nitro-bar-container.active {
  display: flex;
}

.nitro-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: rgba(255, 200, 100, 0.9);
}

.nitro-icon {
  animation: flameFlicker 0.15s ease-in-out infinite alternate;
}

@keyframes flameFlicker {
  0% { transform: scale(1) rotate(-2deg); opacity: 0.9; }
  100% { transform: scale(1.1) rotate(2deg); opacity: 1; }
}

.nitro-bar {
  width: 100%;
  height: 8px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid rgba(255, 150, 50, 0.2);
}

.nitro-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #ff4000, #ff8000, #ffcc00, #fff);
  border-radius: 4px;
  box-shadow: 0 0 10px rgba(255, 150, 50, 0.6), 0 0 20px rgba(255, 100, 0, 0.4);
  transition: width 0.1s linear;
  position: relative;
}

.nitro-fill::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 30px;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6));
  animation: nitroShine 0.5s ease-in-out infinite;
}

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

/* Power-up indicator */
.powerup-indicator {
  position: absolute;
  top: 100px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 8px 20px;
  z-index: 10;
  display: none;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, rgba(100, 255, 200, 0.3) 0%, rgba(50, 200, 150, 0.2) 100%);
  border: 1px solid rgba(100, 255, 200, 0.5);
  border-radius: 25px;
  animation: powerupPulse 1s ease-in-out infinite;
}

.powerup-indicator.active {
  display: flex;
}

@keyframes powerupPulse {
  0%, 100% { transform: translateX(-50%) scale(1); opacity: 1; }
  50% { transform: translateX(-50%) scale(1.05); opacity: 0.9; }
}

.controls {
  display: flex;
  justify-content: space-between;
  width: 100%;
  max-width: 480px;
  margin-top: 18px;
  padding: 0 15px;
  align-items: center;
  z-index: 10;
  position: relative;
}

.control-btn {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  color: white;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  
  /* Neon Glass Button */
  background: linear-gradient(
    145deg,
    rgba(30, 30, 50, 0.9) 0%,
    rgba(20, 20, 40, 0.95) 100%
  );
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  border: 2px solid rgba(0, 200, 255, 0.3);
  box-shadow: 
    0 0 15px rgba(0, 200, 255, 0.2),
    0 0 30px rgba(0, 200, 255, 0.1),
    0 8px 25px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    inset 0 -2px 10px rgba(0, 200, 255, 0.1);
  
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.control-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.1) 0%,
    transparent 100%
  );
  border-radius: 50% 50% 0 0;
  pointer-events: none;
}

.control-btn::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: radial-gradient(circle, rgba(255,255,255,0.4) 0%, transparent 70%);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.3s, height 0.3s;
}

.control-btn:active {
  transform: scale(0.9);
  border-color: rgba(0, 255, 200, 0.6);
  box-shadow: 
    0 0 20px rgba(0, 255, 200, 0.4),
    0 0 40px rgba(0, 255, 200, 0.2),
    0 4px 20px rgba(0, 0, 0, 0.3),
    inset 0 0 20px rgba(0, 255, 200, 0.2);
}

.control-btn:active::after {
  width: 120%;
  height: 120%;
}

.control-btn i {
  position: relative;
  z-index: 2;
  filter: drop-shadow(0 0 8px rgba(0, 200, 255, 0.5)) drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

#playPauseBtn {
  width: 80px;
  height: 80px;
  font-size: 1.8rem;
  background: linear-gradient(
    145deg,
    rgba(40, 20, 60, 0.95) 0%,
    rgba(30, 15, 50, 0.98) 100%
  );
  border: 2px solid rgba(200, 100, 255, 0.4);
  box-shadow: 
    0 0 20px rgba(200, 100, 255, 0.3),
    0 0 40px rgba(200, 100, 255, 0.15),
    0 8px 25px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    inset 0 -2px 10px rgba(200, 100, 255, 0.15);
  animation: playBtnGlow 3s ease-in-out infinite;
}

@keyframes playBtnGlow {
  0%, 100% { 
    box-shadow: 
      0 0 20px rgba(200, 100, 255, 0.3),
      0 0 40px rgba(200, 100, 255, 0.15),
      0 8px 25px rgba(0, 0, 0, 0.4),
      inset 0 1px 0 rgba(255, 255, 255, 0.1);
    border-color: rgba(200, 100, 255, 0.4);
  }
  50% { 
    box-shadow: 
      0 0 30px rgba(100, 200, 255, 0.4),
      0 0 60px rgba(100, 200, 255, 0.2),
      0 8px 30px rgba(0, 0, 0, 0.5),
      inset 0 1px 0 rgba(255, 255, 255, 0.15);
    border-color: rgba(100, 200, 255, 0.5);
  }
}

/* Pause overlay */
.pause-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 80;
  border-radius: 35px;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
}

.pause-overlay.active {
  display: flex;
}

.pause-content {
  text-align: center;
}

.pause-content i {
  font-size: 4rem;
  opacity: 0.8;
  margin-bottom: 10px;
}

.pause-content p {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 3px;
}

.pause-content span {
  font-size: 0.85rem;
  opacity: 0.6;
}

.game-over {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 100;
  border-radius: 30px;
  
  /* Premium dark glass overlay */
  background: linear-gradient(
    135deg,
    rgba(5, 5, 15, 0.9) 0%,
    rgba(20, 10, 40, 0.92) 50%,
    rgba(10, 5, 25, 0.95) 100%
  );
  backdrop-filter: blur(50px) saturate(180%);
  -webkit-backdrop-filter: blur(50px) saturate(180%);
}

.game-over::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(circle at 30% 20%, rgba(255, 50, 100, 0.1) 0%, transparent 40%),
    radial-gradient(circle at 70% 80%, rgba(100, 50, 255, 0.1) 0%, transparent 40%);
  pointer-events: none;
  border-radius: 30px;
}

.game-over-content {
  text-align: center;
  padding: 40px 45px;
  border-radius: 25px;
  background: linear-gradient(
    145deg,
    rgba(30, 20, 50, 0.9) 0%,
    rgba(20, 15, 40, 0.95) 100%
  );
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border: 2px solid rgba(200, 100, 255, 0.2);
  box-shadow: 
    0 0 30px rgba(200, 100, 255, 0.15),
    0 0 60px rgba(100, 50, 255, 0.1),
    0 25px 80px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  animation: slideUp 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  max-width: 90%;
  position: relative;
}

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

.game-over h2 {
  font-size: 2.2rem;
  margin-bottom: 8px;
  font-weight: 800;
  background: linear-gradient(135deg, #ff4080, #ff8040, #ffcc00, #ff4080);
  background-size: 300% 300%;
  animation: gradientText 3s ease infinite;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 0 40px rgba(255, 100, 100, 0.3);
}

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

.game-over .stats-summary {
  display: flex;
  justify-content: center;
  gap: 25px;
  margin: 20px 0;
  padding: 18px;
  background: linear-gradient(145deg, rgba(0, 0, 0, 0.4) 0%, rgba(20, 10, 30, 0.5) 100%);
  border-radius: 15px;
  border: 1px solid rgba(100, 200, 255, 0.1);
}

.stats-summary .stat {
  text-align: center;
}

.stats-summary .stat-label {
  font-size: 0.7rem;
  opacity: 0.7;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, 0.6);
}

.stats-summary .stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, #00d4ff, #00ff88);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 8px rgba(0, 200, 255, 0.3));
}

.game-over p {
  font-size: 1.1rem;
  margin-bottom: 20px;
  font-weight: 500;
  opacity: 0.9;
}

.game-over-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.restart-btn, .reset-btn {
  border: none;
  padding: 16px 36px;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 50px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.restart-btn {
  background: linear-gradient(
    135deg,
    rgba(0, 200, 255, 0.3) 0%,
    rgba(100, 50, 255, 0.3) 100%
  );
  color: white;
  border: 2px solid rgba(0, 200, 255, 0.4);
  box-shadow: 
    0 0 20px rgba(0, 200, 255, 0.2),
    0 0 40px rgba(100, 50, 255, 0.1),
    0 8px 25px rgba(0, 0, 0, 0.3);
}

.restart-btn:hover, .restart-btn:active {
  transform: translateY(-2px) scale(1.02);
  border-color: rgba(0, 255, 200, 0.6);
  box-shadow: 
    0 0 30px rgba(0, 255, 200, 0.3),
    0 0 60px rgba(100, 50, 255, 0.2),
    0 12px 35px rgba(0, 0, 0, 0.4);
}

.reset-btn {
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.1) 0%,
    rgba(255, 255, 255, 0.05) 100%
  );
  color: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  font-size: 0.85rem;
  padding: 10px 24px;
}

.reset-btn:hover, .reset-btn:active {
  transform: translateY(-2px);
  background: linear-gradient(135deg, rgba(255, 100, 100, 0.3) 0%, rgba(255, 80, 80, 0.2) 100%);
  border-color: rgba(255, 100, 100, 0.4);
}

.new-record {
  display: none;
  font-size: 1rem;
  color: #ffd700;
  margin-bottom: 10px;
  animation: recordBounce 0.8s ease infinite;
  text-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}

.new-record.active {
  display: block;
}

@keyframes recordBounce {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-8px) scale(1.05); }
}

/* Countdown overlay */
.countdown-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 90;
  border-radius: 35px;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
}

.countdown-overlay.active {
  display: flex;
}

.countdown-number {
  font-size: 6rem;
  font-weight: 700;
  color: white;
  text-shadow: 0 0 40px rgba(100, 200, 255, 0.8);
  animation: countdownPop 1s ease-out;
}

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

@media (max-width: 500px) {
  .header {
    padding: 10px 20px;
    margin: 8px 0;
  }
  h1 {
    font-size: 1.5rem;
  }
  .header-logo {
    font-size: 1.6rem;
  }
  .controls {
    margin-top: 12px;
    padding: 0 10px;
  }
  .control-btn {
    width: 62px;
    height: 62px;
    font-size: 1.4rem;
  }
  #playPauseBtn {
    width: 70px;
    height: 70px;
  }
  .game-container {
    height: 60vh;
    border-radius: 28px;
  }
  .game-over-content {
    padding: 25px 30px;
    margin: 0 15px;
  }
  .game-over h2 {
    font-size: 1.6rem;
  }
  .stats-summary {
    gap: 15px;
  }
}

.footer {
  text-align: center;
  margin-top: 12px;
  margin-bottom: 8px;
  max-width: 480px;
  padding: 8px 20px;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.5);
  z-index: 10;
  position: relative;
  background: linear-gradient(135deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.02) 100%);
  border-radius: 15px;
  backdrop-filter: blur(10px);
}

.footer a {
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
}

/* Toast notifications */
.toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(-100px);
  padding: 12px 25px;
  background: linear-gradient(135deg, rgba(100, 255, 150, 0.3) 0%, rgba(50, 200, 100, 0.2) 100%);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(100, 255, 150, 0.4);
  border-radius: 50px;
  font-size: 0.9rem;
  font-weight: 600;
  z-index: 1000;
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: flex;
  align-items: center;
  gap: 8px;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
}

.toast.warning {
  background: linear-gradient(135deg, rgba(255, 200, 100, 0.3) 0%, rgba(255, 150, 50, 0.2) 100%);
  border-color: rgba(255, 200, 100, 0.4);
}

/* Shield effect on car */
.shield-active {
  animation: shieldGlow 0.5s ease-in-out infinite alternate;
}

@keyframes shieldGlow {
  from { filter: drop-shadow(0 0 10px rgba(100, 255, 200, 0.5)); }
  to { filter: drop-shadow(0 0 20px rgba(100, 255, 200, 0.8)); }
}

/* Additional enhancements */

/* Screen shake animation for crashes */
@keyframes screenShake {
  0%, 100% { transform: translateX(0); }
  10% { transform: translateX(-10px) rotate(-1deg); }
  20% { transform: translateX(10px) rotate(1deg); }
  30% { transform: translateX(-10px) rotate(-1deg); }
  40% { transform: translateX(10px) rotate(1deg); }
  50% { transform: translateX(-5px); }
  60% { transform: translateX(5px); }
  70% { transform: translateX(-2px); }
  80% { transform: translateX(2px); }
  90% { transform: translateX(-1px); }
}

.game-container.shake {
  animation: screenShake 0.5s ease-in-out;
}

/* Magnet power-up pulse effect */
.magnet-active {
  animation: magnetPulse 0.8s ease-in-out infinite;
}

@keyframes magnetPulse {
  0%, 100% { box-shadow: 0 0 20px rgba(255, 100, 200, 0.3); }
  50% { box-shadow: 0 0 40px rgba(255, 100, 200, 0.6); }
}

/* Slow-mo effect */
.slow-mo-active {
  animation: slowMoEffect 2s ease-in-out infinite;
}

@keyframes slowMoEffect {
  0%, 100% { filter: hue-rotate(0deg) saturate(1); }
  50% { filter: hue-rotate(20deg) saturate(1.2); }
}

/* Double points golden glow */
.double-points-active {
  animation: goldenGlow 1s ease-in-out infinite alternate;
}

@keyframes goldenGlow {
  from { box-shadow: 0 0 20px rgba(255, 215, 0, 0.2); }
  to { box-shadow: 0 0 40px rgba(255, 215, 0, 0.5); }
}

/* Score popup animation */
.score-popup {
  position: absolute;
  font-size: 1.2rem;
  font-weight: 700;
  color: #ffd700;
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
  pointer-events: none;
  animation: scoreFloat 1s ease-out forwards;
  z-index: 50;
}

@keyframes scoreFloat {
  0% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(-50px) scale(1.5);
  }
}

/* Better mobile touch feedback */
.control-btn:active {
  transform: scale(0.85);
  transition: transform 0.1s ease;
}

/* Loading animation */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.loading-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(100, 200, 255, 0.8);
  animation: loadingBounce 1.4s ease-in-out infinite;
}

.loading-dot:nth-child(1) { animation-delay: 0s; }
.loading-dot:nth-child(2) { animation-delay: 0.2s; }
.loading-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes loadingBounce {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.5; }
  40% { transform: scale(1); opacity: 1; }
}

/* Landscape mode warning */
@media (max-height: 500px) and (orientation: landscape) {
  .game-container {
    height: 85vh;
  }
  
  .header {
    padding: 6px 15px;
    margin: 4px 0;
  }
  
  h1 {
    font-size: 1.2rem;
  }
  
  .controls {
    margin-top: 8px;
  }
  
  .control-btn {
    width: 55px;
    height: 55px;
    font-size: 1.2rem;
  }
  
  #playPauseBtn {
    width: 60px;
    height: 60px;
  }
  
  .footer {
    display: none;
  }
}

/* Very small screens */
@media (max-width: 360px) {
  .header {
    padding: 8px 12px;
    gap: 8px;
  }
  
  h1 {
    font-size: 1.2rem;
  }
  
  .control-btn {
    width: 55px;
    height: 55px;
    font-size: 1.2rem;
  }
  
  #playPauseBtn {
    width: 62px;
    height: 62px;
    font-size: 1.4rem;
  }
  
  .game-over-content {
    padding: 20px 15px;
  }
  
  .game-over h2 {
    font-size: 1.4rem;
  }
  
  .stats-summary {
    gap: 10px;
    padding: 10px;
  }
  
  .stats-summary .stat-value {
    font-size: 1.1rem;
  }
}

/* High contrast mode for accessibility */
@media (prefers-contrast: high) {
  .glass-panel {
    border-width: 2px;
    border-color: rgba(255, 255, 255, 0.5);
  }
  
  .control-btn {
    border-width: 2px;
    border-color: rgba(255, 255, 255, 0.5);
  }
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .orb {
    animation: none;
  }
  
  body {
    animation: none;
  }
}

/* Touch device optimizations */
@media (hover: none) {
  .control-btn:hover {
    transform: none;
    box-shadow: inherit;
  }
  
  .restart-btn:hover,
  .reset-btn:hover {
    transform: none;
  }
}
