/* A HUD, not a website: everything floats over the canvas, nothing scrolls,
   and the chrome stays out of the way of the stand. Safe-area insets because
   the dock sits exactly where the iPhone home indicator lives. */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

:root {
  --ink: #e9e7e2;
  --dim: #9a9a95;
  --bg: #0e1013;
  --line: rgba(233, 231, 226, 0.16);
  --panel: rgba(14, 16, 19, 0.82);
  --key: #e2662a;
  --pad: 14px;
  --safe-b: max(var(--pad), env(safe-area-inset-bottom));
  --safe-t: max(var(--pad), env(safe-area-inset-top));
  --safe-l: max(var(--pad), env(safe-area-inset-left));
  --safe-r: max(var(--pad), env(safe-area-inset-right));
}

html, body {
  height: 100%; overflow: hidden; background: var(--bg); color: var(--ink);
  font: 400 14px/1.45 ui-sans-serif, -apple-system, "Segoe UI", Roboto, sans-serif;
  overscroll-behavior: none;
}

#view { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }

.eyebrow {
  font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--dim); font-variant-numeric: tabular-nums;
}

/* ---------------------------------------------------------------- loading */
#boot {
  position: fixed; inset: 0; z-index: 40; background: var(--bg);
  display: grid; place-items: center; padding: 24px;
  transition: opacity .5s ease;
}
#boot.gone { opacity: 0; pointer-events: none; }
#boot .card { max-width: 320px; }
#boot h1 { font-size: 34px; font-weight: 500; letter-spacing: -0.02em; margin: 6px 0 10px; }
#boot .sub { color: var(--dim); font-size: 12.5px; line-height: 1.6; }
#boot .bar { height: 2px; background: var(--line); margin: 22px 0 8px; overflow: hidden; }
#boot .bar i { display: block; height: 100%; width: 0; background: var(--ink); transition: width .25s ease; }
#boot .pct { font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--dim); }

/* ------------------------------------------------------------------ plate */
#plate {
  position: fixed; top: var(--safe-t); left: var(--safe-l); z-index: 10;
  pointer-events: none; text-shadow: 0 1px 12px rgba(0,0,0,.7);
}
#plate .who { font-size: 13px; letter-spacing: 0.01em; margin-top: 1px; }

/* ------------------------------------------------------------- help sheet */
#help {
  position: fixed; top: var(--safe-t); right: var(--safe-r); z-index: 12;
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--panel); border: 1px solid var(--line); color: var(--ink);
  font-size: 14px; cursor: pointer; backdrop-filter: blur(12px);
}
#sheet {
  position: fixed; z-index: 30; left: var(--safe-l); right: var(--safe-r);
  bottom: calc(var(--safe-b) + 62px); max-width: 380px; margin-inline: auto;
  background: var(--panel); border: 1px solid var(--line); backdrop-filter: blur(16px);
  padding: 18px; font-size: 13px;
}
#sheet[hidden] { display: none; }
#sheet h2 { font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--dim); font-weight: 400; }
#sheet dl { margin: 12px 0 0; display: grid; grid-template-columns: 54px 1fr; gap: 8px 12px; }
#sheet dt { color: var(--dim); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; padding-top: 2px; }
#sheet dd { line-height: 1.5; }
#sheet .note { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); color: var(--dim); font-size: 12px; line-height: 1.55; }
#sheet button { margin-top: 14px; width: 100%; padding: 10px; background: none; border: 1px solid var(--line); color: var(--ink); font: inherit; font-size: 12px; cursor: pointer; }

/* ------------------------------------------------------------------- dock */
#dock {
  position: fixed; z-index: 12; bottom: var(--safe-b); left: 50%; transform: translateX(-50%);
  display: flex; gap: 1px; background: var(--line);
  border: 1px solid var(--line); backdrop-filter: blur(12px);
  max-width: calc(100vw - var(--safe-l) - var(--safe-r));
}
#dock button {
  background: var(--panel); border: 0; color: var(--dim); cursor: pointer;
  font: inherit; font-size: 11.5px; letter-spacing: 0.06em;
  padding: 11px 13px; white-space: nowrap; min-height: 42px;
}
#dock button.on { color: var(--ink); }
#dock button.key { color: var(--key); }
#dock[hidden] { display: none; }

/* -------------------------------------------------------------- transport */
#transport {
  position: fixed; z-index: 12; bottom: var(--safe-b);
  left: var(--safe-l); right: var(--safe-r); margin-inline: auto; max-width: 460px;
  display: flex; align-items: center; gap: 12px;
  background: var(--panel); border: 1px solid var(--line);
  backdrop-filter: blur(12px); padding: 9px 12px;
}
#transport[hidden] { display: none; }
#transport button { background: none; border: 0; color: var(--ink); font: inherit; font-size: 12px; cursor: pointer; padding: 4px; min-width: 22px; }
#scrub { flex: 1; height: 22px; display: flex; align-items: center; cursor: pointer; touch-action: none; }
#scrub::before { content: ""; position: absolute; left: 0; right: 0; height: 2px; background: var(--line); }
#scrub { position: relative; }
#fill { position: absolute; left: 0; height: 2px; width: 0; background: var(--key); }
#clock { font-size: 11px; color: var(--dim); font-variant-numeric: tabular-nums; letter-spacing: 0.04em; }

/* ------------------------------------------------------------- thumbstick */
#stick {
  position: fixed; z-index: 11; width: 108px; height: 108px; border-radius: 50%;
  border: 1px solid var(--line); background: rgba(14,16,19,.35);
  pointer-events: none; transform: translate(-50%, -50%);
}
#stick[hidden] { display: none; }
#stick i {
  position: absolute; left: 50%; top: 50%; width: 44px; height: 44px; border-radius: 50%;
  margin: -22px 0 0 -22px; background: rgba(233,231,226,.8);
}

#oops { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 32px; text-align: center; color: var(--dim); }
#oops[hidden] { display: none; }

@media (max-width: 400px) {
  #dock button { padding: 11px 10px; font-size: 11px; }
  #plate .who { font-size: 12px; }
}
