/* AstraScreenShare - visual escuro no estilo do Discord */
:root {
  --fundo-0: #1e1f22;      /* bordas, campos */
  --fundo-1: #2b2d31;      /* colunas laterais */
  --fundo-2: #313338;      /* centro */
  --fundo-3: #383a40;      /* cartões, hover */
  --usuario: #232428;      /* painel do usuário */
  --texto: #dbdee1;
  --texto-forte: #f2f3f5;
  --fraco: #949ba4;
  --blurple: #5865f2;
  --blurple-2: #4752c4;
  --verde: #23a55a;
  --vermelho: #da373c;
  --amarelo: #f0b232;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--fundo-0);
  color: var(--texto);
  font: 15px/1.375 "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
h1, h2, h3 { color: var(--texto-forte); margin: 0; }
h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .02em; color: var(--fraco); font-weight: 700; }
.sub { color: var(--fraco); font-size: 14px; margin: 4px 0 0; }
button { font: inherit; }

/* ---------- botões e campos ---------- */
.bt {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 4px; padding: 0 16px; height: 38px;
  font-size: 14px; font-weight: 600; cursor: pointer; color: #fff;
  background: #4e5058; transition: background .15s;
}
.bt:hover { background: #6d6f78; }
.bt:disabled { opacity: .5; cursor: not-allowed; }
.bt.primario { background: var(--blurple); }
.bt.primario:hover:not(:disabled) { background: var(--blurple-2); }
.bt.secundario { background: #4e5058; }
.bt.perigo { background: transparent; color: #fa777c; }
.bt.perigo:hover { background: rgba(218, 55, 60, .15); }
.bt.link { background: transparent; color: var(--texto); }
.bt.link:hover { text-decoration: underline; background: transparent; }
.bt.pequeno { height: 32px; padding: 0 12px; font-size: 13px; }
.bt-icone { background: transparent; border: 0; color: var(--fraco); cursor: pointer; padding: 6px; border-radius: 4px; display: grid; place-items: center; }
.bt-icone:hover { background: var(--fundo-3); color: var(--texto); }
input, .sel {
  background: var(--fundo-0); color: var(--texto); border: 0; border-radius: 4px;
  padding: 10px; font: inherit; width: 100%; outline: none;
}
input:focus, .sel:focus { box-shadow: 0 0 0 2px var(--blurple); }
.sel { width: auto; cursor: pointer; }
.chip { background: var(--fundo-0); color: var(--fraco); border: 0; border-radius: 4px; font-size: 12px; padding: 2px 6px; cursor: pointer; }
.chip:hover { color: var(--texto); }
.chip span { font-family: Consolas, ui-monospace, monospace; }

/* ---------- estrutura em 3 colunas ---------- */
.app { height: 100%; display: grid; grid-template-columns: 240px 1fr 272px; }
.lateral, .online { background: var(--fundo-1); display: flex; flex-direction: column; min-height: 0; }
.principal { background: var(--fundo-2); display: flex; flex-direction: column; min-width: 0; min-height: 0; }

.lateral-topo { height: 48px; display: flex; align-items: center; gap: 10px; padding: 0 16px; box-shadow: 0 1px 0 rgba(0,0,0,.25); color: var(--texto-forte); flex: none; }
.lateral-topo .logo { width: 24px; height: 24px; border-radius: 6px; }
.info-sala, .info-inicio { flex: 1; overflow-y: auto; padding: 16px 8px; }
.info-inicio p { color: var(--fraco); font-size: 14px; padding: 0 8px; margin: 0; }
.sala-titulo { padding: 0 8px 16px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.sala-titulo b { color: var(--texto-forte); font-size: 16px; word-break: break-word; }
.info-sala h3 { padding: 0 8px 4px; }

.lista { list-style: none; margin: 0; padding: 0; }
.lista li { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 4px; min-height: 42px; }
.lista li:hover { background: var(--fundo-3); }
.lista .nome { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.lista .nome b { font-weight: 500; color: var(--texto); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lista .nome small { color: var(--fraco); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lista .acao { display: none; }
.lista li:hover .acao, .lista li:focus-within .acao { display: inline-flex; }
.pilula { font-size: 10px; font-weight: 700; color: #fff; background: var(--vermelho); border-radius: 4px; padding: 1px 5px; flex: none; }
.cachorro { width: 22px; height: 22px; border-radius: 50%; flex: none; }

.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 13px; flex: none; position: relative; }
.avatar.ao-vivo { box-shadow: 0 0 0 2px var(--fundo-1), 0 0 0 4px var(--vermelho); }
.avatar .bolinha { position: absolute; right: -2px; bottom: -2px; width: 12px; height: 12px; border-radius: 50%; background: var(--verde); border: 3px solid var(--fundo-1); }

.painel-usuario { height: 52px; background: var(--usuario); display: flex; align-items: center; gap: 8px; padding: 0 8px; flex: none; }
.usuario-info { flex: 1; min-width: 0; text-align: left; background: transparent; border: 0; color: var(--texto); padding: 2px 4px; border-radius: 4px; cursor: pointer; display: flex; flex-direction: column; }
.usuario-info:hover { background: var(--fundo-3); }
.usuario-info b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--texto-forte); }
.usuario-info .sub { font-size: 12px; margin: 0; font-family: Consolas, ui-monospace, monospace; }

.barra-topo { height: 48px; display: flex; align-items: center; gap: 10px; padding: 0 16px; box-shadow: 0 1px 0 rgba(0,0,0,.25); flex: none; }
.barra-topo b { color: var(--texto-forte); flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ponto { width: 10px; height: 10px; border-radius: 50%; background: var(--fraco); flex: none; }
.ponto.ok { background: var(--verde); }
.ponto.caiu { background: var(--vermelho); }

/* ---------- início ---------- */
.inicio { flex: 1; overflow-y: auto; padding: 40px 24px; display: flex; flex-direction: column; align-items: center; gap: 28px; }
.boas-vindas { text-align: center; }
.boas-vindas h1 { font-size: 26px; }
.id-grande { margin-top: 18px; background: var(--fundo-0); border: 0; border-radius: 8px; padding: 14px 26px; cursor: pointer; color: var(--texto-forte); display: inline-flex; flex-direction: column; align-items: center; gap: 2px; }
.id-grande:hover { box-shadow: 0 0 0 2px var(--blurple); }
.id-grande span { font: 700 32px/1.1 Consolas, ui-monospace, monospace; letter-spacing: .06em; }
.id-grande small { color: var(--fraco); font-size: 12px; }
.cartoes { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; width: 100%; max-width: 640px; }
.cartao { background: var(--fundo-1); border-radius: 8px; padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.cartao h2 { font-size: 18px; }
.cartao .sub { margin: -6px 0 0; }
.msg { color: #fa777c; min-height: 1.4em; margin: 0; text-align: center; }

/* ---------- sala ---------- */
.sala { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.palco { flex: 1; overflow: auto; padding: 16px; display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); align-content: center; }
.vazio { grid-column: 1 / -1; text-align: center; color: var(--fraco); }
.vazio p { margin: 6px 0 0; }
.vazio b { color: var(--texto-forte); font-size: 17px; }
.bloco { position: relative; background: #000; border-radius: 8px; overflow: hidden; aspect-ratio: 16 / 9; }
.bloco video { width: 100%; height: 100%; object-fit: contain; display: block; background: #000; }
.bloco .rotulo { position: absolute; left: 8px; bottom: 8px; background: rgba(0,0,0,.6); padding: 3px 8px; border-radius: 4px; font-size: 13px; display: flex; gap: 6px; align-items: center; color: #fff; }
.bloco .plateia { position: absolute; left: 8px; top: 8px; background: rgba(0,0,0,.6); padding: 3px 8px; border-radius: 4px; font-size: 13px; display: flex; gap: 6px; align-items: center; color: #fff; }
.bloco .plateia img { width: 20px; height: 20px; border-radius: 50%; }
.bloco .barra { position: absolute; right: 8px; bottom: 8px; display: flex; gap: 6px; align-items: center; background: rgba(0,0,0,.6); padding: 4px 8px; border-radius: 4px; opacity: 0; transition: opacity .15s; }
.bloco:hover .barra { opacity: 1; }
.bloco .barra input[type=range] { width: 90px; padding: 0; accent-color: var(--blurple); background: transparent; box-shadow: none; }
.bloco .barra button { background: none; border: 0; color: #fff; cursor: pointer; padding: 2px; display: grid; place-items: center; }
.bloco .ativar-som { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0,0,0,.45); border: 0; color: #fff; font-weight: 700; cursor: pointer; }
/* Sem mouse (celular): os botões do vídeo ficam sempre à mostra */
@media (hover: none) { .bloco .barra { opacity: 1; } .bloco .barra button { padding: 6px; } }
/* Tela cheia dentro do app Android (o Java esconde as barras e gira a tela) */
.bloco.cheia { position: fixed !important; inset: 0; width: 100%; height: 100%; min-height: 0 !important; aspect-ratio: auto !important; border-radius: 0; z-index: 15; }
body.tem-cheia { overflow: hidden; }
.palco.um-so { align-content: stretch; }
.palco.um-so .bloco { aspect-ratio: auto; min-height: 240px; }

.doca { display: flex; justify-content: center; align-items: center; gap: 10px; padding: 12px 16px 16px; flex-wrap: wrap; }
.bt.transmitir { height: 44px; padding: 0 20px; background: var(--verde); font-size: 15px; }
.bt.transmitir:hover { background: #1a8a4a; }
.bt.transmitir.ao-vivo { background: var(--vermelho); }
.bt.transmitir.ao-vivo:hover { background: #a12828; }
.bt.relaxado { height: 44px; padding: 0 16px 0 6px; background: var(--fundo-3); border-radius: 22px; }
.bt.relaxado img { width: 34px; height: 34px; border-radius: 50%; }
.bt.relaxado.ligado { background: var(--amarelo); color: #1e1f22; }
.aviso { color: var(--fraco); margin: 0; font-size: 13px; flex-basis: 100%; text-align: center; }
.bt.acorde { height: 44px; padding: 0 16px 0 6px; background: #f47b67; border-radius: 22px; color: #1e1f22; }
.bt.acorde:hover:not(:disabled) { background: #f9957f; }
.bt.acorde img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; object-position: 70% 40%; }
.bt.acorde:disabled { opacity: .55; }

/* Modo Acorde: a campainha toca na tela de quem assiste */
.campainha { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 16px;
  background: radial-gradient(circle at center, rgba(244,123,103,.35), rgba(0,0,0,.85) 70%);
  animation: piscar 1s ease-in-out 3; }
.campainha-caixa { position: relative; background: var(--fundo-2); border-radius: 16px; padding: 28px 28px 24px; width: 100%; max-width: 420px; text-align: center;
  box-shadow: 0 0 0 4px #f47b67, 0 20px 60px rgba(0,0,0,.6); animation: pular .45s cubic-bezier(.2,1.6,.4,1); }
.campainha-foto { width: 220px; height: 170px; margin: -80px auto 0; border-radius: 14px; overflow: hidden; border: 4px solid #f47b67; background: #000;
  transform-origin: 50% 0; animation: tremer .5s ease-in-out infinite; box-shadow: 0 10px 30px rgba(0,0,0,.5); }
.campainha-foto img { width: 100%; height: 100%; object-fit: cover; display: block; }
.campainha-ondas { position: absolute; top: 40px; left: 50%; width: 0; height: 0; }
.campainha-ondas span { position: absolute; left: -130px; top: -100px; width: 260px; height: 200px; border-radius: 50%; border: 3px solid #f47b67; opacity: 0; animation: onda 1.5s ease-out infinite; }
.campainha-ondas span:nth-child(2) { animation-delay: .5s; }
.campainha-ondas span:nth-child(3) { animation-delay: 1s; }
.campainha h2 { font-size: 40px; font-weight: 900; letter-spacing: .04em; margin: 18px 0 4px; color: #f47b67; text-shadow: 0 2px 0 #000; }
.campainha p { margin: 0 0 18px; font-size: 16px; color: var(--texto-forte); }
.bt.grande { height: 46px; padding: 0 28px; font-size: 16px; }
@keyframes tremer { 0%, 100% { transform: rotate(0); } 20% { transform: rotate(-4deg); } 40% { transform: rotate(4deg); } 60% { transform: rotate(-3deg); } 80% { transform: rotate(2deg); } }
@keyframes pular { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes onda { from { transform: scale(.8); opacity: .8; } to { transform: scale(1.6); opacity: 0; } }
@keyframes piscar { 50% { background-color: rgba(244,123,103,.25); } }

/* Modo relaxado: só a transmissão na tela, como num cinema */
.faixa-relaxado { display: flex; align-items: center; gap: 10px; padding: 8px 16px; background: rgba(240, 178, 50, .12); color: var(--amarelo); font-size: 14px; }
.faixa-relaxado img { width: 28px; height: 28px; border-radius: 50%; }
.faixa-relaxado span { flex: 1; }
.app.cinema { grid-template-columns: 1fr; }
.app.cinema .lateral, .app.cinema .online, .app.cinema .barra-topo, .app.cinema .doca { display: none; }
.app.cinema .palco { padding: 0; gap: 0; }
.app.cinema .bloco { border-radius: 0; }

/* ---------- online ---------- */
.online { padding: 16px 8px 8px; gap: 10px; }
.online h3 { padding: 0 8px; }
.busca { padding: 6px 10px; font-size: 14px; }
.online .lista { flex: 1; overflow-y: auto; }

/* ---------- chat da sala ---------- */
.abas-direita { display: flex; gap: 4px; }
.aba-d { flex: 1; background: transparent; border: 0; color: var(--fraco); padding: 6px 8px; border-radius: 4px; cursor: pointer; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.aba-d:hover { color: var(--texto); background: var(--fundo-3); }
.aba-d.ativa { color: #fff; background: var(--fundo-3); }
.contador { background: var(--vermelho); color: #fff; border-radius: 8px; font-size: 11px; padding: 0 5px; min-width: 16px; line-height: 16px; text-align: center; }
.painel-chat, .painel-online { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 10px; }
.chat-topo { display: flex; align-items: center; justify-content: space-between; padding-left: 8px; }
.bt-icone.desligado { color: #fa777c; }
.chat-lista { list-style: none; margin: 0; padding: 0 4px; flex: 1; min-height: 0; overflow-y: auto; }
.chat-lista:empty::before { content: "Ninguém falou nada ainda. Diga oi!"; display: block; color: var(--fraco); font-size: 13px; padding: 8px 4px; }
.chat-lista li { display: grid; grid-template-columns: 32px 1fr; column-gap: 10px; padding: 8px 4px 0; }
.chat-lista li > .avatar { grid-row: span 2; }
.chat-lista li.seguida { padding-top: 2px; }
.chat-cab { display: flex; align-items: baseline; gap: 6px; min-width: 0; grid-column: 2; }
.chat-cab b { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-cab time { font-size: 11px; color: var(--fraco); flex: none; }
.chat-lista p { margin: 0; font-size: 14px; color: var(--texto); white-space: pre-wrap; overflow-wrap: anywhere; grid-column: 2; }
.form-chat { display: flex; align-items: center; background: var(--fundo-0); border-radius: 8px; padding-right: 4px; flex: none; }
.form-chat input { background: transparent; box-shadow: none !important; }
.aviso-chat .avatar { width: 36px; height: 36px; }
.aviso-chat .corpo { overflow-wrap: anywhere; }

/* ---------- janelas (modais) ---------- */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.75); display: grid; place-items: center; z-index: 20; padding: 16px; }
.modal-caixa { background: var(--fundo-2); border-radius: 8px; padding: 20px; width: 100%; max-width: 780px; max-height: 92vh; display: flex; flex-direction: column; gap: 14px; box-shadow: 0 8px 24px rgba(0,0,0,.4); }
.modal-caixa.pequena { max-width: 420px; }
.modal-caixa h2 { font-size: 20px; }
.modal-rodape { display: flex; justify-content: flex-end; gap: 8px; background: var(--fundo-1); margin: 0 -20px -20px; padding: 14px 20px; border-radius: 0 0 8px 8px; }
.abas { display: flex; gap: 4px; }
.aba { background: transparent; border: 0; color: var(--fraco); padding: 6px 12px; border-radius: 4px; cursor: pointer; font-weight: 600; }
.aba:hover { color: var(--texto); background: var(--fundo-3); }
.aba.ativa { color: #fff; background: var(--fundo-3); }
.seletor-lista { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; overflow-y: auto; min-height: 140px; }
.seletor-lista button { background: var(--fundo-1); border: 2px solid transparent; border-radius: 8px; padding: 8px; color: var(--texto); cursor: pointer; text-align: left; }
.seletor-lista button:hover { background: var(--fundo-3); }
.seletor-lista button.escolhido { border-color: var(--blurple); }
.seletor-lista img { width: 100%; aspect-ratio: 16 / 9; object-fit: contain; background: #000; border-radius: 4px; display: block; }
.seletor-lista span { display: block; margin-top: 6px; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.opcoes { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.opcoes label { display: flex; flex-direction: column; gap: 6px; font-size: 12px; font-weight: 700; text-transform: uppercase; color: var(--fraco); }
.opcoes .sel { width: 100%; text-transform: none; font-weight: 400; font-size: 14px; }

/* ---------- avisos (canto de baixo) ---------- */
.avisos { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 30; max-width: min(360px, calc(100% - 32px)); }
/* No PC, os avisos ficam no alto do centro, sem cobrir o chat da direita */
@media (min-width: 861px) {
  .avisos { top: 60px; bottom: auto; right: 288px; }
  .app.cinema ~ .avisos { right: 16px; top: 16px; }
  body.modo-astra .avisos { top: 132px; right: 316px; }
}
.aviso-card { background: var(--usuario); border-radius: 8px; padding: 12px; display: flex; gap: 10px; align-items: flex-start; box-shadow: 0 8px 16px rgba(0,0,0,.35); animation: entrar .2s ease-out; }
.aviso-card img { width: 44px; height: 44px; border-radius: 50%; flex: none; }
.aviso-card .corpo { flex: 1; min-width: 0; font-size: 14px; }
.aviso-card .corpo b { color: var(--texto-forte); display: block; }
.aviso-card .botoes { display: flex; gap: 6px; margin-top: 8px; }
@keyframes entrar { from { transform: translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- celular ---------- */
@media (max-width: 860px) {
  .app { height: auto; min-height: 100%; grid-template-columns: 1fr; }
  .lateral { order: 3; }
  .principal { order: 1; min-height: 70vh; }
  .online { order: 2; height: 60vh; min-height: 320px; }
  .info-sala, .info-inicio { max-height: 40vh; }
  .palco { grid-template-columns: 1fr; padding: 8px; }
  .palco.um-so .bloco { aspect-ratio: 16 / 9; min-height: 0; }
  .inicio { padding: 24px 16px; }
  .app.cinema .principal { min-height: 100vh; }
}

/* Cartão "você está transmitindo" no celular */
.bloco.meu-celular { display: grid; place-items: center; background: linear-gradient(135deg, #3c2a2a, #1e1f22); }
.celular-ao-vivo { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; padding: 16px; }
.celular-ao-vivo b { color: var(--texto-forte); font-size: 17px; }
.celular-ao-vivo small { color: var(--fraco); max-width: 320px; }
/* Avisos dentro da tela cheia de um vídeo */
.bloco:fullscreen .avisos { top: 16px; right: 16px; bottom: auto; }
