:root {
  --ink: #3f3734;
  --ink-soft: #746a64;
  --ink-faint: #9d9289;
  --paper: #f4ece4;
  --paper-deep: #e7d8cb;
  --sakura: #d58d9c;
  --sakura-deep: #b86d7e;
  --gold: #a28a5e;
  --line: rgba(82, 66, 59, 0.18);
  --serif: "Songti SC", "STSong", "SimSun", "Source Han Serif SC", serif;
  --serif-heavy: "Source Han Serif SC Heavy", "Songti SC", "SimSun", serif;
  --sans: "Noto Sans SC", "Microsoft YaHei", "PingFang SC", sans-serif;
  --latin: "Georgia", "Times New Roman", serif;
  --ease-out: cubic-bezier(0.18, 0.76, 0.22, 1);
  --ease-soft: cubic-bezier(0.4, 0.1, 0.15, 1);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #e7ded5;
}

body {
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overscroll-behavior: none;
}

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

button:focus-visible {
  outline: 1px solid rgba(104, 78, 65, 0.62);
  outline-offset: 4px;
}

#app {
  position: relative;
  width: 100%;
  height: 100%;
  isolation: isolate;
  background:
    radial-gradient(120% 85% at 74% 20%, rgba(255, 250, 242, 0.92) 0%, rgba(244, 232, 221, 0.35) 50%, transparent 100%),
    linear-gradient(160deg, #eee5dd 0%, #e5d8cf 52%, #ded0c8 100%);
  transition: background 1.8s var(--ease-soft);
}

body.mode-dusk #app {
  background:
    radial-gradient(100% 70% at 78% 16%, rgba(255, 230, 208, 0.72) 0%, rgba(231, 190, 180, 0.22) 56%, transparent 100%),
    linear-gradient(162deg, #e7d5ce 0%, #dab9b4 48%, #ad9ba2 100%);
}

body.mode-night #app {
  background:
    radial-gradient(95% 70% at 72% 28%, rgba(85, 90, 125, 0.65) 0%, rgba(43, 45, 69, 0.38) 58%, transparent 100%),
    linear-gradient(165deg, #2a2a40 0%, #25263b 52%, #171824 100%);
}

#scene {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  cursor: grab;
  outline: none;
}

#scene.is-dragging {
  cursor: grabbing;
}

#scene.is-hovering {
  cursor: pointer;
}

.atmosphere,
.vignette,
.grain,
.light-wash {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.atmosphere {
  z-index: 2;
}

.vignette {
  background:
    radial-gradient(125% 88% at 57% 48%, transparent 56%, rgba(66, 48, 40, 0.12) 84%, rgba(61, 45, 39, 0.23) 100%);
  mix-blend-mode: multiply;
  opacity: 0.8;
  transition: opacity 1.8s ease;
}

body.mode-night .vignette {
  opacity: 1;
  background:
    radial-gradient(125% 88% at 57% 48%, transparent 50%, rgba(8, 10, 23, 0.28) 82%, rgba(5, 7, 16, 0.52) 100%);
}

.grain {
  opacity: 0.25;
  mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 300 300' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.88' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
  background-size: 220px 220px;
  animation: grainShift 9s steps(7) infinite;
}

@keyframes grainShift {
  0% { transform: translate(0, 0); }
  20% { transform: translate(-1.4%, 0.7%); }
  40% { transform: translate(0.8%, -1.2%); }
  60% { transform: translate(-0.4%, 1.4%); }
  80% { transform: translate(1.2%, -0.3%); }
  100% { transform: translate(0, 0); }
}

.light-wash {
  background:
    linear-gradient(90deg, rgba(247, 240, 232, 0.78) 0%, rgba(246, 238, 230, 0.65) 12%, rgba(246, 238, 230, 0.3) 26%, rgba(246, 238, 230, 0.04) 36%, transparent 44%),
    linear-gradient(112deg, rgba(255, 247, 235, 0.18) 0%, transparent 30%),
    radial-gradient(65% 55% at 82% 20%, rgba(255, 226, 201, 0.16), transparent 72%);
  transition: opacity 1.8s ease, background 1.8s ease;
}

body.mode-dusk .light-wash {
  background:
    linear-gradient(90deg, rgba(239, 218, 209, 0.8) 0%, rgba(235, 208, 200, 0.62) 13%, rgba(225, 190, 184, 0.27) 27%, rgba(225, 190, 184, 0.04) 38%, transparent 46%),
    radial-gradient(65% 55% at 82% 20%, rgba(255, 195, 144, 0.22), transparent 72%);
}

body.mode-night .light-wash {
  background:
    linear-gradient(90deg, rgba(23, 24, 38, 0.9) 0%, rgba(24, 25, 40, 0.72) 13%, rgba(28, 29, 45, 0.33) 28%, rgba(30, 30, 48, 0.04) 39%, transparent 47%),
    radial-gradient(60% 55% at 82% 22%, rgba(186, 145, 169, 0.08), transparent 72%);
}

.interface {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  color: var(--ink);
  opacity: 1;
  transition: opacity 0.8s var(--ease-soft);
}

body.mode-night .poem {
  color: #eee2d8;
}

body.mode-night h1,
body.mode-night h1 span {
  color: #f2e4d8;
  text-shadow: 0 1px 12px rgba(8, 9, 20, 0.22);
}

body.mode-night h1 span::after {
  background: linear-gradient(90deg, rgba(214, 178, 177, 0.42), transparent 92%);
}

body.mode-night .eyebrow,
body.mode-night .lead,
body.mode-night .poem-lines,
body.mode-night .interaction-note {
  color: rgba(231, 215, 205, 0.61);
}

body.mode-night .poem-lines::before {
  background: linear-gradient(to bottom, rgba(229, 207, 194, 0.26), rgba(229, 207, 194, 0.04));
}

body.mode-night .note-dot {
  background: #d8b2b8;
  box-shadow: 0 0 0 4px rgba(216, 178, 184, 0.08);
}

body.mode-night .meta-caption,
body.mode-night .meta-index,
body.mode-night .brand-copy {
  color: rgba(236, 219, 207, 0.55);
}

body.mode-night .meta-rule {
  background: rgba(235, 216, 204, 0.26);
}

body.mode-night .brand-kanji {
  color: rgba(238, 213, 200, 0.72);
  border-color: rgba(233, 210, 197, 0.24);
}

body.mode-night .object-hint {
  color: rgba(250, 238, 224, 0.85);
  background: rgba(38, 38, 55, 0.78);
  border-color: rgba(232, 216, 203, 0.14);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.23);
}

