body { overflow: hidden; }
#app { height: 100vh; height: 100dvh; display: flex; flex-direction: column; padding: clamp(14px, 2.2vw, 36px) clamp(18px, 3vw, 52px); gap: clamp(10px, 1.6vw, 24px); }
.top { padding-right: 180px; display: flex; align-items: center; justify-content: space-between; gap: 16px; font-weight: 800; color: var(--muted); font-size: clamp(14px, 1.4vw, 22px); }
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); }
.brand b { font-size: clamp(18px, 1.9vw, 30px); font-weight: 900; display: block; line-height: 1.05; }
.brand small { font-size: clamp(11px, .95vw, 15px); color: var(--muted); font-weight: 800; }
.qn { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.dots { display: flex; gap: 5px; flex-wrap: wrap; justify-content: center; }
.dots span { width: clamp(14px, 2vw, 34px); height: 7px; border-radius: 4px; background: var(--line); }
.dots span.done { background: var(--ink); } .dots span.now { background: var(--hi); outline: 2px solid var(--ink); outline-offset: -2px; }

.qcard { background: var(--card); border-radius: 22px; box-shadow: 0 2px 12px rgba(30,36,48,.08); padding: clamp(14px, 2vw, 34px) clamp(18px, 2.6vw, 44px); text-align: center; font-size: clamp(22px, 3.1vw, 54px); font-weight: 900; line-height: 1.2; text-wrap: balance; color: var(--ink); }
.qcard.small { font-size: clamp(18px, 2.2vw, 36px); padding: 14px 24px; }
.mid { flex: 1; display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 0; }
.mid .pic { flex: 1; height: 100%; display: flex; align-items: center; justify-content: center; min-height: 0; }
.mid .pic .zimg { display: flex; align-items: center; justify-content: center; height: 100%; max-width: 100%; }
.mid .pic img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 14px; background: #fff; box-shadow: 0 2px 10px rgba(0,0,0,.08); }
.timer { width: clamp(80px, 9vw, 150px); height: clamp(80px, 9vw, 150px); border-radius: 50%; background: var(--ink); color: var(--bg); display: flex; flex-direction: column; align-items: center; justify-content: center; flex: none; }
.timer b { font-size: clamp(30px, 4vw, 66px); line-height: 1; font-weight: 900; }
.timer small, .count small { font-size: clamp(11px, 1vw, 16px); font-weight: 800; }
.count { width: clamp(80px, 9vw, 150px); text-align: center; flex: none; }
.count b { font-size: clamp(30px, 4vw, 66px); font-weight: 900; line-height: 1; display: block; }
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(8px, 1.2vw, 18px); }
.tile { color: #fff; border-radius: 16px; padding: clamp(12px, 1.6vw, 26px) clamp(14px, 2vw, 30px); display: flex; align-items: center; gap: clamp(10px, 1.4vw, 22px); font-size: clamp(18px, 2.4vw, 40px); font-weight: 900; line-height: 1.15; }
.tile .shape { width: clamp(26px, 2.8vw, 46px); height: clamp(26px, 2.8vw, 46px); }
.tile.dim { opacity: .35; } .tile.right { outline: 5px solid var(--ink); outline-offset: 3px; }
.tile .n { margin-left: auto; font-size: .8em; background: rgba(0,0,0,.22); border-radius: 10px; padding: 0 12px; }
.bars { flex: 1; display: flex; align-items: flex-end; justify-content: center; gap: clamp(14px, 3vw, 54px); min-height: 0; padding: 0 4vw; }
.bar { flex: 1; max-width: 220px; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; justify-content: flex-end; font-size: clamp(20px, 2.4vw, 40px); font-weight: 900; }
.bar i { display: block; width: 100%; border-radius: 12px 12px 0 0; min-height: 8px; }
.bar.dim { opacity: .35; }
.bottom { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.why { flex: 1; background: var(--hi); color: #1E2430; border-radius: 14px; padding: 12px 20px; font-size: clamp(15px, 1.6vw, 24px); font-weight: 700; }
.bigbtn { min-height: clamp(48px, 4.6vw, 70px); padding: 0 clamp(22px, 3vw, 46px); font-size: clamp(17px, 1.7vw, 26px); border-radius: 14px; }

.lobby { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(16px, 2.4vw, 40px); min-height: 0; }
.joinbox { flex-wrap: wrap; justify-content: center; background: var(--card); border-radius: 26px; box-shadow: 0 2px 12px rgba(30,36,48,.08); display: flex; align-items: center; gap: clamp(16px, 2.4vw, 40px); padding: clamp(16px, 2.4vw, 40px); min-height: 0; overflow: auto; }
.qr { width: clamp(160px, min(24vw, 38dvh), 520px); aspect-ratio: 1; border-radius: 0; overflow: visible; flex: none; background: none; }
.qr svg { width: 100%; height: 100%; display: block; }
.join-t { display: flex; flex-direction: column; gap: clamp(6px, min(1.2vw, 1.6dvh), 18px); color: var(--ink); }
.join-t h2 { margin: 0; font-size: clamp(22px, min(2.8vw, 5dvh), 46px); line-height: 1.1; }
.join-t .url { font-size: clamp(15px, 1.5vw, 24px); color: var(--muted); }
.join-t .url b { color: var(--ink); display: block; }
.pin { white-space: nowrap; font-size: clamp(28px, min(3.8vw, 7dvh), 72px); font-weight: 900; letter-spacing: .08em; background: var(--hi); color: #1E2430; border-radius: 14px; padding: 0 18px; align-self: flex-start; line-height: 1.25; }
.players { display: flex; flex-direction: column; gap: 14px; min-height: 0; }
.plist { display: flex; flex-wrap: wrap; gap: 10px; align-content: flex-start; overflow: auto; flex: 1; }
.pchip { display: flex; align-items: center; gap: 10px; background: var(--card); border-radius: 999px; padding: 8px 18px 8px 8px; font-size: clamp(16px, 1.6vw, 26px); font-weight: 800; border: 2px solid transparent; cursor: pointer; animation: pop .25s ease-out; color: var(--ink); }
.pchip:hover { border-color: var(--bad); }
.pchip .av { width: 1.6em; height: 1.6em; border-radius: 50%; color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 900; font-size: .85em; }
.pchip.off { opacity: .5; }
.empty { flex: 1; border: 2px dashed var(--line); border-radius: 20px; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: clamp(16px, 1.6vw, 24px); }
.teams { display: grid; gap: 12px; flex: 1; overflow: auto; }
.team { background: var(--card); border-radius: 16px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.team h3 { margin: 0; display: flex; align-items: center; gap: 8px; color: var(--ink); }
@keyframes pop { from { transform: scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }

.ready { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; text-align: center; }
.ready .k { font-size: clamp(18px, 2vw, 30px); color: var(--muted); font-weight: 800; }
.ready .q { font-size: clamp(30px, 4.4vw, 76px); font-weight: 900; max-width: 80vw; line-height: 1.15; text-wrap: balance; }
.ready .bar0 { width: min(60vw, 700px); height: 10px; border-radius: 6px; background: var(--line); overflow: hidden; }
.ready .bar0 i { display: block; height: 100%; background: var(--ink); animation: fill 1.2s linear forwards; }
@keyframes fill { from { width: 0; } to { width: 100%; } }

.board { flex: 1; display: flex; flex-direction: column; gap: 10px; justify-content: center; width: min(900px, 100%); margin: 0 auto; }
.brow { display: flex; align-items: center; gap: 16px; background: var(--card); border-radius: 14px; padding: 12px 22px; font-size: clamp(18px, 2vw, 32px); font-weight: 900; color: var(--ink); animation: pop .3s ease-out both; }
.brow .rk { width: 1.8em; color: var(--muted); }
.brow .d { font-size: .7em; color: var(--ok); }
.podium { flex: 1.4; display: flex; align-items: flex-end; justify-content: center; gap: 18px; }
.pod { width: clamp(130px, 15vw, 240px); display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--ink); }
.pod .nm { font-size: clamp(18px, 2.2vw, 36px); font-weight: 900; text-align: center; }
.pod .sc { font-size: clamp(14px, 1.4vw, 22px); color: var(--muted); font-weight: 800; }
.pod .blk { width: 100%; border-radius: 16px 16px 0 0; display: flex; justify-content: center; padding-top: 12px; font-size: clamp(30px, 3.6vw, 60px); font-weight: 900; color: #1E2430; animation: rise .8s ease-out both; transform-origin: bottom; }
@keyframes rise { from { transform: scaleY(0); } to { transform: none; } }
.stat { background: var(--card); border-radius: 18px; padding: 18px 22px; display: flex; flex-direction: column; gap: 6px; color: var(--ink); }
.stat .k { font-size: 14px; font-weight: 900; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.stat .v { font-size: clamp(26px, 3vw, 50px); font-weight: 900; line-height: 1; }

.typed { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.typed span { background: var(--card); border-radius: 12px; padding: 8px 16px; font-size: clamp(16px, 1.8vw, 28px); font-weight: 800; border: 3px solid transparent; color: var(--ink); }
.typed span.ok { border-color: var(--ok); }
.order { display: flex; flex-direction: column; gap: 10px; width: min(760px, 100%); margin: 0 auto; }
.pinwrap { position: relative; display: inline-block; max-height: 100%; }
.pinwrap img { display: block; max-height: 52vh; max-width: 70vw; border-radius: 14px; background: #fff; }
.pinwrap .dot { position: absolute; width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.4); }
.pinwrap .ring { position: absolute; border: 4px dashed var(--ok); border-radius: 50%; transform: translate(-50%, -50%); }
.numline { width: min(900px, 90%); margin: 0 auto; position: relative; height: 90px; }
.numline .ln { position: absolute; left: 0; right: 0; top: 44px; height: 8px; border-radius: 4px; background: var(--line); }
.numline .v { position: absolute; top: 34px; width: 12px; height: 28px; margin-left: -6px; border-radius: 4px; background: var(--c0); opacity: .55; }
.numline .ans { position: absolute; top: 0; transform: translateX(-50%); font-size: 28px; font-weight: 900; color: var(--ok); }
.numline .lo, .numline .hi { position: absolute; top: 60px; left: 0; font-weight: 800; color: var(--muted); }
.numline .hi { left: auto; right: 0; }

.tools { position: fixed; right: 10px; top: 10px; display: flex; gap: 6px; opacity: .35; transition: opacity .2s; z-index: 50; }
.tools:hover { opacity: 1; }
.tbtn { width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--ink); font-size: 18px; cursor: pointer; }
.drawer { position: fixed; right: 10px; top: 60px; width: min(380px, 92vw); max-height: 80vh; overflow: auto; background: var(--card); color: var(--ink); border-radius: 16px; box-shadow: 0 12px 40px rgba(0,0,0,.25); padding: 16px; z-index: 60; display: flex; flex-direction: column; gap: 12px; }
.soundhint { position: fixed; left: 50%; bottom: 12px; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 8px 16px; border-radius: 999px; font-weight: 800; font-size: 14px; cursor: pointer; z-index: 70; }
.center { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; text-align: center; }

/* pen & text layer */
.ann-layer { position: fixed; inset: 0; z-index: 950; pointer-events: none; }
.ann-layer canvas { position: absolute; inset: 0; }
.ann-layer.on { pointer-events: auto; cursor: crosshair; touch-action: none; }
.ann-layer.on[data-tool=text] { cursor: text; } .ann-layer.on[data-tool=erase] { cursor: cell; }
.ann-text { position: absolute; min-width: 40px; padding: 2px 6px; font-weight: 800; line-height: 1.2; outline: none; white-space: pre-wrap; max-width: 70vw; pointer-events: auto; text-shadow: 0 0 3px rgba(255,255,255,.6); }
.ann-text:focus { outline: 2px dashed rgba(43,108,176,.7); border-radius: 6px; }
.ann-ui { position: fixed; right: 12px; top: 50%; transform: translateY(-50%); z-index: 960; display: grid; grid-template-columns: 44px; gap: 6px; justify-items: center; align-items: center; padding: 8px; border-radius: 16px; background: var(--card); color: var(--ink); box-shadow: 0 10px 34px rgba(0,0,0,.28); max-height: calc(100dvh - 16px); overflow-y: auto; overscroll-behavior: contain; }
.ann-ui[hidden] { display: none; }
.ann-b { width: 44px; height: 44px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--ink); font-size: 18px; font-weight: 900; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; padding: 0; }
.ann-b.on { background: var(--btn); color: var(--btn-ink); border-color: var(--btn); }
.ann-b.main { background: var(--btn); color: var(--btn-ink); border-color: var(--btn); }
.ann-b.wide { font-size: 15px; grid-column: 1 / -1; width: 100%; }
.ann-s i { display: block; border-radius: 50%; background: currentColor; }
.ann-c { width: 32px; height: 32px; border-radius: 50%; border: 2px solid #D6D2C8; cursor: pointer; padding: 0; }
.ann-c.on { outline: 3px solid var(--btn); outline-offset: 2px; }
.ann-pick { background: radial-gradient(circle, var(--cc, #fff) 0 42%, transparent 44%), conic-gradient(#E53935, #FB8C00, #FDD835, #43A047, #1E88E5, #8E24AA, #E53935); }
.pendock { position: fixed; right: 12px; top: 50%; transform: translateY(-50%); z-index: 940; display: flex; flex-direction: column; gap: 8px; padding: 8px; border-radius: 16px; background: rgba(255,255,255,.92); box-shadow: 0 6px 22px rgba(0,0,0,.2); }
.pendock[hidden] { display: none; }
.pendock .ann-b svg { width: 22px; height: 22px; }
.ann-pal[hidden] { display: none; }
.ann-pal { position: fixed; z-index: 970; right: 120px; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; gap: 8px; padding: 12px; background: var(--card); color: var(--ink); border-radius: 14px; box-shadow: 0 10px 34px rgba(0,0,0,.28); }
.ann-g { width: 28px; height: 28px; border-radius: 6px; border: 1px solid rgba(0,0,0,.12); cursor: pointer; padding: 0; }
.ann-g.on { outline: 3px solid var(--btn); outline-offset: 1px; }
.ann-sep { grid-column: 1 / -1; width: 100%; height: 1px; background: var(--line); margin: 2px 0; }

/* Students draw */
.inklayer { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 930; pointer-events: none; }
.tbtn.on { background: var(--ink, #1E2430); color: #fff; }
.classbar { position: fixed; left: 50%; transform: translateX(-50%); bottom: 8px; z-index: 945; width: min(1100px, 92vw); background: rgba(255,255,255,.55); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); color: var(--ink, #1E2430); border-radius: 999px; padding: 3px 6px 3px 14px; box-shadow: 0 4px 16px rgba(0,0,0,.12); display: flex; align-items: center; flex-wrap: nowrap; gap: 8px; font-size: 13px; line-height: 1.2; }
.classbar > b { white-space: nowrap; font-size: 12.5px; }
.classbar .muted { font-size: 12px; white-space: nowrap; }
.classbar .who { display: flex; flex-wrap: nowrap; gap: 6px; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.classbar .who::-webkit-scrollbar { display: none; }
.classbar .row .btn.small { padding: 3px 10px; min-height: 0; font-size: 12px; line-height: 1.3; }
.classbar .wchip .wn { opacity: 1; font-size: 12px; }
.classbar .wchip { padding: 1px 6px 1px 4px; flex-shrink: 0; white-space: nowrap; }
.classbar .row { display: flex; gap: 4px; flex-wrap: nowrap; flex-shrink: 0; }
.wchip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line, #E3E0D8); background: transparent; color: inherit; border-radius: 999px; padding: 4px 8px 4px 6px; font: inherit; font-weight: 700; cursor: pointer; }
.wchip i { width: 12px; height: 12px; border-radius: 50%; display: block; }
.wchip span { opacity: .5; font-size: 11px; }

.qr[data-zoom]::after { display: none; } /* keep the corner of the code clear for phone cameras */
.players > .row:last-child { flex: none; flex-wrap: wrap; }

/* ---------- Calm designs A–O: big-screen layouts ---------- */
.qwrap, .qside { display: contents; }
/* question left, answers right (A Linen Split, B Stone & Ink, M Side Panel) */
:is([data-d=split], [data-d=rows], [data-d=panel]) .qwrap { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: clamp(14px, 2vw, 32px); flex: 1; min-height: 0; }
:is([data-d=split], [data-d=rows], [data-d=panel]) .qside { display: flex; flex-direction: column; gap: clamp(10px, 1.4vw, 20px); min-height: 0; }
:is([data-d=split], [data-d=rows], [data-d=panel]) .qwrap .qcard { text-align: left; font-size: clamp(22px, 2.7vw, 48px); }
:is([data-d=split], [data-d=rows], [data-d=panel]) .qwrap.nopic .qcard { flex: 1; display: flex; align-items: center; }
:is([data-d=split], [data-d=rows], [data-d=panel]) .qwrap.nopic .mid { flex: none; }
:is([data-d=split], [data-d=rows], [data-d=panel]) .qwrap .mid { justify-content: flex-start; }
:is([data-d=split], [data-d=rows], [data-d=panel]) .qwrap .mid .pic { order: -1; }
[data-d=split] .qwrap .tiles { grid-auto-rows: minmax(0, 1fr); align-content: stretch; }
[data-d=split] .qwrap .tile { flex-direction: column; align-items: flex-start; justify-content: space-between; }
:is([data-d=rows], [data-d=panel]) .qwrap .tiles { grid-template-columns: minmax(0, 1fr); grid-auto-rows: minmax(0, 1fr); align-content: stretch; }
[data-design=stone] .tile { font-size: clamp(18px, 2.1vw, 36px); }
[data-design=stone] .tile.right { outline: none; border-color: var(--ink); border-width: 3px; }
/* M: dark panel */
[data-d=panel] .qside { background: var(--ink); color: #fff; border-radius: 24px; padding: clamp(16px, 2vw, 34px); }
[data-d=panel] .qside .qcard { background: transparent; box-shadow: none; color: #fff; padding: 0; }
[data-d=panel] .qside .muted { color: rgba(255,255,255,.7) !important; }
[data-d=panel] .qside .timer { background: #fff; color: var(--ink); }
[data-d=panel] .qside .count, [data-d=panel] .qside .count span { color: #fff !important; }
/* F Gallery: big picture, one row of answer bars */
[data-d=gallery] .qcard { font-size: clamp(20px, 2.5vw, 44px); padding-top: 4px; padding-bottom: 4px; }
[data-d=gallery] .tiles { grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); grid-auto-flow: column; }
[data-d=gallery] .tile { font-size: clamp(16px, 1.9vw, 32px); padding: clamp(10px, 1.2vw, 20px); }
[data-d=gallery] .mid .pic img { border-radius: 4px; box-shadow: 0 8px 30px rgba(0,0,0,.14); }
/* G Harbor Mist: one pill per line */
[data-d=pills] .tiles { grid-template-columns: minmax(0, 1fr); width: min(1100px, 100%); margin: 0 auto; gap: clamp(6px, .9vw, 14px); }
[data-d=pills] .tile { padding-top: clamp(8px, 1vw, 16px); padding-bottom: clamp(8px, 1vw, 16px); font-size: clamp(17px, 2.1vw, 36px); }
/* J Round Table: four circles */
[data-d=circles] .tiles { display: flex; justify-content: center; gap: clamp(14px, 2.4vw, 44px); }
[data-d=circles] .tile { width: min(19vw, 30dvh); padding: 6%; font-size: clamp(14px, 1.7vw, 30px); gap: 6px; }
[data-d=circles] .tile .n { margin: 0; }
/* K Ticket */
[data-d=ticket] .tile { padding-right: clamp(14px, 2vw, 30px); }
[data-d=ticket] .tile .lt { font-size: clamp(22px, 2.6vw, 44px); min-height: clamp(52px, 5.4vw, 90px); }
/* L Quiet Lines */
[data-d=lines] .qcard { font-size: clamp(26px, 3.4vw, 60px); }
[data-d=lines] .tiles { column-gap: clamp(30px, 5vw, 90px); }
/* O Museum */
[data-d=frame] .qcard { margin: 8px clamp(10px, 4vw, 80px); padding: clamp(18px, 2.4vw, 40px) clamp(26px, 3vw, 54px); }
[data-d=frame] .tiles { width: min(1100px, 100%); margin: 0 auto; }
[data-d=frame] .tile { font-size: clamp(17px, 2vw, 34px); padding-top: clamp(10px, 1.2vw, 18px); padding-bottom: clamp(10px, 1.2vw, 18px); }
/* I chalk */
[data-design=chalk] .qcard { font-size: clamp(26px, 3.4vw, 60px); }
/* big screen avatars */
.pchip .av.hasav { width: 1.9em; height: 1.9em; }
.brow .bav { width: 1.3em; height: 1.3em; }
:is([data-d=split], [data-d=rows], [data-d=panel]) .qwrap.haspic .mid { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: 1fr 1fr; gap: clamp(10px, 1.4vw, 20px); align-items: center; justify-items: center; }
:is([data-d=split], [data-d=rows], [data-d=panel]) .qwrap.haspic .mid .pic { grid-row: 1 / 3; grid-column: 1; width: 100%; }
:is([data-d=split], [data-d=rows], [data-d=panel]) .qwrap.haspic .mid .count { align-self: start; }
:is([data-d=split], [data-d=rows], [data-d=panel]) .qwrap.haspic .mid .timer { align-self: end; }
[data-d=pills] .mid, [data-d=circles] .mid { min-height: 26dvh; }
/* Order answer list: never cut off. Round designs line the circles up in a row, sized to fit the screen. */
.order { max-height: 100%; }
:is([data-design=round], [data-d=circles]) .order { flex-direction: row; flex-wrap: wrap; justify-content: center; align-items: center; width: 100%; gap: clamp(10px, 1.6vw, 28px); }
:is([data-design=round], [data-d=circles]) .order .tile { flex: none; width: min(15vw, calc((100vh - 240px) * .9)); height: auto; aspect-ratio: 1; padding: 6px; font-size: clamp(14px, 1.7vw, 30px); }
/* Next / bottom bar never pushed off screen: the middle shrinks (and scrolls if it must). */
#app > .bottom, #app > .top, #app > .qcard { flex: none; }
#app > :is(.center, .mid, .qwrap) { min-height: 0; }
#app > .center { overflow-y: auto; justify-content: safe center; }
.order .tile { flex: 0 1 auto; min-height: 0; }
/* Size the order list by how many items there are, so all fit. */
.order { --n: 4; }
.order .tile { height: min(calc((100dvh - 290px) / var(--n) - 10px), 90px); padding-block: 0; font-size: clamp(14px, min(2.2vw, calc((100dvh - 290px) / var(--n) * .42)), 36px); }
:is([data-design=round], [data-d=circles]) .order .tile { height: auto; width: min(calc((100vw - 220px) / var(--n) - 24px), calc(100dvh - 300px)); }

/* Jenny's tools: drag grip, free position, flat (horizontal) near top/bottom */
.ann-grip { grid-column: 1 / -1; width: 100%; height: 20px; border: 0; border-radius: 8px; background: var(--soft); color: var(--muted); font-size: 16px; line-height: 1; cursor: grab; touch-action: none; padding: 0; }
.ann-grip:hover { background: var(--line); color: var(--ink); }
.ann-ui.moving, .ann-ui.moving .ann-grip { cursor: grabbing; }
.ann-ui.moving { opacity: .92; box-shadow: 0 16px 44px rgba(0,0,0,.34); }
.ann-ui.free { right: auto; transform: none; }
.ann-ui.h { grid-template-columns: none; grid-auto-flow: column; grid-template-rows: 44px; max-height: none; max-width: 98vw; overflow-x: auto; overflow-y: hidden; padding: 8px 10px; }
.ann-ui.h .ann-grip { grid-column: auto; grid-row: 1 / -1; width: 22px; height: 100%; }
.ann-ui.h .ann-sep { grid-column: auto; grid-row: 1 / -1; width: 1px; height: 100%; margin: 0 2px; }
.ann-ui.h .ann-b.wide { grid-column: auto; grid-row: 1 / -1; width: auto; padding: 0 12px; white-space: nowrap; }
.ann-rec { grid-column: 1 / -1; width: 70%; height: 0; border-top: 1px dashed #CFCAC0; margin: 1px 0; }
.ann-ui.h .ann-rec { grid-column: auto; grid-row: 1 / -1; width: 0; height: 70%; border-top: 0; border-left: 1px dashed #CFCAC0; margin: 0 1px; }
.ann-ui.h { width: max-content; }
@media (max-height: 640px) { .ann-ui:not(.h) { gap: 5px; padding: 8px; } .ann-ui:not(.h) .ann-b.wide { height: 34px; font-size: 14px; } .ann-ui:not(.h) .ann-b { height: 38px; } .ann-ui:not(.h) .ann-c { width: 28px; height: 28px; } }

/* Pen dock: movable by its grip */
.pendock .ann-grip { width: 100%; height: 18px; font-size: 14px; }
.pendock.free { right: auto; transform: none; }
.pendock.moving { opacity: .92; box-shadow: 0 14px 40px rgba(0,0,0,.3); }
.pendock.moving .ann-grip { cursor: grabbing; }
.pendock.h { flex-direction: row; align-items: stretch; }
.pendock.h .ann-grip { width: 18px; height: auto; }
.pendock.h { padding: 5px; gap: 6px; } .pendock.h .ann-b { width: 38px; height: 38px; }
/* Jenny's tools see-through (solid again when the mouse is on them) */
.ann-ui, .pendock { background: color-mix(in srgb, var(--card) 60%, transparent); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); opacity: .72; transition: opacity .15s; }
.ann-ui .ann-b:not(.on):not(.main), .pendock .ann-b { background: color-mix(in srgb, var(--card) 65%, transparent); }
.ann-ui:hover, .ann-ui.moving, .pendock:hover, .pendock.moving { opacity: 1; }
body.drawing .pendock { display: none !important; } /* the full tools replace the dock while the pen is on */

/* Student pen colors on the Students draw bar */
.wchip { cursor: default; padding: 3px 6px 3px 4px; }
.wchip .wdot { width: 20px; height: 20px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.25); padding: 0; cursor: pointer; }
.wchip .wx { border: 0; background: none; color: inherit; opacity: .55; font-size: 12px; cursor: pointer; padding: 0 2px; }
.wchip .wx:hover { opacity: 1; }
.pcpop { position: fixed; z-index: 980; display: grid; grid-template-columns: repeat(6, 30px); gap: 6px; padding: 10px; background: #fff; border-radius: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.3); }
.pcpop button { width: 30px; height: 30px; border-radius: 50%; border: 2px solid rgba(0,0,0,.12); padding: 0; cursor: pointer; }
.pcpop button.on { outline: 3px solid #1E2430; outline-offset: 2px; }

/* Simple pen tools: current color dot, color used before, pop-up box (colors/sizes/highlighter or Clear menu) */
.ann-cur { width: 40px; height: 40px; border-radius: 50%; border: 0; padding: 0; cursor: pointer; background: var(--cc); box-shadow: 0 0 0 2px var(--card), 0 0 0 5px var(--btn); }
.ann-cur.open { box-shadow: 0 0 0 2px var(--card), 0 0 0 5px var(--btn), 0 0 0 9px color-mix(in srgb, var(--btn) 25%, transparent); }
.ann-prev { width: 26px; height: 26px; }
.ann-ui .ann-b.wide { font-size: 13px; padding: 0 4px; }
.ann-h { font-size: 12px; font-weight: 800; color: var(--muted); }
.ann-row { display: flex; gap: 8px; align-items: center; }
.ann-grid { display: grid; grid-template-columns: repeat(12, 22px); gap: 3px; }
.ann-grid .ann-g { width: 22px; height: 22px; }
.ann-pal .ann-b.wide { width: 100%; font-size: 14px; }
.ann-menu { padding: 6px; gap: 2px; }
.ann-mi { border: 0; background: none; color: var(--ink); font: inherit; font-weight: 800; font-size: 15px; text-align: left; padding: 10px 14px; border-radius: 9px; cursor: pointer; min-width: 140px; }
.ann-mi:hover { background: var(--soft); }
/* No text selection / iOS copy menu while drawing or writing on the host + iPad (/pad) screen */
body, body * { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
img, svg, canvas { -webkit-user-drag: none; }
input, textarea, [contenteditable], [contenteditable] * { -webkit-user-select: text; user-select: text; }
/* Class bar hides below the screen; shows only when Jenny moves the mouse to the bottom (or taps the small tab). */
.classbar { transition: transform .22s ease, opacity .22s ease; }
.classbar:not(.peek) { transform: translate(-50%, calc(100% + 14px)); opacity: 0; pointer-events: none; }
.cbtab { position: fixed; left: 50%; bottom: 0; transform: translateX(-50%); z-index: 944; width: 46px; height: 10px; border-radius: 8px 8px 0 0; background: rgba(0,0,0,.10); border: 0; padding: 0; cursor: pointer; }
.cbtab[hidden] { display: none; }
/* Landscape laptop/full screen: QR and the join text side by side so the whole join card fits without scrolling. */
@media (min-aspect-ratio: 5/4) {
  .lobby { grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr); }
  .joinbox { flex-wrap: nowrap; }
  .qr { width: clamp(150px, min(28vw, 60dvh), 520px); }
  .join-t { min-width: 0; }
  .join-t .url { font-size: clamp(14px, 1.3vw, 24px); }
  .join-t .url b { overflow-wrap: anywhere; }
  .pin { font-size: clamp(26px, min(3.2vw, 7dvh), 72px); }
}
[data-bal] .brow { border: 2.5px solid var(--ol); box-shadow: 0 4px 0 var(--ol); }
