/* public/css/game.css - In-Game HUD, Lobby Screen, and Mobile Touch Layout */

/* Fullscreen Game Screen */
#game-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 150;
  background: #000;
  overflow: hidden;
  touch-action: none;
}

#game-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* In-Game HUD Overlay */
.hud-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 160;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 16px 20px;
}

/* Interactive elements inside HUD */
.hud-interactive {
  pointer-events: auto;
}

/* Top HUD Bar */
.hud-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.hud-top-center {
  display: flex;
  align-items: center;
  gap: 20px;
  background: rgba(11, 16, 32, 0.8);
  border: 1px solid rgba(0, 229, 255, 0.3);
  padding: 8px 24px;
  border-radius: 30px;
  backdrop-filter: blur(8px);
}

.hud-timer-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 900;
  color: var(--neon-cyan);
  text-shadow: 0 0 10px rgba(0, 229, 255, 0.5);
}

.hud-alive-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: #FFFFFF;
}

.hud-alive-val {
  color: var(--action-orange);
  font-weight: 900;
}

.hud-btn-pause {
  background: rgba(14, 23, 48, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #fff;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.hud-btn-pause:hover {
  background: rgba(0, 229, 255, 0.2);
  border-color: var(--neon-cyan);
}

/* Killfeed Top Right */
.hud-killfeed {
  position: absolute;
  top: 70px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 340px;
}

.killfeed-entry {
  background: rgba(11, 16, 32, 0.85);
  border-left: 3px solid var(--neon-cyan);
  padding: 6px 12px;
  border-radius: 4px;
  font-family: var(--font-display);
  font-size: 11px;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: slideInRight 0.25s ease;
  transition: opacity 0.3s;
}

.killfeed-entry.fade-out {
  opacity: 0;
}

.killfeed-entry .killer {
  color: var(--neon-cyan);
  font-weight: 800;
}

.killfeed-entry .weapon-ico {
  color: var(--action-orange);
  font-size: 10px;
}

.killfeed-entry .victim {
  color: #BAC7D5;
}

@keyframes slideInRight {
  from { transform: translateX(40px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Bottom HUD Area */
.hud-bottom-bar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  width: 100%;
}

/* Health, Shield & Weapon Status (Bottom Left) */
.hud-combat-status {
  background: rgba(11, 16, 32, 0.85);
  border: 1px solid rgba(0, 229, 255, 0.3);
  border-radius: 12px;
  padding: 14px 18px;
  width: 280px;
  backdrop-filter: blur(8px);
}

.hud-bar-row {
  margin-bottom: 8px;
}

.hud-bar-label-row {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--text-muted);
}

.hud-progress-bg {
  width: 100%;
  height: 10px;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 5px;
  overflow: hidden;
  position: relative;
}

.hud-progress-hp {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #FF0055, #FFEA00, #00FF66);
  transition: width 0.15s ease-out;
}

.hud-progress-shield {
  height: 100%;
  width: 0%;
  background: var(--neon-cyan);
  box-shadow: 0 0 10px var(--neon-cyan);
  transition: width 0.15s ease-out;
}

.hud-weapon-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.hud-weapon-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hud-weapon-name {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 800;
  color: var(--neon-cyan);
}

/* Active Buffs (Bottom Right) */
.hud-buffs-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end;
}

.buff-icon {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 12px;
  background: rgba(11, 16, 32, 0.85);
  border: 1px solid;
  animation: pulseBuff 1s infinite alternate;
}

.buff-icon.speed { color: var(--neon-yellow); border-color: var(--neon-yellow); }
.buff-icon.rapid { color: var(--neon-red); border-color: var(--neon-red); }
.buff-icon.invis { color: var(--neon-purple); border-color: var(--neon-purple); }
.buff-icon.mega { color: var(--action-orange); border-color: var(--action-orange); }

@keyframes pulseBuff {
  from { transform: scale(1); }
  to { transform: scale(1.06); }
}

/* Zone Warning Banner */
.zone-warning-banner {
  position: absolute;
  top: 90px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255, 0, 85, 0.9);
  color: #fff;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 2px;
  padding: 10px 28px;
  border-radius: 30px;
  border: 2px solid #FFFFFF;
  box-shadow: 0 0 25px rgba(255, 0, 85, 0.8);
  display: none;
  z-index: 170;
  animation: bannerPulse 0.5s infinite alternate;
}

@keyframes bannerPulse {
  from { opacity: 0.8; transform: translateX(-50%) scale(0.98); }
  to { opacity: 1; transform: translateX(-50%) scale(1.02); }
}

/* Countdown Overlay */
.countdown-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  display: none;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 110px;
  font-weight: 900;
  color: var(--neon-cyan);
  text-shadow: 0 0 40px var(--neon-cyan);
  z-index: 180;
  pointer-events: none;
}

/* Mobile Virtual Joystick & Touch Controls */
.mobile-controls-layer {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  display: none; /* Enabled on mobile touch detection */
  z-index: 165;
}

