/* =========================================================
   晚风里的告白 · A Short Visual Novel
   Pink & white, cinematic photo-album theme
   ========================================================= */

:root {
  --ink: #4e3440;
  --ink-soft: #795661;
  --ink-faint: #9f7a86;
  --pink: #e78ea8;
  --pink-deep: #d46f8f;
  --pink-deeper: #bd5677;
  --pink-soft: #f6c8d6;
  --pink-pale: #fff1f5;
  --blush: #ffe8ef;
  --cream: #fffaf8;
  --white: #fffdfd;
  --line: rgba(203, 126, 149, .24);
  --shadow-soft: 0 24px 60px rgba(139, 79, 99, .15);
  --shadow-photo: 0 30px 70px rgba(129, 70, 91, .22), 0 8px 22px rgba(129, 70, 91, .10);
  --font-serif: "Noto Serif SC", "Songti SC", "STSong", "Noto Serif CJK SC", "Source Han Serif SC", "SimSun", "Georgia", serif;
  --font-sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", system-ui, sans-serif;
  --font-latin: Georgia, "Times New Roman", serif;
  --ease-out: cubic-bezier(.2, .72, .22, 1);
}

*,
*::before,
*::after { box-sizing: border-box; }

[hidden] { display: none !important; }

html,
body {
  margin: 0;
  min-height: 100%;
}

html { -webkit-text-size-adjust: 100%; }

body {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 82% 6%, #ffe1ea 0, transparent 34%),
    radial-gradient(circle at 8% 94%, #ffedf2 0, transparent 38%),
    linear-gradient(135deg, #fffafb 0%, #fff2f6 48%, #ffe9f0 100%);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overscroll-behavior: none;
}

button,
input { font: inherit; }

button {
  border: 0;
  padding: 0;
  color: inherit;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

img {
  display: block;
  max-width: 100%;
}

svg { display: block; }

:focus-visible {
  outline: 2px solid var(--pink-deep);
  outline-offset: 3px;
}

::selection {
  color: var(--ink);
  background: var(--pink-soft);
}

.svg-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  width: 18px;
  height: 18px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------------------------------------------------------
   Ambient background
   --------------------------------------------------------- */

.ambient {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background: #fff6f8;
}

.ambient-layer {
  position: absolute;
  inset: -8%;
  background-repeat: no-repeat;
  background-position: center 30%;
  background-size: cover;
  filter: blur(52px) saturate(.78) brightness(1.22);
  opacity: 0;
  transform: scale(1.08);
  transition: opacity 1.5s var(--ease-out);
  will-change: opacity;
}

.ambient-layer.show { opacity: .38; }

.ambient-tint {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 18% 8%, rgba(255, 255, 255, .82), transparent 34%),
    radial-gradient(circle at 88% 92%, rgba(255, 208, 222, .52), transparent 42%),
    linear-gradient(112deg, rgba(255, 252, 252, .88) 0%, rgba(255, 248, 250, .60) 42%, rgba(255, 236, 242, .48) 100%);
}

.glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: .55;
  animation: glowFloat 14s ease-in-out infinite alternate;
}

.glow-a {
  top: -15%;
  right: 4%;
  width: 34vw;
  height: 34vw;
  background: radial-gradient(circle, rgba(255, 195, 213, .72), transparent 68%);
}

.glow-b {
  bottom: -22%;
  left: -7%;
  width: 38vw;
  height: 38vw;
  background: radial-gradient(circle, rgba(255, 225, 220, .66), transparent 68%);
  animation-delay: -6s;
}

.petals {
  position: absolute;
  inset: 0;
  overflow: hidden;
  z-index: 2;
}

.petal {
  position: absolute;
  top: -8vh;
  left: var(--x, 50%);
  width: var(--size, 9px);
  height: calc(var(--size, 9px) * .72);
  border-radius: 62% 38% 62% 38%;
  background: linear-gradient(135deg, rgba(255, 185, 205, .72), rgba(255, 235, 241, .22));
  opacity: 0;
  filter: blur(.2px);
  animation: petalFall var(--dur, 16s) linear infinite;
  animation-delay: var(--delay, 0s);
  will-change: transform;
}

.ambient-grain {
  position: absolute;
  inset: 0;
  opacity: .045;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
  background-size: 180px 180px;
}

/* ---------------------------------------------------------
   Application frame / header
   --------------------------------------------------------- */

.app {
  position: relative;
  z-index: 3;
  height: 100vh;
  height: 100dvh;
  max-width: 1480px;
  margin: 0 auto;
  padding: 0 clamp(16px, 4.4vw, 64px) max(12px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  transition: opacity .55s var(--ease-out), transform .55s var(--ease-out);
}

.app.is-faded {
  opacity: 0;
  transform: scale(.992);
  pointer-events: none;
}

.topbar {
  position: relative;
  z-index: 10;
  flex: 0 0 auto;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  user-select: none;
}

.brand-mark {
  width: 37px;
  height: 37px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff8fa;
  background: linear-gradient(145deg, #f2a8bd, #dd7d9b);
  box-shadow: 0 8px 18px rgba(205, 104, 134, .24), inset 0 1px 0 rgba(255, 255, 255, .5);
}

.brand-mark .icon {
  width: 17px;
  height: 17px;
  fill: currentColor;
  stroke: none;
  transform: translateY(1px);
}

.brand-copy {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.brand-copy strong {
  overflow: hidden;
  color: #5a3945;
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: .15em;
  white-space: nowrap;
}

.brand-copy small {
  color: #b58e9a;
  font-family: var(--font-latin);
  font-size: 7px;
  letter-spacing: .205em;
  white-space: nowrap;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn,
.pill-btn {
  height: 40px;
  color: #7f5a67;
  background: rgba(255, 253, 253, .56);
  border: 1px solid rgba(211, 143, 164, .30);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6);
  backdrop-filter: blur(13px) saturate(1.1);
  transition: color .22s, background .22s, border-color .22s, transform .22s, box-shadow .22s;
}

.icon-btn {
  width: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
}

.pill-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 14px 0 12px;
  border-radius: 999px;
  font-size: 11px;
  letter-spacing: .13em;
}

.icon-btn:hover,
.pill-btn:hover {
  color: var(--pink-deep);
  background: rgba(255, 252, 253, .92);
  border-color: rgba(213, 111, 142, .48);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(166, 88, 111, .12), inset 0 1px 0 #fff;
}

.icon-btn:active,
.pill-btn:active { transform: translateY(0) scale(.97); }

.pill-btn.is-active {
  color: #fff;
  background: linear-gradient(135deg, #efa6bc, #df7f9d);
  border-color: transparent;
  box-shadow: 0 8px 20px rgba(205, 100, 132, .24), inset 0 1px 0 rgba(255, 255, 255, .35);
}

.auto-icon {
  width: 14px;
  height: 14px;
  display: grid;
  place-items: center;
}

.auto-icon .icon { width: 13px; height: 13px; }

.auto-pause { display: none; }
.pill-btn.is-active .auto-play { display: none; }
.pill-btn.is-active .auto-pause { display: block; }

.sound-off { display: none; }
#btnSound.is-muted .sound-on { display: none; }
#btnSound.is-muted .sound-off { display: block; }

#settingsSound .sound-off { display: none; }
#settingsSound.is-muted .sound-on { display: none; }
#settingsSound.is-muted .sound-off { display: block; }

/* ---------------------------------------------------------
   Stage / photo album
   --------------------------------------------------------- */

.stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(7px, 1.4vh, 16px) 0 clamp(9px, 1.6vh, 17px);
}

.chapter-rail {
  position: absolute;
  top: 50%;
  left: 1px;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: rgba(111, 76, 88, .48);
  pointer-events: none;
  user-select: none;
}

.rail-code,
.rail-title {
  writing-mode: vertical-rl;
  text-orientation: mixed;
}

.rail-code {
  color: #b6788b;
  font-family: var(--font-latin);
  font-size: 8px;
  letter-spacing: .34em;
}

.rail-rule {
  width: 1px;
  height: 42px;
  background: linear-gradient(180deg, transparent, rgba(210, 139, 159, .55), transparent);
}

.rail-title {
  color: rgba(104, 70, 82, .58);
  font-family: var(--font-serif);
  font-size: 11.5px;
  letter-spacing: .30em;
}

.rail-heart {
  color: rgba(220, 127, 154, .65);
  font-family: var(--font-serif);
  font-size: 11px;
}

.stage-quote {
  position: absolute;
  top: 50%;
  right: 1px;
  margin: 0;
  transform: translateY(-50%);
  writing-mode: vertical-rl;
  color: rgba(115, 78, 91, .30);
  font-family: var(--font-serif);
  font-size: 11px;
  letter-spacing: .30em;
  pointer-events: none;
  user-select: none;
  white-space: nowrap;
}

.visual {
  position: relative;
  max-width: 100%;
  max-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.photo-card {
  --tilt: -.6deg;
  position: relative;
  z-index: 1;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  padding: clamp(7px, .7vw, 10px) clamp(7px, .7vw, 10px) 0;
  border-radius: 5px;
  background: linear-gradient(180deg, #fffefd 0%, #fffcfa 60%, #fff7f8 100%);
  box-shadow:
    var(--shadow-photo),
    inset 0 0 0 1px rgba(255, 255, 255, .9);
  transform: rotate(var(--tilt));
  transform-origin: 50% 70%;
  transition: transform .8s var(--ease-out), box-shadow .3s;
  animation: photoCardIn .85s var(--ease-out) both;
}

.photo-card::after {
  content: "";
  position: absolute;
  inset: 11px -8px -8px 11px;
  z-index: -1;
  border: 1px solid rgba(219, 158, 177, .32);
  border-radius: 6px;
  background: rgba(255, 255, 255, .30);
  transform: rotate(1.3deg);
}

.photo-card.landscape .photo-media img {
  max-height: min(39vh, 420px);
  max-width: min(77vw, 760px);
}

.photo-media {
  position: relative;
  display: flex;
  justify-content: center;
  overflow: hidden;
  border-radius: 2px;
  background: #f8e5eb;
}

.photo-media::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background: linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, .34) 44%, transparent 68%);
  transform: translateX(-100%);
  animation: photoShimmer 1.8s ease .1s 1;
  pointer-events: none;
}

.photo-media img {
  position: relative;
  z-index: 1;
  display: block;
  width: auto;
  height: auto;
  max-width: min(77vw, 520px);
  max-height: min(56vh, 620px);
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
}

.photo-media img.is-revealing {
  animation: photoReveal .75s var(--ease-out) both;
}

.washi {
  position: absolute;
  z-index: 3;
  top: -10px;
  left: 50%;
  width: 92px;
  height: 23px;
  transform: translateX(-50%) rotate(-2deg);
  background:
    linear-gradient(90deg, rgba(255, 198, 214, .58), rgba(255, 228, 234, .74) 48%, rgba(245, 177, 198, .55));
  border-left: 1px solid rgba(255, 255, 255, .35);
  border-right: 1px solid rgba(255, 255, 255, .35);
  clip-path: polygon(2% 3%, 98% 0, 96% 96%, 4% 100%, 0 62%);
  opacity: .88;
  pointer-events: none;
}

.watermark-cover {
  position: absolute;
  z-index: 2;
  right: 3.1%;
  bottom: 3.1%;
  padding: 4px 9px 5px;
  border: 1px solid rgba(207, 130, 153, .30);
  border-radius: 999px;
  color: #b4667d;
  background: rgba(255, 247, 249, .88);
  box-shadow: 0 4px 12px rgba(127, 70, 89, .12);
  backdrop-filter: blur(5px);
  font-family: var(--font-serif);
  font-size: 9px;
  letter-spacing: .08em;
  white-space: nowrap;
  pointer-events: none;
}

.photo-caption,
.phone-caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  height: 38px;
  padding: 0 6px;
  color: #98727e;
  font-family: var(--font-serif);
  font-size: 10.5px;
  letter-spacing: .13em;
  white-space: nowrap;
}

.photo-no {
  color: #cd8ba0;
  font-family: var(--font-latin);
  font-size: 9.5px;
  letter-spacing: .18em;
}

/* phone mock-up for the selfie scene */

.phone-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  transform: rotate(.7deg);
  animation: photoCardIn .85s var(--ease-out) both;
}

