:root {
  --bg: #09090b;
  --text: #fafafa;
  --muted: #71717a;
  --line: rgba(255, 255, 255, .08);
  --glass: rgba(24, 24, 27, .72);
  --free: #22c55e;
  --busy: #f59e0b;
  --full: #ef4444;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
body {
  font: 15px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- landing ---------- */
.landing {
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: 32px 20px;
  background: radial-gradient(60rem 40rem at 50% -10%, rgba(255, 255, 255, .06), transparent 60%), var(--bg);
}
.hero { width: 100%; max-width: 30rem; text-align: center; }
h1 {
  margin: 0;
  font-size: clamp(2rem, 7vw, 3.25rem);
  font-weight: 650;
  letter-spacing: -.045em;
  line-height: 1.05;
}
.sub { margin: 14px 0 32px; color: var(--muted); font-size: 1rem; }

.go {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 48px;
  padding: 0 22px 0 26px;
  border-radius: 999px;
  background: var(--text);
  color: var(--bg);
  font-weight: 600;
  transition: transform .15s ease, opacity .15s ease;
}
.go svg { transition: transform .15s ease; }
.go:not(:disabled):hover svg { transform: translateX(3px); }
.go:not(:disabled):active { transform: scale(.97); }
.go:disabled { opacity: .35; cursor: default; }
.go.small { height: 40px; padding: 0 20px; font-size: 14px; }

.meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); }
.dot.free { background: var(--free); box-shadow: 0 0 10px var(--free); }
.dot.busy { background: var(--busy); box-shadow: 0 0 10px var(--busy); }
.dot.full { background: var(--full); box-shadow: 0 0 10px var(--full); }
/* ---------- accounts ---------- */
.userbar {
  position: fixed;
  top: calc(14px + env(safe-area-inset-top, 0px));
  right: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 13px;
  color: var(--muted);
}
.userbar #user-name { color: var(--text); }
.userbar a, .userbar button { color: var(--muted); text-decoration: none; padding: 4px 0; }
.userbar a:hover, .userbar button:hover { color: var(--text); }
.auth { display: flex; flex-direction: column; gap: 10px; width: min(20rem, 100%); margin: 0 auto; text-align: left; }
.tabs { display: flex; gap: 4px; padding: 4px; margin-bottom: 6px; border: 1px solid var(--line); border-radius: 999px; }
.tab { flex: 1; height: 32px; border-radius: 999px; color: var(--muted); font-size: 13px; font-weight: 500; }
.tab.active { background: rgba(255, 255, 255, .08); color: var(--text); }
.auth input {
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, .03);
  color: var(--text);
  font: inherit;
  outline: none;
}
.auth input:focus { border-color: rgba(255, 255, 255, .3); }
.go.wide { justify-content: center; width: 100%; padding: 0 20px; margin-top: 4px; }
.pro-badge {
  padding: 2px 7px;
  border-radius: 999px;
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .06em;
}
.pro-badge.ultra { background: linear-gradient(135deg, #8b5cf6, #06b6d4); }
.launchers { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.go.ultra { background: linear-gradient(135deg, #8b5cf6, #06b6d4); color: #fff; }
.redeem { width: min(22rem, 100%); margin: 26px auto 0; padding: 18px; border: 1px solid var(--line); border-radius: 16px; text-align: left; }
.redeem-title { margin: 0 0 10px; font-size: 15px; }
.redeem-title b { background: linear-gradient(135deg, #f59e0b, #ef4444); -webkit-background-clip: text; background-clip: text; color: transparent; }
.perks { margin: 0 0 14px; padding-left: 18px; color: var(--muted); font-size: 13px; }
.perks li + li { margin-top: 3px; }
.redeem-row { display: flex; gap: 8px; }
.redeem-row input {
  flex: 1; min-width: 0; height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px;
  background: rgba(255, 255, 255, .03); color: var(--text); font: inherit; text-transform: uppercase; outline: none;
}
.redeem .note.ok { color: var(--free); }
.privacy { margin: 18px auto 0; max-width: 24rem; color: #52525b; font-size: 12px; }
.note { min-height: 1.5em; margin: 10px 0 0; color: #f87171; font-size: 13px; }

/* ---------- session ---------- */
.session { position: fixed; inset: 0; background: var(--bg); }
.screen { position: absolute; inset: 0; }
.stream { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: var(--bg); outline: none; touch-action: none; }

.overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 18px;
  padding: 20px;
  background: var(--bg);
  color: var(--muted);
  text-align: center;
  font-size: 14px;
}
.overlay p { margin: 0; }
.overlay.stopped .boot { display: none; }
.overlay.stopped p { color: var(--text); }
#overlay-text:empty { display: none; }

/* Boot roadmap */
.boot { text-align: left; width: min(20rem, 100%); }
.boot-title { display: flex; justify-content: space-between; margin: 0 0 18px; color: var(--text); font-weight: 600; font-size: 15px; }
.boot-time { color: var(--muted); font-weight: 400; font-variant-numeric: tabular-nums; }
.roadmap { list-style: none; margin: 0; padding: 0; }
.roadmap li {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 7px 0;
  color: #52525b;
  font-size: 14px;
  transition: color .25s ease;
}
/* Connector line between steps */
.roadmap li:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 7px;
  top: 27px;
  width: 2px;
  height: calc(100% - 20px);
  background: var(--line);
}
.roadmap li::before {
  content: "";
  flex: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid #3f3f46;
  box-sizing: border-box;
  transition: all .25s ease;
}
.roadmap li.done { color: var(--muted); }
.roadmap li.done::before {
  border-color: var(--free);
  background: var(--free) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4.5 8.2l2.3 2.3 4.7-4.9' fill='none' stroke='%2309090b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 14px no-repeat;
}
.roadmap li.done:not(:last-child)::after { background: rgba(34, 197, 94, .4); }
.roadmap li.active { color: var(--text); }
.roadmap li.active::before { border-color: var(--text); animation: pulse 1.2s ease-in-out infinite; }
.roadmap li .step-time { margin-left: auto; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
@keyframes pulse { 50% { box-shadow: 0 0 0 5px rgba(250, 250, 250, .12); } }

.dock {
  position: absolute;
  left: 50%;
  bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--glass);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  box-shadow: 0 8px 30px rgba(0, 0, 0, .35);
  transition: opacity .3s ease;
}
.dock.idle { opacity: .25; }
.dock:hover, .dock:focus-within { opacity: 1; }
.dock button {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  color: #d4d4d8;
  transition: background .15s ease, color .15s ease;
}
.dock button:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.dock .end:hover { background: rgba(239, 68, 68, .9); color: #fff; }
.dock .sep { width: 1px; height: 18px; margin: 0 3px; background: var(--line); }

.mode-menu {
  position: absolute;
  left: 50%;
  bottom: calc(68px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  display: grid;
  gap: 2px;
  min-width: 15rem;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--glass);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  box-shadow: 0 8px 30px rgba(0, 0, 0, .35);
}
.mode-menu[hidden] { display: none; }
.mode-menu button {
  display: grid;
  gap: 1px;
  padding: 8px 12px;
  border-radius: 10px;
  text-align: left;
  color: #d4d4d8;
  font-size: 13px;
}
.mode-menu button span { color: var(--muted); font-size: 12px; }
.mode-menu button:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.mode-menu button.on { background: rgba(255, 255, 255, .12); color: #fff; }

/* Off-screen but focusable, so phones open their keyboard for it. */
.kbd-input { position: fixed; left: -100px; bottom: 0; width: 1px; height: 1px; opacity: 0; font-size: 16px; }

@media (hover: none) {
  .dock.idle { opacity: .55; }
}
