.entrance {
  position: fixed;
  inset: 0;
  max-width: none;
  max-height: none;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  overflow: hidden;
  background: transparent;
  color: #f4d68e;
}

.entrance::backdrop { background: transparent; }

.entrance-scene {
  position: absolute;
  inset: 0;
  isolation: isolate;
  overflow: hidden;
  background: radial-gradient(ellipse at 50% 64%, #24190c, #0a0908 48%, #050505 78%);
}

.entrance-dust { position: absolute; inset: 0; }
.entrance-dust i {
  position: absolute;
  top: var(--y);
  left: var(--x);
  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  background: #ffd480;
  box-shadow: 0 0 9px 1px #da9a41;
  animation: entrance-drift 5s var(--offset) infinite alternate ease-in-out;
}

.entrance-set {
  --vial-width: clamp(62px, 11vh, 99px);
  animation: entrance-stage-dim .8s 4.87s both;
  position: absolute;
  top: 63%;
  left: 50%;
  width: min(77vw, 580px);
  height: min(20vw, 120px);
  transform: translate(-50%, -50%);
  perspective: 750px;
  transform-style: preserve-3d;
}

.entrance-platform {
  position: absolute;
  inset: 0;
  border-radius: 49%;
  border: 1px solid #5d492b;
  transform: rotateX(55deg);
  background: #141310 url('/assets/vial-hero-1100.webp') center bottom / 100% auto;
  box-shadow: inset 0 0 38px #000, 0 12px 0 #080706, 0 14px 0 #352819, 0 36px 40px #000;
}

.entrance-wave {
  position: absolute;
  inset: -23% 4%;
  border: 2px solid #ffdc85;
  border-radius: 50%;
  box-shadow: 0 0 28px #ffa93e, inset 0 0 18px #ffc060;
  animation: entrance-wave 1.2s 3.5s both ease-out;
}

.entrance-shadow {
  position: absolute;
  z-index: 1;
  inset: 32% 30%;
  border-radius: 50%;
  background: #000e;
  filter: blur(9px);
  animation: entrance-shadow 3.2s both;
}

.entrance-drop {
  position: absolute;
  z-index: 2;
  left: 50%;
  bottom: 50%;
  width: var(--vial-width);
  height: calc(var(--vial-width) * 2.34);
  margin-left: calc(var(--vial-width) / -2);
  transform-style: preserve-3d;
  animation: entrance-fall 3.65s both;
}

.entrance-vial {
  position: absolute;
  inset: 0;
  animation: entrance-spin 3.65s both;
  filter: drop-shadow(0 0 12px #d7984838);
}

.entrance-vial img {
  position: absolute;
  top: -7.7%;
  left: -92.8%;
  width: 285.7%;
  max-width: none;
  height: auto;
  clip-path: polygon(
    34.2% 8.5%, 34.7% 7.5%, 37.3% 6.6%, 43% 6.2%, 57% 6.2%,
    62.8% 6.6%, 65.4% 7.5%, 65.8% 8.5%, 65.8% 16.2%, 65.2% 17.2%,
    61.9% 18%, 61.9% 23.5%, 62.6% 25.3%, 65.8% 26.8%, 67.1% 29.1%,
    67.4% 32%, 67.5% 81.5%, 66.9% 84%, 65.1% 86%, 61% 87.1%,
    56% 88.1%, 44% 88.1%, 39% 87.1%, 35% 86%, 33% 84%, 32.5% 81.5%,
    32.5% 32%, 33% 29.1%, 34.2% 26.8%, 37.3% 25.3%, 38.1% 23.5%,
    38.1% 18%, 34.8% 17.2%, 34.2% 16.2%
  );
}

.entrance-vial-label {
  position: absolute;
  inset: 59% 4% auto;
  color: #edc77f;
  font: 600 calc(var(--vial-width) * .095)/1.27 Georgia, serif;
  letter-spacing: .085em;
  text-align: center;
  text-transform: uppercase;
}

.entrance-liquid {
  position: absolute;
  inset: 85% 4% 1%;
  border-radius: 0 0 46% 46% / 0 0 48% 48%;
  overflow: hidden;
  isolation: isolate;
  background: linear-gradient(98deg, #10090036, transparent 17% 74%, #fff0b224 84%, #190c0160);
}

.entrance-liquid::before {
  content: '';
  position: absolute;
  inset: 2% -28% -62%;
  border-radius: 47% 38% 14% 10%;
  background:
    radial-gradient(ellipse at 45% 22%, #fff4b4 0%, transparent 34%),
    repeating-conic-gradient(from 35deg at 52% 33%, #7f4206, #f6a626 22deg, #fff0a1 54deg, #a86118 105deg);
  box-shadow: inset 0 2px 3px #fff9d3, 0 0 10px #ffb929;
  animation: entrance-liquid-fill .57s 3.50s both;
}

.entrance-liquid::after {
  content: '';
  position: absolute;
  inset: 41% 5% 0;
  border-radius: 64% 44% 34% 32% / 42% 43% 24% 29%;
  background:
    radial-gradient(circle at 24% 45%, #fff 0 1px, transparent 1.7px),
    radial-gradient(circle at 69% 51%, #aaa8a0 0 .65px, transparent 1.25px),
    radial-gradient(circle at 49% 27%, #fff 0 1px, transparent 1.3px),
    linear-gradient(170deg, #fffef7, #e3e1d9 46%, #8e8c84);
  background-size: 6px 7px, 9px 5px, 11px 7px, 100% 100%;
  box-shadow: inset 0 1px 2px #fff, 0 1px 3px #1917139c;
  animation: entrance-powder-dissolve .33s 3.50s both;
}

.entrance-liquid-neck {
  position: absolute;
  inset: 14% 7% 64%;
  border-radius: 0 0 10% 10%;
  clip-path: polygon(21% 0, 79% 0, 79% 45%, 94% 69%, 100% 95%, 0 95%, 6% 69%, 21% 45%);
  --neck-gold: linear-gradient(98deg, #713905, #f5a52d 27%, #fff2a6 46%, #c76a12 78%, #542604);
  mix-blend-mode: screen;
}

.entrance-liquid-neck::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--neck-gold);
  box-shadow: inset 0 2px 4px #fff2aa;
  animation: entrance-neck-fill 1.45s 3.76s both;
}

.entrance-bubbles {
  --bubble-start: 3.62s;
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.entrance-liquid-neck .entrance-bubbles {
  --bubble-start: 3.93s;
  animation: entrance-neck-fill 1.45s 3.76s both;
}

.entrance-bubbles i {
  position: absolute;
  bottom: 0;
  left: var(--bubble-x);
  width: var(--bubble-size);
  height: var(--bubble-size);
  border: 1px solid #fff6c5;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 24%, #fffbe9 0%, #dc8f2a38 47%, #a65d16a1);
  box-shadow: 0 0 3px #ffc45b;
  animation: entrance-bubble-rise var(--bubble-speed) calc(var(--bubble-start) + var(--bubble-delay)) both ease-out;
}

.entrance-powder {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.entrance-impact,
.entrance-sparks {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.entrance-impact { z-index: 3; }

.entrance-impact::before {
  content: '';
  position: absolute;
  inset: -120% -25%;
  background: radial-gradient(ellipse, #fff2c589, #ffaf3430 35%, transparent 66%);
  animation: entrance-flash .65s 3.5s both;
}

.entrance-sparks i {
  position: absolute;
  top: 50%;
  left: 50%;
}

.entrance-sparks i {
  width: var(--streak);
  height: 2px;
  border-radius: 50%;
  background: linear-gradient(90deg, transparent, #fcb948 50%, #fff1bf);
  box-shadow: 0 0 9px #f6af43;
  animation: entrance-spark var(--duration) var(--delay) both cubic-bezier(.12,.49,.36,1);
}

.entrance-logo-reveal {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  perspective: 850px;
  pointer-events: none;
}

.entrance-logo-reveal img {
  width: min(76vw, 54vh, 440px);
  height: auto;
  box-shadow: 0 0 82px 15px #d9922d44;
  animation: entrance-logo-rush 1.55s 5.02s both;
}

.entrance-skip {
  position: absolute;
  z-index: 3;
  top: max(14px, env(safe-area-inset-top));
  right: max(14px, env(safe-area-inset-right));
  padding: .6rem .75rem;
  border: 1px solid #866b42;
  border-radius: 4px;
  background: #10100e;
  color: #f9e7c0;
  font: 600 .8rem system-ui, sans-serif;
  cursor: pointer;
}
.entrance-skip:focus-visible { outline: 2px solid #ffdc85; outline-offset: 3px; }

@keyframes entrance-stage-dim { to { opacity: .18; } }
@keyframes entrance-logo-rush {
  0% { opacity: 0; transform: translate3d(0, 9vh, -760px) rotateX(16deg) scale(.55); filter: blur(15px); }
  25% { opacity: .76; filter: blur(5px); }
  59% { opacity: 1; transform: translate3d(0, 0, 100px) scale(1.05); filter: blur(0); }
  100% { opacity: 1; transform: translate3d(0, 0, 140px) scale(1.08); filter: blur(0); }
}
@keyframes entrance-drift {
  from { opacity: .13; transform: translate3d(0, 24px, 0); }
  to { opacity: .82; transform: translate3d(17px, -35px, 0); }
}
@keyframes entrance-fall {
  0%, 10% { transform: translate3d(0, -83vh, 0); animation-timing-function: cubic-bezier(.57,0,.8,.41); }
  30% { transform: translate3d(0, -4vh, 75px); animation-timing-function: ease-out; }
  35% { transform: translate3d(0, -7vh, 92px); }
  82% { transform: translate3d(0, -6vh, 92px); animation-timing-function: cubic-bezier(.56,0,.82,.65); }
  96% { transform: translate3d(0, 0, 0); }
  98% { transform: translate3d(0, -4px, 0); }
  100% { transform: translate3d(0, 0, 0); }
}
@keyframes entrance-spin {
  0%, 10% { opacity: 0; transform: rotateY(-360deg) rotateZ(-24deg); }
  14% { opacity: 1; }
  31% { transform: rotateY(0deg) rotateZ(0deg); }
  36% { transform: translateX(-7%) rotateY(-22deg) rotateZ(-26deg); }
  41% { transform: translate(5%, 4%) rotateY(21deg) rotateZ(18deg); }
  48% { transform: translate(8%, -5%) rotateY(27deg) rotateZ(27deg); }
  54% { transform: translate(-6%, -3%) rotateY(-17deg) rotateZ(-20deg); }
  59% { transform: translate(-8%, 4%) rotateY(-24deg) rotateZ(-27deg); }
  65% { transform: translate(6%, 5%) rotateY(23deg) rotateZ(22deg); }
  71% { transform: translate(7%, -3%) rotateY(18deg) rotateZ(18deg); }
  78%, 100% { transform: rotateY(0deg) rotateZ(0deg); }
}
@keyframes entrance-powder-dissolve {
  from { opacity: .96; }
  to { opacity: 0; transform: scaleY(.6); }
}
@keyframes entrance-liquid-fill {
  0% { opacity: 0; transform: translateY(58%) rotate(-17deg); }
  23% { opacity: 1; }
  57% { transform: translateY(-11%) rotate(12deg); }
  82% { transform: translateY(2%) rotate(-5deg); }
  100% { opacity: 1; transform: translateY(0) rotate(0); }
}
@keyframes entrance-neck-fill {
  0% { opacity: 0; clip-path: inset(100% 0 0); }
  10% { opacity: .8; }
  43%, 86% { opacity: .84; clip-path: inset(0); }
  100% { opacity: .28; clip-path: inset(0); }
}
@keyframes entrance-bubble-rise {
  0% { bottom: -10%; opacity: 0; transform: translateX(-2px) scale(.55); }
  24% { opacity: .95; }
  67% { opacity: .85; transform: translateX(2px) scale(1.12); }
  100% { bottom: 100%; opacity: 0; transform: translateX(-1px) scale(.78); }
}
@keyframes entrance-flash {
  0%, 100% { opacity: 0; transform: scale(.65); }
  12% { opacity: .82; transform: scale(1); }
}
@keyframes entrance-spark {
  0% { opacity: 0; transform: translate(0, 0) scaleX(.35); }
  12% { opacity: 1; }
  60% { opacity: .95; transform: translate(calc(var(--x) * .76), var(--y)) rotate(-28deg); }
  100% { opacity: 0; transform: translate(var(--x), calc(var(--y) * .4 + 10vh)) rotate(28deg) scaleX(.45); }
}
@keyframes entrance-wave {
  0% { opacity: 0; transform: scale(.16); }
  10% { opacity: 1; }
  100% { opacity: 0; transform: scale(1.45); }
}
@keyframes entrance-shadow { from { opacity: 0; } to { opacity: .85; } }
@media (max-height: 530px) {
  .entrance-set { --vial-width: clamp(37px, 11vh, 62px); top: 64%; height: 16vh; }
}

@media (prefers-reduced-motion: reduce) {
  .entrance[open] { visibility: hidden; }
}