.phone-shell {
  position: relative;
  width: clamp(196px, 23vw, 262px);
  padding: 9px;
  border-radius: 43px;
  background: linear-gradient(145deg, #fffefd, #ffedf2 68%, #ffe3eb);
  box-shadow:
    0 36px 76px rgba(128, 68, 89, .25),
    0 8px 20px rgba(128, 68, 89, .10),
    inset 0 0 0 1px rgba(255, 255, 255, .92),
    inset 0 -1px 0 rgba(208, 132, 154, .22);
}

.phone-speaker {
  position: absolute;
  z-index: 4;
  top: 16px;
  left: 50%;
  width: 54px;
  height: 5px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: #e0b8c4;
  box-shadow: inset 0 1px 1px rgba(123, 68, 85, .22);
}

.phone-screen {
  position: relative;
  display: flex;
  flex-direction: column;
  aspect-ratio: 9 / 18.6;
  overflow: hidden;
  border-radius: 35px;
  background: #fff6f8;
  box-shadow: inset 0 0 0 1px rgba(102, 55, 70, .10);
}

.phone-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 17px 18px 4px;
  color: #80606a;
  font-family: var(--font-sans);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: .02em;
}

.phone-signal {
  color: #b78594;
  font-size: 5px;
  letter-spacing: 2px;
}

.phone-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 10px 16px 8px;
  color: #5a3b46;
  font-family: var(--font-serif);
  font-size: 14px;
  letter-spacing: .08em;
}

.phone-today {
  color: #b28492;
  font-family: var(--font-sans);
  font-size: 8px;
  letter-spacing: .06em;
}

.phone-photo {
  position: relative;
  flex: 1;
  min-height: 0;
  margin: 0 8px;
  overflow: hidden;
  border-radius: 11px;
  background: #f3dfe5;
}

.phone-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 24%;
  user-select: none;
  -webkit-user-drag: none;
}

.phone-like {
  position: absolute;
  right: 9px;
  bottom: 9px;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #e889a4;
  background: rgba(255, 255, 255, .78);
  box-shadow: 0 3px 10px rgba(96, 48, 63, .16);
  backdrop-filter: blur(5px);
  font-family: var(--font-serif);
  font-size: 16px;
}

.phone-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 15px 13px;
  color: #a67886;
  font-size: 7.5px;
  letter-spacing: .04em;
}

.phone-tools b {
  color: #d77c99;
  font-weight: 600;
}

.phone-caption {
  width: 100%;
  margin-top: 5px;
  padding: 0 4px;
}

/* ---------------------------------------------------------
   Dialogue / choices
   --------------------------------------------------------- */

.dialogue-wrap {
  position: relative;
  z-index: 6;
  flex: 0 0 auto;
  width: min(900px, 100%);
  margin: 0 auto;
}

.choices {
  margin-bottom: 14px;
  animation: riseIn .5s var(--ease-out) both;
}

.choice-eyebrow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 9px;
  color: #b57b8e;
  font-size: 9px;
  letter-spacing: .32em;
}

.choice-eyebrow span {
  width: 26px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(211, 129, 152, .55));
}

.choice-eyebrow span:last-child {
  background: linear-gradient(90deg, rgba(211, 129, 152, .55), transparent);
}

.choice-eyebrow em {
  font-style: normal;
}

.choice-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.choice-card {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  overflow: hidden;
  padding: 14px 21px;
  border: 1px solid rgba(214, 137, 160, .38);
  border-radius: 17px;
  color: var(--ink);
  background: linear-gradient(135deg, rgba(255, 252, 252, .97), rgba(255, 239, 244, .92));
  box-shadow: 0 14px 34px rgba(162, 92, 114, .13), inset 0 1px 0 rgba(255, 255, 255, .8);
  font-family: var(--font-serif);
  font-size: clamp(15px, 1.4vw, 17px);
  letter-spacing: .055em;
  text-align: left;
  backdrop-filter: blur(15px);
  transition: transform .25s var(--ease-out), border-color .25s, box-shadow .25s;
}

.choice-card::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0;
  background: linear-gradient(90deg, rgba(244, 166, 188, .18), transparent 58%);
  transition: opacity .25s;
}

.choice-card:hover {
  transform: translateY(-2px);
  border-color: rgba(215, 107, 139, .58);
  box-shadow: 0 20px 42px rgba(162, 92, 114, .19), inset 0 1px 0 #fff;
}

.choice-card:hover::before { opacity: 1; }

.choice-index,
.choice-heart {
  position: relative;
  z-index: 1;
}

.choice-index {
  width: 27px;
  height: 27px;
  flex: none;
  display: grid;
  place-items: center;
  border: 1px solid rgba(211, 133, 156, .34);
  border-radius: 50%;
  color: var(--pink-deep);
  background: rgba(255, 255, 255, .82);
  font-family: var(--font-latin);
  font-size: 9px;
  letter-spacing: 0;
}

