/* Modo TV: tipografia grande, sem rolagem, legível a distância. */
body.tv { overflow: hidden; height: 100vh; font-size: clamp(14px, 1.15vw, 26px); cursor: default; }
body.tv.ocioso { cursor: none; }
.tv-palco { height: 100vh; display: grid; grid-template-rows: auto 1fr auto; padding: 2.2vh 2.5vw 1.6vh; gap: 2vh; }

.tv-topo { display: flex; justify-content: space-between; align-items: flex-end; gap: 2vw; }
.tv-sobretitulo { color: var(--text-2); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; font-size: .95em; }
.tv-topo h1 { margin: .1em 0 0; font-size: 3.1em; line-height: 1; letter-spacing: -.02em; }
.tv-relogio { text-align: right; }
#tv-hora { font-size: 2.2em; font-weight: 800; letter-spacing: -.02em; }
.tv-fonte { color: var(--text-2); font-size: .9em; }

.tv-corpo { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 2.5vw; min-height: 0; }
.tv-mapa { border-radius: 16px; background: var(--surface); border: 1px solid var(--border); min-height: 0; }
.tv-mapa .leaflet-control-container .leaflet-control-zoom { display: none; }
.tv-lado { display: flex; flex-direction: column; gap: 1.6vh; min-height: 0; }
.tv-lado .faixa { font-size: .95em; }
.tv-progresso .progresso-trilha { height: 1.1vh; min-height: 8px; }
.tv-progresso .progresso-rotulo { font-size: .9em; }

.tv-cands { display: grid; gap: 1.4vh; align-content: start; }
.tv-cand { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 1.2vw; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 1.2vh 1vw; }
.tv-cand .foto { width: 7.5vh; height: 7.5vh; border-width: .45vh; font-size: 2.2vh; }
.tv-cand.lider .foto { width: 10vh; height: 10vh; }
.tv-cand-nome { font-weight: 800; font-size: 1.45em; line-height: 1.1; }
.tv-cand-meta { color: var(--text-2); font-size: .9em; }
.tv-cand-pct { font-size: 2.6em; font-weight: 800; letter-spacing: -.03em; text-align: right; line-height: 1; }
.tv-cand.lider .tv-cand-pct { font-size: 3.4em; }
.tv-cand-votos { color: var(--text-2); font-size: .85em; text-align: right; }
.tv-cand .cand-barra { height: 1vh; min-height: 6px; }
.tv-extra { color: var(--text-2); font-size: .95em; margin-top: auto; }
.tv-extra b { color: var(--text); }

.tv-rodape { display: grid; gap: .8vh; }
.tv-ufs { display: flex; gap: .45vw; flex-wrap: wrap; justify-content: center; }
.tv-uf {
  display: inline-flex; align-items: center; gap: .35em; padding: .35em .7em; border-radius: 10px; cursor: pointer;
  border: 2px solid var(--border); background: var(--surface); color: var(--text-2); font-weight: 800; font-size: .95em;
}
.tv-uf i { width: .7em; height: .7em; border-radius: 50%; display: inline-block; }
.tv-uf.atual { background: var(--accent); border-color: var(--accent); color: #0b0b0b; }
:root[data-theme="light"] .tv-uf.atual { color: #fff; }
/* foco bem visível para controle remoto */
.tv-uf:focus-visible, .tv-controles :focus-visible { outline: 4px solid var(--s4); outline-offset: 3px; }
.tv-tempo { height: 4px; background: var(--surface-2); border-radius: 2px; overflow: hidden; }
.tv-tempo i { display: block; height: 100%; width: 0; background: var(--accent); }

.tv-controles {
  position: fixed; left: 50%; bottom: 3vh; transform: translateX(-50%); z-index: 2000;
  display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; max-width: 94vw;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 10px; box-shadow: 0 10px 40px rgba(0,0,0,.5);
  font-size: 14px; transition: opacity .3s;
}
body.ocioso .tv-controles { opacity: 0; pointer-events: none; }
.tv-controles { bottom: auto; top: 13vh; }

/* TV em pé / telas estreitas */
@media (max-aspect-ratio: 1/1) {
  body.tv { overflow: auto; height: auto; }
  .tv-palco { height: auto; min-height: 100vh; }
  .tv-corpo { grid-template-columns: 1fr; }
  .tv-mapa { height: 50vh; }
}

/* Cards de região (1º nível) e de estado (2º nível) */
.tv-regiao { padding: .45em 1em; font-size: 1.05em; }
.tv-regiao small { color: inherit; opacity: .7; font-weight: 600; margin-left: .2em; }
.tv-voltar { background: var(--surface-2); }
.tv-regiao-nome { align-self: center; font-weight: 800; color: var(--text-2); margin: 0 .3em; text-transform: uppercase; letter-spacing: .05em; font-size: .9em; }
