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

body, html {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: #07080e;
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  user-select: none;
  -webkit-user-select: none;
}

#app {
  width: 100%;
  height: 100%;
  position: relative;
}

#c {
  width: 100%;
  height: 100%;
  display: block;
  z-index: 1;
}

/* ── Crosshair ──────────────────────────────────────────────────────────── */
#crosshair {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 10px;
  height: 10px;
  transform: translate(-50%, -50%) scale(1);
  pointer-events: none;
  z-index: 10;
  display: none;
  align-items: center;
  justify-content: center;
  transition: transform 0.08s cubic-bezier(0.1, 0.8, 0.3, 1);
}

#crosshair.shooting {
  transform: translate(-50%, -50%) scale(1.6);
}

#crosshair::before,
#crosshair::after {
  content: '';
  position: absolute;
  background: rgba(0, 242, 254, 0.9);
  box-shadow: 0 0 4px rgba(0, 242, 254, 0.6);
}

#crosshair::before { width: 10px; height: 2px; }
#crosshair::after  { width: 2px;  height: 10px; }

#crosshair .dot {
  width: 2px;
  height: 2px;
  background: #ffffff;
  border-radius: 50%;
  z-index: 11;
}

/* ── Hit Marker ─────────────────────────────────────────────────────────── */
#hitmarker {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 24px;
  height: 24px;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 12;
  opacity: 0;
  transition: opacity 0.15s ease-out;
}

#hitmarker.show { opacity: 1; }
#hitmarker.headshot .line { background-color: #ff3366 !important; }

#hitmarker .line {
  position: absolute;
  width: 7px;
  height: 2px;
  background-color: #ffffff;
  box-shadow: 0 0 3px rgba(0,0,0,0.8);
}

#hitmarker .tl { top: 3px;  left: 3px;  transform: rotate(45deg);  }
#hitmarker .tr { top: 3px;  right: 3px; transform: rotate(-45deg); }
#hitmarker .bl { bottom: 3px; left: 3px; transform: rotate(-45deg); }
#hitmarker .br { bottom: 3px; right: 3px; transform: rotate(45deg); }

/* ── Gameplay HUD ───────────────────────────────────────────────────────── */
#hud {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 5;
}

#match-stats {
  position: absolute;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: rgba(12, 14, 26, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 10px 24px;
  border-radius: 30px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.match-score {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 18px;
  font-weight: 800;
}

.blue-hud { color: #00f2fe; text-shadow: 0 0 10px rgba(0, 242, 254, 0.5); }
.red-hud  { color: #ff3366; text-shadow: 0 0 10px rgba(255, 51, 102, 0.5); }
.vs       { font-size: 12px; color: #7982a6; font-weight: 600; }

#hud-match-timer {
  font-size: 14px;
  font-weight: 800;
  color: #ffd166;
  letter-spacing: 1px;
}

.ammo-card {
  position: absolute;
  bottom: 30px;
  right: 40px;
  background: rgba(12, 14, 26, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 14px 28px;
  border-radius: 16px;
  display: flex;
  align-items: baseline;
  gap: 6px;
  color: #ffffff;
  font-weight: 800;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
}

#weapon-name {
  font-size: 11px;
  font-weight: 800;
  color: #00f2fe;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 2px;
}

.ammo-count-container {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

#ammo-clip { font-size: 38px; color: #00f2fe; }
.divider { font-size: 20px; color: #505673; }
#ammo-reserve { font-size: 20px; color: #8b92b3; }

/* ── Sniper Scope Overlay ────────────────────────────────────────────────── */
#sniper-scope {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, transparent 35%, rgba(0, 0, 0, 0.96) 65%);
  pointer-events: none;
  z-index: 18;
  display: flex;
  align-items: center;
  justify-content: center;
}

.scope-circle {
  position: relative;
  width: 480px;
  height: 480px;
  border-radius: 50%;
  border: 3px solid rgba(0, 242, 254, 0.6);
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.8), 0 0 30px rgba(0, 242, 254, 0.3);
}

.scope-crosshair-v {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 1.5px;
  background: rgba(0, 242, 254, 0.7);
  transform: translateX(-50%);
}

.scope-crosshair-h {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1.5px;
  background: rgba(0, 242, 254, 0.7);
  transform: translateY(-50%);
}

/* ── Match Results Screen Modal ─────────────────────────────────────────── */
#match-results-modal {
  position: fixed;
  inset: 0;
  background: rgba(6, 8, 16, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  animation: modal-fade-in 0.3s ease-out;
}

#match-results-modal.hidden,
.hidden {
  display: none !important;
}


.results-card {
  background: rgba(14, 17, 30, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 24px;
  padding: 40px;
  width: 480px;
  max-width: 90vw;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
}

#results-status {
  font-size: 32px;
  font-weight: 900;
  letter-spacing: 2px;
  margin-bottom: 20px;
  color: #ffffff;
}

.results-score-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 30px;
  background: rgba(255, 255, 255, 0.05);
  padding: 12px 20px;
  border-radius: 12px;
}

.results-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 32px;
}

.stat-box {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 14px 8px;
  border-radius: 12px;
}

.stat-label {
  display: block;
  font-size: 11px;
  color: #8b92b3;
  font-weight: 700;
  margin-bottom: 6px;
}

.stat-value {
  font-size: 20px;
  font-weight: 800;
  color: #ffffff;
}

.results-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}


