:root{color-scheme:light;--paper:#fff;--ink:#252837;--muted:#707386;--line:#e3e4eb;--accent:#405779;--game-scale:1;font-family:"Noto Sans CJK KR","Apple SD Gothic Neo","Malgun Gothic",sans-serif;background:#080609;color:#eee6d8}
*{box-sizing:border-box}body{margin:0}button,a,input{touch-action:manipulation}button{font:inherit;color:inherit;border:1px solid var(--line);border-radius:6px;background:transparent;padding:10px 16px;cursor:pointer}button:hover{background:#e8edf4}button:disabled{opacity:.45;cursor:default}button:focus-visible,a:focus-visible,input:focus-visible{outline:3px solid #8ba4c4;outline-offset:3px}a{color:inherit}button.primary{background:#405779;color:#fff;border-color:#405779}button.primary:hover{background:#2e425f}[hidden]{display:none!important}.sr-only{position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
#startup{min-height:100dvh;display:flex;flex-direction:column;justify-content:center;align-items:center;padding:28px;text-align:center;color:#eee6d8;background:#080609}#startup h1{font-size:24px;font-weight:400}#startup p{font-size:14px;line-height:1.8;color:#b5a89c;max-width:480px}#startup button{color:#eee6d8;border-color:#b5a89c66;margin-top:12px}#startup button:hover{background:#801a2b88}
/* Shared dialogs outside the game. */
dialog{background:#fff;color:#252837;border:0;border-radius:10px;width:min(720px,94vw);max-height:88dvh;padding:28px;box-shadow:0 20px 90px #0005}dialog::backdrop{background:#131035b3}.panel-heading{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:22px}.panel-heading h2{margin:0;font-size:24px}.panel-heading button{font-size:12px;white-space:nowrap}#panel-body{line-height:1.8}#panel-body p{color:#707386}#panel-game-name,#panel-navigation,#panel-return{display:none}.credits-text{font:12px/1.7 monospace;white-space:pre-wrap;overflow-wrap:anywhere}#notice{position:fixed;bottom:22px;left:50%;transform:translateX(-50%);z-index:50;background:#272238;color:white;padding:14px 24px;border-radius:7px;max-width:90vw;font:14px/1.5 sans-serif}
/* The original game keeps its own palette and the native 1280 × 720 coordinates. */
body.playing{background:#000;font-family:Haruka,serif}body.playing :focus-visible{outline-color:#b52e3e}#dialogue:focus-visible{outline:none}#dialogue:focus-visible::before{background:#e3b3a5}#reader{position:relative;height:100dvh;display:flex;flex-direction:column;justify-content:center;color:#eee6d8}#game-frame{position:relative;isolation:isolate;overflow:hidden;background:#000;width:min(100vw,calc(100dvh * 16 / 9));aspect-ratio:16/9;margin:auto;container-type:inline-size}#stage-wrap{position:absolute;inset:0;overflow:hidden}#stage{width:1280px;height:720px;transform-origin:top left;position:absolute;overflow:hidden;background:#14202d}.stage-layer{position:absolute}.scene-art{position:absolute;inset:0}.scene-art.enter{animation:reveal var(--transition,.15s) ease-out}@keyframes reveal{from{opacity:0}to{opacity:1}}.prop-text{white-space:pre-wrap;line-height:1.35;font-family:HarukaHand,Haruka,serif;overflow-wrap:break-word}
.reader-top{position:absolute;inset:0;pointer-events:none;z-index:4}.reader-top #position-label,.reader-bottom{display:none}#menu-button{position:fixed;left:calc(var(--game-x) + 1090px * var(--game-scale));top:calc(var(--game-y) + 16px * var(--game-scale));padding:calc(10px * var(--game-scale)) calc(16px * var(--game-scale));font-family:Haruka,serif;font-size:calc(20px * var(--game-scale));background:#171720cc;border:0;border-radius:0;color:#fff5e9;pointer-events:auto}#menu-button:hover{background:#801a2bcc}#save-status{position:absolute;left:16px;top:8px;background:#171720cc;color:#b5a89c;padding:5px 8px;font:11px sans-serif;max-width:70vw}#save-status:empty{display:none}.save-error{color:#ffd2b5!important}
#dialogue{position:absolute;z-index:2;left:0;bottom:0;width:100%;height:27.777778%;padding:0;margin:0;border:0;border-top:1px solid #e7d9c026;border-radius:0;background:#080609ca;box-shadow:none;color:#eee6d8;text-align:left;display:block;font-family:Haruka,serif}#dialogue:hover{background:#080609ca}#dialogue::before{content:'';position:absolute;left:7.1875%;top:0;width:2.8125%;height:2px;background:#b52e3e}#speaker{position:absolute;left:7.1875%;top:9%;font:400 1.796875cqw/1.4 Haruka,serif;color:#e3b3a5;text-shadow:0 1px 1px #08060980}#line{position:absolute;left:7.1875%;top:27%;width:85.625%;font:400 2.03125cqw/1.31 Haruka,serif;color:#eee6d8;text-shadow:0 1px 1px #080609c0;word-break:keep-all;overflow-wrap:anywhere}#line::after{content:'　◆';font-size:1.015625cqw;color:#c44850}.next-mark{display:none}#dialogue.typing #line::after{visibility:hidden}body.large-text #line{font-size:2.3cqw}.picture-only #dialogue,.picture-only #menu-button,.menu-open #dialogue,.menu-open #menu-button{visibility:hidden}
/* Only a delayed, small status strip appears while retaining the current scene. */
#loading{position:absolute;z-index:5;bottom:8px;right:12px;max-width:calc(100% - 24px);padding:9px 14px;border:1px solid #c9b8a34d;background:#100b0eeb;color:#eee6d8;font:13px/1.5 Haruka,serif;pointer-events:none}#loading p{margin:0}#loading div{display:flex;gap:14px;align-items:center}#loading button{pointer-events:auto;color:#eee6d8;border:1px solid #c9b8a366;border-radius:0;padding:5px 9px;font:inherit}#loading button:hover{background:#801a2b88}#loading.initial{top:50%;left:50%;right:auto;bottom:auto;transform:translate(-50%,-50%);width:max-content}#loading.failed{pointer-events:auto}#audio-status{position:fixed;bottom:8px;right:10px;max-width:350px;color:#b5a89c;font:11px/1.5 sans-serif;background:#100b0ed9;margin:0;z-index:7}#audio-status:empty{display:none}
/* Restored title screen: original illustration, title, menu and footer positions. */
#game-title{position:absolute;inset:0;background-size:100% 100%;z-index:2;font-family:Haruka,serif}.title-shade{position:absolute;inset:0;background:linear-gradient(to right,#080508aa 0%,#080508aa 51.5625%,#08050844 51.5625%,#08050844 100%)}#game-title-name{position:absolute;left:8.75%;top:12.7778%;margin:0;font:400 5cqw/1.22 Haruka,serif;color:#eee6d8;text-shadow:0 2px 1px #10090c}#game-title-name span{display:block;margin-bottom:.9375cqw}.title-rule{position:absolute;left:9.0625%;top:38.6111%;width:4.21875%;height:2px;background:#b52e3e}#title-actions{position:absolute;left:8.75%;top:46.9444%;width:30.46875%;display:flex;flex-direction:column;gap:.703125cqw}#title-actions button{font:400 1.953125cqw/1.32 Haruka,serif;border:0;border-radius:0;padding:.546875cqw 1.5625cqw;text-align:left;color:#eee6d8;height:3.671875cqw;white-space:nowrap}#title-actions button:hover{background:#801a2b88;box-shadow:inset 3px 0 #b52e3e}#title-footer{position:absolute;left:8.75%;right:8.75%;top:90.8333%;display:flex;gap:1.875cqw;border-top:1px solid #c9b8a344;padding-top:.625cqw;align-items:center}#title-footer button{font:1.25cqw Haruka,serif;color:#b5a89c;padding:.546875cqw .9375cqw;border:0;border-radius:0;white-space:nowrap}#title-footer button:hover{color:#fff5e9;background:#801a2b88}#title-footer>span{font-size:1.09375cqw;color:#b5a89c;margin-left:auto}.title-mode #stage-wrap,.title-mode #dialogue,.title-mode #menu-button{visibility:hidden}
/* All in-game menus are aligned to the game rectangle, not the browser viewport. */
body.playing dialog{position:fixed;left:var(--game-x);top:var(--game-y);width:var(--game-width);height:var(--game-height);margin:0;padding:0;max-width:none;max-height:none;border:0;border-radius:0;background:#080507e6;color:#eee6d8;box-shadow:none;font-family:Haruka,serif;container-type:inline-size}body.playing dialog::backdrop{background:transparent}body.playing #panel-game-name{display:block;position:absolute;left:7.03125%;top:3.75%;font-size:1.171875cqw;color:#b5a89c}body.playing .panel-heading{position:absolute;left:6.875%;top:8.4722%;width:86.09375%;display:block;margin:0;padding:0;height:13.0556%;border-bottom:1px solid #c9b8a338}body.playing .panel-heading::after{content:'';position:absolute;bottom:-1px;left:.15625cqw;width:4.21875cqw;height:2px;background:#b52e3e}body.playing .panel-heading h2{font:400 2.65625cqw Haruka,serif;margin:0}body.playing #close-panel{display:none}body.playing #panel-navigation{position:absolute;right:7.03125%;top:10.4167%;display:flex;gap:.9375cqw;z-index:1}body.playing #panel-navigation button{font-size:1.5625cqw;padding:.546875cqw .9375cqw}body.playing #panel-body{position:absolute;left:7.03125%;top:24.5833%;width:85.9375%;height:65.2778%;overflow:auto;font:1.5625cqw/1.7 Haruka,serif;scrollbar-color:#a43845 #c9b8a31c;scrollbar-width:thin}body.playing #panel-body>p{margin:0 0 1.2em}body.playing #panel-body p{color:#b5a89c}body.playing #panel-return{position:absolute;display:block;left:6.09375%;top:93.0556%;font-size:1.484375cqw;padding:.546875cqw .9375cqw}body.playing dialog::after{content:'';position:absolute;left:7.03125%;top:91.3889%;width:85.9375%;height:1px;background:#c9b8a338}body.playing dialog button{font-family:Haruka,serif;border:0;border-radius:0;color:#eee6d8;padding:.546875cqw .9375cqw;font-size:1.484375cqw}body.playing dialog button:hover{background:#801a2b88;box-shadow:inset 3px 0 #b52e3e}body.playing dialog button.primary{background:#801a2b88}
/* Original pause menu, with web-only actions on the footer. */
body.playing dialog.pause-panel{background:#060406c9}.pause-panel #panel-game-name,.pause-panel #panel-navigation,.pause-panel #panel-return{display:none!important}body.playing .pause-panel::after{display:none}body.playing .pause-panel .panel-heading{left:14.0625%;top:25%;width:35%;height:auto;border:0}body.playing .pause-panel .panel-heading h2{font-size:2.421875cqw;white-space:nowrap}.pause-panel .panel-heading::after{display:none}body.playing .pause-panel #panel-body{inset:0;width:100%;height:100%;overflow:visible}.pause-panel #panel-body::before,.pause-panel #panel-body::after{content:'';position:absolute;left:12.8125%;width:74.375%;height:1px;background:#c9b8a344}.pause-panel #panel-body::before{top:21.9444%;background:linear-gradient(to right,#b52e3e 6.3%,#c9b8a344 6.3%)}.pause-panel #panel-body::after{top:83.3333%}.pause-panel .pause-label{position:absolute;left:14.0625%;top:16.3889%;margin:0;font-size:1.40625cqw}.pause-panel .pause-hint{position:absolute;left:14.0625%;top:78.0556%;margin:0;font-size:1.328125cqw}.pause-panel .menu-grid{position:absolute;left:50%;top:25.8333%;width:31.25%;display:flex;flex-direction:column;gap:.703125cqw}.pause-panel .menu-grid button{font-size:1.875cqw;line-height:1.3333;height:3.59375cqw;padding:.546875cqw 1.5625cqw;text-align:left;white-space:nowrap}.pause-extra{position:absolute;left:12.8125%;top:86%;display:flex;gap:1.2cqw}.pause-extra button{font-size:1.171875cqw!important;color:#b5a89c!important}
.settings-grid{display:grid;grid-template-columns:1fr 1fr;gap:8.59375cqw;position:relative}.settings-grid::after{content:'';position:absolute;left:49.09%;top:.3125cqw;height:32.96875cqw;width:1px;background:#c9b8a333}.settings-grid h3{margin:0 0 2.5cqw;font:400 2.109375cqw Haruka,serif;color:#e3b3a5}.setting{display:grid;grid-template-columns:1fr auto;align-items:center;gap:1.1cqw;font-size:1.796875cqw;margin:0 0 3.4cqw}.setting-value{font-size:1.328125cqw;color:#b5a89c}.setting input[type=range]{grid-column:1/-1;width:100%;height:1.71875cqw;margin:0;accent-color:#b52e3e;appearance:none;background:transparent;cursor:pointer}.setting input[type=range]::-webkit-slider-runnable-track{height:3px;background:#c9b8a34d}.setting input[type=range]::-webkit-slider-thumb{appearance:none;width:5px;height:17px;margin-top:-7px;border-radius:0;background:#e8d6bb}.setting input[type=range]::-moz-range-track{height:3px;background:#c9b8a34d}.setting input[type=range]::-moz-range-progress{height:3px;background:#b52e3e}.setting input[type=range]::-moz-range-thumb{width:5px;height:17px;border:0;border-radius:0;background:#e8d6bb}.setting-toggle{display:flex;gap:1cqw;align-items:center;font-size:1.640625cqw;min-height:3.515625cqw;margin-bottom:.7cqw}.setting-toggle input{accent-color:#b52e3e;width:1.2cqw;height:1.2cqw}.settings-foot{display:flex;justify-content:space-between;align-items:center;margin-top:1.5cqw;font-size:1.328125cqw}.settings-foot p{margin:0}.settings-foot button{font-size:1.484375cqw!important}
.chapter-row{padding:1.25cqw 0;border-bottom:1px solid #c9b8a338}.chapter-row h3{font-size:1.796875cqw;font-weight:400;margin:0 0 .7cqw;color:#e3b3a5}.chapter-row button{margin:.2cqw}.history-row{padding:1.25cqw 0;border-bottom:1px solid #c9b8a324}.history-row b{font-size:1.796875cqw;font-weight:400;color:#e3b3a5}.history-row p{color:#eee6d8!important;margin:.5em 0;white-space:pre-wrap;font-size:1.796875cqw;line-height:1.45}.history-row button{font-size:1.1cqw!important;padding:.3cqw .6cqw!important;color:#b5a89c!important}.history-pages{display:flex;gap:1.2cqw;position:sticky;bottom:0;background:#100b0ef5;padding:.6cqw 0}
@media(prefers-reduced-motion:reduce){.scene-art.enter{animation:none}}
@media(max-width:1024px) and (orientation:portrait){
 #reader{justify-content:flex-start}#game-frame{width:100%;aspect-ratio:auto;flex:1;margin:60px 0 0;overflow:auto;min-height:0}#stage-wrap{position:relative;width:100%;aspect-ratio:16/9}#dialogue{position:relative;height:auto;min-height:230px;width:100%;padding:52px 7.1875% 30px}#speaker{font-size:20px;top:18px}#line{position:static;display:block;width:100%;font-size:20px;line-height:1.6}#line::after{font-size:12px}body.large-text #line{font-size:23px}#menu-button{left:auto;right:12px;top:10px;font-size:16px;padding:10px 16px}#save-status{left:8px;top:14px;font-size:10px}#loading{position:fixed;bottom:12px;font-size:12px}#loading.initial{position:absolute;top:35%}#audio-status{bottom:46px;font-size:10px}.picture-only #dialogue{display:none}.picture-only #stage-wrap{aspect-ratio:auto;height:min(80dvh,720px);overflow:auto}.picture-only #stage{position:relative}
 #game-title{background-size:cover;background-position:60% center}.title-shade{background:#08050899}#game-title-name{left:8%;top:12%;font-size:36px}#game-title-name span{margin-bottom:8px}.title-rule{left:9%;top:33%;width:54px}#title-actions{left:8%;top:42%;width:84%;gap:10px}#title-actions button{font-size:23px;height:45px;padding:8px 14px}#title-footer{left:8%;right:8%;top:auto;bottom:22px;flex-wrap:wrap;gap:6px;padding-top:12px}#title-footer button{font-size:12px;padding:7px 8px}#title-footer>span{font-size:10px;width:100%;margin:8px 0 0}.title-mode #stage-wrap{height:0}
 body.playing dialog{left:0;top:0;width:100vw;height:100dvh}body.playing #panel-game-name{left:6%;top:24px;font-size:12px}body.playing .panel-heading{left:6%;top:56px;width:88%;height:88px}body.playing .panel-heading h2{font-size:25px}body.playing .panel-heading::after{width:54px}body.playing #panel-navigation{left:4%;right:auto;top:99px;gap:2px}body.playing #panel-navigation button{font-size:13px;padding:8px 10px}body.playing #panel-body{left:6%;top:165px;width:88%;height:calc(100dvh - 235px);font-size:16px}body.playing dialog button{font-size:15px;padding:9px 12px}body.playing #panel-return{left:4%;top:auto;bottom:18px;font-size:15px;padding:8px 10px}body.playing dialog::after{left:6%;width:88%;top:auto;bottom:66px}
 body.playing .pause-panel .panel-heading{left:9%;top:18%;width:82%;height:auto}body.playing .pause-panel .panel-heading h2{font-size:25px}.pause-panel .pause-label{top:8%;left:9%;font-size:16px}.pause-panel #panel-body::before{top:14%;left:9%;width:82%}.pause-panel #panel-body::after{top:82%;left:9%;width:82%}.pause-panel .menu-grid{left:9%;top:29%;width:82%;gap:7px}.pause-panel .menu-grid button{font-size:22px;padding:9px 16px;height:48px}.pause-panel .pause-hint{left:9%;top:77%;font-size:12px}.pause-extra{left:6%;top:85%;width:88%;gap:4px;flex-wrap:wrap}.pause-extra button{font-size:13px!important;padding:8px 10px!important}
 .settings-grid{grid-template-columns:1fr;gap:28px}.settings-grid::after{display:none}.settings-grid h3{font-size:23px;margin-bottom:24px}.settings-grid section+section{border-top:1px solid #c9b8a333;padding-top:24px}.setting{font-size:18px;gap:16px;margin-bottom:32px}.setting-value{font-size:14px}.setting input[type=range]{height:22px}.setting-toggle{font-size:17px;gap:12px;min-height:40px;margin-bottom:8px}.setting-toggle input{width:16px;height:16px}.settings-foot{display:block;font-size:13px;margin-top:24px}.settings-foot button{font-size:15px!important}.chapter-row{padding:18px 0}.chapter-row h3{font-size:18px;margin-bottom:12px}.chapter-row button{margin:3px}.history-row{padding:15px 0}.history-row b,.history-row p{font-size:18px}.history-row button{font-size:12px!important;padding:5px 8px!important}.history-pages{gap:4px;flex-wrap:wrap;padding:8px 0}.history-pages button{font-size:12px!important}
}
body.playing dialog{background-size:100% 100%;background-position:center}
/* Readable controls on phones, tablets and short browser windows. */
@media(max-width:1100px),(max-height:500px){
 #menu-button,#title-actions button,#title-footer button,body.playing dialog button{min-height:44px}
 #title-footer button{font-size:max(13px,1.25cqw)}
 body.playing dialog button{font-size:max(15px,1.484375cqw)}
 .pause-extra button,.history-row button,.history-pages button{font-size:14px!important}
 .setting input[type=range]{height:44px}.setting-toggle{min-height:44px}.setting-toggle input{width:20px;height:20px}
 #panel-body input[type=file]{width:100%;min-height:44px;font:inherit}
 #panel-body input[type=file]::file-selector-button{font:inherit;padding:10px 12px;margin-right:8px}
}
@media(max-width:1024px) and (orientation:portrait){
 .title-mode #game-frame{margin-top:0}#game-title-name{font-size:clamp(32px,9vw,48px);max-width:84%}
 #title-footer{bottom:max(16px,env(safe-area-inset-bottom));gap:6px}#title-footer button{font-size:14px}
 .setting{margin-bottom:24px}.settings-foot button{min-height:44px}
}
@media(max-width:1100px) and (orientation:landscape){
 #menu-button{left:auto;right:calc(var(--game-x) + 12px);top:calc(var(--game-y) + 8px);font-size:16px;min-height:44px;padding:10px 16px}
}
@media(max-height:500px) and (orientation:landscape){
 #game-title-name{top:23%;font-size:clamp(27px,5cqw,42px);max-width:45%}.title-rule{top:65%}
 #title-actions{left:57%;top:23%;width:36%;gap:6px}#title-actions button{font-size:18px;height:44px;padding:8px 12px}
 #title-footer{top:auto;bottom:6px;gap:8px;padding-top:4px}#title-footer>span{font-size:10px}
 .title-shade{background:linear-gradient(to right,#080508aa 0%,#080508aa 51.5625%,#08050888 51.5625%,#08050888 100%)}
 #dialogue{height:auto;min-height:124px;padding:38px 7.1875% 16px}#speaker{top:10px;font-size:16px}
 #line{position:static;display:block;width:100%;font-size:clamp(17px,2.4cqw,20px);line-height:1.4}#line::after{font-size:10px}body.large-text #line{font-size:20px}
 body.playing dialog{left:0;top:0;width:100vw;height:100dvh}
 body.playing #panel-game-name{top:10px;left:5%;font-size:11px}
 body.playing .panel-heading{left:5%;top:35px;width:90%;height:49px}body.playing .panel-heading h2{font-size:24px}
 body.playing #panel-navigation{right:4%;top:30px;gap:4px}body.playing #panel-navigation button{font-size:15px;padding:8px 12px}
 body.playing #panel-body{left:5%;top:100px;width:90%;height:calc(100dvh - 178px);font-size:16px}
 body.playing #panel-return{left:4%;top:auto;bottom:12px;font-size:15px;padding:8px 12px}
 body.playing dialog::after{left:5%;width:90%;top:auto;bottom:66px}
 .settings-grid{gap:32px}.settings-grid h3{font-size:22px;margin-bottom:16px}.settings-grid::after{height:100%}
 .setting{font-size:17px;margin-bottom:16px;gap:8px}.setting-value{font-size:13px}.setting-toggle{font-size:16px;gap:10px}
 .settings-foot{flex-wrap:wrap;gap:8px 20px;font-size:13px}.settings-foot p{width:100%}.settings-foot button{font-size:15px!important}
 body.playing .pause-panel .panel-heading{left:8%;top:26%;width:40%;height:auto}body.playing .pause-panel .panel-heading h2{font-size:22px}
 body.playing .pause-panel #panel-body{inset:0;width:100%;height:100%;overflow:auto}
 .pause-panel .pause-label{left:8%;top:10%;font-size:13px}.pause-panel #panel-body::before{left:8%;top:21%;width:84%}
 .pause-panel .menu-grid{left:54%;top:23%;width:38%;gap:2px}.pause-panel .menu-grid button{font-size:18px;height:44px;padding:8px 12px}
 .pause-panel .pause-hint{left:8%;top:70%;font-size:12px;max-width:42%}.pause-panel #panel-body::after{left:8%;top:84%;width:84%}
 .pause-extra{left:6%;top:auto;bottom:2px;gap:8px}.pause-extra button{padding:8px 12px!important}
}
