/* Estilo do protótipo de apuração ETO. */

/* Fontes locais (Archivo e Archivo Black, SIL OFL 1.1; licenças em fontes/). Só o subconjunto latino, que cobre o português. */
@font-face { font-family: "Archivo"; font-style: normal; font-weight: 400; font-display: swap; src: url(../fontes/archivo-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Archivo"; font-style: normal; font-weight: 600; font-display: swap; src: url(../fontes/archivo-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "Archivo"; font-style: normal; font-weight: 800; font-display: swap; src: url(../fontes/archivo-latin-800-normal.woff2) format("woff2"); }
@font-face { font-family: "Archivo Black"; font-style: normal; font-weight: 400; font-display: swap; src: url(../fontes/archivo-black-latin-400-normal.woff2) format("woff2"); }
:root {
  --fundo: #0f1217;
  --fundo-2: #171b22;
  --linha: #2a303a;
  --texto: #eef0f3;
  --texto-2: #a7afbb;
  --papel: #f3efe6;
  --empate: #b9b2a3;
  --alerta: #f2b705;
  --cor-a: #3a414c;
  --cor-b: #3a414c;
  --raio: 10px;
  --titulo: "Archivo Black", "Arial Black", system-ui, sans-serif;
  --corpo: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: radial-gradient(120% 80% at 50% 10%, #1b2029 0%, var(--fundo) 60%) fixed, var(--fundo);
  color: var(--texto);
  font: 15px/1.45 var(--corpo);
  min-height: 100vh;
  overflow-x: hidden;
}
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* Faixa permanente de origem dos dados */
.faixa {
  position: sticky; top: 0; z-index: 30;
  padding: 7px 16px; text-align: center;
  font-weight: 800; font-size: 13px; letter-spacing: .01em; color: #111;
  border-bottom: 2px solid #111;
}
.faixa.demo { background: repeating-linear-gradient(-45deg, #f2b705 0 18px, #ffd34d 18px 36px); }
.faixa.tse { background: #ffd34d; }
.faixa.oficial { background: #1e2a20; color: #b9f5c8; border-color: #2b4a33; }

.topo { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 20px 4px; max-width: 1240px; margin: 0 auto; }
.marca { font-family: var(--titulo); font-size: 18px; }
.marca b { background: var(--texto); color: var(--fundo); padding: 0 6px; border-radius: 4px; margin-right: 4px; }
.marca .sub { font-family: var(--corpo); font-weight: 600; color: var(--texto-2); font-size: 14px; margin-left: 6px; }
.btn { border: 1px solid var(--linha); background: var(--fundo-2); padding: 7px 12px; border-radius: 8px; cursor: pointer; }
.btn:hover { border-color: #46505e; }

/* Placar */
.placar { display: grid; grid-template-columns: 1fr minmax(240px, 1.15fr) 1fr; gap: 14px; padding: 10px 20px 6px; max-width: 1240px; margin: 0 auto; }
.canto { background: var(--fundo-2); border: 1px solid var(--linha); border-radius: var(--raio); padding: 12px 16px; position: relative; overflow: hidden; min-height: 112px; min-width: 0; }
.canto::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 6px; background: var(--cor); }
.canto-b { text-align: right; }
.canto-b::before { inset: 0 0 0 auto; }
.canto .nome { font-family: var(--titulo); font-size: 18px; line-height: 1.15; overflow-wrap: anywhere; }
.canto .partido, .canto .votos, .canto .ufs { color: var(--texto-2); font-size: 13px; font-variant-numeric: tabular-nums; }
.canto .pct { font-family: var(--titulo); font-size: 40px; line-height: 1; margin-top: 6px; color: var(--cor); font-variant-numeric: tabular-nums; }
.canto .pct small { font-size: 20px; }
.canto.eleito { box-shadow: 0 0 0 2px var(--cor) inset; }
.canto .selo { display: inline-block; margin-top: 6px; padding: 2px 9px; border-radius: 99px; background: var(--cor); color: #fff; font-weight: 800; font-size: 12px; }
.canto.vazio .nome { color: var(--texto-2); }

.centro { display: flex; flex-direction: column; justify-content: center; gap: 7px; text-align: center; min-width: 0; }
.situacao { font-weight: 800; font-size: 16px; }
.situacao .tag { display: table; margin: 0 auto 4px; font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 99px; background: #2a303a; color: var(--texto-2); text-transform: uppercase; letter-spacing: .04em; }
.situacao.eleito .tag { background: #1f6d3a; color: #d8ffe5; }
.barra-secoes { height: 8px; background: #262c35; border-radius: 99px; overflow: hidden; }
.barra-secoes i { display: block; height: 100%; width: 0; background: var(--texto); transition: width .8s ease; }
.secoes-txt { font-size: 13px; color: var(--texto-2); font-variant-numeric: tabular-nums; }
.disputa { position: relative; height: 10px; display: flex; border-radius: 99px; overflow: hidden; background: #262c35; }
.disputa i { display: block; height: 100%; transition: width .8s ease; }
.disputa i:first-child { background: var(--cor-a); }
.disputa i:nth-child(2) { background: var(--cor-b); margin-left: auto; }
.disputa .meio { position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; background: var(--texto); opacity: .75; }

/* Mapa */
.arena { max-width: 1240px; margin: 0 auto; padding: 4px 20px 0; }
.mapa-barra { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 6px 0 2px; flex-wrap: wrap; }
.visao { display: inline-flex; background: var(--fundo-2); border: 1px solid var(--linha); border-radius: 99px; padding: 3px; }
.visao button { border: 0; background: none; padding: 6px 14px; border-radius: 99px; cursor: pointer; font-weight: 600; font-size: 14px; color: var(--texto-2); }
.visao button[aria-pressed="true"] { background: var(--texto); color: var(--fundo); }
.mapa-dica { color: var(--texto-2); font-size: 13px; }
.mapa-caixa { position: relative; }
.mapa { display: block; width: 100%; height: min(66vh, 680px); }
.mapa .uf { fill: var(--papel); stroke: var(--fundo); stroke-width: 1; stroke-linejoin: round; transition: fill 1.2s ease, stroke 1.2s ease; cursor: pointer; outline: none; }
.mapa .uf:hover, .mapa .uf:focus-visible { stroke: #fff !important; stroke-width: 2; }
.mapa .uf.ativa { stroke: #fff !important; stroke-width: 2.5; }
.mapa .uf.sem-dados { fill: url(#hachura); }
.mapa .uf.virou { animation: virou 1.1s ease; }
@keyframes virou { 0% { stroke: #fff; stroke-width: 5; } 100% { stroke-width: 1; } }
.mapa .sigla { font: 700 11px var(--corpo); fill: #1a1d22; pointer-events: none; text-anchor: middle; dominant-baseline: middle; opacity: .8; }
.mapa .sigla.mini { font-size: 8px; }
.mapa .sigla.clara { fill: #fff; }
.mapa .rotulo-regiao { font: 800 17px var(--titulo); fill: #1a1d22; pointer-events: none; text-anchor: middle; dominant-baseline: middle; paint-order: stroke; stroke: #f3efe6aa; stroke-width: 3px; }
.mapa .rotulo-regiao.clara { fill: #fff; stroke: #0005; }
.mapa .rotulo-regiao.sobre-hachura { fill: #fff; stroke: #000a; }

.ficha {
  position: absolute; top: 8px; right: 0; z-index: 5; width: 280px; max-width: 100%;
  background: #0b0e12f2; border: 1px solid var(--linha); border-radius: var(--raio);
  padding: 12px 14px; font-size: 13px; box-shadow: 0 10px 30px #0008;
}
.ficha h3 { margin: 0 24px 4px 0; font-family: var(--titulo); font-size: 16px; }
.ficha .situ { margin: 0 0 8px; color: var(--texto-2); font-weight: 600; }
.ficha .linha { display: flex; justify-content: space-between; gap: 10px; font-variant-numeric: tabular-nums; }
.ficha .linha.lider b { color: #fff; }
.ficha .linha.votos { color: var(--texto-2); font-size: 12px; margin-bottom: 4px; }
.ficha .ponto { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; background: var(--cor); }
.ficha .meta { color: var(--texto-2); margin: 6px 0 0; font-size: 12px; }
.ficha .pequena { font-style: italic; }
.ficha .fechar { position: absolute; top: 4px; right: 6px; background: none; border: 0; color: var(--texto-2); font-size: 22px; line-height: 1; cursor: pointer; padding: 4px 6px; }

/* Área da animação (o módulo do Codex substitui o espaço reservado) */
.luta { position: relative; min-height: 140px; margin-top: 8px; border-radius: var(--raio); }
.luta-placeholder[hidden] { display: none !important; }
.luta-placeholder {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; text-align: center;
  min-height: 140px; border: 1px dashed #3a414c; border-radius: var(--raio); color: var(--texto-2); font-size: 13px; padding: 12px;
}
.luta-placeholder b { color: var(--texto); font-size: 14px; }
.luta[data-pausado="1"] .luta-placeholder { border-color: var(--alerta); }

/* Rodapé */
.rodape { max-width: 1240px; margin: 22px auto 0; padding: 0 20px 40px; color: var(--texto-2); font-size: 13px; }
.rodape a { color: var(--texto); }
.legenda { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-bottom: 10px; }
.legenda span { display: inline-flex; align-items: center; gap: 6px; }
.legenda i { width: 14px; height: 14px; border-radius: 3px; display: inline-block; border: 1px solid #0006; }
.legenda i.hachura { background: repeating-linear-gradient(45deg, #6a717c 0 3px, #4c525c 3px 6px); }
.legenda .dica { font-style: italic; }
.fonte-txt { color: var(--texto); font-weight: 600; }
.avisos { color: var(--alerta); font-weight: 700; }
.avisos:empty { display: none; }
.nota { max-width: 780px; }
.creditos { opacity: .8; }

@media (max-width: 860px) {
  .placar { grid-template-columns: 1fr 1fr; padding: 8px 16px 4px; gap: 10px; }
  .centro { grid-column: 1 / -1; grid-row: 2; }
  .canto { min-height: 0; padding: 10px 12px; }
  .canto .pct { font-size: 30px; }
  .canto .nome { font-size: 15px; }
  .topo { padding: 10px 16px 2px; }
  .marca .sub { display: block; margin: 2px 0 0; }
  .arena { padding: 4px 16px 0; }
  .mapa { height: auto; aspect-ratio: 613 / 639; max-height: 64vh; margin: 0 auto; }
  .mapa-dica { display: none; }
  .ficha { position: fixed; top: auto; bottom: 12px; left: 12px; right: 12px; width: auto; z-index: 35; }
  .rodape { padding: 0 16px 32px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
