html, body {
  width: 100%; height: 100%;
  overflow: hidden; overscroll-behavior: none;
  background: var(--bg);
  font-family: 'Rajdhani', sans-serif;
  color: var(--text);
  cursor: crosshair;
}

/* -- THEMED SCROLLBAR (desktop) -- */
@media (min-width: 721px) {
  /* Firefox */
  * { scrollbar-width: thin; scrollbar-color: rgba(57,255,20,0.25) transparent; }

  /* WebKit / Chromium */
  ::-webkit-scrollbar { width: 8px; height: 8px; }
  ::-webkit-scrollbar-track {
    background: transparent;
    border-left: 1px solid var(--border);
  }
  ::-webkit-scrollbar-thumb {
    background: rgba(57,255,20,0.18);
    border-radius: 4px;
    border: 1px solid rgba(57,255,20,0.3);
    box-shadow: inset 0 0 4px rgba(57,255,20,0.25);
  }
  ::-webkit-scrollbar-thumb:hover {
    background: rgba(57,255,20,0.32);
    box-shadow: inset 0 0 6px rgba(57,255,20,0.5);
  }
  ::-webkit-scrollbar-corner { background: transparent; }

  [data-theme="light"] * { scrollbar-color: rgba(71,85,105,0.35) transparent; }
  [data-theme="light"] ::-webkit-scrollbar-thumb {
    background: rgba(71,85,105,0.25);
    border: 1px solid rgba(71,85,105,0.4);
    box-shadow: none;
  }
  [data-theme="light"] ::-webkit-scrollbar-thumb:hover {
    background: rgba(71,85,105,0.45);
  }
}

/* -- SCANLINE OVERLAY (removed) -- */
body::after {
  content: '';
  position: fixed; inset: 0; z-index: 998;
  pointer-events: none;
}

/* -- MAP -- */
#map { position: fixed; inset: 0; z-index: 0; }
.leaflet-container { background: var(--map-bg); }
.leaflet-control-attribution { display: none !important; }
.leaflet-top.leaflet-left {
  top: auto !important;
  left: auto !important;
  bottom: 32px;
  right: 16px;
}
/* On mobile, keep zoom controls above the bottom sheet */
@media (max-width: 720px) {
  .leaflet-top.leaflet-left {
    bottom: 56vh !important;
    right: 12px !important;
  }
}
.leaflet-control-zoom {
  border: none !important; border-radius: 20px !important;
  background: rgba(3,14,3,0.85) !important;
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
  overflow: hidden;
}
.leaflet-control-zoom a {
  color: var(--text) !important;
  background: transparent !important;
  font-family: 'Rajdhani', sans-serif;
  font-size: 20px; font-weight: 600;
  width: 38px !important; height: 38px !important;
  line-height: 38px !important;
  border: none !important;
  transition: all .15s;
}
.leaflet-control-zoom a:hover { background: rgba(57,255,20,0.08) !important; color: var(--green) !important; }
/* Eliminate sub-pixel gaps between satellite tile images */
.leaflet-tile { transform: scale(1.004); }

/* -- HEADER -- */
#header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 24px;
  background: linear-gradient(to bottom, rgba(5,10,15,0.96) 0%, transparent 100%);
  pointer-events: none;
}
#header > * { pointer-events: all; }

.logo { position: fixed; bottom: 48px; right: 16px; z-index: 200; }
.logo img { height: 240px; display: block; }
.logo .logo-mobile { display: none; }

#no-location-msg {
  display: none;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 14px;
  margin-bottom: 4px;
  background: rgba(255,80,80,0.05);
  border-left: 2px solid rgba(255,80,80,0.3);
  border-radius: 2px;
}

