:root {
  --bg: #0B0C10; --panel: rgba(255,255,255,0.055); --panel-2: rgba(255,255,255,0.09);
  --line: rgba(255,255,255,0.10); --line-2: rgba(255,255,255,0.18);
  --fg: #ECEAE4; --muted: #9AA3B2; --dim: #6F7787; --cyan: #44AFE4; --ok: #3DDC97; --bad: #E5484D;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--fg);
  font: 15px/1.45 "Hanken Grotesk", system-ui, -apple-system, sans-serif; -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; cursor: pointer; }
#home { max-width: 560px; margin: 0 auto; padding: calc(env(safe-area-inset-top) + 28px) 20px 40px; }
header { display: flex; align-items: center; gap: 12px; margin-bottom: 26px; }
header img { width: 30px; height: 30px; }
header h1 { flex: 1; margin: 0; font: 600 22px/1.2 "Outfit", system-ui, sans-serif; letter-spacing: -0.01em; }
.lead { color: var(--muted); margin: 0 0 18px; }
.main { width: 100%; padding: 14px 18px; border-radius: 14px; border: 0; background: var(--cyan); color: #06121a; font-weight: 600; font-size: 16px; }
.main:disabled { opacity: 0.5; cursor: default; }
.ghost { padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--muted); font-size: 13px; }
.msg { padding: 12px 14px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); color: var(--muted); margin-bottom: 18px; }
.msg.bad { border-color: rgba(229,72,77,0.45); color: #f1a3a5; }
.devices { display: flex; flex-direction: column; gap: 10px; }
.dev { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); }
.dev .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--dim); flex: none; }
.dev.on .dot { background: var(--ok); }
.dev .nm { flex: 1; min-width: 0; }
.dev .nm b { display: block; font-weight: 600; }
.dev .nm small { color: var(--dim); font-size: 13px; }
.dev button { padding: 9px 16px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--panel-2); font-weight: 600; }
.dev:not(.on) button { opacity: 0.4; cursor: default; }
.hint { color: var(--dim); font-size: 13px; margin-top: 16px; }

#view { position: fixed; inset: 0; background: #000; display: flex; flex-direction: column; }
#video { flex: 1; min-height: 0; width: 100%; object-fit: contain; background: #000; touch-action: none; outline: none; cursor: default; }
#view.connected #video { cursor: none; }
.state { position: absolute; inset: 0 0 52px; display: grid; place-items: center; text-align: center; padding: 24px; color: var(--muted); pointer-events: none; }
.state:empty { display: none; }
#bar { display: flex; align-items: center; gap: 8px; padding: 8px 12px calc(env(safe-area-inset-bottom) + 8px); background: #0B0C10; border-top: 1px solid var(--line); font-size: 13px; }
#bar .grow { flex: 1; }
#bar button { padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); font-size: 13px; }
#bar .end { border-color: rgba(229,72,77,0.5); color: #f1a3a5; }
#vname { font-weight: 600; }
.stat { color: var(--dim); }
#typer { position: absolute; left: -9999px; top: 0; width: 1px; height: 1px; opacity: 0; }
@media (max-width: 520px) { #cad { display: none; } }
