:root {
  --brand: #1f6feb; --accent: #ffb020;
  --bg: #0b0c0f; --surface: #13151a; --surface-2: #1a1d24; --line: #262a33; --text: #eef0f4; --muted: #9aa2b1;
  --live: #ff3b30; --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --radius: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
button { font: inherit; }
[hidden] { display: none !important; }

/* top bar */
.top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 14px; padding: 10px 20px;
  background: rgba(11,12,15,.86); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; flex: none; }
.brand-logo { height: 34px; max-width: 160px; object-fit: contain; }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; background: linear-gradient(135deg, var(--brand), var(--accent)); }
.brand-logo:not([hidden]) + .brand-mark { display: none; }
.top-title { min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.top-title strong { font-size: 15px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-title span { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-status { margin-left: auto; display: flex; align-items: center; gap: 10px; flex: none; }
.pill { display: inline-flex; align-items: center; gap: 7px; height: 26px; padding: 0 11px; border-radius: 999px; font-size: 11.5px; font-weight: 800; letter-spacing: .08em; }
.pill-live { background: var(--live); color: #fff; }
.pill-live i { width: 7px; height: 7px; border-radius: 50%; background: #fff; animation: pulse 1.6s ease-in-out infinite; }
.pill-soon { background: var(--surface-2); color: var(--muted); letter-spacing: .02em; font-weight: 600; }
@keyframes pulse { 50% { opacity: .35; } }
.viewers { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.viewers b { color: var(--text); font-weight: 600; }

/* now playing */
.nowbar { display: flex; align-items: center; gap: 14px; margin-top: 14px; padding: 12px 16px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.now-tag { flex: none; padding: 4px 8px; border-radius: 6px; background: var(--live); color: #fff; font-size: 11px; font-weight: 800; letter-spacing: .1em; }
.now-t { display: grid; min-width: 0; } .now-t b { font-size: 15.5px; } .now-t span { color: var(--muted); font-size: 13px; }
.nowbar .next { margin-left: auto; display: grid; text-align: right; min-width: 0; }
.nowbar .next span { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.nowbar .next b { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 32ch; }
.agenda li.now { background: color-mix(in srgb, var(--live) 10%, transparent); border-radius: 8px; padding-left: 8px; }
.agenda li.now time::after { content: " ● LIVE"; color: var(--live); font-size: 10px; }
@media (max-width: 1080px) { .nowbar { order: 1; margin: 10px 12px 0; } .nowbar .next { display: none; } }

/* footer */
.foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; max-width: 1680px; margin: 8px auto 0; padding: 18px 20px 26px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.foot-brand { display: flex; align-items: center; gap: 8px; color: var(--text); }
.foot-brand strong { letter-spacing: .08em; }
.foot-mark { width: 18px; height: 18px; border-radius: 5px; background: linear-gradient(135deg, var(--brand), var(--accent)); }
.foot-credit b { color: var(--text); font-weight: 600; }
@media (max-width: 1080px) { .foot { padding: 16px; } }

/* layout */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 20px; padding: 20px; max-width: 1680px; margin: 0 auto; }
.primary { min-width: 0; }
.screen { position: relative; border-radius: var(--radius); overflow: hidden; background: #000; box-shadow: 0 20px 60px rgba(0,0,0,.45); }
.standby { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; overflow: hidden; }
.standby-bg { position: absolute; inset: 0; background:
  radial-gradient(1200px 600px at 20% 10%, color-mix(in srgb, var(--brand) 55%, transparent), transparent 60%),
  radial-gradient(900px 500px at 90% 100%, color-mix(in srgb, var(--accent) 35%, transparent), transparent 60%), #0d0f14;
  background-size: cover; background-position: center; }
.standby-bg.has-img::after { content: ""; position: absolute; inset: 0; background: linear-gradient(rgba(0,0,0,.35), rgba(0,0,0,.7)); }
.standby-inner { position: relative; padding: 24px; max-width: 760px; }
.standby-kicker { margin: 0 0 6px; font-size: 12.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: rgba(255,255,255,.75); }
.standby h2 { margin: 0; font-size: clamp(22px, 3.6vw, 44px); line-height: 1.1; font-weight: 800; letter-spacing: -.02em; }
.countdown { display: flex; justify-content: center; gap: clamp(8px, 2vw, 18px); margin: clamp(14px, 3vw, 28px) 0 8px; }
.countdown div { min-width: clamp(56px, 8vw, 92px); padding: 10px 6px 8px; border-radius: 12px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12); backdrop-filter: blur(6px); }
.countdown b { display: block; font-size: clamp(22px, 3.8vw, 42px); font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.1; }
.countdown span { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: rgba(255,255,255,.7); }
.standby-when { margin: 10px 0 0; color: rgba(255,255,255,.85); font-weight: 500; }
.standby-note { margin: 6px 0 0; font-size: 12.5px; color: rgba(255,255,255,.55); }
.screen.is-live .standby { display: none; }

.about { padding: 22px 4px 8px; }
.about h1 { margin: 0; font-size: 24px; line-height: 1.25; letter-spacing: -.01em; }
.about-sub { margin: 4px 0 14px; color: var(--muted); }
.about-desc { color: #cfd4dd; white-space: pre-line; max-width: 80ch; }
.sponsors { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13.5px; white-space: pre-line; }

/* side panel */
.side { position: sticky; top: 76px; height: calc(100vh - 96px); min-height: 480px; display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.tabs { display: flex; gap: 2px; padding: 6px; border-bottom: 1px solid var(--line); }
.tab { flex: 1; height: 36px; border: 0; border-radius: 9px; background: none; color: var(--muted); font-weight: 600; cursor: pointer; }
.tab[aria-selected="true"] { background: var(--surface-2); color: var(--text); }
.tab:focus-visible { outline: 2px solid var(--brand); }
.badge { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--brand); color: #fff; font-size: 11px; }
.panel { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; }

.pinned { margin: 10px 10px 0; padding: 10px 12px; border-radius: 10px; background: color-mix(in srgb, var(--brand) 16%, var(--surface-2)); border: 1px solid color-mix(in srgb, var(--brand) 40%, transparent); font-size: 13.5px; }
.pinned::before { content: "📌 Pinned"; display: block; font-size: 11px; font-weight: 700; color: var(--muted); margin-bottom: 2px; }
.chat { list-style: none; margin: 0; padding: 10px 14px; flex: 1; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 9px; }
.chat li { font-size: 14px; line-height: 1.42; word-wrap: break-word; animation: in .18s ease-out; }
.chat .n { font-weight: 700; margin-right: 6px; }
.chat .mod .n { color: var(--accent); }
.chat .mod .n::after { content: "HOST"; margin-left: 6px; padding: 1px 5px; border-radius: 4px; background: var(--accent); color: #111; font-size: 9.5px; letter-spacing: .06em; vertical-align: 2px; }
.chat .sys { color: var(--muted); font-size: 12.5px; text-align: center; }
@keyframes in { from { opacity: 0; transform: translateY(4px); } }
.newmsg { position: absolute; left: 50%; bottom: 74px; transform: translateX(-50%); padding: 6px 14px; border: 0; border-radius: 999px; background: var(--brand); color: #fff; font-size: 12.5px; font-weight: 600; cursor: pointer; box-shadow: 0 6px 18px rgba(0,0,0,.4); }
.closed { margin: 10px; padding: 12px; border-radius: 10px; background: var(--surface-2); color: var(--muted); text-align: center; font-size: 13.5px; }
.composer { display: flex; align-items: center; gap: 6px; padding: 10px; border-top: 1px solid var(--line); }
.composer input { flex: 1; min-width: 0; height: 40px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--text); font: inherit; }
.composer input:focus { outline: none; border-color: var(--brand); }
.who { max-width: 96px; height: 40px; padding: 0 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.send { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border: 0; border-radius: 10px; background: var(--brand); color: #fff; cursor: pointer; }

.ask { display: grid; gap: 8px; padding: 14px; border-bottom: 1px solid var(--line); }
.ask label { font-weight: 600; font-size: 14px; }
.ask textarea { resize: vertical; min-height: 64px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--text); font: inherit; }
.ask textarea:focus { outline: none; border-color: var(--brand); }
.ask-row { display: flex; align-items: center; gap: 10px; }
.hint { flex: 1; font-size: 12px; color: var(--muted); }
.btn { height: 38px; padding: 0 16px; border: 0; border-radius: 10px; background: var(--brand); color: #fff; font-weight: 600; cursor: pointer; }
.btn.ghost { background: var(--surface-2); color: var(--text); }
.questions { list-style: none; margin: 0; padding: 10px 14px; overflow-y: auto; flex: 1; display: grid; align-content: start; gap: 10px; }
.questions li { display: grid; grid-template-columns: 1fr auto; gap: 10px; padding: 12px; border-radius: 12px; background: var(--surface-2); }
.questions li.now { outline: 2px solid var(--accent); }
.questions li.now::before { content: "Answering now"; grid-column: 1 / -1; font-size: 11px; font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: .08em; }
.questions .qt { font-size: 14px; }
.questions .qn { font-size: 12px; color: var(--muted); margin-top: 3px; }
.vote { display: grid; justify-items: center; align-content: center; min-width: 46px; padding: 6px; border: 1px solid var(--line); border-radius: 10px; background: none; color: var(--text); cursor: pointer; font-size: 12px; font-weight: 700; }
.vote[aria-pressed="true"] { border-color: var(--brand); color: var(--brand); }
.empty { color: var(--muted); text-align: center; font-size: 13.5px; padding: 26px 10px; }
.agenda { list-style: none; margin: 0; padding: 12px 16px; overflow-y: auto; }
.agenda li { display: grid; grid-template-columns: 64px 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.agenda time { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--accent); font-size: 13.5px; }
.agenda .s { font-size: 12.5px; color: var(--muted); }

.namebox { border: 1px solid var(--line); border-radius: 16px; background: var(--surface); color: var(--text); padding: 22px; width: min(380px, 92vw); }
.namebox::backdrop { background: rgba(0,0,0,.6); backdrop-filter: blur(2px); }
.namebox h3 { margin: 0 0 4px; }
.namebox p { margin: 0 0 14px; color: var(--muted); font-size: 13.5px; }
.namebox input { width: 100%; height: 42px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--text); font: inherit; }
.namebox .row { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }

@media (max-width: 1080px) {
  .layout { grid-template-columns: 1fr; padding: 0 0 16px; gap: 0; }
  .screen { border-radius: 0; position: sticky; top: 55px; z-index: 5; }
  .side { position: static; height: 70vh; min-height: 420px; margin: 12px; border-radius: var(--radius); }
  .about { padding: 16px; order: 3; }
  .primary { display: contents; }
  .screen { order: 1; } .side { order: 2; } .about { order: 3; }
  .top { padding: 8px 14px; }
}
@media (max-width: 560px) {
  .top-title span { display: none; }
  .viewers { display: none !important; }
  .standby-note { display: none; }
  .standby-inner { padding: 12px; }
  .standby-kicker { font-size: 11px; margin-bottom: 2px; }
  .countdown { margin: 10px 0 4px; }
  .countdown div { padding: 6px 4px 5px; }
  .standby-when { font-size: 13px; margin-top: 6px; }
}
