:root {
  --text: #eef4ff;
  --muted: #9fb0c8;
  --line: rgba(160, 200, 255, 0.22);
  --panel: rgba(6, 10, 22, 0.72);
  --accent: #8fe3ff;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #000; color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
#app, #app canvas { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
#app canvas { touch-action: none; cursor: grab; }
#app canvas:active { cursor: grabbing; }

.brand { position: fixed; top: 16px; left: 16px; right: 16px; display: flex; align-items: center; gap: 10px; z-index: 5;
  pointer-events: none; }
.brand > * { pointer-events: auto; }
.logo { font-weight: 700; letter-spacing: 0.32em; font-size: 18px; margin-right: auto; text-shadow: 0 0 12px rgba(143, 227, 255, 0.5); }
.chip { appearance: none; border: 1px solid var(--line); background: rgba(8, 14, 28, 0.6); color: var(--text); border-radius: 999px;
  padding: 6px 12px; font: inherit; font-size: 13px; cursor: pointer; backdrop-filter: blur(6px); }
.chip:hover, .chip:focus-visible { border-color: var(--accent); outline: none; }

#hint { position: fixed; left: 50%; bottom: 44px; transform: translateX(-50%); margin: 0; padding: 8px 14px; border-radius: 999px;
  background: rgba(8, 14, 28, 0.55); border: 1px solid var(--line); color: var(--muted); font-size: 13px; white-space: nowrap;
  transition: opacity 0.8s; z-index: 4; max-width: calc(100vw - 32px); overflow: hidden; text-overflow: ellipsis; }
#hint.gone { opacity: 0; pointer-events: none; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* The planet list, bottom right; on phones it folds away behind a button */
#planets { position: fixed; right: 16px; bottom: 40px; z-index: 5; display: flex; flex-direction: column-reverse; align-items: flex-end; gap: 8px; }
#planets-toggle { display: none; }
#planet-list { list-style: none; margin: 0; padding: 4px; border-radius: 12px; border: 1px solid var(--line);
  background: rgba(8, 14, 28, 0.5); backdrop-filter: blur(6px); }
#planet-list button { appearance: none; display: block; width: 100%; padding: 3px 10px; border: 0; border-radius: 8px; background: transparent;
  font: inherit; font-size: 13px; font-weight: 600; letter-spacing: 0.02em; text-align: right; cursor: pointer; color: #c4cad3; }
#planet-list button:hover, #planet-list button:focus-visible { color: #fff; background: rgba(160, 200, 255, 0.1); outline: none; }
#planet-list button[aria-current="true"] { color: #fff; box-shadow: inset -2px 0 0 var(--dot); }

/* ?tune: sliders for the text size and zoom */
#tune { position: fixed; left: 16px; top: 64px; z-index: 6; display: grid; gap: 8px; padding: 12px 14px; border-radius: 14px;
  border: 1px solid var(--line); background: rgba(8, 14, 28, 0.75); backdrop-filter: blur(6px); font-size: 13px; }
#tune label { display: grid; grid-template-columns: 130px 140px 48px; align-items: center; gap: 10px; }
#tune output { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); }
#tune input { accent-color: #c4cad3; }
#tune .chip { justify-self: start; }

#flash { position: fixed; inset: 0; background: radial-gradient(circle at var(--x, 50%) var(--y, 50%), rgba(220, 245, 255, 0.9), rgba(160, 220, 255, 0.25) 30%, transparent 60%);
  opacity: 0; pointer-events: none; z-index: 2; }

#loading { position: fixed; inset: 0; display: grid; place-content: center; justify-items: center; gap: 18px; background: #000; z-index: 10;
  transition: opacity 1.2s; }
#loading.done { opacity: 0; pointer-events: none; }
#loading p { margin: 0; color: var(--muted); font-size: 13px; letter-spacing: 0.08em; }
.bar { width: 200px; height: 2px; background: rgba(255, 255, 255, 0.12); border-radius: 2px; overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width 0.2s; }
.loading-saucer { width: 64px; height: 24px; border-radius: 50%; background: linear-gradient(#dfe6ee, #7d8794); position: relative;
  animation: bob 1.6s ease-in-out infinite; box-shadow: 0 10px 22px rgba(143, 227, 255, 0.35); }
.loading-saucer::before { content: ""; position: absolute; left: 20px; top: -12px; width: 24px; height: 18px; border-radius: 50% 50% 0 0;
  background: rgba(143, 227, 255, 0.7); }
@keyframes bob { 50% { transform: translateY(-6px) rotate(-3deg); } }

#credits { position: fixed; left: 0; right: 0; bottom: 8px; text-align: center; font-size: 11px; color: rgba(159, 176, 200, 0.7); z-index: 4;
  padding: 0 16px; pointer-events: auto; }
#credits a { color: inherit; }
.noscript { position: fixed; inset: 0; display: grid; place-content: center; margin: 0; padding: 16px; text-align: center; }

@media (max-width: 700px) {
  #planets { bottom: 64px; }
  #planets-toggle { display: block; }
  #planets:not(.open) #planet-list { display: none; }
}
@media (max-width: 640px) {
  #hint { bottom: 112px; font-size: 12px; }
  #credits { font-size: 10px; }
  .chip { padding: 5px 10px; font-size: 12px; }
}

/* ?debug: no fades, so screenshots of a hidden page show the end state */
.debug #loading { transition: none !important; }
