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

:root {
  --explosive-orange: #FF6600;
  --fire-red: #FF4500;
  --warning-red: #CC0000;
  --tactical-dark: #1a1a2e;
  --tactical-navy: #16213e;
  --fire-yellow: #FFD700;
  --fire-orange: #FFA500;
  --wood-dark: #654321;
  --wood-med: #8B6914;
  --military-green: #556B2F;
  --bg-wall: #3a2f25;
  --brass: #B8860B;
  --brass-light: #DAA520;
}

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  background: #1a1510;
  font-family: 'Share Tech Mono', monospace;
  cursor: none;
}

#scene-container {
  position: fixed;
  inset: 0;
  z-index: 1;
  cursor: none;
}

#crosshair {
  position: fixed;
  pointer-events: none;
  z-index: 500;
  transform: translate(-50%, -50%);
  transition: none;
  filter: drop-shadow(0 0 4px rgba(255,69,0,0.6));
}

/* ─── HEADER ─── */
#header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  text-align: center;
  padding: 8px 16px 4px;
  background: linear-gradient(180deg, rgba(20,10,5,0.95) 0%, rgba(20,10,5,0.5) 80%, transparent 100%);
  pointer-events: none;
}

#header h1 {
  font-family: 'Bangers', cursive;
  font-size: clamp(1.4rem, 5vw, 2.8rem);
  letter-spacing: 0.08em;
  line-height: 1.1;
}

.fire-text {
  background: linear-gradient(180deg, #FFD700 0%, #FF6600 40%, #FF4500 70%, #CC0000 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 2px 6px rgba(255,69,0,0.5));
  animation: fire-flicker 0.15s infinite alternate;
}

@keyframes fire-flicker {
  0% { filter: drop-shadow(0 2px 6px rgba(255,69,0,0.5)); }
  100% { filter: drop-shadow(0 3px 10px rgba(255,100,0,0.7)); }
}

#header .subtitle {
  font-family: 'Share Tech Mono', monospace;
  font-size: clamp(0.6rem, 2vw, 0.9rem);
  color: #aa8866;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

/* ─── HEALTH BAR ─── */
#health-bar-container {
  position: fixed;
  top: 58px; left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(20,10,5,0.85);
  border: 2px solid #553311;
  border-radius: 8px;
  padding: 6px 14px;
  min-width: 280px;
  transition: transform 0.05s;
}

.health-icon { font-size: 1.3rem; }
.health-label {
  font-family: 'Bangers', cursive;
  font-size: 0.7rem;
  color: var(--fire-yellow);
  letter-spacing: 0.15em;
  white-space: nowrap;
}

#health-bar-bg {
  flex: 1;
  height: 16px;
  background: #1a0a0a;
  border-radius: 4px;
  border: 1px solid #442211;
  overflow: hidden;
  position: relative;
}

#health-bar-fill {
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, #22cc44, #44ee66);
  border-radius: 3px;
  transition: width 0.3s, background 0.3s;
  box-shadow: inset 0 -2px 4px rgba(0,0,0,0.3), 0 0 8px rgba(34,204,68,0.3);
}

#health-pct {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.85rem;
  color: #44ee66;
  min-width: 40px;
  text-align: right;
}

.health-shake {
  animation: h-shake 0.3s ease-out;
}

@keyframes h-shake {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  25% { transform: translateX(-50%) translateY(-3px); }
  50% { transform: translateX(-50%) translateY(2px); }
  75% { transform: translateX(-50%) translateY(-1px); }
}

/* ─── SCORE ─── */
#score-display {
  position: fixed;
  top: 58px; right: 16px;
  z-index: 100;
  text-align: right;
}

#score-value {
  font-family: 'Bangers', cursive;
  font-size: clamp(1.2rem, 4vw, 2rem);
  color: var(--fire-yellow);
  text-shadow: 0 0 10px rgba(255,215,0,0.4);
}

#combo-display {
  font-family: 'Bangers', cursive;
  font-size: 0.9rem;
  color: var(--fire-orange);
  min-height: 1.2em;
}

/* ─── FLOATING TEXT ─── */
#combo-text, #action-text {
  position: fixed;
  z-index: 200;
  pointer-events: none;
  font-family: 'Bangers', cursive;
  font-size: clamp(2rem, 8vw, 4rem);
  text-align: center;
  left: 50%;
  transform: translateX(-50%);
  opacity: 0;
  text-shadow: 
    0 0 20px rgba(255,69,0,0.8),
    3px 3px 0 #000,
    -1px -1px 0 #000;
}

#combo-text {
  top: 30%;
  color: var(--fire-yellow);
}

#action-text {
  top: 45%;
  color: white;
  font-size: clamp(1.5rem, 6vw, 3rem);
}

