:root {
  --bg-dark: #0a0f18;
  --panel-bg: rgba(11, 18, 30, 0.78);
  --panel-border: rgba(94, 234, 212, 0.25);
  --accent: #22d3ee;
  --accent-strong: #06b6d4;
  --gold: #fbbf24;
  --danger: #f43f5e;
  --success: #34d399;
  --text: #f1f5f9;
  --muted: #94a3b8;
}

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

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg-dark);
  color: var(--text);
  font-family: 'Segoe UI', Inter, system-ui, -apple-system, sans-serif;
}

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

.hidden {
  display: none !important;
}

/* Damage Vignette */
#damage-vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(circle at center, transparent 48%, rgba(244, 63, 94, 0.65) 100%);
  transition: opacity 0.14s ease-out;
  z-index: 5;
}

/* Weapon Scopes (Distinct 8x AWM, 2x ACOG M4A1, 2x Holo P90) */
#sniper-scope {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 6;
}

#sniper-scope.scope-8x {
  background: radial-gradient(circle at center, transparent 29%, rgba(4, 7, 13, 0.96) 30.5%);
}

#sniper-scope.scope-2x-acog {
  background: radial-gradient(circle at center, transparent 21%, rgba(6, 10, 18, 0.55) 22.8%, rgba(6, 10, 18, 0.25) 38%);
}

#sniper-scope.scope-2x-holo {
  background: radial-gradient(circle at center, rgba(16, 185, 129, 0.05) 0%, transparent 24%);
}

.scope-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 60vh;
  height: 60vh;
  transform: translate(-50%, -50%);
  border: 2px solid rgba(34, 211, 238, 0.55);
  border-radius: 50%;
}

.scope-2x-acog .scope-ring {
  width: 44vh;
  height: 44vh;
  border: 8px solid rgba(15, 20, 28, 0.92);
  box-shadow: 0 0 0 2px rgba(251, 146, 60, 0.55), inset 0 0 20px rgba(0, 0, 0, 0.5);
}

.scope-2x-holo .scope-ring {
  width: 34vh;
  height: 28vh;
  border-radius: 18px;
  border: 6px solid rgba(18, 22, 30, 0.9);
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.5), inset 0 0 18px rgba(16, 185, 129, 0.12);
}

.scope-line-h,
.scope-line-v {
  position: absolute;
  background: rgba(255, 255, 255, 0.55);
}

.scope-line-h {
  top: 50%;
  left: 50%;
  width: 60vh;
  height: 1px;
  transform: translate(-50%, -50%);
}

.scope-line-v {
  top: 50%;
  left: 50%;
  width: 1px;
  height: 60vh;
  transform: translate(-50%, -50%);
}

.scope-2x-acog .scope-line-h {
  width: 24vh;
  height: 1.5px;
  background: rgba(251, 146, 60, 0.72);
}

.scope-2x-acog .scope-line-v {
  height: 22vh;
  top: 56%;
  width: 1.5px;
  background: rgba(251, 146, 60, 0.72);
}

.scope-2x-holo .scope-line-h,
.scope-2x-holo .scope-line-v {
  display: none;
}

.scope-dot {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 6px;
  height: 6px;
  background: var(--danger);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.scope-2x-acog .scope-dot {
  width: 8px;
  height: 8px;
  background: #fb923c;
  box-shadow: 0 0 8px #fb923c;
}

.scope-2x-holo .scope-dot {
  width: 34px;
  height: 34px;
  background: radial-gradient(circle, #34d399 0 2.5px, transparent 3px);
  border: 2px solid rgba(52, 211, 153, 0.88);
  box-shadow: 0 0 10px rgba(52, 211, 153, 0.45);
}

.scope-zoom-badge {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(11vh, -15vh);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.85);
  background: rgba(10, 15, 24, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 4px;
  padding: 2px 7px;
}

.scope-8x .scope-zoom-badge {
  transform: translate(18vh, -22vh);
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.45);
}

.scope-2x-holo .scope-zoom-badge {
  transform: translate(9vh, -12vh);
  color: #34d399;
  border-color: rgba(52, 211, 153, 0.45);
}

/* HUD */
#hud {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 10;
}

