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

body {
  font-family: 'Courier New', Courier, monospace;
  overflow: hidden;
  background: #0b0b0b;
  color: #fff;
  user-select: none;
  -webkit-user-select: none;
}

#game-container { position: fixed; inset: 0; }
canvas { display: block; }

/* ============================================================
   MENU ESTILO ZUMBI BLOCKS 2
   ============================================================ */
.menu-overlay {
  position: fixed; inset: 0;
  background: #1a1a1a;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 100;
}
.menu-overlay.hidden { display: none; }

.menu-container {
  text-align: center;
  border: 4px solid #cc0000;
  padding: 40px 50px;
  background: #0b0b0b;
  box-shadow: 0 0 30px rgba(204, 0, 0, 0.5);
  min-width: 380px;
}
.menu-container h1 {
  color: #cc0000;
  font-size: 2.6rem;
  margin-bottom: 12px;
  text-shadow: 3px 3px #000;
  letter-spacing: 2px;
}
.menu-subtitle {
  color: #888;
  font-size: 0.85rem;
  margin-bottom: 28px;
  letter-spacing: 2px;
}
.menu-btn {
  display: block;
  width: 240px;
  padding: 15px;
  margin: 12px auto;
  background: #222;
  color: #fff;
  border: 2px solid #555;
  cursor: pointer;
  font-size: 1rem;
  font-weight: bold;
  font-family: inherit;
  letter-spacing: 2px;
  transition: 0.25s;
}
.menu-btn:hover {
  background: #cc0000;
  border-color: #ff3333;
  box-shadow: 0 0 15px #cc0000;
  transform: scale(1.03);
}
.menu-btn:active { transform: scale(0.98); }

/* ============================================================
   HUD
   ============================================================ */
#hud {
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 10;
  font-family: 'Courier New', monospace;
}
#hud.hidden { display: none; }

/* Timer no topo centro */
#timer {
  position: absolute;
  top: 12px; left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.5);
  padding: 4px 18px;
  color: #ffdd00;
  font-size: 20px;
  font-weight: bold;
  letter-spacing: 2px;
  text-shadow: 2px 2px 0 #000;
  border: 2px solid rgba(255, 255, 255, 0.3);
}

/* Vida embaixo esquerda */
#hud-health {
  position: absolute;
  bottom: 20px; left: 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.hp-bar {
  width: 240px; height: 22px;
  background: rgba(0, 0, 0, 0.6);
  border: 3px solid #000;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.2);
}
.hp-fill {
  height: 100%;
  background: linear-gradient(180deg, #ff4444, #aa0000);
  width: 100%;
  transition: width 0.15s;
}
#hp-text {
  font-size: 12px;
  font-weight: bold;
  color: #fff;
  text-shadow: 2px 2px 0 #000;
  letter-spacing: 1px;
}

/* Munição embaixo direita */
#hud-ammo {
  position: absolute;
  bottom: 20px; right: 20px;
  font-size: 42px;
  font-weight: bold;
  color: #ffffff;
  text-shadow: 3px 3px 0 #000;
  display: flex;
  align-items: baseline;
  gap: 6px;
}
#ammo-sep { font-size: 26px; color: #888; }
#ammo-max { font-size: 26px; color: #888; }
#ammo-current { color: #ffffff; }
#ammo-current.reloading { color: #ffaa00; }

/* Info topo esquerda */
#hud-info {
  position: absolute;
  top: 12px; left: 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 14px;
  font-weight: bold;
  text-shadow: 2px 2px 0 #000;
  letter-spacing: 1px;
}
#hud-info > div {
  background: rgba(0, 0, 0, 0.45);
  padding: 3px 10px;
  border-left: 3px solid #cc0000;
}

/* Barra de XP (rodapé) */
#xp-bar {
  position: absolute;
  bottom: 0; left: 0;
  width: 100%; height: 5px;
  background: rgba(0, 0, 0, 0.6);
}
#xp-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #3498db, #5dade2);
  transition: width 0.2s;
}

