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

body {
  font-family: "Courier New", monospace;
  background: linear-gradient(135deg, #0a0a0a 0%, #1a1a2e 100%);
  color: #fff;
  overflow-x: hidden;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

#app {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
}

.game-header {
  text-align: center;
  margin-bottom: 20px;
}

.game-title {
  font-size: 3rem;
  color: #00ff00;
  text-shadow: 0 0 20px #00ff00, 0 0 40px #00ff00;
  letter-spacing: 5px;
  animation: glow 2s ease-in-out infinite;
}

.game-subtitle {
  color: #888;
  font-size: 0.9rem;
  margin-top: 5px;
}

@keyframes glow {
  0%,
  100% {
    text-shadow: 0 0 20px #00ff00, 0 0 40px #00ff00;
  }
  50% {
    text-shadow: 0 0 30px #00ff00, 0 0 60px #00ff00, 0 0 80px #00ff00;
  }
}

.stats-container {
  display: flex;
  gap: 30px;
  margin-bottom: 15px;
  font-size: 1.2rem;
}

.stat {
  padding: 10px 20px;
  background: rgba(0, 255, 0, 0.1);
  border: 2px solid #00ff00;
  border-radius: 5px;
}

.stat-value {
  color: #ffff00;
  font-weight: bold;
}

.health-container {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 15px;
  width: 100%;
  max-width: 800px;
}

.health-label {
  font-size: 0.9rem;
  min-width: 60px;
}

.health-bar {
  flex: 1;
  height: 16px;
  background: #333;
  border: 2px solid #00ff00;
  border-radius: 8px;
  overflow: hidden;
}

.shield-bar {
  flex: 0 0 100px;
  border-color: #00ffff;
}

.health-fill {
  height: 100%;
  background: linear-gradient(90deg, #00ff00, #00ff00);
  transition: width 0.3s;
}

.shield-fill {
  height: 100%;
  background: linear-gradient(90deg, #00ffff, #00ffff);
  transition: width 0.3s;
}

.canvas-container {
  position: relative;
  border: 4px solid #00ff00;
  border-radius: 10px;
  box-shadow: 0 0 30px rgba(0, 255, 0, 0.5);
  overflow: hidden;
}

#gameCanvas {
  display: block;
  background: #000;
}

.overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.menu-content {
  text-align: center;
  padding: 40px;
}

.menu-icon {
  font-size: 4rem;
  margin-bottom: 20px;
  animation: bounce 1s infinite;
}

@keyframes bounce {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

.menu-title {
  font-size: 2.5rem;
  margin-bottom: 20px;
  color: #00ff00;
}

.game-over {
  color: #ff0000;
  text-shadow: 0 0 20px #ff0000;
}

.menu-score,
.menu-level {
  font-size: 1.3rem;
  margin: 10px 0;
}

.menu-reward {
  font-size: 1.5rem;
  color: #ffff00;
  margin: 15px 0;
  animation: pulse 0.5s infinite;
}

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

.btn {
  padding: 15px 40px;
  font-size: 1.2rem;
  font-weight: bold;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  margin: 10px;
  font-family: "Courier New", monospace;
  transition: all 0.3s;
  text-transform: uppercase;
}

.btn-primary {
  background: #00ff00;
  color: #000;
}

.btn-primary:hover {
  background: #00ff00;
  box-shadow: 0 0 20px #00ff00;
  transform: scale(1.05);
}

.btn-secondary {
  background: #555;
  color: #fff;
}

.btn-secondary:hover {
  background: #777;
  transform: scale(1.05);
}

.control-selection {
  margin: 30px 0;
}

.control-label {
  font-size: 1rem;
  margin-bottom: 10px;
}

.control-buttons {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn-control {
  padding: 10px 20px;
  background: #333;
  color: #fff;
  border: 2px solid #555;
  border-radius: 5px;
  cursor: pointer;
  font-family: "Courier New", monospace;
  transition: all 0.3s;
}

.btn-control:hover {
  background: #444;
}

.btn-control.active {
  background: #00ffff;
  color: #000;
  border-color: #00ffff;
}

.control-info {
  margin-top: 20px;
  color: #888;
  font-size: 0.9rem;
}

.sound-toggle {
  margin: 20px 0;
}

.btn-icon {
  padding: 10px 20px;
  background: #333;
  color: #fff;
  border: 2px solid #555;
  border-radius: 5px;
  cursor: pointer;
  font-family: "Courier New", monospace;
  font-size: 1rem;
}

.btn-icon:hover {
  background: #444;
}

.highscores {
  margin-top: 30px;
  padding: 20px;
  background: rgba(0, 255, 0, 0.05);
  border: 2px solid #00ff00;
  border-radius: 10px;
  min-width: 300px;
}

.highscore-title {
  font-size: 1.3rem;
  margin-bottom: 15px;
  color: #ffff00;
}

#highscoresList {
  font-size: 0.9rem;
  color: #ccc;
}

#highscoresList div {
  padding: 5px 0;
}

.weapon-indicator {
  margin-top: 15px;
  padding: 10px 20px;
  background: rgba(255, 255, 0, 0.1);
  border: 2px solid #ffff00;
  border-radius: 5px;
  font-size: 0.9rem;
}

.weapon-timer {
  color: #888;
  margin-left: 10px;
}

.controls-footer {
  margin-top: 20px;
  text-align: center;
  color: #888;
  font-size: 0.85rem;
}

.controls-footer p {
  margin: 5px 0;
}

/* Touch Controls */
.touch-controls {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 200px;
  pointer-events: none;
}

.joystick-container {
  position: absolute;
  bottom: 20px;
  left: 20px;
  pointer-events: all;
}

.joystick {
  width: 120px;
  height: 120px;
  background: rgba(255, 255, 255, 0.1);
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  position: relative;
}

.joystick-knob {
  width: 50px;
  height: 50px;
  background: rgba(0, 255, 0, 0.7);
  border: 2px solid #00ff00;
  border-radius: 50%;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  transition: all 0.1s;
}

.shoot-button-container {
  position: absolute;
  bottom: 20px;
  right: 20px;
  pointer-events: all;
}

.shoot-button {
  width: 100px;
  height: 100px;
  background: rgba(255, 0, 0, 0.7);
  color: #fff;
  border: 3px solid #ff0000;
  border-radius: 50%;
  font-size: 1rem;
  font-weight: bold;
  font-family: "Courier New", monospace;
  cursor: pointer;
  box-shadow: 0 0 20px rgba(255, 0, 0, 0.5);
}

.shoot-button:active {
  background: rgba(255, 0, 0, 1);
  box-shadow: 0 0 30px rgba(255, 0, 0, 0.8);
}

/* Responsive */
@media (max-width: 850px) {
  #gameCanvas {
    width: 100%;
    height: auto;
  }

  .stats-container {
    flex-wrap: wrap;
    gap: 10px;
  }

  .game-title {
    font-size: 2rem;
  }
}
