* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: #000;
  overflow: hidden;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

#game-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

#gameCanvas {
  display: block;
  background: #0a0a15;
}

.hidden {
  display: none !important;
}

/* Screens */
.screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  background: rgba(0, 0, 0, 0.85);
  z-index: 100;
}

.menu-content {
  text-align: center;
  color: #fff;
  max-width: 400px;
  padding: 20px;
}

.game-title {
  font-size: 4rem;
  font-weight: bold;
  letter-spacing: 0.3em;
  color: #fff;
  text-shadow: 
    0 0 10px #00ffff,
    0 0 20px #00ffff,
    0 0 40px #00ffff;
  margin-bottom: 0;
  animation: pulse-glow 2s ease-in-out infinite;
}

.game-subtitle {
  font-size: 1.5rem;
  color: #ffd700;
  letter-spacing: 0.2em;
  margin-bottom: 40px;
  text-shadow: 0 0 10px #ffd700;
}

@keyframes pulse-glow {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.8; }
}

.menu-button {
  display: block;
  width: 100%;
  max-width: 250px;
  margin: 10px auto;
  padding: 15px 30px;
  font-size: 1.2rem;
  font-weight: bold;
  letter-spacing: 0.1em;
  color: #fff;
  background: linear-gradient(135deg, #00aaff, #0066cc);
  border: 2px solid #00ffff;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-transform: uppercase;
}

.menu-button:hover {
  background: linear-gradient(135deg, #00ccff, #0088ff);
  box-shadow: 0 0 20px rgba(0, 170, 255, 0.5);
  transform: scale(1.05);
}

.menu-button:active {
  transform: scale(0.98);
}

.menu-button.secondary {
  background: transparent;
  border-color: #666;
  color: #999;
}

.menu-button.secondary:hover {
  border-color: #00ffff;
  color: #fff;
  background: rgba(0, 170, 255, 0.1);
}

.instructions {
  margin-top: 30px;
  color: #888;
  font-size: 0.9rem;
  line-height: 1.8;
}

.instructions p {
  margin: 5px 0;
}

/* HUD */
#hud {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  padding: 15px 20px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  color: #fff;
  font-size: 1.1rem;
  font-weight: bold;
  letter-spacing: 0.05em;
  z-index: 50;
  pointer-events: none;
}

.hud-left, .hud-right {
  text-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
}

.score, .level {
  margin-bottom: 5px;
}

.lives {
  display: flex;
  gap: 8px;
}

.life-icon {
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-bottom: 16px solid #00ffff;
  filter: drop-shadow(0 0 5px #00ffff);
}

/* Overlays */
.overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  background: rgba(0, 0, 0, 0.7);
  z-index: 80;
}

.overlay-content {
  text-align: center;
  color: #fff;
  animation: fade-in 0.3s ease;
}

@keyframes fade-in {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

.overlay-content h2 {
  font-size: 2.5rem;
  letter-spacing: 0.1em;
  margin-bottom: 10px;
  color: #00ffff;
  text-shadow: 0 0 20px #00ffff;
}

.overlay-content p {
  color: #aaa;
}

/* Prize Reveal */
.prize-content {
  position: relative;
}

.prize-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 300px;
  height: 300px;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(255, 215, 0, 0.4) 0%, transparent 70%);
  animation: prize-pulse 1s ease-in-out infinite;
  pointer-events: none;
}

@keyframes prize-pulse {
  0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
  50% { transform: translate(-50%, -50%) scale(1.3); opacity: 0.5; }
}

.prize-tier {
  font-size: 1.5rem;
  font-weight: bold;
  margin: 20px 0;
  padding: 10px 30px;
  border-radius: 20px;
  display: inline-block;
}

.prize-tier.common { background: #808080; color: #fff; }
.prize-tier.uncommon { background: #4CAF50; color: #fff; }
.prize-tier.rare { background: #2196F3; color: #fff; }
.prize-tier.epic { background: #9C27B0; color: #fff; }
.prize-tier.legendary { 
  background: linear-gradient(135deg, #ffd700, #ff8c00);
  color: #000;
  animation: legendary-glow 0.5s ease-in-out infinite alternate;
}

@keyframes legendary-glow {
  from { box-shadow: 0 0 20px #ffd700; }
  to { box-shadow: 0 0 40px #ff8c00; }
}

.prize-value {
  font-size: 3rem;
  font-weight: bold;
  color: #ffd700;
  text-shadow: 0 0 20px #ffd700;
  margin: 20px 0;
}

/* Final Score */
.final-score {
  margin: 20px 0;
  padding: 20px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
}

.final-score p {
  margin: 10px 0;
  font-size: 1.2rem;
  color: #ccc;
}

.final-score span {
  color: #00ffff;
  font-weight: bold;
}

/* Rewards Container */
#rewards-container {
  margin: 20px 0;
  padding: 15px;
  background: rgba(255, 215, 0, 0.1);
  border: 1px solid #ffd700;
  border-radius: 10px;
}

#rewards-container h3 {
  color: #ffd700;
  margin-bottom: 10px;
}

#rewards-list {
  color: #fff;
}

.reward-item {
  padding: 8px;
  margin: 5px 0;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 5px;
}

/* Mobile Controls */
#mobile-controls {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 40%;
  pointer-events: none;
  z-index: 60;
}

.control-zone {
  position: absolute;
  bottom: 20px;
  width: 150px;
  height: 150px;
  pointer-events: auto;
}

.control-zone.left {
  left: 20px;
}

.control-zone.right {
  right: 20px;
}

.joystick-base {
  position: relative;
  width: 120px;
  height: 120px;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(0, 255, 255, 0.5);
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.joystick-stick {
  width: 50px;
  height: 50px;
  background: radial-gradient(circle, #00ffff, #0088aa);
  border-radius: 50%;
  box-shadow: 0 0 15px rgba(0, 255, 255, 0.5);
  transition: transform 0.05s ease-out;
}

.fire-button {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: radial-gradient(circle, #ff4444, #aa0000);
  border: 3px solid #ff6666;
  color: #fff;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 0 20px rgba(255, 68, 68, 0.5);
  transition: transform 0.1s ease;
}

.fire-button:active {
  transform: scale(0.9);
  background: radial-gradient(circle, #ff6666, #cc2222);
}

/* Responsive */
@media (max-width: 600px) {
  .game-title {
    font-size: 2.5rem;
    letter-spacing: 0.1em;
  }
  
  .game-subtitle {
    font-size: 1rem;
  }
  
  .menu-button {
    font-size: 1rem;
    padding: 12px 20px;
  }
  
  .instructions {
    font-size: 0.8rem;
  }
  
  #hud {
    font-size: 0.9rem;
    padding: 10px 15px;
  }
}
