:root{color-scheme:dark;--ink:#eeeae2;--gold:#c2ad83;--line:#c9bba236;--panel:#10191bf5}*{box-sizing:border-box}html,body{margin:0;width:100%;height:100%;overflow:hidden;background:#090e10;color:var(--ink);font-family:'Yu Gothic','Meiryo',sans-serif}button,input,select{font:inherit}button{min-height:44px;padding:10px 18px;border:1px solid var(--line);border-radius:2px;background:#152125;color:var(--ink);cursor:pointer;touch-action:manipulation}button:hover,button:focus-visible{background:#344044;border-color:var(--gold)}button:disabled{opacity:.4;cursor:default}button.primary{background:#574933;border-color:#b59a69}button.danger{border-color:#a37d72;background:#402e2a}button.selected{border-color:var(--gold);background:#594b36}[hidden]{display:none!important}#game{height:100dvh;display:grid;grid-template-rows:auto minmax(0,1fr) auto}header{display:flex;justify-content:space-between;align-items:center;gap:15px;padding:14px 3%;background:#0e171a;border-bottom:1px solid var(--line)}header h1{font-size:18px;margin:4px 0}header small{color:var(--gold);font-size:12px}header p{font-size:12px;color:#b8b8ae;margin:0}footer{display:flex;justify-content:space-between;gap:8px;align-items:center;padding:9px 3%;background:#0e171a;border-top:1px solid var(--line)}#progress{font-size:12px;color:#a99b83}#stage{position:relative;overflow:hidden;cursor:pointer;touch-action:manipulation;background:#0b1215}#picture{position:absolute;inset:0}#background{width:100%;height:100%;object-fit:contain;display:block}#flowers{position:absolute;inset:0;width:100%;height:100%;object-fit:fill;clip-path:url(#flowerMask)}#picture.flower-mode{inset:auto 0;top:50%;transform:translateY(-50%);aspect-ratio:1672/941}#picture.flower-mode #background{object-fit:fill}#portrait{position:absolute;left:50%;bottom:0;transform:translateX(-50%);height:98%;width:75%;object-fit:contain;object-position:center bottom;filter:drop-shadow(0 5px 24px #0007)}.shade{position:absolute;inset:0;background:linear-gradient(90deg,#061013ed,#061013b8 44%,#06101308 80%);pointer-events:none}#reader{position:absolute;left:6.5%;top:10%;width:49%;height:78%;overflow:hidden;display:flex;flex-direction:column;justify-content:flex-start}#bodyText{font-family:'Yu Mincho','Hiragino Mincho ProN','Meiryo',serif;font-size:23px;line-height:1.82;letter-spacing:.025em;text-shadow:0 2px 5px #000}#bodyText p{margin:0 0 .7em;white-space:pre-wrap;overflow-wrap:anywhere}#bodyText .toru{color:#becbf6}#bodyText .yuto{color:#b9d8c8}#bodyText .shiori{color:#e8c0d3}#bodyText .misato{color:#e3d0a9}#bodyText .context-copy{font-size:18px;color:var(--gold)}#actionArea{margin-top:12px}#actionArea button{margin-right:8px;font-size:17px;max-width:100%}#mediaButton{position:absolute;right:3%;bottom:5%;background:#0a141be8;font-size:13px}#screenLabel{position:absolute;right:3%;top:3%;padding:7px 12px;background:#081016d9;font-size:12px;border-left:2px solid var(--gold)}.intro-mode .shade{background:linear-gradient(#07101445,#0710147a 45%,#071014ef)}.intro-mode #reader{top:auto;bottom:3%;left:10%;width:80%;height:27%;text-align:center}.intro-mode #bodyText{font-size:21px}.intro-mode #portrait{height:100%;width:70%}#titleScreen{height:100dvh;position:relative}#titleScreen>img{height:100%;width:100%;object-fit:cover}.title-shade{position:absolute;inset:0;background:linear-gradient(90deg,#0a131af5,#0a131a60)}.title-copy{position:absolute;left:10%;top:23%;max-width:80%}.title-copy>small{font-size:17px;letter-spacing:1em;color:var(--gold)}.title-copy h1{font-family:'Yu Mincho','Meiryo',serif;font-size:clamp(32px,5vw,65px);letter-spacing:.16em;font-weight:400;margin:16px 0 24px}.title-copy p{font-size:15px;color:#c2c0b5}.title-actions{display:flex;flex-direction:column;align-items:flex-start;gap:12px;margin:38px 0}.title-actions button{min-width:240px;text-align:left}.title-copy .notice{font-size:11px;letter-spacing:0;color:#bbb5a4}dialog{background:linear-gradient(145deg,#202d30,#101b20);color:var(--ink);border:1px solid #ae9e795c;border-radius:3px;max-height:92dvh;width:min(1020px,94vw);padding:0;box-shadow:0 24px 120px #000a}dialog::backdrop{background:#03080acb;backdrop-filter:blur(3px)}.modal-head{position:sticky;top:0;z-index:5;display:flex;justify-content:space-between;align-items:center;padding:14px 22px;background:#172428;border-bottom:1px solid var(--line);gap:12px}.modal-head h2{font-size:19px;margin:0;font-family:'Yu Mincho','Meiryo',serif}#modalBody{padding:20px 22px;font-size:17px;line-height:1.8;overflow-wrap:anywhere}#modalBody p{margin:0 0 15px}.buttons{display:flex;flex-wrap:wrap;gap:10px;margin:15px 0}.buttons button{flex:0 1 auto}.card{border:1px solid var(--line);background:#0b171db8;padding:18px;margin:12px 0}.card h3{font-size:17px;color:var(--gold);margin:0 0 12px}.card small{display:block;color:#b2b6b4}.compare-grid{display:grid;grid-template-columns:1fr 1fr;gap:16px}.evidence{position:relative;background:#080d11;aspect-ratio:1672/941;overflow:hidden;margin-bottom:12px}.evidence img{width:100%;height:100%;object-fit:contain;display:block}.evidence .flowers-overlay{position:absolute;inset:0;clip-path:url(#flowerMask);object-fit:fill}.evidence .box{position:absolute;border:2px solid #edd29b;pointer-events:none}.evidence .box.patch{left:39.5%;top:14%;width:5%;height:37%}.evidence .box.window{left:49%;top:15.5%;width:30%;height:33.5%}.evidence.zoom img{transform:scale(1.75);transform-origin:48% 32%}.cup-scene{position:relative;aspect-ratio:16/9;background:#362c20;max-height:45dvh;overflow:hidden;border:1px solid var(--line)}.cup-scene .desk{width:100%;height:100%;object-fit:contain;pointer-events:none}.cup-scene .cup{position:absolute;width:10%;transform:translate(-50%,-80%);pointer-events:none}label.setting{display:grid;grid-template-columns:150px 1fr 50px;gap:12px;align-items:center;margin:16px 0}input[type=range]{width:100%;min-height:44px}.record-subtitle{white-space:pre-wrap;min-height:90px;font-family:'Yu Mincho','Meiryo',serif}.video-clock{font-size:13px;color:var(--gold)}.log-entry{border-bottom:1px solid var(--line);padding:15px 0;white-space:pre-wrap}.log-entry small{color:var(--gold);display:block;margin-bottom:8px}#toast{position:fixed;z-index:20;bottom:80px;left:50%;transform:translateX(-50%);max-width:90%;padding:10px 18px;background:#283337;border:1px solid var(--line);font-size:13px}.ending .shade{background:#000;transition:background 2s}.ending #picture,.ending #reader,.ending #mediaButton{visibility:hidden}.ending footer{opacity:0}.end-card{text-align:center;padding:25px}.file-label{color:var(--gold);font-size:14px}.placeholder{display:flex;align-items:center;justify-content:center;min-height:150px;border:1px dashed var(--line);padding:15px;color:#cdbf9f}
@media(max-width:1050px){#bodyText{font-size:21px}#reader{width:57%;left:5%}.shade{background:linear-gradient(90deg,#061013e8,#061013b8 52%,#06101320 86%)}}
@media(max-width:600px) and (orientation:portrait){header{padding:8px 4%;gap:8px}header h1{font-size:15px}header small,header p{font-size:10px}header button{padding:8px 10px;font-size:12px}footer{padding:7px 4%}footer button{padding:8px 14px}#progress{font-size:10px}#reader{left:5%;top:4%;width:90%;height:55%}#bodyText{font-size:18px;line-height:1.75;letter-spacing:0}#picture{inset:61% 0 0}#background{object-fit:contain}.shade{background:linear-gradient(#081219 0%,#081219 58%,#08121900 70%)}#picture.flower-mode{top:auto;bottom:3%;transform:none;inset:auto 0 3%;aspect-ratio:1672/941}#actionArea{margin-top:8px}#actionArea button{font-size:15px;padding:9px 15px}#mediaButton{bottom:2%;right:3%;min-height:40px;padding:6px 12px;font-size:11px}#screenLabel{font-size:10px}.intro-mode #picture{inset:0}.intro-mode #portrait{height:100%;width:100%;object-fit:contain;object-position:center bottom}.intro-mode .shade{background:linear-gradient(#09141a25,#09141a75 55%,#09141aed)}.intro-mode #reader{top:auto;bottom:3%;height:28%;left:6%;width:88%}.intro-mode #bodyText{font-size:18px}.title-copy{left:8%;top:22%}.title-copy h1{font-size:35px}.title-copy p{font-size:13px}.title-actions{margin:30px 0}dialog{width:96vw;max-height:94dvh}.modal-head{padding:10px 12px}.modal-head h2{font-size:16px}#modalBody{padding:13px;font-size:16px;line-height:1.7}.compare-grid{grid-template-columns:1fr;gap:8px}.card{padding:12px;margin:8px 0}.buttons{gap:8px}.buttons button{font-size:14px;padding:9px 12px}label.setting{grid-template-columns:100px 1fr 36px;gap:7px}.record-subtitle{min-height:70px}.evidence{max-height:30dvh}.cup-scene{max-height:32dvh}}
@media(max-height:500px) and (orientation:landscape){header{padding:6px 3%}header h1{font-size:14px}header p,header small{font-size:10px}header button,footer button{min-height:38px;padding:6px 12px;font-size:12px}footer{padding:5px 3%}#reader{top:7%;height:86%;width:58%}#bodyText{font-size:17px;line-height:1.65}#actionArea{margin-top:5px}#actionArea button{font-size:14px;min-height:38px;padding:6px 14px}.intro-mode #reader{height:28%;bottom:2%}.intro-mode #bodyText{font-size:17px}.title-copy{top:10%}.title-copy h1{margin:10px 0;font-size:34px}.title-actions{margin:15px 0;gap:6px}.title-actions button{min-height:36px;padding:6px 12px}.notice{display:none}.modal-head{padding:7px 14px}#modalBody{padding:12px;font-size:14px}.evidence{max-height:32dvh}.record-subtitle{min-height:50px}.card{padding:10px}.buttons button{min-height:38px;padding:6px 12px}.cup-scene{max-height:35dvh}}
@media(prefers-reduced-motion:reduce){*{transition:none!important;animation:none!important}}
*{-webkit-tap-highlight-color:transparent}.modal-head button{flex-shrink:0;white-space:nowrap}.modal-head h2{min-width:0}
/* SCENE 01-20 revision: the same top-left origin for prose and textual choices. */
#bodyText .context-copy{font-size:inherit;line-height:inherit}
@media(max-width:600px) and (orientation:portrait){header{height:108px;min-height:108px}}
@media(max-height:500px) and (orientation:landscape){header{height:82px;min-height:82px}}
.revised #reader,.revised.intro-mode #reader{left:6.5%;top:7%;bottom:auto;width:58%;height:86%;text-align:left;justify-content:flex-start}
.revised #bodyText,.revised.intro-mode #bodyText{font-size:23px;line-height:1.82}
.revised.intro-mode #portrait{height:125%;width:100%;bottom:-30%;object-fit:contain;object-position:center bottom}
.revised.intro-mode .shade{background:linear-gradient(90deg,#071014cd,#07101475 52%,#07101410)}
.revised #actionArea{margin-top:0}
.revised .story-choices{margin:0;gap:3px}
.revised .story-choice{font-family:'Yu Mincho','Hiragino Mincho ProN','Meiryo',serif;font-size:23px!important}
@media(max-width:1050px){.revised #bodyText,.revised.intro-mode #bodyText{font-size:21px}.revised #reader,.revised.intro-mode #reader{left:5%;width:65%}}
@media(max-width:600px) and (orientation:portrait){.revised #reader,.revised.intro-mode #reader{left:5%;top:4%;width:90%;height:56%;bottom:auto}.revised #bodyText,.revised.intro-mode #bodyText{font-size:18px;line-height:1.75;letter-spacing:0}.revised .story-choice{font-size:18px!important}.revised.intro-mode #portrait{height:120%;width:175%;bottom:-28%}.revised.intro-mode .shade{background:linear-gradient(#081219dd,#081219a0 56%,#08121910)} }
@media(max-height:500px) and (orientation:landscape){.revised #reader,.revised.intro-mode #reader{left:5%;top:5%;width:72%;height:92%;bottom:auto}.revised #bodyText,.revised.intro-mode #bodyText{font-size:17px;line-height:1.65}.revised .story-choice{font-size:17px!important;min-height:38px}.revised #bodyText p{margin-bottom:.35em}}
/* No wheel/swipe scrolling: long confirmation screens and history use readable pages. */
#game,#titleScreen,dialog{-webkit-user-select:none;user-select:none}
input,textarea{-webkit-user-select:text;user-select:text}
#game ::selection,dialog ::selection{background:transparent;color:inherit}
dialog{height:92dvh;max-height:92dvh;overflow:hidden}
dialog[open]{display:flex;flex-direction:column}
.modal-head{position:static;flex:0 0 auto}
#modalBody{flex:1 1 auto;min-height:0;overflow:hidden}
.modal-pagination{flex:0 0 auto;display:flex;align-items:center;justify-content:space-between;gap:8px;padding:8px 14px;border-top:1px solid var(--line);background:#172428}
.modal-pagination p{margin:0;font-size:13px;white-space:nowrap;color:var(--gold)}
.modal-pagination button{font-size:14px;padding:8px 12px}
#modalBody [data-page-hidden]{display:none!important}
.modal-split{display:contents!important}
.modal-text-chunk{display:block;white-space:pre-wrap;margin:0 0 12px}
#modalBody .evidence{width:min(100%,calc(32dvh * 1672 / 941));max-height:none;margin:0 auto 12px}
#modalBody .evidence img{user-drag:none;-webkit-user-drag:none}
.card{max-width:100%}
.alignment-grid{grid-template-columns:1fr 1fr!important;gap:8px!important}
.story-choices{display:flex;flex-direction:column;gap:4px;align-items:stretch;margin:14px 0}
.story-choice{position:relative;display:flex;gap:.7em;align-items:baseline;min-height:44px;padding:8px 8px 8px 1.4em;box-sizing:border-box;background:transparent!important;border:0!important;border-radius:0!important;color:#eee;font:inherit;font-size:21px;line-height:1.5;cursor:pointer;text-align:left;overflow-wrap:anywhere;outline:none;touch-action:manipulation}
.story-choice::before{position:absolute;left:0;content:'▶';opacity:0;color:#d899b0}
.story-choice:hover,.story-choice:focus-visible,.story-choice.is-current{color:#edb5c9}
.story-choice:hover::before,.story-choice:focus-visible::before,.story-choice.is-current::before{opacity:1}
.story-choice[aria-disabled=true]{opacity:.4;cursor:default}
.choice-letter{flex:0 0 1em;color:inherit}
#actionArea .story-choice{font-size:23px}
#mediaButton{background:transparent;border:0;color:var(--gold);text-decoration:underline;text-underline-offset:.3em}
@media(max-width:600px){.story-choice,#actionArea .story-choice{font-size:18px;padding-top:7px;padding-bottom:7px}}
@media(max-height:500px) and (orientation:landscape){.story-choice,#actionArea .story-choice{font-size:17px;padding-top:4px;padding-bottom:4px;min-height:38px}.story-choices{margin:6px 0;gap:2px}}
@media(max-width:600px) and (orientation:portrait){dialog{height:94dvh;max-height:94dvh}.modal-pagination{padding:7px 10px}.modal-pagination button{font-size:13px;padding:8px}#modalBody .evidence{width:min(100%,calc(24dvh * 1672 / 941))}}
@media(max-height:500px) and (orientation:landscape){dialog{height:96dvh;max-height:96dvh}.modal-pagination{padding:4px 10px}.modal-pagination button{min-height:38px;padding:6px 10px;font-size:12px}.modal-head h2{font-size:15px}.modal-head button{min-height:38px;padding:6px 10px}#modalBody .evidence{width:min(100%,calc(24dvh * 1672 / 941))}#modalBody .card{margin:4px 0;padding:8px}.record-subtitle{min-height:0}}
/* Early-scene keyboard and pointer selection share exactly one visible cursor. */
.refresh-early .story-choice:not(.is-current):hover,.refresh-early .story-choice:not(.is-current):focus-visible{color:#eee}
.refresh-early .story-choice:not(.is-current):hover::before,.refresh-early .story-choice:not(.is-current):focus-visible::before{opacity:0}
.refresh-early #screenLabel{z-index:2;max-width:90%;pointer-events:none}
@media(max-width:600px) and (orientation:portrait){.refresh-early #screenLabel{top:auto;bottom:2%;right:3%;font-size:11px;padding:5px 8px}}
/* Keep record metadata above the first text line on short landscape displays. */
@media(max-height:500px) and (orientation:landscape){.refresh-early #screenLabel{top:0;right:3%;font-size:9px;line-height:10px;padding:1px 8px;border-left:0;max-width:95%}}

/* Temporary playtest controls; disable TEMP_PLAYTEST in app.js to remove. */
.title-copy{top:14%}
@media(max-height:500px){.title-actions{flex-direction:row!important;width:auto!important}.title-copy{right:5%}.title-actions button{width:auto!important;min-width:0!important}}
.playtest-starts{margin-top:12px!important;gap:8px!important;flex-wrap:wrap}.playtest-starts button{font-size:14px;min-height:44px;padding:8px 12px}.route-badge{display:inline;font-size:inherit;color:inherit}#toast{pointer-events:none}
@media(max-height:500px){.title-copy{top:8%!important}.title-actions{margin-top:10px!important}.title-copy h1{margin:8px 0!important}}

/* Small screens keep 18px text; only crowded choice menus borrow image space. */
@media(max-width:600px) and (orientation:portrait){.revised.compact-action #reader{height:92%}.compact-action #picture{inset:88% 0 0}.compact-action .shade{background:linear-gradient(#081219 0%,#081219ed 86%,#08121920)}.compact-action #screenLabel{display:none}}

/* v15 retains only the title notice; story layout is restored to v13. */
.title-copy .route-notice{color:#ded7c8;font-size:14px;line-height:1.65;margin:12px 0;letter-spacing:0}
@media(max-width:600px) and (orientation:portrait){.title-copy{top:5%;left:6%;right:6%;max-width:88%}.title-copy h1{margin:10px 0 14px}.title-copy .route-notice{font-size:14px;margin:10px 0}.title-actions{margin:16px 0;gap:8px}.title-actions button{min-width:0;width:100%;min-height:44px}.title-copy .notice{font-size:10px}}
@media(max-height:500px) and (orientation:landscape){.title-copy .route-notice{font-size:13px;line-height:1.5;margin:6px 0}.title-actions{margin:10px 0!important}}