.top-bar {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
}

.stat-pill,
.timer-pill {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  backdrop-filter: blur(8px);
  border-radius: 10px;
  padding: 7px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.stat-pill .label {
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 700;
}

.stat-pill .value {
  font-size: 18px;
  font-weight: 800;
}

.value.accent {
  color: var(--accent);
}

.value.gold {
  color: var(--gold);
}

.timer-pill {
  padding: 8px 20px;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.06em;
  border-color: rgba(255, 255, 255, 0.25);
}

/* Top Right Minimap & Kill Feed */
.top-right-panel {
  position: absolute;
  top: 72px;
  right: 16px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

#minimap {
  background: rgba(8, 14, 24, 0.82);
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

#kill-feed {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
  width: 260px;
}

.kill-feed-item {
  background: rgba(11, 18, 30, 0.8);
  border-left: 3px solid var(--accent);
  padding: 5px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  animation: fadeSlide 0.2s ease-out;
}

.kill-feed-item.headshot {
  border-left-color: var(--gold);
}

.kill-feed-item.player-death {
  border-left-color: var(--danger);
}

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

/* Crosshair */
#crosshair {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 0;
  height: 0;
}

.ch-line {
  position: absolute;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 0 3px rgba(0, 0, 0, 0.9);
  transition: transform 0.05s linear;
}

.ch-top,
.ch-bottom {
  width: 2px;
  height: 9px;
  left: -1px;
}

.ch-left,
.ch-right {
  height: 2px;
  width: 9px;
  top: -1px;
}

.ch-dot {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--accent);
  transform: translate(-50%, -50%);
}

/* Hitmarker */
#hitmarker {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 28px;
  height: 28px;
  transform: translate(-50%, -50%);
}

.hm-diag {
  position: absolute;
  width: 8px;
  height: 2px;
  background: #ffffff;
  top: 50%;
  left: 50%;
  transform-origin: center;
}

#hitmarker.headshot .hm-diag {
  background: var(--gold);
  box-shadow: 0 0 6px var(--gold);
}

.hm-1 { transform: translate(-11px, -7px) rotate(45deg); }
.hm-2 { transform: translate(3px, -7px) rotate(-45deg); }
.hm-3 { transform: translate(-11px, 5px) rotate(-45deg); }
.hm-4 { transform: translate(3px, 5px) rotate(45deg); }

#damage-popup {
  position: absolute;
  top: 44%;
  left: 52.5%;
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0.06em;
  color: #ffffff;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.95);
  pointer-events: none;
}

#damage-popup.head {
  color: var(--gold);
  font-size: 16px;
}

#damage-popup.chest {
  color: #fb923c;
}

#damage-popup.limb {
  color: #cbd5e1;
  font-size: 13px;
}

#kill-banner {
  position: absolute;
  top: 38%;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(90deg, transparent, rgba(251, 191, 36, 0.25), transparent);
  color: var(--gold);
  font-weight: 900;
  font-size: 16px;
  letter-spacing: 0.14em;
  padding: 4px 28px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.9);
}

#reload-hint {
  position: absolute;
  top: 56%;
  left: 50%;
  transform: translateX(-50%);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--gold);
  background: rgba(15, 23, 42, 0.78);
  padding: 4px 10px;
  border-radius: 6px;
}

/* Bottom Left HP (Clean Edge-Fade FPS Strip) */
.bottom-left-panel {
  position: absolute;
  bottom: 14px;
  left: 0;
  width: 255px;
  background: linear-gradient(90deg, rgba(10, 12, 16, 0.72) 0%, rgba(10, 12, 16, 0.44) 72%, rgba(10, 12, 16, 0) 100%);
  padding: 10px 36px 12px 16px;
}

