/* =========================================================
   婴宁 · 一笑生春
   A Chinese romance storybook — ink, silk, plum, lantern light
   ========================================================= */

:root {
  --ink: #18221d;
  --ink-deep: #090f0d;
  --ink-soft: #2a3b32;
  --ink-mute: #5b655c;
  --paper: #f7eedf;
  --paper-warm: #efe2ca;
  --paper-deep: #dfcfb3;
  --gold: #c1a066;
  --gold-bright: #e6cd96;
  --gold-dim: #8c754d;
  --vermilion: #b44d3f;
  --vermilion-deep: #8d342c;
  --jade: #8fae9c;
  --jade-deep: #557667;
  --mist: #cfdcd2;
  --serif: "STKaiti", "KaiTi", "Kaiti SC", "Songti SC", "Noto Serif SC", "SimSun", serif;
  --song: "Songti SC", "STSong", "Noto Serif SC", "SimSun", serif;
  --sans: "Optima", "Candara", "Segoe UI", "Microsoft YaHei", sans-serif;
  --ease: cubic-bezier(.22, .8, .26, 1);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--ink-deep);
  color: var(--paper);
}

body {
  font-family: var(--song);
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button {
  font: inherit;
  color: inherit;
  border: 0;
  background: none;
  cursor: pointer;
}

button:focus-visible,
[tabindex]:focus-visible {
  outline: 1px solid var(--gold-bright);
  outline-offset: 4px;
}

::selection {
  background: rgba(193, 160, 102, .32);
  color: var(--paper);
}

.is-hidden {
  display: none !important;
}

#app {
  position: relative;
  width: 100%;
  height: 100dvh;
  min-height: 480px;
  overflow: hidden;
  isolation: isolate;
}

/* ---------- atmospheric background ---------- */

#scene-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse at 72% 34%, rgba(67, 95, 78, .55), transparent 56%),
    radial-gradient(ellipse at 26% 82%, rgba(24, 42, 34, .72), transparent 60%),
    linear-gradient(150deg, #0c1411 0%, #15251f 48%, #0a110f 100%);
}

.scene-layer {
  position: absolute;
  inset: -2%;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  opacity: 0;
  transform: scale(1.035);
  transition: opacity 1.35s var(--ease), transform 14s linear;
  will-change: opacity, transform;
}

.scene-layer.is-active {
  opacity: 1;
  transform: scale(1.005);
}

.scene-layer.is-out {
  opacity: 0;
}

.wash {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(7, 13, 11, .72) 0%, rgba(7, 13, 11, .16) 38%, transparent 62%),
    linear-gradient(180deg, rgba(7, 13, 11, .44) 0%, transparent 22%, transparent 58%, rgba(7, 13, 11, .84) 100%),
    radial-gradient(ellipse at center, transparent 42%, rgba(6, 11, 9, .44) 100%);
  mix-blend-mode: multiply;
}

.grain {
  position: fixed;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  opacity: .14;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220' viewBox='0 0 220 220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='220' height='220' filter='url(%23n)' opacity='.45'/%3E%3C/svg%3E");
  background-size: 220px 220px;
  mix-blend-mode: soft-light;
}

#petals {
  position: fixed;
  inset: 0;
  z-index: 4;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* ---------- HUD ---------- */

.hud {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px clamp(18px, 3.4vw, 48px);
  color: #eaddc4;
  background: linear-gradient(180deg, rgba(7, 13, 11, .74), transparent);
  opacity: 1;
  transition: opacity .5s var(--ease);
}

.hud-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 120px;
}

.seal-small {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 38px;
  background: var(--vermilion);
  color: #f7e9cf;
  font-family: var(--serif);
  font-size: 14px;
  line-height: 1.1;
  letter-spacing: .05em;
  writing-mode: vertical-rl;
  border: 1px solid rgba(247, 233, 207, .45);
  box-shadow: inset 0 0 0 2px rgba(247, 233, 207, .12);
}

.brand-name {
  font-family: var(--serif);
  font-size: 23px;
  letter-spacing: .2em;
  color: #f2e7d1;
}

.hud-chapter {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-family: var(--serif);
  font-size: 15px;
  letter-spacing: .22em;
  color: rgba(238, 220, 188, .9);
  text-shadow: 0 1px 12px rgba(0, 0, 0, .7);
}

#hud-chapter-no {
  color: var(--gold-bright);
  font-size: 12px;
}

.hud-dot {
  color: var(--gold);
  opacity: .6;
}

.hud-tools {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 120px;
  justify-content: flex-end;
}

.icon-btn {
  position: relative;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  color: rgba(238, 222, 193, .8);
  font-family: var(--serif);
  font-size: 16px;
  border: 1px solid transparent;
  border-radius: 50%;
  transition: color .25s var(--ease), border-color .25s var(--ease), background .25s var(--ease);
}

.icon-btn:hover {
  color: var(--gold-bright);
  border-color: rgba(193, 160, 102, .48);
  background: rgba(193, 160, 102, .08);
}

.icon-btn .sound-off {
  display: none;
}

.icon-btn.muted .sound-on {
  display: none;
}

.icon-btn.muted .sound-off {
  display: inline;
}

.icon-btn.muted {
  color: rgba(238, 222, 193, .36);
}

/* ---------- screens ---------- */

.screen {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: none;
}

.screen.is-active {
  display: block;
}

/* ---------- title ---------- */

.title-screen {
  overflow: hidden;
}

.title-art {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 74% 38%, rgba(171, 142, 94, .28), transparent 32%),
    linear-gradient(120deg, #0e1b16 0%, #1e352b 48%, #0b1511 100%);
  background-size: cover;
  background-position: 62% center;
  transform: scale(1.02);
  transition: transform 18s linear;
}

.title-screen.is-active .title-art {
  transform: scale(1.07);
}

.title-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(6, 12, 10, .94) 0%, rgba(6, 12, 10, .78) 28%, rgba(6, 12, 10, .26) 58%, rgba(6, 12, 10, .06) 78%),
    linear-gradient(180deg, rgba(6, 12, 10, .4) 0%, transparent 24%, transparent 62%, rgba(6, 12, 10, .8) 100%);
  pointer-events: none;
}

.title-content {
  position: absolute;
  z-index: 4;
  left: clamp(28px, 8.5vw, 150px);
  top: 50%;
  transform: translateY(-51%);
  width: min(660px, 52vw);
  color: var(--paper);
  animation: fade-in 1.4s var(--ease) both;
}

