/* Approved portrait prototypes, scoped to the integrated game screens. */
.welcome-art{position:absolute;inset:0 42% 0 0;overflow:hidden;z-index:-1;pointer-events:none}
.welcome-art .splash-person{height:auto;width:140%;max-width:none;top:10px;bottom:auto;transform:none}
.welcome-art .splash-person.reco{left:-43%}
.welcome-art .splash-person.suzu{left:-7%;top:50px}
@media(max-width:700px){
 .welcome-art{inset:0 0 auto;height:310px}
 .welcome-art .splash-person{width:145%;height:auto;top:3px;bottom:auto;transform:none}
 .welcome-art .splash-person.reco{left:-45%;top:3px}
 .welcome-art .splash-person.suzu{left:-3%;top:18px}
}
.quest-screen{--pink:#f04499;--ink:#18151e;--paper:#fff9f2;font-size:16px;color:#fff;font-family:"Yu Gothic",Meiryo,system-ui,sans-serif}.quest-screen button{border:0;border-radius:0;padding:0;background:transparent;font:inherit;color:inherit;cursor:pointer}.quest-screen h1,.quest-screen h2,.quest-screen h3,.quest-screen p{margin:0}.quest-screen [hidden]{display:none!important}
.quest-screen *{box-sizing:border-box}
.quest-screen button,.quest-screen a{-webkit-tap-highlight-color:transparent}
.quest-screen button{font:inherit;color:inherit;cursor:pointer;border:0}
.quest-screen button:disabled{cursor:default}
.quest-screen button:focus-visible,.quest-screen a:focus-visible{outline:3px solid #ffb3d7;outline-offset:3px}
.quest-screen a{color:#f4a7cd}
.quest-screen .preview-bar{width:min(960px,100%);margin:auto;padding:16px 20px;display:flex;gap:14px;align-items:center;font-size:12px}
.quest-screen .preview-bar strong{font-weight:700}
.quest-screen .preview-bar span{color:#aaa4af}
.quest-screen .preview-bar a{margin-left:auto}
.quest-screen .preview-footer{text-align:center;color:#aaa4af;font-size:12px;padding:18px 12px}
.quest-screen .device{position:relative;isolation:isolate;width:390px;height:844px;margin:auto;overflow:hidden;display:grid;grid-template-rows:51px 43px minmax(0,1fr) 242px 154px;background:var(--ink);box-shadow:0 16px 80px #0008}
.quest-screen .world{position:absolute;inset:0;width:100%;height:70%;object-fit:cover;object-position:center top;z-index:-2}
.quest-screen .brand{display:flex;justify-content:space-between;align-items:center;padding:0 19px;background:#18151ef5;position:relative}
.quest-screen .brand:after{content:"";position:absolute;left:19px;bottom:0;width:38px;height:3px;background:var(--pink)}
.quest-screen .wordmark{font-family:Arial,sans-serif;font-size:21px;letter-spacing:-.8px;font-weight:900;display:flex;align-items:center;gap:5px}
.quest-screen .wordmark b{font-size:11px;letter-spacing:1.7px;color:var(--pink);border-left:1px solid #7b5268;padding-left:8px;margin-left:2px}
.quest-screen .gold{font:700 16px Arial,sans-serif;display:flex;gap:7px;align-items:center}
.quest-screen .gold svg{width:20px;height:20px;stroke:#f4d8b4;fill:none;stroke-width:1.6}
.quest-screen .status{display:flex;gap:21px;padding:4px 19px 8px;background:#18151ef5}
.quest-screen .status>div{flex:1}
.quest-screen .status span{display:flex;justify-content:space-between;align-items:baseline;font-size:12px;line-height:23px;color:#e2dbe3;font-weight:600}
.quest-screen .status b{font:800 17px Arial,sans-serif;color:#fff}
.quest-screen .status small{font-size:11px;font-weight:400;color:#b6a8b6}
.quest-screen .status i{height:5px;display:block;background:#53414f;transform:skewX(-20deg);overflow:hidden}
.quest-screen .status em{height:100%;display:block;background:var(--pink)}
.quest-screen .status .gauge{background:#f7d9eb}
.quest-screen .character-stage{position:relative;min-height:0;overflow:hidden}
.quest-screen .character-stage:before{content:"";position:absolute;left:17px;top:86px;bottom:72px;width:1px;background:#fff9;z-index:2}
.quest-screen .chapter{position:absolute;z-index:3;left:17px;top:14px;display:flex;align-items:center;gap:10px;color:var(--paper);text-shadow:0 1px 5px #18151e,0 1px 3px #18151e}
.quest-screen .chapter-number{font:800 46px/.9 Arial,sans-serif;letter-spacing:-3px;color:#fff}
.quest-screen .chapter small{font-size:10px;letter-spacing:1px;font-weight:800}
.quest-screen .chapter h1{margin:3px 0 0;font-size:15px;letter-spacing:.5px}
.quest-screen .hero{position:absolute;right:-34px;top:-4px;width:373px;height:auto;z-index:1}
.quest-screen .hero-name{position:absolute;left:17px;bottom:16px;z-index:3;filter:drop-shadow(0 1px 3px #16121c)}
.quest-screen .hero-name small{display:block;font:700 10px Arial,sans-serif;letter-spacing:4px;background:var(--pink);color:#261620;padding:3px 8px;width:max-content}
.quest-screen .hero-name strong{font:900 43px/.98 Arial,sans-serif;letter-spacing:-1.8px;display:block;margin-top:5px}
.quest-screen .hero-name strong span{font-size:12px;margin-left:9px;vertical-align:middle;color:#ffb7da}
.quest-screen .companions{position:absolute;right:12px;bottom:13px;display:flex;gap:5px;z-index:3}
.quest-screen .companions img{width:43px;height:48px;object-fit:cover;object-position:top;background:#241e2be8;border:1px solid #edd7e4;border-bottom:3px solid var(--pink);clip-path:polygon(0 0,85% 0,100% 15%,100% 100%,0 100%)}
.quest-screen .board{position:relative;z-index:4;min-height:0;background:#e7e1cd;display:flex;flex-direction:column;border-top:3px solid var(--pink);clip-path:polygon(0 0,calc(100% - 16px) 0,100% 16px,100% 100%,0 100%)}
.quest-screen .board>header{height:48px;flex-shrink:0;background:var(--paper);color:#241f2a;display:flex;align-items:center;gap:12px;padding:0 16px;border-bottom:1px solid #cdbfc4}
.quest-screen .position{display:flex;align-items:center;gap:7px;border-right:1px solid #d4c5cb;padding-right:12px}
.quest-screen .position>small{font-size:10px;writing-mode:vertical-rl;letter-spacing:1px}
.quest-screen .position strong{font:800 25px Arial,sans-serif;letter-spacing:-1px}
.quest-screen .position strong small{font-size:12px;color:#8c7784;letter-spacing:0}
.quest-screen .map-title{display:flex;flex-direction:column;gap:1px}
.quest-screen .map-title b{font-size:13px;letter-spacing:.8px}
.quest-screen .map-title span{font-size:10px;color:#715d6c}
.quest-screen .board header button{margin-left:auto;min-height:30px;padding:0 11px;background:#28212d;color:#fff;font-size:11px;clip-path:polygon(0 0,calc(100% - 6px) 0,100% 6px,100% 100%,0 100%)}
.quest-screen #map{flex:1;min-height:0;overflow:hidden}
.quest-screen #map>svg{display:block;width:100%;height:100%;background:#c5cfb3}
.quest-screen .commands{position:relative;z-index:5;background:var(--ink);padding:6px 16px 0}
.quest-screen .travel-note{font-size:11px;line-height:19px;text-align:center;color:#d4c6d4;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.quest-screen .main-action{padding:3px 0 0}
.quest-screen .dice-button{position:relative;min-height:56px;width:100%;background:var(--pink);color:#23151f;display:flex;align-items:center;gap:15px;padding:0 18px 0 13px;clip-path:polygon(0 0,calc(100% - 12px) 0,100% 12px,100% 100%,12px 100%,0 calc(100% - 12px));border-bottom:3px solid #a32568}
.quest-screen .dice-button:after{content:"";position:absolute;left:58px;top:12px;bottom:12px;width:1px;background:#68244855}
.quest-screen .dice-button:disabled{background:#bf4d87}
.quest-screen .dice-button strong{font-size:18px;letter-spacing:.5px;font-weight:850}
.quest-screen .dice-button svg{width:29px;height:29px;display:block;fill:none;stroke:currentColor;stroke-width:1.6}
.quest-screen .dice-button .arrow{margin-left:auto;font-size:30px;font-weight:400}
.quest-screen .dice-button #dice-icon{width:37px;flex-shrink:0}
.quest-screen nav{height:61px;display:flex;align-items:center;justify-content:space-between;margin-top:4px}
.quest-screen nav button{background:transparent;display:flex;align-items:center;justify-content:center;gap:8px;font-weight:600;font-size:12px;width:33.333%;min-height:45px;padding:4px 0;color:#f3eaf2}
.quest-screen nav button+button{border-left:1px solid #493346}
.quest-screen .nav-icon{display:flex;color:#edabcf}
.quest-screen .nav-icon svg{width:24px;height:24px;fill:none;stroke:currentColor;stroke-width:1.5}
.quest-screen .dice-reveal{position:absolute;top:calc(50% + 24px);left:50%;transform:translate(-50%,-50%);z-index:8;background:#211927f5;border:1px solid #ffb3da;box-shadow:4px 5px 0 #281d3a55;width:130px;padding:12px;display:flex;flex-direction:column;align-items:center;clip-path:polygon(0 0,calc(100% - 12px) 0,100% 12px,100% 100%,12px 100%,0 calc(100% - 12px))}
.quest-screen .dice-reveal[hidden]{display:none}
.quest-screen .dice-reveal>strong{font-size:23px;line-height:31px;margin-top:9px;color:#ffb3d8}
.quest-screen .die{width:70px;height:70px;padding:12px;display:grid;grid-template-columns:repeat(3,1fr);grid-template-rows:repeat(3,1fr);gap:5px;background:#fff6fb;border-radius:8px;box-shadow:0 4px 0 #b7789d}
.quest-screen .die i{border-radius:50%;background:transparent}
.quest-screen .die .pip{background:#c2307d}
.quest-screen .die.rolling{animation:shake .22s infinite}
@keyframes shake{0%,100%{transform:rotate(-9deg)}50%{transform:rotate(9deg) translateY(-4px)}}
.quest-screen dialog{position:absolute;top:auto;bottom:0;left:50%;right:auto;transform:translateX(-50%);width:100%;max-width:390px;max-height:75%;margin:0;padding:20px;border:0;border-top:3px solid var(--pink);background:#211c29;color:#fff}
.quest-screen dialog::backdrop{background:#100b18b3}
.quest-screen dialog>header{display:flex;justify-content:space-between;align-items:center;padding-bottom:14px;border-bottom:1px solid #694057;font-size:19px}
.quest-screen dialog>header button{font-size:28px;background:transparent}
.quest-screen dialog p{font-size:14px;line-height:1.9}
.quest-screen .party-images{display:flex;gap:8px;margin-top:16px}
.quest-screen .party-images img{width:calc(25% - 6px);height:140px;object-fit:cover;object-position:top;background:#352337;border-bottom:2px solid #ef71b0}
@media(max-width:600px){.quest-screen .preview-bar{height:32px;padding:0 12px;font-size:10px}
.quest-screen .preview-bar span{display:none}
.quest-screen .preview-footer{font-size:11px;line-height:1.6}
.quest-screen .device{width:100%;max-width:430px;height:calc(100svh - 32px);min-height:620px;grid-template-rows:48px 42px minmax(0,1fr) 230px 150px}
.quest-screen .hero{width:96%;right:-28px;top:-9px}
.quest-screen .chapter-number{font-size:40px}
.quest-screen .chapter h1{font-size:14px}
.quest-screen .hero-name strong{font-size:39px}
.quest-screen dialog{max-width:430px}}
@media(max-height:740px){.quest-screen .device{grid-template-rows:44px 39px minmax(0,1fr) 204px 140px}
.quest-screen .board>header{height:42px}
.quest-screen .hero{width:85%;top:-17px}
.quest-screen .chapter{top:10px}
.quest-screen .chapter h1{font-size:12px}
.quest-screen .chapter-number{font-size:32px}
.quest-screen .hero-name{bottom:12px}
.quest-screen .hero-name strong{font-size:30px}
.quest-screen .companions img{height:39px;width:35px}
.quest-screen .dice-button{min-height:51px}
.quest-screen nav{height:53px}}
@media(prefers-reduced-motion:reduce){.quest-screen .die.rolling{animation:none}}
.quest-screen .chapter{display:block;width:114px;text-shadow:0 1px 3px #211120,0 0 9px #21112099}
.quest-screen .chapter-number{font-size:38px;letter-spacing:-2px;display:block;margin-bottom:5px}
.quest-screen .chapter h1{font-size:16px;line-height:1.35;letter-spacing:1px;margin-top:3px}
.quest-screen .chapter small{font-size:9px}
.quest-screen .character-stage:before{top:140px;bottom:90px}
@media(max-height:740px){.quest-screen .chapter-number{font-size:28px}
.quest-screen .chapter h1{font-size:14px}
.quest-screen .character-stage:before{display:none}}
.quest-screen #map{background:url(assets/backgrounds/road-map-v2.png) center/cover no-repeat}
.quest-screen #map>svg{background:transparent}
.quest-screen .world{object-position:28% center}
.quest-screen .board{background:#151827}
.quest-screen .board>header{background:#211c2b;color:#fff6fc;border-bottom-color:#6d3c61}
.quest-screen .position{border-right-color:#5d3b55}
.quest-screen .position strong small{color:#bc9fb4}
.quest-screen .map-title span{color:#d1b8cc}
.quest-screen .board header button{background:#f1dce9;color:#2b1a29}
.quest-screen #map{background-image:url(assets/backgrounds/road-map-cyber-v3.webp);background-color:#121725}
.quest-screen .device{--scene-shade:.48;--map-shade:.36}
.quest-screen .world-shade{position:absolute;inset:0 0 auto;height:70%;z-index:-1;background:#241c31;opacity:var(--scene-shade);mix-blend-mode:multiply;pointer-events:none}
.quest-screen #map{position:relative;isolation:isolate}
.quest-screen #map:before{content:"";position:absolute;inset:0;z-index:0;background:#241c31;opacity:var(--map-shade);mix-blend-mode:multiply;pointer-events:none}
.quest-screen #map>svg{position:relative;z-index:1}
.quest-screen .shade-open{background:transparent;border:1px solid #88617a;font-size:11px;white-space:nowrap;padding:4px 9px;color:#f3cede;min-height:27px}
.quest-screen .shade-controls{padding-top:18px;display:grid;gap:12px}
.quest-screen .shade-controls label{display:flex;justify-content:space-between;align-items:center;font-size:15px}
.quest-screen .shade-controls output{font:700 16px Arial,sans-serif;color:#ffabd1}
.quest-screen .shade-controls input{width:100%;height:32px;margin:0 0 12px;accent-color:#f04499;cursor:pointer}
.quest-screen #reset-shade{justify-self:start;font-size:13px;background:#392b40;border:1px solid #a87794;padding:10px 14px;color:#fff}
@media(max-width:600px){.quest-screen .preview-bar{gap:10px}
.quest-screen .shade-open{font-size:10px;padding:3px 8px}}
.quest-screen .battle-device{--battle-shade:.48;position:relative;isolation:isolate;overflow:hidden;width:390px;height:844px;margin:auto;display:grid;grid-template-rows:48px 66px minmax(0,1fr) 57px 59px 260px;background:#17131e;box-shadow:0 16px 80px #0008}
.quest-screen .battle-device .brand:after{width:38px}
.quest-screen .battle-map{background:transparent;display:flex;align-items:center;gap:6px;font-size:12px;border:1px solid #74536b;padding:5px 8px}
.quest-screen .battle-map svg{display:block;width:17px;height:17px;stroke:#f4b9d7;fill:none;stroke-width:1.6}
.quest-screen .enemy-hud{padding:7px 17px 9px;background:#211b2a;border-bottom:1px solid #6a3a59}
.quest-screen .enemy-hud>div:first-child{display:flex;gap:8px;align-items:center}
.quest-screen .enemy-badge{font-size:10px;line-height:18px;color:#231321;background:#f1a6cf;padding:0 5px;white-space:nowrap}
.quest-screen .enemy-hud h1{font-size:15px;line-height:22px;margin:0;letter-spacing:.3px}
.quest-screen .enemy-health{display:flex;align-items:center;gap:12px;margin-top:4px}
.quest-screen .enemy-health>span{font:10px Arial,sans-serif;white-space:nowrap;color:#d0bdd0}
.quest-screen .enemy-health strong{font-size:19px;color:#fff}
.quest-screen .enemy-health small{font-size:11px}
.quest-screen .enemy-health i{height:5px;display:block;background:#56465a;flex:1;transform:skewX(-20deg);overflow:hidden}
.quest-screen .enemy-health em{display:block;height:100%;width:100%;background:#f3a6d0;transition:width .35s}
.quest-screen .arena{position:relative;min-height:0;overflow:hidden;isolation:isolate;background:#151420}
.quest-screen .arena-background,.quest-screen .arena-shade{position:absolute;inset:0;z-index:-2}
.quest-screen .arena-background{background:url(assets/backgrounds/road-map-cyber-v3.webp) 52% center/cover no-repeat}
.quest-screen .arena-shade{z-index:-1;background:#241c31;mix-blend-mode:multiply;opacity:var(--battle-shade);pointer-events:none}
.quest-screen .floor-mark{position:absolute;right:0;bottom:33px;width:240px;height:65px;border:1px solid #ce79c977;border-radius:50%;transform:rotate(-9deg);background:#16132733}
.quest-screen .fighter{position:absolute;will-change:transform}
.quest-screen .fighter>img{display:block;width:100%;height:auto}
.quest-screen .sister{z-index:3;width:266px;left:-32px;bottom:-124px}
.quest-screen .foe{width:310px;right:-52px;top:1px;z-index:2;filter:drop-shadow(0 13px 4px #0008)}
.quest-screen .sister-caption{position:absolute;left:17px;bottom:13px;z-index:5;background:#211927bd;padding:4px 8px;border-left:2px solid #f04499;font:700 9px Arial,sans-serif;letter-spacing:1.6px}
.quest-screen .sister-caption b{display:block;letter-spacing:-.6px;font-size:27px;margin-top:3px}
.quest-screen .shield-ring{display:none;position:absolute;left:43%;top:47%;width:90px;height:128px;border:3px solid #efaddb;border-radius:48% 48% 44% 44%;box-shadow:0 0 0 6px #f189c122;transform:rotate(-13deg)}
.quest-screen .sister.guarded .shield-ring{display:block}
.quest-screen .intent{position:relative;z-index:4;display:flex;align-items:flex-start;gap:11px;padding:9px 16px 7px;background:#2b1b2a;border-left:3px solid #f04499;border-bottom:1px solid #683552}
.quest-screen .intent-tag{font-size:10px;letter-spacing:1px;writing-mode:vertical-rl;color:#fba1ce;flex-shrink:0}
.quest-screen .intent>div{min-width:0}
.quest-screen .intent strong{display:block;font-size:15px;line-height:18px;letter-spacing:.5px}
.quest-screen .intent p{font-size:10px;color:#dac8d7;line-height:15px;margin:3px 0 0}
.quest-screen .party-hud{display:flex;gap:22px;padding:8px 18px;background:#1c1723}
.quest-screen .party-hud>div{flex:1;min-width:0}
.quest-screen .party-hud span{display:flex;align-items:baseline;justify-content:space-between;font-size:12px;font-weight:600;line-height:26px;color:#dcc8dc}
.quest-screen .party-hud b{font:800 20px Arial,sans-serif;color:#fff}
.quest-screen .party-hud small{font-size:11px;font-weight:400;color:#b6a0b5}
.quest-screen .party-hud i{height:6px;background:#533c50;display:block;transform:skewX(-20deg);overflow:hidden}
.quest-screen .party-hud em{height:100%;display:block;background:#f04499;transition:width .3s}
.quest-screen .party-hud #gauge-meter{background:#f8d8ed}
.quest-screen .combat-controls{padding:0 15px 8px;background:#17131e;min-height:0;display:flex;flex-direction:column;z-index:5}
.quest-screen .turn-row{display:flex;align-items:center;gap:10px;height:34px;flex-shrink:0}
.quest-screen .turn-row strong{font-size:14px;font-weight:800}
.quest-screen .turn-row small{margin-left:auto;color:#b6a2b5;font-size:10px}
.quest-screen .action-pips{display:flex;gap:5px}
.quest-screen .action-pips i{width:10px;height:10px;background:#f04499;transform:rotate(45deg);border:1px solid #ff9fcf}
.quest-screen .action-pips i.used{background:transparent;border-color:#68445f}
.quest-screen .combat-tabs{display:flex;min-height:35px;border-bottom:1px solid #54364e;margin-bottom:8px}
.quest-screen .combat-tabs button{background:transparent;position:relative;width:33.333%;padding:5px 0;font-size:12px;font-weight:700;color:#bca6b9}
.quest-screen .combat-tabs button[aria-selected=true]{color:#fff0f9}
.quest-screen .combat-tabs button[aria-selected=true]:after{content:"";position:absolute;bottom:-1px;left:16px;right:16px;height:3px;background:#f04499}
.quest-screen .action-grid{display:grid;gap:7px;grid-template-columns:repeat(2,minmax(0,1fr));min-height:136px;flex:1;align-content:stretch}
.quest-screen .action-grid button{position:relative;background:#2c2234;text-align:left;min-width:0;border:1px solid #76506a;padding:9px 11px;clip-path:polygon(0 0,calc(100% - 10px) 0,100% 10px,100% 100%,0 100%);display:flex;flex-direction:column;justify-content:center;gap:5px}
.quest-screen .action-grid button.attack{background:#f04499;color:#241321;border:0}
.quest-screen .action-grid button.guard{background:#e9dce9;color:#29212f;border:0}
.quest-screen .action-grid button:disabled{opacity:.37;cursor:default}
.quest-screen .action-grid .action-icon{display:flex;align-items:center;justify-content:space-between}
.quest-screen .action-grid .action-icon svg{width:28px;height:28px;fill:none;stroke:currentColor;stroke-width:1.6}
.quest-screen .action-grid .action-icon span{font:700 10px Arial,sans-serif;opacity:.65}
.quest-screen .action-grid strong{font-size:17px;line-height:23px;font-weight:800}
.quest-screen .action-grid small{font-size:11px;line-height:16px;color:inherit;opacity:.8}
.quest-screen .action-grid.ally{grid-template-columns:repeat(3,minmax(0,1fr));grid-template-rows:repeat(2,minmax(0,1fr));gap:6px}
.quest-screen .action-grid.ally button{padding:6px 7px;gap:2px;justify-content:center}
.quest-screen .action-grid.ally strong{font-size:13px;line-height:17px}
.quest-screen .action-grid.ally small{font-size:10px;line-height:14px;opacity:1;color:#d6bfd1}
.quest-screen .action-grid.ally .action-cost{color:#ffacd4;font-size:10px;line-height:14px}
.quest-screen .action-grid.ally button:nth-child(1){border-left:2px solid #f04499}
.quest-screen .action-grid.ally button:nth-child(2){border-left:2px solid #cba4f6}
.quest-screen .action-grid.item{grid-template-columns:repeat(3,minmax(0,1fr))}
.quest-screen .action-grid.item button{padding:8px;gap:7px;justify-content:center}
.quest-screen .action-grid.item strong{font-size:12px;line-height:19px;overflow-wrap:anywhere}
.quest-screen .action-grid.item .action-icon svg{width:25px;height:25px}
.quest-screen .action-grid.item small{font-size:10px}
.quest-screen .action-grid .enemy-go{grid-column:1/-1;background:#ad4b86;align-items:center;text-align:center;color:#fff}
.quest-screen .combat-latest{display:flex;align-items:center;gap:8px;height:32px;margin-top:4px;flex-shrink:0}
.quest-screen .combat-latest>span{font-size:10px;color:#cfbbcd;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.quest-screen .combat-latest button{flex-shrink:0;margin-left:auto;background:transparent;padding:5px 8px;font-size:10px;border:1px solid #5d3a54;color:#f3c6df}
.quest-screen .battle-dice{position:absolute;z-index:7;right:17px;bottom:14px;width:92px;display:flex;flex-direction:column;align-items:center;gap:8px;padding:10px 8px;background:#21182bf2;border:1px solid #ee9cca;clip-path:polygon(0 0,calc(100% - 10px) 0,100% 10px,100% 100%,0 100%)}
.quest-screen .battle-dice[hidden]{display:none}
.quest-screen .battle-dice .die{width:58px;height:58px;padding:10px;gap:4px}
.quest-screen .battle-dice>strong{font-size:12px;line-height:16px;color:#ffd8ec}
.quest-screen .combat-effects{position:absolute;inset:0;z-index:6;pointer-events:none}
.quest-screen .damage{position:absolute;right:47px;top:40%;font:900 54px/.9 Arial,sans-serif;color:#fff0fb;text-shadow:2px 3px 0 #571c48;animation:damage-rise .85s both}
.quest-screen .damage.incoming{left:65px;right:auto;top:57%;color:#ffc4d6;text-shadow:2px 3px 0 #6d1d3f}
.quest-screen .damage.heal{left:75px;right:auto;top:55%;color:#b7ffdc;text-shadow:2px 3px 0 #17473b}
.quest-screen .damage small{display:block;font-size:13px;margin-bottom:6px;letter-spacing:1px}
.quest-screen .cutin{position:absolute;left:16px;right:16px;bottom:12px;padding:10px 13px;border-left:3px solid #f04499;background:#25182be8;font-size:13px;font-weight:750;animation:cutin-in .25s both}
.quest-screen .slash{position:absolute;right:35px;top:28%;width:130px;height:5px;transform:rotate(-38deg);background:#fff2ff;box-shadow:0 4px 0 #ed469ccc;animation:slash .4s both}
.quest-screen .slash.incoming{right:auto;left:60px;top:53%;transform:rotate(38deg)}
.quest-screen .fighter.attacking{animation:lunge .45s}
.quest-screen .foe.attacking{animation:lunge-foe .45s}
.quest-screen .fighter.hit{animation:hit .45s}
.quest-screen .fighter.defeated{opacity:0;transform:translateY(12px);transition:opacity .55s,transform .55s}
.quest-screen .fight-result{position:absolute;inset:24% 18px auto;z-index:10;padding:24px 20px;background:#21182bf5;border-top:3px solid #f04499;text-align:center;box-shadow:0 15px 70px #0008;clip-path:polygon(0 0,calc(100% - 16px) 0,100% 16px,100% 100%,0 100%)}
.quest-screen .fight-result[hidden]{display:none}
.quest-screen .fight-result>small{font:800 28px Arial,sans-serif;letter-spacing:2px;color:#f789c2}
.quest-screen .fight-result h2{font-size:18px;margin:14px 0 10px}
.quest-screen .fight-result p{font-size:13px;line-height:1.8;color:#ddc9dc}
.quest-screen .fight-result button{background:#f04499;color:#241321;width:100%;padding:12px;margin:12px 0 14px;font-weight:800;font-size:15px}
.quest-screen .fight-result a{font-size:12px}
.quest-screen .battle-log{padding:0;list-style:none;margin:10px 0}
.quest-screen .battle-log li{font-size:13px;line-height:1.7;border-bottom:1px solid #54344e;padding:10px 0;color:#ead5e5}
.quest-screen .battle-log small{color:#ef91c2}
.quest-screen .map-peek{width:100%;display:block;background:url(assets/backgrounds/road-map-cyber-v3.webp) center/cover}
.quest-screen .battle-device #battle-sheet-body>p{font-size:13px;line-height:1.8;color:#d6bfd1}
.quest-screen #battle-shade-reset{justify-self:start;font-size:13px;background:#392b40;border:1px solid #a87794;padding:10px 14px;color:#fff}
.quest-screen .busy .combat-tabs button{pointer-events:none}
.quest-screen .busy .combat-latest button{pointer-events:none}
@keyframes lunge{50%{transform:translate(18px,-4px)}}
@keyframes lunge-foe{50%{transform:translate(-18px,5px)}}
@keyframes hit{25%,75%{transform:translateX(-5px)}50%{transform:translateX(5px);filter:brightness(1.4)}}
@keyframes damage-rise{0%{opacity:0;transform:translateY(10px) scale(.85)}20%{opacity:1;transform:translateY(0) scale(1)}80%{opacity:1}100%{opacity:0;transform:translateY(-35px)}}
@keyframes cutin-in{from{opacity:0;transform:translateX(-14px)}to{opacity:1;transform:none}}
@keyframes slash{0%{opacity:0;scale:.3}30%{opacity:1;scale:1}100%{opacity:0;scale:1.3}}
@media(max-width:600px){.quest-screen .battle-device{width:100%;max-width:430px;height:calc(100svh - 32px);min-height:620px;grid-template-rows:45px 65px minmax(0,1fr) 57px 58px 253px}
.quest-screen .sister{width:69%;bottom:-122px}
.quest-screen .foe{width:80%;right:-13%;top:0}
.quest-screen .combat-controls{padding:0 13px 7px}}
@media(max-height:740px){.quest-screen .battle-device{grid-template-rows:42px 61px minmax(0,1fr) 53px 54px 237px}
.quest-screen .enemy-hud{padding-top:5px}
.quest-screen .intent{padding:7px 13px}
.quest-screen .intent p{font-size:9px;line-height:13px}
.quest-screen .party-hud{padding-top:5px;padding-bottom:6px}
.quest-screen .sister{width:61%;bottom:-135px;left:-26px}
.quest-screen .foe{width:66%;top:-3px;right:-9%}
.quest-screen .action-grid{min-height:123px}
.quest-screen .action-grid strong{font-size:16px}
.quest-screen .action-grid.ally strong{font-size:12px}
.quest-screen .turn-row{height:30px}
.quest-screen .combat-tabs{min-height:32px;margin-bottom:6px}
.quest-screen .combat-latest{height:28px}
.quest-screen .battle-dice{right:12px;bottom:8px;width:75px;padding:8px 5px;gap:5px}
.quest-screen .battle-dice .die{width:47px;height:47px;padding:8px;gap:3px}
.quest-screen .battle-dice>strong{font-size:10px}
.quest-screen .sister-caption b{font-size:22px}}
@media(prefers-reduced-motion:reduce){.quest-screen .fighter.attacking,.quest-screen .fighter.hit,.quest-screen .damage,.quest-screen .cutin,.quest-screen .slash{animation:none}
.quest-screen .damage{opacity:1}
.quest-screen .enemy-health em,.quest-screen .party-hud em{transition:none}}
.quest-screen .enemy-go>svg{width:30px;height:30px;stroke:currentColor;fill:none;stroke-width:1.6}
.quest-screen .action-grid .action-icon:after{display:none}
.quest-screen .intent{display:block}
.quest-screen .intent-tag{position:absolute;left:16px;top:12px;writing-mode:horizontal-tb;letter-spacing:0;white-space:nowrap}
.quest-screen .intent strong{padding-left:60px}
.quest-screen .intent p{font-size:10.5px;line-height:15px}
@media(max-height:740px){.quest-screen .intent-tag{left:13px;top:10px}
.quest-screen .intent p{font-size:10px;line-height:14px}}
@media(max-height:740px){.quest-screen .sister{bottom:-155px}}
.quest-screen .party-formation{position:absolute;inset:0;z-index:3;pointer-events:none;transition:opacity .3s}
.quest-screen .member{position:absolute;width:104px;height:156px;bottom:35px;left:72px;z-index:3;transform-origin:50% 72%;transition:transform .22s,opacity .22s;filter:drop-shadow(0 4px 3px #0008)}
.quest-screen .member>img{width:100%;height:100%;object-fit:contain;object-position:center bottom}
.quest-screen .member[data-member=suzu]{left:0;bottom:36px;width:110px;height:165px}
.quest-screen .member[data-member=roid]{left:143px;bottom:34px;width:105px;height:158px}
.quest-screen .member[data-member=key]{left:15px;bottom:150px;width:82px;height:123px;z-index:1}
.quest-screen .member[data-member=rirum]{left:94px;bottom:153px;width:82px;height:123px;z-index:1}
.quest-screen .foe{width:184px;right:10px;top:20px;transform-origin:70% 38%;transition:transform .25s,opacity .25s}
.quest-screen .foe.turn-focus{transform:scale(1.08)}
.quest-screen .focus-party .member:not(.acting),.quest-screen .focus-foe .member{opacity:.6}
.quest-screen .member.acting{z-index:6;transform:translate(8px,var(--actor-y,-7px)) scale(1.34)}
.quest-screen .focus-foe .foe{z-index:6;transform:translate(-9px,6px) scale(1.2)}
.quest-screen .lineup-names{position:absolute;z-index:8;bottom:0;left:0;right:0;height:30px;display:flex;background:#171020ce;border-top:1px solid #64405c;pointer-events:none}
.quest-screen .lineup-names span{width:20%;display:flex;justify-content:center;align-items:center;font:700 10px Arial,sans-serif;letter-spacing:.7px;color:#cfb7cb;border-bottom:2px solid transparent}
.quest-screen .lineup-names span.current{color:#fff1f9;border-bottom-color:#f04499;background:#f044991a}
.quest-screen .party-shield{display:none;position:absolute;left:26px;bottom:41px;width:190px;height:160px;border:2px solid #eaa1d5;border-radius:45%;background:#f589c011;z-index:5;box-shadow:0 0 0 5px #f189c111}
.quest-screen .party-formation.guarded .party-shield{display:block}
.quest-screen .party-formation.hit{animation:hit .45s}
.quest-screen .party-formation.defeated{opacity:0;transform:translateY(12px)}
.quest-screen .member.attacking{animation:member-lunge .5s}
.quest-screen .foe.attacking{animation:enemy-lunge .5s}
.quest-screen .battle-dice{bottom:39px;right:15px}
.quest-screen .turn-row strong{font-size:16px}
.quest-screen .action-pips i{width:12px;height:12px}
@keyframes member-lunge{0%,100%{transform:translate(8px,var(--actor-y,-7px)) scale(1.34)}50%{transform:translate(25px,calc(var(--actor-y,-7px) - 6px)) scale(1.43)}}
@keyframes enemy-lunge{0%,100%{transform:translate(-9px,6px) scale(1.2)}50%{transform:translate(-25px,12px) scale(1.26)}}
@media(max-width:600px){.quest-screen .foe{width:47%;right:10px;top:20px}}
@media(max-height:740px){.quest-screen .member{width:84px;height:126px;left:67px;bottom:29px}
.quest-screen .member[data-member=suzu]{left:3px;bottom:29px;width:87px;height:131px}
.quest-screen .member[data-member=roid]{left:129px;bottom:29px;width:85px;height:128px}
.quest-screen .member[data-member=key]{left:16px;bottom:105px;width:66px;height:99px}
.quest-screen .member[data-member=rirum]{left:85px;bottom:108px;width:66px;height:99px}
.quest-screen .foe{width:37%;top:8px;right:12px}
.quest-screen .lineup-names{height:26px}
.quest-screen .lineup-names span{font-size:9px}
.quest-screen .battle-dice{bottom:33px;right:10px}
.quest-screen .party-shield{bottom:29px;width:160px;height:130px}
.quest-screen .turn-row strong{font-size:15px}}
@media(prefers-reduced-motion:reduce){.quest-screen .member,.quest-screen .foe{transition:none}
.quest-screen .member.attacking,.quest-screen .foe.attacking,.quest-screen .party-formation.hit{animation:none}}
.quest-screen .member{left:0}
.quest-screen .member[data-member=suzu]{left:72px}
.quest-screen .member[data-member=key],.quest-screen .member[data-member=rirum]{transform-origin:50% 20%;--actor-y:25px}
.quest-screen .arena.focus-party:after,.quest-screen .arena.focus-foe:after{content:attr(data-actor-name);position:absolute;top:8px;left:12px;z-index:9;max-width:70%;padding:5px 8px;background:#21172ce8;border-left:2px solid #f04499;color:#ffe9f7;font-size:12px;font-weight:750;pointer-events:none}
@media(max-height:740px){.quest-screen .member{left:3px;width:76px;height:114px;bottom:29px}
.quest-screen .member[data-member=suzu]{left:65px;width:78px;height:117px;bottom:29px}
.quest-screen .member[data-member=roid]{left:125px;width:77px;height:116px;bottom:29px}
.quest-screen .member[data-member=key]{left:17px;bottom:85px;width:56px;height:84px}
.quest-screen .member[data-member=rirum]{left:81px;bottom:88px;width:56px;height:84px}}
.quest-screen .story-device{--story-shade:.48;position:relative;isolation:isolate;width:390px;height:844px;margin:auto;overflow:hidden;display:grid;grid-template-rows:48px 54px minmax(0,1fr) 390px 48px;background:#17131e;box-shadow:0 16px 80px #0008}
.quest-screen .story-menu{background:transparent;font-size:11px;border:1px solid #79536e;padding:6px 9px;color:#f1cadf}
.quest-screen .story-heading{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:7px 17px;background:#211b2a;border-bottom:1px solid #604052}
.quest-screen .story-heading small{display:block;font-size:10px;letter-spacing:.7px;color:#e0a5c9;line-height:14px}
.quest-screen .story-heading h1{font-size:16px;line-height:22px;letter-spacing:.3px;margin:1px 0 0}
.quest-screen .story-heading>span{font:700 12px Arial,sans-serif;color:#c9afc3;white-space:nowrap}
.quest-screen .story-stage{position:relative;isolation:isolate;min-height:0;overflow:hidden;background:#171322}
.quest-screen .story-world,.quest-screen .story-multiply{position:absolute;inset:0;z-index:-2}
.quest-screen .story-world{background-size:cover;background-position:center}
.quest-screen .story-multiply{z-index:-1;background:#241c31;opacity:var(--story-shade);mix-blend-mode:multiply;pointer-events:none}
.quest-screen .story-person{position:absolute;object-fit:contain;object-position:center top;transition:opacity .2s,transform .25s;pointer-events:none}
.quest-screen .focus-person{width:min(64%,250px);height:auto;aspect-ratio:2/3;right:-4px;top:6px;bottom:auto;z-index:2;transform-origin:60% 0}
.quest-screen .support-person{width:min(48%,190px);height:auto;aspect-ratio:2/3;left:-27px;top:64px;bottom:auto;z-index:1;opacity:.55;transform:scale(.9);transform-origin:50% 0}
.quest-screen .story-stage.listening .focus-person{opacity:.85;transform:scale(.98)}
.quest-screen .story-stage.listening .support-person{opacity:.7}
.quest-screen .story-name{position:absolute;left:17px;top:13px;z-index:3;filter:drop-shadow(0 1px 3px #171020)}
.quest-screen .story-name small{font:700 9px Arial,sans-serif;letter-spacing:2px;display:block;color:#251221;background:#f04499;padding:3px 7px;width:max-content}
.quest-screen .story-name strong{font-size:21px;font-weight:850;display:block;margin-top:4px;text-shadow:0 1px 5px #171020}
.quest-screen .story-companions{position:absolute;z-index:3;left:8px;bottom:3px;display:flex;gap:0;pointer-events:none}
.quest-screen .story-companions img{height:54px;width:42px;object-fit:contain;filter:drop-shadow(0 2px 3px #0009)}
.quest-screen .reader-panel{position:relative;z-index:4;background:#211a29;display:flex;flex-direction:column;min-height:0;border-top:2px solid #f04499;clip-path:polygon(0 0,calc(100% - 13px) 0,100% 13px,100% 100%,0 100%)}
.quest-screen .reader-panel>header{display:flex;align-items:center;gap:8px;height:34px;flex-shrink:0;padding:0 17px;background:#2b1f30;border-bottom:1px solid #55354b}
.quest-screen .reader-panel>header>span:first-child{font-size:11px;color:#ffc1e0;font-weight:700}
.quest-screen .reader-guide{font-size:10px;color:#bfa8bb;margin-left:auto}
.quest-screen .reader-panel>header button{font-size:10px;padding:3px 7px;background:transparent;border:1px solid #79506b;color:#f4d3e6;flex-shrink:0}
.quest-screen .story-reader-body{overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:#c467a0 #38253c;padding:15px 16px 18px;flex:1;min-height:0;scroll-behavior:smooth}
.quest-screen .story-reader-body:focus-visible{outline:2px solid #ef8bbb;outline-offset:-2px}
.quest-screen .reader-block{border-left:2px solid transparent;padding:0 0 0 11px;margin:0 0 18px;transition:border-color .2s}
.quest-screen .reader-block.current{border-left-color:#f38cbd}
.quest-screen .reader-block p{font-size:17px;line-height:1.8;font-weight:500;letter-spacing:.15px;margin:0;color:#fbf2fa;overflow-wrap:anywhere}
.quest-screen .reader-block.narration p{font-size:16px;line-height:1.9;color:#e5d7e2}
.quest-screen .speaker-tag{display:block;padding:0;background:transparent;font-size:11px;font-weight:750;line-height:18px;color:#f4a4ce;cursor:pointer;margin:0 0 3px}
.quest-screen .speaker-tag:hover{color:#fff}
.quest-screen .read-progress{height:2px;background:#4c2c43;flex-shrink:0}
.quest-screen .read-progress i{display:block;height:100%;width:0;background:#f28fbd}
.quest-screen .story-nav{display:flex;align-items:stretch;gap:10px;padding:6px 13px;background:#17131e;border-top:1px solid #4d2e44;z-index:5}
.quest-screen .story-nav button{font-size:12px;font-weight:750;padding:0 11px;background:transparent;border:1px solid #6b4360;min-height:35px}
.quest-screen .story-nav button:disabled{opacity:.3;cursor:default}
.quest-screen .story-nav #next-scene{flex:1;background:#f04499;color:#281422;border:0;display:flex;align-items:center;justify-content:space-between;padding:0 16px;clip-path:polygon(0 0,calc(100% - 8px) 0,100% 8px,100% 100%,0 100%)}
.quest-screen .story-nav #next-scene span{font-size:19px}
.quest-screen .scene-list{display:grid;gap:7px;padding-top:14px}
.quest-screen .scene-list button{display:flex;gap:10px;align-items:center;text-align:left;padding:10px 11px;color:#f9e9f5;background:#302338;border:1px solid #67405b}
.quest-screen .scene-list button[aria-current=true]{border-color:#f04499;background:#482641}
.quest-screen .scene-list button>span{font:700 17px Arial,sans-serif;color:#efa6ce}
.quest-screen .scene-list button small{display:block;font-size:10px;color:#c1a7ba;line-height:16px}
.quest-screen .scene-list button strong{display:block;font-size:13px;line-height:20px}
.quest-screen .story-history h3{font-size:14px;border-left:2px solid #f04499;padding-left:9px;line-height:22px}
.quest-screen .story-history p{font-size:14px;line-height:1.8;margin:12px 0;color:#e5d1e1}
.quest-screen .story-history p b{display:block;font-size:11px;color:#f0a2c9}
.quest-screen .story-history article{border-bottom:1px solid #56334b;margin-bottom:20px;padding-bottom:8px}
.quest-screen #story-shade-reset{justify-self:start;font-size:13px;background:#392b40;border:1px solid #a87794;padding:10px 14px;color:#fff}
@media(max-width:600px){.quest-screen .story-device{width:100%;max-width:430px;height:calc(100svh - 32px);min-height:620px;grid-template-rows:45px 53px minmax(0,1fr) 390px 48px}
.quest-screen .focus-person{right:-2px}
.quest-screen .story-heading h1{font-size:15px}}
@media(max-height:740px){.quest-screen .story-device{grid-template-rows:42px 49px minmax(0,1fr) 330px 46px}
.quest-screen .focus-person{width:49%;right:8px;top:4px}
.quest-screen .support-person{width:39%;left:-12px;top:37px}
.quest-screen .story-name{top:8px;left:14px}
.quest-screen .story-name strong{font-size:17px}
.quest-screen .story-name small{font-size:8px}
.quest-screen .story-companions img{height:39px;width:32px}
.quest-screen .story-reader-body{padding-top:12px}
.quest-screen .reader-block p{font-size:16px;line-height:1.75}
.quest-screen .reader-block.narration p{font-size:15px;line-height:1.85}
.quest-screen .reader-block{margin-bottom:15px}
.quest-screen .reader-guide{font-size:9px}}
@media(prefers-reduced-motion:reduce){.quest-screen .story-person,.quest-screen .reader-block{transition:none}
.quest-screen .story-reader-body{scroll-behavior:auto}}
.quest-screen .support-person{opacity:1;filter:brightness(.55) saturate(.75)}
.quest-screen .story-stage.listening .focus-person{opacity:1;filter:brightness(.8)}
.quest-screen .story-stage.listening .support-person{opacity:1;filter:brightness(.65) saturate(.8)}
.quest-screen .story-stage.listening .story-name small{display:none}
/* Integration shell: no preview toolbar, actual gameplay fills the viewport. */
body.modern-road{background:#16151b}body.modern-road>.topbar{display:none}
body.modern-road #live{position:fixed;top:0;left:0;margin:0}
.quest-screen{width:100%;margin:0 auto}
.quest-screen .device,.quest-screen .battle-device,.quest-screen .story-device{width:100%;max-width:430px;height:100svh;margin:0 auto;min-height:620px}
.quest-screen .game-tools{display:flex;align-items:center;gap:7px}
.quest-screen .game-tools>button{font-size:10px;padding:4px 6px;min-height:27px;min-width:26px;border:1px solid #76516c;background:transparent;color:#f4cee3}
.quest-screen .game-tools .gold{font-size:15px;margin-right:3px}.quest-screen .game-tools .gold small{font-size:10px;color:#e7c8d9}
.quest-screen .status{border:0;border-radius:0;align-items:stretch;max-width:none;gap:21px}
.quest-screen .status>div{min-width:0}.quest-screen .status i{width:100%}
.quest-screen .enemy-hud .battle-map{margin-left:auto;font-size:10px;min-height:23px;padding:2px 7px}
.quest-screen .action-grid.ally small{max-height:29px;overflow:hidden}.quest-screen .action-grid small{font-weight:500}
.quest-screen .modern-dice-anchor{position:absolute;z-index:10;pointer-events:none}
.quest-screen .map-dice-anchor{inset:48px 0 0}
.quest-screen .battle-dice-anchor{right:15px;bottom:39px;width:92px;height:130px}
#roulette.inline-roll{position:absolute;inset:0;z-index:10;display:flex;align-items:center;justify-content:center;gap:0;padding:0;background:none;backdrop-filter:none;pointer-events:none}
#roulette.inline-roll .modern-roll-card{width:112px;min-width:0;max-width:none;max-height:none;padding:11px 9px;margin:0;background:#21182bf5;border:1px solid #ee9cca;border-radius:0;box-shadow:none;clip-path:polygon(0 0,calc(100% - 10px) 0,100% 10px,100% 100%,0 100%);text-align:center;display:flex;flex-direction:column;align-items:center;gap:8px}
#roulette.inline-roll #roll-label{font-size:10px;line-height:14px;margin:0;color:#f3d4e8;font-weight:700}
#roulette.inline-roll #roll-track{display:block;width:auto;overflow:visible;margin:0;transform:none;height:auto}
#roulette.inline-roll #roll-outcome{font-size:19px;line-height:23px;margin:0;min-height:0;color:#ffb4da}
#roulette.inline-roll .die{width:68px;height:68px;min-width:0;min-height:0;padding:12px;display:grid;grid-template-columns:repeat(3,1fr);grid-template-rows:repeat(3,1fr);gap:5px;background:#fff0f7;border-radius:8px;box-shadow:0 4px 0 #a3748f}
#roulette.inline-roll .die i{display:block;border-radius:50%;background:transparent}#roulette.inline-roll .die i.pip{background:#ae2d73}
#roulette.inline-roll .die.rolling{animation:shake .22s infinite}
.quest-screen .battle-dice-anchor #roulette.inline-roll .modern-roll-card{width:92px;padding:9px 6px}
.quest-screen .battle-dice-anchor #roulette.inline-roll .die{width:58px;height:58px;padding:10px;gap:4px}
.quest-screen .battle-dice-anchor #roulette.inline-roll #roll-label{font-size:9px;line-height:12px}
.quest-screen .battle-dice-anchor #roulette.inline-roll #roll-outcome{font-size:15px;line-height:18px}
.quest-screen .integrated-map-peek{height:230px}.quest-screen .integrated-map-peek #map{height:100%}
.quest-screen .combat-power{position:absolute;right:15px;top:48%;padding:6px 9px;background:#2c1933e8;border-left:2px solid #f04499;color:#ffd3eb;font-size:12px;font-weight:800}
.quest-screen .enemy-healing{left:auto;right:45px;top:25%}
.quest-screen .combat-victory{position:absolute;inset:30% 0 auto;text-align:center;font:900 36px Arial,sans-serif;letter-spacing:3px;color:#ffd0ec;text-shadow:2px 3px 0 #521d45}
.quest-screen .wind-effect{position:absolute;inset:20% 10% 18%;border:2px solid #d5d4ff;border-left-color:transparent;border-radius:50%;animation:road-slash .6s both}
.quest-screen .blast{height:12px;box-shadow:0 0 20px #f289c1;transform:rotate(-20deg)}
#utility{border-radius:8px;background:#211b2a;border-color:#9b5c82;max-width:610px;color:#fff1fa}
#utility h2{font-size:21px}#utility h3{font-size:16px;margin-top:22px;color:#f7acce}#utility p{font-size:15px}
#utility button{border-radius:4px}#utility details{border-top:1px solid #6e3e5a;margin-top:16px;padding-top:12px}
.integrated-shade{display:block;font-size:15px;margin:16px 0 22px}.integrated-shade output{float:right;color:#ffb2d8;font-weight:800}.integrated-shade input{display:block;width:100%;height:34px;accent-color:#f04499;margin-top:8px}
.integrated-party{display:grid;grid-template-columns:repeat(3,1fr);gap:9px}.integrated-party figure{margin:0;background:#302139;border-bottom:2px solid #f04499;text-align:center;min-width:0}.integrated-party img{height:130px;width:100%;object-fit:contain;object-position:top}.integrated-party figcaption{font-size:12px;padding:4px}
@media(max-height:740px){.quest-screen .battle-dice-anchor{right:10px;bottom:33px;width:75px;height:110px}.quest-screen .battle-dice-anchor #roulette.inline-roll .modern-roll-card{width:75px;padding:7px 5px}.quest-screen .battle-dice-anchor #roulette.inline-roll .die{width:47px;height:47px;padding:8px;gap:3px}.quest-screen .battle-dice-anchor #roulette.inline-roll #roll-label{font-size:8px}.quest-screen .battle-dice-anchor #roulette.inline-roll #roll-outcome{font-size:13px}}
@media(prefers-reduced-motion:reduce){#roulette.inline-roll .die.rolling{animation:none}}

/* Shared thumb position: primary actions are always 64px above the bottom edge. */
:root{--thumb-bottom:calc(64px + env(safe-area-inset-bottom,0px));--thumb-row:64px}
.quest-screen .main-action,.quest-screen .story-nav #next-scene,.thumb-dock .thumb-actions,.thumb-dock>.primary{position:fixed;z-index:12;left:50%;bottom:var(--thumb-bottom);transform:translateX(-50%);width:calc(min(100vw,430px) - 30px);height:var(--thumb-row);margin:0}
.quest-screen .main-action .dice-button{height:100%;min-height:0;width:100%;margin:0}
.quest-screen .commands nav{position:fixed;z-index:12;left:50%;bottom:calc(10px + env(safe-area-inset-bottom,0px));transform:translateX(-50%);width:calc(min(100vw,430px) - 30px);height:42px}
.quest-screen .commands .travel-note{position:fixed;left:50%;bottom:calc(132px + env(safe-area-inset-bottom,0px));transform:translateX(-50%);width:calc(min(100vw,430px) - 30px);margin:0;text-align:center}
.quest-screen .story-device{grid-template-rows:48px 54px minmax(0,1fr) clamp(230px,38svh,330px) calc(144px + env(safe-area-inset-bottom,0px))}
.quest-screen .story-nav{padding:0;height:144px;background:#17131e}
.quest-screen .story-nav #next-scene{font-size:16px;padding:0 18px}
.quest-screen .story-nav>button:first-child{position:fixed;left:calc(50% - min(50vw,215px) + 15px);bottom:calc(12px + env(safe-area-inset-bottom,0px));height:36px;min-height:36px;padding:0 15px}
.quest-screen .action-grid{position:fixed;z-index:12;bottom:var(--thumb-bottom);left:50%;transform:translateX(-50%);width:calc(min(100vw,430px) - 30px);height:64px;min-height:64px;max-height:64px;flex:none;margin:0}
.quest-screen .action-grid button{padding:6px 10px;gap:1px}
.quest-screen .action-grid .action-icon{position:absolute;right:9px;top:7px;gap:3px}
.quest-screen .action-grid .action-icon svg{width:18px;height:18px}
.quest-screen .action-grid.basic strong{font-size:16px}
.quest-screen .action-grid.basic small{font-size:10px;line-height:14px}
.quest-screen .action-grid.item button{padding:5px 7px;gap:2px}
.quest-screen .action-grid.item .action-icon{position:static;height:17px}
.quest-screen .action-grid.item .action-icon svg{width:15px;height:15px}
.quest-screen .action-grid.item strong{font-size:11px;line-height:15px}
.quest-screen .action-grid.item small{font-size:10px;line-height:13px}
.quest-screen .action-grid.ally{height:134px;min-height:134px;max-height:134px}
.quest-screen .combat-tabs{position:fixed;z-index:12;left:50%;bottom:calc(205px + env(safe-area-inset-bottom,0px));transform:translateX(-50%);width:calc(min(100vw,430px) - 30px);height:32px;margin:0;min-height:32px}
.quest-screen .turn-row{height:28px}
.quest-screen .battle-device{grid-template-rows:48px 66px minmax(0,1fr) 57px 59px calc(280px + env(safe-area-inset-bottom,0px))}
.quest-screen .combat-latest{position:fixed;left:50%;bottom:calc(12px + env(safe-area-inset-bottom,0px));transform:translateX(-50%);width:calc(min(100vw,430px) - 30px);height:36px;margin:0}
.quest-screen .enemy-auto{grid-column:1/-1;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:6px;background:#2b2233;border-left:2px solid #f04499;color:#e6cddd;min-width:0}
.quest-screen .enemy-auto strong{font-size:16px}.quest-screen .enemy-auto small{font-size:11px}
body.thumb-layout{background:#16151b}
body.thumb-layout>.topbar{height:48px;width:min(100%,430px);margin:auto;padding:0 15px;font-size:11px}
body.thumb-layout>.topbar .logo{font-size:15px}body.thumb-layout>.topbar .edition{font-size:9px}
body.thumb-layout>.topbar button{font-size:11px;padding:5px 8px;min-height:30px}
body.thumb-layout .event-layout{width:min(100%,430px);height:calc(100svh - 48px);min-height:0;padding:0 15px calc(154px + env(safe-area-inset-bottom,0px));display:flex;flex-direction:column;gap:12px;overflow-y:auto}
body.thumb-layout .event-art{height:clamp(130px,26svh,240px);min-height:130px;width:100%;flex-shrink:0;margin:0;border-radius:0}
body.thumb-layout .event-copy{width:100%;padding:0;margin:0}
body.thumb-layout .event-copy h1{font-size:23px;line-height:1.5;margin-bottom:12px}
body.thumb-layout .event-copy p{font-size:16px;line-height:1.75}
body.thumb-layout .result-mark{font-size:40px;margin-bottom:8px}
body.thumb-layout .shop-layout{width:min(100%,430px);padding:15px 15px calc(154px + env(safe-area-inset-bottom,0px));height:calc(100svh - 48px);overflow-y:auto}
body.thumb-layout .shop-grid{grid-template-columns:1fr;gap:10px}
body.thumb-layout .shop-item{padding:14px}.thumb-dock{position:fixed;z-index:11;left:50%;bottom:0;transform:translateX(-50%);width:min(100%,430px);height:calc(150px + env(safe-area-inset-bottom,0px));background:#17131e;border-top:1px solid #69405b;padding:0;margin:0}
.thumb-dock .thumb-actions{display:flex;gap:8px}
.thumb-dock .thumb-actions>button,.thumb-dock>.primary{flex:1;min-width:0;height:64px;min-height:64px;margin:0;padding:7px 12px;border:1px solid #b57099;border-radius:0;background:#f04499;color:#271321;font-size:15px;line-height:1.35;text-align:center;display:flex;flex-direction:column;justify-content:center;align-items:center}
.thumb-dock .thumb-actions>button.secondary{background:#2c2234;color:#ffe7f5}
.thumb-dock .thumb-actions>button strong{font-size:14px}.thumb-dock .thumb-actions>button small{color:inherit;font-size:10px;line-height:1.4;margin-top:4px}
.thumb-dock>.cash{position:absolute;bottom:14px;left:16px;font-size:17px}
body.thumb-layout .welcome{padding-bottom:170px;min-height:calc(100svh - 48px)}
body.thumb-layout .start-panel{padding-bottom:15px}.thumb-dock .continue{font-size:12px!important}
@media(max-height:740px){.quest-screen .battle-device{grid-template-rows:42px 61px minmax(0,1fr) 53px 54px calc(264px + env(safe-area-inset-bottom,0px))}.quest-screen .member[data-member=key]{bottom:95px;height:82px;width:55px}.quest-screen .member[data-member=rirum]{bottom:97px;height:82px;width:55px}}
.quest-screen .main-action{padding:0}
body.thumb-layout #live{position:fixed;top:0;left:0;margin:0}
.quest-screen .map-device{grid-template-rows:48px 42px minmax(0,1fr) 230px calc(160px + env(safe-area-inset-bottom,0px))}
@media(max-height:740px){.quest-screen .map-device{grid-template-rows:44px 39px minmax(0,1fr) 204px calc(160px + env(safe-area-inset-bottom,0px))}}
/* Every utility view uses the same thumb rows as the game screens. */
#utility{position:fixed;inset:0;margin:0 auto;width:min(100vw,430px);height:100svh;max-height:none;max-width:430px;padding:0;border:0;border-radius:0;overflow:hidden;background:#211b2a}
#utility-body{height:calc(100svh - 150px - env(safe-area-inset-bottom,0px));overflow-y:auto;overscroll-behavior:contain;padding:20px 17px 24px}
#utility-body h2{margin:0 0 18px;font-size:22px}
.utility-dock{position:fixed;z-index:15;left:50%;bottom:0;transform:translateX(-50%);width:min(100vw,430px);height:calc(150px + env(safe-area-inset-bottom,0px));background:#17131e;border-top:1px solid #69405b}
.utility-actions{position:absolute;left:15px;right:15px;bottom:var(--thumb-bottom);height:64px;display:flex;gap:8px}
#utility .utility-actions>button{height:64px;min-height:64px;flex:1;min-width:0;width:auto;margin:0;padding:8px 10px;border:1px solid #b57099;border-radius:0;background:#f04499;color:#271321;font-size:14px;line-height:1.4}
#utility .utility-actions>button:disabled{opacity:.4}
#utility .utility-actions>button+button{background:#2c2234;color:#ffe7f5}
.utility-nav,.thumb-aux{position:absolute;bottom:calc(12px + env(safe-area-inset-bottom,0px));left:15px;right:15px;height:36px;display:flex;gap:6px}
#utility .utility-nav>button,.thumb-aux>button{flex:1;min-width:0;margin:0;padding:4px 6px;height:36px;font-size:11px;line-height:1.3;border:1px solid #69405b;border-radius:0;background:#241c2b;color:#f2cde5}
#utility .bag-line{padding:12px 8px;gap:8px}#utility .bag-line.selected{border-left:3px solid #f04499;background:#3a263c}
#utility .bag-line>span{font-size:14px}#utility .bag-line>button{font-size:12px;padding:7px 10px;min-height:40px;border-radius:0}
body.thumb-layout .shop-item.selected{border-color:#f04499;background:#342238}
.shop-selected-label{position:absolute;bottom:15px;right:15px;max-width:75%;font-size:12px;color:#eac3dc}
body.thumb-layout .welcome-copy{padding-bottom:25px}
.quest-screen .ending-device{position:relative;isolation:isolate;overflow:hidden;width:100%;max-width:430px;height:100svh;min-height:620px;margin:auto;background:#17131e}
.quest-screen .ending-world{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;z-index:-2}
.quest-screen .ending-device>.brand{height:48px}
.quest-screen .ending-title{padding:35px 18px 12px;text-align:center;text-shadow:0 2px 4px #15101d}
.quest-screen .ending-title>small{font:700 10px Arial,sans-serif;letter-spacing:3px;color:#ffd3e9}
.quest-screen .ending-title h1{font:900 60px/.95 Arial,sans-serif;letter-spacing:-3px;margin:15px 0;color:#ff69ae}
.quest-screen .ending-title h1 span{color:#fff4fb;display:block;font-size:89px;letter-spacing:-5px}
.quest-screen .ending-title p{font-size:15px;font-weight:700}
.quest-screen .ending-party{position:absolute;bottom:260px;left:5px;right:5px;display:grid;grid-template-columns:repeat(5,1fr);align-items:end;gap:0}
.quest-screen .ending-party figure{margin:0;min-width:0}
.quest-screen .ending-party img{display:block;width:100%;height:150px;object-fit:contain;object-position:top}
.quest-screen .ending-party figcaption{text-align:center;font:700 10px Arial,sans-serif;background:#211b2ac9;padding:5px 0;color:#fff}
.quest-screen .ending-companions{position:absolute;bottom:209px;left:0;right:0;display:flex;justify-content:center;gap:12px}
.quest-screen .ending-companions img{width:40px;height:48px;object-fit:contain}
.quest-screen .ending-record{position:absolute;bottom:160px;left:16px;right:16px;display:flex;flex-wrap:wrap;justify-content:center;gap:5px 12px;color:#ffe6f5;text-shadow:0 1px 3px #181020}
.quest-screen .ending-record span{font-size:12px;font-weight:700}.quest-screen .ending-record small{width:100%;text-align:center;font-size:10px;color:#e7cee0}
@media(max-height:740px){.quest-screen .ending-title{padding-top:19px}.quest-screen .ending-title h1{font-size:43px;margin:10px 0}.quest-screen .ending-title h1 span{font-size:65px}.quest-screen .ending-title p{font-size:13px}.quest-screen .ending-party img{height:115px}}

.quest-screen .ending-world{object-position:15% center}

.quest-screen .map-device[data-chapter="2"] .world{object-position:25% top}
.quest-screen .map-device[data-chapter="3"] .world{object-position:75% top}
/* Art occupies the upper three quarters; information floats above it. */
.quest-screen{--control-zone:max(25svh,calc(166px + env(safe-area-inset-bottom,0px)))}
.quest-screen .map-device,.quest-screen .story-device,.quest-screen .battle-device{display:block;position:relative;height:100svh;min-height:0;overflow:hidden;isolation:isolate}
.quest-screen .map-device>.brand,.quest-screen .story-device>.brand,.quest-screen .battle-device>.brand{position:absolute;inset:0 0 auto;height:48px;z-index:7;background:#18151eb3;backdrop-filter:blur(6px)}
.quest-screen .commands,.quest-screen .story-nav,.quest-screen .combat-controls{position:absolute;inset:auto 0 0;height:var(--control-zone);padding:0;background:#17131e;border-top:1px solid #6b3657;z-index:8}
/* Story: a single line of dialogue, with no scrolling or separate text page. */
.quest-screen .story-heading{position:absolute;inset:48px 0 auto;height:56px;z-index:5;background:#1915218c;padding:8px 17px;backdrop-filter:blur(4px)}
.quest-screen .story-stage{position:absolute;inset:0 0 var(--control-zone);overflow:hidden;min-height:0}
.quest-screen .story-person.focus-person{top:100px;right:-38%;width:145%;height:auto;aspect-ratio:auto;object-fit:contain;object-position:center top;transform:none}
.quest-screen .story-person.support-person{top:129px;left:-44%;width:125%;height:auto;aspect-ratio:auto;object-fit:contain;object-position:center top;transform:none;opacity:.65}
.quest-screen .story-person.support-person[src*="/monsters/"]{left:-15%;width:75%;height:calc(100% - 70px)}
@media(max-width:700px){.splash-person.reco{top:8px}.splash-person.suzu{top:24px}}
.quest-screen .story-stage.listening .focus-person{opacity:1;transform:none}
.quest-screen .story-companions{left:auto;right:12px;top:108px;bottom:auto;gap:4px;z-index:4}
.quest-screen .story-companions img{width:30px;height:37px}
.quest-screen .reader-panel{position:absolute;isolation:isolate;left:12px;right:12px;bottom:calc(var(--control-zone) + 12px);height:auto;min-height:112px;z-index:6;background:transparent;border:1px solid #c287a777;border-top:2px solid #f04499;clip-path:none;backdrop-filter:blur(7px);box-shadow:0 6px 24px #100d1940}
.quest-screen .reader-panel:before{content:"";position:absolute;inset:0;background:#15101ce8;mix-blend-mode:multiply;z-index:-1;pointer-events:none}
.quest-screen .reader-panel>header{height:34px;padding:0 13px;background:#30203780;border-bottom:1px solid #96628144}
.quest-screen .reader-panel>header>span:first-child{font-size:15px;color:#ffd2e8}
.quest-screen .reader-guide{margin-left:auto;font-size:11px;color:#e3c3d7}
.quest-screen .reader-panel>header button{font-size:12px;min-height:28px}
.quest-screen .story-reader-body{overflow:visible;height:auto;flex:none;padding:10px 14px 14px;overscroll-behavior:auto}
.quest-screen .reader-block,.quest-screen .reader-block.current,.quest-screen .reader-block.narration{padding:0;margin:0;border:0;background:transparent;opacity:1;transform:none}
.quest-screen .reader-block p,.quest-screen .reader-block.narration p{font-size:15px;line-height:1.65;color:#fff6fc;margin:0;letter-spacing:0;overflow-wrap:normal;word-break:normal;line-break:strict;text-wrap:wrap}
.quest-screen .read-progress{height:2px}
/* Board: retain every map node and movement animation as a translucent overlay. */
.quest-screen .map-device .world{height:calc(100% - var(--control-zone));width:100%;object-fit:cover}
.quest-screen .map-device>.status{position:absolute;left:0;right:0;top:48px;z-index:6;height:44px;background:#191521a8}
.quest-screen .character-stage{position:absolute;inset:92px 0 var(--control-zone);overflow:hidden}
.quest-screen .character-stage .hero{top:10px;right:-37%;width:145%;height:auto;object-position:top}
.quest-screen .character-stage .chapter{top:12px;left:17px}
.quest-screen .character-stage .hero-name{top:113px;bottom:auto;left:17px}
.quest-screen .character-stage .hero-name strong{font-size:32px}
.quest-screen .character-stage .companions{top:170px;bottom:auto;left:17px;right:auto}
.quest-screen .board{position:absolute;left:12px;right:12px;bottom:calc(var(--control-zone) + 8px);height:clamp(182px,28svh,230px);border:1px solid #b5739e77;border-top:2px solid #f04499;background:#18162580;backdrop-filter:blur(5px);clip-path:none}
.quest-screen .board>header{height:40px;background:#21192bbb;padding:0 10px;gap:8px}
.quest-screen .board #map{background:transparent}
.quest-screen .board #map>svg{background:transparent}
.quest-screen .map-dice-anchor{inset:40px 0 0}
/* Battle uses the same lower action row; all five allies remain in the arena. */
.quest-screen .enemy-hud{position:absolute;top:48px;left:0;right:0;height:66px;z-index:6;background:#21182bb8;backdrop-filter:blur(5px)}
.quest-screen .arena{position:absolute;inset:0 0 var(--control-zone);overflow:hidden}
.quest-screen .arena .foe{top:119px;width:40%;right:12px}
.quest-screen .arena .party-formation{top:114px;bottom:110px}
.quest-screen .arena .member[data-member=reco]{left:18%;bottom:0;width:28%;height:auto;aspect-ratio:2/3}
.quest-screen .arena .member[data-member=suzu]{left:0;bottom:5px;width:27%;height:auto;aspect-ratio:2/3}
.quest-screen .arena .member[data-member=roid]{left:40%;bottom:3px;width:26%;height:auto;aspect-ratio:2/3}
.quest-screen .arena .member[data-member=key]{left:4%;bottom:110px;width:22%;height:auto;aspect-ratio:2/3}
.quest-screen .arena .member[data-member=rirum]{left:25%;bottom:115px;width:22%;height:auto;aspect-ratio:2/3}
.quest-screen .arena .lineup-names{bottom:104px}
.quest-screen .intent{position:absolute;left:12px;right:12px;bottom:calc(var(--control-zone) + 78px);height:44px;z-index:6;padding:4px 9px;background:#21192bd9;border-left:2px solid #f04499;backdrop-filter:blur(5px)}
.quest-screen .intent strong{font-size:13px}.quest-screen .intent p{font-size:11px;line-height:1.4}
.quest-screen .party-hud{position:absolute;left:0;right:0;bottom:calc(var(--control-zone) + 28px);height:48px;z-index:6;background:#191521c9;backdrop-filter:blur(5px);padding:3px 16px 8px}
.quest-screen .turn-row{position:fixed;left:50%;transform:translateX(-50%);width:calc(min(100vw,430px) - 30px);bottom:calc(var(--control-zone) + 1px);height:26px;padding:0;background:#211a2bd9;z-index:9}
.quest-screen .combat-tabs{bottom:calc(132px + env(safe-area-inset-bottom,0px));height:30px;min-height:30px}
.quest-screen .action-grid.ally{height:64px;min-height:64px;max-height:64px;grid-template-columns:repeat(5,minmax(0,1fr));grid-template-rows:1fr;gap:4px}
.quest-screen .action-grid.ally button{padding:5px 2px;justify-content:center;align-items:center;text-align:center}
.quest-screen .action-grid.ally strong{font-size:12px;line-height:1.4;white-space:nowrap}
.quest-screen .action-grid.ally small{display:none}
.quest-screen .action-grid.ally .action-cost{position:static;font-size:11px;line-height:1.6}
.quest-screen .arena.focus-party:after,.quest-screen .arena.focus-foe:after{top:117px}
.quest-screen .battle-dice-anchor{bottom:133px;right:12px}
@media(max-height:700px){
 .quest-screen .arena .party-formation{top:120px;bottom:120px}
 .quest-screen .arena .member[data-member=key]{bottom:95px;width:25%}
 .quest-screen .arena .member[data-member=rirum]{bottom:98px;width:25%}
 .quest-screen .arena .member[data-member=reco]{width:32%}
 .quest-screen .arena .member[data-member=suzu],.quest-screen .arena .member[data-member=roid]{width:31%}
}
/* Encounters and results keep their copy over the same large illustration. */
body.thumb-layout{--control-zone:max(25svh,calc(166px + env(safe-area-inset-bottom,0px)))}
body.thumb-layout .event-layout{position:relative;display:block;height:calc(100svh - 48px);min-height:0;padding:0;overflow:hidden;isolation:isolate}
body.thumb-layout .event-art{position:absolute;inset:0 0 var(--control-zone);width:100%;height:auto;min-height:0;border:0;border-radius:0;margin:0;background:var(--scene) center/cover}
body.thumb-layout .event-art .main-character{position:absolute;top:8px;bottom:auto;left:8%;width:92%;height:auto;object-fit:contain;object-position:top}
body.thumb-layout .event-art .mascots{top:12px;right:10px;bottom:auto;gap:3px}
body.thumb-layout .event-art .mascots img{width:30px;height:38px}
body.thumb-layout .event-art .mascots figcaption{display:none}
body.thumb-layout .event-copy{position:absolute;left:12px;right:12px;bottom:calc(var(--control-zone) + 12px);width:auto;padding:14px;margin:0;background:#18121de0;border:1px solid #b8789c77;border-top:2px solid #f04499;backdrop-filter:blur(6px)}
body.thumb-layout .event-copy .eyebrow{font-size:11px;letter-spacing:1px;margin-bottom:6px}
body.thumb-layout .event-copy h1{font-size:21px;line-height:1.4;margin-bottom:9px}
body.thumb-layout .event-copy p{font-size:16px;line-height:1.65;margin-bottom:9px}
body.thumb-layout .event-copy p:last-of-type{margin-bottom:0}
body.thumb-layout .event-copy>small{font-size:12px;display:block;margin-top:10px}
body.thumb-layout .event-copy .result-mark{font-size:28px;margin-bottom:5px}
body.thumb-layout .event-copy .thumb-dock,.thumb-dock{height:var(--control-zone,calc(150px + env(safe-area-inset-bottom,0px)))}
/* Utility text stays on a translucent layer over the live scene. */
#utility{background:transparent;color:#fff6fc;--control-zone:max(25svh,calc(166px + env(safe-area-inset-bottom,0px)))}
#utility::backdrop{background:#100b181a;backdrop-filter:none}
#utility-body{position:absolute;left:12px;right:12px;bottom:calc(var(--control-zone) + 12px);height:auto;max-height:46svh;padding:16px 14px 20px;background:#18121ddd;backdrop-filter:blur(6px);border:1px solid #b8789c77;border-top:2px solid #f04499;scrollbar-width:thin;scrollbar-color:#ba729e #21192b}
#utility-body h2{font-size:20px;margin-bottom:14px}
#utility .utility-dock{height:var(--control-zone)}
#utility .rules-list{padding-left:22px;font-size:15px;line-height:1.8}
#utility .rules-list li+li{margin-top:10px}
body.utility-open .quest-screen .reader-panel,body.utility-open .quest-screen .board,body.utility-open .event-copy,body.utility-open .shop-overlay{visibility:hidden}
body.utility-open .quest-screen .intent,body.utility-open .quest-screen .party-hud,body.utility-open .quest-screen .turn-row,body.utility-open .quest-screen .combat-tabs,body.utility-open .quest-screen .action-grid,body.utility-open .quest-screen .combat-latest{visibility:hidden}
/* The shop keeps its own scene; the stock list floats over the lower artwork. */
body.thumb-layout .shop-layout{position:relative;width:min(100%,430px);height:calc(100svh - 48px);padding:0;margin:auto;overflow:hidden;isolation:isolate}
body.thumb-layout .shop-overlay{position:absolute;left:12px;right:12px;bottom:calc(var(--control-zone) + 12px);max-height:48svh;overflow-y:auto;padding:14px;background:#18121ddd;border:1px solid #b8789c77;border-top:2px solid #f04499;backdrop-filter:blur(6px);scrollbar-width:thin;scrollbar-color:#ba729e #21192b}
body.thumb-layout .shop-title{gap:8px;margin-bottom:8px}
body.thumb-layout .shop-title .portrait{display:none}
body.thumb-layout .shop-title h1{font-size:20px;margin:0}
body.thumb-layout .shop-title .eyebrow{font-size:10px;letter-spacing:1px;margin-bottom:4px}
body.thumb-layout .shop-overlay>p{font-size:15px;line-height:1.7;margin:6px 0 10px}
body.thumb-layout .shop-grid{grid-template-columns:1fr;gap:8px}
body.thumb-layout .shop-item{padding:11px;background:#2b1f32a8;border:1px solid #9b5e824d;border-radius:0}
body.thumb-layout .shop-item h2{font-size:17px;margin-bottom:5px}
body.thumb-layout .shop-item p{font-size:14px;line-height:1.6;min-height:0;margin-bottom:8px}
body.thumb-layout .shop-item button{font-size:14px;min-height:40px;border-radius:0;padding:7px 12px;background:#34253c}
body.thumb-layout .shop-overlay{max-height:40svh}
body.thumb-layout .shop-overlay .toast:empty{display:none}
#utility-body{max-height:40svh}
/* A battle result keeps the battlefield and party instead of switching to a portrait. */
body.thumb-layout .encounter-art{position:absolute;inset:0 0 var(--control-zone);width:100%;overflow:hidden}
body.thumb-layout .encounter-art .arena{inset:0}
body.thumb-layout .encounter-art .arena .foe{top:71px}
body.thumb-layout .encounter-art .arena .party-formation{top:66px;bottom:100px}
.quest-screen .ending-record{bottom:calc(var(--control-zone) + 12px)}
.quest-screen .ending-companions{bottom:calc(var(--control-zone) + 52px)}
/* Ending reward dice: a compact slot below the party, clear of faces. */
.quest-screen .ending-device:has(.ending-reward){min-height:0}
.quest-screen .ending-device:has(.ending-reward) .ending-title{padding-top:clamp(5px,2svh,20px)}
.quest-screen .ending-device:has(.ending-reward) .ending-title h1{font-size:clamp(30px,5.5svh,50px);margin:8px 0}
.quest-screen .ending-device:has(.ending-reward) .ending-title h1 span{font-size:clamp(40px,7.5svh,70px)}
.quest-screen .ending-device:has(.ending-reward) .ending-party{bottom:calc(var(--control-zone) + 158px)}
.quest-screen .ending-device:has(.ending-reward) .ending-party img{height:clamp(65px,15svh,140px)}
.quest-screen .ending-device:has(.ending-reward) .ending-companions{bottom:calc(var(--control-zone) + 118px)}
.quest-screen .ending-reward{position:absolute;left:12px;right:12px;bottom:calc(var(--control-zone) + 47px);height:66px;display:flex;align-items:center;justify-content:center;gap:10px;background:#0008;border-block:1px solid #ffffff30}
.quest-screen .ending-reward p{font-size:clamp(12px,3.4vw,15px);margin:0}.quest-screen .ending-reward small{font-size:10px}
.quest-screen .ending-reward b{color:#ff72b9;font-size:22px}
.quest-screen .ending-dice-anchor{position:relative;inset:auto;width:58px;height:60px;flex:none}
.quest-screen .ending-die-face{font:54px/60px sans-serif;color:#fff}
.quest-screen .ending-dice-anchor #roulette.inline-roll .modern-roll-card{width:58px;padding:3px;gap:0;background:#111;border:0;clip-path:none}
.quest-screen .ending-dice-anchor #roll-label{display:none}.quest-screen .ending-dice-anchor #roulette.inline-roll .die{width:42px;height:42px;padding:6px;gap:3px}.quest-screen .ending-dice-anchor #roll-outcome{font-size:12px}
.quest-screen .ending-device:has(.ending-reward) .ending-companions img{height:36px;width:34px}
@media(max-height:640px){.quest-screen .ending-device:has(.ending-reward) .ending-title{padding-top:0;padding-bottom:4px}.quest-screen .ending-device:has(.ending-reward) .ending-title h1{font-size:22px;margin:2px 0}.quest-screen .ending-device:has(.ending-reward) .ending-title h1 span{font-size:28px}.quest-screen .ending-device:has(.ending-reward) .ending-title p{font-size:12px;margin:2px 0}.quest-screen .ending-device:has(.ending-reward) .ending-party img{height:65px}}
