/* Aplicação: barra de salas | painel da sala | chat + palco. */

html, body { height: 100%; overflow: hidden; }

.app {
  display: grid;
  grid-template-columns: 74px 248px 1fr;
  height: 100dvh;
  background: var(--fundo-2);
}
/* Dentro de uma sala abre a 4ª coluna: a lista de membros à direita, como no
   app desktop e no Discord. No Início e nas DMs ela não existe. */
.app.com-membros { grid-template-columns: 74px 248px 1fr 232px; }

/* ===================================================== coluna das salas */
.trilha {
  background: var(--fundo);
  padding: 12px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  /* Respiro entre as salas: bolhas coladas ficam difíceis de acertar. */
  gap: 10px;
  overflow-y: auto;
  overflow-x: hidden;
}
.trilha::-webkit-scrollbar { width: 0; }

.bolha {
  position: relative;
  width: 48px; height: 48px;
  border: 0;
  border-radius: 16px;
  display: grid; place-items: center;
  font-weight: 800; font-size: .92rem;
  color: #fff;
  cursor: pointer;
  transition: border-radius .16s ease, transform .12s ease;
  flex: none;
  font-family: inherit;
}
.bolha:hover { border-radius: 14px; transform: translateY(-1px); }
.bolha:active { transform: scale(.92); }
.bolha.ativa { border-radius: 14px; }
.bolha { animation: vt-pop .18s ease; }
/* Marcador à esquerda, como no padrão que todo mundo já conhece. */
.bolha::before {
  content: '';
  position: absolute;
  left: -12px;
  width: 4px;
  border-radius: 0 4px 4px 0;
  background: #fff;
  height: 0;
  transition: height .16s ease;
}
.bolha:hover::before { height: 20px; }
.bolha.ativa::before { height: 30px; }

/* Foto da sala (chatUI.pintarIconeSala): cobre a bolha inteira e a cor da
   sala não fica por trás. */
.bolha img {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: inherit;
  display: block;
}
.bolha.com-foto { background: transparent; }

.bolha-nova {
  background: var(--superficie-2);
  color: var(--verde);
  font-size: 1.5rem;
  font-weight: 400;
  line-height: 1;
}
.bolha-nova:hover { background: var(--verde); color: #fff; }

.trilha-sep { width: 32px; height: 2px; background: var(--superficie-3); border-radius: 2px; flex: none; }
#bolha-inicio { background: var(--superficie-2); }

/* ============================================= início: amigos e mensagens */
.amigos-area { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.lateral-inicio { flex: 1; overflow-y: auto; padding: 10px 8px; min-height: 0; }
.lateral-inicio .grupo-titulo { padding-top: 18px; }
.principal-topo .dm-status { margin-left: -4px; }
#btn-ligar svg { width: 20px; height: 20px; }

.trilha-eu { margin-top: auto; }

/* ==================================================== painel lateral */
.lateral {
  background: var(--fundo-2);
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--borda);
  min-width: 0;
}
.lateral-topo {
  height: 50px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-bottom: 1px solid var(--borda);
  box-shadow: 0 1px 0 rgba(0,0,0,.2);
  flex: none;
}
.lateral-topo h2 {
  font-size: .98rem;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lateral-corpo { flex: 1; overflow-y: auto; padding: 12px 8px; min-height: 0; }

.grupo-titulo {
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--texto-3);
  padding: 14px 8px 6px;
}

.item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 7px 9px;
  border: 0;
  background: transparent;
  border-radius: 7px;
  color: var(--texto-2);
  font: inherit;
  font-size: .92rem;
  cursor: pointer;
  text-align: left;
  transition: background .12s, color .12s;
  min-width: 0;
}
.item:hover { background: var(--superficie-2); color: var(--texto); }
.item.ativo { background: var(--superficie-3); color: var(--texto); }
.item .nome { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .tag {
  font-size: .68rem;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--superficie-3);
  color: var(--texto-3);
  flex: none;
}
.item.transmitindo .tag { background: rgba(242,84,91,.18); color: #ff9ba0; }


.icone-btn {
  width: 32px; height: 32px;
  border: 0; border-radius: 7px;
  background: transparent;
  color: var(--texto-2);
  cursor: pointer;
  display: grid; place-items: center;
  font-size: 15px;
  transition: background .12s, color .12s;
}
.icone-btn:hover { background: var(--superficie-2); color: var(--texto); }

/* ========================================================= área principal */
.principal { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--fundo-2); }
.principal-topo {
  height: 50px;
  padding: 0 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--borda);
  box-shadow: 0 1px 0 rgba(0,0,0,.2);
  flex: none;
}
.principal-topo h3 { margin: 0; font-size: .98rem; }
.principal-topo .sep { color: var(--texto-3); }
.principal-topo .espaco { flex: 1; }

