/* ============================================================
   GeoStrike – Global Styles
   ============================================================ */

/* ── Variables ──────────────────────────────────────────────── */
:root {
  --bg: #0d0d1a;
  --bg2: #13132b;
  --surface: rgba(255, 255, 255, 0.06);
  --border: rgba(255, 255, 255, 0.12);
  --text: #e8e8f0;
  --muted: rgba(255, 255, 255, 0.45);
  --accent: #7c6ff7;
  --accent2: #ff6b9d;
  --success: #50fa7b;
  --danger: #ff5555;
  --radius: 16px;
  --shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
}

/* ── Reset & Base ───────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
  font-family: 'Outfit', sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
}

/* Lobby screen: allow vertical scroll */
#screen-lobby {
  overflow-y: auto;
}

.hidden {
  display: none !important;
}

/* ── Screens ────────────────────────────────────────────────── */
.screen {
  position: fixed;
  inset: 0;
  display: none;
  opacity: 0;
  transition: opacity .4s ease;
}

.screen.active {
  display: flex;
  opacity: 1;
  z-index: 1000;
}

/* ── Glass panel ────────────────────────────────────────────── */
.glass-panel {
  background: var(--surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 28px;
  border: none;
  border-radius: 50px;
  font-family: 'Outfit', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s, opacity .2s;
  user-select: none;
}

.btn:active {
  transform: scale(.97);
}

.btn:disabled {
  opacity: .4;
  cursor: not-allowed;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
  box-shadow: 0 4px 24px rgba(124, 111, 247, .45);
}

.btn-primary:hover:not(:disabled) {
  box-shadow: 0 6px 32px rgba(124, 111, 247, .65);
  transform: translateY(-2px);
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  color: var(--text);
  border-color: var(--accent);
}

.btn-large {
  padding: 15px 36px;
  font-size: 1.1rem;
}

.btn.small {
  padding: 8px 20px;
  font-size: .9rem;
}

/* ══════════════════════════════════════════════
   LOBBY SCREEN
══════════════════════════════════════════════ */
#screen-lobby {
  align-items: center;
  justify-content: center;
  flex-direction: column;
  background: radial-gradient(ellipse at 60% 30%, #1a1040 0%, #0d0d1a 70%);
}

.lobby-bg {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 80%, rgba(124, 111, 247, .15) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(255, 107, 157, .12) 0%, transparent 50%);
  pointer-events: none;
}

/* ── Global Header ─────────────────────────────────────────────── */
.global-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: rgba(13, 13, 26, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 2000;
  animation: slide-down 0.3s ease;
}

@keyframes slide-down {
  from {
    transform: translateY(-100%);
  }

  to {
    transform: translateY(0);
  }
}

.lobby-container {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
  width: 100%;
  max-width: 720px;
  padding: 24px;
  padding-top: 80px;
  /* Room for global header */
  padding-bottom: 48px;
}

/* Logo */
.logo-area {
  text-align: center;
}

.logo-icon {
  font-size: 4rem;
  line-height: 1;
  margin-bottom: 8px;
}

.logo-title {
  font-size: 2.8rem;
  font-weight: 900;
  letter-spacing: -1px;
}

.logo-title .accent {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.logo-sub {
  color: var(--muted);
  font-size: .95rem;
  margin-top: 4px;
}

/* Join / Mode / Host panels */
#join-panel,
#mode-panel,
#host-panel {
  width: 100%;
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: stretch;
}

#join-panel h2,
#mode-panel h2,
#host-panel h2 {
  font-size: 1.4rem;
  font-weight: 800;
  text-align: center;
}

input[type=text],
input[type=password],
input[type=email] {
  background: rgba(255, 255, 255, .07);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 18px;
  color: var(--text);
  font-family: 'Outfit';
  font-size: 1rem;
  transition: border-color .2s;
  outline: none;
}

input[type=text]:focus,
input[type=password]:focus,
input[type=email]:focus {
  border-color: var(--accent);
}

input[type=text]::placeholder,
input[type=password]::placeholder,
input[type=email]::placeholder {
  color: var(--muted);
}