.float-text-anim {
  animation: float-up 1.2s ease-out forwards;
}

@keyframes float-up {
  0% { opacity: 0; transform: translateX(-50%) translateY(20px) scale(0.5) rotate(-5deg); }
  20% { opacity: 1; transform: translateX(-50%) translateY(-10px) scale(1.2) rotate(3deg); }
  40% { transform: translateX(-50%) translateY(-20px) scale(1) rotate(-1deg); }
  100% { opacity: 0; transform: translateX(-50%) translateY(-80px) scale(0.8) rotate(2deg); }
}

/* ─── WEAPON BAR ─── */
#weapon-bar {
  position: fixed;
  bottom: 70px; left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  display: flex;
  gap: 6px;
  padding: 8px 12px;
  background: linear-gradient(180deg, rgba(60,40,20,0.92) 0%, rgba(30,18,8,0.95) 100%);
  border: 2px solid #553322;
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.6), inset 0 1px 0 rgba(255,255,255,0.05);
}

.weapon-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6px 10px;
  border: 2px solid #443322;
  border-radius: 8px;
  background: rgba(40,25,12,0.8);
  cursor: pointer;
  transition: all 0.15s;
  min-width: 56px;
  position: relative;
}

.weapon-slot:hover {
  border-color: var(--fire-orange);
  background: rgba(60,35,15,0.9);
}

.weapon-slot.selected {
  border-color: var(--fire-yellow);
  background: rgba(80,45,10,0.9);
  box-shadow: 0 0 12px rgba(255,215,0,0.3), inset 0 0 8px rgba(255,165,0,0.15);
}

.weapon-slot.empty {
  opacity: 0.35;
  pointer-events: none;
}

.weapon-icon { font-size: 1.4rem; line-height: 1; }
.weapon-name {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.5rem;
  color: #aa8866;
  margin-top: 2px;
  white-space: nowrap;
}
.weapon-ammo {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.65rem;
  color: var(--fire-yellow);
}
.weapon-dmg {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.45rem;
  color: #886644;
}

/* Nuke slot */
.nuke-slot {
  border-color: #661111;
}
.nuke-slot.selected {
  border-color: #ff2222;
  box-shadow: 0 0 16px rgba(255,0,0,0.4);
}
.nuke-cover {
  position: absolute;
  inset: -2px;
  background: repeating-linear-gradient(
    45deg,
    #cc0000,
    #cc0000 4px,
    #ffcc00 4px,
    #ffcc00 8px
  );
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  cursor: pointer;
  z-index: 2;
  transition: transform 0.3s;
}
.nuke-cover.open {
  transform: rotateX(-90deg) translateY(-100%);
  opacity: 0;
  pointer-events: none;
}
.nuke-icon { filter: saturate(2); }

/* ─── THROW BUTTON ─── */
#throw-btn {
  position: fixed;
  bottom: 16px; left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  font-family: 'Bangers', cursive;
  font-size: clamp(1rem, 3vw, 1.4rem);
  letter-spacing: 0.1em;
  padding: 10px 36px;
  border: 3px solid #880000;
  border-radius: 50px;
  background: radial-gradient(circle at 35% 35%, #ff3333, #cc0000 60%, #880000);
  color: white;
  cursor: pointer;
  box-shadow:
    0 4px 15px rgba(0,0,0,0.5),
    0 0 20px rgba(204,0,0,0.25),
    inset 0 -3px 8px rgba(0,0,0,0.3),
    inset 0 2px 6px rgba(255,255,255,0.1);
  transition: all 0.1s;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

#throw-btn:hover {
  background: radial-gradient(circle at 35% 35%, #ff4444, #ee1111 60%, #990000);
  box-shadow:
    0 4px 20px rgba(0,0,0,0.6),
    0 0 30px rgba(255,0,0,0.35);
}

#throw-btn:active {
  transform: translateX(-50%) scale(0.93) translateY(2px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

/* ─── STATS ─── */
#stats-toggle {
  position: fixed;
  top: 12px; right: 12px;
  z-index: 200;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(30,18,8,0.85);
  border: 2px solid #553322;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s;
}
#stats-toggle:hover {
  border-color: var(--fire-orange);
  box-shadow: 0 0 10px rgba(255,165,0,0.3);
}

#stats-panel {
  position: fixed;
  top: 56px; right: 12px;
  z-index: 200;
  background: rgba(20,10,5,0.95);
  border: 2px solid #553322;
  border-radius: 10px;
  padding: 14px 18px;
  min-width: 220px;
  color: #ccaa88;
}
#stats-panel.hidden { display: none; }

