/* ════════ scene 1 · the booster pack ════════ */
.pack-header {
  margin-top: clamp(18px, 5vh, 56px);
  text-align: center;
  color: #e8ecff;
  user-select: none;
}
.pack-kicker {
  font-family: var(--hand-body);
  font-size: 17px;
  letter-spacing: 5px;
  text-transform: uppercase;
  color: #8f9bd4;
}
.pack-title {
  font-size: clamp(30px, 5vw, 46px);
  font-weight: 900;
  letter-spacing: 6px;
  background: linear-gradient(100deg, #ffe9b0, #fff, #b7c4ff, #ffe9b0);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: title-shimmer 5s linear infinite;
}
@keyframes title-shimmer { to { background-position: 200% 0; } }

.pack-stage {
  position: relative;
  margin-top: clamp(10px, 4vh, 44px);
  width: 340px;
  height: 470px;
}

.pack {
  position: absolute;
  inset: 0;
  animation: pack-float 4.2s ease-in-out infinite;
  filter: drop-shadow(0 30px 34px rgba(0, 0, 0, 0.55));
  touch-action: none;
}
.pack.tearing { animation: none; }
.pack.gone { transition: transform 0.7s ease-in, opacity 0.7s ease-in; transform: translateY(90px) rotate(7deg) scale(0.92); opacity: 0; }
@keyframes pack-float {
  0%, 100% { transform: translateY(0) rotate(-0.6deg); }
  50% { transform: translateY(-10px) rotate(0.7deg); }
}

.pack-layer {
  position: absolute;
  inset: 0;
}
.pack-layer svg { display: block; width: 100%; height: 100%; }

.pack-body { z-index: 1; }
.pack-strip { z-index: 2; will-change: clip-path, transform; }
.pack-strip.torn { z-index: 3; filter: drop-shadow(0 6px 6px rgba(0, 0, 0, 0.45)); }

/* the torn strip flying away */
.strip-flyer {
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
}
.strip-flyer svg { display: block; width: 100%; height: 100%; }

.tear-hit {
  position: absolute;
  left: -14px;
  right: -14px;
  top: 6px;
  height: 118px;
  z-index: 5;
  cursor: grab;
  touch-action: none;
}
.tear-hit.grabbing { cursor: grabbing; }
.pack.opened .tear-hit { display: none; }

/* glow leaking out of the torn opening */
.pack-glow {
  position: absolute;
  left: 8%;
  right: 8%;
  top: 52px;
  height: 60px;
  z-index: 0;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 224, 130, 0.95), rgba(255, 200, 90, 0.35), transparent);
  opacity: 0;
  transform: scaleY(0.4);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.pack.opened .pack-glow {
  opacity: 1;
  transform: scaleY(1);
  animation: glow-pulse 1.6s ease-in-out infinite;
  z-index: 4;
}
@keyframes glow-pulse { 50% { opacity: 0.6; } }

/* paper bits while tearing */
.tear-bit {
  position: absolute;
  width: 5px;
  height: 5px;
  background: #efe6d2;
  border-radius: 1px;
  z-index: 7;
  pointer-events: none;
}

.tear-hint {
  margin-top: 40px;
  font-family: var(--hand-body);
  font-size: 19px;
  color: #aeb8e8;
  user-select: none;
  transition: opacity 0.4s ease;
}
.tear-hint .hint-hand { display: inline-block; animation: hint-nudge 1.6s ease-in-out infinite; }
.tear-hint .hint-arrow { display: inline-block; animation: hint-slide 1.6s ease-in-out infinite; }
.tear-hint.off { opacity: 0; }
@keyframes hint-nudge { 50% { transform: translateX(8px) rotate(10deg); } }
@keyframes hint-slide { 50% { transform: translateX(10px); } }

/* burst layer: cards fly around in viewport space */
.burst-layer {
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
}
.burst-layer .card { position: absolute; left: 0; top: 0; }

/* golden rays behind the legendary reveal */
.rays {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 1200px;
  height: 1200px;
  margin: -600px 0 0 -600px;
  border-radius: 50%;
  background: repeating-conic-gradient(
    rgba(255, 216, 115, 0.22) 0deg 9deg,
    transparent 9deg 24deg
  );
  mask-image: radial-gradient(circle, black 0%, transparent 62%);
  -webkit-mask-image: radial-gradient(circle, black 0%, transparent 62%);
  opacity: 0;
  transform: scale(0.35);
  transition: opacity 0.5s ease, transform 0.9s ease;
  pointer-events: none;
  z-index: 0;
}
.rays.on {
  opacity: 1;
  transform: scale(1);
  animation: rays-spin 14s linear infinite;
}
@keyframes rays-spin { to { rotate: 360deg; } }

.flash {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 50% 42%, rgba(255, 240, 200, 0.95), rgba(255, 255, 255, 0.6) 40%, transparent 75%);
  opacity: 0;
  pointer-events: none;
  z-index: 80;
}
.flash.pop { animation: flash-pop 0.55s ease-out; }
@keyframes flash-pop { 12% { opacity: 1; } 100% { opacity: 0; } }
