:root {
  --ink: #2f2b3c;
  --muted-ink: #696476;
  --paper: #fffaf0;
  --paper-deep: #f3e8d2;
  --night: #12152e;
  --night-soft: #242851;
  --blue: #5e9ff8;
  --purple: #a986e8;
  --pink: #f08db7;
  --red: #df6d68;
  --silver: #aaaebe;
  --page-radius: 18px 30px 30px 18px;
  --shadow: 0 28px 70px rgb(5 7 24 / 38%);
  font-family:
    "Pretendard", "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic",
    sans-serif;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body,
#game,
#game *,
.game-shell,
.book-frame,
.book,
.page,
.cover,
.story-mode,
.story-visual,
.story-illustration,
.story-caption,
.story-text,
.sticker-page,
.sticker-workspace,
.sticker-scene,
.sticker-tray,
.sticker-card,
.sticker-visual,
.placed-sticker,
.dragging-sticker,
.target-slot,
.cutscene-layer,
.ending-mode,
.credit-watermark,
img {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

body ::selection {
  color: inherit;
  background: transparent;
}

img {
  -webkit-user-drag: none;
  user-drag: none;
  pointer-events: none;
}

button,
button * {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  pointer-events: auto;
}

[hidden] {
  display: none !important;
}

html,
body {
  width: 100%;
  height: 100%;
  min-height: 100%;
  overflow: hidden;
}

body {
  position: relative;
  height: 100dvh;
  min-height: 100dvh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 18% 14%, rgb(123 115 222 / 22%), transparent 24rem),
    radial-gradient(circle at 82% 28%, rgb(92 164 246 / 15%), transparent 26rem),
    linear-gradient(145deg, #0b0d20, #1d2041 58%, #12142d);
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

button {
  font: inherit;
}

button:focus-visible {
  outline: 3px solid #ffe58b;
  outline-offset: 4px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.ambient-stars,
.ambient-stars::before,
.ambient-stars::after {
  position: absolute;
  inset: 0;
  pointer-events: none;
  content: "";
  background-image:
    radial-gradient(circle, rgb(255 255 255 / 90%) 0 1px, transparent 1.8px),
    radial-gradient(circle, rgb(164 196 255 / 70%) 0 1px, transparent 1.6px);
  background-position:
    0 0,
    28px 31px;
  background-size:
    72px 72px,
    110px 110px;
  opacity: 0.34;
}

.ambient-stars::before {
  opacity: 0.24;
}

.ambient-stars::after {
  opacity: 0.12;
}

.game-shell {
  position: relative;
  z-index: 1;
  width: min(1120px, calc(100% - 32px));
  height: 100dvh;
  min-height: 0;
  margin: 0 auto;
  padding:
    max(14px, env(safe-area-inset-top))
    0
    max(46px, calc(env(safe-area-inset-bottom) + 24px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 10px;
}

.game-header {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  color: rgb(255 255 255 / 78%);
}

.eyebrow {
  margin: 0;
  display: grid;
  justify-items: start;
  gap: 2px;
  text-transform: uppercase;
}

.eyebrow-title {
  color: rgb(255 252 239 / 92%);
  font-family: Georgia, "Gowun Batang", "Noto Serif KR", serif;
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.2em;
  text-shadow: 0 0 12px rgb(255 232 164 / 18%);
}

.eyebrow-subtitle {
  color: rgb(255 255 255 / 62%);
  font-size: 0.52rem;
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: 0.14em;
}

.progress-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
}

.progress-track {
  width: 126px;
  height: 7px;
  overflow: hidden;
  border: 1px solid rgb(255 255 255 / 25%);
  border-radius: 99px;
  background: rgb(0 0 0 / 20%);
}

.progress-fill {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #7aaefc, #ef9dc0, #f6c477);
  transition: width 500ms ease;
}

.music-control {
  min-width: 238px;
  padding: 6px 8px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  color: rgb(255 250 235 / 82%);
  border: 1px solid rgb(255 255 255 / 12%);
  border-radius: 999px;
  background: rgb(16 17 39 / 38%);
  box-shadow: 0 5px 18px rgb(4 5 18 / 14%);
  backdrop-filter: blur(8px);
  font-size: 0.67rem;
}

.music-note {
  color: #ffe9a8;
  font-size: 0.82rem;
}

.music-title {
  max-width: 96px;
  overflow: hidden;
  color: #fff8e7;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.music-toggle,
.music-next {
  min-width: 28px;
  height: 25px;
  padding: 0 7px;
  color: inherit;
  border: 1px solid rgb(255 255 255 / 12%);
  border-radius: 999px;
  cursor: pointer;
  background: rgb(255 255 255 / 7%);
}

.music-toggle.is-blocked {
  color: rgb(255 248 232 / 48%);
  border-style: dashed;
  opacity: 0.68;
}

.music-volume-wrap {
  display: flex;
  align-items: center;
  gap: 5px;
  color: rgb(255 250 235 / 54%);
  font-size: 0.58rem;
}

.music-volume {
  width: 64px;
  height: 4px;
  accent-color: #e9c47d;
  cursor: pointer;
}

.music-control.is-playing .music-note {
  animation: music-note-pulse 1.8s ease-in-out infinite;
}

.book-frame {
  position: relative;
  min-height: 0;
  height: 100%;
  perspective: 1800px;
  -webkit-perspective: 1800px;
  isolation: isolate;
}

.book-frame::before {
  position: absolute;
  z-index: -1;
  top: 18px;
  bottom: 14px;
  left: -9px;
  width: 24px;
  content: "";
  border-radius: 16px 4px 4px 16px;
  background:
    linear-gradient(90deg, #b59c78, #eee0c4 35%, #f8ecd5 60%, #957a5b);
  box-shadow:
    -7px 6px 18px rgb(4 5 17 / 30%),
    inset -5px 0 8px rgb(82 56 35 / 20%);
  opacity: 0.82;
}

.book-frame::after {
  position: absolute;
  z-index: -2;
  right: 16px;
  bottom: -8px;
  left: 18px;
  height: 17px;
  content: "";
  border-radius: 0 0 22px 10px;
  background:
    repeating-linear-gradient(
      0deg,
      #e6d4b7 0 2px,
      #fff8e9 2px 4px
    );
  box-shadow: 0 9px 18px rgb(3 4 14 / 30%);
  transform: skewX(-1deg);
}

.book-shadow {
  position: absolute;
  z-index: -1;
  right: 4%;
  bottom: -13px;
  left: 4%;
  height: 52px;
  border-radius: 50%;
  background: rgb(0 0 0 / 42%);
  filter: blur(19px);
}

.book {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: inherit;
  transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d;
  transition: transform 700ms cubic-bezier(0.22, 0.75, 0.16, 1);
}

.book.opening {
  animation: book-open 850ms cubic-bezier(0.18, 0.75, 0.25, 1);
}

.book-frame.ending-transition .book {
  transform-origin: left center;
  animation: book-close-open 650ms cubic-bezier(0.42, 0, 0.2, 1);
}

.page {
  position: absolute;
  inset: 0;
  overflow: hidden;
  visibility: hidden;
  border: 1px solid rgb(87 69 49 / 20%);
  border-radius: var(--page-radius);
  background:
    linear-gradient(rgb(255 255 255 / 48%), rgb(255 255 255 / 10%)),
    repeating-linear-gradient(
      0deg,
      transparent 0 3px,
      rgb(118 91 62 / 2%) 3px 4px
    ),
    var(--paper);
  box-shadow:
    inset 22px 0 35px rgb(91 67 39 / 10%),
    inset 1px 0 rgb(255 255 255 / 80%),
    var(--shadow);
  transform-origin: left center;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.page::after {
  position: absolute;
  inset: 0;
  z-index: 20;
  pointer-events: none;
  content: "";
  opacity: 0.2;
  mix-blend-mode: multiply;
  background-image:
    repeating-linear-gradient(
      7deg,
      transparent 0 3px,
      rgb(91 67 39 / 5%) 3px 4px
    ),
    radial-gradient(circle, rgb(91 67 39 / 8%) 0 0.6px, transparent 0.8px);
  background-size:
    auto,
    9px 9px;
}

.page.current {
  z-index: 3;
  visibility: visible;
}

.page.ready {
  z-index: 2;
  visibility: visible;
}

.page.turning {
  z-index: 5;
  animation: page-turn 820ms cubic-bezier(0.52, 0.02, 0.42, 1) forwards;
}

.page.turning-chapter {
  animation-duration: 1550ms;
}

.book-frame.is-final-turning .page.turning-chapter {
  animation-duration: 3200ms;
}

.page.turning::before {
  position: absolute;
  inset: 0;
  z-index: 30;
  content: "";
  background: linear-gradient(
    90deg,
    transparent 10%,
    rgb(45 34 30 / 8%) 48%,
    rgb(34 25 26 / 44%) 100%
  );
  animation: paper-shadow 820ms ease forwards;
}

.interaction-hint {
  margin: 0;
  color: rgb(255 255 255 / 46%);
  font-family: Georgia, "Batang", serif;
  font-size: 0.68rem;
  letter-spacing: 0.03em;
  text-align: center;
}

.credit-watermark {
  position: fixed;
  z-index: 9999;
  bottom: max(12px, env(safe-area-inset-bottom));
  left: 50%;
  max-width: calc(100% - 24px);
  margin: 0;
  overflow: hidden;
  color: #fff8e7;
  font-family: "Pretendard", "Noto Sans KR", "Apple SD Gothic Neo", sans-serif;
  font-size: clamp(12px, 1vw, 14px);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: 0.025em;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
  opacity: 0.68;
  pointer-events: none;
  user-select: none;
  transform: translateX(-50%);
  text-shadow: 0 1px 6px rgb(7 7 22 / 72%);
}

.cover {
  position: relative;
  height: 100%;
  min-height: inherit;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: #f8f2e3;
  text-align: center;
  background:
    radial-gradient(circle at 50% 38%, rgb(148 177 255 / 18%), transparent 15rem),
    linear-gradient(145deg, #21295a, #11152f 62%, #30315c);
}

.cover::before {
  position: absolute;
  inset: 17px;
  border: 1px solid rgb(255 232 174 / 32%);
  border-radius: 12px 24px 24px 12px;
  content: "";
  box-shadow: inset 0 0 0 6px rgb(255 255 255 / 3%);
}

.cover::after {
  position: absolute;
  inset: 0;
  content: "";
  opacity: 0.58;
  background:
    radial-gradient(circle at 17% 18%, #fff 0 1px, transparent 2px),
    radial-gradient(circle at 75% 22%, #fff 0 1.5px, transparent 2.5px),
    radial-gradient(circle at 68% 72%, #fff 0 1px, transparent 2px),
    radial-gradient(circle at 32% 78%, #fff 0 1.5px, transparent 2.5px);
}

.cover-content {
  position: relative;
  z-index: 2;
  width: min(520px, calc(100% - 50px));
}

.cover-kicker {
  margin: 0 0 18px;
  color: #d8d6ef;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.78rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
}

.cover h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(4.2rem, 12vw, 8.5rem);
  font-weight: 400;
  letter-spacing: 0.08em;
  line-height: 0.9;
  text-shadow:
    0 0 24px rgb(177 197 255 / 25%),
    0 5px 0 rgb(0 0 0 / 14%);
}

.cover-subtitle {
  margin: 22px auto 34px;
  color: rgb(248 242 227 / 68%);
  font-size: 0.9rem;
  letter-spacing: 0.08em;
}

.button-stack {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.paper-button,
.text-button {
  border: 0;
  cursor: pointer;
}

.paper-button {
  position: relative;
  min-width: 170px;
  padding: 13px 22px;
  color: #302d43;
  border-radius: 4px 11px 6px 9px;
  background: #fff6dc;
  box-shadow:
    0 8px 20px rgb(0 0 0 / 25%),
    inset 0 0 0 1px rgb(94 70 42 / 14%);
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    opacity 180ms ease;
}

.paper-button:hover:not(:disabled) {
  transform: translateY(-3px) rotate(-0.4deg);
  box-shadow:
    0 12px 26px rgb(0 0 0 / 27%),
    inset 0 0 0 1px rgb(94 70 42 / 14%);
}

.paper-button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
  filter: grayscale(0.6);
}

.paper-button.secondary {
  color: #f4efff;
  border: 1px solid rgb(255 255 255 / 28%);
  background: rgb(255 255 255 / 9%);
  box-shadow: none;
}

.text-button {
  padding: 8px 10px;
  color: inherit;
  background: transparent;
  text-decoration: underline;
  text-underline-offset: 4px;
  opacity: 0.65;
}

.text-button:hover {
  opacity: 1;
}

.text-button.is-confirming,
.paper-button.is-confirming {
  color: #8b4148;
  border-color: rgb(139 65 72 / 32%);
  background: #fff0e7;
  opacity: 1;
}

.story-mode {
  position: relative;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  display: block;
  cursor: pointer;
  background: var(--paper);
}

.story-mode:focus-visible {
  outline: 4px solid #ffe58b;
  outline-offset: -6px;
}

.story-mode.is-fading-to-video {
  pointer-events: none;
}

.story-mode.is-fading-to-stars {
  pointer-events: none;
}

.story-mode.is-fading-to-plli {
  pointer-events: none;
}

.story-mode.is-fading-to-video .story-visual {
  animation: story-fade-to-video 900ms ease forwards;
}

.story-mode.is-fading-to-stars .story-visual {
  animation: story-fade-to-video 700ms ease forwards;
}

.story-mode.is-fading-to-plli .story-visual {
  animation: story-fade-to-night 2s ease-in-out forwards;
}

.story-mode.is-soft-leaving .story-visual,
.story-mode.is-auto-advancing .story-visual {
  animation: story-soft-leave 500ms ease forwards;
}

.story-visual {
  position: relative;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  background-color: #242851;
  contain: layout paint;
}

.story-visual::before {
  display: none;
}

.chapter-background-frame {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  pointer-events: none;
  background: #242851;
  contain: size layout paint;
}

.chapter-background-image {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: cover;
  object-position: center center;
  animation: none !important;
  transform: none !important;
}

.story-visual::after {
  position: absolute;
  z-index: 1;
  inset: 0;
  content: "";
  pointer-events: none;
  background:
    linear-gradient(180deg, transparent 62%, rgb(31 24 38 / 18%)),
    radial-gradient(circle at 50% 38%, transparent 40%, rgb(16 13 31 / 12%));
}

.story-illustration {
  position: absolute;
  z-index: 3;
  top: clamp(28px, 5%, 46px);
  right: 4%;
  bottom: 40%;
  left: 4%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.story-illustration-image {
  display: block;
  width: auto;
  height: auto;
  max-width: 78%;
  max-height: 100%;
  object-fit: contain;
  filter:
    drop-shadow(0 18px 22px rgb(32 24 44 / 24%))
    saturate(0.98);
  opacity: 0.98;
  mix-blend-mode: normal;
  animation: story-illustration-settle 9s ease-in-out infinite;
}

.story-illustration-book-cover {
  top: clamp(28px, 5%, 44px);
  bottom: 42%;
}

.story-illustration-book-cover .story-illustration-image {
  max-width: min(44%, 320px);
  max-height: 86%;
  border-radius: 0;
  box-shadow: none;
  filter:
    drop-shadow(0 18px 24px rgb(18 12 34 / 24%))
    saturate(0.98);
  animation: story-cover-dream 12s ease-in-out infinite alternate;
}

.story-cover-only .story-chapter-label,
.story-cover-only .story-caption {
  display: none;
}

.story-cover-only .story-illustration {
  top: clamp(28px, 8%, 58px);
  bottom: clamp(28px, 8%, 58px);
}

.story-illustration-pli-cover .story-illustration-image {
  width: min(50vw, 620px);
  max-width: 55vw;
  max-height: 94%;
}

.story-visual-pli-cover-reveal .story-illustration-pli-cover-reveal {
  top: clamp(28px, 5%, 48px);
  bottom: 32%;
}

.story-visual-pli-cover-reveal .story-illustration-image {
  width: min(50vw, 620px);
  max-width: 55%;
  max-height: 96%;
  opacity: 0;
  filter: drop-shadow(0 18px 24px rgb(18 12 34 / 24%)) saturate(0.98);
  animation: pli-cover-reveal 1.5s ease both;
}

.story-visual-pli-cover-reveal .story-caption {
  top: 72%;
  bottom: clamp(18px, 3%, 30px);
}

.story-visual-pli-cover-reveal .story-text {
  color: #3f304d;
  font-size: clamp(1.38rem, 2.3vw, 1.78rem);
  text-shadow: 0 1px 0 rgb(255 252 239 / 72%);
}

.story-illustration-owl .story-illustration-image {
  max-width: min(48%, 360px);
  max-height: 82%;
  filter:
    drop-shadow(0 16px 22px rgb(28 18 42 / 22%))
    saturate(0.98);
}

.story-visual-starai-pages .story-illustration-starai-pages {
  top: clamp(38px, 8%, 68px);
  bottom: 34%;
  opacity: 0;
  transform: translateY(14px) scale(0.96);
  animation: starai-pages-reveal 1.5s ease 0.15s both;
}

.story-visual-starai-pages .story-illustration-starai-pages .story-illustration-image {
  max-width: min(58%, 540px);
  max-height: 96%;
  filter:
    drop-shadow(0 22px 28px rgb(25 18 40 / 24%))
    saturate(1.02);
  animation: starai-pages-breathe 7s ease-in-out 1.6s infinite alternate;
}

.story-visual-epilogue-note .story-illustration-epilogue-note {
  top: clamp(34px, 7%, 62px);
  bottom: 39%;
}

.story-visual-epilogue-note .story-illustration-image {
  width: min(58vw, 650px);
  max-width: 66%;
  max-height: 94%;
  filter:
    drop-shadow(0 22px 28px rgb(28 19 38 / 22%))
    saturate(0.98);
  animation: epilogue-note-open 1.2s ease both;
}

.story-visual-epilogue-note .story-illustration-epilogue-note-drop .story-illustration-image {
  animation: epilogue-note-drop 1.5s cubic-bezier(0.2, 0.78, 0.24, 1) both;
}

.story-visual-starai-pages .story-caption {
  opacity: 0;
  transform: translateX(-50%) translateY(10px);
  animation: starai-pages-caption-in 0.8s ease 4.95s both;
}

.story-visual-starai-child .story-illustration-starai-child {
  top: clamp(42px, 10%, 78px);
  bottom: clamp(160px, 29%, 210px);
  opacity: 0;
  transform: translateY(16px) scale(0.96);
  transition:
    opacity 1.5s ease,
    transform 1.5s cubic-bezier(0.2, 0.82, 0.22, 1);
}

.story-visual-starai-child .story-illustration-starai-child .story-illustration-image {
  max-width: min(42%, 360px);
  max-height: 96%;
  filter:
    drop-shadow(0 20px 24px rgb(28 20 42 / 24%))
    saturate(1.02);
  animation: starai-child-breathe 5.6s ease-in-out infinite alternate;
}

.story-mode.is-starai-revealed .story-illustration-starai-child {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.story-mode.is-starai-revealed .story-caption-footer {
  opacity: 0;
  transition: opacity 500ms ease;
}

.starai-particles {
  position: absolute;
  z-index: 4;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.starai-particles span {
  position: absolute;
  left: var(--starai-x);
  top: var(--starai-y);
  width: var(--starai-size);
  aspect-ratio: 1;
  border-radius: 50%;
  background: #fff0a8;
  box-shadow:
    0 0 10px rgb(255 235 148 / 76%),
    0 0 20px rgb(222 211 255 / 36%);
  opacity: 0;
  transform: translate(-50%, 18px) scale(0.55);
}

.story-mode.is-starai-revealed .starai-particles span {
  animation: starai-star-drift 3.8s ease var(--starai-delay) both;
}

.connection-memory-field {
  position: absolute;
  z-index: 4;
  inset: clamp(46px, 9%, 78px) 8% 32%;
  pointer-events: none;
}

.connection-memory-field::before {
  position: absolute;
  inset: 16% 18%;
  content: "";
  border-radius: 50%;
  background:
    radial-gradient(circle, rgb(255 246 191 / 26%), transparent 63%);
  filter: blur(20px);
  opacity: 0;
  transform: scale(0.72);
}

.connection-memory-field.is-constellation::before {
  animation: connection-memory-glow 3.2s ease both;
}

.connection-memory-field.is-animal-only {
  inset: clamp(52px, 11%, 92px) 8% 32%;
}

.connection-memory-field.is-animal-only::before,
.connection-memory-field.is-animal-only .connection-line,
.connection-memory-field.is-animal-only .connection-memory-symbol {
  display: none;
}

.connection-memory-item {
  position: absolute;
  left: var(--memory-left);
  top: var(--memory-top);
  width: var(--memory-size);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.78) rotate(var(--memory-rotate));
  filter:
    drop-shadow(0 16px 22px rgb(30 20 44 / 18%))
    drop-shadow(0 0 18px rgb(255 243 182 / 22%));
  animation:
    connection-memory-appear 2.8s ease var(--memory-delay) both,
    connection-memory-float 4.6s ease-in-out calc(var(--memory-delay) + 1.2s) infinite alternate;
  will-change: opacity, transform;
}

.connection-memory-field:not(.is-constellation) .connection-memory-item {
  animation: connection-memory-echo 5.2s ease var(--memory-delay) both;
}

.connection-memory-field.is-animal-only .connection-memory-item {
  left: 50%;
  top: 45%;
  width: clamp(180px, 18vw, 240px);
  aspect-ratio: auto;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.88) rotate(var(--memory-rotate));
  animation: connection-animal-only 4s ease var(--memory-delay) both;
}

.connection-memory-symbol {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  opacity: 0;
  transform: scale(0.94);
  animation: connection-symbol-in 0.8s ease var(--memory-delay) both;
}

.connection-memory-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 22px;
}

.connection-memory-image.is-bg {
  display: block;
  background-image: var(--memory-bg);
  background-position: center;
  background-size: cover;
  border: 4px solid rgb(255 252 236 / 72%);
  box-shadow:
    inset 0 0 28px rgb(255 255 255 / 16%),
    0 12px 24px rgb(38 28 52 / 14%);
}

.connection-memory-companion {
  position: absolute;
  right: var(--companion-right);
  bottom: var(--companion-bottom);
  width: var(--companion-size);
  max-width: none;
  height: auto;
  opacity: 0;
  object-fit: contain;
  filter:
    drop-shadow(0 18px 22px rgb(24 18 38 / 24%))
    drop-shadow(0 0 14px rgb(255 244 188 / 22%));
  transform:
    translate(var(--companion-enter-x), var(--companion-enter-y))
    scale(0.82)
    rotate(var(--companion-rotate));
  animation: connection-companion-in 1s ease calc(var(--memory-delay) + 0.8s) both;
  will-change: opacity, transform;
}

.connection-memory-field.is-animal-only .connection-memory-companion {
  position: static;
  width: 100%;
  opacity: 1;
  transform: none;
  animation: none;
}

.memory-sea {
  --memory-left: 26%;
  --memory-top: 43%;
  --memory-size: clamp(124px, 15vw, 190px);
  --memory-rotate: -7deg;
  --companion-size: clamp(100px, 12vw, 156px);
  --companion-right: -24%;
  --companion-bottom: -18%;
  --companion-enter-x: 12px;
  --companion-enter-y: 10px;
  --companion-rotate: 5deg;
}

.memory-bottle {
  --memory-left: 43%;
  --memory-top: 29%;
  --memory-size: clamp(78px, 9vw, 124px);
  --memory-rotate: 5deg;
  --companion-size: clamp(88px, 10vw, 136px);
  --companion-right: -58%;
  --companion-bottom: -32%;
  --companion-enter-x: 10px;
  --companion-enter-y: 12px;
  --companion-rotate: -4deg;
}

.memory-flower {
  --memory-left: 60%;
  --memory-top: 46%;
  --memory-size: clamp(82px, 9vw, 128px);
  --memory-rotate: -4deg;
  --companion-size: clamp(92px, 10.5vw, 140px);
  --companion-right: -46%;
  --companion-bottom: -24%;
  --companion-enter-x: 8px;
  --companion-enter-y: 12px;
  --companion-rotate: 4deg;
}

.memory-ember {
  --memory-left: 75%;
  --memory-top: 35%;
  --memory-size: clamp(84px, 9.4vw, 132px);
  --memory-rotate: 7deg;
  --companion-size: clamp(94px, 11vw, 146px);
  --companion-right: -42%;
  --companion-bottom: -28%;
  --companion-enter-x: 12px;
  --companion-enter-y: 10px;
  --companion-rotate: -5deg;
}

.connection-line {
  position: absolute;
  height: 2px;
  border-radius: 999px;
  background:
    linear-gradient(90deg, transparent, rgb(255 247 195 / 78%), rgb(220 211 255 / 68%), transparent);
  box-shadow:
    0 0 14px rgb(255 243 182 / 48%),
    0 0 22px rgb(203 194 255 / 28%);
  opacity: 0;
  transform-origin: left center;
}

.connection-line-one {
  --line-rotate: -24deg;
  left: 30%;
  top: 40%;
  width: 18%;
  transform: rotate(var(--line-rotate)) scaleX(0);
}

.connection-line-two {
  --line-rotate: 30deg;
  left: 47%;
  top: 34%;
  width: 19%;
  transform: rotate(var(--line-rotate)) scaleX(0);
}

.connection-line-three {
  --line-rotate: -25deg;
  left: 62%;
  top: 44%;
  width: 18%;
  transform: rotate(var(--line-rotate)) scaleX(0);
}

.connection-memory-field.is-constellation .connection-line {
  animation: connection-line-draw 2.4s ease 0.9s both;
}

.story-fragment-field {
  position: absolute;
  z-index: 4;
  inset: clamp(44px, 9%, 76px) 7% 31%;
  pointer-events: none;
}

.story-fragment-field::before {
  position: absolute;
  inset: 8% 18%;
  content: "";
  border-radius: 50%;
  background:
    radial-gradient(circle, rgb(255 244 184 / 26%), transparent 62%);
  opacity: 0;
  filter: blur(18px);
  transform: scale(0.72);
  transition:
    opacity 1.2s ease,
    transform 1.2s ease;
}

.story-fragment-piece {
  position: absolute;
  width: clamp(132px, 17vw, 220px);
  height: auto;
  opacity: 0;
  object-fit: contain;
  filter:
    drop-shadow(0 18px 22px rgb(22 16 34 / 18%))
    drop-shadow(0 0 0 rgb(255 241 180 / 0%));
  transform: translate(-50%, -50%) scale(0.88) rotate(var(--fragment-rotate));
  transition:
    left 1.35s ease,
    top 1.35s ease,
    opacity 1.1s ease,
    filter 1.1s ease,
    transform 1.35s ease;
  will-change: opacity, transform, left, top, filter;
}

.fragment-wait {
  --fragment-rotate: -7deg;
  left: 31%;
  top: 36%;
}

.fragment-remember {
  --fragment-rotate: 6deg;
  left: 59%;
  top: 28%;
}

.fragment-believe {
  --fragment-rotate: -2deg;
  left: 45%;
  top: 54%;
}

.fragment-together {
  --fragment-rotate: 8deg;
  left: 72%;
  top: 54%;
}

.fragment-connect {
  --fragment-rotate: 3deg;
  left: 25%;
  top: 61%;
}

.story-fragment-field.is-rising .story-fragment-piece {
  animation:
    story-fragment-rise 0.8s ease var(--fragment-delay) both,
    story-fragment-float 3.8s ease-in-out calc(var(--fragment-delay) + 0.8s) infinite alternate;
}

.story-fragment-field.is-gathering::before {
  opacity: 1;
  transform: scale(1);
}

.story-fragment-field.is-gathering .story-fragment-piece {
  left: 50%;
  top: 46%;
  opacity: 0.22;
  animation: none;
  filter:
    blur(2px)
    drop-shadow(0 0 24px rgb(255 237 158 / 58%));
  transform: translate(-50%, -50%) scale(0.38) rotate(0deg);
}

.story-fragment-field.is-light .story-fragment-piece {
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.16) rotate(0deg);
}

.story-fragment-light {
  position: absolute;
  left: 50%;
  top: 46%;
  width: clamp(86px, 14vw, 150px);
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle, #fff8c8 0 14%, rgb(255 232 139 / 64%) 28%, transparent 70%);
  box-shadow:
    0 0 28px rgb(255 235 145 / 72%),
    0 0 58px rgb(218 204 255 / 42%);
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.48);
}

.story-fragment-field.is-light .story-fragment-light {
  animation: story-fragment-light 1.15s ease both;
}

.story-cover-name {
  position: absolute;
  left: 50%;
  bottom: clamp(14px, 4.5%, 26px);
  min-width: 118px;
  padding: 8px 18px;
  display: grid;
  place-items: center;
  color: #4d3a6a;
  border: 1px solid rgb(99 79 124 / 18%);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgb(255 250 232 / 93%), rgb(246 232 202 / 88%));
  box-shadow:
    0 10px 22px rgb(34 25 42 / 20%),
    inset 0 1px 0 rgb(255 255 255 / 66%);
  font-family: Georgia, "Batang", "Noto Serif KR", serif;
  font-size: clamp(1.02rem, 2vw, 1.28rem);
  letter-spacing: 0.16em;
  transform: translateX(-50%) rotate(-0.4deg);
}

.story-cover-name-arrow,
.story-cover-name-final {
  grid-area: 1 / 1;
  opacity: 0;
}

.story-cover-name-current {
  grid-area: 1 / 1;
}

.story-illustration-book-cover.is-name-reveal .story-cover-name-current {
  animation: cover-name-out 4.8s ease both;
}

.story-illustration-book-cover.is-name-reveal .story-cover-name-arrow {
  animation: cover-arrow-pulse 4.8s ease both;
}

.story-illustration-book-cover.is-name-reveal .story-cover-name-final {
  animation: cover-name-in 4.8s ease both;
}

.story-atmosphere {
  position: absolute;
  z-index: 2;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.story-atmosphere span {
  position: absolute;
  display: block;
  opacity: 0;
}

.atmosphere-ocean span {
  right: -12%;
  bottom: calc(3% + var(--wave-level, 0px));
  left: -12%;
  height: 18%;
  border-top: 2px solid rgb(226 246 255 / 30%);
  border-radius: 50%;
  opacity: 0.45;
  animation: quiet-wave 8s ease-in-out infinite alternate;
}

.atmosphere-ocean span:nth-child(2) {
  --wave-level: 24px;
  animation-delay: -2.7s;
  animation-duration: 10s;
}

.atmosphere-ocean span:nth-child(3) {
  --wave-level: 48px;
  animation-delay: -5.2s;
  animation-duration: 12s;
}

.atmosphere-moon span {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #fff8d9;
  box-shadow:
    45px 32px 0 rgb(255 248 217 / 65%),
    122px -18px 0 rgb(225 211 255 / 70%),
    210px 42px 0 rgb(255 248 217 / 52%),
    314px -8px 0 rgb(225 211 255 / 62%);
  opacity: 0.5;
  animation: moon-dust 9s ease-in-out infinite;
}

.atmosphere-moon span:nth-child(1) { left: 16%; top: 28%; }
.atmosphere-moon span:nth-child(2) {
  left: 43%;
  top: 18%;
  animation-delay: -3s;
}
.atmosphere-moon span:nth-child(3) {
  left: 62%;
  top: 48%;
  animation-delay: -6s;
}

.atmosphere-neon span {
  width: 9px;
  height: 5px;
  border-radius: 80% 20% 75% 25%;
  background: rgb(255 224 236 / 76%);
  box-shadow:
    90px 36px 0 rgb(255 241 219 / 54%),
    180px -12px 0 rgb(255 213 233 / 58%);
  opacity: 0.45;
  animation: petal-sway 11s linear infinite;
}

.atmosphere-neon span:nth-child(1) { left: 18%; top: 18%; }
.atmosphere-neon span:nth-child(2) {
  left: 42%;
  top: 8%;
  animation-delay: -4s;
}
.atmosphere-neon span:nth-child(3) {
  left: 68%;
  top: 28%;
  animation-delay: -7s;
}

.atmosphere-fire span {
  right: 20%;
  bottom: -18%;
  left: 20%;
  height: 48%;
  border-radius: 50%;
  background: radial-gradient(circle, rgb(255 183 99 / 24%), transparent 68%);
  opacity: 0.55;
  animation: fire-breathe 5.5s ease-in-out infinite;
}

.atmosphere-fire span:nth-child(2) {
  animation-delay: -1.8s;
  transform: scale(0.72);
}

.atmosphere-fire span:nth-child(3) {
  animation-delay: -3.4s;
  transform: scale(0.46);
}

.atmosphere-white span {
  left: 18%;
  top: 28%;
  width: 34%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgb(255 248 210 / 70%), transparent);
  box-shadow: 0 0 8px rgb(255 245 195 / 35%);
  opacity: 0.35;
  transform-origin: left center;
  animation: constellation-thread 8s ease-in-out infinite;
}

.atmosphere-white span:nth-child(2) {
  left: 46%;
  top: 43%;
  width: 26%;
  animation-delay: -2.6s;
  transform: rotate(-12deg);
}

.atmosphere-white span:nth-child(3) {
  left: 30%;
  top: 61%;
  width: 38%;
  animation-delay: -5.2s;
  transform: rotate(9deg);
}

.story-world-ocean .story-visual::after {
  background:
    linear-gradient(180deg, transparent 54%, rgb(24 67 111 / 22%)),
    radial-gradient(circle at 62% 24%, rgb(184 229 255 / 14%), transparent 30%);
}

.story-world-moon .story-visual::after {
  background:
    radial-gradient(circle at 70% 22%, rgb(232 219 255 / 12%), transparent 26%),
    linear-gradient(180deg, transparent 58%, rgb(48 32 82 / 24%));
}

.story-world-neon .story-visual::after {
  background:
    linear-gradient(180deg, rgb(48 11 50 / 8%), transparent 38%),
    radial-gradient(circle at center, transparent 38%, rgb(42 10 43 / 18%));
}

.story-world-fire .story-visual::after {
  background:
    radial-gradient(circle at 52% 83%, rgb(255 158 70 / 26%), transparent 27%),
    linear-gradient(180deg, transparent 45%, rgb(77 20 17 / 28%));
}

.story-world-white .story-visual::after {
  background:
    radial-gradient(circle at 50% 48%, transparent 25%, rgb(44 42 59 / 8%)),
    linear-gradient(180deg, transparent 72%, rgb(65 57 74 / 14%));
}

.motion-pan-right .story-visual::before {
  animation-name: story-pan-right;
}

.motion-pan-left .story-visual::before {
  animation-name: story-pan-left;
}

.motion-pan-up .story-visual::before {
  animation-name: story-pan-up;
}

.story-chapter-label {
  position: relative;
  z-index: 3;
  top: 18px;
  left: 20px;
  display: inline-block;
  padding: 6px 11px;
  color: #453b55;
  border: 1px solid rgb(82 63 52 / 12%);
  border-radius: 4px 10px 6px 9px;
  background: rgb(255 248 226 / 88%);
  box-shadow: 0 5px 14px rgb(24 17 38 / 16%);
  font-family: Georgia, "Batang", serif;
  font-size: 0.62rem;
  letter-spacing: 0.11em;
  backdrop-filter: blur(3px);
  transform: rotate(-0.6deg);
}

.story-caption {
  position: absolute;
  z-index: 6;
  top: 63%;
  right: 0;
  bottom: clamp(24px, 4.2%, 44px);
  left: 50%;
  width: min(780px, 82%);
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  box-shadow: none;
  transform: translateX(-50%);
}

.story-world-prologue:not(.has-illustration) .story-caption {
  top: 50%;
  bottom: auto;
  min-height: min(320px, 46%);
  transform: translate(-50%, -50%);
}

.story-text {
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  color: #2f241f;
  font-family: "Gowun Batang", "Noto Serif KR", "Nanum Myeongjo", "Batang", Georgia, serif;
  font-size: clamp(1.22rem, 2vw, 1.54rem);
  font-weight: 600;
  line-height: 1.54;
  text-align: center;
  word-break: keep-all;
  text-wrap: balance;
  text-shadow:
    0 1px 0 rgb(255 252 239 / 58%);
}

.story-text.is-block-fade {
  opacity: 0;
  transform: translateY(7px);
  transition:
    opacity 1s ease,
    transform 1s ease;
}

.story-text.is-block-fade.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.story-text-line {
  position: relative;
  display: block;
}

.story-text-line + .story-text-line {
  margin-top: 0.38em;
}

.story-text-line.is-memory-fragment {
  width: auto;
  margin-inline: 0;
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
  letter-spacing: inherit;
  text-align: center;
  text-shadow: none;
  animation: none;
}

.story-text-line.is-memory-fragment::before,
.story-text-line.is-memory-fragment::after {
  display: none;
}

.story-text-line.is-memory-fragment + .story-text-line.is-memory-fragment {
  margin-top: 0.24em;
}

.story-lines-4 .story-text,
.story-lines-5 .story-text {
  width: 100%;
  font-size: clamp(1.24rem, 1.78vw, 1.36rem);
  line-height: 1.48;
}

.story-lines-4 .story-text-line + .story-text-line,
.story-lines-5 .story-text-line + .story-text-line {
  margin-top: 0.24em;
}

.story-caption-footer {
  width: min(460px, 100%);
  margin-top: clamp(14px, 2.2vw, 24px);
  min-height: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  color: rgb(87 68 56 / 46%);
  font-size: 0.61rem;
  letter-spacing: 0.05em;
}

.story-next-cue {
  animation: cue-pulse 1.8s ease-in-out infinite;
}

.story-action {
  position: static;
  z-index: 5;
  margin-top: clamp(12px, 2vw, 20px);
  min-width: 200px;
  color: #fff;
  background: #4b4568;
  transform: none;
}

.cutscene-mode {
  --theme: var(--blue);
  --theme-rgb: 94 159 248;
  position: relative;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  isolation: isolate;
  background: #17141d;
}

.cutscene-mode.theme-purple {
  --theme: var(--purple);
  --theme-rgb: 169 134 232;
}

.cutscene-mode.theme-pink {
  --theme: var(--pink);
  --theme-rgb: 240 141 183;
}

.cutscene-mode.theme-red {
  --theme: var(--red);
  --theme-rgb: 223 109 104;
}

.cutscene-mode.theme-silver {
  --theme: var(--silver);
  --theme-rgb: 170 174 190;
}

.cutscene-layer {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  background: #17141d;
  transition: opacity 1.5s ease;
}

.cutscene-layer.is-active {
  opacity: 1;
  pointer-events: auto;
}

.page-cutscene,
.cutscene-video {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #17141d;
}

.cutscene-shade {
  position: absolute;
  z-index: 2;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgb(12 10 25 / 42%), transparent 28%),
    linear-gradient(0deg, rgb(12 10 25 / 62%), transparent 48%),
    radial-gradient(circle at center, transparent 42%, rgb(12 10 25 / 24%));
}

.cutscene-heading {
  position: absolute;
  z-index: 4;
  top: clamp(18px, 3.5vw, 36px);
  right: 20px;
  left: 20px;
  color: #fff8e8;
  text-align: center;
  text-shadow:
    0 2px 12px rgb(17 12 28 / 76%),
    0 1px 2px rgb(17 12 28 / 88%);
}

.cutscene-heading span {
  display: block;
  margin-bottom: 4px;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.cutscene-heading h2 {
  margin: 0;
  font-family: Georgia, "Batang", serif;
  font-size: clamp(1rem, 2.5vw, 1.65rem);
  font-weight: 500;
}

.cutscene-text {
  position: absolute;
  z-index: 5;
  top: clamp(82px, 14%, 112px);
  right: clamp(28px, 7%, 84px);
  bottom: clamp(52px, 8%, 76px);
  left: clamp(28px, 7%, 84px);
  padding: 12px clamp(8px, 2vw, 24px);
  display: flex;
  align-items: flex-end;
  color: #fff8e8;
  pointer-events: none;
}

.cutscene-line {
  width: min(820px, 100%);
  margin: 0;
  color: inherit;
  font-family: Georgia, "Batang", serif;
  font-size: clamp(0.7rem, 1.23vw, 0.92rem);
  font-weight: 600;
  line-height: 1.45;
  text-align: left;
  word-break: keep-all;
  text-shadow:
    0 3px 14px rgb(17 12 28 / 92%),
    0 1px 3px rgb(17 12 28 / 100%),
    0 0 2px rgb(17 12 28 / 100%);
}

.cutscene-paragraph {
  position: relative;
  display: block;
  white-space: pre-line;
}

.cutscene-paragraph + .cutscene-paragraph {
  margin-top: 0.38em;
}

.cutscene-paragraph.is-dialogue {
  padding-left: clamp(6px, 1.2vw, 16px);
}

.fragment-reveal {
  position: absolute;
  z-index: 6;
  right: clamp(26px, 5vw, 72px);
  bottom: clamp(92px, 13%, 136px);
  width: clamp(260px, 30vw, 460px);
  padding: clamp(12px, 1.7vw, 18px);
  display: grid;
  justify-items: center;
  gap: 8px;
  isolation: isolate;
  opacity: 0;
  pointer-events: none;
  transform: translate(18px, 14px) scale(0.92);
}

.fragment-reveal::before {
  position: absolute;
  z-index: -2;
  inset: -16px -18px -18px;
  content: "";
  border-radius: 28px 24px 32px 22px;
  background:
    radial-gradient(circle at 20% 18%, rgb(255 246 180 / 44%), transparent 28%),
    linear-gradient(135deg, rgb(255 251 232 / 52%), rgb(245 230 202 / 34%));
  box-shadow:
    0 18px 36px rgb(20 13 32 / 24%),
    inset 0 1px 0 rgb(255 255 255 / 38%);
  backdrop-filter: blur(2px);
  filter: saturate(0.96);
}

.fragment-reveal::after {
  position: absolute;
  z-index: -1;
  inset: -22px;
  content: "";
  border-radius: 34px;
  background:
    radial-gradient(circle at 18% 28%, rgb(255 242 171 / 68%) 0 2px, transparent 3px),
    radial-gradient(circle at 82% 20%, rgb(255 255 255 / 76%) 0 2px, transparent 3px),
    radial-gradient(circle at 72% 78%, rgb(228 211 255 / 72%) 0 2px, transparent 3px),
    radial-gradient(circle at 32% 86%, rgb(255 246 190 / 68%) 0 1.5px, transparent 2.5px);
  opacity: 0;
  filter: drop-shadow(0 0 10px rgb(255 235 154 / 70%));
}

.cutscene-layer.is-active .fragment-reveal {
  animation: fragment-card-reveal 1.35s cubic-bezier(0.18, 0.82, 0.22, 1) 1.1s both;
}

.cutscene-layer.is-active .fragment-reveal::after {
  animation: fragment-dust-bloom 1.35s ease 1.1s both;
}

.cutscene-layer.is-still .fragment-reveal {
  opacity: 1;
  transform: none;
}

.fragment-reveal-title {
  color: rgb(255 250 230 / 86%);
  font-family: "Gowun Batang", "Noto Serif KR", "Batang", Georgia, serif;
  font-size: clamp(0.72rem, 1.15vw, 0.92rem);
  font-weight: 800;
  letter-spacing: 0.13em;
  text-shadow:
    0 2px 10px rgb(48 30 70 / 66%),
    0 1px 1px rgb(48 30 70 / 80%);
}

.fragment-reveal-image {
  display: block;
  width: 100%;
  height: auto;
  max-height: clamp(140px, 22vw, 260px);
  object-fit: contain;
  filter:
    drop-shadow(0 0 15px rgb(255 236 156 / 48%))
    drop-shadow(0 14px 18px rgb(24 16 36 / 24%));
}

.fragment-sparkle {
  position: absolute;
  z-index: 1;
  width: 8px;
  aspect-ratio: 1;
  border-radius: 999px;
  background: #fff3a6;
  box-shadow:
    0 0 12px rgb(255 238 160 / 88%),
    0 0 22px rgb(255 238 160 / 36%);
  opacity: 0;
}

.sparkle-one {
  top: 12%;
  left: 10%;
}

.sparkle-two {
  right: 12%;
  top: 26%;
  width: 6px;
}

.sparkle-three {
  right: 20%;
  bottom: 12%;
  width: 7px;
}

.cutscene-layer.is-active .fragment-sparkle {
  animation: fragment-sparkle-float 1.35s ease 1.1s both;
}

.cutscene-layer.is-active .sparkle-two {
  animation-delay: 1.22s;
}

.cutscene-layer.is-active .sparkle-three {
  animation-delay: 1.34s;
}

.fragment-reveal::before {
  background: rgb(255 250 232 / 72%);
  box-shadow: 0 8px 20px rgb(20 13 32 / 14%);
  backdrop-filter: blur(1px);
  filter: none;
}

.fragment-reveal::after,
.fragment-sparkle {
  display: none;
}

.cutscene-layer.is-active .fragment-reveal {
  animation: fragment-simple-fade 1s ease 1.1s both;
}

.fragment-reveal-title {
  color: #4f4059;
  text-shadow: none;
}

.fragment-reveal-image {
  filter: none;
}

.cutscene-skip {
  position: absolute;
  right: clamp(14px, 2.5vw, 28px);
  bottom: clamp(14px, 2.5vw, 26px);
  z-index: 7;
  padding: 7px 11px;
  color: rgb(255 248 232 / 82%);
  border: 1px solid rgb(255 248 232 / 28%);
  border-radius: 999px;
  cursor: pointer;
  background: rgb(36 28 43 / 18%);
  box-shadow: 0 4px 14px rgb(10 7 18 / 18%);
  backdrop-filter: blur(5px);
  font-size: 0.68rem;
  opacity: 0.7;
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.cutscene-skip:hover {
  opacity: 1;
  transform: translateY(-2px);
}

.cutscene-next {
  position: absolute;
  z-index: 8;
  right: clamp(20px, 3.5vw, 44px);
  bottom: clamp(18px, 2.8vw, 32px);
  min-width: 190px;
  color: #fff;
  background: var(--theme);
  opacity: 0;
  transform: translateY(10px);
}

.cutscene-next.visible {
  animation: next-button-reveal 600ms ease forwards;
}

.cutscene-layer.is-still::after {
  position: absolute;
  z-index: 3;
  inset: 0;
  content: "";
  pointer-events: none;
  background: rgb(255 247 225 / 4%);
  animation: still-flash 700ms ease both;
}

.cutscene-fallback {
  position: absolute;
  z-index: 1;
  inset: 0;
  overflow: hidden;
  background: linear-gradient(rgb(255 248 228 / 12%), rgb(22 19 32 / 18%));
}

.cutscene-fallback.active {
  animation: fallback-scene 3.2s ease-in-out both;
}

.fallback-page {
  position: absolute;
  inset: 18%;
  border-radius: 50%;
  background: rgb(255 249 222 / 30%);
  filter: blur(20px);
  animation: fallback-page-light 1.6s ease-in-out infinite alternate;
}

.fallback-particle {
  position: absolute;
  width: clamp(34px, 5vw, 58px);
  height: auto;
  color: #fff4b2;
  filter: drop-shadow(0 0 12px rgb(255 244 178 / 72%));
  animation: fallback-particle 2.4s ease-in-out infinite;
}

.particle-one {
  top: 22%;
  left: 24%;
}

.particle-two {
  top: 58%;
  left: 72%;
  animation-delay: -0.6s;
}

.particle-three {
  top: 33%;
  left: 81%;
  animation-delay: -1.2s;
}

.particle-four {
  top: 68%;
  left: 35%;
  animation-delay: -1.8s;
}

.sticker-page.is-fading-to-cutscene {
  opacity: 0;
  filter: brightness(1.12) saturate(0.86);
  pointer-events: none;
  transition:
    opacity 900ms ease,
    filter 900ms ease;
}

.sticker-page {
  --theme: var(--blue);
  --theme-rgb: 94 159 248;
  height: 100%;
  min-height: inherit;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  background:
    linear-gradient(118deg, rgb(var(--theme-rgb) / 5%), transparent 42%),
    var(--paper);
}

.sticker-page.theme-purple {
  --theme: var(--purple);
  --theme-rgb: 169 134 232;
}

.sticker-page.theme-pink {
  --theme: var(--pink);
  --theme-rgb: 240 141 183;
}

.sticker-page.theme-red {
  --theme: var(--red);
  --theme-rgb: 223 109 104;
}

.sticker-page.theme-silver {
  --theme: var(--silver);
  --theme-rgb: 170 174 190;
}

.page-ribbon {
  min-height: 68px;
  padding: 15px 24px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px dashed rgb(75 59 49 / 18%);
}

.chapter-index {
  display: block;
  margin-bottom: 2px;
  color: var(--theme);
  font-size: 0.67rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.page-ribbon h2 {
  margin: 0;
  font-family: Georgia, "Batang", serif;
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  font-weight: 500;
}

.complete-badge {
  padding: 8px 13px;
  color: #fff;
  border-radius: 4px 9px 5px 8px;
  background: var(--theme);
  box-shadow: 0 4px 12px rgb(var(--theme-rgb) / 28%);
  font-size: 0.72rem;
  font-weight: 800;
  transform: rotate(1.5deg);
}

.sticker-workspace {
  min-height: 0;
  padding: 18px 22px 12px;
  overflow: hidden;
}

.page-story {
  min-height: 0;
  padding: 18px 18px 14px;
  overflow: auto;
  border: 1px solid rgb(90 67 47 / 12%);
  border-radius: 7px 17px 10px 14px;
  background:
    linear-gradient(135deg, rgb(255 255 255 / 75%), transparent),
    #f7eddc;
  box-shadow: 0 8px 20px rgb(86 59 33 / 8%);
  transform: rotate(-0.3deg);
}

.tape {
  width: 82px;
  height: 18px;
  margin: -27px auto 16px;
  opacity: 0.65;
  background: rgb(var(--theme-rgb) / 32%);
  transform: rotate(2deg);
}

.page-story p {
  margin: 0 0 10px;
  color: #5a5256;
  font-family: Georgia, "Batang", serif;
  font-size: clamp(0.78rem, 1.35vw, 0.94rem);
  line-height: 1.5;
  word-break: keep-all;
}

.completion-copy {
  margin-top: 19px;
  padding-top: 17px;
  border-top: 1px dashed rgb(var(--theme-rgb) / 48%);
  animation: soft-reveal 600ms ease both;
}

.completion-copy blockquote {
  margin: 13px 0;
  color: #312c38;
  font-family: Georgia, "Batang", serif;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.5;
}

.word-chip {
  display: inline-block;
  padding: 5px 10px;
  color: #fff;
  border-radius: 99px;
  background: var(--theme);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
}

.scene-column {
  min-width: 0;
  height: 100%;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 12px;
}

.sticker-scene {
  position: relative;
  min-height: 0;
  overflow: hidden;
  touch-action: none;
  border: 7px solid white;
  border-radius: 8px 20px 12px 16px;
  background-color: rgb(var(--theme-rgb) / 17%);
  background-image: linear-gradient(180deg, rgb(255 255 255 / 8%), transparent 55%);
  box-shadow:
    0 12px 24px rgb(80 52 31 / 13%),
    inset 0 0 42px rgb(var(--theme-rgb) / 12%);
}

.sticker-scene::before,
.sticker-scene::after {
  position: absolute;
  z-index: 1;
  content: "";
  pointer-events: none;
}

.sticker-scene::before {
  right: -7%;
  bottom: -24%;
  width: 65%;
  height: 60%;
  border-radius: 50%;
  background: rgb(255 255 255 / 22%);
  box-shadow:
    -210px 50px 0 rgb(255 255 255 / 13%),
    -90px -220px 0 rgb(255 255 255 / 9%);
}

.sticker-scene::after {
  inset: 0;
  opacity: 0.34;
  background-image: radial-gradient(
    circle,
    rgb(255 255 255 / 90%) 0 1px,
    transparent 1.7px
  );
  background-size: 42px 42px;
}

.scene-white {
  border-color: #e8e5dd;
}

.target-slot {
  position: absolute;
  z-index: 2;
  width: clamp(58px, 8.5vw, 92px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  color: rgb(55 50 65 / 18%);
  border: 2px dashed rgb(255 255 255 / 72%);
  border-radius: 47% 53% 49% 51%;
  background:
    radial-gradient(circle at 42% 30%, rgb(255 255 255 / 28%), transparent 56%),
    rgb(255 255 255 / 18%);
  box-shadow:
    0 4px 14px rgb(80 60 120 / 12%),
    inset 0 0 18px rgb(255 255 255 / 18%);
  opacity: 0.38;
  transform: translate(-50%, -50%);
  transition:
    opacity 220ms ease,
    transform 240ms ease,
    border-color 220ms ease,
    box-shadow 240ms ease,
    background-color 220ms ease;
}

.target-slot::before {
  position: absolute;
  inset: 8%;
  content: "";
  border-radius: inherit;
  background:
    radial-gradient(circle at 50% 50%, rgb(255 246 190 / 48%), transparent 58%);
  opacity: 0.28;
  animation: sticker-slot-glimmer 3.8s ease-in-out infinite;
  pointer-events: none;
}

.sticker-page.is-dragging .target-slot {
  opacity: 0.55;
}

.sticker-page.is-dragging .target-slot.is-drag-target {
  border-color: rgb(255 255 255 / 86%);
  opacity: 0.75;
  transform: translate(-50%, -50%) scale(1.04);
}

.target-slot.is-near {
  border-color: rgb(255 248 210 / 92%);
  box-shadow:
    0 0 18px rgb(255 245 190 / 65%),
    0 8px 22px rgb(80 60 120 / 15%),
    inset 0 0 20px rgb(255 255 255 / 30%);
  opacity: 0.92;
  transform: translate(-50%, -50%) scale(1.08);
}

.target-slot.is-filled {
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0.92);
}

.sticker-page.is-dragging .target-slot.is-filled {
  opacity: 0;
}

.target-slot .target-fallback {
  position: relative;
  z-index: 1;
  font-size: 1.2rem;
  filter: grayscale(1);
  opacity: 0.26;
}

.target-slot img {
  position: absolute;
  z-index: 1;
  inset: 7%;
  width: 86%;
  height: 86%;
  object-fit: contain;
  filter: grayscale(0.8) sepia(0.15);
  opacity: 0.2;
}

.placed-sticker,
.dragging-sticker {
  display: grid;
  place-items: center;
  user-select: none;
  pointer-events: none;
}

.placed-sticker {
  position: absolute;
  z-index: 4;
  width: clamp(62px, 9vw, 96px);
  aspect-ratio: 1;
  transform: translate(-50%, -50%) rotate(var(--sticker-rotate, -2deg));
  animation: sticker-snap 420ms cubic-bezier(0.2, 1.7, 0.4, 1) both;
}

.sticker-visual {
  position: relative;
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  border: 5px solid white;
  border-radius: 43% 50% 45% 52%;
  background: rgb(255 255 255 / 76%);
  box-shadow:
    0 7px 12px rgb(38 31 45 / 22%),
    inset 0 0 0 1px rgb(0 0 0 / 4%);
}

.sticker-visual img {
  position: absolute;
  inset: 3px;
  width: calc(100% - 6px);
  height: calc(100% - 6px);
  object-fit: contain;
  border-radius: inherit;
}

.sticker-emoji {
  font-size: clamp(2.15rem, 5vw, 3.7rem);
  line-height: 1;
  filter: drop-shadow(0 4px 2px rgb(0 0 0 / 12%));
}

.sticker-tray {
  position: relative;
  min-height: 96px;
  padding: 9px 14px 7px;
  overflow: visible;
  border: 0;
  border-radius: 4px 13px 6px 11px;
  background:
    linear-gradient(94deg, rgb(255 255 255 / 18%), transparent 42%),
    #dfc9a6;
  box-shadow:
    inset 0 1px rgb(255 255 255 / 38%),
    inset 0 -8px 14px rgb(78 55 31 / 7%),
    0 9px 20px rgb(73 49 29 / 12%);
  transform: rotate(-0.18deg);
}

.sticker-tray::before {
  position: absolute;
  top: -7px;
  left: 50%;
  width: 92px;
  height: 16px;
  content: "";
  background: rgb(239 222 174 / 58%);
  box-shadow: 0 2px 5px rgb(64 43 25 / 8%);
  transform: translateX(-50%) rotate(1.2deg);
}

.tray-label {
  position: relative;
  z-index: 2;
  margin: 0 0 3px;
  color: #796a58;
  font-family: Georgia, "Batang", serif;
  font-size: 0.61rem;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.tray-items {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 0;
  padding: 0 18px 2px;
}

.sticker-card {
  --tray-rotate: -4deg;
  --tray-y: 2px;
  position: relative;
  width: clamp(60px, 8vw, 84px);
  aspect-ratio: 1;
  margin-left: clamp(-10px, -0.8vw, -5px);
  padding: 0;
  border: 0;
  border-radius: 14px;
  cursor: grab;
  touch-action: none;
  background: transparent;
  transition:
    transform 240ms cubic-bezier(0.2, 0.8, 0.2, 1),
    filter 180ms ease,
    opacity 180ms ease;
  transform: translateY(var(--tray-y)) rotate(var(--tray-rotate));
}

.sticker-card:first-child {
  margin-left: 0;
}

.sticker-card:nth-child(2) {
  --tray-rotate: 3deg;
  --tray-y: -1px;
}

.sticker-card:nth-child(3) {
  --tray-rotate: -2deg;
  --tray-y: 3px;
}

.sticker-card:nth-child(4) {
  --tray-rotate: 4deg;
  --tray-y: 0px;
}

.sticker-card:nth-child(5) {
  --tray-rotate: -3deg;
  --tray-y: 2px;
}

.sticker-card:hover:not(:disabled) {
  z-index: 8;
  filter: saturate(1.04);
  transform: translateY(calc(var(--tray-y) - 10px)) rotate(0) scale(1.06);
}

.sticker-card:active:not(:disabled) {
  cursor: grabbing;
}

.sticker-card.is-lifted {
  opacity: 0.16;
  transform: translateY(-7px) rotate(var(--tray-rotate)) scale(0.92);
}

.sticker-card:disabled {
  cursor: default;
  opacity: 0.08;
  filter: grayscale(1);
}

.sticker-card .sticker-visual {
  border-width: 4px;
}

.sticker-card .sticker-emoji {
  font-size: clamp(1.9rem, 4vw, 3rem);
}

.dragging-sticker {
  position: fixed;
  z-index: 999;
  width: 98px;
  aspect-ratio: 1;
  transform: translate(-50%, -58%) rotate(-2deg) scale(1.13);
  filter: drop-shadow(0 24px 18px rgb(13 11 25 / 40%));
  animation: sticker-lift 220ms ease both;
}

.sticker-card.shake {
  animation: sticker-shake 420ms ease;
}

.page-actions {
  min-height: 58px;
  padding: 8px 24px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-top: 1px dashed rgb(73 60 48 / 13%);
}

.page-actions p {
  margin: 0;
  color: var(--muted-ink);
  font-size: 0.75rem;
}

.page-actions .paper-button {
  min-width: 150px;
  color: white;
  background: var(--theme);
}

.sparkle {
  position: absolute;
  z-index: 8;
  width: 8px;
  height: 8px;
  pointer-events: none;
  border-radius: 50%;
  background: #fff;
  box-shadow:
    0 -22px 0 #fff3a7,
    19px -11px 0 #fff,
    18px 15px 0 #fff3a7,
    -18px 14px 0 #fff,
    -20px -10px 0 #fff3a7;
  animation: sparkle-pop 700ms ease-out forwards;
  transform: translate(-50%, -50%);
}

.sticker-page.is-complete .sticker-scene {
  animation: page-glow 1000ms ease both;
}

.sticker-page.is-complete .scene-ocean {
  box-shadow:
    0 12px 24px rgb(80 52 31 / 13%),
    inset 0 0 46px rgb(132 222 255 / 48%);
}

.sticker-page.is-complete .scene-moon {
  box-shadow:
    0 12px 24px rgb(80 52 31 / 13%),
    inset 0 0 64px rgb(236 214 255 / 36%);
}

.sticker-page.is-complete .scene-neon {
  filter: saturate(1.3) brightness(1.12);
}

.sticker-page.is-complete .scene-fire {
  filter: saturate(1.2) brightness(1.1);
}

.sticker-page.is-complete .scene-white {
  background-image:
    linear-gradient(25deg, transparent 49%, rgb(126 130 145 / 42%) 49.4% 50%, transparent 50.4%),
    linear-gradient(155deg, transparent 49%, rgb(126 130 145 / 42%) 49.4% 50%, transparent 50.4%);
}

.chapter-transition {
  position: absolute;
  z-index: 40;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  border-radius: var(--page-radius);
  perspective: 1800px;
  transition: background-color 500ms ease;
}

.chapter-transition.is-title-visible {
  background: rgb(15 14 31 / 48%);
  backdrop-filter: blur(2px);
}

.riffle-pages,
.memory-pages {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
}

.riffle-pages span {
  position: absolute;
  inset: var(--sheet-offset);
  border: 1px solid rgb(93 70 45 / 14%);
  border-radius: var(--page-radius);
  background:
    linear-gradient(90deg, rgb(74 55 39 / 9%), transparent 15%),
    repeating-linear-gradient(
      5deg,
      transparent 0 4px,
      rgb(91 67 39 / 3%) 4px 5px
    ),
    var(--paper);
  box-shadow: 8px 12px 30px rgb(5 7 24 / 30%);
  transform-origin: left center;
  animation: riffle-sheet 1260ms cubic-bezier(0.58, 0.02, 0.35, 1) both;
  animation-delay: var(--sheet-delay);
}

.chapter-transition.is-final .riffle-pages span {
  animation-duration: 2700ms;
}

.memory-pages span {
  position: absolute;
  inset: 0;
  opacity: 0;
  background:
    linear-gradient(rgb(20 17 35 / 12%), rgb(20 17 35 / 26%)),
    var(--memory-bg) center / cover;
  animation: memory-page-flash 560ms ease both;
  animation-delay: var(--memory-delay);
}

.chapter-title-card {
  position: absolute;
  z-index: 5;
  top: 50%;
  left: 50%;
  min-width: min(360px, calc(100% - 48px));
  padding: 24px 36px;
  color: #443b50;
  border: 1px solid rgb(87 67 45 / 18%);
  border-radius: 7px 18px 9px 15px;
  background:
    repeating-linear-gradient(
      4deg,
      transparent 0 4px,
      rgb(91 67 39 / 3%) 4px 5px
    ),
    #fff8e6;
  box-shadow:
    0 24px 60px rgb(5 7 24 / 38%),
    inset 0 0 0 1px rgb(255 255 255 / 75%);
  font-family: Georgia, "Batang", serif;
  text-align: center;
  opacity: 0;
  transform: translate(-50%, -44%) rotate(-0.6deg) scale(0.94);
  transition:
    opacity 650ms ease,
    transform 650ms ease;
}

.chapter-title-card img {
  display: block;
  width: 58px;
  height: 58px;
  margin: 0 auto 8px;
  object-fit: contain;
  filter: drop-shadow(0 7px 8px rgb(49 37 54 / 18%));
}

.chapter-title-card p {
  margin: 0 0 5px;
  color: #83798b;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.18em;
}

.chapter-title-card h2 {
  margin: 0;
  font-size: clamp(1.45rem, 4vw, 2.3rem);
  font-weight: 500;
}

.chapter-transition.is-title-visible .riffle-pages,
.chapter-transition.is-title-visible .memory-pages {
  opacity: 0;
}

.chapter-transition.is-title-visible .chapter-title-card {
  opacity: 1;
  transform: translate(-50%, -50%) rotate(-0.6deg) scale(1);
}

.ending-video-scene {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #11142d;
}

.ending-fragment-sequence {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  isolation: isolate;
  background: #eee6d6;
}

.fragment-narration-paper,
.fragment-narration-sky {
  position: absolute;
  inset: -3%;
}

.fragment-narration-paper {
  z-index: -2;
  background:
    linear-gradient(rgb(255 251 239 / 50%), rgb(239 229 209 / 42%)),
    var(--fragment-page-bg) center / cover no-repeat;
  filter: saturate(0.72) brightness(0.96);
  opacity: 1;
  transition: opacity 2.6s ease-in-out, filter 2.6s ease-in-out;
}

.fragment-narration-sky {
  z-index: -1;
  background:
    linear-gradient(180deg, rgb(6 8 28 / 34%), rgb(13 15 43 / 58%)),
    var(--fragment-sky-bg) center / cover no-repeat;
  filter: saturate(0.65) brightness(0.54);
  opacity: 0;
  transform: none;
  transition: opacity 2.6s ease-in-out;
}

.fragment-narration-list {
  position: absolute;
  z-index: 2;
  left: 50%;
  top: 50%;
  width: min(680px, 78%);
  display: grid;
  gap: clamp(12px, 2dvh, 22px);
  color: #44384c;
  font-family: "Gowun Batang", "Noto Serif KR", "Batang", Georgia, serif;
  font-size: clamp(1.35rem, 2.4vw, 2rem);
  font-weight: 500;
  line-height: 1.5;
  text-align: center;
  text-shadow: none;
  opacity: 0;
  transform: translate(-50%, -50%);
  transition:
    color 2.2s ease-in-out,
    opacity 2.6s ease-in-out,
    transform 2.6s ease-in-out;
}

.ending-fragment-gather-field {
  z-index: 3;
  inset: clamp(38px, 7%, 62px) 4% 8%;
  opacity: 1;
  transition:
    opacity 1s ease,
    transform 1s ease;
}

.ending-fragment-gather-field .story-fragment-piece {
  width: clamp(118px, 16vw, 205px);
}

.ending-fragment-gather-field .fragment-wait {
  left: 12%;
  top: 30%;
}

.ending-fragment-gather-field .fragment-remember {
  left: 86%;
  top: 27%;
}

.ending-fragment-gather-field .fragment-believe {
  left: 9%;
  top: 72%;
}

.ending-fragment-gather-field .fragment-together {
  left: 89%;
  top: 70%;
}

.ending-fragment-gather-field .fragment-connect {
  left: 50%;
  top: 13%;
}

.ending-fragment-sequence.is-text-phase .ending-fragment-gather-field {
  opacity: 0;
  transform: scale(0.96);
}

.ending-fragment-sequence.is-text-phase .fragment-narration-list {
  opacity: 1;
}

.fragment-narration-line {
  margin: 0;
  opacity: 0;
  transform: none;
  filter: none;
  text-shadow: none;
  transition: opacity 1s ease;
}

.fragment-narration-line.is-visible {
  opacity: 1;
}

.ending-fragment-sequence.is-rising .fragment-narration-paper {
  opacity: 0;
  filter: saturate(0.55) brightness(0.58);
}

.ending-fragment-sequence.is-rising .fragment-narration-sky {
  opacity: 1;
}

.ending-fragment-sequence.is-rising .fragment-narration-list {
  color: #fff9e6;
  opacity: 0;
  transform: translate(-50%, calc(-50% - 16dvh));
}

.ending-plli-reveal {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  isolation: isolate;
  background: #080a20;
  opacity: 1;
  transition: opacity 1.3s ease, filter 1.3s ease;
}

.ending-plli-reveal.is-leaving {
  opacity: 0;
  filter: brightness(0.68);
}

.plli-night-sky {
  position: absolute;
  z-index: -3;
  inset: -4%;
  background:
    linear-gradient(180deg, rgb(4 6 22 / 72%), rgb(14 16 43 / 78%)),
    var(--plli-night-bg) center / cover no-repeat;
  filter: saturate(0.6) brightness(0.42);
  animation: plli-night-drift 14s ease-in-out both;
}

.plli-night-sky::after {
  position: absolute;
  inset: 0;
  content: "";
  background:
    radial-gradient(circle at 50% 47%, rgb(130 137 220 / 12%), transparent 34%),
    linear-gradient(180deg, rgb(2 4 16 / 16%), rgb(5 7 25 / 44%));
}

.plli-star-dust {
  position: absolute;
  z-index: 1;
  inset: 0;
  pointer-events: none;
}

.plli-star-dust span {
  position: absolute;
  left: var(--plli-star-x);
  top: var(--plli-star-y);
  width: var(--plli-star-size);
  aspect-ratio: 1;
  border-radius: 50%;
  background: rgb(255 250 218 / 92%);
  box-shadow: 0 0 7px rgb(255 244 190 / 60%);
  opacity: 0;
  animation: plli-star-drift 6.8s ease-in-out var(--plli-star-delay) infinite;
}

.plli-name-light {
  position: absolute;
  z-index: 2;
  left: 50%;
  top: 48%;
  width: clamp(80px, 10vw, 132px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgb(255 249 215 / 88%), rgb(218 216 255 / 26%) 38%, transparent 72%);
  opacity: 0;
  filter: blur(10px);
  transform: translate(-50%, -50%) scale(0.16);
  transition:
    opacity 1.6s ease,
    filter 2.2s ease,
    transform 2.2s cubic-bezier(0.2, 0.72, 0.18, 1);
}

.plli-name-light span {
  position: absolute;
  inset: -110%;
  border-radius: 50%;
  background: radial-gradient(circle, rgb(242 237 255 / 20%), transparent 64%);
  opacity: 0;
  transform: scale(0.35);
  transition: opacity 2s ease 0.3s, transform 2.4s ease 0.2s;
}

.ending-plli-reveal.is-light-visible .plli-name-light {
  opacity: 0.86;
  filter: blur(3px);
  transform: translate(-50%, -50%) scale(1.65);
}

.ending-plli-reveal.is-light-visible .plli-name-light span {
  opacity: 1;
  transform: scale(1.1);
}

.plli-name {
  position: absolute;
  z-index: 3;
  left: 50%;
  top: 48%;
  width: 3.1em;
  height: 1.5em;
  margin: 0;
  color: #fff9df;
  font-family: "Nanum Myeongjo", "Noto Serif KR", Georgia, serif;
  font-size: clamp(4.4rem, 9vw, 8rem);
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1;
  text-align: center;
  text-shadow:
    0 2px 8px rgb(14 13 44 / 60%),
    0 0 20px rgb(255 247 198 / 34%),
    0 0 48px rgb(187 185 255 / 28%);
  transform: translate(-50%, -50%);
}

.plli-name-first,
.plli-name-second {
  position: absolute;
  left: 50%;
  top: 50%;
  opacity: 0;
  filter: blur(16px);
  transform: translate(-50%, -50%) scale(0.78);
  transition:
    opacity 1.5s ease,
    filter 1.9s ease,
    transform 1.8s cubic-bezier(0.2, 0.78, 0.2, 1);
}

.ending-plli-reveal.is-name-first .plli-name-first {
  opacity: 0.9;
  filter: blur(1.5px);
  transform: translate(-50%, -50%) scale(1);
}

.ending-plli-reveal.is-name-complete .plli-name-first {
  opacity: 1;
  filter: blur(0);
  transform: translate(-102%, -50%) scale(1);
}

.ending-plli-reveal.is-name-complete .plli-name-second {
  opacity: 1;
  filter: blur(0);
  transform: translate(2%, -50%) scale(1);
}

.ending-plli-reveal.is-name-settled .plli-name {
  animation: plli-name-breathe 2.8s ease-in-out infinite alternate;
}

.ending-star-assembly {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  isolation: isolate;
  background: #11142d;
  opacity: 1;
  transition: opacity 1.2s ease;
}

.ending-star-assembly::before {
  position: absolute;
  z-index: -3;
  inset: -3%;
  content: "";
  background:
    linear-gradient(180deg, rgb(8 10 31 / 36%), rgb(15 17 47 / 64%)),
    var(--assembly-bg) center / cover no-repeat;
  filter: saturate(0.78) brightness(0.55);
  animation: ending-star-sky-drift 12s ease-in-out both;
}

.ending-star-assembly.is-leaving {
  opacity: 0;
}

.ending-star-night {
  position: absolute;
  z-index: -2;
  inset: 0;
  background:
    radial-gradient(circle at 50% 46%, rgb(121 132 218 / 22%), transparent 35%),
    radial-gradient(circle at 50% 80%, rgb(244 222 175 / 12%), transparent 32%);
}

.ending-star-particles {
  position: absolute;
  z-index: 1;
  inset: 0;
  pointer-events: none;
}

.ending-star-particles span {
  position: absolute;
  left: var(--particle-x);
  top: var(--particle-y);
  width: var(--particle-size);
  aspect-ratio: 1;
  border-radius: 50%;
  background: #fff8ce;
  box-shadow: 0 0 8px rgb(255 246 190 / 72%);
  opacity: 0;
  animation: ending-star-particle 3.6s ease-in-out var(--particle-delay) infinite;
}

.ending-star-stickers {
  position: absolute;
  z-index: 3;
  inset: 0;
}

.ending-star-sticker {
  position: absolute;
  left: var(--start-x);
  top: var(--start-y);
  width: clamp(72px, 9.5vw, 126px);
  aspect-ratio: 1;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.72) rotate(var(--sticker-rotate));
  filter: drop-shadow(0 9px 12px rgb(7 8 26 / 38%));
  transition:
    opacity 0.8s ease var(--reveal-delay),
    transform 0.8s cubic-bezier(0.2, 0.72, 0.2, 1) var(--reveal-delay),
    filter 0.8s ease var(--reveal-delay);
  will-change: left, top, opacity, transform;
}

.ending-star-sticker img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 1;
  transition: opacity 0.42s ease, transform 0.6s ease, filter 0.6s ease;
}

.ending-star-assembly.is-revealing .ending-star-sticker {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1) rotate(var(--sticker-rotate));
  filter: drop-shadow(0 10px 16px rgb(7 8 26 / 42%));
}

.ending-star-assembly.is-flying .ending-star-sticker {
  left: var(--target-x);
  top: var(--target-y);
  transform: translate(-50%, -50%) scale(0.82) rotate(0deg);
  filter: drop-shadow(0 0 18px rgb(255 242 174 / 45%));
  transition:
    left 1.6s cubic-bezier(0.36, 0.06, 0.18, 1),
    top 1.6s cubic-bezier(0.36, 0.06, 0.18, 1),
    transform 1.6s cubic-bezier(0.36, 0.06, 0.18, 1),
    filter 1.2s ease;
}

.ending-real-star {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 36%;
  aspect-ratio: 1;
  background: #fff7c6;
  clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 56%, 79% 93%, 50% 71%, 21% 93%, 32% 56%, 2% 35%, 39% 35%);
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.35) rotate(-24deg);
  filter: drop-shadow(0 0 7px #fff7c6) drop-shadow(0 0 18px #e7d7ff);
  transition: opacity 0.5s ease, transform 0.7s cubic-bezier(0.2, 0.84, 0.22, 1.25);
}

.ending-real-star::after {
  position: absolute;
  inset: -80%;
  content: "";
  border-radius: 50%;
  background: radial-gradient(circle, rgb(255 250 207 / 54%), transparent 64%);
  animation: ending-real-star-pulse 1.8s ease-in-out infinite alternate;
}

.ending-star-assembly.is-transformed .ending-star-sticker img {
  opacity: 0;
  transform: scale(0.68);
  filter: brightness(1.8) blur(5px);
}

.ending-star-assembly.is-transformed .ending-real-star {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1) rotate(0deg);
}

.ending-star-lines {
  position: absolute;
  z-index: 2;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.ending-star-lines path {
  fill: none;
  stroke: rgb(255 248 205 / 82%);
  stroke-width: 0.34;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 300;
  stroke-dashoffset: 300;
  filter: drop-shadow(0 0 2px rgb(255 247 198 / 90%)) drop-shadow(0 0 6px rgb(183 184 255 / 64%));
}

.ending-star-assembly.is-connected .ending-star-lines path {
  animation: ending-star-line-draw 0.9s ease forwards;
}

.ending-constellation-video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ending-video-fallback {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at center, rgb(125 137 229 / 26%), transparent 42%),
    linear-gradient(160deg, #11142d, #242851 64%, #15172f);
}

.ending-video-fallback img {
  position: absolute;
  left: 50%;
  top: 50%;
  width: clamp(48px, 8vw, 92px);
  color: #fff2a8;
  opacity: 0;
  filter: drop-shadow(0 0 16px currentColor);
}

.ending-video-fallback img:nth-child(1) { left: 14%; top: 62%; }
.ending-video-fallback img:nth-child(2) { left: 32%; top: 28%; }
.ending-video-fallback img:nth-child(3) { left: 50%; top: 48%; }
.ending-video-fallback img:nth-child(4) { left: 68%; top: 25%; }
.ending-video-fallback img:nth-child(5) { left: 86%; top: 60%; }

.ending-video-fallback.is-active img {
  animation: fallback-star-connect 2.8s ease forwards;
}

.ending-video-fallback.is-active img:nth-child(2) { animation-delay: 180ms; }
.ending-video-fallback.is-active img:nth-child(3) { animation-delay: 360ms; }
.ending-video-fallback.is-active img:nth-child(4) { animation-delay: 540ms; }
.ending-video-fallback.is-active img:nth-child(5) { animation-delay: 720ms; }

.ending {
  position: relative;
  min-height: inherit;
  height: 100%;
  overflow: hidden;
  color: #f8f4ff;
  text-align: center;
  background:
    radial-gradient(circle at 50% 40%, rgb(106 119 212 / 30%), transparent 27rem),
    linear-gradient(160deg, #141731, #282b54 58%, #13152c);
  isolation: isolate;
}

.ending::before {
  position: absolute;
  z-index: -2;
  inset: -12%;
  content: "";
  background:
    radial-gradient(circle at 16% 84%, rgb(255 245 185 / 14%) 0 2px, transparent 3px),
    radial-gradient(circle at 78% 18%, rgb(232 222 255 / 18%) 0 1.5px, transparent 2.5px),
    radial-gradient(circle at 52% 72%, rgb(255 255 255 / 10%) 0 1px, transparent 2px),
    radial-gradient(circle at 28% 26%, rgb(255 245 185 / 12%) 0 1px, transparent 2px);
  background-size: 220px 240px, 260px 220px, 180px 210px, 300px 260px;
  opacity: 0.62;
  animation: ending-bg-scroll 34s linear infinite;
}

.ending::after {
  position: absolute;
  z-index: -1;
  inset: 0;
  content: "";
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 52%, transparent 0 32%, rgb(9 9 24 / 26%) 72%),
    linear-gradient(180deg, rgb(255 246 218 / 5%), rgb(10 9 22 / 22%));
}

.ending-particles {
  position: absolute;
  z-index: 0;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.ending-particles span {
  position: absolute;
  left: var(--particle-left);
  top: var(--particle-top);
  width: var(--particle-size);
  aspect-ratio: 1;
  border-radius: 999px;
  background: rgb(255 245 180 / 78%);
  box-shadow:
    0 0 10px rgb(255 240 170 / 72%),
    0 0 20px rgb(221 208 255 / 32%);
  opacity: 0;
  animation: ending-particle-twinkle 4.6s ease-in-out infinite;
  animation-delay: var(--particle-delay);
}

.ending-inner {
  position: relative;
  z-index: 1;
  width: min(960px, calc(100% - 36px));
  min-height: 100%;
  margin: 0 auto;
  padding: clamp(30px, 5vw, 58px) 0;
  display: grid;
  align-content: start;
  gap: 26px;
}

.credits-page .ending-inner {
  align-content: center;
  gap: clamp(18px, 3vw, 30px);
}

.credits-page .ending-message {
  min-height: 64px;
}

.ending-kicker {
  margin: 0;
  color: rgb(255 255 255 / 52%);
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.mini-pages {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}

.mini-page {
  position: relative;
  min-height: 92px;
  padding: 14px 8px;
  display: grid;
  place-items: end center;
  overflow: hidden;
  color: #443e50;
  border: 4px solid white;
  border-radius: 4px 12px 7px 9px;
  background: var(--card-color);
  box-shadow: 0 12px 25px rgb(0 0 0 / 25%);
  font-family: Georgia, "Batang", serif;
  font-size: 0.72rem;
  opacity: 0;
  transform: translateY(24px) rotate(var(--card-rotate));
  animation: card-rise 650ms ease forwards;
  animation-delay: var(--delay);
}

.mini-page::before {
  position: absolute;
  top: 16px;
  font-size: 1.9rem;
  content: var(--card-icon);
}

.constellation-wrap {
  position: relative;
  width: min(520px, 92%);
  aspect-ratio: 2 / 1;
  margin: 0 auto;
}

.constellation-lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.constellation-lines path {
  fill: none;
  stroke: rgb(240 235 255 / 74%);
  stroke-width: 1.2;
  stroke-dasharray: 300;
  stroke-dashoffset: 300;
  filter: drop-shadow(0 0 5px #d9d1ff);
  animation: draw-line 2.8s ease forwards 4.2s;
}

.ending-star {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: 38px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  color: var(--star-color);
  font-size: 2.3rem;
  opacity: 0;
  filter: drop-shadow(0 0 12px currentColor);
  transform: translate(-50%, 90px) scale(0.2);
  animation: star-gather 1.4s cubic-bezier(0.2, 0.9, 0.2, 1.2) forwards;
  animation-delay: var(--star-delay);
}

.ending-message {
  min-height: 118px;
  display: grid;
  place-items: center;
}

.ending-message p {
  max-width: 700px;
  margin: 0;
  font-family: Georgia, "Batang", serif;
  font-size: clamp(1rem, 2.5vw, 1.65rem);
  line-height: 1.5;
  word-break: keep-all;
  opacity: 0;
  transform: translateY(10px);
  transition:
    opacity 700ms ease,
    transform 700ms ease;
}

.ending-message p.visible {
  opacity: 1;
  transform: none;
}

.credits-stage {
  position: relative;
  width: min(520px, 92%);
  height: min(390px, 50dvh);
  margin: 0 auto;
  overflow: hidden;
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity 900ms ease,
    transform 900ms ease;
  mask-image: linear-gradient(transparent, #000 18%, #000 82%, transparent);
}

.credits-stage[hidden],
.dream-finale[hidden],
.thanks-page[hidden],
.epilogue-page[hidden] {
  display: none;
}

.credits-stage::before,
.credits-stage::after {
  position: absolute;
  right: 12%;
  left: 12%;
  height: 1px;
  content: "";
  background: linear-gradient(90deg, transparent, rgb(255 245 196 / 24%), transparent);
}

.credits-stage::before {
  top: 0;
}

.credits-stage::after {
  bottom: 0;
}

.credits-stage.is-visible {
  opacity: 1;
  transform: none;
}

.credits-track {
  position: absolute;
  top: 108%;
  right: 0;
  left: 0;
}

.credits-track.is-rolling {
  animation: credits-roll 20s linear forwards;
}

.credits-track .credit-line {
  margin: 0 0 clamp(24px, 4dvh, 38px);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.72em;
  color: rgb(255 250 232 / 78%);
  font-family: "Gowun Batang", "Noto Serif KR", "Batang", Georgia, serif;
  font-size: clamp(1.25rem, 2.7vw, 1.8rem);
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: 0.08em;
  text-shadow:
    0 0 18px rgb(255 236 158 / 18%),
    0 2px 12px rgb(15 12 28 / 54%);
  opacity: 0.42;
  animation: credit-line-glow 2.7s ease-in-out both;
  animation-delay: var(--credit-delay);
}

.credit-star {
  color: #fff1a6;
  font-size: 0.88em;
  filter: drop-shadow(0 0 10px rgb(255 234 143 / 76%));
  animation: credit-star-twinkle 2.4s ease-in-out infinite;
  animation-delay: var(--credit-delay);
}

.credits-stage.is-finished {
  display: none;
}

.credits-stage.is-leaving {
  opacity: 0;
  transform: translateY(-12px);
  transition:
    opacity 1s ease,
    transform 1s ease;
}

.epilogue-page {
  display: none;
  opacity: 0;
}

.epilogue-page.visible {
  display: block;
  animation: epilogue-reveal 1.1s ease forwards;
}

.epilogue-page.is-leaving {
  animation: epilogue-leave 850ms ease forwards;
}

.anniversary-lockup {
  margin: 42px 0 10px;
  color: white;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.24rem, 3.3vw, 2.3rem);
  letter-spacing: 0.06em;
  line-height: 1.45;
}

.epilogue-page .anniversary-lockup {
  margin: 10px 0 24px;
  font-size: clamp(0.84rem, 2.1vw, 1.14rem);
  letter-spacing: 0.02em;
  line-height: 1.55;
}

.tiny-wish {
  margin: 24px 0;
  color: rgb(255 255 255 / 46%);
  font-size: 0.6rem;
}

.dream-finale,
.thanks-page {
  width: min(760px, 92%);
  min-height: min(380px, 56dvh);
  margin: 0 auto;
  display: grid;
  place-items: center;
  align-content: center;
  gap: clamp(14px, 2vw, 22px);
  opacity: 0;
  transform: translateY(18px);
}

.dream-finale.visible {
  animation: finale-reveal 2s ease forwards;
}

.thanks-page.visible {
  animation: finale-reveal 1.4s ease forwards;
}

.dream-finale.is-leaving {
  animation: finale-leave 2s ease forwards;
}

.dream-finale-title {
  margin: 0;
  color: #fff9df;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(3rem, 9vw, 6.6rem);
  line-height: 0.95;
  letter-spacing: 0.16em;
  text-shadow:
    0 0 24px rgb(255 235 158 / 28%),
    0 6px 28px rgb(15 10 32 / 56%);
}

.dream-finale-star,
.thanks-star {
  display: inline-grid;
  width: 1.6em;
  aspect-ratio: 1;
  place-items: center;
  color: #fff1a6;
  font-size: clamp(1.1rem, 2.2vw, 1.55rem);
  filter: drop-shadow(0 0 14px rgb(255 235 142 / 78%));
  animation: final-star-pulse 2.1s ease-in-out infinite;
}

.dream-finale-subtitle {
  margin: 0;
  color: rgb(255 249 231 / 76%);
  font-family: "Gowun Batang", "Noto Serif KR", "Batang", Georgia, serif;
  font-size: clamp(1rem, 2vw, 1.25rem);
  line-height: 1.55;
  letter-spacing: 0.03em;
}

.thanks-page {
  gap: 0.8em;
}

.thanks-line {
  margin: 0;
  color: #fff9e8;
  font-family: "Gowun Batang", "Noto Serif KR", "Batang", Georgia, serif;
  font-size: clamp(1.25rem, 3vw, 2rem);
  font-weight: 600;
  line-height: 1.5;
  word-break: keep-all;
  opacity: 0;
  transform: translateY(12px);
  text-shadow:
    0 0 18px rgb(255 236 164 / 16%),
    0 2px 12px rgb(14 10 30 / 54%);
  transition:
    opacity 900ms ease,
    transform 900ms ease;
}

.thanks-line.visible {
  opacity: 1;
  transform: none;
}

.thanks-star {
  margin-top: 0.6em;
  opacity: 0;
  transform: scale(0.72);
  transition:
    opacity 900ms ease,
    transform 900ms ease;
}

.thanks-star.visible {
  opacity: 1;
  transform: scale(1);
}

.ending-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
}

.ending-actions.visible {
  animation: soft-reveal 700ms ease both;
}

@keyframes music-note-pulse {
  0%,
  100% {
    opacity: 0.58;
    transform: translateY(0);
  }
  50% {
    opacity: 1;
    transform: translateY(-2px);
  }
}

@keyframes book-open {
  0% {
    transform: perspective(1600px) rotateY(-4deg) scale(0.9);
  }
  45% {
    transform: perspective(1600px) rotateY(4deg) scale(0.97);
  }
  100% {
    transform: none;
  }
}

@keyframes book-close-open {
  0%,
  100% {
    transform: rotateY(0) scale(1);
  }
  46%,
  58% {
    transform: rotateY(-84deg) scale(0.94);
  }
}

@keyframes story-pan {
  from {
    background-position: 49.5% 49.5%;
  }
  to {
    background-position: 50.8% 50.5%;
  }
}

@keyframes story-pan-right {
  from {
    background-position: 48.5% 50%;
  }
  to {
    background-position: 51.4% 49.2%;
  }
}

@keyframes story-pan-left {
  from {
    background-position: 51.3% 49.2%;
  }
  to {
    background-position: 48.7% 50.6%;
  }
}

@keyframes story-pan-up {
  from {
    background-position: 50% 51.3%;
  }
  to {
    background-position: 50.8% 48.8%;
  }
}

@keyframes page-turn-mobile-stable {
  0% {
    opacity: 1;
    clip-path: inset(0 0 0 0);
    -webkit-clip-path: inset(0 0 0 0);
  }
  100% {
    opacity: 0;
    clip-path: inset(0 100% 0 0);
    -webkit-clip-path: inset(0 100% 0 0);
  }
}

@keyframes story-illustration-settle {
  0%,
  100% {
    transform: translateY(2px) scale(0.995);
  }
  50% {
    transform: translateY(-3px) scale(1.008);
  }
}

@keyframes epilogue-note-open {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.975);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes epilogue-note-drop {
  from {
    opacity: 0;
    transform: translateY(-34px) rotate(-1.5deg) scale(0.96);
  }

  to {
    opacity: 1;
    transform: translateY(0) rotate(0) scale(1);
  }
}

@keyframes story-cover-dream {
  from {
    transform: translateY(4px) scale(0.985);
  }

  to {
    transform: translateY(-4px) scale(1.035);
  }
}

@keyframes pli-cover-reveal {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.97);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes starai-pages-reveal {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.96);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes starai-pages-breathe {
  from {
    transform: translateY(3px) scale(0.995);
  }

  to {
    transform: translateY(-5px) scale(1.012);
  }
}

@keyframes starai-pages-caption-in {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

@keyframes starai-child-breathe {
  from {
    transform: translateY(4px) scale(0.992);
  }

  to {
    transform: translateY(-5px) scale(1.012);
  }
}

@keyframes starai-star-drift {
  0% {
    opacity: 0;
    transform: translate(-50%, 18px) scale(0.55);
  }

  22% {
    opacity: 0.85;
  }

  72% {
    opacity: 0.72;
  }

  100% {
    opacity: 0;
    transform: translate(-50%, -34px) scale(1);
  }
}

@keyframes connection-memory-appear {
  0% {
    opacity: 0;
    transform: translate(-50%, calc(-50% + 18px)) scale(0.76) rotate(var(--memory-rotate));
  }

  45% {
    opacity: 0.92;
  }

  100% {
    opacity: 0.84;
    transform: translate(-50%, -50%) scale(1) rotate(var(--memory-rotate));
  }
}

@keyframes connection-memory-echo {
  0% {
    opacity: 0;
    transform: translate(-50%, calc(-50% + 18px)) scale(0.76) rotate(var(--memory-rotate));
  }

  16% {
    opacity: 0.86;
    transform: translate(-50%, -50%) scale(1) rotate(var(--memory-rotate));
  }

  72% {
    opacity: 0.78;
  }

  100% {
    opacity: 0;
    transform: translate(-50%, calc(-50% - 8px)) scale(0.96) rotate(var(--memory-rotate));
  }
}

@keyframes connection-animal-only {
  0% {
    opacity: 0;
    transform: translate(-50%, calc(-50% + 10px)) scale(0.88) rotate(var(--memory-rotate));
  }

  25% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1) rotate(var(--memory-rotate));
  }

  75% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1) rotate(var(--memory-rotate));
  }

  100% {
    opacity: 0;
    transform: translate(-50%, calc(-50% - 8px)) scale(0.96) rotate(var(--memory-rotate));
  }
}

@keyframes connection-symbol-in {
  from {
    opacity: 0;
    transform: scale(0.94);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes connection-companion-in {
  from {
    opacity: 0;
    transform:
      translate(var(--companion-enter-x), var(--companion-enter-y))
      scale(0.82)
      rotate(var(--companion-rotate));
  }

  to {
    opacity: 1;
    transform:
      translate(0, 0)
      scale(1)
      rotate(var(--companion-rotate));
  }
}

@keyframes connection-memory-float {
  from {
    transform: translate(-50%, -50%) scale(1) rotate(var(--memory-rotate));
  }

  to {
    transform: translate(-50%, calc(-50% - 9px)) scale(1.015) rotate(var(--memory-rotate));
  }
}

@keyframes connection-memory-glow {
  0% {
    opacity: 0;
    transform: scale(0.72);
  }

  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes connection-line-draw {
  0% {
    opacity: 0;
    transform: rotate(var(--line-rotate, 0deg)) scaleX(0);
  }

  38% {
    opacity: 0.88;
  }

  100% {
    opacity: 0.72;
    transform: rotate(var(--line-rotate, 0deg)) scaleX(1);
  }
}

@keyframes cover-name-out {
  0%,
  42% {
    opacity: 1;
    transform: translateY(0);
  }

  58%,
  100% {
    opacity: 0;
    transform: translateY(-8px);
  }
}

@keyframes cover-arrow-pulse {
  0%,
  36% {
    opacity: 0;
    transform: translateY(-8px);
  }

  46%,
  58% {
    opacity: 0.72;
    transform: translateY(0);
  }

  72%,
  100% {
    opacity: 0;
    transform: translateY(8px);
  }
}

@keyframes cover-name-in {
  0%,
  56% {
    opacity: 0;
    transform: translateY(8px);
  }

  76%,
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes memory-fragment-settle {
  0% {
    opacity: 0;
    filter: blur(3px);
    transform: translateY(10px) scale(0.88);
  }

  58% {
    opacity: 1;
    filter: blur(0);
    transform: translateY(-2px) scale(1.08);
  }

  100% {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0) scale(1);
  }
}

@keyframes memory-fragment-dust {
  0% {
    opacity: 0;
    transform: translateY(8px) scale(0.4);
  }

  42% {
    opacity: 0.95;
    transform: translateY(-4px) scale(1.15);
  }

  100% {
    opacity: 0;
    transform: translateY(-16px) scale(0.62);
  }
}

@keyframes story-fragment-rise {
  0% {
    opacity: 0;
    filter:
      blur(3px)
      drop-shadow(0 18px 22px rgb(22 16 34 / 12%));
    transform: translate(-50%, calc(-50% + 18px)) scale(0.82) rotate(var(--fragment-rotate));
  }

  100% {
    opacity: 1;
    filter:
      blur(0)
      drop-shadow(0 18px 22px rgb(22 16 34 / 18%))
      drop-shadow(0 0 16px rgb(255 241 180 / 34%));
    transform: translate(-50%, -50%) scale(1) rotate(var(--fragment-rotate));
  }
}

@keyframes story-fragment-float {
  from {
    transform: translate(-50%, -50%) scale(1) rotate(var(--fragment-rotate));
  }

  to {
    transform: translate(-50%, calc(-50% - 8px)) scale(1.015) rotate(var(--fragment-rotate));
  }
}

@keyframes story-fragment-light {
  0% {
    opacity: 0;
    filter: blur(8px);
    transform: translate(-50%, -50%) scale(0.42);
  }

  48% {
    opacity: 1;
    filter: blur(0);
    transform: translate(-50%, -50%) scale(1.1);
  }

  100% {
    opacity: 0.72;
    filter: blur(0);
    transform: translate(-50%, -50%) scale(1);
  }
}

@keyframes story-fade-to-video {
  from {
    opacity: 1;
    filter: brightness(1);
  }

  to {
    opacity: 0;
    filter: brightness(0.55) blur(2px);
  }
}

@keyframes story-fade-to-night {
  0% {
    opacity: 1;
    filter: brightness(1) saturate(1);
  }

  58% {
    opacity: 0.54;
    filter: brightness(0.58) saturate(0.72);
  }

  100% {
    opacity: 0;
    filter: brightness(0.22) saturate(0.45) blur(2px);
  }
}

@keyframes story-soft-leave {
  from {
    opacity: 1;
    filter: brightness(1);
  }

  to {
    opacity: 0;
    filter: brightness(0.82);
  }
}

@keyframes fragment-card-reveal {
  0% {
    opacity: 0;
    filter: blur(4px);
    transform: translate(18px, 14px) scale(0.9);
  }

  58% {
    opacity: 1;
    filter: blur(0);
    transform: translate(-2px, -4px) scale(1.06);
  }

  100% {
    opacity: 1;
    filter: blur(0);
    transform: translate(0, 0) scale(1);
  }
}

@keyframes fragment-simple-fade {
  from {
    opacity: 0;
    transform: none;
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes fragment-card-reveal-mobile {
  0% {
    opacity: 0;
    filter: blur(4px);
    transform: translate(50%, 14px) scale(0.9);
  }

  58% {
    opacity: 1;
    filter: blur(0);
    transform: translate(50%, -4px) scale(1.06);
  }

  100% {
    opacity: 1;
    filter: blur(0);
    transform: translate(50%, 0) scale(1);
  }
}

@keyframes fragment-dust-bloom {
  0% {
    opacity: 0;
    transform: scale(0.72) rotate(-4deg);
  }

  36% {
    opacity: 0.9;
  }

  100% {
    opacity: 0;
    transform: scale(1.12) rotate(3deg);
  }
}

@keyframes fragment-sparkle-float {
  0% {
    opacity: 0;
    transform: translateY(10px) scale(0.45);
  }

  44% {
    opacity: 0.95;
    transform: translateY(-4px) scale(1.15);
  }

  100% {
    opacity: 0;
    transform: translateY(-18px) scale(0.72);
  }
}

@keyframes sticker-slot-glimmer {
  0%,
  100% {
    opacity: 0.18;
    transform: scale(0.96);
  }

  50% {
    opacity: 0.48;
    transform: scale(1.04);
  }
}

@keyframes quiet-wave {
  from {
    transform: translate3d(-1.5%, 3px, 0) scaleX(1.01);
  }
  to {
    transform: translate3d(1.5%, -4px, 0) scaleX(0.98);
  }
}

@keyframes moon-dust {
  0%,
  100% {
    opacity: 0.28;
    transform: translate3d(0, 8px, 0) scale(0.8);
  }
  50% {
    opacity: 0.7;
    transform: translate3d(12px, -8px, 0) scale(1.1);
  }
}

@keyframes petal-sway {
  0% {
    opacity: 0;
    transform: translate3d(0, -20px, 0) rotate(0);
  }
  18%,
  78% {
    opacity: 0.48;
  }
  100% {
    opacity: 0;
    transform: translate3d(54px, 220px, 0) rotate(190deg);
  }
}

@keyframes fire-breathe {
  0%,
  100% {
    opacity: 0.28;
    transform: scale(0.9);
  }
  50% {
    opacity: 0.58;
    transform: scale(1.08);
  }
}

@keyframes constellation-thread {
  0%,
  100% {
    opacity: 0.12;
    scale: 0.15 1;
  }
  48%,
  68% {
    opacity: 0.52;
    scale: 1 1;
  }
}

@keyframes ending-star-sky-drift {
  from {
    transform: scale(1.04) translate3d(-0.4%, 0.4%, 0);
  }
  to {
    transform: scale(1.1) translate3d(0.5%, -0.6%, 0);
  }
}

@keyframes plli-night-drift {
  from {
    transform: scale(1.04) translate3d(-0.3%, 0.35%, 0);
  }
  to {
    transform: scale(1.1) translate3d(0.45%, -0.45%, 0);
  }
}

@keyframes plli-star-drift {
  0%,
  100% {
    opacity: 0.08;
    transform: translateY(var(--plli-star-drift)) scale(0.72);
  }
  42% {
    opacity: 0.62;
  }
  68% {
    opacity: 0.32;
    transform: translateY(calc(0px - var(--plli-star-drift))) scale(1.08);
  }
}

@keyframes plli-name-breathe {
  from {
    text-shadow:
      0 2px 8px rgb(14 13 44 / 60%),
      0 0 20px rgb(255 247 198 / 28%),
      0 0 42px rgb(187 185 255 / 22%);
  }
  to {
    text-shadow:
      0 2px 8px rgb(14 13 44 / 60%),
      0 0 30px rgb(255 247 198 / 52%),
      0 0 62px rgb(187 185 255 / 38%);
  }
}

@keyframes ending-star-particle {
  0%,
  100% {
    opacity: 0.08;
    transform: translateY(5px) scale(0.7);
  }
  48% {
    opacity: 0.68;
    transform: translateY(-5px) scale(1.1);
  }
}

@keyframes ending-real-star-pulse {
  from {
    opacity: 0.42;
    transform: scale(0.86);
  }
  to {
    opacity: 0.78;
    transform: scale(1.18);
  }
}

@keyframes ending-star-line-draw {
  from {
    stroke-dashoffset: 300;
    opacity: 0.2;
  }
  to {
    stroke-dashoffset: 0;
    opacity: 1;
  }
}

@keyframes visual-breathe {
  0%,
  100% {
    transform: translate(-50%, -50%) scale(var(--item-scale)) rotate(-1deg);
  }
  50% {
    transform: translate(-50%, calc(-50% - 7px)) scale(var(--item-scale)) rotate(1deg);
  }
}

@keyframes visual-drift {
  0%,
  100% {
    transform: translate(calc(-50% - 5px), calc(-50% + 4px)) scale(var(--item-scale)) rotate(1.5deg);
  }
  50% {
    transform: translate(calc(-50% + 7px), calc(-50% - 8px)) scale(var(--item-scale)) rotate(-1deg);
  }
}

@keyframes visual-float {
  0%,
  100% {
    transform: translate(-50%, calc(-50% + 5px)) scale(var(--item-scale));
  }
  50% {
    transform: translate(-50%, calc(-50% - 9px)) scale(var(--item-scale));
  }
}

@keyframes visual-sway {
  0%,
  100% {
    transform: translate(-50%, -50%) scale(var(--item-scale)) rotate(-4deg);
  }
  50% {
    transform: translate(-50%, -50%) scale(var(--item-scale)) rotate(4deg);
  }
}

@keyframes visual-glow {
  0%,
  100% {
    filter:
      drop-shadow(0 16px 16px rgb(15 10 28 / 26%))
      drop-shadow(0 0 5px rgb(255 249 224 / 22%));
    transform: translate(-50%, -50%) scale(var(--item-scale));
  }
  50% {
    filter:
      drop-shadow(0 18px 18px rgb(15 10 28 / 30%))
      drop-shadow(0 0 22px rgb(255 245 184 / 68%));
    transform: translate(-50%, calc(-50% - 3px)) scale(var(--item-scale));
  }
}

@keyframes visual-flicker {
  0%,
  8%,
  12%,
  100% {
    opacity: 1;
    filter: brightness(1) drop-shadow(0 10px 15px rgb(15 10 28 / 28%));
    transform: translate(-50%, -50%) scale(var(--item-scale));
  }
  9%,
  11% {
    opacity: 0.42;
    filter: brightness(0.55);
  }
  56% {
    filter: brightness(1.28) drop-shadow(0 0 18px rgb(255 150 210 / 58%));
  }
}

@keyframes visual-twinkle {
  0%,
  100% {
    opacity: 0.58;
    transform: translate(-50%, -50%) scale(var(--item-scale));
  }
  50% {
    opacity: 1;
    filter: drop-shadow(0 0 18px rgb(255 243 174 / 72%));
    transform: translate(-50%, calc(-50% - 4px)) scale(var(--item-scale));
  }
}

@keyframes visual-write {
  0%,
  100% {
    transform: translate(-50%, -50%) scale(var(--item-scale)) rotate(-7deg);
  }
  50% {
    transform: translate(calc(-50% + 12px), calc(-50% + 5px)) scale(var(--item-scale)) rotate(3deg);
  }
}

.story-visual-item.motion-breathe { animation-name: visual-breathe; }
.story-visual-item.motion-drift { animation-name: visual-drift; }
.story-visual-item.motion-float { animation-name: visual-float; }
.story-visual-item.motion-sway { animation-name: visual-sway; }
.story-visual-item.motion-glow { animation-name: visual-glow; }
.story-visual-item.motion-flicker { animation-name: visual-flicker; animation-duration: 4.2s; }
.story-visual-item.motion-twinkle { animation-name: visual-twinkle; animation-duration: 3.4s; }
.story-visual-item.motion-write { animation-name: visual-write; animation-duration: 4.6s; }

@keyframes cue-pulse {
  0%,
  100% {
    opacity: 0.45;
  }
  50% {
    opacity: 0.9;
  }
}

@keyframes cutscene-page-glow {
  from {
    opacity: 0.4;
    transform: scale(0.92);
  }
  to {
    opacity: 0.9;
    transform: scale(1.08);
  }
}

@keyframes fallback-scene {
  0% {
    filter: brightness(0.88) saturate(0.84);
    transform: scale(1);
  }
  48% {
    filter: brightness(1.25) saturate(1.12);
  }
  100% {
    filter: brightness(1.08) saturate(1);
    transform: scale(1.06);
  }
}

@keyframes fallback-page-light {
  to {
    opacity: 0.9;
    transform: scale(1.16);
  }
}

@keyframes fallback-particle {
  0%,
  100% {
    opacity: 0.25;
    transform: translateY(8px) scale(0.8) rotate(0);
  }
  50% {
    opacity: 1;
    transform: translateY(-10px) scale(1.2) rotate(22deg);
  }
}

@keyframes film-settle {
  0% {
    filter: drop-shadow(0 18px 22px rgb(53 39 45 / 25%));
  }
  45% {
    filter:
      brightness(1.08)
      drop-shadow(0 20px 28px rgb(53 39 45 / 22%));
  }
  100% {
    filter: drop-shadow(0 14px 18px rgb(53 39 45 / 22%));
  }
}

@keyframes still-flash {
  0% {
    opacity: 0;
  }
  45% {
    opacity: 1;
  }
  100% {
    opacity: 0.35;
  }
}

@keyframes next-button-reveal {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes page-turn {
  0% {
    transform: rotateY(0);
    box-shadow: var(--shadow);
  }
  100% {
    transform: rotateY(-165deg);
    box-shadow: 12px 18px 34px rgb(0 0 0 / 42%);
  }
}

@keyframes riffle-sheet {
  0% {
    opacity: 0;
    transform: rotateY(0) translateX(0);
  }
  10% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: rotateY(-178deg) translateX(-3%);
  }
}

@keyframes memory-page-flash {
  0%,
  100% {
    opacity: 0;
    transform: scale(1.035);
  }
  18%,
  76% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes fallback-star-connect {
  0% {
    opacity: 0;
    transform: translate(-50%, calc(-50% + 24px)) scale(0.4);
  }
  55%,
  100% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

@keyframes credits-roll {
  from {
    transform: translateY(0);
  }

  88%,
  to {
    transform: translateY(var(--credits-end-y, calc(-100% - 180px)));
  }
}

@keyframes ending-bg-scroll {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(-9%);
  }
}

@keyframes ending-particle-twinkle {
  0%,
  100% {
    opacity: 0;
    transform: translateY(10px) scale(0.7);
  }

  45%,
  58% {
    opacity: 0.9;
    transform: translateY(-4px) scale(1);
  }
}

@keyframes credit-line-glow {
  0% {
    opacity: 0.24;
    transform: translateY(10px) scale(0.98);
  }

  42% {
    opacity: 1;
    transform: translateY(0) scale(1.03);
  }

  100% {
    opacity: 0.72;
    transform: translateY(0) scale(1);
  }
}

@keyframes credit-star-twinkle {
  0%,
  100% {
    opacity: 0.48;
    transform: scale(0.82) rotate(0deg);
  }

  50% {
    opacity: 1;
    transform: scale(1.16) rotate(18deg);
  }
}

@keyframes epilogue-reveal {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes epilogue-leave {
  from {
    opacity: 1;
    transform: none;
  }
  to {
    opacity: 0;
    transform: translateY(-18px);
  }
}

@keyframes finale-reveal {
  from {
    opacity: 0;
    filter: blur(3px);
    transform: translateY(22px) scale(0.98);
  }
  to {
    opacity: 1;
    filter: blur(0);
    transform: none;
  }
}

@keyframes finale-leave {
  from {
    opacity: 1;
    transform: none;
  }
  to {
    opacity: 0;
    transform: translateY(-16px);
  }
}

@keyframes final-star-pulse {
  0%,
  100% {
    opacity: 0.62;
    transform: scale(0.9) rotate(0deg);
  }

  48% {
    opacity: 1;
    transform: scale(1.16) rotate(16deg);
  }
}

@keyframes paper-shadow {
  0%,
  100% {
    opacity: 0;
  }
  45% {
    opacity: 1;
  }
}

@keyframes sticker-snap {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.7) rotate(-5deg);
  }
  62% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.18) rotate(2deg);
  }
  100% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1) rotate(var(--sticker-rotate, -2deg));
  }
}

@keyframes sticker-shake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-7px) rotate(-4deg);
  }
  50% {
    transform: translateX(7px) rotate(4deg);
  }
  75% {
    transform: translateX(-4px) rotate(-2deg);
  }
}

@keyframes sticker-lift {
  from {
    opacity: 0.72;
    transform: translate(-50%, -50%) rotate(-5deg) scale(0.94);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -58%) rotate(-2deg) scale(1.13);
  }
}

@keyframes sparkle-pop {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.25) rotate(0);
  }
  40% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1.9) rotate(70deg);
  }
}

