.post-story-movie[hidden] {
  display: none;
}

.post-story-movie {
  position: fixed;
  inset: 0;
  z-index: 13000;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(42, 20, 52, 0.72);
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease;
}

.post-story-movie.open {
  opacity: 1;
  pointer-events: auto;
}

.post-story-shell {
  position: relative;
  display: grid;
  grid-template-columns: minmax(260px, 480px) minmax(270px, 360px);
  gap: 0;
  width: min(94vw, 880px);
  max-height: min(92vh, 760px);
  overflow: hidden;
  border: 3px solid rgba(255, 223, 118, 0.9);
  border-radius: 8px;
  background: #fff8fb;
  box-shadow: 0 24px 70px rgba(45, 15, 55, 0.34);
}

.post-story-close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 5;
  width: 44px;
  height: 44px;
  border: 2px solid rgba(87, 36, 83, 0.18);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.94);
  color: #682554;
  font-size: 1.2rem;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 6px 16px rgba(62, 24, 68, 0.16);
}

.post-story-stage {
  position: relative;
  align-self: center;
  justify-self: center;
  width: min(42vw, 360px);
  aspect-ratio: var(--post-story-frame-aspect, 217 / 372);
  overflow: hidden;
  background: #201226;
  box-shadow:
    inset 0 0 0 3px rgba(255, 255, 255, 0.42),
    0 12px 30px rgba(63, 22, 70, 0.18);
}

.post-story-movie[data-story="crownGlow"] .post-story-stage {
  width: min(38vw, 330px);
}

.post-story-sheet,
.post-story-film-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.post-story-sheet {
  background-image: var(--post-story-sheet);
  background-position: 0 0;
  background-repeat: no-repeat;
  background-size: 1000% 100%;
  animation: post-story-sheet-play var(--post-story-duration, 12s)
    steps(9, end) 1 forwards;
}

.post-story-film-glow {
  background:
    linear-gradient(
      90deg,
      rgba(255, 244, 190, 0.18),
      transparent 16% 84%,
      rgba(255, 244, 190, 0.16)
    ),
    linear-gradient(180deg, rgba(255, 255, 255, 0.12), transparent 32%);
  mix-blend-mode: screen;
}

.post-story-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
  min-width: 0;
  padding: 28px 24px 24px;
  border-left: 2px solid rgba(255, 214, 113, 0.58);
  color: #542049;
}

.post-story-kicker {
  color: #8b3d75;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.post-story-copy h2 {
  margin: 0;
  color: #62254f;
  font-size: 1.65rem;
  line-height: 1.12;
}

.post-story-copy p {
  margin: 0;
  color: #6c365e;
  font-size: 1rem;
  line-height: 1.4;
}

.post-story-evidence {
  padding: 10px 12px;
  border: 2px solid rgba(139, 61, 117, 0.18);
  border-radius: 8px;
  background: rgba(255, 244, 202, 0.72);
  color: #542049;
  font-size: 0.9rem;
  font-weight: 850;
}

.post-story-controls {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 6px;
}

.post-story-controls button {
  min-height: 48px;
  padding: 0 18px;
  border: 0;
  border-radius: 8px;
  background: #ffe47c;
  color: #552246;
  font-weight: 900;
  box-shadow: 0 8px 18px rgba(92, 34, 82, 0.16);
}

.post-story-controls .post-story-done {
  background: #ff7eb3;
  color: #fff;
}

.post-story-controls .post-story-replay {
  background: #8fe7d0;
  color: #234d51;
}

.post-story-close:focus-visible,
.post-story-controls button:focus-visible {
  outline: 4px solid rgba(105, 55, 150, 0.35);
  outline-offset: 3px;
}

@keyframes post-story-sheet-play {
  from {
    background-position: 0 0;
  }
  to {
    background-position: 100% 0;
  }
}

@media (max-width: 760px) {
  .post-story-movie {
    padding: 10px;
  }

  .post-story-shell {
    grid-template-columns: 1fr;
    width: min(96vw, 430px);
    max-height: 95vh;
  }

  .post-story-stage {
    width: min(68vw, 280px);
    margin: 12px auto 0;
  }

  .post-story-movie[data-story="crownGlow"] .post-story-stage {
    width: min(62vw, 255px);
  }

  .post-story-copy {
    padding: 14px;
    border-top: 2px solid rgba(255, 214, 113, 0.58);
    border-left: 0;
  }

  .post-story-copy h2 {
    font-size: 1.25rem;
  }

  .post-story-copy p {
    font-size: 0.95rem;
  }

  .post-story-evidence {
    padding: 8px 10px;
    font-size: 0.84rem;
  }
}

@media (max-height: 680px) and (min-width: 761px) {
  .post-story-stage {
    width: min(36vw, 320px);
  }

  .post-story-copy {
    padding: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .post-story-sheet {
    animation: none;
    background-position: 100% 0;
  }
}
