/* Пульс зала — токены и стили всех страниц.
   Главная и телефон участника — светлая или тёмная тема по системе; экран зала — всегда тёмный (проектор). */
:root{
  --bg:#EDF0F3; --surface:#FFFFFF; --sunk:#F3F5F7; --ink:#14212B; --muted:#5A6A77; --line:#D6DDE3;
  --accent:#B8344A; --accent-soft:#F7E4E7; --on-accent:#FFFFFF;
  --stage:#0F1A22; --stage-2:#172530; --stage-ink:#EAF1F6; --stage-muted:#8DA1B1; --track:#1A2833; --fill:#34505F; --lead:#E0566B; --paper:#FFFFFF;
  --f-display:"Geologica","Golos Text",system-ui,sans-serif;
  --f-body:"Golos Text",system-ui,-apple-system,"Segoe UI",sans-serif;
  color-scheme:light;
}
@media (prefers-color-scheme:dark){:root{
  --bg:#0A1015; --surface:#131C24; --sunk:#0F171E; --ink:#E5ECF1; --muted:#8C9DAB; --line:#25323D;
  --accent:#E0566B; --accent-soft:#3A1E25; color-scheme:dark}}
*{box-sizing:border-box}
[hidden]{display:none!important}
html{-webkit-text-size-adjust:100%}
body{margin:0;background:var(--bg);color:var(--ink);font:15px/1.45 var(--f-body)}
button{font-family:inherit}
:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.ico{width:1.1em;height:1.1em;flex:none}
.brand{display:inline-flex;align-items:center;gap:6px;font:600 16px var(--f-display);color:var(--ink)}
.brand .ico{color:var(--accent)}
.muted{color:var(--muted)}
.eyebrow{font-size:12px;letter-spacing:.06em;text-transform:uppercase;color:var(--accent);font-weight:600}
.qr{background:var(--paper);display:block}
.qr svg{display:block;width:100%;height:auto}
.offline{position:fixed;left:50%;bottom:calc(env(safe-area-inset-bottom,0px) + 96px);translate:-50% 0;z-index:9;background:var(--ink);color:var(--surface);font-size:13px;padding:8px 14px;border-radius:99px;white-space:nowrap}
@keyframes rise{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:none}}
@keyframes pop{from{transform:scale(.85);opacity:0}to{transform:none;opacity:1}}

/* ---------- главная (/) */
.home{max-width:1000px;margin:0 auto;padding:32px max(20px,env(safe-area-inset-right)) 56px max(20px,env(safe-area-inset-left));display:grid;gap:28px}
.home-head{display:grid;gap:10px}
.home h1{font:600 clamp(28px,4.4vw,44px)/1.08 var(--f-display);margin:6px 0 0;text-wrap:balance;letter-spacing:-.01em}
.home-head p{margin:0;max-width:62ch;color:var(--muted);font-size:16px}
.links{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,400px),1fr));gap:16px}
.link-card{background:var(--surface);border:1px solid var(--line);border-radius:18px;padding:22px;display:grid;grid-template-columns:minmax(0,1fr) auto;gap:16px 20px;align-items:start}
.link-card h2{font:600 22px/1.2 var(--f-display);margin:0}
.link-card p{margin:6px 0 0;color:var(--muted)}
.link-card .qr{width:118px;padding:8px;border-radius:12px;border:1px solid var(--line)}
.link-row{grid-column:1/-1;display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:46px;padding:0 18px;border-radius:12px;border:1px solid var(--line);background:var(--sunk);color:var(--ink);font-size:15px;font-weight:600;text-decoration:none;cursor:pointer}
.btn.primary{background:var(--accent);border-color:var(--accent);color:var(--on-accent)}
.url{font:500 14px var(--f-body);color:var(--muted);overflow-wrap:anywhere}
.steps{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,260px),1fr));gap:12px;counter-reset:step}
.steps li{counter-increment:step;background:var(--surface);border:1px solid var(--line);border-radius:14px;padding:16px 18px;display:grid;grid-template-columns:auto 1fr;gap:12px;align-items:start}
.steps li::before{content:counter(step);width:28px;height:28px;border-radius:50%;display:grid;place-items:center;background:var(--accent-soft);color:var(--accent);font:600 14px var(--f-display)}
.home-note{margin:0;color:var(--muted);font-size:14px}
.home-note a{color:inherit}
.home h3{font:600 18px var(--f-display);margin:0}

