/* Mobile game shell: the map fills the complete visual viewport. */
html,body{width:100%;height:100%;margin:0;overscroll-behavior:none}body{overflow:hidden}main{position:fixed;inset:0;margin:0!important;max-width:none;padding:0!important}main>header{position:absolute;top:0;left:0;right:0;height:110px;padding:calc(14px + env(safe-area-inset-top)) 18px 12px;display:flex;gap:12px;align-items:center;background:linear-gradient(#314d2d,#23432d);z-index:2;margin:0;border-bottom:1px solid #638047}header h1{font-size:29px;line-height:1.1;margin-top:5px}header .eyebrow{font-size:7px;letter-spacing:1.5px}header .header-right{margin-left:auto}.saved{display:none!important}.xp{font-size:10px;padding:8px}.mobile-help{display:block!important;width:29px;height:29px;font-size:15px;margin:0!important;flex-shrink:0}body[data-page="map"] main>header{display:none!important}.page{position:absolute;inset:110px 0 0;overflow-y:auto;padding:0 14px calc(120px + env(safe-area-inset-bottom));scrollbar-width:thin;scrollbar-color:#bca35d transparent}.page#mapPage{inset:0;padding:0;overflow:hidden}.map-shell{position:absolute;inset:0;border:0;border-radius:0;box-shadow:none}.map{position:absolute;inset:0;height:100%!important;min-height:0!important;width:100%;border:0;border-radius:0;touch-action:none}.gps-gate{padding:calc(30px + env(safe-area-inset-top)) 28px calc(130px + env(safe-area-inset-bottom));background:radial-gradient(ellipse at 50% 30%,#f2e8c1,#b4c58d 80%,#8fa56d);backdrop-filter:blur(3px)}.gps-gate .welcome-ark{height:clamp(110px,23dvh,220px);width:230px;max-width:60vw;object-fit:contain;filter:drop-shadow(0 12px 10px #5c613c44);margin:0 0 20px}.gps-gate h2{max-width:300px;font-size:31px;line-height:1.05}.gps-gate .eyebrow{font-size:8px;letter-spacing:2px}.gps-gate p{max-width:310px;font-size:13px;line-height:1.6}.gps-gate .primary{max-width:300px;font-size:20px;padding:17px;margin:22px 0 18px}.gps-gate small{font-size:10px;line-height:1.6;max-width:290px}.gps-gate:before,.gps-gate:after{opacity:.45}.gps-hud{top:calc(14px + env(safe-area-inset-top));left:12px;max-width:calc(100% - 80px);padding:9px 13px;background:#fff3d8e8}.gps-hud span{font-size:9px}.gps-hud b{font-size:12px}.map-help{position:absolute;right:14px;top:calc(14px + env(safe-area-inset-top));z-index:650;width:37px;height:37px;border:2px solid #c49a53;border-radius:50%;background:linear-gradient(#ffedbd,#d6ad69);color:#724b23;font-size:20px;font-weight:900;box-shadow:0 3px 0 #84592155}.leaflet-top.leaflet-right{top:calc(63px + env(safe-area-inset-top))}.leaflet-bottom.leaflet-right{bottom:calc(112px + env(safe-area-inset-bottom))}.leaflet-control-attribution{font-size:9px!important;line-height:16px!important}.leaflet-control-attribution a{font-size:9px!important}.recenter{bottom:calc(148px + env(safe-area-inset-bottom));right:14px;width:45px;height:45px}.tile-error{bottom:calc(145px + env(safe-area-inset-bottom));max-width:calc(100% - 85px);left:12px}.mobile-nav{position:fixed;inset:auto 0 0;display:flex!important;justify-content:space-around;align-items:flex-end;height:calc(108px + env(safe-area-inset-bottom));padding:7px 10px calc(8px + env(safe-area-inset-bottom));background:linear-gradient(#805228f2,#4c2c18fa);border-top:3px solid #cd9a4d;box-shadow:0 -3px 0 #ffdda45e,0 -10px 25px #1e342626;z-index:900;backdrop-filter:blur(6px)}.mobile-nav button{position:relative;min-width:80px;width:30%;max-width:140px;background:none;color:#e0c89c;border-radius:14px;padding:0 4px 4px;display:flex;align-items:center;flex-direction:column;justify-content:flex-end;height:88px}.mobile-nav button img{width:64px;height:64px;object-fit:contain;filter:drop-shadow(0 4px 3px #27170dcc);opacity:.8;transition:transform .2s,opacity .2s}.mobile-nav button small{display:block;margin-top:0;font:800 12px 'Nunito',sans-serif;line-height:19px;text-shadow:0 2px 1px #362011}.mobile-nav button.active{background:radial-gradient(ellipse at 50% 38%,#f6cd6355,transparent 70%);color:#fff0bb}.mobile-nav button.active img{opacity:1;transform:translateY(-4px) scale(1.09)}.mobile-nav button.active:after{content:'';position:absolute;bottom:-2px;width:23px;height:3px;border-radius:3px;background:#f8d275}.ark-position{background:transparent;border:0;pointer-events:none!important}.ark-position img{width:78px;height:78px;object-fit:contain;filter:drop-shadow(0 5px 3px #39291988)}.collection-grid{grid-template-columns:1fr;gap:17px;max-width:600px;margin:auto}.section-intro{padding:20px 3px;gap:10px;max-width:600px;margin:auto}.section-intro h2{font-size:24px;margin:0 0 5px}.section-intro p{font-size:12px;margin:0;line-height:1.6}.section-intro .total{font-size:21px;white-space:nowrap;padding:10px 13px}.species{padding:20px}.species h2{font-size:27px}.species .latin{font-size:11px}.pair{margin-top:20px}.specimen{padding:14px 8px}.specimen img{height:125px}.species-bottom{gap:12px;font-size:9px}.species-bottom span:last-child{white-space:nowrap}#journalList{max-width:600px;margin:auto}.journal-row{padding:12px;gap:12px}.journal-row strong{font-size:13px}.journal-row img{width:55px;height:55px}.toast{left:50%!important;bottom:calc(127px + env(safe-area-inset-bottom));font-size:12px;max-width:90vw;width:max-content;text-align:center}.modal{padding:14px;z-index:2000}.modalbox{width:430px;max-height:calc(100dvh - 40px - env(safe-area-inset-top) - env(safe-area-inset-bottom));padding:29px 20px 24px}.modal h2{font-size:27px;line-height:1.1}.modal .eyebrow{font-size:8px}.modal p{font-size:12px}.encounter{height:235px;margin:17px -20px}.encounter img{height:210px;max-width:90%}.info-image{height:170px}.modal .primary{font-size:18px}.catch-orb{width:48px;height:48px}.capture-help{font-size:11px}.empty{padding:45px 20px}.empty h3{font-size:24px}.empty p{font-size:13px}.mystery-pin{touch-action:manipulation}
@media(max-height:680px){.gps-gate .welcome-ark{height:95px;margin-bottom:10px}.gps-gate h2{font-size:26px}.gps-gate p{font-size:12px;margin-top:9px}.gps-gate .primary{margin:14px 0;padding:13px}.gps-gate{padding-top:15px}.encounter{height:175px}.encounter img{height:160px}.modalbox{padding-top:25px}.modal h2{font-size:24px}.catch-orb{display:none}.modal p{margin:8px 0}}
@media(min-width:761px){.page:not(#mapPage){padding-inline:max(20px,calc((100vw - 600px)/2))}.mobile-nav{justify-content:center;gap:35px}.gps-gate h2{max-width:400px}.gps-gate .welcome-ark{max-height:220px}.map-help{right:20px}}
.mobile-help{border-radius:50%;background:linear-gradient(#ffedbd,#d6ad69);border:1px solid #c49a53;color:#724b23!important;font-weight:900}

.gps-gate .noe-title{font-size:55px;letter-spacing:6px;line-height:1;margin:0 0 9px;text-shadow:0 3px 0 #ffefc5}.gps-gate .noe-tagline{font-style:italic;font-size:16px;font-weight:700;color:#5c613c;max-width:310px;line-height:1.55;margin:0 0 7px}.modal .noe-tagline{font-style:italic}.gps-gate .welcome-ark{margin-bottom:12px}@media(max-height:680px){.gps-gate .noe-title{font-size:40px}.gps-gate .noe-tagline{font-size:13px;max-width:280px}.gps-gate .welcome-ark{height:80px}}
/* Keep dialog sizing relative to the viewport, not a grid's intrinsic track. */
.modal{display:flex;align-items:center;justify-content:center;box-sizing:border-box;width:100%;height:100%;height:100dvh;min-width:0;overflow-x:hidden;overflow-y:auto;padding:12px;padding-top:max(12px,env(safe-area-inset-top));padding-right:max(12px,env(safe-area-inset-right));padding-bottom:max(12px,env(safe-area-inset-bottom));padding-left:max(12px,env(safe-area-inset-left))}
.modalbox{box-sizing:border-box;flex:0 1 430px;width:100%;min-width:0;max-width:430px;max-height:calc(100vh - 32px);max-height:calc(100dvh - max(12px,env(safe-area-inset-top)) - max(12px,env(safe-area-inset-bottom)) - 8px);margin:auto;overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain;overflow-wrap:anywhere;-webkit-overflow-scrolling:touch;padding:48px clamp(14px,4vw,24px) 24px}
.modalbox>*{min-width:0;max-width:100%}.modalbox h2{font-size:clamp(22px,6.5vw,28px);padding-inline:4px}.modalbox .close{position:absolute;right:10px;top:10px;width:34px;height:34px;min-height:34px;line-height:26px;padding:0;z-index:5}.modalbox img{max-width:100%;object-fit:contain}.modalbox .info-image{width:min(200px,100%);height:clamp(110px,24dvh,170px)}.modalbox .primary,.modalbox .secondary{width:100%;min-width:0;white-space:normal;line-height:1.3;min-height:44px}.modalbox .reward{max-width:100%;white-space:normal;padding:9px 12px;font-size:12px}.modalbox .encounter{margin:16px 0;width:100%;max-width:100%;border-radius:12px}.modalbox .pair{width:100%;gap:8px}.modalbox .specimen{min-width:0;padding:12px 6px}.modalbox .facts{grid-template-columns:repeat(3,minmax(0,1fr))}.modalbox .facts div{min-width:0}.modalbox .instructions p{min-width:0}
@media(max-width:360px){.modalbox{padding-inline:14px;border-width:4px}.modalbox p{font-size:11px}.modalbox .primary{font-size:17px}.modalbox .sex-label{font-size:11px;gap:4px}.modalbox .specimen img{height:90px}.modalbox .sex-label b{width:27px;height:27px;font-size:19px;line-height:23px}}
@media(max-height:600px){.modalbox{padding-top:44px;padding-bottom:18px}.modalbox .info-image{height:100px}.modalbox .encounter{height:150px}.modalbox .encounter img{height:140px}.modalbox .primary{margin-top:12px}.modalbox h2{margin-top:5px;margin-bottom:5px}.modalbox .success-symbol{font-size:21px}}

.legacy-birds-note{padding:20px 4px 0;color:#f6e8bb}.legacy-birds-note h2{font-size:22px}.legacy-birds-note p{font-size:13px;line-height:1.6}

#gpsGate {
 --lagoon:url('assets/arca-embarque.webp');
 justify-content:flex-end;isolation:isolate;overflow:hidden;
 padding:12px 16px calc(106px + env(safe-area-inset-bottom));
 background:#20594b var(--lagoon) center / cover no-repeat;backdrop-filter:none;
}
@media(min-aspect-ratio:4/5){
 #gpsGate,#gpsGate .lagoon-water{background-size:auto 100%}
 #gpsGate{background-color:#173c31}
}
#gpsGate::before,#gpsGate::after {content:none}
.lagoon-water {
 position:absolute;inset:0;pointer-events:none;z-index:-1;
 background:var(--lagoon) center / cover no-repeat;
 mask-image:linear-gradient(transparent 71%,#000 79%);
 transform-origin:50% 75%;animation:lagoon-current 4.8s ease-in-out infinite alternate;
}
@keyframes lagoon-current {from{transform:scale(1.012,1.005) translateX(-.25%)}to{transform:scale(1.025,1.045) translateX(.45%)}}
#gpsGate #gpsMessage:empty{display:none}
#gpsGate #gpsMessage:not(:empty),#gpsGate small{background:#163830dd;color:#fff5d7;border-radius:10px;padding:5px 10px;max-width:310px}
#gpsGate #enableGPS {margin:8px 0;max-width:285px}
#mapRedeem {position:absolute;z-index:650;top:14px;left:14px;width:60px;height:65px;display:grid;place-items:center;padding:2px 5px 16px;border:2px solid #c79b50;border-radius:15px;background:linear-gradient(#684825,#35210f);box-shadow:0 3px 6px #19251388}
#mapRedeem>img {width:100%;height:100%;object-fit:contain}
#mapRedeem>span {position:absolute;bottom:2px;display:flex;align-items:center;gap:3px;color:#fff5cc;font-weight:850}
#mapRedeem .drawn-icon {width:15px;height:15px}
#mapRedeem.redemption-ready {border-color:#c0ff95;box-shadow:0 0 12px 4px #8ffe70;animation:redeem-shimmer 1.5s ease-in-out infinite alternate}
@keyframes redeem-shimmer {to{box-shadow:0 0 23px 5px #99ff73,inset 0 0 12px #9bff63}}
#gpsHud {left:84px;max-width:calc(100% - 145px)}
@media(max-height:530px){#gpsGate{padding-bottom:78px}#gpsGate small{font-size:9px;line-height:1.2}#gpsGate #enableGPS{padding:8px;margin:3px}}
@media(prefers-reduced-motion:reduce){.lagoon-water,#mapRedeem.redemption-ready{animation:none}}

#leafSimulation {
 position:fixed;right:12px;bottom:calc(112px + env(safe-area-inset-bottom));
 z-index:1000;padding:8px 12px;border:1px solid #c79b50;border-radius:8px;
 background:#213d31;color:#fff3d8;font-weight:700;font-size:12px;
}
#leafSimulation.hidden {display:none}

/* Scroll the interface without page magnification. Leaflet manages its own gestures. */
body { touch-action:pan-x pan-y; }