body.mode-night .hint-dot {
  background: #d8b2b8;
}

.poem {
  position: absolute;
  left: clamp(32px, 6.2vw, 108px);
  top: clamp(42px, 11vh, 116px);
  width: min(31vw, 370px);
  transition: opacity 1s var(--ease-soft), transform 1.1s var(--ease-soft);
}

.interface.is-reading .poem,
.interface.is-reading .scene-meta,
.interface.is-reading .brand-mark,
.interface.is-reading .control-dock,
.interface.is-reading .scene-caption,
body.is-ticketing .interface {
  opacity: 0;
  pointer-events: none;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #76655c;
  font-family: var(--latin);
  font-size: 9px;
  letter-spacing: 0.22em;
  line-height: 1;
  margin-bottom: 38px;
  opacity: 0.9;
}

.eyebrow-line {
  width: 34px;
  height: 1px;
  background: currentColor;
  opacity: 0.6;
}

h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(39px, 4.45vw, 68px);
  font-weight: 400;
  letter-spacing: 0.045em;
  line-height: 1.32;
  color: #382f2b;
  text-shadow: 0 0 30px rgba(249, 241, 233, 0.78);
}

h1 span {
  position: relative;
  display: inline-block;
  color: #5b4644;
}

h1 span::after {
  content: "";
  position: absolute;
  left: 0.13em;
  right: 0.1em;
  bottom: 0.055em;
  height: 1px;
  background: linear-gradient(90deg, rgba(152, 108, 109, 0.52), transparent 92%);
}

.lead {
  margin: 31px 0 0;
  color: #675952;
  font-family: var(--serif);
  font-size: clamp(12px, 1.02vw, 14px);
  letter-spacing: 0.1em;
  line-height: 2.13;
  font-weight: 400;
  text-shadow: 0 0 22px rgba(249, 241, 233, 0.72);
}

.poem-lines {
  position: relative;
  margin-top: 43px;
  padding-left: 17px;
  color: #7e6f65;
  font-family: var(--serif);
  font-size: 11px;
  line-height: 2.1;
  letter-spacing: 0.08em;
  text-shadow: 0 0 18px rgba(249, 241, 233, 0.65);
}

.poem-lines::before {
  content: "";
  position: absolute;
  top: 3px;
  bottom: 2px;
  left: 0;
  width: 1px;
  background: linear-gradient(to bottom, rgba(119, 94, 81, 0.34), rgba(119, 94, 81, 0.06));
}

.poem-lines p {
  margin: 0;
}

.poem-lines .small {
  margin-top: 20px;
  font-family: var(--latin);
  font-size: 8.5px;
  letter-spacing: 0.14em;
  line-height: 1.7;
  opacity: 0.7;
}

.interaction-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 38px 0 0;
  color: #8b7a6e;
  font-family: var(--sans);
  font-size: 9px;
  line-height: 1.9;
  letter-spacing: 0.1em;
  opacity: 0.94;
  text-shadow: 0 0 18px rgba(249, 241, 233, 0.7);
}

.note-dot {
  width: 4px;
  height: 4px;
  margin-top: 7px;
  border-radius: 50%;
  background: var(--sakura-deep);
  box-shadow: 0 0 0 4px rgba(184, 109, 126, 0.1);
}

.scene-meta {
  position: absolute;
  right: clamp(26px, 4.2vw, 72px);
  top: clamp(30px, 7vh, 70px);
  display: flex;
  align-items: flex-start;
  gap: 14px;
  color: var(--ink-soft);
  transition: opacity 1s var(--ease-soft);
}

.meta-index {
  font-family: var(--latin);
  font-size: 26px;
  font-weight: 400;
  line-height: 0.85;
  letter-spacing: -0.03em;
  opacity: 0.64;
}

.meta-rule {
  width: 34px;
  height: 1px;
  background: rgba(94, 77, 68, 0.35);
  margin-top: 7px;
}

.meta-caption {
  font-family: var(--latin);
  font-size: 7.5px;
  line-height: 1.65;
  letter-spacing: 0.19em;
  opacity: 0.65;
}

.brand-mark {
  position: absolute;
  right: clamp(30px, 4.6vw, 78px);
  bottom: clamp(104px, 15vh, 146px);
  display: flex;
  align-items: center;
  gap: 13px;
  opacity: 0.68;
  transition: opacity 1s ease;
}

.brand-kanji {
  display: grid;
  place-items: center;
  width: 41px;
  height: 41px;
  border: 1px solid rgba(94, 73, 66, 0.3);
  border-radius: 50%;
  color: #805d5d;
  font-family: var(--serif);
  font-size: 20px;
  line-height: 1;
}

.brand-copy {
  font-family: var(--latin);
  font-size: 7px;
  line-height: 1.55;
  letter-spacing: 0.21em;
  color: var(--ink-soft);
}

