:root {
  --bg: #0a0d14;
  --panel: #10151f;
  --panel-2: #161c29;
  --panel-3: #1d2433;
  --line: rgba(255, 255, 255, .07);
  --line-strong: rgba(255, 255, 255, .14);
  --text: #e9edf6;
  --muted: #8892a7;
  --accent: #6f5bff;
  --accent-2: #2d9cff;
  --accent-rgb: 111, 91, 255;
  --accent-2-rgb: 45, 156, 255;
  --grad: var(--accent); /* era um degradê roxo-azul; ficou só a cor sólida, menos "clichê de IA" */
  --green: #3ddc97;
  --red: #f0525c;
  --stage: #06080d;
  --tag-bg: rgba(10, 13, 20, .78);
  --glass: rgba(16, 21, 31, .82);
  --shadow: rgba(0, 0, 0, .5);
  --radius: 12px;
  --side-w: 288px; /* largura da lista de pessoas (o usuário pode arrastar a borda) */
  --chat-w: 340px; /* largura do chat */
  --ui-scale: 1; /* tamanho da fonte da lista/chat — escolhido em Configurações > Aparência */
  --left-used: var(--side-w);
  --right-used: 0px;
  --rail-w: 0px;
  --rail-bg: color-mix(in srgb, var(--bg) 65%, #000);
  color-scheme: dark;
}
body.side-collapsed { --left-used: 0px; }
body.chat-open { --right-used: var(--chat-w); }
:root[data-theme="light"] {
  --bg: #f2f4fa;
  --panel: #ffffff;
  --panel-2: #f0f2f9;
  --panel-3: #e5e9f4;
  --line: rgba(20, 30, 60, .09);
  --line-strong: rgba(20, 30, 60, .18);
  --text: #131a2b;
  --muted: #5d6882;
  --green: #12a76a;
  --red: #e0414b;
  --stage: #dfe4f0;
  --tag-bg: rgba(255, 255, 255, .88);
  --glass: rgba(255, 255, 255, .86);
  --shadow: rgba(20, 30, 60, .2);
  --rail-bg: #dde2ee;
  color-scheme: light;
}

/* temas de cor — trocam só o acento (índigo é o padrão, não precisa de bloco próprio);
   funciona em cima do claro/escuro, que continuam cuidando só do fundo/texto */
:root[data-color-theme="blue"] { --accent: #2563eb; --accent-2: #06b6d4; --accent-rgb: 37, 99, 235; --accent-2-rgb: 6, 182, 212; }
:root[data-color-theme="green"] { --accent: #10b981; --accent-2: #22d3ee; --accent-rgb: 16, 185, 129; --accent-2-rgb: 34, 211, 238; }
:root[data-color-theme="pink"] { --accent: #db2777; --accent-2: #a855f7; --accent-rgb: 219, 39, 119; --accent-2-rgb: 168, 85, 247; }
:root[data-color-theme="orange"] { --accent: #ea580c; --accent-2: #f59e0b; --accent-rgb: 234, 88, 12; --accent-2-rgb: 245, 158, 11; }
:root[data-color-theme="red"] { --accent: #dc2626; --accent-2: #f43f5e; --accent-rgb: 220, 38, 38; --accent-2-rgb: 244, 63, 94; }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 Inter, "Segoe UI", system-ui, -apple-system, sans-serif;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
.mono { font-family: Consolas, "Courier New", monospace; letter-spacing: .08em; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.spacer { flex: 1; }
svg.ic { width: 1.15em; height: 1.15em; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }
i[data-icon] { display: inline-flex; font-style: normal; }

/* ---------- marca ---------- */
.brand { display: flex; align-items: center; gap: 9px; font-weight: 800; font-size: 17px; letter-spacing: -.02em; }
.brand em { font-style: normal; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand.big { font-size: 30px; }
.logo {
  width: 30px; height: 30px; border-radius: 9px; background: var(--grad); color: #fff;
  display: inline-grid; place-items: center; box-shadow: 0 6px 18px rgba(var(--accent-rgb), .4);
}
.logo svg.ic { width: 17px; height: 17px; }
.logo.sm { width: 26px; height: 26px; border-radius: 8px; }
.brand.big .logo { width: 40px; height: 40px; border-radius: 12px; }
.brand.big .logo svg.ic { width: 22px; height: 22px; }

/* ---------- botões e campos ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--panel-2); color: var(--text); border: 1px solid var(--line-strong);
  border-radius: 999px; padding: 9px 16px; font: inherit; font-weight: 600; cursor: pointer;
  transition: transform .12s, filter .15s, background .15s, box-shadow .15s;
}
.btn:hover { filter: brightness(1.12); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--grad); color: #fff; border-color: transparent; box-shadow: 0 6px 20px rgba(var(--accent-rgb), .35); }
.btn.stop { background: var(--red); color: #fff; border-color: transparent; }
.btn.wide { width: 100%; border-radius: var(--radius); padding: 11px 16px; }

.icon-btn {
  display: inline-grid; place-items: center; background: transparent; border: 0; color: var(--muted);
  cursor: pointer; padding: 6px; border-radius: 8px; font-size: 15px;
}
.icon-btn:hover { color: var(--text); background: var(--panel-3); }

/* botão redondo da dock e do painel do usuário */
.ibtn {
  width: 40px; height: 40px; display: inline-grid; place-items: center; flex: none;
  background: transparent; color: var(--text); border: 0; border-radius: 50%; cursor: pointer; font-size: 18px;
  transition: background .15s, color .15s, transform .12s;
}
.ibtn { position: relative; }
.ibtn:hover { background: var(--panel-3); }
#btn-thumbs.on { color: var(--accent-2); background: rgba(var(--accent-2-rgb), .14); }
.chatbtn { position: relative; width: 42px; height: 42px; }
.chatbtn svg.ic { width: 24px; height: 24px; stroke-width: 2; }
#btn-chat.on { color: var(--accent-2); background: rgba(var(--accent-2-rgb), .14); }
.chatbtn .cnt { top: 1px; right: 0; min-width: 18px; height: 18px; font-size: 11px; }
.cnt, .ibtn .cnt {
  position: absolute; top: 1px; right: 0; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px;
  background: var(--red); color: #fff; font-size: 10px; font-weight: 800; display: grid; place-items: center; line-height: 1;
}
body.thumbs-hidden .thumbs-col { display: none; }
.ibtn:active { transform: scale(.92); }
.ibtn.off { color: var(--red); background: rgba(240, 82, 92, .14); }
.ibtn.off:hover { background: rgba(240, 82, 92, .24); }
.ibtn.on { color: var(--green); }
.ibtn.danger:hover { background: rgba(240, 82, 92, .2); color: var(--red); }

input, textarea {
  background: var(--panel-2); color: var(--text); border: 1px solid var(--line-strong);
  border-radius: var(--radius); padding: 11px 13px; font: inherit; width: 100%; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .22); }
textarea { resize: vertical; min-height: 90px; }
input:disabled { opacity: .6; cursor: not-allowed; }
.row { display: flex; gap: 8px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.error { color: var(--red); font-size: 13px; }

/* ---------- telas de entrada ---------- */
.center-screen { height: 100%; display: grid; place-items: center; padding: 16px; overflow-y: auto; }
.card {
  width: 100%; background: var(--glass); border: 1px solid var(--line); backdrop-filter: blur(14px);
  border-radius: 20px; padding: 22px; display: flex; flex-direction: column; gap: 12px; text-align: left;
  box-shadow: 0 20px 60px var(--shadow);
}
.card.solo { width: min(390px, 100%); padding: 28px; }
.card p { margin: 0; }
.divider { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; margin: 2px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.install-btn { background: var(--panel); border-style: dashed; color: var(--muted); }
.install-btn:hover { color: var(--text); }

body.has-rail { --rail-w: 68px; }
body.has-rail #room, body.has-rail #lobby { margin-left: var(--rail-w); }
.rail {
  position: fixed; left: 0; top: 0; bottom: 0; z-index: 8; width: var(--rail-w);
  display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px 0;
  background: var(--rail-bg); overflow-y: auto; scrollbar-width: none;
}
.rail-favs { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.rail-sep { width: 30px; height: 2px; border-radius: 1px; background: var(--line-strong); flex: none; }
.rail-favs:empty + .rail-sep { display: none; }
.rail-item {
  position: relative; flex: none; display: grid; place-items: center; width: var(--rail-w); padding: 0;
  background: none; border: 0; cursor: pointer; text-decoration: none;
}
.rail-item::before {
  content: ""; position: absolute; left: 0; top: 50%; width: 4px; height: 0; border-radius: 0 4px 4px 0;
  background: var(--text); transform: translateY(-50%); transition: height .15s;
}
.rail-item:hover::before { height: 18px; }
.rail-item.on::before { height: 38px; }
.room-ic {
  display: grid; place-items: center; flex: none; width: 46px; height: 46px; border-radius: 50%;
  color: #fff; font-weight: 700; font-size: 15px; background-size: cover; background-position: center;
  transition: border-radius .15s, background-color .15s, color .15s;
}
.rail-item:hover .room-ic, .rail-item.on .room-ic { border-radius: 15px; }
.rail-logo { background: var(--panel-2); color: var(--accent); }
.rail-logo svg.ic { width: 22px; height: 22px; }
.rail-item:hover .rail-logo, .rail-item.on .rail-logo { background: var(--accent); color: #fff; }
.rail-add { background: var(--panel-2); color: var(--green); }
.rail-add svg.ic { width: 22px; height: 22px; }
.rail-item:hover .rail-add { background: var(--green); color: #fff; }
.rail-badge {
  position: absolute; right: 9px; bottom: -2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  display: grid; place-items: center; background: var(--green); color: #06120c; font-size: 11px; font-weight: 800;
  box-shadow: 0 0 0 3px var(--rail-bg);
}

.lobby { height: 100%; display: flex; flex-direction: column; min-width: 0; }
.lobby-top {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 12px 64px 12px 20px;
  border-bottom: 1px solid var(--line); background: var(--panel);
}
.lobby-search { position: relative; flex: 1; min-width: 180px; max-width: 360px; display: flex; align-items: center; }
.lobby-search i { position: absolute; left: 12px; color: var(--muted); pointer-events: none; }
.lobby-search input { padding: 9px 13px 9px 38px; border-radius: 999px; }
.lobby-search input::-webkit-search-cancel-button { cursor: pointer; }
/* tudo que não é a busca fica agrupado à direita, em dois blocos (conta/sala vs. utilidades),
   em vez de uma fileira só de pílulas iguais competindo pela mesma atenção */
.lobby-top-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-left: auto; }
.btn.ghost { background: transparent; border-color: var(--line-strong); color: var(--muted); }
.btn.ghost:hover { background: var(--panel-2); color: var(--text); filter: none; }
/* fica perto do topo (como uma página normal), mas com um respiro — centralizar no meio da tela
   toda ficava estranho em monitor grande (o cartão parecia perdido, flutuando sozinho no vazio) */
.lobby-body { flex: 1; min-height: 0; overflow-y: auto; padding: 48px 20px; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.lobby-body > * { width: 100%; max-width: 560px; }
.lobby-label { font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 2px; }
.lobby-list { display: flex; flex-direction: column; gap: 6px; }
.lobby-row {
  display: flex; align-items: center; gap: 4px; padding-right: 8px; border-radius: var(--radius);
  background: var(--panel); border: 1px solid var(--line); transition: background .15s, border-color .15s;
}
.lobby-row:hover { background: var(--panel-2); border-color: var(--line-strong); }
.lobby-open {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 10px 12px; text-align: left;
  background: none; border: 0; color: var(--text); font: inherit; cursor: pointer;
}
.lobby-open .room-ic { width: 42px; height: 42px; border-radius: 13px; font-size: 14px; }
.lobby-info { display: flex; flex-direction: column; min-width: 0; }
.lobby-name { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lobby-on { color: var(--green); font-size: 12.5px; font-weight: 600; }
.lobby-off { color: var(--muted); font-size: 12.5px; }
.lobby-star {
  display: grid; place-items: center; width: 36px; height: 36px; flex: none; padding: 0; border: 0; border-radius: 50%;
  background: none; color: var(--muted); cursor: pointer; font-size: 18px; transition: color .15s, background .15s, transform .12s;
}
.lobby-star:hover { background: var(--panel-3); color: var(--text); }
.lobby-star:active { transform: scale(.9); }
.lobby-star.on { color: #f5b70a; }
.lobby-star.on svg.ic { fill: currentColor; }
/* estado vazio: um "cartão" convidativo (ícone + texto + botão) em vez de uma linha de texto
   solta — segue o mesmo visual do "ninguém compartilhando" que já existia dentro da sala */
.lobby-empty { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; padding: 28px 20px; margin-top: 8px; border: 1px dashed var(--line-strong); border-radius: 18px; }
.lobby-empty-ico {
  width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; color: var(--accent-2);
  background: var(--panel); border: 1px solid var(--line);
}
.lobby-empty-ico svg.ic { width: 26px; height: 26px; }
.lobby-empty p { color: var(--muted); max-width: 40ch; }
/* chamativo o bastante pra não passar batido, mas na cor secundária (accent-2) pra não brigar
   com o vermelho do "Criar sala", que é a ação principal da tela */
.dl-link {
  display: inline-flex; align-items: center; gap: 10px; justify-content: center; margin-top: 14px;
  padding: 12px 22px; border-radius: 999px; font-weight: 700; font-size: 14.5px; text-decoration: none;
  color: var(--text); background: rgba(var(--accent-2-rgb), .14); border: 1px solid rgba(var(--accent-2-rgb), .45);
  transition: background .15s, border-color .15s, transform .12s;
}
.dl-link:hover { background: rgba(var(--accent-2-rgb), .22); border-color: rgba(var(--accent-2-rgb), .7); }
.dl-link:active { transform: scale(.97); }
.dl-link svg.ic { color: var(--accent-2); }
/* já tá rodando no app desktop — baixar de novo não faz sentido */
.is-desktop-app .dl-link { display: none; }

#lobby-toast { z-index: 110; }
.room-ic.lg { width: 72px; height: 72px; border-radius: 20px; font-size: 24px; }
.rf-photo { display: flex; align-items: center; gap: 16px; }
.rf-photo-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.rf-seg { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.rf-opt {
  display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; text-align: left; cursor: pointer;
  background: var(--panel-2); color: var(--text); border: 1px solid var(--line-strong); border-radius: var(--radius); font: inherit;
}
.rf-opt small { color: var(--muted); font-size: 12px; }
.rf-opt.on { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .22); }
.rf-delete { margin-right: auto; }
.room-title { display: flex; align-items: center; gap: 8px; flex: none; font-weight: 700; }
.room-title .room-ic { width: 28px; height: 28px; border-radius: 9px; font-size: 11px; }
.room-title b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 26ch; }
.sound-hint {
  position: fixed; top: 64px; left: 50%; transform: translateX(-50%); z-index: 30; pointer-events: none;
  background: var(--glass); border: 1px solid var(--line-strong); padding: 8px 14px; border-radius: 12px;
  backdrop-filter: blur(14px); box-shadow: 0 10px 30px var(--shadow); font-size: 13px;
}
.is-desktop-app .lobby-top { -webkit-app-region: drag; padding-right: calc(var(--wco-right) + 60px); }
.is-desktop-app .lobby-top button, .is-desktop-app .lobby-top input, .is-desktop-app .lobby-top a { -webkit-app-region: no-drag; }
.lobby-auth { display: flex; align-items: center; gap: 8px; }
.lobby-auth .sso-btn { width: auto; padding: 8px 14px; }
.lobby-user { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; }
.lobby-user .room-ic { width: 32px; height: 32px; font-size: 12px; }

/* ---------- sala ---------- */
#room { height: 100%; display: flex; flex-direction: column; }
.topbar {
  height: 54px; display: flex; align-items: center; gap: 12px; padding: 0 60px 0 16px;
  border-bottom: 1px solid var(--line); flex: none; background: color-mix(in srgb, var(--bg) 70%, transparent);
  backdrop-filter: blur(10px);
}
.chip {
  display: inline-flex; align-items: center; gap: 7px; background: var(--panel); border: 1px solid var(--line);
  color: var(--accent-2); border-radius: 999px; padding: 5px 12px; font-size: 13px; font-weight: 600; cursor: pointer;
}
.chip:hover { border-color: var(--accent-2); }
.chip.plain { color: var(--muted); cursor: default; }
.chip.plain:hover { border-color: var(--line); }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 3px rgba(240, 82, 92, .2); }
.dot.on { background: var(--green); box-shadow: 0 0 0 3px rgba(61, 220, 151, .2); }

.body { flex: 1; min-height: 0; display: flex; }
.sidebar {
  position: relative; width: var(--side-w); flex: none; border-right: 1px solid var(--line);
  display: block; min-height: 0;
  background: color-mix(in srgb, var(--panel) 55%, transparent);
}
/* a largura é só espaço (arrastando a borda) — o tamanho da fonte é fixo, escolhido em Aparência */
.side-inner {
  display: flex; flex-direction: column; min-height: 0; zoom: var(--ui-scale);
  width: 100%; height: 100%; /* o Chrome já compensa o zoom nas porcentagens */
}
.sidebar { transition: margin-left .25s ease; }
/* lista recolhida: sai pela esquerda e a tela ocupa tudo; mic/fone passam pra barra de baixo */
body.side-collapsed .sidebar { margin-left: calc(-1 * var(--side-w) - 1px); }
body.resizing .sidebar, body.resizing .dock { transition: none; }

/* borda arrastável para ajustar a largura */
.resizer { position: absolute; top: 0; bottom: 0; right: -5px; width: 10px; cursor: col-resize; z-index: 6; touch-action: none; }
.resizer::after { content: ""; position: absolute; left: 4px; top: 0; bottom: 0; width: 2px; background: transparent; transition: background .15s; }
.resizer:hover::after, body.resizing .resizer::after { background: var(--accent); }
body.resizing { cursor: col-resize; user-select: none; }
body.resizing video, body.resizing .stage { pointer-events: none; }
#btn-side.on { color: var(--accent-2); }
.code-card {
  margin: 12px; padding: 14px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 16px; display: flex; flex-direction: column; gap: 10px;
}
/* login SSO */
.sso { display: flex; flex-direction: column; gap: 12px; }
.sso-buttons { display: flex; flex-direction: column; gap: 8px; }
.sso-btn { width: 100%; text-decoration: none; border-radius: var(--radius); padding: 11px 16px; }
.sso-btn[data-p="discord"] { background: #5865f2; color: #fff; border-color: transparent; }
.sso-btn[data-p="google"] { background: #fff; color: #1f1f1f; border-color: #dadce0; }
.sso-user { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--panel-2); }
.sso-user .avatar { width: 40px; height: 40px; }
.sso-user .avatar::after { display: none; }
.sso-text { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.sso-text b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sso-text small { color: var(--green); font-weight: 600; }
.sso-out { color: var(--muted); font-size: 13px; text-decoration: none; }
.sso-out:hover { color: var(--red); }
.set-sso p { margin: 0 0 14px; }
.set-sso .btn { text-decoration: none; }
.pix-card { gap: 12px; container-type: inline-size; }
/* lista muito estreita: empilha o QR em cima do botão em vez de espremer os dois lado a lado */
@container (max-width: 230px) {
  .pix-row { flex-direction: column; align-items: stretch; }
  .pix-qr { align-self: center; }
}
.pix-head { display: flex; align-items: center; gap: 9px; font-size: 15px; }
.pix-heart { color: #ff5d8f; display: inline-grid; }
.pix-heart svg.ic { width: 18px; height: 18px; fill: #ff5d8f; }
.pix-text { color: var(--muted); font-size: 13px; line-height: 1.5; }
.pix-row { display: flex; align-items: center; gap: 12px; }
.pix-qr { flex: none; display: block; width: 84px; height: 84px; border-radius: 12px; overflow: hidden; border: 1px solid var(--line-strong); background: #fff; }
.pix-qr img { display: block; width: 100%; height: 100%; object-fit: cover; }
.pix-row .btn { flex: 1; width: auto; min-width: 0; padding: 10px 8px; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.label { font-size: 11px; letter-spacing: .12em; color: var(--muted); font-weight: 700; }
.code-line { display: flex; align-items: center; justify-content: space-between; font-weight: 800; font-size: 17px; }
.lists {
  flex: 1; overflow-y: auto; padding: 4px 8px 0;
  scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent;
}
.lists::-webkit-scrollbar { width: 8px; }
.lists::-webkit-scrollbar-track { background: transparent; }
.lists::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 8px; }
.lists::-webkit-scrollbar-thumb:hover { background: var(--muted); }
/* cabeçalhos "Transmitindo" e "Na sala" */
.sec {
  display: flex; align-items: center; gap: 8px; padding: 18px 10px 8px; color: var(--muted);
  font-size: 11px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase;
}
.sec:first-child { padding-top: 10px; }
.sec-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sec-ico { display: inline-grid; place-items: center; width: 16px; height: 16px; }
.sec-ico svg.ic { width: 15px; height: 15px; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); opacity: .6; }
.sec.active { color: var(--text); }
.sec.active .live-dot { background: var(--red); opacity: 1; animation: live-pulse 1.6s ease-out infinite; }
@keyframes live-pulse {
  0% { box-shadow: 0 0 0 0 rgba(240, 82, 92, .55); }
  70% { box-shadow: 0 0 0 7px rgba(240, 82, 92, 0); }
  100% { box-shadow: 0 0 0 0 rgba(240, 82, 92, 0); }
}
.sec-count {
  min-width: 22px; height: 20px; padding: 0 7px; display: inline-grid; place-items: center; border-radius: 999px;
  background: var(--panel-2); border: 1px solid var(--line-strong); color: var(--text); font-size: 11px; letter-spacing: 0;
}
.sec.active .sec-count { background: rgba(240, 82, 92, .14); border-color: rgba(240, 82, 92, .4); color: var(--red); }
.sec-add { padding: 3px; margin-right: -2px; }
.sec-add svg.ic { width: 15px; height: 15px; }

/* salas de voz */
.chan { margin-bottom: 6px; border-radius: 12px; }
.chan-head {
  display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 10px; cursor: pointer;
  color: var(--muted); font-weight: 700; font-size: 13px; transition: background .15s, color .15s;
}
.chan-head:hover { background: var(--panel-2); color: var(--text); }
.chan-ico { display: inline-grid; place-items: center; }
.chan-del { padding: 2px; opacity: 0; }
.chan-del svg.ic { width: 14px; height: 14px; }
.chan-head:hover .chan-del { opacity: 1; }
.chan-del:hover { color: var(--red); }
.chan-ico svg.ic { width: 15px; height: 15px; }
.chan-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chan-count { font-size: 11px; font-weight: 700; color: var(--muted); }
.chan.mine .chan-head { color: var(--accent-2); }
.chan.mine .chan-ico { color: var(--green); }
.chan .user { margin-left: 8px; }
/* arrastar uma pessoa para outra sala */
.user[draggable="true"] { cursor: grab; }
.user.dragging { opacity: .4; }
.chan { transition: background .12s; }
.chan.drop { background: rgba(var(--accent-rgb), .16); outline: 2px dashed var(--accent); outline-offset: -2px; }
.chan.drop .chan-head { color: var(--text); }
.sec-empty {
  margin: 2px 8px 0; padding: 12px; text-align: center; font-size: 12.5px; color: var(--muted);
  border: 1px dashed var(--line-strong); border-radius: 12px;
}

.user {
  position: relative; display: flex; align-items: center; gap: 11px; padding: 7px 8px; border-radius: 12px; cursor: default;
  transition: background .15s;
}
.user.watchable { cursor: pointer; }
.user:hover, .user.active { background: var(--panel-2); }
.user.active { box-shadow: inset 3px 0 0 var(--accent); }
.avatar {
  position: relative; width: 38px; height: 38px; border-radius: 50%; flex: none; display: grid; place-items: center;
  font-weight: 700; font-size: 13px; color: #fff; transition: box-shadow .15s;
}
.avatar::after {
  content: ""; position: absolute; right: -1px; bottom: -1px; width: 11px; height: 11px;
  border-radius: 50%; background: var(--green); border: 2.5px solid var(--bg);
}
.userbar .avatar::after { border-color: var(--panel-2); }
.user.speaking .avatar, .me-card.speaking .avatar { box-shadow: 0 0 0 2.5px var(--bg), 0 0 0 5px var(--green); }
.user .info { flex: 1; min-width: 0; }
.user .name { font-weight: 600; display: flex; align-items: center; gap: 6px; cursor: pointer; }
.user .name .n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user .name:hover .n { text-decoration: underline; }

.uprofile {
  position: fixed; z-index: 60; width: 300px; overflow: hidden;
  background: var(--panel); border: 1px solid var(--line-strong); border-radius: 8px;
  box-shadow: 0 8px 24px var(--shadow);
}
.up-banner { height: 60px; }
.up-body { position: relative; padding: 0 16px 16px; margin-top: -30px; }
.uprofile .up-av {
  width: 80px; height: 80px; font-size: 26px; border: 6px solid var(--panel); box-sizing: border-box;
}
.uprofile .avatar::after { width: 16px; height: 16px; border-width: 4px; border-color: var(--panel); right: 2px; bottom: 2px; }
.up-id { margin-top: 10px; }
.up-name { display: flex; align-items: center; gap: 6px; font-size: 20px; font-weight: 800; line-height: 1.2; }
.up-name .n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.up-status { margin-top: 2px; color: var(--muted); font-size: 13px; }
.up-actions { display: flex; justify-content: flex-end; gap: 8px; min-height: 8px; margin-top: 8px; }
.up-actions:empty { display: none; }
.up-act {
  width: 36px; height: 36px; border-radius: 50%; background: var(--panel-2); border: 1px solid var(--line);
}
.up-act:hover { color: var(--text); background: var(--panel-3); }
.up-box {
  margin-top: 12px; padding: 12px; border-radius: 8px; background: var(--panel-2);
  display: flex; flex-direction: column; gap: 4px;
}
.up-k { margin-top: 8px; font-size: 12px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.up-box .up-k:first-child { margin-top: 0; }
.up-v { font-size: 14px; font-weight: 600; }
.up-roles { min-height: 28px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.up-role {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px; border-radius: 4px;
  background: var(--panel-3); font-size: 12px; font-weight: 600;
}
.up-role.none {
  color: var(--muted); font-weight: 500; background: transparent;
  border: 1px dashed var(--line-strong); border-radius: 6px;
}
.user .name .crown { color: #f5b942; display: inline-flex; }
.user .status { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user .status.live { color: var(--green); font-weight: 600; }
.flags { display: inline-flex; gap: 4px; color: var(--red); }
.user .mon { color: var(--green); display: inline-flex; flex: none; margin-left: 6px; }
.user .umute { opacity: 0; width: 28px; height: 28px; font-size: 14px; }
.user:hover .umute, .user .umute.off { opacity: 1; }
.user .uact { opacity: 0; width: 28px; height: 28px; }
.user:hover .uact { opacity: 1; }
.user .uact:hover { color: var(--accent-2); }
.user .uact.on { opacity: 1; color: var(--accent-2); } /* já tem permissão: sempre visível */
.user .uact.off { opacity: 1; color: var(--red); } /* apontando agora: sempre visível, pra dar pra parar */
.user .uact.off:hover { color: var(--red); }
.user .umute.off { color: var(--red); }
.badge {
  font-size: 10px; font-weight: 800; letter-spacing: .06em; color: var(--accent-2);
  background: rgba(var(--accent-2-rgb), .13); border: 1px solid rgba(var(--accent-2-rgb), .3);
  padding: 1px 6px; border-radius: 5px;
}

.userbar {
  display: flex; align-items: center; gap: 2px; margin: 10px; padding: 8px; flex: none;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 16px;
}
.me-card {
  display: flex; align-items: center; gap: 9px; flex: 1; min-width: 0; padding: 3px 6px 3px 3px;
  background: transparent; border: 0; border-radius: 10px; color: var(--text); font: inherit; cursor: pointer; text-align: left;
}
.me-card:hover { background: var(--panel-3); }
.me-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.me-text b, .me-text span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.userbar .ibtn { width: 34px; height: 34px; font-size: 16px; flex: none; }

/* ---------- painel de amigos (fica por cima da lista da sala, dentro da própria barra lateral) ---------- */
.friends-side {
  position: absolute; inset: 0; z-index: 5; display: flex; flex-direction: column; min-height: 0;
  background: var(--bg);
}
.friends-side-head {
  display: flex; align-items: center; gap: 10px; flex: none; padding: 16px;
  border-bottom: 1px solid var(--line); font-weight: 800; font-size: 15px;
}
.friends-side-head .cnt { position: static; }
.friends-side-body { flex: 1; min-height: 0; overflow-y: auto; padding: 16px; }
.friends-side-body h3 { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 24px 0 10px; }
.friends-side-body .friends-group:first-of-type h3 { margin-top: 4px; }

/* ---------- palco ---------- */
.main { flex: 1; min-width: 0; display: flex; flex-direction: row; padding: 14px 14px calc(var(--dock-h, 58px) + 34px); gap: 12px; }
.stage {
  position: relative; flex: 1; min-height: 0; min-width: 0; background: var(--stage); border: 1px solid var(--line);
  border-radius: 20px; overflow: hidden; box-shadow: 0 16px 50px var(--shadow);
}
.stage-holder { position: absolute; inset: 0; transform-origin: center center; transition: transform .08s linear; }
.stage-holder .tile { width: 100%; height: 100%; }
.stage-holder video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.empty {
  position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 6px; text-align: center;
}
.empty-ico {
  width: 74px; height: 74px; border-radius: 22px; display: grid; place-items: center; color: var(--accent-2);
  background: var(--panel); border: 1px solid var(--line); margin-bottom: 6px;
}
.empty-ico svg.ic { width: 34px; height: 34px; }
.empty-title { font-weight: 700; font-size: 16px; }

.tile { position: relative; }
.tile .tag {
  position: absolute; left: 14px; top: 14px; display: flex; align-items: center; gap: 8px;
  background: var(--tag-bg); border: 1px solid var(--line-strong); border-radius: 999px; backdrop-filter: blur(8px);
  padding: 5px 13px; font-weight: 600; pointer-events: none;
}
.tile .tag::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 3px rgba(240, 82, 92, .25); }
.tile-stop {
  position: absolute; top: 12px; right: 12px; z-index: 2; background: var(--red); color: #fff;
  border: 0; border-radius: 999px; padding: 5px 12px; font-size: 12px; font-weight: 700; cursor: pointer; opacity: .92;
}
.tile-stop:hover { opacity: 1; }

body.mosaic .stage-holder { display: grid; grid-auto-rows: 1fr; gap: 6px; }
body.mosaic .stage-holder .tile { min-width: 0; min-height: 0; cursor: pointer; border-radius: 10px; overflow: hidden; }
body.mosaic .thumbs-col { display: none; }
.tile-name { display: none; }
.thumbs-col { flex: none; width: 200px; display: flex; flex-direction: column; gap: 8px; min-height: 0; }
.thumbs { display: flex; flex-direction: column; gap: 10px; overflow-y: auto; min-height: 0; }
.thumbs:empty { display: none; }
/* alça de puxar/empurrar a faixa de miniaturas (fica na borda mesmo com a faixa escondida) */
.thumbs-tab {
  position: relative; flex: none; align-self: center; width: 18px; height: 72px; margin: 0 -8px; padding: 0;
  display: grid; place-items: center; border: 1px solid var(--line); border-radius: 9px;
  background: var(--panel); color: var(--muted); cursor: grab; touch-action: none; z-index: 3;
  transition: color .15s, border-color .15s, background .15s;
}
.thumbs-tab[hidden] { display: none; }
.thumbs-tab:hover { color: var(--text); border-color: var(--accent); }
.thumbs-tab.dragging { cursor: grabbing; border-color: var(--accent); }
.thumbs-tab svg.ic { width: 16px; height: 16px; transform: rotate(-90deg); transition: transform .2s; }
body.thumbs-hidden .thumbs-tab { margin: 0 2px 0 -4px; color: var(--accent-2); }
body.thumbs-hidden .thumbs-tab svg.ic { transform: rotate(90deg); }
body.mosaic .thumbs-tab { display: none; }
.thumbs-tab .cnt { top: -7px; right: -7px; }
.thumbs-col:has(> .thumbs:empty) { display: none; }
.thumbs .tile {
  width: 100%; flex: none; border-radius: 12px; overflow: hidden; border: 2px solid var(--line);
  cursor: pointer; background: var(--panel); transition: transform .15s, border-color .15s;
}
.thumbs .tile:hover { border-color: var(--accent); transform: translateY(-2px); }
.thumbs video { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: #000; }
.thumbs .tag { display: none; }
.thumbs .tile-name { display: block; padding: 3px 8px; font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thumbs .tile-stop { top: 6px; right: 6px; padding: 2px 8px; font-size: 11px; }

.vol {
  position: absolute; right: 14px; bottom: 14px; z-index: 2; display: flex; align-items: center; gap: 4px;
  background: var(--tag-bg); border: 1px solid var(--line-strong); border-radius: 999px; padding: 3px 14px 3px 6px;
  backdrop-filter: blur(8px);
}
.vol input[type=range] { width: 110px; padding: 0; border: 0; background: transparent; accent-color: var(--accent); cursor: pointer; box-shadow: none; }

/* ---------- reações ---------- */
.reactions { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }

/* ponteiro e desenho sobre a transmissão */
.ptr-toggle {
  position: absolute; left: 14px; bottom: 14px; z-index: 3; background: var(--tag-bg); border: 1px solid var(--line-strong);
  border-radius: 999px; backdrop-filter: blur(8px); width: 38px; height: 38px;
}
.ptr-toggle.on { color: var(--accent-2); border-color: var(--accent-2); background: rgba(var(--accent-2-rgb), .16); }
.stage.ptr-active .stage-holder, .stage.ptr-active .ptr-overlay { cursor: crosshair; }
/* com zoom, segurar o botão esquerdo arrasta a tela pra qualquer direção (não só o centro) */
.stage.zoomed:not(.ptr-active) .stage-holder { cursor: grab; }
.stage.zoomed.panning:not(.ptr-active) .stage-holder { cursor: grabbing; }
.ptr-overlay { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 4; pointer-events: none; overflow: visible; }
.stage.ptr-active .ptr-overlay { pointer-events: auto; }
.ptr-cursor { pointer-events: none; }
.ptr-cursor .dot { filter: drop-shadow(0 1px 4px rgba(0, 0, 0, .5)); }
.ptr-cursor text {
  font: 700 11px/1 Inter, "Segoe UI", system-ui, sans-serif; fill: #fff; paint-order: stroke; stroke: rgba(0, 0, 0, .55); stroke-width: 3px;
}
.ptr-stroke { fill: none; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; animation: ptr-fade 2.4s ease-in forwards; }
@keyframes ptr-fade { 0%, 55% { opacity: 1; } 100% { opacity: 0; } }
.float {
  position: absolute; bottom: 20px; display: flex; flex-direction: column; align-items: center;
  animation: rise 2.6s ease-out forwards;
}
.float .e { font-size: 42px; filter: drop-shadow(0 4px 10px rgba(0, 0, 0, .4)); }
.float .w { font-size: 11px; font-weight: 600; background: var(--tag-bg); border: 1px solid var(--line-strong); padding: 1px 8px; border-radius: 999px; }
@keyframes rise {
  0% { transform: translateY(0) scale(.6); opacity: 0; }
  12% { opacity: 1; transform: translateY(-20px) scale(1.05); }
  100% { transform: translateY(-280px) scale(1.15); opacity: 0; }
}

/* ---------- barra de controles (estilo Discord) ---------- */
/* ---------- música da sala ---------- */
.music {
  position: fixed; right: 16px; bottom: calc(var(--dock-h, 58px) + 34px); z-index: 12; width: 356px;
  max-width: calc(100vw - 32px); max-height: calc(100vh - var(--dock-h, 58px) - 110px); display: flex; flex-direction: column;
  background: var(--panel); border: 1px solid var(--line-strong); border-radius: var(--radius);
  box-shadow: 0 12px 34px var(--shadow); overflow: hidden;
}
.music[hidden] { display: none; }
.music-head { flex: none; display: flex; align-items: center; justify-content: space-between; padding: 8px 8px 8px 14px; }
.music-player { flex: none; }
.music-player[hidden] { display: none; }
.music-yt-box { height: 200px; background: #000; }
.music-yt-box iframe { display: block; width: 100%; height: 100%; border: 0; }
.music-sp-box { height: 152px; }
.music-sp-box iframe { display: block; border: 0; }
.music-yt-box[hidden], .music-sp-box[hidden] { display: none; }
.music-body { min-height: 0; overflow-y: auto; padding: 10px 14px 14px; display: flex; flex-direction: column; gap: 10px; }
.music.mini .music-head, .music.mini .music-body { display: none; }
.music-hint { padding: 7px 10px; border-radius: 8px; font-size: 12px; background: rgba(var(--accent-2-rgb), .14); color: var(--text); }
.music-hint[hidden], .music-now[hidden], .music-controls[hidden] { display: none; }
.music-now { display: flex; align-items: center; gap: 10px; min-width: 0; }
.music-now img { flex: none; width: 48px; height: 48px; object-fit: cover; border-radius: 6px; background: var(--panel-3); }
.music-now img:not([src]) { visibility: hidden; }
.music-meta { min-width: 0; }
.music-title { font-weight: 700; font-size: 13px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.music-controls { display: flex; align-items: center; gap: 6px; }
.music-controls input[type=range] { flex: 1; min-width: 0; padding: 0; border: 0; background: transparent; accent-color: var(--accent); box-shadow: none; }
.music-listen { flex: none; display: flex; align-items: center; gap: 10px; padding: 10px 14px 0; }
.music.mini .music-listen { padding: 8px 10px; }
.music-listen .btn { flex: none; }
.music-vol { flex: 1; display: flex; align-items: center; gap: 6px; color: var(--muted); }
.music-vol[hidden] { display: none; }
.music-vol input[type=range] { flex: 1; min-width: 0; padding: 0; border: 0; background: transparent; accent-color: var(--accent); box-shadow: none; }
.music-form { display: flex; gap: 8px; }
.music-form input { flex: 1; min-width: 0; }
.music-queue { display: flex; flex-direction: column; gap: 4px; }
.music-item { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 4px 0; font-size: 12px; }
.music-item .t { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#btn-music.on { color: var(--accent-2); background: rgba(var(--accent-2-rgb), .14); }

.dock {
  /* centralizada na área da tela (entre a lista de pessoas e o chat), não na janela inteira */
  position: fixed; left: calc(var(--rail-w) + var(--left-used) + (100vw - var(--rail-w) - var(--left-used) - var(--right-used)) / 2);
  bottom: 16px; transform: translateX(-50%); z-index: 5; transition: left .25s ease;
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 10px;
  width: max-content; max-width: calc(100vw - var(--rail-w) - var(--left-used) - var(--right-used) - 16px);
}
.dgrp {
  position: relative; display: flex; align-items: center; gap: 6px; padding: 6px;
  background: var(--glass); border: 1px solid var(--line-strong); border-radius: 14px; backdrop-filter: blur(16px);
  box-shadow: 0 10px 30px var(--shadow);
}
.dsplit { display: flex; align-items: center; }
.dgrp.share { gap: 12px; padding: 6px 8px; } /* "Outra tela" e "Parar de compartilhar" não ficam mais grudados */
.dbtn {
  position: relative; min-width: 44px; height: 44px; padding: 0 12px; display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; background: transparent; color: var(--text); border: 0; border-radius: 10px; cursor: pointer;
  font: inherit; font-weight: 700; white-space: nowrap; transition: background .15s, color .15s, transform .1s, filter .15s;
}
.dbtn svg.ic { width: 21px; height: 21px; }
.dbtn:hover { background: var(--panel-3); }
.dbtn:active { transform: scale(.95); }
.dbtn:disabled { opacity: .5; cursor: not-allowed; }
.dbtn.off { color: var(--red); background: rgba(240, 82, 92, .12); }
.dbtn.off:hover { background: rgba(240, 82, 92, .22); }
.dbtn.on { color: var(--accent-2); background: rgba(var(--accent-2-rgb), .14); }
.dbtn.wide { padding: 0 18px; }
.dbtn.primary { background: var(--grad); color: #fff; box-shadow: 0 4px 16px rgba(var(--accent-rgb), .35); }
.dbtn.primary:hover { background: var(--grad); filter: brightness(1.1); }
.dbtn.stop { background: var(--red); color: #fff; }
.dbtn.stop:hover { background: var(--red); filter: brightness(1.1); }
.dbtn.leave {
  min-width: 60px; height: 58px; border-radius: 14px; background: var(--red); color: #fff;
  box-shadow: 0 10px 30px rgba(240, 82, 92, .35);
}
.dbtn.leave:hover { background: var(--red); filter: brightness(1.1); }
.dchev {
  width: 24px; height: 44px; display: inline-grid; place-items: center; padding: 0; margin-left: -4px;
  background: transparent; border: 0; border-radius: 8px; color: var(--muted); cursor: pointer; transition: background .15s, color .15s;
}
.dchev svg.ic { width: 15px; height: 15px; }
.dchev:hover { background: var(--panel-3); color: var(--text); }
/* no botão de compartilhar (fundo colorido) o "grudado" do mic/fone fica apertado: dá um respiro */
#chev-share { margin-left: 6px; }

/* reações (abrem acima do botão ✨) */
.react-pop {
  position: absolute; bottom: calc(100% + 12px); left: 0; display: flex; gap: 2px; padding: 8px;
  background: var(--glass); border: 1px solid var(--line-strong); border-radius: 14px; backdrop-filter: blur(16px);
  box-shadow: 0 14px 40px var(--shadow);
}
.react {
  background: transparent; border: 0; font-size: 26px; cursor: pointer; padding: 6px 8px; border-radius: 10px;
  transition: transform .12s, background .15s; line-height: 1;
}
.react:hover { transform: scale(1.3) translateY(-2px); background: var(--panel-3); }
.react:active { transform: scale(.9); }

/* ---------- tela de configurações (engrenagem) ---------- */
.settings { position: fixed; inset: 0; z-index: 90; display: flex; background: var(--bg); animation: modal-fade .15s ease-out; }
.set-nav {
  width: min(300px, 32vw); flex: none; padding: 22px 14px; display: flex; flex-direction: column; gap: 2px;
  background: var(--panel); border-right: 1px solid var(--line); overflow-y: auto;
}
.set-user {
  display: flex; align-items: center; gap: 12px; padding: 8px; margin-bottom: 8px; border: 0; border-radius: 12px;
  background: transparent; color: var(--text); cursor: pointer; text-align: left; font: inherit;
}
.set-user:hover { background: var(--panel-2); }
.set-user .avatar { width: 50px; height: 50px; font-size: 17px; }
.set-user .avatar::after { display: none; }
.avatar-edit { display: flex; align-items: center; gap: 16px; margin: 4px 0 20px; }
.avatar.lg { width: 72px; height: 72px; font-size: 24px; }
.avatar.lg::after { display: none; }
.avatar-edit-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.friends-group { margin-top: 22px; }
.friends-group:first-of-type { margin-top: 4px; }
.friends-list { display: flex; flex-direction: column; gap: 6px; }
.friends-empty { color: var(--muted); font-size: 13px; padding: 4px 2px; }
.friend-row {
  display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 12px;
  background: var(--panel); border: 1px solid var(--line);
}
.friend-row .avatar { width: 36px; height: 36px; font-size: 13px; }
.friend-row .avatar::after { display: none; }
.friend-dot {
  position: absolute; right: -1px; bottom: -1px; width: 11px; height: 11px; border-radius: 50%;
  background: var(--muted); border: 2.5px solid var(--panel);
}
.friend-dot.on { background: var(--green); }
.friend-name { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.friend-row .btn { padding: 7px 12px; font-size: 13px; }
.set-user-text { display: flex; flex-direction: column; min-width: 0; }
.set-user-text b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 16px; }
.set-cat { padding: 16px 10px 6px; font-size: 12px; font-weight: 700; color: var(--muted); }
.set-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 0; border-radius: 10px; background: transparent;
  color: var(--muted); font: inherit; font-weight: 600; cursor: pointer; text-align: left;
}
.set-item:hover { background: var(--panel-2); color: var(--text); }
.set-item.on { background: var(--panel-3); color: var(--text); }
.set-item .cnt { position: static; margin-left: auto; }
.set-main { flex: 1; min-width: 0; overflow-y: auto; position: relative; }
.set-x {
  position: fixed; top: 22px; right: 30px; display: grid; justify-items: center; gap: 4px; z-index: 2;
  background: transparent; border: 0; color: var(--muted); cursor: pointer;
}
/* no app desktop a área de cima à direita é dos botões nativos (minimizar/maximizar/fechar) — além
   de não disputar espaço com eles no lado (não muda de lado, senão bate no cartão da conta que já
   fica ali à esquerda), também desce o botão, porque a faixa nativa tem 44px de altura e o ícone
   sozinho (começando em 22px) ficava embaixo dela — clique no círculo não registrava, só no texto */
.is-desktop-app .set-x { top: 54px; right: calc(var(--wco-right) + 10px); }
.set-x i { width: 38px; height: 38px; display: grid; place-items: center; border: 2px solid var(--muted); border-radius: 50%; }
.set-x span { font-size: 11px; font-weight: 800; letter-spacing: .04em; }
.set-x:hover { color: var(--text); }
.set-x:hover i { border-color: var(--text); }
.set-content { max-width: 760px; margin: 0 auto; padding: 56px 28px 90px; }
.set-page h2 { font-size: 26px; letter-spacing: -.02em; margin: 0 0 22px; }
.set-page h3 { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 24px 0 10px; }
.set-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px 26px; }
.set-grid.one { grid-template-columns: 1fr; max-width: 420px; }
.set-grid label { display: block; font-size: 13px; font-weight: 700; }
.set-grid label > select, .set-grid label > input { display: block; margin-top: 8px; width: 100%; }
.set-grid select, .set-page select {
  background: var(--panel-2); color: var(--text); border: 1px solid var(--line-strong); border-radius: 10px;
  padding: 11px 12px; font: inherit; font-weight: 500;
}
.set-grid input[type=range] { padding: 0; border: 0; background: transparent; accent-color: var(--accent); box-shadow: none; cursor: pointer; }
.set-val { color: var(--muted); font-weight: 600; margin-left: 6px; }
.set-test { display: flex; align-items: center; gap: 20px; margin: 28px 0 8px; }
.meter { flex: 1; display: flex; gap: 3px; align-items: center; height: 40px; }
.meter i { flex: 1; max-width: 5px; height: 100%; border-radius: 3px; background: var(--line-strong); transition: background .06s; }
.meter i.on { background: var(--accent); }
.set-page hr { border: 0; border-top: 1px solid var(--line); margin: 28px 0 4px; }
.radio {
  display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; margin-bottom: 8px; cursor: pointer;
  border: 1px solid var(--line); border-radius: 12px; transition: border-color .15s, background .15s;
}
.radio:hover { background: var(--panel-2); }
.radio:has(input:checked) { border-color: var(--accent); background: rgba(var(--accent-rgb), .08); }
.radio input { width: auto; padding: 0; border: 0; margin-top: 4px; accent-color: var(--accent); box-shadow: none; }
.radio span { display: flex; flex-direction: column; gap: 2px; }
.radio b { font-size: 15px; }
.radio small { color: var(--muted); font-size: 12.5px; }
.custom-opts { display: flex; flex-direction: column; gap: 10px; padding: 8px 14px 4px; }
.check { display: flex; align-items: center; gap: 10px; font-size: 14px; cursor: pointer; }
.check input { width: auto; padding: 0; border: 0; accent-color: var(--accent); box-shadow: none; }
.theme-pick { display: flex; gap: 12px; flex-wrap: wrap; }
.theme-card {
  display: flex; align-items: center; gap: 10px; padding: 14px 22px; border-radius: 12px; cursor: pointer;
  border: 2px solid var(--line-strong); background: var(--panel); color: var(--text); font: inherit; font-weight: 700;
}
.theme-card:hover { background: var(--panel-2); }
.theme-card.on { border-color: var(--accent); }
.color-dot { width: 18px; height: 18px; border-radius: 50%; flex: none; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .15); }
.stats { color: var(--green); font-weight: 600; padding: 10px 12px; background: var(--panel-2); border-radius: 10px; margin: 18px 0 10px; }
.set-page .small { line-height: 1.55; }


/* chat de texto */
.chat {
  position: relative; width: var(--chat-w); flex: none; min-height: 0; overflow: hidden;
  border-left: 1px solid var(--line); background: color-mix(in srgb, var(--panel) 55%, transparent);
  transition: width .26s cubic-bezier(.3, .9, .3, 1), border-color .26s, opacity .2s ease;
}
.chat.chat-closed { width: 0; min-width: 0; border-left-color: transparent; opacity: 0; pointer-events: none; }
.chat-inner {
  display: flex; flex-direction: column; min-height: 0; zoom: var(--ui-scale);
  width: 100%; height: 100%; /* 100% (não um px fixo) pro Chrome compensar o zoom certo, como no .side-inner */
}
.chat .resizer { right: auto; left: 0; }
.chat-head { display: flex; align-items: center; gap: 9px; padding: 14px 14px 12px; border-bottom: 1px solid var(--line); }
.chat-head b { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-ico { color: var(--accent-2); display: inline-grid; }
.chat-tabs { display: flex; gap: 6px; padding: 10px 10px 0; overflow-x: auto; flex: none; }
.chat-tab {
  position: relative; flex: none; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line-strong);
  background: var(--panel-2); color: var(--muted); font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer;
  transition: background .15s, border-color .15s, color .15s, transform .1s;
}
.chat-tab:hover { border-color: var(--accent); color: var(--text); }
.chat-tab:active { transform: scale(.95); }
.chat-tab.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.chat-tab .cnt { position: static; margin-left: 6px; display: inline-flex; }
.chat-list { flex: 1; min-height: 0; overflow-y: auto; padding: 10px 6px 8px; display: flex; flex-direction: column; }
.chat-empty { margin: 0 auto; padding: 16px; text-align: center; color: var(--muted); font-size: 13px; }
@keyframes msg-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.msg { display: flex; gap: 10px; padding: 6px 10px; border-radius: 10px; transition: background .15s; animation: msg-in .22s cubic-bezier(.2, .7, .3, 1) both; }
.msg:hover { background: var(--panel-2); }
.msg.grouped { padding-top: 0; padding-bottom: 2px; }
.msg-gap { width: 30px; flex: none; }
.msg .avatar.sm { width: 30px; height: 30px; font-size: 11px; margin-top: 2px; }
.avatar.sm::after { display: none; }
.msg-body { min-width: 0; flex: 1; display: flex; flex-direction: column; align-items: flex-start; }
.msg.mine .msg-body { align-items: flex-end; }
.msg-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 3px; }
.msg.mine .msg-head { flex-direction: row-reverse; }
.msg-name { font-weight: 700; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg.mine .msg-name { color: var(--accent-2); }
.msg-time { font-size: 11px; color: var(--muted); }
.msg-text {
  max-width: 100%; font-size: 14px; line-height: 1.4; overflow-wrap: anywhere; white-space: pre-wrap;
  background: var(--panel-2); border: 1px solid var(--line); padding: 7px 12px; border-radius: 14px 14px 14px 4px;
}
.msg.mine .msg-text { background: var(--grad); border-color: transparent; color: #fff; border-radius: 14px 14px 4px 14px; }
.msg-text a { color: var(--accent-2); text-decoration: none; }
.msg.mine .msg-text a { color: #fff; text-decoration: underline; }
.msg-text a:hover { text-decoration: underline; }
/* anexos: imagem, áudio gravado e arquivo genérico */
.msg-img { display: block; width: 220px; height: 160px; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); }
.msg-img img { display: block; width: 100%; height: 100%; object-fit: cover; }
.msg-audio audio { max-width: 240px; height: 36px; }
.msg-file {
  display: flex; align-items: center; gap: 10px; max-width: 240px; padding: 9px 12px; border-radius: 14px 14px 14px 4px;
  background: var(--panel-2); border: 1px solid var(--line); color: var(--text); text-decoration: none;
}
.msg.mine .msg-file { border-radius: 14px 14px 4px 14px; }
.msg-file-ic { flex: none; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 8px; background: var(--panel-3); color: var(--accent-2); }
.msg-file-ic svg.ic { width: 17px; height: 17px; }
.msg-file-info { display: flex; flex-direction: column; min-width: 0; gap: 1px; }
.msg-file-info b { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-file-info small { font-size: 11px; color: var(--muted); }
.chat-preview {
  margin: 0 10px 8px; padding: 8px 12px; border-radius: 12px; background: rgba(240, 82, 92, .12);
  border: 1px solid var(--red); color: var(--text); font-size: 13px; font-weight: 600;
}
.chat-form { display: flex; align-items: center; gap: 6px; margin: 8px 10px; }
.chat-form input { border-radius: 999px; padding: 10px 16px; transition: box-shadow .15s; }
.chat-form input:focus { box-shadow: 0 0 0 2px var(--accent); }
.chat-form .ibtn { flex: none; }
.chat-form .send { width: 38px; height: 38px; background: var(--grad); color: #fff; flex: none; transition: transform .12s, filter .15s; }
.chat-form .send:active { transform: scale(.9); }
.chat-form .send:hover { filter: brightness(1.12); background: var(--grad); }

/* diálogo de texto */
.modal {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px;
  background: rgba(4, 6, 12, .6); backdrop-filter: blur(5px);
  animation: modal-fade .15s ease-out;
}
.modal-card {
  width: min(400px, 100%); padding: 22px; display: flex; flex-direction: column; gap: 12px;
  background: var(--panel); border: 1px solid var(--line-strong); border-radius: 20px;
  box-shadow: 0 24px 70px var(--shadow); animation: modal-pop .18s ease-out;
}
.modal-title { font-size: 18px; font-weight: 800; letter-spacing: -.01em; }
.modal-text { color: var(--muted); font-size: 13px; line-height: 1.5; margin-top: -6px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }
@keyframes modal-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes modal-pop { from { opacity: 0; transform: translateY(8px) scale(.97); } to { opacity: 1; transform: none; } }

/* menu de clique direito */
.ctx {
  position: fixed; z-index: 50; width: 268px; padding: 6px; display: flex; flex-direction: column;
  background: var(--panel); border: 1px solid var(--line-strong); border-radius: 12px;
  box-shadow: 0 16px 48px var(--shadow); user-select: none; max-height: calc(100vh - 16px); overflow-y: auto;
}
.cm-head { padding: 8px 10px 6px; font-weight: 800; font-size: 13px; letter-spacing: .01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cm-sep { height: 1px; background: var(--line); margin: 5px 4px; }
.cm-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; text-align: left;
  background: transparent; border: 0; color: var(--text); font: inherit; font-size: 13.5px; padding: 8px 10px;
  border-radius: 8px; cursor: pointer;
}
.cm-item:hover { background: var(--accent); color: #fff; }
.cm-item.danger { color: var(--red); }
.cm-item.danger:hover { background: var(--red); color: #fff; }
.cm-box {
  width: 18px; height: 18px; flex: none; border-radius: 5px; border: 2px solid var(--muted); display: grid; place-items: center; color: #fff;
}
.cm-box.on { background: var(--accent); border-color: var(--accent); }
.cm-box svg.ic { width: 12px; height: 12px; stroke-width: 3; }
.cm-item:hover .cm-box { border-color: #fff; }
.cm-main { display: flex; align-items: center; gap: 8px; min-width: 0; }
.cm-ic { flex: none; display: inline-flex; color: var(--muted); }
.cm-ic svg.ic { width: 15px; height: 15px; }
.cm-item:hover .cm-ic { color: #fff; }
.cm-slider { padding: 6px 10px 8px; }
.cm-label { display: flex; justify-content: space-between; font-size: 13px; font-weight: 700; margin-bottom: 6px; }
.cm-val { color: var(--muted); font-weight: 600; }
.cm-slider input[type=range] { width: 100%; padding: 0; border: 0; background: transparent; accent-color: var(--accent); box-shadow: none; }

.banner {
  position: fixed; top: 64px; left: 50%; transform: translateX(-50%); z-index: 10;
  background: rgba(240, 82, 92, .15); border: 1px solid var(--red); padding: 9px 16px; border-radius: 12px; backdrop-filter: blur(8px);
}
.banner.has-btn { display: flex; align-items: center; gap: 12px; padding: 9px 10px 9px 16px; }
.banner.has-btn .btn { background: var(--red); color: #fff; border: 0; padding: 7px 14px; }
.ctrl-banner {
  position: fixed; top: 64px; left: 50%; transform: translateX(-50%); z-index: 15;
  display: flex; align-items: center; gap: 12px;
  background: rgba(240, 82, 92, .92); color: #fff; padding: 10px 12px 10px 18px; border-radius: 12px;
  box-shadow: 0 10px 30px var(--shadow); font-weight: 700; animation: ctrl-pulse 2s ease-in-out infinite;
}
.ctrl-banner .btn { background: #fff; color: var(--red); border: 0; font-weight: 800; }
.ctrl-banner .btn:hover { filter: brightness(.95); }
@keyframes ctrl-pulse { 0%, 100% { box-shadow: 0 10px 30px var(--shadow); } 50% { box-shadow: 0 10px 30px var(--shadow), 0 0 0 6px rgba(240, 82, 92, .25); } }
.tile.ctrl-active { outline: 3px solid var(--red); outline-offset: -3px; }
.tile.ctrl-active video { cursor: crosshair; }
.toast {
  position: fixed; bottom: 92px; left: 50%; transform: translateX(-50%); z-index: 10; max-width: min(520px, calc(100% - 24px));
  background: var(--glass); border: 1px solid var(--line-strong); padding: 10px 16px; border-radius: 14px;
  backdrop-filter: blur(14px); box-shadow: 0 10px 30px var(--shadow); text-align: center;
}

.app-outdated { bottom: auto; top: 56px; z-index: 30; display: flex; align-items: center; gap: 10px; }
.app-outdated .btn { text-decoration: none; }

.theme-btn {
  position: fixed; top: 9px; right: 14px; z-index: 20; width: 36px; height: 36px; display: grid; place-items: center; padding: 0;
  background: var(--panel); color: var(--text); border: 1px solid var(--line-strong); border-radius: 50%; cursor: pointer; font-size: 16px;
}

/* ícone de quem te mandou mensagem, na barra de cima — fica até você ler, igual a lista de
   conversas do Discord (um ícone por conversa com mensagem nova + bolinha de contagem) */
.unread-rail { display: flex; align-items: center; gap: 8px; }
.unread-pill { position: relative; padding: 0; border: 0; background: transparent; cursor: pointer; flex: none; line-height: 0; }
.unread-pill .avatar { width: 34px; height: 34px; box-shadow: 0 0 0 2px var(--bg); transition: transform .12s; }
.unread-pill .avatar::after { display: none; }
.unread-pill:hover .avatar { transform: translateY(-2px); }
.unread-pill .cnt { top: auto; right: -2px; bottom: -2px; box-shadow: 0 0 0 2px var(--bg); }
.theme-btn:hover { background: var(--panel-3); }

/* app desktop: a barra nativa do Windows fica só com os botões (minimizar/maximizar/fechar),
   sem o ícone/título feio — a nossa própria barra de cima vira a "pegada" pra arrastar a janela.
   --wco-right é a largura EXATA que o Windows reservou pros botões (calculada em index.html via
   navigator.windowControlsOverlay — não dá pra chutar um valor fixo, varia com a escala da tela).
   Reserva 3 faixas da direita pra esquerda: botões nativos | botão de tema | conteúdo da barra. */
:root { --wco-right: 150px; /* valor de reserva até o cálculo real chegar */ }
.is-desktop-app .topbar { -webkit-app-region: drag; padding-right: calc(var(--wco-right) + 60px); }
.is-desktop-app .topbar button, .is-desktop-app .topbar a, .is-desktop-app .topbar input { -webkit-app-region: no-drag; }
.is-desktop-app .theme-btn { right: calc(var(--wco-right) + 10px); -webkit-app-region: no-drag; }

.stage:fullscreen { border-radius: 0; border: 0; }

@media (max-width: 820px) {
  body.has-rail:has(#room:not([hidden])) { --rail-w: 0px; }
  body:has(#room:not([hidden])) .rail { display: none; }
  #btn-side { display: none; }
  .room-title b { display: none; }
  .sidebar { display: none; }
  /* no celular a lista de amigos abre por cima de tudo, já que a barra lateral normal fica escondida */
  .sidebar:has(#friends-side:not([hidden])) { display: block; position: fixed; inset: 0; z-index: 95; width: 100%; }
  body { --left-used: 0px; }
  body.chat-open { --right-used: 0px; }
  /* no celular o chat abre por cima da tela, deslizando da direita */
  .chat {
    position: fixed; top: 54px; right: 0; bottom: 0; width: min(92vw, var(--chat-w)); z-index: 30;
    background: var(--panel); box-shadow: -10px 0 40px var(--shadow); opacity: 1;
    transform: translateX(0); transition: transform .26s cubic-bezier(.3, .9, .3, 1);
  }
  .chat.chat-closed { width: min(92vw, var(--chat-w)); opacity: 1; transform: translateX(104%); }
  .chat .resizer { display: none; }
  .chat-inner { zoom: 1; width: 100%; height: 100%; }
  .settings { flex-direction: column; }
  .set-nav { width: auto; flex-direction: row; overflow-x: auto; padding: 10px; border-right: 0; border-bottom: 1px solid var(--line); }
  .set-user, .set-cat { display: none; }
  .set-x { top: 8px; right: 10px; }
  .set-x i { width: 30px; height: 30px; }
  .set-content { padding-top: 24px; }
  .set-grid { grid-template-columns: 1fr; }
  .main { flex-direction: column; }
  .thumbs-col { width: auto; flex-direction: row; align-items: flex-start; }
  .thumbs-tab { width: 72px; height: 18px; margin: -8px 0; }
  .thumbs-tab svg.ic { transform: none; }
  body.thumbs-hidden .thumbs-tab { margin: -8px 0 0; }
  body.thumbs-hidden .thumbs-tab svg.ic { transform: rotate(180deg); }
  .thumbs { flex-direction: row; overflow: auto hidden; }
  .thumbs .tile { width: 130px; }
}
