:root {
  --accent: #00ccff;
  --accent-rgb: 0, 204, 255;
  --bg: #0a0a1a;
  --btn-bg: #0b3d91;
  --btn-border: #1a5cc8;
  --crew: #88aacc;
  --earth: #4488ff;
  --fg: #fff;
  --moon: #cccccc;
  --orion: #ffdd00;
  --panel-bg: rgba(0, 0, 0, 0.75);
  --phase: #ffcc00;
  --slider-end: #ff8844;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { background: var(--bg); color: var(--fg); font-family: 'Courier New', monospace; overflow: hidden; }
canvas { display: block; }

.panel {
  background: var(--panel-bg);
  border: 1px solid rgba(var(--accent-rgb), 0.3);
  border-radius: 6px;
  padding: 12px 12px;
  pointer-events: auto;
  position: fixed;
  z-index: 10;
}
body:not(.ready) .panel { display: none; }

.btn {
  background: var(--btn-bg); border: 1px solid var(--btn-border); border-radius: 4px;
  color: var(--fg); cursor: pointer;
  font-family: inherit; font-size: 12px;
  padding: 6px 12px; transition: background 0.2s;
}
.btn:hover { background: var(--btn-border); }
.btn.active { background: var(--accent); border-color: var(--accent); color: #000; }

.world-label {
  font-size: 12px; letter-spacing: 1px;
  pointer-events: none; position: fixed; z-index: 5;
  text-shadow: 0 0 8px rgba(var(--accent-rgb), 0.6);
  transform: translate(-50%, -100%);
  white-space: nowrap;
}

#fireworks-canvas { left: 0; pointer-events: none; position: fixed; top: 0; z-index: 5; }

#title-panel {
  font-size: 14px; letter-spacing: 2px;
  left: 16px; top: 16px;
  width: 330px;
}
#title-panel h1 { color: var(--accent); font-size: 16px; margin-bottom: 4px; }
#title-panel .crew { color: var(--crew); font-size: 11px; }

#data-panel {
  font-size: 14px; line-height: 1.8;
  left: 16px; top: 90px;
  letter-spacing: 2px;
  width: 330px;
}
#data-panel .label { color: var(--accent); }
#data-panel .phase { color: var(--phase); font-weight: bold; }

#support-panel {
  background: none;
  border: none;
  font-size: 13px;
  left: 16px; top: 240px;
  width: 330px;
}
#support-panel a {
  color: var(--accent);
  text-decoration: none;
}
#support-panel a:hover {
  text-decoration: underline;
}

#camera-panel {
  display: flex; gap: 6px;
  right: 16px; top: 16px;
}

#timeline-panel {
  align-items: center; display: flex; gap: 12px;
  bottom: 16px; left: 50%; transform: translateX(-50%);
  padding: 10px 12px;
  width: min(90vw, 600px);
}
#timeline-slider {
  -webkit-appearance: none; appearance: none;
  background: linear-gradient(to right, var(--accent), var(--slider-end));
  border-radius: 3px; cursor: pointer; outline: none;
  flex: 1; height: 6px;
}
#timeline-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  background: var(--fg); border-radius: 50%; cursor: grab;
  height: 16px; width: 16px;
}
#timeline-label { font-size: 11px; min-width: 40px; text-align: center; white-space: nowrap; }
#play-btn { min-width: 63px; text-align: center; }

#speed-panel {
  align-items: center; display: flex; gap: 6px;
  bottom: 16px; right: 16px;
  padding: 10px 12px;
}

#key-panel {
  bottom: 16px; left: 16px;
  font-size: 12px; letter-spacing: 2px; line-height: 1.8;
}
#key-panel .label { color: var(--accent); }

#earth-label { color: var(--earth); }
#moon-label { color: var(--moon); }
#craft-label { color: var(--orion); }

#loading {
  color: var(--accent); font-size: 18px; letter-spacing: 3px;
  left: 50%; position: fixed; top: 50%; transform: translate(-50%,-50%);
}

@media (max-width: 1344px) {
  #key-panel {
    display: none !important;
  }
  #speed-panel {
    bottom: 100px;
    justify-content: center;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: calc(100% - 32px);
  }
  #timeline-panel {
    flex-wrap: wrap;
    gap: 8px;
    width: calc(100% - 32px);
  }
  #timeline-slider {
    flex: 0 0 100%;
    order: -1;
  }
  #timeline-label {
    display: none;
  }
  #timeline-panel .btn {
    flex: 1;
  }
}
@media (max-width: 768px) {
  #title-panel {
    width: calc(100% - 32px);
  }
  #data-panel {
    width: calc(100% - 32px);
  }
  #data-panel .met-utc {
    display: none;
  }
  #data-panel {
    font-size: 13px;
  }
  #support-panel {
    display: none;
  }
  #camera-panel {
    flex-wrap: wrap;
    justify-content: stretch;
    left: 16px;
    right: auto;
    top: auto;
    width: calc(100% - 32px);
  }
  #camera-panel .btn {
    flex: 1;
    padding: 6px 8px;
  }
}
