:root {
  --wine:      #7B3638;
  --slate:     #415A80;
  --frost:     #A5D4DC;
  --petal:     #F8ADB5;
  --blush:     #F8D8D8;
  --cream:     #FCEEDD;
  --snowdrift: #FFF6FA;
  --text-primary:   #2D2D3A;
  --text-secondary: #6B6B7E;
  --header-h: 56px;
  --notice-h: 0px;
}

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

body {
  font-family: 'Unbounded', system-ui, -apple-system, sans-serif;
  background: var(--snowdrift);
  overflow: hidden;
  height: 100dvh;
}

/* ── Header ─────────────────────────────────────────────────── */
#header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  z-index: 1000;
  background: rgba(255, 246, 250, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(248, 216, 216, 0.6);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 16px;
}

.header-left {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.logo {
  font-size: 18px;
  font-weight: 900;
  color: var(--wine);
  letter-spacing: 3px;
}

.tagline {
  font-size: 10px;
  font-weight: 400;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  opacity: 0.7;
}

#stats {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
}

.stat-value {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}

.stat-label {
  font-size: 9px;
  font-weight: 400;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  opacity: 0.7;
}

.stat-divider {
  width: 1px;
  height: 28px;
  background: var(--blush);
}

.app-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 20px;
  background: var(--wine);
  color: white;
  text-decoration: none;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  white-space: nowrap;
  transition: opacity 0.2s;
}

.app-badge:hover { opacity: 0.85; }

/* ── VPN Notice ──────────────────────────────────────────────── */
#vpn-notice {
  position: fixed;
  top: var(--header-h);
  left: 0; right: 0;
  z-index: 999;
  background: rgba(65, 90, 128, 0.93);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: rgba(255, 255, 255, 0.92);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.3px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 40px 8px 16px;
  line-height: 1.4;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

#vpn-notice.hidden {
  transform: translateY(-100%);
  opacity: 0;
  pointer-events: none;
}

#vpn-notice svg {
  flex-shrink: 0;
  opacity: 0.8;
}

#vpn-notice-close {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  color: rgba(255,255,255,0.6);
  font-size: 18px;
  cursor: pointer;
  padding: 2px 6px;
  line-height: 1;
  transition: color 0.15s;
}
#vpn-notice-close:hover { color: white; }

/* ── Map ─────────────────────────────────────────────────────── */
#map {
  position: fixed;
  inset: 0;
  top: calc(var(--header-h) + var(--notice-h));
  transition: top 0.3s ease;
}

/* Override Leaflet attribution */
.leaflet-control-attribution {
  font-family: system-ui, sans-serif !important;
  font-size: 10px !important;
  background: rgba(255,246,250,0.7) !important;
  backdrop-filter: blur(8px);
}

.leaflet-popup-content-wrapper {
  font-family: 'Unbounded', system-ui, sans-serif;
  border-radius: 12px !important;
  box-shadow: 0 4px 24px rgba(123, 54, 56, 0.12) !important;
}

.leaflet-popup-content {
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-primary);
}

/* ── Legend ──────────────────────────────────────────────────── */
#legend {
  position: fixed;
  bottom: 32px;
  right: 16px;
  z-index: 1000;
  background: rgba(255, 246, 250, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(248, 216, 216, 0.7);
  border-radius: 16px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 200px;
}

.legend-title {
  font-size: 9px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 2px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 400;
  color: var(--text-primary);
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  opacity: 0.85;
}

.legend-note {
  font-size: 9px;
  color: var(--text-secondary);
  opacity: 0.6;
  border-top: 1px solid var(--blush);
  padding-top: 8px;
  margin-top: 2px;
  line-height: 1.4;
}

/* ── Loading spinner ─────────────────────────────────────────── */
#loading {
  position: fixed;
  top: calc(var(--header-h) + 12px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 1001;
  background: rgba(255,246,250,0.9);
  backdrop-filter: blur(8px);
  border: 1px solid var(--blush);
  border-radius: 20px;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--text-secondary);
  pointer-events: none;
}

#loading.hidden { display: none; }

.spinner {
  width: 14px;
  height: 14px;
  border: 2px solid var(--blush);
  border-top-color: var(--wine);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ── Empty state ─────────────────────────────────────────────── */
#empty-state {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 999;
  text-align: center;
  pointer-events: none;
  display: none;
}

#empty-state.visible { display: block; }

.empty-icon {
  font-size: 48px;
  margin-bottom: 12px;
  opacity: 0.3;
}

.empty-text {
  font-size: 13px;
  color: var(--text-secondary);
  opacity: 0.6;
}

/* ── Mobile ──────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .tagline { display: none; }
  #stats { gap: 8px; }
  .stat-label { display: none; }
  .app-badge span { display: none; }
  .app-badge { padding: 6px 8px; }

  #legend {
    bottom: 16px;
    right: 8px;
    left: 8px;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px;
    min-width: 0;
  }

  .legend-title { width: 100%; }
  .legend-note { width: 100%; }
}
