/* Participant phone screens. Big touch targets, one thing at a time. */
:root { --ink: #24244F; --ink-2: #4b5078; --ink-3: #8a8fb3; --blue: #3E3E7E; --pink: #E84E85; --line: #e3e6f2; --bg: #F5F6FB; --green: #1F9D6B; --red: #c62828;
  --display: "Bricolage Grotesque", Inter, system-ui, sans-serif; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; background: var(--bg); }
body { font: 16px/1.45 Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif; color: var(--ink); }
button, input, select, textarea { font: inherit; color: inherit; }
.hidden { display: none !important; }
:focus-visible { outline: 3px solid #5E6CE6; outline-offset: 2px; }

#phone { max-width: 520px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.ph-head { display: flex; align-items: center; gap: 10px; padding: 12px 18px; padding-top: max(12px, env(safe-area-inset-top)); background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.ph-head img { width: 30px; height: 30px; }
.ph-title { flex: 1; min-width: 0; }
.ph-title b { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ph-title span { font-size: 12.5px; color: var(--ink-3); }
.ph-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--green); flex: none; }
.ph-dot.off { background: #f0a202; animation: blink 1.2s infinite; }
@keyframes blink { 50% { opacity: .3; } }
.ph-body { flex: 1; padding: 22px 18px 110px; display: flex; flex-direction: column; }
.ph-body.center { justify-content: center; text-align: center; }

/* entry screens */
.entry { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 28px 22px 60px; }
.entry-logo { height: 34px; align-self: flex-start; margin-bottom: 40px; }
.entry h1 { font: 800 34px/1.1 var(--display); margin: 0 0 8px; letter-spacing: -.01em; }
.entry p { color: var(--ink-2); margin: 0 0 24px; }
.code-input { width: 100%; font: 800 44px var(--display); letter-spacing: .25em; text-align: center; border: 2px solid var(--line); border-radius: 16px; padding: 14px 6px 14px 18px; background: #fff; outline: none; font-variant-numeric: tabular-nums; }
.code-input:focus, .text-input:focus { border-color: var(--blue); box-shadow: 0 0 0 4px #e6e8fb; }
.text-input { width: 100%; border: 2px solid var(--line); border-radius: 14px; padding: 14px 16px; font-size: 18px; background: #fff; outline: none; }
textarea.text-input { resize: none; min-height: 110px; }
.big-btn { width: 100%; border: 0; border-radius: 14px; padding: 17px; font-weight: 700; font-size: 18px; background: var(--blue); color: #fff; cursor: pointer; margin-top: 14px; }
.big-btn:active { transform: scale(.99); }
.big-btn:disabled { opacity: .5; }
.big-btn.light { background: #fff; color: var(--blue); border: 2px solid var(--line); }
.msg { min-height: 22px; margin-top: 10px; font-size: 14.5px; color: var(--red); }
.fine { font-size: 12.5px; color: var(--ink-3); margin-top: 20px; }

/* question screens */
.q { font: 800 26px/1.18 var(--display); margin: 0 0 22px; letter-spacing: -.01em; }
.opts { display: flex; flex-direction: column; gap: 12px; }
.opt { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; background: #fff; border: 2px solid var(--line); border-radius: 16px; padding: 15px 16px; font-size: 17px; font-weight: 600; cursor: pointer; min-height: 64px; transition: border-color .15s, background .15s; }
.opt-key { width: 34px; height: 34px; border-radius: 10px; color: #fff; display: grid; place-items: center; font-weight: 800; flex: none; }
.opt.chosen { border-color: var(--blue); background: #eceefc; }
.opt:disabled { cursor: default; }
.opts.locked .opt:not(.chosen) { opacity: .45; }
.done-note { margin-top: 22px; display: flex; align-items: center; gap: 10px; background: #e7f6ef; color: #146c4a; border-radius: 14px; padding: 13px 16px; font-weight: 600; }
.quiz-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.quiz-tile { border: 0; border-radius: 18px; color: #fff; min-height: 120px; padding: 14px; display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; text-align: left; font-weight: 700; font-size: 16px; cursor: pointer; }
.quiz-tile svg { opacity: .9; }
.quiz-tile.chosen { box-shadow: 0 0 0 4px #fff, 0 0 0 7px var(--ink); }
.quiz-tiles.locked .quiz-tile:not(.chosen) { opacity: .3; }
.timer { height: 10px; background: #e6e8f4; border-radius: 5px; overflow: hidden; margin: -8px 0 20px; }
.timer > div { height: 100%; background: var(--blue); border-radius: 5px; transition: width .1s linear; }
.timer.low > div { background: var(--pink); }
.result { text-align: center; padding: 24px 10px; border-radius: 22px; color: #fff; margin-bottom: 18px; }
.result.right { background: var(--green); }
.result.wrong { background: #6b6f93; }
.result h2 { font: 800 40px var(--display); margin: 6px 0 2px; }
.result p { margin: 0; font-size: 17px; opacity: .95; }
.rank { background: #fff; border-radius: 18px; padding: 18px; text-align: center; border: 2px solid var(--line); }
.rank b { display: block; font: 800 46px var(--display); color: var(--blue); }
.scale-row { display: grid; gap: 8px; }
.scale-btn { border: 2px solid var(--line); background: #fff; border-radius: 14px; min-height: 58px; font: 800 22px var(--display); cursor: pointer; }
.scale-btn.chosen { background: var(--blue); color: #fff; border-color: var(--blue); }
.scale-labels { display: flex; justify-content: space-between; font-size: 13.5px; color: var(--ink-2); margin-top: 10px; gap: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.chip { background: #eceefc; color: var(--blue); border-radius: 999px; padding: 7px 14px; font-weight: 600; font-size: 15px; }
.mine { margin-top: 16px; display: flex; flex-direction: column; gap: 8px; }
.mine div { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 11px 14px; font-size: 15px; }
.counter-note { font-size: 13.5px; color: var(--ink-3); margin-top: 8px; text-align: right; }

/* waiting */
.wait { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 30px 10px; }
.wait h1 { font: 800 30px/1.15 var(--display); margin: 22px 0 8px; }
.wait p { color: var(--ink-2); margin: 0; max-width: 320px; }
.pulse { width: 92px; height: 92px; border-radius: 50%; background: #eceefc; display: grid; place-items: center; position: relative; }
.pulse img { width: 52px; }
.pulse::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 3px solid #c9cdf6; animation: ring 2.4s ease-out infinite; }
@keyframes ring { from { transform: scale(1); opacity: 1; } to { transform: scale(1.6); opacity: 0; } }

/* form */
.form-card { background: #fff; border-radius: 20px; padding: 22px 18px; border: 1px solid var(--line); }
.form-card h1 { font: 800 26px var(--display); margin: 0 0 6px; }
.form-card .intro { color: var(--ink-2); margin: 0 0 18px; font-size: 15px; }
.f-field { display: block; margin-bottom: 14px; }
.f-field > span { display: block; font-weight: 600; font-size: 14.5px; margin-bottom: 6px; }
.f-field > span i { color: var(--pink); font-style: normal; }
.f-field .text-input { font-size: 17px; padding: 12px 14px; }
select.text-input { appearance: none; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%234b5078' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 14px center; }

/* Q&A */
.qa-fab { position: fixed; right: 18px; bottom: max(18px, env(safe-area-inset-bottom)); z-index: 10; border: 0; border-radius: 999px; background: var(--pink); color: #fff; font-weight: 700; padding: 15px 22px; box-shadow: 0 8px 24px rgba(232,78,133,.35); display: flex; gap: 8px; align-items: center; cursor: pointer; }
.sheet-back { position: fixed; inset: 0; background: rgba(36,36,79,.35); z-index: 20; display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: var(--bg); width: 100%; max-width: 520px; max-height: 92dvh; border-radius: 22px 22px 0 0; display: flex; flex-direction: column; animation: up .25s ease both; }
@keyframes up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet-head { display: flex; align-items: center; padding: 16px 18px 6px; }
.sheet-head h2 { flex: 1; font: 800 22px var(--display); margin: 0; }
.x-btn { border: 0; background: #e6e8f4; border-radius: 50%; width: 38px; height: 38px; display: grid; place-items: center; cursor: pointer; }
.sheet-body { overflow-y: auto; padding: 10px 18px 26px; }
.ask-row { display: flex; flex-direction: column; gap: 0; margin-bottom: 18px; }
.ask-row textarea { min-height: 84px; }
.qa-item { display: flex; gap: 12px; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px; margin-bottom: 10px; align-items: flex-start; }
.qa-item.answered { opacity: .55; }
.vote { flex: none; border: 2px solid var(--line); background: #fff; border-radius: 12px; width: 52px; padding: 6px 0; display: flex; flex-direction: column; align-items: center; font-weight: 800; cursor: pointer; color: var(--ink-2); }
.vote.on { border-color: var(--pink); color: var(--pink); background: #fdeaf1; }
.vote:disabled { cursor: default; opacity: .6; }
.qa-text { flex: 1; font-size: 15.5px; padding-top: 4px; }
.qa-tag { display: inline-block; font-size: 12px; color: var(--ink-3); margin-top: 4px; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
