/*
 * Abertura do painel. Mora em public/ e entra por <link> no index.html: chega
 * junto com o documento, sem esperar o bundle. O painel é uma SPA e o
 * RootLoader ainda resolve a sessão antes da primeira rota — sem isto, essa
 * janela inteira é tela branca.
 *
 * Sem texto de propósito: fonte de sistema numa marca com display próprio
 * denuncia que o app ainda não carregou. O mascote pulando faz o trabalho.
 */
#splash {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  background: #fff7ee;
  transition:
    opacity 320ms ease,
    transform 320ms ease;
}

#splash[data-leaving="true"] {
  opacity: 0;
  transform: scale(1.04);
}

/* Respiro de luz atrás do mascote: dá profundidade sem desenhar nada. */
#splash::before {
  content: "";
  position: absolute;
  width: min(64vw, 320px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(255, 138, 51, 0.28) 0%,
    rgba(255, 107, 0, 0.1) 42%,
    transparent 68%
  );
  animation: splash-glow 2.8s ease-in-out infinite;
}

.splash-stage {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 1.1rem;
  animation: splash-enter 420ms cubic-bezier(0.2, 0.9, 0.3, 1) both;
}

.splash-hop {
  position: relative;
  width: 200px;
  height: 200px;
  display: grid;
  place-items: end center;
}

.splash-hop img {
  width: 200px;
  height: 200px;
  transform-origin: 50% 78%;
  animation: splash-jump 1.5s cubic-bezier(0.5, 0.05, 0.5, 0.95) infinite;
}

/* A sombra é o que vende o salto: encolhe e clareia quando ele sobe. O SVG tem
   margem interna, então ela sobe até onde os pés do mascote realmente estão. */
.splash-shade {
  position: absolute;
  bottom: 30px;
  width: 92px;
  height: 12px;
  border-radius: 50%;
  background: rgba(232, 84, 12, 0.22);
  filter: blur(3px);
  animation: splash-shade 1.5s cubic-bezier(0.5, 0.05, 0.5, 0.95) infinite;
}

.splash-dots {
  display: flex;
  gap: 7px;
}

.splash-dots i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ffcda6;
  animation: splash-dot 1.2s ease-in-out infinite;
}

.splash-dots i:nth-child(2) {
  animation-delay: 0.16s;
}

.splash-dots i:nth-child(3) {
  animation-delay: 0.32s;
}

@keyframes splash-enter {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.94);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes splash-jump {
  0% {
    transform: translateY(0) scale(1.06, 0.94) rotate(0deg);
  }
  18% {
    transform: translateY(-38px) scale(0.95, 1.06) rotate(-3deg);
  }
  46% {
    transform: translateY(-44px) scale(0.97, 1.03) rotate(2deg);
  }
  72% {
    transform: translateY(0) scale(1.08, 0.92) rotate(0deg);
  }
  86% {
    transform: translateY(-6px) scale(1, 1) rotate(0deg);
  }
  100% {
    transform: translateY(0) scale(1.06, 0.94) rotate(0deg);
  }
}

@keyframes splash-shade {
  0%,
  72%,
  100% {
    transform: scale(1);
    opacity: 0.75;
  }
  18%,
  46% {
    transform: scale(0.62);
    opacity: 0.3;
  }
}

@keyframes splash-dot {
  0%,
  100% {
    transform: translateY(0);
    background: #ffcda6;
  }
  40% {
    transform: translateY(-7px);
    background: #ff6b00;
  }
}

@keyframes splash-glow {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.85;
  }
  50% {
    transform: scale(1.08);
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  #splash::before,
  .splash-stage,
  .splash-hop img,
  .splash-shade {
    animation: none;
  }

  .splash-dots i {
    animation: splash-dot-fade 1.4s ease-in-out infinite;
  }

  @keyframes splash-dot-fade {
    0%,
    100% {
      opacity: 0.35;
    }
    40% {
      opacity: 1;
    }
  }
}