.hp-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 6px;
}

.hp-icon {
  color: #22c55e;
  font-size: 26px;
  font-weight: 900;
  line-height: 1;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.65);
}

.hp-num {
  font-size: 36px;
  font-weight: 900;
  line-height: 0.95;
  color: #ffffff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7);
}

.hp-max {
  color: rgba(255, 255, 255, 0.92);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.65);
}

.bar-track {
  width: 100%;
  height: 7px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 1px;
  overflow: hidden;
}

.bar-track.small {
  height: 5px;
}

.bar-fill {
  height: 100%;
  transition: width 0.08s linear;
}

.hp-fill {
  background: #ffffff;
}

.hp-fill.low {
  background: #ef4444;
}

/* Bottom Right Weapon & Ammo (Clean Edge-Fade FPS Strip) */
.bottom-right-panel {
  position: absolute;
  bottom: 14px;
  right: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

#reload-ring-wrap {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 58px;
  height: 58px;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 12;
}

.reload-ring-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.reload-ring-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.22);
  stroke-width: 3.5;
}

.reload-ring-arc {
  fill: none;
  stroke: #ffffff;
  stroke-width: 3.5;
  stroke-linecap: round;
  stroke-dasharray: 138.23;
  stroke-dashoffset: 138.23;
  filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.65));
}

.reload-ring-time {
  position: absolute;
  font-size: 13px;
  font-weight: 900;
  color: #ffffff;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9);
}

.ammo-box {
  background: linear-gradient(270deg, rgba(10, 12, 16, 0.74) 0%, rgba(10, 12, 16, 0.44) 72%, rgba(10, 12, 16, 0) 100%);
  padding: 8px 18px 10px 44px;
  min-width: 245px;
  text-align: right;
}

.weapon-hud-top {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.weapon-silhouette svg {
  width: 92px;
  height: 28px;
  fill: rgba(255, 255, 255, 0.9);
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.75));
}

#hud-weapon-name {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: #ffffff;
  text-shadow: 0 1px 5px rgba(0, 0, 0, 0.85);
}

.ammo-hud-divider {
  height: 1px;
  margin: 6px 0 5px auto;
  width: 155px;
  background: linear-gradient(270deg, rgba(255, 255, 255, 0.3), transparent);
}

.ammo-hud-bottom {
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 10px;
}

.ammo-label-col {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.ammo-caption {
  font-size: 11px;
  font-weight: 700;
  color: rgba(226, 232, 240, 0.78);
  line-height: 1;
  margin-bottom: 2px;
}

.ammo-numbers {
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 4px;
}

.ammo-mag {
  font-size: 32px;
  font-weight: 900;
  line-height: 0.95;
  color: #ffffff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.75);
}

.ammo-sep {
  font-size: 16px;
  color: rgba(226, 232, 240, 0.65);
}

.ammo-reserve {
  font-size: 15px;
  font-weight: 800;
  color: rgba(226, 232, 240, 0.75);
}

.ammo-bullets-svg {
  width: 24px;
  height: 24px;
  margin-bottom: 2px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.65));
}

.weapon-hotbar {
  display: flex;
  gap: 6px;
}

.hotbar-slot {
  background: rgba(11, 18, 30, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 5px;
}

.hotbar-slot.active {
  border-color: var(--accent);
  color: #ffffff;
  background: rgba(6, 182, 212, 0.25);
  box-shadow: 0 0 12px rgba(34, 211, 238, 0.28);
}

/* Overlays */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 9, 17, 0.78);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 30;
}

/* Deadshot-inspired Fullscreen Lobby Overlay */
.lobby-overlay {
  background: radial-gradient(circle at 50% 45%, rgba(16, 22, 30, 0.25) 0%, rgba(10, 14, 20, 0.76) 100%);
  backdrop-filter: blur(7px);
  flex-direction: column;
  justify-content: space-between;
  align-items: stretch;
  padding: 0;
}

