:root {
  --neon-cyan: #00f3ff;
  --neon-magenta: #ff0055;
  --neon-purple: #8a2be2;
  --neon-yellow: #ffd700;
  --neon-green: #00ff66;
  --bg-dark: #05070f;
  --panel-bg: rgba(10, 15, 30, 0.95);
  --border-glow: #00f3ff;
  --font-heading: 'Orbitron', sans-serif;
  --font-body: 'Rajdhani', sans-serif;
}

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

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

/* Light retro grid overlay */
#app {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

#game-canvas {
  display: block;
  width: 100%;
  height: 100%;
  background: #03050d;
}

/* Overlay Screen - Lightweight without GPU-heavy backdrop blur */
.overlay-screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  background: rgba(3, 5, 12, 0.94);
  z-index: 10;
}

.hidden {
  display: none !important;
}

/* Cyber Card Panel */
.cyber-card {
  background: var(--panel-bg);
  border: 2px solid var(--neon-cyan);
  padding: 30px;
  border-radius: 6px;
  text-align: center;
  max-width: 600px;
  width: 90%;
  position: relative;
}

.shop-card {
  max-width: 850px;
  text-align: left;
}

/* Glitch Title */
.title-glitch {
  font-family: var(--font-heading);
  font-size: 2.8rem;
  font-weight: 900;
  letter-spacing: 3px;
  color: var(--neon-cyan);
  margin-bottom: 5px;
}

.alert-text {
  color: var(--neon-magenta);
}

.subtitle {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  color: var(--neon-magenta);
  letter-spacing: 2px;
  margin-bottom: 15px;
}

.menu-decor {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.5);
  letter-spacing: 2px;
  margin-bottom: 20px;
}

.instructions-box {
  background: rgba(0, 243, 255, 0.05);
  border-left: 4px solid var(--neon-cyan);
  padding: 12px 16px;
  text-align: left;
  margin-bottom: 25px;
  font-size: 1.05rem;
  line-height: 1.7;
}

.instructions-box code {
  background: rgba(255, 255, 255, 0.15);
  color: var(--neon-yellow);
  padding: 2px 6px;
  border-radius: 3px;
  font-family: monospace;
}

/* Cyber Buttons */
.button-group {
  display: flex;
  gap: 15px;
  justify-content: center;
  margin-top: 15px;
}

.cyber-button {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  padding: 12px 24px;
  border: 1px solid var(--neon-cyan);
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 2px;
  border-radius: 4px;
}

.cyber-button.primary {
  background: var(--neon-cyan);
  color: #000000;
}

.cyber-button.primary:hover {
  background: #ffffff;
  border-color: #ffffff;
}

.cyber-button.secondary {
  background: transparent;
  color: var(--neon-cyan);
}

.cyber-button.secondary:hover {
  background: rgba(0, 243, 255, 0.15);
  color: #fff;
}

/* In-Game HUD */
.hud-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  padding: 16px;
  z-index: 5;
}

.hud-top-left {
  position: absolute;
  top: 16px;
  left: 16px;
  width: 260px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.stat-bar {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stat-label {
  font-family: var(--font-heading);
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.8);
  letter-spacing: 1px;
}

.bar-outer {
  height: 12px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 2px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
}

.bar-fill.health {
  background: #ff0055;
}

.bar-fill.shield {
  background: #00f3ff;
}

.bar-fill.energy {
  background: #ffd700;
}

.stat-value {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.7);
  font-family: monospace;
}

.hud-top-center {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
}

.wave-display {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--neon-yellow);
}

.boss-warning {
  color: var(--neon-magenta);
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 700;
  margin-top: 4px;
}

.hud-top-right {
  position: absolute;
  top: 16px;
  right: 16px;
  text-align: right;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.score-label {
  font-family: var(--font-heading);
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.6);
}

.score-value {
  font-family: var(--font-heading);
  font-size: 1.7rem;
  font-weight: 800;
  color: var(--neon-cyan);
}

.credit-value {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--neon-yellow);
}

.multiplier-card {
  font-family: var(--font-heading);
  font-size: 0.9rem;
  color: var(--neon-magenta);
}

.hud-bottom-bar {
  position: absolute;
  bottom: 16px;
  left: 16px;
  right: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-heading);
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.7);
}

.weapon-active {
  color: var(--neon-cyan);
  font-weight: 700;
  margin-left: 6px;
}

/* Boss Health Bar */
.boss-bar-container {
  position: absolute;
  bottom: 50px;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  max-width: 600px;
  text-align: center;
  z-index: 6;
  pointer-events: none;
}

.boss-name {
  font-family: var(--font-heading);
  font-size: 0.9rem;
  color: var(--neon-magenta);
  font-weight: 700;
  margin-bottom: 4px;
}

.boss-bar-outer {
  height: 14px;
  background: rgba(0, 0, 0, 0.8);
  border: 1px solid var(--neon-magenta);
  border-radius: 2px;
  overflow: hidden;
}

.boss-bar-fill {
  height: 100%;
  width: 100%;
  background: #ff0055;
}

/* Shop Modal Styling */
.shop-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--neon-cyan);
  padding-bottom: 12px;
  margin-bottom: 16px;
}

.shop-header h2 {
  font-family: var(--font-heading);
  color: var(--neon-cyan);
  font-size: 1.3rem;
}

.shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  max-height: 55vh;
  overflow-y: auto;
  padding-right: 6px;
  margin-bottom: 16px;
}

.shop-item {
  background: rgba(0, 243, 255, 0.04);
  border: 1px solid rgba(0, 243, 255, 0.25);
  padding: 12px;
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.item-title {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--neon-yellow);
  margin-bottom: 6px;
  font-size: 0.95rem;
}

.item-desc {
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 10px;
  line-height: 1.3;
}

.item-level {
  font-size: 0.8rem;
  color: var(--neon-cyan);
  margin-bottom: 8px;
  font-weight: 600;
}

.item-buy {
  width: 100%;
  padding: 8px;
  font-size: 0.88rem;
  background: var(--neon-cyan);
  color: #000;
}

.item-buy:disabled {
  background: rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.4);
  border-color: transparent;
  cursor: not-allowed;
}

.shop-footer {
  text-align: center;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 12px;
}

.final-stats {
  background: rgba(255, 255, 255, 0.04);
  padding: 14px;
  margin: 16px 0;
  border-radius: 4px;
  font-size: 1.1rem;
  line-height: 1.8;
}

.stat-row {
  display: flex;
  justify-content: space-between;
}

.highlight {
  color: var(--neon-cyan);
  font-family: var(--font-heading);
  font-weight: 700;
}
