:root {
  --bg-deep: #0b0f19;
  --bg-card: rgba(17, 24, 39, 0.86);
  --bg-glass: rgba(15, 23, 42, 0.78);
  --bg-elevated: rgba(30, 41, 59, 0.85);
  --border-subtle: rgba(255, 255, 255, 0.1);
  --border-accent: rgba(56, 189, 248, 0.45);
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent-primary: #38bdf8;
  --accent-secondary: #6366f1;
  --accent-emerald: #10b981;
  --accent-emerald-hover: #059669;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;
  --shadow-lg: 0 20px 45px -10px rgba(0, 0, 0, 0.65);
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
}

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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-deep);
  color: var(--text-primary);
}

input, button, select {
  font-family: inherit;
}

.mono {
  font-family: 'JetBrains Mono', monospace;
  font-variant-numeric: tabular-nums;
}

/* ============================================================================
   SCREENS & BACKGROUND
   ============================================================================ */
.screen {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 10;
}

.screen.active {
  display: flex;
}

.ambient-bg {
  position: fixed;
  inset: 0;
  z-index: 1;
  background:
    radial-gradient(circle at 18% 20%, rgba(56, 189, 248, 0.16), transparent 45%),
    radial-gradient(circle at 82% 78%, rgba(99, 102, 241, 0.18), transparent 48%),
    radial-gradient(circle at 50% 50%, rgba(16, 185, 129, 0.07), transparent 60%),
    linear-gradient(180deg, #070b14 0%, #0f172a 100%);
  pointer-events: none;
}

.ambient-grid {
  position: fixed;
  inset: 0;
  z-index: 2;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at center, black 40%, transparent 85%);
  pointer-events: none;
}

/* ============================================================================
   MENU & LOBBY CONTAINER
   ============================================================================ */
.center-scroll {
  width: 100%;
  height: 100%;
  overflow-y: auto;
  padding: 28px 20px 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.container-wide {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
}

/* Header Brand */
.brand-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  gap: 16px;
  flex-wrap: wrap;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo-globe {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(135deg, #38bdf8, #6366f1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  box-shadow: 0 8px 25px rgba(56, 189, 248, 0.35);
}

.brand-title h1 {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.03em;
  background: linear-gradient(90deg, #ffffff, #93c5fd);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-title p {
  font-size: 13px;
  color: var(--text-secondary);
}

/* Cards & Glass Panels */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-lg);
}

.home-grid {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 22px;
}

@media (max-width: 900px) {
  .home-grid {
    grid-template-columns: 1fr;
  }
}

.card-title {
  font-size: 15px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Profile Setup */
.profile-preview {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  margin-bottom: 16px;
}

.avatar-big {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  background: rgba(56, 189, 248, 0.15);
  border: 2px solid var(--accent-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  flex-shrink: 0;
}

.input-group {
  width: 100%;
}

.input-group label {
  display: block;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 6px;
  font-weight: 600;
}

.text-input {
  width: 100%;
  padding: 11px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(15, 23, 42, 0.9);
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 600;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.text-input:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2);
}

.avatar-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  margin-top: 10px;
}

.avatar-btn {
  height: 42px;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.03);
  font-size: 20px;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.avatar-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
}

.avatar-btn.selected {
  border-color: var(--accent-primary);
  background: rgba(56, 189, 248, 0.2);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.3);
}

/* Mode Action Cards */
.actions-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.hero-action-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 640px) {
  .hero-action-cards {
    grid-template-columns: 1fr;
  }
}

.action-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: linear-gradient(145deg, rgba(30, 41, 59, 0.88), rgba(15, 23, 42, 0.92));
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.action-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-accent);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.5);
}

.action-card.duels-card {
  background: linear-gradient(145deg, rgba(30, 58, 138, 0.45), rgba(15, 23, 42, 0.95));
  border-color: rgba(56, 189, 248, 0.3);
}

.action-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.16);
  color: #7dd3fc;
  width: fit-content;
}

.action-card h3 {
  font-size: 21px;
  font-weight: 800;
  margin-top: 8px;
}