.choice-label {
  position: relative;
  z-index: 1;
}

.choice-heart {
  margin-left: auto;
  color: var(--pink);
  font-family: var(--font-serif);
  font-size: 17px;
  opacity: .5;
  transition: opacity .25s, transform .25s;
}

.choice-card:hover .choice-heart {
  opacity: 1;
  transform: scale(1.12);
}

/* The one answer that matters gets a softer, warmer card. */
.choices.is-single .choice-card {
  border-color: rgba(210, 93, 129, .52);
  background: linear-gradient(135deg, rgba(255, 250, 252, .99), rgba(255, 228, 238, .96));
  box-shadow: 0 16px 38px rgba(191, 95, 126, .18), inset 0 1px 0 #fff;
}

.choices.is-single .choice-card::before { opacity: .5; }

.choices.is-single .choice-heart {
  opacity: .95;
  color: #d35d81;
}

.choice-card:disabled { cursor: default; }

.choice-card:disabled:not(.is-selected) {
  opacity: .46;
  filter: saturate(.72);
  transform: none;
  box-shadow: 0 8px 20px rgba(162, 92, 114, .07), inset 0 1px 0 rgba(255, 255, 255, .72);
}

.choice-card.is-selected {
  border-color: rgba(210, 93, 129, .74);
  background: linear-gradient(135deg, rgba(255, 247, 250, .99), rgba(255, 220, 231, .96));
  box-shadow:
    0 0 0 3px rgba(226, 143, 167, .16),
    0 20px 46px rgba(191, 95, 126, .24),
    inset 0 1px 0 #fff;
  transform: translateY(-1px);
}

.choice-card.is-selected::before { opacity: 1; }

.choice-card.is-selected .choice-index {
  color: #fffafb;
  border-color: transparent;
  background: linear-gradient(135deg, #efa6bc, #dd7d9b);
  box-shadow: 0 4px 10px rgba(197, 98, 128, .24);
}

.choice-card.is-selected .choice-heart {
  opacity: 1;
  transform: scale(1.24) rotate(-6deg);
}

/* Keep the folded photo compact while a choice is on screen. */
.app.choosing .photo-media img {
  max-height: min(33vh, 350px);
}

.app.choosing .photo-card.landscape .photo-media img {
  max-height: min(25vh, 230px);
}

.app.choosing .phone-shell {
  width: clamp(168px, 18vw, 208px);
}

.app.choosing .photo-caption,
.app.choosing .phone-caption {
  height: 31px;
}

.app.choosing .dialogue-card {
  min-height: 122px;
}

.app.choosing .quote-mark { opacity: .34; }

.dialogue-card {
  position: relative;
  min-height: clamp(144px, 17.5vh, 178px);
  padding: clamp(25px, 2.8vw, 34px) clamp(24px, 3.8vw, 46px) 16px;
  border: 1px solid rgba(214, 143, 163, .34);
  border-radius: 26px;
  background: linear-gradient(135deg, rgba(255, 253, 252, .91), rgba(255, 241, 245, .86));
  box-shadow:
    0 25px 60px rgba(151, 84, 105, .16),
    inset 0 1px 0 rgba(255, 255, 255, .92);
  backdrop-filter: blur(18px) saturate(1.12);
  cursor: pointer;
  transition: border-color .25s, box-shadow .25s, background .25s;
}

.dialogue-card::after {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(218, 151, 171, .13);
  border-radius: 18px;
  pointer-events: none;
}

.dialogue-card:hover {
  border-color: rgba(220, 119, 149, .48);
  box-shadow:
    0 28px 66px rgba(151, 84, 105, .20),
    inset 0 1px 0 rgba(255, 255, 255, .94);
}

.dialogue-card.is-narration {
  background: linear-gradient(135deg, rgba(255, 252, 251, .89), rgba(255, 242, 246, .83));
}

.name-tag {
  position: absolute;
  z-index: 3;
  top: -16px;
  left: clamp(22px, 3.2vw, 40px);
  display: flex;
  align-items: center;
  min-height: 33px;
  padding: 7px 19px 8px;
  border-radius: 999px;
  color: #fffafb;
  background: linear-gradient(135deg, #f2a8be, #df7e9d);
  box-shadow: 0 9px 22px rgba(206, 104, 135, .26), inset 0 1px 0 rgba(255, 255, 255, .38);
  font-family: var(--font-serif);
  font-size: 14px;
  letter-spacing: .17em;
  white-space: nowrap;
}

.name-tag::before {
  content: "";
  width: 4px;
  height: 4px;
  margin-right: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .82);
}

.name-tag.me {
  color: #77525f;
  background: linear-gradient(135deg, #f7e6eb, #eecbd6);
  box-shadow: 0 9px 20px rgba(158, 106, 124, .16), inset 0 1px 0 rgba(255, 255, 255, .55);
}

.name-tag.is-hidden { display: none; }

.quote-mark {
  position: absolute;
  z-index: 0;
  top: 7px;
  right: 27px;
  color: rgba(219, 137, 160, .15);
  font-family: Georgia, serif;
  font-size: 55px;
  line-height: 1;
  pointer-events: none;
  user-select: none;
}

.dialogue-text {
  position: relative;
  z-index: 1;
  min-height: 2.9em;
  margin: 0;
  color: #4f3541;
  font-family: var(--font-serif);
  font-size: clamp(16.5px, 1.38vw, 19px);
  letter-spacing: .055em;
  line-height: 1.95;
  text-align: left;
  text-wrap: pretty;
  user-select: none;
}

.dialogue-text.is-typing::after {
  content: "▍";
  display: inline-block;
  margin-left: 2px;
  color: #dd89a5;
  font-size: .78em;
  vertical-align: .08em;
  animation: cursorBlink .8s steps(1) infinite;
}

.dialogue-card.is-narration .dialogue-text {
  color: #7a5663;
  font-size: clamp(15px, 1.22vw, 17px);
  letter-spacing: .09em;
  line-height: 2.05;
  text-align: center;
}

.dialogue-card.is-action .dialogue-text {
  color: #8d6874;
  font-size: clamp(14.5px, 1.15vw, 16px);
  letter-spacing: .045em;
}

.dialogue-foot {
  position: relative;
  z-index: 1;
  min-height: 16px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 6px;
  padding-right: 2px;
}

.foot-hint {
  color: #b28d99;
  font-family: var(--font-sans);
  font-size: 8.5px;
  letter-spacing: .17em;
  opacity: .82;
}

.next-heart {
  color: #de8ca7;
  font-family: var(--font-serif);
  font-size: 15px;
  opacity: 0;
  transform: translateY(3px);
  transition: opacity .3s, transform .3s;
  animation: heartBeat 1.7s ease-in-out infinite;
}

.dialogue-card.is-ready .next-heart {
  opacity: 1;
  transform: translateY(0);
}

.is-hidden { visibility: hidden !important; }

/* base motion */

@keyframes glowFloat {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(2vw, 2vh, 0) scale(1.08); }
}

@keyframes petalFall {
  0% { transform: translate3d(0, -8vh, 0) rotate(0deg); opacity: 0; }
  8% { opacity: .8; }
  54% { transform: translate3d(3vw, 55vh, 0) rotate(130deg); opacity: .75; }
  100% { transform: translate3d(-2vw, 112vh, 0) rotate(250deg); opacity: 0; }
}

@keyframes photoCardIn {
  from { opacity: 0; transform: translateY(16px) rotate(calc(var(--tilt) - .5deg)) scale(.985); }
  to { opacity: 1; transform: translateY(0) rotate(var(--tilt)) scale(1); }
}

@keyframes photoReveal {
  from { opacity: 0; transform: scale(1.028); filter: blur(5px); }
  to { opacity: 1; transform: scale(1); filter: blur(0); }
}

@keyframes photoShimmer {
  to { transform: translateX(110%); }
}

@keyframes riseIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes cursorBlink {
  0%, 48% { opacity: 1; }
  49%, 100% { opacity: 0; }
}

@keyframes heartBeat {
  0%, 100% { transform: scale(1); }
  18% { transform: scale(1.18); }
  32% { transform: scale(.98); }
  46% { transform: scale(1.08); }
}

/* ---------------------------------------------------------
   Buttons
   --------------------------------------------------------- */

.btn {
  min-height: 50px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 0 27px;
  border-radius: 999px;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: .12em;
  white-space: nowrap;
  transition: transform .25s var(--ease-out), background .25s, border-color .25s, box-shadow .25s, color .25s;
}

.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0) scale(.985); }

