:root {
  color-scheme: dark;
  --ink: #070708;
  --paper: #f3f1ed;
  --muted: #aaa8a5;
  font-family: "Microsoft YaHei", "微软雅黑", "PingFang SC", "Hiragino Sans GB", "Noto Sans CJK SC", "Noto Sans SC", sans-serif;
}
* { box-sizing: border-box; }
html { background: var(--ink); min-height: 100%; }
body { margin: 0; min-height: 100vh; min-height: 100svh; background: var(--ink); color: var(--paper); -webkit-font-smoothing: antialiased; }
.intro {
  min-height: 100vh; min-height: 100svh;
  display: grid; place-items: center;
  padding: max(32px, env(safe-area-inset-top)) max(28px, env(safe-area-inset-right)) max(32px, env(safe-area-inset-bottom)) max(28px, env(safe-area-inset-left));
  background: radial-gradient(ellipse at 50% 43%, #101012 0%, #09090a 44%, #070708 75%);
}
.intro-content { width: min(100%, 640px); margin-top: -2vh; }
.message {
  position: relative; display: grid; width: 100%;
  font-size: clamp(19px, 2.3vw, 28px); font-weight: 400;
  line-height: 2.08; letter-spacing: .065em; overflow-wrap: anywhere;
}
.message p { grid-area: 1 / 1; margin: 0; }
.message-reserve { visibility: hidden; pointer-events: none; user-select: none; }
.message-visible { white-space: pre-wrap; }
.phrase { white-space: nowrap; }
.typing-cursor, .cursor-spacer { display: inline-block; width: 1px; height: 1.06em; margin-left: .18em; vertical-align: -.16em; }
.typing-cursor { background: #d8d7d2; animation: cursor-blink 1s steps(1) infinite; }
.typing-cursor.is-finished { animation: none; opacity: 0; transition: opacity .45s ease; }
.action-slot { margin-top: clamp(42px, 6vh, 64px); display: flex; justify-content: center; visibility: hidden; opacity: 0; transform: translateY(8px); transition: opacity .75s ease, transform .75s ease; }
.action-slot.is-visible { visibility: visible; opacity: 1; transform: none; }
.ready-button {
  display: inline-flex; align-items: center; justify-content: center; gap: 22px;
  min-height: 56px; padding: 15px 26px; border: 1px solid #696868; border-radius: 999px;
  color: #f3f1ed; background: rgba(255,255,255,.018); text-decoration: none;
  font-family: inherit; font-size: 15px; line-height: 1.5; letter-spacing: .09em;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
  transition: color .25s ease, background-color .25s ease, border-color .25s ease;
}
.ready-button svg { width: 19px; height: 19px; transition: transform .25s ease; }
.ready-button:hover { color: #131313; background: #f3f1ed; border-color: #f3f1ed; }
.ready-button:hover svg { transform: translateX(3px); }
.ready-button:active { background: #dcdad6; color: #121212; }
.ready-button:focus-visible, button:focus-visible { outline: 2px solid #f3f1ed; outline-offset: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
@keyframes cursor-blink { 0%,49% { opacity: .8; } 50%,100% { opacity: 0; } }
@media (max-width: 480px) {
  .intro { padding-left: max(30px, env(safe-area-inset-left)); padding-right: max(30px, env(safe-area-inset-right)); }
  .intro-content { max-width: 360px; }
  .message { font-size: 20px; line-height: 2.12; letter-spacing: .035em; }
  .ready-button { min-height: 54px; padding: 14px 23px; font-size: 14px; }
}
@media (max-width: 350px) { .message { font-size: 18px; } .intro { padding-left: 26px; padding-right: 26px; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  .typing-cursor { display: none; }
  .countdown span { animation: none !important; opacity: 1; }
}
.preview-label { font-size: 11px; line-height: 1.8; color: #858382; letter-spacing: .12em; margin: 0 0 30px; }
.next-heading { font-size: clamp(24px, 4vw, 36px); font-weight: 400; letter-spacing: .07em; margin: 0 0 20px; line-height: 1.8; }
.next-description { color: #b9b7b3; font-size: 15px; letter-spacing: .03em; line-height: 2; max-width: 420px; margin: 0 auto 36px; }
.next-content { text-align: center; }
.back-link, .no-script-action a { color: #c1bfbb; font-size: 13px; letter-spacing: .08em; text-decoration: none; border-bottom: 1px solid #535250; padding-bottom: 7px; }
.no-script-action { position: fixed; bottom: 24vh; left: 0; right: 0; text-align: center; }

/* The opening and all later scenes share one document and one live canvas. */
[hidden] { display: none !important; }
body { overflow-x: hidden; }
body.in-journey { height: 100svh; overflow: hidden; overscroll-behavior: none; }
.intro { position: relative; z-index: 3; transition: opacity .85s ease, visibility .85s; }
.intro.is-departing { opacity: 0; visibility: hidden; pointer-events: none; }
.journey { position: fixed; inset: 0; z-index: 1; opacity: 0; visibility: hidden; background: #070709; transition: opacity 1.1s ease; overflow: hidden; }
.journey.is-active { opacity: 1; visibility: visible; }
#universe { display: block; width: 100%; height: 100%; touch-action: pan-x pan-y; }
.countdown { position: absolute; inset: 0; display: grid; align-content: center; justify-items: center; pointer-events: none; }
.countdown span { font-size: clamp(92px, 20vw, 180px); font-weight: 200; line-height: 1; color: #fbefd6; text-shadow: 0 0 44px #cd944439; animation: count-arrives .94s ease both; }
.countdown p { font-size: 12px; letter-spacing: .18em; margin-top: 28px; color: #d1c5ad; }
@keyframes count-arrives { 0% { opacity: 0; transform: scale(.86); } 20%,70% { opacity: 1; } 100% { opacity: 0; transform: scale(1.04); } }
.journey-tools { position: absolute; top: max(20px, env(safe-area-inset-top)); right: max(20px, env(safe-area-inset-right)); display: flex; gap: 16px; z-index: 5; }
.quiet-button { color: #bdb6a7; padding: 8px 3px; font: inherit; font-size: 11px; letter-spacing: .08em; border: 0; background: transparent; min-height: 36px; cursor: pointer; }
.quiet-button:hover { color: #fff5df; }
.dialogue { position: absolute; width: min(340px, calc(100% - 48px)); padding: 17px 21px 18px; border: 1px solid #c9a96549; border-radius: 20px 20px 20px 4px; background: linear-gradient(135deg, #14141beF, #0a0b10eF); box-shadow: 0 12px 45px #00000046; backdrop-filter: blur(9px); -webkit-backdrop-filter: blur(9px); transform: translateX(-50%); opacity: 1; z-index: 4; }
.dialogue-name { display: block; font-size: 10px; line-height: 1.5; color: #d5b372; letter-spacing: .12em; margin-bottom: 7px; }
.dialogue p { margin: 0; color: #f1ebdf; font-size: 15px; letter-spacing: .015em; line-height: 1.85; }
.story-button { position: absolute; bottom: max(48px, calc(env(safe-area-inset-bottom) + 30px)); left: 50%; transform: translateX(-50%); display: flex; align-items: center; justify-content: center; gap: 28px; min-width: 130px; min-height: 52px; padding: 13px 27px; font: inherit; font-size: 15px; letter-spacing: .08em; color: #fff2da; border: 1px solid #d4ac6760; border-radius: 999px; background: #131214d9; box-shadow: 0 0 27px #edbd5b15; cursor: pointer; z-index: 5; }
.story-button:hover { background: #2a221bcf; border-color: #e5c283; }
.story-button { width: max-content; max-width: calc(100% - 32px); white-space: nowrap; }
.scene-target { position: absolute; width: 88px; height: 88px; transform: translate(-50%, -50%); border: 0; border-radius: 50%; background: transparent; cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation; z-index: 3; }
.scene-target:focus-visible { outline-color: #edc784; }
.target-hint { position: absolute; white-space: nowrap; left: 50%; top: calc(100% + 12px); transform: translateX(-50%); color: #e8d2a2; font-size: 12px; line-height: 1.5; letter-spacing: .08em; padding: 7px 12px; border: 1px solid #b68e4633; border-radius: 999px; background: #0b0b12d9; pointer-events: none; animation: hint-breathe 2.6s ease-in-out infinite; }
.star-target .target-hint { top: auto; bottom: calc(100% + 4px); }
.gift-target { width: 180px; height: 190px; border-radius: 20px; }
@keyframes hint-breathe { 0%,100% { opacity: .55; } 50% { opacity: 1; } }
.travel-caption { position: absolute; bottom: max(30px, env(safe-area-inset-bottom)); left: 24px; right: 24px; margin: 0; color: #c8bda6; font-size: 11px; line-height: 1.8; letter-spacing: .16em; text-align: center; animation: caption-arrive 6s ease both; pointer-events: none; }
@keyframes caption-arrive { 0% { opacity: 0; } 15%,70% { opacity: .85; } 100% { opacity: 0; } }
.replay-button { position: absolute; left: max(20px, env(safe-area-inset-left)); bottom: max(22px, env(safe-area-inset-bottom)); background: transparent; border: 0; color: #bfb7a6; padding: 12px 4px; font: inherit; font-size: 11px; cursor: pointer; z-index: 5; }
.asset-warning { position: absolute; bottom: 12px; left: 10px; right: 10px; color: #c8bcaa; font-size: 12px; text-align: center; }
@media (max-width: 350px) { .dialogue { width: calc(100% - 36px); padding: 13px 17px; } .dialogue p { font-size: 13px; } .story-button { bottom: max(24px, env(safe-area-inset-bottom)); min-height: 48px; } }
@media (max-height: 500px) and (min-width: 500px) { .dialogue { width: 260px; padding: 10px 14px; } .dialogue p { font-size: 12px; line-height: 1.65; } .dialogue-name { margin-bottom: 3px; } .story-button { bottom: 20px; min-height: 44px; padding: 8px 22px; } .target-hint { font-size: 11px; top: calc(100% + 1px); } }

/* Later gifts are still part of the same canvas and continuous star field. */
.toy-targets { position: absolute; inset: 0; pointer-events: none; z-index: 3; }
.toy-target { position: absolute; transform: translate(-50%,-50%); border: 0; border-radius: 30%; background: transparent; cursor: pointer; pointer-events: auto; touch-action: manipulation; }
.toy-hint { position: absolute; left: 20px; right: 20px; bottom: 118px; margin: 0; color: #b6a78b; text-align: center; font-size: 10px; letter-spacing: .07em; }
.magic-message { position: absolute; left: 20px; right: 20px; top: 18%; margin: 0; font-size: clamp(17px,3.5vw,24px); font-weight: 300; text-align: center; letter-spacing: .13em; line-height: 2; color: #f5e6eb; text-shadow: 0 0 28px #d4a0c06b; pointer-events: none; z-index: 4; animation: soft-arrival 1.5s ease both; }
.meeting-caption { position: absolute; top: 22%; left: 24px; right: 24px; margin: 0; color: #e4d0b1; font-size: clamp(14px,2.5vw,18px); letter-spacing: .12em; line-height: 1.8; text-align: center; pointer-events: none; animation: soft-arrival 1.8s ease both; }
#meeting-button { white-space: nowrap; font-size: 13px; gap: 18px; }
.meeting-target { width: 110px; height: 110px; }
.journey[data-phase="cake"] #universe { touch-action: none; cursor: grab; }
.journey[data-phase="cake"] #universe:active { cursor: grabbing; }
.cake-controls { position: absolute; left: 24px; right: 24px; bottom: max(30px,calc(env(safe-area-inset-bottom) + 20px)); z-index: 4; text-align: center; }
#cake-hint { margin: 0 0 18px; color: #c8b8ba; font-size: 11px; line-height: 1.8; letter-spacing: .045em; }
#album-button { margin: -8px auto 10px; padding: 4px 6px; min-height: 32px; font-size: 11px; color: #e0b8ca; }
.cake-actions { display: flex; justify-content: center; align-items: center; gap: 24px; }
.cake-actions .story-button { position: static; transform: none; min-width: 150px; }
.cake-actions .quiet-button { min-width: 70px; font-size: 12px; color: #d4c4cc; border-bottom: 1px solid #b390a259; }
.wish-panel { position: absolute; bottom: max(38px,calc(env(safe-area-inset-bottom) + 24px),calc(var(--keyboard-gap,0px) + 18px)); left: 50%; transform: translateX(-50%); width: min(360px,calc(100% - 48px)); z-index: 5; padding: 20px 20px 18px; border: 1px solid #d2afbf4b; background: linear-gradient(140deg,#17101de8,#0b0d13ef); border-radius: 20px; box-shadow: 0 0 55px #d1a1be19; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); animation: soft-arrival .8s ease both; }
.wish-panel label { display: block; font-size: 13px; color: #f1dae5; line-height: 1.6; letter-spacing: .05em; margin-bottom: 12px; }
.wish-panel textarea { display: block; resize: none; width: 100%; min-height: 92px; border: 1px solid #9c849141; border-radius: 11px; background: #08090d94; color: #fbefee; font: inherit; font-size: 16px; line-height: 1.7; padding: 12px; outline-offset: 3px; }
.wish-panel textarea::placeholder { color: #8b7e86; font-size: 13px; }
.wish-panel .story-button { position: static; transform: none; margin: 18px auto 0; font-size: 13px; min-height: 46px; }
.birthday-letter { position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%); width: min(570px,calc(100% - 48px)); max-height: calc(100svh - 150px); padding: clamp(24px,5vw,44px); border: 1px solid #c9a97340; border-radius: 3px 24px 3px 24px; background: linear-gradient(140deg,#141216d9,#0b0b10d9); box-shadow: 0 20px 75px #00000042; backdrop-filter: blur(7px); -webkit-backdrop-filter: blur(7px); z-index: 4; display: flex; flex-direction: column; animation: letter-arrival 2s ease both; }
.letter-overline { margin: 0 0 17px; color: #a79274; font-size: 9px; letter-spacing: .27em; }
.birthday-letter h1 { margin: 0 0 24px; font-size: clamp(24px,5vw,32px); color: #f2dfbd; letter-spacing: .10em; line-height: 1.5; font-weight: 400; }
.birthday-letter h1 span { font-size: 14px; margin-left: 12px; color: #d195a5; }
.letter-scroll { overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #7e6847 transparent; }
.letter-scroll p { margin: 0; font-size: 14px; line-height: 2.2; letter-spacing: .035em; color: #d6cebf; }
.letter-scroll .letter-signature { margin-top: 28px; text-align: right; color: #e1c696; font-size: 13px; }
.letter-scroll .letter-date { margin-top: 6px; color: #968878; text-align: right; font-size: 11px; letter-spacing: .10em; }
.memory-viewer { position: absolute; inset: 0; z-index: 9; background: #0a0a10df; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: max(72px,calc(env(safe-area-inset-top) + 56px)) 20px max(32px,env(safe-area-inset-bottom)); }
#memory-close { position: absolute; right: max(22px,env(safe-area-inset-right)); top: max(20px,env(safe-area-inset-top)); padding: 10px; font-size: 12px; color: #e6d4ba; }
#memory-photo,#memory-video { max-width: min(100%,900px); max-height: calc(100svh - 210px); width: auto; height: auto; min-height: 0; object-fit: contain; border: 1px solid #e6d6ba40; border-radius: 8px; box-shadow: 0 12px 55px #00000055; }
#memory-label { font-size: 11px; letter-spacing: .06em; color: #cbbca5; margin: 16px 0 0; }
.memory-nav { display: flex; gap: 55px; margin-top: 8px; }
.memory-nav .quiet-button { min-width: 75px; font-size: 12px; }
@keyframes soft-arrival { from { opacity: 0; } to { opacity: 1; } }
@keyframes letter-arrival { from { opacity: 0; filter: blur(6px); } to { opacity: 1; filter: blur(0); } }
@media (max-width: 350px) { .journey-tools { top: 13px; right: 12px; gap: 10px; } .toy-hint { bottom: 92px; font-size: 9px; } .cake-controls { left: 15px; right: 15px; bottom: 22px; } .cake-actions { gap: 15px; } .cake-actions .story-button { min-width: 137px; } #cake-hint { font-size: 10px; margin-bottom: 11px; } .birthday-letter { width: calc(100% - 32px); padding: 24px 22px; max-height: calc(100svh - 120px); } .letter-scroll p { font-size: 12px; line-height: 2.15; } .birthday-letter h1 { font-size: 23px; margin-bottom: 18px; } }
@media (max-height: 500px) and (min-width: 500px) { .toy-hint { bottom: 75px; } .magic-message { left: 40%; top: 20%; font-size: 17px; } .meeting-caption { top: 17%; font-size: 13px; } .cake-controls { left: auto; right: 25px; bottom: 20px; width: 240px; } .cake-actions { gap: 14px; } .cake-actions .story-button { min-width: 135px; font-size: 12px; } #cake-hint { font-size: 10px; margin-bottom: 9px; } .wish-panel { left: auto; right: 25px; transform: none; width: 290px; padding: 14px; bottom: 24px; } .wish-panel textarea { min-height: 65px; } .birthday-letter { max-height: calc(100svh - 90px); top: 53%; width: 570px; padding: 22px 30px; } .birthday-letter h1 { font-size: 23px; margin-bottom: 15px; } .letter-overline { margin-bottom: 8px; } .letter-scroll p { font-size: 12px; line-height: 1.9; } #memory-photo,#memory-video { max-height: calc(100svh - 155px); } .memory-viewer { padding-top: 48px; padding-bottom: 10px; } #memory-close { top: 8px; } #memory-label { margin-top: 8px; } .memory-nav { margin-top: 0; } }

