/* Splash de abertura — Cabana Boemia (~2,5s) */
html.cb-sem-splash #cb-splash { display: none; }
html.cb-travado, html.cb-travado body { overflow: hidden; }

#cb-splash {
  --cb-vermelho: #d7261e;
  --cb-creme: #fbf5ea;
  position: fixed; inset: 0; z-index: 99999;
  display: grid; place-items: center; overflow: hidden;
  background: radial-gradient(circle at 50% 45%, #fffdf8 0%, var(--cb-creme) 60%, #f1e4cf 100%);
  cursor: pointer;
  animation: cb-sai .35s ease 2.15s forwards;
}
/* só anima depois que as imagens carregaram */
#cb-splash:not(.cb-pronto), #cb-splash:not(.cb-pronto) * { animation-play-state: paused !important; }

.cb-palco { width: min(84vw, 520px); animation: cb-encolhe .4s cubic-bezier(.5,0,.75,0) 1.7s forwards; }
.cb-logo { position: relative; aspect-ratio: 3055 / 1091; animation: cb-pop .75s ease-out both; }

.cb-corpo, .cb-brilho {
  position: absolute; left: 0; top: 5.68%; width: 100%; height: 94.32%;
}
.cb-corpo { display: block; filter: drop-shadow(0 10px 18px rgba(120, 20, 10, .25)); }

.cb-brilho {
  pointer-events: none;
  background: linear-gradient(105deg, transparent 42%, rgba(255,255,255,.85) 50%, transparent 58%) no-repeat;
  background-size: 300% 100%; background-position: 150% 0;
  -webkit-mask: url("logo-corpo.webp") center / 100% 100% no-repeat;
          mask: url("logo-corpo.webp") center / 100% 100% no-repeat;
  mix-blend-mode: soft-light;
  animation: cb-brilho .65s ease-in-out 1.0s forwards;
}

.cb-coroa {
  position: absolute; left: 40.39%; top: 0; width: 16.40%;
  filter: drop-shadow(0 3px 4px rgba(150, 110, 20, .35));
  transform-origin: 50% 100%;
  animation: cb-coroa .6s cubic-bezier(.34,1.56,.64,1) .5s both;
}

.cb-faisca {
  position: absolute; width: 3.2%; aspect-ratio: 1;
  background: #f2c94c;
  clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%);
  opacity: 0; transform: scale(0);
  animation: cb-faisca .55s ease-out forwards;
}
.cb-faisca.f1 { left: 37%; top: -6%;  animation-delay: .9s; }
.cb-faisca.f2 { left: 57%; top: -10%; animation-delay: 1.0s; width: 2.4%; }
.cb-faisca.f3 { left: 61%; top: 6%;   animation-delay: 1.1s; width: 2%; }

.cb-onda {
  position: absolute; left: 50%; top: 50%;
  width: 260vmax; aspect-ratio: 1; border-radius: 50%;
  background: var(--cb-vermelho);
  transform: translate(-50%, -50%) scale(0);
  animation: cb-onda .45s cubic-bezier(.7,0,.3,1) 1.7s forwards;
}

/* tocar na tela pula a animação */
#cb-splash.cb-pular { animation: cb-sai .25s ease forwards !important; }

@keyframes cb-pop {
  0%   { transform: scale(.15) rotate(-10deg); opacity: 0; }
  50%  { transform: scale(1.08) rotate(2deg);  opacity: 1; }
  72%  { transform: scale(.96) rotate(-1deg); }
  88%  { transform: scale(1.02) rotate(0); }
  100% { transform: scale(1) rotate(0); }
}
@keyframes cb-coroa {
  0%   { transform: translateY(-140%) rotate(-14deg); opacity: 0; }
  60%  { opacity: 1; }
  100% { transform: none; opacity: 1; }
}
@keyframes cb-brilho  { to { background-position: -50% 0; } }
@keyframes cb-faisca  {
  0% { opacity: 0; transform: scale(0) rotate(0); }
  40% { opacity: 1; transform: scale(1.2) rotate(45deg); }
  100% { opacity: 0; transform: scale(.4) rotate(90deg); }
}
@keyframes cb-encolhe { to { transform: scale(.85); opacity: 0; } }
@keyframes cb-onda    { to { transform: translate(-50%, -50%) scale(1); } }
@keyframes cb-sai     { to { opacity: 0; visibility: hidden; } }

@media (prefers-reduced-motion: reduce) {
  .cb-logo, .cb-coroa, .cb-brilho, .cb-faisca, .cb-onda, .cb-palco { animation: none !important; }
  .cb-faisca, .cb-onda { display: none; }
  #cb-splash { animation-delay: 1.2s; }
}
