/* ScreenView — baseado no ScreenView UI Kit v1.0 */
:root {
  /* Neutros */
  --ink-950: #0A0A0B;   /* fundo */
  --ink-900: #111113;   /* superfície */
  --ink-850: #0E0E10;   /* palco */
  --ink-800: #18181B;   /* elevado */
  --line: #26262B;
  --line-soft: #1F1F23;
  --line-ctl: #2E2E34;
  --line-strong: #3A3A40;
  --muted: #8B8B94;
  --dim: #5C5C66;
  --text-2: #C9C9CF;
  --text: #EDEDEF;
  /* Sinal (ação principal, conectado) */
  --signal: #7DF9C2;
  --signal-ink: #06140F;
  --signal-bg: #0F1A16;
  --signal-line: #1F3A30;
  /* Ao vivo (transmitindo, parar, erro) */
  --live: #FF5A4E;
  --live-text: #FF8A80;
  --live-bg: #1C1111;
  --live-line: #4A2220;
  /* Atenção (conectando, latência alta) */
  --warn: #F5B94A;
  --warn-bg: #1A160E;
  --warn-line: #4A3A1C;
  /* Raios */
  --r-chip: 6px;
  --r-ctl: 10px;
  --r-card: 14px;
  --font: 'Geist', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'Geist Mono', ui-monospace, 'Cascadia Mono', Consolas, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--ink-950);
  color: var(--text);
  font: 400 14px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
button { font-family: inherit; }
a { color: var(--muted); }
a:hover { color: var(--text); }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.small { font-size: 12px; }