.action-card p {
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-top: 6px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: all 0.18s;
  text-decoration: none;
  color: var(--text-primary);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

.btn-primary {
  background: linear-gradient(135deg, #0ea5e9, #4f46e5);
  box-shadow: 0 8px 22px rgba(14, 165, 233, 0.35);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(14, 165, 233, 0.5);
}

.btn-emerald {
  background: linear-gradient(135deg, #10b981, #059669);
  box-shadow: 0 8px 22px rgba(16, 185, 129, 0.35);
}

.btn-emerald:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(16, 185, 129, 0.5);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
}

.btn-ghost:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.12);
}

.btn-danger {
  background: rgba(244, 63, 94, 0.16);
  border: 1px solid rgba(244, 63, 94, 0.35);
  color: #fda4af;
}

.btn-danger:hover:not(:disabled) {
  background: rgba(244, 63, 94, 0.28);
}

.join-code-row {
  display: flex;
  gap: 10px;
}

.code-input {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  text-align: center;
  font-size: 17px;
  font-weight: 800;
}

/* Open Rooms List */
.open-rooms-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 200px;
  overflow-y: auto;
}

.open-room-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
}

.open-room-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.room-tag {
  font-size: 12px;
  padding: 3px 9px;
  border-radius: 6px;
  background: rgba(56, 189, 248, 0.14);
  color: #7dd3fc;
  font-weight: 700;
}

/* ============================================================================
   LOBBY SCREEN
   ============================================================================ */
.lobby-layout {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 22px;
}

@media (max-width: 920px) {
  .lobby-layout {
    grid-template-columns: 1fr;
  }
}

.room-code-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.16), rgba(99, 102, 241, 0.16));
  border: 1px solid rgba(56, 189, 248, 0.35);
  margin-bottom: 18px;
  gap: 12px;
  flex-wrap: wrap;
}

.room-code-display {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 0.16em;
  color: #7dd3fc;
}

.lobby-players-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 18px;
}

.lobby-player-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  position: relative;
}

.lobby-player-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.player-avatar-pill {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  background: rgba(255, 255, 255, 0.08);
  border: 2px solid var(--accent-primary);
}

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

.host-crown {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.2);
  color: #fcd34d;
  font-weight: 700;
  margin-left: 6px;
}

/* Emote Bar */
.emote-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
}

.emote-btn {
  flex: 1;
  height: 36px;
  border-radius: 8px;
  border: none;
  background: transparent;
  font-size: 19px;
  cursor: pointer;
  transition: transform 0.15s, background 0.15s;
}

.emote-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: scale(1.2);
}

/* Lobby Settings Controls */
.settings-section {
  margin-bottom: 18px;
}

.settings-section:last-child {
  margin-bottom: 0;
}

.settings-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  margin-bottom: 10px;
  display: block;
}

.seg-group {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}

.seg-btn {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-primary);
  text-align: left;
  cursor: pointer;
  transition: all 0.16s;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.seg-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.08);
}

.seg-btn.active {
  border-color: var(--accent-primary);
  background: rgba(56, 189, 248, 0.16);
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.35);
}

.seg-btn-title {
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
}

.seg-btn-desc {
  font-size: 11.5px;
  color: var(--text-secondary);
  line-height: 1.35;
}

.maps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
  gap: 10px;
}

.pill-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill-btn {
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}

.pill-btn.active {
  border-color: var(--accent-primary);
  background: rgba(56, 189, 248, 0.2);
  color: #7dd3fc;
}

/* ============================================================================
   IN-GAME STREET VIEW & HUD
   ============================================================================ */
#game-screen {
  position: fixed;
  inset: 0;
  background: #050811;
}

#pano-container {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: grab;
}

#pano-container:active {
  cursor: grabbing;
}

/* NMPZ Lock Overlay */
#pano-container.nmpz-locked {
  cursor: default !important;
}

/* Top HUD Bar */
.game-hud-top {
  position: absolute;
  top: 16px;
  left: 16px;
  right: 16px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  pointer-events: none;
  z-index: 30;
  gap: 12px;
}

