@font-face {
  font-family: HuZiShu;
  src: url("assets/fonts/MaShanZheng-Regular.ttf") format("truetype");
  font-display: swap;
}
:root {
  --night: #21191e;
  --wine: #733b4c;
  --rose: #bd7384;
  --blue: #667aa1;
  --ink: #382c31;
  --paper: #f2e7d2;
  --paper2: #e4d3ba;
  --gold: #c8a45a;
  --shadow: rgba(25, 13, 18, 0.42);
}
* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}
html,
body {
  margin: 0;
  min-height: 100%;
  background: radial-gradient(
    circle at 50% 0,
    #57424a 0,
    #2b2026 45%,
    #181216 100%
  );
  color: var(--ink);
  font-family: HuZiShu, "STKaiti", serif;
  overscroll-behavior: none;
}
button,
textarea {
  font: inherit;
}
.screen {
  display: none;
  min-height: 100dvh;
  padding: max(18px, env(safe-area-inset-top)) 16px
    max(24px, env(safe-area-inset-bottom));
  overflow: hidden;
}
.screen.active {
  display: flex;
  flex-direction: column;
  animation: fade-in 0.65s ease both;
}
.hidden {
  display: none !important;
}
#cover-screen {
  align-items: center;
  justify-content: center;
  perspective: 1600px;
  background: radial-gradient(
    circle at 50% 40%,
    rgba(193, 132, 145, 0.18),
    transparent 42%
  );
}
.ambient-stars {
  position: fixed;
  inset: 0;
  opacity: 0.35;
  background-image: radial-gradient(#f8df9b 1px, transparent 1px);
  background-size: 42px 42px;
  animation: drift 18s linear infinite;
}
.book-cover {
  position: relative;
  width: min(88vw, 430px);
  border: 0;
  padding: 0;
  background: none;
  filter: drop-shadow(0 30px 35px #0e090c);
  transform-style: preserve-3d;
  cursor: pointer;
}
.book-cover img {
  display: block;
  width: 100%;
  border-radius: 6px;
}
.book-cover:active {
  transform: scale(0.985) rotateY(-3deg);
}
.book-cover.opening {
  animation: open-book 1.15s cubic-bezier(0.2, 0.75, 0.2, 1) forwards;
}
.cover-copy {
  position: absolute;
  inset: 13% 8% auto;
  display: grid;
  gap: 8px;
  text-align: center;
  color: #542e39;
  text-shadow: 0 1px #fff8;
}
.cover-copy b {
  font-size: clamp(44px, 13vw, 72px);
  font-weight: 400;
  letter-spacing: 0.12em;
}
.cover-copy small {
  font-family: serif;
  letter-spacing: 0.12em;
}
.cover-ribbon {
  position: absolute;
  left: 14%;
  right: 14%;
  bottom: 8%;
  padding: 9px 14px;
  border: 1px solid rgba(91, 54, 56, 0.25);
  border-radius: 50%;
  background: rgba(242, 231, 210, 0.82);
  font-size: 18px;
}

/* 电影小说序章 */
#novel-screen {
  position: relative;
  isolation: isolate;
  padding: 0;
  background: radial-gradient(
    circle at 75% 18%,
    #67424c 0,
    #30252c 44%,
    #1d171b 100%
  );
  color: #f4e7d6;
  transition: background 0.8s;
  overflow: hidden;
}
#novel-screen[data-scene="red-sweater"],
#novel-screen[data-scene="finale"] {
  background: radial-gradient(
    circle at 66% 30%,
    #7c3944 0,
    #362329 43%,
    #1c171a 100%
  );
}
#novel-screen[data-scene="route"],
#novel-screen[data-scene="hotel"] {
  background: radial-gradient(
    circle at 75% 18%,
    #4d6272 0,
    #302c39 48%,
    #1d191f 100%
  );
}
#novel-screen[data-scene="changsha"],
#novel-screen[data-scene="warmth"],
#novel-screen[data-scene="home"] {
  background: radial-gradient(
    circle at 32% 30%,
    #76513d 0,
    #3c2c2c 45%,
    #21191d 100%
  );
}
#novel-screen[data-scene="steam"],
#novel-screen[data-scene="mist"],
#novel-screen[data-scene="release"] {
  background: radial-gradient(
    circle at 70% 25%,
    #5f6870 0,
    #35333b 48%,
    #211b21 100%
  );
}
.novel-atmosphere {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}
.novel-atmosphere:before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.33;
  background-image: radial-gradient(
    rgba(250, 219, 164, 0.75) 1px,
    transparent 1px
  );
  background-size: 54px 54px;
  mask-image: linear-gradient(to bottom, #000, transparent 76%);
  animation: drift 24s linear infinite;
}
.novel-moon {
  position: absolute;
  top: 9%;
  right: 9%;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  box-shadow: -16px 9px 0 0 #e9cfa0;
  opacity: 0.7;
  transform: rotate(-18deg);
}
.novel-city {
  position: absolute;
  left: -4%;
  right: -4%;
  bottom: 0;
  height: 27%;
  opacity: 0.26;
  background: linear-gradient(
    90deg,
    transparent 2%,
    #d0a475 2% 5%,
    transparent 5% 7%,
    #bd8a6d 7% 10%,
    transparent 10% 14%,
    #e4b07e 14% 17%,
    transparent 17% 20%,
    #ad826d 20% 26%,
    transparent 26% 30%,
    #d4a06d 30% 35%,
    transparent 35% 40%,
    #b77c69 40% 43%,
    transparent 43% 48%,
    #e1aa76 48% 55%,
    transparent 55% 61%,
    #b98368 61% 65%,
    transparent 65% 70%,
    #d5a37a 70% 76%,
    transparent 76% 82%,
    #ad7565 82% 87%,
    transparent 87%
  );
  clip-path: polygon(
    0 55%,
    3% 55%,
    3% 12%,
    6% 12%,
    6% 44%,
    11% 44%,
    11% 8%,
    15% 8%,
    15% 65%,
    23% 65%,
    23% 21%,
    28% 21%,
    28% 48%,
    34% 48%,
    34% 2%,
    40% 2%,
    40% 60%,
    47% 60%,
    47% 26%,
    52% 26%,
    52% 47%,
    59% 47%,
    59% 12%,
    65% 12%,
    65% 66%,
    72% 66%,
    72% 35%,
    77% 35%,
    77% 4%,
    83% 4%,
    83% 48%,
    90% 48%,
    90% 20%,
    95% 20%,
    95% 58%,
    100% 58%,
    100% 100%,
    0 100%
  );
}
.novel-thread {
  position: absolute;
  left: -10%;
  top: 45%;
  width: 120%;
  height: 120px;
  border-top: 2px dashed rgba(200, 90, 107, 0.7);
  border-radius: 50%;
  transform: rotate(-7deg);
  animation: thread-breathe 5s ease-in-out infinite;
}
.novel-glow {
  position: absolute;
  left: 50%;
  top: 42%;
  width: 480px;
  height: 480px;
  border-radius: 50%;
  background: rgba(216, 161, 132, 0.09);
  filter: blur(40px);
  transform: translate(-50%, -50%);
}
.novel-topbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  width: min(100%, 860px);
  margin: 0 auto;
  padding: max(15px, env(safe-area-inset-top)) 18px 8px;
  z-index: 3;
}
.novel-topbar > div {
  display: grid;
  text-align: center;
  gap: 2px;
}
.novel-topbar small {
  font-family: serif;
  font-size: 11px;
  letter-spacing: 0.2em;
  opacity: 0.62;
}
.novel-topbar b {
  font-weight: 400;
  font-size: 15px;
}
.novel-text-btn {
  border: 0;
  background: none;
  color: #ecd8c5;
  padding: 9px 0;
  opacity: 0.8;
  cursor: pointer;
}
.novel-text-btn:last-child {
  text-align: right;
}
.novel-stage {
  position: relative;
  display: grid;
  place-items: center;
  flex: 1;
  width: min(100%, 840px);
  min-height: 0;
  margin: auto;
  padding: 10px 18px;
  perspective: 1400px;
}
.novel-page {
  position: relative;
  width: min(100%, 650px);
  max-height: calc(100dvh - 185px);
  min-height: min(68dvh, 680px);
  overflow-y: auto;
  padding: clamp(35px, 7vw, 64px) clamp(28px, 7vw, 65px) 55px;
  color: #403239;
  background: linear-gradient(
    135deg,
    rgba(248, 239, 220, 0.98),
    rgba(225, 207, 181, 0.97)
  );
  border: 1px solid rgba(217, 183, 135, 0.75);
  border-radius: 3px 19px 4px 13px;
  box-shadow:
    0 30px 70px rgba(13, 8, 11, 0.62),
    inset 0 0 55px rgba(137, 99, 67, 0.07);
  transform-style: preserve-3d;
  cursor: pointer;
  scrollbar-width: none;
}
.novel-page::-webkit-scrollbar {
  display: none;
}
.novel-page:before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.28;
  background-image: repeating-linear-gradient(
    17deg,
    transparent 0 11px,
    rgba(102, 74, 50, 0.07) 12px 13px
  );
}
.novel-page:after {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(129, 82, 72, 0.15);
  pointer-events: none;
}
.novel-page.turn-next {
  animation: novel-page-next 0.62s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.novel-page.turn-prev {
  animation: novel-page-prev 0.62s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.novel-page-number {
  position: absolute;
  top: 20px;
  right: 25px;
  font:
    11px/1.3 Georgia,
    serif;
  letter-spacing: 0.18em;
  color: #9b786e;
}
.novel-kicker {
  position: relative;
  margin: 0 0 9px;
  color: #976073;
  font:
    12px/1.5 Georgia,
    "STSong",
    serif;
  letter-spacing: 0.15em;
}
.novel-page h1 {
  position: relative;
  margin: 0 0 26px;
  color: #784052;
  font-size: clamp(37px, 10vw, 58px);
  font-weight: 400;
  line-height: 1;
}
.novel-page h1:after {
  content: "";
  display: block;
  width: 62px;
  margin-top: 17px;
  border-top: 2px solid #ba7787;
}
.novel-copy {
  position: relative;
  font-family: "STSong", "Songti SC", serif;
  font-size: clamp(17px, 4.5vw, 21px);
  line-height: 1.9;
  letter-spacing: 0.035em;
}
.novel-copy p {
  margin: 0 0 1em;
}
.novel-copy p:first-child:first-letter {
  float: left;
  margin: 0.05em 0.12em 0 0;
  color: #8c465a;
  font-family: HuZiShu, serif;
  font-size: 2.8em;
  line-height: 0.82;
}
.novel-tap-hint {
  position: relative;
  margin: 25px 0 0;
  text-align: right;
  color: #9c776f;
  font-size: 12px;
  letter-spacing: 0.12em;
}
.novel-interaction {
  position: relative;
  width: min(100%, 650px);
  min-height: min(68dvh, 680px);
  padding: clamp(34px, 7vw, 60px) clamp(25px, 6vw, 50px);
  text-align: center;
  color: #49363d;
  background: linear-gradient(145deg, #f1e2ca, #dcc1a2);
  border: 1px solid #c39e70;
  border-radius: 14px 4px 17px 4px;
  box-shadow: 0 30px 70px rgba(13, 8, 11, 0.62);
  animation: novel-interaction-in 0.65s both;
}
.novel-interaction > small {
  color: #966074;
  letter-spacing: 0.12em;
}
.novel-interaction h2 {
  margin: 10px auto 24px;
  font-weight: 400;
  font-size: clamp(28px, 7vw, 42px);
  color: #754052;
}
.novel-game {
  --bed-shift: 0px;
  --thread-scale: 0;
  --heart-scale: 0.65;
  --wipe: 0%;
  min-height: 260px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 16px;
}
.novel-game-status {
  color: #8f6e67;
}
.novel-action,
.novel-continue {
  border: 1px solid rgba(121, 70, 83, 0.28);
  border-radius: 999px;
  padding: 11px 22px;
  background: #f7ead5;
  color: #754052;
  box-shadow: 0 7px 18px rgba(92, 54, 58, 0.15);
  cursor: pointer;
}
.novel-continue {
  margin-top: 8px;
  background: #80465a;
  color: #fff2df;
}
.novel-nav {
  display: flex;
  align-items: center;
  gap: 14px;
  width: min(100%, 680px);
  margin: 0 auto;
  padding: 5px 22px max(17px, env(safe-area-inset-bottom));
  z-index: 3;
}
.novel-arrow {
  flex: 0 0 45px;
  width: 45px;
  height: 45px;
  border: 1px solid rgba(244, 226, 203, 0.32);
  border-radius: 50%;
  background: rgba(45, 31, 38, 0.68);
  color: #f5e5d1;
  font: 34px/1 serif;
  cursor: pointer;
}
.novel-arrow:disabled {
  opacity: 0.25;
}
.novel-thread-progress {
  position: relative;
  flex: 1;
  height: 3px;
  background: rgba(248, 225, 199, 0.18);
  overflow: visible;
}
.novel-thread-progress:before,
.novel-thread-progress:after {
  content: "♡";
  position: absolute;
  top: 50%;
  color: #d08a98;
  transform: translateY(-50%);
}
.novel-thread-progress:before {
  left: -5px;
}
.novel-thread-progress:after {
  right: -5px;
}
.novel-thread-progress i {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #b75169, #e4b08b);
  transition: width 0.5s;
}
.spotlight-scene {
  position: relative;
  width: min(100%, 330px);
  height: 250px;
  border: 0;
  border-radius: 45% 45% 12px 12px;
  background: #30252b;
  color: #d9bfaa;
  overflow: hidden;
  cursor: pointer;
}
.spotlight-scene i {
  position: absolute;
  left: -80%;
  top: -70%;
  width: 150%;
  height: 170%;
  background: radial-gradient(
    circle at center,
    rgba(255, 231, 177, 0.82),
    transparent 55%
  );
  transition: transform 0.7s;
}
.spotlight-scene b {
  position: absolute;
  left: 50%;
  bottom: 60px;
  color: #8f3547;
  font-size: 35px;
  font-weight: 400;
  opacity: 0.2;
  transform: translateX(-50%);
  transition: opacity 0.7s;
}
.spotlight-scene span {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 22px;
}
.spotlight-scene.lit i {
  transform: translate(78%, 45%);
}
.spotlight-scene.lit b {
  opacity: 1;
}
.novel-counter {
  position: relative;
  width: 210px;
  height: 210px;
  border: 1px solid #be9c77;
  border-radius: 50%;
  background: conic-gradient(#b85c70 var(--angle, 0deg), #ead7bc 0);
  color: #65404c;
  cursor: pointer;
}
.novel-counter:before {
  content: "";
  position: absolute;
  inset: 12px;
  border-radius: 50%;
  background: #f1e2cb;
}
.novel-counter b,
.novel-counter span {
  position: relative;
  display: block;
  z-index: 1;
}
.novel-counter b {
  font-size: 44px;
  font-weight: 400;
}
.novel-counter span {
  margin-top: 5px;
}
.bed-scene {
  position: relative;
  width: min(100%, 350px);
  height: 155px;
}
.bed {
  position: absolute;
  top: 15px;
  width: 42%;
  height: 120px;
  border: 0;
  border-radius: 10px;
  background: #baa0b3;
  color: #fff;
  font-size: 56px;
  box-shadow: 0 11px 20px rgba(71, 44, 49, 0.18);
  transition: transform 0.4s;
}
.bed small {
  display: block;
  font-size: 13px;
}
.bed.left {
  left: 0;
  transform: translateX(var(--bed-shift));
}
.bed.right {
  right: 0;
  transform: translateX(calc(-1 * var(--bed-shift)));
}
.thread-scene {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(100%, 350px);
  height: 120px;
}
.thread-scene i {
  position: absolute;
  left: 14%;
  right: 14%;
  top: 50%;
  border-top: 2px dashed #b85066;
  transform: scaleX(var(--thread-scale));
  transition: transform 0.45s;
}
.thread-scene span,
.thread-scene b {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: #f5e5cf;
}
.thread-scene b {
  font-size: 30px;
  color: #b34f65;
  transform: scale(var(--heart-scale));
  transition: transform 0.4s;
}
.catch-scene {
  position: relative;
  width: min(100%, 330px);
  height: 250px;
  overflow: hidden;
  border-radius: 18px;
  background: linear-gradient(#3d3546, #7a5963);
}
.catch-scene button {
  position: absolute;
  left: 50%;
  top: 15px;
  border: 0;
  background: none;
  color: #e3a1ad;
  font-size: 58px;
  transform: translateX(-50%);
  animation: heart-fall 2s ease-in infinite;
}
.catch-scene button.caught {
  top: 165px;
  animation: none;
}
.catch-scene span {
  position: absolute;
  bottom: 20px;
  left: 0;
  right: 0;
  color: #f7e4cf;
}
.wipe-scene {
  position: relative;
  width: min(100%, 340px);
  height: 190px;
  border-radius: 18px;
  background: linear-gradient(145deg, #9a7d8c, #d7b8bd);
  overflow: hidden;
}
.wipe-scene:after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(233, 226, 218, 0.86);
  backdrop-filter: blur(13px);
  clip-path: inset(0 var(--wipe) 0 0);
  transition: clip-path 0.12s;
}
.wipe-scene.tear:after {
  background: linear-gradient(
    120deg,
    rgba(190, 202, 219, 0.93),
    rgba(235, 220, 221, 0.9)
  );
}
.wipe-scene.progress:after {
  background: linear-gradient(90deg, #aa8a98, #e5d3b9);
}
.wipe-scene b {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #754052;
  font-size: 42px;
  font-weight: 400;
}
.novel-game label {
  display: grid;
  gap: 7px;
  width: min(100%, 340px);
}
.novel-game input {
  width: 100%;
  accent-color: #9e5166;
}
.seal-scene {
  width: 210px;
  height: 210px;
  border: 1px solid #b59070;
  border-radius: 50%;
  background: #eee0c8;
  color: #744455;
  cursor: pointer;
  transition: transform 0.45s;
}
.seal-scene span,
.seal-scene b {
  display: block;
}
.seal-scene span {
  font-size: 25px;
}
.seal-scene b {
  margin-top: 12px;
  font-weight: 400;
}
.seal-scene.stamped {
  transform: scale(0.88) rotate(-6deg);
  box-shadow: inset 0 0 0 9px #a34f62;
  color: #923c50;
}
.topbar,
.chapter-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 780px;
  width: 100%;
  margin: 0 auto 10px;
  color: #f7ead6;
}
.topbar small {
  font-family: serif;
  letter-spacing: 0.16em;
  opacity: 0.62;
}
.topbar h1 {
  font-size: 32px;
  font-weight: 400;
  margin: 0;
}
.round-btn,
.paper-btn,
.primary-btn {
  border: 0;
  cursor: pointer;
}
.round-btn {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  background: #f2e7d2;
  color: #633849;
  font-size: 28px;
  box-shadow: 0 6px 18px var(--shadow);
}
.map-note {
  color: #e7d4c1;
  text-align: center;
  margin: 0 0 10px;
  opacity: 0.78;
}
.memory-map {
  position: relative;
  width: min(100%, 780px);
  margin: auto;
  border: 7px solid rgba(239, 223, 196, 0.85);
  border-radius: 18px;
  background: var(--paper);
  box-shadow: 0 25px 60px #100b0e;
  overflow: hidden;
}
.memory-map > img {
  display: block;
  width: 100%;
  min-height: 66dvh;
  object-fit: cover;
}
.map-hotspots {
  position: absolute;
  inset: 0;
}
.map-hotspot {
  position: absolute;
  display: grid;
  place-items: center;
  min-width: 52px;
  min-height: 52px;
  padding: 7px 9px;
  border: 1px solid #f4cf96;
  border-radius: 50%;
  background: radial-gradient(circle, #9d5265 0, #693849 70%);
  color: #fff4df;
  box-shadow:
    0 0 0 5px rgba(255, 235, 188, 0.22),
    0 0 22px #f7c887;
  animation: pulse 2.1s ease-in-out infinite;
  transform: translate(-50%, -50%);
  cursor: pointer;
}
.map-hotspot span {
  max-width: 72px;
  line-height: 1;
  font-size: 13px;
  text-align: center;
}
.map-hotspot.done {
  background: radial-gradient(circle, #7c8f78, #445e4d);
  box-shadow:
    0 0 0 5px rgba(212, 237, 204, 0.18),
    0 0 18px #dae8ac;
}
.map-hotspot:active {
  scale: 0.9;
}
.map-footer {
  width: min(100%, 780px);
  margin: 11px auto 0;
  color: #ead9c8;
  display: flex;
  justify-content: space-between;
  font-size: 14px;
}
#chapter-screen,
#memory-screen {
  background: radial-gradient(
    circle at 80% 0,
    rgba(145, 100, 124, 0.23),
    transparent 32%
  );
}
.chapter-header {
  font-size: 15px;
}
.paper-btn {
  padding: 9px 15px;
  border-radius: 999px;
  background: #f0e3cf;
  color: #583744;
  box-shadow: 0 4px 14px var(--shadow);
}
.chapter-card,
.memory-stage {
  position: relative;
  width: min(100%, 720px);
  margin: auto;
  background: linear-gradient(
    135deg,
    rgba(255, 250, 237, 0.97),
    rgba(229, 211, 183, 0.97)
  );
  border: 1px solid #c9aa7a;
  border-radius: 5px 22px 7px 17px;
  box-shadow: 0 28px 70px #100b0e;
  padding: 24px 20px;
  overflow: hidden;
}
.chapter-card:before,
.memory-stage:before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.28;
  background-image: repeating-linear-gradient(
    18deg,
    transparent 0 9px,
    rgba(104, 73, 46, 0.07) 10px 11px
  );
}
.chapter-heading {
  position: relative;
  text-align: center;
  border-bottom: 1px dashed #a6806f;
  padding-bottom: 17px;
}
.chapter-heading h2 {
  font-weight: 400;
  color: #7f4053;
  font-size: clamp(34px, 10vw, 54px);
  margin: 4px;
}
.chapter-heading p {
  font-size: 18px;
  margin: 8px auto;
  max-width: 450px;
}
.game-shell {
  position: relative;
  margin: 20px auto 14px;
  padding: 18px;
  border: 1px solid rgba(119, 72, 74, 0.23);
  border-radius: 18px;
  background: rgba(255, 250, 240, 0.58);
  box-shadow: inset 0 0 25px rgba(149, 105, 90, 0.08);
}
.game-shell h3 {
  margin: 0;
  color: #744053;
  font-weight: 400;
  font-size: 25px;
}
.game-shell p {
  margin: 5px 0 13px;
}
.primary-btn {
  display: block;
  margin: 14px auto 0;
  padding: 12px 25px;
  border-radius: 999px;
  color: #fff7e8;
  background: linear-gradient(135deg, #9b5268, #6f3a4b);
  box-shadow: 0 8px 18px rgba(86, 43, 56, 0.3);
}
.chapter-intro {
  position: relative;
  min-height: 250px;
  margin-top: 18px;
  padding: 24px;
  border-radius: 14px;
  perspective: 1000px;
  background: linear-gradient(145deg, #efe0c8, #ddc4a4);
  box-shadow: inset 0 0 0 1px #c7a678;
}
.intro-stage {
  height: 230px;
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(117, 75, 71, 0.23);
  background: rgba(255, 249, 235, 0.64);
  transform-style: preserve-3d;
}
.intro-stage:after {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px dashed rgba(117, 75, 71, 0.32);
}
.intro-symbol {
  font-size: 70px;
  filter: drop-shadow(0 12px 10px rgba(74, 42, 49, 0.18));
  animation: float 3s ease-in-out infinite;
}
.intro-copy {
  position: absolute;
  z-index: 2;
  left: 20px;
  right: 20px;
  bottom: 20px;
  text-align: center;
  font-size: 22px;
  color: #704052;
}
.intro-line {
  position: absolute;
  width: 70%;
  height: 4px;
  border-top: 3px dashed #b55468;
  transform: rotate(-9deg);
  animation: draw-line 2.2s ease both;
}
.intro-door {
  width: 100px;
  height: 150px;
  border: 7px solid #87634b;
  border-radius: 50% 50% 8px 8px;
  background: linear-gradient(90deg, #8c674d, #b68c66);
  transform-origin: left;
  animation: door-open 2.5s ease-in-out infinite alternate;
}
.intro-fold {
  width: 150px;
  height: 170px;
  background: #f6ebd5;
  border: 1px solid #bc9d76;
  box-shadow: 16px 12px 22px #8b6a5140;
  transform: rotateY(-28deg) rotateX(4deg);
  animation: fold 3s ease-in-out infinite alternate;
}
.memory-stage {
  transform-style: preserve-3d;
  animation: page-arrive 0.7s ease both;
}
.photo-frame {
  position: relative;
  width: 100%;
  min-height: 310px;
  border: 11px solid #fff8e9;
  box-shadow: 0 8px 20px rgba(69, 43, 42, 0.23);
  transform: rotate(-0.6deg);
  background: #c4af98;
  overflow: hidden;
}
.photo-frame img {
  display: block;
  width: 100%;
  max-height: 54dvh;
  min-height: 310px;
  object-fit: cover;
  transition:
    filter 1.1s,
    transform 1.1s,
    opacity 0.6s;
}
.photo-frame img.blurred {
  filter: blur(22px) saturate(0.55) brightness(0.65);
  transform: scale(1.12);
}
.photo-lock {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #fff9e9;
  text-shadow: 0 2px 8px #24161e;
  text-align: center;
  background: linear-gradient(transparent, rgba(35, 22, 28, 0.34));
}
.photo-lock span {
  font-size: 38px;
}
.photo-lock b {
  font-size: 23px;
}
.memory-copy {
  position: relative;
  margin-top: 20px;
}
.memory-copy small {
  color: #9b6070;
  letter-spacing: 0.12em;
}
.memory-copy h2 {
  font-size: 34px;
  font-weight: 400;
  margin: 4px 0;
}
.story-paper {
  font-size: 20px;
  line-height: 1.6;
  padding: 17px 18px;
  margin: 12px 0;
  background: #f7ecd8;
  border-left: 4px solid #bd7a8a;
  box-shadow: 0 4px 12px rgba(94, 62, 48, 0.12);
  animation: ink-in 0.9s both;
}
.memory-decoration i {
  position: absolute;
  color: #b98282;
  font-style: normal;
  font-size: 24px;
  z-index: 2;
}
.memory-decoration i:nth-child(1) {
  top: 7px;
  left: 9px;
}
.memory-decoration i:nth-child(2) {
  top: 16px;
  right: 15px;
}
.memory-decoration i:nth-child(3) {
  bottom: 90px;
  left: 7px;
}
.memory-decoration i:nth-child(4) {
  bottom: 18px;
  right: 12px;
}
.memory-nav {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
}
.memory-nav button:disabled {
  opacity: 0.35;
}
.memory-nav #page-dots {
  display: flex;
  gap: 5px;
}
.memory-nav #page-dots i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #c9af99;
}
.memory-nav #page-dots i.active {
  background: #85475c;
  scale: 1.35;
}
.mini-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  max-width: 270px;
  margin: 12px auto;
}
.mini-cell,
.memory-card,
.treasure,
.audi-tile,
.path-dot {
  border: 0;
  min-height: 50px;
  border-radius: 8px;
  background: #d9c4a9;
  color: #5f4050;
  cursor: pointer;
}
.mini-cell.target {
  outline: 2px dashed #9d5265;
}
.mini-cell.on {
  background: #9d5265;
  color: white;
}
.merge-board .mini-cell {
  font-family: serif;
  font-weight: 700;
}
.memory-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.memory-card {
  font-size: 0;
}
.memory-card.open,
.memory-card.matched {
  font-size: 28px;
  background: #e8c5cf;
}
.treasure-field {
  position: relative;
  height: 180px;
  overflow: hidden;
  border-radius: 12px;
  background: linear-gradient(#40304f, #1f2735);
}
.hook {
  position: absolute;
  top: -5px;
  left: 50%;
  width: 2px;
  height: 100px;
  background: #dac298;
  transform-origin: top;
  animation: swing 1.8s ease-in-out infinite alternate;
}
.hook:after {
  content: "ᒪ";
  position: absolute;
  bottom: -15px;
  left: -6px;
  color: #dac298;
}
.treasure {
  position: absolute;
  font-size: 25px;
  min-height: 42px;
}
.jump-track {
  height: 100px;
  position: relative;
  border-bottom: 5px solid #856853;
  overflow: hidden;
  background: linear-gradient(#b7c6d7, #ead9c1);
}
.jumper {
  position: absolute;
  bottom: 5px;
  left: 5%;
  font-size: 38px;
  transition:
    left 0.25s,
    bottom 0.15s;
}
.jumper.jump {
  bottom: 48px;
}
.heart-field {
  position: relative;
  height: 140px;
  border-radius: 12px;
  background: #ecd9df;
}
.catch-heart {
  position: absolute;
  border: 0;
  background: none;
  font-size: 36px;
  transition:
    left 0.2s,
    top 0.2s;
}
.range-wrap input {
  width: 100%;
  accent-color: #9b5268;
}
.lights-row {
  display: flex;
  justify-content: center;
  gap: 12px;
}
.light-btn {
  border: 0;
  background: none;
  font-size: 38px;
  filter: grayscale(1);
  opacity: 0.45;
}
.light-btn.on {
  filter: none;
  opacity: 1;
  filter: drop-shadow(0 0 12px #ffd46e);
}
.audi-board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}
.audi-tile {
  font-size: 28px;
  background: #dac8b4;
}
.path-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.path-dot {
  min-height: 42px;
  width: 42px;
  border-radius: 50%;
}
.path-dot.done {
  background: #9b5268;
  color: white;
}
.game-success {
  color: #6c7048;
  text-align: center;
  font-size: 22px;
  animation: pop 0.45s both;
}
.paper-dialog {
  border: 0;
  border-radius: 16px;
  padding: 24px;
  background: #f3e6d1;
  color: #442f37;
  box-shadow: 0 25px 80px #120b0e;
  width: min(88vw, 430px);
}
.paper-dialog::backdrop {
  background: rgba(20, 12, 16, 0.72);
  backdrop-filter: blur(5px);
}
.paper-dialog h2 {
  font-size: 30px;
  font-weight: 400;
}
.paper-dialog div {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}
.paper-dialog .primary-btn {
  display: inline-block;
  margin: 0;
}
.ending-wrap {
  margin: auto;
  width: min(92vw, 640px);
  text-align: center;
}
.ending-card {
  position: relative;
  min-height: 470px;
  perspective: 1200px;
  transform-style: preserve-3d;
  cursor: pointer;
}
.ending-front,
.ending-inside {
  position: absolute;
  inset: 0;
  border: 1px solid #c5a475;
  background: linear-gradient(145deg, #f1e2ca, #dfc6a6);
  box-shadow: 0 25px 60px #110b0e;
  backface-visibility: hidden;
  padding: 36px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.ending-front {
  transform-origin: left;
  transition: transform 1s;
}
.ending-card.open .ending-front {
  transform: rotateY(-165deg);
}
.ending-front span {
  font-size: 52px;
  color: #794052;
}
.ending-front b {
  font-weight: 400;
}
.ending-inside h2 {
  font-size: 52px;
  color: #8a465b;
  margin: 0;
}
.ending-inside p {
  font-size: 25px;
}
.ending-inside label {
  width: 100%;
  font-size: 18px;
}
.ending-inside textarea {
  display: block;
  width: 100%;
  margin-top: 10px;
  padding: 15px;
  border: 1px dashed #b08473;
  background: rgba(255, 250, 238, 0.65);
  color: #49363c;
  resize: none;
}
#ending-map {
  margin-top: 18px;
}
#toast {
  position: fixed;
  left: 50%;
  bottom: max(24px, env(safe-area-inset-bottom));
  transform: translate(-50%, 20px);
  padding: 10px 18px;
  border-radius: 999px;
  background: #2d2026;
  color: #f5e8d5;
  opacity: 0;
  pointer-events: none;
  transition: 0.25s;
  z-index: 20;
}
#toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes open-book {
  to {
    transform: rotateY(-94deg) translateX(-30%);
    opacity: 0;
  }
}
@keyframes pulse {
  50% {
    box-shadow:
      0 0 0 9px rgba(255, 235, 188, 0.11),
      0 0 30px #f7c887;
  }
}
@keyframes drift {
  to {
    background-position: 42px 84px;
  }
}
@keyframes thread-breathe {
  50% {
    opacity: 0.35;
    transform: rotate(-5deg) scaleX(0.94);
  }
}
@keyframes novel-page-next {
  from {
    opacity: 0.2;
    transform: translateX(42px) rotateY(17deg);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes novel-page-prev {
  from {
    opacity: 0.2;
    transform: translateX(-42px) rotateY(-17deg);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes novel-interaction-in {
  from {
    opacity: 0;
    transform: translateY(20px) rotateX(5deg);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes heart-fall {
  0%,
  100% {
    transform: translate(-50%, -10px) rotate(-6deg);
  }
  50% {
    transform: translate(-50%, 115px) rotate(8deg);
  }
}
@keyframes float {
  50% {
    transform: translateY(-14px) rotate(3deg);
  }
}
@keyframes draw-line {
  from {
    clip-path: inset(0 100% 0 0);
  }
  to {
    clip-path: inset(0);
  }
}
@keyframes door-open {
  to {
    transform: rotateY(-62deg);
  }
}
@keyframes fold {
  to {
    transform: rotateY(28deg) rotateX(-3deg);
  }
}
@keyframes page-arrive {
  from {
    opacity: 0;
    transform: rotateY(12deg) translateX(30px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes ink-in {
  from {
    opacity: 0;
    filter: blur(6px);
    transform: translateY(8px);
  }
}
@keyframes swing {
  from {
    transform: rotate(-34deg);
  }
  to {
    transform: rotate(34deg);
  }
}
@keyframes pop {
  50% {
    transform: scale(1.1);
  }
}
@media (min-width: 800px) {
  .screen {
    padding-left: 40px;
    padding-right: 40px;
  }
  .chapter-card,
  .memory-stage {
    padding: 32px;
  }
  .map-hotspot {
    min-width: 66px;
    min-height: 66px;
  }
  .map-hotspot span {
    font-size: 15px;
  }
}
@media (max-height: 700px) {
  .novel-page,
  .novel-interaction {
    min-height: 480px;
  }
  .novel-page {
    max-height: calc(100dvh - 155px);
    padding-top: 34px;
  }
  .novel-stage {
    padding-top: 4px;
  }
  .novel-topbar {
    padding-top: 10px;
  }
  .novel-nav {
    padding-bottom: 9px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *:before,
  *:after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