.btn-primary {
  position: relative;
  overflow: hidden;
  color: #fffdfd;
  background: linear-gradient(135deg, #f0a3b9 0%, #e5829f 55%, #d97090 100%);
  box-shadow:
    0 16px 34px rgba(206, 99, 133, .28),
    0 2px 6px rgba(172, 75, 104, .12),
    inset 0 1px 0 rgba(255, 255, 255, .38);
}

.btn-primary::after {
  content: "";
  position: absolute;
  top: 0;
  left: -60%;
  width: 42%;
  height: 100%;
  transform: skewX(-22deg);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .28), transparent);
  transition: left .7s var(--ease-out);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #f3aec3 0%, #e88ba7 55%, #dc7898 100%);
  box-shadow:
    0 20px 40px rgba(206, 99, 133, .34),
    0 2px 6px rgba(172, 75, 104, .10),
    inset 0 1px 0 rgba(255, 255, 255, .4);
}

.btn-primary:hover::after { left: 118%; }

.btn-arrow {
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 400;
  letter-spacing: 0;
}

.btn-ghost {
  color: #73505c;
  background: rgba(255, 253, 253, .48);
  border: 1px solid rgba(209, 140, 161, .36);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .64);
  backdrop-filter: blur(10px);
}

.btn-ghost:hover {
  color: var(--pink-deep);
  background: rgba(255, 252, 253, .84);
  border-color: rgba(214, 111, 142, .48);
  box-shadow: 0 10px 24px rgba(160, 90, 111, .12), inset 0 1px 0 #fff;
}

.btn-quiet {
  min-height: 44px;
  padding: 0 8px;
  color: #a37e89;
  background: transparent;
  font-size: 12px;
  letter-spacing: .10em;
}

.btn-quiet:hover {
  color: var(--pink-deep);
  transform: translateY(-1px);
}

.btn .icon { width: 16px; height: 16px; }

.btn-continue {
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 1px;
  min-height: 54px;
  padding: 9px 23px 10px;
  text-align: left;
}

.btn-continue small {
  max-width: 210px;
  overflow: hidden;
  color: #aa8390;
  font-size: 9px;
  letter-spacing: .06em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-continue.btn-primary small { color: rgba(255, 247, 249, .76); }

/* ---------------------------------------------------------
   Cover
   --------------------------------------------------------- */

.cover {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: clamp(24px, 5vh, 64px) clamp(20px, 6vw, 84px);
  background: #fff7f9;
  transition: opacity .72s var(--ease-out), visibility .72s;
}

.cover.is-closing {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.cover-bg {
  position: absolute;
  inset: -6%;
  background: url("../assets/scene1.webp") center 28% / cover no-repeat;
  filter: blur(40px) saturate(.72) brightness(1.35);
  opacity: .30;
  transform: scale(1.07);
}

.cover-shade {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 76% 30%, rgba(255, 225, 234, .12), transparent 35%),
    radial-gradient(circle at 12% 78%, rgba(255, 255, 255, .40), transparent 36%),
    linear-gradient(112deg, rgba(255, 250, 251, .97) 0%, rgba(255, 245, 248, .92) 43%, rgba(255, 227, 235, .56) 100%);
}

.cover-inner {
  position: relative;
  z-index: 2;
  width: min(1180px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(320px, .92fr);
  align-items: center;
  gap: clamp(28px, 5vw, 82px);
}

.cover-copy {
  max-width: 660px;
  animation: coverCopyIn 1s var(--ease-out) both .1s;
}

.cover-avatar {
  display: none;
  width: 76px;
  height: 76px;
  margin: 0 auto 20px;
  padding: 4px;
  border: 1px solid rgba(214, 141, 162, .38);
  border-radius: 50%;
  background: rgba(255, 252, 252, .65);
  box-shadow: 0 12px 30px rgba(154, 87, 108, .15);
  backdrop-filter: blur(8px);
}

.cover-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 28%;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  color: #bd738b;
  font-family: var(--font-latin);
  font-size: 9px;
  letter-spacing: .35em;
  white-space: nowrap;
}

.eyebrow-line {
  display: inline-block;
  width: 36px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(202, 112, 140, .68));
}

.eyebrow-line-short {
  width: 18px;
  background: linear-gradient(90deg, rgba(202, 112, 140, .68), transparent);
}

.cover-title {
  margin: 22px 0 19px;
  color: #553440;
  font-family: var(--font-serif);
  font-size: clamp(48px, 6.7vw, 94px);
  font-weight: 500;
  letter-spacing: .035em;
  line-height: 1.1;
  text-shadow: 0 2px 0 rgba(255, 255, 255, .55);
}

.title-accent {
  position: relative;
  display: inline-block;
  color: var(--pink-deep);
  background: linear-gradient(135deg, #c9567b 8%, #df7d9a 62%, #e892ab 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

@supports not ((-webkit-background-clip: text) or (background-clip: text)) {
  .title-accent { color: var(--pink-deep); }
}

.title-heart {
  position: absolute;
  top: -.34em;
  right: -.44em;
  color: #eea3b9;
  font-family: var(--font-serif);
  font-size: .23em;
  font-style: normal;
  letter-spacing: 0;
  -webkit-text-fill-color: #eea3b9;
  transform: rotate(14deg);
  animation: tinyHeart 3.2s ease-in-out infinite;
}

.cover-sub {
  margin: 0;
  color: #7c5965;
  font-family: var(--font-serif);
  font-size: clamp(16px, 1.75vw, 21px);
  letter-spacing: .10em;
  line-height: 2.05;
}

.cover-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 11px;
  margin: 23px 0 30px;
  color: #a77f8c;
  font-size: 10px;
  letter-spacing: .16em;
}

.cover-meta i {
  display: inline-block;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #d8a9b6;
}

.meta-headphones {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.meta-headphones .icon {
  width: 13px;
  height: 13px;
  color: #c68599;
}

.cover-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 13px;
}

.cover-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 20px 0 0;
  color: #b396a0;
  font-size: 9.5px;
  letter-spacing: .10em;
}

.cover-dot {
  width: 5px;
  height: 5px;
  flex: none;
  border-radius: 50%;
  background: #e4a6b8;
  box-shadow: 0 0 0 3px rgba(228, 166, 184, .16);
}

.cover-art {
  position: relative;
  height: clamp(420px, 63vh, 620px);
  animation: coverArtIn 1.1s var(--ease-out) both .22s;
}

.cover-photo {
  position: absolute;
  z-index: 1;
  margin: 0;
  padding: 10px 10px 12px;
  border-radius: 3px;
  background: #fffdfd;
  box-shadow: 0 30px 65px rgba(128, 69, 89, .24), 0 4px 12px rgba(128, 69, 89, .10);
}

.cover-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  user-select: none;
  -webkit-user-drag: none;
}

.cover-photo-front {
  right: 9%;
  bottom: 4%;
  width: clamp(220px, 23vw, 310px);
  transform: rotate(-3.6deg);
}

.cover-photo-front img {
  aspect-ratio: 3 / 4;
  object-position: center 27%;
}

.cover-photo-front figcaption {
  margin-top: 10px;
  color: #a27d88;
  font-family: var(--font-serif);
  font-size: 9px;
  letter-spacing: .20em;
  text-align: center;
}

.cover-photo-back {
  z-index: 0;
  top: 1%;
  left: 1%;
  width: clamp(168px, 17vw, 236px);
  transform: rotate(6.5deg);
  opacity: .92;
}

.cover-photo-back img {
  aspect-ratio: 3 / 3.8;
  object-position: center 25%;
}

.cover-note {
  position: absolute;
  z-index: 4;
  bottom: 12%;
  left: 0;
  padding: 17px 22px 18px;
  transform: rotate(-2.4deg);
  border: 1px solid rgba(210, 135, 157, .30);
  border-radius: 3px;
  color: #774f5c;
  background: rgba(255, 250, 249, .92);
  box-shadow: 0 14px 34px rgba(134, 72, 92, .16);
  font-family: var(--font-serif);
  font-size: clamp(13px, 1.2vw, 16px);
  letter-spacing: .08em;
  line-height: 1.8;
  backdrop-filter: blur(8px);
}

.cover-note::before {
  content: "";
  position: absolute;
  top: -9px;
  left: 50%;
  width: 58px;
  height: 17px;
  transform: translateX(-50%) rotate(2deg);
  background: rgba(255, 194, 211, .55);
  clip-path: polygon(2% 8%, 98% 0, 95% 100%, 4% 93%);
}

.cover-tape {
  position: absolute;
  z-index: 5;
  top: 7%;
  left: 47%;
  width: 88px;
  height: 22px;
  transform: rotate(-5deg);
  background: linear-gradient(90deg, rgba(255, 198, 213, .66), rgba(255, 231, 236, .78));
  clip-path: polygon(1% 6%, 99% 0, 96% 94%, 3% 100%);
  opacity: .9;
}