@keyframes page-glow {
  0% {
    filter: brightness(1);
  }
  45% {
    filter: brightness(1.28);
  }
  100% {
    filter: brightness(1.06);
  }
}

@keyframes soft-reveal {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

@keyframes card-rise {
  to {
    opacity: 1;
    transform: translateY(0) rotate(var(--card-rotate));
  }
}

@keyframes star-gather {
  0% {
    opacity: 0;
    transform: translate(-50%, 90px) scale(0.2);
  }
  65% {
    opacity: 1;
  }
  100% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

@keyframes draw-line {
  to {
    stroke-dashoffset: 0;
  }
}

@media (max-width: 820px) {
  .game-shell {
    width: min(100% - 18px, 720px);
    padding-top: max(10px, env(safe-area-inset-top));
    padding-bottom: max(46px, calc(env(safe-area-inset-bottom) + 24px));
  }

  .game-header {
    position: relative;
    min-height: 54px;
    align-items: flex-end;
  }

  .eyebrow {
    position: absolute;
    top: 3px;
    left: 0;
  }

  .progress-wrap {
    flex: 1;
    justify-content: flex-start;
    padding-right: 238px;
  }

  .music-control {
    position: absolute;
    top: 0;
    right: 0;
  }

  .book-frame {
    min-height: 0;
    perspective: none;
    -webkit-perspective: none;
  }

  .book {
    transform-style: flat;
    -webkit-transform-style: flat;
    transition: none;
  }

  .book.opening,
  .book-frame.ending-transition .book {
    animation: none;
    transform: none;
  }

  .page {
    transform-origin: center;
    backface-visibility: visible;
    -webkit-backface-visibility: visible;
    contain: paint;
  }

  .page.turning {
    animation-name: page-turn-mobile-stable;
  }

  .story-visual::before,
  .motion-pan-right .story-visual::before,
  .motion-pan-left .story-visual::before,
  .motion-pan-up .story-visual::before {
    animation: none;
    background-position: center;
    transform: none;
    will-change: auto;
  }

  .chapter-background-frame,
  .chapter-background-image {
    animation: none !important;
    transform: none !important;
  }

  .sticker-workspace {
    overflow: hidden;
  }

  .scene-column {
    grid-template-rows: minmax(0, 1fr) auto;
  }

  .interaction-hint {
    min-height: 30px;
  }
}

@media (max-width: 520px) {
  .game-shell {
    width: calc(100% - 10px);
  }

  .credit-watermark {
    max-width: calc(100% - 18px);
    font-size: clamp(10px, 2.8vw, 12px);
  }

  .progress-wrap {
    padding-right: 142px;
    font-size: 0.62rem;
  }

  .eyebrow-title {
    font-size: 0.72rem;
  }

  .eyebrow-subtitle {
    max-width: 144px;
    font-size: 0.44rem;
    letter-spacing: 0.1em;
  }

  .progress-track {
    width: 74px;
  }

  .music-control {
    min-width: 0;
    padding: 5px 6px;
    gap: 4px;
  }

  .music-title,
  .music-volume-wrap > span {
    display: none;
  }

  .music-next {
    width: 25px;
    min-width: 25px;
    padding: 0;
    font-size: 0;
  }

  .music-next::before {
    content: "›";
    font-size: 1rem;
  }

  .music-volume {
    width: 46px;
  }

  .book-frame {
    min-height: 0;
  }

  .page {
    border-radius: 8px 18px 18px 8px;
  }

  .cover h1 {
    font-size: clamp(3.8rem, 21vw, 5.6rem);
  }

  .button-stack {
    flex-direction: column;
  }

  .paper-button {
    min-width: 190px;
  }

  .page-ribbon {
    padding-inline: 16px;
  }

  .sticker-workspace {
    padding: 10px 10px 8px;
  }

  .story-caption {
    top: 62%;
    bottom: 28px;
    width: min(420px, 88%);
  }

  .story-text {
    width: 100%;
    font-size: clamp(1.04rem, 4.15vw, 1.24rem);
    line-height: 1.52;
  }

  .story-lines-4 .story-text,
  .story-lines-5 .story-text {
    width: 100%;
    font-size: clamp(1.04rem, 3.65vw, 1.14rem);
    line-height: 1.45;
  }

  .story-illustration {
    top: 30px;
    right: 2.5%;
    bottom: 42%;
    left: 2.5%;
  }

  .story-illustration-image {
    max-width: 90%;
    max-height: 100%;
  }

  .ending-star-sticker {
    width: clamp(50px, 14vw, 66px);
  }

  .fragment-narration-list {
    width: 86%;
    gap: clamp(9px, 1.6dvh, 14px);
    font-size: clamp(1.08rem, 5vw, 1.3rem);
    line-height: 1.45;
  }

  .ending-fragment-gather-field {
    inset: 36px 2% 8%;
  }

  .ending-fragment-gather-field .story-fragment-piece {
    width: clamp(94px, 29vw, 138px);
  }

  .ending-fragment-gather-field .fragment-wait,
  .ending-fragment-gather-field .fragment-believe {
    left: 15%;
  }

  .ending-fragment-gather-field .fragment-remember,
  .ending-fragment-gather-field .fragment-together {
    left: 85%;
  }

  .ending-star-1 { --start-x: 18% !important; }
  .ending-star-2 { --start-x: 34% !important; }
  .ending-star-3 { --start-x: 50% !important; }
  .ending-star-4 { --start-x: 66% !important; }
  .ending-star-5 { --start-x: 82% !important; }

  .story-illustration-book-cover .story-illustration-image {
    max-width: min(52%, 220px);
    max-height: 82%;
  }

  .story-illustration-pli-cover .story-illustration-image {
    width: min(55vw, 260px);
    max-width: 58vw;
    max-height: 86%;
  }

  .story-illustration-owl .story-illustration-image {
    max-width: min(58%, 250px);
    max-height: 78%;
  }

  .story-visual-starai-pages .story-illustration-starai-pages {
    top: 42px;
    bottom: 38%;
  }

  .story-visual-starai-pages .story-illustration-starai-pages .story-illustration-image {
    max-width: min(70%, 300px);
    max-height: 96%;
  }

  .story-visual-epilogue-note .story-illustration-epilogue-note {
    top: 42px;
    bottom: 42%;
  }

  .story-visual-epilogue-note .story-illustration-image {
    width: min(82vw, 430px);
    max-width: 88%;
    max-height: 92%;
  }

  .story-visual-starai-child .story-illustration-starai-child {
    top: 44px;
    bottom: 40%;
  }

  .story-visual-starai-child .story-illustration-starai-child .story-illustration-image {
    max-width: min(54%, 230px);
    max-height: 96%;
  }

  .connection-memory-field {
    inset: 42px 4% 38%;
  }

  .connection-memory-field.is-animal-only {
    inset: 44px 4% 38%;
  }

  .connection-memory-field.is-animal-only .connection-memory-item {
    left: 50%;
    top: 45%;
    width: clamp(160px, 45vw, 220px);
  }

  .memory-sea {
    --memory-left: 27%;
    --memory-top: 45%;
    --memory-size: clamp(86px, 30vw, 126px);
    --companion-size: clamp(72px, 24vw, 104px);
    --companion-right: -22%;
    --companion-bottom: -18%;
  }

  .memory-bottle {
    --memory-left: 45%;
    --memory-top: 29%;
    --memory-size: clamp(62px, 19vw, 88px);
    --companion-size: clamp(66px, 22vw, 94px);
    --companion-right: -48%;
    --companion-bottom: -38%;
  }

  .memory-flower {
    --memory-left: 63%;
    --memory-top: 47%;
    --memory-size: clamp(62px, 19vw, 90px);
    --companion-size: clamp(68px, 23vw, 96px);
    --companion-right: -38%;
    --companion-bottom: -28%;
  }

  .memory-ember {
    --memory-left: 76%;
    --memory-top: 35%;
    --memory-size: clamp(64px, 20vw, 92px);
    --companion-size: clamp(70px, 23vw, 98px);
    --companion-right: -35%;
    --companion-bottom: -30%;
  }

  .connection-line-one {
    left: 31%;
    top: 41%;
    width: 19%;
  }

  .connection-line-two {
    left: 49%;
    top: 35%;
    width: 18%;
  }

  .connection-line-three {
    left: 65%;
    top: 45%;
    width: 17%;
  }

  .story-fragment-field {
    inset: 40px 3% 34%;
  }

  .story-fragment-piece {
    width: clamp(92px, 30vw, 142px);
  }

  .fragment-wait {
    left: 30%;
    top: 34%;
  }

  .fragment-remember {
    left: 67%;
    top: 31%;
  }

  .fragment-believe {
    left: 49%;
    top: 55%;
  }

  .fragment-together {
    left: 72%;
    top: 63%;
  }

  .fragment-connect {
    left: 25%;
    top: 66%;
  }

  .story-chapter-label {
    top: 10px;
    left: 10px;
    max-width: calc(100% - 20px);
    font-size: 0.58rem;
  }

  .story-caption-footer {
    width: 100%;
    margin-top: 11px;
    font-size: 0.56rem;
  }

  .story-action {
    min-width: 170px;
    padding: 10px 14px;
  }

  .target-slot {
    width: clamp(64px, 15vw, 88px);
    opacity: 0.46;
  }

  .cutscene-mode {
    min-height: 0;
  }

  .cutscene-heading h2 {
    font-size: 1rem;
  }

  .cutscene-text {
    right: 5%;
    bottom: 58px;
    left: 5%;
    min-height: 96px;
    padding: 8px;
  }

  .cutscene-line {
    font-size: clamp(0.75rem, 3.4vw, 0.92rem);
    line-height: 1.45;
  }

  .fragment-reveal {
    right: 50%;
    bottom: 118px;
    width: min(280px, 72vw);
    padding: 7px 8px;
    gap: 5px;
    transform: translate(50%, 14px) scale(0.92);
  }

  .fragment-reveal::before {
    inset: -10px -12px -12px;
    border-radius: 22px 20px 25px 18px;
  }

  .fragment-reveal-title {
    font-size: clamp(0.64rem, 2.8vw, 0.76rem);
    letter-spacing: 0.1em;
  }

  .fragment-reveal-image {
    max-height: 108px;
  }

  .cutscene-layer.is-active .fragment-reveal {
    animation-name: fragment-card-reveal-mobile;
  }

  .cutscene-layer.is-still .fragment-reveal {
    transform: translate(50%, 0) scale(1);
  }

  .cutscene-skip {
    right: 12px;
    bottom: 10px;
  }

  .cutscene-next {
    right: 12px;
    bottom: 9px;
    min-width: 170px;
    padding: 10px 14px;
  }

  .sticker-scene {
    min-height: 0;
    border-width: 5px;
  }

  .sticker-tray {
    min-height: 78px;
    padding: 7px 8px 5px;
    overflow-x: auto;
  }

  .sticker-card {
    width: 54px;
    margin-left: -7px;
  }

  .tray-label {
    margin-bottom: 2px;
    font-size: 0.55rem;
  }

  .tray-items {
    width: max-content;
    min-width: 100%;
    justify-content: flex-start;
    padding-inline: 12px;
  }

  .page-actions {
    padding-inline: 14px;
  }

  .page-actions p {
    display: none;
  }

  .page-actions .paper-button {
    width: 100%;
  }

  .mini-pages {
    grid-template-columns: repeat(5, 82px);
    overflow-x: auto;
    padding: 0 4px 16px;
  }

  .ending-inner {
    width: calc(100% - 20px);
    gap: 16px;
  }

  .constellation-wrap {
    width: 100%;
  }

  .credits-stage {
    width: min(340px, 94%);
    height: min(330px, 46dvh);
  }

  .credits-track .credit-line {
    margin-bottom: 24px;
    font-size: clamp(1.05rem, 5.2vw, 1.42rem);
  }

  .anniversary-lockup {
    font-size: clamp(0.96rem, 5.3vw, 1.62rem);
  }

  .epilogue-page .anniversary-lockup {
    font-size: clamp(0.78rem, 3.7vw, 1rem);
  }

  .tiny-wish {
    font-size: 0.54rem;
    line-height: 1.55;
  }

  .dream-finale,
  .thanks-page {
    min-height: min(350px, 58dvh);
  }

  .dream-finale-title {
    font-size: clamp(2.55rem, 14vw, 4rem);
  }

  .dream-finale-subtitle,
  .thanks-line {
    font-size: clamp(1rem, 5vw, 1.28rem);
  }

  .ending-actions {
    flex-direction: column;
    align-items: center;
  }
}

@keyframes mobile-image-fade-in {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@media (max-width: 820px) {
  /* Mobile browsers can jitter when several transformed image layers are composited. */
  .story-illustration,
  .story-illustration-image,
  .story-illustration-book-cover .story-illustration-image,
  .story-visual-starai-pages .story-illustration-starai-pages,
  .story-visual-starai-pages .story-illustration-starai-pages .story-illustration-image,
  .story-visual-epilogue-note .story-illustration-image,
  .story-visual-starai-child .story-illustration-starai-child,
  .story-visual-starai-child .story-illustration-starai-child .story-illustration-image,
  .connection-memory-item,
  .connection-memory-companion,
  .sticker-visual img,
  .fragment-reveal-image {
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    will-change: auto !important;
  }

  .story-illustration {
    bottom: auto !important;
    height: min(calc((100vw - 18px) * 0.92), calc(62% - 30px), 360px);
    contain: layout paint;
  }

  .story-illustration-image,
  .story-illustration-book-cover .story-illustration-image,
  .story-visual-starai-pages .story-illustration-starai-pages .story-illustration-image,
  .story-visual-starai-child .story-illustration-starai-child .story-illustration-image {
    animation: none !important;
    transition: none !important;
    transform: none !important;
    filter: none !important;
  }

  .story-illustration-image,
  .fragment-reveal-image {
    filter: none !important;
  }

  .story-visual-pli-cover-reveal .story-illustration-image,
  .story-visual-epilogue-note .story-illustration-image {
    animation: mobile-image-fade-in 1.2s ease both !important;
    transform: none !important;
  }

  .story-visual-starai-pages .story-illustration-starai-pages {
    opacity: 1;
    animation: mobile-image-fade-in 1.2s ease both !important;
    transform: none !important;
  }

  .story-visual-starai-pages .story-caption {
    opacity: 1;
    animation: mobile-image-fade-in 700ms ease 1.2s both !important;
    transform: translateX(-50%) !important;
  }

  .story-visual-starai-child .story-illustration-starai-child {
    transform: none !important;
    transition: opacity 1.2s ease !important;
  }

  .story-mode.is-starai-revealed .story-illustration-starai-child {
    transform: none !important;
  }

  .story-atmosphere span,
  .starai-particles span {
    animation: none !important;
    transition: none !important;
    will-change: auto !important;
  }

  .connection-memory-item,
  .connection-memory-field:not(.is-constellation) .connection-memory-item,
  .connection-memory-field.is-animal-only .connection-memory-item {
    opacity: 1;
    animation: mobile-image-fade-in 900ms ease var(--memory-delay, 0s) both !important;
    transform: translate(-50%, -50%) rotate(var(--memory-rotate)) !important;
    filter: none;
  }

  .connection-memory-companion {
    opacity: 1;
    animation: mobile-image-fade-in 900ms ease both !important;
    transform: rotate(var(--companion-rotate)) !important;
    filter: none;
  }

  .connection-memory-field.is-animal-only .connection-memory-companion {
    transform: none !important;
  }

  .cutscene-layer.is-active .fragment-reveal {
    animation: mobile-image-fade-in 1s ease 1.1s both !important;
    transform: translate(50%, 0) !important;
  }

  .cutscene-layer.is-still .fragment-reveal {
    transform: translate(50%, 0) !important;
  }

  .target-slot,
  .placed-sticker,
  .dragging-sticker,
  .sticker-card,
  .sticker-page.is-complete .sticker-scene {
    animation: none !important;
    will-change: auto !important;
  }

  .target-slot {
    transition:
      opacity 160ms ease,
      box-shadow 160ms ease !important;
  }

  .sticker-card {
    transition: opacity 160ms ease !important;
  }

  .sticker-card:hover:not(:disabled),
  .sticker-card:active:not(:disabled) {
    filter: none;
    transform: translateY(var(--tray-y)) rotate(var(--tray-rotate));
  }

  .sticker-card.is-lifted {
    transform: translateY(var(--tray-y)) rotate(var(--tray-rotate));
  }

  .dragging-sticker {
    filter: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 1ms !important;
    animation-delay: 0ms !important;
    transition-duration: 1ms !important;
  }

  .page.turning {
    animation: none;
  }
}
