.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.enfeite,
.flutuante,
.passarela__item,
.progresso__salto,
.carro__svg,
.aviso__laco,
.rsvp__icone,
.queda {
  fill: currentColor;
}

.sprite .sprite__escuro {
  fill: var(--ameixa);
}

.sprite .sprite__claro {
  fill: var(--branco);
}

.sprite .sprite__ouro {
  fill: var(--ouro);
}

.sprite .sprite__vidro {
  fill: var(--algodao);
}

.sprite .sprite__traco {
  fill: none;
  stroke-width: 3;
  stroke-linecap: round;
}

.sprite .sprite__traco--escuro {
  stroke: var(--ameixa);
}

.sprite .sprite__traco--claro {
  stroke: var(--branco);
  stroke-width: 2.5;
}

body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto;
  height: env(safe-area-inset-top, 0px);
  z-index: 60;
  background: var(--rosa-escuro);
}

.pagina {
  position: relative;
  z-index: 1;
}

.progresso {
  position: fixed;
  top: env(safe-area-inset-top, 0px);
  left: 0;
  right: 0;
  z-index: 60;
  height: 6px;
  background: var(--rosa-escuro);
  pointer-events: none;
}

.progresso__barra {
  height: 100%;
  background: linear-gradient(90deg, var(--chiclete), var(--ouro), var(--branco));
  transform-origin: left center;
  transform: scaleX(var(--progresso, 0));
}

.progresso__salto {
  position: absolute;
  top: -2px;
  left: 0;
  width: 26px;
  height: 26px;
  color: var(--chiclete);
  filter: drop-shadow(0 2px 2px var(--sombra));
  transform: translateX(calc(var(--progresso, 0) * (100vw - 30px)));
}

.flutuantes {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.flutuante {
  position: absolute;
  opacity: 0.9;
  filter: drop-shadow(0 6px 10px var(--sombra));
  animation: boiar 7s ease-in-out infinite alternate;
}

.flutuante--1 { top: 12%; left: 4%; width: 64px; height: 64px; color: var(--branco); }
.flutuante--2 { top: 30%; right: 5%; width: 46px; height: 46px; color: var(--chiclete); animation-duration: 5s; }
.flutuante--3 { top: 55%; left: 6%; width: 70px; height: 70px; color: var(--ameixa); animation-duration: 8s; }
.flutuante--4 { top: 72%; right: 4%; width: 60px; height: 60px; color: var(--algodao); animation-duration: 6s; }
.flutuante--5 { top: 6%; right: 14%; width: 34px; height: 34px; color: var(--ouro); animation-duration: 4s; }
.flutuante--6 { top: 88%; left: 12%; width: 52px; height: 52px; color: var(--chiclete); animation-duration: 9s; }
.flutuante--7 { top: 44%; left: 16%; width: 30px; height: 30px; color: var(--branco); animation-duration: 5.5s; }
.flutuante--8 { top: 64%; right: 16%; width: 28px; height: 28px; color: var(--ouro); animation-duration: 4.5s; }

@keyframes boiar {
  from { transform: translate3d(0, var(--py, 0px), 0) rotate(-10deg); }
  to { transform: translate3d(0, calc(var(--py, 0px) - 18px), 0) rotate(10deg); }
}

.enfeite {
  position: absolute;
  top: 92px;
  width: 44px;
  height: 44px;
  animation: balancar 3.2s ease-in-out infinite;
}

.enfeite--oculos {
  left: 7%;
  color: var(--rosa);
}

.enfeite--salto {
  right: 7%;
  color: var(--rosa);
  animation-delay: 1.6s;
}

@keyframes balancar {
  0%, 100% { transform: rotate(-12deg) translateY(0); }
  50% { transform: rotate(10deg) translateY(-6px); }
}

.coroa-botao.balanca {
  animation: tremer 0.35s ease-in-out;
}

.coroa-botao.girando {
  animation: girar 1s cubic-bezier(0.3, 1.6, 0.5, 1);
}

@keyframes tremer {
  0%, 100% { transform: rotate(0); }
  25% { transform: rotate(-14deg) scale(1.1); }
  75% { transform: rotate(14deg) scale(1.1); }
}

@keyframes girar {
  from { transform: rotate(0) scale(1); }
  50% { transform: rotate(200deg) scale(1.6); }
  to { transform: rotate(360deg) scale(1); }
}

.convite__nome .letra {
  display: inline-block;
  animation: entrar 0.7s cubic-bezier(0.3, 1.5, 0.5, 1) both;
  animation-delay: calc(var(--i) * 60ms);
}

.convite__nome .letra--espaco {
  width: 0.3em;
}

.convite__nome.dancando .letra {
  animation: pular 0.6s ease-in-out both;
  animation-delay: calc(var(--i) * 70ms);
}

@keyframes entrar {
  from { transform: translateY(0.4em) scale(0.6) rotate(-10deg); }
  to { transform: none; }
}

@keyframes pular {
  0%, 100% { transform: translateY(0); }
  40% { transform: translateY(-0.35em) rotate(-8deg); }
}

.idade__numero {
  transition: transform 0.2s;
}

.idade__numero.segurando {
  transform: scale(1.25) rotate(-8deg);
  transition-duration: 0.8s;
}

.passarela {
  overflow: hidden;
  padding-block: 10px;
  background: repeating-linear-gradient(90deg, var(--rosa) 0 16px, var(--chiclete) 16px 32px);
}

.passarela__trilho {
  display: flex;
  gap: 22px;
  width: max-content;
  animation: desfile 26s linear infinite;
}

.passarela__item {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  color: var(--branco);
  filter: drop-shadow(0 2px 0 var(--rosa-escuro));
}

@keyframes desfile {
  to { transform: translateX(-50%); }
}

.estrada {
  position: relative;
  height: 54px;
  margin-top: 6px;
  background: linear-gradient(180deg, transparent 0 70%, var(--rosa-escuro) 70% 100%);
  overflow: hidden;
}

.estrada::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 7px;
  height: 2px;
  background: repeating-linear-gradient(90deg, var(--ouro) 0 14px, transparent 14px 28px);
}

