:root {
  --ink: #0f1b33;
  --ink-soft: #4a5672;
  --paper: #f6f7fb;
  --card: #ffffff;
  --line: #dfe3ee;
  --accent: #1f6feb;
  --accent-ink: #ffffff;
  --accent-soft: #e8f0fe;
  --room-bg: #0b1220;
  --room-panel: #121b2e;
  --room-line: rgba(255, 255, 255, 0.1);
  --room-text: #e8ecf5;
  --room-dim: rgba(232, 236, 245, 0.6);
  --live: #ef4444;
  --radius: 14px;
  --font: ui-sans-serif, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); color: var(--ink); background: var(--paper); line-height: 1.5; -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
a { color: var(--accent); }

.topbar { display: flex; align-items: center; justify-content: space-between; padding: 16px 24px; border-bottom: 1px solid var(--line); background: var(--card); }
.wordmark { display: inline-flex; align-items: center; text-decoration: none; }
.wordmark img { display: block; height: 28px; width: auto; }
.topbar-dark { background: var(--room-bg); border-color: var(--room-line); }
.badge { font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; padding: 5px 10px; border-radius: 999px; background: rgba(255,255,255,0.08); color: var(--room-dim); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 10px; padding: 14px 22px; font: inherit; font-weight: 700; cursor: pointer; text-decoration: none; transition: transform .12s ease, background .12s ease; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: var(--accent-ink); width: 100%; font-size: 16px; }
.btn-primary:hover { background: #1a5fd0; }
.btn-primary:disabled { opacity: .6; cursor: wait; }
.btn-ghost { background: transparent; color: inherit; border: 1px solid currentColor; }

/* ---------------------------------------------------------- registration */
.reg { max-width: 1080px; margin: 0 auto; padding: 48px 16px 32px; display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 48px; align-items: start; }
.eyebrow { margin: 0 0 12px; font-size: 13px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); }
.reg h1 { margin: 0 0 16px; font-size: clamp(30px, 4.2vw, 46px); line-height: 1.1; letter-spacing: -0.025em; }
.lede { margin: 0 0 24px; font-size: 18px; color: var(--ink-soft); }
.bullets { list-style: none; padding: 0; margin: 0 0 32px; display: grid; gap: 12px; }
.bullets li { position: relative; padding-left: 32px; font-size: 16px; }
.bullets li::before { content: '✓'; position: absolute; left: 0; top: 0; width: 22px; height: 22px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: 13px; font-weight: 800; display: grid; place-items: center; }
.host { display: flex; gap: 16px; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
.host-photo { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.host-name { margin: 0; font-weight: 800; }
.host-title { margin: 0 0 6px; color: var(--ink-soft); font-size: 14px; }
.host-bio { margin: 0; font-size: 14px; color: var(--ink-soft); }

.card { position: sticky; top: 24px; background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 28px; box-shadow: 0 12px 40px rgba(15, 27, 51, 0.08); }
.card-kicker { margin: 0; font-size: 12px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-soft); }
.card h2 { margin: 4px 0 6px; font-size: 26px; letter-spacing: -0.02em; }
.next-line { margin: 0 0 20px; color: var(--ink-soft); font-size: 14px; }
.next-line strong { color: var(--ink); font-variant-numeric: tabular-nums; }
.field { display: block; margin-bottom: 14px; }
.field span { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.field input, .field select { width: 100%; font: inherit; font-size: 16px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); }
.field input:focus, .field select:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.consent { display: flex; gap: 10px; align-items: flex-start; font-size: 12.5px; color: var(--ink-soft); margin: 4px 0 18px; }
.consent input { margin-top: 3px; }
.form-error { margin: 0 0 12px; padding: 10px 12px; border-radius: 8px; background: #fdecec; color: #a11; font-size: 14px; }
.form-ok { margin: 8px 0 0; font-weight: 700; color: #0a7a3d; }
.fine { margin: 10px 0 0; text-align: center; font-size: 12.5px; color: var(--ink-soft); }

.state { max-width: 560px; margin: 0 auto; padding: 96px 16px; text-align: center; }
.foot { text-align: center; padding: 32px 16px; font-size: 12px; color: var(--ink-soft); }

@media (max-width: 860px) {
  .reg { grid-template-columns: 1fr; gap: 28px; padding-top: 28px; }
  .card { position: static; padding: 22px; }
}
@media (max-width: 420px) { .row { grid-template-columns: 1fr; gap: 0; } }

/* ------------------------------------------------------------------ room */
.page-room { background: var(--room-bg); color: var(--room-text); }
.page-room .state { color: var(--room-text); }
.foot-dark { color: var(--room-dim); }
.room { max-width: 1280px; margin: 0 auto; padding: 24px 16px; }
.room-head h1 { margin: 0; font-size: clamp(20px, 2.6vw, 28px); letter-spacing: -0.02em; }
.room-sub { margin: 4px 0 20px; color: var(--room-dim); }

.stage-wait { text-align: center; padding: 56px 16px; border: 1px solid var(--room-line); border-radius: 18px; background: radial-gradient(ellipse at 50% 0%, rgba(31,111,235,0.18), transparent 65%), var(--room-panel); }
.wait-hello { margin: 0 0 18px; font-size: 18px; }
.wait-label { margin: 0; font-size: 12px; font-weight: 800; letter-spacing: 0.16em; text-transform: uppercase; color: var(--room-dim); }
.wait-clock { margin: 6px 0; font-size: clamp(56px, 11vw, 96px); font-weight: 800; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; line-height: 1; }
.wait-when { margin: 0 0 10px; font-weight: 600; }
.wait-note { margin: 0 0 22px; color: var(--room-dim); font-size: 14px; }

.live-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.player { position: relative; aspect-ratio: 16 / 9; background: #000; border-radius: var(--radius); overflow: hidden; }
.player video { width: 100%; height: 100%; display: block; object-fit: contain; background: #000; }
.player:fullscreen { border-radius: 0; }
.unmute { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); border: 0; border-radius: 999px; padding: 14px 22px; font: inherit; font-weight: 800; background: rgba(255,255,255,0.95); color: #000; cursor: pointer; box-shadow: 0 8px 30px rgba(0,0,0,.4); }
.player-bar { position: absolute; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; background: linear-gradient(transparent, rgba(0,0,0,.6)); pointer-events: none; }
.player-bar > * { pointer-events: auto; }
.live-dot { font-size: 12px; font-weight: 800; letter-spacing: 0.08em; color: #fff; background: var(--live); padding: 3px 8px; border-radius: 6px; }
.icon-btn { border: 0; background: rgba(0,0,0,.45); color: #fff; font: inherit; font-size: 13px; padding: 6px 10px; border-radius: 8px; cursor: pointer; }
.player-ended { position: absolute; inset: 0; display: grid; place-content: center; gap: 14px; text-align: center; background: rgba(5,10,20,.82); font-size: 18px; font-weight: 700; }
.player-ended p { margin: 0; }
.cta-wrap { margin-top: 16px; }
.btn-cta { font-size: 18px; padding: 18px 22px; animation: pop .4s ease-out; }
@keyframes pop { from { transform: scale(.96); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.chat { display: flex; flex-direction: column; height: min(70vh, 560px); border: 1px solid var(--room-line); border-radius: var(--radius); background: var(--room-panel); }
.chat-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--room-line); }
.chat-title { font-size: 12px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; }
.chat-private { font-size: 11.5px; color: var(--room-dim); }
.chat-body { flex: 1; min-height: 0; overflow-y: auto; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 92%; }
.msg-from { font-size: 11.5px; font-weight: 700; color: var(--room-dim); margin-bottom: 2px; }
.msg-text { font-size: 14px; padding: 8px 11px; border-radius: 10px; background: rgba(255,255,255,0.06); overflow-wrap: anywhere; }
.msg.from-host .msg-from { color: #8ab4ff; }
.msg.from-host .msg-text { background: rgba(31,111,235,0.2); border: 1px solid rgba(31,111,235,0.4); }
.msg.from-host a { color: #fff; font-weight: 700; }
.msg.mine { align-self: flex-end; }
.msg.mine .msg-text { background: rgba(255,255,255,0.12); }
.msg-note { font-size: 11.5px; color: var(--room-dim); margin-top: 3px; }
.msg.failed .msg-note { color: #ffb4b4; }
.chat-form { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--room-line); }
.chat-form input { flex: 1; min-width: 0; font: inherit; font-size: 15px; padding: 10px 12px; border-radius: 9px; border: 1px solid var(--room-line); background: rgba(255,255,255,0.06); color: var(--room-text); }
.chat-form input:focus { outline: 2px solid var(--accent); border-color: transparent; }
.chat-form button { border: 0; border-radius: 9px; padding: 0 16px; font: inherit; font-weight: 700; background: var(--accent); color: #fff; cursor: pointer; }

@media (max-width: 960px) {
  .live-grid { grid-template-columns: 1fr; }
  .chat { height: 380px; }
}
@media (prefers-reduced-motion: reduce) { .btn-cta { animation: none; } }
