:root{
  --bg:#0b0d0a; --surface:#141811; --surface-2:#1c2117; --line:rgba(255,255,255,.07);
  --fg:#f3f5ef; --muted:#a3ab98; --lime:#b2e94a; --on-lime:#11160a; --live:#ff5a4f;
  --r:18px; --ease:cubic-bezier(.2,.8,.2,1);
}
*{box-sizing:border-box}
html,body{margin:0}
body{
  min-height:100dvh; color:var(--fg); font:400 16px/1.5 Manrope,system-ui,sans-serif;
  background:radial-gradient(1200px 600px at 15% -10%, #1b2611 0%, transparent 60%), var(--bg);
  -webkit-font-smoothing:antialiased;
}
svg{width:1em;height:1em;fill:currentColor;flex:none}
.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}
button,input{font:inherit;color:inherit}
:focus-visible{outline:2px solid var(--lime);outline-offset:2px}

/* шапка */
.top{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:16px clamp(16px,3vw,32px);max-width:1440px;margin:0 auto}
.brand{display:flex;align-items:center;gap:14px;min-width:0}
.mark{display:grid;place-items:center;width:44px;height:44px;border-radius:14px;background:var(--lime);color:var(--on-lime);font-size:22px;flex:none}
.kicker{font-size:13px;color:var(--muted);font-weight:600;letter-spacing:.02em}
h1{margin:0;font-size:clamp(17px,2vw,22px);font-weight:800;line-height:1.2;letter-spacing:-.01em}
.meta{display:flex;align-items:center;gap:10px;flex:none}
.live,.viewers{display:inline-flex;align-items:center;gap:8px;height:34px;padding:0 14px;border-radius:999px;font-size:14px;font-weight:700}
.live{background:rgba(255,90,79,.14);color:#ffb3ad}
.live i{width:8px;height:8px;border-radius:50%;background:var(--live);box-shadow:0 0 0 0 rgba(255,90,79,.6);animation:pulse 1.8s infinite}
.viewers{background:var(--surface-2);color:var(--fg);font-variant-numeric:tabular-nums}
.viewers svg{color:var(--muted)}
@keyframes pulse{70%{box-shadow:0 0 0 8px rgba(255,90,79,0)}100%{box-shadow:0 0 0 0 rgba(255,90,79,0)}}

/* сетка */
.room{display:grid;grid-template-columns:minmax(0,1fr) 380px;gap:20px;padding:0 clamp(16px,3vw,32px) 24px;max-width:1440px;margin:0 auto;align-items:start}
.stage{display:flex;flex-direction:column;gap:16px;min-width:0}

/* плеер */
.player{position:relative;aspect-ratio:16/9;border-radius:var(--r);overflow:hidden;background:#000;box-shadow:0 30px 80px -30px rgba(0,0,0,.8),0 0 0 1px var(--line)}
.player video{width:100%;height:100%;display:block;object-fit:contain;background:#000}
.veil{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:14px;background:rgba(6,8,5,.72);backdrop-filter:blur(6px);font-weight:600;color:var(--fg);transition:opacity .2s var(--ease)}
.veil[hidden]{display:none}
.spin{width:36px;height:36px;border-radius:50%;border:3px solid rgba(178,233,74,.25);border-top-color:var(--lime);animation:spin .8s linear infinite}
@keyframes spin{to{transform:rotate(360deg)}}
.unmute{position:absolute;left:16px;bottom:16px;display:inline-flex;align-items:center;gap:8px;height:44px;padding:0 18px;border:0;border-radius:999px;background:var(--lime);color:var(--on-lime);font-weight:700;cursor:pointer;transition:transform .15s var(--ease)}
.unmute:active{transform:scale(.97)}
.unmute[hidden]{display:none}

/* оффер */
.offer{display:flex;align-items:center;justify-content:space-between;gap:20px;padding:20px 22px;border-radius:var(--r);background:linear-gradient(135deg,#21300f,#161c10 60%);box-shadow:inset 0 0 0 1px rgba(178,233,74,.28);animation:rise .35s var(--ease)}
.offer[hidden]{display:none}
.offer h2{margin:6px 0 4px;font-size:clamp(18px,2vw,22px);font-weight:800;line-height:1.25}
.offer p{margin:0;color:var(--muted)}
.tag{display:inline-block;padding:3px 10px;border-radius:999px;background:rgba(178,233,74,.14);color:var(--lime);font-size:13px;font-weight:700}
.cta{display:inline-flex;align-items:center;justify-content:center;min-height:52px;padding:0 26px;border-radius:14px;background:var(--lime);color:var(--on-lime);font-weight:800;text-decoration:none;white-space:nowrap;transition:transform .15s var(--ease),filter .15s}
.cta:hover{filter:brightness(1.07)}
.cta:active{transform:scale(.98)}
@keyframes rise{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:none}}

.host{display:flex;align-items:center;gap:12px;padding:12px 16px;border-radius:14px;background:var(--surface);box-shadow:inset 0 0 0 1px var(--line);color:var(--muted);font-weight:600}
.host[hidden]{display:none}
.host button{height:40px;padding:0 16px;border-radius:10px;border:0;background:var(--surface-2);font-weight:700;cursor:pointer}
.debug{margin:0;padding:12px 14px;border-radius:12px;background:#000;color:#cfe8a8;font:12px/1.5 ui-monospace,Menlo,monospace;white-space:pre-wrap;max-height:220px;overflow:auto}
.debug[hidden]{display:none}

/* чат */
.chat{display:flex;flex-direction:column;height:calc(100dvh - 100px);max-height:820px;min-height:420px;border-radius:var(--r);background:var(--surface);box-shadow:inset 0 0 0 1px var(--line);overflow:hidden;position:sticky;top:16px}
.chat-head{padding:16px 18px;font-weight:800;border-bottom:1px solid var(--line)}
.msgs{flex:1;margin:0;padding:12px 18px;list-style:none;overflow-y:auto;display:flex;flex-direction:column;gap:10px;overscroll-behavior:contain}
.msgs li{display:flex;flex-direction:column;gap:1px;font-size:15px;line-height:1.4;animation:rise .2s var(--ease)}
.msgs b{font-size:13px;font-weight:700;color:var(--muted)}
.msgs .is-host{padding:10px 12px;border-radius:12px;background:rgba(178,233,74,.1)}
.msgs .is-host b{color:var(--lime)}
.send{padding:12px;border-top:1px solid var(--line);display:flex;flex-direction:column;gap:8px}
.name-row{display:flex;flex-direction:column;gap:4px}
.name-row[hidden]{display:none}
.name-row label{font-size:13px;color:var(--muted);font-weight:600}
.send input{width:100%;height:46px;padding:0 14px;border-radius:12px;border:1px solid var(--line);background:var(--surface-2);font-size:16px}
.send input::placeholder{color:#7d8574}
.msg-row{display:flex;gap:8px}
.msg-row button{width:46px;height:46px;flex:none;display:grid;place-items:center;border:0;border-radius:12px;background:var(--lime);color:var(--on-lime);font-size:20px;cursor:pointer}

@media (max-width:960px){
  .room{grid-template-columns:1fr}
  .chat{position:static;height:60dvh;min-height:360px}
}
@media (max-width:560px){
  .top{flex-wrap:wrap}
  .offer{flex-direction:column;align-items:stretch}
  .cta{width:100%}
  .meta{width:100%}
}
@media (prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important}}