/* Crosshair ZB2 (linhas em cruz com espaço no meio) */
#crosshair {
  position: absolute;
  top: 50%; left: 50%;
  width: 26px; height: 26px;
  transform: translate(-50%, -50%);
}
.ch-line {
  position: absolute;
  background: #fff;
  box-shadow: 0 0 3px #000, 0 0 1px #000;
}
.ch-top    { top: 0; left: 50%; width: 2px; height: 8px; transform: translateX(-50%); }
.ch-bottom { bottom: 0; left: 50%; width: 2px; height: 8px; transform: translateX(-50%); }
.ch-left   { left: 0; top: 50%; width: 8px; height: 2px; transform: translateY(-50%); }
.ch-right  { right: 0; top: 50%; width: 8px; height: 2px; transform: translateY(-50%); }

/* Hit marker */
#hit-marker {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%) scale(0);
  color: #ffffff;
  font-size: 30px;
  font-weight: bold;
  text-shadow: 0 0 6px #cc0000, 0 0 3px #000;
  opacity: 0;
  pointer-events: none;
}
#hit-marker.active {
  animation: hitPop 0.25s ease-out;
}
@keyframes hitPop {
  0%   { opacity: 1; transform: translate(-50%, -50%) scale(0.5); }
  50%  { opacity: 1; transform: translate(-50%, -50%) scale(1.2); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1); }
}

/* Flash de dano (borda vermelha) */
#damage-flash {
  position: absolute; inset: 0;
  pointer-events: none;
  box-shadow: inset 0 0 0 rgba(255, 0, 0, 0);
  transition: box-shadow 0.35s ease-out;
}
#damage-flash.active {
  box-shadow: inset 0 0 150px rgba(200, 0, 0, 0.85);
  transition: box-shadow 0.04s;
}

/* Banner de horda */
#wave-banner {
  position: fixed;
  top: 28%; left: 50%;
  transform: translate(-50%, -50%) scale(0.7);
  padding: 18px 55px;
  background: rgba(0, 0, 0, 0.85);
  border: 3px solid #cc0000;
  color: #cc0000;
  font-family: 'Courier New', monospace;
  font-size: 38px;
  font-weight: bold;
  letter-spacing: 6px;
  text-shadow: 0 0 25px #cc0000, 3px 3px #000;
  z-index: 50;
  pointer-events: none;
  opacity: 0;
  transition: all 0.35s ease-out;
}
#wave-banner.hidden { display: none; }
#wave-banner.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

/* ============================================================
   MOBILE
   ============================================================ */
#mobile-controls {
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 20;
}
#mobile-controls.hidden { display: none; }
#joystick-zone {
  position: absolute;
  bottom: 100px; left: 30px;
  pointer-events: auto;
}
#joystick-base {
  width: 130px; height: 130px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  border: 3px solid rgba(255, 255, 255, 0.4);
  position: relative;
  touch-action: none;
}
#joystick-stick {
  width: 55px; height: 55px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.75);
  border: 2px solid rgba(0, 0, 0, 0.4);
  position: absolute;
  top: 50%; left: 50%;
  margin-left: -27px;
  margin-top: -27px;
  pointer-events: none;
}
#look-zone {
  position: absolute;
  top: 0; right: 0;
  width: 55%; height: 100%;
  pointer-events: auto;
  touch-action: none;
}
#btn-attack {
  position: absolute;
  bottom: 40px; right: 40px;
  width: 100px; height: 100px;
  border-radius: 50%;
  background: rgba(204, 0, 0, 0.75);
  border: 3px solid rgba(255, 255, 255, 0.6);
  color: #fff;
  font-size: 38px;
  pointer-events: auto;
  cursor: pointer;
  touch-action: none;
  box-shadow: 0 0 15px rgba(204, 0, 0, 0.6);
}
#btn-attack:active {
  background: rgba(255, 50, 50, 0.95);
  transform: scale(0.94);
}
/* Hit marker crítico — fica vermelho e maior */
#hit-marker.critical {
  color: #ff2200;
  font-size: 44px;
  text-shadow: 0 0 12px #ff0000, 0 0 6px #000;
}
