@font-face { font-family: "Poppins"; src: url("/fonts/Poppins-Black.ttf") format("truetype"); font-weight: 800 900; font-display: swap; }
@font-face { font-family: "Poppins"; src: url("/fonts/Poppins-Bold.ttf") format("truetype"); font-weight: 500 700; font-display: swap; }
@font-face { font-family: "Rubik"; src: url("/fonts/Rubik-VariableFont_wght.ttf") format("truetype"); font-weight: 300 900; font-display: swap; }
:root {
  --fundo: #0e0f14;
  --painel: #181a22;
  --borda: #2a2d3a;
  --texto: #f3f1ea;
  --suave: #9a9cab;
  --ouro: #ffc83d;
  --corL: #d7262b;
  --corR: #1f5fd1;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--fundo); color: var(--texto); }
body { font-family: "Rubik", "Avenir Next", system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
main { max-width: 1000px; margin: 0 auto; padding: 12px 16px 24px; }

.topo { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
h1 { margin: 0; font-size: clamp(20px, 4.4vw, 30px); font-weight: 900; text-transform: uppercase; letter-spacing: -.01em; }
h1 span { color: var(--ouro); }
.topo-acoes { display: flex; align-items: center; gap: 8px; }
.selo { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; padding: 5px 10px; border-radius: 999px; background: var(--painel); border: 1px solid var(--borda); color: var(--suave); white-space: nowrap; }
.selo.vivo { background: #c8102e; border-color: #c8102e; color: #fff; }
.selo.vivo::before { content: "● "; animation: pisca 1.2s infinite; }
.selo.sim { background: var(--ouro); border-color: var(--ouro); color: #201800; }
@keyframes pisca { 50% { opacity: .25; } }
.btn-icone { background: var(--painel); border: 1px solid var(--borda); color: var(--texto); border-radius: 999px; width: 36px; height: 36px; font-size: 16px; cursor: pointer; }

.placar { display: grid; grid-template-columns: 1fr minmax(120px, .8fr) 1fr; gap: 8px; align-items: stretch; }
.canto, .centro { background: var(--painel); border: 1px solid var(--borda); border-radius: 12px; padding: 10px 12px; min-width: 0; }
.canto.esq { border-top: 4px solid var(--corL); }
.canto.dir { border-top: 4px solid var(--corR); text-align: right; }
.canto.lider { box-shadow: 0 0 0 2px var(--ouro) inset; }
.nome { font-weight: 900; text-transform: uppercase; font-size: clamp(13px, 3vw, 20px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.partido { font-size: 12px; color: var(--suave); }
.pct { font-size: clamp(26px, 7.5vw, 52px); font-weight: 900; line-height: 1.05; font-variant-numeric: tabular-nums; }
.votos { font-size: clamp(11px, 2.4vw, 14px); color: var(--suave); font-variant-numeric: tabular-nums; }
.centro { text-align: center; display: flex; flex-direction: column; justify-content: center; gap: 4px; }
.rotulo { font-size: 10px; text-transform: uppercase; letter-spacing: .1em; color: var(--suave); }
.secoes { font-size: clamp(18px, 4.6vw, 30px); font-weight: 900; font-variant-numeric: tabular-nums; }
.progresso { height: 6px; background: #0b0c10; border-radius: 99px; overflow: hidden; }
.progresso i { display: block; height: 100%; width: 0; background: var(--ouro); transition: width .6s; }
.vantagem { font-size: clamp(10px, 2.2vw, 13px); color: var(--ouro); font-weight: 700; min-height: 1.3em; }

.oferecimento { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 8px; padding: 8px 12px; min-height: 52px; background: var(--painel); border: 1px solid var(--borda); border-radius: 12px; color: var(--texto); text-decoration: none; }
.oferecimento[hidden] { display: none; }
.oferecimento span { font-size: 10px; text-transform: uppercase; letter-spacing: .12em; color: var(--suave); }
.oferecimento img { max-height: 36px; max-width: 55%; object-fit: contain; }
.oferecimento img[hidden] { display: none; }
.oferecimento b { font-size: 15px; }
.oferecimento.vago { border: 2px dashed var(--ouro); background: rgba(255, 200, 61, .12); color: var(--ouro); font-weight: 800; font-size: 13px; }
.oferecimento.vago span { color: var(--ouro); }
.cabo { position: relative; display: flex; height: 14px; margin: 8px 0; border-radius: 99px; overflow: hidden; background: #0b0c10; border: 1px solid var(--borda); }
.cabo i { display: block; height: 100%; transition: width .6s; }
#caboL { background: var(--corL); width: 50%; }
#caboR { background: var(--corR); width: 50%; }
.cabo b { position: absolute; left: 50%; top: -2px; bottom: -2px; width: 2px; background: #fff; }

.ringue { position: relative; border-radius: 14px; overflow: hidden; border: 1px solid var(--borda); background: #000; }
canvas { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; }
.espera { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; padding: 4% 16px 0; text-align: center; background: linear-gradient(#000c, #0006 45%, #0000 70%); }
.espera[hidden] { display: none; }
.espera h2 { margin: 0 0 4px; font-size: clamp(18px, 4.5vw, 30px); text-transform: uppercase; font-weight: 900; }
.espera p { margin: 2px 0; font-size: clamp(12px, 2.6vw, 15px); }
.contagem { color: var(--ouro); font-weight: 800; font-variant-numeric: tabular-nums; }

.btn { margin-top: 8px; background: var(--ouro); color: #201800; border: 0; border-radius: 999px; padding: 9px 18px; font-weight: 800; font-size: 14px; cursor: pointer; }
.btn.pequeno { margin: 0; padding: 6px 12px; font-size: 12px; }
.controles { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-top: 10px; font-size: 13px; color: var(--suave); }
.controles label { display: inline-flex; align-items: center; gap: 6px; }
.controles > span:not(.status) { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.controles > span[hidden] { display: none; }
select { background: var(--painel); color: var(--texto); border: 1px solid var(--borda); border-radius: 8px; padding: 6px 8px; font-size: 13px; max-width: 100%; }
input[type=range] { width: 130px; accent-color: var(--ouro); }
.status { margin-left: auto; font-variant-numeric: tabular-nums; }
footer p { font-size: 11px; color: var(--suave); line-height: 1.5; margin: 14px 0 0; }
footer a { color: var(--texto); }

@media (max-width: 560px) {
  main { padding: 10px 16px 20px; }
  .placar { grid-template-columns: 1fr 1fr; }
  .centro { grid-column: 1 / -1; order: 3; }
  .status { margin-left: 0; width: 100%; }
}

/* ── modo jogo ── */
.modo-jogo .placar, .modo-jogo .cabo { display: none; }
.espera.fim { justify-content: center; padding-top: 0; background: #000a; }
.jogo-opcoes { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.btn.contorno { background: transparent; color: var(--texto); border: 2px solid var(--ouro); }
.toque { display: flex; gap: 12px; margin-top: 10px; }
.toque[hidden] { display: none; }
.toque > div { flex: 1; display: flex; gap: 8px; }
.toque > div.unico { max-width: 520px; margin: 0 auto; }
.toque > div.invertido { flex-direction: row-reverse; }
.toque button { flex: 1; min-height: 64px; border-radius: 14px; border: 2px solid var(--borda); background: var(--painel); color: var(--texto); font-size: 16px; font-weight: 800; cursor: pointer; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.toque button.soco { flex: 1.5; background: var(--ouro); border-color: var(--ouro); color: #201800; }
.toque button:active, .toque button.ativo { transform: scale(.96); filter: brightness(1.25); }

/* ── apuração por território ── */
.territorio { margin-top: 18px; padding: 14px; background: var(--painel); border: 1px solid var(--borda); border-radius: 12px; }
.modo-jogo .territorio { display: none; }
.territorio h2 { margin: 0; font-size: 15px; font-weight: 900; text-transform: uppercase; letter-spacing: .04em; }
.terr-aviso { margin: 2px 0 0; font-size: 12px; color: var(--suave); }
.terr-selecao { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.terr-selecao select { flex: 1 1 220px; min-width: 0; padding: 9px 10px; font-size: 14px; background: var(--fundo); }
.terr-selecao select[hidden] { display: none; }
.terr-resultado { margin-top: 12px; }
.terr-resultado[hidden] { display: none; }
.terr-topo { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 12px; margin-bottom: 8px; }
.terr-topo b { font-size: 17px; }
.terr-topo span { font-size: 12px; color: var(--ouro); font-weight: 700; font-variant-numeric: tabular-nums; }
.terr-linha { display: grid; grid-template-columns: minmax(70px, 150px) 1fr 68px; grid-template-areas: "nome barra pct" "nome votos votos"; align-items: center; gap: 2px 10px; padding: 6px 0; }
.terr-cand { grid-area: nome; font-weight: 800; font-size: 13px; text-transform: uppercase; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.terr-barra { grid-area: barra; height: 12px; background: #0b0c10; border-radius: 99px; overflow: hidden; }
.terr-barra i { display: block; height: 100%; width: 0; background: var(--corL); border-radius: 99px; transition: width .6s; }
.terr-barra.dir i { background: var(--corR); }
.terr-linha > b { grid-area: pct; text-align: right; font-size: 16px; font-weight: 900; font-variant-numeric: tabular-nums; }
.terr-votos { grid-area: votos; font-size: 12px; color: var(--suave); font-variant-numeric: tabular-nums; }
@media (max-width: 560px) {
  .terr-linha { grid-template-columns: 1fr 68px; grid-template-areas: "nome pct" "barra barra" "votos votos"; gap: 3px 10px; }
}

/* ── apoio via PIX ── */
.apoio p { color: var(--suave); font-size: 14px; }
.apoio .btn { margin-top: 4px; }
.modo-jogo .apoio { display: block; }
.pix { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; margin: 14px 0; }
.pix img { width: 240px; height: 240px; background: #fff; border-radius: 8px; flex: none; }
.pix-como { margin: 10px 0 0; font-size: 12px !important; color: var(--suave) !important; }
.pix > div { flex: 1 1 240px; min-width: 0; }
.pix-rotulo { margin: 0; font-size: 11px; text-transform: uppercase; letter-spacing: .1em; }
.pix-chave { margin: 4px 0 10px; font-family: "SF Mono", Menlo, monospace; font-size: 13px; word-break: break-all; color: var(--texto) !important; }
.pix-nota { font-size: 12px !important; }

/* ── página do jogo ── */
.jogo-chamada { margin-top: 10px !important; font-size: 13px !important; }
.jogo-chamada a { color: var(--ouro); font-weight: 700; }
.pagina-jogo .placar, .pagina-jogo .cabo, .pagina-jogo .controles, .pagina-jogo .territorio, .pagina-jogo .oferecimento { display: none !important; }
.voltar { display: inline-flex; align-items: center; gap: 6px; color: var(--suave); font-size: 14px; text-decoration: none; margin-bottom: 8px; }
.voltar:hover { color: var(--texto); }
.jogo-rodape { margin-top: 18px; padding: 16px; background: var(--painel); border: 1px solid var(--borda); border-radius: 12px; text-align: center; }
.jogo-rodape p { margin: 0 0 10px; color: var(--suave); font-size: 14px; }

/* o bloco do PIX usa a caixa do quadro de território, mas deve aparecer na página do jogo */
.pagina-jogo .territorio.apoio, .modo-jogo .territorio.apoio { display: block !important; }
/* no celular, o menu e o resultado do jogo saem de cima do ringue e ficam logo abaixo dele (não cabem por cima) */
@media (max-width: 700px) {
  .pagina-jogo .ringue .espera, .modo-jogo .ringue .espera { position: static; padding: 16px 12px 18px; background: var(--painel); }
  .pagina-jogo .ringue .espera.fim, .modo-jogo .ringue .espera.fim { background: var(--painel); }
  .pagina-jogo .jogo-opcoes .btn, .modo-jogo .jogo-opcoes .btn { flex: 1 1 100%; }
}

/* tipografia do novo padrão: Poppins nos títulos e números, Rubik nos textos */
h1, h2, .nome, .pct, .secoes, .btn, .selo, .vantagem, .toque button, .territorio h2, .terr-linha > b, .terr-cand, .terr-topo b, .contagem { font-family: "Poppins", "Avenir Next", system-ui, sans-serif; }

/* ── perguntas frequentes ── */
.faq details { background: var(--fundo, #101118); border: 1px solid var(--borda); border-radius: 10px; margin-top: 8px; }
.faq summary { cursor: pointer; padding: 12px 14px; font-weight: 700; font-family: "Poppins", system-ui, sans-serif; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--ouro); font-size: 20px; line-height: 1; }
.faq details[open] summary::after { content: "–"; }
.faq details p { margin: 0; padding: 0 14px 14px; color: var(--suave); line-height: 1.5; }
.faq a { color: var(--ouro); }
.ajuda { margin-left: auto; color: var(--ouro); font-size: 13px; font-weight: 700; text-decoration: none; white-space: nowrap; }
.ajuda:hover { text-decoration: underline; }

/* ── modo transmissão (?tv): tela limpa para OBS / live no X ── */
.modo-tv .controles, .modo-tv .territorio, .modo-tv footer, .modo-tv .ajuda, .modo-tv #ctlToque { display: none !important; }
.modo-tv body { overflow: hidden; }
.modo-tv main { max-width: min(100vw, calc((100vh - 275px) * 1.778)); padding-top: 8px; padding-bottom: 0; }
.tv-marca { display: none; }
.modo-tv .tv-marca { display: flex; position: fixed; left: 0; right: 0; bottom: 0; justify-content: center; gap: 28px; padding: 8px 16px; background: rgba(14,15,20,.92); border-top: 2px solid var(--ouro); font: 800 18px "Poppins", system-ui, sans-serif; color: var(--texto); letter-spacing: .02em; }
.modo-tv .tv-marca b { color: var(--ouro); }
.ajuda-2 { margin-left: 14px; }
a.btn { text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
#espera .jogo-opcoes { margin-top: 4px; }
@media (max-width: 560px) {
  #espera .btn { font-size: 12px; padding: 6px 11px; margin-top: 4px; }
  #espera .jogo-opcoes { gap: 6px; flex-wrap: nowrap; }
}
.modo-tv #espera a.btn { display: none; }
.curto { display: none; }
@media (max-width: 560px) {
  #espera .btn { white-space: nowrap; }
  #espera .longo { display: none; }
  #espera .curto { display: inline; }
}
#espera .btn.contorno { background: rgba(14,15,20,.82); }
.tv-pix { display: none; }
.modo-tv main { max-width: min(calc(100vw - 480px), calc((100vh - 305px) * 1.778)); }
.modo-tv .tv-pix { display: flex; flex-direction: column; align-items: center; position: fixed; right: 18px; top: 50%; transform: translateY(-58%); width: 200px; padding: 14px 12px; background: var(--painel); border: 2px solid var(--ouro); border-radius: 14px; text-align: center; }
.tv-pix span { font-size: 11px; text-transform: uppercase; letter-spacing: .12em; color: var(--suave); }
.tv-pix b { font: 900 34px/1 "Poppins", system-ui, sans-serif; color: var(--ouro); margin: 2px 0 10px; }
.tv-pix img { width: 170px; height: 170px; border-radius: 8px; background: #fff; }
.tv-pix p { margin: 10px 0 4px; font: 700 14px/1.25 "Poppins", system-ui, sans-serif; color: var(--texto); }
.tv-pix small { font-size: 10px; color: var(--suave); }

/* ── transmissão vertical (Instagram Live, 9:16): /?tv numa tela em pé ── */
@media (orientation: portrait) {
  .modo-tv main { max-width: 100vw; padding: 10px 14px 0; }
  .modo-tv .tv-pix { position: static; transform: none; width: auto; margin: 14px 14px 0; flex-direction: row; gap: 14px; text-align: left; align-items: center; }
  .modo-tv .tv-pix img { width: 150px; height: 150px; flex: none; }
  .modo-tv .tv-pix > div { display: flex; flex-direction: column; }
  .modo-tv .tv-marca { flex-wrap: wrap; gap: 4px 16px; font-size: 16px; padding: 10px 12px 14px; }
}
@media (orientation: landscape) {
  .modo-tv .tv-pix > div { display: contents; }
  .modo-tv .tv-pix img { order: 3; }
  .modo-tv .tv-pix span { order: 1; } .modo-tv .tv-pix b { order: 2; } .modo-tv .tv-pix p { order: 4; } .modo-tv .tv-pix small { order: 5; }
}
