/* 锯齿封口卡包与手势撕封物理效果（对齐参考视频） */

.foil-pack {
  position: relative;
  width: 178px;
  height: 238px;
  border-radius: 8px;
  background:
    radial-gradient(circle at 28% 20%, rgba(255, 255, 255, 0.35), transparent 45%),
    linear-gradient(155deg, #c74133 0%, #9b261b 52%, #6d1812 100%);
  box-shadow:
    inset 0 0 0 1.5px rgba(245, 200, 92, 0.5),
    0 18px 34px rgba(55, 16, 12, 0.3);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: transform 0.28s var(--ease-overshoot), box-shadow 0.28s ease;
  overflow: visible;
}

.pack-preview {
  animation: packFloat 3.2s ease-in-out infinite;
}

.hero-pack-wrap:hover .pack-preview {
  transform: translateY(-4px) scale(1.03);
}

.pack-serrated-top,
.pack-serrated-bottom {
  position: absolute;
  left: 0;
  right: 0;
  height: 11px;
  pointer-events: none;
}

.pack-serrated-top {
  top: -8px;
  background:
    linear-gradient(135deg, transparent 50%, #c74133 50%) 0 0 / 12px 11px repeat-x,
    linear-gradient(225deg, transparent 50%, #c74133 50%) 0 0 / 12px 11px repeat-x;
}

.pack-serrated-bottom {
  bottom: -8px;
  background:
    linear-gradient(45deg, transparent 50%, #6d1812 50%) 0 0 / 12px 11px repeat-x,
    linear-gradient(315deg, transparent 50%, #6d1812 50%) 0 0 / 12px 11px repeat-x;
}

.pack-tear-line {
  position: absolute;
  top: 26px;
  left: 8px;
  right: 8px;
  border-top: 1.5px dashed rgba(255, 232, 185, 0.55);
}

.pack-sheen {
  position: absolute;
  inset: 0;
  border-radius: 8px;
  background: linear-gradient(115deg, transparent 25%, rgba(255, 248, 225, 0.28) 48%, transparent 72%);
  background-size: 220% 220%;
  animation: sheenSweep 4s ease-in-out infinite;
  pointer-events: none;
}

.pack-body-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding-top: 12px;
}

.pack-seal-badge {
  width: 68px;
  height: 68px;
  border-radius: 16px;
  background: #fff9ef;
  display: grid;
  place-items: center;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.22);
  transform: rotate(-4deg);
}

.pack-seal-badge.lg {
  width: 86px;
  height: 86px;
  border-radius: 20px;
}

.pack-seal-ring {
  width: 78%;
  height: 78%;
  border-radius: 12px;
  border: 2px solid var(--crimson);
  display: grid;
  place-items: center;
}

.pack-seal-char {
  font-family: var(--font-serif);
  font-size: 32px;
  font-weight: 700;
  color: var(--crimson);
}

.pack-seal-badge.lg .pack-seal-char {
  font-size: 40px;
}

.pack-title-cn {
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 700;
  color: #fff6e5;
  letter-spacing: 0.08em;
}

.pack-title-sub {
  font-size: 9px;
  letter-spacing: 0.16em;
  color: rgba(255, 232, 185, 0.78);
}

/* 暗场撕包放大版 */
.tear-pack-stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.tear-pack {
  width: 236px;
  height: 326px;
  --tear-progress: 0;
  transition: transform 0.25s var(--ease-overshoot);
}

/* 稀有度边缘呼吸光晕（严格对齐参考视频） */
.tear-pack[data-rarity="LR"] {
  box-shadow: 0 0 36px rgba(0, 229, 184, 0.55), 0 0 70px rgba(246, 185, 59, 0.25);
}
.tear-pack[data-rarity="UR"] {
  box-shadow: 0 0 34px rgba(246, 185, 59, 0.6);
}
.tear-pack[data-rarity="SSR"] {
  box-shadow: 0 0 30px rgba(192, 108, 255, 0.55);
}
.tear-pack[data-rarity="SR"] {
  box-shadow: 0 0 26px rgba(56, 189, 248, 0.5);
}
.tear-pack[data-rarity="R"] {
  box-shadow: 0 0 22px rgba(255, 220, 175, 0.3);
}

.tear-pack.is-anticipation {
  transform: scale(0.95) rotate(-1.2deg);
}

.tear-pack.is-bursting {
  transform: scale(1.08);
  opacity: 0;
  transition: transform 0.28s var(--ease-out-expo), opacity 0.26s ease;
}

.tear-pack-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 999px;
  background: rgba(20, 14, 10, 0.55);
  border: 1px solid rgba(245, 200, 92, 0.55);
  color: #fde68a;
}

/* 顶部封条：自左向右逐段撕开。已撕开的部分被裁掉，前沿为锯齿 */
.tear-top-strip {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 46px;
  border-radius: 8px 8px 0 0;
  background: linear-gradient(160deg, #d74a3a, #a62b1f);
  border-bottom: 1px solid rgba(255, 232, 185, 0.45);
  z-index: 12;
  display: flex;
  align-items: center;
  justify-content: center;
  --tx: calc(var(--tear-progress) * 100%);
  clip-path: polygon(
    var(--tx) 0, 100% 0, 100% 100%,
    calc(var(--tx) + 5px) 100%, calc(var(--tx) - 2px) 87%,
    calc(var(--tx) + 6px) 74%, calc(var(--tx) - 3px) 61%,
    calc(var(--tx) + 5px) 48%, calc(var(--tx) - 2px) 35%,
    calc(var(--tx) + 6px) 22%, calc(var(--tx) - 3px) 10%
  );
  pointer-events: none;
}

/* 被撕下的卷边：跟随撕裂前沿，越到末尾翘得越高 */
.tear-flap {
  position: absolute;
  top: -6px;
  left: calc(var(--tear-progress) * 100% - 14px);
  width: 30px;
  height: 40px;
  z-index: 13;
  background: linear-gradient(150deg, #e0584a, #a62b1f);
  border-radius: 2px 18px 2px 14px;
  transform-origin: left bottom;
  transform:
    translateY(calc(var(--tear-progress) * -26px))
    rotate(calc(var(--tear-progress) * -38deg));
  opacity: calc(min(var(--tear-progress) * 6, 1));
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}

/* 缝口涌出的垂直光幕：宽度跟随进度 */
.tear-curtain {
  position: absolute;
  left: 0;
  top: -84px;
  height: 90px;
  width: calc(var(--tear-progress) * 100%);
  z-index: 11;
  background: repeating-linear-gradient(90deg, rgba(255, 236, 170, 0.95) 0 2px, rgba(255, 236, 170, 0) 2px 7px);
  -webkit-mask-image: linear-gradient(to top, #000 0%, transparent 100%);
  mask-image: linear-gradient(to top, #000 0%, transparent 100%);
  opacity: calc(var(--tear-progress) * 1.2);
  filter: drop-shadow(0 0 8px rgba(255, 220, 140, 0.9));
  pointer-events: none;
}

/* 撕裂过程中包体光晕随进度变色：冷 → 暖 → 高稀有度色（对齐参考视频） */
.tear-pack[data-heat="cool"] {
  box-shadow: 0 0 30px rgba(80, 200, 255, 0.55);
}
.tear-pack[data-heat="warm"] {
  box-shadow: 0 0 36px rgba(255, 205, 80, 0.75);
}

.strip-label {
  font-size: 11px;
  font-weight: 700;
  color: rgba(255, 240, 210, 0.85);
  letter-spacing: 0.15em;
}

/* 撕裂缝线与手柄 */
.tear-seam {
  position: absolute;
  top: 40px;
  left: -8px;
  right: -8px;
  height: 28px;
  z-index: 20;
  display: flex;
  align-items: center;
}

.seam-dash {
  position: absolute;
  left: 10px;
  right: 10px;
  height: 2px;
  border-top: 2px dashed rgba(255, 238, 198, 0.72);
}

.seam-glow {
  position: absolute;
  left: 10px;
  height: 6px;
  width: calc(var(--tear-progress) * 92%);
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.95), #f5c85c, #00e5b8);
  box-shadow: 0 0 18px #fde68a, 0 0 30px #00e5b8;
  pointer-events: none;
}

.tear-handle {
  position: relative;
  left: calc(6px + var(--tear-progress) * 204px);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid #fff7e2;
  background: rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(4px);
  display: grid;
  place-items: center;
  cursor: grab;
  touch-action: none;
  box-shadow: 0 0 16px rgba(255, 240, 200, 0.65);
}

.tear-handle:active {
  cursor: grabbing;
  transform: scale(1.1);
}

.handle-core {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 10px #fff;
}

@keyframes packFloat {
  0%, 100% { transform: translateY(0px) rotate(-0.8deg); }
  50% { transform: translateY(-6px) rotate(0.8deg); }
}

@keyframes sheenSweep {
  0% { background-position: 180% 0; }
  60%, 100% { background-position: -80% 0; }
}
