
:root {
  --bg: #07080c;
  --fg: #eceef2;
  --muted: #a3acb8;
  --faint: #7c8694;
  --surface: #12141a;
  --subtle: #1c2028;
  --border: #2c313b;
  --border-strong: #4a5160;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; background: var(--bg); color: var(--fg);
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif; overflow: hidden; }
.orrery { position: fixed; inset: 0; background: var(--bg); }
.viewport { position: absolute; inset: 0; z-index: 0; }
.viewport canvas { display: block; width: 100% !important; height: 100% !important; }
.label-layer { position: absolute; inset: 0; z-index: 2; pointer-events: none; overflow: hidden; }
.world-label {
  position: absolute; top: 0; left: 0; color: var(--fg);
  font-size: 13px; font-weight: 500; white-space: nowrap;
  text-shadow: 0 1px 2px #000e, 0 0 10px #000a;
  transform: translate(-50%, -120%);
  opacity: 0; transition: opacity .15s;
}
.world-label.on { opacity: 1; }
.topbar, .dock { position: absolute; left: 0; right: 0; z-index: 3; pointer-events: none; }
.topbar > *, .dock > * { pointer-events: auto; }
.topbar {
  top: 0; display: flex; justify-content: space-between; align-items: flex-start;
  padding: calc(env(safe-area-inset-top, 0px) + 72px) 16px 0; /* room for Mega Win header */
}
.brand h1 { font-size: 1.35rem; font-weight: 650; text-shadow: 0 1px 2px #000b; }
.brand p, .elapsed span { color: var(--muted); font-size: .85rem; }
.elapsed { text-align: right; }
.elapsed strong { display: block; font-variant-numeric: tabular-nums; }
.dock {
  bottom: 0; display: flex; flex-direction: column; gap: 10px;
  padding: 28px 16px calc(env(safe-area-inset-bottom, 0px) + 12px);
  background: linear-gradient(transparent, #07080cf0 55%);
}
.controls { display: flex; align-items: center; gap: 10px; max-width: 720px; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface); color: var(--fg); cursor: pointer; font-size: 14px;
}
#speed { flex: 1; max-width: 280px; }
.rate { font-variant-numeric: tabular-nums; color: var(--muted); min-width: 3.5rem; }
.modes { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 8px; max-width: 420px; }
.modes button {
  border: 1px solid var(--border); background: var(--surface); color: var(--muted);
  border-radius: 999px; padding: 10px 12px; cursor: pointer; font-size: .9rem;
}
.modes button[aria-pressed="true"] {
  color: var(--fg); border-color: var(--border-strong); background: var(--subtle);
}
.rail { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; max-width: 100%; }
.rail::-webkit-scrollbar { display: none; }
.chip {
  flex: none; height: 42px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface); color: var(--fg);
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: .88rem;
}
.chip[aria-pressed="true"] { border-color: var(--border-strong); background: var(--subtle); }
.dot { width: 8px; height: 8px; border-radius: 999px; }
.hints { display: flex; justify-content: space-between; gap: 16px; max-width: 720px;
  color: var(--faint); font-size: .75rem; }
@media (max-width: 640px) {
  .topbar { padding-top: calc(env(safe-area-inset-top, 0px) + 110px); }
  .hints { flex-direction: column; gap: 4px; }
}
