@font-face{font-family:DotGothic16;src:url('./fonts/DotGothic16.woff') format('woff');font-display:swap}
:root{color-scheme:dark;--night:#241a28;--navy:#382637;--panel:#4a3142;--line:#b77e91;--paper:#fff0d8;--ink:#382438;--orange:#ffb36d;--gold:#ffd38c;--shadow:#130f1b;--outer:#170f1c;--grid:#322236;--muted:#d6b8c4;--subtle:#bca0ae;--hover:#ffe0bb;--disabled:#594454;--disabled-ink:#c7b8c1;--disabled-edge:#816b7b;--inset:#2c1e2d;--evidence:#883a49;--positive:#57715e;--selected:#ffdfb2;--selected-edge:#b65d70;--rose:#f4b5c3;--retry:#c9b5cc}
*{box-sizing:border-box}html{min-height:100%;background:var(--outer)}body{margin:0;color:var(--paper);font-family:DotGothic16,monospace;line-height:1.65;background:repeating-linear-gradient(0deg,transparent 0 31px,var(--grid) 31px 32px),repeating-linear-gradient(90deg,var(--night) 0 31px,var(--grid) 31px 32px)}button,input,a{font:inherit}button,a{touch-action:manipulation;-webkit-tap-highlight-color:transparent}button,a.primary,.menu-stack>a,.dialog-footer>a{display:flex;align-items:center;justify-content:center;gap:8px;min-height:48px;padding:9px 12px;border:2px solid var(--line);box-shadow:inset 0 0 0 2px var(--navy),3px 3px 0 var(--shadow);background:var(--paper);color:var(--ink);text-decoration:none;cursor:pointer;font-weight:700;line-height:1.45;border-radius:0}button:hover,a.primary:hover,.menu-stack>a:hover{background:var(--hover)}button:focus-visible,a:focus-visible,summary:focus-visible,input:focus-visible{outline:3px solid var(--gold);outline-offset:4px}button:disabled{background:var(--disabled);color:var(--disabled-ink);border-color:var(--disabled-edge);cursor:default;box-shadow:inset 0 0 0 2px var(--inset)}.primary{background:var(--orange)!important;border-color:var(--paper)!important;color:var(--night)!important}button.primary:disabled{background:var(--disabled)!important;color:var(--disabled-ink)!important;border-color:var(--disabled-edge)!important}a{color:var(--gold)}h1,h2,h3,p,figure{margin:0}h1,h2{font-size:clamp(20px,5.4vw,26px);line-height:1.5}p{overflow-wrap:anywhere}[hidden]{display:none!important}.small{font-size:12px;line-height:1.7}.muted{color:var(--muted)}.eyebrow{font-size:12px;letter-spacing:.07em;color:var(--gold);margin-bottom:6px}.speaker{font-size:13px;color:var(--gold);margin-bottom:6px}.panel{border:2px solid var(--line);box-shadow:inset 0 0 0 2px var(--inset);background:var(--navy);padding:16px}#game-shell{width:min(100%,480px);margin:0 auto;min-height:100dvh;background:var(--night);border-left:3px solid var(--line);border-right:3px solid var(--line);box-shadow:0 0 0 5px var(--shadow)}.screen{min-height:100dvh;padding:env(safe-area-inset-top) 12px calc(16px + env(safe-area-inset-bottom));position:relative}.topbar{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:10px 2px;border-bottom:2px solid var(--line);min-height:68px}.topbar p{font-size:16px}.topbar .small{font-size:12px;color:var(--gold)}button.compact{min-width:48px;padding:8px}.art-region{position:relative;background:var(--navy);overflow:hidden}.scene{display:block;width:100%;height:100%;object-fit:contain;image-rendering:pixelated}.menu-stack{display:grid;gap:8px}.menu-stack>button,.menu-stack>a{text-align:left;justify-content:flex-start}.title-screen{padding:0 0 calc(16px + env(safe-area-inset-bottom))}.title-picture{aspect-ratio:10/9}.title-picture>.scene{object-fit:cover;object-position:50% 18%}.title-picture h1{position:absolute;bottom:8px;left:6%;width:88%;text-align:center;text-shadow:2px 2px var(--night)}#title-logo{display:block;width:100%;max-height:140px;object-fit:contain;image-rendering:pixelated}#title-heading:not([data-ready=true]) #title-logo{visibility:hidden}#title-heading[data-ready=true] .logo-fallback{display:none}.logo-fallback{position:absolute;bottom:8px;left:0;width:100%;color:var(--paper);background:#382637e6;padding:8px;font-size:clamp(22px,7vw,32px);line-height:1.4}.title-menu{padding:16px 20px 0;border-top:3px solid var(--line)}.title-hook{font-size:19px;margin:4px 0 16px}.title-menu .small{margin-top:14px}.title-menu .eyebrow{font-size:11px}.title-menu .menu-stack{grid-template-columns:1fr 1fr}.title-menu .primary{grid-column:1/-1}.title-menu .menu-stack>button,.title-menu .menu-stack>a{justify-content:center}.story-screen{display:flex;flex-direction:column}.story-art{aspect-ratio:10/7;margin:12px 0}.story-dialogue{display:flex;flex-direction:column;flex:1;min-height:230px}.story-copy{font-size:17px;line-height:1.85;white-space:pre-line}.story-footer{margin-top:auto;padding-top:18px;display:flex;align-items:center;justify-content:space-between;gap:12px}.story-footer button{min-width:120px}.story-tip{text-align:center;color:var(--subtle);padding-top:10px}.objective{display:flex;align-items:flex-start;gap:8px;background:var(--paper);color:var(--ink);padding:10px 12px;margin:10px 0;border:2px solid var(--line);font-size:14px}.objective>span{color:var(--evidence)}.location-art{aspect-ratio:10/6.4;border:2px solid var(--line)}.location-art>.scene{object-fit:cover;object-position:50% 42%}.location-caption{position:absolute;top:8px;left:8px;background:var(--night);font-size:11px;padding:2px 8px;border:1px solid var(--line)}.rico-line{display:flex;align-items:center;padding:8px 12px 8px 4px;gap:10px;min-height:96px;margin-top:8px}.rico-line>img{width:72px;height:78px;object-fit:contain;image-rendering:pixelated}.rico-line .speaker{margin-bottom:0}.rico-line p:last-child{font-size:14px}.section-caption{font-size:12px;color:var(--gold);margin:10px 0 6px}.investigation-actions .menu-stack button{justify-content:space-between;font-size:15px}.action-check{font-size:12px;color:var(--positive)}.action-unread{font-size:12px;color:var(--evidence)}#bottom-nav{display:grid;grid-template-columns:1fr 1fr 1.25fr;gap:8px;margin-top:14px;padding-bottom:4px}#bottom-nav button{min-height:58px;font-size:14px;flex-wrap:wrap;gap:4px}#deduce-open-btn small{display:block;width:100%;font-size:10px;line-height:1}#deduce-open-btn.ready{background:var(--orange);border-color:var(--paper);box-shadow:inset 0 0 0 2px var(--selected-edge),0 0 0 2px var(--gold),0 0 12px #f4b5c344}#progress-dots{display:flex;gap:4px;margin-left:auto}#progress-dots span{width:10px;height:10px;border:2px solid var(--paper)}#progress-dots .done{background:var(--rose)}#progress-dots .current{background:var(--orange);border-color:var(--gold)}.save-strip{color:var(--subtle);min-height:20px;padding-top:7px}dialog{width:min(94vw,450px);max-height:calc(100dvh - 32px - env(safe-area-inset-top) - env(safe-area-inset-bottom));padding:0;color:var(--paper);background:var(--night);border:3px solid var(--line);box-shadow:0 0 0 4px var(--shadow),inset 0 0 0 2px var(--panel);overflow:auto}dialog::backdrop{background:#170f1cdd}dialog[open]{display:flex;flex-direction:column}.dialog-heading{padding:16px;border-bottom:2px solid var(--line);flex:none;background:var(--navy)}.dialog-heading .small{margin-top:8px}.dialog-body{padding:16px;overflow:auto;min-height:0}.dialog-body>p+*{margin-top:14px}.dialog-footer{display:grid;gap:8px;padding:12px 16px calc(16px + env(safe-area-inset-bottom));border-top:2px solid var(--line);background:var(--navy);flex:none}.dialog-footer>button,.dialog-footer>a{width:100%}.record-art{aspect-ratio:10/7;margin-bottom:14px;border:2px solid var(--line)}.record-body{white-space:pre-line;line-height:1.95}.record-source{font-size:12px;color:var(--muted);margin-bottom:10px}mark{color:var(--gold);background:none;text-decoration:underline;text-underline-offset:4px}.record-card{border:2px solid var(--line);padding:14px;margin-bottom:14px;background:var(--panel)}.record-card h3{font-size:16px;color:var(--paper);margin-bottom:6px}.record-card .record-source{font-size:11px}.record-card p:last-child{font-size:14px;white-space:pre-line}.question{padding:12px;background:var(--paper);color:var(--ink);margin-bottom:20px;font-size:16px}fieldset{border:0;padding:0;margin:0 0 20px;min-width:0}legend{font-size:14px;color:var(--gold);margin-bottom:8px}fieldset>button{width:100%;text-align:left;justify-content:flex-start;margin:0 0 8px;font-size:14px;font-weight:400}fieldset>button[aria-checked=true]{border-color:var(--gold);background:var(--selected);box-shadow:inset 0 0 0 2px var(--selected-edge),3px 3px 0 var(--shadow)}.statement-speaker{display:block;font-size:11px;color:var(--evidence)}.option-copy{display:block}.evidence-option{display:block!important}.evidence-option span{display:block}.evidence-option small{display:block;font-size:11px;font-weight:400;line-height:1.7;margin-top:5px}details{border:1px solid var(--line);padding:10px;font-size:13px}summary{cursor:pointer;min-height:28px}details>p{margin-top:10px}.volume-label{display:flex;justify-content:space-between;margin-top:20px}input[type=range]{width:100%;min-height:48px;accent-color:var(--orange)}#audio-mute,#save-retry-btn,#restart-btn{width:100%;margin-top:14px}.help{padding-left:22px;margin:0 0 14px}.help li{padding:5px 0}.image-fallback{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:16px;background:var(--navy);font-size:12px;gap:10px}.image-fallback button{font-size:12px}.result-screen .result-art{aspect-ratio:10/7;margin:12px 0}.result-copy{text-align:center}.result-copy h1{font-size:30px;color:var(--gold)}.result-score{margin:10px 0 18px}.result-score strong{color:var(--orange);font-size:26px}.result-copy .small{margin:14px 0}.result-copy .menu-stack{margin-top:20px}.result-copy .menu-stack>*{justify-content:center}.noscript{padding:24px}
@media(min-width:700px){#game-shell{margin:20px auto;min-height:calc(100dvh - 40px)}.screen{min-height:calc(100dvh - 40px);padding-left:18px;padding-right:18px}.title-screen{padding-left:0;padding-right:0}.title-picture{aspect-ratio:10/8}.story-art{max-height:350px}.story-dialogue{min-height:210px}.location-art{aspect-ratio:10/5.7}}@media(max-width:350px){.screen{padding-left:8px;padding-right:8px}.title-screen{padding-left:0;padding-right:0}.title-menu{padding-left:14px;padding-right:14px}.story-copy{font-size:16px}.rico-line p:last-child{font-size:13px}.dialog-body,.dialog-heading{padding:12px}.dialog-footer{padding-left:12px;padding-right:12px}.topbar p{font-size:14px}#progress-dots{gap:3px}#progress-dots span{width:8px;height:8px}}@media(max-height:500px) and (orientation:landscape){#game-shell{max-width:820px;width:100%;margin:0}.screen{min-height:100dvh}.title-screen{display:grid;grid-template-columns:1fr 1fr}.title-picture{aspect-ratio:auto;min-height:100dvh}.title-menu{border-top:0;border-left:2px solid var(--line);padding:12px 16px}.title-hook{font-size:16px;margin-bottom:10px}.title-menu .eyebrow{font-size:10px}.title-menu .small{font-size:10px;margin-top:8px}.title-menu .menu-stack{gap:6px}.story-screen{display:grid;grid-template-columns:1fr 1fr;gap:10px;align-content:start}.story-screen>.topbar{grid-column:1/-1;min-height:54px}.story-art{margin:0;aspect-ratio:10/7;align-self:start}.story-dialogue{min-height:210px;height:100%;padding:12px}.story-copy{font-size:15px}.story-tip{grid-column:1/-1}.play-screen{display:grid;grid-template-columns:1fr 1fr;gap:8px 12px;align-content:start}.play-screen>.topbar,.play-screen>.objective,.play-screen>#bottom-nav,.play-screen>.save-strip{grid-column:1/-1}.play-screen>.objective{margin:0}.location-art{grid-column:1;aspect-ratio:10/6.5}.rico-line{grid-column:1;margin:0;min-height:82px}.investigation-actions{grid-column:2;grid-row:3/5}.section-caption{margin-top:0}#bottom-nav{margin-top:0}.save-strip{padding:0}.result-screen .result-art{max-height:250px}dialog{max-height:calc(100dvh - 24px);width:min(94vw,600px)}}
@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important;animation:none!important;transition:none!important}}

