:root {
  --bg-primary: #070312;
  --bg-secondary: #0f0923;
  --border-color: #3b1d7d;
  --text-primary: #f1f1f1;
  --text-secondary: #8b91a7;
  --neon-cyan: #00f0ff;
  --neon-pink: #ff007f;
  --neon-green: #00ff66;
  --neon-yellow: #ffea00;
  --neon-orange: #ff5e00;
  --neon-purple: #9d4edd;
  --neon-blue: #00d2ff;
}

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

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

#app {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 1200px;
  width: 100%;
  padding: 20px;
  min-height: 100vh;
}

/* Header & HUD Styling */
.game-header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 25px;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: 0 0 15px rgba(59, 29, 125, 0.2);
  margin-bottom: 20px;
}

.logo-container {
  display: flex;
  flex-direction: column;
}

.logo-neon {
  font-family: 'Outfit', sans-serif;
  font-size: 32px;
  font-weight: 800;
  letter-spacing: 2px;
  color: #fff;
  text-shadow: 0 0 10px rgba(0, 240, 255, 0.6), 0 0 20px rgba(0, 240, 255, 0.3);
}

.logo-neon .accent {
  color: var(--neon-pink);
  text-shadow: 0 0 10px rgba(255, 0, 127, 0.6), 0 0 20px rgba(255, 0, 127, 0.3);
}

.sub-logo {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: var(--text-secondary);
  margin-top: -4px;
}

.hud-stats {
  display: flex;
  gap: 25px;
}

.stat-box {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.stat-label {
  font-size: 11px;
  color: var(--text-secondary);
  letter-spacing: 1.5px;
  font-weight: 600;
  text-transform: uppercase;
}

.stat-val {
  font-family: 'Outfit', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 1px;
}

#lives-val {
  color: var(--neon-pink);
  text-shadow: 0 0 5px rgba(255, 0, 127, 0.4);
}

/* Layout for Canvas + Sidebars */
.main-layout {
  display: flex;
  width: 100%;
  gap: 20px;
  justify-content: center;
}

.sidebar {
  width: 260px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}

.panel-header {
  background-color: var(--border-color);
  color: #fff;
  font-family: 'Outfit', sans-serif;
  font-size: 13px;
  font-weight: 700;
  padding: 8px 15px;
  letter-spacing: 1.5px;
  border-top-left-radius: 4px;
  border-top-right-radius: 4px;
  text-shadow: 0 0 5px rgba(255, 255, 255, 0.3);
}

.panel-body {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-top: none;
  border-bottom-left-radius: 6px;
  border-bottom-right-radius: 6px;
  padding: 15px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

/* Left Sidebar Indicators */
#modifiers-list {
  min-height: 120px;
}

.no-modifiers {
  color: var(--text-secondary);
  font-size: 13px;
  font-style: italic;
  text-align: center;
  margin-top: 20px;
}

.modifier-badge {
  background-color: rgba(59, 29, 125, 0.4);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 6px 12px;
  font-size: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  animation: slideIn 0.3s ease;
}

.modifier-badge.glow-cyan { border-color: var(--neon-cyan); box-shadow: 0 0 5px rgba(0, 240, 255, 0.3); }
.modifier-badge.glow-green { border-color: var(--neon-green); box-shadow: 0 0 5px rgba(0, 255, 102, 0.3); }
.modifier-badge.glow-yellow { border-color: var(--neon-yellow); box-shadow: 0 0 5px rgba(255, 234, 0, 0.3); }
.modifier-badge.glow-orange { border-color: var(--neon-orange); box-shadow: 0 0 5px rgba(255, 94, 0, 0.3); }

.scroll-scores {
  min-height: 250px;
  max-height: 350px;
  overflow-y: auto;
}

.score-entry {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  padding: 4px 0;
  border-bottom: 1px dashed rgba(59, 29, 125, 0.3);
}

.score-entry:last-child {
  border-bottom: none;
}

.score-rank {
  color: var(--neon-cyan);
  font-weight: 600;
  margin-right: 6px;
}

.score-name {
  color: #fff;
}

.score-num {
  font-family: 'Outfit', sans-serif;
  color: var(--neon-yellow);
}

/* Canvas Area */
.canvas-container {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.canvas-glow-wrapper {
  position: relative;
  border: 3px solid var(--border-color);
  border-radius: 8px;
  box-shadow: 0 0 25px rgba(59, 29, 125, 0.5);
  background-color: #000;
  overflow: hidden;
}

#game-canvas {
  display: block;
}

