/* ============================================================================
   cordless — visual
   Cinzas chapados no estilo Discord, densos e diretos. O acento agua e a unica
   cor de marca; o resto e neutro de proposito, pra que o verde de "esta
   falando" e o vermelho de "mudo" saltem sozinhos sem competir com enfeite.
   ========================================================================= */

:root {
  --preto: #16171a;
  --trilha: #101114;
  --lateral: #1e2024;
  --fundo: #26282d;
  --alto: #2f3238;
  --mais-alto: #383b42;
  --linha: #34373d;

  --texto: #f2f3f5;
  --fraco: #b3b8c0;
  --apagado: #878d96;

  --agua: #6ee7d7;
  --agua-forte: #45cfbc;
  --agua-fundo: rgba(110, 231, 215, 0.12);
  --violeta: #a78bfa;
  --ambar: #fbbf24;
  --rosa: #f472b6;
  --verde: #29c07a;
  --vermelho: #ef4d52;

  --r-p: 6px;
  --r-m: 9px;
  --r-g: 14px;

  --rapido: 110ms;
  --medio: 190ms;
  --suave: cubic-bezier(0.2, 0.8, 0.2, 1);
  --mola: cubic-bezier(0.2, 1.3, 0.4, 1);

  --sombra: 0 8px 26px rgba(0, 0, 0, 0.45);
  --sombra-alta: 0 18px 50px rgba(0, 0, 0, 0.6);
}

* { box-sizing: border-box; }

/* O `hidden` do HTML e so a folha do navegador dizendo display:none, e
   qualquer regra de autor ganha dele. Como varios blocos aqui declaram
   display:grid/flex, sem este !important o hidden nao esconderia nada. */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--preto);
  color: var(--texto);
  font: 15px/1.45 system-ui, "Segoe UI", Roboto, sans-serif;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

