/* Terrain pixels and world units share one uniformly scaled, following camera. */
.original-layout .scene-head{right:4%;top:17%;opacity:1;max-width:65%;z-index:5;pointer-events:none}
.original-layout .scene-head h2{display:block;margin:0 0 3px;font-family:KaiTi,'DFKai-SB',serif;font-size:clamp(13px,3.4cqw,18px);font-weight:600;letter-spacing:1px;line-height:1.4;color:#fff4d3;text-shadow:0 1px 3px #142b20,1px 0 2px #142b20,-1px 0 2px #142b20;overflow-wrap:anywhere}
.original-layout .scene-head .stage-number{font-size:clamp(9px,2.1cqw,11px);text-shadow:0 1px 3px #0d2519}
.original-layout .landscape{background-position:center center;background-size:cover;background-repeat:no-repeat}
.landscape.scene-camera-map{overflow:hidden;background:#405e43;filter:none}
.scene-tile-layer{position:absolute;left:0;top:0;transform-origin:0 0;background-position:0 0;background-size:100% 100%;background-repeat:no-repeat;pointer-events:none;will-change:transform}
.scene-tile{position:absolute;display:block;width:512px;height:512px;max-width:none;border:0;padding:0;opacity:0;pointer-events:none;image-rendering:auto}
.scene-tile-ready{opacity:1}
.original-layout .scene-world-camera{inset:auto;left:0;top:0;right:auto;bottom:auto;width:1000px;height:700px;transform-origin:0 0;border-radius:0;will-change:transform}
.original-layout .scene-world-camera .rt-name,.original-layout .scene-world-camera .rt-model-loaded .rt-name{font-size:12px}
.original-layout .scene-world-camera .rt-unit{width:62px;height:74px}
.original-layout .scene-world-camera .rt-hero{width:64px;height:95px}
.original-layout .scene-world-camera .rt-unit.boss{width:104px;height:112px}
.original-layout .scene-world-camera .rt-model-loaded{height:65px}
.original-layout .scene-world-camera .rt-model-loaded.rt-hero{height:75px}
.original-layout .scene-world-camera .rt-model-loaded.boss{height:110px}
.original-layout .landscape:after{content:'';position:absolute;inset:0;background:linear-gradient(#12271935,transparent 30%,transparent 64%,#102e2240);pointer-events:none}
.scene-arrival{position:absolute;left:15%;right:15%;top:25%;padding:13px 16px;background:linear-gradient(90deg,transparent,#173b2eea 20%,#173b2eea 80%,transparent);border-top:1px solid #d3bb7666;border-bottom:1px solid #d3bb7666;color:#fff3bf;text-align:center;font-family:KaiTi,'DFKai-SB',serif;font-size:clamp(15px,4cqw,21px);letter-spacing:2px;line-height:1.4;z-index:8;pointer-events:none;text-shadow:0 1px 4px #0a2419;animation:scene-notice-in .25s ease-out}
.scene-arrival[hidden],.scene-load-status[hidden],.scene-map-button[hidden],.rt-network-notice[hidden]{display:none}
.scene-load-status{position:absolute;right:4%;top:29%;max-width:70%;color:#fff4d1;background:#143222d9;border-radius:3px;padding:3px 6px;font-size:clamp(10px,2.2cqw,12px);line-height:1.4;z-index:7}
.scene-load-status button{margin-left:8px;padding:3px 7px;min-height:30px;border:1px solid #c6bf8c;background:#163e2a;color:#ffe8ad;border-radius:3px;font-size:inherit}
.scene-load-status button[hidden]{display:none}
.scene-map-button{position:absolute;right:4%;top:23%;width:clamp(44px,10cqw,54px);height:clamp(44px,10cqw,54px);border:1px solid #cdb27d;border-radius:50%;background:radial-gradient(#596746ee,#203c2bf5);box-shadow:inset 0 0 0 3px #182e29,0 2px 5px #07150cb3;color:#fff0bf;text-shadow:0 1px 2px #13271d;font-family:KaiTi,'DFKai-SB',serif;font-size:clamp(13px,3cqw,16px);z-index:8}
.scene-map-button:hover{filter:brightness(1.12)}
.scene-map-button:focus-visible{outline:2px solid #fff0b5;outline-offset:3px}
.battlefield>.rt-field-badge{position:absolute;bottom:auto;height:auto;left:13%;right:17%;top:22%;z-index:6;display:block;text-align:center;color:#f4e9b9;text-shadow:0 1px 3px #102a1d;font-size:clamp(10px,2.1cqw,12px);pointer-events:none}
.battlefield>.rt-network-notice{position:absolute;left:15%;right:15%;top:35%;z-index:9;padding:10px 12px;border:1px solid #e5c89688;background:#202b26ed;text-align:center;color:#fff0c5;font-size:clamp(11px,2.5cqw,14px);pointer-events:none}
.scene-world-camera.rt-disconnected:after{display:none}
.scene-map-dialog{box-sizing:border-box;width:min(600px,calc(100vw - 24px));max-width:none;max-height:calc(100dvh - 24px);padding:18px;overflow:auto;border:1px solid #c0a768;border-radius:8px;color:#f2eacb;background:linear-gradient(140deg,#254332,#14291f);box-shadow:0 15px 60px #0009;font-family:'Microsoft JhengHei','PingFang TC',sans-serif}
.scene-map-dialog::backdrop{background:#06140cc9}
.scene-map-header{display:flex;justify-content:space-between;align-items:start;gap:12px;margin-bottom:14px}
.scene-map-header small{font-size:10px;letter-spacing:3px;color:#c9bc8c}
.scene-map-header h2{margin:3px 0 4px;font-size:22px;font-family:KaiTi,'DFKai-SB',serif;letter-spacing:2px;color:#ffefba}
.scene-map-header p{margin:0;font-size:13px;color:#dae1cd}
.scene-map-header button{flex-shrink:0;width:44px;height:44px;border-radius:50%;border:1px solid #c0a76888;background:#193023;color:#f9eac1;font-size:26px;line-height:1}
.scene-overview{position:relative;width:min(100%,66dvh);border:1px solid #b4aa7c88;background:#13251c;overflow:hidden;margin:0 auto}
.scene-overview>img{display:block;width:100%;height:100%;object-fit:contain;object-position:center;aspect-ratio:11 / 10}
.scene-overview>svg{position:absolute;inset:0;width:100%;height:100%;overflow:visible;pointer-events:none}
.scene-active-zone{fill:#ffd46824;stroke:#ffdf83;stroke-width:16;stroke-dasharray:45 24}
.scene-viewport-zone{fill:#ecfbff10;stroke:#e5faff;stroke-width:10}
.scene-player-pin{fill:#7bfff0;stroke:#103e3c;stroke-width:12}
.scene-map-legend{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:10px 16px;margin:13px 0 9px;font-size:11px;color:#eee6c3}
.scene-map-legend>span{display:inline-flex;align-items:center;gap:5px}
.scene-map-legend i{display:inline-block;width:12px;height:10px}
.legend-active{border:1px dashed #ffdf83;background:#ffd46824}
.legend-viewport{border:1px solid #e5faff;background:#ecfbff10}
.scene-map-legend .legend-player{width:9px;height:9px;border-radius:50%;background:#7bfff0;border:1px solid #103e3c}
.scene-map-note{margin:8px 0 0;text-align:center;font-size:12px;color:#d0c7a7}
#scene-overview-status{margin:10px 0;color:#ffdbad;text-align:center;font-size:12px}
#scene-overview-status[hidden]{display:none}
.scene-changing{animation:scene-ground-in .45s ease-out}
@keyframes scene-ground-in{from{filter:brightness(.65)}to{filter:brightness(1)}}
@keyframes scene-notice-in{from{opacity:0;transform:translateY(4px)}to{opacity:1;transform:translateY(0)}}
.reduced-motion .scene-changing,.reduced-motion .scene-arrival{animation:none}
@media(max-height:550px){.scene-map-dialog{width:min(620px,calc(100vw - 24px));padding:12px}.scene-map-header{margin-bottom:9px}.scene-map-header h2{font-size:18px}.scene-overview{width:min(100%,calc(52dvh * 1.1));max-height:none}.scene-map-legend{margin:8px 0 4px}.scene-map-note{margin-top:4px}}
@media(prefers-reduced-motion:reduce){.scene-changing,.scene-arrival{animation:none}}
/* P4 explorable map: NPC / exit markers, NPC dialogue and overview layers. */
.rt-place{position:absolute;margin:0;padding:0;border:0;background:none;transform:translate(-50%,-100%);display:flex;flex-direction:column;align-items:center;gap:2px;cursor:pointer;color:#fff4d0;font:inherit;min-width:44px;min-height:44px}
.rt-place-icon{display:grid;place-items:center;width:30px;height:30px;border-radius:50%;border:2px solid #f3d98c;background:radial-gradient(#3f7a5c,#173a2a);font-family:KaiTi,'DFKai-SB',serif;font-size:16px;box-shadow:0 2px 6px #0009}
.rt-exit .rt-place-icon{border-radius:4px;transform:rotate(45deg);background:radial-gradient(#7b5ec4,#2b1c55)}
.rt-exit .rt-place-icon::first-letter{display:inline-block}
.rt-place-name{white-space:nowrap;font-size:11px;padding:1px 6px;border-radius:3px;background:#102a1dd9;text-shadow:0 1px 2px #000}
.rt-place:focus-visible .rt-place-icon,.rt-place:hover .rt-place-icon{filter:brightness(1.25);outline:2px solid #fff3c0;outline-offset:2px}
.rt-npc-dialog{position:absolute;left:8%;right:8%;bottom:160px;z-index:9;padding:12px 40px 10px 14px;border:1px solid #d6bd7c;border-radius:6px;background:linear-gradient(160deg,#1f3d2ef2,#10241af5);color:#f7edc9;box-shadow:0 6px 20px #000a}
.rt-npc-dialog[hidden]{display:none}
.rt-npc-name{display:block;margin-bottom:4px;font-family:KaiTi,'DFKai-SB',serif;font-size:16px;color:#ffe39a;letter-spacing:1px}
.rt-npc-lines p{margin:2px 0;font-size:13px;line-height:1.55}
.rt-npc-close{position:absolute;right:4px;top:4px;width:36px;height:36px;border:0;border-radius:50%;background:#173021;color:#f7e6b5;font-size:20px;line-height:1;cursor:pointer}
.scene-walk-area{fill:#8affd833;stroke:none}
.scene-npc-point circle{fill:#ffe08a;stroke:#3b2a07;stroke-width:12}
.scene-exit-point rect{fill:#b49cff;stroke:#24154f;stroke-width:12}
.scene-map-points text{fill:#fff6d6;stroke:#0f2318;stroke-width:14;paint-order:stroke;font-size:110px;text-anchor:middle;font-family:'Microsoft JhengHei','PingFang TC',sans-serif}
.scene-map-legend .legend-walk{background:#8affd833;border:1px solid #8affd877}
.scene-map-legend .legend-npc{width:9px;height:9px;border-radius:50%;background:#ffe08a}
.scene-map-legend .legend-exit{width:8px;height:8px;background:#b49cff;transform:rotate(45deg)}
.scene-map-legend>span[hidden]{display:none}

/* P7 quest area marker and HUD chip */
.rt-quest .rt-place-icon{border-radius:50%;transform:none;background:radial-gradient(#c9822f,#6b3510);border-color:#ffe08a;animation:rt-quest-pulse 1.6s ease-in-out infinite}
.rt-quest .rt-place-name{background:#5a2e0cd9;color:#ffe9b0}
@keyframes rt-quest-pulse{0%,100%{box-shadow:0 0 0 0 #ffd36a88}50%{box-shadow:0 0 0 8px #ffd36a00}}
@media (prefers-reduced-motion:reduce){.rt-quest .rt-place-icon{animation:none}}
.rt-quest-go{position:absolute;left:50%;top:27%;transform:translateX(-50%);z-index:7;max-width:56%;min-height:32px;padding:4px 12px;border-radius:16px;border:1px solid #f3d98c;background:#4a2a0ce6;color:#ffe9b0;font:inherit;font-size:clamp(11px,2.2cqw,13px);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;cursor:pointer}
.rt-quest-go.elsewhere{background:#1f2b26e6;border-color:#9fb8a8;color:#d9e8de;cursor:help}
.rt-quest-go:focus-visible{outline:2px solid #fff3c0;outline-offset:2px}
.scene-quest-point circle{fill:#ffb34a22;stroke:#ffcf6a;stroke-width:10;stroke-dasharray:36 24}
.scene-quest-point text{fill:#ffe9b0;font-size:100px;text-anchor:middle;paint-order:stroke;stroke:#3b2007;stroke-width:12px}
.legend-quest{width:9px;height:9px;border-radius:50%;border:1px dashed #ffcf6a;background:#ffb34a33}

/* Cosmetic models retain original NPC interaction buttons; followers never capture input. */
.rt-npc-model-loaded .rt-place-icon{opacity:0;height:76px;width:54px;border:0;box-shadow:none}
.rt-npc-model-loaded:hover .rt-place-name,.rt-npc-model-loaded:focus-visible .rt-place-name{outline:2px solid #ffe6a7}
.rt-companion-label{position:absolute;z-index:2;pointer-events:none;transform:translate(-50%,0);white-space:nowrap;color:#bff7ee;background:#10342b99;border-radius:3px;padding:0 3px;font-size:9px;text-shadow:0 1px 2px #000}
.rt-model-loaded.rt-mounted{height:113px}

/* Keep focusing a distant map marker from scrolling the camera container. */
.battlefield.scene-camera-active{overflow:clip}

/* P21.5: local minimap follows the hero; expanded view shows the entire map. */
.original-layout .scene-map-button{width:clamp(64px,19cqw,104px);height:clamp(64px,19cqw,104px);border-radius:6px;overflow:hidden;padding:0;background:#203c2b}
.scene-minimap{display:block;width:100%;height:100%;pointer-events:none}
.scene-mini-pin{fill:#7bfff0;stroke:#163e35;stroke-width:12}
.scene-mini-caption{position:absolute;bottom:0;left:0;right:0;padding:3px 0;background:#102a20d9;color:#fff0bf;font-size:10px;line-height:1.2;pointer-events:none}
.original-layout .scene-map-dialog{width:calc(var(--realm-frame-width) - 16px);max-width:calc(100vw - 16px);max-height:calc(100dvh - 24px);padding:12px;background:linear-gradient(120deg,#fff7dd88,transparent),#dbe3cf;color:#354336;border:3px double #aa955f}
.original-layout .scene-map-header h2{color:#405631;font-size:21px}
.original-layout .scene-map-header small,.original-layout .scene-map-header p,.original-layout .scene-map-note,.original-layout .scene-map-legend{color:#546546}
.original-layout .scene-map-header button{background:#749577;color:#fff2c5;border-radius:4px;width:32px;height:32px}