.hud-pill {
  pointer-events: auto;
  background: var(--bg-glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  padding: 10px 16px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
}

.hud-round-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.round-badge {
  font-size: 16px;
  font-weight: 800;
  color: #fff;
}

.multiplier-badge {
  padding: 4px 9px;
  border-radius: 8px;
  background: rgba(245, 158, 11, 0.22);
  border: 1px solid rgba(245, 158, 11, 0.5);
  color: #fde68a;
  font-size: 12px;
  font-weight: 800;
}

.mode-badge {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 600;
}

/* Center Timer Pill */
.hud-timer-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 136px;
  padding: 8px 20px;
  transition: all 0.25s;
}

.timer-value {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.timer-sub {
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 600;
}

.hud-timer-pill.urgent {
  background: rgba(225, 29, 72, 0.85);
  border-color: #fda4af;
  animation: pulseUrgent 0.8s infinite alternate;
}

.hud-timer-pill.urgent .timer-sub {
  color: #ffe4e6;
}

@keyframes pulseUrgent {
  from { transform: scale(1); box-shadow: 0 0 18px rgba(244, 63, 94, 0.5); }
  to { transform: scale(1.06); box-shadow: 0 0 32px rgba(244, 63, 94, 0.9); }
}

/* Top-Right Live Players Status / HP Bars */
.hud-players-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  max-width: 540px;
  pointer-events: auto;
}

.hud-player-card {
  background: var(--bg-glass);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  padding: 8px 12px;
  min-width: 165px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  transition: all 0.2s;
}

.hud-player-card.guessed {
  border-color: rgba(16, 185, 129, 0.65);
  box-shadow: 0 0 18px rgba(16, 185, 129, 0.25);
}

.hud-player-card.eliminated {
  opacity: 0.48;
  filter: grayscale(0.7);
}

.hud-player-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.hud-player-ident {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 115px;
}

.hud-player-status {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
}

.hud-player-status.ready {
  background: rgba(16, 185, 129, 0.22);
  color: #6ee7b7;
}

.hud-player-status.pin {
  background: rgba(56, 189, 248, 0.2);
  color: #7dd3fc;
}

.hp-bar-track {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
  position: relative;
}

.hp-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #10b981, #34d399);
  transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1), background 0.3s;
}

.hp-bar-fill.mid {
  background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

.hp-bar-fill.low {
  background: linear-gradient(90deg, #e11d48, #fb7185);
}

.hp-text-row {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  margin-top: 4px;
  color: var(--text-secondary);
  font-weight: 700;
}

/* Bottom-Left Panorama Controls */
.game-hud-bottom-left {
  position: absolute;
  bottom: 20px;
  left: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 30;
}

.hud-icon-btn {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  color: var(--text-primary);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.45);
  transition: all 0.16s;
}

.hud-icon-btn:hover {
  background: rgba(30, 41, 59, 0.95);
  transform: translateY(-2px);
  border-color: var(--accent-primary);
}

/* Compass Widget */
.compass-widget {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.22);
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  position: relative;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.compass-dial {
  width: 100%;
  height: 100%;
  position: relative;
  transition: transform 0.06s linear;
}

.compass-needle-n {
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-bottom: 14px solid #f43f5e;
}

.compass-needle-s {
  position: absolute;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 14px solid #cbd5e1;
}

.compass-label {
  position: absolute;
  font-size: 9px;
  font-weight: 800;
  color: #fff;
  pointer-events: none;
}

/* ============================================================================
   GUESS MINI-MAP DRAWER (Bottom-Right)
   ============================================================================ */
.guess-map-wrapper {
  position: absolute;
  bottom: 20px;
  right: 20px;
  z-index: 35;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 310px;
  height: 235px;
  opacity: 0.88;
  transition: width 0.24s cubic-bezier(0.22, 1, 0.36, 1),
              height 0.24s cubic-bezier(0.22, 1, 0.36, 1),
              opacity 0.2s;
}

.guess-map-wrapper:hover,
.guess-map-wrapper.pinned,
.guess-map-wrapper.has-pin {
  opacity: 1;
}

.guess-map-wrapper:hover:not(.size-custom),
.guess-map-wrapper.size-m {
  width: 440px;
  height: 330px;
}

.guess-map-wrapper.size-l {
  width: 620px;
  height: 450px;
}

.guess-map-wrapper.size-s {
  width: 310px;
  height: 235px;
}

@media (max-width: 700px) {
  .guess-map-wrapper,
  .guess-map-wrapper:hover:not(.size-custom),
  .guess-map-wrapper.size-m,
  .guess-map-wrapper.size-l {
    width: calc(100vw - 32px);
    height: 270px;
    right: 16px;
    bottom: 16px;
  }
}

.map-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
}

