/* 地图推进（map-progress.mjs，2026-10-16）。电脑版专用（body.desktop-game）；手机版不出现。
   A = 结算棋盘左上角的小地图窗（棋盘单位，整块随棋盘缩放）；B = 全屏外层地图推进。
   只有 transform / opacity 在动；滤镜、阴影都是静态的。所有贴图都按原像素或缩小显示。 */

/* ---- A: result window -------------------------------------------------------------------------------------------- */
body.desktop-game .mp-route{position:absolute;z-index:4;box-sizing:border-box;pointer-events:none;will-change:transform;animation:mp-rise .45s ease-out .6s both}
/* Own layer: the static window (map copy, lines, nodes, frame) is rastered once, not again whenever the board around it repaints. */
body.desktop-game .mp-route-head{display:flex;align-items:baseline;gap:10px;height:34px;padding:0 8px;color:#f1dfae;text-shadow:0 1px 3px #000,0 0 8px #000}
body.desktop-game .mp-route-kicker{font:600 13px/1 var(--uk-sans);letter-spacing:.2em;color:#cfae6a;white-space:nowrap}
body.desktop-game .mp-route-name{font:700 21px/1 var(--uk-serif);letter-spacing:.08em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0}
body.desktop-game .mp-route-count{margin-left:auto;font:600 15px/1 var(--uk-sans);color:#ecd8a2;white-space:nowrap}
body.desktop-game .mp-route-map{position:relative;overflow:hidden;background:#0b0f18;box-shadow:0 12px 26px #000b,0 0 0 1px #000}
body.desktop-game .mp-route-map::before{content:"";position:absolute;inset:0;z-index:1;pointer-events:none;background:radial-gradient(ellipse 80% 75% at 50% 50%,transparent 45%,#060a12a8 100%),linear-gradient(#0000 60%,#060a1255)}
body.desktop-game .mp-route-map::after{content:"";position:absolute;inset:0;z-index:9;pointer-events:none;border:16px solid transparent;border-image:url("./assets/map-progress/frame-869.webp") 80 / 16px round}
body.desktop-game .mp-route-art{position:absolute;left:0;top:0;width:100%;height:100%;display:block;max-width:none}
body.desktop-game .mp-route-lines{position:absolute;inset:0;z-index:2;width:100%;height:100%;overflow:visible}
body.desktop-game .mp-route-lines path{fill:none;stroke:#dce8ff80;stroke-width:1.6px;stroke-dasharray:3 4;vector-effect:non-scaling-stroke}
body.desktop-game .mp-route-lines path.is-done{stroke:#a6d6ffd0;stroke-width:2.4px;stroke-dasharray:none}
body.desktop-game .mp-node{position:absolute;z-index:4;width:22px;height:22px;margin:-11px 0 0 -11px;background:url("./assets/map-progress/node-96.webp") center/contain no-repeat;opacity:.5}
body.desktop-game .mp-node.is-boss{width:26px;height:30px;margin:-17px 0 0 -13px;background-image:url("./assets/map-progress/boss-h112.webp")}
body.desktop-game .mp-node.is-current,body.desktop-game .mp-node.is-cleared{opacity:1}
body.desktop-game .mp-node::after{content:"";position:absolute;left:50%;top:50%;width:8px;height:8px;margin:-4px 0 0 -4px;transform:rotate(45deg);background:#5d6672}
body.desktop-game .mp-node.is-boss::after{top:57%;border-radius:50%;transform:none}
body.desktop-game .mp-node.is-cleared::after{background:linear-gradient(135deg,#fff1b8,#d9a441);box-shadow:0 0 6px #ffd56f}
body.desktop-game .mp-node.is-current::after{background:#bfe3ff;box-shadow:0 0 6px #8cc8ff}
body.desktop-game .mp-node.is-to::after{background:#5d6672;box-shadow:none}
body.desktop-game .mp-dot{position:absolute;left:50%;top:50%;z-index:1;width:9px;height:9px;margin:-4.5px 0 0 -4.5px;transform:rotate(45deg);background:#d6efff;box-shadow:0 0 7px #8cc8ff}
body.desktop-game .mp-node.is-boss .mp-dot{top:57%;border-radius:50%}
body.desktop-game .mp-check{position:absolute;left:50%;top:50%;z-index:2;width:22px;height:22px;margin:-15px 0 0 -9px;display:block}
body.desktop-game .mp-check svg{width:100%;height:100%;overflow:visible;display:block}
body.desktop-game .mp-check polyline{fill:none;stroke:#fff5cf;stroke-width:3.4px;stroke-linecap:round;stroke-linejoin:round;paint-order:stroke}
body.desktop-game .mp-lit{position:absolute;z-index:3;width:50px;height:50px;border-radius:50%;transform:translate(-50%,-50%);opacity:.85;background:radial-gradient(circle,#fff6d0 0,#ffd86faa 28%,#f0b43c40 52%,transparent 70%)}
body.desktop-game .mp-trail{position:absolute;inset:0;z-index:3}
body.desktop-game .mp-seg{position:absolute;left:0;top:0;transform-origin:0 50%;background:url("./assets/map-progress/trail-384.webp") 0 50%/auto 100% repeat-x}
body.desktop-game .mp-comet{position:absolute;left:0;top:0;z-index:5;width:26px;height:26px;border-radius:50%;opacity:0;background:radial-gradient(circle,#fffbe8 0,#ffe08a 22%,#f0b43c77 48%,transparent 72%)}
body.desktop-game .mp-beacon{position:absolute;z-index:3;width:46px;height:46px;border-radius:50%;transform:translate(-50%,-50%);background:radial-gradient(circle,#fff3c8d0 0,#ffd27a70 34%,transparent 70%)}
body.desktop-game .mp-pulse{position:absolute;z-index:5;width:38px;height:38px;box-sizing:border-box;border-radius:50%;border:2px solid #ffe9a6;box-shadow:0 0 10px #ffd86f99;transform:translate(-50%,-50%);opacity:0}
body.desktop-game .mp-tag{position:absolute;z-index:6;padding:4px 9px 5px;border-radius:9px;transform:translate(-50%,0);white-space:nowrap;font:700 13px/1 var(--uk-sans);letter-spacing:.06em;color:#2b1a06;background:linear-gradient(#fff0b8,#ddb05a);box-shadow:0 2px 6px #000b}
body.desktop-game .mp-tag.is-up{margin-top:-42px}
body.desktop-game .mp-tag.is-down{margin-top:20px}
body.desktop-game .mp-gate{position:absolute;z-index:4;width:0;height:0}
body.desktop-game .mp-gate i{position:absolute;left:-12px;top:-12px;width:24px;height:24px;box-sizing:border-box;transform:rotate(45deg);border:2px solid #f3d58e;background:radial-gradient(circle,#fff4cc 0,#e8b95599 45%,#3a2a1066 80%);box-shadow:0 0 8px #ffd76f88}
body.desktop-game .mp-gate em{position:absolute;top:-9px;font:700 14px/1 var(--uk-serif);font-style:normal;white-space:nowrap;color:#fbe7b2;text-shadow:0 1px 2px #000,0 0 6px #000,0 0 10px #000}
body.desktop-game .mp-gate.is-left em{right:18px}
body.desktop-game .mp-gate.is-right em{left:18px}
body.desktop-game .mp-gate.is-below em{top:18px;transform:translateX(-50%)}
body.desktop-game .mp-gate.is-above em{top:-36px;transform:translateX(-50%)}
body.desktop-game .mp-gate em::after{content:" →"}
body.desktop-game .mp-route.is-run .mp-comet{will-change:transform}
@keyframes mp-rise{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:none}}

/* ---- B: outer-map advance (full screen) ---------------------------------------------------------------------------- */
body.desktop-game .mp-advance{position:fixed;inset:0;z-index:2147482000;overflow:hidden;background:#05070d;outline:none;cursor:pointer;contain:strict;-webkit-user-select:none;user-select:none}
body.desktop-game .mp-b-cam{position:absolute;left:0;top:0;transform-origin:0 0;will-change:transform}
body.desktop-game .mp-b-map,body.desktop-game .mp-b-layer{position:absolute;left:0;top:0;display:block;max-width:none;pointer-events:none}
body.desktop-game .mp-b-lines{position:absolute;inset:0;width:100%;height:100%;overflow:visible}
body.desktop-game .mp-b-lines path{fill:none;stroke:#dce8ff60;stroke-width:3px;stroke-dasharray:7 9;vector-effect:non-scaling-stroke}
body.desktop-game .mp-b-lines path.is-done{stroke:#a6d6ffd0;stroke-width:4px;stroke-dasharray:none}
body.desktop-game .mp-b-node{position:absolute;width:var(--n);height:var(--n);transform:translate(-50%,-50%);background:url("./assets/map-progress/node-96.webp") center/contain no-repeat;opacity:.75}
body.desktop-game .mp-b-node.is-boss{height:calc(var(--n) * 1.16);background-image:url("./assets/map-progress/boss-h112.webp")}
body.desktop-game .mp-b-node.is-cleared{opacity:1}
body.desktop-game .mp-b-dark{position:absolute;border-radius:50%;transform:translate(-50%,-50%);background:radial-gradient(closest-side,#04060ce0 0,#04060cd0 46%,#04060c80 72%,#04060c00 100%);will-change:opacity}
body.desktop-game .mp-b-fog{position:absolute;transform:translate(-50%,-50%);background:url("./assets/map-progress/fog-640.webp") center/100% 100% no-repeat;will-change:transform,opacity}
body.desktop-game .mp-b-glow{position:absolute;border-radius:50%;opacity:0;transform:translate(-50%,-50%);background:radial-gradient(closest-side,#fff6d6 0,#ffe08ab0 24%,#f0b43c48 52%,#f0b43c00 100%);will-change:transform,opacity}
body.desktop-game .mp-b-mark{position:absolute;box-sizing:border-box;opacity:0;transform:translate(-50%,-50%) rotate(45deg);border:3px solid #f6dc98;background:radial-gradient(circle,#fff8dc 0,#f3cf7a 30%,#7a5520 75%,#3a2810 100%);box-shadow:0 0 18px #ffd86fcc,0 0 0 2px #2a1c0899;will-change:transform,opacity}
body.desktop-game .mp-b-ring{position:absolute;box-sizing:border-box;border-radius:50%;border:3px solid #ffe8a2;box-shadow:0 0 16px #ffd86fcc,inset 0 0 10px #ffd86f88;opacity:0;transform:translate(-50%,-50%);will-change:transform,opacity}
body.desktop-game .mp-b-trail{position:absolute;inset:0}
body.desktop-game .mp-b-seg{position:absolute;left:0;top:0;transform-origin:0 50%;background:url("./assets/map-progress/trail-384.webp") 0 50%/auto 100% repeat-x;will-change:opacity}
body.desktop-game .mp-b-flash{position:absolute;border-radius:50%;opacity:0;background:radial-gradient(closest-side,#fff8e0 0,#ffd86fbb 30%,#f0b43c00 100%);will-change:transform,opacity}
body.desktop-game .mp-b-seal{position:absolute;background:url("./assets/map-progress/seal-192.webp") center/contain no-repeat;will-change:transform,opacity}
body.desktop-game .mp-b-pin{position:absolute;left:0;top:0;will-change:transform,opacity}
body.desktop-game .mp-b-pin img{position:absolute;left:0;top:0;width:100%;height:100%;display:block;max-width:none}
body.desktop-game .mp-b-pin-glow{position:absolute;left:50%;bottom:-14%;width:180%;height:44%;transform:translateX(-50%);border-radius:50%;background:radial-gradient(closest-side,#ffe08aa0,#f0b43c38 55%,#f0b43c00)}
body.desktop-game .mp-b-vignette{position:absolute;inset:0;pointer-events:none;background:radial-gradient(ellipse 78% 72% at 50% 46%,#05070d00 52%,#05070dc8 100%)}
body.desktop-game .mp-b-caption{position:absolute;left:50%;padding:18px 70px 20px;text-align:center;white-space:nowrap;color:#f7e8bf;pointer-events:none;transform:translate(-50%,0);background:radial-gradient(closest-side,#05070dd8,#05070d90 60%,#05070d00);text-shadow:0 2px 6px #000}
body.desktop-game .mp-b-caption.is-bottom{bottom:8vh}
body.desktop-game .mp-b-caption.is-top{top:7vh}
body.desktop-game .mp-b-kicker{display:block;font:600 clamp(14px,1.25vw,20px)/1.2 var(--uk-sans);letter-spacing:.32em;color:#e4c37b}
body.desktop-game .mp-b-title{display:block;margin-top:.3em;font:700 clamp(30px,3.1vw,52px)/1.12 var(--uk-serif);letter-spacing:.12em}
body.desktop-game .mp-b-hint{position:absolute;right:28px;bottom:22px;opacity:0;pointer-events:none;font:500 14px/1 var(--uk-sans);letter-spacing:.12em;color:#eadfc4;text-shadow:0 1px 3px #000}

/* While the opaque map is up, CSS loops underneath stop ticking (no per-frame style work for things nobody can see). */
html.mp-advance-open body.desktop-game > :not(.mp-advance),html.mp-advance-open body.desktop-game > :not(.mp-advance) *,html.mp-advance-open body.desktop-game > :not(.mp-advance) *::before,html.mp-advance-open body.desktop-game > :not(.mp-advance) *::after{animation-play-state:paused!important}

@media (prefers-reduced-motion:reduce){
  body.desktop-game .mp-route{animation:none}
}
