:root {
  color-scheme: dark;
  --ink: #f3f5f3;
  --muted: #9aa29f;
  --line: rgba(255,255,255,.12);
  --panel: rgba(10,14,17,.74);
  --acid: #dfff66;
}

* { box-sizing: border-box; }

html, body { margin: 0; width: 100%; height: 100%; overflow: hidden; background: #020405; }
body { color: var(--ink); font-family: Manrope, sans-serif; }
button, input { font: inherit; }
button { color: inherit; }

.app { position: relative; width: 100%; height: 100%; min-height: 560px; overflow: hidden; background: radial-gradient(circle at 50% 40%, #11191e 0, #040709 48%, #010203 100%); }
#space { position: absolute; inset: 0; }
#space canvas { display: block; width: 100%; height: 100%; outline: none; }
.planet-label { position: absolute; z-index: 3; top: 0; left: 0; display: flex; align-items: center; gap: 7px; padding: 5px 8px; border: 1px solid rgba(255,255,255,.1); background: rgba(5,8,9,.62); color: #e6eae7; font: 600 10px Manrope, sans-serif; letter-spacing: .09em; white-space: nowrap; pointer-events: none; backdrop-filter: blur(5px); transform: translateY(-50%); transition: opacity .15s ease; }
.planet-label::before { content: ""; width: 5px; height: 5px; flex: 0 0 auto; border-radius: 50%; background: var(--planet-color); box-shadow: 0 0 7px var(--planet-color); }
.planet-label.is-hidden { opacity: 0; }

.live-dot { width: 5px; height: 5px; display: inline-block; border-radius: 50%; background: var(--acid); box-shadow: 0 0 8px var(--acid); }

.help-chip { position: absolute; z-index: 4; left: 30px; top: 28px; display: flex; align-items: center; gap: 10px; color: #727b77; font: 500 8px DM Mono, monospace; letter-spacing: .1em; pointer-events: none; }
.mouse-icon { width: 12px; height: 17px; border: 1px solid #626a67; border-radius: 7px; position: relative; }
.mouse-icon::after { content: ""; position: absolute; top: 3px; left: 5px; height: 4px; border-left: 1px solid #89908d; }

.time-controls { position: absolute; z-index: 6; left: 50%; bottom: 24px; width: min(780px, calc(100vw - 48px)); transform: translateX(-50%); }
.time-controls.is-collapsed { width: max-content; }
.time-panel-toggle { position: absolute; right: 0; top: -33px; height: 34px; display: flex; align-items: center; gap: 7px; padding: 0 11px; border: 1px solid rgba(255,255,255,.14); border-bottom: 0; background: rgba(10,14,17,.88); color: #9da6a1; font: 600 8px Manrope, sans-serif; letter-spacing: .12em; cursor: pointer; backdrop-filter: blur(16px); }
.time-panel-toggle:hover { color: var(--acid); border-color: rgba(223,255,102,.38); }
.time-panel-toggle svg { width: 14px; fill: none; stroke: currentColor; stroke-width: 1.6; transition: transform .2s ease; }
.time-controls.is-collapsed .time-panel-toggle { position: relative; top: auto; right: auto; border-bottom: 1px solid rgba(255,255,255,.14); }
.time-controls.is-collapsed .time-panel-toggle svg { transform: rotate(180deg); }
.time-panel[hidden] { display: none; }
.time-panel { position: relative; width: 100%; padding: 18px 20px; display: grid; grid-template-columns: minmax(210px, 1fr) auto 150px; align-items: center; gap: 24px; border: 1px solid rgba(255,255,255,.16); background: linear-gradient(145deg, rgba(18,24,27,.92), rgba(7,10,12,.88)); box-shadow: 0 26px 70px rgba(0,0,0,.48), inset 0 1px rgba(255,255,255,.025); backdrop-filter: blur(22px); }
.time-panel::before { content: ""; position: absolute; left: 50%; top: -1px; width: 66px; border-top: 1px solid var(--acid); transform: translateX(-50%); }
.time-display { position: relative; min-width: 0; text-align: left; }
.time-label { display: flex; align-items: center; justify-content: flex-start; gap: 8px; margin-bottom: 8px; font: 600 9px Manrope, sans-serif; color: #b8c0bc; letter-spacing: .18em; }
.date-picker { position: relative; }
.date-button { width: 100%; min-height: 52px; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0; padding: 0 15px; border: 1px solid rgba(255,255,255,.13); background: rgba(255,255,255,.035); font-size: 18px; font-weight: 600; letter-spacing: .055em; transition: .18s ease; }
.date-picker:hover .date-button, .date-picker:focus-within .date-button { color: var(--acid); border-color: rgba(223,255,102,.45); background: rgba(223,255,102,.055); }
.date-button svg { width: 20px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.4; }
#dateInput { position: absolute; z-index: 2; inset: 0; width: 100%; height: 100%; margin: 0; border: 0; opacity: .001; cursor: pointer; }
.sim-time { margin-top: 7px; color: #929c97; font: 500 13px DM Mono, monospace; letter-spacing: .13em; }
.transport-wrap { display: grid; justify-items: center; gap: 8px; }
.transport { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 0; }
.transport button { display: grid; place-items: center; border: 0; background: none; cursor: pointer; transition: .18s ease; }
.transport-button { width: 58px; height: 58px; border: 1px solid rgba(255,255,255,.13) !important; color: #b9c1bd; background: rgba(255,255,255,.035) !important; }
.transport-button:hover { color: var(--acid); border-color: rgba(223,255,102,.5) !important; background: rgba(223,255,102,.055) !important; transform: translateY(-2px); }
.transport svg { width: 24px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.play-button { width: 66px; height: 66px; border: 1px solid rgba(223,255,102,.75) !important; border-radius: 50% !important; color: var(--acid); box-shadow: 0 0 26px rgba(223,255,102,.1); }
.play-button:hover { background: rgba(223,255,102,.08); transform: scale(1.04); }
.play-icon { display: none; margin-left: 2px; }
.paused .play-icon { display: block; }
.paused .pause-icon { display: none; }
.speed-control { display: flex; justify-content: center; align-items: center; gap: 10px; color: #9ba49f; font: 600 10px Manrope, sans-serif; letter-spacing: .13em; }
.speed-control output { color: var(--acid); font-size: 12px; font-weight: 600; }
.time-actions { display: grid; grid-template-columns: 1fr; }
.action-button { height: 66px; border: 1px solid var(--line); background: rgba(255,255,255,.035); color: #aeb6b2; font: 600 12px Manrope, sans-serif; letter-spacing: .11em; cursor: pointer; transition: .18s; }
.action-button:hover { border-color: rgba(223,255,102,.5); color: #cbd0cd; }
.action-button--active { color: var(--acid); border-color: rgba(223,255,102,.35); }
.target-icon { display: inline-block; width: 7px; height: 7px; margin-right: 4px; border: 1px solid currentColor; border-radius: 50%; box-shadow: inset 0 0 0 2px #111; background: currentColor; }

.loading { position: absolute; z-index: 20; inset: 0; display: grid; place-content: center; justify-items: center; background: #020405; transition: opacity .7s ease, visibility .7s; }
.loading.is-hidden { opacity: 0; visibility: hidden; }
.loading span { width: 30px; height: 30px; border: 1px solid #29302d; border-top-color: var(--acid); border-radius: 50%; animation: spin 1s linear infinite; }
.loading p { margin-top: 16px; color: #68706c; font: 500 8px DM Mono, monospace; letter-spacing: .2em; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 760px) {
  .planet-label { padding: 4px 6px; font-size: 8px; }
  .time-controls { bottom: max(12px, env(safe-area-inset-bottom)); width: calc(100vw - 24px); }
  .time-controls.is-collapsed { width: max-content; }
  .time-panel { padding: 14px; grid-template-columns: 1fr; gap: 13px; }
  .time-display { text-align: center; }
  .time-label { justify-content: center; margin-bottom: 6px; }
  .date-button { min-height: 46px; justify-content: center; font-size: 16px; }
  .sim-time { margin-top: 5px; }
  .transport { gap: 10px; }
  .transport-button { width: 54px; height: 54px; }
  .play-button { width: 60px; height: 60px; }
  .action-button { height: 48px; }
  .help-chip { display: none; }
}

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
