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

body {
  overflow: hidden;
  background: #0a0a1a;
  font-family: system-ui, -apple-system, sans-serif;
  color: #e0e0e0;
}

#globe-canvas {
  display: block;
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  touch-action: none;
  z-index: 0;
}

#webgl-fallback {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0a0a1a;
  color: #fff;
  font-size: 1.1rem;
  padding: 1rem;
  text-align: center;
  z-index: 1000;
}
#webgl-fallback.hidden { display: none; }

/* ===== Timeline ===== */

#timeline-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(10, 10, 30, 0.88);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  padding: 6px 12px 4px;
}

#timeline-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

#range-presets {
  display: flex;
  gap: 4px;
}

#range-presets button {
  padding: 2px 10px;
  font-size: 0.8rem;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 3px;
  color: #aaa;
  cursor: pointer;
  transition: all 0.15s;
}
#range-presets button:hover { background: rgba(255,255,255,0.12); color: #ddd; }
#range-presets button.active {
  background: rgba(80,120,200,0.4);
  border-color: rgba(80,120,200,0.6);
  color: #fff;
}

#nav-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
}
#nav-buttons button {
  padding: 2px 8px;
  font-size: 0.85rem;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 3px;
  color: #aaa;
  cursor: pointer;
}
#nav-buttons button:hover { background: rgba(255,255,255,0.12); color: #ddd; }
#range-label {
  font-size: 0.82rem;
  color: #999;
  min-width: 100px;
  text-align: center;
}

#timeline-chart-wrap {
  width: 100%;
  height: 52px;
  position: relative;
}
#timeline-canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

#status-bar {
  height: 16px;
  display: flex;
  align-items: center;
}
#status-text {
  font-size: 0.75rem;
  color: #888;
}

/* ===== Left panel ===== */

#panel {
  position: fixed;
  left: 8px;
  top: 108px;
  z-index: 100;
  padding: 10px 12px;
  background: rgba(10, 10, 30, 0.85);
  backdrop-filter: blur(8px);
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.1);
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 140px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
}

.panel-section {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.panel-title {
  font-size: 0.78rem;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 2px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  padding-bottom: 3px;
}

.band-filter-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 1px 0;
  cursor: pointer;
  font-size: 0.82rem;
}
.band-filter-row input[type="checkbox"] {
  accent-color: var(--band-color, #888);
  width: 14px;
  height: 14px;
  cursor: pointer;
}
.band-filter-row .band-swatch {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  flex-shrink: 0;
}
.band-filter-row .band-name {
  color: #ccc;
}
.band-filter-row.disabled .band-name {
  color: #555;
}

.btn-row {
  display: flex;
  gap: 6px;
  margin-top: 2px;
}
.btn-row button {
  flex: 1;
  padding: 3px 6px;
  font-size: 0.75rem;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 3px;
  color: #aaa;
  cursor: pointer;
}
.btn-row button:hover { background: rgba(255,255,255,0.12); color: #ddd; }

.radio-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  color: #bbb;
  cursor: pointer;
  padding: 1px 0;
}
.radio-label input[type="radio"] {
  accent-color: #5078c8;
  width: 14px;
  height: 14px;
  cursor: pointer;
}

/* ===== Welcome box (bottom-right) ===== */

#welcome-box {
  position: fixed;
  bottom: 12px;
  right: 12px;
  z-index: 90;
  max-width: 320px;
  padding: 12px 14px;
  background: rgba(10, 20, 40, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  font-size: 0.88rem;
  line-height: 1.4;
  color: #ddd;
}
#welcome-box.hidden { display: none; }
#welcome-box p { margin: 0 0 8px 0; }
#welcome-box p:last-of-type { margin-bottom: 10px; }
#welcome-box a {
  color: #7ab8ff;
  text-decoration: none;
}
#welcome-box a:hover { text-decoration: underline; }
#welcome-box #welcome-dismiss {
  display: block;
  width: 100%;
  padding: 6px 10px;
  margin-top: 4px;
  background: rgba(80, 120, 200, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  color: #e0e0e0;
  font-size: 0.85rem;
  cursor: pointer;
}
#welcome-box #welcome-dismiss:hover {
  background: rgba(80, 120, 200, 0.6);
}

/* ===== Responsive ===== */

@media (max-width: 480px) {
  #panel {
    left: 4px;
    top: 100px;
    min-width: 120px;
    padding: 8px;
  }
  #timeline-bar {
    padding: 4px 6px 2px;
  }
  #range-presets button {
    padding: 2px 6px;
    font-size: 0.72rem;
  }
}