#loc-wrap {
  margin-bottom: 10px;
  padding: 10px 12px;
  background: rgba(57,255,20,0.04);
  border: 1px solid rgba(57,255,20,0.12);
  border-left: 2px solid var(--teal);
}
.loc-label {
  font-size: 9px; font-weight: 700; letter-spacing: 2.5px;
  text-transform: uppercase; color: var(--muted);
  margin-bottom: 6px;
}
.loc-main {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.loc-city {
  display: flex; align-items: center; gap: 8px;
  overflow: hidden; flex: 1; min-width: 0;
}
#loc-refresh {
  flex-shrink: 0;
  background: none; cursor: pointer;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 10px;
  display: flex; align-items: center; gap: 5px;
  font-family: 'Rajdhani', sans-serif; font-size: 9px; font-weight: 700;
  letter-spacing: 1.5px; text-transform: uppercase;
  transition: all .2s; -webkit-tap-highlight-color: transparent;
}
#loc-refresh svg { width: 13px; height: 13px; flex-shrink: 0; }
#loc-refresh:hover:not(:disabled) { color: var(--green); border-color: var(--green); }
#loc-refresh:disabled { opacity: 0.3; cursor: default; }
#loc-refresh.spinning svg { animation: loc-spin 0.8s ease; }
@keyframes loc-spin { 0% { transform: rotate(0); } 100% { transform: rotate(360deg); } }
.loc-pin {
  width: 14px; height: 14px; flex-shrink: 0;
  color: var(--teal);
}
#loc-text {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 20px; letter-spacing: 1px; line-height: 1;
  color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  min-width: 0; flex: 1;
}
.pulse-dot {
  flex-shrink: 0;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green), 0 0 16px rgba(57,255,20,0.4);
  animation: pulse 2s ease-in-out infinite;
}
.ovation-canvas { will-change: contents; }

/* -- COORDINATE BAR -- */
#coord-bar {
  position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 200;
  background: var(--glass);
  backdrop-filter: blur(22px); -webkit-backdrop-filter: blur(22px);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 8px 18px;
  display: flex; gap: 4px 14px; align-items: baseline;
  cursor: pointer; transition: all .15s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
#coord-bar:hover { opacity: 0.85; }
#coord-bar.copied { box-shadow: 0 0 0 1px var(--green), 0 2px 8px rgba(0,0,0,0.3); }
.coord-lbl {
  font-family: 'Rajdhani', sans-serif; font-size: 9px; font-weight: 700;
  letter-spacing: 2px; text-transform: uppercase;
  color: var(--muted); margin-right: 4px;
}
.coord-val {
  font-family: 'Bebas Neue', sans-serif; font-size: 16px;
  color: var(--green); letter-spacing: 1px;
  text-shadow: 0 0 6px rgba(57,255,20,0.3);
}

/* Copy tooltip */
#coord-tip {
  position: fixed; z-index: 9999;
  transform: translateX(-50%);
  background: var(--ctrl-bg); color: var(--green); border: 1px solid rgba(57,255,20,0.25);
  font-family: 'Rajdhani', sans-serif; font-size: 10px; font-weight: 700;
  letter-spacing: 2px; text-transform: uppercase;
  padding: 5px 12px; border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
  opacity: 0; transition: opacity .2s;
  pointer-events: none;
}
#coord-tip.visible { opacity: 1; }

/* -- LOADING -- */
#loading {
  position: fixed; inset: 0; z-index: 400; background: var(--bg);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px;
  transition: opacity .8s ease;
}
#loading.out { opacity: 0; pointer-events: none; }

.ld-logo { position: relative; }
.ld-logo img {
  height: 200px; display: block;
  filter: drop-shadow(0 0 20px rgba(57,255,20,0.6)) drop-shadow(0 0 40px rgba(0,255,65,0.25));
  background: transparent; opacity: 0; transition: opacity 0.4s;
}
.ld-logo img.loaded { opacity: 1; }

/* Circular progress ring */
.ld-progress {
  width: 48px; height: 48px; margin-top: 24px;
}
.ld-progress svg { display: block; animation: ld-ring-rotate 1.8s linear infinite; }
.ld-progress circle {
  fill: none; stroke-width: 2; stroke-linecap: round;
}
.ld-progress .track { stroke: rgba(255,255,255,0.04); }
.ld-progress .fill {
  stroke: var(--teal); stroke-dasharray: 100; stroke-dashoffset: 60;
  filter: drop-shadow(0 0 4px rgba(57,255,20,0.6));
}

/* Status text with pulse */
.ld-txt {
  font-size: 11px; font-weight: 600; letter-spacing: 3.5px;
  text-transform: uppercase; color: var(--muted);
  margin-top: 18px;
  animation: ld-txt-pulse 2s ease-in-out infinite;
}

/* -- USER MARKER -- */
.u-dot {
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--green); border: 2px solid rgba(2,8,2,0.8);
  box-shadow: 0 0 0 2px var(--teal), 0 0 16px var(--teal), 0 0 32px rgba(57,255,20,.5);
  animation: umarker 2.4s ease-in-out infinite;
}
