:root {
  --bg-space: #05070b;
  --surface-glass: rgba(10, 15, 26, 0.82);
  --surface-glass-strong: rgba(8, 12, 22, 0.94);
  --border-hairline: rgba(255, 255, 255, 0.12);
  --border-accent: rgba(0, 245, 212, 0.38);
  --accent-cyan: #00f5d4;
  --accent-emerald: #10b981;
  --accent-gold: #f59e0b;
  --accent-crimson: #ef4444;
  --accent-blue: #3b82f6;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-space);
  color: #f8fafc;
  font-family: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-font-smoothing: antialiased;
  color-scheme: dark;
}

.font-display {
  font-family: "Outfit", sans-serif;
}

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

/* Deep space backdrop + starfield canvas */
#space-backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(circle at 50% 45%, rgba(16, 36, 68, 0.42) 0%, rgba(7, 11, 20, 0.85) 55%, #05070b 100%);
  pointer-events: none;
}

#starfield-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

#confetti-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 80;
  pointer-events: none;
}

#map {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1;
  background: transparent;
  cursor: crosshair;
}

#map.is-dragging {
  cursor: grabbing;
}

/* Glass panels */
.glass-panel {
  background: var(--surface-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-hairline);
  box-shadow: 0 18px 48px -16px rgba(0, 0, 0, 0.72);
}

.glass-panel-strong {
  background: var(--surface-glass-strong);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-hairline);
  box-shadow: 0 24px 64px -16px rgba(0, 0, 0, 0.85);
}

/* Pro Gold Luxury Surface */
.pro-gold-surface {
  background: linear-gradient(160deg, rgba(20, 17, 12, 0.96) 0%, rgba(10, 14, 24, 0.97) 100%);
  border: 1px solid rgba(245, 158, 11, 0.36);
  box-shadow: 0 24px 72px -16px rgba(245, 158, 11, 0.22);
}

.pro-badge-glow {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.22), rgba(217, 119, 6, 0.14));
  border: 1px solid rgba(245, 158, 11, 0.55);
  color: #fbbf24;
  box-shadow: 0 0 18px rgba(245, 158, 11, 0.24);
}

/* Custom MapLibre marker pins */
.ml-pin-wrap {
  position: relative;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.ml-pin-ring {
  position: absolute;
  inset: -4px;
  border-radius: 9999px;
  opacity: 0.45;
  animation: pin-ring 2s cubic-bezier(0.16, 1, 0.3, 1) infinite;
}

.ml-pin-core {
  width: 16px;
  height: 16px;
  border-radius: 9999px;
  border: 2.5px solid #ffffff;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.65);
}

.ml-pin-guess .ml-pin-ring {
  background: rgba(59, 130, 246, 0.45);
}

.ml-pin-guess .ml-pin-core {
  background: var(--accent-blue);
  box-shadow: 0 0 16px rgba(59, 130, 246, 0.85);
}

.ml-pin-target .ml-pin-ring {
  background: rgba(16, 185, 129, 0.5);
}

.ml-pin-target .ml-pin-core {
  background: var(--accent-emerald);
  box-shadow: 0 0 18px rgba(16, 185, 129, 0.9);
}

.ml-pin-label {
  position: absolute;
  top: -26px;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.01em;
  background: rgba(5, 7, 11, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #f8fafc;
}

@keyframes pin-ring {
  0% {
    transform: scale(0.8);
    opacity: 0.65;
  }
  100% {
    transform: scale(1.75);
    opacity: 0;
  }
}

/* Custom subtle scrollbars */
.custom-scroll::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.custom-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.custom-scroll::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.16);
  border-radius: 9999px;
}

.custom-scroll::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.28);
}

/* Slide-out drawer transition */
.drawer-backdrop {
  transition: opacity 180ms cubic-bezier(0.16, 1, 0.3, 1);
}

.drawer-panel {
  transition: transform 200ms cubic-bezier(0.16, 1, 0.3, 1);
}

/* MapLibre attribution compact dark styling */
.maplibregl-ctrl-attrib {
  background: rgba(5, 7, 11, 0.6) !important;
  color: rgba(226, 232, 240, 0.65) !important;
  font-size: 10px !important;
  backdrop-filter: blur(6px);
}

.maplibregl-ctrl-attrib a {
  color: rgba(226, 232, 240, 0.8) !important;
}

.maplibregl-ctrl-bottom-right {
  bottom: 4px !important;
  right: 6px !important;
}

@media (prefers-reduced-motion: reduce) {
  .ml-pin-ring {
    animation: none;
  }
  .drawer-backdrop,
  .drawer-panel {
    transition: none;
  }
}
