/* The Last Startup Ever — deck chrome. */
:root {
  color-scheme: dark;
  --bg: #07090e;
  --ink: #f4f7fd;
  --mut: #93a0b5;
  --dim: #5b677a;
  --line: rgba(147, 160, 181, .18);
  --panel: rgba(12, 15, 22, .92);
  --accent: #6ea8ff;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; background: var(--bg); color: var(--ink); overflow: hidden; }
body { font: 15px/1.5 var(--font); }
#stage { position: fixed; inset: 0; width: 100%; height: 100%; display: block; outline: none; touch-action: none; }
body.idle { cursor: none; }

#ui { position: fixed; inset: 0; pointer-events: none; z-index: 10; }
#ui > * { pointer-events: auto; }

#bar { position: absolute; top: 0; left: 0; right: 0; height: 2px; background: rgba(255,255,255,.06); }
#prog { height: 100%; width: 0; background: linear-gradient(90deg, #6ea8ff, #b18cff); transition: width .45s cubic-bezier(.2,.8,.2,1); }

#hud {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 14px clamp(14px, 3vw, 30px) calc(14px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(180deg, transparent, rgba(7,9,14,.75) 55%);
}
#hud .left { display: flex; align-items: baseline; gap: 12px; min-width: 0; }
#hud .right { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.mono { font-family: var(--mono); font-size: 12px; letter-spacing: .02em; color: var(--dim); }
#idx { color: var(--mut); }
.ttl { font-weight: 650; font-size: 13.5px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

#hud button, #arrows button {
  appearance: none; border: 1px solid var(--line); background: rgba(255,255,255,.04);
  color: var(--mut); font: 600 12.5px/1 var(--font); padding: 8px 10px;
  border-radius: 9px; cursor: pointer; transition: color .15s, border-color .15s, background .15s;
}
#hud button:hover, #arrows button:hover { color: var(--ink); border-color: rgba(110,168,255,.5); background: rgba(110,168,255,.1); }
#hud button:focus-visible, #arrows button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

#arrows { position: absolute; right: clamp(14px, 3vw, 30px); top: 50%; transform: translateY(-50%); display: grid; gap: 8px; }
#arrows button { width: 40px; height: 40px; font-size: 16px; border-radius: 50%; }

#cta {
  position: absolute; right: clamp(14px, 3vw, 30px); bottom: 76px;
  display: none; align-items: center; gap: 8px;
  padding: 12px 16px; border-radius: 12px; text-decoration: none;
  color: #fff; font-weight: 650; font-size: 14px;
  background: linear-gradient(180deg, #3f7fe6, #2d63c9);
  box-shadow: 0 14px 34px rgba(63,127,230,.35);
}
body.last #cta { display: inline-flex; }
#cta:hover { text-decoration: none; filter: brightness(1.06); }

#notes {
  position: absolute; left: 0; right: 0; bottom: 0; display: none;
  padding: 16px clamp(16px, 3vw, 30px) calc(18px + env(safe-area-inset-bottom, 0px));
  background: var(--panel); border-top: 1px solid var(--line);
  grid-template-columns: minmax(0, 1fr) auto; gap: 10px 26px; align-items: start;
}
#notes.on { display: grid; }
#notes p { margin: 0; max-width: 78ch; font-size: 17px; white-space: pre-line; }
#notes .mono { white-space: nowrap; padding-top: 3px; }

#overview {
  position: fixed; inset: 0; z-index: 40; display: none; overflow: auto;
  padding: 44px clamp(16px, 4vw, 48px) 80px;
  background: rgba(7,9,14,.97);
  grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); gap: 20px; align-content: start;
}
#overview.on { display: grid; }
#overview button { all: unset; display: grid; gap: 8px; cursor: pointer; }
#overview canvas { width: 100%; aspect-ratio: 16/9; border-radius: 8px; border: 1px solid var(--line); background: #0b0f17; }
#overview button:hover canvas, #overview button:focus-visible canvas { border-color: var(--accent); }
#overview .lap { font-family: var(--mono); font-size: 12px; color: var(--mut); }

#help { position: fixed; inset: 0; z-index: 50; display: none; place-items: center; background: rgba(7,9,14,.72); backdrop-filter: blur(8px); }
#help.on { display: grid; }
#help .sheet { width: min(480px, calc(100vw - 32px)); background: #0e131c; border: 1px solid var(--line); border-radius: 18px; padding: 22px 24px; box-shadow: 0 30px 90px rgba(0,0,0,.6); }
#help h2 { margin: 0 0 12px; font-size: 18px; letter-spacing: -.02em; }
#help table { width: 100%; border-collapse: collapse; font-size: 14px; }
#help td { padding: 6px 0; border-bottom: 1px solid rgba(255,255,255,.05); color: var(--mut); }
#help td:first-child { width: 46%; color: var(--ink); }
#help p { color: var(--dim); font-size: 12px; margin: 12px 0 0; }
kbd { font-family: var(--mono); font-size: 11.5px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; padding: 1px 5px; color: var(--ink); }

#foot {
  position: fixed; top: 0; left: 0; right: 0; z-index: 9; pointer-events: none;
  display: flex; justify-content: space-between; gap: 14px;
  padding: 12px clamp(14px, 3vw, 30px);
  color: var(--dim); font-size: 11.5px; font-family: var(--mono);
  opacity: .7;
}

@media (max-width: 640px) {
  .ttl { display: none; }
  #arrows { display: none; }
  #notes p { font-size: 15px; }
  #foot span:last-child { display: none; }
  #cta { right: 50%; transform: translateX(50%); bottom: 84px; white-space: nowrap; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