/* ---------- телефон участника (/vote) */
.phone-page{background:var(--surface)}
.phone{min-height:100vh;min-height:100dvh;max-width:560px;margin:0 auto;display:flex;flex-direction:column;background:var(--surface)}
.ph-top{position:sticky;top:0;z-index:2;background:var(--surface);padding:calc(env(safe-area-inset-top,0px) + 14px) 20px 12px;display:flex;justify-content:space-between;align-items:center;font-size:14px;color:var(--muted);border-bottom:1px solid var(--line)}
.ph-form{flex:1;display:flex;flex-direction:column}
.ph-body{flex:1;padding:20px 20px 24px;display:flex;flex-direction:column;gap:11px;animation:rise .35s cubic-bezier(.2,.8,.2,1)}
.ph-body h1{font:600 21px/1.28 var(--f-display);margin:0;text-wrap:balance}
.ph-center{flex:1;display:flex;flex-direction:column;justify-content:center;align-items:center;text-align:center;gap:10px;padding:32px 28px;animation:rise .35s cubic-bezier(.2,.8,.2,1)}
.ph-center h1{font:600 26px/1.2 var(--f-display);margin:4px 0 0;text-wrap:balance}
.ph-center p{margin:0;font-size:16px}
.ph-center .muted{font-size:15px}
.hint{margin:0 0 4px;font-size:14px;color:var(--muted)}
.opts{display:flex;flex-direction:column;gap:8px}
.opt{position:relative;display:grid;grid-template-columns:22px minmax(0,1fr);gap:12px;align-items:start;min-height:48px;padding:12px 14px;border:1px solid var(--line);border-radius:14px;cursor:pointer;font-size:15px;line-height:1.35;transition:background-color .15s,border-color .15s}
.opt input{position:absolute;opacity:0;pointer-events:none}
.opt:has(input:focus-visible){outline:2px solid var(--accent);outline-offset:1px}
.box{width:22px;height:22px;border-radius:7px;border:1.5px solid var(--muted);display:grid;place-items:center}
.opt:has(input:checked){border-color:var(--accent);background:var(--accent-soft)}
.opt:has(input:checked) .box{background:var(--accent);border-color:var(--accent)}
.opt:has(input:checked) .box::after{content:"";width:10px;height:5px;border-left:2px solid var(--on-accent);border-bottom:2px solid var(--on-accent);transform:translateY(-1px) rotate(-45deg)}
.other{width:100%;min-height:64px;resize:none;border:1px solid var(--accent);border-radius:14px;padding:12px 14px;font:16px/1.35 var(--f-body);background:var(--surface);color:var(--ink)}
.ph-foot{position:sticky;bottom:0;background:var(--surface);padding:12px 20px calc(env(safe-area-inset-bottom,0px) + 16px);border-top:1px solid var(--line)}
.send{width:100%;height:54px;border-radius:16px;border:0;background:var(--accent);color:var(--on-accent);font-size:16px;font-weight:600;cursor:pointer}
.send:disabled{background:var(--sunk);color:var(--muted);cursor:default}
.err{margin:0 0 10px;color:var(--accent);font-size:14px;text-align:center}
.okb{width:56px;height:56px;border-radius:50%;display:grid;place-items:center;background:var(--accent-soft);color:var(--accent);animation:pop .4s cubic-bezier(.2,.9,.3,1.3)}
.okb .ico{width:28px;height:28px}
.joined b{color:var(--ink);font:600 16px var(--f-display);font-variant-numeric:tabular-nums}
.sent{display:flex;gap:12px;align-items:center;padding:12px 14px;border-radius:14px;background:var(--accent-soft)}
.sent .okb{width:40px;height:40px;flex:none}
.sent .okb .ico{width:20px;height:20px}
.sent-t b{display:block;font:600 17px var(--f-display)}
.sent-t span{display:block;font-size:14px;color:var(--muted)}
.mres{list-style:none;margin:4px 0 0;padding:0;display:grid;gap:12px}
.mres li>div{display:flex;justify-content:space-between;gap:10px;font-size:14.5px;line-height:1.3}
.mres b{font:600 14.5px var(--f-display);font-variant-numeric:tabular-nums}
.mres .tr{display:block;height:6px;border-radius:9px;background:var(--sunk);margin-top:5px;overflow:hidden}
.mres .fl{display:block;height:100%;width:0;border-radius:inherit;background:var(--muted);opacity:.45;transition:width .7s cubic-bezier(.2,.8,.2,1)}
.mres .me .lbl{color:var(--accent);font-weight:600}
.mres .me .fl{background:var(--accent);opacity:1}

/* ---------- экран зала (/screen): масштаб от размера окна, всё в em */
.screen-page{background:var(--stage);color:var(--stage-ink);overflow:hidden;color-scheme:dark}
.sc{position:fixed;inset:0;font-size:min(1.45vw,2.6vh);padding:2.1em 2.4em 1.6em;display:flex;flex-direction:column;gap:1.1em;
  background:radial-gradient(110% 90% at 100% 0%,var(--stage-2) 0%,var(--stage) 62%)}