/* Top Lobby Header */
.lobby-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 82px;
  padding: 14px 220px 12px;
  background: linear-gradient(180deg, rgba(10, 14, 20, 0.85) 0%, rgba(10, 14, 20, 0.52) 78%, rgba(10, 14, 20, 0) 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.lobby-brand-center {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lobby-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  font-weight: 900;
  letter-spacing: 0.08em;
  line-height: 1;
  color: #ffffff;
  text-shadow: 0 4px 18px rgba(0, 0, 0, 0.65);
}

/* Large Top-Right Corner Settings & Controls Buttons */
.lobby-corner-actions {
  position: absolute;
  right: 20px;
  top: 12px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  z-index: 5;
}

.corner-icon-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 84px;
  padding: 10px 14px;
  background: rgba(16, 22, 32, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  color: #f1f5f9;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.42);
  transition: transform 0.14s ease, border-color 0.15s ease, background 0.15s ease;
}

.corner-icon-btn:hover {
  transform: translateY(-2px);
  background: rgba(30, 41, 59, 0.9);
  border-color: rgba(34, 197, 94, 0.65);
  color: #ffffff;
}

.corner-svg {
  width: 30px;
  height: 30px;
}

.corner-icon-btn span {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

/* Match Summary Banner */
.match-summary {
  width: min(580px, 90vw);
  margin: 10px auto 0;
  background: rgba(15, 23, 36, 0.85);
  border: 1px solid rgba(56, 189, 248, 0.4);
  border-radius: 10px;
  padding: 10px 16px;
  text-align: center;
}

.match-summary h3 {
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--gold);
  margin-bottom: 8px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.summary-grid div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.summary-grid span {
  font-size: 10px;
  color: var(--muted);
  font-weight: 700;
}

.summary-grid strong {
  font-size: 20px;
  color: #ffffff;
}

/* Main Open Lobby Layout (Pure Centered Hero) */
.lobby-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px 26px 26px;
  min-height: 0;
}

/* Center Stage: Operative Figure & Play Buttons */
.lobby-center-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
}

.squad-row {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.operative-preview {
  width: 240px;
  position: relative;
  height: 270px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  filter: drop-shadow(0 14px 24px rgba(0, 0, 0, 0.55));
}

.lobby-char-loading {
  position: absolute;
  left: 50%;
  top: 52%;
  transform: translate(-50%, -50%);
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.25);
  color: #cbd5e1;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  pointer-events: none;
  white-space: nowrap;
}

.lobby-char-loading.hidden {
  display: none;
}

#lobby-char-canvas {
  width: 100%;
  height: 100%;
  display: block;
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 78%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 0%, #000 78%, transparent 100%);
}

/* Play CTA Row */
.play-cta-row {
  display: flex;
  align-items: stretch;
  justify-content: center;
  margin-top: -16px;
}

.play-main-btn {
  min-width: 250px;
  height: 62px;
  border: none;
  border-radius: 6px;
  background: linear-gradient(180deg, #22c55e 0%, #15803d 100%);
  color: #ffffff;
  font-size: 28px;
  font-weight: 900;
  letter-spacing: 0.1em;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(34, 197, 94, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  transition: transform 0.12s ease, filter 0.15s ease;
}

.play-main-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
}

.mode-badge-btn {
  position: relative;
  min-width: 96px;
  height: 62px;
  border: none;
  border-radius: 5px;
  background: linear-gradient(180deg, #e07a3f 0%, #a94f21 100%);
  color: #ffffff;
  padding: 6px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.42);
  transition: transform 0.12s ease, filter 0.15s ease;
}

.mode-badge-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
}

.mode-badge-btn strong {
  font-size: 21px;
  font-weight: 900;
  line-height: 1.05;
}

