/* HUD do jogo em paisagem. Cores e formas seguem a referência visual. */
:root {
  --blue: #1e6bff;
  --red: #e0242b;
  --gold: #ffd000;
  --panel: rgba(8, 12, 22, 0.55);
  --ink: #ffffff;
}

/* Modo retrato: pede para girar o celular. */
#rotate {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100;
  background: #05070d;
  color: var(--ink);
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 20px;
  padding: 24px;
}
@media (orientation: portrait) {
  #rotate { display: flex; }
}

/* Camada do HUD: não recebe toques, exceto os botões. */
.hud {
  position: fixed;
  inset: 0;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
  font-family: system-ui, sans-serif;
  color: var(--ink);
  text-shadow: 0 1px 3px #000;
}

/* Placar no topo: time azul à esquerda, vermelho à direita, tempo no meio. */
.hud-top {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
}
.score {
  min-width: 64px;
  padding: 6px 14px;
  font-size: 30px;
  font-weight: 800;
  text-align: center;
  clip-path: polygon(10% 0, 100% 0, 90% 100%, 0 100%);
}
.score.blue { background: var(--blue); }
.score.red { background: var(--red); }
.clock {
  text-align: center;
  background: var(--panel);
  padding: 4px 16px;
  border-radius: 6px;
}
.clock .time { font-size: 26px; font-weight: 700; }
.clock .meta { font-size: 13px; opacity: 0.85; }

/* Pausa e radar no canto superior esquerdo. */
.pause {
  position: absolute;
  top: 10px;
  left: 10px;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: var(--panel);
  pointer-events: auto;
}
.radar {
  position: absolute;
  top: 8px;
  left: 64px;
  width: 128px;
  height: 128px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(20, 40, 30, 0.8) 0%, rgba(5, 10, 15, 0.8) 100%);
  border: 2px solid rgba(255, 255, 255, 0.25);
  overflow: hidden;
}
.radar .dot {
  position: absolute;
  width: 9px;
  height: 9px;
  margin: -4.5px 0 0 -4.5px;
  border-radius: 50%;
}
.radar .dot.blue { background: var(--blue); }
.radar .dot.red { background: var(--red); }
.radar .me {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0;
  height: 0;
  margin: -7px 0 0 -6px;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-bottom: 14px solid var(--ink);
}

/* Registro de abates, logo abaixo do radar. */
.feed {
  position: absolute;
  top: 146px;
  left: 10px;
  font-size: 13px;
  line-height: 1.5;
}
.feed .blue { color: #7fb2ff; }
.feed .red { color: #ff7d7d; }

/* Painel de armas no canto superior direito. */
.weapons {
  position: absolute;
  top: 8px;
  right: 10px;
  width: 170px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.weapon-slot {
  background: var(--panel);
  border-radius: 6px;
  padding: 6px 10px;
  text-align: right;
}
.weapon-slot .name { font-size: 12px; opacity: 0.85; }
.weapon-slot .ammo { font-size: 22px; font-weight: 800; }
.weapon-slot.active { outline: 2px solid var(--gold); }

/* Botões redondos de toque. pointer-events liberado só para eles. */
.btn {
  position: absolute;
  width: 74px;
  height: 74px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  border: 2px solid rgba(255, 255, 255, 0.35);
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  pointer-events: auto;
  touch-action: none;
}
.btn.pressed { background: rgba(255, 208, 0, 0.45); }
.btn.fire {
  width: 110px;
  height: 110px;
  background: rgba(224, 36, 43, 0.5);
  border-color: rgba(255, 255, 255, 0.6);
}
.btn.aim { right: 26px; top: 40%; }
.btn.jump { right: 130px; bottom: 150px; }
.btn.crouch { right: 130px; bottom: 56px; }
.btn.reload { right: 34px; bottom: 210px; }
.btn.fire { right: 20px; bottom: 26px; }

/* Joystick à esquerda: base fixa e manete que acompanha o dedo. */
.joy-base {
  position: absolute;
  left: 40px;
  bottom: 40px;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.3);
}
.joy-knob {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 60px;
  height: 60px;
  margin: -30px 0 0 -30px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
}

/* Barra de vida embaixo, no centro. */
.health {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  width: 320px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  font-weight: 700;
}
.health .bar {
  flex: 1;
  height: 12px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 6px;
  overflow: hidden;
}
.health .fill {
  height: 100%;
  width: 100%;
  background: #3ddc4f;
  transition: width 0.15s;
}

/* Mira no centro. */
.crosshair {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 24px;
  height: 24px;
  margin: -12px 0 0 -12px;
}
.crosshair::before,
.crosshair::after {
  content: '';
  position: absolute;
  background: var(--ink);
  box-shadow: 0 0 2px #000;
}
.crosshair::before { left: 11px; top: 0; width: 2px; height: 24px; }
.crosshair::after { top: 11px; left: 0; height: 2px; width: 24px; }

/* Telas de menu, pausa, placar, vitória e derrota. */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 14px;
  background: rgba(5, 8, 15, 0.82);
  color: var(--ink);
  pointer-events: auto;
}
.overlay.show { display: flex; }
.overlay .title { font-size: 44px; font-weight: 900; letter-spacing: 1px; }
.overlay .sub { font-size: 18px; opacity: 0.9; }
.menu-btn {
  width: 320px;
  padding: 14px 0;
  border: none;
  border-radius: 8px;
  background: var(--gold);
  color: #111;
  font-size: 20px;
  font-weight: 800;
  pointer-events: auto;
}
.menu-btn.secondary {
  background: rgba(255, 255, 255, 0.18);
  color: var(--ink);
}
.result.win .title { color: var(--blue); }
.result.lose .title { color: var(--red); }