.carro {
  position: absolute;
  bottom: 6px;
  left: -90px;
  width: 78px;
  height: 44px;
  padding: 0;
  background: none;
  border: 0;
  color: var(--chiclete);
  cursor: pointer;
  animation: dirigir 9s linear infinite;
  -webkit-tap-highlight-color: transparent;
}

.carro:focus-visible {
  outline: 3px solid var(--ouro);
  outline-offset: 2px;
}

.carro__svg {
  width: 100%;
  height: 100%;
  animation: quicar 0.45s ease-in-out infinite alternate;
  transform-origin: 20% 90%;
}

.carro.empinando .carro__svg {
  animation: empinar 0.8s ease-in-out;
}

@keyframes dirigir {
  from { left: -90px; }
  to { left: 100%; }
}

@keyframes quicar {
  from { transform: translateY(0); }
  to { transform: translateY(-2px); }
}

@keyframes empinar {
  0%, 100% { transform: rotate(0); }
  30%, 70% { transform: rotate(-18deg); }
}

.aviso__laco {
  position: absolute;
  top: -18px;
  right: 16px;
  width: 44px;
  height: 44px;
  color: var(--rosa);
  transform: rotate(12deg);
}

.rsvp__titulo {
  font-size: clamp(1.55rem, 7vw, 2rem);
}

.rsvp__icone {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  color: var(--chiclete);
  animation: pulsar 1.4s ease-in-out infinite;
}

@keyframes pulsar {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.2); }
}

html.anima .revelar {
  transition: transform 0.7s cubic-bezier(0.2, 0.9, 0.3, 1.2), opacity 0.7s ease;
}

html.anima .revelar:not(.visivel) {
  opacity: 0.35;
  transform: translateY(30px) scale(0.97);
}

.rodape {
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

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

.chuva {
  position: fixed;
  inset: 0;
  z-index: 69;
  overflow: hidden;
  pointer-events: none;
}

.queda {
  position: absolute;
  top: -70px;
  left: var(--x, 50%);
  width: var(--tam, 40px);
  height: var(--tam, 40px);
  color: var(--cor, var(--rosa));
  filter: drop-shadow(0 4px 6px var(--sombra));
  animation: cair var(--dur, 3s) linear forwards;
}

@keyframes cair {
  from { transform: translateY(0) rotate(0); }
  to { transform: translateY(calc(100vh + 140px)) rotate(var(--giro, 360deg)); }
}

.toast {
  position: fixed;
  left: 0;
  right: 0;
  width: fit-content;
  margin-inline: auto;
  bottom: calc(100px + env(safe-area-inset-bottom, 0px));
  z-index: 80;
  max-width: calc(100% - 32px);
  padding: 12px 22px;
  border-radius: 24px;
  font-weight: 800;
  text-align: center;
  color: var(--branco);
  background: var(--ameixa);
  border: 2px solid var(--chiclete);
  border-radius: 999px;
  box-shadow: 0 10px 30px var(--sombra);
  text-wrap: balance;
  animation: surgir 0.4s cubic-bezier(0.3, 1.5, 0.5, 1);
}

@keyframes surgir {
  from { transform: translateY(30px) scale(0.8); opacity: 0; }
  to { transform: none; opacity: 1; }
}

html.glitter body {
  background-image:
    radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.7) 0 2px, transparent 3px),
    radial-gradient(circle at 80% 60%, rgba(255, 255, 255, 0.7) 0 2px, transparent 3px),
    linear-gradient(120deg, #E4258C, #FF8CC6, #D9A441, #FF8CC6, #E4258C);
  background-size: 60px 60px, 90px 90px, 400% 400%;
  animation: glitter 6s ease infinite;
}

html.glitter .convite__nome {
  background: linear-gradient(90deg, var(--rosa), var(--ouro), var(--chiclete), var(--rosa));
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: none;
  animation: glitter 3s linear infinite;
}

@keyframes glitter {
  0% { background-position: 0 0, 0 0, 0% 50%; }
  50% { background-position: 30px 30px, -45px 45px, 100% 50%; }
  100% { background-position: 60px 60px, -90px 90px, 0% 50%; }
}

@media (max-width: 420px) {
  .enfeite {
    top: 96px;
    width: 36px;
    height: 36px;
  }

  .enfeite--oculos {
    left: 5%;
  }

  .enfeite--salto {
    right: 5%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .passarela__trilho,
  .carro {
    animation: none !important;
  }

  .carro {
    left: calc(50% - 39px);
  }
}