.mode-badge-btn small {
  font-size: 10px;
  font-weight: 700;
  opacity: 0.9;
}

.ribbon-tag {
  position: absolute;
  top: -8px;
  right: -10px;
  background: #facc15;
  color: #111827;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.05em;
  padding: 2px 6px;
  border-radius: 3px;
  transform: rotate(7deg);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
}

.sub-actions-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.create-team-btn,
.join-team-btn {
  min-width: 146px;
  height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 5px;
  color: #ffffff;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 8px 18px;
  cursor: pointer;
  transition: transform 0.12s ease, filter 0.15s ease;
}

.create-team-btn {
  background: linear-gradient(180deg, rgba(47, 139, 230, 0.9), rgba(29, 98, 178, 0.94));
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.28);
}

.join-team-btn {
  background: linear-gradient(180deg, rgba(51, 65, 85, 0.9), rgba(30, 41, 59, 0.94));
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.38);
}

.create-team-btn:hover,
.join-team-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.1);
}

/* Join Team Code Modal */
.join-team-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(8, 12, 20, 0.72);
  backdrop-filter: blur(6px);
}

.join-team-card {
  width: min(360px, 90vw);
  padding: 22px 24px;
  border-radius: 8px;
  background: rgba(15, 21, 32, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 22px 54px rgba(0, 0, 0, 0.65);
  text-align: center;
}

.join-team-card h3 {
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0.06em;
  color: #ffffff;
  margin-bottom: 6px;
}

.join-modal-sub {
  font-size: 12px;
  color: #cbd5e1;
  margin-bottom: 14px;
}

.join-code-input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 5px;
  border: 1px solid rgba(56, 189, 248, 0.45);
  background: rgba(8, 12, 20, 0.92);
  color: #ffffff;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 24px;
  font-weight: 900;
  letter-spacing: 0.28em;
  text-align: center;
  text-transform: uppercase;
}

.join-code-input:focus {
  outline: none;
  border-color: #38bdf8;
}

.join-error-msg {
  margin-top: 8px;
  font-size: 12px;
  font-weight: 700;
  color: #f87171;
}

.join-modal-actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

.join-go-btn,
.join-cancel-btn {
  flex: 1;
  width: auto;
  height: 40px;
  border: none;
  border-radius: 4px;
  color: #ffffff;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: filter 0.14s ease, transform 0.12s ease;
}