button { cursor: pointer; font: inherit; border: none; border-radius: var(--r-m); color: inherit; }
button:focus-visible, input:focus-visible { outline: 2px solid var(--agua); outline-offset: 2px; }

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: transparent; border-radius: 9px; }
:hover::-webkit-scrollbar-thumb { background: #0c0d10; }
::-webkit-scrollbar-track { background: transparent; }

/* O fundo com aurora existe SO na tela de entrada. Dentro do app ele sai de
   cena: chapado le melhor e nao compete com o que importa. */
.ceu {
  position: fixed;
  inset: -30%;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(38% 46% at 22% 28%, rgba(110, 231, 215, 0.18), transparent 70%),
    radial-gradient(42% 40% at 78% 30%, rgba(167, 139, 250, 0.16), transparent 70%);
  filter: blur(40px);
  animation: respirar 26s ease-in-out infinite alternate;
  transition: opacity 600ms ease;
}
body:has(#entrada[hidden]) .ceu { opacity: 0; }

@keyframes respirar {
  from { transform: translate3d(-3%, -2%, 0) scale(1); }
  to   { transform: translate3d(3%, 2%, 0) scale(1.12); }
}

.alerta-versao {
  position: fixed;
  z-index: 90;
  top: 0; left: 0; right: 0;
  background: #3a1417;
  border-bottom: 1px solid var(--vermelho);
  color: #ff9ea1;
  padding: 8px 18px;
  font-size: 13px;
  text-align: center;
  animation: descer var(--medio) var(--suave);
}
.alerta-versao b { color: #fff; }
@keyframes descer { from { transform: translateY(-100%); } }

@keyframes aparecer { from { opacity: 0; transform: translateY(6px); } }
@keyframes subir { to { opacity: 1; transform: none; } }
@keyframes brotar { from { transform: scale(0); } }

/* ============================================================= entrada */

.tela-entrada {
  position: relative;
  z-index: 1;
  height: 100%;
  display: grid;
  place-items: center;
  padding: 20px;
}

.abertura {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 4px;
  cursor: pointer;
}

.cabo { width: min(480px, 84vw); overflow: visible; }

.fio {
  fill: none;
  stroke: var(--agua);
  stroke-width: 3;
  stroke-linecap: round;
  filter: drop-shadow(0 0 6px rgba(110, 231, 215, 0.55));
  /* O comprimento real de cada curva vem do JS. O 1000 e a rede de seguranca:
     sem ele, ate o JS medir, o cabo pisca inteiro na tela. */
  stroke-dasharray: var(--comp, 1000);
  stroke-dashoffset: var(--comp, 1000);
  animation: desenhar 0.85s ease-out forwards;
}
.plugue { fill: var(--agua); opacity: 0; animation: surgir 0.2s ease-out 0.8s forwards; }

@keyframes desenhar { to { stroke-dashoffset: 0; } }
@keyframes surgir { to { opacity: 1; } }

.ponta { animation: 1.5s cubic-bezier(0.2, 0.7, 0.25, 1) 1.15s forwards; }
.ponta-esq { animation-name: recuar; }
.ponta-dir { animation-name: soltar; }

/* O brilho aguenta ate as pontas se afastarem de verdade. Apagando desde o
   inicio, o estalo do rompimento passa despercebido. */
@keyframes recuar {
  25%  { transform: translate(-18px, 6px) rotate(-2deg); opacity: 1; }
  60%  { opacity: 0.9; }
  100% { transform: translate(-62px, 38px) rotate(-7deg); opacity: 0; }
}
@keyframes soltar {
  25%  { transform: translate(32px, -30px) rotate(7deg); opacity: 1; }
  60%  { opacity: 0.9; }
  100% { transform: translate(96px, -200px) rotate(22deg); opacity: 0; }
}

.faiscas circle {
  fill: var(--agua);
  opacity: 0;
  animation: faiscar 1s cubic-bezier(0.1, 0.8, 0.3, 1) 1.15s forwards;
  transform-origin: 240px 78px;
  filter: drop-shadow(0 0 5px var(--agua));
}
@keyframes faiscar {
  0%   { opacity: 1; transform: rotate(var(--a)) translateX(0) scale(1.6); }
  70%  { opacity: 0.85; }
  100% { opacity: 0; transform: rotate(var(--a)) translateX(var(--d)) scale(0.25); }
}

.marca {
  margin: -18px 0 0;
  display: flex;
  gap: 1px;
  font-size: clamp(38px, 9vw, 64px);
  font-weight: 200;
  letter-spacing: 0.06em;
  line-height: 1;
}
.marca span {
  opacity: 0;
  transform: translateY(16px);
  animation: subir 0.7s var(--suave) forwards;
  animation-delay: calc(1.5s + var(--i, 0) * 0.055s);
}
.marca span:nth-child(1) { --i: 0 }
.marca span:nth-child(2) { --i: 1 }
.marca span:nth-child(3) { --i: 2 }
.marca span:nth-child(4) { --i: 3 }
.marca span:nth-child(5) { --i: 4 }
.marca span:nth-child(6) { --i: 5 }
.marca span:nth-child(7) { --i: 6 }
.marca span:nth-child(8) { --i: 7 }
/* As tres ultimas letras — "less" — sao o que o nome quer dizer. */
.marca span:nth-child(n + 5) { color: var(--agua); }

.lema {
  margin: 14px 0 0;
  color: var(--apagado);
  font-size: 14px;
  letter-spacing: 0.14em;
  opacity: 0;
  animation: subir 0.9s ease-out 2.1s forwards;
}

.pular {
  position: fixed;
  right: 18px;
  bottom: 16px;
  background: none;
  border: 1px solid var(--linha);
  color: var(--apagado);
  border-radius: 999px;
  padding: 5px 14px;
  font-size: 12px;
  opacity: 0;
  animation: subir 0.5s ease-out 0.6s forwards;
  transition: color var(--rapido), border-color var(--rapido);
}
.pular:hover { color: var(--texto); border-color: var(--agua); }

.abertura.saindo { animation: dissolver 0.5s ease-in forwards; pointer-events: none; }
@keyframes dissolver { to { opacity: 0; transform: scale(1.06); } }

.cartao {
  position: relative;
  width: 100%;
  max-width: 380px;
  background: var(--fundo);
  border: 1px solid var(--linha);
  border-radius: var(--r-g);
  padding: 30px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: var(--sombra-alta);
  opacity: 0;
  transform: translateY(18px) scale(0.98);
  transition: opacity 500ms ease, transform 500ms var(--suave);
}
.cartao.pronto { opacity: 1; transform: none; }
.cartao h2 { margin: 0; font-size: 24px; font-weight: 600; letter-spacing: -0.01em; }
.cartao .sub { margin: -10px 0 2px; color: var(--apagado); font-size: 14px; }
.cartao form { display: flex; flex-direction: column; gap: 14px; animation: aparecer var(--medio) var(--suave); }

label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--fraco);
}

input {
  background: var(--preto);
  border: 1px solid transparent;
  border-radius: var(--r-p);
  padding: 11px 13px;
  color: var(--texto);
  font-size: 15px;
  font-weight: 400;
  text-transform: none;
  letter-spacing: normal;
  transition: border-color var(--rapido);
}
input:focus { outline: none; border-color: var(--agua); }
input::placeholder { color: #6c727c; }

.abas { display: flex; gap: 4px; background: var(--preto); padding: 4px; border-radius: var(--r-m); }
.aba {
  flex: 1;
  background: none;
  color: var(--apagado);
  padding: 9px;
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--r-p);
  transition: background var(--rapido), color var(--rapido);
}
.aba:hover { color: var(--texto); background: rgba(255, 255, 255, 0.04); }
.aba.ativa { background: var(--alto); color: var(--agua); }

.principal {
  background: var(--agua);
  color: #05231f;
  padding: 12px;
  font-weight: 700;
  transition: background var(--rapido), transform var(--rapido);
}
.principal:hover { background: var(--agua-forte); }
.principal:active { transform: scale(0.985); }
.principal:disabled { opacity: 0.5; cursor: wait; }

.secundario {
  background: none;
  border: 1px solid var(--linha);
  color: var(--fraco);
  padding: 11px;
  font-size: 14px;
  font-weight: 600;
  transition: border-color var(--rapido), color var(--rapido), background var(--rapido);
}
.secundario:hover { color: var(--texto); border-color: var(--agua); background: var(--agua-fundo); }

.erro { margin: 0; color: #ff9095; font-size: 13px; animation: tremer 320ms; }
@keyframes tremer {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

/* ============================================================= esqueleto */

.app { position: relative; z-index: 1; height: 100%; display: flex; min-height: 0; }

.veu { position: fixed; inset: 0; z-index: 40; background: rgba(0, 0, 0, 0.6); animation: aparecer var(--rapido) ease; }

/* ---- trilha de servidores */

.trilha {
  flex: 0 0 72px;
  background: var(--trilha);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 10px 0;
  overflow-y: auto;
}
.trilha-servidores { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.risco-h { width: 32px; height: 2px; background: var(--linha); border-radius: 2px; flex: none; }

.bolha {
  position: relative;
  width: 48px;
  height: 48px;
  flex: none;
  border-radius: 16px;
  background: var(--lateral);
  color: var(--fraco);
  display: grid;
  place-items: center;
  font-size: 15px;
  font-weight: 700;
  text-transform: uppercase;
  transition: border-radius var(--medio) var(--mola), background var(--rapido), color var(--rapido);
  animation: brotar 240ms var(--mola);
}
.bolha:hover { border-radius: 14px; background: var(--agua); color: #05231f; }
.bolha:active { transform: scale(0.93); }
.bolha.ativa { border-radius: 14px; background: linear-gradient(135deg, var(--agua), var(--violeta)); color: #05231f; }
.bolha.casa:hover, .bolha.casa.ativa { background: linear-gradient(135deg, var(--violeta), var(--rosa)); color: #1a0b2e; }

/* A pilulinha branca na borda esquerda e a assinatura visual do Discord: diz
   qual servidor esta aberto sem precisar de texto. Ela cresce, nao pisca. */
.bolha::before {
  content: '';
  position: absolute;
  left: -12px;
  top: 50%;
  width: 4px;
  height: 0;
  border-radius: 0 4px 4px 0;
  background: #fff;
  transform: translateY(-50%);
  transition: height var(--medio) var(--mola);
}
.bolha:hover::before { height: 18px; }
.bolha.ativa::before { height: 30px; }

.bolha.nova { background: var(--lateral); color: var(--verde); }
.bolha.nova:hover { background: var(--verde); color: #04150c; }
.bolha .ico { width: 22px; height: 22px; }

.selo-voz {
  position: absolute;
  right: -3px;
  bottom: -3px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--verde);
  color: #04150c;
  font-size: 11px;
  font-weight: 700;
  display: grid;
  place-items: center;
  border: 3px solid var(--trilha);
}

/* ---- barra de canais */

.barra {
  flex: 0 0 250px;
  width: 250px;
  background: var(--lateral);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.barra-topo {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 49px;
  padding: 0 14px;
  border-bottom: 1px solid var(--linha);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.2);
  font-size: 15px;
  font-weight: 700;
}
.barra-topo b { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.mini-acao {
  background: none;
  color: var(--apagado);
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: var(--r-p);
  flex: none;
  transition: background var(--rapido), color var(--rapido);
}
.mini-acao:hover { background: var(--alto); color: var(--texto); }
.mini-acao .ico { width: 18px; height: 18px; }

.barra-corpo {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.grupo { color: var(--apagado); }
.grupo {
  padding: 10px 8px 2px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--apagado);
}

.canal {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 9px;
  border-radius: var(--r-p);
  background: none;
  color: var(--apagado);
  font-size: 15px;
  font-weight: 500;
  text-align: left;
  transition: background var(--rapido), color var(--rapido);
  animation: aparecer var(--rapido) ease;
}
.canal:hover { background: var(--alto); color: var(--fraco); }
.canal:active { transform: scale(0.985); }
.canal.ativo { background: var(--mais-alto); color: var(--texto); }

/* Enquanto o microfone abre e o servidor responde. Sem este sinal, o clique
   parece ter se perdido e a pessoa clica de novo. */
.canal.entrando { color: var(--verde); }
.canal.entrando::after {
  content: 'entrando…';
  margin-left: auto;
  font-size: 11px;
  color: var(--verde);
  animation: piscar 1s ease-in-out infinite;
}
@keyframes piscar { 50% { opacity: 0.35; } }
.canal .ico { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.9; }
/* Texto e voz tem cores proprias: da pra achar o canal certo no canto do olho. */
.canal[data-tipo="texto"]:hover .ico, .canal[data-tipo="texto"].ativo .ico { color: var(--agua); }
.canal[data-tipo="voz"]:hover .ico, .canal[data-tipo="voz"].na-call .ico { color: var(--verde); }
.canal span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.canal .qtd { margin-left: auto; font-size: 11px; color: var(--apagado); }

/* Ponto agua na borda: voce esta conectado na voz DESTE canal, mesmo estando
   lendo outro. E o que deixa a voz e o texto conviverem sem confusao. */
.canal.na-call { color: var(--agua); }
.canal.na-call::before {
  content: '';
  position: absolute;
  left: -8px;
  top: 50%;
  width: 4px;
  height: 20px;
  border-radius: 0 4px 4px 0;
  background: var(--agua);
  transform: translateY(-50%);
}

.na-voz {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 9px 4px 26px;
  font-size: 13px;
  color: var(--apagado);
  animation: aparecer var(--rapido) ease;
}
.na-voz .bolinha {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--agua), var(--violeta));
  display: grid;
  place-items: center;
  font-size: 9px;
  font-weight: 700;
  color: #06121a;
  text-transform: uppercase;
  flex: none;
}
.na-voz.mudo .bolinha { background: var(--vermelho); color: #fff; }

/* ---- widget de voz */

.voz-widget {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px;
  background: var(--preto);
  border-top: 1px solid var(--linha);
  animation: aparecer var(--medio) var(--suave);
}
.voz-info {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 9px;
  background: none;
  text-align: left;
  padding: 5px 7px;
  border-radius: var(--r-p);
  transition: background var(--rapido);
}
.voz-info:hover { background: var(--alto); }
.voz-info b { display: block; font-size: 13px; color: var(--verde); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.voz-info small { display: block; font-size: 11px; color: var(--apagado); }
.voz-ponto {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--verde);
  flex: none;
  box-shadow: 0 0 0 3px rgba(41, 192, 122, 0.2);
  animation: pulsar-ponto 2s ease-in-out infinite;
}
@keyframes pulsar-ponto { 50% { box-shadow: 0 0 0 6px rgba(41, 192, 122, 0.08); } }

.voz-sair {
  background: none;
  color: var(--apagado);
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: var(--r-p);
  flex: none;
  transition: background var(--rapido), color var(--rapido);
}
.voz-sair:hover { background: var(--vermelho); color: #fff; }
.voz-sair .ico { width: 18px; height: 18px; }

.lateral-pe {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-top: 1px solid var(--linha);
  background: var(--trilha);
  font-size: 12px;
}
.lateral-pe span { flex: 1; overflow-wrap: anywhere; font-weight: 600; color: var(--fraco); }
.lateral-pe .secundario { padding: 5px 10px; font-size: 11px; }

/* ---- busca e contatos */

.busca {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--preto);
  border: 1px solid transparent;
  border-radius: var(--r-p);
  padding: 0 11px;
  transition: border-color var(--rapido);
}
.busca:focus-within { border-color: var(--agua); }
.busca .ico { width: 15px; height: 15px; fill: none; stroke: var(--apagado); stroke-width: 2; flex: none; }
.busca input { border: none; background: none; padding: 9px 0; flex: 1; min-width: 0; font-size: 14px; }
.busca input:focus { outline: none; }

.contatos { display: flex; flex-direction: column; gap: 2px; }

.contato {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--r-p);
  cursor: pointer;
  font-size: 14px;
  color: var(--fraco);
  transition: background var(--rapido), color var(--rapido);
  animation: aparecer var(--rapido) ease;
}
.contato:hover { background: var(--alto); color: var(--texto); }
.contato.ativo { background: var(--mais-alto); color: var(--texto); }
.contato .luz {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #4c5058;
  flex: none;
  transition: background var(--medio), box-shadow var(--medio);
}
.contato.online .luz { background: var(--verde); box-shadow: 0 0 0 3px rgba(41, 192, 122, 0.18); }
.contato .naolidas { position: static; margin-left: auto; flex: none; }
.contato .quem-e { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.contato .quem-e b { font-weight: 600; }
.contato .previa {
  font-size: 12px;
  color: var(--apagado);
  /* Uma linha so: previa de mensagem longa nao pode esticar a barra. */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vazio-busca { color: var(--apagado); font-size: 13px; padding: 10px 4px; line-height: 1.5; }
.aviso-caixa {
  margin: 0;
  padding: 11px 12px;
  border-radius: var(--r-p);
  background: rgba(167, 139, 250, 0.1);
  border-left: 3px solid var(--violeta);
  color: var(--fraco);
  font-size: 13px;
}

/* ============================================================= conteudo */

.conteudo {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--fundo);
}

.topo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  height: 49px;
  flex: none;
  border-bottom: 1px solid var(--linha);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.2);
  font-size: 15px;
}
.topo b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.marca-canal { width: 20px; height: 20px; stroke: var(--apagado); fill: none; stroke-width: 1.9; flex: none; }
.assinatura {
  margin-left: auto;
  padding-left: 12px;
  border-left: 1px solid var(--linha);
  font-size: 11px;
  color: var(--apagado);
}
.contador { color: var(--apagado); font-size: 12px; }

.hamburguer {
  display: none;
  background: none;
  color: var(--fraco);
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: var(--r-p);
  transition: background var(--rapido), color var(--rapido);
}
.hamburguer:hover { background: var(--alto); color: var(--texto); }
.hamburguer .ico { width: 19px; height: 19px; }

.vista { flex: 1; min-height: 0; animation: aparecer var(--medio) var(--suave); }
.vista.coluna { display: flex; flex-direction: column; }

.vazio-geral {
  display: grid;
  place-content: center;
  text-align: center;
  color: var(--apagado);
  gap: 6px;
}
.vazio-geral p { margin: 0; font-size: 17px; color: var(--fraco); }
.vazio-geral small { font-size: 13px; }
.vazio-geral b { color: var(--agua); }

/* ---- mensagens */

.mensagens {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 15px;
}
.msg { animation: entrar-msg 220ms var(--suave); }
@keyframes entrar-msg { from { opacity: 0; transform: translateY(8px); } }
.msg .quem { font-size: 13px; font-weight: 600; color: var(--agua); margin-bottom: 2px; }
.msg .texto { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--fraco); line-height: 1.5; }
.msg.minha .quem { color: var(--violeta); }
.msg.sistema { color: var(--apagado); font-size: 12px; font-style: italic; }

.chat-envio { display: flex; gap: 8px; padding: 12px 16px 16px; }
.chat-envio input { flex: 1; min-width: 0; padding: 12px 14px; font-size: 15px; background: var(--alto); }
.chat-envio button {
  background: var(--agua);
  color: #05231f;
  width: 46px;
  font-weight: 700;
  font-size: 17px;
  transition: background var(--rapido), transform var(--rapido);
}
.chat-envio button:hover { background: var(--agua-forte); }
.chat-envio button:active { transform: scale(0.94); }

/* ============================================================= call */

#vista-voz { display: flex; flex-direction: column; }
.corpo { flex: 1; min-height: 0; display: flex; }

#palco {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 14px 16px;
  overflow: auto;
}

.pessoas {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  align-content: center;
  flex: 1;
  min-height: 0;
}
#palco.compartilhando .pessoas { flex: 0 0 auto; gap: 8px; }

.pessoa {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 11px;
  padding: 20px 24px;
  border-radius: var(--r-g);
  background: var(--alto);
  border: 1px solid transparent;
  min-width: 148px;
  cursor: pointer;
  transition: background var(--rapido), border-color var(--rapido), transform var(--rapido);
  animation: entrar-cartao 240ms var(--suave) backwards;
}
@keyframes entrar-cartao { from { opacity: 0; transform: translateY(10px); } }
.pessoa:hover { background: var(--mais-alto); border-color: var(--linha); }
.pessoa:active { transform: scale(0.985); }

#palco.compartilhando .pessoa {
  flex-direction: row;
  gap: 8px;
  padding: 4px 12px 4px 4px;
  border-radius: 999px;
  min-width: 0;
}

.avatar {
  position: relative;
  width: 74px;
  height: 74px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--agua), var(--violeta));
  display: grid;
  place-items: center;
  font-size: 25px;
  font-weight: 700;
  color: #06121a;
  text-transform: uppercase;
  box-shadow: 0 0 0 0 rgba(110, 231, 215, 0);
  transition: box-shadow 140ms ease;
}
#palco.compartilhando .avatar { width: 26px; height: 26px; font-size: 11px; }