.control-dock {
  position: absolute;
  left: 50%;
  bottom: clamp(24px, 4vh, 42px);
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 7px 10px 7px 8px;
  border: 1px solid rgba(104, 82, 72, 0.14);
  border-radius: 999px;
  background: rgba(247, 240, 232, 0.55);
  box-shadow: 0 9px 40px rgba(75, 54, 44, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(16px) saturate(1.1);
  -webkit-backdrop-filter: blur(16px) saturate(1.1);
  pointer-events: auto;
  transition: opacity 0.8s var(--ease-soft), background 1.3s ease, border-color 1.3s ease;
}

body.mode-night .control-dock {
  background: rgba(37, 37, 54, 0.58);
  border-color: rgba(220, 207, 196, 0.12);
  box-shadow: 0 9px 40px rgba(0, 0, 0, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  color: rgba(239, 228, 218, 0.82);
}

.light-switch {
  display: flex;
  align-items: center;
  gap: 2px;
}

.light-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 999px;
  font-family: var(--sans);
  font-size: 9px;
  letter-spacing: 0.12em;
  color: var(--ink-soft);
  opacity: 0.65;
  transition: color 0.35s ease, background 0.35s ease, opacity 0.35s ease;
}

body.mode-night .light-btn {
  color: rgba(239, 228, 218, 0.68);
}

.light-btn span {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.45;
  transition: background 0.35s ease, transform 0.35s ease, opacity 0.35s ease;
}

.light-btn:hover {
  opacity: 0.9;
}

.light-btn.is-active {
  color: var(--ink);
  opacity: 1;
  background: rgba(255, 251, 246, 0.68);
  box-shadow: 0 1px 8px rgba(74, 54, 45, 0.06);
}

body.mode-night .light-btn.is-active {
  color: #f1e3d3;
  background: rgba(238, 218, 195, 0.12);
}

.light-btn.is-active span {
  opacity: 1;
  transform: scale(1.2);
}

.light-btn[data-mode="day"].is-active span { background: #bf9563; }
.light-btn[data-mode="dusk"].is-active span { background: #bf6c62; }
.light-btn[data-mode="night"].is-active span { background: #c9b4d7; box-shadow: 0 0 7px rgba(201, 180, 215, 0.8); }

.dock-divider {
  width: 1px;
  height: 16px;
  background: rgba(95, 74, 63, 0.17);
}

body.mode-night .dock-divider {
  background: rgba(230, 216, 203, 0.14);
}

.round-btn {
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  border-radius: 50%;
  color: var(--ink-soft);
  opacity: 0.65;
  transition: opacity 0.3s ease, background 0.3s ease, transform 0.5s var(--ease-out);
}

.round-btn:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.45);
}

body.mode-night .round-btn {
  color: rgba(240, 227, 213, 0.8);
}

body.mode-night .round-btn:hover {
  background: rgba(255, 255, 255, 0.08);
}

.round-btn svg {
  width: 16px;
  height: 16px;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.25;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.round-btn:active {
  transform: rotate(-28deg);
}

.scene-caption {
  position: absolute;
  left: clamp(32px, 6.2vw, 108px);
  bottom: clamp(33px, 5.1vh, 53px);
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink-faint);
  font-family: var(--latin);
  font-size: 7.5px;
  letter-spacing: 0.17em;
  opacity: 0.7;
  transition: color 1.3s ease;
}

body.mode-night .scene-caption {
  color: rgba(233, 218, 207, 0.55);
}

.scene-caption i {
  display: block;
  width: 27px;
  height: 1px;
  background: currentColor;
  opacity: 0.45;
}

.mobile-hint {
  display: none;
}

.object-hint {
  position: fixed;
  z-index: 9;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px 8px 10px;
  border-radius: 3px;
  border: 1px solid rgba(103, 82, 70, 0.16);
  background: rgba(249, 243, 234, 0.82);
  color: #57473f;
  font-family: var(--sans);
  font-size: 9px;
  letter-spacing: 0.1em;
  box-shadow: 0 8px 30px rgba(64, 45, 36, 0.11);
  backdrop-filter: blur(10px);
  pointer-events: none;
  opacity: 0;
  transform: translate3d(0, 5px, 0);
  transition: opacity 0.24s ease, transform 0.24s ease;
}

.object-hint.is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

.hint-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--sakura-deep);
  box-shadow: 0 0 0 3px rgba(184, 109, 126, 0.11);
}

/* ---------------- Loader ---------------- */
.loader {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: #ece2d9;
  color: #67554c;
  transition: opacity 0.9s var(--ease-soft), visibility 0.9s;
}

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

.loader-mark {
  position: relative;
  width: 38px;
  height: 38px;
  margin-bottom: 7px;
}

.loader-petal {
  position: absolute;
  left: 14px;
  top: 2px;
  width: 11px;
  height: 16px;
  border-radius: 100% 0 100% 0;
  background: rgba(190, 130, 141, 0.64);
  transform-origin: 50% 100%;
  animation: petalTurn 2.4s var(--ease-soft) infinite;
}

.loader-petal.second {
  --r: 120deg;
  transform: rotate(120deg) translateY(8px);
  background: rgba(199, 148, 150, 0.48);
  animation-delay: -0.8s;
}

.loader-petal.third {
  --r: 240deg;
  transform: rotate(240deg) translateY(8px);
  background: rgba(205, 161, 160, 0.38);
  animation-delay: -1.6s;
}

@keyframes petalTurn {
  0%, 100% { opacity: 0.35; transform: rotate(var(--r, 0deg)) scale(0.82); }
  50% { opacity: 1; transform: rotate(calc(var(--r, 0deg) + 8deg)) scale(1); }
}

.loader p {
  margin: 0;
  font-family: var(--serif);
  font-size: 16px;
  letter-spacing: 0.3em;
  opacity: 0.75;
}

.loader-sub {
  font-family: var(--latin);
  font-size: 7.5px;
  letter-spacing: 0.17em;
  opacity: 0.44;
}

.loader-fallback {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  max-width: 380px;
  padding: 30px;
  text-align: center;
}

.loader-fallback-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(127, 100, 84, 0.35);
  border-radius: 50%;
  color: #8b6461;
  font-family: var(--serif);
  font-size: 21px;
}

.loader-fallback p {
  margin: 0;
  letter-spacing: 0.16em;
}

.loader-fallback .loader-sub {
  max-width: 290px;
  line-height: 1.9;
  letter-spacing: 0.1em;
  opacity: 0.56;
}

/* ---------------- Poster reader ---------------- */
.reader {
  position: absolute;
  inset: 0;
  z-index: 8;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.85s var(--ease-soft), visibility 0.85s;
}

.reader.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.reader-wash {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(243, 234, 224, 0.9) 0%, rgba(243, 234, 224, 0.68) 25%, rgba(243, 234, 224, 0.08) 53%, transparent 68%),
    linear-gradient(0deg, rgba(61, 44, 36, 0.12), transparent 30%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.9s var(--ease-soft);
}

.reader.is-settled .reader-wash {
  opacity: 1;
}

.reader-head {
  position: absolute;
  left: clamp(32px, 6.2vw, 108px);
  top: clamp(50px, 13vh, 140px);
  width: min(28vw, 320px);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.9s 0.25s var(--ease-soft), transform 0.9s 0.25s var(--ease-soft);
}

.reader.is-settled .reader-head {
  opacity: 1;
  transform: none;
}

.reader-kicker {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #8d7b70;
  font-family: var(--latin);
  font-size: 8px;
  letter-spacing: 0.2em;
}

