/* The existing paper-dot portal starts just after the brass key opens and
   finishes before the following paper-dot section can enter the viewport.
   The original --paper-open value remains untouched for the key/title fades. */
.scrollFinalFlow {
  --paper-open-early: clamp(0, calc((var(--unlock-progress) - .58) * 3.333333), 1);
}

.scrollFinalFlow .rewardPaperPortal {
  /* Keep the existing dot pattern/scale, but let the ellipse reach the top
     edge on tall phones and small tablets before the next chapter appears. */
  height: max(118vmax, 145svh);
  opacity: var(--paper-open-early);
  transform: translate3d(-50%, -50%, 0) scale(calc(.014 + var(--paper-open-early) * 1.06));
}

@media (max-width: 700px) {
  .scrollFinalFlow .rewardPaperPortal {
    height: max(132vmax, 145svh);
  }
}

@media (prefers-reduced-motion: reduce) {
  .scrollFinalFlow .rewardPaperPortal {
    transform: translate3d(-50%, -50%, 0) scale(1.08);
  }
}
