body {
  margin: 0;
  padding: 0;
  overflow: hidden;
  background: #87CEEB;
  font-family: Arial, sans-serif;
}
canvas {
  display: block;
}
#timer {
  position: absolute;
  top: 10px;
  left: 10px;
  color: white;
  background: linear-gradient(135deg, rgba(0,0,0,0.7), rgba(30,30,30,0.5));
  padding: 12px 16px;
  border-radius: 10px;
  font-weight: bold;
  letter-spacing: 0.5px;
  border: 1px solid rgba(255,255,255,0.1);
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 6px rgba(0,0,0,0.3);
}
#wave {
  position: absolute;
  top: 60px;
  left: 10px;
  color: white;
  background: linear-gradient(135deg, rgba(0,50,100,0.7), rgba(0,80,160,0.5));
  padding: 12px 16px;
  border-radius: 10px;
  font-weight: bold;
  letter-spacing: 0.5px;
  border: 1px solid rgba(100,200,255,0.3);
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 6px rgba(0,0,0,0.3);
}
#shots {
  position: absolute;
  top: 110px;
  left: 10px;
  color: white;
  background: linear-gradient(135deg, rgba(100,50,0,0.7), rgba(160,80,0,0.5));
  padding: 12px 16px;
  border-radius: 10px;
  font-weight: bold;
  letter-spacing: 0.5px;
  border: 1px solid rgba(255,200,100,0.3);
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 6px rgba(0,0,0,0.3);
}
#score {
  position: absolute;
  top: 10px;
  right: 10px;
  color: white;
  background: linear-gradient(135deg, rgba(50,100,0,0.7), rgba(80,160,0,0.5));
  padding: 12px 20px;
  border-radius: 10px;
  font-weight: bold;
  font-size: 18px;
  letter-spacing: 0.8px;
  border: 1px solid rgba(200,255,100,0.3);
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 6px rgba(0,0,0,0.3);
  animation: scoreGlow 2s ease-in-out infinite;
}
@keyframes scoreGlow {
  0%, 100% { box-shadow: 0 4px 6px rgba(0,0,0,0.3); }
  50% { box-shadow: 0 4px 12px rgba(200,255,100,0.4); }
}
#combo {
  position: absolute;
  top: 50px;
  right: 10px;
  color: white;
  background: linear-gradient(135deg, rgba(255,100,0,0.6), rgba(255,200,0,0.6));
  padding: 10px 14px;
  border-radius: 5px;
  font-weight: bold;
  letter-spacing: 0.5px;
  animation: comboPulse 0.5s ease-out;
  transition: opacity 0.3s ease;
}
#combo.hidden {
  opacity: 0;
  pointer-events: none;
}
@keyframes comboPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}
#powerBar {
  position: absolute;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  width: 200px;
  height: 8px;
  background: rgba(0,0,0,0.5);
  border: 2px solid rgba(255,255,255,0.5);
  border-radius: 5px;
  overflow: hidden;
  transition: opacity 0.2s ease;
}
#powerBar.hidden {
  opacity: 0;
}
#powerFill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #4CAF50, #8BC34A, #FFEB3B, #FF9800, #f44336);
  transition: width 0.05s linear;
  box-shadow: 0 0 10px rgba(255,255,255,0.5);
}
.hit-fx {
  position: absolute;
  color: #fff;
  font-weight: bold;
  text-shadow: 0 1px 2px rgba(0,0,0,0.6);
  pointer-events: none;
  z-index: 2000;
  transition: transform 0.8s ease-out, opacity 0.8s ease-out;
}
#crosshair {
  position: absolute;
  top: 50%;
  left: 50%;
  --size: 24px;
  width: var(--size);
  height: var(--size);
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 1000;
}
#crosshair::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--size);
  height: var(--size);
  border: 2px solid rgba(255,255,255,0.9);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 10px rgba(0,0,0,0.4), inset 0 0 10px rgba(255,255,255,0.2);
}
#crosshair::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 2px;
  height: 2px;
  background: radial-gradient(circle, rgba(255,255,255,1) 0%, rgba(255,255,255,0.8) 50%, transparent 100%);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 8px rgba(255,255,255,0.8);
}
/* Crosshair lines */
#crosshair .line-h {
  position: absolute;
  top: 50%;
  left: -8px;
  right: -8px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.6) 30%, rgba(255,255,255,0.6) 70%, transparent);
  transform: translateY(-50%);
}
#crosshair .line-v {
  position: absolute;
  left: 50%;
  top: -8px;
  bottom: -8px;
  width: 1px;
  background: linear-gradient(180deg, transparent, rgba(255,255,255,0.6) 30%, rgba(255,255,255,0.6) 70%, transparent);
  transform: translateX(-50%);
}
#targetPreview {
  position: absolute;
  right: 10px;
  bottom: 10px;
  width: 160px;
  height: 160px;
  background: rgba(0,0,0,0.4);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  image-rendering: pixelated;
  z-index: 1100;
}

#overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  background: radial-gradient(ellipse at center, rgba(0,0,0,0.55), rgba(0,0,0,0.8));
  color: #fff;
  z-index: 2000;
  opacity: 1;
  transition: opacity .25s ease;
}
#overlay.hidden { opacity: 0; pointer-events: none; }
#overlay h1 {
  font-size: 56px;
  letter-spacing: 2px;
  margin: 0 0 12px 0;
  text-shadow: 0 4px 12px rgba(0,0,0,0.6);
}
#overlay p { opacity: 0.9; margin: 0; font-size: 18px; }

.wave-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  color: #fff;
  z-index: 1500;
  pointer-events: none;
  animation: waveCompleteAnimation 2.5s ease-in-out;
}

.wave-overlay.hidden {
  display: none;
}

.wave-overlay h2 {
  font-size: 52px;
  margin: 0;
  text-shadow: 0 4px 16px rgba(0,0,0,0.8), 0 0 40px rgba(255,255,255,0.5);
  letter-spacing: 3px;
  text-transform: uppercase;
  background: linear-gradient(135deg, #ffd700, #ffed4e, #fff, #ffed4e, #ffd700);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: waveTextShine 2s linear infinite;
}
@keyframes waveTextShine {
  0% { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}

.wave-overlay p {
  font-size: 20px;
  margin-top: 10px;
  opacity: 0.9;
  text-shadow: 0 2px 8px rgba(0,0,0,0.6);
}

@keyframes waveCompleteAnimation {
  0% {
    opacity: 0;
    transform: translate(-50%, -40%) scale(0.8);
  }
  20% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.1);
  }
  30% {
    transform: translate(-50%, -50%) scale(1);
  }
  80% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -55%) scale(0.95);
  }
}

/* Mobile Controls */
#mobileControls {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1000;
}

#mobileControls.hidden {
  display: none;
}

/* Look/Aim Area (entire screen on mobile) */
#lookArea {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: auto;
  z-index: -1; /* Behind fire button */
}

/* Responsive Design */
@media (max-width: 768px) {
  body {
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent; /* Remove tap highlight */
  }
  
  #overlay {
    cursor: pointer; /* Show it's tappable */
  }
  
  .desktop-controls {
    display: none !important;
  }
  
  .mobile-controls {
    display: block !important;
  }
  
  #timer, #wave, #shots {
    font-size: 14px;
    padding: 5px 10px;
  }
  
  #score {
    font-size: 20px;
    padding: 8px 16px;
  }
  
  #combo {
    font-size: 16px;
    padding: 6px 12px;
  }
  
  #overlay h1 {
    font-size: 28px;
  }
  
  #overlay p {
    font-size: 16px;
  }
  
  #crosshair {
    width: 40px;
    height: 40px;
  }
  
  #crosshair::before {
    width: 30px;
    height: 30px;
  }
  
  #crosshair::after {
    width: 6px;
    height: 6px;
  }
  
  .wave-overlay h2 {
    font-size: 36px;
  }
}

@media (min-width: 769px) {
  .mobile-controls {
    display: none !important;
  }
  
  .desktop-controls {
    display: block !important;
  }
  
  #mobileControls {
    display: none !important;
  }
}