.title-kicker {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: .34em;
  color: rgba(232, 211, 171, .72);
  margin-bottom: 20px;
}

.title-lockup {
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: 18px;
  margin-left: -8px;
}

.title-seal {
  writing-mode: vertical-rl;
  white-space: nowrap;
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 60px;
  margin-bottom: 14px;
  border: 1px solid rgba(224, 195, 139, .66);
  color: var(--gold-bright);
  font-family: var(--serif);
  font-size: 15px;
  line-height: 1.35;
  letter-spacing: .18em;
  opacity: .9;
}

.title-main {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(72px, 6.6vw, 104px);
  line-height: 1;
  letter-spacing: .06em;
  white-space: nowrap;
  color: #f8edda;
  text-shadow: 0 6px 42px rgba(0, 0, 0, .35);
}

.title-sub {
  margin: 14px 0 24px 4px;
  font-family: var(--serif);
  font-size: clamp(15px, 1.4vw, 20px);
  letter-spacing: .52em;
  color: var(--gold-bright);
  white-space: nowrap;
}

.title-poem {
  margin: 32px 0 36px;
  font-family: var(--song);
  font-size: clamp(14px, 1.2vw, 17px);
  line-height: 2.3;
  letter-spacing: .16em;
  color: rgba(242, 230, 209, .82);
}

.title-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 18px;
  height: 50px;
  padding: 0 24px;
  border: 1px solid rgba(193, 160, 102, .42);
  color: var(--paper);
  font-family: var(--serif);
  font-size: 16px;
  letter-spacing: .18em;
  transition: color .3s var(--ease), background .3s var(--ease), border-color .3s var(--ease), transform .3s var(--ease);
  overflow: hidden;
}

.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent, rgba(230, 205, 150, .14), transparent);
  transform: translateX(-100%);
  transition: transform .55s var(--ease);
}

.btn:hover::before {
  transform: translateX(100%);
}

.btn:hover {
  transform: translateY(-1px);
  border-color: rgba(230, 205, 150, .78);
}

.btn span {
  position: relative;
  z-index: 1;
}

.btn i {
  position: relative;
  z-index: 1;
  font-family: var(--sans);
  font-style: normal;
  font-size: 8px;
  letter-spacing: .24em;
  opacity: .52;
}

.btn-primary {
  background: var(--paper);
  color: var(--ink);
  border-color: var(--paper);
}

.btn-primary i {
  opacity: .45;
}

.btn-primary:hover {
  background: var(--gold-bright);
  border-color: var(--gold-bright);
  color: var(--ink);
}

.btn-ghost {
  background: rgba(9, 15, 13, .16);
  backdrop-filter: blur(4px);
}

.btn-ghost:hover {
  background: rgba(193, 160, 102, .12);
}

.title-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 52px;
  font-family: var(--sans);
  font-size: 9px;
  letter-spacing: .18em;
  color: rgba(230, 214, 186, .42);
}

.title-meta-line {
  width: 30px;
  height: 1px;
  background: rgba(193, 160, 102, .34);
}

.title-flower {
  position: absolute;
  z-index: 3;
  right: clamp(36px, 8vw, 140px);
  bottom: clamp(44px, 9vh, 110px);
  width: 92px;
  height: 92px;
  color: rgba(229, 205, 158, .34);
  animation: slow-turn 54s linear infinite;
}

.title-flower svg {
  width: 100%;
  height: 100%;
}

.title-scroll-hint {
  position: absolute;
  z-index: 4;
  right: clamp(44px, 9vw, 164px);
  bottom: clamp(140px, 18vh, 210px);
  writing-mode: vertical-rl;
  font-family: var(--serif);
  font-size: 11px;
  letter-spacing: .32em;
  color: rgba(235, 219, 190, .46);
}

.title-scroll-hint::after {
  content: "";
  display: block;
  width: 1px;
  height: 44px;
  margin: 14px auto 0;
  background: linear-gradient(var(--gold), transparent);
  opacity: .65;
}

/* ---------- game ---------- */

.game-screen {
  overflow: hidden;
}

.scene-caption {
  position: absolute;
  left: clamp(18px, 3.3vw, 46px);
  bottom: 200px;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 8px;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  color: rgba(238, 222, 192, .66);
  pointer-events: none;
}

.caption-cn {
  font-family: var(--serif);
  font-size: 14px;
  letter-spacing: .3em;
}

.caption-en {
  font-family: var(--sans);
  font-size: 7px;
  letter-spacing: .2em;
  opacity: .48;
}

.scene-caption::before {
  content: "";
  width: 1px;
  height: 34px;
  margin-bottom: 4px;
  background: linear-gradient(transparent, rgba(193, 160, 102, .6));
}

.flower-pouch {
  position: absolute;
  z-index: 30;
  right: clamp(18px, 3.3vw, 48px);
  top: 108px;
  width: 184px;
  padding: 20px 18px 16px;
  background:
    linear-gradient(165deg, rgba(17, 28, 23, .88), rgba(9, 16, 13, .76));
  border: 1px solid rgba(193, 160, 102, .34);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .22), inset 0 0 0 4px rgba(247, 238, 223, .025);
  backdrop-filter: blur(12px);
  transition: opacity .4s var(--ease), transform .4s var(--ease);
}

.flower-pouch.is-collecting {
  opacity: 0;
  transform: translateX(18px);
  pointer-events: none;
}

.flower-pouch::before,
.flower-pouch::after {
  content: "";
  position: absolute;
  width: 8px;
  height: 8px;
  border-color: rgba(230, 205, 150, .65);
  border-style: solid;
}

.flower-pouch::before {
  top: 6px;
  left: 6px;
  border-width: 1px 0 0 1px;
}

.flower-pouch::after {
  right: 6px;
  bottom: 6px;
  border-width: 0 1px 1px 0;
}

.pouch-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(193, 160, 102, .2);
}

.pouch-title {
  font-family: var(--serif);
  font-size: 20px;
  letter-spacing: .18em;
  color: #f1e4cd;
}

.pouch-count {
  font-family: var(--sans);
  font-size: 9px;
  letter-spacing: .12em;
  color: rgba(230, 205, 150, .58);
}

.flower-slots {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 8px 0 10px;
}

