:root {
  --fundo: #0f1115;
  --painel: #171a21;
  --painel2: #1f232c;
  --borda: #2b303b;
  --texto: #e7e9ee;
  --fraco: #9aa1af;
  --verde: #1fb57a;
  --verde2: #23c988;
  --vermelho: #e5484d;
  --amarelo: #f5b544;
  --raio: 10px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--fundo); color: var(--texto);
  font: 14px/1.45 "Segoe UI", system-ui, -apple-system, Roboto, sans-serif; }
[hidden] { display: none !important; }
button, input, select { font: inherit; color: inherit; }

.btn { background: var(--painel2); border: 1px solid var(--borda); border-radius: 8px; padding: 8px 14px;
  cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s; }
.btn:hover { background: #262b36; }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primario { background: var(--verde); border-color: var(--verde); color: #04140d; font-weight: 600; }
.btn.primario:hover { background: var(--verde2); }
.btn.perigo { border-color: #5a2a2d; color: #ffb4b6; }
.btn.perigo:hover { background: #3a1d20; }
.btn.ligado { background: #173d2d; border-color: var(--verde); }
.btn.transmitindo { background: var(--vermelho); border-color: var(--vermelho); color: #fff; }
.link { background: none; border: 0; color: var(--verde2); cursor: pointer; padding: 4px 6px; }
.logo { color: var(--verde2); }

/* Entrar */
.entrar { display: grid; place-items: center; height: 100%; padding: 24px; }
.cartao { width: 100%; max-width: 380px; background: var(--painel); border: 1px solid var(--borda);
  border-radius: 14px; padding: 28px; display: grid; gap: 14px; }
.marca { font-size: 22px; font-weight: 700; }
.sub { margin: -6px 0 4px; color: var(--fraco); }
label { display: grid; gap: 6px; color: var(--fraco); font-size: 13px; }
input, select { background: var(--fundo); border: 1px solid var(--borda); border-radius: 8px; padding: 9px 11px; color: var(--texto); }
input:focus, select:focus { outline: 2px solid var(--verde); outline-offset: 0; border-color: transparent; }
details summary { cursor: pointer; color: var(--fraco); }
details label { margin-top: 8px; }
.erro { color: #ff9a9d; min-height: 1.2em; margin: 0; }
.rodape { color: var(--fraco); font-size: 12px; margin: 0; text-align: center; }

/* Sala */
.sala { display: grid; grid-template-rows: auto 1fr; height: 100%; }
.barra { display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: var(--painel); border-bottom: 1px solid var(--borda); }
.sala-nome { font-weight: 600; font-size: 15px; }
.status { color: var(--fraco); font-size: 12px; }
.status.alerta { color: var(--amarelo); }
.acoes { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.corpo { display: grid; grid-template-columns: 1fr 240px; min-height: 0; }
.palco { position: relative; padding: 12px; display: grid; gap: 12px; min-height: 0; overflow: auto;
  grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); align-content: start; }
.palco.um { grid-template-columns: 1fr; align-content: stretch; }
.vazio { grid-column: 1 / -1; align-self: center; text-align: center; color: var(--fraco); padding: 60px 0; }
.dica { color: var(--fraco); font-size: 12px; }
.lateral { background: var(--painel); border-left: 1px solid var(--borda); padding: 12px; overflow: auto; display: flex; flex-direction: column; }
.lateral h3 { margin: 0 0 8px; font-size: 13px; color: var(--fraco); font-weight: 600; }
#lista-pessoas { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
#lista-pessoas li { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 6px; }
#lista-pessoas li.falando { background: #173d2d; }
#lista-pessoas .icones { margin-left: auto; font-size: 12px; opacity: .85; }
.banda { margin-top: auto; color: var(--fraco); font-size: 11px; padding-top: 8px; }

/* Bloco de transmissão */
.bloco { position: relative; background: #000; border: 1px solid var(--borda); border-radius: var(--raio);
  overflow: hidden; display: flex; min-height: 220px; }
.palco.um .bloco { min-height: 0; }
.bloco video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.bloco .rotulo { position: absolute; left: 8px; bottom: 8px; display: flex; gap: 8px; align-items: center;
  background: rgba(0,0,0,.65); padding: 4px 8px; border-radius: 6px; font-size: 12px; }
.bloco .controles { position: absolute; right: 8px; bottom: 8px; display: flex; gap: 6px; align-items: center;
  background: rgba(0,0,0,.65); padding: 4px 8px; border-radius: 6px; opacity: 0; transition: opacity .15s; }
.bloco:hover .controles { opacity: 1; }
.bloco .controles button { background: none; border: 0; cursor: pointer; font-size: 14px; padding: 2px 4px; }
.bloco .controles input[type=range] { width: 90px; padding: 0; }
.bloco.local .rotulo::before { content: "● "; color: var(--vermelho); }

/* Modal */
.modal { border: 1px solid var(--borda); border-radius: 14px; background: var(--painel); color: var(--texto);
  padding: 0; width: min(920px, 94vw); max-height: 90vh; }
.modal::backdrop { background: rgba(0,0,0,.6); }
.modal-corpo { display: flex; flex-direction: column; gap: 14px; padding: 18px 20px; max-height: 90vh; overflow: auto; }
.modal-topo { display: flex; align-items: center; }
.modal-topo h2 { margin: 0; font-size: 17px; }
.fechar { margin-left: auto; background: none; border: 0; cursor: pointer; font-size: 16px; color: var(--fraco); }
.abas { display: flex; gap: 6px; align-items: center; }
.aba { background: none; border: 1px solid var(--borda); border-radius: 999px; padding: 5px 14px; cursor: pointer; }
.aba.ativa { background: var(--painel2); border-color: var(--verde); }
.abas .link { margin-left: auto; }
.fontes { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; margin-top: 10px; max-height: 330px; overflow: auto; padding: 2px; }
.fonte { background: var(--fundo); border: 2px solid transparent; border-radius: 10px; padding: 6px; cursor: pointer; text-align: left; display: grid; gap: 6px; }
.fonte:hover { border-color: var(--borda); }
.fonte.escolhida { border-color: var(--verde); }
.fonte img.miniatura { width: 100%; aspect-ratio: 16 / 9; object-fit: contain; background: #000; border-radius: 6px; }
.fonte .nome { display: flex; gap: 6px; align-items: center; font-size: 12px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.fonte .nome img { width: 16px; height: 16px; }
.bloco-audio h3 { margin: 0 0 8px; font-size: 14px; }
.opcao { display: flex; gap: 8px; align-items: center; color: var(--texto); font-size: 14px; padding: 3px 0; cursor: pointer; }
.opcao small { color: var(--fraco); }
.apps { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 6px; margin: 6px 0 4px 24px; }
.apps.desligado { opacity: .45; pointer-events: none; }
.app-item { display: flex; gap: 8px; align-items: center; background: var(--fundo); border: 1px solid var(--borda);
  border-radius: 8px; padding: 7px 9px; color: var(--texto); font-size: 13px; cursor: pointer; }
.app-item .nome-app { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-item .tocando { margin-left: auto; color: var(--verde2); font-size: 11px; }
.app-item.vazio { color: var(--fraco); cursor: default; }
.linha { display: flex; gap: 12px; }
.linha label { flex: 1; max-width: 360px; }
.modal-rodape { display: flex; justify-content: flex-end; gap: 8px; }

@media (max-width: 800px) {
  .corpo { grid-template-columns: 1fr; }
  .lateral { display: none; }
  .palco { grid-template-columns: 1fr; }
  .barra { flex-wrap: wrap; }
}
.logo-img { width: 24px; height: 24px; vertical-align: middle; border-radius: 6px; }
.logo-img.grande { width: 40px; height: 40px; border-radius: 10px; }
.marca, .sala-nome { display: flex; align-items: center; gap: 10px; }
