/* Global Styles & Reset */
:root {
  --bg-dark: hsl(230, 25%, 4%);
  --neon-blue: hsl(190, 100%, 50%);
  --neon-blue-glow: hsla(190, 100%, 50%, 0.45);
  --neon-magenta: hsl(320, 100%, 50%);
  --neon-magenta-glow: hsla(320, 100%, 50%, 0.45);
  --neon-red: hsl(0, 100%, 60%);
  --neon-red-glow: hsla(0, 100%, 60%, 0.4);
  --neon-green: hsl(120, 100%, 50%);
  --neon-green-glow: hsla(120, 100%, 50%, 0.4);
  --neon-gold: hsl(45, 100%, 50%);
  --neon-gold-glow: hsla(45, 100%, 50%, 0.4);
  
  --glass-bg: rgba(10, 10, 18, 0.65);
  --glass-border: rgba(255, 255, 255, 0.08);
  --font-family-display: 'Orbitron', sans-serif;
  --font-family-sans: 'Inter', sans-serif;
}

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

body {
  background-color: var(--bg-dark);
  font-family: var(--font-family-sans);
  color: #ffffff;
  overflow: hidden;
  width: 100vw;
  height: 100vh;
}

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

/* Glassmorphism Styles */
.glass-panel {
  background: var(--glass-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

/* HUD Overlay */
#hud {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  justify-content: space-around;
  align-items: center;
  width: 90%;
  max-width: 900px;
  padding: 12px 24px;
  pointer-events: none;
  transition: all 0.5s cubic-bezier(0.19, 1, 0.22, 1);
}

.hud-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hud-label {
  font-family: var(--font-family-display);
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 4px;
}

.hud-value {
  font-family: var(--font-family-display);
  font-weight: 700;
  font-size: 1.3rem;
  letter-spacing: 0.05em;
}

/* Mini Lives Icons */
#lives-container {
  display: flex;
  gap: 6px;
  align-items: center;
  min-height: 24px;
}

.mini-paddle {
  width: 18px;
  height: 6px;
  border-radius: 3px;
  background-color: var(--neon-red);
  box-shadow: 0 0 8px var(--neon-red-glow);
  display: inline-block;
  transition: all 0.3s ease;
}

.mini-paddle.lost {
  opacity: 0.15;
  transform: scale(0.6);
}

/* Colors Classes with Emissive Neon Shadows */
.neon-blue {
  color: var(--neon-blue);
  text-shadow: 0 0 8px var(--neon-blue-glow), 0 0 15px var(--neon-blue-glow);
}

.neon-magenta {
  color: var(--neon-magenta);
  text-shadow: 0 0 8px var(--neon-magenta-glow), 0 0 15px var(--neon-magenta-glow);
}

.neon-red {
  color: var(--neon-red);
  text-shadow: 0 0 8px var(--neon-red-glow), 0 0 15px var(--neon-red-glow);
}

.neon-green {
  color: var(--neon-green);
  text-shadow: 0 0 8px var(--neon-green-glow), 0 0 15px var(--neon-green-glow);
}

.neon-gold {
  color: var(--neon-gold);
  text-shadow: 0 0 8px var(--neon-gold-glow), 0 0 15px var(--neon-gold-glow);
}

/* Overlays Layer */
.overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 20;
  background-color: rgba(6, 6, 12, 0.7);
  transition: opacity 0.4s ease;
}

.flex-center {
  display: flex;
  justify-content: center;
  align-items: center;
}

.hidden {
  opacity: 0;
  pointer-events: none !important;
  display: none !important;
}

/* Menu Components */
.menu-box {
  width: 90%;
  max-width: 550px;
  padding: 40px 30px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  animation: floatIn 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.glow-title {
  font-family: var(--font-family-display);
  font-size: 2.8rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  margin-bottom: 5px;
  color: #fff;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.2), 0 0 20px var(--neon-blue-glow);
  animation: pulseTitle 2s ease-in-out infinite alternate;
}

.subtitle {
  font-family: var(--font-family-display);
  font-size: 0.95rem;
  letter-spacing: 0.2em;
  margin-bottom: 35px;
  text-transform: uppercase;
}

.menu-buttons {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-bottom: 35px;
}

/* Buttons System */
.btn {
  font-family: var(--font-family-display);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  padding: 14px 28px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  background: transparent;
  color: #ffffff;
  transition: all 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  outline: none;
  text-transform: uppercase;
}

.btn-primary {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* Neon buttons variations */
.neon-btn-magenta {
  border-color: var(--neon-magenta);
  box-shadow: inset 0 0 8px var(--neon-magenta-glow), 0 0 8px var(--neon-magenta-glow);
}
.neon-btn-magenta:hover {
  background-color: var(--neon-magenta);
  box-shadow: 0 0 25px var(--neon-magenta);
  transform: translateY(-2px) scale(1.02);
}

.neon-btn-blue {
  border-color: var(--neon-blue);
  box-shadow: inset 0 0 8px var(--neon-blue-glow), 0 0 8px var(--neon-blue-glow);
}
.neon-btn-blue:hover {
  background-color: var(--neon-blue);
  color: #000;
  box-shadow: 0 0 25px var(--neon-blue);
  transform: translateY(-2px) scale(1.02);
}

.neon-btn-gold {
  border-color: var(--neon-gold);
  box-shadow: inset 0 0 8px var(--neon-gold-glow), 0 0 8px var(--neon-gold-glow);
}
.neon-btn-gold:hover {
  background-color: var(--neon-gold);
  color: #000;
  box-shadow: 0 0 25px var(--neon-gold);
  transform: translateY(-2px) scale(1.02);
}

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

.credits {
  font-family: var(--font-family-display);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.4);
  line-height: 1.8;
}

/* Modal - How to play */
.modal-box {
  width: 95%;
  max-width: 650px;
  padding: 30px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-height: 90vh;
  overflow-y: auto;
  animation: floatIn 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-box h2 {
  font-family: var(--font-family-display);
  font-size: 1.8rem;
  letter-spacing: 0.1em;
  text-align: center;
}

.modal-content {
  font-size: 0.85rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.8);
  overflow-y: auto;
  padding-right: 10px;
}

.modal-content p {
  margin-bottom: 12px;
}

.modal-content h3 {
  font-family: var(--font-family-display);
  font-size: 0.95rem;
  color: var(--neon-blue);
  margin-top: 18px;
  margin-bottom: 8px;
  letter-spacing: 0.05em;
}

.modal-content ul {
  list-style: none;
  margin-bottom: 15px;
}

.modal-content li {
  margin-bottom: 6px;
  position: relative;
  padding-left: 14px;
}

.modal-content li::before {
  content: '>';
  position: absolute;
  left: 0;
  color: var(--neon-magenta);
  font-family: var(--font-family-display);
  font-weight: 700;
}

/* Powerups Description Grid */
.powerup-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-top: 8px;
}