.cover-sparkle {
  position: absolute;
  color: #e098af;
  opacity: .7;
  animation: tinyHeart 4s ease-in-out infinite;
}

.cover-sparkle .icon {
  width: 17px;
  height: 17px;
}

.cover-sparkle-a {
  top: 8%;
  right: 2%;
}

.cover-sparkle-b {
  right: 36%;
  bottom: 4%;
  color: #e7a7b9;
  animation-delay: -2s;
}

.cover-sparkle-b .icon {
  width: 13px;
  height: 13px;
  fill: currentColor;
  stroke: none;
}

.cover-signature {
  position: absolute;
  right: clamp(20px, 4vw, 54px);
  bottom: 25px;
  z-index: 2;
  color: rgba(159, 119, 132, .46);
  font-family: var(--font-latin);
  font-size: 8px;
  letter-spacing: .28em;
}

/* ---------------------------------------------------------
   Chapter interlude
   --------------------------------------------------------- */

.chapter-screen {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  background:
    radial-gradient(circle at 16% 12%, rgba(255, 255, 255, .9), transparent 32%),
    linear-gradient(135deg, #fffafb 0%, #ffeef3 54%, #ffe1e9 100%);
  transition: opacity .6s var(--ease-out), visibility .6s;
  cursor: pointer;
}

.chapter-screen.is-open {
  opacity: 1;
  visibility: visible;
}

.chapter-glow {
  position: absolute;
  top: -24%;
  right: -12%;
  width: min(76vw, 950px);
  aspect-ratio: 1;
  border-radius: 50%;
  filter: blur(30px);
  background: radial-gradient(circle, rgba(255, 196, 213, .66), transparent 66%);
}

.chapter-petal {
  position: absolute;
  border-radius: 58% 42% 58% 42%;
  background: linear-gradient(135deg, rgba(255, 190, 208, .62), rgba(255, 232, 238, .15));
  filter: blur(.4px);
  animation: petalFall 18s linear infinite;
}

.chapter-petal-a {
  top: 20%;
  left: 12%;
  width: 14px;
  height: 10px;
  animation-delay: -3s;
}

.chapter-petal-b {
  top: 64%;
  right: 14%;
  width: 10px;
  height: 7px;
  animation-delay: -9s;
}

.chapter-content {
  position: relative;
  z-index: 2;
  width: min(820px, calc(100% - 48px));
  padding: 32px 22px;
  text-align: center;
  transform: translateY(14px);
  transition: transform .9s var(--ease-out);
}

.chapter-screen.is-open .chapter-content { transform: translateY(0); }

.chapter-code {
  color: #bd758b;
  font-family: var(--font-latin);
  font-size: 9px;
  letter-spacing: .50em;
}

.chapter-watermark {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: -1;
  transform: translate(-50%, -52%);
  color: rgba(233, 149, 174, .13);
  font-family: var(--font-latin);
  font-size: clamp(190px, 34vw, 430px);
  font-weight: 400;
  letter-spacing: -.07em;
  line-height: .8;
  user-select: none;
}

.chapter-number {
  margin-top: 15px;
  color: #b47488;
  font-family: var(--font-serif);
  font-size: clamp(16px, 1.8vw, 22px);
  letter-spacing: .42em;
}

.chapter-heading {
  margin: 22px 0 0;
  color: #4f303b;
  font-family: var(--font-serif);
  font-size: clamp(38px, 5.4vw, 72px);
  font-weight: 500;
  letter-spacing: .13em;
  line-height: 1.25;
}

.chapter-divider {
  width: min(340px, 70%);
  display: flex;
  align-items: center;
  gap: 15px;
  margin: 28px auto 18px;
  color: #de8ea7;
}

.chapter-divider span {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(209, 126, 150, .52), transparent);
}

.chapter-divider i {
  font-family: var(--font-serif);
  font-size: 12px;
  font-style: normal;
}

.chapter-quote {
  margin: 0;
  color: #8c6471;
  font-family: var(--font-serif);
  font-size: clamp(13.5px, 1.4vw, 17px);
  letter-spacing: .16em;
  line-height: 1.9;
}

.chapter-hint {
  margin: 44px 0 0;
  color: #b58b98;
  font-size: 9px;
  letter-spacing: .34em;
}

.chapter-timer {
  position: relative;
  display: block;
  width: 126px;
  height: 1px;
  margin: 15px auto 0;
  overflow: hidden;
  background: rgba(226, 178, 192, .42);
}

.chapter-screen.is-open .chapter-timer::after {
  content: "";
  position: absolute;
  inset: 0;
  transform-origin: left center;
  background: linear-gradient(90deg, #e9a0b6, #d96f91);
  animation: chapterTimer 4.2s linear forwards;
}

/* ---------------------------------------------------------
   Cinema / KTV video
   --------------------------------------------------------- */

.cinema {
  position: fixed;
  inset: 0;
  z-index: 96;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: clamp(18px, 4vh, 46px) 24px;
  color: #fff8fa;
  background:
    radial-gradient(circle at 50% 42%, rgba(112, 56, 75, .74) 0%, rgba(38, 22, 29, .94) 46%, #140c10 100%);
  opacity: 0;
  visibility: hidden;
  transition: opacity .7s var(--ease-out), visibility .7s;
}

.cinema::before {
  content: "";
  position: absolute;
  top: 12%;
  left: 50%;
  width: min(62vw, 760px);
  aspect-ratio: 1;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(225, 128, 157, .18), transparent 65%);
  filter: blur(30px);
  pointer-events: none;
}

.cinema.is-open {
  opacity: 1;
  visibility: visible;
}

.cinema-head {
  position: relative;
  z-index: 2;
  margin-bottom: clamp(20px, 3.2vh, 30px);
  text-align: center;
}

.cinema-kicker {
  color: #e9a4ba;
  font-family: var(--font-latin);
  font-size: 9px;
  letter-spacing: .42em;
}

.cinema-head h2 {
  margin: 12px 0 10px;
  color: #fff4f7;
  font-family: var(--font-serif);
  font-size: clamp(25px, 3vw, 38px);
  font-weight: 500;
  letter-spacing: .20em;
}

.cinema-head p {
  margin: 0;
  color: rgba(255, 231, 238, .56);
  font-family: var(--font-serif);
  font-size: 11.5px;
  letter-spacing: .11em;
}

.cinema-stage {
  position: relative;
  z-index: 2;
  width: min(1000px, 90vw);
}

.cinema-frame {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border-radius: 16px;
  background: #090506;
  box-shadow:
    0 0 0 1px rgba(255, 239, 244, .16),
    0 40px 100px rgba(0, 0, 0, .52),
    0 0 80px rgba(219, 119, 150, .10);
}

.cinema-frame video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #090506;
  filter: brightness(1.14) contrast(1.02) saturate(1.05);
}

.cinema-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 90px rgba(0, 0, 0, .42);
  pointer-events: none;
}

.cinema-cover {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: radial-gradient(circle at 50% 48%, rgba(18, 10, 13, .16), rgba(18, 10, 13, .66));
  transition: opacity .45s, visibility .45s;
}

.cinema-cover.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.play-btn {
  position: relative;
  width: 82px;
  height: 82px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 242, 246, .55);
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(140deg, #efa8bd, #d96f91);
  box-shadow:
    0 20px 50px rgba(0, 0, 0, .35),
    0 0 0 8px rgba(240, 159, 183, .08),
    inset 0 1px 0 rgba(255, 255, 255, .45);
  transition: transform .3s var(--ease-out), box-shadow .3s;
}

.play-btn:hover {
  transform: scale(1.06);
  box-shadow:
    0 24px 60px rgba(0, 0, 0, .4),
    0 0 0 12px rgba(240, 159, 183, .11),
    inset 0 1px 0 rgba(255, 255, 255, .5);
}

.play-btn .icon {
  width: 29px;
  height: 29px;
  margin-left: 4px;
  fill: currentColor;
  stroke: none;
}

.play-ring {
  position: absolute;
  inset: -14px;
  border: 1px solid rgba(255, 194, 211, .35);
  border-radius: 50%;
  animation: playPulse 2.1s ease-out infinite;
}

.cinema-cover p {
  margin: 7px 0 0;
  color: rgba(255, 240, 244, .78);
  font-family: var(--font-serif);
  font-size: 12px;
  letter-spacing: .18em;
}

.cinema-cover small {
  color: rgba(255, 232, 239, .36);
  font-size: 9px;
  letter-spacing: .18em;
}

