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

body {
  background-color: #07020d;
  color: #fff;
  font-family: 'Press Start 2P', monospace, sans-serif;
  overflow: hidden;
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

#game-container {
  position: relative;
  width: 1280px;
  height: 720px;
  max-width: 100vw;
  max-height: 100vh;
  aspect-ratio: 16 / 9;
  background: #000;
  box-shadow: 0 0 50px rgba(255, 0, 127, 0.4), 0 0 100px rgba(0, 255, 242, 0.2);
  border: 2px solid #ff007f;
  overflow: hidden;
}

canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

#gameCanvas {
  z-index: 1;
}

#cutsceneCanvas {
  z-index: 2;
}

/* CRT and Vignette overlays */
#crt-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10;
  background: linear-gradient(
    rgba(18, 16, 16, 0) 50%, 
    rgba(0, 0, 0, 0.35) 50%
  ), linear-gradient(
    90deg,
    rgba(255, 0, 0, 0.03),
    rgba(0, 255, 0, 0.01),
    rgba(0, 0, 255, 0.03)
  );
  background-size: 100% 4px, 6px 100%;
  opacity: 0.85;
}

#vignette-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 11;
  box-shadow: inset 0 0 100px rgba(0, 0, 0, 0.9), inset 0 0 40px rgba(255, 0, 128, 0.2);
}

/* Cutscene UI */
#cutscene-ui {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 5;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 40px;
  pointer-events: none;
}

.retro-text {
  font-family: 'VT323', monospace;
  font-size: 28px;
  line-height: 1.4;
  color: #fff;
  text-shadow: 0 0 10px #ff007f, 0 0 20px #ff007f;
  max-width: 800px;
  background: rgba(0, 0, 0, 0.75);
  border-left: 5px solid #ff007f;
  padding: 15px 25px;
  border-radius: 2px;
  animation: pulseGlow 2s infinite alternate;
}

#skip-prompt {
  align-self: flex-end;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  font-size: 12px;
  color: #00fff2;
  text-shadow: 0 0 8px #00fff2;
}

kbd {
  background: #ff007f;
  color: #fff;
  padding: 4px 8px;
  border-radius: 3px;
  box-shadow: 0 0 10px #ff007f;
  font-family: 'Press Start 2P', monospace;
}

.progress-bar-bg {
  width: 260px;
  height: 12px;
  background: rgba(0, 0, 0, 0.8);
  border: 2px solid #00fff2;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 0 8px rgba(0, 255, 242, 0.5);
}

#skip-progress-bar {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #ff007f, #00fff2);
  transition: width 0.05s linear;
}

/* Top-Down HUD */
#game-hud {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 4;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 24px;
}

.hud-top-left, .hud-top-right {
  display: flex;
  gap: 16px;
}

.hud-top-right {
  position: absolute;
  top: 24px;
  right: 24px;
}

.hud-bottom-right {
  position: absolute;
  bottom: 24px;
  right: 24px;
}

.hud-box {
  background: rgba(10, 5, 20, 0.85);
  border: 2px solid #33154d;
  padding: 10px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.8);
}

.godmode-btn {
  background: rgba(15, 8, 30, 0.9);
  border: 2px solid #ff007f;
  color: #fff;
  font-family: 'Press Start 2P', monospace;
  font-size: 10px;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  pointer-events: auto;
  box-shadow: 0 0 15px rgba(255, 0, 127, 0.4);
  transition: all 0.15s ease;
}

.godmode-btn:hover {
  background: rgba(40, 15, 60, 0.95);
  box-shadow: 0 0 25px rgba(255, 0, 127, 0.7);
  transform: translateY(-2px);
}

.godmode-btn.active {
  border-color: #ffe600;
  box-shadow: 0 0 25px rgba(255, 230, 0, 0.8), inset 0 0 15px rgba(255, 230, 0, 0.3);
  background: rgba(35, 30, 5, 0.95);
  color: #ffe600;
}

.godmode-icon {
  font-size: 18px;
}

.score-box {
  border-color: #ff007f;
}

.hud-label {
  font-size: 10px;
  color: #8f92a3;
  letter-spacing: 1px;
}

.hud-val {
  font-size: 14px;
}

.neon-pink {
  color: #ff007f;
  text-shadow: 0 0 10px #ff007f;
}

.neon-yellow {
  color: #ffe600;
  text-shadow: 0 0 10px #ffe600;
}

.neon-red {
  color: #ff2244;
  text-shadow: 0 0 10px #ff2244;
}

.neon-cyan {
  color: #00fff2;
  text-shadow: 0 0 10px #00fff2;
}

