/* Sistema visual no estilo shadcn/ui: tokens num lugar só, componentes discretos, foco visível.
   Cores da marca: roxo (botões e destaques) e ciano (links, foco, voz). */
:root {
  --bg: #0b0814;
  --panel: #131020;
  --panel-2: #1c1830;
  --hover: #262040;
  --border: rgba(255, 255, 255, .08);
  --border-strong: rgba(255, 255, 255, .14);
  --input: rgba(255, 255, 255, .04);
  --text: #f4f2fa;
  --text-2: #d9d4e8;
  --muted: #9d97b0;
  --accent: #7c3aed;
  --accent-hover: #6d28d9;
  --accent-2: #22d3ee;
  --ring: rgba(139, 92, 246, .55);
  --brand-gradient: linear-gradient(135deg, #7b2ff2, #1dd8fc);
  --primary-gradient: linear-gradient(180deg, #8b5cf6, #7c3aed);
  --danger: #e5484d;
  --danger-hover: #cc3a3f;
  --live: #2fb37a;
  --warn: #f0b232;
  --radius: 10px;
  --radius-lg: 16px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px -8px rgba(0, 0, 0, .5);
  --shadow-lg: 0 24px 64px -16px rgba(0, 0, 0, .7);
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: dark;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(124, 58, 237, .22), transparent 70%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font: 14.5px/1.55 Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
/* Fundo em grade, como no site, nas telas de entrada (login, configuração, convite, antessala) */
body:has(> main.home:not([hidden]))::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .035) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse at top, #000 25%, transparent 70%);
}

h1, h2, h3 { letter-spacing: -.015em; font-weight: 600; }
::selection { background: rgba(124, 58, 237, .45); }
* { scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .15) transparent; }

[hidden] { display: none !important; }

.sprite { display: none; }
.icon {
  width: 22px;
  height: 22px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.muted { color: var(--muted); }
.small { font-size: 13px; }
.error { color: #ff6b70; margin: 0; font-size: 14px; }

/* --- campos ------------------------------------------------------------- */

label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
}

input, select, textarea {
  font: inherit;
  color: var(--text);
  background: var(--input);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 9px 12px;
  transition: border-color .15s, box-shadow .15s, background-color .15s;
}
input:hover, select:hover { border-color: rgba(255, 255, 255, .22); }
input:focus, select:focus, textarea:focus { outline: none; border-color: #8b5cf6; box-shadow: 0 0 0 3px var(--ring); }
input::placeholder { color: rgba(157, 151, 176, .7); }
select option { background: var(--panel); }

/* --- botões ------------------------------------------------------------- */

button {
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  color: #fff;
  background: var(--primary-gradient);
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 9px 16px;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .16), 0 1px 2px rgba(0, 0, 0, .4);
  transition: background .15s, border-color .15s, box-shadow .15s, transform .08s, color .15s, opacity .15s;
}
button:hover { background: linear-gradient(180deg, #9a6dfa, #7c3aed); }
button:active { transform: scale(.98); }
button:focus-visible, a:focus-visible, summary:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent-2); }
button:disabled { opacity: .5; cursor: default; transform: none; }

button.secondary { background: rgba(255, 255, 255, .06); border-color: var(--border); color: var(--text); box-shadow: none; }
button.secondary:hover { background: rgba(255, 255, 255, .1); border-color: var(--border-strong); }
button.danger { background: var(--danger); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14); }
button.danger:hover { background: var(--danger-hover); }

