/* Live room: QR panel, join badge, ink + taps on the projector, live quiz bars, student phone page, cockpit preview. */

/* Projector (teach.html) */
#livepanel { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: rgba(15, 21, 19, .35); backdrop-filter: blur(8px); }
#livepanel[hidden] { display: none; }
.lp { position: relative; width: min(880px, 92vw); padding: 28px 32px; display: flex; flex-direction: column; gap: 16px; animation: dlg .6s var(--ease); }
.lp-x { position: absolute; right: 16px; top: 16px; }
.lp-main { display: grid; grid-template-columns: 300px 1fr; gap: 30px; align-items: center; }
.lp-qr, .rqr { background: #fff; border-radius: 18px; padding: 10px; box-shadow: 0 0 0 1px var(--line); }
.lp-qr svg, .rqr svg { display: block; width: 100%; height: auto; }
.lp h2 { font-size: 2.6rem; letter-spacing: -.04em; margin: 0 0 .4rem; }
.lp-url { font-family: var(--mono); font-size: 1.15rem; margin: 0; word-break: break-all; }
.lp-code { font-size: 1.3rem; margin: .6rem 0; } .lp-code b { font-family: var(--mono); font-size: 2.2rem; letter-spacing: .12em; color: var(--accent); }
.lp-n { font-size: 1.2rem; font-weight: 600; }
.lp-teacher { padding-top: 6px; border-top: 1px solid var(--line); }
#livebadge { position: fixed; left: 16px; bottom: 16px; z-index: 30; border: 0; padding: .55rem 1rem; border-radius: 999px; font: inherit; font-size: .95rem; cursor: pointer;
  background: color-mix(in srgb, var(--panel) 88%, transparent); backdrop-filter: blur(12px); color: var(--ink); box-shadow: var(--hi), 0 0 0 1px var(--line), 0 12px 28px -18px rgba(0,0,0,.4); }
#livebadge[hidden] { display: none; }
#livebadge b { font-family: var(--mono); }
#ink { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 200; pointer-events: none; } /* above Reveal's black pause screen, so you can draw on it */
.tapfx { position: fixed; z-index: 26; width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%; background: var(--c, var(--accent)); pointer-events: none; animation: tapfx .7s var(--ease) forwards; }
@keyframes tapfx { to { transform: scale(5); opacity: 0; } }
body.preview .deck-tools, body.preview #hud, body.preview #livebadge, body.preview .reveal .controls, body.preview .reveal .progress { display: none !important; }

