#mapDialog.map40{width:min(720px,calc(100vw - 16px));max-width:720px;padding:12px;max-height:calc(100dvh - 20px);overflow:auto;background:#171b29;color:#ece5ee;box-sizing:border-box}.map40-head{display:flex;gap:6px;align-items:center;flex-wrap:wrap}.map40-head strong{flex:1;min-width:140px;font-size:16px}.map40-head button{min-height:44px;padding:7px 10px;font-size:13px}.map40-stage{position:relative;height:clamp(220px,43dvh,430px);overflow:hidden;border:1px solid #766885;border-radius:14px;background:#243831;touch-action:none}.map40-stage>canvas{position:absolute;inset:0;width:100%;height:100%;pointer-events:none}#map40-ground{z-index:0}#map40-front{z-index:3}#map40-pet{position:absolute;width:68px;height:78px;transform:translate(-50%,-86%);z-index:2;pointer-events:none}#map40-pet img{width:100%;height:100%;object-fit:contain}#map40-pet img,#map40-pet canvas{transform:scaleX(var(--map53-mirror,1))}#map40-pet span{position:absolute;bottom:-3px;left:29px;font-size:11px;color:#d5f7dc}#map40-pet[data-facing=up] span{transform:rotate(180deg)}#map40-pet[data-facing=left] span{transform:rotate(90deg)}#map40-pet[data-facing=right] span{transform:rotate(-90deg)}.map40-controls{display:flex;align-items:center;justify-content:space-between;gap:18px;padding:8px 12px}.map40-controls button{min-height:64px;max-width:55%;font-size:16px;flex:1;touch-action:manipulation}#map40-stick{position:relative;width:116px;height:116px;flex:none;border:2px solid #9c86b6;border-radius:50%;background:radial-gradient(#50475f,#252735);touch-action:none;user-select:none}#map40-stick span{position:absolute;width:48px;height:48px;left:34px;top:34px;border-radius:50%;background:#c3add5;border:2px solid #e3d6ed;box-sizing:border-box;pointer-events:none}#map40-info,#map40-hint{font-size:12px;margin:8px 0;min-height:18px;line-height:1.4}.map40 small{display:block;font-size:11px;line-height:1.4;color:#b8b2c9}@media(max-height:640px){.map40-stage{height:32dvh;min-height:160px}#map40-stick{width:94px;height:94px}#map40-stick span{left:23px;top:23px}.map40-controls{padding:4px}.map40 small{font-size:10px}}body:has(#mapDialog[open]){overflow:hidden;overscroll-behavior:none}

#map40-guide{font-size:12px;color:#e7d3a7;margin:6px 0;line-height:1.4;max-height:42px;overflow:auto}#map40-pet .pet-animation{width:100%;height:100%;object-fit:contain}

.map40-route{display:flex;align-items:center;gap:8px;font-size:12px;margin:5px 0}.map40-route select{flex:1;min-width:0;min-height:36px;font-size:12px;background:#262837;color:#eee3f5;border:1px solid #847294;border-radius:8px;padding:5px}

#map40-pet img[data-branch=true]{filter:hue-rotate(var(--branch-hue,100deg)) saturate(1.4) drop-shadow(0 0 4px #92e7ef)}#map40-pet.lunar img[data-branch=true]{filter:hue-rotate(var(--branch-hue,100deg)) hue-rotate(105deg) saturate(1.4) drop-shadow(0 0 4px #dbb2ff)}
/* V41: let the world occupy the screen, with controls reachable below it. */
.navigation-v16 #mapDialog.map40{height:calc(100dvh - 12px);max-height:calc(100dvh - 12px);width:calc(100vw - 12px);max-width:850px;padding:10px;overflow:hidden;display:none;flex-direction:column;gap:4px;border-radius:18px;background:#171e2b}
.navigation-v16 #mapDialog.map40[open]{display:flex}
#mapDialog.map40 .nav-trail{margin:0 0 3px;padding:0 0 4px;min-height:36px;font-size:11px;flex:none}
#mapDialog.map40 .nav-trail button{min-height:36px;padding:4px 10px;font-size:12px}
#mapDialog.map40 .map40-head{flex-wrap:nowrap;gap:5px;flex:none}
#mapDialog.map40 .map40-head strong{font-size:14px;line-height:1.2;min-width:0}
#mapDialog.map40 .map40-head button{min-height:36px;padding:5px 8px;font-size:12px;flex:none}
#mapDialog.map40 .map40-head .close{width:36px;height:36px;font-size:22px}
#mapDialog.map40 #map40-info{font-size:11px;min-height:14px;margin:1px 0;flex:none}
#mapDialog.map40 #map40-guide{font-size:11px;line-height:1.3;max-height:29px;min-height:14px;margin:0;flex:none}
#mapDialog.map40 .map40-route{font-size:11px;margin:1px 0 3px;flex:none}
#mapDialog.map40 .map40-route select{min-height:30px;font-size:11px;padding:3px 5px}
#mapDialog.map40 .map40-stage{flex:1;min-height:180px;height:auto;border-radius:12px;border-color:#6b7780}
#mapDialog.map40 #map40-hint{font-size:11px;margin:1px 0;min-height:14px;flex:none}
#mapDialog.map40 .map40-controls{flex:none;padding:3px 10px;gap:20px}
#mapDialog.map40 #map40-stick{width:88px;height:88px;border-color:#899c9c;background:radial-gradient(#40505b,#222b3c)}
#mapDialog.map40 #map40-stick span{width:38px;height:38px;left:25px;top:25px;background:#9ebbbe;border-color:#d0e4dc}
#mapDialog.map40 .map40-controls button{min-height:58px;max-width:60%;font-size:13px;line-height:1.2;padding:8px}
#mapDialog.map40 small{font-size:9px;line-height:1.2;text-align:center;flex:none}
#mapDialog.map40 #map40-pet{width:49px;height:56px;filter:drop-shadow(0 4px 2px #111b2577)}
#mapDialog.map40 #map40-pet span{left:20px;font-size:9px}
@media(min-width:800px){.navigation-v16 #mapDialog.map40{height:min(820px,calc(100dvh - 12px))}}
@media(max-height:540px){#mapDialog.map40 #map40-guide,#mapDialog.map40 small{display:none}#mapDialog.map40 .map40-controls{position:absolute;bottom:14px;left:14px;right:14px;pointer-events:none}#mapDialog.map40 .map40-controls>*{pointer-events:auto;opacity:.85}#mapDialog.map40 #map40-stick{width:88px;height:88px}}

/* V48: Phaser owns the scene; original actor elements retain accessible layout and hit targets. */
#phaser48-world{position:absolute;inset:0;width:100%!important;height:100%!important;z-index:0;pointer-events:none;display:none}
.phaser48-active #phaser48-world{display:block}
.phaser48-active #map40-ground,.phaser48-active #map40-front{visibility:hidden}
.phaser48-active #map40-pet,.phaser48-active #map44-players{opacity:0}
#phaser48-quality{font-size:11px;min-height:30px;padding:4px 8px;flex:none;border:1px solid #78918d;background:#23363c;color:#dcebe0;border-radius:8px}
.map40-tools{display:flex;flex-wrap:wrap;align-items:center;gap:5px}.map40-tools .map40-route{flex:1;min-width:150px}