/* Ícones */
.i { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.i-sm { width: 15px; height: 15px; stroke-width: 1.8; }
.i-xs { width: 13px; height: 13px; stroke-width: 1.8; }
.i-lg { width: 28px; height: 28px; stroke-width: 1.5; }

/* ---------- Botões (h 40 · r 10 · px 16) ---------- */
.btn {
  height: 40px; padding: 0 16px; border-radius: var(--r-ctl); border: 1px solid transparent;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 500 14px/1 var(--font); white-space: nowrap; cursor: pointer; text-decoration: none;
  transition: background .15s, border-color .15s, color .15s, filter .15s;
}
.btn:focus-visible, .icon-btn:focus-visible, .source:focus-visible, .seg button:focus-visible, .switch-row:focus-visible, .menu button:focus-visible {
  outline: none; box-shadow: 0 0 0 2px var(--ink-900), 0 0 0 3px var(--signal);
}
.btn-primary { background: var(--signal); color: var(--signal-ink); }
.btn-primary:hover:not(:disabled) { filter: brightness(1.08); }
.btn-secondary { background: var(--ink-800); border-color: var(--line-ctl); color: var(--text); }
.btn-secondary:hover:not(:disabled) { border-color: var(--line-strong); background: #1D1D21; }
.btn-ghost { background: transparent; color: var(--text-2); padding: 0 12px; }
.btn-ghost:hover { color: var(--text); background: var(--ink-800); }
.btn-danger { background: var(--live-bg); border-color: var(--live-line); color: var(--live-text); }
.btn-danger:hover:not(:disabled) { background: #251414; }
.btn-lg { height: 48px; font-size: 15px; width: 100%; }
.btn-sm { height: 36px; padding: 0 14px; font-size: 13px; }
.btn-xs { height: 30px; padding: 0 10px; font-size: 12px; border-radius: 7px; }
.btn:disabled { background: #141416; border-color: var(--line-soft); color: #6B6B74; cursor: not-allowed; filter: none; }
.btn.done { background: var(--signal-bg); border-color: var(--signal-line); color: var(--signal); }
.stop-sq { width: 8px; height: 8px; border-radius: 2px; background: var(--live); }

/* Botões de ícone (44 × 44) */
.icon-btn {
  width: 44px; height: 44px; border-radius: 11px; border: 1px solid transparent; background: transparent;
  color: var(--text-2); display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.icon-btn:hover { background: var(--ink-800); color: var(--text); }
.icon-btn.on { border-color: var(--signal); background: var(--signal-bg); color: var(--signal); }
.icon-btn.off { border-color: var(--live-line); background: var(--live-bg); color: var(--live-text); }
.icon-btn:disabled { opacity: .4; cursor: not-allowed; }

/* ---------- Campos ---------- */
.field { display: flex; flex-direction: column; gap: 8px; }
.field label { font-size: 13px; color: var(--text-2); }
.opt { color: var(--dim); font-size: 12px; margin-left: 4px; }
.input {
  height: 44px; width: 100%; min-width: 0; border-radius: var(--r-ctl); border: 1px solid var(--line-ctl);
  background: var(--ink-950); color: var(--text); padding: 0 14px; font: 400 14px var(--font); outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.input.mono { font-family: var(--mono); font-size: 14px; letter-spacing: .04em; }
.input::placeholder { color: var(--dim); }
.input:focus { border-color: var(--signal); box-shadow: 0 0 0 3px rgba(125, 249, 194, .12); }
.input.invalid { border-color: #6B2A25; }
.msg { margin: 0; font-size: 12px; }
.msg.error { color: var(--live-text); }
.msg.warn { color: var(--warn); }
.hint { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.5; }
.hint.warn { color: var(--warn); }
.hint.center { text-align: center; }
.label { font-size: 11px; color: var(--muted); letter-spacing: .02em; }

/* Segmentado */
.seg { display: flex; padding: 3px; gap: 2px; border-radius: var(--r-ctl); border: 1px solid var(--line); background: var(--ink-950); }
.seg button {
  flex: 1; height: 34px; border-radius: 7px; border: 0; background: transparent; color: var(--muted);
  font: 400 12px var(--mono); cursor: pointer; transition: background .15s, color .15s;
}
.seg button:hover { color: var(--text); }
.seg button[aria-pressed="true"] { background: var(--line); color: var(--text); }

/* Switch */
.switch-row {
  display: flex; align-items: center; justify-content: space-between; width: 100%; height: 28px;
  border: 0; background: transparent; color: var(--text); font: 400 14px var(--font); padding: 0; cursor: pointer; border-radius: 6px;
}
.switch { position: relative; width: 36px; height: 20px; border-radius: 999px; background: var(--line-ctl); transition: background .15s; flex: none; }
.switch::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 999px;
  background: var(--text); transition: transform .15s;
}
.switch-row[aria-checked="true"] .switch { background: var(--signal); }
.switch-row[aria-checked="true"] .switch::after { transform: translateX(16px); }
.switch-row:disabled { color: var(--dim); cursor: not-allowed; }
.switch-row:disabled .switch { opacity: .4; }

/* Pílulas de status */
.pill {
  display: inline-flex; align-items: center; gap: 8px; height: 28px; padding: 0 11px; border-radius: 999px;
  font: 400 11px var(--mono); letter-spacing: .06em; white-space: nowrap;
  background: var(--ink-800); border: 1px solid var(--line); color: #A1A1AA;
}
.pill .pdot { width: 7px; height: 7px; border-radius: 999px; background: currentColor; flex: none; }
.pill-live { background: var(--live-bg); border-color: var(--live-line); color: var(--live-text); }
.pill-live .pdot { background: var(--live); animation: svpulse 1.8s infinite; }
.pill-warn { background: var(--warn-bg); border-color: var(--warn-line); color: var(--warn); }
.pill-warn .pdot { animation: svblink 1.2s infinite; }
.pill-ok { background: var(--signal-bg); border-color: var(--signal-line); color: var(--signal); }
.pill-neutral { color: var(--text-2); gap: 6px; }
.chip { font-size: 12px; color: var(--muted); border: 1px solid var(--line); border-radius: var(--r-chip); padding: 3px 8px; letter-spacing: .04em; }
.timer { font-size: 12px; color: var(--text-2); padding: 0 4px; }
.live-dot { width: 8px; height: 8px; border-radius: 999px; background: var(--live); animation: svpulse 1.8s infinite; flex: none; }

@keyframes svpulse { 0% { box-shadow: 0 0 0 0 rgba(255,90,78,.55); } 70% { box-shadow: 0 0 0 8px rgba(255,90,78,0); } 100% { box-shadow: 0 0 0 0 rgba(255,90,78,0); } }
@keyframes svblink { 50% { opacity: .25; } }
@keyframes spin { to { transform: rotate(360deg); } }

/* Cartões */
.card { border: 1px solid var(--line); border-radius: 16px; background: var(--ink-900); padding: 28px; display: flex; flex-direction: column; gap: 20px; }

/* ---------- Telas de página (início e escolha) ---------- */
.screen { min-height: 100%; }
.dots {
  display: flex; flex-direction: column;
  background-image: radial-gradient(#1C1C20 1px, transparent 1px); background-size: 24px 24px; background-position: 12px 12px;
}
.site-head {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 24px clamp(16px, 5vw, 80px); border-bottom: 1px solid var(--line-soft); background: var(--ink-950);
}
.logo { display: inline-flex; align-items: center; gap: 12px; color: var(--text); text-decoration: none; font-size: 18px; font-weight: 600; letter-spacing: -0.02em; }
.logo:hover { color: var(--text); }
.eyebrow { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--muted); letter-spacing: .02em; }

.landing {
  flex: 1; width: 100%; max-width: 1280px; margin: 0 auto; padding: clamp(40px, 8vh, 96px) clamp(16px, 5vw, 80px);
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 420px); gap: clamp(32px, 6vw, 96px); align-items: center;
}
.hero { display: flex; flex-direction: column; gap: 20px; }
.hero h1 { margin: 0; font-size: clamp(32px, 4.4vw, 60px); overflow-wrap: anywhere; line-height: 1.02; font-weight: 600; letter-spacing: -0.045em; }
.lead { margin: 0; max-width: 420px; font-size: 16px; line-height: 1.6; color: var(--muted); }
.start { gap: 18px; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--dim); font-size: 11px; letter-spacing: .06em; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line-soft); }
.join { display: flex; gap: 8px; }
.code-input { text-transform: uppercase; }
.code-input::placeholder { text-transform: none; }

@media (max-width: 860px) {
  .landing { grid-template-columns: 1fr; align-items: start; }
  .card { padding: 20px; }
}
@media (max-width: 400px) { .join { flex-direction: column; } }

.setup { flex: 1; width: 100%; max-width: 760px; margin: 0 auto; padding: clamp(32px, 6vh, 64px) 16px; display: flex; flex-direction: column; gap: 20px; }
.title { margin: -8px 0 4px; font-size: 28px; line-height: 34px; font-weight: 500; letter-spacing: -0.02em; }
.sources { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.source {
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px; text-align: left;
  padding: 20px; border-radius: var(--r-card); border: 1px solid var(--line); background: var(--ink-900);
  color: var(--text); cursor: pointer; font: inherit; transition: border-color .15s, background .15s;
}
.source .i-lg { color: var(--muted); margin-bottom: 10px; }
.source strong { font-size: 15px; font-weight: 500; }
.source span { font-size: 12px; color: var(--muted); line-height: 1.4; }
.source:hover { border-color: var(--line-strong); }
.source[aria-checked="true"] { border-color: var(--signal); background: var(--signal-bg); box-shadow: 0 0 0 3px rgba(125, 249, 194, .08); }
.source[aria-checked="true"] .i-lg { color: var(--signal); }
.settings { gap: 18px; }
.setting { display: flex; flex-direction: column; gap: 10px; }
@media (max-width: 600px) {
  .sources { grid-template-columns: 1fr; }
  .source { flex-direction: row; align-items: center; gap: 14px; padding: 14px 16px; }
  .source .i-lg { margin: 0; width: 24px; height: 24px; }
  .source span { display: none; }
}

/* ---------- Sessão ---------- */
.session { height: 100%; display: flex; flex-direction: column; overflow: hidden; }
.topbar {
  height: 64px; flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 0 20px 0 24px; border-bottom: 1px solid var(--line-soft); background: var(--ink-950);
}
.tb-left, .tb-right { display: flex; align-items: center; gap: 12px; min-width: 0; }
.tb-right { gap: 10px; flex: none; }
.tb-logo { display: inline-flex; flex: none; }
.vsep { width: 1px; height: 20px; background: var(--line); flex: none; }
.tb-title { font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.session-body { flex: 1; display: flex; min-height: 0; }
.stage-wrap { flex: 1; min-width: 0; padding: 24px; display: flex; flex-direction: column; gap: 10px; }
.stage {
  flex: 1; position: relative; min-height: 0; border-radius: var(--r-card); border: 1px solid var(--line-soft);
  background: var(--ink-850); background-image: radial-gradient(#1A1A1E 1px, transparent 1px); background-size: 20px 20px;
  overflow: hidden; display: flex; align-items: center; justify-content: center;
}
.stage video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: transparent; }
.stage:fullscreen { border: 0; border-radius: 0; background: #000; }
.corner { position: absolute; width: 14px; height: 14px; border: 0 solid var(--signal); opacity: .8; pointer-events: none; transition: opacity .25s; }
.corner.tl { top: 14px; left: 14px; border-top-width: 1.5px; border-left-width: 1.5px; }
.corner.tr { top: 14px; right: 14px; border-top-width: 1.5px; border-right-width: 1.5px; }
.corner.bl { bottom: 14px; left: 14px; border-bottom-width: 1.5px; border-left-width: 1.5px; }
.corner.br { bottom: 14px; right: 14px; border-bottom-width: 1.5px; border-right-width: 1.5px; }
.stage-stats {
  position: absolute; top: 18px; left: 40px; right: 40px; display: flex; align-items: center; gap: 14px;
  font-size: 11px; color: var(--muted); letter-spacing: .04em; pointer-events: none; transition: opacity .25s;
  white-space: nowrap; overflow: hidden;
}
.stage-stats .ok { color: var(--signal); }
.stage-stats .warn { color: var(--warn); }
.stage-stats .bad { color: var(--live-text); }
.bars { display: inline-flex; align-items: flex-end; gap: 3px; height: 14px; }
.bars i { width: 3px; border-radius: 1px; background: var(--line-strong); display: block; }
.bars i:nth-child(1) { height: 4px; } .bars i:nth-child(2) { height: 7px; } .bars i:nth-child(3) { height: 10px; } .bars i:nth-child(4) { height: 14px; }
.bars[data-level="4"] i, .bars[data-level="3"] i:nth-child(-n+3) { background: var(--signal); }
.bars[data-level="2"] i:nth-child(-n+2) { background: var(--warn); }
.bars[data-level="1"] i:nth-child(1) { background: var(--live); }

.stage-overlay {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; text-align: center; padding: 24px; background: rgba(10, 10, 11, .72);
}
.stage-overlay p { margin: 0; font-size: 15px; color: var(--text-2); max-width: 420px; }
.stage-overlay .label { letter-spacing: .08em; color: #6B6B74; font-size: 12px; }
.spinner { width: 28px; height: 28px; border-radius: 999px; border: 2px solid var(--line-strong); border-top-color: var(--signal); animation: spin .8s linear infinite; }

/* Controles na barra de cima (botões de ícone com borda, como no kit) */
.topbar .icon-btn { width: 36px; height: 36px; border-radius: var(--r-ctl); border-color: var(--line-ctl); background: var(--ink-800); color: var(--text); }
.topbar .icon-btn:hover:not(:disabled) { border-color: var(--line-strong); background: #1D1D21; }
.topbar .icon-btn.off { border-color: var(--live-line); background: var(--live-bg); color: var(--live-text); }
.topbar .icon-btn .i { width: 18px; height: 18px; }

/* Parado: esconde dados e cursor sobre o vídeo */
.watching.idle .stage { cursor: none; }
.watching.idle .stage-stats, .watching.idle .corner { opacity: 0; }

/* Tela cheia: vídeo ocupa tudo; a barra de cima flutua por cima e some quando o mouse para */
.watching:fullscreen { background: #000; }
.watching:fullscreen .topbar {
  position: absolute; top: 0; left: 0; right: 0; z-index: 3; border-bottom: 0;
  background: linear-gradient(rgba(10, 10, 11, .92), rgba(10, 10, 11, .6) 70%, rgba(10, 10, 11, 0));
  transition: opacity .25s, transform .25s;
}
.watching:fullscreen.idle .topbar { opacity: 0; transform: translateY(-8px); pointer-events: none; }
.watching:fullscreen .stage-wrap { padding: 0; }
.watching:fullscreen .stage { border: 0; border-radius: 0; background: #000; }
.watching:fullscreen .stage-stats { top: 70px; }
.watching:fullscreen .corner { display: none; }

/* Menus (popover) */
.pop { position: relative; }
.menu {
  position: absolute; bottom: calc(100% + 10px); left: 50%; transform: translateX(-50%); z-index: 5;
  min-width: 210px; padding: 6px; border-radius: 12px; background: var(--ink-800); border: 1px solid var(--line-ctl);
  box-shadow: 0 12px 32px rgba(0, 0, 0, .4); display: flex; flex-direction: column; gap: 2px;
}
.menu-label { padding: 8px 10px 6px; font-size: 11px; color: var(--muted); letter-spacing: .04em; }
.menu button {
  display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 10px; border: 0; border-radius: 8px;
  background: transparent; color: var(--text); font: 400 14px var(--font); cursor: pointer; text-align: left;
}
.menu button:hover { background: var(--line); }
.menu button[aria-current="true"] { color: var(--signal); }
.menu-right { top: calc(100% + 8px); bottom: auto; left: auto; right: 0; transform: none; }
.name-form { width: 260px; padding: 12px; gap: 10px; }
.name-form .menu-label { padding: 0; }

/* Painel lateral */
.side { width: 320px; flex: none; border-left: 1px solid var(--line-soft); display: flex; flex-direction: column; min-height: 0; }
.side-head { padding: 20px 20px 14px; display: flex; justify-content: space-between; align-items: baseline; }
.side-head h2 { margin: 0; font-size: 14px; font-weight: 500; }
.people { list-style: none; margin: 0; padding: 0 12px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; min-height: 0; }
.person { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 8px; border-radius: 10px; }
.person-main { display: flex; align-items: center; gap: 12px; min-width: 0; }
.person-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.person-name { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.person-role { font-size: 12px; color: var(--muted); }
.person-role.warn, .person-lat.warn { color: var(--warn); }
.person-lat { font-size: 11px; color: var(--muted); flex: none; }
.avatar {
  position: relative; width: 32px; height: 32px; border-radius: 999px; flex: none; display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 500; background: #22222A; color: var(--text-2);
}
.avatar::after { content: ""; position: absolute; right: -1px; bottom: -1px; width: 9px; height: 9px; border-radius: 999px; background: var(--signal); border: 2px solid var(--ink-950); }
.avatar.me { background: #1F2A27; color: var(--signal); }
.avatar.warn { background: #2A2320; color: var(--warn); }
.avatar.warn::after { background: var(--warn); }
.people-empty { padding: 10px 8px; font-size: 13px; color: var(--muted); line-height: 1.5; }
.side-foot { margin-top: auto; padding: 20px; border-top: 1px solid var(--line-soft); display: flex; flex-direction: column; gap: 12px; }
.linkbox {
  display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 4px 0 12px; border-radius: var(--r-ctl);
  border: 1px solid var(--line-ctl); background: var(--ink-950);
}
.linkbox span { flex: 1; min-width: 0; font-size: 12px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.secure { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }

/* Quem assiste: palco ocupa quase tudo */
.watching .stage-wrap { padding: 12px; }
.watching .topbar { height: 56px; }

@media (max-width: 900px) {
  .session { height: auto; min-height: 100%; overflow: visible; }
  .session-body { flex-direction: column; }
  #host .stage-wrap { padding: 12px; }
  #host .stage { flex: none; aspect-ratio: 16 / 10; }
  .side { width: auto; border-left: 0; border-top: 1px solid var(--line-soft); }
  .watching { height: 100%; overflow: hidden; }
  .watching .session-body { flex-direction: row; }
}
@media (max-width: 640px) {
  .topbar { padding: 0 12px; gap: 8px; }
  .tb-left .vsep, .tb-right .vsep, .timer, #inviteBtn span, #endBtn span:last-child, .topbar .chip, .pill-neutral { display: none; }
  #nameBtnText { display: none; }
  .tb-left { gap: 10px; }
  .tb-right { gap: 6px; }
  .topbar .pill { padding: 0 8px; }
  .stage-stats { left: 20px; right: 20px; }
  .watching .stage-wrap { padding: 0; }
  .watching .stage { border-radius: 0; border: 0; }
  .watching .corner { display: none; }
}

/* Aviso (toast) */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 20;
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px;
  background: var(--ink-800); border: 1px solid var(--line-ctl); box-shadow: 0 12px 32px rgba(0, 0, 0, .4);
  font-size: 13px; max-width: calc(100% - 32px);
}
.toast-icon {
  width: 22px; height: 22px; border-radius: 999px; flex: none; display: flex; align-items: center; justify-content: center;
  background: var(--signal-bg); color: var(--signal); font: 500 10px var(--font);
}
.toast-icon .i { width: 12px; height: 12px; stroke-width: 2.4; }
.toast-icon.t-warn { background: var(--warn-bg); color: var(--warn); font: 500 12px var(--mono); }
.toast-icon.t-person { background: #22222A; color: var(--text); font-weight: 600; }
#statsText { display: contents; }

/* Lista de quem está na sala (para quem assiste) */
.pill-btn { cursor: pointer; font-family: var(--mono); }
.pill-btn:hover, .pill-btn[aria-expanded="true"] { border-color: var(--line-strong); color: var(--text); }
.pill-btn:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--ink-900), 0 0 0 3px var(--signal); }
.people-menu { width: 260px; max-height: min(60vh, 420px); }
.people-menu .people { padding: 0; overflow-y: auto; }
.people-menu .person { padding: 8px 6px; }
@media (max-width: 640px) { .tb-right .pill-btn { display: inline-flex; } }

/* Início: textos em cima, os dois cartões embaixo, meio a meio; no celular, um embaixo do outro. */
.landing {
  max-width: 1320px; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-areas: "hero hero" "start social";
  align-items: start; gap: 24px; row-gap: clamp(28px, 5vh, 56px);
}

/* Detalhes do grupo */
.s-members { margin: 0 0 6px 16px; padding: 4px 0 4px 14px; border-left: 1px solid var(--line); }
.s-members .s-row { padding: 6px 0; }
.s-members .avatar { width: 28px; height: 28px; font-size: 11px; }
.s-code { display: flex; align-items: center; gap: 8px; padding: 6px 0 8px; }
.s-code .chip { color: var(--text); }
/* Apoiar (Pix) no topo do início */
.head-right { display: flex; align-items: center; gap: 16px; }
.support { width: min(340px, calc(100vw - 32px)); padding: 16px; gap: 10px; }
.support strong { font-size: 14px; font-weight: 500; }
.support p { margin: 0; font-size: 13px; line-height: 1.5; color: var(--muted); }
.support .menu-label { padding: 4px 0 0; }
.support .linkbox { height: auto; min-height: 40px; padding: 6px 6px 6px 12px; }
.support .linkbox span { font-size: 11px; white-space: normal; overflow-wrap: anywhere; user-select: all; }
#supportBtn .i { color: var(--live-text); }
.support #pixCopyBtn { height: 30px; padding: 0 12px; flex: none; justify-content: center; border-radius: 7px; background: var(--signal); color: var(--signal-ink); font-size: 12px; font-weight: 500; }
.support #pixCopyBtn.done { background: var(--signal-bg); color: var(--signal); }
/* Barra do topo sempre visível ao rolar, com o crédito */
.site-head { position: sticky; top: 0; z-index: 10; }
.site-credit { font-size: 11px; color: var(--muted); letter-spacing: .06em; white-space: nowrap; }
@media (max-width: 760px) { .site-credit { display: none; } }

/* Volume de quem assiste */
.vol { display: flex; align-items: center; gap: 8px; }
.volume {
  -webkit-appearance: none; appearance: none; width: 84px; height: 4px; border-radius: 999px; cursor: pointer; margin: 0;
  background: linear-gradient(to right, var(--signal) var(--v, 100%), var(--line-ctl) var(--v, 100%));
}
.volume::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; border-radius: 999px; background: var(--text); border: 0; }
.volume::-moz-range-thumb { width: 14px; height: 14px; border-radius: 999px; background: var(--text); border: 0; }
.volume:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--ink-900), 0 0 0 3px var(--signal); }
@media (max-width: 640px) { .volume { display: none; } }

.btn-pin[aria-pressed="true"] { color: var(--signal); }
.btn-pin[aria-pressed="false"] { color: var(--muted); }
.btn-pin[aria-pressed="false"]:hover { color: var(--text); }
.btn-kick { color: var(--muted); }
.btn-kick:hover { color: var(--live-text); background: var(--live-bg); }
.s-row.has-badge .avatar::before {
  content: ""; position: absolute; top: -2px; right: -2px; width: 9px; height: 9px; border-radius: 999px;
  background: var(--warn); border: 2px solid var(--ink-900);
}
.hero { grid-area: hero; align-items: center; text-align: center; }
.hero .lead { max-width: 520px; }
.start { grid-area: start; }
.social { grid-area: social; gap: 14px; }
@media (max-width: 860px) { .landing { grid-template-columns: 1fr; grid-template-areas: "hero" "start" "social"; } }
.social-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.social-head h2 { margin: 0; font-size: 15px; font-weight: 500; }
.mycode { display: flex; align-items: center; gap: 8px; }
.mycode .chip { color: var(--text); }
.link-btn { align-self: flex-start; height: 30px; padding: 0 8px; color: var(--muted); }
.s-group { display: flex; flex-direction: column; gap: 2px; }
.s-group + .s-group { margin-top: 6px; }
.s-title { font-size: 11px; color: var(--muted); letter-spacing: .04em; padding: 6px 0 4px; }
.s-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line-soft); }
.s-row:first-of-type { border-top: 0; }
.s-row .person-main { flex: 1; }
.s-actions { display: flex; gap: 6px; flex: none; }
.s-row.live .avatar { background: var(--live-bg); color: var(--live-text); }
.s-row.live .avatar::after { background: var(--live); }
.s-row .avatar.idle::after { display: none; }
.s-row .person-role.live { color: var(--live-text); }
.s-empty { margin: 0; font-size: 13px; color: var(--muted); }
.btn-x { width: 30px; padding: 0; color: var(--dim); }
.btn-x:hover { color: var(--live-text); }

/* Resolução + fps lado a lado na tela de escolha */
.setting-row { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 16px; }
@media (max-width: 520px) { .setting-row { grid-template-columns: 1fr; } }
.side-foot .seg + .seg { margin-top: -4px; }

/* ---------- Chat da sala ---------- */
.side-tabs { display: flex; gap: 4px; padding: 14px 12px 10px; border-bottom: 1px solid var(--line-soft); }
.side-tabs button {
  flex: 1; height: 34px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 8px; background: transparent; color: var(--muted); font: 500 13px var(--font); cursor: pointer;
}
.side-tabs button:hover { color: var(--text); }
.side-tabs button[aria-selected="true"] { background: var(--ink-800); color: var(--text); }
.side-tabs button:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--signal); }
#viewerList { padding-top: 8px; }
.badge {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center;
  background: var(--live); color: #fff; font-size: 10px; font-weight: 600; line-height: 1;
}
.chat-btn { position: relative; }
.chat-btn .badge { position: absolute; top: -6px; right: -6px; }
.topbar .icon-btn.on { border-color: var(--signal-line); background: var(--signal-bg); color: var(--signal); }
.icon-btn-sm { width: 30px; height: 30px; border-radius: 8px; }
.icon-btn-sm .i { width: 16px; height: 16px; }

.chat { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.chat-list {
  flex: 1; min-height: 0; overflow-y: auto; list-style: none; margin: 0; padding: 12px 16px; display: flex; flex-direction: column; gap: 2px;
  scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent;
}
.chat-msg { padding: 8px 10px 6px; border-radius: 10px; }
.chat-msg.grouped { padding-top: 0; }
.chat-msg.mine { background: var(--signal-bg); }
.chat-msg.mine + .chat-msg.mine.grouped { margin-top: -4px; border-top-left-radius: 0; border-top-right-radius: 0; }
.chat-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 2px; }
.chat-name { font-size: 12px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-msg.mine .chat-name { color: var(--signal); }
.chat-tag { font-size: 9px; letter-spacing: .06em; color: var(--live-text); border: 1px solid var(--live-line); border-radius: 4px; padding: 1px 4px; }
.chat-time { margin-left: auto; font-size: 10px; color: var(--dim); flex: none; }
.chat-text { margin: 0; font-size: 13px; line-height: 1.45; color: var(--text-2); white-space: pre-wrap; overflow-wrap: anywhere; }
.chat-text a { color: var(--signal); }
.chat-empty { margin: auto 0; padding: 24px 8px; text-align: center; font-size: 13px; color: var(--muted); line-height: 1.5; }
.chat-form { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line-soft); }
.chat-form .input { height: 38px; }
.chat-form .btn { height: 38px; }

/* Quem compartilha: chat ocupa o painel (a lista e o rodapé do painel somem) */
#host .side { min-height: 0; }

/* Quem assiste: painel à direita do vídeo */
.watching .session-body { flex: 1; display: flex; min-height: 0; }
.chat-side { width: 320px; flex: none; border-left: 1px solid var(--line-soft); background: var(--ink-950); display: flex; flex-direction: column; min-height: 0; }
.chat-side .side-head { padding: 12px 12px 10px 16px; align-items: center; border-bottom: 1px solid var(--line-soft); }
.watching:fullscreen .chat-side { padding-top: 56px; }
@media (max-width: 640px) {
  /* Celular: o chat abre como uma folha por cima da parte de baixo do vídeo. */
  .chat-side {
    position: fixed; left: 0; right: 0; bottom: 0; width: auto; height: 60vh; height: 60dvh; z-index: 15;
    border-left: 0; border-top: 1px solid var(--line-ctl); border-radius: 16px 16px 0 0; box-shadow: 0 -12px 32px rgba(0, 0, 0, .5);
  }
}