/* Overlays */
.overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(5, 2, 13, 0.85);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  z-index: 10;
  transition: opacity 0.4s ease;
  padding: 40px;
}

.overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.overlay h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 20px;
  letter-spacing: 2px;
  margin-top: 20px;
  color: var(--neon-cyan);
  text-shadow: 0 0 10px rgba(0, 240, 255, 0.4);
}

.overlay p {
  color: var(--text-secondary);
  font-size: 13px;
  margin-top: 8px;
}

.loader-spinner {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(0, 240, 255, 0.1);
  border-top-color: var(--neon-cyan);
  border-radius: 50%;
  animation: spin 1s infinite linear;
}

.prompt-box {
  background-color: var(--bg-secondary);
  border: 2px solid var(--border-color);
  border-radius: 8px;
  padding: 30px 25px;
  box-shadow: 0 0 30px rgba(59, 29, 125, 0.6);
  max-width: 380px;
}

.prompt-box h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 22px;
  margin-bottom: 12px;
  color: #fff;
  text-shadow: 0 0 10px rgba(59, 29, 125, 0.8);
}

.prompt-box p {
  font-size: 13px;
  line-height: 1.6;
  margin-bottom: 25px;
  color: var(--text-secondary);
}

.cyber-btn {
  background: linear-gradient(135deg, #4b299a, #200b4e);
  color: #fff;
  font-family: 'Outfit', sans-serif;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 1.5px;
  padding: 12px 24px;
  border: 1px solid var(--neon-cyan);
  border-radius: 4px;
  cursor: pointer;
  outline: none;
  transition: all 0.2s ease;
}

.cyber-btn:hover {
  background: var(--neon-cyan);
  color: var(--bg-primary);
  box-shadow: 0 0 15px var(--neon-cyan);
}

/* Right Sidebar: Guide Chart */
.powerup-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.guide-item {
  display: flex;
  align-items: center;
  font-size: 13px;
  gap: 12px;
}

.pill {
  width: 22px;
  height: 18px;
  border-radius: 3px;
  color: #fff;
  font-weight: 700;
  font-size: 11px;
  display: flex;
  justify-content: center;
  align-items: center;
  border: 1px solid #fff;
  box-shadow: 0 0 5px rgba(255,255,255,0.2);
}

.pill-green { background: linear-gradient(to bottom, var(--neon-green), #008822); }
.pill-red { background: linear-gradient(to bottom, #ff3333, #990000); }
.pill-purple { background: linear-gradient(to bottom, #ff00ff, #880088); }
.pill-yellow { background: linear-gradient(to bottom, var(--neon-yellow), #998800); }
.pill-orange { background: linear-gradient(to bottom, #ff8c00, #cc3300); }
.pill-cyan { background: linear-gradient(to bottom, var(--neon-cyan), #007788); }
.pill-blue { background: linear-gradient(to bottom, var(--neon-blue), #004488); }

.text-guide p {
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-secondary);
}

.text-guide strong {
  color: #fff;
}

.key {
  background-color: rgba(59, 29, 125, 0.4);
  border: 1px solid var(--border-color);
  padding: 1px 5px;
  border-radius: 3px;
  font-family: monospace;
  color: var(--neon-cyan);
}

/* Footer info */
.game-footer {
  width: 100%;
  text-align: center;
  padding: 20px;
  color: var(--text-secondary);
  font-size: 11px;
  margin-top: 20px;
  border-top: 1px solid rgba(59, 29, 125, 0.2);
}

/* Animations */
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes slideIn {
  from { transform: translateX(-10px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Responsive layout adjustments */
@media (max-width: 1150px) {
  .main-layout {
    flex-direction: column;
    align-items: center;
  }
  .sidebar {
    width: 600px;
  }
  .powerup-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* Sound Toggle Button */
.sound-toggle-btn {
  background: none;
  border: 1px solid var(--border-color);
  color: var(--neon-cyan);
  border-radius: 4px;
  width: 38px;
  height: 38px;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  align-self: center;
  margin-left: 10px;
  transition: all 0.2s ease;
}

.sound-toggle-btn:hover {
  background: rgba(0, 240, 255, 0.15);
  border-color: var(--neon-cyan);
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.4);
}
