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

body {
  background: #000;
  overflow: hidden;
  font-family: 'VT323', monospace;
  color: white;
}

/* Three.js Canvas */
canvas {
  display: block;
}

/* UI Layer */
#ui-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none; /* Important so we can click "through" it */
  z-index: 100;
}

#crosshair {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin-top: -10px;
  margin-left: -10px;
  border: 2px solid rgba(0, 255, 0, 0.5);
  pointer-events: none;
  transition: transform 0.05s, border-color 0.05s;
}

#crosshair::before, #crosshair::after {
  content: '';
  position: absolute;
  background: rgba(0, 255, 0, 0.8);
}

#crosshair::before {
  top: 7px; left: -15px; width: 46px; height: 2px;
}

#crosshair::after {
  left: 7px; top: -15px; width: 2px; height: 46px;
}

#crosshair.shoot {
  transform: scale(1.5) rotate(45deg);
  border-color: red;
}
#crosshair.shoot::before, #crosshair.shoot::after {
  background: red;
}

/* Retro HUD Bar */
#stats {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100vw;
  background: #111;
  border-top: 4px solid #555;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 40px;
  padding: 10px 0;
  text-shadow: 2px 2px 0px #000;
  z-index: 10;
  pointer-events: auto;
}

.stat-box {
  background: #222;
  border: 4px inset #444;
  padding: 5px 20px;
  text-align: center;
  color: #aaa;
  font-size: 24px;
  min-width: 120px;
}

.stat-val {
  display: block;
  font-size: 36px;
  color: #fff;
  margin-top: 5px;
}

#lives {
  color: #ff3333;
}

/* Menu Screens */
.screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: radial-gradient(circle, rgba(50,0,0,0.8) 0%, rgba(0,0,0,1) 100%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  pointer-events: auto; /* Catch clicks */
}

/* Typography & Effects */
.glow-text {
  font-size: 100px;
  color: #ff0000;
  margin-bottom: 20px;
  text-shadow: 0 0 10px #ff0000, 0 0 20px #ff0000, 0 0 40px #8a0000, 4px 4px 0px #000;
  text-transform: uppercase;
  letter-spacing: 5px;
}

.bloody-text {
  font-size: 120px;
  color: #8b0000;
  margin-bottom: 20px;
  text-shadow: 4px 4px 0px #000;
  text-transform: uppercase;
}

.success-text {
  font-size: 100px;
  color: #00ff00;
  margin-bottom: 20px;
  text-shadow: 0 0 10px #00ff00, 4px 4px 0px #000;
}

.screen p {
  font-size: 28px;
  color: #ccc;
  text-align: center;
  line-height: 1.5;
  text-shadow: 2px 2px 0px #000;
}

/* Retro Buttons */
.retro-btn {
  padding: 15px 40px;
  font-family: 'VT323', monospace;
  font-size: 36px;
  background: #555;
  color: white;
  border: 4px outset #888;
  cursor: pointer;
  margin-top: 40px;
  transition: all 0.1s;
  text-shadow: 2px 2px 0px #000;
}

.retro-btn:hover {
  background: #777;
}

.retro-btn:active {
  border: 4px inset #888;
  background: #333;
}

.hidden {
  display: none !important;
}

/* Flash effect */
#flash {
  position: absolute;
  top: 0; left: 0; width: 100vw; height: 100vh;
  pointer-events: none;
  opacity: 0;
  z-index: 99;
}

#flash.active {
  animation: shoot-flash 0.15s ease-out;
}

@keyframes shoot-flash {
  0% { opacity: 1; }
  100% { opacity: 0; }
}

#gun-container {
  position: absolute;
  bottom: 100px; /* Above the HUD */
  right: 25%;
  width: 500px;
  height: 500px;
  pointer-events: none;
  transition: transform 0.05s ease-out;
  display: none;
}

#gun-container.visible {
  display: block;
}

#gun-container.recoil {
  transform: translateY(50px) rotate(5deg);
}

#gun-container canvas {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

#flame-container {
  position: absolute;
  top: -60%;
  left: 45%;
  width: 15%;
  height: 90%;
  transform-origin: bottom center;
  pointer-events: none;
  display: none;
  opacity: 0.9;
  z-index: 10;
}

#flame-container canvas {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transform: rotate(180deg);
}

#flame-container.active {
  display: block;
  animation: flameFlicker 0.05s infinite alternate;
}

@keyframes flameFlicker {
  0% { transform: scaleY(1); opacity: 0.8; filter: brightness(1); }
  100% { transform: scaleY(1.1); opacity: 1; filter: brightness(1.2); }
}
