@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@300;400;500&display=swap');
body.started .intro{visibility:hidden}body:not(.started) #chapter{visibility:hidden}body.finished #chapter{visibility:hidden}@media(prefers-reduced-motion:reduce){*{transition:none!important}}
:root{color-scheme:dark;font-family:Arial,"Microsoft YaHei",sans-serif;color:#e7e9ee;background:#070e24}*{box-sizing:border-box}body{margin:0;overflow:hidden}#universe{position:fixed;inset:0;width:100%;height:100%}header{position:fixed;top:0;left:0;width:100%;padding:30px 4%;display:flex;align-items:center;justify-content:space-between;z-index:2}.brand{color:#eee6d7;text-decoration:none;display:flex;align-items:center;gap:13px;font-size:27px}.brand span{font-family:"Noto Serif SC",serif;font-size:22px;letter-spacing:6px}.brand small{font-size:10px;letter-spacing:3px;color:#8190ae;margin-left:8px}.edition{font-size:11px;letter-spacing:3px;color:#6b7c9c}button{font:inherit;color:#a5b2c9;background:none;border:none;cursor:pointer;transition:color .2s,background .2s}button:hover{color:#fff}button:focus-visible,a:focus-visible{outline:1px solid #ffce76;outline-offset:6px}#fullscreen{font-size:20px}#fullscreen span{font-size:11px;vertical-align:middle;margin-left:8px}main{position:fixed;inset:0;pointer-events:none}main button{pointer-events:auto}.intro{position:absolute;left:11%;top:25%;transition:opacity 1s,transform 1s}.eyebrow{font-size:9px;letter-spacing:3px;color:#91a3c0}h1{font:300 clamp(32px,4vw,59px)/1.65 "Noto Serif SC",SimSun,serif;letter-spacing:5px;margin:24px 0}h1 em{font-style:normal;color:#f6dba5}p{font-size:12px;line-height:2.2;letter-spacing:2px;color:#8595af}.primary{border:1px solid #a28c634d;padding:15px 25px;color:#e5cc9c;background:#c9a4620b;letter-spacing:3px;font-size:12px;margin-top:24px}.primary:hover{background:#c9a46222}.primary span{margin-left:35px}.intro>small{display:block;font-size:9px;color:#5c6d89;margin-top:19px;letter-spacing:2px}body.started .intro{opacity:0;transform:translateY(-15px);pointer-events:none}body.started .intro button{pointer-events:none}#chapter{position:absolute;left:10%;top:27%;opacity:0;transition:opacity 1s;max-width:280px}body.started #chapter{opacity:1}#chapter h2{font:300 29px/1.6 "Noto Serif SC",SimSun,serif;letter-spacing:3px;margin:20px 0 14px}.age{position:absolute;left:5%;top:55%;display:flex;align-items:baseline;gap:6px;color:#e7cca1;opacity:.65}.age strong{font-weight:300;font-size:32px}.age span{font-size:10px}.age small{position:absolute;top:45px;font-size:9px;letter-spacing:2px;color:#64789b}.ending{position:absolute;left:0;top:28%;text-align:center;width:100%;background:radial-gradient(ellipse,#070e2499,transparent 65%)}.ending h2{font:300 clamp(25px,3vw,42px)/1.8 "Noto Serif SC",SimSun,serif;letter-spacing:4px}.ending p{color:#afb8c9}.ending[hidden]{display:none}body.finished #chapter,body.finished .age{opacity:0}footer{position:fixed;bottom:26px;left:10%;width:80%;z-index:3}.transport{display:flex;align-items:center;gap:22px;font-size:11px}.transport button{min-height:35px}#play{color:#eed2a2;font-size:17px}#restart{font-size:20px}.spacer{flex:1}#timeLabel{font-size:10px;letter-spacing:1px;color:#8391aa}#sound{font-size:13px}#sound span{font-size:10px;margin-left:7px}input[type=range]{width:100%;height:18px;appearance:none;background:transparent;cursor:pointer;margin:9px 0 0}input[type=range]::-webkit-slider-runnable-track{height:1px;background:linear-gradient(to right,#d4b67e var(--progress,0%),#5a6a873f var(--progress,0%))}input[type=range]::-webkit-slider-thumb{appearance:none;width:7px;height:7px;border-radius:50%;background:#edd7ac;margin-top:-3px;box-shadow:0 0 10px #edcc87}input[type=range]::-moz-range-track{height:1px;background:#5a6a87}input[type=range]::-moz-range-thumb{width:7px;height:7px;border:0;background:#edd7ac}.milestones{display:flex;justify-content:space-between}.milestones button{font-size:9px;color:#7888a4;padding:5px 0;letter-spacing:2px}.legend{display:flex;gap:22px;font-size:9px;color:#6f7f9a;align-items:center;margin-top:24px}.legend span:before{content:'';display:inline-block;width:4px;height:4px;border-radius:50%;background:var(--dot);margin-right:7px}.legend i{font-style:normal;margin-left:auto;font-size:9px;letter-spacing:1px}@media(max-width:700px){header{padding:22px 6%}.brand small,.edition,#fullscreen span,.legend i{display:none}.intro{left:11%;top:22%}h1{font-size:35px}.intro p{font-size:11px}#chapter{top:15%;left:10%;max-width:75%}#chapter h2{font-size:22px;margin:12px 0 6px}#chapter p{font-size:10px}.age{left:5%;top:48%}.age strong{font-size:24px}footer{left:7%;width:86%;bottom:22px}.legend{justify-content:center;gap:18px;margin-top:17px}.transport{gap:16px}.eyebrow{font-size:8px;letter-spacing:2px}body:not(.started) .age{opacity:0}.ending{top:30%}}
/* Refinement: let the scene lead and keep the text outside its main path. */
body.epilogue #chapter,body.epilogue .age{visibility:hidden;opacity:0}
#chapter{max-width:245px;top:24%}#chapter h2{font-size:25px}
.ending{top:31%;animation:reveal 2s ease both}.ending h2{font-size:clamp(24px,2.7vw,37px)}
@keyframes reveal{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:translateY(0)}}
footer:before{content:'';position:absolute;inset:-20px -12% -30px;background:linear-gradient(transparent,#070e24d9);z-index:-1;pointer-events:none}
@media(max-width:700px){#chapter{top:19%;max-width:80%}#chapter h2{font-size:21px}.ending{top:28%}.ending h2{font-size:25px}.intro h1{font-size:32px;letter-spacing:3px}.intro{top:20%}}
@media(max-height:580px){header{padding-top:14px}.intro{top:16%}.intro h1{font-size:27px;line-height:1.35;margin:12px 0}.intro p{line-height:1.6}.intro .primary{margin-top:8px}.intro>small{display:none}#chapter{top:22%}footer{bottom:12px}.legend{display:none}}
@media(prefers-reduced-motion:reduce){.ending{animation:none}}
/* Keep the surviving child's trajectory unobstructed during the closing card. */
@media(min-width:701px){.ending{left:10%;width:32%;top:25%;text-align:left;background:none}.ending h2{font-size:clamp(24px,2.5vw,37px)}}
@media(max-width:700px){.ending{top:19%;background:none}.ending h2{font-size:24px;line-height:1.7}.ending p{font-size:10px}.ending .primary{position:fixed;bottom:190px;left:50%;transform:translateX(-50%);white-space:nowrap}}
@keyframes reveal{from{opacity:0}to{opacity:1}}
@media(min-width:701px){#chapter{max-width:360px;width:29vw}#chapter h2{text-wrap:balance}}
#exportStatus{position:fixed;right:5%;bottom:160px;z-index:5;max-width:80%;color:#d2bb92;font-size:11px;background:#070e24dc;padding:6px 12px;border-radius:4px}
#exportStatus:empty{display:none}button:disabled{opacity:.4;cursor:wait}
@media(max-width:700px){.transport{gap:11px}.transport button{font-size:10px}#sound span{display:none}#timeLabel{max-width:70px;font-size:9px}.legend{gap:16px}}
@media(max-width:700px){.transport{gap:8px}.transport button{white-space:nowrap;flex-shrink:0;padding:4px;font-size:10px}#timeLabel{max-width:55px;line-height:1.6}.transport .spacer{min-width:0}}
#exportDialog{width:min(470px,92vw);max-height:90dvh;overflow:auto;border:1px solid #8795b333;border-radius:12px;padding:28px;background:#0a1429;color:#dce2ed;box-shadow:0 25px 100px #0009}
#exportDialog::backdrop{background:#020712bb;backdrop-filter:blur(7px)}
.export-header{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}.export-header h2{font:400 23px/1.6 'Noto Serif SC',serif;margin:13px 0 0}.export-header>button{font-size:26px;padding:0 5px}
#exportDialog p{font-size:11px;letter-spacing:1px;line-height:1.8}.export-description{color:#96a6be}#exportChoices{padding:12px 0;border:0;display:flex;gap:10px}#exportChoices legend{font-size:11px;color:#97a8c3;margin-bottom:10px}
#exportChoices label{flex:1;border:1px solid #8795b333;border-radius:6px;padding:12px 8px;font-size:12px;cursor:pointer}#exportChoices label:has(input:checked){border-color:#c8ac6c;background:#d8bd8010}#exportChoices small{display:block;color:#8293ad;margin:8px 0 0 25px;font-size:10px}
#recordingPreview,#exportVideo{display:block;width:auto;height:260px;max-width:100%;margin:18px auto;background:#060d20;border:1px solid #8795b326;border-radius:6px}#recordingPreview[hidden],#exportVideo[hidden]{display:none}
#exportDialog #exportStatus{position:static;max-width:none;padding:0;background:none;font-size:11px;color:#c9b58d;margin:12px 0}
#exportProgress{width:100%;height:4px;accent-color:#d9bc83}#downloadExport{display:block;color:#e5cd9d;font-size:12px;margin-top:15px}#downloadExport[hidden]{display:none}.export-actions{display:flex;align-items:center;gap:24px}.export-actions .primary{margin-top:12px}.export-actions>button:not(.primary){font-size:12px}
@media(max-height:600px){#recordingPreview,#exportVideo{height:170px}#exportDialog{padding:18px}}

/* Quiet transport: labels remain visible in the story; only the progress UI toggles. */
.control-button{display:inline-flex;align-items:center;justify-content:center;gap:8px}
.control-button svg{width:18px;height:18px;flex-shrink:0}
body.controls-collapsed .transport>:not(#play):not(#toggleProgress):not(.spacer),
body.controls-collapsed #timeline,body.controls-collapsed .milestones,body.controls-collapsed .legend{display:none}
@media(max-width:700px){
 footer{left:5%;width:90%;bottom:max(16px,env(safe-area-inset-bottom))}
 .legend{display:none}
 .transport{gap:3px;min-height:44px}
 .transport button{min-width:40px;min-height:44px;padding:4px;font-size:17px;flex-shrink:0}
 .transport .control-label{display:none}
 .control-button svg{width:21px;height:21px}
 #speed{font-size:12px;min-width:36px}
 #timeLabel{font-size:9px;letter-spacing:0;max-width:none;white-space:nowrap;line-height:1.4}
 #sound{font-size:21px}#sound span{display:none}
 .milestones button{min-height:30px;padding:4px 0}
 #timeline{margin-top:2px}
}
@media(max-width:360px){#timeLabel{display:none}}

/* Opening card has a single call to action; story lights appear only after starting. */
body:not(.started) footer,body:not(.started) .age,body:not(.started) #fullscreen{visibility:hidden;pointer-events:none}

.intro h1 em{white-space:nowrap}
/* Entry choice and quiet, consistent playback symbols. */
#immersionDialog{width:min(420px,calc(100vw - 40px));max-height:calc(100dvh - 40px);overflow:auto;padding:38px 32px 24px;text-align:center;color:#e7e2d8;background:radial-gradient(ellipse at 50% 0,#19243c,#0a1228 75%);border:1px solid #c9a46240;border-radius:8px;box-shadow:0 24px 100px #0008}
#immersionDialog::backdrop{background:#040918d9;backdrop-filter:blur(9px)}
.immersion-star{font-size:38px;color:#e5cc9c;margin:23px 0 12px}
#immersionDialog h2{font:300 29px/1.7 "Noto Serif SC",SimSun,serif;letter-spacing:3px;margin:0 0 16px}
#immersionDialog p{font-size:11px;letter-spacing:1px;line-height:2}
#immersionDialog .primary{display:block;width:100%;margin:24px 0 7px;min-height:48px}
#keepWindow{min-height:44px;font-size:11px;letter-spacing:2px;padding:10px 20px;color:#9eabc0}
#immersionStatus{color:#c4b28f;margin:10px 0 0}#immersionStatus:empty{display:none}
#immersionDialog button:disabled{cursor:default}
#play{display:inline-flex;align-items:center;justify-content:center;-webkit-tap-highlight-color:transparent;touch-action:manipulation}
#play svg{width:21px;height:21px;fill:none;stroke:currentColor;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round;pointer-events:none}
#play[data-state=paused] svg{transform:translateX(1px)}
@media(max-width:700px){#play{width:44px;min-width:44px;height:44px;padding:10px;border:1px solid #c9a46240;border-radius:50%;background:#c9a4620a;color:#e5cc9c}#play:active{background:#c9a46222}#play:focus-visible{outline-offset:4px}#immersionDialog{padding:30px 24px 20px}#immersionDialog h2{font-size:26px}}
