/* Каркас один на все темы. Тема (themes/<имя>/theme.css) задаёт только переменные. */
:root {
  --bg:#ffffff; --ink:#1b2130; --accent:#096eff; --on-accent:#ffffff; --card:#f1f4f9; --track:#e3e8f0;
  --ok:#096eff; --alarm:#d8333b; --alarm-ink:#d8333b; --head:Arial,sans-serif; --body:Arial,sans-serif; --head-weight:800;
  --q-size:50px; --pq-size:23px; --r:12px; --logo-h:40px; --sheet:#ffffff; --sheet-ink:#1b2130;
}
* { box-sizing:border-box; margin:0; padding:0; -webkit-tap-highlight-color:transparent; }
html, body { height:100%; }
body { background:#0c0d10; color:var(--ink); font-family:var(--body); overflow:hidden; }
button { font:inherit; color:inherit; border:0; background:none; cursor:pointer; }
.hidden { display:none !important; }
.hd { font-family:var(--head); font-weight:var(--head-weight); }

/* ================= большой экран (рисуется 1280×720 и растягивается под окно) ================= */
#stage { position:absolute; left:0; top:0; width:1280px; height:720px; transform-origin:0 0; overflow:hidden;
  background:var(--bg); background-size:cover; background-position:center; }
.logo { position:absolute; left:64px; top:46px; height:var(--logo-h); display:flex; align-items:center; font-family:var(--head); font-weight:var(--head-weight); font-size:24px; }
.logo img { height:100%; }
.topr { position:absolute; right:64px; top:52px; font-size:20px; opacity:.85; }
.view { position:absolute; inset:0; opacity:0; visibility:hidden; transition:opacity .35s ease; }
.view.on { opacity:1; visibility:visible; }

.bar { position:absolute; left:64px; right:64px; top:110px; height:4px; border-radius:4px; background:var(--track); overflow:hidden; }
.bar i { display:block; height:100%; width:100%; border-radius:4px; background:var(--accent); transform-origin:0 50%; }
.sec { position:absolute; right:64px; top:124px; font-size:18px; opacity:.85; }
.qwrap { position:absolute; left:64px; right:64px; top:166px; display:flex; flex-direction:column; gap:40px; }
.qtext { max-width:1040px; font-family:var(--head); font-weight:var(--head-weight); font-size:var(--q-size); line-height:1.15; }
.opts { display:grid; grid-template-columns:1fr 1fr; gap:14px 20px; }
.o { min-height:78px; border-radius:var(--r); background:var(--card); display:flex; align-items:center; gap:18px; padding:10px 24px; font-size:24px; font-weight:500; line-height:1.2;
  border:2px solid transparent; transition:opacity .3s, border-color .3s, background .3s; }
.o b { width:46px; height:46px; border-radius:50%; border:2px solid var(--accent); display:grid; place-items:center; font-family:var(--head); font-weight:var(--head-weight); font-size:21px; flex:none; }
.o.small { font-size:20px; }
.o.right { border-color:var(--accent); } .o.right b { background:var(--accent); color:var(--on-accent); }
.o.dim { opacity:.45; }
.teams { position:absolute; left:64px; right:300px; bottom:40px; display:flex; flex-wrap:wrap; gap:8px 30px; font-size:19px; }
.t { display:flex; align-items:center; gap:10px; opacity:.6; transition:opacity .3s, color .3s; }
.t i { width:10px; height:10px; border-radius:50%; border:2px solid currentColor; transition:background .3s; }
.t.ok { opacity:1; } .t.ok i { background:var(--ok); border-color:var(--ok); }
.t.away { opacity:1; color:var(--alarm-ink); } .t.away i { background:var(--alarm-ink); border-color:var(--alarm-ink); }
.t.off { opacity:.35; }
.count { position:absolute; right:64px; bottom:40px; font-size:19px; }
.toasts { position:absolute; left:0; right:0; bottom:96px; display:flex; flex-direction:column; align-items:center; gap:10px; pointer-events:none; }
.toast { background:var(--alarm); color:#fff; border-radius:12px; padding:16px 26px; font-size:21px; font-weight:700; box-shadow:0 12px 30px rgba(0,0,0,.25);
  animation:toastIn .35s ease both; }
