* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { overflow: hidden; background: #0a0a0f; font-family: 'Segoe UI', 'Arial', sans-serif; color: #e0e0e0; height: 100%; }

/* ===== LOBBY ===== */
#lobby {
  display: flex; align-items: center; justify-content: center;
  height: 100vh;
  background: linear-gradient(135deg, #0a0a1a 0%, #1a1a2e 50%, #16213e 100%);
}
.lobby-box {
  background: rgba(20, 20, 40, 0.95);
  border: 1px solid rgba(100, 200, 255, 0.2);
  border-radius: 12px;
  padding: 40px;
  width: 420px;
  text-align: center;
}
.lobby-box h1 {
  font-size: 42px;
  color: #ff6b35;
  text-shadow: 0 0 20px rgba(255, 107, 53, 0.4);
  margin-bottom: 4px;
}
.subtitle {
  color: #888;
  margin-bottom: 24px;
  font-size: 14px;
}
#input-name {
  width: 100%;
  padding: 12px 16px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 8px;
  color: #fff;
  font-size: 16px;
  outline: none;
  margin-bottom: 12px;
}
#input-name:focus { border-color: #ff6b35; }
#input-name::placeholder { color: #666; }

.btn-primary {
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, #ff6b35, #e63946);
  border: none;
  border-radius: 8px;
  color: #fff;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: transform 0.1s;
}
.btn-primary:hover { transform: scale(1.02); }
.btn-primary:active { transform: scale(0.98); }

.btn-secondary {
  width: 100%;
  padding: 10px;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 8px;
  color: #aaa;
  font-size: 14px;
  cursor: pointer;
  margin-top: 12px;
}
.btn-secondary:hover { border-color: #ff6b35; color: #ff6b35; }

#room-list {
  margin: 20px 0 8px;
  max-height: 300px;
  overflow-y: auto;
}
.room-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  margin-bottom: 6px;
  cursor: pointer;
  transition: border-color 0.2s;
}
.room-item:hover { border-color: #ff6b35; }
.room-name { font-weight: 600; }
.room-count { color: #888; font-size: 13px; }
.room-playing { color: #4ecca3; font-size: 11px; }

/* ===== GAME ===== */
#game-container { position: relative; width: 100vw; height: 100vh; }
#renderCanvas { width: 100%; height: 100%; display: block; outline: none; }

/* ===== HUD ===== */
#hud { position: absolute; top: 0; left: 0; right: 0; bottom: 0; pointer-events: none; z-index: 10; }

#crosshair {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-size: 28px; color: rgba(255,255,255,0.8);
  text-shadow: 0 0 4px rgba(0,0,0,0.8);
  font-family: monospace;
  user-select: none;
}

#hp-container {
  position: absolute; bottom: 30px; left: 30px;
  display: flex; align-items: center; gap: 10px;
}
#hp-bar {
  width: 200px; height: 12px;
  background: rgba(0,0,0,0.6);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 6px;
  overflow: hidden;
}
#hp-fill {
  height: 100%; width: 100%;
  background: linear-gradient(90deg, #e63946, #ff6b35);
  border-radius: 6px;
  transition: width 0.2s;
}
#hp-text {
  font-size: 18px; font-weight: bold;
  text-shadow: 0 0 6px rgba(0,0,0,0.8);
}

#ammo-container {
  position: absolute; bottom: 30px; right: 30px;
  font-size: 24px; font-weight: bold;
  text-shadow: 0 0 6px rgba(0,0,0,0.8);
}
#ammo { font-size: 32px; }

#scoreboard {
  position: absolute; top: 16px; left: 50%;
  transform: translateX(-50%);
  display: flex; align-items: center; gap: 10px;
  background: rgba(0,0,0,0.5);
  padding: 8px 20px;
  border-radius: 8px;
  font-size: 18px; font-weight: bold;
}
.team-red { color: #ff5555; }
.team-blue { color: #5588ff; }
.vs { color: #666; }
#red-score { color: #ff5555; font-size: 24px; }
#blue-score { color: #5588ff; font-size: 24px; }

#timer {
  position: absolute; top: 56px; left: 50%;
  transform: translateX(-50%);
  font-size: 14px; color: #aaa;
  text-shadow: 0 0 4px rgba(0,0,0,0.8);
}

#kill-feed {
  position: absolute; top: 80px; right: 20px;
  display: flex; flex-direction: column; gap: 4px;
  align-items: flex-end;
}
.kill-entry {
  background: rgba(0,0,0,0.6);
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 13px;
  animation: killFadeIn 0.3s ease;
  white-space: nowrap;
}
@keyframes killFadeIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }

