:root {
  --azul: #034c97;
  --azul-escuro: #021f45;
  --verde: #44b496;
  --verde-claro: #9be8cf;
  --sol: #ffc93c;
  --coral: #ff7a6b;
  --lilas: #a796ff;
  --rosa: #ff9ec7;
  --creme: #fff8ec;
  --tinta: #10213d;
  --titulo: 'Fredoka', 'Nunito', system-ui, sans-serif;
  --texto: 'Nunito', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--texto);
  color: #fff;
  background: radial-gradient(120% 80% at 50% 0%, #0a5fb8 0%, var(--azul) 35%, var(--azul-escuro) 100%);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
button { font: inherit; cursor: pointer; }
[hidden] { display: none !important; }

#confete { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 50; }

.tela { display: none; min-height: 100dvh; }
.tela.ativa { display: flex; }

/* ---------- Entrada ---------- */
#entrada { align-items: center; justify-content: center; padding: 32px 20px 40px; position: relative; overflow: hidden; }
.entrada-conteudo { width: 100%; max-width: 420px; position: relative; z-index: 1; text-align: center; animation: subir .8s cubic-bezier(.2, .8, .2, 1) both; }
.logo { display: block; margin: 0 auto; background: #fff; border-radius: 999px; padding: 10px 18px; width: 180px; height: auto; box-shadow: 0 10px 30px rgba(0, 0, 0, .2); }
.selo {
  display: inline-block; margin: 22px 0 6px; padding: 6px 14px; border-radius: 999px;
  background: rgba(255, 255, 255, .14); font: 600 13px/1 var(--titulo); letter-spacing: .18em; text-transform: uppercase;
}
.titulo-entrada { font: 700 clamp(44px, 13vw, 64px)/.95 var(--titulo); margin: 6px 0 14px; letter-spacing: -.01em; }
.destaque { color: var(--sol); display: inline-block; animation: pulsar 2.4s ease-in-out infinite; }
.sub { font-size: 16px; line-height: 1.45; opacity: .9; margin: 0 auto 24px; max-width: 360px; }

form { background: rgba(255, 255, 255, .1); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border: 1px solid rgba(255, 255, 255, .18); border-radius: 28px; padding: 22px 18px 18px; text-align: left; }
.campo { display: block; margin-bottom: 16px; }
.campo > span { display: block; font-weight: 800; font-size: 14px; margin: 0 0 7px 4px; }
.campo input {
  width: 100%; border: 2px solid transparent; border-radius: 16px; padding: 14px 16px; font: 700 17px var(--texto);
  color: var(--tinta); background: #fff; outline: none; transition: border-color .2s, box-shadow .2s;
}
.campo input:focus { border-color: var(--sol); box-shadow: 0 0 0 4px rgba(255, 201, 60, .3); }
.campo input[type="date"] { min-height: 54px; appearance: none; -webkit-appearance: none; }
.cpf { display: flex; align-items: center; gap: 8px; }
.cpf .digitos { width: 118px; flex: none; text-align: center; font: 700 28px var(--titulo); letter-spacing: .3em; padding: 10px 0 10px .3em; }
.cpf .digitos::placeholder { color: #c9d3e0; }
.cpf-resto { font: 700 22px var(--titulo); letter-spacing: .06em; opacity: .55; margin-left: 4px; }
.erro { background: #fff; color: #b3261e; border-radius: 14px; padding: 12px 14px; font-weight: 700; font-size: 14px; margin: 0 0 14px; animation: tremer .4s; }
.privacidade { font-size: 12.5px; line-height: 1.45; opacity: .8; margin: 14px 4px 0; }

.botao {
  border: 0; border-radius: 999px; padding: 16px 22px; font: 700 18px var(--titulo); display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: transform .15s, box-shadow .15s; text-decoration: none;
}
.botao:active { transform: scale(.97); }
.botao.principal { width: 100%; background: var(--sol); color: var(--tinta); box-shadow: 0 8px 0 #d99d0b, 0 14px 30px rgba(0, 0, 0, .25); }
.botao.principal:active { box-shadow: 0 3px 0 #d99d0b; transform: translateY(5px); }
.botao .carregando { display: none; width: 20px; height: 20px; border-radius: 50%; border: 3px solid rgba(16, 33, 61, .25); border-top-color: var(--tinta); animation: girar .8s linear infinite; }
.botao.ocupado .carregando { display: inline-block; }
.botao.ocupado .rotulo { opacity: .7; }

.bolhas span { position: absolute; font-size: 34px; opacity: .35; animation: flutuar 9s ease-in-out infinite; }
.bolhas span:nth-child(1) { left: 6%; top: 12%; }
.bolhas span:nth-child(2) { right: 8%; top: 8%; animation-delay: -2s; font-size: 26px; }
.bolhas span:nth-child(3) { left: 10%; bottom: 14%; animation-delay: -4s; }
.bolhas span:nth-child(4) { right: 6%; bottom: 22%; animation-delay: -1s; font-size: 40px; }
.bolhas span:nth-child(5) { left: 46%; top: 3%; animation-delay: -6s; font-size: 22px; }
.bolhas span:nth-child(6) { right: 18%; top: 40%; animation-delay: -3s; font-size: 24px; }
.bolhas span:nth-child(7) { left: 3%; top: 48%; animation-delay: -5s; }
.bolhas span:nth-child(8) { right: 40%; bottom: 3%; animation-delay: -7s; font-size: 28px; }

/* ---------- Abrindo ---------- */
#abrindo { flex-direction: column; align-items: center; justify-content: center; gap: 18px; text-align: center; padding: 24px; }
.abrindo-icone { font-size: 84px; animation: quicar 1s ease-in-out infinite; filter: drop-shadow(0 12px 18px rgba(0, 0, 0, .3)); }
#abrindo-texto { font: 600 22px var(--titulo); min-height: 1.4em; }

/* ---------- Stories ---------- */
#story { align-items: center; justify-content: center; background: #000; }
.moldura {
  position: relative; width: 100%; height: 100dvh; overflow: hidden; touch-action: none; overscroll-behavior: none; user-select: none; -webkit-user-select: none;
  max-width: calc(100dvh * 9 / 16);
}
@media (min-width: 600px) {
  #story { background: radial-gradient(circle at 50% 30%, #0a3c78, #01142e); }
  .moldura { height: min(94dvh, 900px); max-width: calc(min(94dvh, 900px) * 9 / 16); border-radius: 28px; box-shadow: 0 30px 80px rgba(0, 0, 0, .5); }
}
.barras { position: absolute; top: 0; left: 0; right: 0; z-index: 6; display: flex; gap: 4px; padding: max(10px, env(safe-area-inset-top)) 10px 0; }
.barra { flex: 1; height: 3.5px; border-radius: 3px; background: rgba(255, 255, 255, .35); overflow: hidden; }
.barra i { display: block; height: 100%; width: 0; background: #fff; border-radius: 3px; }
.barra.feita i { width: 100%; }
.tema-claro .barra { background: rgba(16, 33, 61, .18); }
.tema-claro .barra i { background: var(--tinta); }
.tema-claro .botao-icone { background: rgba(16, 33, 61, .12); color: var(--tinta); }
.topo-story { position: absolute; z-index: 6; top: calc(max(10px, env(safe-area-inset-top)) + 12px); left: 12px; right: 8px; display: flex; align-items: center; gap: 4px; }
.mini-logo { height: 30px; background: #fff; border-radius: 999px; padding: 4px 10px; margin-right: auto; }
.botao-icone { background: rgba(0, 0, 0, .18); color: #fff; border: 0; width: 38px; height: 38px; border-radius: 50%; font-size: 15px; font-weight: 800; }

.zona { position: absolute; z-index: 4; top: 70px; bottom: 0; background: transparent; border: 0; -webkit-tap-highlight-color: transparent; }
.zona.voltar { left: 0; width: 32%; }
.zona.avancar { right: 0; width: 68%; }
.sem-zonas .zona { display: none; }

#slides { position: absolute; inset: 0; }
.slide {
  position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center;
  padding: 96px 26px 76px; opacity: 0; visibility: hidden; overflow: hidden;
  transform: translateY(14%);
  transition: opacity .45s ease, transform .6s cubic-bezier(.2, .8, .2, 1), visibility 0s .6s;
}
.slide.antes { transform: translateY(-14%); }
.slide.ativo { opacity: 1; visibility: visible; transform: none; transition: opacity .45s ease, transform .6s cubic-bezier(.2, .8, .2, 1); z-index: 2; }
.slide .entra { opacity: 0; }
.slide.ativo .entra { animation: subir .8s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(var(--d, 0) * 1s); }
.slide.ativo .estoura { animation: estourar .7s cubic-bezier(.3, 1.6, .5, 1) both; animation-delay: calc(var(--d, 0) * 1s); }
.slide .estoura { opacity: 0; }

.kicker { font: 600 15px var(--titulo); letter-spacing: .14em; text-transform: uppercase; opacity: .85; margin: 0 0 12px; }
.grande { font: 700 clamp(36px, 10vw, 50px)/1.02 var(--titulo); margin: 0 0 16px; letter-spacing: -.01em; }
.gigante { font: 700 clamp(120px, 38vw, 190px)/.9 var(--titulo); margin: 6px 0; letter-spacing: -.04em; text-shadow: 0 10px 0 rgba(0, 0, 0, .12); }
.texto { font-size: 18px; line-height: 1.45; margin: 0 auto; max-width: 330px; }
.texto b { font-weight: 800; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 22px; }
.chip { background: rgba(255, 255, 255, .92); color: var(--tinta); border-radius: 999px; padding: 10px 16px; font: 600 17px var(--titulo); box-shadow: 0 6px 16px rgba(0, 0, 0, .12); }
.emoji-hero { font-size: 92px; line-height: 1; margin-bottom: 10px; filter: drop-shadow(0 12px 16px rgba(0, 0, 0, .2)); }
.slide.ativo .emoji-hero.anima { animation: estourar .8s cubic-bezier(.3, 1.6, .5, 1) both, balancar 3s 1s ease-in-out infinite; }

/* Seta "role para baixo" */
.seta {
  position: absolute; z-index: 6; left: 50%; bottom: calc(10px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: none; border: 0; color: #fff; display: flex; flex-direction: column; align-items: center; gap: 0; padding: 6px 18px;
  font: 600 12px var(--titulo); letter-spacing: .14em; text-transform: uppercase; opacity: .9; animation: chamar 1.6s ease-in-out infinite;
}
.seta span { margin-bottom: 4px; text-shadow: 0 1px 6px rgba(0, 0, 0, .25); }
.seta i { display: block; width: 14px; height: 14px; border-right: 3px solid currentColor; border-bottom: 3px solid currentColor; transform: rotate(45deg); margin-top: -5px; border-radius: 2px; }
.seta i + i { opacity: .55; }
.tema-claro .seta { color: var(--tinta); }
.selo-demo { display: none; position: absolute; z-index: 6; top: calc(max(10px, env(safe-area-inset-top)) + 58px); left: 12px; background: var(--coral); color: #fff; font: 700 11px var(--titulo); letter-spacing: .1em; text-transform: uppercase; padding: 4px 10px; border-radius: 999px; }
.modo-demo .selo-demo { display: block; }

/* Fundos */
.s-intro { background: radial-gradient(130% 90% at 50% 10%, #1576d6 0%, var(--azul) 45%, var(--azul-escuro) 100%); }
.s-total { background: linear-gradient(160deg, #5fd3ad 0%, var(--verde) 45%, #1f8a6c 100%); }
.s-dia { background: linear-gradient(165deg, #ff9b7a 0%, var(--coral) 50%, #e2525a 100%); }
.s-hit { background: radial-gradient(120% 80% at 50% 30%, #2a2f7a 0%, #141842 60%, #090b24 100%); }
.s-meses { background: linear-gradient(170deg, #c3b6ff 0%, var(--lilas) 50%, #7a63f0 100%); }
.s-album { background: var(--creme); color: var(--tinta); }
.s-nivel { background: radial-gradient(120% 90% at 50% 20%, #ffe28a 0%, var(--sol) 45%, #ffa630 100%); color: var(--tinta); }
.s-missao { background: linear-gradient(160deg, var(--verde) 0%, #2a8bb0 55%, var(--azul) 100%); }
.s-final { background: radial-gradient(130% 90% at 50% 0%, #1576d6 0%, var(--azul) 50%, var(--azul-escuro) 100%); padding-top: 84px; padding-bottom: 24px; justify-content: flex-start; }
.s-vazio { background: linear-gradient(160deg, #7ad6ff 0%, #3a9ae0 50%, var(--azul) 100%); }

/* Decorações flutuantes nos slides */
.deco { position: absolute; font-size: 30px; opacity: .5; animation: flutuar 8s ease-in-out infinite; pointer-events: none; }

/* Dia combo */
.pilulas { display: flex; flex-direction: column; gap: 10px; margin-top: 22px; width: 100%; max-width: 320px; }
.pilula { background: #fff; color: var(--tinta); border-radius: 18px; padding: 12px 16px; font: 600 18px var(--titulo); display: flex; align-items: center; gap: 10px; box-shadow: 0 6px 0 rgba(0, 0, 0, .12); }
.slide.ativo .pilula { animation: cair .7s cubic-bezier(.3, 1.5, .5, 1) both; animation-delay: calc(var(--d, 0) * 1s); }
.slide .pilula { opacity: 0; }

/* Hit */
.disco { width: 210px; height: 210px; border-radius: 50%; position: relative; margin: 8px auto 26px;
  background: repeating-radial-gradient(circle, #1b1b1b 0 2px, #262626 2px 5px); box-shadow: 0 20px 50px rgba(0, 0, 0, .5); }
.disco::after { content: '💉'; position: absolute; inset: 31%; border-radius: 50%; display: grid; place-items: center; font-size: 34px; background: radial-gradient(circle, var(--sol) 0 55%, var(--coral) 56%); }
.slide.ativo .disco { animation: estourar .8s both, girar 4s .8s linear infinite; }
.ranking { font: 700 22px var(--titulo); color: var(--sol); margin: 0; }

/* Meses */
.grafico { display: grid; grid-template-columns: repeat(12, 1fr); gap: 5px; align-items: end; height: 190px; width: 100%; max-width: 360px; margin: 22px auto 6px; }
.coluna { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 5px; }
.coluna .b { width: 100%; border-radius: 8px 8px 4px 4px; background: rgba(255, 255, 255, .55); height: 0; transition: height 1s cubic-bezier(.2, .9, .3, 1.2); min-height: 4px; }
.coluna.top .b { background: var(--sol); box-shadow: 0 0 20px rgba(255, 201, 60, .7); }
.coluna small { font: 600 11px var(--titulo); opacity: .85; }
.coluna .n { font: 700 13px var(--titulo); opacity: 0; transition: opacity .3s 1s; }
.slide.ativo .coluna .n { opacity: 1; }

/* Álbum */
.album { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; width: 100%; max-width: 350px; margin: 18px auto 0; }
.album.muitas { grid-template-columns: repeat(4, 1fr); gap: 8px; }
.figurinha { background: #fff; border-radius: 16px; padding: 10px 4px 8px; box-shadow: 0 6px 0 #ead9bb, 0 10px 18px rgba(0, 0, 0, .06); border: 2px solid #f0e2c8; }
.figurinha .e { font-size: 34px; display: block; line-height: 1.1; }
.album.muitas .figurinha .e { font-size: 28px; }
.figurinha small { display: block; font: 600 11.5px/1.15 var(--titulo); color: var(--azul); margin-top: 4px; }
.slide .figurinha { opacity: 0; }
.slide.ativo .figurinha { animation: virar .7s cubic-bezier(.3, 1.4, .5, 1) both; animation-delay: calc(var(--d, 0) * 1s); }
.s-album .kicker { color: var(--verde); opacity: 1; }
.s-album .grande span { color: var(--azul); }

/* Nível */
.trofeu { font-size: 110px; line-height: 1; }
.slide.ativo .trofeu { animation: estourar .9s cubic-bezier(.3, 1.6, .5, 1) both, balancar 3s 1s ease-in-out infinite; }
.nivel-numero { font: 700 20px var(--titulo); margin: 10px 0 4px; }
.nivel-titulo { font: 700 clamp(32px, 9vw, 44px)/1.05 var(--titulo); margin: 4px 0 22px; }
.xp { width: 100%; max-width: 320px; height: 26px; border-radius: 999px; background: rgba(16, 33, 61, .15); overflow: hidden; margin: 0 auto 10px; box-shadow: inset 0 3px 0 rgba(0, 0, 0, .08); }
.xp i { display: block; height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg, var(--coral), #ff4f8b); transition: width 1.6s cubic-bezier(.2, .9, .3, 1) .6s; }
.estrelas { font-size: 30px; letter-spacing: 6px; margin-bottom: 8px; }

/* Missão */
.cartao-missao { background: #fff; color: var(--tinta); border-radius: 26px; padding: 22px 20px; width: 100%; max-width: 330px; margin: 18px auto 0; box-shadow: 0 12px 0 rgba(0, 0, 0, .12); }
.cartao-missao .vac { font: 700 26px/1.1 var(--titulo); color: var(--azul); margin: 4px 0; }
.cartao-missao .quando { font: 600 17px var(--titulo); color: var(--verde); }
.botao.whats { background: #25d366; color: #fff; margin-top: 18px; box-shadow: 0 6px 0 #179c4a; position: relative; z-index: 5; }

/* Final */
.previa { width: 100%; max-width: 250px; aspect-ratio: 9 / 16; border-radius: 18px; overflow: hidden; box-shadow: 0 18px 40px rgba(0, 0, 0, .45); background: rgba(255, 255, 255, .1); margin: 0 auto 14px; flex-shrink: 0; }
.previa.feed { aspect-ratio: 4 / 5; max-width: 290px; }
.previa img { width: 100%; height: 100%; display: block; }
.acoes { position: relative; z-index: 5; width: 100%; max-width: 360px; display: flex; flex-direction: column; gap: 10px; }
.linha-acoes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.botao.rede { padding: 12px 0; font-size: 14px; flex-direction: column; gap: 2px; background: rgba(255, 255, 255, .14); color: #fff; border-radius: 18px; }
.botao.rede b { font-size: 22px; line-height: 1; }
.alternador { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
.alternador button { border: 2px solid rgba(255, 255, 255, .35); background: transparent; color: #fff; border-radius: 999px; padding: 7px 12px; font: 600 13px var(--titulo); }
.alternador button[aria-pressed="true"] { background: #fff; color: var(--azul); border-color: #fff; }
.link-simples { background: none; border: 0; color: #fff; opacity: .8; text-decoration: underline; font-weight: 700; font-size: 14px; padding: 6px; }
.aviso { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); background: #fff; color: var(--tinta); padding: 12px 18px; border-radius: 999px; font-weight: 800; opacity: 0; transition: .3s; z-index: 60; pointer-events: none; }
.aviso.mostrar { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Animações ---------- */
@keyframes subir { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: none; } }
@keyframes estourar { 0% { opacity: 0; transform: scale(.3) rotate(-8deg); } 70% { opacity: 1; transform: scale(1.08) rotate(2deg); } 100% { opacity: 1; transform: none; } }
@keyframes cair { from { opacity: 0; transform: translateY(-60px) rotate(-6deg); } to { opacity: 1; transform: none; } }
@keyframes virar { 0% { opacity: 0; transform: scale(.3) rotate(-14deg); } 70% { opacity: 1; transform: scale(1.1) rotate(3deg); } 100% { opacity: 1; transform: none; } }
@keyframes flutuar { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-18px) rotate(8deg); } }
@keyframes balancar { 0%, 100% { transform: rotate(-5deg); } 50% { transform: rotate(5deg); } }
@keyframes quicar { 0%, 100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-22px) scale(1.06); } }
@keyframes pulsar { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }
@keyframes girar { to { transform: rotate(360deg); } }
@keyframes chamar { 0%, 100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, 8px); } }
@keyframes tremer { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
@media (max-height: 700px) {
  .gigante { font-size: 110px; }
  .emoji-hero { font-size: 70px; }
  .grande { font-size: 34px; }
  .previa { max-width: 190px; }
}
