body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; overscroll-behavior: none; }
body { display: flex; flex-direction: column; min-height: 100dvh; }
#app { flex: 1; min-height: 0; width: 100%; max-width: 560px; align-self: center; display: flex; flex-direction: column; padding: max(16px, env(safe-area-inset-top)) 16px 12px; gap: 14px; position: relative; z-index: 1; }
.bar { display: flex; align-items: center; justify-content: space-between; font-weight: 800; font-size: 15px; gap: 8px; }
.av { width: 30px; height: 30px; border-radius: 50%; color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 900; font-size: 14px; flex: none; }
.who { display: flex; align-items: center; gap: 8px; }
.center { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; text-align: center; }
.big { font-size: 34px; font-weight: 900; line-height: 1.15; margin: 0; }
.sub { font-size: 18px; color: var(--muted); font-weight: 700; margin: 0; }
.panel { background: var(--card); border-radius: 22px; padding: 22px; box-shadow: 0 2px 10px rgba(30,36,48,.08); display: flex; flex-direction: column; gap: 16px; width: 100%; }
.pin-in { font-size: 30px !important; font-weight: 900 !important; letter-spacing: .12em; text-align: center; }
.qtext { background: var(--card); border-radius: 16px; padding: 14px 16px; font-size: 20px; font-weight: 800; line-height: 1.3; text-align: center; }
.tbar { height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; }
.tbar i { display: block; height: 100%; background: var(--ink); transition: width .25s linear; }
.grid { flex: 1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: minmax(110px, 1fr); gap: 10px; }
.ans { border: none; border-radius: 18px; color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; font-size: 20px; font-weight: 900; padding: 10px; cursor: pointer; line-height: 1.2; text-align: center; transition: transform .08s; }
.ans:active { transform: scale(.97); }
.ans .shape { width: 48px; height: 48px; }
.ans.sel { outline: 5px solid var(--ink); outline-offset: 2px; }
.ans.off { opacity: .35; }
.send { min-height: 56px; font-size: 20px; border-radius: 14px; }
.ord { display: flex; flex-direction: column; gap: 10px; }
.oitem { display: flex; align-items: center; gap: 10px; color: #fff; border-radius: 14px; padding: 12px 12px 12px 16px; font-size: 19px; font-weight: 900; }
.oitem span { flex: 1; }
.oitem button { width: 44px; height: 44px; border-radius: 10px; border: none; background: rgba(255,255,255,.22); color: #fff; font-size: 20px; font-weight: 900; cursor: pointer; }
.numv { font-size: 64px; font-weight: 900; text-align: center; line-height: 1; }
input[type=range].slider { width: 100%; height: 44px; accent-color: var(--c0); }
.pinimg { position: relative; border-radius: 14px; overflow: hidden; background: #fff; }
.pinimg img { display: block; width: 100%; }
.pinimg .mk { position: absolute; width: 26px; height: 26px; margin: -13px 0 0 -13px; border-radius: 50%; background: var(--c1); border: 4px solid #fff; box-shadow: 0 1px 5px rgba(0,0,0,.4); }
.res { margin: -16px; margin-top: 0; padding: 24px 16px; flex: 1; display: flex; flex-direction: column; color: #fff; border-radius: 0; }
.res.ok { background: var(--ok); } .res.no { background: var(--bad); } .res.none { background: #5B6270; } .res.poll { background: var(--c0); }
.res .center { color: #fff; }
.res .circle { width: 110px; height: 110px; border-radius: 50%; background: #fff; display: flex; align-items: center; justify-content: center; font-size: 60px; font-weight: 900; }
.res .pts { font-size: 30px; font-weight: 900; background: rgba(0,0,0,.2); border-radius: 12px; padding: 2px 18px; }
.res .box { background: rgba(0,0,0,.2); border-radius: 16px; padding: 14px; text-align: center; font-size: 18px; font-weight: 800; }
.stat2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; width: 100%; }
.stat2 div { background: var(--card); border-radius: 16px; padding: 14px; display: flex; flex-direction: column; }
.stat2 b { font-size: 30px; font-weight: 900; }
.lock { background: var(--card); border-radius: 16px; padding: 14px 16px; display: flex; gap: 12px; align-items: flex-start; font-size: 15px; font-weight: 700; color: var(--muted); text-align: left; }
.teams { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; }
.teams button { min-height: 60px; border-radius: 14px; border: 4px solid transparent; color: #fff; font-size: 18px; font-weight: 900; cursor: pointer; }
.teams button.sel { border-color: var(--ink); }
.mark { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; opacity: .06; font-weight: 800; font-size: 15px; color: var(--ink); line-height: 46px; transform: rotate(-24deg) scale(1.5); white-space: pre; display: none; }
.mark.on { display: block; }
.err { color: var(--bad); font-weight: 800; }

.pfoot { position: relative; z-index: 2; display: flex; justify-content: center; padding: 6px 12px max(12px, env(safe-area-inset-bottom)); }
.res + .pfoot, body:has(.res) .pfoot { background: transparent; }

.qpic { align-self: center; display: flex; justify-content: center; border-radius: 12px; overflow: hidden; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.1); max-width: 100%; }
.qpic img { display: block; max-height: 19vh; max-width: 100%; object-fit: contain; }
.qpic.small img { max-height: 14vh; }
.zoombox .qpic, .zoombox .qpic.small { background: none; box-shadow: none; border-radius: 0; }
.zoombox .qpic img, .zoombox .qpic.small img { width: 96vw; height: 92vh; max-width: 96vw; max-height: 92vh; object-fit: contain; background: none; border-radius: 0; }

/* Students draw */
.dp { position: fixed; inset: 0; z-index: 60; background: var(--bg); display: flex; flex-direction: column; padding: 8px 10px 10px; gap: 8px; box-sizing: border-box; }
.dpbar { display: flex; align-items: center; gap: 8px; flex: none; }
.dpbar .who { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; }
.dpbar .who i { width: 14px; height: 14px; border-radius: 50%; display: block; }
.dpbar .rot { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 800; color: #fff; background: #3F5266; border-radius: 999px; padding: 6px 10px; line-height: 1.15; }
.dpbar .btn.small { min-height: 38px; padding: 0 12px; }
.dpage { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 8px; }
.dq { flex: none; background: var(--card); border-radius: 12px; padding: 8px 12px; text-align: center; font-weight: 800; font-size: clamp(15px, 4.2vmin, 26px); }
.dpic { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; }
.dpic img { max-width: 100%; max-height: 100%; display: block; border-radius: 10px; background: #fff; }
.dopts { flex: none; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.dopt { display: flex; align-items: center; gap: 8px; border-radius: 10px; padding: 8px 10px; color: #fff; font-weight: 800; font-size: clamp(13px, 3.4vmin, 20px); }
.dopt svg { width: 18px; height: 18px; flex: none; }
.dcv { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; }
.backdraw { position: fixed; right: 12px; bottom: 70px; z-index: 50; width: auto !important; padding: 0 16px; }
@media (orientation: landscape) { .dpbar .rot { display: none; } .dopts { grid-template-columns: repeat(4, minmax(0, 1fr)); } .dp { padding: 6px 12px 8px; } }

/* screenshot guard */
.mark.top { z-index: 1000; opacity: .08; }
.shield { position: fixed; inset: 0; z-index: 2000; background: var(--bg, #F7F5F0); display: none; align-items: center; justify-content: center; text-align: center; }
.shield.on { display: flex; }
.shield div { display: flex; flex-direction: column; gap: 6px; color: var(--ink, #1E2430); }
.shield b { font-size: 26px; } .shield span { color: var(--muted, #666); font-weight: 700; }
img { -webkit-user-drag: none; pointer-events: auto; }

.tjklink { color: inherit; font-weight: 800; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Calm designs A–O: phone layouts ---------- */
.ans .tx { display: block; }
/* rows: one answer per line (B Stone & Ink, G Harbor Mist, M Side Panel, O Museum) when answers have words */
:is([data-d=rows], [data-d=pills], [data-d=panel], [data-d=frame], [data-d=ticket]) .grid.lab { grid-template-columns: minmax(0, 1fr); grid-auto-rows: minmax(64px, 1fr); }
:is([data-d=rows], [data-d=pills], [data-d=panel], [data-d=frame], [data-d=ticket]) .grid.lab .ans { flex-direction: row; justify-content: flex-start; text-align: left; padding: 10px 16px; gap: 14px; }
[data-design=stone] .grid.nolab .ans .ln { width: 64px; height: 64px; font-size: 28px; }
[data-design=harbor] .ans .ln { width: 44px; height: 44px; font-size: 20px; }
[data-design=harbor] .grid.nolab .ans .ln { width: 64px; height: 64px; font-size: 28px; }
[data-design=ticket] .ans { padding: 0 14px 0 0 !important; gap: 14px; }
[data-design=ticket] .ans .lt { width: 64px; font-size: 26px; }
[data-design=ticket] .grid.nolab .ans { flex-direction: row; }
[data-design=ticket] .grid.nolab .ans .lt { width: 40%; font-size: 40px; }
[data-design=museum] .ans .lt { width: 34px; height: 34px; font-size: 16px; }
[data-design=museum] .grid.nolab .ans .lt { width: 60px; height: 60px; font-size: 28px; }
/* F Gallery: answers as slim bars under a bigger picture */
[data-d=gallery] .qpic img { max-height: 28vh; }
/* J Round Table */
[data-d=circles] .grid { grid-auto-rows: auto; align-content: center; justify-items: center; }
[data-d=circles] .ans { width: min(100%, 40vw, 24dvh); padding: 14%; font-size: 16px; }
/* M Side Panel: dark question block */
[data-d=panel] .qtext { border-radius: 14px; text-align: left; }
[data-d=lines] .qtext { font-size: 24px; }
[data-design=chalk] .qtext { font-size: 24px; }
.bar .who .av.hasav { width: 34px; height: 34px; }
