:root {
  --fundo: #14161a;
  --superficie: #1d2026;
  --borda: #2c3038;
  --texto: #f2f3f5;
  --texto-2: #a3a8b3;
  --lula: #e0303d;
  --flavio: #2f6fd6;
  --ok: #2fb36b;
  --raio: 18px;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
button, a { touch-action: manipulation; }

.pular {
  position: absolute; left: 16px; top: -100px; z-index: 10;
  padding: 10px 14px; background: var(--texto); color: var(--fundo); border-radius: 10px; font-weight: 700;
}
.pular:focus-visible { top: 16px; outline: 3px solid var(--texto); outline-offset: 3px; }
main:focus { outline: none; }

body {
  margin: 0;
  background: var(--fundo);
  color: var(--texto);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { width: 100%; max-width: 760px; margin: 0 auto; padding: 0 16px; flex: 1; }

/* topo */
.topo { position: relative; text-align: center; padding: 36px 16px 22px; isolation: isolate; overflow: hidden; }
/* luz suave: vermelho de um lado, azul do outro, com o mesmo peso */
.topo::before {
  content: ""; position: absolute; inset: -40% -10% 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(45% 60% at 18% 40%, rgba(224, 48, 61, .22), transparent 70%),
    radial-gradient(45% 60% at 82% 40%, rgba(47, 111, 214, .22), transparent 70%);
}
.selo {
  display: inline-flex; align-items: center; gap: 8px; margin: 0 0 14px; padding: 6px 14px;
  background: rgba(255, 255, 255, .04); border: 1px solid var(--borda); border-radius: 999px;
  color: var(--texto); font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
}
.selo-ponto { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); animation: pulso 1.6s infinite; }
.selo-total { color: var(--texto-2); font-weight: 600; font-variant-numeric: tabular-nums; }
.selo-total:not(:empty)::before { content: "·"; margin-right: 8px; }
h1 { margin: 0; font-size: clamp(34px, 8.5vw, 64px); line-height: 1.04; letter-spacing: -.03em; text-wrap: balance; }
.destaque {
  background: linear-gradient(90deg, #ff4d5a 0%, #ff4d5a 30%, #5b8ef0 70%, #5b8ef0 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.sub { margin: 14px auto 0; max-width: 32em; color: var(--texto); font-size: clamp(16px, 4vw, 19px); font-weight: 600; text-wrap: pretty; }
.sub-nota { margin: 6px auto 0; max-width: 32em; color: var(--texto-2); font-size: 13px; text-wrap: pretty; }

/* cartões */
.arena { display: flex; gap: 14px; }
.arena[data-inv="true"] .card[data-c="lula"] { order: 2; }

.card {
  --cor: var(--lula);
  flex: 1 1 0; min-width: 0;
  display: flex; flex-direction: column; align-items: stretch;
  padding: 0; overflow: hidden;
  background: var(--superficie); color: inherit; font: inherit; text-align: center;
  border: 2px solid var(--borda); border-radius: var(--raio);
  cursor: pointer;
  position: relative;
  transition: transform .15s;
}
/* brilho do hover numa camada própria: anima só opacity, não box-shadow */
.card::after {
  content: ""; position: absolute; inset: -2px; border-radius: inherit; pointer-events: none;
  border: 2px solid var(--cor); box-shadow: 0 10px 30px -12px var(--cor);
  opacity: 0; transition: opacity .15s;
}
.card[data-c="flavio"] { --cor: var(--flavio); }
.card:hover:not(:disabled) { transform: translateY(-2px); }
.card:hover:not(:disabled)::after { opacity: 1; }
.card:active:not(:disabled) { transform: translateY(0) scale(.99); }
.card:focus-visible { outline: 3px solid var(--texto); outline-offset: 3px; }
.card:disabled { cursor: default; }

.foto { display: block; aspect-ratio: 1; background: #fff; overflow: hidden; }
.foto img { display: block; width: 100%; height: 100%; object-fit: cover; }

.nome { display: block; padding: 12px 8px 4px; font-weight: 700; font-size: clamp(16px, 4vw, 22px); line-height: 1.2; }
.acao {
  display: block; margin: 8px 12px 14px; padding: 10px;
  background: var(--cor); color: #fff; border-radius: 12px;
  font-weight: 700; letter-spacing: .02em;
}
.card:disabled .acao { background: transparent; color: var(--texto-2); border: 1px solid var(--borda); }
.card.escolhido { border-color: var(--cor); }
.card.escolhido .acao { background: transparent; color: var(--cor); border: 1px solid var(--cor); }

.ts { display: flex; justify-content: center; margin-top: 14px; min-height: 0; }
.ts:empty { display: none; }

/* confirmação com Google */
.confirmar {
  margin-top: 16px; padding: 20px 16px;
  background: var(--superficie); border: 1px solid var(--borda); border-radius: var(--raio);
  text-align: center;
}
.confirmar h2 { font-size: 20px; text-wrap: balance; }
.confirmar h2:focus { outline: none; }
.confirmar-texto { margin: 6px 0 0; color: var(--texto-2); text-wrap: pretty; }
.botao-google { display: flex; justify-content: center; min-height: 44px; margin-top: 16px; }
.aviso-app {
  margin: 14px auto 0; max-width: 30em; padding: 10px 12px;
  border: 1px solid #ff7b85; border-radius: 10px; color: #ffb3b9; font-size: 14px;
}
.privacidade { margin: 12px auto 0; max-width: 30em; color: var(--texto-2); font-size: 12px; }
.link {
  margin-top: 12px; padding: 6px 8px; background: none; border: 0; border-radius: 8px;
  color: var(--texto-2); font: inherit; font-size: 14px; text-decoration: underline; text-underline-offset: 3px;
  cursor: pointer;
}
.link:hover { color: var(--texto); }
.link:focus-visible { outline: 2px solid var(--texto); outline-offset: 2px; }
.centro { text-align: center; margin: 0; }

/* confirmação com CAPTCHA */
.confirmar-voto {
  display: block; width: 100%; max-width: 320px; margin: 16px auto 0; padding: 14px;
  border: 0; border-radius: 999px; background: var(--texto); color: var(--fundo);
  font: inherit; font-weight: 800; cursor: pointer; transition: transform .15s;
}
.confirmar-voto:hover:not(:disabled) { background: #fff; }
.confirmar-voto:active:not(:disabled) { transform: scale(.98); }
.confirmar-voto:disabled { opacity: .5; cursor: default; }
.confirmar-voto:focus-visible { outline: 2px solid var(--texto); outline-offset: 3px; }

/* compartilhar */
.compartilhar {
  margin-top: 20px; padding: 20px 16px; text-align: center;
  background: var(--superficie); border: 1px solid var(--borda); border-radius: var(--raio);
}
.compartilhar h2 { font-size: 20px; text-wrap: balance; }
.compartilhar-texto { margin: 6px auto 0; max-width: 32em; color: var(--texto-2); text-wrap: pretty; }
.botao-wa {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; max-width: 360px; margin-top: 16px; padding: 14px 18px;
  border-radius: 999px; background: #25d366; color: #0b2b17; font-weight: 800; text-decoration: none;
  transition: transform .15s;
}
.botao-wa:hover { filter: brightness(1.05); }
.botao-wa:active { transform: scale(.98); }
.botao-wa:focus-visible { outline: 2px solid var(--texto); outline-offset: 3px; }
.selo-ok { margin: 0 0 8px; color: var(--ok); font-weight: 700; }
.desafio { max-width: 360px; margin: 16px auto 0; }
.desafio-barra { height: 12px; background: var(--fundo); border-radius: 999px; overflow: hidden; }
.desafio-barra span {
  display: block; height: 100%; background: #25d366; border-radius: inherit;
  transform: scaleX(0); transform-origin: left center; transition: transform .4s cubic-bezier(.2, .8, .2, 1);
}
.desafio-texto { margin: 8px 0 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.desafio.completo .desafio-texto { color: #25d366; }
.compartilhar-dica { margin: 10px auto 0; max-width: 30em; color: var(--texto-2); font-size: 14px; text-wrap: pretty; }
/* desafio concluído: o painel se recolhe numa linha compacta */
.compartilhar.recolhido { padding: 14px 16px; }
.compartilhar.recolhido h2,
.compartilhar.recolhido .compartilhar-texto,
.compartilhar.recolhido .desafio-barra,
.compartilhar.recolhido .compartilhar-dica { display: none; }
.compartilhar.recolhido .selo-ok { margin: 0; display: inline; }
.compartilhar.recolhido .desafio { display: inline; margin: 0; }
.compartilhar.recolhido .desafio-texto { display: inline; margin: 0 0 0 6px; font-size: 14px; }
.compartilhar.recolhido .botao-wa {
  width: auto; max-width: none; margin-top: 10px; padding: 8px 14px; font-size: 14px; gap: 6px;
}
.compartilhar.recolhido .botao-wa svg { width: 16px; height: 16px; }
.compartilhar.recolhido .compartilhar-outros { display: inline-flex; margin: 10px 0 0 8px; vertical-align: middle; }
.compartilhar-outros { display: flex; justify-content: center; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.secundario-btn {
  padding: 8px 14px; border-radius: 999px; background: transparent; color: var(--texto);
  border: 1px solid var(--borda); font: inherit; font-size: 14px; cursor: pointer;
}
.secundario-btn:hover { border-color: var(--texto-2); }
.secundario-btn:focus-visible { outline: 2px solid var(--texto); outline-offset: 2px; }

/* apoio via Pix */
.apoio {
  margin-top: 20px; padding: 20px 16px;
  background: var(--superficie); border: 1px solid var(--borda); border-radius: var(--raio);
  text-align: center;
}
.apoio h2 { font-size: 20px; text-wrap: balance; }
.apoio-texto { margin: 6px auto 0; max-width: 32em; color: var(--texto-2); text-wrap: pretty; }
.valores { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 16px; }
.valor {
  min-width: 84px; padding: 10px 14px; border-radius: 999px;
  background: transparent; color: var(--texto); border: 1px solid var(--borda);
  font: inherit; font-weight: 700; font-variant-numeric: tabular-nums; cursor: pointer;
  transition: transform .15s;
}
.valor:hover { border-color: var(--texto-2); }
.valor:active { transform: scale(.97); }
.valor[aria-pressed="true"] { background: var(--ok); border-color: var(--ok); color: #08130d; }
.valor:focus-visible, .pix-copiar:focus-visible, .pix-codigo:focus-visible { outline: 2px solid var(--texto); outline-offset: 2px; }
.pix { margin-top: 18px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.pix-qr { width: 220px; height: 220px; border-radius: 12px; background: #fff; }
.pix-dica { margin: 0; color: var(--texto-2); font-size: 14px; }
.pix-rotulo { font-size: 13px; color: var(--texto-2); }
.pix-codigo {
  width: 100%; max-width: 420px; padding: 10px; resize: none;
  background: var(--fundo); color: var(--texto); border: 1px solid var(--borda); border-radius: 10px;
  font: 12px/1.4 ui-monospace, "SFMono-Regular", Consolas, monospace; overflow-wrap: anywhere;
}
.pix-copiar {
  width: 100%; max-width: 420px; padding: 12px; border: 0; border-radius: 12px;
  background: var(--ok); color: #08130d; font: inherit; font-weight: 800; cursor: pointer;
  transition: transform .15s;
}
.pix-copiar:hover { filter: brightness(1.08); }
.pix-copiar:active { transform: scale(.98); }
.pix-recebedor { margin: 0; color: var(--texto-2); font-size: 13px; }
.apoio-aviso { margin: 14px auto 0; max-width: 32em; color: var(--texto-2); font-size: 12px; }

/* chamada para doar depois do voto: entra, brilha 3 vezes e para (só transform/opacity) */
.apoio { position: relative; }
.apoio::after {
  content: ""; position: absolute; inset: -2px; border-radius: inherit; pointer-events: none;
  border: 2px solid var(--ok); box-shadow: 0 0 24px -4px var(--ok); opacity: 0;
}
.coracao { display: inline-block; }
.apoio.chamando { animation: apoio-entra .6s cubic-bezier(.2, .8, .2, 1) both; }
.apoio.chamando::after { animation: apoio-brilho 1.6s ease-in-out .7s 3; }
.apoio.chamando .coracao { animation: coracao-bate 1.6s ease-in-out .7s 3; }
.apoio.chamando .valor { animation: valor-surge .45s cubic-bezier(.2, .8, .2, 1) both; }
.apoio.chamando .valor:nth-child(1) { animation-delay: .35s; }
.apoio.chamando .valor:nth-child(2) { animation-delay: .45s; }
.apoio.chamando .valor:nth-child(3) { animation-delay: .55s; }
.apoio.chamando .valor:nth-child(4) { animation-delay: .65s; }
@keyframes apoio-entra { from { opacity: 0; transform: translateY(18px) scale(.98); } }
@keyframes apoio-brilho { 0%, 100% { opacity: 0; } 45% { opacity: 1; } }
@keyframes coracao-bate { 0%, 40%, 100% { transform: scale(1); } 15% { transform: scale(1.3); } 28% { transform: scale(1.1); } }
@keyframes valor-surge { from { opacity: 0; transform: translateY(8px) scale(.9); } }

/* celular: o QR quase nunca é escaneado da própria tela, o "copiar" vem primeiro */
@media (pointer: coarse) {
  .pix-qr { width: 160px; height: 160px; order: 5; }
  .pix-dica { order: -1; }
}
.card.escolhido:not(:disabled) .acao { background: transparent; color: var(--cor); border: 1px solid var(--cor); }
[hidden] { display: none !important; }

.status { min-height: 1.5em; margin: 14px 0 0; text-align: center; color: var(--texto-2); }
.status.ok { color: var(--ok); }
.status.erro { color: #ff7b85; }

/* painel */
.painel {
  margin: 24px 0 32px; padding: 20px;
  background: var(--superficie); border: 1px solid var(--borda); border-radius: var(--raio);
}
.painel-topo { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
h2 { margin: 0; font-size: 18px; }
.ao-vivo { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--texto-2); text-transform: uppercase; letter-spacing: .08em; }
.ao-vivo i { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); animation: pulso 1.6s infinite; }
.ao-vivo.off i { background: var(--texto-2); animation: none; }
@keyframes pulso { 50% { opacity: .3; } }

.placar { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 16px; }
.placar li { --cor: var(--lula); }
.placar li[data-c="flavio"] { --cor: var(--flavio); }
.placar li.frente { order: -1; }
.linha { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.pn { font-weight: 700; }
.placar li.frente .pn::after {
  content: "na frente"; margin-left: 8px; padding: 2px 8px; vertical-align: 2px;
  background: var(--cor); color: #fff; border-radius: 999px;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
}
.pp { font-size: 28px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.barra { height: 14px; margin-top: 6px; background: var(--fundo); border-radius: 999px; overflow: hidden; }
.barra span {
  display: block; height: 100%; background: var(--cor);
  transform: scaleX(0); transform-origin: left center;
  transition: transform .6s cubic-bezier(.2, .8, .2, 1);
}
.pv { margin-top: 4px; color: var(--texto-2); font-size: 14px; font-variant-numeric: tabular-nums; }
.total { margin: 18px 0 0; color: var(--texto-2); font-size: 14px; text-align: center; }

.rodape { padding: 0 16px calc(28px + env(safe-area-inset-bottom)); text-align: center; color: var(--texto-2); font-size: 13px; }
.rodape p { max-width: 36em; margin: 0 auto; }
.rodape a { color: var(--texto-2); text-underline-offset: 3px; }
.rodape a:hover { color: var(--texto); }

/* página de privacidade */
.texto-legal { max-width: 680px; padding-top: 24px; padding-bottom: 48px; line-height: 1.65; }
.texto-legal h1 { font-size: clamp(28px, 6vw, 40px); margin: 16px 0 4px; text-align: left; }
.texto-legal h2 { font-size: 18px; margin: 28px 0 6px; }
.texto-legal p { margin: 0 0 12px; overflow-wrap: anywhere; }
.texto-legal a { color: var(--texto); text-underline-offset: 3px; }
.mudo { color: var(--texto-2); }

@media (max-width: 420px) {
  .arena { gap: 10px; }
  .acao { margin: 6px 8px 10px; padding: 8px; font-size: 14px; }
  .painel { padding: 16px; }
}

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