* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: #000;
  font-family: 'Share Tech Mono', monospace;
  color: #fff;
  touch-action: none; /* Desativa zoom acidental ao tocar no celular */
}

/* 1. CÂMERA DO MUNDO REAL (100% DA TELA DO CELULAR) */
#cameraFeed {
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  object-fit: cover;
  z-index: 1;
}

/* 2. THREE.JS 3D VIEWPORT */
#threeCanvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 5;
  pointer-events: none;
}

/* 3. CANVAS 2D AR */
#arHudCanvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 6;
  pointer-events: none;
}

/* 4. RETÍCULO DINÂMICO QUE SEGUE O CLIQUE/TOQUE DO DEDO NA TELA */
.screen-crosshair {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 52px;
  height: 52px;
  pointer-events: none;
  z-index: 10;
  transition: transform 0.08s ease-out, border-color 0.15s ease;
}

.crosshair-ring {
  width: 100%;
  height: 100%;
  border: 2px dashed rgba(0, 243, 255, 0.7);
  border-radius: 50%;
  animation: rotateCrosshair 10s linear infinite;
}

@keyframes rotateCrosshair {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.crosshair-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 6px;
  height: 6px;
  background: #00f3ff;
  border-radius: 50%;
  box-shadow: 0 0 10px #00f3ff;
}

.screen-crosshair.locked .crosshair-ring {
  border-color: #ff0055;
  box-shadow: 0 0 16px rgba(255, 0, 85, 0.8);
}

.screen-crosshair.locked .crosshair-center {
  background: #ff0055;
  box-shadow: 0 0 10px #ff0055;
}

/* 5. OVERLAY DE LUZ TOTALMENTE BRANCA (FLASHBANG CEGANTE PARA TODOS) */
.blind-flash-overlay {
  position: absolute;
  inset: 0;
  background: #ffffff;
  opacity: 0;
  pointer-events: none;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.15s ease-out;
}

.blind-flash-overlay.active {
  opacity: 0.98;
}

.blind-text {
  font-family: 'Orbitron', sans-serif;
  color: #ff0055;
  font-size: 1.2rem;
  font-weight: 900;
  letter-spacing: 2px;
  text-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
  animation: flashPulse 0.5s infinite alternate;
}

@keyframes flashPulse {
  0% { transform: scale(0.95); opacity: 0.8; }
  100% { transform: scale(1.05); opacity: 1; }
}

/* 6. AVISO SUTIL DO BOW-OS */
.bow-os-pill {
  position: absolute;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(10, 16, 26, 0.9);
  border: 1px solid rgba(0, 243, 255, 0.4);
  backdrop-filter: blur(8px);
  padding: 6px 14px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 20;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.bow-os-pill.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(-15px);
}

.bow-os-pill .msg {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.72rem;
  letter-spacing: 1px;
  color: #00f3ff;
  font-weight: bold;
}

/* 7. CONTROLES DE CONSTRUÇÃO */
.build-bar {
  position: absolute;
  bottom: 84px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 25, 40, 0.92);
  border: 1px solid #ffe600;
  padding: 8px 14px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 25;
  box-shadow: 0 0 20px rgba(255, 230, 0, 0.4);
}

.build-bar.hidden { display: none; }

.build-label {
  font-size: 0.75rem;
  color: #ffe600;
  font-family: 'Orbitron', sans-serif;
  font-weight: bold;
}

.btn-build {
  padding: 6px 12px;
  border-radius: 4px;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.72rem;
  font-weight: bold;
  border: none;
  cursor: pointer;
}

.btn-build.ok { background: #00ff66; color: #000; }
.btn-build.no { background: #ff0055; color: #fff; }

/* 8. EFEITOS DE DANO & HITMARKER */
.damage-overlay {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle, transparent 30%, rgba(255, 0, 85, 0.85) 100%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease-out;
  z-index: 18;
}

.damage-overlay.active { opacity: 1; }

.hitmarker-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  z-index: 19;
}

.hitmarker-overlay.active { opacity: 1; }

.hitmarker-overlay::before, .hitmarker-overlay::after {
  content: '';
  position: absolute;
  width: 24px;
  height: 2.5px;
  background: #ff0055;
  box-shadow: 0 0 8px #ff0055;
}

.hitmarker-overlay::before { transform: rotate(45deg); }
.hitmarker-overlay::after { transform: rotate(-45deg); }

/* 9. BARRA DE HUD MÍNIMA TOUCH-FRIENDLY PARA CELULAR */
.mobile-hud {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(8, 14, 25, 0.85);
  border: 1px solid rgba(0, 243, 255, 0.3);
  backdrop-filter: blur(12px);
  padding: 8px 16px;
  border-radius: 32px;
  display: flex;
  align-items: center;
  gap: 16px;
  z-index: 20;
  box-shadow: 0 4px 25px rgba(0, 0, 0, 0.7);
  max-width: 95vw;
}

.hud-stat {
  display: flex;
  align-items: center;
  gap: 5px;
}

.hud-stat .emoji {
  font-size: 1.15rem;
}

.hud-stat .val {
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  color: #fff;
  font-size: 0.88rem;
}

.hud-stat .sub {
  font-size: 0.62rem;
  color: #8da4be;
  margin-left: 2px;
}

.hud-stat.action-btn {
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  transition: background 0.15s, transform 0.1s;
}

.hud-stat.action-btn:active {
  transform: scale(0.9);
  background: rgba(0, 243, 255, 0.25);
}

/* DICA NA TELA */
.mobile-shoot-hint {
  position: absolute;
  bottom: 64px;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.72rem;
  color: rgba(0, 243, 255, 0.8);
  pointer-events: none;
  z-index: 15;
  background: rgba(0, 0, 0, 0.4);
  padding: 2px 10px;
  border-radius: 10px;
}

/* 10. MODAL LOBBY RESPONSIVO MOBILE */
.lobby-overlay {
  position: absolute;
  inset: 0;
  background: rgba(3, 7, 15, 0.95);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 16px;
}

.lobby-overlay.hidden { display: none; }

.lobby-sheet {
  background: #091322;
  border: 1px solid rgba(0, 243, 255, 0.4);
  padding: 24px 20px;
  border-radius: 14px;
  width: 100%;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: 0 0 35px rgba(0, 243, 255, 0.25);
}

.lobby-sheet .title {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.15rem;
  color: #00f3ff;
  font-weight: 900;
  text-align: center;
}

.lobby-sheet .subtitle {
  font-size: 0.8rem;
  color: #8da4be;
  text-align: center;
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-row label {
  font-size: 0.72rem;
  color: #00f3ff;
  font-family: 'Orbitron', sans-serif;
}

.form-row input {
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(0, 243, 255, 0.3);
  color: #fff;
  padding: 12px;
  border-radius: 8px;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.95rem;
  outline: none;
}

.form-row input:focus {
  border-color: #00f3ff;
  box-shadow: 0 0 10px rgba(0, 243, 255, 0.5);
}

.safe-warning {
  background: rgba(255, 230, 0, 0.08);
  border: 1px solid rgba(255, 230, 0, 0.3);
  padding: 8px 10px;
  border-radius: 6px;
  color: #ffe600;
  font-size: 0.75rem;
  line-height: 1.3;
}

.btn-join {
  background: linear-gradient(135deg, #00f3ff, #0077aa);
  border: none;
  padding: 14px;
  border-radius: 8px;
  color: #000;
  font-family: 'Orbitron', sans-serif;
  font-weight: 900;
  font-size: 0.92rem;
  cursor: pointer;
  letter-spacing: 1px;
  margin-top: 4px;
}