/* Live quiz on the projector */
.qz-a button { position: relative; overflow: hidden; }
.qz-bar { position: absolute; left: 0; bottom: 0; height: 8px; width: 0; background: var(--c); opacity: .75; transition: width .6s var(--ease); }
.qz-n { margin-left: auto; font-style: normal; font-family: var(--mono); font-size: 30px; font-weight: 600; color: var(--c); }
.qz-a button.dim { opacity: .45; }
.qz-live { font-size: 24px; display: inline-flex; align-items: center; gap: 14px; }
.qz-fast { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; margin-top: 10px; font-size: 22px; }
.qz-fast span small { color: var(--ink3); font-family: var(--mono); }
.qz-lb { list-style: none; margin: 10px 0; padding: 0; display: flex; flex-direction: column; gap: 8px; min-width: min(560px, 100%); }
.qz-lb li { display: grid; grid-template-columns: 54px 1fr auto; align-items: center; gap: 12px; padding: 12px 18px; border-radius: 16px; background: var(--panel2); font-size: 26px; animation: pop .6s var(--spring) backwards; }
.qz-lb li:nth-child(1) { background: color-mix(in srgb, #d9a400 22%, var(--panel)); font-size: 30px; }
.qz-lb li em { font-style: normal; font-family: var(--mono); color: var(--ink2); }
.qz-lb li.me { box-shadow: inset 0 0 0 2px var(--accent); }

/* Student phone page (join.html) */
body.jn { min-height: 100dvh; }
.jn-main { position: relative; z-index: 1; max-width: 520px; margin: 0 auto; padding: 14px 16px 32px; display: flex; flex-direction: column; gap: 14px; }
.jn-top { display: flex; justify-content: space-between; align-items: center; font-size: .9rem; }
.jn-chip { font-size: .8rem; color: var(--ink3); } .jn-chip.open { color: var(--good); } .jn-chip.lost { color: var(--warn); }
.jn-card { padding: 22px 20px; display: flex; flex-direction: column; gap: 12px; }
.jn-card h1 { margin: 0; font-size: 1.9rem; letter-spacing: -.035em; }
.jn-card label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: .95rem; }
.jn-card input { font: inherit; font-size: 1.25rem; padding: .8rem 1rem; border: 0; border-radius: 14px; background: var(--bg2); box-shadow: inset 0 0 0 1px var(--line); color: var(--ink); }
.jn-card .btn { justify-content: center; font-size: 1.1rem; padding: .9rem; }
.jn-center { text-align: center; align-items: center; }
.jn-big { font-size: 4.2rem; line-height: 1; }
.jn-pts { font-family: var(--mono); font-size: 1.2rem; font-weight: 600; }
.jn-card.ok { box-shadow: inset 0 0 0 3px var(--good), var(--glow); } .jn-card.no { box-shadow: inset 0 0 0 3px var(--bad), var(--glow); }
.jn-qtext { font-size: 1.35rem; font-weight: 600; letter-spacing: -.02em; line-height: 1.25; margin: 4px 2px 6px; }
.jn-ans { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.jn-ans button { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-height: 120px; padding: 14px; border: 0; border-radius: 18px; background: var(--k); color: #fff; text-align: left; font: inherit; font-size: 1rem; font-weight: 600; box-shadow: 0 6px 0 color-mix(in srgb, var(--k) 60%, #000); transition: transform .15s; }
.jn-ans button b { font-size: 1.6rem; }
.jn-ans button:active { transform: translateY(4px); box-shadow: 0 2px 0 color-mix(in srgb, var(--k) 60%, #000); }
.jn-ans button:disabled { opacity: .35; } .jn-ans button.picked { opacity: 1; outline: 4px solid var(--ink); outline-offset: 2px; }
.jn-locked { text-align: center; font-weight: 600; color: var(--ink2); }

/* Cockpit preview + remote */
.pv { display: flex; flex-direction: column; gap: 8px; }
.pv[hidden] { display: none; }
.pvbar { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.pvbar .tag { margin-right: auto; }
.pvwrap { position: relative; aspect-ratio: 16 / 9; border-radius: 16px; overflow: hidden; box-shadow: 0 0 0 1px var(--line); background: var(--bg2); }
.pvwrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.pvwrap canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: crosshair; }
#main { display: contents; }
#pvshow[hidden] { display: none; }
.rqr { width: 220px; }
body.remote #aud, body.remote #mini, body.remote #livego { display: none; }
body.mini .ck-top { margin: .4rem .4rem 0; padding: .5rem .6rem; }
body.mini #coach, body.mini #stuck { font-size: 1rem; }
.ck > *, .ck-main > * { min-width: 0; }
body.mini .ck-top select { flex: 1 1 100%; max-width: 100%; }
body.mini .ck-top .timer { flex: 1 1 auto; }
body.mini .ck-top .timer .bar { flex: 1; width: auto; }
body.mini .ck-nav .btn { flex: 1; justify-content: center; }
body.mini .ck-nav .up { display: none; }
body.mini .pvbar .btn { padding: .4em .7em; }
@media (max-width: 700px) { .lp-main { grid-template-columns: 1fr; } }

/* ---- Pen colours, black-screen preview, phone/iPad thumb dock ---- */
.cols { display: inline-flex; gap: 6px; align-items: center; }
.sw { width: 26px; height: 26px; border-radius: 50%; border: 0; padding: 0; background: var(--sw); box-shadow: 0 0 0 1px var(--line), inset 0 0 0 1px rgba(0,0,0,.15); cursor: pointer; transition: transform .25s var(--spring); }
.sw.on { transform: scale(1.15); box-shadow: 0 0 0 2px var(--panel), 0 0 0 4px var(--accent); }
.pvwrap.paused::after { content: "Screen paused · draw away"; position: absolute; inset: 0; z-index: 1; background: #000; color: #666; display: grid; place-items: end center; padding-bottom: 8px; font-size: .75rem; pointer-events: none; }
.pvwrap canvas { z-index: 2; }
.dock { display: none; }
body.remote .dock { display: flex; flex-direction: column; gap: 8px; position: fixed; left: 8px; right: 8px; bottom: calc(8px + env(safe-area-inset-bottom)); z-index: 50; padding: 10px; border-radius: 26px; background: color-mix(in srgb, var(--panel) 88%, transparent); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); box-shadow: 0 0 0 1px var(--line), 0 18px 40px -18px rgba(0,0,0,.35); }
body.remote { padding-bottom: 160px; }
.dk-row { display: flex; gap: 6px; align-items: center; }
.dk-row > button { flex: 1; min-height: 46px; border: 0; border-radius: 16px; background: var(--bg2); color: var(--ink); font: 600 .9rem/1.1 var(--sans, inherit); padding: 0 6px; touch-action: manipulation; transition: transform .2s var(--spring); }
.dk-row > button:active { transform: scale(.96); }
.dk-row > button.primary { background: var(--accent); color: #fff; }


.dock .cols { flex: 0 0 auto; }
.dock .sw { width: 30px; height: 30px; }
@media (max-width: 420px) { .dock .dk-row:first-child { flex-wrap: wrap; } .dock .dk-row:first-child .cols { width: 100%; justify-content: center; } }
/* On the remote the dock owns these controls — hide the duplicates higher up. */
body.remote #pause, body.remote #coach, body.remote #stuck, body.remote #peek, body.remote .ck-nav, body.remote #pvbar [data-pm], body.remote #pvbar [data-pclear], body.remote #pvbar [data-phide], body.remote #pvbar .cols, body.remote #tgo { display: none !important; }
body:has(.reveal.paused) #livepanel, body:has(.reveal.paused) #livebadge { display: none; } /* paused = pure black, only your ink shows */