.divider-text {
  text-align: center;
  color: var(--muted);
  font-size: .85rem;
}

/* Mode Selection Cards */
.mode-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  max-height: 60vh;
  overflow-y: auto;
  padding: 4px 12px 12px 4px;
}

@media (max-width: 600px) {
  .mode-cards {
    grid-template-columns: 1fr;
  }
}

/* Custom scrollbar for mode cards */
.mode-cards::-webkit-scrollbar {
  width: 6px;
}

.mode-cards::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
}

.mode-cards::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 10px;
}

.mode-cards::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

.mode-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  overflow: hidden;
  color: var(--text);
}

.mode-card:hover:not(.disabled) {
  background: rgba(124, 111, 247, 0.15);
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(124, 111, 247, 0.2);
}

.mode-card.accent-card {
  border-bottom: 4px solid var(--accent);
  background: linear-gradient(135deg, rgba(124, 111, 247, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
}

.mode-card.accent-card:hover {
  background: linear-gradient(135deg, rgba(124, 111, 247, 0.2) 0%, rgba(255, 255, 255, 0.08) 100%);
}

.mode-card:active:not(.disabled) {
  transform: scale(0.98);
}

.mode-card.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  filter: grayscale(1);
}

/* ── Premium / Locked Styles ─────────────────────────────── */
.mode-card.locked {
  opacity: 0.5;
  filter: grayscale(0.7);
  cursor: not-allowed;
  pointer-events: none;
}

.mode-card.locked::after {
  content: '👑 PREMIUM';
  position: absolute;
  top: 10px;
  right: -30px;
  background: linear-gradient(135deg, #FFD700, #FFA500);
  color: #000;
  font-size: 0.6rem;
  font-weight: 900;
  padding: 3px 36px;
  transform: rotate(45deg);
  box-shadow: 0 2px 8px rgba(255, 165, 0, 0.4);
  letter-spacing: 0.5px;
}

.dataset-item.locked {
  opacity: 0.5;
  filter: grayscale(0.6);
  cursor: not-allowed;
  position: relative;
}

.dataset-item.locked::after {
  content: '👑';
  margin-left: 4px;
  font-size: 0.85rem;
}

/* Premium marker – gold glow */
.player-marker-pin.premium {
  border: 2px solid #FFD700 !important;
  box-shadow: 0 0 12px #FFD700, 0 0 24px rgba(255, 165, 0, 0.5) !important;
  background: linear-gradient(135deg, #FFD700, #FFA500) !important;
  color: #000 !important;
  font-weight: 900;
}

.mode-icon {
  font-size: 2.5rem;
  margin-bottom: 8px;
}

.mode-card h3 {
  font-size: 1.2rem;
  font-weight: 800;
  margin-bottom: 4px;
}

.mode-card p {
  font-size: 0.85rem;
  color: var(--muted);
}

.coming-soon {
  position: absolute;
  top: 12px;
  right: -28px;
  background: var(--accent2);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 4px 32px;
  transform: rotate(45deg);
  text-transform: uppercase;
  letter-spacing: 1px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

/* QR code area */
.qr-hint {
  text-align: center;
  font-size: .9rem;
  color: var(--muted);
}

#qr-img-wrap {
  display: flex;
  justify-content: center;
  min-height: 150px;
  align-items: center;
}

#qr-img-wrap img {
  border-radius: 12px;
  width: 200px;
  height: 200px;
  object-fit: contain;
}

.qr-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.server-url {
  text-align: center;
  font-size: .85rem;
  color: var(--accent);
  word-break: break-all;
  background: rgba(124, 111, 247, .1);
  padding: 8px 14px;
  border-radius: 8px;
}

/* Lobby player list */
.player-list-lobby {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  min-height: 60px;
  max-height: 140px;
  overflow-y: auto;
}

.waiting-text {
  text-align: center;
  color: var(--muted);
  font-size: .9rem;
  margin-top: 4px;
}

.lobby-player-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, .07);
  border-radius: 50px;
  padding: 5px 14px 5px 5px;
  margin: 4px;
  font-size: .9rem;
  font-weight: 600;
}