/* Conditions are reading content, not secondary labels. */
.evidence-option small:last-child{font-size:13px;line-height:1.85}.evidence-option mark{color:var(--evidence)}.title-picture{aspect-ratio:10/7}.title-picture>.scene{object-fit:contain}.title-picture h1{bottom:0}.title-picture #title-logo{max-height:114px}

/* Portrait title fills the game viewport without stretching the scene. */
.title-screen{display:flex;flex-direction:column;min-height:100dvh}.title-picture{flex:1 0 auto;min-height:300px;aspect-ratio:auto}.title-picture>.scene{position:absolute;inset:0;object-fit:cover;object-position:50% 42%}.title-menu{flex:none}.title-picture h1{bottom:12px}.title-picture #title-logo{max-height:136px}
@media(min-width:700px){.title-screen{min-height:calc(100dvh - 40px)}.title-picture{min-height:390px}}
@media(max-height:500px) and (orientation:landscape){.title-screen{display:grid;grid-template-columns:1fr 1fr}.title-picture{min-height:100dvh}.title-picture #title-logo{max-height:104px}.title-menu{min-height:100dvh}.title-picture>.scene{object-position:50% 40%}}

/* Reading content may scroll; the principal investigation controls stay visible. */
.title-picture,.title-menu{min-width:0}
.play-screen{height:100dvh;min-height:0;display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:auto auto minmax(0,1fr) auto auto;gap:0}
.play-screen>.topbar,.play-screen>.objective,.play-screen>#bottom-nav,.play-screen>.save-strip{grid-column:1}
#investigation-content{min-height:0;overflow:auto;overscroll-behavior:contain;scrollbar-width:thin;padding-bottom:4px}
#bottom-nav{margin-top:8px;padding-top:6px;border-top:2px solid var(--line);background:var(--night)}
@media(max-height:720px) and (orientation:portrait){.play-screen>.topbar{min-height:60px;padding:6px 2px}.play-screen>.objective{font-size:12px;padding:8px;margin:6px 0}.location-art{height:clamp(100px,22dvh,155px);aspect-ratio:auto}.location-art>.scene{object-position:50% 30%}.rico-line{min-height:64px;padding:4px 8px 4px 2px;gap:8px;margin-top:6px}.rico-line>img{height:52px;width:48px}.rico-line .speaker{font-size:11px}.rico-line p:last-child{font-size:12px;line-height:1.5}.section-caption{margin:6px 0 4px;font-size:11px}#bottom-nav{margin-top:4px;padding-top:4px}#bottom-nav button{min-height:52px}.save-strip{font-size:10px;line-height:1.4;min-height:17px;padding-top:3px}.investigation-actions .menu-stack{gap:6px}.investigation-actions .menu-stack button{font-size:13px}}
@media(max-height:500px) and (orientation:landscape){.play-screen{grid-template-columns:minmax(0,1fr);grid-template-rows:auto auto minmax(0,1fr) auto auto;gap:0;padding-bottom:calc(8px + env(safe-area-inset-bottom))}.play-screen>.topbar{min-height:48px;padding:3px 2px}.play-screen>.objective{margin:4px 0;font-size:12px;padding:6px 10px}.play-screen>#investigation-content{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);grid-template-rows:minmax(90px,1fr) auto;gap:6px 12px}.location-art{grid-column:1;grid-row:1;height:100%;min-height:90px;aspect-ratio:auto}.location-art>.scene{object-position:50% 30%}.rico-line{grid-column:1;grid-row:2;min-height:52px;padding:2px 6px;gap:6px;margin:0}.rico-line>img{width:40px;height:44px}.rico-line .speaker{font-size:10px}.rico-line p:last-child{font-size:11px;line-height:1.5}.investigation-actions{grid-column:2;grid-row:1/3}.section-caption{font-size:11px;margin:0 0 4px}.investigation-actions .menu-stack{gap:6px}.investigation-actions .menu-stack button{font-size:13px;padding:6px 10px}#bottom-nav{padding-top:4px;margin-top:4px;gap:10px}#bottom-nav button{min-height:48px;padding:5px 12px}#deduce-open-btn small{display:inline;width:auto}.save-strip{font-size:10px;line-height:1.4;min-height:14px;padding:0}.title-picture{min-width:0}.title-menu{min-width:0}}

/* The case file may scroll, while sharing and returning remain in reach. */
.result-screen{height:100dvh;min-height:0;display:grid;grid-template-rows:auto clamp(100px,28dvh,240px) minmax(0,1fr);gap:10px}
.result-screen .result-art{height:100%;aspect-ratio:auto;margin:0}.result-art>.scene{object-fit:contain}
.result-copy{min-height:0;display:flex;flex-direction:column;padding:12px}
.result-summary{min-height:0;overflow:auto;flex:1;overscroll-behavior:contain}
.result-copy .menu-stack{flex:none;grid-template-columns:1fr 1fr;margin-top:12px}
.result-copy #share-link,.result-copy #result-portal-link{grid-column:1/-1}
.result-copy .menu-stack>button{font-size:12px;padding:6px}
.result-copy #share-status{flex:none;margin:7px 0 0;font-size:10px;line-height:1.5}
@media(max-height:500px) and (orientation:landscape){.result-screen{grid-template-columns:minmax(0,1fr) minmax(0,1fr);grid-template-rows:auto minmax(0,1fr);gap:8px 12px;padding-bottom:calc(10px + env(safe-area-inset-bottom))}.result-screen>.topbar{grid-column:1/-1;min-height:48px;padding:4px}.result-screen .result-art{grid-column:1;grid-row:2;max-height:none}.result-screen .result-copy{grid-column:2;grid-row:2}.result-copy .menu-stack{margin-top:8px;gap:6px}.result-copy .menu-stack>*{min-height:48px}.result-copy h1{font-size:25px}.result-copy .result-score{margin:5px 0 10px}.result-copy .result-score strong{font-size:22px}}
@media(max-height:700px) and (orientation:portrait){.title-screen:has(#continue-btn:not([hidden])) .title-hook{display:none}.title-screen:has(#continue-btn:not([hidden])) .title-menu{padding-top:12px}}
@media(min-width:700px) and (min-height:501px){.play-screen,.result-screen{height:calc(100dvh - 40px)}}

/* Shared Saku cinematic geometry; Rico keeps her own rose/cream colors and art. */
#deduction-dialog{max-width:calc(100vw - env(safe-area-inset-left,0px) - env(safe-area-inset-right,0px) - 32px);--deduction-accent:var(--rose);--deduction-ink:var(--paper);--deduction-deep:#62374c;width:min(1080px,calc(100vw - env(safe-area-inset-left,0px) - env(safe-area-inset-right,0px) - 32px));height:min(680px,calc(100dvh - env(safe-area-inset-top,0px) - env(safe-area-inset-bottom,0px) - 32px));max-height:none;border:3px solid var(--deduction-accent);outline:2px solid var(--panel);background:var(--night);box-shadow:inset 0 0 0 3px var(--shadow),0 6px 0 var(--shadow);overflow:hidden;isolation:isolate}
#deduction-dialog[open]{display:grid;grid-template-rows:minmax(0,1fr)}
#deduction-dialog::backdrop{background:#170f1ced}
#deduction-dialog[data-outcome=wrong]{--deduction-accent:var(--retry);--deduction-deep:#44364f;border-color:var(--retry)}
#deduction-result{display:grid;grid-template-rows:minmax(0,1fr) auto;min-height:0;height:100%;overflow:hidden}
.deduction-stage{position:relative;display:grid;grid-template-columns:minmax(0,.95fr) minmax(0,1.05fr);align-items:stretch;gap:28px;min-width:0;min-height:0;padding:28px 36px 20px;overflow:hidden;background:linear-gradient(132deg,transparent 0 19%,#b77e9133 19% 20%,transparent 20% 37%,#b77e9122 37% 38%,transparent 38% 100%)}
.deduction-stage::before{content:'';position:absolute;inset:14% 0 14%;z-index:-1;background:var(--deduction-deep);clip-path:polygon(0 17%,100% 0,100% 83%,0 100%)}
.deduction-stage::after{content:'';position:absolute;inset:-8%;z-index:2;background:var(--deduction-accent);clip-path:polygon(0 0,18% 0,84% 100%,66% 100%);transform:translateX(125%);pointer-events:none;opacity:.6}
#deduction-dialog[data-phase=result][open] .deduction-stage::after{animation:deduction-wipe 160ms steps(4,end) both}
.verdict-art{position:relative;min-width:0;min-height:0;align-self:stretch;overflow:hidden;background:transparent}
#verdict-image{position:absolute;inset:0;width:100%;height:100%;max-width:100%;max-height:100%;object-fit:contain;object-position:center bottom;image-rendering:pixelated;filter:drop-shadow(5px 5px 0 var(--shadow))}
#deduction-dialog[data-phase=result][open] #verdict-image{animation:deduction-art-in 160ms steps(4,end) both}
.deduction-copy{position:relative;min-width:0;min-height:0;display:flex;flex-direction:column;justify-content:center;gap:16px;align-self:stretch;padding:20px 0;overflow:visible}
#verdict-kicker{flex:0 0 auto;color:var(--deduction-accent);font-size:13px;line-height:1.5;letter-spacing:.25em;margin:0}
#deduction-title{flex:0 0 auto;margin:0;font-size:clamp(24px,4vw,44px);line-height:1.35;font-weight:400;letter-spacing:.045em;color:var(--deduction-ink);text-shadow:3px 3px var(--shadow);overflow-wrap:anywhere}
#verdict-text{flex:0 1 auto;min-height:0;max-height:46%;overflow:auto;overscroll-behavior:contain;font-size:18px;line-height:1.9;white-space:pre-line;color:var(--paper);scrollbar-width:thin;scrollbar-color:var(--deduction-accent) var(--night);margin:0}
.deduction-footer{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:16px 28px 20px;border-top:3px solid var(--deduction-accent);background:var(--inset);min-width:0;z-index:3}
.deduction-footer-mark{font-size:16px;letter-spacing:.22em;color:var(--deduction-accent);white-space:nowrap}
#deduction-continue{flex:0 1 360px;min-width:0;min-height:56px;font-size:16px}
#deduction-dialog[data-outcome=wrong] #deduction-continue{background:var(--retry)!important;border-color:var(--paper)!important;color:var(--ink)!important}
@keyframes deduction-wipe{from{transform:translateX(-125%)}to{transform:translateX(125%)}}
@keyframes deduction-art-in{from{transform:translateX(-18px);opacity:.35}to{transform:translateX(0);opacity:1}}
#deduction-focus{position:relative;display:grid;grid-template-columns:minmax(0,1fr);align-content:center;gap:16px;width:100%;height:100%;min-height:0;padding:24px 0;overflow:hidden;text-align:center;color:var(--paper);font-weight:400;border:0;box-shadow:none;background:linear-gradient(135deg,var(--night) 0 32%,var(--panel) 32% 34%,var(--night) 34% 68%,var(--panel) 68% 70%,var(--night) 70%);isolation:isolate}
#deduction-focus:active{translate:none}
.focus-kicker{font-size:14px;letter-spacing:.4em;color:var(--rose)}
.deduction-focus-band{position:relative;display:block;min-width:0;height:clamp(110px,26dvh,216px);overflow:hidden;border-block:4px solid var(--rose);background:repeating-linear-gradient(0deg,var(--navy) 0 10px,var(--panel) 10px 12px);box-shadow:0 6px 0 var(--shadow);animation:focus-band-in 160ms steps(4,end) both}
/* Her portrait has a larger head in its native composition: 3x preserves its
   square pixels and matches Saku's 4x close-up head size, without warping. */
#focus-image{position:absolute;width:480px;height:480px;max-width:none;left:calc(50% - 220px);top:calc(50% - 198px);object-fit:contain;image-rendering:pixelated;filter:drop-shadow(8px 0 0 var(--shadow))}
.focus-title{font-size:clamp(28px,6vw,48px);line-height:1.4;min-height:1.4em;text-shadow:3px 3px var(--shadow);padding:0 16px;background:none;color:var(--paper);font-weight:400}
.focus-hint{font-size:11px;color:var(--muted);letter-spacing:.08em}
@keyframes focus-band-in{from{transform:translateX(-24px);opacity:.35}to{transform:translateX(0);opacity:1}}
@media(orientation:portrait){.deduction-stage{grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(80px,1.1fr) minmax(0,1fr);gap:8px;padding:16px 18px 12px}.deduction-stage::before{inset:6% 0 37%}.deduction-copy{padding:0;justify-content:flex-start;gap:8px}#verdict-kicker{font-size:11px;line-height:1.4}#deduction-title{font-size:clamp(22px,7vw,34px);line-height:1.3}#verdict-text{flex:1 1 auto;max-height:none;font-size:15px;line-height:1.7}.deduction-footer{padding:12px 16px 16px;gap:8px}.deduction-footer-mark{display:none}#deduction-continue{flex:1 1 auto;min-height:48px;width:100%;font-size:14px}}
@media(orientation:portrait) and (max-height:460px){.deduction-stage{grid-template-rows:minmax(72px,.9fr) minmax(0,1fr);padding:10px 12px 8px;gap:6px}.deduction-copy{gap:6px}#verdict-kicker{font-size:10px}#deduction-title{font-size:23px;line-height:1.25}#verdict-text{font-size:14px;line-height:1.6}.deduction-footer{padding:10px 12px 14px}}
@media(orientation:landscape) and (max-height:500px){.deduction-stage{grid-template-columns:minmax(0,.8fr) minmax(0,1.2fr);gap:20px;padding:10px 24px 8px}.deduction-copy{padding:0;justify-content:center;gap:8px}#verdict-kicker{font-size:11px;line-height:1.4}#deduction-title{font-size:clamp(22px,4vw,32px);line-height:1.25}#verdict-text{font-size:14px;line-height:1.65;max-height:42%}.deduction-footer{padding:10px 20px 14px}#deduction-continue{min-height:48px;font-size:14px;flex-basis:340px}}
@media(orientation:landscape) and (max-height:480px){#deduction-focus{gap:10px;padding:12px 0}.focus-kicker{font-size:12px}.focus-title{font-size:30px}.focus-hint{font-size:10px}}
@media(prefers-reduced-motion:reduce){.deduction-focus-band,#deduction-dialog[data-phase=result][open] #verdict-image,#deduction-dialog[data-phase=result][open] .deduction-stage::after{animation:none}.deduction-stage::after{display:none}}

/* Keep a Japanese phrase together; only the comma becomes a wrap point. */
.verdict-title-phrase{display:inline-block;white-space:nowrap}


/* Shared PC presentation: Saku's reviewed 1120/800 frame, Rico's own colors
   and tap investigation. Portrait phones and compact landscape retain their
   existing controls; the approved full-viewport deduction cinematic is intact. */
@media (min-width:960px) and (min-height:501px) and (orientation:landscape){
 html,body{height:100dvh;min-height:0}
 body{display:grid;place-items:center;padding:12px;overflow:hidden}
 #game-shell{position:relative;width:min(100%,1120px);height:min(800px,calc(100dvh - 24px));min-height:0;margin:0;overflow:hidden;border:3px solid var(--line);outline:2px solid var(--panel);outline-offset:2px;isolation:isolate}
 .screen{height:100%;min-height:0;padding:16px}
 #game-shell:has(>#title-screen:not([hidden])){height:auto;max-height:calc(100dvh - 24px)}
 .title-screen{display:grid;grid-template-columns:minmax(0,1.25fr) minmax(280px,1fr);grid-template-rows:minmax(0,1fr);gap:20px;padding:20px;height:auto;max-height:calc(100dvh - 30px);align-items:stretch}
 .title-picture{min-width:0;min-height:0;aspect-ratio:10/7;align-self:center;height:auto;overflow:hidden}
 .title-picture>.scene{position:absolute;inset:0;object-fit:cover;object-position:50% 20%}
 .title-picture h1{left:17.5%;bottom:0;width:65%;height:35.714285714%;display:grid;place-items:center;margin:0;pointer-events:none}
 .title-picture #title-logo{width:100%;height:100%;max-height:none;object-fit:contain}
 .title-picture .logo-fallback{font-size:clamp(24px,3vw,38px);bottom:0;line-height:1.35}
 .title-menu{display:flex;flex-direction:column;justify-content:center;gap:14px;min-height:0;overflow:auto;border:2px solid var(--line);background:var(--navy);padding:18px}
 .title-menu .eyebrow,.title-menu .small{margin:0;font-size:11px}
 .title-hook{font-size:19px;line-height:1.7;margin:0}
 .title-menu .menu-stack{grid-template-columns:1fr;gap:8px}
 .title-menu .menu-stack>*{grid-column:1;min-height:48px;font-size:14px}
 .story-screen{display:grid;grid-template-columns:minmax(0,1.25fr) minmax(280px,1fr);grid-template-rows:52px minmax(0,1fr) 18px;gap:16px}
 .story-screen>.topbar{grid-column:1/-1;min-height:0;padding:0 2px 8px}
 .story-art{grid-column:1;grid-row:2;aspect-ratio:auto;height:100%;max-height:none;margin:0;background:transparent}
 .story-art>.scene{object-fit:contain}
 .story-dialogue{grid-column:2;grid-row:2;height:100%;min-height:0;padding:18px}
 .story-copy{flex:1;min-height:0;overflow:auto;overscroll-behavior:contain;font-size:16px;line-height:1.8}
 .story-footer{flex:none;gap:12px;padding-top:16px;min-height:64px}
 .story-footer button{min-height:48px}
 .story-tip{grid-column:1/-1;padding:0;font-size:11px;line-height:18px}
 .play-screen{height:100%;grid-template-rows:52px auto minmax(0,1fr) 64px 18px;gap:8px;padding:12px}
 .play-screen>.topbar{min-height:0;padding:0 2px 6px}
 .play-screen>.objective{margin:0;font-size:14px;padding:9px 12px}
 #investigation-content{display:grid;grid-template-columns:minmax(0,1.65fr) minmax(280px,1fr);grid-template-rows:minmax(0,1fr) 112px;gap:12px 16px;overflow:hidden;padding:0}
 .location-art{grid-column:1;grid-row:1;height:100%;min-height:0;aspect-ratio:auto}
 .location-art>.scene{object-fit:contain;object-position:center}
 .rico-line{grid-column:1;grid-row:2;height:100%;min-height:0;margin:0;padding:8px 14px;overflow:auto}
 .rico-line>img{width:72px;height:78px;flex:none}
 .rico-line p:last-child{font-size:14px;line-height:1.8}
 .investigation-actions{grid-column:2;grid-row:1/3;min-height:0;overflow:auto;overscroll-behavior:contain;border:2px solid var(--line);padding:16px;background:var(--navy)}
 .section-caption{margin:0 0 12px;font-size:14px}
 .investigation-actions .menu-stack{gap:10px}
 .investigation-actions .menu-stack button{min-height:56px;font-size:14px;padding:10px 12px}
 #bottom-nav{margin:0;padding-top:6px;gap:12px}
 #bottom-nav button{min-height:54px;font-size:14px}
 .save-strip{margin:0;padding:0;font-size:11px;line-height:18px}
 .result-screen{height:100%;grid-template-columns:minmax(0,1fr) minmax(320px,42%);grid-template-rows:52px minmax(0,1fr);gap:16px}
 .result-screen>.topbar{grid-column:1/-1;min-height:0;padding:0 2px 8px}
 .result-screen .result-art{grid-column:1;grid-row:2;height:100%;max-height:none;min-height:0;margin:0;background:transparent}
 .result-screen .result-copy{grid-column:2;grid-row:2;padding:18px;text-align:left}
 .result-copy h1{font-size:24px;line-height:1.5}
 .result-copy .menu-stack{grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
 .result-copy #share-link{grid-column:1/-1}
 .result-copy #result-portal-link{grid-column:auto}
 .result-copy .menu-stack>*{min-height:48px;font-size:12px;padding:8px 4px;text-align:center}
 .result-copy #share-status{font-size:11px;line-height:1.55}
 dialog:not(#deduction-dialog){width:min(620px,calc(100vw - 32px));max-width:calc(100vw - 32px);max-height:calc(100dvh - 32px)}
}

/* Compact reading uses an inner text scroller; Next and title actions remain
   inside the visible viewport instead of requiring page scrolling. */
@media (max-height:600px) and (orientation:portrait){
 html,body{height:100dvh;min-height:0}
 #game-shell{height:100dvh;min-height:0;max-height:100dvh;margin:0;overflow:hidden}
 .screen{min-height:0}
 .title-screen{height:100%;min-height:0;display:grid;grid-template-rows:minmax(0,1fr) auto;padding:0 0 env(safe-area-inset-bottom)}
 .title-picture{min-height:0;height:100%;aspect-ratio:auto;flex:none}
 .title-picture>.scene{object-fit:cover;object-position:50% 20%}
 .title-picture h1{bottom:8px}
 .title-picture #title-logo{max-height:clamp(56px,16dvh,96px)}
 .title-picture .logo-fallback{font-size:18px;line-height:1.35}
 .title-menu{display:flex;flex-direction:column;gap:8px;min-height:0;padding:10px 12px}
 .title-hook,.title-menu>.small{display:none}
 .title-menu .eyebrow{font-size:10px;line-height:1.6;margin:0}
 .title-menu .menu-stack{gap:8px}
 .story-screen{height:100%;min-height:0;display:grid;grid-template-rows:56px clamp(80px,30dvh,160px) minmax(0,1fr);gap:8px;padding:0 10px calc(12px + env(safe-area-inset-bottom))}
 .story-screen>.topbar{min-height:0;padding:0 2px 4px}
 .story-art{height:100%;min-height:0;max-height:none;aspect-ratio:auto;margin:0}
 .story-art>.scene{object-fit:contain}
 .story-dialogue{height:100%;min-height:0;overflow:hidden;padding:12px}
 .story-copy{flex:1;min-height:0;overflow:auto;overscroll-behavior:contain;font-size:16px;line-height:1.8}
 .story-footer{flex:none;min-height:48px;margin-top:8px;padding-top:0}
 .story-footer button{min-height:48px}
 .story-tip{display:none}
}
@media (max-height:420px) and (orientation:portrait){
 .title-picture>.scene{object-fit:contain;object-position:center}
}
@media (max-height:500px) and (orientation:landscape){
 html,body{height:100dvh;min-height:0}
 body{display:grid;place-items:center}
 #game-shell{height:100dvh;min-height:0;max-height:100dvh;margin:0;overflow:hidden}
 .screen{min-height:0}
 .title-screen{height:100%;min-height:0;grid-template-rows:minmax(0,1fr);padding:0}
 .title-picture{height:100%;min-height:0}
 .title-menu{height:100%;min-height:0;overflow:auto}
 .story-screen{height:100%;min-height:0;grid-template-rows:48px minmax(0,1fr);padding:8px 12px;gap:8px 12px}
 .story-screen>.topbar{grid-column:1/-1;min-height:0;padding:0 2px}
 .story-art{grid-column:1;grid-row:2;height:100%;max-height:none;min-height:0;margin:0;aspect-ratio:auto}
 .story-dialogue{grid-column:2;grid-row:2;height:100%;min-height:0;overflow:hidden;padding:12px}
 .story-copy{flex:1;min-height:0;overflow:auto;overscroll-behavior:contain}
 .story-footer{flex:none;min-height:48px;margin-top:8px;padding-top:0}
 .story-tip{display:none}
}

/* Keep the result and its four actions visible on compact portrait screens. */
@media (max-height:700px) and (orientation:portrait){
 .result-screen{grid-template-rows:48px clamp(68px,18dvh,120px) minmax(0,1fr);gap:8px}
 .result-screen>.topbar{min-height:48px;padding:4px 0}
 .result-screen .result-copy{padding:10px}
 .result-copy .menu-stack{grid-template-columns:repeat(3,minmax(0,1fr));margin-top:8px;gap:8px}
 .result-copy #result-portal-link{grid-column:auto}
 .result-summary>.eyebrow{display:none}
 .result-copy h1{font-size:24px;line-height:1.4}
 .result-copy .result-score{font-size:12px;line-height:1.4;margin:4px 0 8px}
 .result-copy .result-score strong{font-size:20px}
 .result-copy .menu-stack>*{min-height:48px;font-size:11px;padding:4px}
}
