#stage,
#stage-large {
  container-type: size;
}

.preview-head {
  justify-content: flex-end;
}

.gift-art {
  position: relative;
  isolation: isolate;
  width: 100%;
  width: min(100%, 164cqh);
  aspect-ratio: 1.64;
  --line-left: 4%;
  --line-width: 35%;
  --line-floor: 8%;
  --seam: -3.1%;
  --box-width: 70%;
  --box-right: 1.8%;
  --box-floor: 6%;
}
.gift-art[data-count="1"] {
  --line-left: 12%; --line-width: 21%;
  --box-width: 71%; --box-right: 3%;
}
.gift-art[data-count="4"] {
  --line-left: 17%; --line-width: 66%; --line-floor: 3%; --seam: -1.7%;
  --box-width: 71%; --box-floor: 16%;
}
.gift-art[data-count="8"] {
  --line-left: 3.5%; --line-width: 93%; --line-floor: 4%; --seam: -.9%;
  --box-width: 73%; --box-floor: 14.5%;
}
.gift-art::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: auto 1% 0;
  height: 23%;
  border-radius: 50%;
  background: radial-gradient(ellipse, #310c1b33, transparent 70%);
}
.gift-art img { position: relative; display: block; width: 100%; -webkit-user-drag: none; }
.gift-box {
  position: absolute;
  isolation: isolate;
  right: var(--box-right); bottom: var(--box-floor); width: var(--box-width);
  z-index: 1;
}
.gift-box::before {
  content: "";
  position: absolute;
  left: 3%; right: 3%; bottom: 7%; height: 13%;
  border-radius: 50%; z-index: -1;
  background: #2106106b; filter: blur(clamp(3px,1.05cqw,7px));
  transform: rotate(12deg);
}
.gift-lineup, .hero-pouches {
  position: absolute;
  z-index: 2;
  display: flex;
  align-items: flex-end;
  left: var(--line-left); bottom: var(--line-floor); width: var(--line-width);
}
.gift-pouch, .hero-pouches .pouch {
  flex: 1 1 0;
  min-width: 0;
  position: relative;
  isolation: isolate;
}
.gift-pouch + .gift-pouch, .hero-pouches .pouch + .pouch { margin-left: var(--seam,-3.1%); }
.gift-pouch::before, .hero-pouches .pouch::before {
  content: "";
  position: absolute;
  width: 92%; height: 3%; left: 4%; bottom: 1%;
  border-radius: 50%;
  z-index: -1;
  background: #280e1cb3;
  filter: blur(clamp(1.5px,.5cqw,4px));
}
.gift-note {
  position: absolute;
  right: 3.5%;
  bottom: 3%;
  z-index: 4;
  width: 23%;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  overflow-wrap: anywhere;
  white-space: pre-line;
  padding: clamp(4px, 1.5cqw, 10px);
  border: 1px solid #d6bb92;
  border-radius: 1px;
  background: #ffebc5;
  color: #61263a;
  box-shadow: 0 3px 8px #2b0a1c66;
  font: italic clamp(.65rem, 3cqw, 1rem)/1.2 var(--serif);
  transform: rotate(-5deg);
}

#image-dialog .stage {
  height: min(64dvh, 56vw, 475px);
}

#stage-large .gift-note {
  -webkit-line-clamp: 5;
}

.hero-still {
  --line-left: 4%;
  --line-floor: 12%;
  --line-width: 42%;
}
.hero-still .h-box {
  width: 57%;
  left: 42%;
  bottom: 3%;
  z-index: 1;
}
.hero-still .h-box::after { height: 10%; bottom: 9%; filter: blur(7px); }

@media (max-width: 700px) {
  .preview > .stage {
    height: clamp(150px, 23vh, 240px);
  }

  .step {
    scroll-margin-top: calc(clamp(150px, 23vh, 240px) + 55px);
  }

  .hero-still { --line-left: 4%; --line-floor: 12%; --line-width: 40%; }
  .hero-still .h-box { width: 56%; left: 42%; bottom: 2%; }
}

@media (max-height: 550px) and (max-width: 850px) {
  .preview > .stage {
    height: 230px;
  }

  .step {
    scroll-margin-top: 1em;
  }
}
