/* ---------------- rolagem de mensagens ---------------- */
#message-scroller { flex: 1; min-height: 0; overflow-y: auto; overflow-anchor: none; }
/* min-height mantem o palco de voz preenchendo a area; sem justify-content
   o conteudo comeca no topo, em vez de ficar colado no rodape */
#message-list { display: flex; flex-direction: column; min-height: 100%; padding-bottom: 24px; }

.load-more { padding: 16px; text-align: center; }
.load-more button { color: var(--link); font-size: 14px; }

/* ---------------- cabecalho do canal ---------------- */
.channel-intro { padding: 32px 16px 12px; }
.channel-intro .badge-icon {
  width: 56px; height: 56px; border-radius: 16px;
  background: var(--input); display: grid; place-items: center;
  color: var(--text-bright); margin-bottom: 16px;
}
.channel-intro .avatar-wrap { margin-bottom: 14px; }
/* moldura pode passar ate 160% do avatar (min() em layout.css); no avatar xl
   (80px) isso e 24px de sobra pra cada lado - sem essa margem ela invade o h2 */
.channel-intro .avatar-wrap.com-moldura { margin-bottom: 24px; }
.channel-intro h2 {
  font-family: var(--font-display);
  font-size: var(--fs-display); font-weight: 700; color: var(--text-bright);
  letter-spacing: -0.02em; margin-bottom: 4px;
  text-wrap: balance;
}
.channel-intro p { color: var(--text-muted); font-size: var(--fs-ui); max-width: 62ch; text-wrap: pretty; }

.day-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 20px 16px 6px;
  font-size: var(--fs-xs); font-weight: 600; color: var(--text-faint);
}
.day-divider::before, .day-divider::after {
  content: ""; flex: 1; height: 1px; background: var(--divider);
}

/* ---------------- mensagem ---------------- */
.message {
  position: relative;
  padding: 2px 48px 2px 72px;
  min-height: 22px;
  transition: background var(--t-toque) ease;
}
.message:hover { background: var(--hover); }
.message.first { margin-top: 16px; padding-top: 2px; }
.message.mentioned { background: var(--mention-bg); position: relative; }
.message.mentioned::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 2px;
  background: var(--brand);
}
.message.mentioned:hover { background: rgba(149, 69, 243, 0.17); }
.message.sending { opacity: 0.55; }
.message.failed .message-content { color: var(--red); }

.message .avatar-wrap { position: absolute; left: 16px; top: 2px; }
.message .avatar-clicavel { cursor: pointer; }
.message .msg-header { display: flex; align-items: baseline; gap: 8px; margin-bottom: 1px; }
.message .author {
  font-size: var(--fs-msg); font-weight: 600; color: var(--text-bright);
  cursor: pointer;
}
.message .author:hover { text-decoration: underline; }
.message .owner-tag {
  font-size: 11px; font-weight: 600; line-height: 16px;
  background: rgba(233, 168, 58, 0.14); color: var(--owner);
  padding: 0 6px; border-radius: 4px; align-self: center;
}
.message .timestamp { font-size: var(--fs-xs); color: var(--text-faint); }
.message .edited { font-size: 11px; color: var(--text-faint); margin-left: 4px; }

.message .gutter-time {
  position: absolute;
  left: 0; width: 72px;
  padding-right: 8px;
  text-align: right;
  font-size: 11px; color: var(--text-faint);
  /* numeros de mesma largura: a hora nao "dança" ao aparecer e sumir */
  font-variant-numeric: tabular-nums;
  opacity: 0; line-height: 22px;
  transition: opacity var(--t-toque) ease;
}
.message:hover .gutter-time { opacity: 1; }

.message-content {
  font-size: var(--fs-msg);
  line-height: 1.47;
  color: var(--text);
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow-wrap: anywhere;
  text-wrap: pretty;
}

