:root{--bg:#07090b;--fg:#eee9df;--sub:#9ca3aa;--edge:rgba(214,225,229,.21);font-family:"Hiragino Kaku Gothic ProN","Yu Gothic",Meiryo,system-ui,sans-serif;color-scheme:dark}*{box-sizing:border-box}html,body{margin:0;width:100%;height:100%;overflow:hidden;background:#07090b;color:var(--fg);overscroll-behavior:none}button{font:inherit;cursor:pointer;-webkit-tap-highlight-color:transparent}button:focus-visible{outline:2px solid #e7eaee;outline-offset:3px}#game{position:relative;width:100%;height:100dvh;min-height:320px;overflow:hidden;isolation:isolate;touch-action:manipulation;background:#050709}#world{position:absolute;inset:0;width:100%;height:100%;display:block;touch-action:none}#vignette,#grain,#hurt,#whiteout{position:absolute;inset:0;pointer-events:none}#vignette{background:radial-gradient(ellipse 67% 57% at 50% 44%,transparent 10%,rgba(0,0,0,.13) 65%,rgba(0,0,0,.68) 100%);z-index:2}#grain{opacity:.10;z-index:3;background-image:url("data:image/svg+xml,%3Csvg viewBox='0 0 150 150' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.92' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.65'/%3E%3C/svg%3E");background-size:180px 180px}#hurt{z-index:4;opacity:0;background:radial-gradient(ellipse at center,transparent 25%,rgba(135,12,15,.8) 100%);transition:opacity .3s}#whiteout{z-index:4;opacity:0;background:rgba(231,238,238,.88);transition:opacity .2s}.hidden{display:none!important}#hud{position:absolute;z-index:7;left:0;right:0;top:0;padding:calc(15px + env(safe-area-inset-top)) max(16px,env(safe-area-inset-right)) 0 max(16px,env(safe-area-inset-left));display:flex;justify-content:space-between;align-items:flex-start;pointer-events:none}.hud-mark{display:flex;flex-direction:column;gap:3px;text-shadow:0 2px 12px #000}.hud-tiny,.eyebrow{font-size:10px;letter-spacing:.2em;color:#9da8ad}.hud-mark>#zoneName{font-weight:600;font-size:14px;letter-spacing:.08em}.icon-button{background:rgba(4,7,10,.75);border:1px solid var(--edge);border-radius:12px;min-width:78px;color:#d6dbdf;padding:10px 12px;display:flex;flex-direction:column;align-items:center;gap:4px;pointer-events:auto}.icon-button span{font-size:22px;line-height:23px}.icon-button small{font-size:9px;letter-spacing:.13em}.icon-button.on{border-color:#e1e7e2;box-shadow:inset 0 0 18px rgba(227,230,218,.16);color:#fff}#narration{position:absolute;bottom:calc(195px + env(safe-area-inset-bottom));left:50%;transform:translateX(-50%);width:min(90%,530px);padding:12px 15px;text-align:center;background:rgba(5,8,10,.86);border:1px solid rgba(219,228,232,.15);z-index:8;font-size:clamp(12px,2.8vw,15px);line-height:1.7;letter-spacing:.06em;pointer-events:none;animation:fadeup .25s}@keyframes fadeup{from{opacity:0;transform:translate(-50%,10px)}to{opacity:1;transform:translate(-50%,0)}}#breathWarning{position:absolute;top:23%;left:0;right:0;text-align:center;color:#f1eee9;font-size:17px;letter-spacing:.2em;z-index:9;text-shadow:0 2px 8px black;pointer-events:none}#controls{position:absolute;z-index:7;left:0;right:0;bottom:calc(33px + env(safe-area-inset-bottom));height:163px;display:flex;justify-content:center;align-items:center;pointer-events:none}#controlNotes{position:absolute;left:max(10px,env(safe-area-inset-left));top:0;font-size:10px;line-height:1.9;color:#b1bcc3;display:flex;flex-direction:column;letter-spacing:.06em}#stick{position:absolute;bottom:16px;width:118px;height:118px;border-radius:50%;background:radial-gradient(circle,rgba(57,67,76,.58),rgba(6,10,15,.79) 80%);border:1px solid rgba(215,224,234,.26);box-shadow:0 4px 35px #0006;pointer-events:auto;touch-action:none;user-select:none}.stick-rim{position:absolute;inset:12px;border-radius:50%;border:1px solid rgba(190,199,203,.18)}.stick-axis-v{position:absolute;top:10px;bottom:10px;left:calc(50% - .5px);border-left:1px solid #67717c65}.stick-axis-h{position:absolute;top:calc(50% - .5px);left:10px;right:10px;border-top:1px solid #67717c65}#stickThumb{position:absolute;left:calc(50% - 19px);top:calc(50% - 19px);width:38px;height:38px;border-radius:50%;border:1px solid #cad1d3;background:radial-gradient(circle at 35% 30%,#e6ecec,#909da5 90%);box-shadow:0 1px 11px #000;will-change:transform}#speedTag{position:absolute;bottom:0;right:max(12px,env(safe-area-inset-right));font-size:10px;letter-spacing:.1em;color:#b3c0c6}.screen{position:absolute;inset:0;z-index:15;display:flex;flex-direction:column;background:linear-gradient(145deg,rgba(12,19,24,.94),rgba(3,4,6,.97));padding:calc(36px + env(safe-area-inset-top)) max(22px,env(safe-area-inset-right)) calc(42px + env(safe-area-inset-bottom)) max(22px,env(safe-area-inset-left))}#titleScreen{justify-content:space-between;background:radial-gradient(ellipse at 55% 38%,rgba(49,63,67,.4),transparent 53%),linear-gradient(#0e1418,#030405)}.title-top{font-size:11px;letter-spacing:.25em;color:#adb5b5}.title-main{margin:auto 0;max-width:610px}.title-main h1{font-size:clamp(36px,8.8vw,66px);font-weight:650;line-height:1.35;letter-spacing:.02em;margin:25px 0 22px;text-shadow:1px 3px 25px #000}.punct{color:#a9afb1}.title-main p{font-size:14px;color:#c5c7c5;line-height:2.2;letter-spacing:.12em}.title-actions{display:grid;gap:10px;width:min(100%,490px)}.primary,.secondary{border-radius:3px;border:1px solid #d2d5d3;min-height:50px;padding:11px 17px;text-align:left;display:flex;align-items:center;justify-content:space-between;font-size:14px;font-weight:600;letter-spacing:.08em}.primary{color:#11171c;background:#e1e2dd}.secondary{color:#dee1df;background:#09101499;border-color:#66747d}.primary:active,.secondary:active{transform:scale(.99)}.title-footer{font-size:9px;color:#899397;letter-spacing:.12em;margin-top:24px}.title-footer span{padding:0 7px}#intro{justify-content:center;align-items:center;background:#050607}#introCopy{font-size:clamp(19px,4.2vw,28px);line-height:2;text-align:center;white-space:pre-line;letter-spacing:.15em;max-width:90%}.tap-continue{position:absolute;bottom:calc(53px + env(safe-area-inset-bottom));border:0;background:none;color:#aab4b9;font-size:13px;letter-spacing:.08em}#context{position:absolute;z-index:10;bottom:calc(210px + env(safe-area-inset-bottom));left:50%;transform:translateX(-50%);width:min(92vw,420px);padding:15px;border:1px solid #63747b;background:rgba(7,11,14,.95);box-shadow:0 10px 30px #000b}#contextTitle{font-size:13px;margin-bottom:12px;letter-spacing:.1em;text-align:center}#contextButtons{display:grid;gap:9px}#contextButtons button{border:1px solid #71828a;background:#172128;color:#f3f1ec;border-radius:2px;padding:12px 13px;text-align:left;font-size:13px}#contextButtons button:active{background:#334149}#interaction{position:absolute;z-index:11;bottom:calc(215px + env(safe-area-inset-bottom));left:50%;transform:translateX(-50%);background:rgba(6,9,12,.95);border:1px solid #66767d;padding:18px 18px 12px;width:min(92vw,430px);text-align:center}.inter-label{font-weight:650;letter-spacing:.12em;font-size:16px}#interHint{font-size:12px;color:#b2babf;margin:11px 0 19px}#interTrack{height:60px;border:1px solid #59666c;position:relative;background:#11191e;touch-action:none;user-select:none}#interFill{height:100%;width:0;background:linear-gradient(90deg,#384b58,#6a828d5b);pointer-events:none}#interHandle{position:absolute;width:66px;height:52px;left:3px;top:3px;display:flex;align-items:center;justify-content:center;background:#afbbc0;color:#101c24;font-weight:900;touch-action:none;cursor:ew-resize}button.link-button{background:none;border:none;color:#bfc5c8;text-align:center;padding:12px 10px;align-self:center;font-size:12px;text-decoration:underline;text-underline-offset:4px}.panel-screen{overflow:hidden;background:#0b1013}.panel-head{display:flex;justify-content:space-between;align-items:start;gap:12px;border-bottom:1px solid #445057;padding-bottom:18px}.panel-head h2{margin:7px 0 0;font-size:25px}.square-close{width:42px;height:42px;border:1px solid #5d6970;background:#162029;color:#e7ebec;border-radius:3px;font-size:24px}.book-list{overflow:auto;flex:1;margin:15px 0 8px;padding:0 2px;-webkit-overflow-scrolling:touch}.book-entry{padding:15px 3px;border-bottom:1px solid #374148;display:flex;align-items:start;justify-content:space-between;gap:12px}.book-entry small{color:#98a8af;font-size:10px;letter-spacing:.13em}.book-entry b{font-weight:650;display:block;margin-top:5px;font-size:15px}.book-entry p{font-size:12px;color:#b7bec0;line-height:1.6;margin:7px 0 0}.book-entry.locked{opacity:.52}.book-badge{font-size:10px;color:#acb4b9;white-space:nowrap}.book-foot{font-size:11px;color:#8e989d}.help-body{overflow:auto;flex:1;padding:18px 3px 6px;line-height:1.9;font-size:14px}.help-body p{margin:0 0 24px}.help-body b{font-size:15px}.help-body .muted{font-size:11px;color:#9da7ac}#result{align-items:center;justify-content:center;background:radial-gradient(ellipse at center,#1d1c1d,#050607 76%);overflow-y:auto}.result-shell{width:min(100%,490px);margin:auto;display:flex;flex-direction:column;gap:10px}.result-kicker{font-size:12px;color:#c0a2a2;letter-spacing:.4em}.result-number{font-size:13px;letter-spacing:.2em;color:#a2adb2;margin-top:18px}.result-shell h2{font-size:clamp(32px,7vw,50px);margin:2px 0 10px;font-weight:600}.result-shell p{font-size:14px;color:#ced2d0;line-height:2;min-height:64px;white-space:pre-line}.result-progress{display:flex;justify-content:space-between;color:#adb4b5;border-block:1px solid #394248;padding:15px 0;font-size:12px;margin-bottom:16px}#falseClear{background:linear-gradient(140deg,#dee5e5,#a7bdc0);color:#1d3036;justify-content:center;align-items:center;text-align:center;z-index:18}.clear-kicker{font-size:11px;letter-spacing:.2em}.clear-check{font-size:85px;margin:27px 0 8px}#falseClear h2{font-size:35px;margin:0}#falseClear p{letter-spacing:.35em;font-size:12px}#shareMsg{position:absolute;z-index:30;bottom:calc(42px + env(safe-area-inset-bottom));left:50%;transform:translateX(-50%);width:min(90%,440px);padding:15px;background:#1e2b30;border:1px solid #829098;text-align:center;font-size:12px;line-height:1.7}#debug{position:absolute;top:calc(88px + env(safe-area-inset-top));right:10px;z-index:26;background:#0a0e10f2;border:1px solid #a1a9a8;color:#fff;width:235px;padding:10px;max-height:65vh;overflow:auto;font:12px monospace}#debug .debug-bar{display:flex;justify-content:space-between}#debug select,#debug button{background:#21313c;color:#fff;border:1px solid #546674;min-height:30px;margin:4px 0;width:100%}#debugState{line-height:1.6;white-space:pre-wrap}#debug .debug-bar button{width:30px}@media(min-width:700px){#controls{bottom:26px}#narration{bottom:220px}#context,#interaction{bottom:224px}#stick{width:128px;height:128px}#titleScreen{padding-inline:max(40px,calc((100vw - 900px)/2))}}@media(max-height:600px){#controls{height:130px;bottom:calc(12px + env(safe-area-inset-bottom))}#stick{width:92px;height:92px;bottom:12px}#controlNotes{font-size:9px}#narration,#context,#interaction{bottom:calc(143px + env(safe-area-inset-bottom))}#titleScreen{padding-top:calc(15px + env(safe-area-inset-top));padding-bottom:calc(18px + env(safe-area-inset-bottom))}.title-main h1{font-size:clamp(27px,6vh,50px);margin:12px 0}.title-main p{line-height:1.5}.primary,.secondary{min-height:40px}.title-actions{gap:5px}.title-footer{margin-top:9px}.panel-screen{padding-top:calc(15px + env(safe-area-inset-top))}.help-body{font-size:12px}}
#butterfly3d{position:absolute;z-index:5;left:50%;top:40%;width:32px;height:26px;display:none;align-items:center;justify-content:center;filter:drop-shadow(0 0 9px #f7fbfff0);pointer-events:none;transform-origin:center}#butterfly3d.visible{display:flex}#butterfly3d .wing{width:14px;height:21px;background:linear-gradient(140deg,#f9fcff,#b8d0d9);border-radius:80% 20% 67% 30%;animation:wing .26s infinite alternate}#butterfly3d .wing.right{transform:scaleX(-1);animation-delay:-.13s}#butterfly3d .body{height:18px;width:3px;background:#e7f2f7;border-radius:40%}@keyframes wing{from{transform:scaleX(.6) rotate(-24deg)}to{transform:scaleX(1) rotate(12deg)}}@media(prefers-reduced-motion:reduce){#butterfly3d .wing{animation:none}*{scroll-behavior:auto!important}}

/* v1.2 画面上の進路選択を視認しやすくする。縦・横ともタップ範囲を確保 */
#context{bottom:calc(202px + env(safe-area-inset-bottom));width:min(94vw,490px);padding:14px 16px 16px;border-radius:9px;box-shadow:0 0 0 1px #b3c0c044,0 18px 35px #000c}
#contextTitle{font-size:clamp(12px,2.8vw,15px);font-weight:600;line-height:1.65;margin-bottom:11px;}
#contextButtons{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
#contextButtons button{min-height:70px;border-radius:7px;text-align:center;font-size:clamp(12px,2.7vw,15px);line-height:1.55;font-weight:650;touch-action:manipulation;}
#contextButtons button:active{transform:scale(.98)}
#trueOutro{overflow:hidden;align-items:center;justify-content:center;background:#191c1b;padding:0;}
.dawn-sky{position:absolute;inset:0;background:linear-gradient(180deg,#48515b 0%,#777e82 28%,#b4a69a 57%,#9d8173 78%,#363c3e 100%);}
.dawn-horizon{position:absolute;bottom:17%;width:100%;height:19%;background:linear-gradient(0deg,#2e3638,#687073);clip-path:polygon(0 51%,19% 47%,26% 38%,43% 38%,43% 46%,58% 46%,69% 29%,85% 29%,85% 42%,100% 39%,100% 100%,0 100%)}
.dawn-road{position:absolute;bottom:0;left:0;right:0;height:22%;background:linear-gradient(180deg,#46474b,#292f35)}
.dawn-road::before{content:'';position:absolute;left:44%;bottom:14%;width:24%;height:2px;background:#bcbab5;opacity:.32;transform:perspective(50px) rotateX(14deg)}
.dawn-wall{position:absolute;inset:0 0 13% 37%;background:repeating-linear-gradient(0deg,transparent 0,transparent 50px,#58636a35 51px,#58636a35 52px),linear-gradient(125deg,#7a7774,#565656 85%);clip-path:polygon(36% 0,100% 0,100% 100%,0 100%);transition:transform 1.1s ease,filter 1.1s ease}
.dawn-hatch{position:absolute;left:35%;top:49%;width:52%;max-width:290px;height:18%;min-height:95px;background:#090c10;border:9px solid #353c42;box-shadow:0 0 0 3px #8b8f8e80,12px 15px 30px #0009;overflow:hidden}
.dawn-hatch-inner{position:absolute;inset:0;background:radial-gradient(ellipse at 50% 58%,#15202b,#06070b 72%);}
.outro-eye{position:absolute;top:49%;width:10px;height:6px;border-radius:80% 80% 50% 50%;background:#b3bac0;box-shadow:0 0 11px #c3ced6aa;opacity:0;transition:opacity 1.25s ease}
.outro-eye.e1{left:39%}.outro-eye.e2{left:59%}
.dawn-bars{position:absolute;inset:0;pointer-events:none;background:repeating-linear-gradient(90deg,transparent 0,transparent 27px,#4d555a 28px,#4d555a 33px,transparent 34px);box-shadow:inset 0 0 16px #000}
#trueOutro.turned .dawn-wall{transform:translateX(-15%) scale(1.12)}
#trueOutro.eyes-open .outro-eye{opacity:1;animation:outroEyes 1.7s ease-in-out infinite alternate}
@keyframes outroEyes{from{filter:brightness(.7)}to{filter:brightness(1.25)}}
.outro-line{position:absolute;bottom:calc(13% + env(safe-area-inset-bottom));left:16px;right:16px;text-align:center;color:#f9f6f2;font-size:clamp(17px,4.8vw,25px);text-shadow:0 2px 12px #000;letter-spacing:.19em;white-space:pre-line;min-height:2em;}
@media(max-height:600px){#context{bottom:calc(136px + env(safe-area-inset-bottom));padding:9px 12px}#contextButtons button{min-height:48px}#contextTitle{margin-bottom:7px}}
@media(max-width:360px){#contextButtons button{font-size:11px;padding:8px 5px}#context{bottom:calc(180px + env(safe-area-inset-bottom))}}
@media(prefers-reduced-motion:reduce){.dawn-wall,.outro-eye{transition:none!important}.outro-eye{animation:none!important}}

/* v1.3: 追跡警告と左右肘のほふく前進。背景/画面操作との干渉なし */

#chaseIndicator{position:absolute;top:calc(86px + env(safe-area-inset-top));left:max(10px,env(safe-area-inset-left));z-index:8;width:min(47vw,180px);padding:7px 8px 7px;border:1px solid rgba(154,175,182,.43);border-left:2px solid #9baeb9;border-radius:5px;background:linear-gradient(120deg,rgba(5,9,13,.90),rgba(15,21,25,.80));box-shadow:0 4px 22px #0008;color:#eef0ef;pointer-events:none;transition:border-color .2s,background .2s;}
.chase-heading{display:flex;align-items:center;gap:6px;font-size:clamp(9px,2.4vw,10px);letter-spacing:.02em;font-weight:650;color:#c7d1d6;white-space:nowrap;}
.chase-eye-pair{width:22px;display:flex;gap:4px;align-items:center;justify-content:center;flex:none;}
.chase-eye-pair i{height:4px;width:6px;background:#d1dde4;border-radius:70% 70% 45% 45%;box-shadow:0 0 6px #f2f7fb80;}
.chase-readings{display:grid;grid-template-columns:1fr 1fr;align-items:end;gap:4px;margin:5px 0 4px;}
.chase-readings-single{grid-template-columns:1fr;}
.chase-readings>div{display:flex;flex-direction:row;align-items:baseline;gap:7px;min-width:0;}
.chase-caption{color:#9daab1;font-size:9px;white-space:nowrap;}
.chase-readings strong{font-size:clamp(17px,4.4vw,20px);font-weight:700;line-height:1.2;font-variant-numeric:tabular-nums;white-space:nowrap;}
.chase-readings strong span{font-size:9px;margin-left:2px;font-weight:500;color:#b7c6cb;}
.chase-track{height:4px;background:#3b454b;overflow:hidden;border-radius:9px;}
#chaseFill{height:100%;width:15%;background:#a1c2cf;transition:width .20s linear,background-color .2s;}
.chase-foot{display:none;}
#chaseIndicator.warn{border-left-color:#c9a874;}.warn #chaseFill{background:#d4a86a;}
#chaseIndicator.danger{border-left-color:#e27878;background:linear-gradient(120deg,rgba(25,8,11,.92),rgba(18,13,14,.90));animation:chaseBeat .62s ease-in-out infinite alternate;}.danger #chaseFill{background:#de6e73;}
#chaseIndicator.danger .chase-eye-pair i{background:#fff1ed;box-shadow:0 0 12px #ffb1a6;}
@keyframes chaseBeat{from{box-shadow:0 4px 22px #0008;}to{box-shadow:0 0 18px #a330345d;}}
@media(max-width:400px){#chaseIndicator{top:calc(83px + env(safe-area-inset-top));padding:6px 7px;}.chase-heading{font-size:9px;}}
@media(max-height:600px){#chaseIndicator{top:calc(62px + env(safe-area-inset-top));width:min(47vw,180px);padding:5px 7px;}.chase-readings{margin:4px 0;}}
@media(prefers-reduced-motion:reduce){#chaseIndicator.danger{animation:none;}}

/* v1.5: Intro guidance fades after learning; never hides controls or captions. */
#controlNotes{transition:opacity .75s ease}#controlNotes.compact{opacity:.12}
@media(prefers-reduced-motion:reduce){#controlNotes{transition:none}}

/* v1.7 | Optimized photo cutouts, flexible result stills */
.result-art{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;object-position:center center;opacity:.80;filter:brightness(.63) saturate(.80);pointer-events:none;z-index:0}
#result:before{content:"";position:absolute;inset:0;background:linear-gradient(180deg,#030508aa 0%,#05080a4d 40%,#020305b8 100%);z-index:1;pointer-events:none}
#result .result-shell{position:relative;z-index:2;background:rgba(6,9,12,.75);border:1px solid rgba(198,210,214,.23);border-radius:7px;padding:20px;box-shadow:0 18px 40px #0007}
#trueOutro .dawn-sky{background-image:linear-gradient(0deg,#1119,#1110 55%),url("assets/images/G08_true_outro.webp");background-size:cover;background-position:72% 50%}
#trueOutro .dawn-horizon,#trueOutro .dawn-road{opacity:.13}
#trueOutro .dawn-wall{background:linear-gradient(125deg,#70675e33,#1d222266 85%)}
#butterfly3d{width:38px;height:36px;background-size:contain;background-repeat:no-repeat;background-position:center;filter:drop-shadow(0 0 3px rgba(238,243,244,.65));}
@media(max-height:600px){#result .result-shell{padding:12px 16px}}
@media(max-width:430px){#result .result-shell{padding:16px}}
@media(prefers-reduced-motion:reduce){#outroEyesReal{transition:none}}

/* Scene test panel: shown only with ?debug=1 and opened using a compact toggle. */
#debugOpen{position:absolute;z-index:27;right:max(10px,env(safe-area-inset-right));bottom:calc(12px + env(safe-area-inset-bottom));background:rgba(14,23,28,.94);border:1px solid #98a8ac;border-radius:7px;color:#e5e7e5;font:600 11px/1.3 system-ui,sans-serif;letter-spacing:.05em;padding:10px 12px;min-height:42px;min-width:88px;box-shadow:0 6px 18px #0009;touch-action:manipulation}
#debugOpen span{font-weight:400;color:#afbdc2}
#debug{top:calc(10px + env(safe-area-inset-top));right:max(10px,env(safe-area-inset-right));width:min(320px,calc(100vw - 20px));max-height:min(83dvh,660px);overflow-y:auto;overscroll-behavior:contain;z-index:28;border-radius:9px;padding:12px;background:rgba(8,13,17,.97);box-shadow:0 10px 28px #000c}
#debug .debug-bar{align-items:center;gap:10px;margin-bottom:10px}
#debug .debug-bar button{margin:0;width:40px;min-height:40px;font-size:20px;flex:none}
#debug label{display:block;margin-top:10px;margin-bottom:4px;color:#c3cdd0;font:600 12px/1.5 system-ui,sans-serif}
#debug select{font:12px/1.45 system-ui,sans-serif;min-height:44px;margin:0 0 4px;background:#19262c;border-radius:4px;padding:6px 7px}
#debug>button{font:600 12px/1.4 system-ui,sans-serif;min-height:43px;border-radius:4px;margin:4px 0 7px}
#debug .debug-danger{color:#f1d0ca;border-color:#b46f66;background:#332126}
#debugState{padding:10px 7px;background:#101a20;border:1px solid #31404a;border-radius:4px;margin:9px 0;font:11px/1.5 ui-monospace,monospace;white-space:pre-wrap;color:#cfdbde}
#debug .debug-note{font:11px/1.6 system-ui,sans-serif;color:#9aa8ac;margin:9px 1px 2px}
#resultShare:disabled{opacity:.62;cursor:wait}
@media(max-height:600px){#debug{max-height:85dvh}}

/* Landscape / iPad Split View: keep the first END line reachable when the panel is taller than the view. */
@media (max-height:600px) and (min-width:600px){#result{justify-content:flex-start}#result .result-shell{margin:0 auto;flex-shrink:0}}

/* 開始時の全面タイトルをスキップ。ゲーム中は小さな機能メニューから記録・操作説明へ。 */
.hud-actions{display:flex;align-items:flex-start;gap:8px;pointer-events:auto}
#quickMenuBtn.menu-icon{min-width:50px;padding:10px 9px;min-height:64px}
#quickMenuBtn.menu-icon span{font-size:20px;line-height:23px}
#quickMenu{position:absolute;right:max(12px,env(safe-area-inset-right));top:calc(92px + env(safe-area-inset-top));z-index:14;width:min(66vw,220px);padding:10px;border:1px solid rgba(171,187,195,.45);background:rgba(6,11,15,.96);box-shadow:0 10px 28px #0009;display:grid;gap:8px}
#quickMenu button{color:#e8eceb;background:#152027;border:1px solid #60717b;border-radius:3px;min-height:43px;padding:9px 12px;text-align:left;touch-action:manipulation}
#quickMenu button:active{background:#30404a}
@media(max-height:600px){#quickMenu{top:calc(71px + env(safe-area-inset-top));}#quickMenuBtn.menu-icon{min-height:50px;padding:6px 8px}}

/* Mobile portrait: keep explanatory text legible over the duct floor. */
@media (max-width:650px) and (min-height:500px) and (orientation:portrait){
 #controlNotes{top:-130px;font-size:11px;text-shadow:0 1px 3px #000}
}

/* Visible ending illustration – not a dark, cropped layer behind the dialog. */
#result{justify-content:flex-start;align-items:center;overflow-x:hidden;overflow-y:auto;-webkit-overflow-scrolling:touch;overscroll-behavior:contain;padding:calc(14px + env(safe-area-inset-top)) max(12px,env(safe-area-inset-right)) calc(20px + env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left))}
#result::before{display:none}
#result .result-shell{flex-shrink:0;margin:auto;max-width:520px;width:100%;background:rgba(9,13,17,.96);gap:7px;padding:14px;border:1px solid rgba(198,210,214,.20)}
#result .result-number{margin-top:1px}
.result-still-frame{padding:0;margin:2px 0 0;min-width:0;width:100%;}
.result-still-expand{display:block;width:100%;padding:0;margin:0;border:1px solid #657078;background:#05090d;border-radius:3px;cursor:zoom-in;overflow:hidden}
.result-art{display:block;position:static;inset:auto;width:100%;height:auto;aspect-ratio:16/9;object-fit:contain;object-position:center;opacity:1;filter:none;z-index:auto;pointer-events:auto;}
.result-art.still-load-error{min-height:140px}
.result-still-frame figcaption{min-height:16px;padding-top:3px;text-align:right;color:#a7b6ba;font-size:10px}
#result .result-shell h2{font-size:clamp(24px,6vw,35px);margin:2px 0 3px}
#result .result-shell p{font-size:13px;line-height:1.65;min-height:0;margin:3px 0}
#result .result-progress{padding:8px 0;margin:3px 0}
#result .result-shell .primary,#result .result-shell .secondary{min-height:42px;padding:8px 12px;font-size:12px}
#result .result-shell .link-button{padding:7px 10px}
@media(max-height:650px){#result .result-shell{margin:0 auto}#result .result-shell h2{font-size:23px}#result .result-still-frame figcaption{font-size:9px}}
/* Debug gallery and full-screen still magnifier. */
#debugGallery,#stillViewer{position:absolute;inset:0;z-index:29;overflow:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;background:#080d11;color:#eaece9;padding:calc(14px + env(safe-area-inset-top)) max(14px,env(safe-area-inset-right)) calc(26px + env(safe-area-inset-bottom)) max(14px,env(safe-area-inset-left));}
.still-gallery-top,.still-viewer-head{display:flex;justify-content:space-between;align-items:center;gap:12px;border-bottom:1px solid #495961;padding-bottom:12px}
.still-gallery-top small,.still-viewer-head small{font-size:10px;color:#a8b4bc;letter-spacing:.12em}
.still-gallery-top h2,.still-viewer-head h2{font-size:clamp(17px,4.5vw,25px);margin:6px 0 0;line-height:1.25}
.still-gallery-top button,.still-viewer-head button,.still-viewer-nav button{min-height:40px;border:1px solid #768891;background:#1a2931;color:#f4f4f0;border-radius:4px;padding:7px 12px;flex-shrink:0}
.still-gallery-note{font-size:12px;line-height:1.65;color:#bdc8cc;margin:15px 0 8px}
#debugGalleryStatus{font-size:12px;color:#d5dcdb;padding:8px 9px;background:#152128;border:1px solid #41545e;margin:0 0 15px}
.still-gallery-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;max-width:920px;margin:0 auto}
.still-gallery-item{text-align:left;min-width:0;background:#111a20;border:1px solid #43545c;color:#e3e6e5;border-radius:6px;padding:7px;overflow:hidden;touch-action:manipulation}
.still-gallery-item img{display:block;width:100%;aspect-ratio:16/9;object-fit:contain;background:#070b0e}
.still-gallery-item span{font-size:12px;display:block;line-height:1.5;margin-top:7px}
.still-gallery-item small{display:block;color:#9ebda9;margin-top:2px;font-size:10px}
.still-gallery-item small.still-error{color:#f2b2aa}
#stillViewer{z-index:31;display:flex;flex-direction:column;overflow:hidden;}
.still-viewer-picture{flex:1;min-height:0;display:flex;flex-direction:column;justify-content:center;align-items:center;margin:12px 0;gap:7px}
.still-viewer-picture img{display:block;width:100%;height:100%;max-height:100%;object-fit:contain;}
#stillViewerStatus{min-height:16px;color:#e9b2aa;font-size:12px;text-align:center;margin:0}
.still-viewer-nav{display:flex;justify-content:space-between;gap:12px;padding-bottom:3px}
@media(min-width:800px){.still-gallery-grid{grid-template-columns:repeat(3,minmax(0,1fr))}}

/* User-requested guidance: visible only for the first 10 seconds of actual play. */
#controlNotes.hidden{display:none!important;opacity:0!important;pointer-events:none!important}

/* Seven-tap ending text: keep text readable on phones without a long paragraph. */
#result .ending-text-panel{display:flex;gap:12px;justify-content:space-between;align-items:center;padding:9px 0 5px;border-top:1px solid #4a5459;}
#result .ending-step{font-size:12px;letter-spacing:.16em;color:#aebec8;font-variant-numeric:tabular-nums;white-space:nowrap;}
#result .ending-tap{min-height:44px;min-width:165px;padding:11px 15px;border:1px solid #cbd1d1;color:#eff2f0;background:#1a2a30;border-radius:5px;font-size:13px;font-weight:650;}
#result .ending-dialogue{margin:0;padding:12px 8px 16px;min-height:96px;font-size:clamp(17px,4.2vw,21px)!important;line-height:1.75!important;color:#f0f0eb!important;letter-spacing:.045em;}
#result #endingAllActions{display:flex;flex-direction:column;gap:9px;}
#result #endingAllActions.hidden{display:none!important;}
@media(max-width:380px){#result .ending-tap{min-width:145px;font-size:12px;}#result .ending-dialogue{font-size:16px!important;}}


/* Seven independent dialogue pages, then one physical shock, then the END result. */
#endingPrelude{z-index:19;justify-content:flex-end;align-items:center;background:rgba(0,0,0,.10);padding:calc(14px + env(safe-area-inset-top)) max(15px,env(safe-area-inset-right)) calc(34px + env(safe-area-inset-bottom)) max(15px,env(safe-area-inset-left));}
.ending-prelude-card{width:min(100%,510px);padding:18px 20px 15px;border:1px solid rgba(192,204,208,.50);background:rgba(6,10,14,.92);box-shadow:0 12px 32px #000a;}
.ending-prelude-step{color:#a9b9c2;font-size:12px;letter-spacing:.18em;font-variant-numeric:tabular-nums;}
.ending-prelude-dialogue{color:#f4f2ef;font-size:clamp(18px,4.9vw,23px);line-height:1.85;letter-spacing:.045em;white-space:pre-line;margin:11px 0 14px;min-height:3.7em;}
.ending-prelude-next{display:block;width:100%;min-height:49px;padding:12px;color:#ecf0f0;background:#1a2a30;border:1px solid #c5cfd2;border-radius:4px;font-size:14px;font-weight:650;text-align:center;touch-action:manipulation;}
@media(max-height:490px){#endingPrelude{padding-bottom:calc(10px + env(safe-area-inset-bottom));}.ending-prelude-card{padding:9px 13px;}.ending-prelude-dialogue{min-height:0;font-size:17px;line-height:1.55;margin:5px 0;}.ending-prelude-next{min-height:43px;}}
#game.ending-impact{animation:endingSingleCrash .25s ease-out both;}
@keyframes endingSingleCrash{
  0%{transform:translate3d(-24px,15px,0) rotate(-2deg) scale(1.09)}
  40%{transform:translate3d(-24px,15px,0) rotate(-2deg) scale(1.09)}
  100%{transform:translate3d(0,0,0) rotate(0) scale(1)}
}
@media(max-width:460px){@keyframes endingSingleCrash{
  0%,40%{transform:translate3d(-22px,13px,0) rotate(-2deg) scale(1.12)}
  100%{transform:translate3d(0,0,0) rotate(0deg) scale(1)}
}}
#trueOutro{position:absolute;inset:0;overflow:hidden;background:#07090b;isolation:isolate}
#trueOutro .outro-bg,#trueOutro .outro-darken,#outroLine{position:absolute}
#trueOutro .outro-bg{inset:0;background-size:cover;background-position:center center;transition:opacity .55s ease,filter .55s ease}
#trueOutro .outro-bg-sunrise{opacity:1;background-image:linear-gradient(180deg,rgba(10,12,14,.20),rgba(8,10,12,.48)),url("assets/images/G08_true_sunrise_pc.webp");filter:saturate(1.02) brightness(.96)}
#trueOutro .outro-bg-lookback{opacity:0;background-image:linear-gradient(180deg,rgba(3,4,5,.20),rgba(1,2,3,.52)),url("assets/images/G08_true_lookback_pc_revised.webp");filter:brightness(.82)}
#trueOutro .outro-darken{inset:0;background:linear-gradient(180deg,rgba(0,0,0,.13),rgba(0,0,0,.27));pointer-events:none;z-index:1}
#trueOutro.lookback .outro-bg-sunrise{opacity:0;filter:brightness(.35)}
#trueOutro.lookback .outro-bg-lookback{opacity:1;filter:brightness(.92)}
@media (max-width:700px) and (orientation:portrait){
  #trueOutro .outro-bg-sunrise{background-image:linear-gradient(180deg,rgba(10,12,14,.20),rgba(8,10,12,.48)),url("assets/images/G08_true_sunrise_mobile.webp");background-position:center center}
  #trueOutro .outro-bg-lookback{background-image:linear-gradient(180deg,rgba(3,4,5,.20),rgba(1,2,3,.58)),url("assets/images/G08_true_lookback_mobile_revised.webp");background-position:center center}
}
@media(prefers-reduced-motion:reduce){
 #game.ending-impact{animation:endingCrashReduced .25s ease-out both;}
 @keyframes endingCrashReduced{0%,40%{transform:translate3d(-4px,2px,0)}100%{transform:translate3d(0,0,0)}}
 #trueOutro .outro-bg{transition:none}
}


/* Debug inspection center: full-size, readable, tabs, safe-area aware. */
#debug{position:absolute;z-index:28;inset:calc(8px + env(safe-area-inset-top)) max(8px,env(safe-area-inset-right)) calc(8px + env(safe-area-inset-bottom)) max(8px,env(safe-area-inset-left));width:auto;max-height:none;display:flex;flex-direction:column;padding:0;border:1px solid #566871;border-radius:14px;background:rgba(7,12,16,.98);box-shadow:0 16px 55px #000e;overflow:hidden;font:14px/1.65 system-ui,"Yu Gothic",Meiryo,sans-serif;color:#e9edef}
@media(min-width:850px){#debug{width:min(790px,calc(100vw - 36px));left:auto;right:18px;top:18px;bottom:18px;}}
#debug .debug-bar{display:flex;align-items:center;justify-content:space-between;flex:none;min-height:67px;margin:0;padding:11px 16px;border-bottom:1px solid #364852;background:#111a20}
#debug .debug-bar div{display:flex;flex-direction:column;gap:1px}
#debug .debug-bar small{font:10px/1.4 ui-monospace,monospace;letter-spacing:.18em;color:#8da9b7}
#debug .debug-bar strong{font-size:16px;font-weight:700}
#debug .debug-bar button{height:44px;min-height:44px;width:44px;margin:0;border-radius:9px;font-size:24px}
#debug .debug-tabs{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:5px;flex:none;padding:10px 11px;background:#101920;border-bottom:1px solid #293943}
#debug .debug-tabs button{min-height:43px;width:auto;padding:8px 2px;margin:0;border:1px solid #3a515e;border-radius:8px;font-size:12px;font-weight:700;color:#b4c6cf;background:#17242c}
#debug .debug-tabs button.active{background:#dae7e9;color:#17252b;border-color:#f5ffff}
#debug .debug-body{flex:1;min-height:0;overflow-y:auto;padding:13px clamp(12px,3vw,24px) 28px;overscroll-behavior:contain;-webkit-overflow-scrolling:touch}
#debug .debug-pane{max-width:750px;margin:auto}
#debug .debug-pane h2{font-size:16px;line-height:1.5;margin:16px 0 5px;padding-bottom:8px;border-bottom:1px solid #374851}
#debug .debug-pane h2:first-child{margin-top:3px}
#debug .debug-sub{margin:5px 0 11px;color:#adbac0;font-size:12px;line-height:1.7}
#debug .debug-info{color:#98b4c0;font-size:12px;line-height:1.65;margin:8px 1px 13px}
#debug .debug-pane label{font-size:13px;margin:12px 0 5px}
#debug .debug-pane select,#debug .debug-pane input{width:100%;min-height:47px;margin:0 0 9px;border:1px solid #4d6672;border-radius:9px;background:#15252e;color:#f0f6f7;padding:8px 12px;font:14px/1.5 system-ui,sans-serif}
#debug .debug-pane button.debug-primary,#debug .debug-pane #debugMonster,#debug .debug-pane #debugReset{width:100%;min-height:48px;margin:5px 0 13px;border-radius:9px;font:700 13px/1.5 system-ui,sans-serif}
#debug .debug-pane button.debug-primary{background:#c7dbe1;color:#0b222c;border:1px solid #dceff3}
#debug .debug-pane button.debug-primary:hover{background:#e9f7f9}
#debug #debugState{white-space:pre-wrap;font:12px/1.8 ui-monospace,monospace;overflow-wrap:anywhere;padding:15px}
#debug .debug-danger-zone{padding:14px;background:#241c20;border:1px solid #68464b;border-radius:9px;margin:20px 0}
#debug .debug-danger-zone summary{cursor:pointer;font-weight:700;color:#f1bdb7}
#debug .debug-dialogue-toolbar{display:flex;gap:10px;justify-content:space-between;align-items:center;padding:10px 0;font-size:12px;color:#b9c9d2}
#debug #debugDialogueCopy{width:auto;min-height:37px;padding:6px 12px;border-radius:8px;margin:0;background:#263b46;color:#e9f1f5;border:1px solid #507080;flex:none}
#debug #debugDialogueCopy:disabled{opacity:.4}
#debug .debug-dialogue-list{display:grid;gap:13px}
#debug .debug-dialogue-card{background:#121f27;border:1px solid #35505d;border-radius:10px;padding:14px;overflow-wrap:anywhere}
#debug .debug-dialogue-card header{display:flex;flex-direction:column;gap:3px;padding-bottom:10px;border-bottom:1px solid #344854}
#debug .debug-dialogue-card h3{font-size:15px;line-height:1.5;margin:0;color:#e7f6fc}
#debug .debug-dialogue-card small{font-size:11px;color:#90a7b2;line-height:1.5}
#debug .debug-dialogue-card ol{list-style:decimal;list-style-position:outside;margin:11px 0 4px;padding:0 0 0 27px}
#debug .debug-dialogue-card li{white-space:pre-line;line-height:1.8;font-size:14px;margin:0 0 12px;padding:0 3px 9px;border-bottom:1px solid #243640}
#debug .debug-dialogue-card li:last-child{border-bottom:0;margin-bottom:0}
#debug .debug-dialogue-card li::marker{color:#8da5b3;font-size:11px}
#debug .debug-dialogue-card .debug-dialogue-play{width:100%;min-height:43px;margin:12px 0 0;padding:8px;border:1px solid #819ea9;border-radius:8px;background:#273f48;color:#eef3f3}
#debug .debug-note{flex:none;background:#0a141a;border-top:1px solid #293d48;padding:8px 14px;margin:0;font-size:10px;line-height:1.5;color:#7e9aa5}
@media(max-width:430px){#debug{border-radius:7px}#debug .debug-tabs{gap:3px;padding:8px}#debug .debug-tabs button{font-size:11px;padding:5px 0}#debug .debug-bar{min-height:60px}#debug .debug-dialogue-card{padding:12px}}
@media(max-height:450px){#debug .debug-bar{min-height:49px;padding:5px 12px}#debug .debug-tabs{padding:5px 8px}#debug .debug-tabs button{min-height:35px}#debug .debug-note{display:none}}

/* Minimum usable targets; no other layout change. */
#result .result-shell .primary,#result .result-shell .secondary{min-height:44px}
#debugOpen{min-height:44px}
@media(max-height:450px){#debug .debug-tabs button{min-height:42px}}

/* END01: uploaded portrait still on phones; do not letterbox it as a 16:9 image. */
#result .result-art.end01-portrait{aspect-ratio:9 / 16}
.still-gallery-item img.end01-portrait{aspect-ratio:9 / 16}

/* Portrait ending art: keep both END01 and TRUE END10 uncropped on phone. */
#result .result-art.ending-portrait,.still-gallery-item img.ending-portrait{aspect-ratio:9/16;object-fit:contain}

/* Every END result still remains a 16:9 landscape photograph on both screen orientations. */
#result .result-art,#result .result-art.ending-portrait,#result .result-art.end01-portrait,
.still-gallery-item img,.still-gallery-item img.ending-portrait,.still-gallery-item img.end01-portrait{aspect-ratio:16/9;object-fit:contain}
.debug-visual-list{display:grid;gap:12px;padding-bottom:15px}
.debug-visual-card{padding:12px;background:#121f27;border:1px solid #39515d;border-radius:8px;min-width:0}
.debug-visual-card h3{font-size:13px;color:#f1f8fa;margin:0 0 5px;line-height:1.6;overflow-wrap:anywhere}
.debug-visual-card p{font-size:11px;color:#a6bcc7;line-height:1.65;margin:0 0 10px;overflow-wrap:anywhere}
.debug-visual-variants{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.debug-visual-variant{display:flex;flex-direction:column;gap:6px;min-width:0;border:1px solid #334b55;padding:8px;border-radius:6px}
.debug-visual-variant strong{font-size:12px;color:#dce9ee}
.debug-visual-empty{color:#c9bcb0;background:#2b2425;border:1px dashed #74605d;padding:10px 5px;text-align:center;border-radius:4px;font-size:12px}
.debug-visual-asset{display:flex;flex-direction:column;gap:4px;min-width:0}
.debug-visual-asset span{overflow-wrap:anywhere;font-size:10px;color:#b1c1c6}
.debug-visual-asset small{font-size:10px;color:#a7cbbc}
.debug-visual-asset .still-error{color:#f3aaa4}
#debug .debug-visual-image-button{width:100%;min-height:45px;height:auto;margin:0;display:block;background:#060a0e;border:1px solid #566c77;border-radius:4px;padding:0;overflow:hidden}
.debug-visual-image-button img{width:100%;max-height:175px;object-fit:contain;display:block;background:#070a0b}
#debug .debug-visual-go{width:100%;min-height:44px;margin:12px 0 0;background:#253c46;border:1px solid #7b9cad;color:#f2f8f9;border-radius:6px}
#debugVisualPreview{position:absolute;inset:0;z-index:41;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;padding:max(14px,env(safe-area-inset-top)) max(14px,env(safe-area-inset-right)) max(14px,env(safe-area-inset-bottom)) max(14px,env(safe-area-inset-left));background:rgba(2,5,8,.97)}
#debugVisualPreview.hidden{display:none}
#debugVisualPreview header{width:100%;display:flex;align-items:center;justify-content:space-between;gap:10px;color:#f0f7f9;font-size:13px}
#debugVisualPreview button{min-height:44px;padding:7px 14px;background:#263c49;color:white;border:1px solid #93aebc}
#debugVisualPreview img{max-height:calc(100% - 105px);max-width:100%;object-fit:contain}
#debugVisualPreview p{font-size:12px;color:#b9cbcf}
@media(max-width:360px){.debug-visual-variants{gap:5px}.debug-visual-variant{padding:5px}}

/* END攻略案内: 既存4タブの視認性を落とさず5タブを収納。 */
#debug .debug-guide-list{display:grid;gap:12px;padding:0 0 15px}
#debug .debug-guide-card{background:#121f27;border:1px solid #3d5662;border-radius:10px;padding:14px;overflow-wrap:anywhere}
#debug .debug-guide-card h3{margin:0;color:#e8f4f6;font-size:15px;line-height:1.6}
#debug .debug-guide-type{margin:3px 0 9px;color:#adc5ce;font-size:11px;letter-spacing:.07em}
#debug .debug-guide-card ol{margin:8px 0 13px;padding:0 0 0 25px}
#debug .debug-guide-card li{font-size:13px;line-height:1.7;margin-bottom:9px;padding-left:3px;white-space:pre-line}
#debug .debug-guide-card li::marker{color:#a2c0c9;font-size:11px}
#debug .debug-guide-note{border-left:3px solid #7994a0;padding:7px 9px;background:#1b2b33;color:#c6d5d9;font-size:12px;line-height:1.7;margin:8px 0 12px}
#debug .debug-guide-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}
#debug .debug-guide-actions button{min-height:45px;margin:0;padding:7px 5px;border-radius:8px;border:1px solid #6c8996;background:#213843;color:#e8f2f4;font-size:12px;line-height:1.45;font-weight:700}
#debug .debug-guide-actions button:last-child{background:#c8dce2;color:#11232c;border-color:#e5f3f5}
@media(max-width:430px){#debug .debug-tabs{gap:3px}#debug .debug-tabs button{font-size:10px;letter-spacing:-.03em;padding:7px 0;min-height:45px}#debug .debug-guide-card{padding:12px}}
@media(max-width:340px){#debug .debug-guide-actions{grid-template-columns:minmax(0,1fr)}#debug .debug-guide-actions button{min-height:44px}}

/* Responsive photographs during END narration; the RESULT illustration remains landscape. */
#endingPrelude{isolation:isolate;overflow:hidden}
#endingPrelude .ending-stage-picture{position:absolute;inset:0;z-index:0;display:block;pointer-events:none}
#endingPrelude .ending-stage-picture img{display:block;width:100%;height:100%;object-fit:cover;object-position:center;filter:brightness(.78)}
#endingPrelude::before{content:"";position:absolute;inset:0;z-index:1;pointer-events:none;background:linear-gradient(to bottom,rgba(0,0,0,.04) 15%,rgba(0,0,0,.08) 52%,rgba(0,0,0,.37) 100%)}
#endingPrelude .ending-prelude-card{z-index:2;position:relative}
#endingPrelude.ending-stage-empty{background:#020304}
#endingPrelude.ending-stage-empty::before{background:rgba(0,0,0,.95)}
#endingPreludeNext:disabled{opacity:.76;cursor:wait}
.visually-hidden{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;overflow:hidden!important;clip-path:inset(50%)!important;white-space:nowrap!important;border:0!important}

/* Each actual image appears once in an END folder; tap image to navigate, separate zoom. */
.debug-image-end-group{border:1px solid #3d5560;background:#111f27;border-radius:10px;overflow:hidden}
.debug-image-end-group>summary{padding:14px 13px;font-weight:700;font-size:14px;cursor:pointer;line-height:1.5;min-height:47px;color:#eff6f8;list-style-position:inside}
.debug-image-end-group[open]>summary{border-bottom:1px solid #304550}
.debug-image-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;padding:9px}
.debug-image-entry{background:#162832;border:1px solid #354e5d;border-radius:8px;padding:7px;min-width:0;display:flex;flex-direction:column;gap:7px}
.debug-image-caption{font-size:11px;color:#dcecf1;overflow-wrap:anywhere;line-height:1.5;min-height:30px}
#debug .debug-image-tap{width:100%;padding:0;border:1px solid #587786;border-radius:5px;background:#090f14;min-height:54px;margin:0;overflow:hidden}
.debug-image-tap img{width:100%;height:134px;object-fit:contain;display:block}
.debug-image-status{font-size:10px;color:#aec4cd}
.debug-image-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:5px;margin-top:auto;align-items:center}
#debug .debug-image-actions button{margin:0;min-height:42px;background:#253c48;border:1px solid #708c99;color:#ecf6f9;border-radius:6px;padding:6px 3px;font-size:10px;line-height:1.3}
#debug .debug-image-actions button:last-child{background:#c8dce2;color:#142a34;font-weight:700}
.debug-image-actions small{font-size:10px;color:#94aab6;text-align:center}
.debug-image-other>h3{font-size:14px;color:#deeef3;padding:5px}
#debug .debug-missing-scene{display:block;width:calc(100% - 20px);margin:5px 10px;min-height:44px;text-align:left;border-radius:6px;background:#243843;border:1px solid #526977;padding:8px;color:#e6eff2;font-size:12px}
@media(max-width:359px){.debug-image-grid{gap:5px;padding:6px}.debug-image-entry{padding:5px}.debug-image-tap img{height:104px}}
/* Motion is optical and silent; final impact remains the existing single shake. */
#endingPrelude .ending-motion-picture{z-index:0;opacity:0;transition:opacity 1200ms ease-in-out;}
#endingPrelude.ending-motion-drift #endingStagePicture img{animation:endingSlowDrift 5.5s ease-out both}
#endingPrelude.ending-motion-reveal .ending-motion-picture{opacity:1}
#endingPrelude.ending-motion-reveal .ending-motion-picture img{animation:endingNearDrift 3.1s ease-out both}
#endingPrelude.ending-motion-done .ending-motion-picture{opacity:1;transition:none}
#endingPrelude[data-motion-end="2"].ending-motion-drift #endingStagePicture img{animation-name:endingPressure}
#endingPrelude[data-motion-end="7"].ending-motion-drift #endingStagePicture img{animation-name:endingFall}
#endingPrelude[data-motion-end="8"].ending-motion-reveal .ending-motion-picture{transition-duration:1500ms}
@keyframes endingSlowDrift{from{transform:scale(1)}to{transform:scale(1.075)}}
@keyframes endingNearDrift{from{transform:scale(1)}to{transform:scale(1.04)}}
@keyframes endingPressure{from{transform:scaleX(1)}to{transform:scaleX(1.12)}}
@keyframes endingFall{from{transform:translateY(0) rotate(0)}to{transform:translateY(-2.5%) rotate(-1.5deg) scale(1.05)}}
@media(prefers-reduced-motion:reduce){#endingPrelude .ending-motion-picture{transition-duration:.6s}#endingPrelude.ending-motion-drift #endingStagePicture img,#endingPrelude.ending-motion-reveal .ending-motion-picture img{animation:none}}

/* Mobile free-crawl monologue: keep transient subtitles out of the thumb's
   joystick area, without moving controls, branch choices, or ending dialogue. */
@media (max-width:650px) and (orientation:portrait){
  #narration{top:clamp(195px,32dvh,315px);bottom:auto;}
}
@media (max-width:950px) and (max-height:600px) and (orientation:landscape){
  #narration{top:clamp(70px,21dvh,100px);bottom:auto;left:72%;width:min(46vw,340px);}
}

/* Ending archive: locked contents remain genuinely hidden, never load artwork. */
#book .book-list{min-height:0;overflow-y:auto}
#book .book-entry{display:grid;grid-template-columns:minmax(96px,32%) minmax(0,1fr) auto;gap:12px;align-items:start;padding:15px 2px;border-bottom:1px solid #344148}
#book .book-picture{display:flex;align-items:center;justify-content:center;aspect-ratio:16/9;min-width:0;width:100%;margin:0;padding:0;background:#070b0f;border:1px solid #4c5b63;border-radius:3px;overflow:hidden;color:#849199}
#book button.book-picture{cursor:zoom-in}
#book button.book-picture:active{border-color:#e0e7e9}
#book .book-picture img{display:block;object-fit:cover;width:100%;height:100%}
#book .book-picture-secret{font:500 clamp(18px,5vw,25px) "Hiragino Mincho ProN","Yu Mincho",serif;letter-spacing:.15em;color:#87919b}
#book .book-entry.locked{opacity:1}
#book .book-entry.locked .book-details{opacity:.65}
#book .book-details{min-width:0}
#book .book-details b{font-family:"Hiragino Mincho ProN","Yu Mincho",serif;overflow-wrap:anywhere;font-size:14px}
#book .book-details p{white-space:pre-line;overflow-wrap:anywhere}
#book .book-secret-description{color:#8a959e;letter-spacing:.10em}
#book .book-badge{font-size:9px;margin-top:2px;color:#a6b5bd}
#book .book-foot{line-height:1.6}
#result .share-help{font-size:10px!important;line-height:1.5!important;color:#aebac0;margin:2px 0 6px!important}
#result .secondary:disabled{opacity:.58;cursor:wait}
@media(max-width:380px){#book .book-entry{grid-template-columns:92px minmax(0,1fr);gap:10px}#book .book-badge{grid-column:2;grid-row:2;margin:0}}

/* One-tap X composer and platform-safe image-sharing alternatives. */
#result .share-help{min-height:0!important;padding:2px 0!important;margin:1px 0 2px!important;font-size:11px!important;color:#b8c4c9!important;line-height:1.6!important}


/* Readability and subtle intro reveal; no extra popup over the game scene. */
#intro{background:rgba(3,6,9,var(--intro-alpha,.98));transition:background-color .7s ease;}
#intro .intro-progress{position:relative;text-align:center;color:#b6c0c6;font:400 clamp(10px,2.6vw,12px)/20px system-ui,sans-serif;letter-spacing:.10em;margin-bottom:clamp(14px,3.5dvh,30px);opacity:.57;text-shadow:none;}
#introCopy{font-size:clamp(22px,5.25vw,36px);line-height:1.75;letter-spacing:.065em;max-width:min(92%,680px);padding:clamp(10px,2.5vw,24px);background:radial-gradient(ellipse,rgba(1,3,5,.58),rgba(1,3,5,0) 73%);text-shadow:0 2px 12px #000,0 0 24px #000;overflow-wrap:anywhere;}
#introCopy.intro-enter{animation:introTextIn .24s ease-out;}
@keyframes introTextIn{from{opacity:.5;transform:translateY(4px)}to{opacity:1;transform:translateY(0)}}
#intro.intro-paused .intro-progress{display:none;}
#introNext.tap-continue{font-size:clamp(15px,3.6vw,18px);font-weight:600;min-height:48px;padding:12px 22px;letter-spacing:.06em;text-shadow:0 2px 10px #000;}
#narration{width:min(85%,460px);max-height:28dvh;padding:10px 12px;font-size:clamp(15px,3.15vw,18px);line-height:1.58;letter-spacing:.03em;}
/* Keep landscape narration beside, not beyond, the crawl controls. */
@media (max-width:950px) and (max-height:600px) and (orientation:landscape){#narration{width:min(46vw,340px);}}
#contextTitle{font-size:clamp(15px,3.1vw,18px);line-height:1.5;}
#contextButtons button{font-size:clamp(14px,3.0vw,17px);line-height:1.45;}
.inter-label{font-size:clamp(17px,3.5vw,20px);}
#interHint{font-size:clamp(14px,3vw,17px);}
#controlNotes{font-size:12px;line-height:1.7;}
#speedTag{font-size:12px;}
.hud-mark>#zoneName{font-size:clamp(15px,3vw,18px);}
.help-body{font-size:clamp(15px,3.2vw,17px);line-height:1.75;}
.help-body b{font-size:clamp(16px,3.5vw,19px);}
.help-body .muted{font-size:clamp(12px,2.8vw,14px);}
#book .book-details b{font-size:clamp(16px,3.5vw,19px);}
#book .book-details p{font-size:clamp(13px,2.9vw,15px);line-height:1.55;}
#result .ending-dialogue{font-size:clamp(19px,4.6vw,24px)!important;line-height:1.58!important;}
#result .result-shell .primary,#result .result-shell .secondary{font-size:clamp(14px,3.15vw,16px);min-height:46px;}
#result .result-shell p.share-help{font-size:clamp(12px,2.8vw,14px);}
@media(max-width:380px){#contextButtons button{font-size:14px;}#controlNotes{font-size:11px;}#result .ending-dialogue{font-size:18px!important;}#introCopy{font-size:clamp(22px,5.5vw,25px);}}
@media(max-height:590px){#intro .intro-progress{margin-bottom:7px;}#introCopy{font-size:clamp(19px,4vh,25px);line-height:1.5;padding:6px;}#introNext.tap-continue{bottom:calc(11px + env(safe-area-inset-bottom));}#contextTitle{font-size:14px;}#contextButtons button{min-height:47px;font-size:13px;}#narration{max-height:21dvh;font-size:14px;padding:6px 8px;}#result .ending-dialogue{font-size:18px!important;}}
@media(prefers-reduced-motion:reduce){#intro,#introCopy{transition:none!important;animation:none!important;}}

/* 48m shadow encounter: quiet, gradual, visually distinct from the existing pursuer. */
#shadowEncounter{position:absolute;z-index:8;top:16%;right:1%;width:min(52vw,340px);height:min(60vh,500px);opacity:.82;pointer-events:none;filter:blur(1.2px) drop-shadow(0 0 24px #000);transform-origin:74% 40%;animation:shadowCreep 1150ms ease-in-out both}
#shadowEncounter img{width:100%;height:100%;display:block;object-fit:contain;opacity:.96}
@keyframes shadowCreep{from{transform:translate(28%,16%) scale(.68);opacity:0}35%{opacity:.43}to{transform:translate(0,0) scale(1);opacity:.8}}
#shadowDeath{position:absolute;inset:0;z-index:22;background:#020203;pointer-events:none;overflow:hidden;display:block}
#shadowDeath img{width:100%;height:100%;object-fit:cover;display:block;filter:brightness(.75);animation:shadowEyeReveal 1550ms ease-out both}
@keyframes shadowEyeReveal{from{transform:scale(.88);filter:brightness(.22)}40%{filter:brightness(.75)}to{transform:scale(1.04);filter:brightness(.68)}}
@media(prefers-reduced-motion:reduce){#shadowEncounter,#shadowDeath img{animation:none!important}}
@media(max-width:430px){#shadowEncounter{top:21%;right:-4%;width:55vw;height:40vh;filter:blur(1px) drop-shadow(0 0 16px #000)}}

/* Debug-only share card inspection: simple mobile-first controls, no game overlay changes. */
#debug .debug-share-section{margin:4px 0 20px;padding:12px;border:1px solid #48616d;border-radius:10px;background:#101b21;min-width:0}
#debug .debug-share-swatches{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px;margin:8px 0 14px}
#debug .debug-share-chip{min-width:0;min-height:49px;margin:0;padding:8px 5px;border:1px solid var(--end-color,#81939d);background:#17242c;color:#e9f1f3;border-radius:6px;font:600 12px/1.3 system-ui,sans-serif;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px}
#debug .debug-share-chip::before{content:'';display:block;width:68%;height:4px;border-radius:4px;background:var(--end-color,#81939d)}
#debug .debug-share-chip[aria-pressed="true"]{background:#253740;outline:2px solid var(--end-color,#81939d);outline-offset:0}
#debug .debug-share-chip small{max-width:100%;font-size:10px;font-weight:400;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#debug .debug-share-preview{display:flex;flex-direction:column;align-items:center;justify-content:center;min-height:100px;gap:8px;padding:12px;background:#070c0f;border:1px solid #354952;border-radius:7px}
#debug .debug-share-preview img{display:block;width:min(100%,315px);height:auto;aspect-ratio:4 / 5;object-fit:contain;box-shadow:0 6px 30px #0009}
#debug .debug-share-preview img.hidden{display:none}
#debug #debugShareStatus{color:#c5d0d5;font-size:12px;line-height:1.6;text-align:center}
#debug #debugShareSave:disabled{opacity:.47;cursor:default}

/* Single, consistent X report action; other gameplay actions are unchanged. */
#result #resultShare{width:100%;min-height:74px;padding:17px 18px;border:2px solid #f0f8fa;border-radius:7px;background:linear-gradient(135deg,#f2f9fa 0%,#c6e0e8 100%);color:#0c1b24;font-size:clamp(18px,4.5vw,23px);font-weight:800;letter-spacing:.11em;justify-content:center;text-align:center;box-shadow:0 0 0 1px rgba(162,212,229,.30),0 0 22px rgba(148,210,225,.30),0 8px 20px rgba(0,0,0,.40)}
#result #resultShare:active:not(:disabled){transform:scale(.985);background:#d2e5eb}
#result #resultShare:disabled{opacity:.58;box-shadow:none;cursor:wait}
#result #shareNote{color:#aab7c0;font-size:11px!important;line-height:1.55!important;margin:0 0 6px!important;min-height:0!important}

#startRush{position:absolute;z-index:12;left:50%;top:16%;transform:translateX(-50%);width:min(92vw,620px);pointer-events:none;text-align:center;text-shadow:0 4px 24px #000,0 0 26px rgba(0,0,0,.55);}
#startRush .start-rush-sub{display:inline-block;padding:7px 12px;margin-bottom:12px;border:1px solid rgba(242,244,244,.34);background:rgba(9,12,15,.56);color:#d7dcde;font-size:clamp(12px,3.2vw,19px);letter-spacing:.20em;}
#startRush .start-rush-main{font-weight:800;color:#f3efea;font-size:clamp(42px,13vw,110px);line-height:1;letter-spacing:.13em;}
#startRush.show{display:block!important;animation:startRushIn 2.65s cubic-bezier(.2,.72,.2,1) both;}
@keyframes startRushIn{0%{opacity:0;transform:translateX(-50%) scale(.92)}12%{opacity:1;transform:translateX(-50%) scale(1)}78%{opacity:1;transform:translateX(-50%) scale(1.02)}100%{opacity:0;transform:translateX(-50%) scale(1.05)}}
@media(max-width:430px){#startRush{top:18%;}#startRush .start-rush-sub{margin-bottom:10px;}}
@media(prefers-reduced-motion:reduce){#startRush.show{animation:none;display:block!important;opacity:1;} }

/* Persistent exit-distance readout: within the existing HUD, below the zone name. */
#hud .exit-remaining{display:inline-flex;align-items:baseline;gap:4px;align-self:flex-start;max-width:100%;padding:4px 7px;margin-top:4px;border:1px solid rgba(154,175,182,.28);border-radius:4px;background:rgba(5,9,13,.82);color:#d6e1e4;font:500 clamp(11px,2.6vw,12px)/1.35 system-ui,sans-serif;letter-spacing:.02em;text-shadow:0 1px 3px #000;white-space:nowrap;pointer-events:none}
#hud .exit-remaining strong{color:#f3f2ee;font-size:clamp(14px,3.4vw,16px);font-weight:750;line-height:1;font-variant-numeric:tabular-nums}
#hud .exit-remaining span{font-size:11px;color:#c6d0d3}
@media(max-height:600px){#hud .exit-remaining{margin-top:1px;padding:2px 6px;font-size:11px}#hud .exit-remaining strong{font-size:14px}}
/* Reserve a narrow separation between the new meter readout and chase panel. */
#hud .exit-remaining{padding:2px 6px;margin-top:2px;line-height:1.15}
#hud .exit-remaining strong{font-size:14px}
@media(max-width:400px){#chaseIndicator{top:calc(89px + env(safe-area-inset-top))}}
@media(max-height:600px){#chaseIndicator{top:calc(90px + env(safe-area-inset-top))}}
