:root {
  --bg-deep: #05060f;
  --bg-panel: rgba(18, 22, 40, 0.75);
  --cyan: #34f5ff;
  --magenta: #ff2e88;
  --yellow: #ffd23f;
  --green: #33ff88;
  --red: #ff3b3b;
  --text-main: #e9f6ff;
  --border-glow: rgba(52, 245, 255, 0.4);
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  height: 100dvh;
  background: radial-gradient(circle at 50% 20%, #101433 0%, var(--bg-deep) 70%);
  color: var(--text-main);
  font-family: 'Rajdhani', sans-serif;
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
}

#game-root {
  position: relative;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

.screen {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 24px;
  position: relative;
}

.screen.active {
  display: flex;
}

/* ---------- START SCREEN ---------- */

.game-title {
  font-family: 'Orbitron', sans-serif;
  font-weight: 900;
  font-size: clamp(2rem, 6vw, 4rem);
  letter-spacing: 4px;
  margin: 0;
  color: var(--text-main);
  text-shadow: 0 0 10px var(--cyan), 0 0 30px var(--cyan);
  text-align: center;
}

.game-title span {
  color: var(--magenta);
  text-shadow: 0 0 10px var(--magenta), 0 0 30px var(--magenta);
}

.game-subtitle {
  font-family: 'Orbitron', sans-serif;
  letter-spacing: 3px;
  color: var(--yellow);
  margin-top: 8px;
  margin-bottom: 28px;
  text-transform: uppercase;
  font-size: clamp(0.85rem, 2vw, 1.1rem);
}

.rules-box {
  max-width: 560px;
  text-align: center;
  background: var(--bg-panel);
  border: 1px solid var(--border-glow);
  border-radius: 14px;
  padding: 16px 22px;
  margin-bottom: 32px;
  backdrop-filter: blur(6px);
  box-shadow: 0 0 24px rgba(52, 245, 255, 0.15);
  font-size: 1.05rem;
  line-height: 1.5;
}

.difficulty-picker {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  justify-content: center;
}

.diff-btn {
  font-family: 'Orbitron', sans-serif;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 18px 30px;
  border-radius: 12px;
  border: 2px solid var(--border-glow);
  background: linear-gradient(160deg, rgba(30,36,66,0.9), rgba(10,12,26,0.9));
  color: var(--text-main);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  font-size: 1.1rem;
  min-height: 44px;
  touch-action: manipulation;
}

.diff-btn:hover {
  transform: translateY(-4px) scale(1.03);
  box-shadow: 0 0 24px var(--cyan);
  border-color: var(--cyan);
}

.diff-btn:active {
  transform: translateY(0) scale(0.98);
}

.diff-name {
  font-weight: 700;
  letter-spacing: 2px;
}

.diff-info {
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.85rem;
  color: var(--yellow);
}

.diff-easy { border-color: var(--green); }
.diff-easy:hover { box-shadow: 0 0 24px var(--green); border-color: var(--green); }
.diff-medium { border-color: var(--yellow); }
.diff-medium:hover { box-shadow: 0 0 24px var(--yellow); border-color: var(--yellow); }
.diff-hard { border-color: var(--red); }
.diff-hard:hover { box-shadow: 0 0 24px var(--red); border-color: var(--red); }

.hint {
  margin-top: 28px;
  color: #8ea2c9;
  font-size: 0.9rem;
  letter-spacing: 1px;
}

/* ---------- GAME SCREEN ---------- */

.arena {
  position: relative;
  width: min(900px, 96vw);
  height: min(640px, 92vh, 92dvh);
  background:
    radial-gradient(circle at 50% 30%, rgba(52,245,255,0.08), transparent 60%),
    linear-gradient(180deg, #0b0e22 0%, #05060f 80%);
  border: 1px solid var(--border-glow);
  border-radius: 18px;
  box-shadow: 0 0 40px rgba(52,245,255,0.1), inset 0 0 60px rgba(0,0,0,0.6);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.arena.shake {
  animation: screen-shake 0.4s ease;
}

@keyframes screen-shake {
  0% { transform: translate(0, 0); }
  15% { transform: translate(-10px, 6px); }
  30% { transform: translate(8px, -6px); }
  45% { transform: translate(-8px, 4px); }
  60% { transform: translate(6px, -4px); }
  75% { transform: translate(-4px, 2px); }
  100% { transform: translate(0, 0); }
}

.game-header {
  position: relative;
  text-align: center;
  padding: 10px 16px 0;
  z-index: 5;
}

.home-btn {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border-glow);
  background: rgba(18, 22, 40, 0.75);
  color: var(--cyan);
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: box-shadow 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
  touch-action: manipulation;
  z-index: 6;
}

.home-btn:hover {
  box-shadow: 0 0 14px var(--cyan);
  border-color: var(--cyan);
}

.home-btn:active {
  transform: translateY(-50%) scale(0.9);
}

.game-header-title {
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  font-size: clamp(0.7rem, 2vw, 1.05rem);
  letter-spacing: 1.5px;
  color: var(--cyan);
  text-shadow: 0 0 10px var(--cyan);
}

.game-header-title .header-dash {
  color: var(--magenta);
  text-shadow: 0 0 10px var(--magenta);
}

.hud-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  z-index: 5;
}

.hud-label {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.75rem;
  letter-spacing: 2px;
  color: #8ea2c9;
  margin-right: 8px;
}

.hp-wrap {
  display: flex;
  align-items: center;
}

.hp-bar-track {
  width: clamp(110px, 28vw, 220px);
  height: 20px;
  border-radius: 10px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.2);
  overflow: hidden;
}