.lobby-player-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
}

.hidden {
  display: none !important;
}

/* ══════════════════════════════════════════════
   GAME SCREEN
══════════════════════════════════════════════ */
#screen-game {
  flex-direction: column;
}

/* HUD */
.game-hud {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: linear-gradient(180deg, rgba(13, 13, 26, .9) 0%, transparent 100%);
  pointer-events: none;
}

.hud-left,
.hud-right {
  min-width: 80px;
}

.hud-left {
  display: flex;
  gap: 24px;
  align-items: center;
}

.hud-stat {
  display: flex;
  flex-direction: column;
}

.hud-left .hud-round-label {
  display: block;
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

#hud-round,
.hud-value {
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--text);
}

#hud-budget {
  color: var(--accent);
}

.capital-badge {
  background: rgba(13, 13, 26, .75);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 8px 20px;
  text-align: center;
  transition: transform .3s ease, box-shadow .3s ease;
}

.capital-badge.pulse {
  transform: scale(1.18);
  box-shadow: 0 0 0 6px rgba(124, 111, 247, .3);
}

.capital-label {
  display: block;
  font-size: .65rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--muted);
}

.capital-name {
  display: block;
  font-size: 1.4rem;
  font-weight: 900;
  line-height: 1.1;
}

.capital-country {
  display: block;
  font-size: .75rem;
  color: var(--muted);
  margin-top: 2px;
}

/* Timer ring */
.hud-right {
  display: flex;
  justify-content: flex-end;
}

#timer-ring-wrap {
  position: relative;
  width: 50px;
  height: 50px;
}

.timer-ring {
  width: 50px;
  height: 50px;
  transform: rotate(-90deg);
}

.ring-bg {
  fill: none;
  stroke: rgba(255, 255, 255, .1);
  stroke-width: 3;
}

.ring-fg {
  fill: none;
  stroke: var(--accent);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 113;
  /* 2π*18 */
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 1s linear, stroke .5s;
}

.timer-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .95rem;
  font-weight: 800;
}

.pulse-danger {
  animation: timer-pulse 0.5s ease-in-out 3;
}

@keyframes timer-pulse {
  0% {
    transform: scale(1);
    filter: drop-shadow(0 0 0 rgba(255, 85, 85, 0));
  }

  50% {
    transform: scale(1.15);
    filter: drop-shadow(0 0 10px rgba(255, 85, 85, 0.8));
  }

  100% {
    transform: scale(1);
    filter: drop-shadow(0 0 0 rgba(255, 85, 85, 0));
  }
}

/* Map */
#map {
  position: absolute;
  inset: 0;
  z-index: 1;
}

/* Click status bar */
.click-status-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  display: flex;
  gap: 8px;
  padding: 10px 14px;
  background: linear-gradient(0deg, rgba(13, 13, 26, .9) 0%, transparent 100%);
  flex-wrap: wrap;
  pointer-events: none;
}

.click-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(13, 13, 26, .7);
  backdrop-filter: blur(8px);
  border-radius: 50px;
  padding: 4px 12px 4px 4px;
  font-size: .8rem;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, .1);
  transition: opacity .3s;
}

.click-chip-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
}

.click-chip.done {
  opacity: 1;
}

.click-chip.waiting {
  opacity: .45;
}

.click-chip.done .click-chip-dot {
  box-shadow: 0 0 8px currentColor;
}

/* Fertig button (player only) */
.fertig-wrap {
  position: absolute;
  bottom: 60px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1100;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: all;
}

.fertig-btn {
  font-size: 1.2rem;
  padding: 16px 48px;
  box-shadow: 0 8px 32px rgba(124, 111, 247, .5);
  animation: bounce-in .3s ease;
}

.fertig-hint {
  font-size: .75rem;
  color: rgba(255, 255, 255, .6);
  text-align: center;
}

/* Waiting overlay */
.waiting-overlay {

  position: absolute;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 80px;
  pointer-events: none;
}