#reload-banner {
  position: absolute;
  bottom: 100px;
  right: 40px;
  background: rgba(255, 51, 102, 0.2);
  border: 1px solid rgba(255, 51, 102, 0.5);
  color: #ff3366;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 2px;
  padding: 6px 14px;
  border-radius: 8px;
  animation: pulse-border 1s infinite alternate;
}

@keyframes pulse-border {
  0%   { opacity: 0.6; }
  100% { opacity: 1; }
}

/* ── Kill Feed Container ────────────────────────────────────────────────── */
/* ── Emo Currency Card & Reward Popups ──────────────────────────────────── */
.emo-card {
  position: absolute;
  bottom: 30px;
  left: 40px;
  background: rgba(12, 14, 26, 0.8);
  border: 1px solid rgba(255, 209, 102, 0.3);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 12px 24px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #ffd166;
  font-weight: 800;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
}

.emo-icon { font-size: 22px; }
#emo-count { font-size: 28px; color: #ffffff; }
.emo-label { font-size: 12px; color: #ffd166; letter-spacing: 1px; }

#emo-popup-container {
  position: absolute;
  top: 45%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 25;
}

.emo-popup-item {
  font-size: 32px;
  font-weight: 900;
  color: #ffd166;
  text-shadow: 0 0 16px rgba(255, 209, 102, 0.8), 0 2px 4px rgba(0, 0, 0, 0.8);
  letter-spacing: 2px;
  animation: emo-float 1.2s cubic-bezier(0.1, 0.8, 0.3, 1) forwards;
}

@keyframes emo-float {
  0% {
    transform: translateY(20px) scale(0.6);
    opacity: 0;
  }
  30% {
    transform: translateY(0) scale(1.2);
    opacity: 1;
  }
  100% {
    transform: translateY(-60px) scale(1.0);
    opacity: 0;
  }
}

#kill-feed {
  position: absolute;
  top: 30px;
  right: 30px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  pointer-events: none;
  z-index: 15;
}


.kill-feed-item {
  background: rgba(12, 14, 26, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(10px);
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
  box-shadow: 0 6px 20px rgba(0,0,0,0.4);
  animation: slide-in 0.2s cubic-bezier(0.1, 0.8, 0.3, 1);
  display: flex;
  align-items: center;
  gap: 8px;
}

.kill-feed-item.headshot {
  border-color: rgba(255, 51, 102, 0.5);
  box-shadow: 0 0 12px rgba(255, 51, 102, 0.3);
}

.kill-icon { font-size: 14px; }

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

/* ── Red Death Vignette Overlay ─────────────────────────────────────────── */
#death-screen-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at center, rgba(255, 51, 102, 0.4) 0%, rgba(180, 0, 40, 0.85) 100%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 8px;
  z-index: 18;
  pointer-events: none;
  animation: death-flash 0.3s ease-out;
}

#death-screen-overlay.hidden { display: none !important; }