.mobile-joystick-zone {
  position: absolute;
  bottom: 40px;
  left: 30px;
  width: 130px;
  height: 130px;
  border-radius: 50%;
  background: rgba(0, 229, 255, 0.08);
  border: 2px dashed rgba(0, 229, 255, 0.35);
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mobile-joystick-nub {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--neon-cyan);
  box-shadow: 0 0 15px var(--neon-cyan);
  pointer-events: none;
  transition: transform 0.04s ease-out;
}

.mobile-action-buttons {
  position: absolute;
  bottom: 40px;
  right: 30px;
  display: flex;
  gap: 16px;
  align-items: flex-end;
  pointer-events: auto;
}

.mobile-btn-circle {
  border-radius: 50%;
  font-family: var(--font-display);
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: none;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

.mobile-btn-dash {
  width: 60px;
  height: 60px;
  font-size: 13px;
  background: rgba(255, 122, 0, 0.25);
  border: 2px solid var(--action-orange);
  color: var(--action-orange);
}

.mobile-btn-switch {
  width: 50px;
  height: 50px;
  font-size: 12px;
  background: rgba(180, 0, 255, 0.25);
  border: 2px solid var(--neon-purple);
  color: #fff;
}

.mobile-btn-fire {
  width: 78px;
  height: 78px;
  font-size: 16px;
  background: var(--neon-cyan);
  color: #000;
  box-shadow: 0 0 20px rgba(0, 229, 255, 0.6);
}

/* ===================================================
   LOBBY SCREEN STYLING
=================================================== */
#lobby-screen {
  max-width: 1100px;
  margin: 30px auto;
  padding: 0 20px;
  position: relative;
  z-index: 1;
}

.lobby-header-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.lobby-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.lobby-code-display-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--neon-cyan);
  padding: 8px 18px;
  border-radius: 8px;
}

.lobby-code-text {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 900;
  color: var(--neon-cyan);
  letter-spacing: 4px;
  text-shadow: 0 0 10px rgba(0, 229, 255, 0.6);
}

.lobby-content-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
}

.lobby-player-slots-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.lobby-player-card {
  background: rgba(14, 23, 48, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: all 0.2s;
}

.lobby-player-card.ready {
  border-color: var(--neon-green);
  box-shadow: 0 0 12px rgba(0, 255, 102, 0.2);
}

.lobby-player-card.empty {
  opacity: 0.5;
  border-style: dashed;
}

.slot-avatar-wrap {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid var(--neon-cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  background: #000;
}

.slot-avatar-wrap.empty {
  border-color: rgba(255, 255, 255, 0.2);
  color: var(--text-muted);
}

.slot-info {
  flex: 1;
}

.slot-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.slot-name {
  font-weight: 700;
  font-size: 15px;
}

.host-crown {
  font-size: 11px;
  font-family: var(--font-display);
  font-weight: 800;
  color: var(--neon-yellow);
}

.badge {
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 10px;
}

.badge-bot { background: rgba(255, 122, 0, 0.2); color: var(--action-orange); border: 1px solid var(--action-orange); }
.badge-human { background: rgba(0, 229, 255, 0.2); color: var(--neon-cyan); border: 1px solid var(--neon-cyan); }
.badge-online { background: rgba(255, 122, 0, 0.2); color: var(--action-orange); }
.badge-mixed { background: rgba(180, 0, 255, 0.2); color: var(--neon-purple); }

.slot-status {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 800;
}

.status-ready { color: var(--neon-green); text-shadow: 0 0 6px var(--neon-green); }
.status-waiting { color: var(--text-muted); }

/* Lobby Sidebar */
.lobby-sidebar {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.lobby-chat-box {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  height: 320px;
  overflow: hidden;
}

.lobby-chat-messages {
  flex: 1;
  padding: 14px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 14px;
}

.chat-msg .chat-sender {
  font-weight: 700;
  color: var(--neon-cyan);
}

.chat-msg .chat-sender.host {
  color: var(--neon-yellow);
}

.chat-msg.system {
  color: var(--action-orange);
  font-style: italic;
}

.lobby-chat-form {
  display: flex;
  border-top: 1px solid var(--card-border);
}

.lobby-chat-input {
  flex: 1;
  background: rgba(0, 0, 0, 0.4);
  border: none;
  padding: 10px 14px;
  color: #fff;
  outline: none;
}

.lobby-chat-send-btn {
  background: var(--neon-cyan);
  border: none;
  color: #000;
  font-family: var(--font-display);
  font-weight: 800;
  padding: 0 16px;
  cursor: pointer;
}

/* ===================================================
   GAME OVER SCREEN STYLING
=================================================== */
.gameover-dialog {
  max-width: 540px;
  text-align: center;
}

.title-victory {
  color: var(--neon-green);
  text-shadow: 0 0 25px rgba(0, 255, 102, 0.8);
  font-size: 32px;
}

.title-defeat {
  color: var(--neon-red);
  text-shadow: 0 0 25px rgba(255, 0, 85, 0.8);
  font-size: 32px;
}

.gameover-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 24px 0;
}

.stat-box {
  background: rgba(6, 10, 20, 0.8);
  border: 1px solid rgba(0, 229, 255, 0.2);
  border-radius: 8px;
  padding: 14px 8px;
}

.stat-box-val {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 900;
  color: var(--neon-cyan);
  margin-bottom: 4px;
}

.stat-box-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
}