/* Botões redondos de ícone da barra de controles */
button.round {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .06);
  border: 1px solid var(--border);
  box-shadow: none;
  color: var(--text);
}
button.round:hover { background: rgba(255, 255, 255, .12); border-color: var(--border-strong); }
button.round.on { background: var(--primary-gradient); border-color: transparent; color: #fff; box-shadow: 0 6px 18px -6px rgba(124, 58, 237, .9), inset 0 1px 0 rgba(255, 255, 255, .18); }
button.round.on:hover { background: linear-gradient(180deg, #9a6dfa, #7c3aed); }
/* Microfone captando: anel ciano que cresce com o volume da voz */
#mic.on { box-shadow: 0 0 0 calc(var(--level, 0) * 7px) rgba(34, 211, 238, .55); transition: box-shadow .08s linear; }

/* Própria transmissão escondida: um quadro pequeno, desfocado, no fundo */
.self-hidden { position: absolute; inset: 0; display: grid; place-items: center; overflow: hidden; background: var(--bg); }
.self-hidden[hidden] { display: none; }
#self-frame { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: blur(22px) brightness(.45); transform: scale(1.15); }
.self-hidden-text { position: relative; max-width: 420px; padding: 20px; text-align: center; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.self-hidden-text p { margin: 0; }
/* Selo da qualidade que está saindo, no canto de baixo da prévia de quem transmite */
.badge.send { top: auto; bottom: 12px; left: 12px; background: rgba(16, 13, 22, .78); font-variant-numeric: tabular-nums; }

/* Aviso de rede para quem transmite, no alto da prévia */
.net-warning {
  position: absolute;
  top: 52px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 10px;
  width: max-content;
  max-width: calc(100% - 24px);
  padding: 8px 8px 8px 14px;
  border-radius: 10px;
  background: rgba(240, 178, 50, .95);
  color: #1b1405;
  font-size: 14px;
  font-weight: 600;
}
.net-warning[hidden] { display: none; }
.net-warning button { padding: 6px 12px; font-size: 13px; }
.net-warning button.secondary { background: rgba(0, 0, 0, .15); color: #1b1405; }

/* Sala só de voz: quem está na sala no lugar da tela preta */
.voice-stage {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 24px;
  background: radial-gradient(circle at 30% 20%, rgba(151, 50, 246, .35), transparent 60%),
    radial-gradient(circle at 75% 85%, rgba(29, 240, 252, .22), transparent 55%), var(--bg);
  text-align: center;
}
.voice-stage[hidden] { display: none; }
.voice-people { display: flex; flex-wrap: wrap; justify-content: center; gap: 20px; margin: 0; padding: 0; list-style: none; max-height: 75%; overflow: auto; }
.voice-person { display: flex; flex-direction: column; align-items: center; gap: 8px; width: 104px; }
.voice-person .big-avatar { width: 72px; height: 72px; font-size: 28px; border-radius: 50%; box-shadow: 0 0 0 3px transparent; transition: box-shadow .15s; }
.voice-person.speaking .big-avatar { box-shadow: 0 0 0 4px var(--accent-2), 0 0 24px rgba(29, 240, 252, .45); }
.voice-person.muted-mic .big-avatar { opacity: .75; }
.voice-name { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.voice-stage p { margin: 0; }
button.round.danger { background: var(--danger); color: #fff; }
button.round.danger:hover { background: var(--danger-hover); }

/* --- telas de entrada --------------------------------------------------- */

.home {
  max-width: 440px;
  margin: 11vh auto 48px;
  padding: 0 16px;
  animation: rise .5s var(--ease) both;
}
.home .card { padding: 32px; }
.hint { text-align: center; }

.card {
  background: linear-gradient(180deg, rgba(255, 255, 255, .035), rgba(255, 255, 255, .01)), var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

.form { display: flex; flex-direction: column; gap: 8px; }
.form label:not(.check) { margin-top: 4px; }
.form > button { margin-top: 12px; }
.form p { margin: 0; }
.field-hint { margin-top: -2px !important; }
.card h2 { margin: 16px 0 4px; font-size: 17px; }
.home.wide { max-width: 560px; }
.section { margin-top: 24px; padding-top: 8px; border-top: 1px solid var(--border); }
.notice {
  display: block;
  margin: 8px 0;
  padding: 10px 14px;
  border-radius: var(--radius);
  background: rgba(124, 58, 237, .1);
  border: 1px solid rgba(139, 92, 246, .3);
  color: var(--text-2);
  font-size: 14px;
  text-decoration: none;
}
a { color: var(--accent-2); text-underline-offset: 3px; }
a.notice { transition: background .15s, border-color .15s; }
a.notice:hover { background: rgba(124, 58, 237, .18); border-color: rgba(139, 92, 246, .5); }
.ok { color: var(--live); margin: 0; font-size: 14px; }
#audio-status:empty { display: none; }
.warn { color: var(--warn); }
.qr { align-self: center; width: 200px; height: 200px; border-radius: 8px; background: #fff; padding: 8px; }
.codes { columns: 2; margin: 8px 0; padding-left: 24px; font-family: ui-monospace, monospace; }
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.row-actions > * { flex: 1 1 auto; white-space: nowrap; line-height: 1.5; }
a.button {
  display: inline-block;
  text-align: center;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  padding: 9px 16px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: #fff;
  background: var(--primary-gradient);
  transition: background .15s, border-color .15s;
}
a.button.secondary { background: rgba(255, 255, 255, .06); border-color: var(--border); color: var(--text); }
a.button.secondary:hover { background: rgba(255, 255, 255, .1); border-color: var(--border-strong); }
.check { display: flex; align-items: center; gap: 8px; text-transform: none; font-size: 14px; font-weight: 400; color: var(--text); }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.list { list-style: none; margin: 8px 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.list li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 14px; background: rgba(255, 255, 255, .03); border: 1px solid var(--border); border-radius: var(--radius); }
.list li.disabled b { text-decoration: line-through; color: var(--muted); }
.list .actions { display: flex; flex-wrap: wrap; gap: 6px; }
.list button { padding: 6px 10px; font-size: 13px; }
.invite-box { display: flex; gap: 8px; margin: 8px 0; }
.invite-box input { flex: 1; min-width: 0; }
code { padding: 1px 6px; border-radius: 6px; background: rgba(255, 255, 255, .06); border: 1px solid var(--border); font-size: 12.5px; font-family: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, monospace; }

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 8px;
  font-weight: 600;
  letter-spacing: -.02em;
}
.brand img { border-radius: 22%; box-shadow: 0 4px 14px -4px rgba(124, 58, 237, .7); }
.small-brand { font-weight: 600; margin: 0; }

/* --- configuração inicial em passos ------------------------------------------ */

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.steps { display: flex; gap: 6px; margin: 12px 0 4px; padding: 0; list-style: none; counter-reset: step; }
.steps li {
  flex: 1;
  padding-top: 8px;
  border-top: 3px solid var(--border-strong);
  color: var(--muted);
  font-size: 13px;
  counter-increment: step;
}
.steps li::before { content: counter(step) ". "; }
.steps li.done { border-color: var(--live); color: var(--text); }
.steps li[aria-current] { border-color: var(--accent); color: var(--text); font-weight: 600; }
#step-status { margin: 0 0 8px; }
fieldset.step { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; border: 0; min-width: 0; }
fieldset.step[hidden] { display: none; }
fieldset.step p { margin: 0; }
.step-actions { display: flex; gap: 8px; margin-top: 12px; }
.step-actions button { flex: 1; }

/* --- página inicial: barra lateral e criar sala --------------------------- */

.app {
  display: grid;
  grid-template-columns: 300px 1fr;
  min-height: 100vh;
}
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px 12px;
  background: rgba(19, 16, 32, .72);
  backdrop-filter: blur(16px);
  border-right: 1px solid var(--border);
}
.sidebar .brand { padding: 0 4px 8px; }
.side-title { margin: 14px 8px 2px; font-size: 12px; font-weight: 500; color: var(--muted); }
.room-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.room-list li { display: flex; align-items: center; border-radius: 8px; transition: background .12s; }
.room-list li:hover, .room-list li:focus-within { background: rgba(255, 255, 255, .06); }
.room-list li.muted { padding: 6px 8px; }
.room-link { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; padding: 6px 8px; color: var(--text); text-decoration: none; }
.room-link-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.room-link-text > * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.room-link:focus-visible { outline: 2px solid var(--accent-2); outline-offset: -2px; border-radius: 6px; }
.dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--border); }
/* Tipo da sala (controle ou antena) com o ponto de "ao vivo" no canto */
.room-type { position: relative; flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: rgba(255, 255, 255, .06); color: var(--text-2); }
.room-type .icon { width: 18px; height: 18px; }
.room-type.type-live { color: #c4a5ff; }
.room-type.type-together { color: var(--accent-2); }
.room-type .dot { position: absolute; right: -2px; bottom: -2px; width: 10px; height: 10px; border: 2px solid var(--panel); background: #4a4560; }
.room-type .dot.live { background: var(--live); box-shadow: 0 0 0 2px rgba(47, 179, 122, .25); }
input.room-rename { flex: 1; min-width: 0; margin: 4px; padding: 6px 8px; font-size: 14px; font-weight: 600; }
.dot.live { background: var(--live); box-shadow: 0 0 0 3px rgba(47, 179, 122, .25); }
button.forget { padding: 4px 8px; margin-right: 4px; background: transparent; border: 0; box-shadow: none; color: var(--muted); font-size: 12px; opacity: 0; }
.room-list li:hover button.forget, button.forget:focus-visible { opacity: 1; }
/* Esquecer a sala é destrutivo: o X fica vermelho ao passar o mouse */
button.forget:hover, button.forget:focus-visible { background: rgba(229, 72, 77, .16); color: #ff6b70; }
#no-rooms { margin: 0 4px; }
.side-footer { margin-top: auto; padding: 12px 4px 0; border-top: 1px solid var(--border); }
.side-footer p { margin: 0 0 6px; }
.forget-on-logout { margin-bottom: 8px; font-size: 13px; color: var(--muted); }
.forget-on-logout input { width: 14px; height: 14px; }
.side-footer .side-buttons { margin: 8px 0; }
.command-box { display: flex; gap: 8px; align-items: flex-start; margin-top: 6px; }
.command-box code { flex: 1; min-width: 0; padding: 6px 8px; border-radius: 6px; background: var(--panel-2); font-size: 12px; overflow-wrap: anywhere; user-select: all; }
.command-box button { padding: 6px 10px; font-size: 13px; }
button.link { padding: 0; background: none; border: 0; box-shadow: none; color: var(--accent-2); font-size: 14px; text-decoration: underline; text-underline-offset: 3px; }
button.link:hover { background: none; color: #67e8f9; }
button.new-room { width: 100%; }
.new-room { display: flex; align-items: center; justify-content: center; gap: 8px; }
.new-room .icon { width: 18px; height: 18px; }
/* Botões de navegação com ícone: Página inicial, Administração, Minha conta, Sair */
.side-buttons .button, .side-buttons button { display: flex; align-items: center; gap: 10px; text-align: left; }
.side-buttons .icon { width: 18px; height: 18px; opacity: .85; }
.menu-wrap { position: relative; display: flex; flex-direction: column; }
.menu-wrap > button .chevron { margin-left: auto; width: 14px; height: 14px; transition: rotate .15s; }
.menu-wrap > button[aria-expanded="false"] .chevron { rotate: 180deg; }
.menu {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 6px);
  display: flex;
  flex-direction: column;
  padding: 4px;
  background: var(--panel-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  animation: pop-in .15s var(--ease);
  z-index: 5;
}
.menu a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 6px; color: var(--text); text-decoration: none; font-size: 14px; }
.menu a:hover, .menu a:focus-visible { background: rgba(255, 255, 255, .08); outline: none; box-shadow: none; }
.menu .icon { width: 18px; height: 18px; opacity: .85; }
.side-buttons .icon.external { width: 14px; height: 14px; margin-left: auto; opacity: .55; }
a.button.icon-link, button.icon-link { display: inline-flex; align-items: center; gap: 8px; }
.icon-link .icon { width: 18px; height: 18px; }

.app-main { display: flex; align-items: flex-start; justify-content: center; padding: 12vh 16px 32px; }
.welcome { max-width: 520px; width: 100%; padding: 32px; display: flex; flex-direction: column; gap: 12px; }
.welcome { animation: rise .5s var(--ease) both; }
.welcome h1 { margin: 0; font-size: 28px; line-height: 1.2; }
.welcome p { margin: 0; }
button.big { padding: 13px 20px; font-size: 16px; font-weight: 600; box-shadow: 0 10px 30px -10px rgba(124, 58, 237, .8), inset 0 1px 0 rgba(255, 255, 255, .18); }

.dialog {
  width: min(560px, calc(100vw - 32px));
  padding: 22px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(255, 255, 255, .04), rgba(255, 255, 255, .01)), var(--panel);
  color: var(--text);
  box-shadow: var(--shadow-lg);
}
/* Abre como os diálogos do Radix: surge e cresce um pouco; o fundo escurece e desfoca */
.dialog[open] { animation: pop-in .22s var(--ease); }
.dialog::backdrop { background: rgba(5, 3, 10, .6); backdrop-filter: blur(4px); animation: fade-in .2s ease; }
.dialog-head button.round { width: 36px; height: 36px; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.dialog-head h2 { margin: 0; font-size: 20px; }
.type-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.type-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 18px;
  text-align: left;
  background: rgba(255, 255, 255, .03);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: none;
  transition: background .15s, border-color .15s, transform .15s var(--ease), box-shadow .15s;
}
.type-card:hover { background: rgba(124, 58, 237, .08); border-color: rgba(139, 92, 246, .6); transform: translateY(-2px); box-shadow: 0 12px 30px -14px rgba(124, 58, 237, .8); }
.type-icon { display: grid; place-items: center; width: 42px; height: 42px; margin-bottom: 8px; border-radius: 12px;
  background: linear-gradient(135deg, rgba(124, 58, 237, .3), rgba(34, 211, 238, .22)); color: #c4b5fd; }
.more-options { margin-top: 14px; }
.more-options summary { cursor: pointer; color: var(--muted); font-size: 14px; }
.more-options .check { margin-top: 10px; }
.dialog .error { margin-top: 10px; }

@media (max-width: 700px) {
  .app { grid-template-columns: 1fr; }
  .app-main { order: -1; padding: 16px; }
  .sidebar { border-right: 0; border-top: 1px solid var(--border); }
  .type-cards { grid-template-columns: 1fr; }
  button.forget { opacity: 1; }
}

/* --- administração: menu lateral -------------------------------------------- */

.admin { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.admin-side {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 12px;
  background: rgba(19, 16, 32, .72);
  backdrop-filter: blur(16px);
  border-right: 1px solid var(--border);
}
.admin-side .brand { padding: 0 4px 4px; }
.admin-nav { display: flex; flex-direction: column; gap: 2px; }
.admin-nav button { position: relative; display: flex; align-items: center; gap: 10px; padding: 8px 12px; text-align: left; background: transparent; border: 0; box-shadow: none; color: var(--muted); font-weight: 500; }
.admin-nav button:hover { background: rgba(255, 255, 255, .05); color: var(--text); }
.admin-nav button[aria-current="page"] { background: rgba(255, 255, 255, .07); color: var(--text); }
.admin-nav button[aria-current="page"]::before { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; border-radius: 3px; background: var(--brand-gradient); }
.side-buttons { display: flex; flex-direction: column; gap: 6px; margin-top: auto; }
.side-buttons.top { margin-top: 0; }
.admin-nav .icon { width: 18px; height: 18px; flex: none; opacity: .8; }
.admin-nav button[aria-current="page"] .icon { opacity: 1; color: var(--accent-2); }
.side-separator { width: 100%; margin: 4px 0; border: 0; border-top: 1px solid var(--border); }
.admin-main { padding: 36px 44px; max-width: 780px; width: 100%; }
.admin-page:not([hidden]) { animation: rise .35s var(--ease) both; }
.admin-page h1 { margin: 0 0 8px; font-size: 26px; }
.admin-page h2 { margin: 24px 0 4px; font-size: 18px; }
.admin-page > p { margin: 0 0 8px; }

@media (max-width: 700px) {
  .admin { grid-template-columns: 1fr; }
  .admin-side { border-right: 0; border-bottom: 1px solid var(--border); }
  .admin-nav { flex-direction: row; flex-wrap: wrap; }
  .side-buttons { flex-direction: row; margin-top: 0; }
  .side-buttons .button { flex: 1; }
  .admin-main { padding: 20px 16px; }
}

/* --- gaveta lateral da sala ---------------------------------------------------- */

.topbar-start { display: flex; align-items: center; gap: 10px; }
button.round.nav-toggle { width: 40px; height: 40px; }
.room-nav {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 30;
  width: min(300px, 86vw);
  overflow-y: auto;
  background: var(--panel);
  box-shadow: 24px 0 64px rgba(0, 0, 0, .55);
}
/* Gaveta que desliza da esquerda, como o Vaul */
.room-nav:not([hidden]) { animation: slide-in .28s var(--ease); }
.room-nav[hidden], .nav-backdrop[hidden] { display: none; }
.room-nav-head { display: flex; align-items: center; justify-content: space-between; }
.room-nav-head button.round { width: 36px; height: 36px; }
.room-nav .room-link[aria-current="page"] { background: var(--hover); border-radius: 6px; }
.nav-backdrop { position: fixed; inset: 0; z-index: 29; background: rgba(5, 3, 10, .55); backdrop-filter: blur(3px); animation: fade-in .2s ease; }

/* --- antessala: prévia de câmera e microfone -------------------------------- */

.home.lobby { max-width: 880px; }
.lobby-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 24px; align-items: start; }
.preview { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.preview p { margin: 0; }
.preview-video {
  position: relative;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  background: #000;
  display: grid;
  place-items: center;
}
.preview-video video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.preview-buttons { position: absolute; bottom: 10px; left: 0; right: 0; display: flex; justify-content: center; gap: 10px; }
.preview-buttons button.round { background: rgba(19, 16, 32, .7); backdrop-filter: blur(10px); }
.preview-buttons button.round.on { background: var(--accent); }
.meter { height: 6px; border-radius: 3px; background: rgba(255, 255, 255, .06); overflow: hidden; }
.meter span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--live), var(--accent-2)); transition: width .08s linear; }
.lobby-side { display: flex; flex-direction: column; gap: 4px; min-width: 0; }

@media (max-width: 760px) {
  .lobby-grid { grid-template-columns: 1fr; }
  /* No celular, quem chega quase sempre só quer entrar: nome e botão primeiro, a prévia depois */
  .lobby-side { order: -1; }
  .home.lobby { margin-top: 16px; }
}

/* --- sala --------------------------------------------------------------- */

.room {
  display: grid;
  grid-template-columns: 1fr 320px;
  height: 100vh;
}

.stage {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  /* Sem isto, o tamanho natural do vídeo estica a coluna e empurra os botões para fora da tela */
  min-height: 0;
  padding: 12px 16px 16px;
}

.topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.invite {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
  padding: 4px;
  background: rgba(255, 255, 255, .04);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--muted);
}
.invite input { flex: 1; min-width: 0; background: transparent; border: 0; box-shadow: none; padding: 6px 0; color: var(--muted); }
.invite button { padding: 7px 12px; }

.player {
  position: relative;
  flex: 1;
  min-height: 0;
  background: #000;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.player #video { width: 100%; height: 100%; object-fit: contain; display: block; }
.player:fullscreen { border-radius: 0; }

.overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 16px;
  color: var(--text-2);
  background: rgba(5, 3, 10, .65);
  backdrop-filter: blur(6px);
}

.badge {
  position: absolute;
  top: 12px;
  left: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px 4px 8px;
  border-radius: 999px;
  background: var(--live);
  color: #fff;
  font-size: 12.5px;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .35);
}
.badge .icon { width: 16px; height: 16px; }

.dock { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.dock-group { display: flex; gap: 12px; }
.dock-group:empty, .dock-group:not(:has(.controls:not([hidden]))) { display: none; }
/* Barra de controles em vidro fosco */
.controls {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px;
  background: rgba(19, 16, 32, .72);
  backdrop-filter: blur(16px) saturate(140%);
  border: 1px solid var(--border);
  border-radius: 40px;
  box-shadow: var(--shadow);
}
#stats { margin: 0; }
#stats:empty { display: none; }

.volume {
  --level: 1;
  display: flex;
  align-items: center;
  height: 48px;
  padding: 0 7px;
  background: rgba(255, 255, 255, .06);
  border: 1px solid var(--border);
  border-radius: 26px;
  color: var(--text);
  text-transform: none;
}
/* A barra fica recolhida e abre ao passar o mouse (ou ao focar pelo teclado) */
.volume-slider { position: relative; display: flex; align-items: center; width: 0; opacity: 0; margin: 0;
  transition: width .2s var(--ease), opacity .15s, margin .2s var(--ease); }
.volume:hover .volume-slider, .volume:focus-within .volume-slider, .volume.adjusting .volume-slider { width: 110px; opacity: 1; margin: 0 10px 0 6px; }
.volume input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  min-width: 0;
  height: 4px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 2px;
  background: linear-gradient(to right, var(--accent) calc(var(--level) * 100%), rgba(255, 255, 255, .22) 0);
  cursor: pointer;
}
.volume input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 0; box-shadow: 0 1px 4px rgba(0, 0, 0, .5); }
.volume input[type="range"]::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 0; box-shadow: 0 1px 4px rgba(0, 0, 0, .5); }
.volume input[type="range"]::-moz-range-track { background: transparent; }
/* No mudo, a barra vai a zero e fica vermelha */
.volume.silent input[type="range"] { background: rgba(255, 107, 112, .45); }
.volume-tip {
  position: absolute;
  bottom: calc(100% + 14px);
  left: calc(var(--level) * (100% - 14px) + 7px);
  translate: -50% 0;
  padding: 3px 7px;
  border-radius: 6px;
  background: rgba(5, 3, 10, .92);
  border: 1px solid var(--border-strong);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity .12s;
}
.volume-slider:hover .volume-tip, .volume.adjusting .volume-tip, .volume input:focus-visible + .volume-tip { opacity: 1; }

.popover {
  position: absolute;
  bottom: calc(100% + 12px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 320px;
  padding: 16px;
  background: rgba(19, 16, 32, .92);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}
.popover:not([hidden]) { animation: pop-in .18s var(--ease); }
.popover h2 { margin: 0 0 6px; font-size: 16px; }
/* Ajustes ficam à direita: a janela abre alinhada à borda direita da barra */
#viewer-controls .popover { left: auto; right: 0; transform: none; max-height: min(70vh, 640px); overflow-y: auto; }
.popover-section { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; padding-top: 10px; border-top: 1px solid var(--border); }
.popover-section h3 { margin: 0 0 2px; font-size: 14px; }
.popover label:not(:first-of-type) { margin-top: 6px; }
.popover .row { display: flex; gap: 8px; }
.popover .row select { flex: 1; min-width: 0; }
.popover p { margin: 6px 0 0; }

/* --- chat --------------------------------------------------------------- */

.chat {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: rgba(19, 16, 32, .6);
  border-left: 1px solid var(--border);
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid var(--border);
}
.tabs { display: flex; gap: 4px; }
.tabs { padding: 3px; border-radius: 10px; background: rgba(255, 255, 255, .04); border: 1px solid var(--border); }
.tab { display: inline-flex; align-items: center; white-space: nowrap; padding: 5px 12px; background: transparent; border: 0; box-shadow: none; border-radius: 7px; color: var(--muted); font-size: 14px; }
.tab:hover { background: transparent; color: var(--text); }
.tab[aria-selected="true"] { background: rgba(255, 255, 255, .1); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, .4); }
.chat-tools { padding: 8px 12px 0; }
.chat-tools button { width: 100%; padding: 6px 10px; font-size: 13px; }
.people { list-style: none; margin: 0; padding: 12px 8px; }
.person { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 6px; }
.person:hover { background: var(--panel-2); }
.person .avatar { grid-row: auto; flex: none; }
.person-info { display: flex; flex-direction: column; flex: 1; min-width: 0; line-height: 1.3; }
.person-actions { display: flex; flex-wrap: wrap; gap: 6px; width: 100%; padding-left: 46px; }
.person-actions button { padding: 4px 10px; font-size: 12px; white-space: nowrap; }
.badge.presenter { left: auto; right: 12px; background: var(--accent); padding-left: 12px; }
.badge.rec { left: 50%; transform: translateX(-50%); background: var(--danger); padding-left: 12px; }
button.round.recording { background: var(--danger); color: #fff; }
button.round.recording:hover { background: var(--danger-hover); }
.chat input:disabled { opacity: .6; cursor: not-allowed; }

.chat ul {
  flex: 1;
  overflow-y: auto;
  list-style: none;
  margin: 0;
  padding: 12px 8px;
  overflow-wrap: anywhere;
}

.msg {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 0 10px;
  padding: 6px 8px;
  border-radius: 6px;
}
.msg { animation: msg-in .22s var(--ease); }
.msg:hover { background: rgba(255, 255, 255, .04); }
.avatar {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-weight: 700;
  color: #fff;
}
.msg .meta { display: flex; align-items: baseline; gap: 8px; }
.msg .author { font-weight: 600; }
.msg .time { font-size: 11px; color: var(--muted); }
.msg .text { margin: 0; }

.chat li.system {
  padding: 4px 8px;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}

.msg .text.jumbo { font-size: 40px; line-height: 1.2; }

.chat form { position: relative; padding: 12px; }

.composer {
  display: flex;
  align-items: center;
  background: var(--input);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  transition: border-color .15s, box-shadow .15s;
}
.composer:focus-within { border-color: #8b5cf6; box-shadow: 0 0 0 3px var(--ring); }
.composer input { flex: 1; min-width: 0; background: transparent; border: 0; box-shadow: none !important; }
.emoji-btn {
  padding: 4px 10px;
  background: transparent;
  border: 0;
  box-shadow: none;
  font-size: 20px;
  line-height: 1;
  filter: grayscale(1);
  opacity: .7;
}
.emoji-btn:hover, .emoji-btn[aria-expanded="true"] { background: transparent; filter: none; opacity: 1; }

.emoji-picker {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: calc(100% - 4px);
  z-index: 10;
  display: flex;
  flex-direction: column;
  height: 320px;
  background: rgba(19, 16, 32, .95);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.emoji-picker:not([hidden]) { animation: pop-in .18s var(--ease); }
.emoji-tabs {
  display: flex;
  gap: 2px;
  padding: 6px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, .03);
}
.emoji-tabs button {
  flex: 1;
  padding: 6px 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  font-size: 18px;
  line-height: 1;
  border-radius: 6px;
  filter: grayscale(1);
  opacity: .6;
}
.emoji-tabs button:hover { background: var(--hover); opacity: 1; }
.emoji-tabs button[aria-selected="true"] { background: var(--hover); filter: none; opacity: 1; }
.emoji-title { margin: 8px 10px 2px; font-size: 12px; font-weight: 500; color: var(--muted); }
.emoji-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(36px, 1fr));
  align-content: start;
  padding: 4px 6px 8px;
  overflow-y: auto;
}
.emoji-grid button {
  padding: 4px 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  font-size: 22px;
  line-height: 1.2;
  border-radius: 6px;
}
.emoji-grid button:hover { background: var(--hover); }
.emoji-grid .empty { grid-column: 1 / -1; color: var(--muted); font-size: 13px; padding: 8px 4px; }

/* Guia do celular */
.guide h1 { font-size: 24px; }
.guide h2 { margin-top: 20px; }
.guide p { margin: 6px 0; }

/* Seletor de idioma */
button.link { padding: 0; background: none; border: 0; box-shadow: none; color: var(--muted); font-weight: 400; text-decoration: underline; }
button.link:hover { background: none; color: var(--text); }
button.link[aria-pressed="true"] { color: var(--text); text-decoration: none; font-weight: 600; }
.lang-row { margin: 12px 0 0; text-align: center; }

/* Telas ao vivo: quem está transmitindo, para escolher qual assistir */
.screens { display: flex; flex-wrap: wrap; gap: 6px; }
.screen-chip { padding: 6px 12px; font-size: 13px; background: rgba(255, 255, 255, .06); border-color: var(--border); box-shadow: none; color: var(--text); border-radius: 999px; }
.screen-chip:hover { background: rgba(255, 255, 255, .1); }
.screen-chip[aria-selected="true"] { background: var(--primary-gradient); border-color: transparent; color: #fff; }

/* Câmera sobre a tela (picture-in-picture) */
.pip { position: absolute; z-index: 2; object-fit: cover; background: #000; border: 2px solid rgba(255, 255, 255, .85);
  box-shadow: 0 6px 20px rgba(0, 0, 0, .55); border-radius: 12px; transition: all .2s; }
.pip { height: auto; }
.pip-s { width: 16%; }
.pip-m { width: 24%; }
.pip-l { width: 34%; }
.pip-circle { border-radius: 50%; aspect-ratio: 1; }
.pip-rounded { aspect-ratio: 16 / 9; }
.pip-tl { top: 16px; left: 16px; }
.pip-tr { top: 16px; right: 16px; }
.pip-bl { bottom: 16px; left: 16px; }
.pip-br { bottom: 16px; right: 16px; }

/* Ajustes da câmera: botões em grupo */
.pip-layout { display: flex; flex-direction: column; gap: 6px; margin: 6px 0 0; padding: 0; border: 0; }
.pip-layout legend { font-size: 13px; font-weight: 500; color: var(--text-2); padding: 0; margin-bottom: 4px; }
/* Grupos de botões no estilo "toggle group": uma faixa com o escolhido em destaque */
.seg { display: flex; gap: 2px; padding: 3px; border-radius: 10px; background: rgba(255, 255, 255, .04); border: 1px solid var(--border); }
.seg button { flex: 1; padding: 5px 4px; font-size: 13px; background: transparent; border: 0; box-shadow: none; border-radius: 7px; color: var(--muted); }
.seg button:hover { background: rgba(255, 255, 255, .05); color: var(--text); }
.seg button[aria-pressed="true"] { background: rgba(255, 255, 255, .12); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, .4); }

/* Pedidos (mão levantada, pedir a tela) e quem está falando */
/* Quantas pessoas estão na sala: um olho e o número */
.viewers { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px;
  background: rgba(255, 255, 255, .05); border: 1px solid var(--border); color: var(--text-2);
  font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.viewers .icon { width: 16px; height: 16px; color: var(--accent-2); }
.count-badge.muted-badge { background: rgba(255, 255, 255, .14); }
/* Registro da sala: eventos em lista compacta, com a hora */
.chat ul.log { padding: 10px 12px; gap: 2px; }
.log-entry { display: flex; gap: 10px; align-items: baseline; padding: 4px 6px; border-radius: 6px; font-size: 13px; color: var(--text-2); animation: msg-in .2s var(--ease); }
.log-entry:hover { background: rgba(255, 255, 255, .03); }
.log-entry .time { flex: none; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.requests-options { margin: 12px 8px 0; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius); display: flex; flex-direction: column; gap: 8px; }
.requests-options legend { padding: 0 4px; font-size: 12px; font-weight: 600; color: var(--muted); }
.requests-options .check { font-size: 13px; }
.limit-row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 6px 8px; margin: 0; padding: 0; font-size: 13px; }
.limit-row label { grid-column: 1 / -1; }
.limit-row input { padding: 6px 8px; }
.limit-row button { padding: 6px 12px; }
.requests-options .field-hint { margin: 0; font-size: 12px; }
.requests-options button.link { font-size: 12px; }
.count-badge { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; margin-left: 4px;
  border-radius: 9px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; }
.people-panel { flex: 1; display: flex; flex-direction: column; min-height: 0; overflow-y: auto; }
.requests { list-style: none; margin: 0; padding: 12px 8px 0; display: flex; flex-direction: column; gap: 6px; }
.request { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px 10px; border-radius: 10px;
  background: rgba(124, 58, 237, .1); border: 1px solid rgba(139, 92, 246, .3); font-size: 14px; animation: msg-in .22s var(--ease); }
.request span { flex: 1 1 100%; }
.request button { padding: 4px 10px; font-size: 12px; }
.people { flex: none; overflow: visible; }
.avatar.speaking { box-shadow: 0 0 0 3px var(--live); }

/* Escolha do tipo de sala */
.room-types { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0; padding: 0; border: 0; }
.room-types legend { font-size: 13px; font-weight: 500; color: var(--text-2); padding: 0; margin-bottom: 6px; }
.room-type { display: flex; flex-direction: column; gap: 4px; padding: 12px; border-radius: 12px; background: rgba(255, 255, 255, .03);
  border: 1px solid var(--border); cursor: pointer; text-transform: none; font-weight: 400; color: var(--text); font-size: 14px; transition: border-color .15s, background .15s; }
.room-type:has(input:checked) { border-color: #8b5cf6; background: rgba(124, 58, 237, .1); box-shadow: 0 0 0 3px rgba(139, 92, 246, .2); }
.room-type input { position: absolute; opacity: 0; pointer-events: none; }
.room-type-title { font-weight: 600; font-size: 15px; }

/* Convites da sala (anfitrião) */
/* As listas do painel ocupam o que precisam; quem rola é o painel (a regra .chat ul é do chat) */
.people-panel ul, .people-panel > * { flex: none; }
.people-panel .invites { padding: 0; }
.invites-panel { margin: 12px 8px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--border); background: rgba(255, 255, 255, .02); }
.invites-panel summary { cursor: pointer; font-weight: 500; }
.invites-panel .check { margin: 10px 0; font-size: 14px; }
.invites { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.invite-item { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.invite-item div { flex: 1 1 140px; display: flex; flex-direction: column; min-width: 0; }
.invite-item button { padding: 4px 10px; font-size: 12px; }
.invite-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.invite-grid > div { display: flex; flex-direction: column; gap: 6px; }

/* Aviso de nova versão em /admin */
.update-box { display: flex; flex-direction: column; gap: 8px; margin-bottom: 24px; }
.update-box h2 { margin: 0; }
.update-box p { margin: 0; }
.update-status-new { border-color: var(--warn) !important; }
.update-steps { display: flex; flex-direction: column; gap: 6px; }
.update-steps h3 { margin: 8px 0 0; font-size: 15px; }
.update-steps pre { margin: 0; padding: 8px 10px; border-radius: var(--radius); background: rgba(0, 0, 0, .3); overflow-x: auto; font-size: 13px; }
.update-box details summary { cursor: pointer; margin-top: 4px; }

/* Painel de uso em /admin */
.usage-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin: 12px 0; }
.usage-stat { display: flex; flex-direction: column; padding: 14px 16px; border: 1px solid var(--border); border-radius: 14px; background: rgba(255, 255, 255, .03); }
.usage-value { font-size: 26px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
#usage-bar { width: 100%; height: 10px; accent-color: var(--accent); }
#usage-bar.warn { accent-color: var(--warn); }
.usage-history { margin: 4px 0; padding-left: 20px; }

/* --- botões com ícone e texto, aviso rápido, campo de senha ------------------- */

button.icon-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 7px 12px; }
button.icon-button .icon { width: 18px; height: 18px; }
button.icon-button.wide { width: 100%; }
button.primary-soft { background: rgba(124, 58, 237, .18); border-color: rgba(139, 92, 246, .45); color: #ddd0ff; box-shadow: none; }
button.primary-soft:hover { background: rgba(124, 58, 237, .3); }
button.icon-button.copied { background: rgba(47, 179, 122, .18); border-color: rgba(47, 179, 122, .5); color: #8ff0c3; }
button.discord .icon { color: #a5b4fc; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 60;
  translate: -50% 0;
  max-width: min(420px, calc(100vw - 32px));
  padding: 10px 16px;
  border-radius: 12px;
  background: rgba(28, 24, 48, .96);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-lg);
  color: var(--text);
  font-size: 14px;
  animation: toast-in .25s var(--ease);
}
.toast.leaving { opacity: 0; translate: -50% 8px; transition: opacity .2s, translate .2s; }

/* Volume: o ícone liga e desliga o som */
button.mute { display: grid; place-items: center; flex: none; width: 32px; height: 32px; margin: 0; padding: 0; border-radius: 50%;
  background: transparent; border: 0; box-shadow: none; color: var(--text); }
button.mute:hover { background: rgba(255, 255, 255, .1); }
button.mute.on { color: #ff6b70; }

/* Mostrar a senha: um olho dentro do campo */
.password-field { position: relative; display: flex; }
.password-field input { flex: 1; min-width: 0; padding-right: 44px; }
.password-field .reveal { position: absolute; right: 4px; top: 50%; translate: 0 -50%; display: grid; place-items: center;
  width: 34px; height: 34px; padding: 0; border-radius: 8px; background: transparent; border: 0; box-shadow: none; color: var(--muted); }
.password-field .reveal { cursor: pointer; }
.password-field .reveal:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--accent-2); }
.password-field .reveal:hover { background: rgba(255, 255, 255, .08); color: var(--text); }
.password-field .reveal .icon { width: 18px; height: 18px; }

/* Servidor privado (cadastro só por convite): a página inicial não tem login */
.private-badge { display: inline-flex; align-items: center; gap: 8px; align-self: flex-start; padding: 4px 12px; border-radius: 999px;
  background: rgba(124, 58, 237, .14); border: 1px solid rgba(139, 92, 246, .4); color: #ddd0ff; font-size: 13px; font-weight: 600; }
.private-badge .icon { width: 16px; height: 16px; }

/* Sobre: créditos, licença e versão */
.about-card { display: flex; gap: 16px; align-items: center; margin: 12px 0; padding: 16px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: rgba(255, 255, 255, .03); }
.about-card img { flex: none; }
.about-card p { margin: 2px 0; }
.about-list { margin: 8px 0; padding: 0; list-style: none; display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; }
.about-list dt { color: var(--muted); font-size: 14px; }
.about-list dd { margin: 0; font-size: 14px; }
#sobre .row-actions > * { flex: none; }

/* Esconder o chat: o vídeo fica com a largura toda */
.room.chat-hidden { grid-template-columns: 1fr; }
.room.chat-hidden .chat { display: none; }

/* --- animações (no estilo Radix e Vaul) ---------------------------------------- */

@keyframes rise { from { opacity: 0; translate: 0 10px; } }
@keyframes fade-in { from { opacity: 0; } }
@keyframes pop-in { from { opacity: 0; translate: 0 6px; scale: .97; } }
@keyframes slide-in { from { translate: -100% 0; } }
@keyframes msg-in { from { opacity: 0; translate: 0 6px; } }
@keyframes toast-in { from { opacity: 0; translate: -50% 12px; scale: .96; } }
@keyframes sheet-in { from { translate: 0 100%; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Live: pergunta do chat em destaque sobre o vídeo; no chat, a estrela do anfitrião */
.highlight {
  position: absolute;
  left: 50%;
  bottom: 72px;
  translate: -50% 0;
  width: max-content;
  max-width: min(640px, calc(100% - 32px));
  margin: 0;
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: 0 10px;
  align-items: center;
  padding: 12px 12px 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-left: 4px solid var(--accent-2);
  background: rgba(16, 13, 22, .86);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-lg);
  animation: pop-in .25s var(--ease);
  z-index: 2;
}
.highlight .author { font-weight: 700; font-size: 13px; color: var(--accent-2); }
.highlight .text { grid-column: 2; margin: 2px 0 0; font-size: 17px; line-height: 1.35; overflow-wrap: anywhere; max-height: 4.1em; overflow: hidden; }
.highlight button.round { grid-row: 1 / span 2; grid-column: 3; width: 32px; height: 32px; }
.msg { position: relative; }
.msg .msg-highlight { position: absolute; top: 4px; right: 4px; width: 30px; height: 30px; opacity: 0; transition: opacity .15s; }
.msg:hover .msg-highlight, .msg .msg-highlight:focus-visible, .msg.highlighted .msg-highlight { opacity: 1; }
.msg.highlighted { background: rgba(34, 211, 238, .08); box-shadow: inset 3px 0 0 var(--accent-2); }
.msg.highlighted .msg-highlight { color: var(--accent-2); }
.msg.highlighted .msg-highlight .icon { fill: currentColor; }
@media (hover: none) { .msg .msg-highlight { opacity: .7; } }

/* --- sala no celular -----------------------------------------------------------
   Em pé (como YouTube e Twitch): o vídeo de ponta a ponta no topo, a barra de controles logo abaixo e o
   chat ocupando o resto da tela, sem a página rolar. Deitado: o vídeo com a altura toda e o chat ao lado,
   que pode ser escondido. Os ajustes abrem numa folha que sobe de baixo (como o Vaul). */

@media (max-width: 800px) and (orientation: portrait), (max-width: 560px) {
  .highlight { bottom: 10px; padding: 8px 8px 8px 10px; grid-template-columns: 28px 1fr auto; }
  .highlight .avatar { width: 28px; height: 28px; font-size: 13px; }
  .highlight .text { font-size: 14px; max-height: 2.8em; }
  .room { display: flex; flex-direction: column; height: 100vh; height: 100dvh; }
  .stage { flex: none; padding: 0; gap: 0; }
  .topbar { flex-wrap: nowrap; gap: 8px; padding: 8px 10px; }
  .topbar .small-brand { font-size: 0; gap: 0; }
  .topbar:not(:has(#invite:not([hidden]), #nav-toggle:not([hidden]))) { display: none; }
  .invite { flex: none; max-width: none; margin-left: auto; padding: 0; gap: 6px; background: none; border: 0; }
  .invite button:not(#copy) .label { display: none; }
  .invite button.icon-button { padding: 7px 10px; }
  .screens { padding: 0 10px 8px; flex-wrap: nowrap; overflow-x: auto; }
  .screen-chip { flex: none; }
  .player { flex: none; aspect-ratio: 16 / 9; border-radius: 0; border-left: 0; border-right: 0; box-shadow: none; }
  .dock { flex-wrap: nowrap; gap: 2px; padding: 6px 6px; overflow-x: auto; border-bottom: 1px solid var(--border); scrollbar-width: none; }
  .dock-group { gap: 2px; }
  .controls { gap: 2px; padding: 0; background: transparent; border: 0; box-shadow: none; backdrop-filter: none; }
  .controls button.round { width: 40px; height: 40px; flex: none; }
  .controls button.round .icon { width: 20px; height: 20px; }
  /* No celular o volume vem dos botões do aparelho: fica só o mudo */
  .volume { height: 40px; padding: 0; background: transparent; border: 0; }
  .volume .volume-slider { display: none; }
  button.mute { margin: 0; width: 40px; height: 40px; }
  .chat-hide { display: none !important; }
  .room.chat-hidden .chat { display: flex; }
  .chat { flex: 1; min-height: 0; height: auto; border-left: 0; background: transparent; }
  .chat-header { padding: 8px 10px; }
  .tab { padding: 5px 10px; }
  .chat form { padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); }
  .badge { top: 8px; left: 8px; font-size: 12px; }
  .badge.presenter { right: 8px; }
  #viewer-controls .popover, .popover {
    position: fixed; inset: auto 0 0 0; transform: none; width: auto; max-height: 78dvh; overflow-y: auto;
    padding: 20px 16px calc(16px + env(safe-area-inset-bottom)); border-radius: 18px 18px 0 0; border-bottom: 0;
    animation: sheet-in .28s var(--ease);
  }
  #viewer-controls .popover::before { content: ""; position: absolute; top: 8px; left: 50%; translate: -50% 0; width: 40px; height: 4px; border-radius: 2px; background: var(--border-strong); }
  .toast { bottom: calc(16px + env(safe-area-inset-bottom)); }
}

@media (orientation: landscape) and (max-height: 500px) {
  .room { grid-template-columns: 1fr 280px; height: 100vh; height: 100dvh; }
  .room.chat-hidden { grid-template-columns: 1fr; }
  .stage { padding: 6px; gap: 6px; }
  .topbar { flex-wrap: nowrap; gap: 8px; }
  .topbar .small-brand { font-size: 0; gap: 0; }
  .topbar:not(:has(#invite:not([hidden]), #nav-toggle:not([hidden]))) { display: none; }
  .invite { max-width: none; padding: 2px; }
  .invite button:not(#copy) .label { display: none; }
  .invite button.icon-button { padding: 5px 10px; }
  .player { aspect-ratio: auto; flex: 1; border-radius: 10px; }
  .dock { flex-wrap: nowrap; gap: 6px; }
  .dock-group { gap: 6px; }
  .controls { gap: 4px; padding: 4px; }
  .controls button.round { width: 38px; height: 38px; }
  .volume { height: 38px; padding: 0 4px; background: transparent; border: 0; }
  .volume .volume-slider { display: none; }
  button.mute { margin: 0; width: 38px; height: 38px; }
  .chat { height: 100vh; height: 100dvh; border-top: 0; border-left: 1px solid var(--border); }
  .chat-header { padding: 8px 10px; }
  .tab { padding: 4px 8px; font-size: 13px; }
  .chat form { padding: 8px; }
  #viewer-controls .popover, .popover { position: fixed; inset: 8px 8px 8px auto; transform: none; width: min(340px, 60vw); max-height: none; overflow-y: auto; }
}

/* Barra de controles compacta em telas médias */
@media (max-width: 1000px) and (min-width: 801px) {
  .volume:hover .volume-slider, .volume:focus-within .volume-slider, .volume.adjusting .volume-slider { width: 80px; }
}
