:root{color-scheme:dark;--gold:#f4d296;--pale:#fff7e6;--ink:#30213f;--paper:#fff7e9}*{box-sizing:border-box}body{margin:0;background:#21172c;color:var(--pale);font-family:system-ui,-apple-system,"Hiragino Kaku Gothic ProN",sans-serif}button,a{-webkit-tap-highlight-color:transparent}button{font:inherit;cursor:pointer;touch-action:manipulation}button:disabled{opacity:.45;cursor:default}button:focus-visible,a:focus-visible{outline:3px solid #ffda87;outline-offset:4px}[hidden]{display:none!important}main{max-width:1200px;margin:auto}.site-return{display:flex;justify-content:space-between;padding:0 22px;border-bottom:1px solid #ffffff0d}.site-return a,.end-links a{display:inline-flex;align-items:center;min-height:44px;color:#f5d6a0;text-decoration:none;font-size:12px}header{height:66px;padding:0 24px;display:flex;align-items:center;justify-content:space-between}#brand{color:var(--gold);text-decoration:none;letter-spacing:4px;font-size:16px}#brand span{font-size:9px;letter-spacing:2px;color:#d3bdce;margin-left:16px}nav{display:flex;gap:8px}nav button,#menuButton{min-height:44px;border:1px solid #b2cbd440;border-radius:25px;padding:9px 13px;font-size:11px;background:#2c1c38;color:#f1e2eb}#stage{position:relative;aspect-ratio:16/10;min-height:700px;overflow:hidden;isolation:isolate;background:var(--ink)}#art,#shade,#fx{position:absolute;inset:0;width:100%;height:100%;pointer-events:none}#art{background:#30213f url(assets/opening.webp?v=paper-v2) center/cover;transition:filter .7s,opacity .5s}#shade{background:linear-gradient(0deg,#21172ce6,transparent 65%)}#fx{z-index:2;mix-blend-mode:screen}body.cinematic #fx{mix-blend-mode:normal}#chapterBar{position:absolute;top:0;left:0;right:0;height:58px;padding:7px 24px;display:flex;align-items:center;justify-content:space-between;gap:12px;z-index:3;background:var(--ink);border-bottom:1px solid #efd19a30}#chapter{font-size:12px;letter-spacing:1px;line-height:1.5}#menuButton{flex:none}body.reading #art{top:58px;height:calc(100% - 58px);transform:none}
#cover{position:absolute;inset:0;padding:62px 5% 40px 53%;background:linear-gradient(270deg,#30213ff2,#30213f88 40%,transparent 70%)}.eyebrow{font-size:11px;letter-spacing:2px;color:var(--gold)}h1{font-family:serif;font-weight:600;font-size:clamp(30px,3.6vw,46px);letter-spacing:2px;line-height:1.7;margin:26px 0 20px;text-shadow:0 3px 20px #21172c}h1 span{font-size:1em}h1 rt{color:#fff4d5}.cover-copy{font-family:serif;font-size:17px;line-height:2;letter-spacing:1px;text-shadow:0 2px 15px #29142e}.cover-bottom{position:absolute;bottom:50px;left:53%;right:5%}.book-meta{display:block;font-size:11px;letter-spacing:1px;color:#f0dfe7;margin-bottom:16px}.gold,.outline{min-height:48px;border-radius:6px;padding:13px 23px;font-size:14px;font-weight:650;letter-spacing:1px}.gold{border:1px solid #fbe4b1;color:#403122;background:linear-gradient(120deg,#f7dea3,#eac380);box-shadow:0 5px 22px #07121e45}.outline{border:1px solid #d0b78a66;color:#f0e2c8;background:#382643}#start{min-width:240px}#loadStatus{font-size:11px;color:#dac6d4;line-height:1.7;margin-top:15px}#dialogue{position:absolute;z-index:4;bottom:4%;left:5%;right:5%;background:linear-gradient(130deg,#fffaf0fc,#efe6d5fc);color:#423a30;border:1px solid #dec28f;border-top:2px solid #dcb478;box-shadow:0 12px 45px #06142350;padding:21px 28px 17px;border-radius:10px;max-height:48%;overflow-y:auto;scrollbar-width:thin}.dialogue-top{display:flex;align-items:center;justify-content:space-between}#speaker{color:#775025;font-size:12px;letter-spacing:2px}#pageCount{font-size:11px;color:#746856;font-variant-numeric:tabular-nums}#text{font-size:19px;line-height:2.15;white-space:pre-line;margin:14px 0 16px;min-height:82px;letter-spacing:.03em}ruby{ruby-align:center}rt{font-size:.5em;font-weight:400;letter-spacing:0;color:#dbc8d7}#text rt,#speaker rt{color:#7b674c}.gold rt,#dialogue .outline rt{color:#624e33}body.no-ruby rt{display:none}#controls{display:flex;align-items:center;gap:12px}.quiet{background:none;border:0;color:#695b49;padding:12px 0;font-size:12px;min-height:44px}#hint{font-size:10px;color:#71624f}#next{margin-left:auto;min-width:155px}#dialogue.action{border-color:#c48e43}#dialogue.action #hint{color:#775021}#endingActions{display:flex;gap:12px;margin-top:10px}#endingActions button{flex:1}#dialogue .outline{background:#ece1cd;color:#51432f;border-color:#bca27a}#cinema{position:absolute;z-index:5;inset:0;display:flex;flex-direction:column;justify-content:flex-end;align-items:center;padding:50px 24px;background:linear-gradient(0deg,#2a1838e8,transparent 70%);text-align:center;pointer-events:none}.cinema-rule{width:65px;height:2px;background:var(--gold)}#cinemaTitle{font-family:serif;font-weight:600;font-size:clamp(27px,4.1vw,49px);line-height:1.6;letter-spacing:3px;white-space:pre-line;margin:20px 0 12px;text-shadow:0 3px 25px #23132c}#cinemaSub{font-size:14px;color:#f1dbb3;letter-spacing:2px;line-height:1.9}#ending{position:absolute;inset:0;z-index:5;display:flex;align-items:center;justify-content:center;padding:24px;background:linear-gradient(0deg,#21172cdb,#30213f55)}.ending-card{max-width:490px;width:100%;text-align:center;background:#30213fe8;border:1px solid #d9bd8777;padding:36px 26px;border-radius:12px;backdrop-filter:blur(5px)}.ending-card h2{font-family:serif;font-size:27px;font-weight:500;letter-spacing:2px;line-height:1.7;outline:none}.ending-card p{font-family:serif;font-size:17px;line-height:2;letter-spacing:1px}.ending-line{height:1px;width:45px;background:var(--gold);margin:22px auto}.end-word{display:block;color:#f0d29c;letter-spacing:6px;font-size:13px;margin:22px 0}.ending-card button{margin-top:12px}.end-links{display:flex;justify-content:center;gap:16px;flex-wrap:wrap}.end-links a{text-decoration:underline}#track{position:absolute;z-index:7;bottom:0;left:0;right:0;height:3px;background:#b3bfbd15}#trackFill{display:block;width:0;height:100%;background:linear-gradient(90deg,#d4869a,#f4d296);transition:width .4s}footer{display:flex;justify-content:space-between;gap:12px;font-size:10px;color:#c9b1c6;padding:17px 24px;letter-spacing:1px}dialog{background:#30213f;color:#f7edda;border:1px solid #d2b78780;border-radius:9px;width:min(480px,92vw);max-height:85svh;padding:26px}dialog::backdrop{background:#1b1025d9}.menu-top{display:flex;align-items:center;justify-content:space-between}.menu-top h2{font-family:serif;font-weight:500;margin:0}.menu-top button{background:none;color:var(--gold);font-size:28px;border:0;width:44px;height:44px}dialog p{font-size:13px;color:#deccdb;line-height:1.9}#chapters{display:grid;gap:8px;margin:20px 0}#chapters button{padding:13px 16px;background:#483150;border:1px solid #91abbc55;border-radius:5px;color:#f1e7d5;text-align:left;min-height:48px;font-size:13px}#chapters button.current{border-color:var(--gold)}#menuCover{width:100%}.restart-choices{display:flex;gap:10px;flex-wrap:wrap}.restart-choices button{flex:1;min-width:135px}#restartDialog h2{font-family:serif;font-size:24px;font-weight:500}body.calm #art,body.calm #trackFill{transition:none}
@media(max-width:760px){header{height:56px;padding:0 12px}#brand{font-size:12px;letter-spacing:2px}#brand span{display:none}nav{gap:5px}nav button{font-size:10px;padding:8px}.site-return{padding:0 13px}.site-return a{font-size:11px}#stage{aspect-ratio:auto;height:calc(100svh - 140px);min-height:650px;max-height:1000px}#art{height:60%;background-position:center;background-size:cover}#shade{background:linear-gradient(0deg,#30213f 32%,#30213faa 48%,transparent 75%)}#cover{padding:0 7%;background:linear-gradient(0deg,#30213f 3%,#30213fd9 41%,transparent 75%)}#cover .eyebrow{margin-top:58%;font-size:10px;letter-spacing:1.5px}h1{font-size:31px;line-height:1.7;letter-spacing:1px;margin:10px 0}.cover-copy{font-size:14px;margin-top:8px;line-height:1.9}.cover-bottom{left:7%;right:7%;bottom:26px}#start{width:100%}.book-meta{font-size:10px;margin-bottom:13px}#loadStatus{font-size:10px;margin-top:12px}body.reading #stage{height:auto;max-height:none;min-height:calc(100svh - 140px);display:flex;flex-direction:column;padding-bottom:16px}body.reading #chapterBar{position:relative;order:0;flex:none;height:58px;padding:7px 12px}#chapter{font-size:10px;letter-spacing:0}#menuButton{font-size:10px;padding:8px 10px}body.reading #art{position:relative;inset:auto;order:1;flex:none;width:100%;height:auto;aspect-ratio:3/2;transform:none;background-position:center}body.reading #shade{background:linear-gradient(0deg,#30213f 25%,transparent 70%)}#dialogue{position:relative;inset:auto;order:2;flex:1;margin:12px 4% 0;padding:18px 20px 15px;max-height:none;overflow:visible}#text{font-size:17px;line-height:2.12;margin:13px 0;min-height:108px;letter-spacing:0}#speaker{font-size:11px;letter-spacing:1px}#controls{flex-wrap:wrap;gap:6px}#hint{font-size:10px}#next{font-size:13px;min-width:130px;padding:12px 14px}#dialogue.action #next{flex-basis:100%;margin-top:7px}#endingActions{gap:9px}#endingActions button{padding:12px 8px;font-size:13px}#cinema{padding:35px 22px 10%;background:linear-gradient(0deg,#30213f 4%,#30213fb0 28%,transparent 75%)}#cinemaTitle{font-size:29px;letter-spacing:1px}#cinemaSub{font-size:12px;letter-spacing:1px}body.cinematic #art{height:76%;background-size:contain;background-repeat:no-repeat;background-position:center top}body.cinematic #shade{background:linear-gradient(0deg,#30213f 15%,transparent 85%)}.ending-card{padding:27px 18px}.ending-card h2{font-size:23px}.ending-card p{font-size:16px}footer{padding:14px 12px;font-size:9px}footer>span:last-child{display:none}}
@media(min-width:520px) and (max-width:760px){#cover .eyebrow{margin-top:38%}#cover{background:linear-gradient(0deg,#30213f 3%,#30213fdc 48%,transparent 85%)}#art{height:65%}body.reading #art{max-height:380px}}
@media(max-width:360px){#hint{display:none}#text{font-size:16px}#dialogue{padding:16px}h1{font-size:27px}.book-meta{letter-spacing:0}#cover .eyebrow{margin-top:61%}}
@media(min-width:761px){body.reading #stage{display:flex;flex-direction:column;aspect-ratio:auto;height:auto;min-height:700px;padding-bottom:24px}body.reading #chapterBar{position:relative;flex:none;order:0}body.reading #art{position:relative;inset:auto;order:1;flex:none;height:560px;background-size:contain;background-repeat:no-repeat;background-position:center}body.reading #dialogue{position:relative;inset:auto;order:2;margin:18px 5% 0;max-height:none}body.cinematic #art{background-size:contain;background-repeat:no-repeat;background-position:center top}}
@media(prefers-reduced-motion:reduce){#trackFill{transition:none}}

/* A story about stage light: warm velvet, with the established reader layout. */
#cover .cover-copy{max-width:27em}#cinemaTitle{color:#fff3d1}#art{background-color:#30213f}#fx{mix-blend-mode:screen}body.cinematic #fx{mix-blend-mode:normal}body.calm #cinemaTitle{transform:none!important}
@media(min-width:761px){body:not(.reading) #stage{min-height:780px}#cover{padding-top:200px}#cover h1{font-size:clamp(28px,3.2vw,40px)}}

/* Paper edition: the cover is a normal document flow, so text size controls its height. */
body.reading #art{background-color:#f5edda;background-size:contain;background-repeat:no-repeat}
body.cover-state #stage{display:flex;flex-direction:column;aspect-ratio:auto;height:auto;min-height:0;max-height:none}
body.cover-state #art{position:relative;inset:auto;flex:none;width:100%;height:auto;aspect-ratio:3/2;max-height:520px;background-size:contain;background-repeat:no-repeat;background-position:center;background-color:#f5edda}
body.cover-state #shade{display:none}
body.cover-state #cover{position:relative;inset:auto;padding:24px 6% 28px;background:#30213f}
body.cover-state #cover h1{font-size:34px;line-height:1.65;margin:12px 0;max-width:none}
body.cover-state #cover .cover-copy{max-width:none;font-size:15px;line-height:1.95;margin:12px 0 0}
body.cover-state #cover .eyebrow{margin:0}
body.cover-state .cover-bottom{position:static;inset:auto;margin-top:24px;max-width:560px}
body.cover-state .book-meta{margin-bottom:12px}
body.cover-state #start{width:100%;min-width:0}
body.cover-state #loadStatus{margin-bottom:0}
@media(max-width:760px){
 body.cover-state #art{max-height:none}
 body.cover-state #cover{padding:20px 6% 24px}
 body.cover-state #cover h1{font-size:29px;margin:10px 0}
 body.cover-state #cover .cover-copy{font-size:14px}
 body.cover-state .cover-bottom{margin-top:22px;max-width:none}
}