.reader-kicker span {
  width: 22px;
  height: 1px;
  background: currentColor;
  opacity: 0.5;
}

.reader-head h2 {
  margin: 24px 0 9px;
  color: #473936;
  font-family: var(--serif);
  font-size: clamp(36px, 4vw, 58px);
  font-weight: 400;
  letter-spacing: 0.08em;
  line-height: 1.2;
}

.reader-head > p {
  margin: 0;
  color: #9d8b80;
  font-family: var(--latin);
  font-size: 8px;
  letter-spacing: 0.2em;
}

.reader-info {
  position: absolute;
  left: clamp(32px, 6.2vw, 108px);
  bottom: clamp(100px, 17vh, 165px);
  width: min(27vw, 312px);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.9s 0.35s var(--ease-soft), transform 0.9s 0.35s var(--ease-soft);
}

.reader.is-settled .reader-info {
  opacity: 1;
  transform: none;
}

.reader-info > p {
  margin: 0;
  color: #7b6a61;
  font-family: var(--serif);
  font-size: 11.5px;
  line-height: 2.08;
  letter-spacing: 0.075em;
}

.reader-pager {
  display: flex;
  align-items: center;
  gap: 17px;
  margin-top: 27px;
  color: #8b786d;
  font-family: var(--latin);
  font-size: 10px;
  letter-spacing: 0.17em;
}

.reader-pager span i {
  font-style: normal;
  opacity: 0.4;
  margin: 0 4px;
}

.pager-btn {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid rgba(104, 82, 70, 0.21);
  border-radius: 50%;
  color: #756259;
  transition: background 0.3s ease, transform 0.4s var(--ease-out), border-color 0.3s ease;
}

.pager-btn:hover {
  background: rgba(255, 250, 243, 0.5);
  border-color: rgba(104, 82, 70, 0.38);
  transform: scale(1.04);
}

.pager-btn svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.15;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.reader-back {
  position: absolute;
  right: clamp(28px, 4.4vw, 72px);
  bottom: clamp(36px, 5.4vh, 58px);
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 17px;
  border: 1px solid rgba(104, 82, 70, 0.23);
  border-radius: 2px;
  color: #6f5b52;
  background: rgba(250, 244, 236, 0.33);
  font-family: var(--sans);
  font-size: 9px;
  letter-spacing: 0.12em;
  backdrop-filter: blur(9px);
  transition: background 0.3s ease, border-color 0.3s ease;
  opacity: 0;
  pointer-events: none;
}

.reader.is-settled .reader-back {
  opacity: 1;
  pointer-events: auto;
}

.reader-back:hover {
  background: rgba(250, 244, 236, 0.64);
  border-color: rgba(104, 82, 70, 0.38);
}

.reader-back svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.reader-index {
  position: absolute;
  right: clamp(31px, 4.7vw, 77px);
  top: clamp(30px, 7vh, 70px);
  display: flex;
  align-items: flex-start;
  gap: 16px;
  color: #8e7a6e;
  font-family: var(--latin);
  font-size: 7.5px;
  line-height: 1.7;
  letter-spacing: 0.19em;
  opacity: 0;
  transition: opacity 0.8s ease;
}

.reader.is-settled .reader-index {
  opacity: 0.66;
}

.reader-index b {
  font-size: 26px;
  font-weight: 400;
  line-height: 0.9;
  letter-spacing: -0.03em;
}

/* ---------------- Ticket overlay ---------------- */
.ticket-overlay {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.8s var(--ease-soft), visibility 0.8s;
}

.ticket-overlay.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.ticket-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(95% 80% at 58% 50%, rgba(68, 52, 47, 0.22), rgba(43, 34, 35, 0.65)),
    rgba(47, 37, 36, 0.38);
  backdrop-filter: blur(13px) saturate(0.8);
  -webkit-backdrop-filter: blur(13px) saturate(0.8);
}

.ticket-overlay::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(75% 70% at 65% 52%, rgba(254, 239, 220, 0.18), transparent 70%);
  pointer-events: none;
}

.ticket-close-wrap {
  position: absolute;
  right: clamp(22px, 3.2vw, 46px);
  top: clamp(20px, 4vh, 38px);
}

.ticket-close {
  display: grid;
  place-items: center;
  width: 37px;
  height: 37px;
  border: 1px solid rgba(246, 230, 211, 0.22);
  border-radius: 50%;
  color: rgba(250, 239, 226, 0.73);
  transition: background 0.3s ease, border-color 0.3s ease;
}

.ticket-close:hover {
  background: rgba(255, 247, 235, 0.08);
  border-color: rgba(246, 230, 211, 0.44);
}

.ticket-close svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.1;
  stroke-linecap: round;
}

.ticket-copy {
  position: absolute;
  left: clamp(32px, 6.2vw, 108px);
  top: clamp(70px, 17vh, 180px);
  width: min(32vw, 390px);
  color: #f1e2d1;
  opacity: 0;
  transform: translateY(13px);
  transition: opacity 1s 0.4s var(--ease-soft), transform 1s 0.4s var(--ease-soft);
}

.ticket-overlay.is-settled .ticket-copy {
  opacity: 0.92;
  transform: none;
}

.ticket-kicker {
  display: block;
  color: rgba(244, 224, 202, 0.55);
  font-family: var(--latin);
  font-size: 7.5px;
  letter-spacing: 0.22em;
  line-height: 1.6;
}

.ticket-copy h2 {
  margin: 25px 0 22px;
  color: #f4e6d4;
  font-family: var(--serif);
  font-size: clamp(32px, 3.15vw, 46px);
  font-weight: 400;
  letter-spacing: 0.065em;
  line-height: 1.35;
  white-space: nowrap;
}

.ticket-copy p {
  margin: 0;
  color: rgba(241, 224, 204, 0.65);
  font-family: var(--serif);
  font-size: 11px;
  line-height: 2;
  letter-spacing: 0.08em;
}

.ticket-status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 33px;
  color: rgba(238, 217, 194, 0.44);
  font-family: var(--sans);
  font-size: 8px;
  letter-spacing: 0.12em;
}

.status-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #d4b48f;
  box-shadow: 0 0 0 4px rgba(212, 180, 143, 0.1);
  animation: statusPulse 3.5s ease infinite;
}