.join-go-btn {
  background: linear-gradient(180deg, #3798ee, #2076cb);
  box-shadow: 0 6px 16px rgba(32, 118, 203, 0.35);
}

.join-cancel-btn {
  background: linear-gradient(180deg, #ef3434, #c91818);
}

.join-go-btn:hover,
.join-cancel-btn:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.sub-action-btn {
  min-width: 104px;
  height: 40px;
  background: rgba(130, 128, 122, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 5px;
  color: #f8fafc;
  font-size: 13px;
  font-weight: 700;
  padding: 8px 16px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.sub-action-btn:hover {
  background: rgba(155, 152, 145, 0.72);
}

.lobby-status-line {
  font-size: 12px;
  font-weight: 700;
  color: #e2e8f0;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.85);
}

/* Custom Team Lobby (Create Team Screen) */
.lobby-overlay.team-mode {
  background: rgba(15, 20, 30, 0.56);
  backdrop-filter: blur(8px);
}

.lobby-overlay.team-mode .lobby-header {
  display: none;
}

.team-lobby {
  flex: 1;
  display: flex;
  min-height: 0;
  padding: 20px 26px 22px;
}

.team-lobby-grid {
  width: 100%;
  display: grid;
  grid-template-columns: 220px 1fr 270px;
  gap: 20px;
  align-items: stretch;
}

.team-left-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.team-left-top-pills {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.team-top-pill,
.team-subpill {
  background: rgba(20, 26, 36, 0.68);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  color: #cbd5e1;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 10px;
  cursor: pointer;
}

.team-top-pill.active,
.team-subpill.active {
  background: rgba(74, 92, 118, 0.75);
  border-color: rgba(255, 255, 255, 0.28);
  color: #ffffff;
}

.team-subpill-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
}

.team-left-card {
  background: rgba(14, 18, 26, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  padding: 14px 12px;
}

.team-left-title {
  font-size: 14px;
  font-weight: 800;
  color: #ffffff;
}

.team-left-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.18);
  margin: 8px 0 12px;
}

.team-left-desc {
  font-size: 12px;
  color: #cbd5e1;
  line-height: 1.45;
  text-align: center;
  margin-bottom: 14px;
}

.team-loadout-mini {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.team-mini-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--muted);
  text-align: center;
}

.team-weapon-chips {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
}

.team-w-chip {
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 4px;
  color: #e2e8f0;
  font-size: 11px;
  font-weight: 700;
  padding: 6px 8px;
  cursor: pointer;
}

.team-w-chip.active {
  background: #f8fafc;
  color: #0f172a;
  border-color: #ffffff;
}

/* Center Match Panel */
.team-center-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 2px 0 6px;
}

.team-match-header {
  display: flex;
  align-items: center;
  gap: 14px;
}

.team-map-thumb {
  width: 96px;
  height: 56px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
}

.team-match-info h2 {
  font-size: 26px;
  font-weight: 900;
  line-height: 1.05;
  color: #ffffff;
}

.team-match-info div {
  font-size: 12px;
  font-weight: 700;
  color: #e2e8f0;
  line-height: 1.3;
}

.team-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(210px, 245px));
  gap: 14px;
  width: 100%;
  justify-content: center;
  margin: 10px 0 auto;
}