.death-title {
  font-size: 52px;
  font-weight: 900;
  color: #ffffff;
  letter-spacing: 4px;
  text-shadow: 0 0 20px rgba(255, 51, 102, 0.8);
}

.killed-by {
  font-size: 18px;
  font-weight: 700;
  color: #ffd166;
  letter-spacing: 1px;
}

.respawn-hint {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.8);
  margin-top: 10px;
}

@keyframes death-flash {
  0%   { opacity: 0; transform: scale(1.05); }
  100% { opacity: 1; transform: scale(1); }
}

/* ── Fullscreen UI Overlay (Main Lobby & Pause) ───────────────────────── */
#overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at center, rgba(14, 18, 38, 0.8) 0%, rgba(6, 8, 16, 0.95) 100%);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 20;
  opacity: 1;
  transition: opacity 0.3s ease;
}

#overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.overlay-bg-glow {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 50% 20%, rgba(0, 242, 254, 0.12) 0%, transparent 60%),
              radial-gradient(circle at 80% 80%, rgba(255, 51, 102, 0.08) 0%, transparent 50%);
  pointer-events: none;
}

/* ── Glassmorphic Lobby Panels ────────────────────────────────────────── */
.lobby-panel {
  position: relative;
  z-index: 2;
  background: rgba(16, 20, 38, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 24px;
  padding: 40px;
  width: 720px;
  max-width: 92%;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6),
              inset 0 1px 0 rgba(255, 255, 255, 0.15);
  display: flex;
  flex-direction: column;
  gap: 22px;
  color: #ffffff;
}

.lobby-panel.hidden {
  display: none !important;
}

.brand-badge {
  align-self: flex-start;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 2px;
  color: #00f2fe;
  background: rgba(0, 242, 254, 0.1);
  border: 1px solid rgba(0, 242, 254, 0.25);
  padding: 4px 10px;
  border-radius: 20px;
}

h1 {
  font-size: 34px;
  font-weight: 900;
  letter-spacing: 3px;
  background: linear-gradient(135deg, #ffffff 0%, #00f2fe 50%, #4facfe 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 4px 20px rgba(0, 242, 254, 0.3);
  margin-top: -10px;
}

.subtitle {
  font-size: 13px;
  color: #8b92b3;
  font-weight: 600;
  margin-top: -16px;
}

/* ── Lobby Actions & Inputs ────────────────────────────────────────────── */
.lobby-actions {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.actions-row {
  display: flex;
  gap: 12px;
}

.join-private-group {
  display: flex;
  gap: 8px;
  flex: 1;
}

input[type="text"] {
  background: rgba(8, 10, 20, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  padding: 12px 16px;
  color: #ffffff;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  outline: none;
  flex: 1;
  transition: all 0.2s ease;
}

input[type="text"]:focus {
  border-color: #00f2fe;
  box-shadow: 0 0 12px rgba(0, 242, 254, 0.3);
}

/* ── Buttons & CTAs ────────────────────────────────────────────────────── */
.primary-btn {
  background: linear-gradient(135deg, #00f2fe 0%, #0066ff 100%);
  color: #ffffff;
  border: none;
  border-radius: 14px;
  padding: 16px 28px;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 1.5px;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 242, 254, 0.35);
  transition: all 0.2s cubic-bezier(0.1, 0.8, 0.3, 1);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.primary-btn:hover {
  transform: translateY(-2px) scale(1.01);
  box-shadow: 0 12px 32px rgba(0, 242, 254, 0.55);
}

.primary-btn:active {
  transform: translateY(0);
}

.primary-btn.pulse {
  animation: btn-glow 2s infinite alternate;
}

@keyframes btn-glow {
  0%   { box-shadow: 0 8px 24px rgba(0, 242, 254, 0.35); }
  100% { box-shadow: 0 12px 36px rgba(0, 242, 254, 0.65); }
}

.secondary-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #e2e6f5;
  border-radius: 12px;
  padding: 12px 20px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.secondary-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

.secondary-btn.small {
  padding: 10px 16px;
  font-size: 12px;
}

.danger-btn {
  background: rgba(255, 51, 102, 0.12);
  border: 1px solid rgba(255, 51, 102, 0.3);
  color: #ff3366;
  border-radius: 12px;
  padding: 12px 22px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s ease;
}

.danger-btn:hover {
  background: rgba(255, 51, 102, 0.25);
  border-color: #ff3366;
  color: #ffffff;
}

.refresh-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #8b92b3;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.refresh-btn:hover {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.25);
}

/* ── Rooms Browser Grid ────────────────────────────────────────────────── */
.rooms-browser-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 18px;
}

.rooms-browser-header h3 {
  font-size: 13px;
  color: #8b92b3;
  letter-spacing: 2px;
  font-weight: 800;
}

.rooms-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 14px;
  overflow-y: auto;
  max-height: 240px;
  padding-right: 4px;
}

.rooms-grid::-webkit-scrollbar,
.roster-list::-webkit-scrollbar {
  width: 5px;
}
.rooms-grid::-webkit-scrollbar-thumb,
.roster-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}