#stats-panel h3 {
  font-family: 'Bangers', cursive;
  font-size: 1rem;
  color: var(--fire-yellow);
  margin-bottom: 8px;
  letter-spacing: 0.1em;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  padding: 3px 0;
  border-bottom: 1px solid rgba(85,51,34,0.3);
}
.stat-row span:last-child {
  color: var(--fire-orange);
  font-weight: bold;
}

/* ─── RESULT OVERLAY ─── */
#result-overlay {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.8);
}
#result-overlay.hidden { display: none; }

.result-content {
  background: linear-gradient(180deg, #2a1a0a, #150a05);
  border: 3px solid var(--fire-orange);
  border-radius: 16px;
  padding: 28px 36px;
  text-align: center;
  max-width: 400px;
  box-shadow: 0 0 40px rgba(255,100,0,0.3);
}

#result-title {
  font-family: 'Bangers', cursive;
  font-size: 2rem;
  color: var(--fire-yellow);
  margin-bottom: 8px;
  text-shadow: 0 0 15px rgba(255,215,0,0.4);
}

#result-rating {
  font-family: 'Bangers', cursive;
  font-size: 1.3rem;
  color: var(--fire-orange);
  margin-bottom: 16px;
}

#result-stats {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.8rem;
  color: #ccaa88;
  margin-bottom: 20px;
  line-height: 1.8;
}

#resurrect-btn {
  font-family: 'Bangers', cursive;
  font-size: 1.1rem;
  padding: 12px 28px;
  border: 2px solid #22aa44;
  border-radius: 50px;
  background: linear-gradient(180deg, #22aa44, #116622);
  color: white;
  cursor: pointer;
  letter-spacing: 0.05em;
  box-shadow: 0 0 15px rgba(34,170,68,0.3);
  transition: all 0.2s;
  animation: pulse-green 1.5s infinite;
}

#resurrect-btn:hover {
  background: linear-gradient(180deg, #33cc55, #228833);
  box-shadow: 0 0 25px rgba(34,170,68,0.5);
}

@keyframes pulse-green {
  0%, 100% { box-shadow: 0 0 15px rgba(34,170,68,0.3); }
  50% { box-shadow: 0 0 25px rgba(34,170,68,0.5); }
}

/* ─── NUKE FLASH ─── */
#nuke-flash {
  position: fixed;
  inset: 0;
  z-index: 350;
  background: white;
  pointer-events: none;
}
#nuke-flash.hidden { display: none; }
.nuke-flash-anim {
  animation: nuke-flash-kf 2s ease-out forwards;
}
@keyframes nuke-flash-kf {
  0% { opacity: 1; }
  30% { opacity: 1; }
  100% { opacity: 0; }
}

/* ─── SCREEN SHAKE ─── */
.screen-shake {
  animation: screenshake 0.3s ease-out;
}
@keyframes screenshake {
  0% { transform: translate(0,0); }
  10% { transform: translate(-8px, 6px); }
  20% { transform: translate(6px, -8px); }
  30% { transform: translate(-6px, 4px); }
  40% { transform: translate(4px, -4px); }
  50% { transform: translate(-3px, 3px); }
  60% { transform: translate(3px, -2px); }
  70% { transform: translate(-2px, 2px); }
  80% { transform: translate(1px, -1px); }
  100% { transform: translate(0,0); }
}

.screen-shake-big {
  animation: screenshake-big 0.6s ease-out;
}
@keyframes screenshake-big {
  0% { transform: translate(0,0); }
  5% { transform: translate(-15px, 12px); }
  10% { transform: translate(12px, -15px); }
  15% { transform: translate(-12px, 10px); }
  20% { transform: translate(10px, -10px); }
  30% { transform: translate(-8px, 6px); }
  40% { transform: translate(6px, -6px); }
  50% { transform: translate(-4px, 4px); }
  60% { transform: translate(3px, -3px); }
  80% { transform: translate(-1px, 1px); }
  100% { transform: translate(0,0); }
}

/* ─── FOOTER ─── */
footer {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 90;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 3px 12px;
  pointer-events: none;
}

footer a, footer span {
  pointer-events: auto;
  color: rgba(184,100,11,0.4);
  font-size: 0.6rem;
  text-decoration: none;
  font-family: 'Share Tech Mono', monospace;
}

footer a:hover { color: var(--fire-orange); }
footer span { cursor: pointer; }

/* Mobile responsive */
@media (max-width: 600px) {
  #weapon-bar {
    gap: 3px;
    padding: 6px 8px;
    bottom: 62px;
  }
  .weapon-slot {
    padding: 4px 6px;
    min-width: 44px;
  }
  .weapon-icon { font-size: 1.1rem; }
  .weapon-name { font-size: 0.4rem; }
  #health-bar-container {
    min-width: 220px;
    padding: 4px 10px;
  }
  .health-label { font-size: 0.55rem; }
  #throw-btn {
    padding: 8px 28px;
  }
}