.waiting-card {
  padding: 16px 28px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.waiting-dots {
  display: flex;
  gap: 6px;
}

.waiting-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  animation: bounce 1.2s infinite;
}

.waiting-dots span:nth-child(2) {
  animation-delay: .2s;
}

.waiting-dots span:nth-child(3) {
  animation-delay: .4s;
}

/* Eliminated overlay */
.eliminated-overlay {
  position: absolute;
  inset: 0;
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, .7);
  backdrop-filter: blur(6px);
}

.elim-card {
  padding: 40px;
  text-align: center;
  max-width: 320px;
  width: 90%;
}

.elim-emoji {
  font-size: 3.5rem;
  margin-bottom: 12px;
  animation: shake .5s;
}

.elim-card h2 {
  font-size: 1.8rem;
  font-weight: 900;
  margin-bottom: 8px;
  color: var(--danger);
}

.elim-hint {
  color: var(--muted);
  font-size: .85rem;
  margin-top: 8px;
}

/* ══════════════════════════════════════════════
   RESULT MODAL
══════════════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, .7);
  backdrop-filter: blur(8px);
  animation: fadeIn .3s ease;
}

.modal-box {
  width: min(520px, 95vw);
  max-height: 90vh;
  overflow-y: auto;
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.modal-header {
  text-align: center;
}

.modal-round-badge {
  display: inline-block;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
  border-radius: 50px;
  padding: 3px 16px;
  font-size: .8rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.modal-header h2 {
  font-size: 1.6rem;
  font-weight: 900;
}

/* Table */
.res-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .9rem;
}

.res-table th {
  text-align: left;
  padding: 8px 10px;
  color: var(--muted);
  font-weight: 600;
  border-bottom: 1px solid var(--border);
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .8px;
}

.res-table td {
  padding: 10px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, .05);
  vertical-align: middle;
}

.res-table tr:last-child td {
  border-bottom: none;
}

.player-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

.player-color-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
}

.tag-eliminated {
  background: rgba(255, 85, 85, .15);
  color: var(--danger);
  border: 1px solid rgba(255, 85, 85, .3);
  border-radius: 50px;
  padding: 2px 10px;
  font-size: .75rem;
  font-weight: 700;
}

.tag-safe {
  background: rgba(80, 250, 123, .1);
  color: var(--success);
  border: 1px solid rgba(80, 250, 123, .2);
  border-radius: 50px;
  padding: 2px 10px;
  font-size: .75rem;
  font-weight: 700;
}

.tag-winner {
  background: rgba(255, 215, 0, .15);
  color: #ffd700;
  border: 1px solid rgba(255, 215, 0, .3);
  border-radius: 50px;
  padding: 2px 10px;
  font-size: .75rem;
  font-weight: 700;
}

/* ══════════════════════════════════════════════
   END SCREEN
══════════════════════════════════════════════ */
#screen-end {
  align-items: center;
  justify-content: flex-start;
  flex-direction: column;
  background: radial-gradient(ellipse at 50% 30%, #1a1040 0%, #0d0d1a 70%);
  overflow-y: auto;
}

#confetti-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.end-container {
  position: relative;
  z-index: 1001;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  width: 100%;
  max-width: 560px;
  padding: 40px 24px;
  margin: auto 0;
}

.trophy {
  font-size: 5rem;
  animation: bounce-in .6s ease;
}

.end-title {
  font-size: 2.5rem;
  font-weight: 900;
  text-align: center;
}

.winner-card {
  width: 100%;
  padding: 24px 28px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.winner-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 900;
  flex-shrink: 0;
}

.winner-name {
  font-size: 1.5rem;
  font-weight: 800;
}

.winner-dist {
  font-size: .9rem;
  color: var(--muted);
  margin-top: 2px;
}

.summary-wrap {
  width: 100%;
  padding: 24px;
}

.summary-wrap h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* ══════════════════════════════════════════════
   LEAFLET custom markers