/* ---------------- resposta ---------------- */
.reply-preview {
  display: flex; align-items: center; gap: 6px;
  font-size: var(--fs-sm); color: var(--text-muted);
  margin-bottom: 4px; cursor: pointer;
  position: relative;
}
.reply-preview::before {
  content: "";
  position: absolute;
  left: -40px; top: 10px;
  width: 36px; height: 10px;
  border-left: 2px solid var(--divider);
  border-top: 2px solid var(--divider);
  border-top-left-radius: 6px;
}
.reply-preview .avatar { width: 16px; height: 16px; font-size: 9px; }
.reply-preview .who { font-weight: 500; color: var(--text-bright); }
.reply-preview .snippet { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reply-preview:hover .snippet { color: var(--text); }

.message.highlight { animation: flash 2s ease; }
@keyframes flash {
  0%, 40% { background: rgba(149, 69, 243, 0.2); }
  100% { background: transparent; }
}

/* ---------------- markdown ---------------- */
.message-content strong { font-weight: 700; }
.message-content em { font-style: italic; }
.message-content u { text-decoration: underline; }
.message-content s { text-decoration: line-through; }
.message-content code.inline {
  background: var(--input); border-radius: 4px;
  padding: 1px 5px; font-family: var(--mono); font-size: 87%;
}
.message-content pre {
  background: var(--input-alt);
  border: 1px solid var(--divider);
  border-radius: var(--radius);
  padding: 10px 12px;
  margin: 4px 0;
  overflow-x: auto;
  max-width: 100%;
}
.message-content pre code { font-family: var(--mono); font-size: 13px; color: var(--text); white-space: pre; }
.message-content blockquote {
  border-left: 3px solid var(--divider);
  padding-left: 12px; margin: 2px 0;
}
.message-content .mention {
  background: rgba(149, 69, 243, 0.16); color: var(--brand-soft);
  border-radius: 4px; padding: 0 3px; font-weight: 500; cursor: pointer;
  transition: background var(--t-toque) ease, color var(--t-toque) ease;
}
.message-content .mention:hover { background: var(--brand); color: #fff; }
.message-content .mention.me { background: rgba(149, 69, 243, 0.28); }
.message-content .spoiler {
  background: var(--input-alt); border-radius: 3px;
  color: transparent; cursor: pointer;
}
.message-content .spoiler.revealed { background: var(--hover); color: inherit; }
.message-content .emoji-lg { font-size: 40px; line-height: 1.2; }

/*
 * Emoji do servidor dentro da mensagem.
 *
 * Alinhado pela base do texto e com altura em em, para acompanhar o tamanho
 * da linha - inclusive quando a mensagem so tem emoji e o corpo cresce.
 */
.message-content .emoji-custom {
  display: inline-block;
  height: 1.4em;
  width: auto;
  vertical-align: -0.32em;
  object-fit: contain;
  margin: 0 1px;
}
.message-content .emoji-lg .emoji-custom { height: 1.15em; vertical-align: -0.18em; }

/* ---------------- anexos ---------------- */
.attachments { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.attachment-img {
  max-width: 400px; max-height: 320px;
  border-radius: var(--radius); cursor: pointer;
  width: auto; object-fit: contain;
}
.attachment-file {
  display: flex; align-items: center; gap: 12px;
  background: var(--input-alt);
  border: 1px solid var(--divider);
  border-radius: var(--radius);
  padding: 10px 12px;
  max-width: 420px;
}
.attachment-file .info { min-width: 0; }
.attachment-file .fname { color: var(--link); font-size: var(--fs-ui); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attachment-file .fsize { font-size: var(--fs-xs); color: var(--text-muted); }
.attachment-video, .attachment-audio { max-width: 420px; border-radius: var(--radius); }

/* ---------------- previa de link ---------------- */
.previa-link {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  max-width: 460px;
  margin-top: 6px;
  padding: 12px 14px;
  position: relative;
  overflow: hidden;
  background: var(--input-alt);
  border: 1px solid var(--divider);
  border-radius: var(--radius);
  color: inherit;
  text-decoration: none;
  transition: background var(--t-toque) ease, border-color var(--t-toque) ease;
}
.previa-link:hover {
  background: var(--hover);
  border-color: var(--text-faint);
  text-decoration: none;
}

.previa-texto { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.previa-site {
  font-size: var(--fs-xs); font-weight: 500;
  color: var(--text-faint);
}
.previa-titulo {
  font-size: var(--fs-ui); font-weight: 600; color: var(--link);
  line-height: 1.3;
  text-wrap: pretty;
}
.previa-link:hover .previa-titulo { text-decoration: underline; }
.previa-desc {
  font-size: var(--fs-sm); color: var(--text-muted); line-height: 1.45;
  text-wrap: pretty;
  /* tres linhas ja dizem do que se trata; o resto e no proprio site */
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.previa-capa {
  flex: 0 0 auto;
  width: 76px; height: 76px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--input);
}

@media (max-width: 720px) {
  .previa-capa { display: none; }
}

/* ---------------- reacoes ---------------- */
.reactions { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.reaction {
  display: flex; align-items: center; gap: 6px;
  height: 26px; padding: 0 7px;
  border-radius: var(--radius);
  background: var(--input);
  border: 1px solid transparent;
  font-size: var(--fs-ui); color: var(--text-muted);
  transition: border-color var(--t-toque) ease, background var(--t-toque) ease;
}
.reaction:hover { border-color: var(--text-faint); }
.reaction.mine { background: var(--mention-bg); border-color: var(--brand); color: var(--brand-soft); }
.reaction .count { font-size: var(--fs-xs); font-weight: 600; font-variant-numeric: tabular-nums; }
.reaction.add { color: var(--text-muted); opacity: 0; }
.message:hover .reaction.add { opacity: 1; }

/* ---------------- acoes rapidas ---------------- */
.msg-actions {
  position: absolute;
  top: -16px; right: 16px;
  display: none;
  background: var(--modal);
  border-radius: var(--radius);
  box-shadow: var(--shadow-high);
  overflow: hidden;
}
/* aparece junto quando o teclado chega em algum dos botoes */
.message:hover .msg-actions,
.msg-actions:focus-within { display: flex; }
.msg-actions button {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  color: var(--text-muted);
  transition: background var(--t-toque) ease, color var(--t-toque) ease;
}
.msg-actions button:hover { background: var(--hover); color: var(--text-bright); }
.msg-actions button.danger:hover { color: var(--red); }
/*
 * A barra corta o que passa da borda (overflow:hidden), entao o anel de foco
 * com offset ficava invisivel aqui. Neste caso ele vira uma sombra por dentro.
 */
.msg-actions button:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 2px var(--foco);
  border-radius: 0;
}

/* ---------------- edicao inline ---------------- */
.edit-box { margin: 4px 0; }
.edit-box textarea {
  width: 100%;
  background: var(--input-alt);
  border: 1px solid var(--divider); border-radius: var(--radius);
  padding: 10px 12px;
  color: var(--text);
  resize: none;
  font-size: var(--fs-msg);
  line-height: 1.47;
  outline: none;
}
.edit-box textarea:focus { border-color: var(--brand); }
.edit-box .hint { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.edit-box .hint b { color: var(--link); cursor: pointer; font-weight: 400; }

/* ---------------- area do compositor ---------------- */
#composer-area { padding: 0 16px 20px; flex: 0 0 auto; }

#reply-bar {
  display: flex; align-items: center; gap: 8px;
  background: var(--input-alt);
  border: 1px solid var(--divider);
  border-bottom: 0;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: 8px 14px;
  font-size: var(--fs-sm); color: var(--text-muted);
}
#reply-bar .who { color: var(--text-bright); font-weight: 600; }
#reply-bar .close { margin-left: auto; color: var(--text-muted); }
#reply-bar .close:hover { color: var(--text-bright); }

#pending-files { display: flex; gap: 8px; flex-wrap: wrap; background: var(--input); border: 1px solid var(--divider); border-bottom: 0; border-radius: var(--radius-lg) var(--radius-lg) 0 0; padding: 12px; }
.pending-file {
  position: relative;
  width: 108px; height: 108px;
  background: var(--input-alt);
  border-radius: var(--radius);
  padding: 8px;
  display: flex; flex-direction: column; justify-content: flex-end;
  overflow: hidden;
}
.pending-file img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pending-file .fname {
  position: relative; z-index: 1;
  font-size: 11px; color: var(--text-bright);
  background: rgba(0, 0, 0, 0.6); border-radius: 3px; padding: 2px 4px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pending-file .remove {
  position: absolute; top: 4px; right: 4px; z-index: 2;
  width: 24px; height: 24px; border-radius: 4px;
  background: var(--modal); color: var(--red);
  display: grid; place-items: center;
}

#composer {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  background: var(--input);
  border: 1px solid var(--divider);
  border-radius: var(--radius-lg);
  padding: 0 8px 0 0;
  position: relative;
  transition: border-color var(--t-toque) ease;
}
#composer.stacked { border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
#composer:focus-within { border-color: var(--text-faint); }
#composer.disabled { opacity: 0.5; pointer-events: none; }

#composer .attach-btn {
  width: 36px; height: 46px;
  flex: 0 0 36px;
  display: grid; place-items: center;
  color: var(--text-muted);
  margin-left: 6px;
  transition: color var(--t-toque) ease;
}
#composer .attach-btn:hover { color: var(--text-bright); }

#composer-input {
  flex: 1;
  background: none;
  border: 0;
  outline: none;
  resize: none;
  color: var(--text);
  font-size: var(--fs-msg);
  line-height: 1.47;
  padding: 12px 0;
  max-height: 340px;
  min-height: 46px;
  overflow-y: auto;
}
#composer-input::placeholder { color: var(--text-faint); }

#composer .tool-btn {
  width: 34px; height: 46px;
  display: grid; place-items: center;
  color: var(--text-muted);
  flex: 0 0 34px;
  transition: color var(--t-toque) ease;
}
#composer .tool-btn:hover { color: var(--text-bright); }
#composer .char-count { font-size: var(--fs-xs); color: var(--text-muted); align-self: center; padding-left: 4px; font-variant-numeric: tabular-nums; }
#composer .char-count.over { color: var(--red); font-weight: 600; }

#typing-bar {
  height: 22px;
  font-size: var(--fs-xs);
  color: var(--text-muted);
  padding: 0 4px;
  display: flex; align-items: center; gap: 6px;
  margin-top: -20px;
}
#typing-bar .dots { display: inline-flex; gap: 2px; }
#typing-bar .dots i {
  width: 4px; height: 4px; border-radius: 50%;
  background: var(--text-muted);
  animation: bounce 1.4s infinite ease-in-out;
}
#typing-bar .dots i:nth-child(2) { animation-delay: 0.2s; }
#typing-bar .dots i:nth-child(3) { animation-delay: 0.4s; }
@keyframes bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-4px); opacity: 1; }
}