@media (min-width: 500px) {
  .powerup-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.p-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.02);
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.badge {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-family: var(--font-family-display);
  font-weight: 900;
  font-size: 0.75rem;
  color: #fff;
  flex-shrink: 0;
}

.m-badge { background: #ff0055; box-shadow: 0 0 6px rgba(255, 0, 85, 0.7); }
.l-badge { background: #ff3300; box-shadow: 0 0 6px rgba(255, 51, 0, 0.7); }
.c-badge { background: #00ccff; box-shadow: 0 0 6px rgba(0, 204, 255, 0.7); }
.e-badge { background: #cc00ff; box-shadow: 0 0 6px rgba(204, 0, 255, 0.7); }
.s-badge { background: #00ff66; box-shadow: 0 0 6px rgba(0, 255, 102, 0.7); }
.f-badge { background: #ffaa00; box-shadow: 0 0 6px rgba(255, 170, 0, 0.7); }
.w-badge { background: #ffff00; color: #000; box-shadow: 0 0 6px rgba(255, 255, 0, 0.7); }

/* Blinking & Keyframes */
.blinking {
  animation: blink 1.2s steps(2, start) infinite;
}

@keyframes blink {
  to { visibility: hidden; }
}

@keyframes floatIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes pulseTitle {
  from {
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.1), 0 0 15px var(--neon-blue-glow);
  }
  to {
    text-shadow: 0 0 15px rgba(255, 255, 255, 0.2), 0 0 30px var(--neon-blue-glow), 0 0 40px var(--neon-magenta-glow);
  }
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--glass-border);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--neon-magenta-glow);
}

/* Stage Transition Screen Progress Bar */
.level-transition-bar {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  margin-top: 25px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

#level-transition-progress {
  width: 0%;
  height: 100%;
  background: var(--neon-green);
  box-shadow: 0 0 8px var(--neon-green-glow);
  border-radius: 4px;
  transition: width 0.05s linear;
}

.highscore-note {
  font-family: var(--font-family-display);
  font-size: 0.8rem;
  color: var(--neon-gold);
  text-shadow: 0 0 5px var(--neon-gold-glow);
  margin-bottom: 20px;
  animation: pulseTitle 1s ease-in-out infinite alternate;
}

.victory-score {
  font-family: var(--font-family-display);
  font-size: 1.1rem;
  margin-bottom: 30px;
}

/* Camera Debug Panel styles */
#camera-debug-panel {
  position: absolute;
  bottom: 20px;
  right: 20px;
  z-index: 100;
  width: 300px;
  padding: 12px 16px;
  background: var(--glass-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
  font-family: var(--font-family-sans);
  color: #fff;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

#panel-toggle {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  font-family: var(--font-family-display);
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  user-select: none;
}

.toggle-icon {
  font-size: 0.7rem;
  transition: transform 0.3s ease;
  color: var(--neon-magenta);
}

.panel-body {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: max-height 0.4s ease, opacity 0.3s ease;
  max-height: 350px;
  opacity: 1;
}

.panel-body.hidden-panel {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  margin-top: 0;
  pointer-events: none;
}

.panel-desc {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.6);
  line-height: 1.4;
}

.slider-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.slider-group label {
  font-family: var(--font-family-display);
  font-size: 0.65rem;
  letter-spacing: 0.05em;
  color: var(--neon-blue);
  display: flex;
  justify-content: space-between;
}

.slider-group input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  outline: none;
}

.slider-group input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--neon-magenta);
  box-shadow: 0 0 6px var(--neon-magenta);
  cursor: pointer;
  transition: transform 0.1s ease;
}

.slider-group input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.panel-buttons {
  display: flex;
  justify-content: flex-end;
  margin-top: 4px;
}

.btn-mini {
  padding: 6px 12px;
  font-size: 0.65rem;
  border-radius: 4px;
  letter-spacing: 0.05em;
}