@keyframes statusPulse {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 1; }
}

.keepsake {
  position: relative;
  width: min(720px, 63vw);
  height: min(680px, 76vh);
  margin-left: 23vw;
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 1600px;
  opacity: 0;
  transform: translateY(24px) scale(0.97);
  transition: opacity 1.1s 0.1s var(--ease-soft), transform 1.2s 0.1s var(--ease-soft);
}

.ticket-overlay.is-settled .keepsake {
  opacity: 1;
  transform: none;
}

.mail {
  position: relative;
  width: min(560px, 46vw);
  height: min(420px, 48vh);
  transform: rotateX(8deg) rotateZ(-2deg);
  transform-style: preserve-3d;
  transition: transform 1.7s var(--ease-soft);
}

.envelope {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  transform-style: preserve-3d;
  transform: translateZ(0);
  filter: drop-shadow(0 30px 34px rgba(20, 13, 14, 0.24));
  transition: transform 1.4s 0.4s var(--ease-soft), opacity 0.8s 0.7s ease;
}

.env-back,
.env-front,
.env-inner,
.env-side,
.env-flap {
  position: absolute;
}

.env-back {
  inset: 0;
  border-radius: 3px;
  background:
    linear-gradient(122deg, rgba(255, 255, 255, 0.48), transparent 39%),
    linear-gradient(155deg, #eee0cc 0%, #e7d5c1 54%, #decab5 100%);
  box-shadow: inset 0 0 0 1px rgba(139, 106, 83, 0.14);
}

.env-inner {
  inset: 7px;
  background:
    radial-gradient(70% 70% at 50% 20%, rgba(107, 74, 53, 0.17), transparent 70%),
    #d8c2aa;
  border-radius: 2px;
  transform: translateZ(-1px);
}

.env-front {
  left: 0;
  right: 0;
  bottom: 0;
  height: 72%;
  background:
    linear-gradient(133deg, rgba(255, 255, 255, 0.32), transparent 36%),
    linear-gradient(170deg, #eadbc8 0%, #e2ceb8 62%, #dac2aa 100%);
  clip-path: polygon(0 0, 50% 43%, 100% 0, 100% 100%, 0 100%);
  box-shadow: inset 0 1px 0 rgba(255, 251, 244, 0.4);
  z-index: 3;
}

.env-side {
  bottom: 0;
  height: 78%;
  width: 52%;
  opacity: 0.96;
  z-index: 2;
}

.env-side.left {
  left: 0;
  background: linear-gradient(145deg, #e9d9c4, #dcc5ae);
  clip-path: polygon(0 0, 100% 48%, 100% 100%, 0 100%);
}

.env-side.right {
  right: 0;
  background: linear-gradient(215deg, #eadbc8, #d8c0a9);
  clip-path: polygon(100% 0, 0 48%, 0 100%, 100% 100%);
}

.env-flap {
  left: 0;
  right: 0;
  top: 0;
  height: 57%;
  z-index: 4;
  transform-origin: top center;
  transform-style: preserve-3d;
  transition: transform 1.4s var(--ease-soft), z-index 0s linear 0.72s;
  filter: drop-shadow(0 2px 1px rgba(102, 72, 51, 0.08));
}

.env-flap-inner {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.45), transparent 46%),
    linear-gradient(165deg, #eee0cd 0%, #e5d2bd 58%, #dcc5ad 100%);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  border-radius: 3px 3px 0 0;
  box-shadow: inset 0 0 0 1px rgba(137, 103, 78, 0.09);
}

.env-seal {
  position: absolute;
  left: 50%;
  top: 51%;
  z-index: 6;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  margin-left: -29px;
  border-radius: 50%;
  color: rgba(255, 235, 221, 0.77);
  background:
    radial-gradient(60% 60% at 37% 30%, rgba(217, 137, 137, 0.98), rgba(150, 55, 70, 0.96) 70%, rgba(123, 38, 53, 0.97));
  box-shadow:
    0 3px 7px rgba(84, 28, 38, 0.28),
    inset 0 1px 2px rgba(255, 200, 197, 0.34),
    inset 0 0 0 3px rgba(121, 38, 48, 0.22);
  font-family: var(--serif);
  font-size: 23px;
  transition: opacity 0.5s ease, transform 0.7s var(--ease-soft);
  pointer-events: none;
}

.env-seal::after {
  content: "";
  position: absolute;
  inset: 5px;
  border: 1px solid rgba(255, 212, 198, 0.27);
  border-radius: 50%;
}

.env-stamp {
  position: absolute;
  top: 18%;
  right: 8%;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 54px;
  height: 64px;
  border: 1px solid rgba(164, 102, 105, 0.45);
  color: rgba(161, 85, 93, 0.6);
  font-family: var(--latin);
  font-size: 6px;
  line-height: 1.4;
  letter-spacing: 0.12em;
  text-align: center;
  transform: rotate(4deg);
  opacity: 0;
  transition: opacity 0.8s 1.15s ease;
}

.env-stamp::after {
  content: "";
  position: absolute;
  inset: 4px;
  border: 1px dashed rgba(161, 85, 93, 0.3);
}

.env-postmark {
  position: absolute;
  top: 19%;
  right: 17%;
  z-index: 2;
  color: rgba(130, 80, 79, 0.49);
  font-family: var(--serif);
  font-size: 10px;
  line-height: 1.4;
  letter-spacing: 0.12em;
  transform: rotate(-7deg);
  opacity: 0;
  transition: opacity 0.8s 1.25s ease;
}

.env-postmark i {
  font-family: var(--latin);
  font-size: 7px;
  font-style: normal;
  letter-spacing: 0.1em;
}

.env-address {
  position: absolute;
  left: 9%;
  bottom: 13%;
  z-index: 5;
  width: 36%;
  color: rgba(112, 79, 62, 0.54);
  font-family: var(--serif);
  font-size: 9px;
  letter-spacing: 0.17em;
  transform: rotate(-1deg);
  opacity: 0;
  transition: opacity 0.8s 1.3s ease;
}

.env-address i {
  display: block;
  height: 1px;
  margin-top: 10px;
  background: rgba(120, 86, 67, 0.24);
}

.env-address i:nth-of-type(2) { width: 78%; }
.env-address i:nth-of-type(3) { width: 57%; }

.mail.is-open .envelope {
  opacity: 0.38;
  transform: translateY(145px) translateZ(-100px) scale(0.92);
}

.mail.is-open .env-flap {
  transform: rotateX(-168deg);
  z-index: 1;
}

.mail.is-open .env-seal {
  opacity: 0;
  transform: scale(0.65) rotate(-22deg);
}

.mail.is-open .env-stamp,
.mail.is-open .env-postmark,
.mail.is-open .env-address {
  opacity: 1;
}

.ticket-sheet {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 2;
  width: min(510px, 42vw);
  height: min(244px, 29vh);
  margin-left: min(-255px, -21vw);
  margin-top: min(-122px, -14.5vh);
  display: flex;
  transform: translateY(72px) translateZ(-20px) rotateZ(2deg) scale(0.92);
  opacity: 0;
  transition: transform 1.45s var(--ease-out), opacity 0.8s 0.7s ease;
  filter: drop-shadow(0 20px 24px rgba(27, 18, 17, 0.25));
  transform-style: preserve-3d;
}

.mail.is-open .ticket-sheet {
  transform: translateY(-70px) translateZ(70px) rotateZ(-0.7deg) scale(1);
  opacity: 1;
  z-index: 6;
}

.ticket-main {
  position: relative;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(139, 112, 75, 0.38);
  border-radius: 2px 0 0 2px;
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(255, 255, 255, 0.85), transparent 51%),
    linear-gradient(145deg, #fbf3e5 0%, #f5e8d5 57%, #efdec8 100%);
  box-shadow:
    inset 0 0 0 5px rgba(252, 245, 233, 0.48),
    inset 0 0 26px rgba(152, 111, 73, 0.09);
}

.ticket-paper-grain {
  position: absolute;
  inset: 0;
  opacity: 0.16;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='p'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23p)' opacity='0.35'/%3E%3C/svg%3E");
  pointer-events: none;
}

.ticket-main::before {
  content: "";
  position: absolute;
  inset: 9px;
  border: 1px solid rgba(165, 133, 94, 0.27);
  border-radius: 1px;
  pointer-events: none;
}

.ticket-main::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(45% 70% at 84% 9%, rgba(228, 173, 170, 0.13), transparent 60%),
    linear-gradient(90deg, transparent 72%, rgba(173, 129, 84, 0.035) 72%);
}

.ticket-head {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 21px 23px 0;
}

.ticket-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ticket-sakura {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(159, 99, 101, 0.4);
  border-radius: 50%;
  color: #a7616d;
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1;
}

.ticket-brand b {
  display: block;
  font-family: var(--latin);
  font-size: 9px;
  font-weight: 400;
  letter-spacing: 0.19em;
  color: #6e5044;
}

.ticket-brand small {
  display: block;
  margin-top: 3px;
  color: #9a7f6d;
  font-family: var(--serif);
  font-size: 8px;
  letter-spacing: 0.24em;
}

.ticket-class {
  padding-left: 13px;
  border-left: 1px solid rgba(146, 112, 78, 0.25);
  color: #9d7f68;
  font-family: var(--latin);
  font-size: 6.5px;
  line-height: 1.6;
  letter-spacing: 0.18em;
  text-align: right;
}

.ticket-route {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: end;
  gap: 16px;
  padding: 20px 23px 0;
}

.ticket-route > div:first-child,
.route-end {
  min-width: 77px;
}

.ticket-route span,
.ticket-meta span {
  display: block;
  color: #a38b79;
  font-family: var(--latin);
  font-size: 6px;
  letter-spacing: 0.17em;
}

.ticket-route b {
  display: block;
  margin: 5px 0 3px;
  color: #58443a;
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 400;
  letter-spacing: 0.08em;
}

.ticket-route small,
.ticket-meta small {
  display: block;
  color: #aa9280;
  font-family: var(--latin);
  font-size: 5.7px;
  letter-spacing: 0.12em;
}

.route-line {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-bottom: 12px;
  color: #aa7f71;
}

.route-line i {
  flex: 1;
  height: 1px;
  background-image: linear-gradient(90deg, rgba(165, 126, 110, 0.6) 50%, transparent 50%);
  background-size: 5px 1px;
}

.route-line span {
  font-family: var(--latin);
  font-size: 12px;
  color: #b17d76;
}

.route-end {
  text-align: right;
}

.ticket-meta {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.2fr 1fr 0.8fr;
  gap: 12px;
  margin: 17px 23px 0;
  padding-top: 11px;
  border-top: 1px solid rgba(156, 120, 82, 0.19);
}

.ticket-meta b {
  display: block;
  margin: 4px 0 2px;
  color: #675047;
  font-family: var(--serif);
  font-size: 9.5px;
  font-weight: 400;
  letter-spacing: 0.045em;
  white-space: nowrap;
}

.ticket-footer {
  position: absolute;
  left: 23px;
  right: 20px;
  bottom: 14px;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 9px;
  color: #b19a86;
  font-family: var(--latin);
  font-size: 5.5px;
  letter-spacing: 0.12em;
}

.ticket-motto {
  color: #a0776e;
  font-family: var(--serif);
  font-size: 7px;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.ticket-stamp {
  position: absolute;
  right: 36px;
  bottom: 39px;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border: 1px solid rgba(178, 99, 102, 0.28);
  border-radius: 50%;
  color: rgba(171, 90, 94, 0.37);
  transform: rotate(-12deg);
}

.ticket-stamp::after {
  content: "";
  position: absolute;
  inset: 4px;
  border: 1px dashed rgba(171, 90, 94, 0.24);
  border-radius: 50%;
}

.ticket-stamp span {
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1;
}

.ticket-stamp i {
  font-family: var(--serif);
  font-size: 5px;
  font-style: normal;
  letter-spacing: 0.1em;
}

.ticket-perforation {
  position: relative;
  z-index: 3;
  width: 1px;
  margin: 8px 0;
  background-image: linear-gradient(180deg, transparent 0%, rgba(146, 112, 78, 0.37) 6%, rgba(146, 112, 78, 0.37) 94%, transparent 100%);
  background-size: 1px 6px;
  background-repeat: repeat-y;
}

.ticket-perforation::before,
.ticket-perforation::after {
  content: "";
  position: absolute;
  left: -4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #463836;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.35);
}

.ticket-perforation::before { top: -13px; }
.ticket-perforation::after { bottom: -13px; }

.ticket-stub {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  width: 92px;
  flex: 0 0 92px;
  padding: 19px 9px 16px;
  border: 1px solid rgba(139, 112, 75, 0.38);
  border-left: 0;
  border-radius: 0 2px 2px 0;
  background:
    radial-gradient(100% 100% at 85% 0%, rgba(248, 219, 210, 0.66), transparent 55%),
    linear-gradient(140deg, #f7ead8, #eedcc4);
  box-shadow: inset 0 0 0 4px rgba(252, 245, 233, 0.32);
  touch-action: none;
  cursor: grab;
  transition: box-shadow 0.3s ease, filter 0.3s ease;
  transform-origin: left center;
  user-select: none;
}

.ticket-stub::before {
  content: "";
  position: absolute;
  left: -1px;
  top: 11px;
  bottom: 11px;
  border-left: 1px dashed rgba(151, 116, 78, 0.36);
}

.ticket-stub:hover {
  box-shadow: inset 0 0 0 4px rgba(255, 249, 239, 0.48), 0 0 0 1px rgba(157, 112, 101, 0.18);
}

.ticket-stub.is-bending {
  cursor: grabbing;
  filter: brightness(1.025);
}

.ticket-stub.is-torn {
  pointer-events: none;
}

.stub-vertical {
  writing-mode: vertical-rl;
  color: #9c7e68;
  font-family: var(--serif);
  font-size: 6.5px;
  letter-spacing: 0.21em;
  line-height: 1;
}

.ticket-stub b {
  color: #70584b;
  font-family: var(--latin);
  font-size: 23px;
  font-weight: 400;
  letter-spacing: 0.1em;
}

.stub-flowers {
  color: rgba(176, 104, 113, 0.68);
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1;
}

.ticket-stub small {
  color: #a48e7c;
  font-family: var(--sans);
  font-size: 6px;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.ticket-sheet.is-detached .ticket-main {
  border-radius: 2px;
  border-right: 1px solid rgba(139, 112, 75, 0.24);
}

.ticket-sheet.is-detached .ticket-perforation {
  opacity: 0.22;
}

.ticket-petals {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  overflow: hidden;
}

.fallen-petal {
  position: absolute;
  width: 12px;
  height: 9px;
  border-radius: 60% 8% 60% 8%;
  background: linear-gradient(145deg, rgba(255, 239, 238, 0.98), rgba(209, 131, 155, 0.94));
  box-shadow: 0 1.5px 2px rgba(108, 67, 66, 0.18);
  transform-origin: 50% 50%;
  will-change: transform, opacity;
  clip-path: polygon(47% 2%, 66% 17%, 86% 29%, 94% 52%, 77% 70%, 60% 79%, 50% 71%, 39% 82%, 22% 70%, 8% 52%, 16% 29%, 34% 16%);
}

.keepsake-caption {
  position: absolute;
  left: 50%;
  bottom: -26px;
  transform: translateX(-50%);
  color: rgba(242, 224, 204, 0.52);
  font-family: var(--serif);
  font-size: 9px;
  letter-spacing: 0.16em;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.8s 0.5s ease;
}

.ticket-overlay.is-settled .keepsake-caption {
  opacity: 1;
}

.ticket-bottom {
  position: absolute;
  left: 50%;
  bottom: clamp(28px, 5.2vh, 56px);
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.8s 1.15s ease;
}

.ticket-overlay.is-settled .ticket-bottom {
  opacity: 1;
  pointer-events: auto;
}

.ticket-done {
  padding: 12px 26px;
  border: 1px solid rgba(243, 221, 198, 0.38);
  border-radius: 2px;
  color: rgba(250, 237, 219, 0.88);
  font-family: var(--serif);
  font-size: 10px;
  letter-spacing: 0.14em;
  background: rgba(244, 224, 201, 0.06);
  backdrop-filter: blur(7px);
  transition: background 0.3s ease, border-color 0.3s ease;
}

.ticket-done:hover {
  background: rgba(244, 224, 201, 0.14);
  border-color: rgba(243, 221, 198, 0.6);
}

.ticket-again {
  display: none;
  padding: 12px 26px;
  border: 1px solid rgba(243, 221, 198, 0.38);
  border-radius: 2px;
  color: rgba(250, 237, 219, 0.88);
  font-family: var(--serif);
  font-size: 10px;
  letter-spacing: 0.14em;
  background: rgba(244, 224, 201, 0.06);
}

.ticket-overlay.has-torn .ticket-done {
  display: none;
}

.ticket-overlay.has-torn .ticket-again {
  display: block;
}

.ticket-bottom-note {
  color: rgba(242, 224, 204, 0.34);
  font-family: var(--sans);
  font-size: 7.5px;
  letter-spacing: 0.12em;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 112px;
  z-index: 15;
  padding: 10px 16px;
  border: 1px solid rgba(118, 90, 73, 0.15);
  border-radius: 2px;
  background: rgba(250, 243, 234, 0.88);
  color: #77645a;
  font-family: var(--serif);
  font-size: 9px;
  letter-spacing: 0.08em;
  box-shadow: 0 10px 36px rgba(65, 46, 38, 0.12);
  backdrop-filter: blur(12px);
  transform: translate(-50%, 8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease, transform 0.5s var(--ease-out);
}

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

body.mode-night .toast {
  background: rgba(38, 39, 56, 0.87);
  border-color: rgba(236, 222, 209, 0.12);
  color: rgba(243, 230, 216, 0.82);
}

body.is-ticketing .grain,
body.is-ticketing .vignette {
  opacity: 0.1;
}

/* Cinematic transitions for UI on ticket overlay */
.ticket-overlay ~ .toast {
  z-index: 15;
}

@media (max-width: 1100px) {
  .poem {
    width: min(36vw, 330px);
  }

  .scene-meta,
  .brand-mark {
    display: none;
  }

  .keepsake {
    margin-left: 16vw;
    width: 70vw;
  }

  .ticket-copy {
    width: 27vw;
  }
}

@media (max-width: 820px) {
  .poem {
    left: 25px;
    top: 35px;
    width: calc(100% - 50px);
    pointer-events: none;
  }

  .mobile-hint {
    position: absolute;
    left: 50%;
    bottom: 73px;
    display: block;
    margin: 0;
    transform: translateX(-50%);
    color: rgba(112, 93, 82, 0.68);
    font-family: var(--sans);
    font-size: 8px;
    letter-spacing: 0.09em;
    white-space: nowrap;
    text-shadow: 0 0 15px rgba(249, 241, 233, 0.9);
    transition: opacity 0.5s ease;
  }

  body.mode-night .mobile-hint {
    color: rgba(235, 220, 207, 0.52);
    text-shadow: 0 0 15px rgba(10, 11, 24, 0.7);
  }

  .interface.is-reading .mobile-hint,
  body.is-ticketing .mobile-hint {
    opacity: 0;
  }

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

  h1 {
    font-size: clamp(32px, 8.8vw, 48px);
    line-height: 1.3;
  }

  .lead {
    margin-top: 18px;
    font-size: 10.5px;
    line-height: 1.9;
  }

  .poem-lines,
  .interaction-note {
    display: none;
  }

  .control-dock {
    bottom: max(18px, env(safe-area-inset-bottom));
    padding: 5px 7px 5px 5px;
    gap: 6px;
  }

  .light-btn {
    padding: 7px 9px;
    font-size: 8px;
    letter-spacing: 0.06em;
  }

  .dock-divider {
    height: 13px;
  }

  .round-btn {
    width: 27px;
    height: 27px;
  }

  .scene-caption {
    display: none;
  }

  .reader-head {
    left: 25px;
    top: 30px;
    width: calc(100% - 100px);
  }

  .reader-kicker {
    font-size: 6.5px;
  }

  .reader-head h2 {
    margin: 14px 0 4px;
    font-size: 32px;
  }

  .reader-info {
    left: 25px;
    bottom: 92px;
    width: calc(100% - 50px);
    max-width: 330px;
  }

  .reader-info > p {
    font-size: 10px;
    line-height: 1.9;
  }

  .reader-back {
    right: 20px;
    bottom: 23px;
  }

  .reader-index {
    display: none;
  }

  .reader-wash {
    background:
      linear-gradient(180deg, rgba(243, 234, 224, 0.78) 0%, rgba(243, 234, 224, 0.22) 32%, transparent 50%),
      linear-gradient(0deg, rgba(243, 234, 224, 0.8) 0%, rgba(243, 234, 224, 0.28) 34%, transparent 53%);
  }

  .ticket-copy {
    left: 25px;
    top: 75px;
    width: calc(100% - 50px);
  }

  .ticket-kicker {
    font-size: 6.5px;
  }

  .ticket-copy h2 {
    margin: 14px 0 10px;
    font-size: 32px;
  }

  .ticket-copy p {
    display: none;
  }

  .ticket-status {
    margin-top: 15px;
    font-size: 7px;
  }

  .keepsake {
    margin-left: 0;
    margin-top: 15vh;
    width: 100vw;
    height: 52vh;
    perspective: 1100px;
  }

  .mail {
    width: min(430px, 88vw);
    height: min(300px, 37vh);
  }

  .ticket-sheet {
    width: min(390px, 84vw);
    height: min(206px, 25vh);
    margin-left: min(-195px, -42vw);
    margin-top: min(-103px, -12.5vh);
  }

  .mail.is-open .ticket-sheet {
    transform: translateY(-44px) translateZ(55px) rotateZ(-0.7deg) scale(1);
  }

  .ticket-head {
    padding: 14px 16px 0;
  }

  .ticket-sakura {
    width: 23px;
    height: 23px;
    font-size: 14px;
  }

  .ticket-brand b {
    font-size: 7.5px;
  }

  .ticket-brand small {
    font-size: 6px;
  }

  .ticket-route {
    gap: 9px;
    padding: 14px 16px 0;
  }

  .ticket-route > div:first-child,
  .route-end {
    min-width: 60px;
  }

  .ticket-route b {
    margin: 3px 0 2px;
    font-size: 14px;
  }

  .ticket-route span,
  .ticket-meta span {
    font-size: 5px;
  }

  .ticket-route small,
  .ticket-meta small {
    font-size: 4.8px;
  }

  .ticket-meta {
    margin: 12px 16px 0;
    padding-top: 8px;
    gap: 7px;
  }

  .ticket-meta b {
    font-size: 7.2px;
  }

  .ticket-footer {
    left: 16px;
    right: 14px;
    bottom: 9px;
    font-size: 4.8px;
  }

  .ticket-motto {
    display: none;
  }

  .ticket-stamp {
    right: 18px;
    bottom: 23px;
    width: 37px;
    height: 37px;
  }

  .ticket-stamp span {
    font-size: 13px;
  }

  .ticket-stub {
    width: 67px;
    flex-basis: 67px;
    padding: 11px 6px 9px;
  }

  .ticket-stub b {
    font-size: 17px;
  }

  .stub-vertical {
    font-size: 5.5px;
  }

  .stub-flowers {
    font-size: 12px;
  }

  .ticket-stub small {
    font-size: 5px;
  }

  .env-seal {
    width: 44px;
    height: 44px;
    margin-left: -22px;
    font-size: 18px;
  }

  .env-postmark,
  .env-stamp {
    display: none;
  }

  .ticket-bottom {
    bottom: max(18px, env(safe-area-inset-bottom));
  }

  .ticket-bottom-note {
    display: none;
  }

  .keepsake-caption {
    bottom: -8px;
    font-size: 8px;
  }

  .ticket-close-wrap {
    top: 14px;
    right: 14px;
  }

  .ticket-copy {
    pointer-events: none;
  }

  .object-hint {
    display: none;
  }

  .grain {
    opacity: 0.13;
  }

  .ticket-backdrop {
    background:
      radial-gradient(110% 90% at 58% 54%, rgba(71, 53, 46, 0.2), rgba(40, 31, 33, 0.72)),
      rgba(40, 31, 32, 0.34);
  }
}

@media (max-height: 700px) and (min-width: 821px) {
  .poem {
    top: 40px;
  }

  .eyebrow {
    margin-bottom: 24px;
  }

  .lead {
    margin-top: 18px;
  }

  .poem-lines {
    margin-top: 24px;
  }

  .interaction-note {
    margin-top: 24px;
  }

  .keepsake {
    height: 82vh;
  }

  .ticket-copy {
    top: 64px;
  }
}

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