.hp-bar-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, var(--green), #8dff9a);
  transition: width 0.3s ease, background 0.3s ease;
}

.hp-bar-fill.hp-mid {
  background: linear-gradient(90deg, var(--yellow), #ffe08a);
}

.hp-bar-fill.hp-low {
  background: linear-gradient(90deg, var(--red), #ff8080);
}

.hp-bar-fill.hp-pulse {
  animation: hp-pulse 0.4s ease;
}

@keyframes hp-pulse {
  0% { filter: brightness(2.4); }
  100% { filter: brightness(1); }
}

.score-wrap {
  font-family: 'Orbitron', sans-serif;
}

.game-timer-wrap {
  display: flex;
  align-items: center;
  font-family: 'Orbitron', sans-serif;
}

.game-timer-value {
  font-size: 1.3rem;
  color: var(--yellow);
  text-shadow: 0 0 10px var(--yellow);
}

.game-timer-value.game-timer-low {
  color: var(--red);
  text-shadow: 0 0 14px var(--red);
  animation: timer-urgent-pulse 0.8s ease-in-out infinite;
}

@keyframes timer-urgent-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.18); }
}

#score-value {
  font-size: 1.3rem;
  color: var(--cyan);
  text-shadow: 0 0 10px var(--cyan);
}

.vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 0 0 0 rgba(255,0,0,0);
  transition: box-shadow 0.15s ease;
  z-index: 4;
}

.vignette.hit {
  box-shadow: inset 0 0 140px 40px rgba(255,20,20,0.65);
}

.screen-flash {
  position: absolute;
  inset: 0;
  background: white;
  opacity: 0;
  pointer-events: none;
  z-index: 4;
}

.screen-flash.flash-correct {
  animation: flash-white 0.2s ease;
}

@keyframes flash-white {
  0% { opacity: 0.35; }
  100% { opacity: 0; }
}

.corridor {
  position: relative;
  flex: 1;
  overflow: hidden;
  perspective: 900px;
  perspective-origin: 50% 40%;
}

.corridor-floor {
  position: absolute;
  left: -50%;
  right: -50%;
  bottom: 0;
  height: 65%;
  background-image:
    repeating-linear-gradient(90deg, rgba(52,245,255,0.25) 0, rgba(52,245,255,0.25) 2px, transparent 2px, transparent 60px),
    repeating-linear-gradient(0deg, rgba(52,245,255,0.2) 0, rgba(52,245,255,0.2) 2px, transparent 2px, transparent 40px);
  background-size: 60px 40px;
  transform: rotateX(60deg) translateZ(0);
  transform-origin: 50% 100%;
  mask-image: linear-gradient(to top, rgba(0,0,0,0.9), transparent 90%);
  -webkit-mask-image: linear-gradient(to top, rgba(0,0,0,0.9), transparent 90%);
  animation: floor-scroll 1.2s linear infinite;
}

