.abertura {
  --img-proporcao: 1408 / 768;
  --centro-x: 50%;
  --centro-y: 39%;
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  background: #02060f;
  overflow: hidden;
  cursor: pointer;
}

.abertura-fundo {
  position: absolute;
  inset: -40px;
  background: url("../img/abertura.jpg") center / cover no-repeat;
  filter: blur(28px) brightness(0.45);
  opacity: 0;
}

.abertura-palco {
  position: relative;
  width: min(92vw, calc(80vh * var(--img-proporcao)));
  aspect-ratio: var(--img-proporcao);
  opacity: 0;
}
.abertura-palco img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 14px;
  box-shadow: 0 0 60px rgba(59, 140, 255, 0.25), 0 20px 60px rgba(0, 0, 0, 0.6);
}

.abertura-onda {
  position: absolute;
  left: var(--centro-x);
  top: var(--centro-y);
  width: 30%;
  aspect-ratio: 1;
  border: 3px solid rgba(90, 170, 255, 0.9);
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(0.3);
  opacity: 0;
  pointer-events: none;
  box-shadow: 0 0 18px rgba(59, 140, 255, 0.8), inset 0 0 18px rgba(59, 140, 255, 0.5);
}

.abertura-brilho {
  position: absolute;
  inset: 0;
  border-radius: 14px;
  overflow: hidden;
  pointer-events: none;
}
.abertura-brilho::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 14%;
  left: -50%;
  background: linear-gradient(100deg, transparent, rgba(180, 220, 255, 0.32), transparent);
  mix-blend-mode: screen;
  transform: skewX(-18deg);
}

.abertura-carregando {
  position: relative;
  width: min(260px, 60vw);
  height: 3px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
  opacity: 0;
}
.abertura-carregando::after {
  content: "";
  position: absolute;
  inset: 0;
  width: 0;
  background: linear-gradient(90deg, #1a5fd0, #6fb4ff);
  box-shadow: 0 0 10px #3b8cff;
}
html.abertura-ativa, html.abertura-ativa body { overflow: hidden; }

.abertura-dica {
  position: absolute;
  bottom: max(18px, env(safe-area-inset-bottom));
  color: rgba(159, 176, 200, 0.6);
  font: 12px "Segoe UI", Arial, sans-serif;
  letter-spacing: 0.04em;
  opacity: 0;
}

.abertura.pronta .abertura-fundo        { animation: ab-fundo 1.2s ease-out forwards; }
.abertura.pronta .abertura-palco        { animation: ab-entrada 1.1s cubic-bezier(.2, .8, .2, 1) forwards; }
.abertura.pronta .abertura-palco img    { animation: ab-pancada 0.42s ease-out 1.25s 3; }
.abertura.pronta .abertura-onda         { animation: ab-onda 1.1s ease-out forwards; }
.abertura.pronta .abertura-onda:nth-of-type(1) { animation-delay: 1.25s; }
.abertura.pronta .abertura-onda:nth-of-type(2) { animation-delay: 1.67s; }
.abertura.pronta .abertura-onda:nth-of-type(3) { animation-delay: 2.09s; }
.abertura.pronta .abertura-brilho::before { animation: ab-brilho 1s ease-in-out 2.6s forwards; }
.abertura.pronta .abertura-carregando   { animation: ab-aparecer 0.4s ease-out 0.6s forwards; }
.abertura.pronta .abertura-carregando::after { animation: ab-barra 3s ease-in-out 0.6s forwards; }
.abertura.pronta .abertura-dica         { animation: ab-aparecer 0.6s ease-out 1.2s forwards; }

.abertura.saindo {
  animation: ab-saida 0.7s ease-in forwards;
  pointer-events: none;
}

@keyframes ab-fundo    { to { opacity: 1; } }
@keyframes ab-aparecer { to { opacity: 1; } }
@keyframes ab-entrada {
  from { opacity: 0; transform: scale(1.12); filter: blur(14px) brightness(0.3); }
  to   { opacity: 1; transform: scale(1);    filter: blur(0) brightness(1); }
}
@keyframes ab-pancada {
  0%   { transform: scale(1);     filter: brightness(1); }
  18%  { transform: scale(1.035); filter: brightness(1.35) saturate(1.2); }
  100% { transform: scale(1);     filter: brightness(1); }
}
@keyframes ab-onda {
  0%   { opacity: 0.95; transform: translate(-50%, -50%) scale(0.3); }
  100% { opacity: 0;    transform: translate(-50%, -50%) scale(3.4); }
}
@keyframes ab-brilho { to { left: 110%; } }
@keyframes ab-barra  { to { width: 100%; } }
@keyframes ab-saida {
  to { opacity: 0; transform: scale(1.06); filter: blur(6px); }
}

@media (prefers-reduced-motion: reduce) {
  .abertura.pronta .abertura-palco { animation: ab-aparecer 0.6s ease-out forwards; }
  .abertura.pronta .abertura-palco img,
  .abertura.pronta .abertura-onda,
  .abertura.pronta .abertura-brilho::before { animation: none; }
  .abertura.saindo { animation: ab-aparecer 0.4s reverse forwards; }
}