.flower-slot {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  height: 46px;
  padding: 0 4px;
  color: rgba(226, 214, 188, .34);
  text-align: left;
  border-bottom: 1px dashed rgba(193, 160, 102, .14);
  transition: color .3s var(--ease), background .3s var(--ease);
}

.flower-slot:last-child {
  border-bottom: 0;
}

.flower-slot:hover {
  color: rgba(242, 226, 196, .75);
  background: rgba(193, 160, 102, .05);
}

.flower-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid rgba(193, 160, 102, .25);
  border-radius: 50%;
  font-size: 15px;
  font-family: var(--serif);
  opacity: .5;
  transition: opacity .3s var(--ease), color .3s var(--ease), border-color .3s var(--ease), box-shadow .3s var(--ease);
}

.flower-label {
  font-family: var(--serif);
  font-size: 14px;
  letter-spacing: .22em;
}

.flower-slot.is-found {
  color: var(--gold-bright);
}

.flower-slot.is-found .flower-icon {
  opacity: 1;
  color: var(--gold-bright);
  border-color: rgba(230, 205, 150, .6);
  box-shadow: 0 0 24px rgba(193, 160, 102, .2);
}

.flower-slot.just-found .flower-icon {
  animation: flower-pop .7s var(--ease);
}

.pouch-quote {
  margin: 12px 0 16px;
  min-height: 3.6em;
  font-family: var(--serif);
  font-size: 11px;
  line-height: 1.8;
  letter-spacing: .06em;
  color: rgba(223, 211, 187, .54);
  transition: opacity .4s var(--ease);
}

.pouch-journal {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 10px 0 0;
  border-top: 1px solid rgba(193, 160, 102, .2);
  color: rgba(230, 205, 150, .72);
  font-family: var(--serif);
  font-size: 11px;
  letter-spacing: .16em;
  transition: color .3s var(--ease);
}

.pouch-journal:hover {
  color: var(--gold-bright);
}

.pouch-journal span {
  font-family: var(--sans);
  font-size: 13px;
}

/* ---------- flower hotspots ---------- */

.flower-hotspots {
  position: absolute;
  inset: 0;
  z-index: 25;
  pointer-events: none;
}

.hotspot {
  position: absolute;
  pointer-events: auto;
  width: 48px;
  height: 48px;
  margin: -24px 0 0 -24px;
  border-radius: 50%;
  color: var(--gold-bright);
  background: radial-gradient(circle, rgba(247, 238, 223, .08), transparent 68%);
}

.hotspot::before,
.hotspot::after {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(230, 205, 150, .72);
  border-radius: 50%;
  animation: hotspot-pulse 2.8s ease-out infinite;
}

.hotspot::after {
  animation-delay: 1.2s;
}

.hotspot .hotspot-core {
  position: absolute;
  inset: 19px;
  border-radius: 50%;
  background: var(--gold-bright);
  box-shadow: 0 0 22px 8px rgba(230, 205, 150, .3);
}

.hotspot .hotspot-label {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 12px);
  transform: translateX(-50%);
  white-space: nowrap;
  padding: 5px 10px;
  font-family: var(--serif);
  font-size: 11px;
  letter-spacing: .14em;
  color: var(--paper);
  background: rgba(10, 17, 14, .78);
  border: 1px solid rgba(193, 160, 102, .36);
  opacity: 0;
  transition: opacity .25s var(--ease), transform .25s var(--ease);
}

.hotspot:hover .hotspot-label,
.flower-hotspots.is-collecting .hotspot-label {
  opacity: 1;
  transform: translateX(-50%) translateY(-3px);
}

.hotspot.is-found {
  pointer-events: none;
  opacity: 0;
  transition: opacity .5s var(--ease);
}

.hotspot.prop-hotspot {
  width: 58px;
  height: 58px;
  margin: -29px 0 0 -29px;
  background: radial-gradient(circle, rgba(247, 238, 223, .12), transparent 68%);
}

.prop-hotspot::before,
.prop-hotspot::after {
  inset: 11px;
  border-color: rgba(247, 238, 223, .82);
}

.prop-hotspot .hotspot-core {
  inset: 24px;
  background: var(--paper);
  box-shadow: 0 0 22px 7px rgba(247, 238, 223, .34);
}

.prop-hotspot .hotspot-label {
  opacity: 1;
  transform: translateX(-50%);
  color: var(--paper);
  background: rgba(9, 17, 13, .8);
}

.prop-hotspot:hover .hotspot-label {
  transform: translateX(-50%) translateY(-3px);
}

.prop-hotspot.is-found {
  opacity: 0;
  transform: scale(1.35);
  transition: opacity .4s var(--ease), transform .4s var(--ease);
}

/* ---------- hold interaction ---------- */

.hold-layer {
  position: absolute;
  inset: 0;
  z-index: 28;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s var(--ease), visibility .3s;
}

.hold-layer.is-visible {
  opacity: 1;
  visibility: visible;
}

.hold-button {
  position: absolute;
  left: 50%;
  top: 42%;
  width: 88px;
  height: 88px;
  margin: -44px 0 0 -44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  pointer-events: auto;
  touch-action: none;
  color: var(--gold-bright);
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.hold-button::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(var(--gold-bright) calc(var(--p, 0) * 1%), rgba(193, 160, 102, .2) 0);
  box-shadow: 0 0 34px rgba(230, 205, 150, .18);
}

.hold-button::after {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 35%, rgba(230, 205, 150, .2), transparent 48%),
    rgba(8, 16, 12, .88);
  border: 1px solid rgba(230, 205, 150, .42);
}

.hold-button .hold-glyph {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  font-family: var(--serif);
  font-size: 24px;
  text-shadow: 0 0 18px rgba(230, 205, 150, .6);
}

.hold-button .hold-label {
  position: absolute;
  z-index: 3;
  top: calc(100% + 11px);
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  padding: 5px 11px;
  font-family: var(--serif);
  font-size: 12px;
  letter-spacing: .14em;
  color: var(--paper);
  background: rgba(9, 17, 13, .82);
  border: 1px solid rgba(193, 160, 102, .4);
}

.hold-button.is-holding .hold-glyph {
  animation: hold-breathe 1.1s ease-in-out infinite;
}

.hold-button.is-lit {
  animation: hold-lit .8s var(--ease) both;
}

