:root{color-scheme:dark;--bg:#0b100e;--panel:#151c18;--panel2:#1b2420;--line:#344038;--text:#edeadd;--muted:#aab1a5;--gold:#d3b587;--red:#bc6e64;--ink:#19211c;font-family:"Hiragino Kaku Gothic ProN","Yu Gothic",Meiryo,sans-serif}
*{box-sizing:border-box}html{background:var(--bg)}body{margin:0;background:var(--bg);color:var(--text);min-height:100vh}button{font:inherit;cursor:pointer}button:focus-visible,a:focus-visible{outline:2px solid var(--gold);outline-offset:4px}button:disabled{opacity:.35;cursor:default}img{display:block;max-width:100%}h1,h2,h3,p{margin:0}.mono{font-family:ui-monospace,"SFMono-Regular",Consolas,monospace}.eyebrow{color:var(--gold);font-size:var(--min-font);letter-spacing:.22em;font-weight:700}.muted{color:var(--muted)}
.topbar{height:76px;border-bottom:1px solid #29332d;display:flex;align-items:center;justify-content:space-between;padding:0 5vw;gap:20px;background:#0c110f}.brand{background:none;color:var(--text);display:flex;align-items:center;gap:13px;text-align:left;padding:8px 0;border:0}.cross{width:22px;height:22px;position:relative;display:inline-block}.cross:before,.cross:after{content:"";position:absolute;background:var(--gold);inset:9px 1px}.cross:after{inset:1px 9px}.brand-name{font-family:"Yu Mincho",serif;font-size:18px;letter-spacing:.12em}.brand-sub{font-size:var(--min-font);letter-spacing:.18em;color:var(--muted);display:block;margin-top:4px}.top-tools{display:flex;align-items:center;gap:20px}.text-btn{background:none;border:0;color:var(--muted);padding:12px 5px;font-size:var(--min-font)}.text-btn:hover{color:var(--text)}.status-light{display:flex;align-items:center;gap:8px;font-size:var(--min-font);color:var(--muted);letter-spacing:.1em}.dot{width:5px;height:5px;border-radius:50%;background:#c0b28d;box-shadow:0 0 9px #d4b98888}.primary,.secondary{min-height:48px;padding:13px 22px;font-size:var(--min-font);letter-spacing:.04em;border:1px solid transparent}.primary{background:var(--gold);color:#172019;font-weight:700}.primary:hover{background:#e0c49d}.secondary{background:#121815;border-color:#546157;color:var(--text)}.secondary:hover{background:#1b2520}.icon-btn{width:42px;height:42px;display:grid;place-items:center;background:#111713;border:1px solid var(--line);color:var(--text);font-size:20px}.pill{font-size:var(--min-font);border:1px solid #69725d;color:#d5ddc7;letter-spacing:.1em;padding:6px 10px}
.landing{min-height:calc(100svh - 76px);position:relative;overflow:hidden;display:flex;align-items:center}.hero-photo{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;object-position:center}.landing:after{content:"";position:absolute;inset:0;background:linear-gradient(90deg,#0b100ef5 0%,#0b100edd 23%,#0b100e66 58%,#0b100e08 100%),linear-gradient(0deg,#0b100e 0%,transparent 35%)}.hero-copy{position:relative;z-index:1;width:100%;max-width:780px;padding:70px 5vw 130px}.hero-copy h1{font-family:"Yu Mincho","Hiragino Mincho ProN",serif;font-weight:400;font-size:clamp(58px,7vw,96px);letter-spacing:.09em;line-height:1.35;margin:14px 0 8px}.hero-sub{font-family:"Yu Mincho",serif;font-size:clamp(20px,2vw,27px);letter-spacing:.12em}.hero-description{font-size:var(--min-font);line-height:2.15;color:#c1c8bc;margin-top:25px}.hero-actions{display:flex;gap:12px;margin-top:32px;flex-wrap:wrap}.hero-note{margin-top:17px;color:#b8beb1;font-size:var(--min-font);line-height:1.9}.hero-meta{position:absolute;z-index:1;left:5vw;right:5vw;bottom:26px;display:flex;justify-content:space-between;align-items:flex-end;color:var(--muted);font-size:var(--min-font);letter-spacing:.12em}.hero-meta strong{display:block;color:var(--gold);font-size:24px;font-weight:400;margin-bottom:5px}.room-label{position:absolute;z-index:1;right:5vw;top:40px;text-align:right;color:#eee9df;opacity:.75;font-size:var(--min-font);letter-spacing:.12em}.room-label span{display:block;margin-top:7px;font-size:var(--min-font)}
.game-shell{max-width:1500px;margin:auto;padding:27px 4vw 32px}.game-heading{display:flex;justify-content:space-between;align-items:center;gap:20px;margin-bottom:19px}.game-heading h1{font-family:"Yu Mincho",serif;font-size:23px;font-weight:400;letter-spacing:.08em;margin-top:7px}.shift-time{text-align:right;color:var(--gold);font-size:29px;letter-spacing:.08em}.shift-time small{display:block;margin-top:4px;color:var(--muted);font:var(--min-font) sans-serif}.dungeon-layout{display:grid;grid-template-columns:minmax(0,1fr) 255px;gap:25px;align-items:start}.explore-area{min-width:0}.dungeon-scene{position:relative;width:100%;aspect-ratio:16/8.9;overflow:hidden;background:#080d0a;isolation:isolate;border:1px solid #3a453d;box-shadow:0 14px 45px #0007}.dungeon-scene:before{content:"";position:absolute;inset:-2%;z-index:-1;background-image:var(--scene-image);background-size:var(--scene-size);background-position:var(--scene-pos);background-repeat:no-repeat;filter:brightness(.62) saturate(.65);transition:filter 1s,background-size 1.5s,background-position 1.5s}.dungeon-scene:after{content:"";position:absolute;inset:0;z-index:1;background:linear-gradient(0deg,#04080699 0%,transparent 28%,transparent 70%,#03060572),radial-gradient(ellipse at center,transparent 25%,#04080666 100%);pointer-events:none}.dungeon-scene.stair-scene:before{filter:brightness(.44) saturate(.45) hue-rotate(-10deg)}.dungeon-scene.approach-scene:before{filter:brightness(.42) saturate(.5) sepia(.08)}.dungeon-scene.patient-room-scene:before{filter:brightness(.47) saturate(.58)}.dungeon-scene.treatment-scene:before{filter:brightness(.57) saturate(.55)}.scene-vignette{position:absolute;inset:0;z-index:2;pointer-events:none}.scene-label{position:absolute;z-index:6;left:17px;top:15px;color:#e9e3d3;font-size:var(--min-font);letter-spacing:.15em;text-shadow:0 2px 8px #000}.scene-label span{padding-left:8px;color:#d4b88d}.scene-center-mark{position:absolute;z-index:3;width:4px;height:4px;border-radius:50%;left:50%;top:50%;background:#f2e4ca77;box-shadow:0 0 10px #f3dfb055}.scene-bottom-label{position:absolute;z-index:7;left:0;right:0;bottom:18px;text-align:center;color:#eee1cf;font-family:"Yu Mincho",serif;font-size:var(--min-font);letter-spacing:.12em;text-shadow:0 2px 10px #000}.ghost-peek{position:absolute;z-index:5;inset:0;overflow:hidden;pointer-events:none;animation:ghost-fade 4.6s ease both}.ghost-peek img{position:absolute;max-width:none;width:auto;object-fit:contain;opacity:.72;filter:brightness(.67) saturate(.35) contrast(1.12);left:50%;transform:translateX(-50%);transition:height 1.6s ease,left 1.6s ease,top 1.6s ease,filter 1.6s ease}.ghost-stage-1 img{height:23%;top:24%;opacity:.37;filter:brightness(.44) saturate(.25);left:52%}.ghost-stage-2 img{height:37%;top:26%;opacity:.5;left:49%}.ghost-stage-3 img{height:53%;top:24%;opacity:.62;left:55%;filter:brightness(.62) saturate(.3) blur(.3px)}.ghost-stage-4 img{height:83%;top:14%;opacity:.78;left:50%;filter:brightness(.76) saturate(.4)}.ghost-stage-5 img{height:245%;top:26%;opacity:.9;left:50%;filter:brightness(.9) saturate(.35) contrast(1.15);transform:translateX(-50%)}@keyframes ghost-fade{0%{opacity:0}14%{opacity:1}65%{opacity:1}100%{opacity:0}}
.location-caption{display:flex;align-items:center;gap:13px;min-height:50px;color:#b5beb1;font-size:var(--min-font);letter-spacing:.04em}.travel-pad{padding:15px 17px 13px;border:1px solid var(--line);background:linear-gradient(135deg,#19211c,#101613)}.turn-controls,.move-controls{display:flex;justify-content:center;gap:10px}.turn-controls button,.move-controls button{min-width:145px}.move-controls{margin-top:9px}.move-controls .primary{min-width:210px}.move-footnote{text-align:center;color:var(--muted);font-size:var(--min-font);margin-top:12px;line-height:1.7}.lock-note{color:#d8b68c}.game-tools{display:flex;align-items:center;justify-content:center;gap:16px;margin-top:14px}.game-tools button{min-height:38px}.side-panel{border:1px solid #303b34;background:linear-gradient(155deg,#18201b,#111714);padding:20px 19px;min-height:435px}.side-heading{color:var(--gold);font-size:var(--min-font);letter-spacing:.16em;padding-bottom:16px;border-bottom:1px solid var(--line)}.round-label{display:flex;justify-content:space-between;align-items:center;margin-top:17px;color:var(--muted);font-size:var(--min-font)}.round-label strong{color:#e3ddcf;font-size:var(--min-font);font-weight:500}.clue-list{min-height:45px;padding:14px 0;border-bottom:1px solid var(--line);display:grid;gap:8px}.clue-list span{font-family:"Yu Mincho",serif;font-size:var(--min-font);color:#d7d9c9}.paper{margin-top:17px;background:#e5e1d4;color:#202820;padding:22px 18px;min-height:198px;box-shadow:0 4px 15px #0003}.paper h2{font:600 var(--min-font) "Yu Mincho",serif;letter-spacing:.12em;padding-bottom:11px;border-bottom:1px solid #a8a89a}.paper p{font:var(--min-font)/2 "Yu Mincho",serif;margin-top:14px}.paper .paper-note{border-top:1px solid #b8b7aa;padding-top:9px;font-size:var(--min-font);color:#596154}.side-footer{display:flex;justify-content:space-between;gap:5px;color:#929b8e;font-size:var(--min-font);margin-top:18px}.game-bottom{display:flex;justify-content:space-between;color:#747e73;font-size:var(--min-font);letter-spacing:.06em;margin-top:18px}.return-banner{position:fixed;right:24px;bottom:22px;z-index:9;box-shadow:0 8px 30px #0009}.toast{position:fixed;left:50%;bottom:25px;transform:translateX(-50%);z-index:30;padding:14px 20px;background:#e6e2d7;color:#1c241e;font-size:var(--min-font);max-width:calc(100vw - 28px);box-shadow:0 8px 30px #0008;text-align:center}
dialog{max-width:min(700px,calc(100vw - 22px));max-height:calc(100svh - 30px);padding:0;border:1px solid #515d52;background:#151c18;color:var(--text);box-shadow:0 25px 80px #000c}dialog::backdrop{background:#040806cf;backdrop-filter:blur(3px)}.dialog-body{padding:28px 30px}.dialog-top{display:flex;justify-content:space-between;align-items:center;gap:15px}.dialog-body h2{font:400 24px "Yu Mincho",serif;margin:21px 0 16px}.dialog-body>p{font:var(--min-font)/2 "Yu Mincho",serif;color:#c8cdbf;white-space:pre-line}.dialog-actions{display:flex;justify-content:flex-end;gap:10px;margin-top:25px}.note-stamp{border-top:1px solid var(--line);margin-top:23px;padding-top:14px;color:var(--gold);font-size:var(--min-font);letter-spacing:.1em}.check-row{display:flex;justify-content:space-between;align-items:center;gap:20px;border-top:1px solid var(--line);padding:16px 0;font-size:var(--min-font);color:#d5d9ce}.check-row input[type=range]{width:170px;accent-color:var(--gold)}.check-row input[type=checkbox]{accent-color:var(--gold);width:18px;height:18px}.settings-note{font:var(--min-font)/1.9 sans-serif!important;color:var(--muted)!important;margin-top:10px}.map-dialog{min-width:min(520px,calc(100vw - 30px))}.map-grid{display:grid;grid-template-columns:repeat(5,minmax(48px,1fr));grid-template-rows:repeat(3,74px);gap:8px;margin:25px 0 13px;padding:10px;background:#0d1310;border:1px solid #2d3930}.map-node{position:relative;display:flex;flex-direction:column;justify-content:center;align-items:center;gap:5px;border:1px solid #405045;background:#19231d;color:#dce1d4;text-align:center}.map-node span{font-size:18px;color:var(--gold)}.map-node small{font-size:var(--min-font);line-height:1.35}.map-node.here{border-color:var(--gold);box-shadow:0 0 15px #d5b78630}.map-node.here span{color:#f2d4a6}.map-node.unknown{background:#101613;border-style:dashed;color:#667267}.map-node.unknown span{color:#667267}.map-legend{display:flex;justify-content:center;gap:15px;color:var(--muted);font-size:var(--min-font)}.note-list{display:grid;gap:10px;margin:18px 0}.note-list p,.log-list p{padding:10px 12px;border-left:2px solid #a88c62;background:#101713;color:#d3d7cc;font-size:var(--min-font);line-height:1.7}.log-list{display:grid;gap:6px;max-height:170px;overflow:auto}.log-list p{border-left-color:#45564a;color:#aeb8ab}.return-banner .primary{box-shadow:0 4px 24px #0008}
.ending-page{min-height:calc(100svh - 76px);display:grid;grid-template-columns:minmax(280px,.9fr) minmax(400px,1.1fr)}.ending-image{background:url('assets/room-window-reflection.webp') center/cover;filter:brightness(.42) saturate(.55)}.ending-copy{align-self:center;padding:60px clamp(28px,7vw,100px)}.ending-copy h1{font:400 clamp(30px,4vw,48px) "Yu Mincho",serif;letter-spacing:.08em;margin:19px 0}.ending-copy>p{white-space:pre-line;font:var(--min-font)/2.15 "Yu Mincho",serif;color:#c5cdbf}.result-stats{display:flex;gap:28px;border-top:1px solid var(--line);border-bottom:1px solid var(--line);padding:22px 0;margin-top:30px}.result-stats div{display:grid;gap:8px}.result-stats span{font-size:var(--min-font);color:var(--muted)}.result-stats strong{font-size:24px;color:var(--gold);font-weight:400}.result-actions{display:flex;gap:10px;flex-wrap:wrap;margin-top:25px}
@media(max-width:980px){.dungeon-layout{grid-template-columns:minmax(0,1fr) 220px;gap:16px}.side-panel{padding:17px 14px}.paper{padding:18px 14px}.move-controls button,.turn-controls button{min-width:120px}.move-controls .primary{min-width:180px}}
@media(max-width:740px){.topbar{height:66px;padding:0 18px}.status-light{display:none}.top-tools{gap:9px}.brand-name{font-size:var(--min-font)}.brand-sub{font-size:var(--min-font)}.landing{min-height:calc(100svh - 66px)}.landing:after{background:linear-gradient(90deg,#0b100eef,#0b100e8c 58%,#0b100e38),linear-gradient(0deg,#0b100e,transparent 70%)}.hero-photo{object-position:53% center}.hero-copy{padding:70px 23px 140px}.hero-copy h1{font-size:60px}.hero-sub{font-size:20px}.hero-description{font-size:var(--min-font)}.hero-actions{flex-direction:column;align-items:flex-start;gap:9px}.hero-actions button{min-width:225px}.hero-meta{left:23px;right:23px;bottom:22px;font-size:var(--min-font)}.room-label{right:23px;top:20px}.game-shell{padding:21px 14px 25px}.game-heading{margin-bottom:13px}.game-heading h1{font-size:19px}.shift-time{font-size:24px}.dungeon-layout{display:flex;flex-direction:column;gap:13px}.explore-area{width:100%}.dungeon-scene{aspect-ratio:4/3}.scene-label{left:10px;top:10px;font-size:var(--min-font)}.scene-bottom-label{font-size:var(--min-font);bottom:12px}.location-caption{min-height:43px;font-size:var(--min-font)}.travel-pad{padding:12px 8px}.turn-controls{gap:7px}.move-controls{gap:7px}.turn-controls button,.move-controls button{min-width:0;flex:1;padding:11px 7px;font-size:var(--min-font)}.move-controls .primary{min-width:0;flex:1.2}.move-footnote{font-size:var(--min-font)}.game-tools{gap:6px}.game-tools button{font-size:var(--min-font);padding:9px 11px}.side-panel{width:100%;min-height:0;padding:14px}.side-heading{padding-bottom:10px}.round-label{margin-top:11px}.clue-list{min-height:34px;padding:10px 0;grid-template-columns:1fr 1fr}.paper{display:none}.side-footer{margin-top:11px}.game-bottom{font-size:var(--min-font);margin-top:13px}.return-banner{left:14px;right:14px;bottom:12px}.return-banner button{width:100%}.dialog-body{padding:22px 20px}.dialog-body h2{font-size:21px}.dialog-body>p{font-size:var(--min-font)}.check-row{font-size:var(--min-font)}.map-grid{grid-template-rows:repeat(3,64px);gap:5px;padding:6px}.map-node small{font-size:var(--min-font)}.map-legend{gap:8px;font-size:var(--min-font)}.ending-page{grid-template-columns:1fr;grid-template-rows:27svh 1fr}.ending-copy{padding:30px 22px 40px}.ending-copy h1{font-size:31px}.ending-copy>p{font-size:var(--min-font)}.result-stats{gap:18px}.result-stats strong{font-size:21px}.result-actions button{flex:1}}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{scroll-behavior:auto!important;transition:none!important;animation:none!important}.ghost-peek{animation:none;opacity:.75}}
.light-dip{position:absolute;inset:0;z-index:9;pointer-events:none;background:#020403;animation:single-blackout 1.1s ease-out both}
@keyframes single-blackout{0%,38%{opacity:.98}100%{opacity:0}}
html.reduced .dungeon-scene:before{transition:none}
.crisis-hints{margin:18px 0 6px;border-top:1px solid var(--line);padding-top:12px}
.hint-title{color:var(--gold);font-size:var(--min-font);letter-spacing:.2em;margin-bottom:8px}
.crisis-hints p{font:var(--min-font)/1.8 "Yu Mincho",serif;color:#b9c0b2;padding:6px 10px;border-left:2px solid #6b5a46;margin-top:6px}
.crisis-choices{display:grid;gap:10px;margin-top:18px}
.crisis-choices button{text-align:left;min-height:52px}
.credit-line{font:var(--min-font)/1.6 sans-serif!important;color:var(--muted)!important;margin-top:16px;word-break:break-all}
.death-note{color:var(--gold)!important}
.dungeon-scene:before{transform:scaleX(var(--scene-flip,1));transition:filter 1s,background-size 1.5s,background-position 1.5s,transform .35s}
.dpad{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));grid-template-rows:repeat(3,64px);gap:8px;max-width:420px;margin:0 auto}
.dpad .dpad-N{grid-column:2;grid-row:1}.dpad .dpad-W{grid-column:1;grid-row:2}.dpad .dpad-center{grid-column:2;grid-row:2}.dpad .dpad-E{grid-column:3;grid-row:2}.dpad .dpad-S{grid-column:2;grid-row:3}
.dpad-btn{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;background:#121815;border:1px solid #546157;color:var(--text);padding:6px 4px;min-height:64px}
.dpad-btn .dpad-arrow{font-size:20px;line-height:1}
.dpad-btn small{font-size:var(--min-font);color:var(--muted);line-height:1.2;text-align:center}
.dpad-btn:hover:not(:disabled){background:#1b2520}
.dpad-btn.facing{border-color:var(--gold);box-shadow:0 0 0 1px var(--gold) inset}
.dpad-btn.locked{border-style:dashed;color:#d8b68c}
.dpad-btn.empty{opacity:.28}
.dpad-btn .back-note{color:var(--gold);font-size:var(--min-font)}
.dpad-center{min-height:64px}
.dpad-extra{display:flex;justify-content:center;margin-top:10px}
html.reduced .dungeon-scene:before{transition:none}
@media(max-width:740px){.dpad{grid-template-rows:repeat(3,58px);gap:6px}.dpad-btn{min-height:58px}.move-footnote{font-size:var(--min-font)}}
.map-exits{display:flex;flex-wrap:wrap;gap:8px 14px;margin:14px 0 4px;padding:10px 12px;border:1px solid var(--line);background:#101713;font-size:var(--min-font);color:#d3d7cc}
.map-exits .hint-title{flex:0 0 100%;margin-bottom:0}
.dpad .dpad-center{padding:6px 4px;font-size:var(--min-font);white-space:nowrap;letter-spacing:0}
.dpad-extra .secondary{padding:12px 14px;font-size:var(--min-font);text-align:center}
@keyframes view-N{from{scale:1.18}to{scale:1}}
@keyframes view-S{from{translate:0 -5%}to{translate:0 0}}
@keyframes view-E{from{translate:8% 0}to{translate:0 0}}
@keyframes view-W{from{translate:-8% 0}to{translate:0 0}}
@keyframes view-turn{from{opacity:.15}to{opacity:1}}
.dungeon-scene.anim-N:before{animation:view-N .6s ease-out}
.dungeon-scene.anim-S:before{animation:view-S .6s ease-out}
.dungeon-scene.anim-E:before{animation:view-E .6s ease-out}
.dungeon-scene.anim-W:before{animation:view-W .6s ease-out}
.dungeon-scene.anim-turn:before{animation:view-turn .5s ease-out}
:root{--min-font:18px}
@media(max-width:740px){:root{--min-font:16px}}
/* 小さな文字が大きくなる分、行や枠が窮屈にならないようにする */
.dpad{grid-template-rows:repeat(3,auto)}
.dpad-btn{min-height:64px;padding:8px 6px}
.dpad-btn small{font-size:var(--min-font)}
@media(min-width:741px){.topbar{min-height:76px;height:auto;flex-wrap:wrap;padding-top:8px;padding-bottom:8px}}
@media(max-width:740px){.topbar{min-height:66px;height:auto;flex-wrap:wrap}}
.map-grid{grid-template-rows:repeat(3,auto)}
.map-node{min-height:74px;padding:6px 4px}
/* ドア（廊下の写真から切り出した画像）。左右・正面・後ろに置く */
.door{position:absolute;z-index:4;display:block;padding:0;background:none;border:0;cursor:pointer;perspective:700px}
.door .door-img{display:block;width:100%;height:100%;background-size:100% 100%;background-repeat:no-repeat;filter:brightness(.78) contrast(1.05);transition:transform .38s ease,opacity .38s ease;box-shadow:0 0 0 1px #0008}
.door-left{left:0;top:2%;width:19%;height:84%}
.door-left .door-img{background-image:url('assets/door-left.webp');transform-origin:left center}
.door-right{right:0;top:2%;width:17%;height:84%}
.door-right .door-img{background-image:url('assets/door-right.webp');transform-origin:right center}
.door-ahead{left:50%;top:10%;width:20%;height:70%;transform:translateX(-50%)}
.door-ahead .door-img{background-image:url('assets/door-left.webp')}
.door-behind{left:50%;bottom:4%;top:auto;width:11%;height:30%;transform:translateX(-50%);opacity:.9}
.door-behind .door-img{background-image:url('assets/door-left.webp')}
.door-label{position:absolute;left:50%;bottom:6%;transform:translateX(-50%);white-space:nowrap;background:#050a08cc;color:#f0e6d0;padding:2px 8px;font-size:var(--min-font);border:1px solid #6b5a46}
.door-behind .door-label{bottom:-2px}
.door:hover .door-img,.door:focus-visible .door-img{filter:brightness(1.05) contrast(1.05)}
.door.locked .door-img{filter:brightness(.5) saturate(.4)}
.door.opening.door-left .door-img{transform:rotateY(70deg);opacity:.35}
.door.opening.door-right .door-img{transform:rotateY(-70deg);opacity:.35}
.door.opening.door-ahead .door-img,.door.opening.door-behind .door-img{transform:scale(1.5);opacity:0}
html.reduced .door .door-img{transition:none}
.spine{font:var(--min-font) ui-monospace,Consolas,monospace;color:var(--gold);letter-spacing:.05em}
.door-figure{height:120px;margin:12px 0;background:url('assets/ghost-nurse.webp') center 20%/auto 260% no-repeat;opacity:.35;filter:brightness(.7)}
@keyframes view-fwd{from{scale:1.22}to{scale:1}}
@keyframes view-back{from{translate:0 4%;opacity:.5}to{translate:0 0;opacity:1}}
@keyframes view-door{from{scale:1.5;opacity:.1}to{scale:1;opacity:1}}
.dungeon-scene.anim-fwd:before{animation:view-fwd .6s ease-out}
.dungeon-scene.anim-back:before{animation:view-back .6s ease-out}
.dungeon-scene.anim-door:before{animation:view-door .65s ease-out}
.chase-bar{display:flex;flex-wrap:wrap;align-items:center;gap:6px 14px;margin-bottom:10px;padding:8px 12px;border:1px solid #8a4b3f;background:#2a1511;color:#f1d4c8;font-size:var(--min-font)}
.chase-bar strong{color:#ff9d84;letter-spacing:.1em}
.chase-bar span{letter-spacing:.12em}
.chase-bar small{color:#d8b8ac;margin-left:auto}
.dungeon-scene.glance:before{filter:brightness(.55) saturate(.5);-webkit-mask-image:radial-gradient(ellipse 34% 75% at 95% 48%,#000 0,#000 40%,transparent 100%);mask-image:radial-gradient(ellipse 34% 75% at 95% 48%,#000 0,#000 40%,transparent 100%)}
.dungeon-scene.glance .door{display:none}
.glance-ghost{position:absolute;z-index:5;right:1%;top:12%;height:calc(72% * var(--ghost-scale,1));width:22%;background:url('assets/ghost-nurse.webp') center top/auto 100% no-repeat;opacity:.55;-webkit-mask-image:linear-gradient(to left,#000 35%,transparent);mask-image:linear-gradient(to left,#000 35%,transparent);pointer-events:none}
/* 蛍光灯の光。写真の蛍光灯の位置に重ねる（位置はJSで合わせる）。第1〜2段階は奥の1本が弱く明滅、第3段階以降は両方が荒く明滅 */
.lamp{position:absolute;z-index:3;transform:translate(-50%,-50%);opacity:0;pointer-events:none;mix-blend-mode:screen;
  background:radial-gradient(ellipse at center,rgba(215,240,228,.9) 0,rgba(180,220,205,.35) 38%,transparent 72%);transition:opacity .2s}
.lamp.on{opacity:.55}
.flicker-soft .lamp-b.on{animation:lamp-soft 4.2s infinite}
.flicker-hard .lamp.on{animation:lamp-hard 1.7s infinite}
.flicker-hard .lamp-b.on{animation-duration:1.3s;animation-delay:-.4s}
@keyframes lamp-soft{0%,5%,12%,58%,66%,100%{opacity:.55}6%{opacity:.05}8%{opacity:.5}9.5%{opacity:.1}59%{opacity:.1}61%{opacity:.5}62.5%{opacity:.04}64%{opacity:.5}}
@keyframes lamp-hard{0%,100%{opacity:.6}8%{opacity:.05}12%{opacity:.55}18%{opacity:.0}22%{opacity:.4}40%{opacity:.6}46%{opacity:.08}48%{opacity:.6}70%{opacity:.5}74%{opacity:0}78%{opacity:.6}}
@media(prefers-reduced-motion:reduce){.lamp{animation:none!important}}
html.reduced .lamp{animation:none!important}
.dpad-btn.facing{box-shadow:none}
/* 部屋ごとの色味（同じ写真でも、違う場所に見えるように） */
.dungeon-scene.room-pharmacy:before{filter:brightness(.5) saturate(.45) hue-rotate(60deg) contrast(1.1)}
.dungeon-scene.room-storage:before{filter:brightness(.4) saturate(.35) sepia(.35) contrast(1.15)}
.dungeon-scene.room-staffroom:before{filter:brightness(.5) saturate(.6) sepia(.15)}
.dungeon-scene.room-treatment:before{filter:brightness(.58) saturate(.5) hue-rotate(-15deg)}
.dungeon-scene.room-room301:before{filter:brightness(.5) saturate(.5) hue-rotate(20deg)}
.dungeon-scene.room-station:before{filter:brightness(.62) saturate(.5) hue-rotate(-10deg) contrast(1.1)}
/* 地図は9列（廊下が長くなった）。狭い画面では横にスクロールする */
.map-dialog .map-grid{grid-template-columns:repeat(9,minmax(64px,1fr));min-width:640px}
.map-dialog{overflow-x:auto}
.map-node small{font-size:var(--min-font)}
/* 光（蛍光灯）：移動の動きの間は隠し、横目で見る間も隠す */
.dungeon-scene[class*="anim-"] .lamp{visibility:hidden}
.dungeon-scene.glance .lamp{display:none}
.act-list{display:grid;gap:10px;margin:14px 0}
.act-list button{text-align:left;min-height:52px}
/* 幽霊：廊下の遠くを、歩いて、すっと消える。画面の中央や部屋の中には出さない */
.ghost-walker{position:absolute;z-index:4;pointer-events:none;background:url('assets/ghost-nurse.webp') center bottom/contain no-repeat;opacity:0;filter:brightness(.62) saturate(.25) blur(.5px);animation:ghost-walk 4.6s ease-in-out forwards}
@keyframes ghost-walk{0%{opacity:0;translate:-18% 0}16%{opacity:.5}62%{opacity:.42;translate:6% 0}100%{opacity:0;translate:22% 0}}
html.reduced .ghost-walker{animation:none;opacity:.32}
@media(prefers-reduced-motion:reduce){.ghost-walker{animation:none;opacity:.32}}
.dungeon-scene.glance .ghost-walker{display:none}
/* ドアは画像を貼らない：画面の端の「名前の札」と、正面のドア（写真そのもの）を押す領域 */
.door .door-img{display:none}
.door{background:none}
.door .door-label{position:static;transform:none;display:inline-block;padding:6px 10px;background:#050a08d9;border:1px solid #8a7656;color:#f0e6d0;white-space:nowrap}
.door-left{left:0;top:50%;bottom:auto;width:auto;height:auto;transform:translateY(-50%)}
.door-left .door-label{border-left:0}
.door-right{right:0;left:auto;top:50%;bottom:auto;width:auto;height:auto;transform:translateY(-50%)}
.door-right .door-label{border-right:0}
.door-behind{left:50%;top:auto;bottom:6px;width:auto;height:auto;transform:translateX(-50%)}
.door-ahead{left:20%;top:4%;width:60%;height:90%;transform:none;border:0;display:flex;align-items:flex-end;justify-content:center;padding-bottom:10px}
.door-ahead:hover .door-label,.door-ahead:focus-visible .door-label{border-color:#e3c897;color:#fff}
.door-ahead:focus-visible{outline:0}
.door.opening .door-label{opacity:.4}
.door.locked .door-label{border-style:dashed;color:#d8b68c}
.scene-bottom-label,.scene-label,.scene-vignette{pointer-events:none}
/* 専用画像（Codexで作成）は、すでに暗いので、色味の補正を弱める */
.dungeon-scene.treatment-scene:before,.dungeon-scene.room-station:before,.dungeon-scene.stair-scene:before,.dungeon-scene.approach-scene:before,.dungeon-scene.patient-room-scene:before{filter:brightness(.95) saturate(.9)}
.dungeon-scene.room-pharmacy:before,.dungeon-scene.room-storage:before,.dungeon-scene.room-staffroom:before,.dungeon-scene.room-treatment:before,.dungeon-scene.room-room301:before,.dungeon-scene.room-hallA:before,.dungeon-scene.room-hallB:before,.dungeon-scene.room-hallC:before{filter:brightness(.95) saturate(.9)}
.door-behind{left:auto;right:10px;bottom:6px;transform:none}

/* ===== 1画面に全部収める（スクロールしない）。画面の高さに合わせて、場面の絵を縮める ===== */
html:has(.dungeon-shell),html:has(.dungeon-shell) body{height:100dvh;overflow:hidden}
html:has(.dungeon-shell) #app{height:100dvh;display:flex;flex-direction:column}
html:has(.dungeon-shell) .topbar{flex:0 0 auto;height:auto;min-height:0;padding:6px 3vw}
.dungeon-shell{flex:1 1 auto;min-height:0;max-width:none;margin:0;width:100%;display:flex;flex-direction:column;padding:6px 14px 8px}
.dungeon-shell .game-heading{flex:0 0 auto;margin:0 0 4px}
.dungeon-shell .game-heading .eyebrow{display:none}
.dungeon-shell .game-heading h1{margin-top:0}
.dungeon-shell .shift-time{font-size:22px}
.dungeon-shell .shift-time small{display:inline;margin-left:8px}
.dungeon-shell .dungeon-layout{flex:1 1 auto;min-height:0;display:grid;grid-template-columns:minmax(0,1fr) 250px;gap:12px;align-items:stretch}
.dungeon-shell .explore-area{display:flex;flex-direction:column;min-height:0;min-width:0}
.dungeon-shell .explore-area>*{flex:0 0 auto}
.dungeon-shell .dungeon-scene{flex:0 1 auto;width:100%;aspect-ratio:16/8.9;min-height:60px}
.dungeon-shell .location-caption{min-height:0;padding:4px 0}
.dungeon-shell .travel-pad{padding:6px 8px}
.dungeon-shell .dpad{grid-template-rows:repeat(3,auto);gap:5px;max-width:460px}
.dungeon-shell .dpad-btn{min-height:44px;padding:3px 4px}
.dungeon-shell .dpad-center{min-height:44px}
.dungeon-shell .dpad-extra{display:flex;gap:6px;margin-top:6px}
.dungeon-shell .dpad-extra .secondary{flex:1;padding:6px 8px;min-height:40px}
.dungeon-shell .move-footnote{display:none}
.dungeon-shell .game-tools{margin-top:6px;gap:8px}
.dungeon-shell .game-tools button{min-height:36px;padding:4px 10px}
.dungeon-shell .game-bottom{display:none}
.dungeon-shell .chase-bar{margin-bottom:4px;padding:4px 10px}
.dungeon-shell .side-panel{min-height:0;overflow:auto;padding:10px}
.dungeon-shell .side-panel .paper{display:none}
.dungeon-shell .return-banner{position:static;margin:6px 0 0;box-shadow:none}
.dungeon-shell .return-banner button{width:100%;min-height:40px}
@media(max-width:900px){
  .dungeon-shell .dungeon-layout{display:flex;flex-direction:column}
  .dungeon-shell .side-panel{display:none}
  .dungeon-shell .dpad{max-width:none}
}
@media(max-height:560px){
  .dungeon-shell .shift-time small,.dungeon-shell .location-caption>span:last-child{display:none}
}
/* 横長で、高さが足りない画面：場面を左、操作を右に並べて、場面を大きく保つ */
@media(min-width:600px) and (max-height:760px){
  .dungeon-shell .dungeon-layout{display:block}
  .dungeon-shell .side-panel{display:none}
  .dungeon-shell .explore-area{display:grid;grid-template-columns:minmax(0,1fr) minmax(250px,36%);grid-template-rows:auto auto 1fr auto;column-gap:14px;height:100%}
  .dungeon-shell .chase-bar{grid-column:1/-1;grid-row:1}
  .dungeon-shell .dungeon-scene{grid-column:1;grid-row:2;align-self:start;flex:none}
  .dungeon-shell .location-caption{grid-column:1;grid-row:3;align-self:start}
  .dungeon-shell .travel-pad{grid-column:2;grid-row:2/4;align-self:start}
  .dungeon-shell .game-tools{grid-column:2;grid-row:4;align-self:end;justify-content:flex-start}
  .dungeon-shell .dpad{max-width:none}
  .dungeon-shell .dpad-extra{flex-direction:column}
}
.react{font-style:italic;color:#e5d3ae!important;border-left:2px solid #8a7656;padding-left:12px;margin-top:14px!important}
.dialog-body>p.react{font:15px/1.9 "Yu Mincho",serif!important}
/* 302号室：元の画像（手あり）が、ゆっくり消えて、手のない画像が現れる */
.anomaly-fade{position:absolute;inset:-2%;z-index:0;background-image:var(--fade-image);background-size:var(--scene-size);background-position:var(--scene-pos);background-repeat:no-repeat;transform:scaleX(var(--scene-flip,1));filter:brightness(.95) saturate(.9);pointer-events:none;animation:hand-retract 1.7s ease-in-out forwards}
@keyframes hand-retract{0%,25%{opacity:1}100%{opacity:0}}
html.reduced .anomaly-fade{animation:none;opacity:0}
@media(min-width:600px) and (max-height:760px){
  .dungeon-shell .dungeon-scene{max-height:calc(100dvh - 270px)}
  .dungeon-shell .return-banner{position:static}
}

/* 横向きスマホなど、高さが 440px 以下：上の帯と見出しを省き、操作を細くして、全部を収める */
@media(min-width:600px) and (max-height:440px){
  html:has(.dungeon-shell) .topbar{padding:2px 10px}
  html:has(.dungeon-shell) .topbar .brand-sub,html:has(.dungeon-shell) .topbar .status-light,html:has(.dungeon-shell) .topbar .cross{display:none}
  .dungeon-shell{padding:2px 8px 4px}
  .dungeon-shell .game-heading{display:none}
  .dungeon-shell .explore-area{grid-template-columns:minmax(0,1fr) minmax(240px,40%);grid-template-rows:auto auto auto;column-gap:10px;height:auto}
  .dungeon-shell .chase-bar{grid-row:1;padding:2px 8px;margin-bottom:2px}
  .dungeon-shell .dungeon-scene{grid-row:2;max-height:calc(100dvh - 145px)}
  .dungeon-shell .location-caption{grid-row:3;padding:2px 0}
  .dungeon-shell .travel-pad{grid-column:2;grid-row:2;align-self:start;padding:2px 4px;max-height:calc(100dvh - 100px);overflow:auto}
  .dungeon-shell .game-tools{grid-column:2;grid-row:3;align-self:start;margin-top:2px;gap:4px}
  .dungeon-shell .game-tools button{min-height:30px;padding:2px 8px}
  .dungeon-shell .dpad{grid-template-rows:repeat(3,34px);gap:3px}
  .dungeon-shell .dpad-btn,.dungeon-shell .dpad-center{min-height:34px;padding:0 3px}
  .dungeon-shell .dpad-extra{flex-direction:row;gap:4px;margin-top:3px}
  .dungeon-shell .dpad-extra .secondary{min-height:30px;padding:2px 6px}
  .dungeon-shell .return-banner{position:static;margin:2px 0 0}
  .dungeon-shell .return-banner button{min-height:32px}
}
/* ===== 入口の画面（音楽の案内） ===== */
.gate{min-height:100dvh;display:grid;place-items:center;padding:18px;background:linear-gradient(#0b100ecc,#0b100ef0),url('assets/old-ward-corridor.webp') center/cover no-repeat}
.gate-card{width:100%;max-width:560px;text-align:center;display:grid;gap:14px}
.gate-title{font-family:"Yu Mincho","Hiragino Mincho ProN",serif;font-size:clamp(40px,9vw,64px);letter-spacing:.12em;color:#f3ead7}
.gate-sub{color:var(--gold);letter-spacing:.22em;font-size:var(--min-font)}
.gate-phones{margin:6px auto 0;padding:8px 18px;border:1px solid #8a7656;background:#13100a99;color:#f5e6c4;font-size:calc(var(--min-font) + 4px);letter-spacing:.1em}
.gate-note{line-height:1.9;color:#d3d9cc;font-size:var(--min-font)}
.gate-panel{display:grid;gap:12px;padding:14px;border:1px solid #4a5a50;background:#0f1612cc}
.gate-toggle{width:100%;min-height:52px}
.gate-vol{display:flex;align-items:center;gap:12px;color:#e6e2d4;font-size:var(--min-font)}
.gate-vol input[type=range]{flex:1;accent-color:var(--gold);min-height:32px}
.gate-vol b{min-width:2.4em;text-align:right;font-weight:600}
.gate-load{min-height:1.6em;color:#aab1a5;font-size:var(--min-font)}
.gate-enter{min-height:60px;font-size:calc(var(--min-font) + 4px);letter-spacing:.3em}
.gate-credit{margin-top:6px;color:#8f9a90;font-size:var(--min-font);line-height:1.7}
.gate-credit a,.credit-block a{color:#cdb88f}
.credit-block{word-break:break-all}
/* 階段の踊り場の窓：白衣の幽霊が、一瞬だけ映って消える */
.window-ghost{position:absolute;z-index:3;pointer-events:none;background:url('assets/ghost-nurse.webp') center top/100% auto no-repeat;opacity:0;filter:brightness(1.5) saturate(.1) blur(.8px);-webkit-mask-image:linear-gradient(#000 45%,transparent 100%);mask-image:linear-gradient(#000 45%,transparent 100%);animation:window-ghost 1.1s ease-out forwards}
@keyframes window-ghost{0%{opacity:0}10%{opacity:.32}35%{opacity:.22}100%{opacity:0}}
html.reduced .window-ghost{animation:none;opacity:.2}
/* ===== 追いつかれた瞬間：ドアップの幽霊 ===== */
.scare-overlay{position:fixed;inset:0;z-index:9999;background:#000;display:grid;place-items:center;overflow:hidden;animation:scare-black .35s steps(1) both}
.scare-face{position:absolute;inset:0;background:url('assets/ghost-closeup.webp') center/cover no-repeat #000;opacity:0;animation:scare-in 2.4s ease-out .35s forwards}
@keyframes scare-black{from{opacity:1}to{opacity:1}}
@keyframes scare-in{0%{opacity:0;transform:scale(1.0)}6%{opacity:1;transform:scale(1.08)}12%{opacity:.55}18%{opacity:1}24%{opacity:.7}30%{opacity:1;transform:scale(1.14)}100%{opacity:1;transform:scale(1.32)}}
html.reduced .scare-face{animation:none;opacity:1}
@media(prefers-reduced-motion:reduce){.scare-face{animation:none;opacity:1}}
.spoiler-note{margin-top:18px!important;color:#c9a97a!important;border:1px solid #6d5a3c;padding:10px 14px;font-size:var(--min-font);line-height:1.8}
.record-line{margin-top:14px!important;color:#d8c9a3!important;letter-spacing:.04em}
.choice-actions{display:grid!important;gap:10px}
.choice-actions button{width:100%;text-align:left;line-height:1.6}
.rec-list{list-style:none;padding:0;margin:14px 0 0;display:grid;gap:8px}
.rec-list li{padding:8px 12px;border:1px solid #3d4a41;line-height:1.7}
.rec-got{background:#1a2420;color:#e6dfc8}
.rec-got b{color:#d8b56f}
.rec-lock{color:#8f9a90}
.rec-list small{color:#9aa69a}
@media(max-width:560px){.result-actions{flex-direction:column}.result-actions button{flex:none;width:100%;min-height:48px}}
.phone-hint{color:#d8c9a3;font-size:var(--min-font);letter-spacing:.04em}
/* ===== スマホ（縦）：写真を大きく、文字を減らす ===== */
@media(max-width:640px) and (orientation:portrait){
  html:has(.dungeon-shell) .topbar{padding:4px 12px}
  .dungeon-shell{padding:4px 8px 6px}
  .dungeon-shell .game-heading h1{font-size:18px}
  .dungeon-shell .shift-time{font-size:18px}
  .dungeon-shell .shift-time small{display:none}
  .dungeon-shell .dungeon-layout{display:flex;flex-direction:column;gap:6px}
  .dungeon-shell .dungeon-scene{aspect-ratio:1/1.05;max-height:52dvh;width:100%}
  .dungeon-shell .scene-label{display:none}
  .dungeon-shell .location-caption>span:not(.pill):not(.phone-hint):not(.scene-note){display:none}
  .dungeon-shell .dpad-btn small{display:none}
  .dungeon-shell .dpad-btn{min-height:40px}
  .dungeon-shell .side-panel{display:none}
}
/* ===== スマホ（横）：余計な文字を隠す ===== */
@media(orientation:landscape) and (max-height:560px){
  .dungeon-shell .location-caption>span:not(.pill):not(.phone-hint):not(.scene-note){display:none}
  .dungeon-shell .dpad-btn small{display:block;font-size:11px;line-height:1.1}
  .dungeon-shell .dpad-btn .dpad-arrow{font-size:14px;line-height:1}
  .dungeon-shell .dpad{grid-template-rows:repeat(3,auto)}
  .dungeon-shell .dpad-btn,.dungeon-shell .dpad-center{min-height:38px;padding:2px 3px}
  .dungeon-shell .travel-pad{max-height:none;overflow:visible}
  .dungeon-shell .scene-label{display:none}
  .dungeon-shell .game-heading{display:none}
}
.scene-note{color:#e3d7b8;font-size:var(--min-font);letter-spacing:.06em}
#rotate-note{display:none}
@media(max-width:700px) and (orientation:portrait){
  /* 入口・タイトルは、縦のままでも、押せる。探索中（ゲーム画面）だけ、横向きを促す */
  html:has(.dungeon-shell) #rotate-note{position:fixed;inset:0;z-index:100000;background:#0b100e;color:#e6dfc8;display:grid;place-items:center;text-align:center;padding:24px;font-size:20px;line-height:1.9;letter-spacing:.08em}
  #rotate-note small{display:block;margin:10px 0 16px;font-size:var(--min-font);color:#9aa69a;letter-spacing:.04em}
  #rotate-note button{min-height:48px;padding:8px 18px;font-size:15px}
}
/* ===== 手の操作（没入モード）：画面いっぱいの画像 ===== */
html.immersive .topbar{position:fixed;top:0;left:0;right:0;z-index:40;background:linear-gradient(#000b,#0000);border:0;padding:6px 10px;height:auto;min-height:0}
html.immersive .topbar .brand-name{opacity:.75;font-size:12px}
html.immersive .topbar .status-light,html.immersive .topbar .cross{display:none}
html.immersive .game-heading,html.immersive .side-panel,html.immersive .game-bottom{display:none!important}
html.immersive .dungeon-shell{position:fixed;inset:0;padding:0;margin:0;z-index:1;width:auto}
html.immersive .dungeon-layout{display:block;height:100%}
html.immersive .explore-area{position:absolute;inset:0;display:block}
html.immersive .dungeon-scene{position:absolute;inset:0;width:100%;height:100%;max-height:none;aspect-ratio:auto;border:0}
html.immersive .location-caption{position:absolute;left:12px;bottom:10px;z-index:20;background:#000a;padding:4px 10px;min-height:0;max-width:60%}
html.immersive .game-tools{position:absolute;right:104px;bottom:14px;z-index:30;display:flex;gap:6px;margin:0}
html.immersive .game-tools button{background:#000a;border:1px solid #4a5a50;min-height:34px;padding:2px 10px}
html.immersive .chase-bar{position:absolute;top:40px;left:12px;z-index:30;margin:0}
html.immersive .return-banner{position:absolute;left:50%;bottom:60px;transform:translateX(-50%);z-index:30;margin:0}
html.immersive .touch-layer{position:absolute;inset:0;z-index:15;touch-action:none;user-select:none;-webkit-user-select:none}
html.immersive .stick-ring{position:absolute;width:96px;height:96px;margin:-48px 0 0 -48px;border:2px solid #d8c9a366;border-radius:50%;opacity:0;pointer-events:none;transition:opacity .12s}
html.immersive .stick-ring.on{opacity:1}
html.immersive .stick-knob{position:absolute;left:50%;top:50%;width:36px;height:36px;margin:-18px 0 0 -18px;border-radius:50%;background:#d8c9a355}
html.immersive .touch-inspect{position:absolute;right:18px;bottom:18px;z-index:30;width:72px;height:72px;border-radius:50%;background:#101a14cc;border:2px solid #d8c9a3;color:#f1e8cf;font-size:14px}
html.immersive .touch-glance{position:absolute;right:18px;bottom:104px;z-index:30;width:56px;height:56px;border-radius:50%;background:#101a14cc;border:2px solid #b8593f;font-size:22px}
/* ===== 低い画面（スマホの横向きなど）：タイトル・入口の画面を、スクロールなしで、1画面に収める ===== */
@media(max-height:560px){
  html:has(.landing),html:has(.landing) body,html:has(.gate),html:has(.gate) body{height:100dvh;overflow:auto}
  html:has(.landing) .topbar{padding:4px 12px;height:auto;min-height:0}
  html:has(.landing) .topbar .brand-sub,html:has(.landing) .topbar .status-light{display:none}
  .landing{min-height:0;height:calc(100dvh - 44px)}
  .hero-copy{padding:8px 5vw 8px;max-width:none}
  .hero-copy h1{font-size:clamp(30px,8vh,48px);margin:2px 0 2px;line-height:1.2}
  .hero-sub{font-size:clamp(13px,3.6vh,18px);margin:0}
  .hero-description{font-size:13px;line-height:1.6;margin-top:6px}
  .hero-actions{margin-top:10px;gap:8px;flex-direction:row;flex-wrap:wrap}
  .hero-actions button{min-width:0;min-height:38px;padding:4px 14px;font-size:14px}
  .hero-note{display:none}
  .gate{min-height:0;height:100dvh;padding:6px 14px}
  .gate-card{gap:6px;max-width:720px}
  .gate-title{font-size:clamp(26px,8vh,40px)}
  .gate-phones{margin:0 auto;padding:4px 14px;font-size:14px}
  .gate-note{font-size:12px;line-height:1.5;margin:0}
  .gate-panel{padding:6px 10px;gap:6px}
  .gate-toggle{min-height:36px}
  .gate-load{min-height:1.2em;font-size:12px}
  .gate-enter{min-height:44px}
  .gate-credit{font-size:11px;line-height:1.4}
}
@media(max-height:560px){
  .gate-card>.gate-note{display:none}
  #gate-install .gate-note{display:block;font-size:11px}
  .gate-credit{display:none}
}
/* ===== セーフエリア：左右の文字が、切り欠きやブラウザの帯で切れないように ===== */
:root{--sal:env(safe-area-inset-left,0px);--sar:env(safe-area-inset-right,0px);--sab:env(safe-area-inset-bottom,0px)}
/* 切り欠きの分だけ、内側へ（切り欠きがない端末では、0 で、見た目は変わらない） */
.topbar,.dungeon-shell,.landing,.gate{margin-left:var(--sal);margin-right:var(--sar)}
@media(max-height:560px){
  .hero-copy{padding-left:max(60px,calc(var(--sal) + 28px));padding-right:max(40px,calc(var(--sar) + 20px))}
  .topbar{padding-left:max(56px,calc(var(--sal) + 28px));padding-right:max(56px,calc(var(--sar) + 28px))}
  .gate{padding-left:max(56px,calc(var(--sal) + 28px));padding-right:max(56px,calc(var(--sar) + 28px))}
}
html.immersive .topbar{padding-left:max(56px,calc(var(--sal) + 28px));padding-right:max(56px,calc(var(--sar) + 28px))}
html.immersive .location-caption{left:max(56px,calc(var(--sal) + 28px));bottom:max(10px,var(--sab))}
html.immersive .touch-inspect{right:max(58px,calc(var(--sar) + 28px));bottom:max(18px,calc(var(--sab) + 10px))}
html.immersive .touch-glance{right:max(58px,calc(var(--sar) + 28px))}
html.immersive .game-tools{right:max(146px,calc(var(--sar) + 116px));bottom:max(14px,calc(var(--sab) + 6px))}
html.immersive .chase-bar{left:max(56px,calc(var(--sal) + 28px))}
/* ブラウザのバーを小さくするための、ほんの少しの余白（スクロールできる分だけ、ページを長くする） */
/* 余白（スクロールできる分）は、タイトル・入口・没入モードだけ。通常のゲーム画面は、ずらさない */
html.bars-room:has(.landing) body,html.bars-room:has(.gate) body,html.bars-room.immersive body{min-height:calc(100dvh + 80px)}
@media(max-width:700px) and (orientation:portrait){
  .gate{min-height:0;height:100dvh;padding:10px 14px}
  .gate-card{gap:8px}
  .gate-card>.gate-note{display:none}
  #gate-install .gate-note{display:block;font-size:12px;line-height:1.6}
  .gate-credit{display:none}
}
/* ===== 縦画面を基本に：画像は上、操作は下（親指の届く所） ===== */
#rotate-note{display:none!important}
.zone-hint{display:none}
@media(orientation:portrait){
  html.immersive .dungeon-shell{background:#0b100e}
  html.immersive .dungeon-scene{bottom:auto;height:62dvh}
  html.immersive .location-caption{bottom:auto;top:calc(62dvh - 38px);left:12px;max-width:calc(100% - 24px)}
  html.immersive .chase-bar{top:44px}
  html.immersive .game-tools{bottom:auto;right:auto;left:12px;top:calc(62dvh + 10px)}
  html.immersive .touch-inspect{right:18px;bottom:calc(38dvh / 2 - 36px + var(--sab))}
  html.immersive .touch-glance{right:18px;bottom:calc(38dvh / 2 + 44px)}
  html.immersive .zone-hint{display:flex;position:absolute;top:calc(62dvh + 62px);bottom:0;flex-direction:column;align-items:center;justify-content:center;gap:4px;color:#8f9a90;font-size:13px;letter-spacing:.1em;text-align:center;border-top:1px solid #1f2a24;pointer-events:none}
  html.immersive .zone-hint b{font-weight:400;color:#c9c2a8;font-size:15px}
  html.immersive .zone-l{left:0;width:50%}
  html.immersive .zone-r{right:0;width:50%;border-left:1px solid #1f2a24}
  html.immersive .return-banner{bottom:calc(38dvh + 12px)}
}
/* 縦画面：上のボタンを折り返さない／操作エリアの重なりをなくす */
html.immersive .topbar{flex-wrap:nowrap}
html.immersive .top-tools{display:flex;flex-wrap:nowrap;gap:4px;margin-left:auto}
html.immersive .top-tools button,html.immersive .topbar .brand-name{white-space:nowrap}
html.immersive .top-tools button{font-size:12px;padding:4px 6px}
@media(orientation:portrait){
  html.immersive .zone-hint{justify-content:flex-start;padding-top:18px}
  html.immersive .touch-inspect{bottom:calc(env(safe-area-inset-bottom,0px) + 22px)}
  html.immersive .touch-glance{bottom:calc(env(safe-area-inset-bottom,0px) + 106px)}
}
.guide-step{margin:14px 0}
.guide-step b{display:block;margin-bottom:6px;color:#e6dfc8;font-weight:600;line-height:1.6}
.guide-step small{display:block;color:#9aa69a;margin-top:4px}
.guide-step svg{display:block;max-width:360px;margin:0 auto}
/* ===== 縦画面の仕上げ ===== */
@media(orientation:portrait){
  html.immersive .topbar{padding-left:max(12px,calc(var(--sal) + 8px));padding-right:max(12px,calc(var(--sar) + 8px))}
  html.immersive .location-caption{flex-wrap:nowrap;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;height:34px;align-items:center}
  html.immersive .location-caption>span:not(.pill):not(.phone-hint):not(.scene-note){display:none}
  html.immersive .return-banner{bottom:calc(38dvh + 52px)}
}
@media(max-width:700px) and (orientation:portrait) and (max-height:700px){
  .gate{padding:6px 12px}
  .gate-card{gap:5px}
  .gate-title{font-size:34px}
  .gate-phones{padding:4px 12px;font-size:14px}
  .gate-panel{padding:6px 10px;gap:6px}
  .gate-toggle{min-height:38px;font-size:14px}
  #gate-install .gate-note{font-size:11px;line-height:1.5;margin:0}
  .gate-load{min-height:1em;font-size:12px}
  .gate-enter{min-height:46px}
}
/* ===== 会話の場面（師長の画像つき・タップで次へ） ===== */
.talk-scene{position:fixed;inset:0;z-index:100001;background:#05080a;color:#ece6d2;display:flex;flex-direction:column;cursor:pointer;user-select:none;-webkit-user-select:none}
.talk-bg{position:absolute;inset:0;background:url('assets/old-ward-corridor.webp') center/cover no-repeat;filter:blur(7px) brightness(.32) saturate(.8);transform:scale(1.08)}
.talk-portrait{position:absolute;left:50%;bottom:calc(27dvh - 6px);transform:translateX(-50%);height:min(66dvh,calc(100vw * 1.45));max-width:96vw;object-fit:contain;transition:filter .25s,opacity .25s;-webkit-mask-image:linear-gradient(#000 82%,transparent 100%);mask-image:linear-gradient(#000 82%,transparent 100%)}
.talk-portrait.dim{filter:brightness(.55) saturate(.7)}
.talk-eyebrow{position:absolute;top:max(14px,env(safe-area-inset-top,0px));left:16px;color:#d8b56f;letter-spacing:.14em;font-size:14px;z-index:2}
.talk-box{position:absolute;left:10px;right:10px;bottom:max(10px,env(safe-area-inset-bottom,0px));min-height:23dvh;padding:12px 16px 30px;background:#0b100ef2;border:1px solid #5a6a5e;z-index:2}
.talk-name{color:#d8b56f;font-size:14px;letter-spacing:.12em;min-height:1.4em}
.talk-text{margin:6px 0 0;font:19px/1.85 "Yu Mincho","Hiragino Mincho ProN",serif;opacity:0}
.talk-text.in{animation:talk-in .28s ease-out forwards}
@keyframes talk-in{from{opacity:0;transform:translateY(4px)}to{opacity:1;transform:none}}
.talk-next{position:absolute;right:14px;bottom:8px;color:#9aa69a;font-size:13px;animation:talk-blink 1.4s infinite}
@keyframes talk-blink{50%{opacity:.35}}
.talk-skip{position:absolute;top:max(10px,env(safe-area-inset-top,0px));right:12px;z-index:3;background:#000a;border:1px solid #6d5a3c;color:#e6dfc8;padding:6px 14px;font-size:13px}
html.reduced .talk-text.in,html.reduced .talk-next{animation:none;opacity:1}
/* ===== 十字キー（バイオハザード4のような、上下左右のボタン）。画面の下に、大きく ===== */
html.immersive,html.immersive *{-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}
html.immersive .travel-pad{display:block;position:absolute;left:0;right:0;bottom:0;z-index:30;border:0;border-top:1px solid #1f2a24;background:#0b100e;padding:10px 14px calc(10px + env(safe-area-inset-bottom,0px))}
html.immersive .travel-pad .dpad{max-width:340px;margin:0 auto;height:100%;grid-template-rows:repeat(3,minmax(44px,1fr));gap:8px}
html.immersive .travel-pad .dpad-btn,html.immersive .travel-pad .dpad-center{min-height:44px;font-size:15px}
html.immersive .travel-pad .dpad-btn .dpad-arrow{font-size:22px}
html.immersive .travel-pad .dpad-btn small{display:block;font-size:12px}
html.immersive .travel-pad .dpad-extra{position:absolute;right:12px;top:-52px;margin:0}
html.immersive .travel-pad .dpad-extra button{background:#101a14cc;border:2px solid #b8593f;min-height:44px}
html.immersive .game-tools{top:36px;left:12px;right:auto;bottom:auto}
html.immersive .chase-bar{top:76px}
html.immersive .touch-inspect,html.immersive .touch-glance,html.immersive .zone-hint{display:none!important}
@media(orientation:portrait){
  html.immersive .travel-pad{height:38dvh}
  html.immersive .game-tools{top:36px}
}
@media(orientation:landscape){
  html.immersive .travel-pad{left:auto;right:10px;bottom:10px;width:min(300px,42vw);height:auto;border:1px solid #2b372f;background:#0b100ecc;padding:8px}
  html.immersive .travel-pad .dpad{grid-template-rows:repeat(3,44px)}
}
/* 公開後の検証の指摘の修正 */
html,html body{-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}
input,textarea{-webkit-user-select:text;user-select:text}
@media(orientation:landscape){
  html.immersive .return-banner{left:12px;right:auto;transform:none;bottom:60px;max-width:calc(100vw - min(300px,42vw) - 40px)}
  html.immersive .travel-pad .dpad-extra{top:-60px}
}
html.immersive .travel-pad .dpad-extra button{font-size:14px;padding:4px 10px;white-space:nowrap}
html.immersive .game-tools{top:50px}
html.immersive .chase-bar{top:88px}
/* ===== 写真をタップして調べる／チュートリアル ===== */
.dpad-hint{display:flex;align-items:center;justify-content:center;text-align:center;font-size:12px;line-height:1.5;color:#9aa69a;border:1px dashed #3d4a41;min-height:44px}
.dungeon-scene{cursor:pointer}
.tutorial{position:fixed;inset:0;z-index:100002;background:#000000d0;display:flex;align-items:flex-start;justify-content:center;padding:max(16px,env(safe-area-inset-top,0px)) 14px 0}
.tutorial.step-pad{background:linear-gradient(#000000e0 0,#000000e0 52%,#0000 66%)}
.tut-card{width:min(420px,100%);margin-top:6dvh;background:#0f1612;border:1px solid #6d5a3c;padding:16px 18px;text-align:center}
.tut-step{color:#d8b56f;font-size:13px;letter-spacing:.12em}
.tut-card h2{font:22px/1.4 "Yu Mincho",serif;margin:6px 0 8px}
.tut-card p{font-size:16px;line-height:1.8;color:#d9dccf;margin:0}
.tut-anim{position:relative;height:96px;margin:6px 0 10px;overflow:hidden}
.tut-swipe::before,.tut-tap::before{content:"👆";position:absolute;left:calc(50% - 22px);top:26px;font-size:44px;line-height:1}
.tut-swipe::before{animation:tut-swipe 1.8s ease-in-out infinite}
.tut-tap::before{animation:tut-press 1.4s ease-in-out infinite}
.tut-tap::after{content:"";position:absolute;left:calc(50% - 20px);top:14px;width:40px;height:40px;border:3px solid #d8c9a3;border-radius:50%;opacity:0;animation:tut-ripple 1.4s ease-out infinite}
.tut-pad::before{content:"↑　←　→　↓";display:block;text-align:center;font-size:30px;line-height:96px;letter-spacing:.1em;color:#e6dfc8;animation:tut-blink 1.2s ease-in-out infinite}
@keyframes tut-swipe{0%,100%{transform:translateX(-96px)}50%{transform:translateX(96px)}}
@keyframes tut-press{0%,100%{transform:translateY(0)}50%{transform:translateY(-10px)}}
@keyframes tut-ripple{0%,40%{opacity:0;transform:scale(.4)}60%{opacity:1}100%{opacity:0;transform:scale(1.6)}}
@keyframes tut-blink{50%{opacity:.35}}
.tut-actions{display:flex;gap:10px;justify-content:center}
.tut-actions button{min-width:110px;min-height:44px}
html.reduced .tut-anim::before,html.reduced .tut-anim::after{animation:none}
/* 走るボタン（十字キーの右下） */
.dpad .run-btn{grid-column:3;grid-row:3;background:#2a1d17;border:2px solid #b8593f;color:#f1e8cf;font-size:16px;min-height:44px;border-radius:50%;touch-action:none}
.dpad .run-btn.on{background:#5a2a1c}
html.immersive .travel-pad .run-btn{width:min(100%,92px);height:auto;aspect-ratio:1;justify-self:center;align-self:center}
.menu-list{display:grid;gap:10px;margin:14px 0}
.menu-list button{min-height:48px;text-align:left;padding:8px 16px}
.menu-note{color:#9aa69a;font-size:13px;line-height:1.7;margin:0}
/* 読みやすさ：お知らせ（toast）は暗い色で、画像の下に。解説は、折り返して、全文を表示 */
.toast{background:#0b100ef0;color:#ece6d2;border:1px solid #6d5a3c;font-size:15px;line-height:1.8;text-align:left;padding:12px 16px}
html.immersive .toast{bottom:calc(38dvh + 16px);max-width:calc(100vw - 24px)}
@media(orientation:landscape){html.immersive .toast{bottom:calc(max(10px,var(--sab)) + 96px);left:12px;transform:none;max-width:calc(100vw - min(300px,42vw) - 40px)}}
html.immersive .location-caption>span,html.immersive .location-caption{white-space:normal!important}
@media(orientation:portrait){
  html.immersive .location-caption{top:auto!important;bottom:calc(38dvh + 6px);height:auto;overflow:visible;flex-wrap:wrap;max-width:calc(100% - 24px);padding:6px 10px;align-items:flex-start;text-overflow:clip}
  html.immersive .toast{bottom:calc(38dvh + 72px)}
}
@media(orientation:portrait){
  html.immersive .toast{left:12px;transform:none;width:calc(100vw - 24px);max-width:none;bottom:calc(38dvh + 112px)}
}
/* 抵抗の場面：画面の揺れ・残り時間の線 */
.dialog-body.struggle{animation:struggle-shake .5s linear 3}
.struggle-text{font-size:17px;line-height:2}
.struggle-bar{height:3px;margin:14px 0 4px;background:#b3563f;transform-origin:left;animation:struggle-bar linear forwards}
@keyframes struggle-shake{0%,100%{translate:0 0}20%{translate:-4px 2px}40%{translate:5px -3px}60%{translate:-3px -2px}80%{translate:4px 3px}}
@keyframes struggle-bar{from{transform:scaleX(1)}to{transform:scaleX(0)}}
@media(prefers-reduced-motion:reduce){.dialog-body.struggle{animation:none}}
/* 名前の登録 */
.name-row{display:block;margin:14px 0 4px}
.name-row input{width:100%;box-sizing:border-box;font-size:20px;padding:12px 14px;background:#0b100e;color:#ece6d2;border:1px solid #6d5a3c;border-radius:6px}
/* 逃げる場面の操作 */
.chase-actions{display:flex;flex-direction:column;gap:6px;width:100%}
.pace-row{display:flex;gap:6px;justify-content:center}
.pace-row button{flex:1;min-height:40px;padding:6px 8px;font-size:14px}
.pace-btn.on{background:#5a2a1c;border-color:#b8593f;color:#f1e8cf}
/* 逃げる場面の操作パネル：十字キーの上に、2段で並べる（十字キーに重ならない） */
html.immersive .travel-pad .dpad-extra.chase-actions{left:8px;right:8px;top:-104px;width:auto}
html.immersive .travel-pad .dpad-extra.chase-actions button{min-height:44px;font-size:14px;padding:4px 6px}
@media(orientation:portrait){html.immersive:has(.chase-actions) .toast{bottom:calc(38dvh + 118px + 72px)}}
html.immersive .travel-pad .dpad-extra button.pace-btn.on{background:#6a2f1f;color:#fff3dc;box-shadow:inset 0 0 0 1px #f0a37c}
/* 窓に一瞬だけ映る顔 */
.glass-flash{position:fixed;inset:0;z-index:95;pointer-events:none;background:#04080acc url(assets/ghost-closeup.webp) center/cover no-repeat;opacity:0;mix-blend-mode:screen;animation:glass-flash .65s ease-out both}
@keyframes glass-flash{0%{opacity:0}18%{opacity:.5}55%{opacity:.18}100%{opacity:0}}
/* 場面の画像（選択・一本道の場面） */
.choice-image{display:block;width:100%;max-height:34dvh;object-fit:cover;border-radius:6px;margin:6px 0 10px;filter:brightness(.95)}
/* 入口：最初から始める */
.gate-new{display:block;width:100%;margin-top:10px;min-height:44px;font-size:14px;color:#cdbfa3;background:transparent;border:1px solid #5b4b33}
/* 生還エンドの師長の顔 */
.ending-nurse{display:block;width:min(70%,240px);margin:16px auto;border-radius:8px;filter:brightness(.92)}
/* 廊下の向こうを歩いていく幽霊（影のように。足取りに合わせて、わずかに上下・傾く） */
.ghost-pass{position:absolute;z-index:4;left:50%;bottom:34%;width:12%;height:34%;margin-left:-6%;pointer-events:none;opacity:0;animation:ghost-pass-move 6s linear both}
.ghost-pass-body{width:100%;height:100%;background:url('assets/ghost-nurse.webp') center bottom/contain no-repeat;filter:brightness(.42) saturate(.3) contrast(1.15) blur(.5px);transform-origin:50% 100%;animation:ghost-pass-bob .74s ease-in-out infinite}
@keyframes ghost-pass-move{
  0%{opacity:0;transform:translate(-210%,70%) scale(1.15)}
  12%{opacity:.85}
  70%{opacity:.7}
  100%{opacity:0;transform:translate(-8%,-18%) scale(.28)}
}
@keyframes ghost-pass-bob{0%,100%{transform:translateY(0) rotate(-1.4deg)}50%{transform:translateY(-3%) rotate(1.4deg)}}
.ending-ghost{width:min(86%,420px)}
/* 距離の表示：左＝離れる／右＝追いつかれる。時間切れの線 */
.chase-track-wrap{display:flex;align-items:center;gap:8px;width:100%}
.chase-lbl{font-size:12px;white-space:nowrap;letter-spacing:.04em}
.chase-lbl.l{color:#9ad1a8}.chase-lbl.r{color:#ff9d84}
.chase-track{display:flex;gap:3px;flex:1;min-width:0}
.chase-track i{flex:1;height:14px;border-radius:2px;background:#26382c}
.chase-track i.ghost{background:#f2e9d8;box-shadow:0 0 8px #fff9}
.chase-track i.caught{background:#6b1f17}
.chase-idle{width:100%;height:3px;background:#3a1f1a;margin-top:2px}
.chase-idle b{display:block;height:100%;width:0;background:#ff7a5c;transition:width 1s linear}
/* バッドエンドの前の演出 */
.cine{position:fixed;inset:0;z-index:300;background:#000;overflow:hidden}
.cine-img{position:absolute;inset:-6%;background-size:cover;background-position:center}
.cine-a .cine-img{animation:cine-zoom 1.5s ease-in both}
@keyframes cine-zoom{0%{transform:scale(1);filter:brightness(.55)}100%{transform:scale(1.4);filter:brightness(1.05)}}
.cine-b .cine-img{animation:cine-shake .1s linear 9,cine-flash .9s ease-out both}
@keyframes cine-shake{0%{translate:-2% 1%;scale:1.18}50%{translate:2% -1.5%;scale:1.26}100%{translate:-1% -2%;scale:1.18}}
@keyframes cine-flash{0%{filter:brightness(2.6) contrast(1.35)}100%{filter:brightness(.9)}}
.cine-c .cine-img{animation:cine-eye 1.1s ease-in both}
@keyframes cine-eye{0%{transform:scale(1);filter:brightness(.5)}55%{filter:brightness(1.1)}100%{transform:scale(1.75);filter:brightness(1.35)}}
.cine-d .cine-img{animation:cine-pan 2.2s ease-out both}
@keyframes cine-pan{0%{transform:scale(1.25) translateX(-3%);filter:brightness(.6)}100%{transform:scale(1.25) translateX(3%);filter:brightness(.95)}}
.cine-e .cine-img{animation:cine-strobe .35s steps(3,end) both}
@keyframes cine-strobe{0%{filter:brightness(2.2) contrast(1.5);transform:scale(1.15)}40%{filter:brightness(.4)}100%{filter:brightness(1.2);transform:scale(1.3)}}
.cine-still .cine-img{animation:none!important;filter:brightness(.9)}
.ending-strip{display:flex;gap:8px;justify-content:center;width:min(86%,420px);margin:0 auto 16px}
.ending-strip img{flex:1 1 0;min-width:0;aspect-ratio:16/9;object-fit:cover;border-radius:6px;filter:brightness(.8) saturate(.8)}

/* 文章ごとの演出：画像の動き */
.fx-wrap{overflow:hidden;border-radius:6px;margin:6px 0 10px}.fx-wrap .choice-image{margin:0;border-radius:0}
.choice-image.fx-zoom{animation:fx-zoom 7s ease-out both}
.choice-image.fx-shake{animation:fx-shake .14s linear 14}
.choice-image.fx-flash{animation:fx-flash .8s ease-out both}
.choice-image.fx-pan{animation:fx-pan 8s ease-in-out both;scale:1.18}
.choice-image.fx-fade{animation:fx-fade 2s ease-out both}
.choice-image.fx-pulse{animation:fx-pulse 1.4s ease-in-out 4}
html.reduced .choice-image[class*="fx-"]{animation:none!important;scale:1}   /* 「動きを減らす」設定では、画像を動かさない */
/* 画像の動き：突然バンと出る／一瞬だけ見えて消える／血が飛び散る */
.choice-image.fx-pop{animation:fx-pop 1.7s both}
.choice-image.fx-blink{animation:fx-blink 1.6s both}
.choice-image.fx-blood{animation:fx-bloodimg .9s ease-out both}
.fx-wrap{position:relative}
.fx-blood-splat{position:absolute;inset:0;pointer-events:none;background:url("data:image/svg+xml,%3Csvg%20xmlns=%22http://www.w3.org/2000/svg%22%20viewBox=%220%200%20500%20250%22%20preserveAspectRatio=%22xMidYMid%20slice%22%3E%3Cdefs%3E%3Cfilter%20id=%22r%22%20x=%22-20%25%22%20y=%22-20%25%22%20width=%22140%25%22%20height=%22140%25%22%3E%3CfeTurbulence%20type=%22fractalNoise%22%20baseFrequency=%220.03%22%20numOctaves=%223%22%20seed=%225%22/%3E%3CfeDisplacementMap%20in=%22SourceGraphic%22%20scale=%2230%22/%3E%3C/filter%3E%3C/defs%3E%3Cg%20filter=%22url%28%23r%29%22%20opacity=%220.93%22%3E%3Ccircle%20cx=%22250%22%20cy=%2295%22%20r=%2246%22%20fill=%22%237d0707%22/%3E%3Ccircle%20cx=%22216%22%20cy=%22117%22%20r=%2230%22%20fill=%22%236a0505%22/%3E%3Ccircle%20cx=%22288%22%20cy=%2277%22%20r=%2226%22%20fill=%22%238e0a0a%22/%3E%3Cellipse%20cx=%22230%22%20cy=%22135%22%20rx=%2241%22%20ry=%229%22%20transform=%22rotate%28117%20230%20135%29%22%20fill=%22%237a0606%22/%3E%3Cellipse%20cx=%22306%22%20cy=%22122%22%20rx=%2256%22%20ry=%227%22%20transform=%22rotate%2826%20306%20122%29%22%20fill=%22%237a0606%22/%3E%3Cellipse%20cx=%22307%22%20cy=%22117%22%20rx=%2255%22%20ry=%224%22%20transform=%22rotate%2821%20307%20117%29%22%20fill=%22%237a0606%22/%3E%3Cellipse%20cx=%22212%22%20cy=%22112%22%20rx=%2238%22%20ry=%225%22%20transform=%22rotate%28156%20212%20112%29%22%20fill=%22%237a0606%22/%3E%3Cellipse%20cx=%22183%22%20cy=%22129%22%20rx=%2268%22%20ry=%225%22%20transform=%22rotate%28153%20183%20129%29%22%20fill=%22%237a0606%22/%3E%3Cellipse%20cx=%22261%22%20cy=%22160%22%20rx=%2260%22%20ry=%2211%22%20transform=%22rotate%2880%20261%20160%29%22%20fill=%22%237a0606%22/%3E%3Cellipse%20cx=%22200%22%20cy=%2269%22%20rx=%2251%22%20ry=%2211%22%20transform=%22rotate%28208%20200%2069%29%22%20fill=%22%237a0606%22/%3E%3Cellipse%20cx=%22323%22%20cy=%22117%22%20rx=%2269%22%20ry=%226%22%20transform=%22rotate%2817%20323%20117%29%22%20fill=%22%237a0606%22/%3E%3Cellipse%20cx=%22277%22%20cy=%22129%22%20rx=%2240%22%20ry=%226%22%20transform=%22rotate%2852%20277%20129%29%22%20fill=%22%237a0606%22/%3E%3Cellipse%20cx=%22269%22%20cy=%2253%22%20rx=%2242%22%20ry=%228%22%20transform=%22rotate%28294%20269%2053%29%22%20fill=%22%237a0606%22/%3E%3Cellipse%20cx=%22215%22%20cy=%2253%22%20rx=%2250%22%20ry=%228%22%20transform=%22rotate%28230%20215%2053%29%22%20fill=%22%237a0606%22/%3E%3Cellipse%20cx=%22288%22%20cy=%22111%22%20rx=%2237%22%20ry=%225%22%20transform=%22rotate%2823%20288%20111%29%22%20fill=%22%237a0606%22/%3E%3Cellipse%20cx=%22226%22%20cy=%2243%22%20rx=%2252%22%20ry=%226%22%20transform=%22rotate%28245%20226%2043%29%22%20fill=%22%237a0606%22/%3E%3Cellipse%20cx=%22200%22%20cy=%2265%22%20rx=%2253%22%20ry=%226%22%20transform=%22rotate%28211%20200%2065%29%22%20fill=%22%237a0606%22/%3E%3Ccircle%20cx=%22324%22%20cy=%22-60%22%20r=%223.7%22%20fill=%22%238a0808%22/%3E%3Ccircle%20cx=%2250%22%20cy=%2234%22%20r=%228.1%22%20fill=%22%238a0808%22/%3E%3Ccircle%20cx=%22229%22%20cy=%22-2%22%20r=%228.9%22%20fill=%22%238a0808%22/%3E%3Ccircle%20cx=%22395%22%20cy=%22175%22%20r=%227.3%22%20fill=%22%238a0808%22/%3E%3Ccircle%20cx=%22374%22%20cy=%22200%22%20r=%222.3%22%20fill=%22%238a0808%22/%3E%3Ccircle%20cx=%22110%22%20cy=%22-54%22%20r=%226.0%22%20fill=%22%238a0808%22/%3E%3Ccircle%20cx=%22371%22%20cy=%2223%22%20r=%226.9%22%20fill=%22%238a0808%22/%3E%3Ccircle%20cx=%2253%22%20cy=%2215%22%20r=%225.2%22%20fill=%22%238a0808%22/%3E%3Ccircle%20cx=%22427%22%20cy=%22-73%22%20r=%225.3%22%20fill=%22%238a0808%22/%3E%3Ccircle%20cx=%22196%22%20cy=%2241%22%20r=%226.9%22%20fill=%22%238a0808%22/%3E%3Ccircle%20cx=%2243%22%20cy=%22-69%22%20r=%227.8%22%20fill=%22%238a0808%22/%3E%3Ccircle%20cx=%22209%22%20cy=%22205%22%20r=%226.7%22%20fill=%22%238a0808%22/%3E%3Ccircle%20cx=%22456%22%20cy=%22113%22%20r=%223.2%22%20fill=%22%238a0808%22/%3E%3Ccircle%20cx=%22328%22%20cy=%22137%22%20r=%227.4%22%20fill=%22%238a0808%22/%3E%3Ccircle%20cx=%22355%22%20cy=%22162%22%20r=%224.7%22%20fill=%22%238a0808%22/%3E%3Ccircle%20cx=%22326%22%20cy=%2247%22%20r=%225.1%22%20fill=%22%238a0808%22/%3E%3Ccircle%20cx=%22-50%22%20cy=%2237%22%20r=%227.7%22%20fill=%22%238a0808%22/%3E%3Ccircle%20cx=%22356%22%20cy=%2222%22%20r=%224.9%22%20fill=%22%238a0808%22/%3E%3Ccircle%20cx=%2251%22%20cy=%22242%22%20r=%228.7%22%20fill=%22%238a0808%22/%3E%3Ccircle%20cx=%22329%22%20cy=%22161%22%20r=%223.6%22%20fill=%22%238a0808%22/%3E%3Ccircle%20cx=%22272%22%20cy=%22222%22%20r=%226.1%22%20fill=%22%238a0808%22/%3E%3Ccircle%20cx=%22243%22%20cy=%22149%22%20r=%224.9%22%20fill=%22%238a0808%22/%3E%3Ccircle%20cx=%2290%22%20cy=%22198%22%20r=%228.7%22%20fill=%22%238a0808%22/%3E%3Ccircle%20cx=%22169%22%20cy=%22-29%22%20r=%226.3%22%20fill=%22%238a0808%22/%3E%3Ccircle%20cx=%22204%22%20cy=%2239%22%20r=%228.3%22%20fill=%22%238a0808%22/%3E%3Ccircle%20cx=%22309%22%20cy=%22-89%22%20r=%227.6%22%20fill=%22%238a0808%22/%3E%3Ccircle%20cx=%22100%22%20cy=%22167%22%20r=%222.7%22%20fill=%22%238a0808%22/%3E%3Ccircle%20cx=%22180%22%20cy=%2248%22%20r=%222.5%22%20fill=%22%238a0808%22/%3E%3Ccircle%20cx=%22284%22%20cy=%22171%22%20r=%224.4%22%20fill=%22%238a0808%22/%3E%3Ccircle%20cx=%22335%22%20cy=%22113%22%20r=%223.1%22%20fill=%22%238a0808%22/%3E%3Ccircle%20cx=%22397%22%20cy=%22160%22%20r=%222.2%22%20fill=%22%238a0808%22/%3E%3Ccircle%20cx=%22424%22%20cy=%22-10%22%20r=%223.0%22%20fill=%22%238a0808%22/%3E%3Ccircle%20cx=%22247%22%20cy=%22202%22%20r=%224.5%22%20fill=%22%238a0808%22/%3E%3Ccircle%20cx=%22470%22%20cy=%22223%22%20r=%229.0%22%20fill=%22%238a0808%22/%3E%3Ccircle%20cx=%2270%22%20cy=%22170%22%20r=%2230%22%20fill=%22%23780606%22/%3E%3Ccircle%20cx=%2248%22%20cy=%22150%22%20r=%2214%22%20fill=%22%238a0a0a%22/%3E%3Ccircle%20cx=%22100%22%20cy=%22190%22%20r=%2212%22%20fill=%22%23700505%22/%3E%3Ccircle%20cx=%22138%22%20cy=%22153%22%20r=%221.9%22%20fill=%22%238a0808%22/%3E%3Ccircle%20cx=%22120%22%20cy=%22143%22%20r=%222.7%22%20fill=%22%238a0808%22/%3E%3Ccircle%20cx=%22112%22%20cy=%22164%22%20r=%221.6%22%20fill=%22%238a0808%22/%3E%3Ccircle%20cx=%22140%22%20cy=%22171%22%20r=%222.2%22%20fill=%22%238a0808%22/%3E%3Ccircle%20cx=%22102%22%20cy=%22158%22%20r=%223.9%22%20fill=%22%238a0808%22/%3E%3Ccircle%20cx=%22165%22%20cy=%22176%22%20r=%224.6%22%20fill=%22%238a0808%22/%3E%3Ccircle%20cx=%22125%22%20cy=%22147%22%20r=%222.3%22%20fill=%22%238a0808%22/%3E%3Ccircle%20cx=%22142%22%20cy=%22164%22%20r=%225.0%22%20fill=%22%238a0808%22/%3E%3Ccircle%20cx=%22116%22%20cy=%22151%22%20r=%225.2%22%20fill=%22%238a0808%22/%3E%3Ccircle%20cx=%22164%22%20cy=%22177%22%20r=%225.1%22%20fill=%22%238a0808%22/%3E%3Ccircle%20cx=%22158%22%20cy=%22167%22%20r=%222.5%22%20fill=%22%238a0808%22/%3E%3Ccircle%20cx=%22128%22%20cy=%22155%22%20r=%221.6%22%20fill=%22%238a0808%22/%3E%3Ccircle%20cx=%22114%22%20cy=%22143%22%20r=%222.7%22%20fill=%22%238a0808%22/%3E%3Ccircle%20cx=%22176%22%20cy=%22161%22%20r=%223.5%22%20fill=%22%238a0808%22/%3E%3C/g%3E%3C/svg%3E") center/cover no-repeat;transform-origin:50% 38%;animation:fx-splat 1.1s cubic-bezier(.12,.9,.25,1) both,fx-drip 6s ease-in 1.1s both;mix-blend-mode:normal}
html.reduced .fx-blood-splat{animation:none!important}
@keyframes fx-pop{0%,52%{opacity:0;transform:scale(.85)}53%{opacity:1;transform:scale(1.38);filter:brightness(3.2) contrast(1.4)}68%{transform:scale(1.12);filter:brightness(1.6)}100%{opacity:1;transform:scale(1);filter:brightness(.95)}}
@keyframes fx-blink{0%,34%{opacity:0}35%{opacity:1;transform:scale(1.12);filter:brightness(2.4) contrast(1.3)}55%{opacity:1;transform:scale(1.04);filter:brightness(1.2)}58%,100%{opacity:0}}
@keyframes fx-bloodimg{0%{filter:brightness(2.2) saturate(1.6) hue-rotate(-15deg);transform:scale(1.08)}100%{filter:brightness(.8) saturate(1.2);transform:scale(1)}}
@keyframes fx-splat{0%{opacity:0;transform:scale(.15)}12%{opacity:1}100%{opacity:1;transform:scale(1)}}
@keyframes fx-drip{from{background-position:50% 50%}to{background-position:50% 54%}}

@keyframes fx-zoom{from{transform:scale(1)}to{transform:scale(1.3)}}
@keyframes fx-shake{0%{transform:translate(-1.5%,1%) scale(1.06)}50%{transform:translate(1.5%,-1%) scale(1.08)}100%{transform:translate(-1%,-1.5%) scale(1.06)}}
@keyframes fx-flash{0%{filter:brightness(3) contrast(1.4)}100%{filter:brightness(.95)}}
@keyframes fx-pan{from{transform:translateX(-5%)}to{transform:translateX(5%)}}
@keyframes fx-fade{from{opacity:0}to{opacity:1}}
@keyframes fx-pulse{0%,100%{filter:brightness(.55)}50%{filter:brightness(1.3)}}

/* ===== 突き当たりの幽霊（押している間＝動かない／離している間＝後ずさる） ===== */
.ghost-turn{touch-action:none;-webkit-user-select:none;user-select:none;-webkit-touch-callout:none;cursor:pointer}
.ghost-turn .gt-scene{position:relative;width:100%;aspect-ratio:4/3;max-height:46vh;overflow:hidden;border-radius:8px;background:#000;margin:6px 0 10px}
.ghost-turn .gt-bg{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;filter:brightness(.7) contrast(1.05)}
.ghost-turn .gt-ghost{position:absolute;left:50%;bottom:0;height:88%;width:auto;transform:translateX(-50%) scale(var(--gt-scale,1));transform-origin:50% 100%;transition:transform .35s linear;pointer-events:none}
.ghost-turn.omen .gt-scene{animation:gt-shiver .18s linear infinite}
.ghost-turn.look .gt-scene{box-shadow:0 0 0 2px #b3563f,0 0 28px #b3563f88}
.ghost-turn .gt-text{margin:6px 0;min-height:3em;line-height:1.7}
.ghost-turn .gt-bar{height:5px;background:#ffffff1a;border-radius:3px;overflow:hidden;margin:4px 0 8px}
.ghost-turn .gt-bar b{display:block;height:100%;width:0;background:#78c28c;transition:width .1s linear}
.ghost-turn .gt-howto{font-size:.82em;opacity:.8;margin:4px 0 10px;line-height:1.6}
.ghost-turn .gt-hold{width:100%;min-height:64px;font-size:1.05em;touch-action:none}
.ghost-turn .gt-hold.on{background:#b3563f;border-color:#e09a85}
@keyframes gt-shiver{0%{transform:translate(0,0)}25%{transform:translate(1px,-1px)}50%{transform:translate(-1px,1px)}75%{transform:translate(1px,1px)}100%{transform:translate(0,0)}}
@media (prefers-reduced-motion:reduce){.ghost-turn.omen .gt-scene{animation:none}.ghost-turn .gt-ghost{transition:none}}
.dialog-body.struggle.still{animation:none}
/* 場面ごとの、枠の動き（管理画面の「場面ごとの演出」で選ぶ） */
.dialog-body.sbox-shake{animation:struggle-shake .5s linear 3}
.dialog-body.sbox-fade{animation:sbox-fade .9s ease-out}
.dialog-body.sbox-zoom{animation:sbox-zoom 1.3s ease-out}
@keyframes sbox-fade{from{opacity:0}to{opacity:1}}
@keyframes sbox-zoom{from{transform:scale(.94);opacity:.4}to{transform:scale(1);opacity:1}}
html.reduced .dialog-body[class*="sbox-"]{animation:none}
@media(prefers-reduced-motion:reduce){.dialog-body[class*="sbox-"]{animation:none}}
/* 結果画面：背景画像を設定していない時は、上の空きを作らない */
.ending-page.no-bg{grid-template-columns:1fr;grid-template-rows:auto;min-height:0;align-items:start}.ending-page.no-bg .ending-image{display:none}.ending-page.no-bg .ending-copy{align-self:start}

/* 申し送りの手書き（逃げきった後） */
.handover{margin:20px 0 6px;padding:14px 18px 10px;background:#d6cdb8;color:#2a2018;border:1px solid #8c806a;box-shadow:0 6px 18px #0009;transform:rotate(-.5deg);max-width:620px}
.handover-title{font-size:13px;letter-spacing:.3em;color:#5a4d3a;border-bottom:1px solid #8c806a88;padding-bottom:4px;margin-bottom:6px}
.hw{display:block;width:100%;height:auto;overflow:visible}
.hw path{fill:none;stroke:#2a2018;stroke-width:4.6;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:1;stroke-dashoffset:1}
.hw .hw-sig path{stroke:#7b1616;stroke-width:5.2}
.hw.go path{animation:hw-draw var(--s,.25s) linear forwards;animation-delay:var(--d)}
.hw.instant path{stroke-dashoffset:0}
@keyframes hw-draw{to{stroke-dashoffset:0}}
@media(prefers-reduced-motion:reduce){.hw path{stroke-dashoffset:0;animation:none!important}}

.choice-image.letter-img{object-fit:contain;max-height:40dvh;aspect-ratio:1/1;width:auto;margin:6px auto 10px;box-shadow:0 4px 14px #000a}

/* 停電：非常灯の赤い光だけが、わずかに灯る（赤い光を頼りに、ナースステーションへ） */
.blackout-layer{position:absolute;inset:0;z-index:8;pointer-events:none;background:radial-gradient(circle at 16% 12%,rgba(255,40,30,.34),transparent 34vmin),radial-gradient(circle at 50% 55%,rgba(60,0,4,.4),rgba(14,0,2,.9) 70vmin);animation:emerg 3.4s ease-in-out infinite}
@keyframes emerg{50%{opacity:.8}}
@media(prefers-reduced-motion:reduce){.blackout-layer{animation:none}}

/* 明るさ（設定）と、明かりの点滅 */
.dim-layer,.lift-layer,.flick-layer{position:absolute;inset:0;pointer-events:none}
.dim-layer{z-index:7;background:#000;opacity:var(--dim,0)}
.lift-layer{z-index:7;background:#fff;mix-blend-mode:soft-light;opacity:var(--lift,0)}
.flick-layer{z-index:9;background:#000;opacity:0;animation:lamp-flick .9s steps(1) 1}
@keyframes lamp-flick{0%{opacity:.55}12%{opacity:0}22%{opacity:.8}34%{opacity:.1}46%{opacity:.65}58%{opacity:0}100%{opacity:0}}
html.reduced .flick-layer{display:none}

/* 幽霊図鑑・スタンプ */
.ghost-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin:10px 0}
.ghost-cell{display:flex;flex-direction:column;align-items:center;gap:2px;padding:8px 4px;border:1px solid #3a453d;border-radius:8px;background:#0d1210;color:#e9efe7;text-align:center;font:inherit}
.ghost-cell img{width:100%;aspect-ratio:1/1;object-fit:contain;background:#111a2e;border-radius:6px}
.ghost-cell.found{cursor:pointer;border-color:#6d5a3c}
.ghost-cell.found:hover{border-color:#e4472b}
.ghost-cell.lock img.ghost-sil{filter:brightness(0);opacity:.55}
.ghost-cell small{color:#9aa69a}
.ghost-arts{display:flex;gap:8px;justify-content:center;margin:8px 0}
.ghost-arts img{width:48%;aspect-ratio:1/1;object-fit:contain;background:#111a2e;border-radius:8px}
.ghost-arts img.real{object-fit:cover}
.ghost-row{margin:6px 0;line-height:1.7}.ghost-row b{display:inline-block;min-width:5.5em;color:#d8b88d}
.ghost-notice{margin:12px 0;padding:10px 14px;border:1px solid #6d5a3c;border-radius:8px;background:#120e0c}
.ghost-notice p{margin:2px 0;color:#ffd9d2}
.stamp-canvas{display:block;width:min(78vw,340px);aspect-ratio:1/1;margin:8px auto;border-radius:22px;background:#111a2e}
.stamp-opts{display:flex;flex-direction:column;gap:8px;margin:8px 0}
.stamp-row{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.stamp-row>span{min-width:5.5em;color:#9aa69a}
.stamp-row input[type=text]{flex:1;min-width:10em}
.stamp-chips{display:flex;gap:6px;flex-wrap:wrap}

/* 体験版だと分かる表示 */
.trial-badge{display:inline-block;margin-left:8px;padding:1px 9px;border:1px solid #e4472b;border-radius:11px;background:#3a0f0a;color:#ffd9d2;font-size:12px;letter-spacing:.08em;vertical-align:middle}
.trial-badge.big{display:block;width:max-content;margin:6px auto 0;padding:3px 16px;font-size:16px;border-radius:16px}

/* パソコンの、見回しの案内（写真の上。ドラッグすると、消える） */
.look-hint{position:absolute;top:10px;right:10px;z-index:9;padding:5px 12px;border:1px solid #6d5a3c;border-radius:14px;background:#000a;color:#ecdcb8;font-size:13px;letter-spacing:.04em;pointer-events:none;animation:look-hint-pulse 2.6s ease-in-out infinite}
@keyframes look-hint-pulse{50%{opacity:.55}}
html.reduced .look-hint{animation:none}

/* 十字キーの真ん中：いまいる部屋の名前 */
.dpad .dpad-center.dpad-here{display:flex;align-items:center;justify-content:center;text-align:center;white-space:normal;word-break:keep-all;overflow-wrap:anywhere;line-height:1.25;border:1px solid #6d5a3c;background:#120e0c;color:#ecdcb8;font-weight:600}

/* 「つぎへ」で送る画面：文章の長さで、枠の大きさが変わらない（つぎへ・閉じるのボタンが、毎回、同じ位置に出る） */
.dialog-body.paged{box-sizing:border-box;width:min(580px,calc(100vw - 24px));min-height:min(72svh,540px);display:flex;flex-direction:column}
.dialog-body.paged>.note-stamp{margin-top:auto}
.dialog-body.paged>.dialog-actions{margin-top:auto}
.dialog-body.paged>.note-stamp+.dialog-actions{margin-top:10px}
