:root { --primary: #6d5dfc; --bg: #14122b; --text: #fff; --font: system-ui, -apple-system, Segoe UI, Roboto, sans-serif; }
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--bg); color: var(--text); font-family: var(--font); line-height: 1.4; }
button { font: inherit; cursor: pointer; }
input, textarea, select { font: inherit; }
.btn { background: var(--primary); color: #fff; border: 0; border-radius: 12px; padding: .75em 1.2em; font-weight: 600; }
.btn:disabled { opacity: .45; cursor: default; }
.btn.ghost { background: transparent; color: inherit; border: 1px solid color-mix(in srgb, var(--text) 30%, transparent); }
.btn.small { padding: .4em .8em; font-size: .9em; border-radius: 8px; }
.muted { opacity: .7; }
.center { text-align: center; }
#toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 99; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { background: #222; color: #fff; padding: .7em 1.1em; border-radius: 10px; box-shadow: 0 6px 24px #0006; font-size: .95em; }
.toast.ok { background: #1e7d4f; }
.toast.bad { background: #b3261e; }

/* ---------- audience ---------- */
.aud { max-width: 560px; margin: 0 auto; padding: 18px 16px 90px; min-height: 100vh; display: flex; flex-direction: column; }
.aud header { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; opacity: .9; font-size: .9em; }
.aud header img { max-height: 32px; max-width: 120px; }
.aud h1 { font-size: 1.45em; margin: .2em 0 .8em; }
.aud .opts { display: grid; gap: 10px; }
.aud .opt { text-align: left; background: color-mix(in srgb, var(--text) 10%, transparent); color: inherit; border: 2px solid transparent; border-radius: 14px; padding: 1em 1.1em; font-size: 1.05em; }
.aud .opt.sel { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 30%, transparent); }
.aud .opt.right { border-color: #3ddc84; background: #3ddc8433; }
.aud .opt.wrong { border-color: #ff5c5c; background: #ff5c5c22; }
.aud .scale { display: flex; gap: 8px; flex-wrap: wrap; }
.aud .scale button { flex: 1 0 44px; padding: .9em 0; border-radius: 12px; border: 0; background: color-mix(in srgb, var(--text) 12%, transparent); color: inherit; font-size: 1.1em; font-weight: 600; }
.aud .scale-labels { display: flex; justify-content: space-between; font-size: .85em; opacity: .7; margin-top: 6px; }
.aud input[type=text], .aud textarea, .aud input[type=email] { width: 100%; padding: .85em 1em; border-radius: 12px; border: 1px solid color-mix(in srgb, var(--text) 25%, transparent); background: color-mix(in srgb, var(--text) 8%, transparent); color: inherit; }
.aud textarea { min-height: 96px; resize: vertical; }
.aud .row { display: flex; gap: 8px; margin-top: 10px; }
.aud .done { padding: 1.2em; border-radius: 14px; background: color-mix(in srgb, var(--primary) 22%, transparent); text-align: center; font-size: 1.1em; }
.aud .notice { padding: .7em 1em; border-radius: 10px; background: #ffb02033; }
.aud .timer { font-size: 2.2em; font-weight: 800; text-align: center; margin: .2em 0 .5em; font-variant-numeric: tabular-nums; }
.aud .q { display: flex; gap: 10px; align-items: flex-start; padding: .8em 0; border-bottom: 1px solid color-mix(in srgb, var(--text) 12%, transparent); }
.aud .q .vote { min-width: 52px; border-radius: 10px; border: 1px solid color-mix(in srgb, var(--text) 30%, transparent); background: transparent; color: inherit; padding: .35em; }
.aud .q .vote.on { background: var(--primary); border-color: var(--primary); }
.aud .field { margin-bottom: 14px; }
.aud .field label { display: block; font-size: .9em; margin-bottom: 4px; opacity: .85; }
.aud .verified { font-size: .8em; padding: .15em .6em; border-radius: 99px; background: #3ddc8433; margin-left: auto; }
.aud footer { margin-top: auto; padding-top: 24px; }
.mini-bars .bar { margin: 6px 0; }
.mini-bars .track { height: 10px; border-radius: 6px; background: color-mix(in srgb, var(--text) 12%, transparent); overflow: hidden; }
.mini-bars .fill { height: 100%; background: var(--primary); }

/* ---------- presenter: a 16:9 stage that scales to any screen ---------- */
.pres2 { position: fixed; inset: 0; background: #000; overflow: hidden; }
.pres2 .viewport { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.pres2 .canvas { position: relative; width: min(100vw, calc(100vh * 16 / 9)); aspect-ratio: 16 / 9; overflow: hidden; container-type: size; background: var(--bg); color: var(--text); }
.pres2 .bg, .pres2 .dim { position: absolute; inset: 0; background-position: center; background-repeat: no-repeat; }
.pres2 .dim { background: #000; }
.pres2 .layer { position: absolute; height: auto; pointer-events: none; }
.pres2 .content { position: absolute; inset: 0; padding: 5cqh 5cqw 7cqh; display: flex; flex-direction: column; font-size: 1.9cqw; }
.pres2 .content.withbar { padding-top: 10cqh; }
.pres2 h1 { font-size: 3.6cqw; margin: 0 0 1.2cqh; line-height: 1.15; text-shadow: 0 .15cqw .6cqw #0009; }
.pres2 .meta { opacity: .75; font-size: 1.3cqw; margin-bottom: 2cqh; text-shadow: 0 1px 4px #0008; min-height: 1em; }
.pres2 .body { font-size: 2.1cqw; white-space: pre-wrap; text-shadow: 0 1px 6px #0008; }
.pres2 .media { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; margin-top: 1cqh; }
.pres2 .media img, .pres2 .media video { max-width: 100%; max-height: 100%; border-radius: .6cqw; }
.pres2 .media iframe { width: min(100%, calc((100cqh - 22cqh) * 16 / 9)); aspect-ratio: 16 / 9; border-radius: .6cqw; }
.pres2 .res { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.pres2 .resbox { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: auto; }
.pres2 .bars { display: grid; gap: 1.6cqh; font-size: 1.8cqw; }
.pres2 .bars .lbl { display: flex; justify-content: space-between; margin-bottom: .5cqh; text-shadow: 0 1px 4px #0008; }
.pres2 .bars .track { height: 4cqh; background: color-mix(in srgb, var(--text) 14%, transparent); border-radius: 1cqh; overflow: hidden; }
.pres2 .fill { height: 100%; background: var(--primary); border-radius: 1cqh; transition: width .6s cubic-bezier(.2,.8,.2,1); }
.pres2 .bars .right .fill { background: #3ddc84; }
.pres2 .bars .right .lbl { color: #3ddc84; font-weight: 700; }
.pres2 .gtrack { display: grid; gap: .5cqh; }
.pres2 .grow { display: flex; align-items: center; gap: .8cqw; font-size: .7em; }
.pres2 .grow .fill { height: 1.8cqh; }
.pres2 .legend { display: flex; flex-wrap: wrap; gap: 1.2cqw; margin: 1cqh 0 1.6cqh; font-size: 1.3cqw; }
.pres2 .legend span::before { content: ''; display: inline-block; width: 1cqw; height: 1cqw; border-radius: .2cqw; margin-right: .5cqw; background: var(--c); }
.pres2 .pcards { display: grid; grid-template-columns: repeat(var(--n), 1fr); gap: 2.5cqw; flex: 1; min-height: 0; align-items: stretch; }
.pres2 .pcard { background: color-mix(in srgb, #000 45%, transparent); border: .3cqw solid transparent; border-radius: 1.2cqw; padding: 1.2cqw; display: flex; flex-direction: column; gap: 1cqh; min-height: 0; transition: border-color .4s, transform .4s; backdrop-filter: blur(4px); }
.pres2 .pcard img, .pres2 .pcard .noimg { flex: 1; min-height: 0; width: 100%; object-fit: contain; border-radius: .8cqw; }
.pres2 .pcard .noimg { display: flex; align-items: center; justify-content: center; font-size: 2.6cqw; font-weight: 800; background: color-mix(in srgb, var(--text) 10%, transparent); }
.pres2 .pcard.lead { border-color: var(--primary); transform: scale(1.02); box-shadow: 0 0 2.5cqw color-mix(in srgb, var(--primary) 60%, transparent); }
.pres2 .pcard.right { border-color: #3ddc84; }
.pres2 .pname { font-size: 2cqw; font-weight: 800; text-align: center; }
.pres2 .pnum { text-align: center; font-size: 1.4cqw; }
.pres2 .pnum b { font-size: 3.4cqw; font-variant-numeric: tabular-nums; }
.pres2 .ptrack { height: 1.6cqh; border-radius: 1cqh; background: color-mix(in srgb, var(--text) 15%, transparent); overflow: hidden; }
.pres2 .hiddenres { font-size: 1.8cqw; margin-bottom: 2cqh; padding: 1cqh 1.4cqw; border-radius: .8cqw; background: #0007; align-self: flex-start; }
.pres2 .cloud { display: flex; flex-wrap: wrap; gap: .2em .7em; justify-content: center; align-content: center; flex: 1; line-height: 1.1; font-size: 1.6cqw; }
.pres2 .cloud span { font-weight: 700; text-shadow: 0 1px 6px #0008; }
.pres2 .cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(22cqw, 1fr)); gap: 1.2cqw; }
.pres2 .card { background: color-mix(in srgb, var(--text) 10%, #0005); border-radius: 1cqw; padding: 1.2cqh 1.2cqw; font-size: 1.5cqw; }
.pres2 .card small { display: block; opacity: .6; margin-top: .5em; font-size: .75em; }
.pres2 .avg { font-size: 10cqw; font-weight: 800; line-height: 1; }
.pres2 .qa .item { display: flex; gap: 1.4cqw; align-items: center; padding: 1.2cqh 0; border-bottom: 1px solid color-mix(in srgb, var(--text) 14%, transparent); font-size: 2cqw; }
.pres2 .qa .votes { min-width: 6cqw; text-align: center; font-weight: 800; color: var(--primary); filter: brightness(1.4); }
.pres2 .qa .item.hidden { opacity: .35; text-decoration: line-through; }
.pres2 .lb { display: grid; gap: .8cqh; font-size: 1.8cqw; }
.pres2 .lb div { display: flex; justify-content: space-between; padding: .8cqh 1.2cqw; border-radius: .8cqw; background: color-mix(in srgb, var(--text) 10%, #0004); }
.pres2 h2 { font-size: 2.2cqw; margin: 0 0 1cqh; }
.pres2 .split { display: grid; grid-template-columns: 1.3fr 1fr; gap: 4cqw; align-items: start; }
.pres2 .countdown { font-size: 3.4cqw; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--primary); filter: brightness(1.4); margin-bottom: 1.5cqh; }
.pres2 .floats { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.pres2 .float { position: absolute; bottom: -6cqh; animation: floatup 3.2s ease-out forwards; }
@keyframes floatup { 0% { transform: translateY(0) scale(.6); opacity: 0; } 12% { opacity: 1; transform: translateY(-10cqh) scale(1); } 100% { transform: translateY(-85cqh) translateX(-4cqw); opacity: 0; } }
.pres2 .rtotals { position: absolute; right: 1.5cqw; bottom: 1.5cqh; display: flex; gap: 1.2cqw; padding: .6cqh 1.2cqw; border-radius: .8cqw; background: #000a; color: #fff; font-size: 1.3cqw; }
.pres2 .joinbar { white-space: nowrap; max-width: 96vw; position: fixed; top: 0; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 14px; padding: 6px 16px 6px 6px; background: #000c; color: #fff; border-radius: 0 0 14px 14px; font-size: clamp(12px, 1.35vw, 24px); z-index: 10; }
.pres2 .joinbar .qr { height: clamp(40px, 5vw, 80px); background: #fff; border-radius: 6px; padding: 3px; cursor: pointer; }
.pres2 .joinbar .code { font-weight: 800; letter-spacing: .06em; color: var(--primary); filter: brightness(1.5); }
.pres2 .joinbar .stat { opacity: .75; font-size: .75em; margin-left: 8px; }
.pres2 .hud { position: fixed; left: 0; right: 0; bottom: 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px 18px; background: linear-gradient(transparent, #000d); color: #fff; z-index: 10; opacity: 0; transition: opacity .3s; }
.pres2 .hud.show, .pres2 .hud:hover { opacity: 1; }
.pres2 .hud select { background: #0008; color: #fff; border: 1px solid #fff5; border-radius: 8px; padding: .35em .5em; }
.pres2 .hud select option { color: #000; }
.pres2 .hud .sp { flex: 1; }
.pres2 .hud .btn.ghost { color: #fff; border-color: #fff6; }
.pres2 .soundprompt { position: fixed; left: 18px; top: 18px; z-index: 20; }
.overlay { position: fixed; inset: 0; background: color-mix(in srgb, var(--bg) 92%, transparent); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px; z-index: 50; font-size: 2em; }
.overlay img { width: min(60vh, 80vw); background: #fff; padding: 14px; border-radius: 16px; }
/* phone extras */
.aud .opts.pics { grid-template-columns: 1fr 1fr; }
.aud .opts.pics .opt { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 10px; text-align: center; font-weight: 700; }
.aud .opts.pics .opt img { width: 100%; aspect-ratio: 1; object-fit: contain; border-radius: 10px; }
.aud .eyes { text-align: center; margin: 12vh 0 4vh; }
.aud .eyes .big { font-size: 64px; }
.aud .reacts { display: flex; justify-content: space-around; margin-top: 16px; padding: 8px; border-radius: 16px; background: color-mix(in srgb, var(--text) 8%, transparent); }
.aud .reacts button { font-size: 30px; background: none; border: 0; padding: 6px 12px; border-radius: 12px; touch-action: manipulation; }
.aud .reacts button:active { background: color-mix(in srgb, var(--text) 15%, transparent); }
.aud .reacts button.pop { animation: pop .35s ease; }
@keyframes pop { 50% { transform: scale(1.5); } }