.hold-button.is-lit::before {
  box-shadow: 0 0 50px rgba(230, 205, 150, .42);
}

/* ---------- poem puzzle ---------- */

.puzzle-overlay {
  z-index: 120;
}

.puzzle-overlay .overlay-backdrop {
  background: rgba(4, 9, 7, .82);
}

.poem-card {
  position: relative;
  z-index: 1;
  width: min(560px, 92vw);
  padding: 34px 36px 28px;
  color: var(--ink);
  background:
    radial-gradient(ellipse at 88% 0%, rgba(193, 160, 102, .18), transparent 38%),
    linear-gradient(112deg, #fbf4e7, #f2e5cf 58%, #ead8ba);
  border: 1px solid rgba(140, 117, 77, .48);
  box-shadow: 0 40px 100px rgba(0, 0, 0, .48), inset 0 0 0 7px rgba(255, 250, 241, .3);
  animation: rise-in .45s var(--ease) both;
}

.poem-card::before {
  content: "";
  position: absolute;
  inset: 14px;
  border: 1px solid rgba(140, 117, 77, .2);
  pointer-events: none;
}

.poem-card .overlay-kicker {
  color: rgba(140, 117, 77, .72);
}

.poem-card h2 {
  position: relative;
  margin: 8px 0 10px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(30px, 3.4vw, 42px);
  letter-spacing: .16em;
  color: #2b352d;
}

.poem-intro {
  position: relative;
  margin: 0;
  font-family: var(--song);
  font-size: 13px;
  line-height: 1.9;
  letter-spacing: .04em;
  color: rgba(53, 60, 51, .7);
}

.poem-target {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 24px 0 20px;
}

.poem-slot {
  display: grid;
  place-items: center;
  width: 56px;
  height: 66px;
  color: #3f3425;
  font-family: var(--serif);
  font-size: 30px;
  border: 1px solid rgba(140, 117, 77, .26);
  border-bottom: 2px solid rgba(140, 117, 77, .55);
  background: rgba(255, 251, 243, .34);
  transition: background .25s var(--ease), box-shadow .25s var(--ease);
}

.poem-slot.is-filled {
  background: rgba(255, 251, 243, .68);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .4), 0 4px 18px rgba(84, 62, 32, .08);
}

.poem-tiles {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.poem-tile {
  width: 52px;
  height: 58px;
  padding: 0;
  color: #3f3425;
  font-family: var(--serif);
  font-size: 24px;
  border: 1px solid rgba(140, 117, 77, .34);
  background: rgba(255, 251, 243, .48);
  box-shadow: 0 3px 0 rgba(140, 117, 77, .12);
  transition: transform .2s var(--ease), border-color .2s var(--ease), background .2s var(--ease), opacity .2s var(--ease);
}

.poem-tile:hover:not(:disabled) {
  transform: translateY(-2px);
  border-color: var(--vermilion);
  background: rgba(255, 251, 243, .8);
}

.poem-tile:active:not(:disabled) {
  transform: translateY(1px);
}

.poem-tile.is-used {
  opacity: .18;
  pointer-events: none;
}

.poem-tile.is-wrong {
  border-color: var(--vermilion);
  color: var(--vermilion-deep);
}

.poem-hint {
  min-height: 20px;
  margin: 16px 0 0;
  text-align: center;
  font-family: var(--serif);
  font-size: 12px;
  letter-spacing: .12em;
  color: rgba(140, 117, 77, .8);
}

.poem-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 18px;
}

.poem-reset,
.poem-skip {
  min-width: 88px;
  padding: 8px 14px;
  font-family: var(--serif);
  font-size: 12px;
  letter-spacing: .14em;
  border: 1px solid rgba(140, 117, 77, .3);
  color: #5e513d;
  background: rgba(255, 251, 243, .36);
  transition: color .2s var(--ease), border-color .2s var(--ease);
}

.poem-reset:hover,
.poem-skip:hover {
  color: var(--vermilion-deep);
  border-color: var(--vermilion);
}

.poem-card.is-wrong {
  animation: poem-shake .42s var(--ease);
}

@keyframes poem-shake {
  0%, 100% { transform: translateX(0); }
  22% { transform: translateX(-7px); }
  48% { transform: translateX(5px); }
  72% { transform: translateX(-3px); }
}

@keyframes hold-breathe {
  0%, 100% { transform: scale(1); opacity: .9; }
  50% { transform: scale(1.18); opacity: 1; }
}

@keyframes hold-lit {
  0% { transform: scale(1); }
  45% { transform: scale(1.12); }
  100% { transform: scale(1); }
}

/* ---------- dialogue ---------- */

.dialogue-wrap {
  position: absolute;
  left: 50%;
  bottom: max(22px, calc(10px + var(--safe-bottom)));
  z-index: 31;
  width: min(1000px, calc(100vw - 56px));
  transform: translateX(-50%);
}

.portrait-medallion {
  position: absolute;
  left: 6px;
  bottom: calc(100% - 18px);
  z-index: 2;
  width: 132px;
  height: 132px;
  opacity: 0;
  transform: translateY(8px) scale(.96);
  transition: opacity .55s var(--ease), transform .55s var(--ease);
  pointer-events: none;
}

.portrait-medallion.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.portrait-inner {
  position: absolute;
  inset: 7px;
  overflow: hidden;
  border-radius: 50%;
  background: radial-gradient(circle at 55% 34%, #d7c0a3, #6d7d6e 58%, #1b2922);
  background-size: cover;
  background-position: 50% 18%;
  filter: saturate(.9) contrast(1.02);
}

.portrait-inner::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 50%, rgba(8, 13, 11, .45));
  border-radius: inherit;
}

.portrait-ring {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(230, 205, 150, .62);
  border-radius: 50%;
  box-shadow: 0 0 0 5px rgba(12, 20, 16, .5), 0 0 46px rgba(193, 160, 102, .14);
}

.portrait-ring::before {
  content: "宁";
  position: absolute;
  right: 5px;
  bottom: 9px;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  background: var(--vermilion);
  color: var(--paper);
  font-family: var(--serif);
  font-size: 11px;
  border-radius: 50%;
  border: 1px solid rgba(247, 238, 223, .4);
}