══════════════════════════════════════════════ */
.player-marker-pin {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, .8);
  box-shadow: 0 2px 10px rgba(0, 0, 0, .5);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .65rem;
  font-weight: 800;
  color: #fff;
}

.target-marker-pin {
  width: 24px;
  height: 24px;
  background: #fff;
  border-radius: 50%;
  border: 3px solid var(--danger);
  box-shadow: 0 0 0 4px rgba(255, 85, 85, .3), 0 2px 10px rgba(0, 0, 0, .5);
  animation: pulse-target 1.5s infinite;
}

/* ══════════════════════════════════════════════
   ANIMATIONS
══════════════════════════════════════════════ */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes bounce {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-6px);
  }
}

@keyframes bounce-in {
  0% {
    transform: scale(.5);
    opacity: 0;
  }

  80% {
    transform: scale(1.1);
  }

  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes shake {

  0%,
  100% {
    transform: rotate(0);
  }

  25% {
    transform: rotate(-8deg);
  }

  75% {
    transform: rotate(8deg);
  }
}

@keyframes pulse-target {

  0%,
  100% {
    box-shadow: 0 0 0 4px rgba(255, 85, 85, .4), 0 2px 10px rgba(0, 0, 0, .5);
  }

  50% {
    box-shadow: 0 0 0 10px rgba(255, 85, 85, .1), 0 2px 10px rgba(0, 0, 0, .5);
  }
}

/* ══════════════════════════════════════════════
   RESPONSIVE (mobile player view)
══════════════════════════════════════════════ */
@media (max-width: 500px) {
  .lobby-container {
    padding: 16px;
  }

  #join-panel,
  #host-panel {
    padding: 22px;
  }

  .logo-title {
    font-size: 2.2rem;
  }

  .capital-name {
    font-size: 1.1rem;
  }

  .modal-box {
    padding: 20px;
  }
}

/* ══════════════════════════════════════════════
   EVENT ANNOUNCEMENT OVERLAY
   ══════════════════════════════════════════════ */
.event-announcement-overlay {
  position: absolute;
  inset: 0;
  z-index: 1600;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle, rgba(124, 111, 247, 0.4) 0%, rgba(0, 0, 0, 0.8) 100%);
  backdrop-filter: blur(8px);
  animation: fade-in 0.4s ease-out;
}

