:root { color-scheme: light dark; --fundo: #f6f6f4; --texto: #1c1c1a; --cartao: #ffffff; --borda: #c9c9c4; --acento: #2f5d50; }
@media (prefers-color-scheme: dark) {
  :root { --fundo: #151514; --texto: #ecece8; --cartao: #1f1f1d; --borda: #3a3a37; --acento: #7fb5a3; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--fundo); color: var(--texto); font: 16px/1.5 system-ui, sans-serif; }
body.entrar { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.cartao { width: 100%; max-width: 360px; background: var(--cartao); border: 1px solid var(--borda); border-radius: 12px; padding: 24px; }
h1 { margin: 0 0 16px; font-size: 1.5rem; }
label { display: block; margin: 12px 0 4px; font-size: .9rem; }
input { width: 100%; padding: 10px; font-size: 1rem; border: 1px solid var(--borda); border-radius: 8px; background: var(--fundo); color: var(--texto); }
body.entrar button { margin-top: 20px; width: 100%; padding: 12px; font-size: 1rem; border: 0; border-radius: 8px; background: var(--acento); color: var(--fundo); cursor: pointer; }

/* ===== Central: painel holográfico (escuro, ciano). Escopo: body.central ===== */
body.central {
  --fundo: #03080f; --painel: rgba(8, 26, 40, .78); --borda: #1f5a7a; --brilho: rgba(54, 198, 240, .22);
  --ciano: #36c6f0; --claro: #bff3ff; --medio: #5fd4f7; --apagado: #6f9bb3;
  --ok: #4be3a0; --aviso: #f5c04a; --mudo: #7a8a99;
  --mono: ui-monospace, "SF Mono", Menlo, monospace;
  min-height: 100vh; display: flex; flex-direction: column; gap: 12px; padding: 14px 16px;
  background: radial-gradient(ellipse at 50% 38%, #0a2236 0%, #050d17 45%, var(--fundo) 100%) fixed;
  color: #cfefff; font: 13px/1.45 -apple-system, BlinkMacSystemFont, system-ui, "Segoe UI", sans-serif;
}
body.central::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; opacity: .5;
  background-image: linear-gradient(rgba(54, 198, 240, .035) 1px, transparent 1px), linear-gradient(90deg, rgba(54, 198, 240, .035) 1px, transparent 1px);
  background-size: 44px 44px;
}
body.central > * { position: relative; }
body.central button { margin: 0; width: auto; font: inherit; }

.topo { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; }
.topo-esq { display: flex; align-items: center; gap: 16px; justify-self: start; }
.marca { font-size: 20px; letter-spacing: .5em; color: var(--claro); text-shadow: 0 0 14px rgba(54, 198, 240, .7); }
.selo { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--borda); border-radius: 999px; padding: 3px 14px; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; box-shadow: 0 0 12px var(--brilho) inset; justify-self: start; }
.selo .ponto { width: 8px; height: 8px; border-radius: 50%; background: currentColor; box-shadow: 0 0 8px currentColor; animation: pulsa 2.4s ease-in-out infinite; }
.selo.ok { color: var(--ok); } .selo.aviso { color: var(--aviso); } .selo.mudo { color: var(--mudo); }
.relogio { text-align: center; }
.relogio .data { color: var(--apagado); font-size: 12px; text-transform: capitalize; }
.relogio .hora { font-size: 26px; color: #7fe0ff; letter-spacing: .12em; font-variant-numeric: tabular-nums; text-shadow: 0 0 12px rgba(54, 198, 240, .6); }
.botao-topo { justify-self: end; border: 1px solid var(--borda); background: rgba(10, 30, 46, .85); color: var(--medio); border-radius: 999px; padding: 6px 16px; letter-spacing: .06em; }
.botao-topo:disabled, .botao-voz:disabled { opacity: .55; cursor: not-allowed; }

.grade { display: grid; grid-template-columns: 250px minmax(0, 1fr) 290px; gap: 12px; flex: 1; min-height: 0; }
.coluna { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.painel {
  border: 1px solid var(--borda); background: var(--painel); border-radius: 10px; padding: 12px 14px;
  box-shadow: 0 0 18px rgba(54, 198, 240, .10) inset, 0 0 14px rgba(54, 198, 240, .08);
  backdrop-filter: blur(4px); position: relative;
}
.painel::before, .painel::after { content: ""; position: absolute; width: 12px; height: 12px; border: 2px solid var(--ciano); opacity: .7; pointer-events: none; }
.painel::before { top: -1px; left: -1px; border-right: 0; border-bottom: 0; border-top-left-radius: 10px; }
.painel::after { bottom: -1px; right: -1px; border-left: 0; border-top: 0; border-bottom-right-radius: 10px; }
.painel h2 { margin: 0 0 8px; font-size: 10.5px; font-weight: 500; letter-spacing: .18em; text-transform: uppercase; color: var(--medio); }

.linhas { display: flex; flex-direction: column; }
.linha { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 4px 0; border-bottom: 1px solid rgba(31, 90, 122, .35); }
.linha:last-child { border-bottom: 0; }
.linha-dir { white-space: nowrap; font-size: 12px; }
.linha-dir.ok, .ok { color: var(--ok); } .linha-dir.aviso, .aviso { color: var(--aviso); } .linha-dir.mudo, .mudo { color: var(--mudo); }
.peca { border-bottom: 1px solid rgba(31, 90, 122, .35); padding-bottom: 4px; }
.peca:last-child { border-bottom: 0; }
.peca .linha { border-bottom: 0; padding-bottom: 0; }
.frase { color: var(--apagado); font-size: 11px; font-style: italic; margin-top: 1px; }
.mudo { color: var(--mudo); font-size: 11px; }
.ficha { border: 1px solid var(--borda); border-radius: 999px; padding: 0 8px; font-size: 10px; color: var(--medio); white-space: nowrap; }
.linha.feed .linha-esq { flex: 1; min-width: 0; }
.quando { color: var(--mudo); font-size: 10px; font-family: var(--mono); }
.linha.proxima .linha-esq { color: var(--claro); }

.linha-barra { padding: 4px 0; border-bottom: 1px solid rgba(31, 90, 122, .35); }
.linha-barra:last-child { border-bottom: 0; }
.linha-barra .linha { border: 0; padding: 0 0 3px; }
.barra { height: 4px; border-radius: 2px; background: rgba(31, 90, 122, .4); overflow: hidden; }
.barra-valor { height: 100%; width: calc(var(--v, 0) * 100%); background: linear-gradient(90deg, #1b8fb3, var(--ciano)); box-shadow: 0 0 8px var(--ciano); transition: width .6s ease; }

.painel-voz { text-align: center; }
.painel-voz h2 { text-align: left; }
.botao-voz { width: 58px !important; height: 58px; border-radius: 50%; border: 2px solid var(--ciano); background: rgba(10, 30, 46, .9); box-shadow: 0 0 18px rgba(54, 198, 240, .45); display: grid; place-items: center; margin: 6px auto 4px; }
.mic { width: 12px; height: 20px; border: 2px solid var(--claro); border-radius: 7px; position: relative; display: block; }
.mic::after { content: ""; position: absolute; left: 50%; bottom: -9px; width: 18px; height: 8px; margin-left: -9px; border: 2px solid var(--claro); border-top: 0; border-radius: 0 0 10px 10px; }

/* Centro: o palco do núcleo; #ao-vivo é o espaço que a T9 usa para o modo ao vivo. */
.palco { flex: 0 0 auto; height: clamp(300px, 46vh, 480px); padding: 0; overflow: hidden; background: radial-gradient(ellipse at center, #0d2a40 0%, rgba(5, 11, 20, .9) 72%); }
.palco canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.palco-legenda { position: absolute; left: 0; right: 0; bottom: 14px; text-align: center; pointer-events: none; }
.palco-nome { font-size: 22px; letter-spacing: .6em; padding-left: .6em; color: var(--claro); text-shadow: 0 0 16px rgba(54, 198, 240, .8); }
.palco-total { color: var(--medio); font-size: 10.5px; letter-spacing: .25em; text-transform: uppercase; margin-top: 2px; }
.palco-ao-vivo { position: absolute; left: 14px; right: 14px; top: 12px; pointer-events: none; }
.palco.sem-3d { background: radial-gradient(circle at center, #12405c 0%, rgba(5, 11, 20, .9) 60%); }
.par { display: grid; grid-template-columns: 1.25fr 1fr; gap: 12px; }

.mapa { position: relative; height: 190px; }
.mapa-campo { position: absolute; inset: 0; }
.mapa-vazio { color: var(--mudo); padding: 20px 0; }
.ponto-ideia {
  position: absolute; left: calc(var(--x, .5) * 100%); top: calc(var(--y, .5) * 100%);
  width: 7px; height: 7px; margin: -3.5px 0 0 -3.5px; padding: 0; border: 0; border-radius: 50%;
  background: var(--cor, var(--ciano)); box-shadow: 0 0 6px var(--cor, var(--ciano)); cursor: pointer;
  transition: transform .15s ease;
}
.ponto-ideia:hover, .ponto-ideia:focus-visible, .ponto-ideia.ativo { transform: scale(2); outline: 0; box-shadow: 0 0 12px var(--cor, var(--ciano)); }
.mapa-rotulo { position: absolute; left: calc(var(--x, .5) * 100%); top: calc(var(--y, .5) * 100%); transform: translateX(-50%); font-size: 9.5px; color: var(--apagado); letter-spacing: .1em; text-transform: uppercase; pointer-events: none; }
.fam-0 { --cor: #36c6f0; } .fam-1 { --cor: #4be3a0; } .fam-2 { --cor: #f5c04a; }
.fam-3 { --cor: #c58bff; } .fam-4 { --cor: #ff7a90; } .fam-5 { --cor: #7fa6ff; }
.mapa-legenda { position: absolute; left: 0; right: 0; bottom: 0; display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 10px; color: var(--apagado); }
.legenda-item { display: inline-flex; align-items: center; gap: 5px; }
.legenda-ponto { width: 7px; height: 7px; border-radius: 50%; background: var(--cor); box-shadow: 0 0 5px var(--cor); }
.mapa-cartao { position: absolute; right: 0; top: 0; width: min(260px, 100%); background: rgba(3, 12, 20, .96); border: 1px solid var(--ciano); border-radius: 8px; padding: 10px 12px; box-shadow: 0 0 18px var(--brilho); z-index: 2; }
.mapa-cartao[hidden] { display: none; }
.cartao-titulo { color: var(--claro); margin-bottom: 4px; padding-right: 16px; }
.cartao-linha { font-size: 11px; color: var(--apagado); }
.cartao-fechar { position: absolute; top: 4px; right: 6px; background: none; border: 0; color: var(--medio); font-size: 16px; cursor: pointer; }

.diario { display: flex; flex-direction: column; gap: 4px; }
.diario-item { color: #cfefff; }

.rodape { display: flex; justify-content: center; }
.fale { width: min(720px, 100%); border: 1px solid var(--borda); border-radius: 999px; padding: 9px 22px; display: flex; justify-content: center; gap: 14px; color: #7fe0ff; box-shadow: 0 0 16px var(--brilho) inset, 0 0 14px rgba(54, 198, 240, .1); }
.fale-rotulo { letter-spacing: .25em; }
.fale-estado { color: var(--mudo); }

body.offline .painel { border-color: #6b4a1a; }
@keyframes pulsa { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .selo .ponto { animation: none; } .barra-valor, .ponto-ideia { transition: none; } }
@media (max-width: 1000px) {
  .grade { grid-template-columns: 1fr; }
  .topo { grid-template-columns: 1fr auto; }
  .relogio { display: none; }
  .par { grid-template-columns: 1fr; }
  .palco { height: clamp(240px, 40vh, 360px); }
}