@keyframes floor-scroll {
  0% { background-position: 0 0, 0 0; }
  100% { background-position: 0 40px, 0 40px; }
}

.corridor-fog {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 35%, transparent 0%, transparent 30%, rgba(5,6,15,0.85) 85%);
  pointer-events: none;
}

.monster-slots {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
}

.monster-unit {
  position: absolute;
  left: calc(50% + var(--x-offset, 0%));
  top: 46%;
  font-size: 6rem;
  user-select: none;
  transform: translate(-50%, -50%) translateZ(0) scale(1);
  transition: top 0.5s ease, left 0.5s ease, transform 0.5s ease, opacity 0.5s ease, filter 0.5s ease;
  filter: drop-shadow(0 0 24px rgba(255,110,20,0.55));
  will-change: transform, opacity, filter;
}

.monster-unit.spawning {
  opacity: 0;
}

.monster-unit.depth-0 { top: 30%; opacity: 0.35; filter: blur(3px) drop-shadow(0 0 10px rgba(255,110,20,0.35)); transform: translate(-50%, -50%) scale(0.35); z-index: 1; }
.monster-unit.depth-1 { top: 35%; opacity: 0.55; filter: blur(2px) drop-shadow(0 0 14px rgba(255,110,20,0.4)); transform: translate(-50%, -50%) scale(0.52); z-index: 2; }
.monster-unit.depth-2 { top: 41%; opacity: 0.75; filter: blur(1px) drop-shadow(0 0 18px rgba(255,110,20,0.45)); transform: translate(-50%, -50%) scale(0.72); z-index: 3; }
.monster-unit.depth-3 { top: 49%; opacity: 0.92; filter: drop-shadow(0 0 22px rgba(255,110,20,0.5)); transform: translate(-50%, -50%) scale(0.95); z-index: 4; }
.monster-unit.depth-4 { top: 58%; opacity: 1; filter: drop-shadow(0 0 32px rgba(255,90,10,0.65)); transform: translate(-50%, -50%) scale(1.3); z-index: 5; }

.monster-unit.hit-flash {
  animation: monster-hit 0.35s ease;
}

