/* HYPERNOVA: Void Vanguard - Style Sheet */

:root {
  --bg-dark: #070913;
  --bg-panel: rgba(14, 20, 36, 0.85);
  --primary-cyan: #00f0ff;
  --primary-magenta: #ff007f;
  --primary-yellow: #ffe600;
  --primary-orange: #ff6600;
  --primary-green: #00ff66;
  --primary-purple: #9d4edd;
  --primary-red: #ff3344;
  --text-main: #f0f4fc;
  --text-muted: #8c9cb8;
  --border-glow: rgba(0, 240, 255, 0.4);
  --font-display: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-dark);
  font-family: var(--font-display);
  color: var(--text-main);
}

#game-container {
  position: relative;
  width: 100vw;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  background: radial-gradient(circle at center, #11172e 0%, #060914 100%);
}

#game-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: block;
  cursor: crosshair;
  z-index: 1;
}

/* Glassmorphism HUD Overlay */
#hud-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 16px 24px;
}

.hud-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  width: 100%;
}

.hud-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hud-panel {
  background: var(--bg-panel);
  border: 1px solid rgba(0, 240, 255, 0.25);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 0 0 15px rgba(0, 240, 255, 0.15);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 10px;
  padding: 10px 16px;
  pointer-events: auto;
}

/* Health & Shield Bars */
.status-bar-container {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 220px;
}

.bar-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.bar-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  width: 52px;
  text-transform: uppercase;
  font-family: var(--font-mono);
}

.bar-label.hull { color: #ff3366; }
.bar-label.shield { color: #00f0ff; }
.bar-label.energy { color: #ffe600; }

.progress-track {
  flex: 1;
  height: 10px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 5px;
  overflow: hidden;
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.progress-fill {
  height: 100%;
  width: 100%;
  transition: width 0.15s ease-out;
  border-radius: 4px;
}

.progress-fill.hull-fill {
  background: linear-gradient(90deg, #ff0055, #ff5500);
  box-shadow: 0 0 10px rgba(255, 0, 85, 0.6);
}

.progress-fill.shield-fill {
  background: linear-gradient(90deg, #0099ff, #00f0ff);
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.6);
}

.progress-fill.supernova-fill {
  background: linear-gradient(90deg, #9d4edd, #ff007f, #ffe600);
  box-shadow: 0 0 12px rgba(255, 0, 127, 0.8);
}

/* Center Score & Multiplier */
.score-panel {
  text-align: center;
  padding: 8px 24px;
  background: var(--bg-panel);
  border: 1px solid rgba(255, 230, 0, 0.3);
  box-shadow: 0 0 20px rgba(255, 230, 0, 0.15);
  border-radius: 12px;
}

.score-title {
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 2px;
  font-family: var(--font-mono);
  text-transform: uppercase;
}

.score-value {
  font-size: 28px;
  font-weight: 800;
  color: #fff;
  font-family: var(--font-mono);
  text-shadow: 0 0 12px rgba(0, 240, 255, 0.8);
}

.wave-badge {
  display: inline-block;
  background: rgba(255, 0, 127, 0.2);
  border: 1px solid rgba(255, 0, 127, 0.5);
  color: #ff3399;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  margin-top: 2px;
  letter-spacing: 1px;
}

.multiplier-tag {
  color: #ffe600;
  font-weight: 800;
  font-size: 13px;
  margin-left: 6px;
}

/* Top Right Buttons & Stats */
.hud-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.hud-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--text-main);
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-family: var(--font-display);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  pointer-events: auto;
}

.hud-btn:hover {
  background: rgba(0, 240, 255, 0.2);
  border-color: var(--primary-cyan);
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.4);
  transform: translateY(-1px);
}

.hud-btn:active {
  transform: translateY(1px);
}

/* Bottom Ammo & Weapon Bay */
.hud-bottom {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  width: 100%;
}

.weapon-panel {
  display: flex;
  gap: 16px;
  align-items: center;
}

.weapon-slot {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 160px;
}

.weapon-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.weapon-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--primary-cyan);
  letter-spacing: 0.5px;
}

.ammo-count {
  font-size: 12px;
  font-family: var(--font-mono);
  font-weight: 700;
  color: #fff;
}

.ammo-bars {
  display: flex;
  gap: 4px;
  height: 8px;
}

.ammo-pip {
  flex: 1;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  transition: background 0.1s ease;
}

.ammo-pip.active {
  background: var(--primary-cyan);
  box-shadow: 0 0 6px var(--primary-cyan);
}

.ammo-pip.missile-active {
  background: #ff0055;
  box-shadow: 0 0 6px #ff0055;
}

.ammo-pip.recharging {
  background: rgba(255, 230, 0, 0.4);
  animation: pulse-ammo 0.6s infinite alternate;
}

@keyframes pulse-ammo {
  0% { opacity: 0.3; }
  100% { opacity: 0.9; }
}

.supernova-slot {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 140px;
}

/* Center Wave Banner & Notifications */
#wave-alert {
  position: absolute;
  top: 25%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.8);
  opacity: 0;
  pointer-events: none;
  text-align: center;
  z-index: 15;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#wave-alert.active {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.wave-title {
  font-size: 42px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 4px;
  color: #fff;
  text-shadow: 0 0 20px rgba(0, 240, 255, 0.9), 0 0 40px rgba(255, 0, 127, 0.6);
}