/* Weapon Card */
.weapon-card {
  background: rgba(10, 5, 20, 0.9);
  border: 2px solid #00fff2;
  box-shadow: 0 0 15px rgba(0, 255, 242, 0.4);
  padding: 12px 18px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.weapon-icon {
  font-size: 36px;
  filter: drop-shadow(0 0 8px #ff007f);
}

.weapon-name {
  font-size: 13px;
  color: #ffe600;
  text-shadow: 0 0 8px #ffe600;
  margin-bottom: 4px;
}

.weapon-desc {
  font-size: 9px;
  color: #aaa;
  margin-bottom: 6px;
  font-family: 'VT323', monospace;
  font-size: 16px;
}

.ammo-indicator {
  font-size: 10px;
  color: #00fff2;
  letter-spacing: 1px;
}

/* Controls Hint */
.controls-hint {
  background: rgba(10, 5, 20, 0.85);
  border: 1px solid #442266;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 9px;
  color: #ddd;
}

.controls-hint kbd {
  font-size: 8px;
  padding: 2px 5px;
}

/* Modals (Death / Victory) */
.modal-screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 20;
  background: rgba(8, 0, 16, 0.94);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px;
  pointer-events: auto;
}

.glitch-title {
  font-size: 42px;
  letter-spacing: 4px;
  margin-bottom: 20px;
  position: relative;
  text-transform: uppercase;
}

.red-glitch {
  color: #ff1133;
  text-shadow: 3px 3px 0 #00fff2, -3px -3px 0 #ff007f;
  animation: textGlitch 0.4s infinite alternate;
}

.victory-glitch {
  color: #ffe600;
  text-shadow: 3px 3px 0 #ff007f, -3px -3px 0 #00fff2;
  animation: textGlitch 0.6s infinite alternate;
}

.modal-subtitle {
  font-size: 16px;
  line-height: 1.6;
  max-width: 800px;
  margin-bottom: 30px;
  color: #eee;
}

.stats-card {
  background: rgba(20, 10, 35, 0.9);
  border: 2px solid #ff007f;
  box-shadow: 0 0 30px rgba(255, 0, 127, 0.5);
  padding: 24px 36px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 30px;
  min-width: 550px;
  text-align: left;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.2);
  padding-bottom: 8px;
}

.rank-big {
  font-size: 18px;
}

.retro-btn {
  background: #ff007f;
  color: #fff;
  border: none;
  font-family: 'Press Start 2P', monospace;
  font-size: 15px;
  padding: 16px 28px;
  cursor: pointer;
  box-shadow: 0 0 20px #ff007f, 0 6px 0 #99004d;
  transition: transform 0.1s, box-shadow 0.1s;
}

.retro-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 30px #ff007f, 0 8px 0 #99004d;
  background: #ff2299;
}

.retro-btn:active {
  transform: translateY(4px);
  box-shadow: 0 0 10px #ff007f, 0 2px 0 #99004d;
}

.btn-win {
  background: #00fff2;
  color: #050114;
  box-shadow: 0 0 25px #00fff2, 0 6px 0 #009990;
}

.btn-win:hover {
  background: #55ffff;
  box-shadow: 0 0 35px #00fff2, 0 8px 0 #009990;
}

/* Audio prompt on first interaction */
.audio-prompt {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 50;
  background: rgba(5, 2, 12, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.audio-prompt-content {
  border: 3px solid #ff007f;
  box-shadow: 0 0 40px rgba(255, 0, 127, 0.7);
  padding: 40px;
  text-align: center;
  background: #0d061a;
  max-width: 750px;
}

.audio-prompt-content h2 {
  font-size: 20px;
  color: #ffe600;
  text-shadow: 0 0 15px #ffe600;
  margin-bottom: 25px;
  line-height: 1.5;
}

.audio-prompt-content p {
  font-size: 13px;
  color: #00fff2;
  text-shadow: 0 0 10px #00fff2;
  margin-bottom: 20px;
  animation: blinkFast 1s infinite alternate;
}

.audio-note {
  font-size: 10px;
  color: #aaa;
  font-family: 'VT323', monospace;
  font-size: 18px;
}

/* Utilities & Animations */
.hidden {
  display: none !important;
}

@keyframes blinkFast {
  0% { opacity: 0.3; }
  100% { opacity: 1; }
}

@keyframes pulseGlow {
  0% { box-shadow: 0 0 10px rgba(255, 0, 127, 0.4); }
  100% { box-shadow: 0 0 25px rgba(255, 0, 127, 0.9); }
}

@keyframes textGlitch {
  0% {
    transform: translate(0);
  }
  20% {
    transform: translate(-2px, 2px);
  }
  40% {
    transform: translate(-1px, -1px);
  }
  60% {
    transform: translate(2px, 1px);
  }
  80% {
    transform: translate(1px, -2px);
  }
  100% {
    transform: translate(0);
  }
}