.announcement-content {
  text-align: center;
  animation: pulse-in 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.announcement-badge {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  padding: 8px 20px;
  border-radius: 50px;
  font-weight: 800;
  font-size: 0.9rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 20px;
  box-shadow: 0 4px 15px rgba(124, 111, 247, 0.4);
}

.announcement-text {
  font-size: clamp(3rem, 12vw, 6rem);
  font-weight: 900;
  color: #fff;
  text-shadow: 0 0 30px rgba(124, 111, 247, 0.8), 0 0 60px rgba(124, 111, 247, 0.4);
  letter-spacing: 10px;
  margin: 0;
}

@keyframes pulse-in {
  0% {
    transform: scale(0.8);
    opacity: 0;
    letter-spacing: 0;
  }

  100% {
    transform: scale(1);
    opacity: 1;
    letter-spacing: 10px;
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

/* Leaflet z-index fix */
.leaflet-pane {
  z-index: 400 !important;
}

.leaflet-top,
.leaflet-bottom {
  z-index: 800 !important;
}

/* ══════════════════════════════════════════════
   CAPITAL REVEAL OVERLAY
══════════════════════════════════════════════ */
.capital-reveal-overlay {
  position: absolute;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.capital-reveal-card {
  background: linear-gradient(135deg, rgba(124, 111, 247, .95), rgba(255, 107, 157, .95));
  backdrop-filter: blur(24px);
  border-radius: 28px;
  padding: 36px 60px;
  text-align: center;
  box-shadow: 0 20px 80px rgba(0, 0, 0, .6);
  animation: bounce-in .5s cubic-bezier(.34, 1.56, .64, 1);
}

.reveal-label {
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: 2.5px;
  color: rgba(255, 255, 255, .7);
  margin-bottom: 14px;
}

.reveal-name {
  font-size: clamp(2.2rem, 7vw, 4rem);
  font-weight: 900;
  color: #fff;
  text-shadow: 0 2px 16px rgba(0, 0, 0, .3);
  line-height: 1.1;
}

.reveal-country {
  font-size: 1rem;
  color: rgba(255, 255, 255, .75);
  margin-top: 8px;
}

.reveal-mystery {
  font-size: clamp(3rem, 10vw, 6rem);
  color: rgba(255, 255, 255, .9);
  animation: pulse-q 0.8s ease-in-out infinite;
}

@keyframes pulse-q {

  0%,
  100% {
    transform: scale(1) rotate(-5deg);
    opacity: .8;
  }

  50% {
    transform: scale(1.12) rotate(5deg);
    opacity: 1;
  }
}

.capital-name {
  transition: opacity .4s;
}

/* ══════════════════════════════════════════════
   EVENT UI
   ══════════════════════════════════════════════ */
.event-banner {
  position: absolute;
  top: 70px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 215, 0, 0.2);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 215, 0, 0.3);
  padding: 6px 20px;
  border-radius: 50px;
  color: #ffd700;
  font-weight: 800;
  font-size: 0.9rem;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  animation: bounce-in 0.5s ease;
  pointer-events: none;
}

.event-banner.speed {
  background: rgba(255, 85, 85, 0.2);
  border-color: rgba(255, 85, 85, 0.3);
  color: #ff5555;
}

.event-banner.double {
  background: rgba(80, 250, 123, 0.2);
  border-color: rgba(80, 250, 123, 0.3);
  color: #50fa7b;
}

.event-banner.fog {
  background: rgba(180, 180, 180, 0.2);
  border-color: rgba(255, 255, 255, 0.3);
  color: #ddd;
}

.event-banner.rotate {
  background: rgba(124, 111, 247, 0.2);
  border-color: rgba(124, 111, 247, 0.3);
  color: var(--accent);
}

.event-banner.zoom-lock {
  background: rgba(100, 100, 100, 0.2);
  border-color: rgba(255, 255, 255, 0.3);
  color: #fff;
}

.event-banner.perfection,
.event-banner.event-perfection {
  background: rgba(255, 107, 157, 0.2);
  border-color: rgba(255, 107, 157, 0.3);
  color: var(--accent2);
}

.event-announcement-overlay {
  position: absolute;
  inset: 0;
  z-index: 1500;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  pointer-events: none;
}

.announcement-content {
  text-align: center;
  animation: bounce-in 0.5s ease;
}

.announcement-badge {
  color: var(--accent);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 8px;
}

.announcement-text {
  font-size: clamp(3rem, 10vw, 5rem);
  font-weight: 900;
  color: #fff;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.8);
}

.event-reveal-overlay {
  position: absolute;
  inset: 0;
  z-index: 1500;
  display: flex;
  align-items: flex-end;
  /* Moved down */
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  /* Slightly darker backdrop */
  padding-bottom: 15vh;
  /* Distance from bottom */
  pointer-events: all;
}

.event-reveal-card {
  padding: 60px 80px;
  /* Bigger padding */
  text-align: center;
  border-width: 6px;
  /* Thicker border */
  border-radius: 40px;
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.8);
  animation: event-pop 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#event-reveal-name {
  font-size: clamp(2.5rem, 8vw, 4.5rem);
  font-weight: 900;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 2px;
}

#event-reveal-desc {
  font-size: 1.4rem;
  opacity: 0.9;
}