/* -------------------------------------------------------------- palco */
.palco {
  background: #05060a;
  border-bottom: 1px solid var(--borda);
  display: none;
  flex-direction: column;
  flex: none;
}
.palco.aberto { display: flex; animation: vt-slide-down .22s ease; }
.palco video {
  width: 100%;
  height: 40vh; /* sobrescrito pelo JS (alça de redimensionar) */
  max-height: none;
  background: #000;
  display: block;
  object-fit: contain;
}
.palco:not(.redimensionando) video { transition: height .16s ease; }
.palco.redimensionando { user-select: none; }

/* Expandir = ocupar a JANELA do VisTalk (nunca a tela do sistema). */
.palco.expandido {
  position: fixed;
  inset: 0;
  z-index: 90;
  animation: vt-pop .16s ease;
}
.palco.expandido video { height: auto; flex: 1; max-height: none; }

/* O mural (as janelinhas de quem você assiste) ocupa o lugar que era do
   `<video>` único: a altura vem do divisor, como antes. */
.palco .mural { height: 40vh; flex: none; }
.palco.expandido .mural { height: auto; flex: 1; }

.palco-barra {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  background: var(--superficie);
  font-size: .88rem;
}
.palco-barra .espaco { flex: 1; }
.palco-barra #palco-titulo { color: var(--texto-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.palco-status { color: var(--texto-3); font-size: .82rem; flex: none; }
/* Só aparece em tela cheia, que é quando a saída deixa de ser óbvia. */
.palco-dica { display: none; color: var(--texto-3); font-size: .8rem; flex: none; }
.palco.expandido .palco-dica { display: inline; }
.palco-volume { width: 92px; flex: none; }
.icone-btn.ativo { color: var(--roxo); background: var(--roxo-suave); }
/* A faixa CONTINUA à vista enquanto se assiste: é por ela que se abre a
   segunda e a terceira janelinha do mural. */

.ao-vivo {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 700;
  font-size: .74rem;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: #ff9ba0;
}
.ao-vivo::before {
  content: '';
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--vermelho);
  animation: pulso 2s infinite;
}
@keyframes pulso {
  0%   { box-shadow: 0 0 0 0 rgba(242, 84, 91, .55); }
  70%  { box-shadow: 0 0 0 8px rgba(242, 84, 91, 0); }
  100% { box-shadow: 0 0 0 0 rgba(242, 84, 91, 0); }
}

/* Faixa com as transmissões da sala.
   Em tela larga ela NÃO aparece: quem está ao vivo é mostrado pelo selo
   AO VIVO ao lado do nome, dentro do canal de voz (como no Discord). A faixa
   volta só em tela estreita, onde a lateral vira gaveta e o selo fica
   escondido atrás do menu. */