.dialogue {
  position: relative;
  min-height: 168px;
  padding: 22px 34px 15px 39px;
  color: var(--ink);
  background:
    linear-gradient(104deg, rgba(255, 250, 240, .98), rgba(246, 236, 218, .97) 58%, rgba(239, 225, 202, .96));
  box-shadow: 0 24px 70px rgba(0, 0, 0, .32), inset 0 0 0 1px rgba(255, 252, 245, .5);
  border: 1px solid rgba(193, 160, 102, .55);
  transition: opacity .3s var(--ease), transform .3s var(--ease);
}

.dialogue::before {
  content: "";
  position: absolute;
  top: 17px;
  bottom: 17px;
  left: 15px;
  width: 2px;
  background: linear-gradient(180deg, var(--vermilion), rgba(180, 77, 63, .14));
}

.dialogue::after {
  content: "";
  position: absolute;
  top: 8px;
  right: 8px;
  width: 26px;
  height: 26px;
  border-top: 1px solid rgba(140, 117, 77, .45);
  border-right: 1px solid rgba(140, 117, 77, .45);
  pointer-events: none;
}

.dialogue-head {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 30px;
  margin-bottom: 10px;
}

.speaker-seal {
  display: inline-grid;
  place-items: center;
  min-width: 38px;
  height: 28px;
  padding: 0 9px;
  background: var(--vermilion);
  color: #f9efdb;
  font-family: var(--serif);
  font-size: 13px;
  letter-spacing: .12em;
  border: 1px solid rgba(247, 238, 223, .38);
}

.speaker-en {
  font-family: var(--sans);
  font-size: 7px;
  letter-spacing: .24em;
  color: var(--gold-dim);
  opacity: .7;
}

.dialogue-rule {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, rgba(140, 117, 77, .34), transparent);
}

.dialogue-hint {
  font-family: var(--serif);
  font-size: 10px;
  letter-spacing: .16em;
  color: rgba(112, 92, 62, .7);
  white-space: nowrap;
  animation: hint-breathe 3.2s ease-in-out infinite;
}

.dialogue-hint.is-hidden {
  visibility: hidden;
}

.dialogue-body {
  position: relative;
}

.dialogue-text {
  margin: 0;
  min-height: 2.4em;
  font-family: var(--song);
  font-size: clamp(17px, 1.6vw, 20px);
  line-height: 2;
  letter-spacing: .055em;
  color: #27322b;
  white-space: pre-line;
}

.dialogue-text.is-narration {
  color: #4d554d;
}

.dialogue-text.is-verse {
  font-family: var(--serif);
  text-align: center;
  font-size: clamp(20px, 2vw, 26px);
  line-height: 2.2;
  letter-spacing: .16em;
  color: #334239;
  padding: 6px 0;
}

.dialogue-text .em {
  color: var(--vermilion-deep);
}

.dialogue-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 13px;
  padding-top: 9px;
  border-top: 1px dashed rgba(140, 117, 77, .24);
  font-family: var(--sans);
  font-size: 8px;
  letter-spacing: .14em;
  color: rgba(93, 80, 59, .48);
}

.key-hint kbd {
  display: inline-block;
  padding: 1px 4px;
  margin-right: 4px;
  border: 1px solid rgba(93, 80, 59, .26);
  font-family: var(--sans);
  font-size: 7px;
  letter-spacing: .08em;
}

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

.choices {
  display: grid;
  gap: 7px;
  margin-top: 14px;
}

.choice-btn {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 46px;
  padding: 10px 16px;
  text-align: left;
  color: #2c3930;
  background: rgba(255, 251, 242, .42);
  border: 1px solid rgba(140, 117, 77, .28);
  transition: color .25s var(--ease), background .25s var(--ease), border-color .25s var(--ease), transform .25s var(--ease);
  animation: rise-in .5s var(--ease) both;
}

.choice-btn:nth-child(2) { animation-delay: .07s; }
.choice-btn:nth-child(3) { animation-delay: .14s; }

.choice-btn:hover {
  color: #1c2a21;
  background: rgba(255, 250, 239, .82);
  border-color: rgba(140, 117, 77, .62);
  transform: translateX(3px);
}

.choice-key {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  border: 1px solid rgba(140, 117, 77, .34);
  border-radius: 50%;
  font-family: var(--sans);
  font-size: 9px;
  color: var(--gold-dim);
}

.choice-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.choice-label {
  font-family: var(--song);
  font-size: 15px;
  letter-spacing: .08em;
}

.choice-hint {
  font-family: var(--sans);
  font-size: 8px;
  letter-spacing: .12em;
  color: rgba(93, 80, 59, .5);
}

/* ---------- chapter card ---------- */

.chapter-card {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  background:
    radial-gradient(ellipse at center, rgba(29, 47, 39, .72), rgba(6, 11, 9, .92)),
    #09100d;
  opacity: 0;
  visibility: hidden;
  transition: opacity .8s var(--ease), visibility .8s var(--ease);
}

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

.chapter-card-inner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 44px 64px;
  border-top: 1px solid rgba(193, 160, 102, .34);
  border-bottom: 1px solid rgba(193, 160, 102, .34);
  color: var(--paper);
  text-align: center;
}

.chapter-card-inner::before,
.chapter-card-inner::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 68px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(193, 160, 102, .55));
}

.chapter-card-inner::before { left: -84px; }
.chapter-card-inner::after { right: -84px; transform: rotate(180deg); }

.chapter-card-no {
  font-family: var(--sans);
  font-size: 9px;
  letter-spacing: .32em;
  color: var(--gold-bright);
}

.chapter-card-title {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(42px, 6vw, 78px);
  letter-spacing: .15em;
  text-indent: .15em;
  color: #f6ead5;
}

.chapter-card-en {
  font-family: var(--sans);
  font-size: 8px;
  letter-spacing: .28em;
  color: rgba(230, 205, 150, .48);
}

.chapter-card-line {
  width: 1px;
  height: 36px;
  margin-top: 6px;
  background: linear-gradient(var(--gold), transparent);
  opacity: .6;
}

/* ---------- overlays ---------- */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  place-items: center;
  padding: 24px;
}

.overlay.is-open {
  display: grid;
}

.overlay-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 10, 8, .72);
  backdrop-filter: blur(10px);
  animation: fade-in .35s var(--ease) both;
}

.journal-book,
.menu-card,
.about-card {
  position: relative;
  z-index: 1;
  animation: rise-in .45s var(--ease) both;
}