.map-tool-btn {
  padding: 4px 9px;
  border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: var(--bg-glass);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.map-tool-btn.active,
.map-tool-btn:hover {
  color: #fff;
  border-color: var(--accent-primary);
  background: rgba(56, 189, 248, 0.22);
}

#guess-map {
  flex: 1;
  width: 100%;
  border-radius: 16px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.65);
  overflow: hidden;
  cursor: crosshair !important;
  background: #1e293b;
}

.guess-submit-btn {
  width: 100%;
  height: 46px;
  border-radius: 13px;
  border: none;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  box-shadow: 0 10px 25px rgba(16, 185, 129, 0.4);
  transition: all 0.18s;
}

.guess-submit-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(16, 185, 129, 0.6);
}

.guess-submit-btn:disabled {
  background: rgba(30, 41, 59, 0.88);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  box-shadow: none;
  cursor: not-allowed;
}

/* ============================================================================
   ROUND RESULTS & GAME OVER OVERLAYS
   ============================================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(7, 11, 20, 0.85);
  backdrop-filter: blur(14px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.active {
  display: flex;
}

.results-dialog {
  width: 100%;
  max-width: 1060px;
  max-height: 92vh;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-xl);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.75);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.results-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.results-body {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 20px;
  padding: 20px 24px;
  overflow-y: auto;
  flex: 1;
}

@media (max-width: 860px) {
  .results-body {
    grid-template-columns: 1fr;
  }
}

#results-map {
  width: 100%;
  min-height: 360px;
  height: 100%;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  overflow: hidden;
  background: #1e293b;
}

.results-players-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
}

.result-player-row {
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.result-player-row.winner {
  border-color: rgba(16, 185, 129, 0.5);
  background: rgba(16, 185, 129, 0.08);
}

.result-row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.result-score-pill {
  font-size: 18px;
  font-weight: 800;
  color: #34d399;
}

.damage-pill {
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(244, 63, 94, 0.2);
  border: 1px solid rgba(244, 63, 94, 0.45);
  color: #fda4af;
  font-size: 12px;
  font-weight: 800;
}

.results-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

/* Custom Map Markers */
.custom-pin-marker {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 2.5px solid #ffffff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.65);
  font-size: 15px;
}

.target-flag-marker {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #10b981;
  border: 3px solid #ffffff;
  box-shadow: 0 0 18px rgba(16, 185, 129, 0.9);
  font-size: 18px;
}

/* Toasts & Floating Emotes */
#toast-container {
  position: fixed;
  top: 78px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 90;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

.toast-item {
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: #fff;
  padding: 9px 18px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 700;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  animation: toastSlideIn 0.25s ease-out;
}

@keyframes toastSlideIn {
  from { opacity: 0; transform: translateY(-12px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.floating-emote {
  position: fixed;
  bottom: 90px;
  right: 50%;
  z-index: 95;
  pointer-events: none;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 18px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: floatUpFade 2.4s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes floatUpFade {
  0% { opacity: 0; transform: translateY(20px) scale(0.8); }
  15% { opacity: 1; transform: translateY(0) scale(1.05); }
  80% { opacity: 1; transform: translateY(-65px) scale(1); }
  100% { opacity: 0; transform: translateY(-95px) scale(0.9); }
}

/* Loading Spinner Overlay */
.loading-banner {
  position: absolute;
  inset: 0;
  z-index: 25;
  background: rgba(7, 11, 20, 0.72);
  backdrop-filter: blur(8px);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.loading-banner.active {
  display: flex;
}

.spinner {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 4px solid rgba(56, 189, 248, 0.2);
  border-top-color: #38bdf8;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}
