/* Game Map — 941 × 1672 reference coordinate space (map-game-v1.png). */
#app:has(#screen-world.active){background:#8ddcf5 url('assets/bg_sky.png') center/cover no-repeat}
#app:has(#screen-world.active) #topbar,
#app:has(#screen-world.active) #bottomnav{display:none}
#app:has(#screen-world.active) .pet-region{position:absolute;inset:0}
#app:has(#screen-world.active) #screens{position:absolute;left:var(--map-left);top:var(--map-top);width:941px;height:1672px;transform:scale(var(--map-scale));transform-origin:top left;padding:0;overflow:visible}
#screen-world{position:relative;width:941px;height:1672px;overflow:hidden;color:#17445e;font-family:Arial,'Sarabun',sans-serif;background:linear-gradient(#54c9f155,#d9f8ff22)}
#screen-world.active{animation:none}

.map-header{position:absolute;left:31px;top:24px;width:879px;height:79px;display:grid;grid-template-columns:86px minmax(0,1fr) 210px 165px 86px;gap:8px;align-items:center;z-index:6}
.map-header h1{position:relative;width:100%;height:74px;min-width:0;margin:0;padding:16px 28px;border:3px solid #72e7f4;border-radius:38px;background:linear-gradient(100deg,rgba(0,113,119,.94),rgba(0,99,139,.92));box-shadow:inset 0 0 13px rgba(114,255,235,.25),0 4px 8px rgba(0,62,85,.22);color:#fff;font-size:39px;line-height:37px;text-align:center;text-shadow:0 3px 2px #145279;white-space:nowrap;overflow:hidden}
.map-back,.map-menu{position:relative;width:86px;height:79px;border:3px solid #a9faff;border-radius:25px;background:linear-gradient(145deg,rgba(17,126,160,.95),rgba(17,73,111,.97));box-shadow:0 5px 9px rgba(0,51,77,.3),inset 0 0 13px rgba(101,239,255,.5);color:#fff;cursor:pointer}
.map-back{font-size:0;padding:0}
.map-back::before{content:'';position:absolute;left:29px;top:20px;width:28px;height:28px;border-left:11px solid #eefcff;border-bottom:11px solid #eefcff;border-radius:4px;transform:rotate(45deg);filter:drop-shadow(0 3px 1px #195777)}
.map-back::after{content:'';position:absolute;left:31px;top:34px;width:34px;height:11px;border-radius:7px;background:#eefcff;filter:drop-shadow(0 3px 1px #195777)}
.map-menu{display:flex;flex-direction:column;justify-content:center;align-items:center;gap:8px;padding:0}
.map-menu span{display:block;width:45px;height:7px;border-radius:6px;background:#fff;box-shadow:0 2px #376b7c}
.map-wallet,.map-energy{position:relative;width:100%;height:70px;min-width:0;padding:0 9px 0 6px;display:flex;align-items:center;justify-content:flex-start;border:3px solid #6cdbef;border-radius:36px;background:rgba(10,58,98,.9);box-shadow:inset 0 0 10px rgba(255,255,255,.17),0 4px 8px rgba(0,62,85,.22);color:#fff;font-size:25px;text-shadow:0 2px 2px #185474;overflow:hidden}
.map-wallet img{width:55px;height:55px;object-fit:contain;flex:0 0 auto;margin-right:5px}.map-energy img{width:47px;height:55px;object-fit:contain;flex:0 0 auto;margin-right:3px}
.map-wallet b,.map-energy b{min-width:0;white-space:nowrap;overflow:hidden;text-overflow:clip}

.map-tabs{position:absolute;left:52px;top:117px;width:837px;height:105px;display:flex;border:3px solid #e9ffff;border-radius:54px;background:#d6f7f5db;box-shadow:0 4px 12px #27739178;overflow:hidden;z-index:5}
.map-tab{position:relative;flex:1;border:0;background:transparent;color:#1b4c72;font:700 31px Arial,sans-serif;display:flex;align-items:center;justify-content:center;gap:24px;cursor:pointer}
.map-tab.active{flex:1.08;color:#fff;border:3px solid #75f5f3;border-radius:52px;background:linear-gradient(135deg,#28e6e8,#11aeda);box-shadow:inset 0 0 0 4px #ffffff45,0 3px 9px #147b9d80;text-shadow:0 3px 2px #08729a}
.map-tab img{width:91px;height:76px;object-fit:contain;filter:drop-shadow(0 3px 2px #17435c77)}
.map-tab svg{width:68px;height:68px;fill:none;stroke:#245b82;stroke-width:6;stroke-linecap:round}

.map-status{position:absolute;left:56px;top:239px;width:829px;height:76px;padding:0 34px;display:flex;align-items:center;justify-content:space-between;border:3px solid #eaffff;border-radius:40px;background:linear-gradient(110deg,#f3ffffdf,#d2f4f0e8);box-shadow:0 4px 13px #247b996e;color:#23486b;font-size:27px;font-weight:700;z-index:5}
.map-status span{white-space:nowrap}.map-status i{display:block;width:2px;height:38px;background:#4c91b0aa}
.map-status b,.map-status em{font-style:normal}.map-status .map-hp{display:flex;align-items:center;gap:10px;color:#ef3973;font-size:42px}.map-status .map-hp b{color:#24496b;font-size:27px}.map-status .s-str{color:#ef493d}.map-status .s-spd{color:#148ae7}.map-status .s-def{color:#15933c}

#screen-world #map-wrap{position:absolute;inset:0;width:941px;height:1672px;border-radius:0;overflow:hidden;box-shadow:none;background:#27b7e4}
.game-map-canvas{position:absolute;inset:0;width:941px;height:1672px}
#screen-world #map-img{position:absolute;inset:0;width:941px;height:1672px;object-fit:cover}
#screen-world #map-nodes{position:absolute;left:0;top:304px;width:941px;height:1130px}
.map-compass{position:absolute;right:26px;bottom:270px;width:112px;height:112px;z-index:1;color:#0d4f8c;font:800 23px Arial,sans-serif;text-shadow:0 1px #bff5ff}
.map-compass svg{position:absolute;inset:14px;width:84px;height:84px;overflow:visible;fill:#78d7ec99;stroke:#0d4f8c;stroke-width:4;stroke-linejoin:round;filter:drop-shadow(0 2px 2px #40a7c7)}
.map-compass svg .needle{fill:#0d4f8c;stroke:#d8fbff;stroke-width:2}.map-compass b{position:absolute;line-height:1}.map-compass .north{left:47px;top:-3px}.map-compass .south{left:48px;bottom:-2px}.map-compass .west{left:-1px;top:46px}.map-compass .east{right:-1px;top:46px}
#screen-world .node{width:70px;height:70px;margin:-35px 0 0 -35px;border-width:8px;font-size:34px;box-shadow:0 0 0 5px #fff9,0 5px 10px #1d536a88;z-index:2}
#screen-world .node.stage-1,#screen-world .node.stage-3,#screen-world .node.stage-6,#screen-world .node.stage-9{border-color:#f8a400}
#screen-world .node.stage-2,#screen-world .node.stage-5,#screen-world .node.stage-7,#screen-world .node.stage-10{border-color:#7047e7}
#screen-world .node.stage-4{border-color:#159de4}
#screen-world .node.stage-8{border-color:#10bbb6}
#screen-world .node.current{width:83px;height:83px;margin:-42px 0 0 -42px;border-color:#ffc322;box-shadow:0 0 0 7px #fff,0 0 26px 11px #ffe75bc7,0 5px 12px #174b6688}
#screen-world .node.locked{filter:grayscale(.65);opacity:.72}
#screen-world .node-egg{width:93px;margin:-112px 0 0 -47px;filter:drop-shadow(0 7px 5px #17475f88)}

#screen-world #world-actions{position:absolute;left:31px;top:1408px;width:879px;height:217px;padding:17px;display:grid;grid-template-columns:repeat(3,1fr);gap:10px;border:3px solid #eaffff;border-radius:58px;background:linear-gradient(115deg,#b5f7e0d9,#b7dff2df);box-shadow:inset 0 0 0 5px #ffffff32,0 0 22px #bffaffb3;z-index:6}
#screen-world .world-action-btn{position:relative;height:177px;min-width:0;margin:0;padding:0;border:3px solid #ffffe8;border-radius:43px;overflow:hidden;color:#173d4b;cursor:pointer;font:700 31px Arial,sans-serif;box-shadow:inset 0 0 0 5px #ffffff42,0 3px 9px #31737c54}
#screen-world .world-action-btn:nth-child(1){background:linear-gradient(130deg,#d9ffd4,#95e89b)}
#screen-world .world-action-btn:nth-child(2){background:linear-gradient(130deg,#fff4c7,#f7d67a)}
#screen-world .world-action-btn:nth-child(3){background:linear-gradient(130deg,#f1ddff,#c998e8)}
.world-action-art{position:absolute;left:0;right:0;top:8px;height:112px;display:flex;align-items:center;justify-content:center;filter:drop-shadow(0 4px 2px #234e4d4f)}
.world-action-art img{width:112px;height:112px;object-fit:contain}
#screen-world .world-action-btn b{position:absolute;left:0;right:0;bottom:12px;white-space:nowrap;font:inherit}
#screen-world .world-action-btn:active,.map-tab:active,.map-back:active,.map-menu:active{filter:brightness(.92);transform:translateY(1px)}

/* Stage entry modal */
#modal-layer:has(.map-stage-dialog){padding:18px;background:#082f47ad;backdrop-filter:brightness(.65)}
.dialog.map-stage-dialog{position:relative;flex:0 0 auto;width:700px;max-width:none;max-height:none;padding:31px 28px 24px;border:5px solid #8affff;border-radius:45px;background:linear-gradient(180deg,#18cbe5 0 18%,#c7fbfa 36%,#a9ecec 100%);box-shadow:inset 0 0 0 5px #ffffff3d,0 0 18px #69f8ff,0 22px 55px #001d30a8;color:#194a70;overflow:visible;transform:scale(var(--map-scale));animation:map-stage-pop .18s ease}
.map-stage-dialog .dlg-title{color:#fff;font:800 46px Arial,sans-serif;text-shadow:0 4px 2px #155d94;margin:3px 0 25px}
.map-stage-dialog .dlg-title::before{content:'⚔️';margin-right:20px}
.map-stage-close{position:absolute;right:-14px;top:-18px;width:72px;height:72px;border:4px solid #a8ffff;border-radius:50%;background:linear-gradient(#25c8dc,#168cae);color:#fff;font:700 48px/58px Arial;box-shadow:0 4px 11px #07577488;cursor:pointer}
.map-stage-scene{height:190px;margin:0 0 20px;border:4px solid #e9ffff;border-radius:35px;background:url('assets/home/habitat.png') center 62%/cover no-repeat;box-shadow:inset 0 0 22px #0d779657,0 4px 10px #11748f56}
.map-stage-costs{height:115px;padding:12px 18px;display:grid;grid-template-columns:repeat(3,1fr);align-items:center;border:3px solid #fff;border-radius:31px;background:#ecffffd9;box-shadow:0 4px 10px #197a9661;text-align:center}
.map-stage-costs>div+div{border-left:2px solid #5ba4bd}.map-stage-costs span{display:block;font-size:22px;font-weight:700}.map-stage-costs b{display:block;margin-top:7px;font-size:30px}.map-stage-costs .cost-danger{color:#e52626}
.map-stage-dialog .map-stage-primary{height:105px;margin-top:20px;border:4px solid #fff2a4;border-radius:52px;background:linear-gradient(#ffe168,#ffad13);box-shadow:inset 0 0 0 5px #ffffff4d,0 6px 12px #c778176b;color:#53330b;font:800 34px Arial,sans-serif;text-shadow:0 1px #fff4a6}
.map-stage-dialog .map-stage-primary small{display:inline-block;margin-left:15px;padding:10px 17px;border-radius:28px;background:#c77a12;color:#fff;font-size:24px;text-shadow:none}
.map-stage-dialog .btn-ghost{height:80px;margin-top:14px;border:3px solid #fff;border-radius:40px;background:#e7ffffc9;color:#285478;font:700 30px Arial,sans-serif;box-shadow:0 4px 9px #32839a55}
.map-stage-dialog .map-stage-extra{height:80px;min-height:80px;font-size:30px}
@keyframes map-stage-pop{from{transform:scale(calc(var(--map-scale) * .9));opacity:0}to{transform:scale(var(--map-scale));opacity:1}}
@media(prefers-reduced-motion:reduce){#screen-world *,#modal-layer .map-stage-dialog{animation:none!important;transition:none!important}}

/* EVD + Items row under the status bar — Real World's .ow-tool-row (real-world.css), placed the same
   distance below .map-status (239 + 86). The button reuses #ow-heal-btn's look. */
/* Compact pill on the right: a full-width row covered the final boss node (NODES[10] = 50%, 6%). */
#world-tool-row{top:325px;left:auto;right:52px;width:auto;min-width:300px;height:64px;padding-left:22px;gap:12px;z-index:5} /* width grows with the text: EVD is gear + SpO2 since 10-18, often 2 digits */
/* EVD over CRIT (user 11-16): side by side the pill grew past x≈530 and covered node 11 (centre x 470). Stacked it stays
   about as wide as the old EVD-only pill. */
#world-tool-row{display:grid;grid-template-columns:auto auto;grid-template-rows:1fr 1fr;column-gap:14px;row-gap:2px;align-items:center}
#world-tool-row .ow-evd,#world-tool-row .ow-crit{grid-column:1;font-size:21px;line-height:1;gap:8px;margin:0;white-space:nowrap}
#world-tool-row .ow-crit{grid-row:2}
#world-tool-row .ow-evd::before,#world-tool-row .ow-crit::before{width:25px;height:25px}
#world-tool-row #world-heal-btn{grid-column:2;grid-row:1 / span 2}
#world-heal-btn{align-self:stretch;min-width:150px;padding:0 20px;border:3px solid #7effff;border-radius:38px;background:linear-gradient(135deg,#28e6e8,#0aa9d9);box-shadow:inset 0 0 0 4px #ffffff40,0 3px 9px #147b9d80;color:#fff;font:800 25px Arial,sans-serif;text-shadow:0 3px 2px #08729a;display:flex;align-items:center;justify-content:center;gap:10px;cursor:pointer}
#world-heal-btn img{width:40px;height:46px;object-fit:contain}
#world-heal-btn:disabled{filter:grayscale(.65);opacity:.72}
