﻿:root {
  --bg-0: #05070d;
  --bg-1: #0a1220;
  --panel: rgba(7, 14, 24, 0.82);
  --panel-border: rgba(163, 193, 255, 0.18);
  --text: #f7f8fb;
  --muted: rgba(236, 241, 248, 0.74);
  --accent: #ff4db8;
  --accent-soft: #ffd8f1;
  --shadow: 0 18px 42px rgba(0, 0, 0, 0.28);
  --radius: 24px;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  background: linear-gradient(180deg, #0a1220, #04060a 74%);
  color: var(--text);
  font-family: "IBM Plex Sans", system-ui, sans-serif;
}

body {
  overflow: hidden;
}

button,
input {
  font: inherit;
}

#app-shell {
  position: relative;
  width: 100vw;
  height: 100vh;
  isolation: isolate;
}

.viewport {
  position: absolute;
  inset: 0;
}

#map-root {
  z-index: 0;
}

.top-scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(4, 8, 15, 0.76) 0%, rgba(4, 8, 15, 0.28) 22%, transparent 40%),
    radial-gradient(circle at 16% 10%, rgba(255, 77, 184, 0.14), transparent 24%),
    radial-gradient(circle at 82% 12%, rgba(95, 153, 255, 0.12), transparent 22%);
}

.hero,
.control-panel,
.status-bar,
.credits {
  position: absolute;
  z-index: 2;
}

.hero {
  top: 28px;
  left: 28px;
  max-width: none;
  pointer-events: none;
}

.hero h1 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(2.25rem, 4.6vw, 4.9rem);
  line-height: 1;
  letter-spacing: -0.06em;
  white-space: nowrap;
  color: var(--accent-soft);
}

.control-panel {
  top: 28px;
  right: 28px;
  width: min(380px, calc(100vw - 56px));
  padding: 18px;
  border-radius: var(--radius);
  border: 1px solid var(--panel-border);
  background: linear-gradient(180deg, rgba(15, 26, 40, 0.86), rgba(6, 12, 20, 0.82));
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.panel-label {
  margin: 0 0 12px;
  color: rgba(247, 248, 251, 0.82);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.switch-row strong {
  display: block;
  font-weight: 600;
}

.switch-row small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.35;
}

.switch {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
  width: 56px;
  height: 32px;
}

.switch input {
  position: absolute;
  inset: 0;
  opacity: 0;
  margin: 0;
  cursor: pointer;
}

.slider {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: background 180ms ease;
}

.slider::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(180deg, #ffffff, #f3e1ee);
  box-shadow: 0 5px 14px rgba(0, 0, 0, 0.24);
  transition: transform 180ms ease;
}

.switch input:checked + .slider {
  background: linear-gradient(180deg, rgba(255, 77, 184, 0.72), rgba(162, 36, 108, 0.78));
}

.switch input:checked + .slider::after {
  transform: translateX(24px);
}

.button-row {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.cta-button,
.ghost-button {
  flex: 1;
  min-height: 44px;
  border-radius: 999px;
  cursor: pointer;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease;
}

.cta-button {
  border: 1px solid rgba(255, 133, 211, 0.42);
  background: linear-gradient(135deg, #ff9fda, #ff4db8 62%, #d1298a);
  color: #170511;
  font-weight: 700;
}

.ghost-button {
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-weight: 600;
}

.cta-button:hover,
.cta-button:focus-visible,
.ghost-button:hover,
.ghost-button:focus-visible {
  outline: none;
  transform: translateY(-1px);
}

.loading-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  padding: 10px 12px;
  border-radius: 999px;
  background: rgba(255, 77, 184, 0.12);
  border: 1px solid rgba(255, 77, 184, 0.28);
  color: var(--accent-soft);
  font-weight: 600;
  font-size: 0.92rem;
}

.loading-pill::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: currentColor;
  animation: pulse 1.1s ease-in-out infinite;
}

.panel-note {
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.status-bar {
  left: 28px;
  bottom: 72px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-radius: 999px;
  background: rgba(7, 14, 22, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(16px);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.2);
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 7px 11px;
  border-radius: 999px;
  background: rgba(255, 77, 184, 0.18);
  color: var(--accent-soft);
  font-size: 0.88rem;
  font-weight: 700;
}

.detail-text {
  color: var(--muted);
  font-size: 0.96rem;
}

.credits {
  right: 28px;
  bottom: 18px;
  max-width: min(720px, calc(100vw - 56px));
  color: rgba(247, 248, 251, 0.6);
  font-size: 0.8rem;
  line-height: 1.45;
  text-align: right;
}

.maplibregl-ctrl-bottom-right {
  right: 28px;
  bottom: 28px;
}

.maplibregl-ctrl-group {
  border-radius: 18px !important;
  overflow: hidden;
  background: rgba(7, 14, 22, 0.84) !important;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: var(--shadow);
}

.maplibregl-ctrl button {
  background-color: transparent !important;
}

.maplibregl-popup-content {
  padding: 0 !important;
  border-radius: 18px !important;
  background: linear-gradient(180deg, rgba(14, 24, 38, 0.96), rgba(8, 12, 20, 0.96)) !important;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 20px 36px rgba(0, 0, 0, 0.34);
}

.maplibregl-popup-tip {
  border-top-color: rgba(8, 12, 20, 0.96) !important;
}

.county-popup {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 240px;
  padding: 16px;
}

.county-popup-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.county-popup h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent-soft);
}

.county-popup-close {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(247, 248, 251, 0.84);
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
}

.county-popup-input {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

.county-popup-input::placeholder {
  color: rgba(236, 241, 248, 0.42);
}

.county-popup-save {
  align-self: flex-start;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 133, 211, 0.42);
  background: linear-gradient(135deg, #ff9fda, #ff4db8 62%, #d1298a);
  color: #170511;
  font-weight: 700;
  cursor: pointer;
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(0.8);
    opacity: 0.56;
  }

  50% {
    transform: scale(1);
    opacity: 1;
  }
}

@media (max-width: 880px) {
  body {
    overflow-y: auto;
  }

  #app-shell {
    min-height: 100vh;
    height: auto;
  }

  .hero {
    top: 18px;
    left: 18px;
    right: 18px;
  }

  .hero h1 {
    font-size: clamp(1.9rem, 8vw, 3rem);
  }

  .control-panel {
    top: auto;
    right: 18px;
    left: 18px;
    bottom: 118px;
    width: auto;
  }

  .status-bar {
    left: 18px;
    right: 18px;
    bottom: 18px;
    flex-wrap: wrap;
    border-radius: 22px;
  }

  .credits {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

