:root {
  --icon-size: 48px;
  --spin-dur: 14s;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: #0b1220;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: #e6edf3;
}

#map {
  position: absolute;
  inset: 0;
}

/* ---------- top bar ---------- */
#topbar {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 1000;
  background: rgba(15, 22, 35, 0.85);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  padding: 10px 14px;
  pointer-events: none;
}
#title {
  font-weight: 700;
  letter-spacing: 0.08em;
  font-size: 13px;
  color: #7dd3fc;
}
#status {
  font-size: 12px;
  color: #9fb0c3;
  margin-top: 2px;
}

/* ---------- storm list sidebar ---------- */
#stormList {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 1000;
  width: 250px;
  max-height: calc(100vh - 24px);
  overflow-y: auto;
  background: rgba(15, 22, 35, 0.85);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  padding: 8px;
}
.stormCard {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s;
}
.stormCard:hover {
  background: rgba(255,255,255,0.06);
}
.stormCard img {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}
.stormCard .name {
  font-size: 13px;
  font-weight: 600;
}
.stormCard .meta {
  font-size: 11px;
  color: #9fb0c3;
}
#stormList h4 {
  margin: 4px 6px;
  font-size: 11px;
  letter-spacing: 0.06em;
  color: #7dd3fc;
  text-transform: uppercase;
}

/* ---------- debug menu ---------- */
#debugToggle {
  position: absolute;
  bottom: 16px;
  right: 16px;
  z-index: 1001;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(15, 22, 35, 0.9);
  color: #e6edf3;
  font-size: 18px;
  cursor: pointer;
}
#debugPanel {
  position: absolute;
  bottom: 64px;
  right: 16px;
  z-index: 1001;
  width: 230px;
  background: rgba(15, 22, 35, 0.95);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  padding: 14px;
}
#debugPanel.hidden { display: none; }
#debugPanel h3 {
  margin: 0 0 10px;
  font-size: 12px;
  letter-spacing: 0.08em;
  color: #7dd3fc;
}
#debugPanel label {
  display: block;
  font-size: 12px;
  margin-bottom: 10px;
  color: #cbd5e1;
}
#debugPanel input[type="range"] {
  width: 100%;
}
#debugPanel .checkboxRow {
  display: flex;
  align-items: center;
  gap: 6px;
}
#debugPanel .checkboxRow input { width: auto; }
#debugPanel button {
  width: 100%;
  padding: 8px;
  border-radius: 6px;
  border: none;
  background: #7dd3fc;
  color: #0b1220;
  font-weight: 600;
  cursor: pointer;
}

/* ---------- storm icon markers ---------- */
.stormIconWrapper {
  width: var(--icon-size);
  height: var(--icon-size);
}
.stormIconWrapper svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.spin-cw [data-anim="true"] {
  transform-box: view-box;
  transform-origin: 50% 50%;
  animation: spin-cw var(--spin-dur) linear infinite;
}
.spin-ccw [data-anim="true"] {
  transform-box: view-box;
  transform-origin: 50% 50%;
  animation: spin-ccw var(--spin-dur) linear infinite;
}
.spin-paused [data-anim="true"] {
  animation-play-state: paused !important;
}

@keyframes spin-cw {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
@keyframes spin-ccw {
  from { transform: rotate(0deg); }
  to   { transform: rotate(-360deg); }
}

/* ---------- leaflet popup theming ---------- */
.leaflet-popup-content-wrapper {
  background: #0f1623;
  color: #e6edf3;
  border-radius: 8px;
}
.leaflet-popup-tip { background: #0f1623; }
.popupTitle {
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 4px;
}
.popupRow {
  font-size: 12px;
  color: #cbd5e1;
  margin: 1px 0;
}