@keyframes toastIn { from { opacity:0; transform:translateY(16px); } to { opacity:1; transform:none; } }
.closed-note { position:absolute; left:64px; bottom:96px; font-size:22px; font-weight:700; }

/* лобби */
.lobby-h { position:absolute; left:64px; top:150px; width:700px; font-family:var(--head); font-weight:var(--head-weight); font-size:64px; line-height:1.08; }
.lobby-p { position:absolute; left:64px; top:330px; width:620px; font-size:24px; line-height:1.4; opacity:.9; }
.lobby-code { position:absolute; left:64px; top:440px; font-family:var(--head); font-weight:var(--head-weight); font-size:84px; letter-spacing:10px; color:var(--accent); }
.qr { position:absolute; right:64px; top:130px; width:340px; height:340px; background:#fff; border-radius:20px; padding:18px; }
.qr img { width:100%; height:100%; display:block; }

/* заставка раунда, перерыв */
.big-k { position:absolute; left:64px; top:210px; font-size:26px; opacity:.85; }
.big-h { position:absolute; left:64px; top:256px; width:1100px; font-family:var(--head); font-weight:var(--head-weight); font-size:84px; line-height:1.05; }
.big-p { position:absolute; left:64px; top:470px; width:900px; font-size:28px; line-height:1.4; opacity:.9; }

/* разбор ответа */
.rv-q { position:absolute; left:64px; top:150px; width:1150px; font-size:26px; line-height:1.3; opacity:.85; }
.rv-a { position:absolute; left:64px; top:250px; right:64px; border-radius:var(--r); background:var(--accent); color:var(--on-accent); display:flex; align-items:center; gap:22px; padding:22px 28px;
  font-family:var(--head); font-weight:var(--head-weight); font-size:36px; line-height:1.15; }
.rv-a b { width:62px; height:62px; border-radius:50%; background:var(--on-accent); color:var(--accent); display:grid; place-items:center; flex:none; font-size:28px; }
.rv-f { position:absolute; left:64px; top:400px; width:640px; font-size:24px; line-height:1.45; }
.rv-f.wide { width:1150px; }
.rv-img { position:absolute; right:64px; top:396px; width:440px; height:230px; border-radius:var(--r); object-fit:cover; }
.rv-cap { position:absolute; right:64px; top:632px; width:440px; font-size:14px; opacity:.7; }
.rv-who { position:absolute; left:64px; bottom:40px; right:64px; font-size:19px; display:flex; gap:10px 26px; flex-wrap:wrap; }

/* таблица */
.rows { position:absolute; left:64px; right:64px; top:150px; display:flex; flex-direction:column; gap:10px; }
.rw { display:grid; grid-template-columns:54px 260px 1fr 80px; align-items:center; gap:16px; height:56px; font-size:24px; }
.rw .pl { font-family:var(--head); font-weight:var(--head-weight); opacity:.7; }
.rw .nm small { display:block; font-size:13px; color:var(--alarm-ink); }
.rw .tr { height:100%; border-radius:10px; background:var(--card); overflow:hidden; }
.rw .br { height:100%; border-radius:10px; background:var(--accent); opacity:.55; transform-origin:0 50%; transition:transform 1s cubic-bezier(.2,.7,.2,1); }
.rw.lead .br { opacity:1; }
.rw .sc { font-family:var(--head); font-weight:var(--head-weight); font-size:30px; text-align:right; }
.gate { position:fixed; inset:0; background:#0c0d10; color:#fff; display:grid; place-items:center; z-index:50; font-family:Arial,sans-serif; text-align:center; }
.gate button { background:#fff; color:#0c0d10; border-radius:14px; padding:20px 36px; font-size:22px; font-weight:700; }
.gate p { margin-top:16px; opacity:.7; font-size:15px; }

/* ================= телефон капитана ================= */
body.phone, body.host { overflow:auto; background:var(--bg); background-size:cover; background-position:center; background-attachment:fixed; }
.pwrap { min-height:100%; max-width:480px; margin:0 auto; padding:calc(18px + env(safe-area-inset-top)) 18px calc(20px + env(safe-area-inset-bottom)); display:flex; flex-direction:column; }
.ptop { display:flex; justify-content:space-between; align-items:center; font-size:16px; opacity:.9; min-height:28px; }
.ptop .plogo { height:26px; display:flex; align-items:center; font-family:var(--head); font-weight:var(--head-weight); } .ptop .plogo img { height:100%; }
.pbar { height:4px; border-radius:4px; background:var(--track); margin-top:12px; overflow:hidden; } .pbar i { display:block; height:100%; background:var(--accent); transform-origin:0 50%; }
.pq { font-family:var(--head); font-weight:var(--head-weight); font-size:var(--pq-size); line-height:1.22; margin:20px 0 18px; }
.po { width:100%; text-align:left; min-height:62px; border-radius:var(--r); background:var(--card); display:flex; align-items:center; gap:14px; padding:10px 16px; font-size:18px; font-weight:500; line-height:1.25;
  margin-bottom:10px; border:2px solid transparent; }
.po b { width:38px; height:38px; border-radius:50%; border:2px solid var(--accent); display:grid; place-items:center; font-family:var(--head); font-weight:var(--head-weight); font-size:17px; flex:none; }
.po.sel { border-color:var(--accent); } .po.sel b { background:var(--accent); color:var(--on-accent); }
.po.dim { opacity:.45; }
.btn { width:100%; min-height:58px; border-radius:var(--r); background:var(--accent); color:var(--on-accent); display:grid; place-items:center; font-weight:700; font-size:19px; padding:10px 16px; }
.btn.ghost { background:transparent; color:inherit; border:2px solid var(--track); }
.btn:disabled { opacity:.5; }
.field { width:100%; height:60px; border-radius:var(--r); border:2px solid var(--accent); background:var(--card); color:var(--ink); padding:0 16px; font:inherit; font-size:21px; font-weight:700; outline:none; }
.ph-h { font-family:var(--head); font-weight:var(--head-weight); font-size:34px; line-height:1.12; }
.ph-p { font-size:17px; line-height:1.45; opacity:.9; margin-top:12px; }
.center { margin:auto 0; text-align:center; }
.okc { width:120px; height:120px; border-radius:50%; background:var(--ok); color:var(--on-accent); display:grid; place-items:center; margin:0 auto 22px; font-size:60px; font-weight:800; }
.err { color:var(--alarm-ink); font-weight:700; margin-top:12px; min-height:22px; }
.sheet-bg { position:fixed; inset:0; background:rgba(0,0,0,.45); z-index:20; }
.sheet { position:fixed; left:0; right:0; bottom:0; z-index:21; background:var(--sheet); color:var(--sheet-ink); border-radius:24px 24px 0 0; padding:24px 18px calc(22px + env(safe-area-inset-bottom));
  display:flex; flex-direction:column; gap:10px; max-width:480px; margin:0 auto; animation:sheetUp .25s ease both; }
@keyframes sheetUp { from { transform:translateY(100%); } to { transform:none; } }
.sheet h3 { font-size:24px; } .sheet p { font-size:16px; line-height:1.4; opacity:.8; margin-bottom:6px; }
.sheet .btn.ghost { border-color:rgba(0,0,0,.15); color:var(--sheet-ink); }
.redscr { position:fixed; inset:0; z-index:40; background:var(--alarm); color:#fff; display:flex; flex-direction:column; padding:calc(40px + env(safe-area-inset-top)) 22px calc(24px + env(safe-area-inset-bottom)); text-align:center; }
.redscr h2 { font-size:32px; line-height:1.15; margin-top:auto; } .redscr p { font-size:18px; line-height:1.45; margin-top:14px; }
.redscr .pill { margin:18px auto auto; background:#fff; color:var(--alarm); border-radius:999px; padding:10px 22px; font-weight:800; font-size:20px; }
.redscr .btn { background:#fff; color:var(--alarm); }
.offline { position:fixed; left:0; right:0; top:0; z-index:45; background:#222; color:#fff; text-align:center; font-size:14px; padding:calc(6px + env(safe-area-inset-top)) 8px 6px; }
.place { font-family:var(--head); font-weight:var(--head-weight); font-size:120px; line-height:1; color:var(--accent); }

/* ================= пульт ведущего ================= */
body.host { background:linear-gradient(var(--host-veil, rgba(0,0,0,0)), var(--host-veil, rgba(0,0,0,0))), var(--bg); background-size:cover; background-position:center; background-attachment:fixed; }
.hrow { display:flex; justify-content:space-between; align-items:baseline; font-size:15px; opacity:.9; gap:10px; }
.hrow b { font-weight:700; }
.conn { display:inline-flex; align-items:center; gap:7px; font-size:13px; } .conn i { width:8px; height:8px; border-radius:50%; background:var(--ok); } .conn.off i { background:var(--alarm-ink); }
.hq { font-family:var(--head); font-weight:var(--head-weight); font-size:20px; line-height:1.22; margin:12px 0; }
.hright { display:flex; align-items:center; gap:10px; font-size:15px; background:var(--card); border-radius:12px; padding:10px 12px; }
.hright i { width:30px; height:30px; border-radius:50%; background:var(--accent); color:var(--on-accent); display:grid; place-items:center; font-style:normal; font-family:var(--head); font-weight:var(--head-weight); font-size:14px; flex:none; }
.htimer { display:flex; align-items:center; gap:12px; margin:12px 0; } .htimer .pbar { flex:1; margin:0; height:6px; } .htimer b { font-family:var(--head); font-weight:var(--head-weight); font-size:22px; min-width:44px; text-align:right; }
.hlist { background:var(--card); border-radius:16px; padding:2px 14px; }
.htr { display:grid; grid-template-columns:12px 1fr auto; align-items:center; gap:10px; min-height:44px; font-size:16px; border-bottom:1px solid var(--track); }
.htr:last-child { border:0; }
.htr .d { width:10px; height:10px; border-radius:50%; border:2px solid currentColor; opacity:.6; }
.htr.ok .d { background:var(--ok); border-color:var(--ok); opacity:1; }
.htr.away { color:var(--alarm-ink); } .htr.away .d { background:var(--alarm-ink); border-color:var(--alarm-ink); opacity:1; }
.htr.offl { opacity:.5; }
.htr .a { font-family:var(--head); font-weight:var(--head-weight); font-size:15px; min-width:28px; height:26px; border-radius:7px; display:grid; place-items:center; padding:0 6px; background:var(--track); }
.htr .a.g { background:var(--accent); color:var(--on-accent); }
.htr .w { font-size:13px; opacity:.7; }
.htr .sc { font-family:var(--head); font-weight:var(--head-weight); font-size:19px; }
.hbtns { display:grid; grid-template-columns:1fr 1fr; gap:10px; margin-top:16px; }
.hb { min-height:54px; border-radius:14px; background:var(--card); display:grid; place-items:center; font-weight:700; font-size:16px; padding:8px; text-align:center; }
.hb.main { grid-column:1 / -1; min-height:62px; background:var(--accent); color:var(--on-accent); font-size:18px; }
.hb:disabled { opacity:.4; }
.alert { background:#fff; color:#2a2230; border-radius:16px; padding:14px 16px; margin:12px 0; }
.alert h2 { font-size:17px; color:#c22a46; } .alert p { font-size:14px; line-height:1.45; margin-top:4px; }
.alert .act { display:flex; gap:8px; margin-top:12px; }
.alert .act button { flex:1; min-height:42px; border-radius:10px; font-weight:700; font-size:15px; }
.alert .act .k { background:#c22a46; color:#fff; } .alert .act .f { background:#ece8f1; color:#2a2230; }
.hlog { font-size:13px; line-height:1.6; opacity:.8; margin-top:14px; }
.hmenu { margin-top:18px; font-size:14px; opacity:.85; display:flex; flex-wrap:wrap; gap:8px 18px; }
.hmenu a, .hmenu button { color:inherit; text-decoration:underline; font-size:14px; }
