/* Conversations sit over the scene like a small, illustrated story panel. */
/* Each speaker turn opens a new panel; keep its scene shade at full opacity. */
.story-backdrop{align-items:flex-end;background:#26332638;padding:18px 12px calc(18px + var(--safe-area-inset-bottom,0px));padding:18px 12px calc(18px + var(--safe-area-inset-bottom,env(safe-area-inset-bottom,0px)));-webkit-backdrop-filter:none;backdrop-filter:none;animation:none}
.story-sheet{width:100%;width:min(620px,100%);height:auto;min-height:230px;max-height:calc(100vh - 36px - var(--safe-area-inset-top,0px) - var(--safe-area-inset-bottom,0px));max-height:calc(calc(var(--minitool-vh,1vh) * 100) - 36px - var(--safe-area-inset-top,0px) - var(--safe-area-inset-bottom,0px));max-height:calc(100dvh - 36px - var(--safe-area-inset-top,env(safe-area-inset-top,0px)) - var(--safe-area-inset-bottom,env(safe-area-inset-bottom,0px)));padding:20px 20px 14px;display:grid;grid-template-columns:84px minmax(0,1fr);grid-template-rows:auto minmax(0,1fr) auto;--minitool-row-gap:12px;--minitool-column-gap:16px;grid-gap:12px 16px;gap:12px 16px;border-color:#68745c;border-radius:12px 9px 14px 10px;overflow:hidden;animation:story-arrive .16s ease-out}
.story-sheet .modal-header{display:contents}
.story-sheet .modal-header>.speaker-portrait{grid-column:1;grid-row:1 / 3;align-self:start;width:84px;height:108px;margin:8px 0 0;object-fit:contain}
.story-sheet .modal-heading{grid-column:2;grid-row:1;padding:0;align-self:center;min-width:0}
.story-sheet .modal-heading:before{display:none}
.story-sheet .modal-header h2{display:inline-block;margin:0;padding:5px 11px 6px;background:#e2e8d5;border:1px solid #9ba78a;border-radius:5px 7px 4px 6px;font-size:16px;font-weight:700;letter-spacing:1px;line-height:1.5;overflow-wrap:break-word;overflow-wrap:anywhere}
.story-content{grid-column:2;grid-row:2;min-height:0;min-width:0;max-height:47vh;max-height:calc(var(--minitool-vh,1vh) * 47);max-height:47dvh;overflow:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:#adb598 transparent;padding:2px 3px 4px 0}
.story-text{margin:0;white-space:pre-wrap;overflow-wrap:break-word;overflow-wrap:anywhere;color:#374430;font-size:16px;line-height:1.95;letter-spacing:.35px}
.story-footer{grid-column:1 / -1;grid-row:3;display:flex;align-items:center;--minitool-row-gap:10px;--minitool-column-gap:10px;grid-gap:10px;gap:10px;min-width:0;padding-top:12px;margin-top:2px;border-top:1px dashed #b4bba4}
.story-footer .skip-button{min-height:44px;padding:10px 6px;color:#737e66;font-size:11px;flex-shrink:0;border-radius:4px}
.story-footer .skip-button:hover{background:#eae9da;color:#44543c}
.story-pagination{display:flex;align-items:center;--minitool-row-gap:7px;--minitool-column-gap:7px;grid-gap:7px;gap:7px;margin-left:auto;flex-shrink:0}
.story-pagination .paper-button{width:44px;padding:9px}
.story-pagination .paper-button svg{width:17px}
.story-page-count{font-size:11px;font-variant-numeric:tabular-nums;white-space:nowrap;color:#66765c}
.story-footer #next-story{min-width:112px;margin-left:auto;justify-content:space-between;--minitool-row-gap:16px;--minitool-column-gap:16px;grid-gap:16px;gap:16px;font-size:13px;letter-spacing:.5px}
.story-footer .story-pagination:not([hidden])+#next-story{margin-left:0}
.story-footer #next-story>span{font-size:20px;line-height:1}
.story-options{display:grid;--minitool-row-gap:9px;--minitool-column-gap:9px;grid-gap:9px;gap:9px;margin-top:15px;padding:2px 3px 4px}
.story-option{display:flex;--minitool-row-gap:10px;--minitool-column-gap:10px;grid-gap:10px;gap:10px;align-items:center;width:100%;min-height:48px;padding:10px 13px;text-align:left;border:1px solid #99a887;border-radius:6px 9px 5px 7px;background:#e9eedc;box-shadow:0 2px 0 #cbd1b8;color:#43583a;font-size:14px;line-height:1.7;overflow-wrap:break-word;overflow-wrap:anywhere}
.story-option:not(:disabled):hover{background:#dce7cb;border-color:#607e50}
.story-option:not(:disabled):active{transform:translateY(2px);box-shadow:none}
.story-option:disabled{opacity:1;color:#8a8d7b;background:#eeede2;border-color:#c3c6b3;box-shadow:none}
.story-option-mark{font-size:24px;flex-shrink:0;line-height:1}
.story-option small{display:block;font-size:11px;margin-top:3px}
.choice-sheet.story-sheet .story-footer.minitool-has-hidden-pagination{display:none}
.choice-sheet.story-sheet .story-footer:has(.story-pagination[hidden]){display:none}
.narration-sheet.story-sheet{grid-template-columns:minmax(0,1fr);min-height:200px}
.narration-sheet.story-sheet .modal-header{display:flex;grid-column:1;grid-row:1;--minitool-row-gap:11px;--minitool-column-gap:11px;grid-gap:11px;gap:11px;margin:0;padding:0;border:0;min-height:0}
.narration-sheet.story-sheet .modal-heading{padding:0}
.narration-sheet.story-sheet .tool-portrait{width:32px;height:32px;color:#7a885e}
.narration-sheet.story-sheet .tool-portrait svg{width:28px;height:28px}
.narration-sheet.story-sheet .modal-header h2{background:#efe7cb;border-color:#bcb48e}
.narration-sheet .story-content{grid-column:1;max-height:47vh;max-height:calc(var(--minitool-vh,1vh) * 47);max-height:47dvh}
.story-title-only.story-sheet{min-height:150px}
.story-title-only .story-content{display:none}
.story-system-sheet{height:auto;max-height:calc(100vh - 36px);max-height:calc(calc(var(--minitool-vh,1vh) * 100) - 36px);max-height:calc(100dvh - 36px);overflow:auto}
.story-system-sheet .panel-intro{font-size:14px;line-height:1.9;color:#637057;margin:6px 0 18px}
.story-system-sheet .system-actions{display:flex;--minitool-row-gap:10px;--minitool-column-gap:10px;grid-gap:10px;gap:10px;flex-shrink:0}
.story-system-sheet .system-actions .ink-button{flex:1}
.story-system-sheet .ending-copy{font-size:15px;line-height:1.9;text-align:center;margin:4px 0 0}
.story-system-sheet .ending-art{width:120px;height:125px;flex-shrink:0}
.story-system-sheet .ending-score{margin:15px 0;padding:15px 0;flex-shrink:0}
.story-system-sheet .ending-score strong{font-size:17px}
.story-system-sheet .ending-score small{color:#657654}
.story-system-sheet #ending-home{width:100%;flex-shrink:0}
@keyframes story-arrive{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}
@media(min-width:600px){.story-backdrop{padding-bottom:32px}.story-sheet{min-height:210px}.story-content{max-height:42vh;max-height:calc(var(--minitool-vh,1vh) * 42);max-height:42dvh}}
@media(max-width:360px){.story-backdrop{padding-left:9px;padding-right:9px;padding-inline:9px}.story-sheet{padding:15px 13px 11px;grid-template-columns:62px minmax(0,1fr);--minitool-column-gap:10px;grid-column-gap:10px;column-gap:10px}.story-sheet .modal-header>.speaker-portrait{width:62px;height:88px;margin-top:4px}.story-text{font-size:15px;line-height:1.85}.story-footer{--minitool-row-gap:7px;--minitool-column-gap:7px;grid-gap:7px;gap:7px}.story-footer .skip-button{padding-left:2px;padding-right:2px;padding-inline:2px}.story-footer #next-story{min-width:88px;--minitool-row-gap:9px;--minitool-column-gap:9px;grid-gap:9px;gap:9px}.story-pagination{--minitool-row-gap:5px;--minitool-column-gap:5px;grid-gap:5px;gap:5px}.story-sheet .modal-header h2{font-size:15px;padding-left:8px;padding-right:8px;padding-inline:8px}}
@media(max-height:600px){.story-backdrop{padding-top:10px;padding-bottom:10px;padding-block:10px}.story-sheet{min-height:0;padding-top:13px;padding-bottom:10px;padding-block:13px 10px;max-height:calc(100vh - 20px - var(--safe-area-inset-top,0px) - var(--safe-area-inset-bottom,0px));max-height:calc(calc(var(--minitool-vh,1vh) * 100) - 20px - var(--safe-area-inset-top,0px) - var(--safe-area-inset-bottom,0px));max-height:calc(100dvh - 20px - var(--safe-area-inset-top,env(safe-area-inset-top,0px)) - var(--safe-area-inset-bottom,env(safe-area-inset-bottom,0px)));--minitool-row-gap:8px;grid-row-gap:8px;row-gap:8px}.story-content,.narration-sheet .story-content{max-height:45vh;max-height:calc(var(--minitool-vh,1vh) * 45);max-height:45dvh}.story-footer{padding-top:8px}.story-system-sheet .ending-art{width:84px;height:88px}.story-system-sheet .ending-score{padding:11px 0;margin:11px 0}}
@media(max-height:400px){.story-sheet{grid-template-columns:62px minmax(0,1fr)}.story-sheet .modal-header>.speaker-portrait{width:62px;height:82px}.story-sheet .modal-header h2{font-size:14px;padding-top:3px;padding-bottom:3px;padding-block:3px}.story-content,.narration-sheet .story-content{max-height:calc(100vh - 145px);max-height:calc(calc(var(--minitool-vh,1vh) * 100) - 145px);max-height:calc(100dvh - 145px)}.story-text{font-size:15px;line-height:1.8}.story-system-sheet{max-height:calc(100vh - 24px);max-height:calc(calc(var(--minitool-vh,1vh) * 100) - 24px);max-height:calc(100dvh - 24px);display:block}.story-system-sheet .ending-art{float:left;margin:0 12px 8px 0}.story-system-sheet .ending-score{clear:both}}
@media(prefers-reduced-motion:reduce){.story-sheet{animation:none}.story-option{transition:none}}

/* Narration opens a full paper page; conversations keep their original panel. */
.narration-backdrop{padding:0;align-items:stretch;background:#faf7eb;animation:narration-open .28s ease-out}
.narration-screen.adventure-sheet{width:100%;height:100vh;height:calc(var(--minitool-vh,1vh) * 100);height:100dvh;max-height:100vh;max-height:calc(var(--minitool-vh,1vh) * 100);max-height:100dvh;min-height:0;display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:auto minmax(0,1fr) auto;--minitool-row-gap:12px;--minitool-column-gap:12px;grid-gap:12px;gap:12px;padding:calc(20px + var(--safe-area-inset-top,0px)) 20px calc(20px + var(--safe-area-inset-bottom,0px)) 20px;padding:calc(20px + var(--safe-area-inset-top,env(safe-area-inset-top,0px))) max(20px,var(--safe-area-inset-right,env(safe-area-inset-right,0px)),calc((100vw - 620px)/2)) calc(20px + var(--safe-area-inset-bottom,env(safe-area-inset-bottom,0px))) max(20px,var(--safe-area-inset-left,env(safe-area-inset-left,0px)),calc((100vw - 620px)/2));border:0;border-radius:0;box-shadow:none;overflow:hidden;animation:none}
.narration-screen .modal-header{grid-row:1;min-height:44px;margin:0;padding:0 0 10px;--minitool-row-gap:10px;--minitool-column-gap:10px;grid-gap:10px;gap:10px;border-bottom:1px solid #cdd0bb}
.narration-screen .modal-heading{padding:0}
.narration-screen .modal-heading:before{display:none}
.narration-screen .modal-header h2{font-size:21px;line-height:1.5;letter-spacing:2px;overflow-wrap:break-word;overflow-wrap:anywhere}
.narration-screen .tool-portrait{width:30px;height:30px;color:#7a885e}
.narration-screen .tool-portrait svg{width:27px;height:27px}
.narration-screen .skip-button{margin-left:auto;min-width:80px;min-height:44px;padding:8px 0 8px 10px;flex-shrink:0;font-size:12px;color:#69765f}
.narration-screen .skip-button span{margin-left:5px}
.narration-screen .story-content{grid-column:1;grid-row:2;display:flex;flex-direction:column;max-height:none;min-height:0;padding:8px 3px 8px 0;scroll-behavior:auto;touch-action:pan-y pinch-zoom;overflow:auto;overscroll-behavior:contain;scrollbar-gutter:stable}html.minitool-no-focus-visible .narration-screen .story-content:focus{outline:2px solid #819474;outline-offset:3px;border-radius:3px}
.narration-screen .story-content:focus-visible{outline:2px solid #819474;outline-offset:3px;border-radius:3px}
.narration-screen .story-text{flex-shrink:0;margin-top:auto;margin-bottom:auto;margin-block:auto;font-size:16px;line-height:1.85;letter-spacing:.25px;color:#3f4936}
.narration-footer{grid-row:3;display:flex;align-items:center;justify-content:space-between;--minitool-row-gap:16px;--minitool-column-gap:16px;grid-gap:16px;gap:16px;min-width:0;padding-top:12px;border-top:1px solid #cdd0bb}
.narration-playback{display:flex;align-items:center;--minitool-row-gap:8px;--minitool-column-gap:8px;grid-gap:8px;gap:8px;min-width:0}
.narration-playback .paper-button{min-height:44px;flex-shrink:0;background:transparent;border-color:#b6bda5;font-weight:500;padding:8px 12px}
.narration-hint{max-width:70px;font-size:10px;line-height:1.5;color:#77816b}
.narration-footer #next-story{margin-left:auto;min-width:130px;min-height:48px;justify-content:space-between;padding:11px 16px;--minitool-row-gap:18px;--minitool-column-gap:18px;grid-gap:18px;gap:18px;font-size:14px;letter-spacing:1px}
.narration-footer #next-story>span{font-size:22px;line-height:1}
@keyframes narration-open{from{opacity:0}to{opacity:1}}
@media(min-width:600px) and (min-height:600px){.narration-screen.adventure-sheet{padding-block:calc(32px + var(--safe-area-inset-top,0px)) calc(28px + var(--safe-area-inset-bottom,0px));padding-top:calc(32px + var(--safe-area-inset-top,0px));padding-bottom:calc(28px + var(--safe-area-inset-bottom,0px));padding-block:calc(32px + var(--safe-area-inset-top,env(safe-area-inset-top,0px))) calc(28px + var(--safe-area-inset-bottom,env(safe-area-inset-bottom,0px)));--minitool-row-gap:20px;--minitool-column-gap:20px;grid-gap:20px;gap:20px}.narration-screen .story-text{font-size:18px;line-height:1.9;letter-spacing:.4px}.narration-screen .modal-header h2{font-size:24px}}
@media(max-height:600px){.narration-screen.adventure-sheet{padding-block:calc(10px + var(--safe-area-inset-top,0px)) calc(10px + var(--safe-area-inset-bottom,0px));padding-top:calc(10px + var(--safe-area-inset-top,0px));padding-bottom:calc(10px + var(--safe-area-inset-bottom,0px));padding-block:calc(10px + var(--safe-area-inset-top,env(safe-area-inset-top,0px))) calc(10px + var(--safe-area-inset-bottom,env(safe-area-inset-bottom,0px)));--minitool-row-gap:8px;--minitool-column-gap:8px;grid-gap:8px;gap:8px}.narration-screen .modal-header{padding-bottom:4px}.narration-screen .story-content{padding-top:4px;padding-bottom:4px;padding-block:4px}.narration-footer{padding-top:8px}}
@media(max-width:360px){.narration-screen.adventure-sheet{padding-inline:16px 16px;padding-left:16px;padding-right:16px;padding-inline:max(16px,var(--safe-area-inset-left,env(safe-area-inset-left,0px))) max(16px,var(--safe-area-inset-right,env(safe-area-inset-right,0px)))}.narration-footer{--minitool-row-gap:10px;--minitool-column-gap:10px;grid-gap:10px;gap:10px}.narration-footer #next-story{min-width:116px;padding-left:12px;padding-right:12px;padding-inline:12px}.narration-screen .modal-header h2{font-size:19px;letter-spacing:1px}}

/* Prologue and ending: one illustrated chapter page that unfolds paragraph by paragraph. */
.chapter-screen .story-content{cursor:default}
.chapter-page{flex-shrink:0;display:flex;flex-direction:column;align-items:center;--minitool-row-gap:22px;--minitool-column-gap:22px;grid-gap:22px;gap:22px;width:100%;margin-top:auto;margin-bottom:auto;padding-bottom:4vh;padding-bottom:calc(var(--minitool-vh,1vh) * 4);padding-bottom:4dvh}
.chapter-art{margin:0;display:flex;justify-content:center;align-items:flex-end;flex-shrink:0;animation:chapter-unfold .7s ease-out both}
.chapter-scene{display:block;width:216px;max-width:62vw;height:auto}
.chapter-cast{display:flex;align-items:flex-end;justify-content:center;--minitool-row-gap:2px;--minitool-column-gap:2px;grid-gap:2px;gap:2px;padding:0 16px 3px;border-bottom:2px solid #6c795f;border-radius:0 0 40% 40%/0 0 5px 5px}
.chapter-cast>img,.chapter-cast>canvas{display:block;width:auto;height:104px}
.narration-screen .chapter-text{width:100%;max-width:30em;margin:0 auto;white-space:normal}
.chapter-paragraph{margin:0 0 .85em;text-wrap:pretty;transition:opacity .7s ease,transform .7s ease,visibility 0s}
.chapter-paragraph:last-child{margin-bottom:0}
.chapter-keep{white-space:nowrap}
.chapter-paragraph:last-child:not(:first-child){margin-top:1.35em;text-align:center;text-wrap:balance;color:#55624a}
.chapter-paragraph.is-pending{opacity:0;visibility:hidden;transform:translateY(6px);transition:none}
.chapter-progress{display:flex;align-items:center;--minitool-row-gap:7px;--minitool-column-gap:7px;grid-gap:7px;gap:7px;margin:0;padding:0 0 0 2px;list-style:none}
.chapter-progress[hidden]{display:none}
.chapter-progress li{width:8px;height:8px;border:1.5px solid #9aa58a;border-radius:50%;transition:background-color .3s,border-color .3s}
.chapter-progress li.is-read{background:#5f6f50;border-color:#5f6f50}
@keyframes chapter-unfold{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}
@media(min-width:600px) and (min-height:600px){.chapter-scene{width:260px}.chapter-cast>img,.chapter-cast>canvas{height:128px}}
@media(max-height:600px){.chapter-page{--minitool-row-gap:14px;--minitool-column-gap:14px;grid-gap:14px;gap:14px;padding-bottom:0}.chapter-scene{width:168px}.chapter-cast>img,.chapter-cast>canvas{height:76px}}
@media(max-height:460px) and (min-width:520px){.chapter-page{flex-direction:row;align-items:center;--minitool-row-gap:24px;--minitool-column-gap:24px;grid-gap:24px;gap:24px}.chapter-art{position:-webkit-sticky;position:sticky;top:0;align-self:flex-start;width:32%;max-width:200px;padding-top:6px}.chapter-scene{width:100%;max-width:none}.chapter-cast>img,.chapter-cast>canvas{height:68px}.narration-screen .chapter-text{flex:1;min-width:0}}
@media(prefers-reduced-motion:reduce){.chapter-art{animation:none}.chapter-paragraph,.chapter-progress li{transition:none}}
