:root {
  --fundo: #0d0f1a;
  --fundo2: #151827;
  --fundo3: #1e2236;
  --linha: #242a42;
  --texto: #e8eaf6;
  --fraco: #8b92b8;
  --amarelo: #f5c451;
  --verde: #3ddc84;
  --vermelho: #ff5a5f;
  font-family: Inter, system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #05060b; color: var(--texto); }
body { display: flex; }
button { font: inherit; color: inherit; cursor: pointer; }
[hidden] { display: none !important; }

#palco { position: relative; flex: 1; min-width: 0; }
#mundo { position: absolute; inset: 0 0 64px 0; width: 100%; height: calc(100% - 64px); display: block; image-rendering: pixelated; }

.topo-esq { position: absolute; top: 14px; left: 14px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; pointer-events: none; }
.marca, .pilula, .resumo { background: rgba(13, 15, 26, .92); border-radius: 10px; padding: 8px 12px; font-size: 13px; font-weight: 600; box-shadow: 0 4px 14px rgba(0,0,0,.3); }
.marca { font-weight: 700; }
.resumo { display: flex; gap: 10px; }
.resumo:empty { display: none; }
.resumo span { display: flex; align-items: center; gap: 5px; }
.resumo i, .maq i, .ponto { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }

.maquinas { position: absolute; top: 14px; right: 14px; display: flex; gap: 6px; }
.maq { background: rgba(13, 15, 26, .92); border-radius: 10px; padding: 7px 10px; font-size: 12px; font-weight: 600; display: flex; gap: 6px; align-items: center; }
.maq.on i { background: var(--verde); box-shadow: 0 0 6px var(--verde); }
.maq.off i { background: var(--vermelho); }
.maq.\? i { background: var(--amarelo); }

.aviso { position: absolute; top: 64px; left: 50%; transform: translate(-50%, -10px); opacity: 0; transition: .35s; background: rgba(13, 15, 26, .95); padding: 10px 18px; border-radius: 12px; font-size: 15px; pointer-events: none; box-shadow: 0 6px 20px rgba(0,0,0,.35); }
.aviso.on { opacity: 1; transform: translate(-50%, 0); }

.barra { position: absolute; left: 0; right: 0; bottom: 0; height: 64px; background: var(--fundo); border-top: 1px solid var(--linha); display: flex; align-items: center; justify-content: space-between; padding: 0 14px; gap: 12px; }
.eu { display: flex; gap: 10px; align-items: center; font-size: 13px; }
.eu small { display: block; color: var(--fraco); font-size: 11px; }
.av-eu { width: 36px; height: 36px; border-radius: 50%; background: var(--fundo3); display: grid; place-items: center; font-size: 20px; position: relative; }
.av-eu::after { content: ''; position: absolute; right: 0; bottom: 0; width: 10px; height: 10px; border-radius: 50%; background: var(--verde); border: 2px solid var(--fundo); }
.botoes { display: flex; gap: 8px; }
.botoes button, .painel-bt { background: var(--fundo3); border: 0; border-radius: 10px; height: 38px; min-width: 38px; padding: 0 12px; font-size: 16px; }
.botoes button:hover, .painel-bt:hover { background: #2a3050; }
.dir { display: flex; gap: 10px; align-items: center; }
.painel-bt { font-size: 14px; font-weight: 600; }
.conexao { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--fraco); }
.conexao i { width: 8px; height: 8px; border-radius: 50%; background: var(--amarelo); }
.conexao.on i { background: var(--verde); box-shadow: 0 0 6px var(--verde); }
.conexao.off i { background: var(--vermelho); }

.painel { width: 330px; flex: none; background: var(--fundo); border-left: 1px solid var(--linha); display: flex; flex-direction: column; }
body.sem-painel .painel { display: none; }
.abas { display: flex; padding: 10px 10px 0; gap: 4px; }
.aba { flex: 1; background: none; border: 0; padding: 10px; border-radius: 8px 8px 0 0; color: var(--fraco); font-weight: 600; font-size: 13px; border-bottom: 2px solid transparent; }
.aba.on { color: var(--texto); border-bottom-color: var(--amarelo); }
.busca { padding: 10px 12px 4px; }
.busca input, .porta input { width: 100%; background: var(--fundo2); border: 1px solid var(--linha); color: var(--texto); border-radius: 8px; padding: 9px 11px; font: inherit; font-size: 13px; outline: none; }
.busca input:focus, .porta input:focus { border-color: var(--amarelo); }
.busca small, .porta small { display: block; color: var(--fraco); font-size: 11px; margin-top: 5px; }
.lista, .feed { flex: 1; overflow-y: auto; padding: 6px 8px 16px; }
.grupo-tit { display: flex; align-items: center; gap: 7px; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--fraco); padding: 12px 8px 6px; font-weight: 700; }
.grupo-tit b { color: var(--texto); }
.pessoa { width: 100%; display: flex; align-items: center; gap: 10px; background: none; border: 0; padding: 7px 8px; border-radius: 10px; text-align: left; }
.pessoa:hover, .pessoa.ativa { background: var(--fundo2); }
.pessoa.ativa { outline: 1px solid var(--amarelo); }
.av { width: 34px; height: 34px; border-radius: 50%; background: var(--fundo3) center/cover no-repeat; image-rendering: pixelated; position: relative; flex: none; }
.av i { position: absolute; right: -1px; bottom: -1px; width: 11px; height: 11px; border-radius: 50%; border: 2px solid var(--fundo); }
.av.g { width: 48px; height: 48px; }
.txt { flex: 1; min-width: 0; }
.nm { font-weight: 600; font-size: 13px; display: block; }
.sub { display: block; font-size: 11px; color: var(--fraco); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.host { font-size: 10px; color: var(--fraco); background: var(--fundo2); border-radius: 6px; padding: 2px 6px; }
.vazio { color: var(--fraco); font-size: 12px; padding: 12px; }

.ev { display: flex; gap: 9px; padding: 9px 8px; border-bottom: 1px solid rgba(59,66,112,.5); font-size: 12.5px; }
.ev .ponto { margin-top: 5px; }
.ev em { font-style: normal; font-weight: 600; }
.evmsg { color: var(--fraco); margin-top: 3px; word-break: break-word; }
.evh { color: var(--fraco); font-size: 11px; margin-top: 3px; }

.cartao { position: absolute; left: 14px; bottom: 78px; width: 400px; max-height: calc(100% - 150px); overflow-y: auto; background: rgba(13, 15, 26, .97); border: 1px solid var(--linha); border-radius: 14px; padding: 16px; box-shadow: 0 10px 30px rgba(0,0,0,.45); font-size: 13px; }
.cartao .fechar { position: absolute; top: 10px; right: 10px; background: var(--fundo3); border: 0; border-radius: 8px; width: 28px; height: 28px; }
.cartao .topo { display: flex; gap: 12px; align-items: center; padding-right: 30px; }
.cartao .nm { font-size: 15px; }
.cartao .est { font-weight: 600; margin-top: 3px; }
.cartao .est small { color: var(--fraco); font-weight: 400; }
.cartao .faz { color: var(--fraco); margin: 12px 0 8px; line-height: 1.45; }
.cartao .msg { background: var(--fundo2); border-radius: 8px; padding: 8px 10px; margin: 8px 0; line-height: 1.4; word-break: break-word; }
.cartao .msg.ruim { background: rgba(255, 90, 95, .14); color: #ffb3b5; }
.campos { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 10px 0; }
.campo { background: var(--fundo2); border-radius: 8px; padding: 6px 9px; }
.campo span { display: block; font-size: 10px; color: var(--fraco); text-transform: uppercase; letter-spacing: .05em; }
.campo b { font-weight: 600; font-size: 12px; word-break: break-word; }
.cartao .ir { margin-top: 2px; width: 100%; background: var(--fundo3); color: var(--texto); border: 0; border-radius: 10px; padding: 10px; font-weight: 700; }

.porta { position: fixed; inset: 0; background: rgba(3, 4, 9, .8); display: grid; place-items: center; z-index: 10; }
.porta form { background: var(--fundo); border: 1px solid var(--linha); border-radius: 16px; padding: 28px; width: 340px; display: flex; flex-direction: column; gap: 8px; }
.porta h1 { font-size: 18px; margin: 0 0 10px; }
.porta label { font-size: 12px; color: var(--fraco); font-weight: 600; }
.porta button { margin-top: 10px; background: var(--amarelo); color: #202540; border: 0; border-radius: 10px; padding: 11px; font-weight: 700; }
.erro { color: var(--vermelho); font-size: 12px; margin: 4px 0 0; }

@media (max-width: 800px) {
  .painel { position: fixed; right: 0; top: 0; bottom: 64px; z-index: 5; width: 86vw; }
  .cartao { width: calc(100% - 28px); }
  .eu small { display: none; }
}
.grupo-tit .mini { margin-left: auto; display: flex; gap: 3px; }
.grupo-tit .mini i { width: 6px; height: 6px; border-radius: 50%; display: block; }
.chat { border-top: 1px solid var(--linha); margin-top: 14px; padding-top: 12px; }
.chat-tit { display: flex; justify-content: space-between; align-items: center; font-weight: 700; margin-bottom: 8px; }
.chat-tit .nova { background: none; border: 1px solid var(--linha); color: var(--fraco); border-radius: 8px; padding: 4px 8px; font-size: 11px; }
.msgs { display: flex; flex-direction: column; gap: 6px; max-height: 300px; min-height: 60px; overflow-y: auto; padding: 2px; }
.bal { max-width: 85%; padding: 8px 10px; border-radius: 12px; line-height: 1.45; word-break: break-word; }
.bal small { display: block; font-size: 10px; color: var(--fraco); margin-top: 3px; text-align: right; }
.bal.voce { align-self: flex-end; background: #2b3570; border-bottom-right-radius: 4px; }
.bal.agente { align-self: flex-start; background: var(--fundo2); border-bottom-left-radius: 4px; }
.bal.ruim { background: rgba(255, 90, 95, .14); color: #ffb3b5; }
.bal code { background: #05060b; border-radius: 4px; padding: 0 4px; font-size: 12px; }
.bal.pensando { color: var(--fraco); display: flex; align-items: center; gap: 8px; }
.pontinhos { display: inline-flex; gap: 3px; }
.pontinhos i { width: 5px; height: 5px; border-radius: 50%; background: var(--fraco); animation: pulo 1s infinite; }
.pontinhos i:nth-child(2) { animation-delay: .15s; } .pontinhos i:nth-child(3) { animation-delay: .3s; }
@keyframes pulo { 0%, 60%, 100% { transform: none; opacity: .5; } 30% { transform: translateY(-3px); opacity: 1; } }
.aviso-chat { color: var(--fraco); font-size: 12px; line-height: 1.45; margin: 4px 0; }
.chat-form { display: flex; gap: 6px; margin-top: 8px; align-items: flex-end; }
.chat-form textarea { flex: 1; resize: none; background: var(--fundo2); border: 1px solid var(--linha); color: var(--texto); border-radius: 8px; padding: 8px 10px; font: inherit; font-size: 13px; outline: none; }
.chat-form textarea:focus { border-color: var(--amarelo); }
.chat-form button { background: var(--amarelo); color: #202540; border: 0; border-radius: 8px; padding: 9px 12px; font-weight: 700; }
.chat-form.travado button { opacity: .45; }
.chat .dica { display: block; color: var(--fraco); font-size: 11px; margin-top: 5px; }

/* ---- casas, botões do topo ---- */
.topo-esq { pointer-events: auto; }
.casas, .topo-bts { display: flex; gap: 6px; flex-wrap: wrap; }
.casa, .topo-bts button { background: rgba(13, 15, 26, .92); border: 1px solid var(--linha); border-radius: 10px; padding: 8px 12px; font-size: 13px; font-weight: 700; box-shadow: 0 4px 14px rgba(0,0,0,.4); }
.casa:hover, .topo-bts button:hover { border-color: #3a4166; }
.casa.on { background: var(--amarelo); color: #12141f; border-color: var(--amarelo); }
.casa.mais, .topo-bts button { color: var(--fraco); font-weight: 600; }
.casa .alerta { font-style: normal; background: var(--vermelho); color: #fff; border-radius: 9px; padding: 0 6px; margin-left: 4px; font-size: 11px; }
.maq { border: 1px solid var(--linha); }
.maq i { background: var(--c); }
.maq.on i { background: var(--c); box-shadow: 0 0 8px var(--c); }
.maq.off { opacity: .45; }
.maq.off i, .maq.talvez i { background: var(--c); opacity: .5; box-shadow: none; }
.maq small { color: var(--fraco); font-weight: 400; }
.host { color: var(--c, var(--fraco)); border: 1px solid color-mix(in srgb, var(--c, #888) 45%, transparent); background: color-mix(in srgb, var(--c, #888) 12%, transparent); font-weight: 700; }
.av-eu { background: var(--fundo3) center/cover no-repeat; image-rendering: pixelated; }
.casa-tit { font-size: 12px; font-weight: 800; color: var(--amarelo); padding: 14px 8px 2px; }
.pessoa.inativo { opacity: .5; }
.av.orca { display: grid; place-items: center; font-size: 18px; }
.busca { flex: none; }
#orca { padding-top: 0; }

/* ---- aba Salas ---- */
.sala-it { background: var(--fundo2); border: 1px solid var(--linha); border-radius: 10px; padding: 10px; margin: 6px 0; }
.sala-nm { display: flex; gap: 8px; align-items: center; font-size: 13px; }
.sala-nm small { margin-left: auto; color: var(--fraco); }
.sala-ctl { display: flex; gap: 6px; align-items: center; margin-top: 8px; }
.sala-ctl .cadeiras { font-size: 12px; color: var(--fraco); margin-right: auto; }
.sala-ctl button, .bt-largo, .ed-bts button { background: var(--fundo3); border: 1px solid var(--linha); border-radius: 8px; padding: 6px 10px; font-size: 12px; font-weight: 600; }
.sala-ctl button:hover, .bt-largo:hover, .ed-bts button:hover { border-color: #3a4166; }
.bt-largo { width: 100%; margin-top: 10px; padding: 10px; background: var(--amarelo); color: #12141f; border: 0; font-weight: 700; }
.bt-largo.fraco { background: var(--fundo3); color: var(--texto); border: 1px solid var(--linha); margin-top: 6px; }

/* ---- edição do minion e janelinha ---- */
.edicao { margin-top: 12px; border: 1px solid var(--linha); border-radius: 10px; padding: 8px 10px; background: var(--fundo2); }
.edicao summary { cursor: pointer; font-weight: 700; }
.ed, .janela { display: flex; flex-direction: column; gap: 4px; }
.ed { margin-top: 8px; }
.ed label, .janela label { font-size: 12px; color: var(--fraco); font-weight: 600; margin-top: 6px; }
.ed input, .ed textarea, .ed select, .janela input, .janela textarea, .janela select { width: 100%; background: var(--fundo); border: 1px solid var(--linha); color: var(--texto); border-radius: 8px; padding: 8px 10px; font: inherit; font-size: 13px; outline: none; resize: vertical; }
.ed input:focus, .ed textarea:focus, .ed select:focus, .janela input:focus, .janela textarea:focus, .janela select:focus { border-color: var(--amarelo); }
.ed small, .janela small { color: var(--fraco); font-size: 11px; line-height: 1.4; }
.ed-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ed-bts { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0 4px; }
.ed-bts .salvar, .janela .ed-bts button[type=submit] { background: var(--amarelo); color: #12141f; border: 0; font-weight: 700; }
.ed-bts .apagar, .perigo { background: rgba(255, 90, 95, .14) !important; color: #ffb3b5; border: 1px solid rgba(255, 90, 95, .35) !important; border-radius: 8px; padding: 6px 10px; font-size: 12px; margin-top: 10px; }
.janela { background: var(--fundo); border: 1px solid var(--linha); border-radius: 16px; padding: 24px; width: 380px; max-height: 90vh; overflow-y: auto; }
.janela h2 { margin: 0 0 6px; font-size: 17px; }
.aba { padding: 10px 4px; font-size: 12.5px; white-space: nowrap; }