.transmissoes {
  display: none;
  gap: 10px;
  padding: 10px 16px;
  overflow-x: auto;
  border-bottom: 1px solid var(--borda);
  flex: none;
}
@media (max-width: 900px) {
  .transmissoes:not(:empty) { display: flex; }
}
.cartao-live {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 8px 12px;
  background: var(--superficie);
  border: 1px solid var(--borda);
  border-radius: var(--raio);
  cursor: pointer;
  font: inherit;
  color: var(--texto);
  text-align: left;
  transition: border-color .14s ease, background .14s ease, transform .12s ease;
  flex: none;
  max-width: 320px;
  animation: vt-pop .18s ease;
}
.cartao-live:hover { border-color: var(--roxo); background: var(--superficie-2); transform: translateY(-1px); }
.cartao-live.assistindo { border-color: var(--roxo); background: var(--roxo-suave); }
.cartao-live .txt { min-width: 0; }
.cartao-live b { display: block; font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cartao-live small { color: var(--texto-3); font-size: .78rem; }

/* --------------------------------------------------------------- chat */
.chat {
  flex: 1;
  /* `min-height: 0` é o que faz o container ROLAR em vez de esticar a coluna
     (item flex tem min-height: auto por padrão e se recusa a encolher). */
  min-height: 0;
  overflow-y: auto;
  padding: 22px 26px 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  scroll-behavior: smooth;
}

.msg {
  display: flex;
  gap: 16px;
  padding: 4px 8px;
  margin: 0 -8px;
  border-radius: 8px;
  transition: background .12s ease;
  animation: msg-entra .18s ease;
}
.msg:hover { background: rgba(255, 255, 255, .025); }
@keyframes msg-entra { from { opacity: 0; transform: translateY(6px); } }
.msg .avatar { margin-top: 2px; }
.msg-corpo { min-width: 0; flex: 1; }
.msg-cab { display: flex; align-items: baseline; gap: 9px; }
.msg-cab b { font-size: .98rem; }
.msg-cab time { font-size: .72rem; color: var(--texto-3); }
.msg-texto { font-size: 1rem; line-height: 1.5; color: #dde1ec; white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; }
/* Mensagens seguidas da mesma pessoa: esconde o cabeçalho e alinha o texto. */
.msg.agrupada { padding-top: 0; }
.msg.agrupada .avatar, .msg.agrupada .msg-cab { display: none; }
.msg.agrupada .msg-corpo { margin-left: 52px; }

.chat-vazio { margin: auto; text-align: center; color: var(--texto-3); padding: 40px 20px; animation: vt-pop .2s ease; }
.chat-vazio .icone { font-size: 2.6rem; margin-bottom: 12px; }

.digitando {
  padding: 2px 26px;
  font-size: .8rem;
  color: var(--texto-3);
  min-height: 0;
  transition: opacity .15s ease;
}
.digitando:empty { display: none; }

.compositor { padding: 4px 26px 20px; flex: none; position: relative; }
.compositor-caixa {
  /* o clipe e o emoji ficam nas pontas, o texto cresce no meio */
  display: flex;
  align-items: flex-end;
  gap: 10px;
  background: var(--superficie-2);
  border: 1px solid var(--borda);
  border-radius: var(--raio);
  padding: 12px 16px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.compositor-caixa:focus-within {
  border-color: var(--roxo);
  box-shadow: 0 0 0 3px var(--roxo-suave);
}
.compositor textarea {
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--texto);
  font: inherit;
  resize: none;
  max-height: 160px;
  outline: none;
  line-height: 1.5;
}
.compositor textarea::placeholder { color: var(--texto-3); }

/* ======================================================== estado vazio */
.vazio {
  grid-column: 2 / -1;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 40px;
}
.vazio .caixa-vazia { max-width: 460px; }
.vazio .icone { font-size: 3.4rem; margin-bottom: 18px; }
.vazio h2 { font-size: 1.5rem; }
.vazio p { color: var(--texto-2); }
.vazio .acoes { display: flex; gap: 12px; justify-content: center; margin-top: 22px; flex-wrap: wrap; }

/* ============================================================== modal */
.modal-fundo {
  position: fixed;
  inset: 0;
  background: rgba(4, 5, 9, .74);
  backdrop-filter: blur(3px);
  display: grid;
  place-items: center;
  padding: 22px;
  z-index: 100;
  animation: aparecer .16s ease;
}
@keyframes aparecer { from { opacity: 0 } }
.modal {
  width: min(460px, 100%);
  background: var(--superficie);
  border: 1px solid var(--borda);
  border-radius: var(--raio-g);
  padding: 26px;
  box-shadow: var(--sombra-g);
  max-height: 86vh;
  overflow-y: auto;
  animation: modal-sobe .2s cubic-bezier(.2, .8, .3, 1);
}
@keyframes modal-sobe { from { opacity: 0; transform: translateY(14px) scale(.97); } }
.modal h3 { margin-bottom: 6px; font-size: 1.25rem; }
.modal .sub { color: var(--texto-2); font-size: .92rem; margin-bottom: 20px; }
.modal-acoes { display: flex; gap: 10px; justify-content: flex-end; margin-top: 22px; flex-wrap: wrap; }

/* Modal de imagem (foto de perfil / imagem da sala) */
.img-modal { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.img-previa {
  width: 128px; height: 128px;
  border-radius: 50%;
  background: var(--fundo-2);
  border: 1px solid var(--borda);
  display: grid; place-items: center;
  font-size: 2.4rem;
  overflow: hidden;
  transition: transform .16s ease;
}
.img-previa:hover { transform: scale(1.03); }
.img-previa img { width: 100%; height: 100%; object-fit: cover; }

.copiavel {
  display: flex;
  gap: 8px;
  align-items: center;
  background: var(--fundo-2);
  border: 1px solid var(--borda);
  border-radius: var(--raio);
  padding: 10px 12px;
}
.copiavel code {
  flex: 1;
  font-family: var(--mono);
  font-size: .84rem;
  overflow-x: auto;
  white-space: nowrap;
  color: var(--ciano);
}

/* ============================================================== avisos */
.torradas { position: fixed; bottom: 20px; right: 20px; display: grid; gap: 10px; z-index: 200; }
.torrada {
  background: var(--superficie-2);
  border: 1px solid var(--borda-forte);
  border-left: 3px solid var(--roxo);
  border-radius: var(--raio);
  padding: 12px 16px;
  font-size: .9rem;
  box-shadow: var(--sombra);
  animation: entrar .18s ease;
  max-width: 340px;
}
.torrada.erro { border-left-color: var(--vermelho); }
@keyframes entrar { from { opacity: 0; transform: translateX(14px) } }

/* ========================================================== responsivo */
.veu { display: none; }

/* Celular e tablet em pé: o chat ocupa a tela inteira e o resto vira gaveta,
   como no Discord do celular. O ☰ abre salas + canais juntos (a barra de
   salas não rouba 62px fixos da conversa); o 👥 abre os membros. */
@media (max-width: 900px) {
  .app, .app.com-membros {
    grid-template-columns: 1fr;
    padding-top: env(safe-area-inset-top);
  }
  .vazio { grid-column: 1 / -1; }

  /* Fechadas, as gavetas ficam INVISÍVEIS além de fora da tela: antes a
     lateral recuava só a própria largura e sobrava um pedaço dela aparecendo
     por cima da barra de salas. */
  .trilha, .lateral, .membros-col {
    position: fixed;
    top: 0; bottom: 0;
    z-index: 60;
    padding-top: env(safe-area-inset-top);
    visibility: hidden;
    transition: transform .2s ease, visibility 0s linear .2s;
  }
  .trilha { left: 0; width: 72px; transform: translateX(-100%); }
  .lateral { left: 72px; width: min(290px, calc(100vw - 72px - 44px)); transform: translateX(calc(-100% - 72px)); }
  .membros-col { right: 0; width: min(290px, calc(100vw - 44px)); transform: translateX(100%); }
  .trilha { padding-top: calc(12px + env(safe-area-inset-top)); }
  .lateral .eu-barra { padding-bottom: calc(8px + env(safe-area-inset-bottom)); }

  .lateral.aberta, .membros-col.aberta,
  .app:has(.lateral.aberta) .trilha {
    transform: none;
    visibility: visible;
    transition: transform .2s ease, visibility 0s;
  }
  .lateral.aberta, .membros-col.aberta { box-shadow: var(--sombra-g); }

  .veu {
    position: fixed;
    inset: 0;
    z-index: 59;
    background: rgba(4, 5, 9, .6);
  }
  .app:has(.lateral.aberta, .membros-col.aberta) .veu { display: block; animation: aparecer .2s ease; }

  .bolha { width: 46px; height: 46px; }
  .bolha::before { left: -13px; }

  /* Topo: só ícones, e o nome do canal encolhe com reticências. O "Convidar"
     continua no ⋯ da sala. */
  .principal-topo { padding: 0 6px; gap: 2px; }
  .principal-topo .sep { margin-left: 2px; }
  .principal-topo h3 { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .principal-topo .icone-btn { width: 38px; height: 38px; flex: none; }
  .principal-topo .btn { flex: none; padding: 0 10px; height: 36px; }
  .principal-topo .rotulo { display: none; }
  #btn-convidar { display: none; }
  .principal.em-voz .voz-topo { padding-right: 4px; margin-right: 2px; }

  /* Conversa: menos respiro lateral, texto ocupando a largura. */
  .chat { padding: 14px 12px 8px; }
  .msg { gap: 12px; }
  .msg.agrupada .msg-corpo { margin-left: 48px; }
  .digitando { padding: 2px 14px; }

  .compositor { padding: 4px 8px calc(8px + env(safe-area-inset-bottom)); }
  .compositor-caixa { padding: 6px 6px 6px 4px; gap: 4px; align-items: center; }
  .compositor-caixa .icone-btn { width: 38px; height: 38px; flex: none; font-size: 18px; }
  /* 16px: abaixo disso o Safari do iPhone dá zoom na página ao focar. */
  .compositor textarea { font-size: 16px; min-width: 0; align-self: center; }
  #btn-enviar { flex: none; padding: 8px 14px; }

  /* As abas de amigos rolam de lado, sem a barra de rolagem por cima. */
  .amigos-topo { gap: 8px; padding: 0 8px; scrollbar-width: none; }
  .amigos-topo::-webkit-scrollbar { display: none; }

  .lateral-topo { padding: 0 8px 0 14px; }
  .btn-novidades { padding: 0 8px; }

  .torradas { left: 12px; right: 12px; bottom: calc(84px + env(safe-area-inset-bottom)); }
  .torrada { max-width: none; }

  .modal-fundo { padding: 12px; }
  .modal { padding: 20px; max-height: 90dvh; }

  .palco video { max-height: 38vh; }
  .palco .mural { max-height: 38vh; }
  .palco-barra { padding: 6px 8px; gap: 6px; flex-wrap: wrap; }
}
@media (min-width: 901px) { .so-mobile { display: none !important; } }

/* Toque: sem hover, o que só aparecia com o mouse em cima fica sempre à vista. */
@media (hover: none) {
  .canal-menu { opacity: 1; }
  .item:hover { transform: none; }
}

/* ============================================================== canais */
.grupo-titulo { display: flex; align-items: center; justify-content: space-between; }
.grupo-add {
  border: 0;
  background: transparent;
  color: var(--texto-3);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
  border-radius: 5px;
}
.grupo-add:hover { color: var(--texto); background: var(--superficie-2); }

.canal { display: flex; align-items: center; gap: 2px; }
.canal .item { flex: 1; min-width: 0; }
.canal-simbolo { color: var(--texto-3); font-size: .9rem; width: 16px; text-align: center; flex: none; }
.canal .item.ativo .canal-simbolo { color: var(--texto-2); }

/* O menu do canal só aparece no hover — como no Discord, evita poluir. */
.canal-menu { opacity: 0; width: 24px; height: 24px; font-size: 13px; flex: none; }
.canal:hover .canal-menu { opacity: 1; }

/* Quem está numa sala de voz, listado abaixo dela */
.voz-pessoa {
  display: flex;
  align-items: center;
  gap: 8px;
  /* padding vertical folgado: o brilho de "falando" cabe dentro da linha e não
     é cortado pela rolagem da lista. */
  padding: 6px 10px 6px 30px;
  border-radius: 7px;
  transition: background .14s ease, box-shadow .14s ease;
}
.voz-pessoa.ajustavel { cursor: pointer; }
.voz-pessoa.ajustavel:hover { background: var(--superficie-2); }
.voz-pessoa .nome {
  font-size: .84rem;
  color: var(--texto-2);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.voz-pessoa.mudo-local .nome { text-decoration: line-through; opacity: .55; }
/* Maior que o `avatar-p` de antes (26px): dava para ver quem era só pelo nome. */
.voz-pessoa .avatar { width: 32px; height: 32px; font-size: .78rem; flex: none; }
.voz-pessoa .avatar { transition: box-shadow .16s ease, transform .16s ease; }
/* Contorno verde em quem está falando: é o retorno que diz "seu microfone
   está funcionando" sem precisar perguntar. Vale para você também. */
.voz-pessoa.falando .avatar {
  box-shadow: 0 0 0 2px var(--verde);
  animation: voz-pulso 1.5s ease-in-out infinite;
}
/* Brilho contido (máx. 5px): não vaza da linha nem é cortado pela rolagem. */
@keyframes voz-pulso {
  0%, 100% { box-shadow: 0 0 0 2px var(--verde), 0 0 0 3px rgba(63, 207, 142, .35); }
  50%      { box-shadow: 0 0 0 2px var(--verde), 0 0 0 5px rgba(63, 207, 142, 0); }
}


/* Controle de volume por pessoa — abre ao clicar em quem está na voz. */

/* Espelho da barra de voz no topo da área principal. */
.voz-topo { display: none; align-items: center; gap: 2px; }
.principal.em-voz .voz-topo {
  display: flex;
  padding-right: 8px;
  margin-right: 4px;
  border-right: 1px solid var(--borda);
  animation: vt-slide-down .18s ease;
}

/* =========================================================== barra de voz */
.voz-barra {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 10px;
  background: var(--fundo);
  border-top: 1px solid var(--borda);
  flex: none;
  animation: vt-slide-up .2s ease;
  transition: box-shadow .2s ease;
}
/* Quando VOCÊ fala, a barra inteira ganha um halo verde por dentro. */
.voz-barra.falando { box-shadow: inset 0 0 0 1px rgba(63, 207, 142, .5); }
.voz-info { display: flex; align-items: center; gap: 9px; flex: 1; min-width: 0; }
.voz-info b {
  display: block;
  font-size: .85rem;
  color: var(--verde);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.voz-info small { color: var(--texto-3); font-size: .74rem; }
/* Sinal da chamada: verde = boa, amarelo/vermelho = latência alta, cinza
   piscando = reconectando. O título (tooltip nativo) traz o "Xx ms". */
.voz-ponto {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--verde);
  flex: none;
  cursor: help;
  animation: respira 2.4s ease-in-out infinite;
  transition: box-shadow .2s ease, background-color .2s ease;
}
.voz-ponto.sinal-media { background: var(--amarelo); }
.voz-ponto.sinal-ruim { background: var(--vermelho); }
.voz-ponto.reconectando {
  background: var(--texto-3);
  animation: voz-ponto-reconectando .9s ease-in-out infinite;
}
.voz-barra.falando .voz-ponto:not(.reconectando) {
  animation: voz-ponto-pulso 1.2s ease-in-out infinite;
}
@keyframes respira {
  50% { opacity: .35; }
}
@keyframes voz-ponto-pulso {
  0%, 100% { box-shadow: 0 0 0 0 rgba(63, 207, 142, .5); }
  50%      { box-shadow: 0 0 0 6px rgba(63, 207, 142, 0); }
}
@keyframes voz-ponto-reconectando {
  0%, 100% { opacity: 1; }
  50%      { opacity: .3; }
}
.icone-btn.ativo-perigo { color: var(--vermelho); background: rgba(242, 84, 91, .12); }
.icone-btn.perigo:hover { color: var(--vermelho); background: rgba(242, 84, 91, .14); }
/* O microfone acende verde enquanto você fala (a menos que esteja mudo). */
.voz-barra.falando #btn-mudo:not(.ativo-perigo) { color: var(--verde); }

/* ===================================================== polimento e animações */
/* Itens da lateral: leve deslize no hover, além da cor. */
.item, .membro { transition: background .12s ease, color .12s ease, transform .12s ease; }
.item:hover { transform: translateX(2px); }

/* Botão "Transmitir" enquanto você está ao vivo: pulsa em vermelho. */
#btn-transmitir.btn-perigo { animation: live-pulsa 2s ease-in-out infinite; }
@keyframes live-pulsa {
  0%, 100% { box-shadow: 0 0 0 0 rgba(242, 84, 91, .0); }
  50%      { box-shadow: 0 0 0 4px rgba(242, 84, 91, .18); }
}

/* Torradas entram deslizando e saem suaves. */
.torrada { animation: torrada-entra .22s cubic-bezier(.2, .8, .3, 1); }
@keyframes torrada-entra { from { opacity: 0; transform: translateX(24px) scale(.96); } }

/* Contorno verde também no avatar do próprio usuário (rodapé) quando fala. */
.voz-barra.falando ~ .eu-barra .avatar,
.eu-barra .avatar { transition: box-shadow .16s ease; }

/* Cartão de transmissão sendo assistido: destaque animado. */
.cartao-live.assistindo { animation: none; }

/* Painel de emoji e popovers entram com o mesmo gesto. */
.emoji-painel { animation: vt-pop .14s ease; }

/* Foco visível consistente nos controles interativos. */
.icone-btn:focus-visible,
.bolha:focus-visible,
.item:focus-visible {
  outline: 2px solid var(--roxo);
  outline-offset: 2px;
}

/* ================================================= o seu "ao vivo" (web)
   O mesmo painel do app desktop: preview do que está sendo transmitido,
   quantas pessoas assistem, ajustes em tempo real e estatísticas. */
.palco-live[hidden] { display: none !important; }
.palco-live { display: flex; }
.palco-live video {
  width: 100%;
  height: 34vh;          /* o divisor manda nisto */
  background: #000;
  display: block;
  object-fit: contain;
}
.palco-live video[hidden] { display: none !important; }
.live-extras {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 6px 14px;
  background: var(--superficie);
  border-top: 1px solid var(--borda);
  font-size: .82rem;
  color: var(--texto-2);
}
.live-extras .chk { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
#live-espectadores { color: var(--texto-3); font-size: .84rem; }
#live-fonte { color: var(--texto-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Estatísticas: bitrate, FPS, resolução, RTT e qual encoder está em uso. */
.stats-overlay {
  margin: 0;
  padding: 10px 14px;
  background: #05060a;
  border-top: 1px solid var(--borda);
  color: var(--texto-2);
  font-family: var(--mono);
  font-size: .74rem;
  line-height: 1.6;
  white-space: pre-wrap;
  max-height: 26vh;
  overflow-y: auto;
}