.room-card {
  background: rgba(8, 10, 20, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all 0.2s ease;
}

.room-card:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(0, 242, 254, 0.3);
  transform: translateY(-2px);
}

.room-card h4 {
  font-size: 15px;
  font-weight: 800;
  color: #ffffff;
}

.room-meta {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: #8b92b3;
  font-weight: 600;
}

.team-counts {
  display: flex;
  gap: 10px;
  font-size: 12px;
  font-weight: 800;
}

.team-blue-text { color: #00f2fe; }
.team-red-text  { color: #ff3366; }

.status-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 4px;
}

.status-badge {
  font-size: 10px;
  font-weight: 800;
  padding: 4px 8px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.status-badge.waiting {
  background: rgba(255, 209, 102, 0.12);
  color: #ffd166;
  border: 1px solid rgba(255, 209, 102, 0.3);
}

.status-badge.in-progress {
  background: rgba(0, 242, 254, 0.12);
  color: #00f2fe;
  border: 1px solid rgba(0, 242, 254, 0.3);
}

.status-badge.full {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

/* ── Room Lobby Roster Screen ───────────────────────────────────────────── */
.room-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 16px;
}

.room-header h2 {
  font-size: 22px;
  font-weight: 800;
  color: #ffffff;
}

.code-display {
  font-size: 13px;
  color: #8b92b3;
  font-weight: 600;
  margin-top: 2px;
}

.code-val {
  color: #ffd166;
  font-weight: 800;
  background: rgba(255, 209, 102, 0.12);
  padding: 2px 8px;
  border-radius: 6px;
  letter-spacing: 1.5px;
}

.rosters-container {
  display: flex;
  gap: 16px;
  height: 240px;
}

.team-card {
  flex: 1;
  background: rgba(8, 10, 20, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.team-card.blue { border-top: 3px solid #00f2fe; }
.team-card.red  { border-top: 3px solid #ff3366; }

.team-card h3 {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 1.5px;
}

.team-card.blue h3 { color: #00f2fe; }
.team-card.red h3  { color: #ff3366; }

.roster-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  flex: 1;
}

.player-row {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.player-row.local {
  background: rgba(0, 242, 254, 0.08);
  border-color: rgba(0, 242, 254, 0.3);
  font-weight: 800;
  color: #00f2fe;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.status-dot.ready { background: #3ca55c; }

.lobby-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 16px;
}

.countdown-text {
  font-size: 13px;
  font-weight: 700;
  color: #ffd166;
}

/* ── Results Overlay ────────────────────────────────────────────────────── */
.results-card {
  position: relative;
  z-index: 2;
  background: rgba(16, 20, 38, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 24px;
  padding: 40px;
  width: 440px;
  text-align: center;
  box-shadow: 0 30px 60px rgba(0,0,0,0.7);
  display: flex;
  flex-direction: column;
  gap: 16px;
  color: #ffffff;
}

.results-card.hidden { display: none !important; }

.results-scores {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  font-size: 24px;
  font-weight: 800;
}

.blue-res { color: #00f2fe; }
.red-res  { color: #ff3366; }

.winner-text {
  font-size: 26px;
  font-weight: 900;
  letter-spacing: 1px;
}

.results-timer {
  font-size: 13px;
  color: #8b92b3;
}