#reload-indicator {
  position: absolute; bottom: 80px; left: 50%;
  transform: translateX(-50%);
  font-size: 16px; color: #f5c542;
  text-shadow: 0 0 10px rgba(245,197,66,0.5);
  animation: reloadPulse 0.6s infinite;
}
@keyframes reloadPulse { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }

#damage-flash {
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  background: radial-gradient(ellipse at center, transparent 40%, rgba(255,0,0,0.4) 100%);
  opacity: 0;
  transition: opacity 0.15s;
  pointer-events: none;
}
#damage-flash.active { opacity: 1; }

#hit-marker {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-size: 20px; color: #ff4444;
  text-shadow: 0 0 4px rgba(255,0,0,0.8);
}

#team-indicator {
  position: absolute; top: 16px; left: 20px;
  font-size: 14px; font-weight: bold;
  padding: 4px 12px;
  border-radius: 4px;
}
#team-indicator.red { background: rgba(255,50,50,0.3); color: #ff5555; border: 1px solid rgba(255,50,50,0.4); }
#team-indicator.blue { background: rgba(50,80,255,0.3); color: #5588ff; border: 1px solid rgba(50,80,255,0.4); }

#kd-display {
  position: absolute; bottom: 60px; left: 30px;
  font-size: 13px; color: #aaa;
  text-shadow: 0 0 4px rgba(0,0,0,0.8);
}

/* ===== OVERLAYS ===== */
#death-screen {
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(100, 0, 0, 0.5);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  z-index: 20;
}
.death-text {
  font-size: 64px; font-weight: bold; color: #ff3333;
  text-shadow: 0 0 30px rgba(255,0,0,0.5);
  animation: deathPulse 1s ease;
}
@keyframes deathPulse { from { transform: scale(1.5); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.death-killer { font-size: 20px; color: #ffaa88; margin-top: 12px; }
.death-respawn { font-size: 14px; color: #888; margin-top: 8px; }

#pause-menu {
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex; align-items: center; justify-content: center;
  z-index: 30;
}
.pause-box { text-align: center; }
.pause-text {
  font-size: 36px; font-weight: bold; color: #ff6b35;
  text-shadow: 0 0 20px rgba(255,107,53,0.4);
  margin-bottom: 16px;
}
.pause-hint { color: #888; font-size: 14px; line-height: 1.8; margin-bottom: 20px; }
#pause-menu .btn-secondary { width: auto; padding: 8px 24px; pointer-events: auto; }

#game-over {
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex; align-items: center; justify-content: center;
  z-index: 40;
}
.gameover-box { text-align: center; }
#winner-text {
  font-size: 48px; font-weight: bold;
  text-shadow: 0 0 30px currentColor;
  margin-bottom: 12px;
}
#final-score { font-size: 24px; color: #ccc; margin-bottom: 24px; }
#game-over .btn-primary { width: auto; padding: 12px 32px; pointer-events: auto; }

/* ===== TAB SCOREBOARD ===== */
#tab-scoreboard {
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.75);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  z-index: 25;
  pointer-events: none;
}
.sb-header {
  font-size: 28px; font-weight: bold; color: #ff6b35;
  text-shadow: 0 0 15px rgba(255,107,53,0.3);
  margin-bottom: 20px;
  letter-spacing: 3px;
}
.sb-teams {
  display: flex; gap: 32px;
}
.sb-team {
  background: rgba(20,20,40,0.85);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  padding: 16px 20px;
  min-width: 200px;
}
.sb-team-name {
  font-size: 16px; font-weight: bold;
  text-align: center;
  margin-bottom: 10px;
  letter-spacing: 2px;
}
.sb-team table {
  width: 100%;
  border-collapse: collapse;
}
.sb-team th {
  font-size: 11px; color: #888;
  text-align: left; padding: 4px 8px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.sb-team td {
  font-size: 14px; padding: 4px 8px;
}
.sb-team tr.my-row td {
  color: #f5c542;
  font-weight: bold;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 3px; }