.journal-book {
  width: min(860px, 92vw);
  max-height: min(84vh, 760px);
  padding: clamp(24px, 4vw, 44px);
  overflow: auto;
  color: var(--ink);
  background:
    radial-gradient(ellipse at 90% 0%, rgba(193, 160, 102, .16), transparent 38%),
    linear-gradient(112deg, #fbf4e7, #f2e5cf 58%, #ead8ba);
  border: 1px solid rgba(140, 117, 77, .45);
  box-shadow: 0 40px 100px rgba(0, 0, 0, .42), inset 0 0 0 7px rgba(255, 250, 241, .36);
}

.journal-book::before {
  content: "";
  position: absolute;
  top: 14px;
  left: 14px;
  right: 14px;
  bottom: 14px;
  border: 1px solid rgba(140, 117, 77, .22);
  pointer-events: none;
}

.journal-head,
.menu-head,
.about-head {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.overlay-kicker {
  font-family: var(--sans);
  font-size: 8px;
  letter-spacing: .28em;
  color: rgba(140, 117, 77, .74);
}

.journal-head h2,
.menu-head h2,
.about-head h2 {
  margin: 6px 0 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(28px, 3.2vw, 42px);
  letter-spacing: .14em;
}

.journal-head h2 { color: #2b352d; }

.close-btn {
  position: relative;
  z-index: 2;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: #6c5c43;
  font-family: var(--sans);
  font-size: 22px;
  border: 1px solid rgba(140, 117, 77, .28);
  border-radius: 50%;
  transition: color .25s var(--ease), border-color .25s var(--ease), transform .25s var(--ease);
}

.close-btn:hover {
  color: var(--vermilion-deep);
  border-color: var(--vermilion);
  transform: rotate(90deg);
}

.journal-intro {
  margin: 18px 0 20px;
  padding-bottom: 16px;
  border-bottom: 1px dashed rgba(140, 117, 77, .3);
  font-family: var(--serif);
  font-size: 13px;
  letter-spacing: .12em;
  color: rgba(70, 65, 52, .62);
}

.journal-list {
  display: grid;
  gap: 0;
}

.journal-entry {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 16px;
  padding: 17px 0;
  border-bottom: 1px dashed rgba(140, 117, 77, .2);
  animation: rise-in .4s var(--ease) both;
}

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

.journal-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  color: var(--vermilion);
  font-family: var(--serif);
  font-size: 17px;
  border: 1px solid rgba(180, 77, 63, .32);
  border-radius: 50%;
}

.journal-mark.is-flower {
  color: var(--gold-dim);
  border-color: rgba(140, 117, 77, .32);
}

.journal-entry h3 {
  margin: 0 0 5px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 17px;
  letter-spacing: .12em;
  color: #2c382f;
}

.journal-entry p {
  margin: 0;
  font-family: var(--song);
  font-size: 13px;
  line-height: 1.9;
  letter-spacing: .04em;
  color: rgba(53, 60, 51, .72);
}

.journal-empty {
  padding: 34px 0;
  text-align: center;
  font-family: var(--serif);
  font-size: 14px;
  letter-spacing: .16em;
  color: rgba(70, 65, 52, .46);
}

.journal-foot {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-top: 20px;
  padding-top: 15px;
  border-top: 1px solid rgba(140, 117, 77, .22);
  font-family: var(--sans);
  font-size: 8px;
  letter-spacing: .16em;
  color: rgba(70, 65, 52, .46);
}

.menu-card {
  width: min(440px, 92vw);
  padding: 32px 34px 24px;
  color: var(--paper);
  background:
    radial-gradient(ellipse at 80% 0%, rgba(193, 160, 102, .16), transparent 42%),
    linear-gradient(150deg, #1d3028, #0b1511);
  border: 1px solid rgba(193, 160, 102, .46);
  box-shadow: 0 40px 100px rgba(0, 0, 0, .48), inset 0 0 0 6px rgba(247, 238, 223, .025);
}

.menu-head h2 { color: #f2e6d0; }
.menu-head .overlay-kicker { color: rgba(230, 205, 150, .58); }
.menu-head .close-btn { color: rgba(242, 230, 208, .6); border-color: rgba(193, 160, 102, .28); }
.menu-head .close-btn:hover { color: var(--gold-bright); border-color: var(--gold-bright); }

.menu-poem {
  margin: 18px 0 22px;
  font-family: var(--serif);
  font-size: 13px;
  letter-spacing: .16em;
  color: rgba(230, 205, 150, .6);
}

.menu-actions {
  display: grid;
}

.menu-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 2px;
  color: rgba(241, 229, 208, .82);
  text-align: left;
  border-top: 1px solid rgba(193, 160, 102, .16);
  transition: color .25s var(--ease), padding-left .25s var(--ease);
}

.menu-row:last-child {
  border-bottom: 1px solid rgba(193, 160, 102, .16);
}

.menu-row:hover {
  color: var(--gold-bright);
  padding-left: 8px;
}

.menu-row span {
  font-family: var(--serif);
  font-size: 16px;
  letter-spacing: .16em;
}

.menu-row em {
  font-family: var(--sans);
  font-style: normal;
  font-size: 7px;
  letter-spacing: .2em;
  opacity: .38;
}

.menu-foot {
  display: flex;
  justify-content: space-between;
  margin-top: 24px;
  font-family: var(--sans);
  font-size: 8px;
  letter-spacing: .14em;
  color: rgba(230, 214, 186, .32);
}

.about-card {
  width: min(560px, 92vw);
  padding: 34px 38px 30px;
  color: var(--ink);
  background: linear-gradient(112deg, #fbf4e7, #f0e2ca);
  border: 1px solid rgba(140, 117, 77, .45);
  box-shadow: 0 40px 100px rgba(0, 0, 0, .42);
}

.about-head h2 { color: #2b352d; }
.about-card p {
  font-family: var(--song);
  font-size: 13px;
  line-height: 2;
  letter-spacing: .04em;
  color: rgba(53, 60, 51, .78);
}

.about-card p + p {
  margin-top: 12px;
}

.about-small {
  font-family: var(--serif) !important;
  font-size: 11px !important;
  color: rgba(93, 80, 59, .58) !important;
}

.about-close {
  margin-top: 8px;
  color: var(--paper);
  background: var(--ink);
  border-color: var(--ink);
}

/* ---------- ending ---------- */

.ending-screen {
  overflow: hidden;
}

.ending-art {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 70% 30%, rgba(230, 196, 148, .25), transparent 46%),
    linear-gradient(135deg, #1a2c24, #0b1511);
  background-size: cover;
  background-position: center;
  transform: scale(1.02);
}

.ending-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(7, 13, 11, .9), rgba(7, 13, 11, .56) 38%, rgba(7, 13, 11, .06) 72%),
    linear-gradient(180deg, rgba(7, 13, 11, .4), transparent 30%, transparent 68%, rgba(7, 13, 11, .62));
}

.ending-card {
  position: absolute;
  z-index: 4;
  left: clamp(26px, 8vw, 132px);
  top: 50%;
  transform: translateY(-50%);
  width: min(560px, 76vw);
  color: var(--paper);
  animation: fade-in 1.4s var(--ease) both;
}

.ending-kicker {
  font-family: var(--sans);
  font-size: 9px;
  letter-spacing: .32em;
  color: var(--gold-bright);
}

.ending-card h2 {
  margin: 16px 0 14px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(52px, 7vw, 92px);
  letter-spacing: .1em;
  color: #f7ebd6;
}

.ending-quote {
  margin: 0 0 24px;
  padding-left: 16px;
  border-left: 2px solid rgba(180, 77, 63, .7);
  font-family: var(--serif);
  font-size: clamp(17px, 1.7vw, 22px);
  line-height: 1.8;
  letter-spacing: .1em;
  color: rgba(242, 226, 198, .86);
}

.ending-text {
  max-width: 480px;
  min-height: 5.6em;
  margin: 0 0 26px;
  font-family: var(--song);
  font-size: 14px;
  line-height: 2;
  letter-spacing: .06em;
  color: rgba(235, 222, 198, .72);
}

.ending-stats {
  display: flex;
  gap: 34px;
  margin-bottom: 30px;
  padding: 16px 0;
  border-top: 1px solid rgba(193, 160, 102, .24);
  border-bottom: 1px solid rgba(193, 160, 102, .24);
}

.ending-stats > div {
  display: flex;
  align-items: baseline;
  gap: 7px;
}

.ending-stats span {
  font-family: var(--serif);
  font-size: 26px;
  color: var(--gold-bright);
}

.ending-stats small {
  font-family: var(--sans);
  font-size: 8px;
  letter-spacing: .14em;
  color: rgba(235, 222, 198, .46);
}

.ending-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.ending-credit {
  margin-top: 34px;
  font-family: var(--sans);
  font-size: 8px;
  letter-spacing: .14em;
  color: rgba(235, 222, 198, .32);
}

/* ---------- toast / loading ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 218px;
  z-index: 130;
  max-width: min(520px, 82vw);
  padding: 12px 20px;
  color: var(--ink);
  background: rgba(250, 242, 228, .94);
  border: 1px solid rgba(193, 160, 102, .46);
  box-shadow: 0 18px 50px rgba(0, 0, 0, .28);
  font-family: var(--serif);
  font-size: 12px;
  line-height: 1.8;
  letter-spacing: .08em;
  text-align: center;
  opacity: 0;
  transform: translate(-50%, 10px);
  pointer-events: none;
  transition: opacity .35s var(--ease), transform .35s var(--ease);
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.loading {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 18px;
  background: #08100d;
  color: rgba(230, 205, 150, .6);
  transition: opacity .7s var(--ease), visibility .7s var(--ease);
}

.loading.is-done {
  opacity: 0;
  visibility: hidden;
}

.loading-flower {
  font-size: 30px;
  animation: slow-turn 9s linear infinite;
  color: var(--gold);
}

.loading p {
  margin: 0;
  font-family: var(--serif);
  font-size: 12px;
  letter-spacing: .28em;
}

/* ---------- animation ---------- */

@keyframes rise-in {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slow-turn {
  to { transform: rotate(360deg); }
}

@keyframes hint-breathe {
  0%, 100% { opacity: .45; }
  50% { opacity: .95; }
}

@keyframes flower-pop {
  0% { transform: scale(.7) rotate(-20deg); }
  55% { transform: scale(1.22) rotate(8deg); }
  100% { transform: scale(1) rotate(0); }
}

@keyframes hotspot-pulse {
  0% { transform: scale(.72); opacity: .9; }
  70% { transform: scale(1.55); opacity: 0; }
  100% { transform: scale(1.55); opacity: 0; }
}

/* ---------- responsive ---------- */

@media (max-width: 1000px) {
  .title-content { width: min(620px, 66vw); }
  .flower-pouch { width: 164px; padding: 17px 15px 14px; }
  .portrait-medallion { width: 122px; height: 122px; left: 4px; }
  .dialogue-wrap { width: min(900px, calc(100vw - 40px)); }
}

@media (max-width: 760px) {
  #app { min-height: 100svh; }

  .hud {
    padding: 12px 14px;
    gap: 8px;
  }

  .seal-small { width: 25px; height: 32px; font-size: 12px; }
  .brand-name { font-size: 19px; letter-spacing: .14em; }
  .hud-brand { min-width: auto; gap: 8px; }
  .hud-chapter { font-size: 12px; letter-spacing: .12em; gap: 5px; }
  .hud-tools { min-width: auto; gap: 0; }
  .icon-btn { width: 32px; height: 32px; font-size: 14px; }

  .title-content {
    top: auto;
    bottom: calc(76px + var(--safe-bottom));
    transform: none;
    width: calc(100vw - 44px);
    left: 22px;
  }

  .title-kicker { font-size: 9px; margin-bottom: 14px; letter-spacing: .22em; }
  .title-lockup { gap: 12px; }
  .title-seal { width: 34px; height: 54px; margin-bottom: 12px; font-size: 12px; }
  .title-main { font-size: clamp(86px, 27vw, 132px); }
  .title-sub { margin: 0 0 12px; font-size: 12px; letter-spacing: .38em; }
  .title-poem { margin: 16px 0 20px; font-size: 12px; line-height: 2; letter-spacing: .08em; }
  .title-actions { gap: 7px; }
  .btn { height: 44px; padding: 0 16px; font-size: 14px; gap: 10px; }
  .btn i { font-size: 7px; }
  .title-meta { margin-top: 18px; font-size: 7px; gap: 8px; flex-wrap: wrap; }
  .title-meta-line { width: 18px; }
  .title-flower { width: 54px; height: 54px; right: 22px; bottom: 36px; opacity: .6; }
  .title-scroll-hint { display: none; }
  .title-shade {
    background:
      linear-gradient(180deg, rgba(6, 12, 10, .1) 0%, transparent 20%, rgba(6, 12, 10, .58) 58%, rgba(6, 12, 10, .94) 100%),
      linear-gradient(90deg, rgba(6, 12, 10, .52), transparent 65%);
  }

  .scene-caption { display: none; }

  .flower-pouch {
    top: auto;
    right: 12px;
    bottom: calc(43vh + 22px + var(--safe-bottom));
    width: 142px;
    padding: 10px 12px 10px;
    background: linear-gradient(165deg, rgba(16, 27, 22, .82), rgba(8, 14, 12, .72));
  }

  .pouch-top { padding-bottom: 8px; }
  .pouch-title { font-size: 15px; }
  .pouch-count { font-size: 8px; }
  .flower-slots { flex-direction: row; gap: 2px; margin: 5px 0 5px; }
  .flower-slot { flex: 1; height: 34px; gap: 4px; justify-content: center; border-bottom: 0; padding: 0; }
  .flower-icon { width: 22px; height: 22px; font-size: 12px; }
  .flower-label { display: none; }
  .pouch-quote { display: none; }
  .pouch-journal { padding-top: 7px; font-size: 9px; letter-spacing: .08em; }
  .pouch-journal span { font-size: 10px; }

  .flower-hotspots { z-index: 26; }
  .hotspot { width: 42px; height: 42px; margin: -21px 0 0 -21px; }
  .hotspot .hotspot-core { inset: 17px; }
  .hotspot .hotspot-label { font-size: 10px; }
  .hotspot.prop-hotspot { width: 50px; height: 50px; margin: -25px 0 0 -25px; }
  .prop-hotspot .hotspot-core { inset: 20px; }
  .prop-hotspot .hotspot-label { font-size: 10px; padding: 4px 8px; }

  .hold-button { width: 72px; height: 72px; margin: -36px 0 0 -36px; }
  .hold-button .hold-glyph { font-size: 21px; }
  .hold-button .hold-label { top: calc(100% + 9px); font-size: 10px; padding: 4px 9px; }

  .dialogue-wrap {
    bottom: max(10px, var(--safe-bottom));
    width: calc(100vw - 20px);
  }

  .portrait-medallion {
    display: block;
    width: 84px;
    height: 84px;
    left: 6px;
    bottom: calc(100% - 12px);
  }

  .portrait-inner { inset: 5px; }
  .portrait-ring::before {
    right: 2px;
    bottom: 5px;
    width: 18px;
    height: 18px;
    font-size: 9px;
  }

  .dialogue {
    min-height: 0;
    max-height: 45vh;
    overflow: auto;
    padding: 15px 18px 11px 24px;
  }

  .dialogue::before { top: 12px; bottom: 12px; left: 9px; }
  .dialogue-head { margin-bottom: 7px; gap: 8px; }
  .speaker-seal { min-width: 32px; height: 24px; font-size: 11px; padding: 0 7px; }
  .speaker-en { display: none; }
  .dialogue-hint { font-size: 8px; }
  .dialogue-text { font-size: 15px; line-height: 1.9; }
  .dialogue-text.is-verse { font-size: 18px; }
  .dialogue-foot { margin-top: 8px; padding-top: 6px; font-size: 7px; }
  .key-hint { display: none; }
  .choices { gap: 5px; margin-top: 9px; }
  .choice-btn { min-height: 40px; padding: 8px 10px; gap: 9px; }
  .choice-key { width: 20px; height: 20px; flex-basis: 20px; font-size: 8px; }
  .choice-label { font-size: 13px; }
  .choice-hint { display: none; }

  .chapter-card-inner { padding: 32px 32px; }
  .chapter-card-inner::before, .chapter-card-inner::after { display: none; }
  .chapter-card-title { font-size: 42px; }

  .journal-book, .about-card { max-height: 86vh; }
  .journal-book { padding: 24px 20px; }
  .journal-entry { grid-template-columns: 36px minmax(0, 1fr); gap: 10px; padding: 13px 0; }
  .journal-mark { width: 30px; height: 30px; font-size: 14px; }
  .journal-entry h3 { font-size: 15px; }
  .journal-entry p { font-size: 12px; }
  .journal-intro { font-size: 12px; margin: 12px 0 8px; }
  .overlay { padding: 12px; }
  .menu-card { padding: 26px 22px 20px; }
  .about-card { padding: 26px 22px 22px; }
  .about-card p { font-size: 12px; }

  .poem-card { padding: 28px 20px 22px; }
  .poem-card::before { inset: 9px; }
  .poem-card h2 { font-size: 30px; }
  .poem-intro { font-size: 12px; line-height: 1.8; }
  .poem-target { gap: 7px; margin: 17px 0 15px; }
  .poem-slot { width: 46px; height: 54px; font-size: 24px; }
  .poem-tile { width: 44px; height: 48px; font-size: 21px; }
  .poem-hint { margin-top: 12px; font-size: 11px; }
  .poem-actions { margin-top: 13px; }
  .poem-reset, .poem-skip { min-width: 76px; padding: 7px 12px; font-size: 11px; }

  .ending-card {
    left: 22px;
    right: 22px;
    top: auto;
    bottom: calc(42px + var(--safe-bottom));
    transform: none;
    width: auto;
  }

  .ending-card h2 { font-size: 54px; margin: 10px 0 10px; }
  .ending-quote { font-size: 16px; margin-bottom: 14px; }
  .ending-text { font-size: 12px; line-height: 1.9; min-height: 0; margin-bottom: 16px; }
  .ending-stats { gap: 22px; padding: 10px 0; margin-bottom: 18px; }
  .ending-stats span { font-size: 21px; }
  .ending-credit { margin-top: 18px; }
  .toast { bottom: calc(43vh + 44px); font-size: 11px; }
}

@media (max-width: 420px) {
  .hud-chapter { display: none; }
  .title-main { font-size: 94px; }
  .flower-pouch { width: 128px; }
  .pouch-quote, .pouch-journal { display: none; }
  .ending-card h2 { font-size: 46px; }
}

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