.event-reveal-card.speed {
  background: linear-gradient(135deg, #ff5555, #ffb86c);
  border-color: rgba(255, 255, 255, 0.3);
}

.event-reveal-card.double {
  background: linear-gradient(135deg, #50fa7b, #8be9fd);
  border-color: rgba(255, 255, 255, 0.3);
}

.event-reveal-card.fog {
  background: linear-gradient(135deg, #6272a4, #f8f8f2);
  color: #282a36;
}

.event-reveal-card.rotate {
  background: linear-gradient(135deg, #bd93f9, #ff79c6);
}

.event-reveal-card.perfection {
  background: linear-gradient(135deg, #ffb86c, #ff5555);
}

@keyframes event-pop {
  0% {
    transform: scale(0) rotate(-10deg);
    opacity: 0;
  }

  100% {
    transform: scale(1) rotate(0deg);
    opacity: 1;
  }
}

/* Map Event Modifiers */
#map.fog {
  filter: blur(10px);
  transition: filter 2s ease;
}

#map.rotate {
  transform: rotate(180deg);
  transition: transform 1s ease-in-out;
}

#map.zoom-lock {
  cursor: not-allowed;
}

/* Leaderboard */
.leaderboard-wrap {
  background: rgba(40, 42, 54, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.leaderboard-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.leaderboard-row:last-child {
  border-bottom: none;
}

.leaderboard-rank {
  font-weight: 800;
  color: var(--accent);
  width: 24px;
}

.leaderboard-info {
  flex: 1;
  padding-left: 10px;
}

.leaderboard-name {
  font-weight: 700;
  font-size: 0.95rem;
}

.leaderboard-date {
  font-size: 0.7rem;
  color: var(--muted);
}

.leaderboard-score {
  font-weight: 800;
  color: #fff;
  text-align: right;
  min-width: 60px;
}

.leaderboard-score span {
  font-size: 0.7rem;
  color: var(--muted);
  font-weight: 400;
  margin-left: 2px;
}

/* Mode Selection Highlight */
.mode-card.selected {
  border-color: var(--accent);
  box-shadow: 0 0 20px rgba(124, 111, 247, 0.4);
  transform: translateY(-4px) scale(1.02);
  background: rgba(124, 111, 247, 0.1);
}

.mode-card.selected h3 {
  color: var(--accent);
}

/* ── Map Filters for Events ──────────────────────────────────── */
#map.blurred {
  filter: blur(14px);
}

#map.grayscale-event {
  filter: grayscale(100%);
}

#map.rotated {
  transform: rotate(180deg);
}

#map {
  transition: filter 1s ease, transform 1.5s ease;
}

/* ── Team Mode ──────────────────────────────────────────────── */
.team-badge {
  font-size: 0.72rem;
  margin-left: 8px;
  background: rgba(255, 255, 255, 0.08);
  padding: 3px 8px;
  border-radius: 6px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.team-badge.alpha {
  color: #4D96FF;
  background: rgba(77, 150, 255, 0.15);
  border-color: rgba(77, 150, 255, 0.3);
}

.team-badge.beta {
  color: #FF6B6B;
  background: rgba(255, 107, 107, 0.15);
  border-color: rgba(255, 107, 107, 0.3);
}

#res-team-stats {
  border: 1px solid var(--border);
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.2);
}

/* ── Thief Mode ────────────────────────────────────────────── */
#thief-panel {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1000;
  width: 90%;
  max-width: 500px;
  text-align: center;
}

.city-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  max-height: 400px;
  overflow-y: auto;
  padding: 10px;
}

.city-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 12px;
  border-radius: 8px;
  color: white;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.city-btn:hover {
  background: var(--accent);
  border-color: white;
  transform: translateY(-2px);
}

/* -- POI Mode Image ------------------------------------------- */
.poi-image-wrap {
  width: 100%;
  max-width: 380px;
  margin: 15px auto 4px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  background: #000;
  display: none;
  animation: poiSlideDown .4s ease-out;
}

@keyframes poiSlideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.poi-image-wrap.visible {
  display: block;
}

.poi-image-wrap img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
}

/* -- Dataset Selection ---------------------------------------- */
.dataset-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.dataset-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.05);
  padding: 10px 14px;
  border-radius: 10px;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.2s;
}

.dataset-item:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--accent);
}

.dataset-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  cursor: pointer;
}

.dataset-label {
  font-size: 0.95rem;
  font-weight: 500;
}

@media (max-width: 480px) {
  .dataset-grid {
    grid-template-columns: 1fr;
  }
}