/* ============================================================
   Hear the Earth — minimal dark UI
   Same design language as the other tools: deep navy, frosted
   panels, flat cyan accent, instrument mono. No gradients.
   ============================================================ */

:root {
  --navy:   #05060f;
  --panel:  rgba(18, 22, 48, 0.55);
  --border: rgba(140, 160, 255, 0.18);
  --text:   #e7e9ff;
  --muted:  #8b90c0;
  --accent: #58C69D; /* leafy green, this tool's identity color */
  --mono: ui-monospace, "Cascadia Mono", Consolas, "SF Mono", Menlo, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  background: var(--navy);
  color: var(--text);
  font-family: var(--mono);
  -webkit-font-smoothing: antialiased;
}

/* The map fills the whole window */
#map {
  position: fixed;
  inset: 0;
  background: var(--navy);
}

/* Leaflet, dressed for the dark */
.leaflet-container { background: var(--navy); font-family: var(--mono); }
.leaflet-control-attribution {
  background: rgba(18, 22, 48, 0.7) !important;
  color: var(--muted) !important;
  font-size: 10px;
}
.leaflet-control-attribution a { color: var(--accent) !important; }
.leaflet-control-zoom a {
  background: rgba(18, 22, 48, 0.85) !important;
  color: var(--text) !important;
  border-color: var(--border) !important;
}
.leaflet-control-zoom a:hover { background: rgba(40, 48, 90, 0.9) !important; }

.hidden { display: none !important; }

/* ---------- Playback sweep line over the map ---------- */
#playhead {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  width: 2px;
  background: var(--accent);
  z-index: 500;               /* above map tiles, below panels */
  pointer-events: none;
  box-shadow: 0 0 12px rgba(88, 198, 157, 0.8);
}

/* ---------- Brand card (top left): one click, straight home ---------- */
#brand {
  position: fixed;
  top: max(28px, env(safe-area-inset-top));
  left: max(32px, env(safe-area-inset-left));
  z-index: 1100;
  display: block;
  padding: 10px 16px 12px;
  background: #ececef;
  color: #0d0e12;
  border-radius: 2px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  text-decoration: none;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  transition: background 0.18s ease;
}
#brand:hover { background: #ffffff; }
#brand span {
  display: block;
  margin-top: 2px;
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: lowercase;
  color: #6a6b73;
}

/* ---------- Tool tag (bottom left): name + what it does ---------- */
#tool-tag {
  position: fixed;
  left: 32px;
  bottom: 26px;
  z-index: 1100;
  padding: 10px 14px;
  background: rgba(18, 22, 48, 0.75);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border);
  border-radius: 2px;
  pointer-events: none;
  user-select: none;
}
#tool-tag strong {
  display: block;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text);
}
#tool-tag span {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  color: var(--muted);
}

/* ---------- Status line ---------- */
#status {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1200;
  padding: 16px 28px;
  border-radius: 2px;
  background: var(--panel);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border);
  font-size: 14px;
  color: var(--text);
  text-align: center;
}
#status.error { color: #ff8a8a; border-color: rgba(255, 138, 138, 0.4); }

/* ---------- Control panel ---------- */
#scan-panel {
  position: fixed;
  top: 90px;
  right: 28px;
  z-index: 1100;
  width: 268px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  padding: 18px 20px;
  border-radius: 2px;
  background: var(--panel);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}
#scan-panel h2 {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text);
  border-left: 3px solid var(--accent);
  padding-left: 9px;
}
#scan-panel .hint {
  margin: 0 0 14px;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.5;
}

#preview {
  display: block;
  width: 100%;
  border-radius: 2px;
  margin: 14px 0 6px;
  border: 1px solid var(--border);
  background: var(--navy);
}
.stats {
  margin: 0 0 14px;
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.ctl { display: block; margin-bottom: 14px; }
.ctl > span {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}
.ctl em { color: var(--text); font-style: normal; }

.ctl.checkbox {
  display: flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
}
.ctl.checkbox input { width: 15px; height: 15px; accent-color: var(--accent); cursor: pointer; }
.ctl.checkbox span { font-size: 12px; color: var(--muted); margin: 0; }

input[type="range"] {
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  height: 5px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.12);
  cursor: pointer;
  outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 9px; height: 20px;
  border-radius: 3px;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(88, 198, 157, 0.25);
}
input[type="range"]::-moz-range-thumb {
  width: 9px; height: 20px;
  border: none;
  border-radius: 3px;
  background: #fff;
}

/* Notch marks under sliders (spans injected by main.js) */
.ticks {
  display: flex;
  justify-content: space-between;
  padding: 5px 3px 0;
}
.ticks span {
  width: 1px;
  height: 5px;
  background: rgba(140, 160, 255, 0.35);
}

/* Buttons */
#scan-btn, #play-btn, #download-btn, #explore-btn {
  width: 100%;
  padding: 11px;
  border: none;
  border-radius: 2px;
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  color: var(--navy);
  cursor: pointer;
  background: var(--accent);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  box-shadow: 0 6px 24px rgba(88, 198, 157, 0.2);
}
#scan-btn:hover, #play-btn:hover, #download-btn:hover, #explore-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 30px rgba(88, 198, 157, 0.3);
}
#play-btn { margin-top: 4px; }
#play-btn.playing {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: none;
}
#download-btn.secondary, #explore-btn.secondary {
  margin-top: 9px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: none;
}
#download-btn.secondary:hover, #explore-btn.secondary:hover { background: rgba(255, 255, 255, 0.16); }

/* ---------- Mobile ---------- */
@media (max-width: 600px) {
  #brand { top: max(14px, env(safe-area-inset-top)); left: max(14px, env(safe-area-inset-left)); padding: 8px 12px 10px; font-size: 13px; }
  #tool-tag { display: none; }

  #scan-panel {
    top: auto;
    bottom: max(10px, env(safe-area-inset-bottom));
    left: 8px;
    right: 8px;
    width: auto;
    max-height: 55vh;
    padding: 12px 16px;
  }
  #scan-panel .hint { display: none; }
}