/* O anel e o unico jeito de saber quem esta falando numa call. Ele pulsa
   devagar pra chamar o olho sem virar estrobo. */
.pessoa.falando .avatar {
  box-shadow: 0 0 0 3px var(--agua), 0 0 22px rgba(110, 231, 215, 0.45);
  animation: pulsar 1.6s ease-in-out infinite;
}
@keyframes pulsar { 50% { box-shadow: 0 0 0 5px var(--agua), 0 0 30px rgba(110, 231, 215, 0.6); } }

.pessoa.silenciado .avatar { filter: grayscale(0.85); opacity: 0.6; }

.selo-mudo {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 25px;
  height: 25px;
  border-radius: 50%;
  background: var(--vermelho);
  border: 3px solid var(--alto);
  display: grid;
  place-items: center;
  animation: brotar 220ms var(--mola);
}
.selo-mudo svg { width: 13px; height: 13px; stroke: #fff; fill: none; stroke-width: 2.4; stroke-linecap: round; }
#palco.compartilhando .selo-mudo { width: 14px; height: 14px; border-width: 2px; right: -3px; bottom: -3px; }
#palco.compartilhando .selo-mudo svg { width: 8px; height: 8px; }

.pessoa .nome { font-size: 14px; font-weight: 600; }
#palco.compartilhando .pessoa .nome { font-size: 13px; }
.aviso { font-size: 11px; color: var(--apagado); text-align: center; }
.aviso.grave { color: #ff9095; }

.grade {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  align-content: center;
}
.grade:empty { display: none; }

.quadro {
  position: relative;
  background: #000;
  border: 1px solid var(--linha);
  border-radius: var(--r-m);
  overflow: hidden;
  aspect-ratio: 16 / 9;
  /* Sem este teto, uma tela sozinha fica mais alta que o palco e obriga a
     rolar a pagina no meio da chamada. */
  width: min(100%, calc((100dvh - 260px) * 16 / 9));
  justify-self: center;
  cursor: zoom-in;
  transition: border-color var(--rapido);
  animation: entrar-cartao 260ms var(--suave);
}
.quadro:hover { border-color: var(--agua); }
.quadro video { width: 100%; height: 100%; object-fit: contain; display: block; background: #000; }
.quadro .nome {
  position: absolute;
  left: 9px;
  bottom: 9px;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  padding: 3px 10px;
  border-radius: var(--r-p);
  font-size: 12px;
  font-weight: 600;
}

/* Um clique aumenta o quadro aqui dentro mesmo — sem tela cheia, pra nao
   perder de vista quem esta falando nem os botoes do rodape. */
.grade.focado { grid-template-columns: 1fr; }
.grade.focado .quadro:not(.foco) { display: none; }
.grade.focado .foco { cursor: zoom-out; border-color: var(--agua); width: min(100%, calc((100dvh - 190px) * 16 / 9)); }
.grade.focado .foco .nome::after { content: ' · clique ou Esc pra voltar'; color: var(--apagado); font-weight: 400; }

/* ---- quadro compartilhado */

.quadro-caixa {
  position: relative;
  width: min(100%, calc((100dvh - 260px) * 16 / 9));
  margin: 0 auto;
  align-self: center;
  animation: aparecer var(--medio) var(--suave);
}
#quadro {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #12141a;
  border: 1px solid var(--linha);
  border-radius: var(--r-m);
  cursor: crosshair;
  /* Sem isto o navegador rola a pagina em vez de desenhar, no celular. */
  touch-action: none;
}
.ferramentas {
  position: absolute;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(14, 16, 20, 0.92);
  border: 1px solid var(--linha);
  backdrop-filter: blur(10px);
  box-shadow: var(--sombra);
  flex-wrap: wrap;
  justify-content: center;
  max-width: 96%;
}
.ferramentas .cor {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--c);
  border: 2px solid transparent;
  padding: 0;
  transition: transform var(--rapido) var(--mola), border-color var(--rapido);
}
.ferramentas .cor:hover { transform: scale(1.12); }
.ferramentas .cor.ativa { border-color: #fff; transform: scale(1.18); }
.ferramentas .risco { width: 1px; height: 20px; background: var(--linha); margin: 0 3px; }

.ferramenta {
  background: none;
  border: 1px solid var(--linha);
  color: var(--apagado);
  border-radius: 999px;
  padding: 5px 11px;
  font-size: 12px;
  font-weight: 600;
  transition: color var(--rapido), border-color var(--rapido), background var(--rapido);
}
.ferramenta:hover { color: var(--texto); border-color: var(--agua); }
.ferramenta.ativa { background: var(--agua); border-color: var(--agua); color: #05231f; }
.ferramenta.perigo:hover { color: #ff9095; border-color: var(--vermelho); }

/* ---- barra de convite */

/* Verde e escrito por extenso de proposito: quem entra pela primeira vez nao
   adivinha o que um icone de corrente faz, e convidar e a acao que mais
   importa num app que so tem graca com gente dentro. */
.barra-convite {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 10px 0;
  padding: 10px 13px;
  border-radius: var(--r-m);
  background: linear-gradient(135deg, rgba(41, 192, 122, 0.18), rgba(41, 192, 122, 0.06));
  border: 1px solid rgba(41, 192, 122, 0.45);
  color: var(--verde);
  text-align: left;
  transition: background var(--rapido), transform var(--rapido), box-shadow var(--rapido);
}
.barra-convite:hover {
  background: var(--verde);
  color: #04150c;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(41, 192, 122, 0.25);
}
.barra-convite:active { transform: translateY(0); }
.barra-convite .ico { width: 19px; height: 19px; flex: none; }
.barra-convite span { font-weight: 800; letter-spacing: 0.08em; font-size: 13px; }
.barra-convite small { display: block; font-size: 11px; opacity: 0.75; font-weight: 500; letter-spacing: 0; }
.barra-convite span, .barra-convite small { display: block; }
.barra-convite > span { flex: 1; }

/* ---- cinema */

.cinema-caixa {
  width: min(100%, calc((100dvh - 300px) * 16 / 9));
  margin: 0 auto;
  align-self: center;
  animation: aparecer var(--medio) var(--suave);
}

.cinema-topo {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 12px;
  background: linear-gradient(180deg, rgba(251, 191, 36, 0.14), rgba(251, 191, 36, 0.04));
  border: 1px solid rgba(251, 191, 36, 0.4);
  border-bottom: none;
  border-radius: var(--r-m) var(--r-m) 0 0;
  font-size: 14px;
}
.cinema-topo .ico { width: 18px; height: 18px; color: var(--ambar); }
.cinema-topo b { color: var(--ambar); letter-spacing: 0.04em; }
.cinema-topo span { flex: 1; font-size: 12px; color: var(--apagado); }

.cinema-tela {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000;
  border: 1px solid rgba(251, 191, 36, 0.4);
  border-top: none;
  border-radius: 0 0 var(--r-m) var(--r-m);
  overflow: hidden;
}
.cinema-tela iframe { width: 100%; height: 100%; display: block; border: 0; }

/* O veu existe por causa da politica de autoplay: o navegador so deixa o
   video comecar depois de um clique DAQUELA pessoa. Sem ele, quem nao abriu
   o cinema veria uma tela preta parada sem entender por que. */
.cinema-veu {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 14px;
  background: rgba(0, 0, 0, 0.82);
  text-align: center;
  padding: 20px;
}
.cinema-veu p { margin: 0; color: var(--fraco); font-size: 15px; }
.cinema-veu .principal { padding: 12px 26px; }

.ferramenta.encerrar {
  background: var(--vermelho);
  border-color: var(--vermelho);
  color: #fff;
  font-weight: 800;
  letter-spacing: 0.05em;
}
.ferramenta.encerrar:hover { background: #ff5f64; border-color: #ff5f64; color: #fff; }

/* ---- chat da call */

.chat {
  width: 300px;
  flex: 0 0 300px;
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--linha);
  background: var(--lateral);
  animation: entrar-esq var(--medio) var(--suave);
}
@keyframes entrar-esq { from { transform: translateX(20px); opacity: 0; } }
.chat-topo {
  padding: 0 14px;
  height: 44px;
  display: flex;
  align-items: center;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--apagado);
  border-bottom: 1px solid var(--linha);
}
.chat .mensagens { padding: 14px; font-size: 14px; }
.chat .chat-envio { padding: 12px; border-top: 1px solid var(--linha); }
.chat .chat-envio input { padding: 10px 12px; font-size: 14px; background: var(--fundo); }
.chat .chat-envio button { width: 42px; font-size: 16px; }

/* ---- controles */

.controles {
  display: flex;
  gap: 8px;
  justify-content: center;
  align-items: center;
  padding: 12px;
  background: var(--preto);
  border-top: 1px solid var(--linha);
  flex: none;
}

.redondo {
  position: relative;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--alto);
  color: var(--texto);
  display: grid;
  place-items: center;
  transition: background var(--rapido), color var(--rapido), transform var(--rapido) var(--mola);
}
.redondo:hover { background: var(--mais-alto); transform: translateY(-2px); }
.redondo:active { transform: translateY(0) scale(0.94); }
.redondo.largo { width: auto; border-radius: 999px; padding: 0 20px; gap: 9px; grid-auto-flow: column; }
.redondo .rot { font-size: 14px; font-weight: 600; }

.ico { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.ico .cheio { fill: currentColor; stroke: none; }
.ico.desligado { display: none; }
.redondo.cortado .ico.ligado { display: none; }
.redondo.cortado .ico.desligado { display: block; }

/* Cortado = microfone/fone desligado. Vermelho porque e um estado que voce
   precisa perceber sem ler nada. */
.redondo.cortado { background: var(--vermelho); color: #fff; }
.redondo.cortado:hover { background: #ff5f64; }
.redondo.ativo { background: var(--agua); color: #05231f; }
.redondo.ativo:hover { background: var(--agua-forte); }
.redondo.desligar { background: var(--vermelho); color: #fff; }
.redondo.desligar:hover { background: #ff5f64; }
.redondo.atender { background: var(--verde); color: #04150c; }
.redondo.atender:hover { background: #35d98c; }

.naolidas {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--vermelho);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: grid;
  place-items: center;
  border: 2px solid var(--preto);
  animation: brotar 240ms var(--mola);
}

/* ============================================================= menu da pessoa */

/* Clique NORMAL, nao botao direito: o menu do navegador continua funcionando
   e nao aparecem dois menus empilhados. */
.menu-pessoa {
  position: fixed;
  z-index: 60;
  min-width: 210px;
  background: var(--lateral);
  border: 1px solid var(--linha);
  border-radius: var(--r-m);
  padding: 6px;
  box-shadow: var(--sombra-alta);
  display: flex;
  flex-direction: column;
  gap: 2px;
  animation: brotar-menu 150ms var(--suave);
  transform-origin: top left;
}
@keyframes brotar-menu { from { opacity: 0; transform: scale(0.94) translateY(-4px); } }
.menu-pessoa .cabeca {
  padding: 7px 10px 9px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--apagado);
  border-bottom: 1px solid var(--linha);
  margin-bottom: 4px;
  overflow-wrap: anywhere;
}
.menu-pessoa button {
  display: flex;
  align-items: center;
  gap: 10px;
  background: none;
  color: var(--fraco);
  text-align: left;
  padding: 9px 10px;
  font-size: 14px;
  font-weight: 500;
  border-radius: var(--r-p);
  transition: background var(--rapido), color var(--rapido);
}
.menu-pessoa button:hover { background: var(--agua); color: #05231f; }
.menu-pessoa button.perigo { color: #ff9095; }
.menu-pessoa button.perigo:hover { background: var(--vermelho); color: #fff; }
.menu-pessoa .ico { width: 17px; height: 17px; }

.menu-volume { padding: 8px 10px 10px; display: flex; flex-direction: column; gap: 7px; }
.menu-volume span { font-size: 12px; color: var(--apagado); font-weight: 600; }
.menu-volume input[type="range"] {
  width: 100%;
  accent-color: var(--agua);
  cursor: pointer;
}

/* ---- aviso flutuante */

.aviso-flutuante {
  position: fixed;
  z-index: 85;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  background: var(--lateral);
  border: 1px solid var(--agua);
  color: var(--texto);
  padding: 11px 18px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--sombra-alta);
  animation: subir-aviso 240ms var(--mola);
}
.aviso-flutuante.ruim { border-color: var(--vermelho); color: #ff9095; }
@keyframes subir-aviso { from { opacity: 0; transform: translate(-50%, 14px); } }

/* ============================================================= modal */

.modal-fundo {
  position: fixed;
  inset: 0;
  z-index: 88;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(3px);
  animation: aparecer var(--rapido) ease;
}

.modal {
  width: 100%;
  max-width: 430px;
  background: var(--fundo);
  border: 1px solid var(--linha);
  border-radius: var(--r-g);
  padding: 26px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: var(--sombra-alta);
  animation: brotar-modal 240ms var(--mola);
}
@keyframes brotar-modal { from { opacity: 0; transform: scale(0.94) translateY(10px); } }

.modal-icone { font-size: 30px; line-height: 1; }
.modal h3 { margin: 0; font-size: 20px; font-weight: 700; }
.modal p { margin: 0; color: var(--fraco); font-size: 14px; line-height: 1.55; }
.modal .modal-dica { color: var(--apagado); font-size: 12.5px; font-style: italic; }
.modal label { gap: 8px; }
.modal-botoes { display: flex; gap: 10px; margin-top: 4px; }
.modal-botoes button { flex: 1; }

.modal-opcoes { display: flex; gap: 10px; }
.modal-opcao {
  flex: 1;
  background: var(--preto);
  border: 1px solid var(--linha);
  border-radius: var(--r-m);
  padding: 12px;
  text-align: left;
  color: var(--fraco);
  transition: border-color var(--rapido), background var(--rapido), color var(--rapido);
}
.modal-opcao b { display: block; font-size: 14px; margin-bottom: 3px; }
.modal-opcao small { font-size: 11.5px; color: var(--apagado); line-height: 1.4; display: block; }
.modal-opcao:hover { border-color: var(--agua); }
.modal-opcao.ativa { border-color: var(--agua); background: var(--agua-fundo); color: var(--texto); }

/* ============================================================= telefone tocando */

.tocando {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.72);
  animation: aparecer var(--medio) ease;
}
.tocando-cartao {
  background: var(--fundo);
  border: 1px solid var(--linha);
  border-radius: var(--r-g);
  padding: 32px 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  box-shadow: var(--sombra-alta);
  animation: brotar-menu 260ms var(--mola);
}
.tocando-cartao b { font-size: 20px; }
.tocando-cartao small { color: var(--apagado); font-size: 13px; }
.tocando-avatar {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--agua), var(--violeta));
  display: grid;
  place-items: center;
  font-size: 30px;
  font-weight: 700;
  color: #06121a;
  text-transform: uppercase;
  margin-bottom: 8px;
  animation: chacoalhar 1.4s ease-in-out infinite;
}
/* O avatar balanca como um telefone tocando — o aviso chega antes do texto. */
@keyframes chacoalhar {
  0%, 60%, 100% { transform: rotate(0); }
  10%, 30%, 50% { transform: rotate(-7deg); }
  20%, 40% { transform: rotate(7deg); }
}
.tocando-botoes { display: flex; gap: 16px; margin-top: 14px; }

/* ============================================================= telas estreitas */

@media (max-width: 900px) {
  .hamburguer { display: grid; }
  .trilha { flex-basis: 60px; }
  .bolha { width: 42px; height: 42px; font-size: 13px; }

  /* No celular a barra de canais vira gaveta por cima, e nao coluna fixa. */
  .barra {
    position: fixed;
    z-index: 41;
    top: 0;
    bottom: 0;
    left: 60px;
    width: min(260px, 74vw);
    flex-basis: auto;
    transform: translateX(calc(-100% - 60px));
    transition: transform var(--medio) var(--suave);
    box-shadow: var(--sombra-alta);
  }
  .barra.aberta { transform: none; }

  .chat { position: absolute; inset: 0 0 0 auto; width: 100%; flex-basis: auto; z-index: 20; }
  .redondo .rot { display: none; }
  .redondo.largo { width: 46px; padding: 0; }
  .assinatura { display: none; }
}

@media (min-width: 901px) {
  .veu { display: none; }
}

/* Quem pediu menos movimento no sistema nao leva animacao nenhuma. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .ceu { animation: none; }
}