@keyframes monster-hit {
  0% { filter: brightness(1); }
  30% { filter: brightness(3) drop-shadow(0 0 40px #fff); }
  100% { filter: brightness(1); }
}

.monster-unit.dying {
  animation: monster-die 0.5s ease forwards;
}

@keyframes monster-die {
  0% { filter: brightness(1); opacity: 1; }
  15% { filter: brightness(5) drop-shadow(0 0 90px #fff); opacity: 1; transform: translate(-50%, -50%) scale(1.7); }
  50% { filter: brightness(2.2) drop-shadow(0 0 60px var(--yellow)); opacity: 1; transform: translate(-50%, -50%) scale(0.8) rotate(-14deg); }
  100% { filter: brightness(1); opacity: 0; transform: translate(-50%, -50%) scale(0.05) rotate(30deg); }
}

.explosion {
  position: absolute;
  width: 0;
  height: 0;
  z-index: 20;
  pointer-events: none;
}

.explosion-ring {
  position: absolute;
  left: 0;
  top: 0;
  width: 46px;
  height: 46px;
  margin: -23px 0 0 -23px;
  border-radius: 50%;
  border: 8px solid var(--yellow);
  box-shadow: 0 0 50px var(--yellow), inset 0 0 40px #fff;
  opacity: 1;
  animation: explosion-ring-anim 0.65s ease-out forwards;
}

.explosion-ring.ring-2 {
  border-color: var(--red);
  box-shadow: 0 0 40px var(--red), inset 0 0 26px #fff;
  animation: explosion-ring-anim 0.85s ease-out 0.06s forwards;
}

.explosion-ring.ring-3 {
  width: 30px;
  height: 30px;
  margin: -15px 0 0 -15px;
  border-color: #fff;
  border-width: 6px;
  box-shadow: 0 0 34px #fff;
  animation: explosion-ring-anim 0.5s ease-out 0.12s forwards;
}

@keyframes explosion-ring-anim {
  0% { transform: scale(0.2); opacity: 1; }
  100% { transform: scale(9); opacity: 0; }
}

.explosion-flash {
  position: absolute;
  left: 0;
  top: 0;
  width: 90px;
  height: 90px;
  margin: -45px 0 0 -45px;
  border-radius: 50%;
  background: radial-gradient(circle, #fff 0%, var(--yellow) 35%, rgba(255,90,10,0.6) 60%, transparent 75%);
  animation: explosion-flash-anim 0.3s ease-out forwards;
}

@keyframes explosion-flash-anim {
  0% { transform: scale(0.25); opacity: 1; }
  100% { transform: scale(3.6); opacity: 0; }
}

.explosion-particle {
  position: absolute;
  left: 0;
  top: 0;
  width: 14px;
  height: 14px;
  margin: -7px 0 0 -7px;
  border-radius: 50%;
  background: radial-gradient(circle, #fff, var(--yellow) 45%, var(--red) 85%);
  box-shadow: 0 0 16px var(--yellow);
  animation: explosion-particle-anim 0.75s cubic-bezier(0.15, 0.8, 0.25, 1) forwards;
}

@keyframes explosion-particle-anim {
  0% { transform: translate(0, 0) scale(1); opacity: 1; }
  100% { transform: translate(var(--dx), var(--dy)) scale(0.1); opacity: 0; }
}

.monster-unit.attack-lunge {
  animation: monster-attack 0.45s ease;
}

@keyframes monster-attack {
  0% { }
  35% { filter: brightness(1.8) drop-shadow(0 0 34px var(--red)); }
  70% { }
  100% { }
}

@keyframes screen-shake-kill {
  0% { transform: translate(0, 0) scale(1); }
  15% { transform: translate(-12px, 8px) scale(1.015); }
  30% { transform: translate(10px, -7px) scale(1.01); }
  45% { transform: translate(-8px, 6px) scale(1.008); }
  60% { transform: translate(7px, -4px) scale(1.004); }
  80% { transform: translate(-3px, 2px) scale(1.001); }
  100% { transform: translate(0, 0) scale(1); }
}

.arena.shake-kill {
  animation: screen-shake-kill 0.4s ease;
}

.crosshair {
  position: absolute;
  top: 10%;
  left: 50%;
  transform: translateX(-50%);
  font-size: 2rem;
  opacity: 0.7;
  animation: crosshair-pulse 1.6s ease-in-out infinite;
  z-index: 6;
}

@keyframes crosshair-pulse {
  0%, 100% { transform: translateX(-50%) scale(1); opacity: 0.5; }
  50% { transform: translateX(-50%) scale(1.15); opacity: 0.9; }
}

.gun-rig {
  position: absolute;
  bottom: -2%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  pointer-events: none;
}

.gun-sprite {
  position: relative;
  width: clamp(92px, 21vw, 140px);
  height: clamp(84px, 20vw, 128px);
  display: block;
  transform-origin: 50% 100%;
  animation: gun-idle 2.4s ease-in-out infinite;
  filter: drop-shadow(0 0 18px rgba(52,245,255,0.4));
}

.cannon-leg {
  position: absolute;
  bottom: 0;
  width: 28%;
  height: 38%;
  background: linear-gradient(160deg, #3d4452, #181a20 75%);
  border: 2px solid #0c0d10;
  clip-path: polygon(22% 0%, 78% 0%, 100% 100%, 0% 100%);
  box-shadow: inset 0 2px 4px rgba(255,255,255,0.12);
}

.cannon-leg::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 16%;
  width: 3px;
  height: 50%;
  transform: translateX(-50%);
  background: var(--cyan);
  box-shadow: 0 0 8px var(--cyan);
  opacity: 0.85;
}

.cannon-leg-left { left: 2%; transform: rotate(-7deg); }
.cannon-leg-right { right: 2%; transform: rotate(7deg); }

.cannon-base {
  position: absolute;
  bottom: 2%;
  left: 50%;
  width: 72%;
  height: 26%;
  transform: translateX(-50%);
  background: linear-gradient(160deg, #545e70, #262a33 70%);
  border: 2px solid #14161c;
  border-radius: 6px;
  box-shadow: 0 6px 10px rgba(0,0,0,0.5), inset 0 2px 4px rgba(255,255,255,0.15);
}

.cannon-body {
  position: absolute;
  bottom: 18%;
  left: 50%;
  width: 62%;
  height: 46%;
  transform: translateX(-50%);
  background: linear-gradient(160deg, #5a6478, #262a33 65%);
  clip-path: polygon(14% 0%, 86% 0%, 100% 32%, 100% 100%, 0% 100%, 0% 32%);
  border: 2px solid #14161c;
  box-shadow: 0 4px 10px rgba(0,0,0,0.5), inset 0 2px 5px rgba(255,255,255,0.15);
}

.cannon-status-light {
  position: absolute;
  top: 14%;
  right: 16%;
  width: 10%;
  height: 10%;
  border-radius: 50%;
  background: var(--magenta);
  box-shadow: 0 0 8px var(--magenta);
  animation: status-blink 1.4s ease-in-out infinite;
}

@keyframes status-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.25; }
}

.cannon-core-glow {
  position: absolute;
  bottom: 24%;
  left: 50%;
  width: 20%;
  height: 18%;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(circle, #fff, var(--cyan) 45%, transparent 75%);
  box-shadow: 0 0 14px var(--cyan), 0 0 28px var(--cyan);
  animation: core-pulse 1.8s ease-in-out infinite;
}

@keyframes core-pulse {
  0%, 100% { opacity: 0.75; transform: translateX(-50%) scale(0.9); }
  50% { opacity: 1; transform: translateX(-50%) scale(1.1); }
}

.cannon-barrel {
  position: absolute;
  bottom: 40%;
  left: 50%;
  width: 56%;
  height: 42%;
  transform: translateX(-50%);
  border-radius: 50% / 44%;
  background: radial-gradient(circle at 40% 30%, #aab2c0, #545c6c 55%, #1c1f26 100%);
  border: 3px solid #14161c;
  box-shadow: 0 8px 14px rgba(0,0,0,0.55), inset 0 4px 8px rgba(255,255,255,0.2);
}

.cannon-barrel-ring {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 70%;
  height: 70%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 3px dashed rgba(52,245,255,0.75);
  box-shadow: 0 0 10px rgba(52,245,255,0.5);
  animation: ring-spin 5s linear infinite;
}

@keyframes ring-spin {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

.cannon-muzzle-ring {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 48%;
  height: 48%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle at 42% 38%, #3a4049, #050506 72%);
  border: 4px solid #62697a;
  box-shadow: inset 0 0 12px rgba(0,0,0,0.9);
}

.cannon-muzzle-core {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 42%;
  height: 42%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, var(--cyan), rgba(52,245,255,0.2) 60%, transparent 80%);
  box-shadow: 0 0 16px var(--cyan);
  animation: core-pulse 1.6s ease-in-out infinite;
}

@keyframes gun-idle {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-4px) rotate(-1deg); }
}

.gun-sprite.recoil {
  animation: gun-recoil 0.28s ease;
}

@keyframes gun-recoil {
  0% { transform: translateY(0) rotate(-2deg); }
  20% { transform: translateY(18px) rotate(-6deg) scale(0.94); }
  100% { transform: translateY(0) rotate(-2deg); }
}

.muzzle-flash {
  position: absolute;
  bottom: 61%;
  left: 50%;
  transform: translateX(-50%);
  font-size: 3.4rem;
  opacity: 0;
  pointer-events: none;
}

.muzzle-flash.fire {
  animation: muzzle-fire 0.25s ease;
}

@keyframes muzzle-fire {
  0% { opacity: 1; transform: translateX(-50%) scale(0.6); }
  100% { opacity: 0; transform: translateX(-50%) scale(1.8); }
}

.tracer {
  position: absolute;
  bottom: 61%;
  left: 50%;
  width: 8px;
  height: 0;
  background: linear-gradient(180deg, #fff, var(--yellow), #ff8a00);
  transform: translateX(-50%);
  transform-origin: bottom center;
  opacity: 0;
  border-radius: 4px;
  box-shadow: 0 0 12px var(--yellow);
  pointer-events: none;
}

.tracer.fire {
  animation: tracer-shot 0.18s ease-out;
}

@keyframes tracer-shot {
  0% { opacity: 1; height: 0; }
  40% { opacity: 1; height: 46vh; }
  100% { opacity: 0; height: 46vh; }
}

.timer-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 24px;
  z-index: 5;
}

.timer-bar-track {
  flex: 1;
  height: 12px;
  border-radius: 6px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.2);
  overflow: hidden;
}

.timer-bar-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, var(--cyan), #8af9ff);
  transition: width 1s linear, background 0.3s ease;
}

.timer-bar-fill.timer-low {
  background: linear-gradient(90deg, var(--red), #ff8080);
}

.timer-value {
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  font-size: 1.2rem;
  min-width: 28px;
  text-align: center;
  color: var(--cyan);
}

.timer-value.timer-low {
  color: var(--red);
  text-shadow: 0 0 12px var(--red);
}

.question-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 20px 24px 28px;
  z-index: 5;
}

.question-text {
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(1.6rem, 5vw, 2.4rem);
  letter-spacing: 2px;
  text-shadow: 0 0 14px var(--cyan);
}

.answer-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(100px, 140px));
  gap: 14px;
  width: 100%;
  max-width: 360px;
  justify-content: center;
}

.answer-option {
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  font-size: 1.4rem;
  letter-spacing: 1px;
  padding: 14px 10px;
  min-height: 44px;
  border-radius: 10px;
  border: 2px solid var(--magenta);
  background: linear-gradient(160deg, rgba(255,46,136,0.25), rgba(20,10,20,0.6));
  color: var(--text-main);
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.15s ease;
  touch-action: manipulation;
}

.answer-option:hover {
  box-shadow: 0 0 20px var(--magenta);
  transform: translateY(-2px);
}

.answer-option:active {
  transform: translateY(0) scale(0.96);
}

.answer-option:disabled {
  cursor: default;
  opacity: 0.6;
  transform: none;
  box-shadow: none;
}

.answer-option.option-correct {
  border-color: var(--green);
  box-shadow: 0 0 20px var(--green);
  background: linear-gradient(160deg, rgba(51,255,136,0.3), rgba(10,20,14,0.6));
}

.answer-option.option-wrong {
  border-color: var(--red);
  box-shadow: 0 0 20px var(--red);
  background: linear-gradient(160deg, rgba(255,59,59,0.3), rgba(20,10,10,0.6));
}

/* ---------- GAME OVER SCREEN ---------- */

.gameover-title {
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(2.2rem, 7vw, 4.5rem);
  color: var(--red);
  text-shadow: 0 0 20px var(--red), 0 0 50px var(--red);
  margin: 0;
  letter-spacing: 4px;
}

.gameover-sub {
  color: #8ea2c9;
  margin-top: 10px;
  margin-bottom: 24px;
  font-size: 1.1rem;
}

.final-score {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.4rem;
  margin-bottom: 32px;
  color: var(--yellow);
  text-shadow: 0 0 12px var(--yellow);
}

#final-score-value {
  color: var(--cyan);
}

/* ---------- WIN SCREEN ---------- */

.confetti-layer {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 1;
}

.confetti-piece {
  position: absolute;
  top: -10%;
  left: var(--left, 50%);
  font-size: var(--size, 1.5rem);
  opacity: 0;
  animation: confetti-fall var(--duration, 3s) linear var(--delay, 0s) forwards;
}

@keyframes confetti-fall {
  0% { transform: translate(0, 0) rotate(0deg); opacity: 1; }
  100% { transform: translate(var(--drift, 40px), 130vh) rotate(var(--rotate, 360deg)); opacity: 0.9; }
}

.win-title {
  font-family: 'Orbitron', sans-serif;
  font-weight: 900;
  font-size: clamp(2.4rem, 7vw, 4.8rem);
  color: var(--green);
  text-shadow: 0 0 20px var(--green), 0 0 50px var(--yellow);
  margin: 0;
  letter-spacing: 4px;
  position: relative;
  z-index: 2;
  animation: win-title-pop 0.6s ease;
}

@keyframes win-title-pop {
  0% { transform: scale(0.4); opacity: 0; }
  60% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

.win-sub {
  color: var(--yellow);
  margin-top: 10px;
  margin-bottom: 24px;
  font-size: 1.1rem;
  position: relative;
  z-index: 2;
  text-align: center;
}

#screen-win .final-score,
#screen-win button {
  position: relative;
  z-index: 2;
}

/* ---------- RESPONSIVE: TABLET ---------- */

@media (max-width: 820px) {
  .screen {
    padding: 16px;
  }

  .rules-box {
    font-size: 0.95rem;
    padding: 14px 18px;
  }

  .difficulty-picker {
    gap: 14px;
  }

  .diff-btn {
    padding: 14px 22px;
  }

  .hud-top {
    padding: 12px 16px;
  }

  .timer-wrap {
    padding: 0 16px;
  }

  .question-wrap {
    padding: 14px 16px 20px;
  }

  .game-header {
    padding: 8px 12px 0;
  }
}

/* ---------- RESPONSIVE: PHONE (PORTRAIT) ---------- */

@media (max-width: 480px) {
  .game-subtitle {
    margin-bottom: 18px;
  }

  .rules-box {
    padding: 12px 16px;
    font-size: 0.85rem;
    margin-bottom: 20px;
  }

  .difficulty-picker {
    flex-direction: column;
    width: 100%;
    max-width: 300px;
    gap: 12px;
  }

  .diff-btn {
    flex-direction: row;
    justify-content: space-between;
    width: 100%;
    padding: 14px 20px;
  }

  .arena {
    border-radius: 0;
    border-left: none;
    border-right: none;
  }

  .hud-top {
    padding: 10px 12px;
  }

  .hud-label {
    font-size: 0.65rem;
    margin-right: 4px;
  }

  .score-wrap #score-value {
    font-size: 1.1rem;
  }

  .game-timer-value {
    font-size: 1.05rem;
  }

  .win-title {
    font-size: clamp(1.8rem, 8vw, 3rem);
  }

  .win-sub {
    font-size: 0.9rem;
    padding: 0 10px;
  }

  .monster-unit {
    font-size: 4rem;
  }

  .gun-sprite {
    width: clamp(64px, 30vw, 100px);
    height: clamp(48px, 22vw, 76px);
  }

  .muzzle-flash {
    font-size: 2.6rem;
  }

  .crosshair {
    font-size: 1.6rem;
  }

  .game-header {
    padding: 6px 10px 0;
  }

  .home-btn {
    width: 26px;
    height: 26px;
    font-size: 0.9rem;
    left: 8px;
  }

  .game-header-title {
    font-size: clamp(0.6rem, 3.2vw, 0.85rem);
  }

  .timer-wrap {
    padding: 0 12px;
    gap: 8px;
  }

  .question-wrap {
    padding: 10px 12px 16px;
    gap: 10px;
  }

  .answer-options {
    max-width: 280px;
    grid-template-columns: repeat(2, minmax(90px, 130px));
    gap: 10px;
  }

  .answer-option {
    padding: 12px 8px;
    font-size: 1.2rem;
  }
}

