.memory-film {
  position: fixed;
  inset: 0;
  box-sizing: border-box;
  padding: env(safe-area-inset-top, 0px) max(5px, env(safe-area-inset-right))
    max(6px, env(safe-area-inset-bottom)) max(5px, env(safe-area-inset-left));
  z-index: 50;
  overflow: hidden;
  touch-action: pan-x pan-y;
  isolation: isolate;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  color: #fff0f6;
  background: linear-gradient(180deg, #101d4b38, transparent 48%, #12224950);
  transition:
    opacity 1.1s ease,
    visibility 1.1s ease;
  font-family: "Segoe UI", sans-serif;
}
.memory-film.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.memory-film__header {
  position: absolute;
  top: 3%;
  left: 12%;
  right: 12%;
  text-align: center;
  z-index: 3;
}
.memory-film__heading {
  position: relative;
  display: inline-block;
  margin: 0;
  color: #fff1e2;
  font:
    700 clamp(28px, 4.8vw, 68px) / 1.25 "Dancing Script",
    cursive;
  text-shadow:
    0 1px 1px #f2b9aa,
    0 0 12px #f7a6c74d;
}
.memory-film__title-text {
  color: #fff0d9;
  background: linear-gradient(180deg, #fff9fc 18%, #fff4e6 60%, #f7d39b);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.memory-film__title-flourish {
  position: absolute;
  width: 108%;
  height: 0.65em;
  left: -4%;
  bottom: -0.4em;
  overflow: visible;
  pointer-events: none;
  fill: none;
  stroke: #ffe6be;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 3px #f4a5b8aa);
}
.memory-film__stage {
  position: absolute;
  top: 17%;
  bottom: 13%;
  left: 2%;
  width: 96%;
  z-index: 2;
  touch-action: pan-y;
  user-select: none;
  cursor: grab;
}
.memory-film__belt {
  position: absolute;
  inset: 0;
}
.memory-film__ribbon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  overflow: visible;
  pointer-events: none;
}
.memory-film__aura {
  filter: blur(7px);
  opacity: 0.65;
}
.memory-film__card {
  position: absolute;
  top: 50%;
  left: 50%;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
  visibility: hidden;
  cursor: pointer;
}
.memory-film__photo {
  display: none;
}
.memory-film__stage.is-dragging,
.memory-film__stage.is-dragging .memory-film__card {
  cursor: grabbing;
}
.memory-film__controls {
  position: absolute;
  top: 87%;
  height: 7%;
  left: 30%;
  right: 30%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(20px, 3vw, 48px);
  z-index: 4;
}
.memory-film__controls button {
  flex: none;
  display: grid;
  place-items: center;
  border: 1px solid #ffe2d5;
  color: #fff6e9;
  border-radius: 50%;
  background: #22345d7a;
  cursor: pointer;
  padding: 0;
  width: clamp(32px, 5vh, 48px);
  height: clamp(32px, 5vh, 48px);
  font:
    300 32px/1 Georgia,
    serif;
}
.memory-film__controls .memory-film__pause {
  width: clamp(38px, 6.4vh, 60px);
  height: clamp(38px, 6.4vh, 60px);
  background: linear-gradient(140deg, #e7a0ae, #ac647e);
  box-shadow:
    0 0 14px #ffc4b855,
    inset 0 0 8px #fff2d844;
  font: 18px/1 sans-serif;
}
.memory-film__pause-bars {
  width: 13px;
  height: 19px;
  border-left: 5px solid currentColor;
  border-right: 5px solid currentColor;
  box-sizing: border-box;
  border-radius: 1px;
}
.memory-film button:disabled {
  opacity: 0.35;
  cursor: default;
}
.memory-film button:focus-visible,
.memory-film__stage:focus-visible {
  outline: 2px solid #fff4d2;
  outline-offset: 4px;
}
.memory-film__status {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
.memory-film__decor {
  position: absolute;
  left: 0;
  top: 0;
  width: 0;
  height: auto;
  z-index: 4;
  pointer-events: none;
}
.memory-film__light {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}
/* Give the available mobile viewport to the photographs, including landscape
   windows shortened by browser chrome. */
@media (max-width: 600px),
  (max-height: 500px) and (orientation: landscape),
  (pointer: coarse) and (max-width: 1100px) {
  .memory-film__header {
    top: max(4px, env(safe-area-inset-top));
    left: 8%;
    right: 8%;
  }
  .memory-film__heading {
    font-size: clamp(18px, 4.8vh, 24px);
    line-height: 1.25;
  }
  .memory-film__stage {
    top: max(38px, calc(env(safe-area-inset-top) + 34px));
    bottom: max(42px, calc(env(safe-area-inset-bottom) + 40px));
    height: auto;
    left: 3%;
    width: 94%;
  }
  .memory-film__controls {
    top: auto;
    bottom: max(8px, env(safe-area-inset-bottom));
    height: 34px;
    left: 25%;
    right: 25%;
    gap: 18px;
  }
  .memory-film__controls button {
    width: 30px;
    height: 30px;
    font-size: 23px;
  }
  .memory-film__controls .memory-film__pause {
    width: 34px;
    height: 34px;
    font-size: 13px;
  }
  .memory-film__pause-bars {
    height: 13px;
    width: 10px;
    border-width: 3px;
  }
}
@media (orientation: landscape) and (max-height: 500px),
  (orientation: landscape) and (pointer: coarse) and (max-width: 1100px) {
  .memory-film__stage {
    --fit-film-width: 1;
    bottom: max(34px, calc(env(safe-area-inset-bottom) + 32px));
  }
}
@media (max-width: 600px) and (orientation: portrait) {
  .memory-film__header {
    top: max(20px, env(safe-area-inset-top));
  }
  .memory-film__heading {
    font-size: clamp(20px, 6vw, 26px);
  }
  .memory-film__stage {
    top: 96px;
    bottom: max(100px, calc(env(safe-area-inset-bottom) + 90px));
  }
  .memory-film__controls {
    bottom: max(40px, env(safe-area-inset-bottom));
    left: 24%;
    right: 10%;
  }
}
@media (prefers-reduced-motion: reduce) {
  .memory-film,
  .memory-film__card {
    transition: opacity 0.15s;
  }
}