.team-col {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.team-col-header {
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 800;
  color: #ffffff;
  border-radius: 2px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

.team-col-header.alpha {
  background: linear-gradient(180deg, #3ba3f7, #1f82dc);
}

.team-col-header.bravo {
  background: linear-gradient(180deg, #f03030, #d41616);
}

.team-roster-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.team-player-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  background: rgba(15, 20, 28, 0.66);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 3px;
}

.team-player-row.is-you {
  border-color: rgba(56, 189, 248, 0.55);
  background: rgba(20, 32, 48, 0.78);
}

.team-slot-num {
  font-size: 12px;
  font-weight: 700;
  color: #94a3b8;
  min-width: 16px;
}

.team-player-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.team-player-name {
  font-size: 13px;
  font-weight: 800;
  color: #ffffff;
}

.team-player-status {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: #f87171;
}

.team-player-status.ready {
  color: #4ade80;
}

.team-mid-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 14px;
}

.team-mid-btn {
  min-width: 124px;
  height: 36px;
  background: rgba(74, 82, 92, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 3px;
  color: #f1f5f9;
  font-size: 13px;
  font-weight: 700;
  padding: 0 14px;
  cursor: pointer;
  transition: background 0.14s ease;
}

.team-mid-btn:hover,
.team-mid-btn.active {
  background: rgba(110, 122, 138, 0.85);
}

.team-bottom-cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
}

.team-ready-btn {
  width: 244px;
  height: 54px;
  border: none;
  border-radius: 3px;
  background: linear-gradient(180deg, #3798ee, #2076cb);
  color: #ffffff;
  font-size: 25px;
  font-weight: 900;
  letter-spacing: 0.06em;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(32, 118, 203, 0.4);
  transition: transform 0.12s ease, filter 0.15s ease;
}

.team-ready-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
}

.team-ready-btn.starting {
  background: linear-gradient(180deg, #22c55e, #15803d);
}

.team-secondary-pair {
  display: flex;
  gap: 8px;
  width: 244px;
}

.team-privacy-btn,
.team-leave-btn {
  flex: 1;
  height: 38px;
  border: none;
  border-radius: 3px;
  color: #ffffff;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}

.team-privacy-btn {
  background: rgba(162, 168, 178, 0.56);
}

.team-privacy-btn:hover {
  background: rgba(182, 188, 198, 0.72);
}

.team-leave-btn {
  background: linear-gradient(180deg, #ef3434, #c91818);
}

.team-leave-btn:hover {
  filter: brightness(1.08);
}

/* Right Map & Mode Column */
.team-right-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.team-side-heading {
  font-size: 17px;
  font-weight: 800;
  color: #ffffff;
  text-align: center;
}

.team-map-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 7px;
}

.team-map-card {
  position: relative;
  height: 48px;
  padding: 0;
  border: 2px solid rgba(255, 255, 255, 0.12);
  border-radius: 3px;
  overflow: hidden;
  cursor: pointer;
  background: #0f172a;
}

.team-map-card.active {
  border-color: #ffffff;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.75);
}

.map-card-art {
  position: absolute;
  inset: 0;
  display: block;
}

.map-card-name {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  width: 100%;
  height: 100%;
  padding: 4px 6px;
  font-size: 10px;
  font-weight: 800;
  color: #ffffff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.95);
  background: linear-gradient(180deg, transparent 35%, rgba(0, 0, 0, 0.65) 100%);
}

/* Styled Map Thumbnails */
.map-factory   { background: linear-gradient(135deg, #364152 0%, #64748b 45%, #d97706 100%); }
.map-crosswalk { background: linear-gradient(135deg, #1e293b 0%, #475569 50%, #0ea5e9 100%); }
.map-outpost   { background: linear-gradient(135deg, #4b5563 0%, #78716c 55%, #38bdf8 100%); }
.map-warehouse { background: linear-gradient(135deg, #27272a 0%, #52525b 55%, #84cc16 100%); }
.map-vineyard  { background: linear-gradient(135deg, #78350f 0%, #b45309 50%, #fcd34d 100%); }
.map-neonyard  { background: linear-gradient(135deg, #0f172a 0%, #1e293b 55%, #14b8a6 100%); }
.map-refinery  { background: linear-gradient(135deg, #334155 0%, #7c2d12 55%, #f97316 100%); }
.map-sandstorm { background: linear-gradient(135deg, #7c2d12 0%, #b45309 55%, #fde68a 100%); }

.team-mode-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 5px;
}

.team-mode-btn {
  height: 30px;
  background: rgba(52, 60, 72, 0.68);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 3px;
  color: #e2e8f0;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.team-mode-btn.active {
  background: #ffffff;
  color: #0f172a;
  font-weight: 900;
}

.team-more-settings-btn {
  margin-top: 4px;
  height: 34px;
  background: rgba(52, 60, 72, 0.68);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 3px;
  color: #f1f5f9;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.team-more-settings-btn:hover {
  background: rgba(74, 86, 104, 0.85);
}

/* Sub-panels (Loadout / Settings / Controls) */
.lobby-subpanel {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.subpanel-card {
  width: min(640px, 92vw);
  background: rgba(15, 21, 30, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  padding: 24px 28px;
  box-shadow: 0 22px 54px rgba(0, 0, 0, 0.6);
}

.subpanel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.subpanel-head h2 {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.09em;
  color: #ffffff;
}

.back-play-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  color: #f1f5f9;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 12px;
  cursor: pointer;
}

.slider-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Bottom Lobby Footer */
.lobby-footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 8px 24px 14px;
}

.footer-left {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.footer-prompt {
  font-size: 11px;
  font-weight: 700;
  color: #e2e8f0;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.85);
}

.footer-pill-btn {
  background: rgba(92, 110, 178, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 5px;
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 8px 18px;
  cursor: pointer;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: rgba(226, 232, 240, 0.72);
}

.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--text);
  border-radius: 8px;
  padding: 9px 13px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.chip:hover {
  border-color: var(--accent);
}

.chip.active {
  background: rgba(59, 130, 246, 0.28);
  border-color: #60a5fa;
  color: #ffffff;
}

.hint {
  margin-top: 12px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
  font-size: 14px;
}

.setting-row select {
  background: #0f172a;
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  padding: 6px 10px;
}

.toggle-pill-btn {
  min-width: 72px;
  padding: 6px 14px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(100, 116, 139, 0.28);
  color: #cbd5e1;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: all 0.15s ease;
}

.toggle-pill-btn.active {
  background: rgba(34, 197, 94, 0.26);
  border-color: #22c55e;
  color: #4ade80;
}

.controls-box {
  margin-top: 8px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 14px;
  font-size: 13px;
  color: #cbd5e1;
}

kbd {
  display: inline-block;
  padding: 2px 6px;
  font-size: 11px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  color: #fff;
  margin-right: 4px;
}

.respawn-card {
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid rgba(244, 63, 94, 0.45);
  border-radius: 14px;
  padding: 24px 36px;
  text-align: center;
}

.respawn-card h2 {
  color: var(--danger);
  font-size: 24px;
  margin-bottom: 6px;
}

.respawn-countdown {
  margin-top: 10px;
  font-size: 16px;
  color: var(--accent);
  font-weight: 700;
}

/* Network / Wi-Fi Firewall Warning & 4v4 Room Host Controls */
.net-warning-banner {
  position: fixed;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 95;
  max-width: min(92vw, 620px);
  padding: 10px 18px;
  border-radius: 6px;
  background: rgba(153, 27, 27, 0.94);
  border: 1px solid rgba(252, 165, 165, 0.65);
  color: #fef2f2;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.5);
}

.team-name-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 10px;
}

.team-name-input {
  width: 100%;
  padding: 6px 9px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(8, 12, 20, 0.85);
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
}

.team-room-meta {
  font-size: 11px;
  font-weight: 800;
  color: #7dd3fc;
  text-align: center;
  margin-bottom: 10px;
}

.team-bots-toggle {
  width: 100%;
  margin-top: 10px;
  margin-bottom: 8px;
  padding: 7px 10px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(51, 65, 85, 0.72);
  color: #e2e8f0;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.team-bots-toggle.active {
  background: rgba(21, 128, 61, 0.8);
  border-color: rgba(74, 222, 128, 0.65);
  color: #ffffff;
}

.team-bots-toggle:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.team-player-row {
  justify-content: space-between;
}

.team-player-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.team-host-badge {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 5px;
  border-radius: 3px;
  background: rgba(250, 204, 21, 0.22);
  color: #fde047;
  font-size: 9px;
  font-weight: 900;
  vertical-align: middle;
}

.team-mini-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.team-row-btn {
  padding: 3px 6px;
  border-radius: 3px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(56, 189, 248, 0.2);
  color: #bae6fd;
  font-size: 9px;
  font-weight: 800;
  cursor: pointer;
}

.team-row-btn:hover {
  background: rgba(56, 189, 248, 0.4);
}

.team-row-btn.kick {
  background: rgba(239, 68, 68, 0.22);
  color: #fecaca;
}

.team-row-btn.kick:hover {
  background: rgba(239, 68, 68, 0.45);
}

@media (max-width: 880px) {
  .lobby-header {
    justify-content: flex-start;
    padding: 16px 190px 14px 18px;
  }
  .lobby-logo {
    font-size: 28px;
  }
  .corner-icon-btn {
    min-width: 70px;
    padding: 8px 10px;
  }
  .corner-svg {
    width: 24px;
    height: 24px;
  }
  .lobby-main {
    overflow-y: auto;
  }
  .team-lobby {
    overflow-y: auto;
  }
  .team-lobby-grid {
    grid-template-columns: 1fr;
  }
  .team-columns {
    grid-template-columns: 1fr 1fr;
  }
}