.wave-subtitle {
  font-size: 16px;
  font-family: var(--font-mono);
  color: var(--primary-yellow);
  letter-spacing: 2px;
  margin-top: 4px;
}

/* Modals & Overlays */
.game-modal {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(5, 8, 18, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 50;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.game-modal.visible {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background: #0d1326;
  border: 2px solid rgba(0, 240, 255, 0.4);
  border-radius: 16px;
  box-shadow: 0 0 40px rgba(0, 240, 255, 0.25), 0 20px 50px rgba(0, 0, 0, 0.8);
  padding: 36px 40px;
  max-width: 520px;
  width: 90%;
  text-align: center;
  transform: scale(0.95);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.game-modal.visible .modal-content {
  transform: scale(1);
}

.modal-logo {
  font-size: 38px;
  font-weight: 900;
  letter-spacing: 3px;
  background: linear-gradient(135deg, #00f0ff 0%, #ff007f 50%, #ffe600 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 6px;
}

.modal-tagline {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 24px;
}

.modal-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 28px;
  background: rgba(255, 255, 255, 0.03);
  padding: 16px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.stat-item {
  display: flex;
  flex-direction: column;
}

.stat-label {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-muted);
  text-transform: uppercase;
}

.stat-val {
  font-size: 20px;
  font-weight: 700;
  font-family: var(--font-mono);
  color: #fff;
}

.stat-val.highlight {
  color: var(--primary-cyan);
}

.btn-primary-glow {
  background: linear-gradient(135deg, #00f0ff 0%, #0077ff 100%);
  color: #050a18;
  font-weight: 800;
  font-size: 16px;
  border: none;
  border-radius: 30px;
  padding: 14px 36px;
  cursor: pointer;
  letter-spacing: 1px;
  box-shadow: 0 0 25px rgba(0, 240, 255, 0.5);
  transition: all 0.2s ease;
  width: 100%;
  margin-bottom: 12px;
}

.btn-primary-glow:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 35px rgba(0, 240, 255, 0.8);
  filter: brightness(1.1);
}

.btn-secondary-glow {
  background: transparent;
  color: var(--text-main);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 30px;
  padding: 10px 24px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
}

.btn-secondary-glow:hover {
  border-color: var(--primary-cyan);
  color: var(--primary-cyan);
  background: rgba(0, 240, 255, 0.05);
}

.controls-guide-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px 16px;
  text-align: left;
  font-size: 13px;
  margin: 20px 0;
  background: rgba(0, 0, 0, 0.3);
  padding: 16px;
  border-radius: 8px;
}

.key-badge {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 4px;
  padding: 2px 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--primary-cyan);
  display: inline-block;
  min-width: 24px;
  text-align: center;
}

/* Mobile Virtual Controls */
#mobile-controls {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 20;
  display: none;
}

.joystick-zone {
  position: absolute;
  bottom: 30px;
  width: 130px;
  height: 130px;
  border-radius: 50%;
  background: rgba(0, 240, 255, 0.06);
  border: 2px dashed rgba(0, 240, 255, 0.3);
  pointer-events: auto;
  touch-action: none;
}

.joystick-zone.left { left: 24px; }
.joystick-zone.right { right: 24px; }

.joystick-thumb {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: radial-gradient(circle, #00f0ff 0%, rgba(0, 150, 255, 0.7) 100%);
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.6);
  pointer-events: none;
}

.mobile-fire-btn {
  position: absolute;
  bottom: 170px;
  right: 32px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: radial-gradient(circle, #ff0055 0%, #990033 100%);
  box-shadow: 0 0 15px rgba(255, 0, 85, 0.6);
  border: 2px solid #ff3377;
  color: #fff;
  font-weight: 800;
  font-size: 10px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  pointer-events: auto;
  touch-action: none;
}

@media (max-width: 768px) {
  #mobile-controls {
    display: block;
  }
  .hud-panel {
    padding: 6px 10px;
  }
  .status-bar-container {
    min-width: 150px;
  }
  .score-value {
    font-size: 20px;
  }
  .weapon-slot {
    min-width: 110px;
  }
}
