/* The orbit page: the view fills the screen; a thin loading bar; the clock, the slider, the boat's play button and the
   Vrid / Flyg toggle at the bottom; the credits in small type under them; a hint over the controls for a few seconds.
   No other text. */
:root {
  --ink: rgba(255, 255, 255, 0.92);
  --dim: rgba(255, 255, 255, 0.62);
  --glass: rgba(14, 20, 28, 0.42);
  --accent: #f3d27a;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #0d1218; overflow: hidden; }
body { font: 13px/1.35 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; color: var(--ink); }
#view { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; outline: none; }

#loading { position: fixed; left: 0; right: 0; top: 0; height: 3px; background: rgba(255, 255, 255, 0.08); z-index: 3;
  transition: opacity 0.6s ease; }
#bar { height: 100%; width: 100%; background: var(--accent); transform: scaleX(0); transform-origin: 0 50%; }
body.ready #loading { opacity: 0; pointer-events: none; }
body.failed #bar { background: #d66; transform: scaleX(1); }

#controls, #credits { touch-action: manipulation; }
#controls { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(30px + env(safe-area-inset-bottom));
  width: min(560px, calc(100% - 32px)); display: flex; align-items: center; gap: 12px; padding: 8px 14px 8px 8px;
  border-radius: 999px; background: var(--glass); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  opacity: 0; transition: opacity 0.6s ease; z-index: 2; }
body.ready #controls { opacity: 1; }

#play { flex: none; width: 36px; height: 36px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.08); color: var(--ink); cursor: pointer; display: grid; place-items: center; padding: 0; }
#play:hover { background: rgba(255, 255, 255, 0.16); }
#play:focus-visible, #time:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
#play .icon { width: 0; height: 0; border-style: solid; border-width: 7px 0 7px 12px;
  border-color: transparent transparent transparent var(--ink); margin-left: 3px; }
#play.on .icon { width: 11px; height: 13px; border: 0; margin: 0;
  background: linear-gradient(90deg, var(--ink) 0 4px, transparent 4px 7px, var(--ink) 7px 11px); }

/* the mode: two words in a pill, the one in use filled; only where there is a keyboard (body.keys) */
#mode { flex: none; display: none; gap: 2px; padding: 2px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.08); }
body.keys #mode { display: flex; }
#mode button { font: inherit; font-size: 12px; line-height: 1; height: 30px; padding: 0 11px; border: 0; border-radius: 999px;
  background: transparent; color: var(--dim); cursor: pointer; }
#mode button:hover { color: var(--ink); }
#mode button[aria-pressed="true"] { background: var(--accent); color: #1b1f24; }
#mode button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
body.fly #view { cursor: grab; }
body.fly.dragging #view { cursor: grabbing; }

#time { flex: 1; min-width: 0; height: 28px; background: transparent; -webkit-appearance: none; appearance: none; cursor: pointer; }
#time::-webkit-slider-runnable-track { height: 4px; border-radius: 2px;
  background: linear-gradient(90deg, #26385a, #8fa6c4 14%, #f0d9a0 30%, #fdf5df 50%, #f0d9a0 72%, #e39a5c 88%, #26385a); }
#time::-moz-range-track { height: 4px; border-radius: 2px;
  background: linear-gradient(90deg, #26385a, #8fa6c4 14%, #f0d9a0 30%, #fdf5df 50%, #f0d9a0 72%, #e39a5c 88%, #26385a); }
#time::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; margin-top: -8px; border-radius: 50%;
  background: var(--accent); border: 2px solid rgba(0, 0, 0, 0.35); box-shadow: 0 0 8px rgba(243, 210, 122, 0.6); }
#time::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: var(--accent); border: 2px solid rgba(0, 0, 0, 0.35); }
#clock { flex: none; min-width: 3.2em; text-align: right; font-variant-numeric: tabular-nums; font-size: 14px; color: var(--ink); }

/* the hint and the speed: small, over the scene above the controls, fading out */
#hint, #speed { position: fixed; left: 50%; transform: translateX(-50%); z-index: 2; pointer-events: none;
  width: max-content; max-width: calc(100% - 32px); padding: 6px 14px; border-radius: 14px; text-align: center;
  text-wrap: balance; font-size: 12.5px; color: var(--ink); background: var(--glass); backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px); opacity: 0; transition: opacity 0.9s ease; }
#hint { bottom: calc(30px + 52px + 12px + env(safe-area-inset-bottom)); }
#speed { bottom: calc(30px + 52px + 12px + 42px + env(safe-area-inset-bottom)); font-variant-numeric: tabular-nums; }
body.ready #hint.show, body.ready #speed.show { opacity: 1; transition: opacity 0.25s ease; }

#credits { position: fixed; left: 0; right: 0; bottom: 0; padding: 0 12px calc(6px + env(safe-area-inset-bottom));
  font-size: 10px; color: var(--dim); text-align: center; z-index: 1; text-shadow: 0 0 3px rgba(0, 0, 0, 0.6); }
#credits summary { cursor: pointer; list-style: none; text-wrap: balance; }
#credits summary::-webkit-details-marker { display: none; }
#credits:has(details[open]) { z-index: 3; }
#credits details[open] { max-width: 760px; margin: 0 auto; padding: 8px 12px; border-radius: 10px; background: rgba(10, 14, 20, 0.92);
  text-align: left; }
#credits details[open] summary { margin-bottom: 4px; }
#credits p { margin: 4px 0; }

/* A narrow window with a mouse (the toggle shown): the controls closer, the toggle smaller, so the slider keeps room */
@media (max-width: 520px) {
  #controls { gap: 8px; }
  #mode button { padding: 0 8px; font-size: 11.5px; }
}

/* A phone or a tablet: controls a finger can hit (44 px, the least Apple's guidelines give), the credits a size larger
   on two even lines, and the controls lifted clear of them */
@media (pointer: coarse) {
  #controls { bottom: calc(48px + env(safe-area-inset-bottom)); padding: 6px 14px 6px 6px; }
  #play { width: 44px; height: 44px; }
  #mode button { height: 38px; padding: 0 13px; font-size: 13px; }
  #hint { bottom: calc(48px + 56px + 12px + env(safe-area-inset-bottom)); }
  #speed { bottom: calc(48px + 56px + 12px + 42px + env(safe-area-inset-bottom)); }
  #time { height: 44px; }
  #time::-webkit-slider-thumb { width: 28px; height: 28px; margin-top: -12px; }
  #time::-moz-range-thumb { width: 26px; height: 26px; }
  #credits { font-size: 11px; }
  #credits summary { padding: 6px 0 2px; }
}