.sc-eyebrow{display:flex;align-items:center;gap:.7em;font-size:.85em;letter-spacing:.06em;text-transform:uppercase;color:var(--stage-muted)}
.logo{display:grid;place-items:center;width:2.2em;height:2.2em;border-radius:.5em;border:1px dashed var(--stage-muted);font:600 .8em var(--f-display);letter-spacing:0}
.sc-qn{margin-left:auto;font-variant-numeric:tabular-nums}
.sc h1{font:600 1.75em/1.18 var(--f-display);margin:0;text-wrap:balance;max-width:38em}
.sc-body{flex:1;min-height:0;display:grid;grid-template-columns:minmax(0,1fr) 14em;gap:2.2em}
.bars{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:.5em;min-width:0}
.bars.dense{font-size:.9em;gap:.38em}
.bar{position:relative;display:flex;align-items:center;gap:1em;padding:.55em .9em;border-radius:.5em;background:var(--track);overflow:hidden}
.fill{position:absolute;inset:0 auto 0 0;width:0;background:var(--fill);transition:width .7s cubic-bezier(.2,.8,.2,1),background-color .3s}
.bar.lead .fill{background:var(--lead)}
.lbl{position:relative;flex:1;min-width:0;line-height:1.22}
.pct{position:relative;font:600 1.15em var(--f-display);font-variant-numeric:tabular-nums;min-width:3.2ch;text-align:right}
.sc-side{display:flex;flex-direction:column;gap:1.3em;min-width:0}
.qrbox{display:flex;gap:.8em;align-items:center;font-size:.85em;color:var(--stage-muted);line-height:1.3}
.qrbox .qr{width:5.4em;flex:none;padding:.35em;border-radius:.4em}
.count b{display:block;font:700 3.4em/1 var(--f-display);font-variant-numeric:tabular-nums}
.count span{color:var(--stage-muted);font-size:.9em}
.prog{height:.32em;background:var(--track);border-radius:1em;overflow:hidden;margin-top:.6em}
.prog i{display:block;height:100%;width:0;background:var(--lead);transition:width .5s}
.others h2{margin:0 0 .5em;font-size:.8em;font-weight:500;letter-spacing:.06em;text-transform:uppercase;color:var(--stage-muted)}
.others ul{list-style:none;margin:0;padding:0;display:grid;gap:.4em}
.others li{background:var(--stage-2);border-radius:.5em;padding:.45em .7em;font-size:.88em;line-height:1.25;animation:pop .45s cubic-bezier(.2,.9,.3,1.2)}
.others .empty{color:var(--stage-muted);font-size:.85em}
.sc-foot{display:flex;justify-content:space-between;font-size:.78em;color:var(--stage-muted)}
.sc-foot .brand{font-size:1em;color:var(--stage-ink);gap:.4em}
.sc-foot .brand .ico{color:var(--lead)}
.lobby{flex:1;display:grid;grid-template-columns:auto minmax(0,1fr);gap:3em;align-items:center}
.lobby .qr{width:16em;padding:.8em;border-radius:.8em}
.lobby h1{font-size:2.5em;margin:.35em 0 .3em}
.lobby p{margin:0;color:var(--stage-muted);font-size:1.1em;max-width:30em}
.lobby p b{color:var(--stage-ink);font-weight:600}
.dots{display:grid;grid-template-columns:repeat(20,1fr);gap:.45em;max-width:27em;margin-top:2em}
.dots i{aspect-ratio:1;border-radius:50%;background:var(--track);transition:background-color .3s,transform .3s}
.dots i.on{background:var(--lead);transform:scale(1.08)}
.joined-sc{margin-top:.9em;font-size:1.05em;color:var(--stage-muted)}
.joined-sc b{color:var(--stage-ink);font:600 1.3em var(--f-display);font-variant-numeric:tabular-nums}
.final{flex:1;display:grid;place-items:center;align-content:center;gap:.8em;text-align:center}
.final .okb{width:5em;height:5em;background:var(--stage-2);color:var(--lead)}
.final .okb .ico{width:2.4em;height:2.4em}
.final h1{font-size:3em;margin:0}
.final p{margin:0;color:var(--stage-muted);font-size:1.2em}
.host{position:fixed;right:16px;bottom:64px;z-index:5;display:flex;gap:6px;align-items:center;padding:6px;border-radius:14px;background:var(--stage-2);border:1px solid var(--track);font-size:14px;transition:opacity .3s}
.host span{padding:0 10px;color:var(--stage-muted);font-variant-numeric:tabular-nums;white-space:nowrap}
.hb{min-height:40px;padding:0 14px;border-radius:10px;border:1px solid var(--track);background:var(--stage);color:var(--stage-ink);font-size:14px;font-weight:500;cursor:pointer;white-space:nowrap}
.hb:disabled{opacity:.4;cursor:default}
.hb.warn{border-color:var(--lead);color:var(--lead)}
.idle{cursor:none}
.idle .host{opacity:0;pointer-events:none}
.screen-page .offline{background:var(--stage-ink);color:var(--stage);bottom:80px}

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