.cinema-end {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  background: rgba(22, 12, 16, .45);
  backdrop-filter: blur(5px);
  transition: opacity .6s var(--ease-out), visibility .6s;
}

.cinema-end.is-visible {
  opacity: 1;
  visibility: visible;
}

.cinema-end p {
  margin: 0;
  color: #fff2f5;
  font-family: var(--font-serif);
  font-size: clamp(14px, 1.6vw, 19px);
  letter-spacing: .12em;
  text-align: center;
}

.cinema-progress {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 5;
  height: 2px;
  background: rgba(255, 255, 255, .12);
}

.cinema-progress span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, #e9a0b6, #d96f91);
  box-shadow: 0 0 10px rgba(235, 139, 167, .46);
  transition: width .15s linear;
}

.cinema-skip {
  position: absolute;
  z-index: 5;
  top: clamp(16px, 3vh, 30px);
  right: clamp(18px, 3vw, 38px);
  padding: 8px 14px 8px 16px;
  border: 1px solid rgba(255, 236, 242, .16);
  border-radius: 999px;
  color: rgba(255, 237, 243, .50);
  font-size: 9px;
  letter-spacing: .18em;
  transition: color .25s, border-color .25s, background .25s;
}

.cinema-skip span {
  margin-left: 6px;
  font-size: 12px;
}

.cinema-skip:hover {
  color: #fff4f7;
  border-color: rgba(255, 236, 242, .38);
  background: rgba(255, 255, 255, .06);
}

.cinema-foot {
  position: absolute;
  bottom: clamp(16px, 3vh, 27px);
  z-index: 2;
  margin: 0;
  color: rgba(255, 232, 239, .30);
  font-size: 8.5px;
  letter-spacing: .28em;
}

/* ---------------------------------------------------------
   Ending
   --------------------------------------------------------- */

.ending {
  position: fixed;
  inset: 0;
  z-index: 94;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: clamp(20px, 5vh, 58px) clamp(20px, 5vw, 72px);
  opacity: 0;
  visibility: hidden;
  transition: opacity .8s var(--ease-out), visibility .8s;
}

.ending.is-open {
  opacity: 1;
  visibility: visible;
}

.ending-bg {
  position: absolute;
  inset: -6%;
  background: url("../assets/scene8.webp") center 28% / cover no-repeat;
  filter: blur(42px) saturate(.8) brightness(1.3);
  opacity: .27;
  transform: scale(1.07);
}

.ending-shade {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 18% 22%, rgba(255, 255, 255, .75), transparent 32%),
    radial-gradient(circle at 88% 82%, rgba(255, 206, 220, .42), transparent 38%),
    linear-gradient(118deg, rgba(255, 250, 251, .95), rgba(255, 241, 245, .90) 58%, rgba(255, 229, 237, .72));
}

.ending-inner {
  position: relative;
  z-index: 2;
  width: min(1080px, 100%);
  display: grid;
  grid-template-columns: minmax(240px, .78fr) minmax(0, 1.22fr);
  align-items: center;
  gap: clamp(30px, 6vw, 88px);
}

.ending-photo {
  position: relative;
  justify-self: center;
  width: min(320px, 27vw);
  margin: 0;
  padding: 10px 10px 0;
  transform: rotate(-2.2deg);
  border-radius: 4px;
  background: #fffdfd;
  box-shadow: 0 34px 72px rgba(128, 69, 89, .24), 0 5px 14px rgba(128, 69, 89, .10);
  animation: coverArtIn 1s var(--ease-out) both .1s;
}

.ending-photo img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  object-position: center 22%;
  user-select: none;
  -webkit-user-drag: none;
}

.ending-photo figcaption {
  height: 39px;
  display: grid;
  place-items: center;
  color: #a27c87;
  font-family: var(--font-serif);
  font-size: 9px;
  letter-spacing: .18em;
}

.ending-wm {
  position: absolute;
  right: 7%;
  bottom: 48px;
  padding: 3px 8px;
  border: 1px solid rgba(208, 131, 153, .28);
  border-radius: 999px;
  color: #b4667d;
  background: rgba(255, 247, 249, .9);
  font-family: var(--font-serif);
  font-size: 8px;
  letter-spacing: .07em;
}

.ending-copy {
  max-width: 580px;
  animation: coverCopyIn 1s var(--ease-out) both .2s;
}

.ending-kicker {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 0;
  color: #b9788d;
  font-family: var(--font-latin);
  font-size: 8.5px;
  letter-spacing: .34em;
}

.ending-kicker span {
  display: inline-block;
  width: 23px;
  height: 1px;
  background: rgba(205, 126, 149, .45);
}

.ending-mark {
  margin: 17px 0 16px;
  color: #ad7386;
  font-family: var(--font-serif);
  font-size: 16px;
  letter-spacing: .38em;
}

.ending-title {
  margin: 0 0 20px;
  color: #543440;
  font-family: var(--font-serif);
  font-size: clamp(37px, 4.4vw, 59px);
  font-weight: 500;
  letter-spacing: .08em;
  line-height: 1.2;
}

.ending-quote {
  margin: 0;
  color: #785562;
  font-family: var(--font-serif);
  font-size: clamp(15px, 1.5vw, 19px);
  letter-spacing: .11em;
  line-height: 2.05;
}

.ending-heartline {
  display: flex;
  align-items: center;
  gap: 13px;
  width: min(260px, 60%);
  margin: 26px 0 19px;
  color: #dc90a7;
  font-family: var(--font-serif);
  font-size: 11px;
}

.ending-heartline span {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(211, 134, 156, .48), transparent);
}

.ending-thanks {
  margin: 0 0 28px;
  color: #a37d89;
  font-family: var(--font-serif);
  font-size: 12px;
  letter-spacing: .15em;
}

.ending-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.ending-signature {
  position: absolute;
  right: clamp(20px, 4vw, 52px);
  bottom: 24px;
  z-index: 2;
  margin: 0;
  color: rgba(158, 118, 131, .44);
  font-family: var(--font-latin);
  font-size: 8px;
  letter-spacing: .28em;
}

/* keyframes for cover / chapter / cinema / ending */

