/* =============================================================
 *  Salas Discord - estilo
 * ========================================================== */

:root {
    --fundo:        #14161c;
    --fundo-2:      #1b1e26;
    --fundo-3:      #232733;
    --borda:        #2e3342;
    --texto:        #e6e8ee;
    --texto-fraco:  #9aa2b4;
    --primaria:     #5865f2;
    --primaria-2:   #4752c4;
    --ok:           #3ba55d;
    --alerta:       #d9822b;
    --erro:         #e5484d;
    --raio:         12px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
}

body {
    background: var(--fundo);
    color: var(--texto);
    font: 15px/1.5 "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

a { color: #8b95ff; }

code {
    background: var(--fundo-3);
    border-radius: 6px;
    padding: 1px 6px;
    font-family: Consolas, "Courier New", monospace;
    font-size: .88em;
    word-break: break-all;
}

.oculto { display: none !important; }

/* ------------------------------------------------------------
 *  Botoes
 * --------------------------------------------------------- */
.botao {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border: 1px solid var(--borda);
    border-radius: var(--raio);
    background: var(--fundo-3);
    color: var(--texto);
    font-size: .95rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background .15s, border-color .15s, transform .05s;
}

.botao:hover  { background: #2b3040; }
.botao:active { transform: translateY(1px); }

.botao:disabled {
    opacity: .5;
    cursor: not-allowed;
}

.botao.primario {
    background: var(--primaria);
    border-color: var(--primaria);
}
.botao.primario:hover { background: var(--primaria-2); }

.botao.perigo {
    background: var(--erro);
    border-color: var(--erro);
}
.botao.perigo:hover { background: #c93b40; }

.botao.discord {
    background: var(--primaria);
    border-color: var(--primaria);
    width: 100%;
    justify-content: center;
    padding: 14px;
    font-size: 1rem;
}
.botao.discord:hover { background: var(--primaria-2); }

.botao.pequeno { padding: 6px 12px; font-size: .85rem; }

/* ------------------------------------------------------------
 *  Paginas simples (login / instalacao)
 * --------------------------------------------------------- */
.pagina-simples {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 16px;
    background: radial-gradient(1000px 500px at 50% -10%, #232a44 0%, var(--fundo) 62%);
}

.caixa {
    width: 100%;
    max-width: 560px;
    background: var(--fundo-2);
    border: 1px solid var(--borda);
    border-radius: 18px;
    padding: 34px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .45);
}

.caixa h1 { margin: 0 0 4px; font-size: 1.5rem; }

.caixa .sub {
    margin: 0 0 22px;
    color: var(--texto-fraco);
}

.entrada { text-align: center; }
.entrada .passos { text-align: left; }

.logo-discord {
    color: var(--primaria);
    margin-bottom: 14px;
}

.passos {
    margin: 26px 0 0;
    padding-left: 20px;
    color: var(--texto-fraco);
    font-size: .92rem;
}
.passos li { margin: 7px 0; }

.aviso {
    margin: 16px 0;
    padding: 12px 14px;
    border-radius: 10px;
    border-left: 4px solid var(--borda);
    background: var(--fundo-3);
    font-size: .92rem;
    text-align: left;
}
.aviso.erro    { border-left-color: var(--erro);   background: #2a1c20; }
.aviso.sucesso { border-left-color: var(--ok);     background: #182a20; }
.aviso.alerta  { border-left-color: var(--alerta); background: #2a2318; }

/* Checklist do instalador */
.checklist {
    list-style: none;
    margin: 0 0 22px;
    padding: 0;
}

.checklist li {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 10px 0;
    border-bottom: 1px solid var(--borda);
    font-size: .92rem;
}
.checklist li:last-child { border-bottom: 0; }

.checklist .marca {
    flex: 0 0 28px;
    height: 24px;
    display: grid;
    place-items: center;
    border-radius: 7px;
    font-size: .72rem;
    font-weight: 700;
}
.checklist .ok    .marca { background: rgba(59, 165, 93, .18); color: var(--ok); }
.checklist .falha .marca { background: rgba(229, 72, 77, .18); color: var(--erro); }

.checklist code {
    display: block;
    margin-top: 6px;
    color: var(--texto-fraco);
}

.rodape-inst {
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid var(--borda);
    font-size: .85rem;
    color: var(--texto-fraco);
}
.rodape-inst a { word-break: break-all; }
.dica { color: var(--texto-fraco); font-size: .85rem; }

/* ------------------------------------------------------------
 *  Sala
 * --------------------------------------------------------- */
.pagina-sala {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

.topo {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 16px;
    background: var(--fundo-2);
    border-bottom: 1px solid var(--borda);
}

.topo-esq, .topo-dir {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.marca-app { font-weight: 700; white-space: nowrap; }

.meu-nome {
    color: var(--texto-fraco);
    font-size: .9rem;
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.avatar-topo { border-radius: 50%; }

.chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 12px;
    border-radius: 999px;
    background: var(--fundo-3);
    border: 1px solid var(--borda);
    font-size: .84rem;
    white-space: nowrap;
}

.chip .ponto {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--texto-fraco);
}

.chip.espera .ponto { background: var(--alerta); }
.chip.voz    .ponto { background: var(--ok); }
.chip.voz           { border-color: rgba(59, 165, 93, .5); }
.chip.bot.on   .ponto { background: var(--ok); }
.chip.bot.meio .ponto { background: var(--alerta); }
.chip.bot.off  .ponto { background: var(--erro); }

.faixa {
    flex: 0 0 auto;
    padding: 9px 16px;
    font-size: .88rem;
    border-bottom: 1px solid var(--borda);
    background: #1d2436;
    color: #c9d2ea;
}
.faixa.alerta { background: #2a2318; color: #f0d5ae; }

.conteudo {
    flex: 1 1 auto;
    display: grid;
    grid-template-columns: 1fr 288px;
    min-height: 0;
}

/* Palco */
.palco {
    position: relative;
    min-width: 0;
    padding: 16px;
    overflow: auto;
}

.palco-vazio {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: var(--texto-fraco);
    text-align: center;
}
.palco-vazio h2 { margin: 0; font-size: 1.05rem; color: var(--texto); }
.palco-vazio p  { margin: 0; font-size: .9rem; }
.palco-vazio-icone { opacity: .35; }

.grade-telas {
    display: grid;
    gap: 12px;
    grid-template-columns: 1fr;
}
.grade-telas[data-quantidade="2"],
.grade-telas[data-quantidade="3"],
.grade-telas[data-quantidade="4"] {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.tela {
    position: relative;
    background: #000;
    border: 1px solid var(--borda);
    border-radius: var(--raio);
    overflow: hidden;
    aspect-ratio: 16 / 9;
}

.tela.minha { border-color: var(--primaria); }

.tela video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
    display: block;
}

.tela-barra {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: linear-gradient(transparent, rgba(0, 0, 0, .8));
    opacity: 0;
    transition: opacity .15s;
}
.tela:hover .tela-barra { opacity: 1; }

.tela-nome {
    flex: 1 1 auto;
    font-size: .85rem;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tela-botao {
    border: 1px solid rgba(255, 255, 255, .25);
    background: rgba(0, 0, 0, .45);
    color: #fff;
    border-radius: 8px;
    padding: 4px 10px;
    font-size: .78rem;
    cursor: pointer;
}
.tela-botao:hover { background: rgba(255, 255, 255, .18); }

/* Lateral */
.lateral {
    display: flex;
    flex-direction: column;
    min-height: 0;
    background: var(--fundo-2);
    border-left: 1px solid var(--borda);
}

.lateral-titulo {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 14px 16px;
    font-size: .78rem;
    letter-spacing: .09em;
    text-transform: uppercase;
    color: var(--texto-fraco);
    border-bottom: 1px solid var(--borda);
}

.contador {
    background: var(--fundo-3);
    border-radius: 999px;
    padding: 1px 9px;
    font-size: .8rem;
    letter-spacing: 0;
}

.lista-membros {
    flex: 1 1 auto;
    list-style: none;
    margin: 0;
    padding: 8px;
    overflow-y: auto;
}

.membro {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 8px;
    border-radius: 10px;
}
.membro:hover { background: var(--fundo-3); }

.membro img { border-radius: 50%; flex: 0 0 auto; }

.membro-nome {
    flex: 1 1 auto;
    font-size: .92rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.estado-conexao {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex: 0 0 auto;
    background: var(--texto-fraco);
}
.estado-conexao.on   { background: var(--ok); }
.estado-conexao.meio { background: var(--alerta); }
.estado-conexao.erro { background: var(--erro); }

.tag {
    flex: 0 0 auto;
    font-size: .68rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    padding: 2px 7px;
    border-radius: 6px;
    font-weight: 700;
}
.tag.voce { background: var(--fundo-3); color: var(--texto-fraco); }
.tag.tela { background: rgba(88, 101, 242, .22); color: #98a2ff; }

.lateral-rodape {
    flex: 0 0 auto;
    padding: 12px 16px;
    border-top: 1px solid var(--borda);
}

.explica {
    margin: 0;
    font-size: .82rem;
    color: var(--texto-fraco);
}

/* Barra inferior */
.barra {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    background: var(--fundo-2);
    border-top: 1px solid var(--borda);
}

.barra-dica {
    font-size: .85rem;
    color: var(--texto-fraco);
}

@media (max-width: 860px) {
    .conteudo { grid-template-columns: 1fr; grid-template-rows: 1fr auto; }
    .lateral  { border-left: 0; border-top: 1px solid var(--borda); max-height: 34vh; }
    .grade-telas[data-quantidade] { grid-template-columns: 1fr; }
    .meu-nome { display: none; }
}