/* ---------------- autocomplete ---------------- */
#autocomplete {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0; right: 0;
  background: var(--modal);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-high);
  overflow: hidden;
  max-height: 260px;
  overflow-y: auto;
  z-index: 30;
  padding: 4px;
}
#autocomplete .ac-head {
  padding: 6px 8px 4px; font-size: var(--fs-xs); font-weight: 600;
  color: var(--text-faint);
}
.ac-item {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 8px; border-radius: var(--radius-row); cursor: pointer; font-size: var(--fs-ui);
}
.ac-item.active { background: var(--active); }
.ac-item .sub { color: var(--text-muted); font-size: var(--fs-xs); margin-left: auto; }

/* ---------------- estado vazio / voz ---------------- */
.empty-state {
  flex: 1;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 12px; text-align: center; padding: 40px;
  color: var(--text-muted);
}
.empty-state h2 {
  font-family: var(--font-display);
  font-size: 22px; font-weight: 700; color: var(--text-bright);
  letter-spacing: -0.01em;
  text-wrap: balance;
}
.empty-state p { max-width: 46ch; text-wrap: pretty; line-height: 1.5; }

/* a sala de voz e a unica area quase preta: o que importa ali sao as pessoas e a tela */
.voice-stage {
  flex: 1;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 24px; background: var(--rail); padding: 40px;
}
:root[data-theme="light"] .voice-stage { background: var(--input-alt); }
.voice-tiles { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.voice-tile {
  width: 200px; min-height: 140px; height: auto;
  padding: 20px 10px 16px;
  background: var(--sidebar);
  border-radius: var(--radius-lg);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 8px;
  border: 2px solid transparent;
  transition: border-color var(--t-toque) ease;
}
/* com o teto de 1,6x, a moldura ainda passa uns 24px alem do avatar grande
   (80px); sem essa folga embaixo, ela ficava por cima do nome e do ping */
.voice-tile .avatar-wrap.com-moldura { margin-bottom: 16px; }
.voice-tile.speaking { border-color: var(--green); }
.voice-tile .name { font-size: var(--fs-ui); font-weight: 600; color: var(--text-bright); }
.voice-tile .muted-badge { font-size: var(--fs-xs); color: var(--red); }
.voice-actions { display: flex; gap: 10px; }
.voice-actions button {
  height: 44px; padding: 0 18px; border-radius: var(--radius-lg);
  background: var(--input); color: var(--text-bright);
  font-weight: 500; display: flex; align-items: center; gap: 8px;
  transition: background var(--t-toque) ease;
}
.voice-actions button:hover { background: var(--active); }
.voice-actions button.on { background: var(--text-bright); color: var(--rail); }
.voice-actions button.leave { background: var(--danger); color: #fff; font-weight: 600; }
.voice-actions button.leave:hover { background: var(--danger-hover); }
.voice-actions button.join { background: var(--green); color: #fff; font-weight: 600; }

/* ---------------- palco de voz ---------------- */
.voice-stage .stage-title {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  font-size: var(--fs-title); font-weight: 600; color: var(--text-bright);
}
.voice-stage .stage-hint { color: var(--text-muted); font-size: var(--fs-ui); text-align: center; }

/*
 * align-items:center (herdado de .voice-stage) faz os filhos encolherem para
 * o tamanho do proprio conteudo em vez de esticar. Sem isto, a largura do
 * palco da transmissao (que e 100% do seu pai) dependia de quanto os tiles de
 * participantes empurravam a fileira - com poucas pessoas na sala, o palco
 * nascia minusculo mesmo tendo espaco de sobra ao lado.
 */
.voice-stage.with-stream {
  justify-content: flex-start;
  align-items: stretch;
  padding: 16px;
  gap: 12px;
}

/* ---------------- tela compartilhada ---------------- */
/* o video sem moldura: quem marca que e ao vivo e o selo, com o degrade da marca */
.stream-stage {
  position: relative;
  width: 100%;
  flex: 1;
  min-height: 220px;
  background: #000;
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.stream-video {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
  opacity: 0;
  transition: opacity 0.25s ease;
}
.stream-video.ready { opacity: 1; }
/* a tela cheia e pedida no contentor (chat.js), nao no <video> */
.stream-stage:fullscreen { border-radius: 0; }

.stream-loading {
  position: absolute;
  z-index: 2;
  color: var(--text-muted);
  font-size: 14px;
  pointer-events: none;
}
/* ~ e nao +: o selo "ao vivo" entrou entre o video e este aviso */
.stream-video.ready ~ .stream-loading { display: none; }

.stream-bar {
  position: absolute;
  z-index: 3;
  left: 14px; right: 14px; bottom: 14px;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius);
  background: rgba(12, 13, 16, 0.72);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  backdrop-filter: blur(6px);

  /* escondida por padrao: ela cobre o rodape da transmissao, e transmissao
     boa e a que se ve inteira. Volta quando o mouse entra no palco, como em
     qualquer tocador de video. */
  opacity: 0;
  transform: translateY(6px);
  pointer-events: none;
  transition: opacity var(--t-abre) var(--curva-saida),
              transform var(--t-abre) var(--curva-saida);
}

/* alem do mouse, dois casos que tambem precisam dela na tela: foco de teclado
   (sem isto os botoes seriam inalcancaveis sem mouse) e o painel de numeros
   aberto, que e a propria barra quem controla */
.stream-stage:hover > .stream-bar,
.stream-stage:focus-within > .stream-bar,
.stream-stage:has([data-painel-numeros]:not([hidden])) > .stream-bar {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

/* em tela de toque nao existe passar o mouse: ali ela fica sempre visivel */
@media (hover: none) {
  .stream-bar { opacity: 1; transform: none; pointer-events: auto; }
}

@media (prefers-reduced-motion: reduce) {
  .stream-bar { transition: none; }
}
.stream-bar .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--red);
  flex: 0 0 8px;
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse { 50% { opacity: 0.35; } }
/* o titulo cresce e empurra os botoes para a direita. Com margin-left:auto em
   cada botao eles se espalhavam um do outro conforme apareciam e sumiam (o de
   volume some na propria transmissao) */
.stream-bar [data-titulo] { flex: 1; min-width: 0; }
/* numeros da transmissao: fica sobre o video, no canto oposto ao selo */
.stream-numeros {
  position: absolute;
  z-index: 3;
  right: 14px; top: 14px;
  min-width: 168px;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: rgba(12, 13, 16, 0.84);
  backdrop-filter: blur(6px);
  color: #fff;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.stream-numeros[hidden] { display: none; }
.numero-titulo {
  font-size: var(--fs-xs); font-weight: 600;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 8px;
}
.numero-linha {
  display: flex; align-items: baseline; justify-content: space-between; gap: 16px;
  padding: 2px 0;
}
.numero-linha span { color: rgba(255, 255, 255, 0.66); }
.numero-linha b { font-weight: 700; }

.stream-bar .stream-btn.ligado { background: var(--brand); }

/* plateia: quantas pessoas estao com esta transmissao aberta */
.stream-plateia {
  flex: 0 0 auto;
  display: inline-flex; align-items: center; gap: 5px;
  height: 24px; padding: 0 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 12px; font-weight: 700;
  font-variant-numeric: tabular-nums;
  cursor: default;
}
.stream-plateia[hidden] { display: none; }

.stream-bar .stream-btn {
  flex: 0 0 auto;
  width: 28px; height: 28px;
  display: grid; place-items: center;
  border-radius: 8px;
  color: #fff;
}
.stream-bar .stream-btn:hover { background: rgba(255, 255, 255, 0.18); }
/* sair da live: sempre um pouco destacado, e a saida de um estado */
.stream-bar .stream-btn[data-sair-live] { background: rgba(255, 255, 255, 0.14); }
.stream-bar .stream-btn[data-sair-live]:hover { background: rgba(255, 255, 255, 0.26); }

/* selo "ao vivo" no canto do video: so depois que a imagem chega */
.stream-stage .stream-selo { display: none; }
.stream-stage .stream-video.ready ~ .stream-selo {
  position: absolute;
  z-index: 3;
  left: 18px; top: 18px;
  display: flex; align-items: center; gap: 7px;
  height: 26px; padding: 0 10px 0 9px;
  border-radius: var(--radius);
  background: var(--brand-gradient);
  color: #fff;
  font-size: var(--fs-xs); font-weight: 700;
}
.stream-selo .bolinha {
  width: 7px; height: 7px; border-radius: 50%; background: #fff;
  animation: pulse 2s ease-in-out infinite;
}

.stream-switcher { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.switch-btn {
  display: flex; align-items: center; gap: 6px;
  height: 32px; padding: 0 12px;
  border-radius: var(--radius);
  background: var(--sidebar);
  color: var(--text-muted);
  font-size: var(--fs-sm); font-weight: 500;
  transition: background var(--t-toque) ease, color var(--t-toque) ease;
}
.switch-btn:hover { color: var(--text-bright); }
.switch-btn.active { background: var(--active); color: var(--text-bright); }
/* voltar a assistir: e uma acao, nao um dos transmissores */
.switch-btn[data-voltar-live] { background: var(--input); color: var(--brand-soft); }
.switch-btn[data-voltar-live]:hover { background: var(--active); color: var(--text-bright); }

/* ---------------- participantes ---------------- */
.voice-stage.with-stream .voice-tiles { gap: 8px; }
.voice-stage.with-stream .voice-tile {
  width: 132px; height: 96px;
  gap: 4px;
}
.voice-stage.with-stream .voice-tile .avatar.xl { width: 48px; height: 48px; font-size: 18px; }

.voice-tile .tile-flags { display: flex; align-items: center; gap: 6px; }
.voice-tile .muted-badge { color: var(--red); display: inline-flex; }
/* quem esta transmitindo carrega o degrade: e o estado que importa na sala */
.stream-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 1px 7px; border-radius: 4px;
  background: var(--brand-gradient); color: #fff;
  font-size: 11px; font-weight: 700; line-height: 16px;
}

.voice-actions button.sharing { background: var(--brand-gradient); color: #fff; font-weight: 600; }
.voice-actions button.sharing:hover { filter: brightness(1.08); }

.voice-member .live-icon { margin-left: auto; color: var(--red); display: inline-flex; }
.voice-member .live-icon + .mute-icon { margin-left: 0; }

@media (max-width: 900px) {
  .voice-stage.with-stream .voice-tiles { display: none; }
}

/* participante clicavel: abre o controle de volume individual */
.voice-tile[data-user] { cursor: pointer; position: relative; }
.voice-tile[data-user]::after {
  content: "";
  position: absolute; inset: 0;
  border-radius: 8px;
  box-shadow: inset 0 0 0 2px transparent;
  transition: box-shadow 0.15s ease;
  pointer-events: none;
}
.voice-tile[data-user]:hover::after { box-shadow: inset 0 0 0 2px var(--brand); }
.voice-tile .dica-volume {
  position: absolute; top: 6px; right: 8px;
  font-size: 10px; color: var(--text-muted);
  opacity: 0; transition: opacity 0.15s ease;
}
.voice-tile[data-user]:hover .dica-volume { opacity: 1; }

/* silenciado por administrador: nao e o mudo comum */
.voice-tile .muted-badge.servidor { color: var(--brand-soft); }

/* ---- transmissao pausada (janela minimizada ou coberta) ---- */
.stream-pausada {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: rgba(0, 0, 0, .72);
  color: var(--text-bright);
  text-align: center;
  z-index: 2;
}
.stream-stage.pausada .stream-pausada { display: flex; }
.stream-pausada small { color: var(--text-muted); }
.palco-slot:empty { display: none; }
.stream-switcher:empty { display: none; }
