/* Oxonia Phone Stage: a generic smartphone frame for presenting the phone apps. No third-party marks. */
:root { --accent: #6b3fc9; --bg: #0b0d14; --fg: #e9ecf5; --muted: #98a1b8; --panel: #141826; --line: #262c40; --chip: #1c2236; --focus: #8ab4ff; }
body[data-theme="light"] { --bg: #e9ecf3; --fg: #141826; --muted: #566079; --panel: #ffffff; --line: #cfd5e3; --chip: #f1f3f9; --focus: #2f5bea; }
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--fg); font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; overflow: hidden; }
body[data-theme="dark"] { background: radial-gradient(1200px 700px at 50% 40%, #1a2038 0%, #0b0d14 60%); }
body[data-theme="light"] { background: radial-gradient(1200px 700px at 50% 40%, #fff 0%, #e3e7f0 70%); }
a { color: inherit; }
button, select, input { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.skip { position: absolute; left: 8px; top: -60px; background: var(--panel); padding: 8px 12px; border-radius: 8px; z-index: 50; }
.skip:focus { top: 8px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.topbar { position: fixed; left: 0; right: 0; top: 0; height: 52px; display: flex; align-items: center; gap: 14px; padding: 0 16px; z-index: 10; transition: opacity .2s; }
.topbar .brand { font-weight: 650; letter-spacing: .01em; text-decoration: none; display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.topbar .brand i { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); display: inline-block; }
.topbar nav { display: flex; gap: 6px; flex-wrap: wrap; }
.topbar nav a { text-decoration: none; padding: 5px 11px; border-radius: 999px; background: var(--chip); border: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.topbar nav a[aria-current="page"] { color: var(--fg); border-color: var(--accent); }

.tag { position: fixed; left: 14px; bottom: 12px; z-index: 9; font-size: 12px; color: var(--muted); background: var(--chip); border: 1px solid var(--line); padding: 4px 10px; border-radius: 999px; }
.notice { position: fixed; top: 58px; left: 50%; transform: translateX(-50%); z-index: 9; max-width: min(640px, 92vw); font-size: 13px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; color: var(--muted); }
.notice a { color: var(--fg); }

.stage { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; padding: 56px 12px 64px; }
body.cues-open .stage { padding-right: 352px; }
body.no-controls .stage, body.present .stage { padding-bottom: 14px; }
body.present .stage { padding-top: 14px; }
body.present .topbar, body.present .tag-hint, body.present .notice, body.rec .topbar, body.rec .tag, body.rec .notice { display: none; }
body.hide-controls .topbar { opacity: 0; pointer-events: none; }
.phone-slot { position: relative; flex: none; }

/* The phone. Its pixel size is set by stage.js; it is scaled with a transform from the top-left corner. */
.phone { position: absolute; left: 0; top: 0; transform-origin: 0 0; background: linear-gradient(145deg, #2a2d38, #12141b 55%, #23262f); border-radius: 62px; padding: 14px; box-shadow: 0 0 0 2px #3a3e4b inset, 0 0 0 1px #07080c, 0 40px 90px rgba(0, 0, 0, .55), 0 10px 24px rgba(0, 0, 0, .4); }
.phone::before, .phone::after { content: ""; position: absolute; width: 4px; background: #23262f; border-radius: 3px; }
.phone::before { left: -4px; top: 150px; height: 64px; box-shadow: 0 90px 0 #23262f; }
.phone::after { right: -4px; top: 200px; height: 96px; }
.screen { position: relative; overflow: hidden; background: #000; border-radius: 48px; width: var(--sw); height: var(--sh); isolation: isolate; }
.statusbar { position: absolute; left: 0; right: 0; top: 0; height: var(--sbh); background: var(--app-accent); color: #fff; display: flex; align-items: flex-end; justify-content: space-between; padding: 0 28px 7px 34px; font-size: 15px; font-weight: 600; z-index: 3; }
.statusbar .island { position: absolute; left: 50%; top: 10px; width: 108px; height: 30px; margin-left: -54px; background: #000; border-radius: 20px; }
.land .statusbar .island { display: none; }
.land .statusbar { padding: 0 24px 4px; font-size: 12px; align-items: center; }
.statusbar .sys { display: flex; gap: 6px; align-items: center; }
.statusbar svg { display: block; fill: currentColor; }
.screen iframe { position: absolute; left: 0; top: var(--sbh); width: var(--sw); height: calc(var(--sh) - var(--sbh) - var(--hbh)); border: 0; background: var(--app-bg); }
.homebar { position: absolute; left: 0; right: 0; bottom: 0; height: var(--hbh); background: var(--app-bg); z-index: 3; display: flex; align-items: center; justify-content: center; }
.homebar i { width: 134px; height: 5px; border-radius: 3px; background: #111; opacity: .85; }
.overlay { position: absolute; left: 0; right: 0; top: var(--sbh); bottom: var(--hbh); z-index: 2; background: var(--app-bg); color: #222; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 12px; text-align: center; padding: 28px; font-size: 15px; }
.overlay.on { display: flex; }
.overlay h2 { margin: 0; font-size: 20px; }
.overlay p { margin: 0; color: #444; }
.overlay .row { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.overlay .btn { background: var(--app-accent); color: #fff; border: 0; padding: 10px 16px; border-radius: 12px; cursor: pointer; text-decoration: none; font-weight: 600; }
.overlay .btn.alt { background: transparent; color: var(--app-accent); border: 1.5px solid var(--app-accent); }
.overlay .tile { width: 72px; height: 72px; border-radius: 18px; background: var(--app-accent); color: #fff; display: grid; place-items: center; font-size: 30px; font-weight: 700; overflow: hidden; }
.overlay .tile img { width: 100%; height: 100%; object-fit: cover; }

.toolbar { position: fixed; left: 50%; bottom: 12px; transform: translateX(-50%); z-index: 20; display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 6px; max-width: calc(100vw - 24px); box-shadow: 0 10px 30px rgba(0, 0, 0, .35); transition: opacity .2s, transform .2s; }
body.cues-open .toolbar { left: calc(50% - 170px); }
body.hide-controls .toolbar, body.rec .toolbar { opacity: 0; pointer-events: none; transform: translate(-50%, 16px); }
body.present.idle .toolbar { opacity: 0; pointer-events: none; transform: translate(-50%, 16px); }
.toolbar .grp { display: flex; gap: 4px; align-items: center; padding: 0 4px; border-right: 1px solid var(--line); }
.toolbar .grp:last-child { border-right: 0; }
.toolbar button, .toolbar select, .toolbar a.b { background: var(--chip); border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; cursor: pointer; text-decoration: none; display: inline-flex; gap: 6px; align-items: center; min-height: 34px; }
.toolbar button:hover, .toolbar a.b:hover { border-color: var(--accent); }
.toolbar button[aria-pressed="true"] { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 22%, var(--chip)); }
.toolbar kbd { font: 11px ui-monospace, monospace; color: var(--muted); border: 1px solid var(--line); border-radius: 4px; padding: 0 4px; }
.toolbar input[type="range"] { width: 110px; accent-color: var(--accent); }
.toolbar .val { min-width: 42px; text-align: center; color: var(--muted); font-variant-numeric: tabular-nums; }

.pop, .cues { position: fixed; z-index: 30; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 16px 40px rgba(0, 0, 0, .45); }
.pop { left: 50%; bottom: 76px; transform: translateX(-50%); padding: 14px; text-align: center; max-width: 92vw; }
.pop[hidden], .cues[hidden] { display: none; }
.pop .url { font: 12px ui-monospace, monospace; color: var(--muted); word-break: break-all; max-width: 260px; margin: 8px auto 0; }
.pop svg { border-radius: 8px; display: block; margin: 0 auto; }
.help h2 { margin: 0 0 8px; font-size: 16px; }
.help table { border-collapse: collapse; font-size: 13px; width: 100%; }
.help td { padding: 2px 8px 2px 0; vertical-align: top; }
.help p { margin: 8px 0 0; color: var(--muted); font-size: 13px; max-width: 380px; text-align: left; }
.cues { top: 60px; right: 12px; bottom: 12px; width: 330px; padding: 14px; overflow: auto; }
.cues h2 { margin: 0 0 4px; font-size: 16px; }
.cues .sub { color: var(--muted); font-size: 12px; margin: 0 0 10px; }
.cues ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.cues li { background: var(--chip); border: 1px solid var(--line); border-radius: 10px; padding: 9px 10px; }
.cues li q { quotes: none; display: block; font-weight: 600; }
.cues li small { display: block; color: var(--muted); margin-top: 3px; font-size: 12px; }
.cues li .row { display: flex; gap: 6px; align-items: center; margin-top: 6px; }
.cues .verify { font-size: 11px; font-weight: 700; color: #b45309; background: #fef3c7; border-radius: 6px; padding: 1px 6px; }
.cues .copy { background: transparent; border: 1px solid var(--line); border-radius: 8px; padding: 2px 8px; cursor: pointer; font-size: 12px; }
.cues .meta { margin-top: 12px; font-size: 12px; color: var(--muted); }
.cues .meta p { margin: 6px 0 0; }
.toast { position: fixed; left: 50%; top: 64px; transform: translateX(-50%); background: var(--panel); border: 1px solid var(--line); padding: 6px 14px; border-radius: 999px; z-index: 40; font-size: 13px; opacity: 0; pointer-events: none; transition: opacity .2s; }
.toast.on { opacity: 1; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
@media (max-width: 720px) { .topbar nav { display: none; } body.cues-open .stage { padding-right: 12px; } .cues { left: 12px; width: auto; } body.cues-open .toolbar { left: 50%; } }

/* Index page */
.index { position: static; overflow: auto; height: 100%; padding: 40px 20px 60px; }
body.index-page { overflow: auto; }
.index main { max-width: 900px; margin: 0 auto; }
.index h1 { font-size: 28px; margin: 0 0 6px; }
.index .lead { color: var(--muted); margin: 0 0 26px; max-width: 640px; }
.cards { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.card .head { display: flex; gap: 12px; align-items: center; }
.card .tile { width: 52px; height: 52px; border-radius: 14px; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 22px; overflow: hidden; flex: none; }
.card .tile img { width: 100%; height: 100%; object-fit: cover; }
.card h2 { margin: 0; font-size: 17px; }
.card p { margin: 0; color: var(--muted); font-size: 13px; }
.card .actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; }
.card .actions a { text-decoration: none; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--chip); font-size: 13px; }
.card .actions a.primary { background: var(--accent); color: #fff; border-color: transparent; font-weight: 600; }
.badge { font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 999px; background: var(--chip); border: 1px solid var(--line); color: var(--muted); }
.index footer { margin-top: 28px; color: var(--muted); font-size: 13px; max-width: 720px; }