/* ---------- RESPONSIVE: SHORT / LANDSCAPE PHONE ---------- */

@media (max-height: 480px) {
  .game-title {
    font-size: clamp(1.4rem, 5vw, 2.2rem);
  }

  .game-subtitle {
    margin-bottom: 10px;
  }

  .rules-box {
    padding: 8px 14px;
    margin-bottom: 14px;
    font-size: 0.8rem;
  }

  .difficulty-picker {
    flex-direction: row;
  }

  .diff-btn {
    padding: 8px 16px;
  }

  .hud-top {
    padding: 6px 14px;
  }

  .game-timer-value {
    font-size: 0.95rem;
  }

  .win-title {
    font-size: clamp(1.6rem, 8vh, 2.4rem);
  }

  .win-sub {
    font-size: 0.8rem;
    margin-bottom: 12px;
  }

  .game-header {
    padding: 3px 12px 0;
  }

  .home-btn {
    width: 22px;
    height: 22px;
    font-size: 0.8rem;
    left: 6px;
  }

  .game-header-title {
    font-size: clamp(0.5rem, 2.4vh, 0.7rem);
    letter-spacing: 1px;
  }

  .monster-unit {
    font-size: 3.2rem;
  }

  .gun-sprite {
    width: clamp(56px, 24vh, 88px);
    height: clamp(42px, 18vh, 66px);
  }

  .question-text {
    font-size: clamp(1.1rem, 4vh, 1.6rem);
  }

  .question-wrap {
    padding: 6px 14px 10px;
    gap: 6px;
  }

  .answer-options {
    gap: 8px;
  }

  .answer-option {
    padding: 6px 8px;
    min-height: 36px;
    font-size: 1.1rem;
  }
}

