/* Scoped structure changes: existing map, market and home layouts are untouched. */
body.immersive{overflow:hidden}
body.immersive .sidebar,body.immersive .topline,body.immersive .page-foot{display:none!important}
body.immersive .game-shell{display:block!important;padding:0!important;min-height:100dvh!important}
body.immersive .main{padding:0!important;margin:0!important;width:100vw!important;height:100dvh!important;min-height:0!important}
body.immersive #view{padding:0!important;margin:0!important;height:100dvh!important}
body.immersive .v2-story{position:fixed!important;inset:0!important;width:100vw!important;height:100dvh!important;min-height:0!important;margin:0!important;padding:0!important;border:0!important;border-radius:0!important;overflow:hidden!important}
body.immersive .chapter-strip,body.immersive .v2-story-head>div:first-child:not(.v2-story-tools){display:none!important}
body.immersive .v2-story-head{inset:max(12px,env(safe-area-inset-top)) max(16px,env(safe-area-inset-right)) auto auto!important;width:auto!important;top:max(12px,env(safe-area-inset-top))!important;padding:0!important;display:flex!important;z-index:10!important}
body.immersive .v2-story-tools{margin:0!important;gap:7px!important;display:flex!important}
body.immersive .v2-tool{background:#253549c2!important;color:#e2e7e5!important;border:1px solid #aebcc45a!important;padding:7px 13px!important;font-size:11px!important;letter-spacing:.08em}
body.immersive .story-cast{inset:8% 5% 17%!important;min-height:0!important;gap:1.5%!important;overflow:hidden!important}
body.immersive .story-portrait{mask-image:linear-gradient(#000 0 76%,#000b 89%,transparent 100%)!important;max-width:48%!important;width:var(--stage-slot,43%)!important}
body.immersive .cast-1 .story-portrait{width:60%!important;max-width:70%!important}
body.immersive .story-portrait img{top:var(--stage-crown,0)!important;left:50%!important;height:calc(100% * var(--stage-image-height,1))!important;width:auto!important;max-width:none!important;max-height:none!important;transform:translateX(calc(-1 * var(--stage-face-x,50%)))!important;clip-path:var(--stage-clip,none)!important;filter:drop-shadow(0 2px 3px #26334625)!important}
body.immersive .story-portrait[data-character="I-child"] img{height:calc(100% * var(--stage-image-height,1))!important;top:var(--stage-crown,20%)!important}
body.immersive .v2-dialogue{position:absolute!important;left:6%!important;right:6%!important;bottom:max(18px,env(safe-area-inset-bottom))!important;margin:0!important;height:clamp(112px,18vh,156px)!important;min-height:0!important;max-height:none!important;padding:20px 25px 11px!important;overflow:visible!important;display:grid!important;grid-template-rows:1fr 22px!important;background:#e7e8e0f2!important;backdrop-filter:blur(8px)!important}
body.immersive .v2-nameplate{height:32px!important;min-width:130px!important;top:-21px!important;left:22px!important;padding:4px 15px!important}
body.immersive .v2-nameplate b{font-size:15px!important;line-height:1.3!important}
body.immersive .v2-nameplate small{display:none!important}
body.immersive .v2-dialogue-body{min-height:0!important;padding:0 32px 0 0!important;display:flex;align-items:center}
body.immersive .v2-prose{font-size:min(var(--reading-size),24px)!important;line-height:1.6!important;white-space:normal!important;overflow-wrap:anywhere!important;max-height:3.3em}
body.immersive .v2-dialogue footer{margin:0!important;padding:0!important;border:0!important;display:flex!important;align-items:center!important;font-size:9px!important;gap:15px!important;opacity:.7}
body.immersive .v2-dialogue footer>span{margin-right:auto}
body.immersive .v2-page-progress{display:none!important}
body.immersive .v2-next{width:27px!important;height:24px!important}
body.immersive .v2-choices{position:fixed;left:50%;top:45%;transform:translate(-50%,-50%);width:min(600px,70vw);display:grid!important;grid-template-columns:1fr!important;gap:10px!important;z-index:12}
body.immersive .v2-choice{background:#e6e8e3ed!important;color:#3d536b!important;border:1px solid #a2b2be!important;padding:10px 20px!important;min-height:42px!important;font-size:16px!important}
body.immersive .choice-response{width:100%}
body.immersive .choice-q{position:absolute;right:8px;bottom:5px;opacity:.8}
body.immersive .choice-q .chibi{height:60px!important;width:55px!important}
.vn-slot-list{display:grid;grid-template-columns:repeat(2,1fr);gap:12px}
.mode-choice{max-width:1150px;margin:auto}.mode-options{display:grid;grid-template-columns:1fr 1fr;gap:24px;margin:25px 0}
.mode-options>button{min-height:190px;border:1px solid #a5b3bec2;background:#dee3dded;color:#41586f;font-family:inherit;padding:25px;box-shadow:inset 0 0 0 5px #ccd5d080;position:relative}
.mode-options>button::before{content:'❧';font-size:30px;position:absolute;right:22px;bottom:15px;opacity:.4}
.mode-options h2{font-size:25px;font-weight:400;letter-spacing:.08em}.mode-options small{font-size:10px;letter-spacing:.2em}
.daily-menu{padding:18px 0;border-top:1px solid #aab8bf55}.daily-menu>small{letter-spacing:.16em;font-size:11px}.daily-menu>div{display:flex;gap:10px;flex-wrap:wrap;margin-top:15px}.daily-menu span{font-size:12px}
.daily-reading .daily-scene{height:150px;background-size:cover;background-position:center;margin:16px 0;filter:saturate(.65)}.daily-reading p{font-size:18px;line-height:1.8;min-height:60px}.daily-choices{display:flex;gap:10px;flex-wrap:wrap}
body.immersive .vn-social>.page-heading,body.immersive .vn-social>.interlude-cards{display:none!important}
body.immersive .vn-social{padding:0!important}
body.immersive .vn-social .v2-dialogue{bottom:145px!important;height:112px!important;min-height:0!important}
body.immersive .vn-social .interlude-compose{position:fixed;bottom:12px;left:6%;right:6%;height:112px;z-index:8;padding:8px 14px;grid-template-columns:1fr auto;grid-template-rows:24px 1fr;gap:5px 10px;overflow:hidden;background:#e3e7e0ef}
body.immersive .interlude-location{grid-column:1;font-size:10px;flex-wrap:nowrap}
body.immersive .interlude-location select{font-size:11px!important;min-width:0!important;max-width:160px!important;height:24px!important;padding:1px 5px!important}
body.immersive .interlude-compose textarea{grid-column:1;grid-row:2;font-size:14px!important;min-height:0!important;height:52px!important;padding:7px!important;resize:none}
body.immersive .interlude-compose-foot{grid-column:2;grid-row:1/3;align-self:end;display:block}
body.immersive .interlude-compose-foot>small,body.immersive .interlude-suggestions{display:none!important}
body.immersive .vn-social .story-cast{bottom:32%!important}
.text-companion{max-width:950px;margin:25px auto;height:calc(100dvh - 150px);min-height:380px;display:flex;flex-direction:column;background:#e4e6df;color:#3e5268;border:1px solid #9aadb8;box-shadow:inset 0 0 0 7px #c9d3d033}
.text-companion header{padding:18px 24px;display:flex;justify-content:space-between;border-bottom:1px solid #bcc9cc;background:#d5dfdd}.text-companion h1{font-size:25px;font-weight:400;margin:6px 0}.text-companion small{font-size:10px;letter-spacing:.05em}.text-companion header span{font-size:11px}.text-companion button{font:inherit;font-size:11px;color:#425b72;background:#c9d5d2;border:1px solid #9aaeb8;padding:7px 12px}.text-companion button:disabled{opacity:.45}.text-companion header>div:last-child{display:flex;gap:8px;align-items:center}
.text-thread{overflow-y:auto;flex:1;padding:18px 25px;scrollbar-width:thin;overscroll-behavior:contain}
.text-message{max-width:85%;margin:0 0 15px;padding:12px 15px;background:#f2f1e7;border:1px solid #bdc8c8;position:relative}.text-message.outgoing{margin-left:auto;background:#d1dfda}.text-message small{font-size:10px;color:#687c86}.text-message p{font-size:16px;line-height:1.65;margin:8px 0;white-space:pre-wrap;overflow-wrap:anywhere}.text-message.selected{outline:2px solid #728caa}
.text-message-actions{display:flex;gap:5px;opacity:.65}.text-message-actions button{background:transparent;border:0;padding:3px 6px;font-size:9px}.text-select-box{position:absolute;left:-24px;top:15px;padding:1px!important;background:transparent!important;border:0!important}.text-batch{padding:8px 24px;display:flex;align-items:center;gap:10px;background:#c0d0cf}.text-batch span{font-size:10px;margin-right:auto}
.text-compose{padding:12px 24px;border-top:1px solid #b4c4c8}.text-compose textarea{font:inherit;font-size:15px;background:#f1f2ea;color:#3e5268;resize:none;height:58px;min-height:0!important;margin:0!important;padding:9px;border:1px solid #b2c1c6;width:100%}.text-compose>div{display:flex;align-items:center;gap:10px;margin-top:9px}.text-compose small{margin-right:auto;font-size:10px}.text-empty{padding:40px;color:#6d808c;text-align:center}.text-wait{font-size:11px}
@media(max-width:1050px) and (orientation:landscape){
 body.immersive .v2-story-head{top:7px!important;right:12px!important}
 body.immersive .v2-tool{font-size:9px!important;padding:5px 9px!important}
 body.immersive .v2-dialogue{height:clamp(82px,22vh,115px)!important;bottom:9px!important;padding:12px 17px 7px!important;grid-template-rows:1fr 14px!important}
 body.immersive .v2-nameplate{height:26px!important;top:-18px!important;min-width:100px!important;padding:3px 10px!important}
 body.immersive .v2-nameplate b{font-size:12px!important}
 body.immersive .v2-prose{font-size:clamp(12px,3.5vh,17px)!important;line-height:1.5!important}
 body.immersive .v2-dialogue footer{font-size:7px!important}
 body.immersive .story-cast{inset:8% 5% 20%!important}
 body.immersive .v2-choices{width:min(500px,68vw);gap:6px!important;top:42%}
 body.immersive .v2-choice{font-size:12px!important;min-height:28px!important;padding:6px 13px!important}
 body.immersive .vn-social .v2-dialogue{bottom:95px!important;height:80px!important}
 body.immersive .vn-social .interlude-compose{height:76px;bottom:7px;padding:5px 10px;grid-template-rows:20px 1fr;gap:3px 8px}
 body.immersive .interlude-compose textarea{height:36px!important;font-size:12px!important;padding:4px!important}
 body.immersive .vn-social .story-cast{bottom:40%!important}
 .text-companion{margin:8px 15px;height:calc(100dvh - 75px);min-height:0}.text-companion header{padding:8px 15px}.text-companion h1{font-size:18px;margin:3px 0}.text-thread{padding:10px 20px}.text-message p{font-size:13px}.text-compose{padding:7px 15px}.text-compose textarea{height:40px;font-size:12px}.text-message{padding:8px 12px;margin-bottom:8px}.mode-options>button{min-height:120px;padding:14px}.mode-options h2{font-size:20px}
}