@keyframes coverCopyIn {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes coverArtIn {
  from { opacity: 0; transform: translateY(16px) rotate(-1deg) scale(.98); }
  to { opacity: 1; transform: translateY(0) rotate(0) scale(1); }
}

@keyframes tinyHeart {
  0%, 100% { transform: translateY(0) rotate(14deg) scale(1); opacity: .7; }
  50% { transform: translateY(-5px) rotate(20deg) scale(1.08); opacity: 1; }
}

@keyframes chapterTimer {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

@keyframes playPulse {
  0% { transform: scale(.88); opacity: .8; }
  70%, 100% { transform: scale(1.18); opacity: 0; }
}

/* ---------------------------------------------------------
   Modals / history / settings
   --------------------------------------------------------- */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(70, 42, 52, .30);
  backdrop-filter: blur(12px) saturate(.94);
  animation: backdropIn .3s ease both;
}

.modal {
  width: min(540px, 100%);
  max-height: min(88dvh, 780px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(218, 146, 167, .34);
  border-radius: 28px;
  background:
    radial-gradient(circle at 82% 0%, rgba(255, 221, 231, .62), transparent 35%),
    linear-gradient(160deg, #fffdfd, #fff3f7);
  box-shadow: 0 44px 110px rgba(85, 45, 59, .30), inset 0 1px 0 #fff;
  animation: modalIn .42s var(--ease-out) both;
}

.modal-wide { width: min(820px, 100%); }
.modal-small { width: min(430px, 100%); }

.modal-head {
  flex: none;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 26px 28px 17px;
}

.modal-kicker {
  margin: 0 0 6px;
  color: #bd7b8e;
  font-family: var(--font-latin);
  font-size: 8px;
  letter-spacing: .34em;
}

.modal-head h3 {
  margin: 0;
  color: #553642;
  font-family: var(--font-serif);
  font-size: 25px;
  font-weight: 500;
  letter-spacing: .12em;
}

.modal-close {
  width: 34px;
  height: 34px;
  flex: none;
  display: grid;
  place-items: center;
  border: 1px solid rgba(210, 145, 164, .28);
  border-radius: 50%;
  color: #99717d;
  background: rgba(255, 251, 252, .58);
  transition: color .22s, background .22s, border-color .22s, transform .22s;
}

.modal-close:hover {
  color: var(--pink-deep);
  background: #fff;
  border-color: rgba(214, 112, 142, .48);
  transform: rotate(6deg);
}

.modal-body {
  min-height: 0;
  overflow-y: auto;
  padding: 0 28px 28px;
  scrollbar-width: thin;
  scrollbar-color: rgba(213, 144, 164, .45) transparent;
}

.modal-body::-webkit-scrollbar { width: 5px; }
.modal-body::-webkit-scrollbar-thumb {
  border-radius: 99px;
  background: rgba(213, 144, 164, .45);
}

/* history */

.history-body { padding-top: 2px; }

.history-chapter {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 21px 0 12px;
  color: #b57b8e;
  font-size: 9px;
  letter-spacing: .25em;
}

.history-chapter:first-child { margin-top: 2px; }

.history-chapter::before,
.history-chapter::after {
  content: "";
  height: 1px;
  flex: 1;
  background: linear-gradient(90deg, transparent, rgba(210, 137, 157, .26));
}

.history-chapter::after {
  background: linear-gradient(90deg, rgba(210, 137, 157, .26), transparent);
}

.history-entry {
  padding: 11px 2px 12px;
  border-bottom: 1px dashed rgba(211, 144, 164, .22);
}

.history-entry:last-child { border-bottom: 0; }

.history-speaker {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 4px;
  color: #c86f8d;
  font-family: var(--font-serif);
  font-size: 11px;
  letter-spacing: .15em;
}

.history-speaker::before {
  content: "";
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
}

.history-speaker.me { color: #9c7a85; }

.history-text {
  margin: 0;
  color: #5a3b46;
  font-family: var(--font-serif);
  font-size: 14px;
  letter-spacing: .035em;
  line-height: 1.85;
}

.history-entry.is-narration .history-text,
.history-entry.is-action .history-text {
  color: #886571;
  font-size: 13px;
  line-height: 1.9;
}

.history-entry.is-choice .history-text { color: #c16482; }

.history-empty {
  margin: 18px 0 8px;
  color: #a5808b;
  font-family: var(--font-serif);
  font-size: 13px;
  letter-spacing: .08em;
  text-align: center;
}

/* settings */

.setting-group {
  padding: 18px 0;
  border-bottom: 1px solid rgba(212, 145, 164, .20);
}

.setting-group:first-child { padding-top: 2px; }

.setting-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 12px;
  color: #654550;
  font-size: 12px;
  letter-spacing: .12em;
}

.setting-label b {
  color: var(--pink-deep);
  font-family: var(--font-latin);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: .08em;
}

.volume-row {
  display: flex;
  align-items: center;
  gap: 13px;
}

.mini-sound {
  width: 36px;
  height: 36px;
  flex: none;
  display: grid;
  place-items: center;
  border: 1px solid rgba(211, 142, 162, .30);
  border-radius: 50%;
  color: #956c7a;
  background: rgba(255, 252, 253, .68);
  transition: color .2s, background .2s;
}

.mini-sound:hover {
  color: var(--pink-deep);
  background: #fff;
}

.mini-sound .icon { width: 16px; height: 16px; }

input[type="range"] {
  --val: 65%;
  width: 100%;
  height: 22px;
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 99px;
  background: linear-gradient(90deg, #e7a1b6 var(--val), #f2dbe2 var(--val));
}

input[type="range"]::-moz-range-track {
  height: 4px;
  border-radius: 99px;
  background: linear-gradient(90deg, #e7a1b6 var(--val), #f2dbe2 var(--val));
}

input[type="range"]::-webkit-slider-thumb {
  width: 18px;
  height: 18px;
  margin-top: -7px;
  appearance: none;
  -webkit-appearance: none;
  border: 3px solid #e592ab;
  border-radius: 50%;
  background: #fffdfd;
  box-shadow: 0 3px 10px rgba(164, 91, 112, .24);
}

input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border: 3px solid #e592ab;
  border-radius: 50%;
  background: #fffdfd;
  box-shadow: 0 3px 10px rgba(164, 91, 112, .24);
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 4px;
  border-radius: 13px;
  background: rgba(246, 226, 233, .72);
}

.segmented button {
  height: 36px;
  border-radius: 9px;
  color: #946d7a;
  font-size: 12px;
  letter-spacing: .08em;
  transition: background .22s, color .22s, box-shadow .22s;
}

.segmented button:hover { color: var(--pink-deep); }

.segmented button.active {
  color: var(--pink-deep);
  background: #fffdfd;
  box-shadow: 0 4px 12px rgba(163, 97, 117, .13);
  font-weight: 600;
}

.setting-tip {
  padding-bottom: 10px;
  border-bottom: 0;
}

.setting-tip p {
  display: flex;
  gap: 14px;
  margin: 7px 0;
  color: #a17e89;
  font-size: 10px;
  letter-spacing: .04em;
  line-height: 1.7;
}

.setting-tip p span {
  width: 42px;
  flex: none;
  color: #c08598;
  letter-spacing: .12em;
}

.settings-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-top: 5px;
}

.btn-danger { color: #c36179; }
.btn-danger:hover { color: #b44e69; }

/* confirm */

.confirm-text {
  margin: 0 0 23px;
  color: #7c5965;
  font-family: var(--font-serif);
  font-size: 14px;
  letter-spacing: .06em;
  line-height: 1.9;
}

.confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* toast */

.toast {
  position: fixed;
  bottom: 26px;
  left: 50%;
  z-index: 140;
  padding: 10px 18px;
  border: 1px solid rgba(255, 255, 255, .10);
  border-radius: 999px;
  color: #fff5f8;
  background: rgba(77, 45, 56, .90);
  box-shadow: 0 14px 34px rgba(71, 38, 49, .22);
  font-size: 10.5px;
  letter-spacing: .08em;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(10px);
  transition: opacity .3s, transform .3s;
  backdrop-filter: blur(10px);
}

.toast.is-show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@keyframes backdropIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(14px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ---------------------------------------------------------
   Responsive
   --------------------------------------------------------- */

@media (max-width: 1180px) {
  .stage-quote { display: none; }
}

@media (max-width: 1020px) {
  .chapter-rail { display: none; }
  .cover-inner { gap: 34px; }
  .cover-photo-back { left: -2%; }
  .cover-photo-front { right: 4%; }
  .cover-note { left: -2%; }
}

@media (max-width: 880px) {
  .cover { padding: 28px 26px 30px; }
  .cover-inner {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 0;
  }
  .cover-copy {
    max-width: 560px;
    text-align: center;
  }
  .cover-avatar { display: block; }
  .eyebrow { justify-content: center; }
  .cover-title { margin-top: 17px; }
  .cover-sub br { display: block; }
  .cover-meta { justify-content: center; }
  .cover-actions { justify-content: center; }
  .cover-foot { justify-content: center; }
  .cover-art { display: none; }
  .cover-signature { display: none; }
  .cover-shade {
    background:
      radial-gradient(circle at 50% 18%, rgba(255, 255, 255, .48), transparent 40%),
      linear-gradient(150deg, rgba(255, 250, 251, .96), rgba(255, 234, 240, .87));
  }

  .ending { overflow-y: auto; padding-top: 36px; padding-bottom: 36px; }
  .ending-inner { grid-template-columns: 1fr; justify-items: center; }
  .ending-photo { display: none; }
  .ending-copy { max-width: 560px; text-align: center; }
  .ending-kicker { justify-content: center; }
  .ending-heartline { margin-right: auto; margin-left: auto; }
  .ending-actions { justify-content: center; }
  .ending-signature { display: none; }
  .ending-shade {
    background:
      radial-gradient(circle at 50% 18%, rgba(255, 255, 255, .70), transparent 38%),
      linear-gradient(145deg, rgba(255, 250, 251, .95), rgba(255, 232, 239, .87));
  }
}

@media (max-width: 720px) {
  .app {
    padding: 0 14px max(10px, env(safe-area-inset-bottom));
  }

  .topbar {
    height: 60px;
    gap: 12px;
  }

  .brand { gap: 9px; }

  .brand-mark {
    width: 33px;
    height: 33px;
  }

  .brand-mark .icon { width: 15px; height: 15px; }

  .brand-copy strong {
    font-size: 14px;
    letter-spacing: .10em;
  }

  .brand-copy small { display: none; }

  .top-actions { gap: 6px; }

  .icon-btn {
    width: 36px;
    height: 36px;
  }

  .pill-btn {
    height: 36px;
    gap: 5px;
    padding: 0 11px 0 10px;
    font-size: 10px;
    letter-spacing: .08em;
  }

  .icon-btn .icon { width: 16px; height: 16px; }

  .stage {
    padding: 5px 0 9px;
  }

  .photo-card {
    padding: 6px 6px 0;
  }

  .photo-card::after { inset: 8px -6px -6px 8px; }

  .photo-media img {
    max-width: 82vw;
    max-height: min(47vh, 470px);
  }

  .photo-card.landscape .photo-media img {
    max-width: 84vw;
    max-height: min(36vh, 300px);
  }

  .photo-caption,
  .phone-caption {
    height: 32px;
    padding: 0 4px;
    font-size: 9px;
    letter-spacing: .09em;
  }

  .photo-no { font-size: 8.5px; }

  .washi {
    top: -8px;
    width: 72px;
    height: 18px;
  }

  .phone-shell { width: clamp(184px, 52vw, 226px); }

  .dialogue-wrap { width: 100%; }

  .dialogue-card {
    min-height: 138px;
    padding: 25px 21px 13px;
    border-radius: 22px;
  }

  .dialogue-card::after {
    inset: 8px;
    border-radius: 15px;
  }

  .name-tag {
    left: 20px;
    top: -14px;
    min-height: 29px;
    padding: 6px 15px 7px;
    font-size: 12.5px;
  }

  .quote-mark {
    top: 6px;
    right: 17px;
    font-size: 44px;
  }

  .dialogue-text {
    min-height: 2.8em;
    font-size: 16px;
    letter-spacing: .035em;
    line-height: 1.9;
  }

  .dialogue-card.is-narration .dialogue-text {
    font-size: 14.5px;
    line-height: 1.95;
  }

  .dialogue-card.is-action .dialogue-text {
    font-size: 14px;
  }

  .foot-hint { font-size: 8px; letter-spacing: .10em; }

  .choice-card {
    padding: 12px 15px;
    gap: 10px;
    border-radius: 15px;
    font-size: 14.5px;
  }

  .choice-index {
    width: 24px;
    height: 24px;
    font-size: 8px;
  }

  .choice-eyebrow {
    margin-bottom: 7px;
    font-size: 8px;
  }

  .cover {
    padding: max(26px, env(safe-area-inset-top)) 22px max(25px, env(safe-area-inset-bottom));
    overflow-y: auto;
  }

  .cover-avatar {
    width: 64px;
    height: 64px;
    margin-bottom: 16px;
  }

  .cover-title {
    margin: 14px 0 14px;
    font-size: clamp(42px, 13.2vw, 60px);
    letter-spacing: .02em;
  }

  .eyebrow {
    gap: 9px;
    font-size: 8px;
    letter-spacing: .24em;
  }

  .eyebrow-line { width: 24px; }
  .eyebrow-line-short { width: 12px; }

  .cover-sub {
    font-size: 16px;
    line-height: 1.95;
  }

  .cover-meta {
    gap: 8px;
    margin: 19px 0 24px;
    font-size: 9px;
    letter-spacing: .10em;
  }

  .cover-actions {
    width: 100%;
    flex-direction: column;
    gap: 10px;
  }

  .cover-actions .btn {
    width: min(300px, 100%);
  }

  .btn-continue {
    align-items: center;
    text-align: center;
  }

  .cover-foot {
    margin-top: 17px;
    font-size: 8.5px;
    letter-spacing: .05em;
  }

  .chapter-content { padding: 22px 16px; }
  .chapter-code { font-size: 8px; letter-spacing: .35em; }
  .chapter-number { font-size: 15px; letter-spacing: .32em; }
  .chapter-heading {
    margin-top: 17px;
    font-size: clamp(31px, 9.4vw, 42px);
    letter-spacing: .08em;
  }
  .chapter-divider { margin: 22px auto 15px; }
  .chapter-quote { font-size: 12.5px; letter-spacing: .10em; }
  .chapter-hint { margin-top: 36px; }
  .chapter-watermark { font-size: clamp(170px, 62vw, 300px); }

  .cinema { padding: 22px 14px 28px; }
  .cinema-head { margin-bottom: 16px; }
  .cinema-kicker { font-size: 8px; letter-spacing: .30em; }
  .cinema-head h2 { margin: 9px 0 7px; font-size: 24px; letter-spacing: .13em; }
  .cinema-head p { font-size: 10px; }
  .cinema-stage { width: 94vw; }
  .cinema-frame { border-radius: 10px; }
  .cinema-cover p { font-size: 11px; }
  .cinema-cover small { font-size: 8px; }
  .play-btn { width: 66px; height: 66px; }
  .play-btn .icon { width: 24px; height: 24px; }
  .cinema-skip { top: 14px; right: 14px; padding: 7px 11px; font-size: 8px; }
  .cinema-end { gap: 15px; padding: 18px; }
  .cinema-end p { font-size: 13px; }
  .cinema-end .btn { min-height: 43px; padding: 0 20px; font-size: 12px; }
  .cinema-foot { display: none; }

  .ending-title { font-size: clamp(34px, 10vw, 45px); }
  .ending-mark { font-size: 14px; }
  .ending-quote { font-size: 14.5px; }
  .ending-actions { flex-direction: column; width: 100%; gap: 9px; }
  .ending-actions .btn { width: min(290px, 100%); }
  .ending-thanks { margin-bottom: 23px; }

  .modal-backdrop { padding: 12px; }
  .modal { max-height: 92dvh; border-radius: 23px; }
  .modal-head { padding: 22px 21px 14px; }
  .modal-head h3 { font-size: 22px; }
  .modal-body { padding: 0 21px 22px; }
  .settings-actions { flex-wrap: wrap; }
  .toast { bottom: 18px; width: max-content; max-width: calc(100vw - 28px); text-align: center; }
}

@media (max-width: 420px) {
  .brand-copy strong { font-size: 13px; }
  .pill-btn .auto-label { display: none; }
  .pill-btn { width: 36px; padding: 0; justify-content: center; }
  .photo-media img { max-height: min(43vh, 420px); }
  .dialogue-text { font-size: 15.5px; }
  .cover-title { font-size: 39px; }
  .cover-sub { font-size: 15px; }
  .cover-meta i { display: none; }
  .cover-meta { gap: 8px; }
  .ending-quote br { display: none; }
}

@media (max-height: 720px) and (min-width: 721px) {
  .topbar { height: 62px; }
  .photo-media img { max-height: min(52vh, 520px); }
  .dialogue-card { min-height: 137px; padding-top: 26px; }
  .cover-inner { gap: 34px; }
  .cover-art { height: 58vh; }
}

@media (max-height: 660px) {
  .brand-copy small { display: none; }
  .topbar { height: 56px; }
  .photo-media img { max-height: min(41vh, 390px); }
  .photo-caption,
  .phone-caption { height: 29px; }
  .dialogue-card { min-height: 124px; padding-top: 23px; }
  .dialogue-text { font-size: 15.5px; }
  .chapter-hint { margin-top: 27px; }
  .cover-avatar { display: none; }
  .cover-title { font-size: clamp(38px, 9vw, 58px); }
  .cover-meta { margin: 16px 0 19px; }
  .cover-foot { margin-top: 13px; }
  .ending-mark { margin: 10px 0 10px; }
  .ending-title { margin-bottom: 12px; }
  .ending-thanks { margin-bottom: 16px; }
}

@media (max-height: 520px) and (orientation: landscape) {
  .topbar { height: 48px; }
  .brand-mark { width: 30px; height: 30px; }
  .brand-copy strong { font-size: 13px; }
  .stage { padding: 0 0 4px; }
  .photo-media img { max-height: 44vh; max-width: 38vw; }
  .photo-caption, .phone-caption { height: 25px; }
  .photo-card { padding: 5px 5px 0; }
  .dialogue-wrap { width: min(760px, 88vw); }
  .dialogue-card { min-height: 106px; padding: 20px 24px 10px; }
  .dialogue-text { min-height: 2.2em; font-size: 14px; line-height: 1.7; }
  .name-tag { top: -12px; min-height: 25px; padding: 4px 13px 5px; font-size: 11px; }
  .dialogue-foot { min-height: 10px; margin-top: 1px; }
  .choice-card { padding: 9px 14px; font-size: 13px; }
  .choices { margin-bottom: 8px; }
  .chapter-heading { font-size: 30px; }
  .chapter-hint { display: none; }
  .cover { padding-top: 18px; padding-bottom: 18px; }
  .cover-avatar { display: none; }
  .cover-title { font-size: 45px; margin: 10px 0 9px; }
  .cover-sub { font-size: 14px; line-height: 1.7; }
  .cover-meta { margin: 12px 0 15px; }
  .cover-foot { display: none; }
  .btn { min-height: 42px; }
  .ending-photo { display: none; }
}

@media (max-height: 620px) and (max-width: 880px) {
  .cover-avatar { display: none; }
}

/* accessibility */

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

  .petals,
  .chapter-petal,
  .glow { display: none; }
}

