:root {
  --fundo: #16181d; --fundo2: #22252d; --tinta: #fff; --acento: #ffd60a; --acento-tinta: #0a5e2f;
  --vidro: rgba(255,255,255,.12); --vidro2: rgba(255,255,255,.2); --suave: rgba(255,255,255,.72);
  --nosso: #ffd60a; --deles: rgba(255,255,255,.45);
}
body[data-time="verde"] { --fundo: #0b7a3b; --fundo2: #08542a; --acento: #ffd60a; --acento-tinta: #0a5e2f; --nosso: #ffd60a; }
body[data-time="vermelho"] { --fundo: #c8102e; --fundo2: #860a1e; --acento: #fff; --acento-tinta: #c8102e; --nosso: #fff; --deles: rgba(255,255,255,.38); }
body[data-time="circo"] { --fundo: #0f1b2d; --fundo2: #0a1220; --acento: #7cc4ff; --acento-tinta: #0f1b2d; --nosso: #7cc4ff; --deles: #7cc4ff; }

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: Inter, system-ui, -apple-system, 'Segoe UI', sans-serif; color: var(--tinta);
  background: linear-gradient(180deg, var(--fundo) 0%, var(--fundo2) 100%) fixed; background-color: var(--fundo2);
  min-height: 100vh; min-height: 100dvh; transition: background .4s;
}
button, input { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
a { color: inherit; }
[hidden] { display: none !important; }

#app { max-width: 480px; margin: 0 auto; padding: 0 16px calc(84px + env(safe-area-inset-bottom)); min-height: 100vh; }
.tela { padding-top: calc(20px + env(safe-area-inset-top)); display: flex; flex-direction: column; gap: 12px; animation: entra .35s ease; }
@keyframes entra { from { opacity: 0; transform: translateY(8px); } }
.topo-mini { font-size: 11px; font-weight: 700; letter-spacing: .12em; opacity: .8; }
.cab { display: flex; justify-content: space-between; align-items: center; }
.troca { font-size: 12px; font-weight: 700; padding: 6px 10px; border-radius: 99px; background: var(--vidro); }
h1 { font-size: 34px; font-weight: 900; letter-spacing: -.02em; line-height: 1.05; margin: 8px 0 6px; }
h2 { font-size: 26px; font-weight: 900; letter-spacing: -.02em; line-height: 1.1; }
h2 em, h1 em { font-style: normal; color: var(--acento); }
.nota { font-size: 12px; opacity: .65; text-align: center; }
.sub-txt { font-size: 14px; color: var(--suave); }

.foto { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; border: 2px solid rgba(255,255,255,.9); background: #ddd; flex: none; }
.foto.grande { width: 120px; height: 120px; border-width: 4px; }
.foto.gigante { width: 168px; height: 168px; border-width: 5px; }

/* escolha do time */
.tela-time { background: transparent; }
body[data-time=""] { background: #f6f4ef; color: #16181d; }
body[data-time=""] .nota { color: #16181d; }
.time-btn { display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: 18px; text-align: left; color: #fff; transition: transform .15s; }
.time-btn:active { transform: scale(.97); }
.time-btn b { display: block; font-size: 16px; font-weight: 900; letter-spacing: .02em; }
.time-btn small { font-size: 13px; opacity: .85; font-weight: 600; }
.time-btn .foto { width: 64px; height: 64px; }
.time-btn.verde { background: #0b7a3b; } .time-btn.verde b { color: #ffd60a; }
.time-btn.vermelho { background: #c8102e; }
.time-btn.circo { background: #0f1b2d; } .time-btn.circo b { color: #7cc4ff; }
.duas { display: flex; } .duas .foto { width: 44px; height: 44px; } .duas .foto + .foto { margin-left: -14px; }

/* início */
.fala-linha { display: flex; align-items: flex-start; gap: 10px; min-height: 64px; }
.fala-linha .foto { width: 60px; height: 60px; cursor: pointer; }
.balao { background: #fff; color: #16181d; border-radius: 16px; padding: 10px 12px; font-size: 14px; font-weight: 700; line-height: 1.35; position: relative; flex: 1; }
.balao small { display: block; font-size: 10px; font-weight: 600; opacity: .55; margin-top: 4px; }
.contagem { padding: 4px 0; }
.contagem .rotulo { font-size: 30px; font-weight: 900; line-height: 1; }
.contagem .relogio { font-size: 40px; font-weight: 900; color: var(--acento); letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.contagem .sub { font-size: 13px; color: var(--suave); }
.card { display: block; width: 100%; text-align: left; background: var(--vidro); border-radius: 16px; padding: 14px; }
.card b { display: block; font-size: 16px; font-weight: 800; margin-bottom: 3px; }
.card span { font-size: 13px; color: var(--suave); }
.cta { background: rgba(0,0,0,.25); border-radius: 18px; padding: 16px; display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.cta b { font-size: 17px; font-weight: 900; } .cta span { font-size: 13px; color: var(--suave); }
.btn { display: block; text-align: center; padding: 14px; border-radius: 14px; font-weight: 800; font-size: 15px; text-decoration: none; }
.btn.branco { background: #fff; color: var(--acento-tinta); }
body[data-time="vermelho"] .btn.branco, body[data-time="circo"] .btn.branco { color: var(--fundo); }
.btn.destaque { background: var(--acento); color: var(--acento-tinta); }
body[data-time="vermelho"] .btn.destaque { color: #c8102e; }
.btn.vidro { background: var(--vidro2); color: #fff; }

/* bingo */
.bingo { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.bingo button { aspect-ratio: 1; border-radius: 12px; background: var(--vidro); font-size: 12px; font-weight: 800; line-height: 1.15; padding: 4px; display: flex; align-items: center; justify-content: center; text-align: center; overflow-wrap: anywhere; hyphens: auto; transition: transform .12s, background .2s; }
.bingo button:active { transform: scale(.92); }
.bingo button.x { background: var(--acento); color: var(--acento-tinta); }
body[data-time="vermelho"] .bingo button.x { color: #c8102e; }
.bingo button.linha { box-shadow: 0 0 0 3px #fff inset; }
.bingo-status { font-size: 14px; font-weight: 700; background: var(--vidro); border-radius: 12px; padding: 10px 12px; }

/* palpite */
.palpite-fotos { display: flex; justify-content: space-between; align-items: center; height: 170px; padding: 0 6px; }
.palpite-fotos figure { display: flex; flex-direction: column; align-items: center; gap: 6px; transition: transform .2s; }
.palpite-fotos .foto { width: 110px; height: 110px; border-width: 4px; }
.palpite-fotos figcaption { font-weight: 800; font-size: 14px; }
#palpite-barra { width: 100%; appearance: none; -webkit-appearance: none; height: 18px; border-radius: 10px; background: linear-gradient(90deg, #c8102e 0 50%, #0b7a3b 50% 100%); outline: none; border: 2px solid rgba(255,255,255,.6); }
#palpite-barra::-webkit-slider-thumb { -webkit-appearance: none; width: 34px; height: 34px; border-radius: 50%; background: #fff; border: 4px solid #16181d; cursor: grab; }
#palpite-barra::-moz-range-thumb { width: 28px; height: 28px; border-radius: 50%; background: #fff; border: 4px solid #16181d; cursor: grab; }
.palpite-num { display: flex; justify-content: space-between; font-size: 26px; font-weight: 900; font-variant-numeric: tabular-nums; }
#palpite-resultado .card { margin-top: 4px; }

/* apuração */
.ao-vivo { font-size: 11px; font-weight: 800; letter-spacing: .1em; color: #fff; background: rgba(0,0,0,.3); padding: 4px 8px; border-radius: 99px; animation: pisca 1.2s infinite; }
@keyframes pisca { 50% { opacity: .5; } }
.manchete { font-size: 28px; font-weight: 900; line-height: 1.08; letter-spacing: -.02em; }
.manchete em { font-style: normal; color: var(--acento); }
.cands { display: flex; flex-direction: column; gap: 8px; }
.cand { background: var(--vidro); border-radius: 16px; padding: 12px; display: flex; gap: 12px; align-items: center; transition: transform .3s; }
.cand .foto { transition: transform .3s, width .3s, height .3s; }
.cand.lider .foto { width: 64px; height: 64px; animation: balanca 1.6s ease-in-out infinite; }
@keyframes balanca { 25% { transform: rotate(-6deg) scale(1.04); } 75% { transform: rotate(6deg) scale(1.04); } }
.cand .info { flex: 1; min-width: 0; }
.cand .nome { font-weight: 800; font-size: 16px; display: flex; justify-content: space-between; }
.cand .pct { font-size: 22px; font-weight: 900; font-variant-numeric: tabular-nums; }
.cand .votos { font-size: 12px; color: var(--suave); font-variant-numeric: tabular-nums; }
.barra { height: 10px; border-radius: 6px; background: rgba(255,255,255,.18); overflow: hidden; margin: 6px 0 4px; }
.barra i { display: block; height: 100%; border-radius: 6px; background: var(--deles); transition: width .8s ease; }
.cand.nosso .barra i { background: var(--nosso); }
.mini-t { font-size: 12px; font-weight: 700; letter-spacing: .06em; opacity: .8; text-transform: uppercase; margin-top: 4px; }
.ufs { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.ufs div { border-radius: 6px; font-size: 11px; font-weight: 800; text-align: center; padding: 7px 0; background: var(--vidro); }
.ufs .f { background: #ffd60a; color: #0a5e2f; }
.ufs .l { background: #fff; color: #c8102e; }
body[data-time="circo"] .ufs .f { background: #ffd60a; } body[data-time="circo"] .ufs .l { background: #ff6b7d; color: #fff; }
.fonte { font-size: 11px; opacity: .65; }

/* placar geral, ao vivo, lembrete */
.cab-dir { display: flex; gap: 6px; }
.geral { background: rgba(0,0,0,.22); border-radius: 18px; padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.geral-nums { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.geral-nums div { background: var(--vidro); border-radius: 12px; padding: 10px 6px; text-align: center; }
.geral-nums b { display: block; font-size: 20px; font-weight: 900; font-variant-numeric: tabular-nums; }
.geral-nums span { font-size: 11px; color: var(--suave); }
.geral-top { display: flex; flex-direction: column; gap: 5px; }
.geral-top .linha-top { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; }
.geral-top .linha-top i { flex: none; height: 8px; border-radius: 4px; background: var(--acento); min-width: 6px; }
.geral-top .linha-top span { flex: none; font-variant-numeric: tabular-nums; opacity: .8; }
.acesos { display: flex; flex-wrap: wrap; gap: 5px; }
.acesos span { font-size: 12px; font-weight: 800; background: #fff; color: #c8102e; border-radius: 99px; padding: 4px 9px; }
.acesos em { font-style: normal; font-size: 12px; opacity: .7; }
.bingo button.aceso { position: relative; }
.bingo button.aceso::after { content: 'FALARAM'; position: absolute; top: 3px; right: 3px; font-size: 7px; font-weight: 900; letter-spacing: .05em; background: #ff2d4f; color: #fff; border-radius: 4px; padding: 1px 3px; }
.ao-vivo-faixa { background: #ff2d4f; color: #fff; border-radius: 12px; padding: 10px 12px; font-size: 14px; font-weight: 800; animation: entra .3s; }
.lembrete { background: var(--vidro); border-radius: 16px; padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.lembrete b { font-size: 15px; }
.lembrete-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.lembrete-btns .btn { padding: 11px 6px; font-size: 13px; }

/* nav */
.nav { position: fixed; left: 0; right: 0; bottom: 0; display: flex; justify-content: center; background: rgba(0,0,0,.35); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); padding: 8px 8px calc(8px + env(safe-area-inset-bottom)); z-index: 10; }
.nav button { flex: 1; max-width: 120px; padding: 10px 4px; font-size: 13px; font-weight: 700; opacity: .7; border-radius: 12px; }
.nav button.ativo { opacity: 1; background: var(--vidro); }
.rodape { font-size: 10px; opacity: .55; padding: 24px 0 8px; display: flex; flex-direction: column; gap: 4px; line-height: 1.4; }
.rodape a { font-weight: 800; font-size: 12px; }

/* pop */
.pop { position: fixed; inset: 0; z-index: 30; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,.45); padding: 16px; animation: entra .2s; }
.pop-caixa { max-width: 340px; display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.pop-caixa .balao { font-size: 16px; }
.pop-caixa small { font-size: 11px; opacity: .75; }
.pula { animation: pula .7s cubic-bezier(.3,1.6,.5,1); }
@keyframes pula { 0% { transform: scale(.3) rotate(-20deg); } 60% { transform: scale(1.15) rotate(6deg); } 100% { transform: scale(1) rotate(0); } }
.treme { animation: treme .5s linear 2; }
@keyframes treme { 20% { transform: translateX(-8px) rotate(-4deg); } 40% { transform: translateX(8px) rotate(4deg); } 60% { transform: translateX(-6px); } 80% { transform: translateX(6px); } }

/* festa */
.festa { position: fixed; inset: 0; z-index: 40; background: linear-gradient(180deg, var(--fundo), var(--fundo2)); display: flex; align-items: center; justify-content: center; padding: 16px; }
body[data-time=""] .festa { background: #16181d; }
#confete { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.festa-caixa { position: relative; width: 100%; max-width: 380px; display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.festa-titulo { font-size: 52px; font-weight: 900; letter-spacing: -.03em; line-height: 1; }
.festa-sub { font-size: 13px; color: var(--suave); }
.festa-caixa .btn { width: 100%; }
.fechar { font-size: 13px; opacity: .7; padding: 8px; text-decoration: underline; }

@media (min-width: 900px) {
  #app { padding-top: 24px; }
  .nav { left: 50%; right: auto; transform: translateX(-50%); width: 480px; border-radius: 18px 18px 0 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
