.ms-sheet{background:linear-gradient(145deg,#22443b,#132d28);color:#eddfb8;border:1px solid #8d825c;border-radius:22px 22px 10px 10px;box-shadow:0 -8px 24px #051a1944;position:relative}.ms-grip{width:100%;display:flex;align-items:center;justify-content:center;gap:10px;position:relative;min-height:44px;padding:20px 12px 8px;background:none!important;border:0!important;border-bottom:1px solid #c1a66e22!important;border-radius:22px 22px 0 0;color:#decea6!important;font:12px Arial!important;touch-action:none;cursor:pointer}.ms-grip>i{position:absolute;top:8px;width:36px;height:3px;border-radius:5px;background:#c1b18a77}.ms-grip>b{position:absolute;right:16px;font-size:17px}.ms-sheet-body{max-height:180px;overflow:auto;overscroll-behavior:contain;scrollbar-color:#b69e65 #132e27;padding:8px 12px;transition:max-height .25s ease}.ms-sheet.expanded>.ms-sheet-body{max-height:65dvh}.ms-quick{display:flex;gap:8px;padding:8px 12px}.ms-quick button{display:flex;gap:6px;align-items:center;justify-content:center;flex:1;background:#b59b5c22!important;border:1px solid #b7a26777!important;color:#f7e7bc!important;border-radius:8px;min-height:48px;font:12px Arial}.ms-quick button:first-child{flex:1.4;background:linear-gradient(#a38546,#775d2b)!important}.ms-quick button.active{box-shadow:0 0 0 2px #b9db8a,inset 0 0 16px #f1d77a55!important}.ms-quick img{width:25px;height:25px;object-fit:contain}.ms-grip:focus-visible{outline:3px solid #dcc184;outline-offset:-3px}
@media(max-width:640px), (max-width:960px) and (max-height:500px) and (pointer:coarse){
html.ms-phone body:not(.landing-active){background:#102821!important;padding-bottom:78px!important}html.ms-phone #game-screen{display:flex!important;flex-direction:column!important;padding:0 6px!important;gap:10px!important;width:100%!important;max-width:100%!important;box-sizing:border-box}html.ms-phone #game-screen.hidden{display:none!important}html.ms-phone #center-column{width:100%!important;min-width:0!important;order:0}html.ms-phone #scene-box{width:100%!important;height:355px!important;min-height:355px!important;margin:0!important;border-radius:16px 16px 0 0!important;border-color:#aa945c!important;box-sizing:border-box}html.ms-phone #scene-art{background-size:cover!important}html.ms-phone #scene-loc-name{max-width:72%;top:12px!important}html.ms-phone #scene-npcs{bottom:10px!important}html.ms-phone #scene-weather{max-width:110px;right:6px!important;font-size:10px!important}html.ms-phone #ms-location-sheet{margin-top:-14px;z-index:20}html.ms-phone #left-panel{width:100%!important;max-width:100%!important;display:flex!important;gap:10px!important}html.ms-phone #left-panel>.panel{padding:8px!important;background:transparent!important;border:0!important;box-shadow:none!important}html.ms-phone #weather-box{display:none!important}html.ms-phone #side-exits{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px!important}html.ms-phone .tj-route{margin:0!important;width:auto!important;min-width:0!important;transform:none!important}html.ms-phone #left-panel button{min-height:44px}html.ms-phone #trainer-palette{order:3;width:100%!important;max-width:100%!important;box-sizing:border-box;border-radius:14px!important;overflow:hidden}html.ms-phone #trainer-palette .tp-list{max-height:280px;overflow:auto}html.ms-phone #main-content-area{min-height:0!important}html.ms-phone #center-column>details{margin:16px 10px!important}html.ms-phone #mobile-hunt-fab,html.ms-phone #mobile-panel-left-btn,html.ms-phone #mobile-panel-right-btn{display:none!important}html.ms-phone #mobile-chat-fab{bottom:86px;right:12px;width:42px;height:42px;font-size:18px;background:#224b40;border-color:#b8a36f}html.ms-phone #mobile-bottom-nav{display:flex!important;background:#102c27f5;border-top:1px solid #a48b55;min-height:64px;padding:4px 4px max(7px,env(safe-area-inset-bottom));box-sizing:border-box;backdrop-filter:blur(10px)}html.ms-phone #mobile-bottom-nav .mb-btn{width:20%;min-height:54px;height:auto;font:10px Arial;color:#c9cbb3}html.ms-phone #mobile-bottom-nav .mb-btn.active{color:#f7d88e;background:#ab935422}html.ms-phone #mobile-bottom-nav img{width:25px;height:25px}html.ms-phone #mobile-more-sheet{max-height:82dvh;overflow:auto;background:linear-gradient(145deg,#2c4a3fef,#102a24f7);backdrop-filter:blur(14px);border-color:#bba16a;padding:20px 16px max(20px,env(safe-area-inset-bottom));box-shadow:0 -20px 70px #0008}html.ms-phone #mobile-more-sheet .mm-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:9px}html.ms-phone #mobile-more-sheet .mm-btn{background:#75927a15;min-height:85px;border-color:#bcad7944;color:#eee0b8;font-size:12px}html.ms-phone #mobile-more-sheet .ms-menu-tools{border-top:1px solid #b49b5c55;margin-top:15px;padding-top:14px}html.ms-phone #mobile-more-sheet h4{font-size:20px!important;margin:8px 0 20px!important}html.ms-phone .sheet-close{min-width:44px;min-height:44px}html.ms-phone .modal{padding:0!important;align-items:flex-end!important}html.ms-phone .modal>.modal-content{max-width:100vw!important;max-height:94dvh!important;box-sizing:border-box;border-radius:22px 22px 0 0!important}html.ms-phone .modal .close-btn{min-width:40px;min-height:40px;text-align:center;line-height:40px;top:4px;right:4px;z-index:5}
html.ms-phone.battle-open #scene-box{height:auto!important;min-height:0!important;overflow:visible!important}html.ms-phone.battle-open #scene-art,html.ms-phone.battle-open #scene-npcs,html.ms-phone.battle-open #scene-loc-name,html.ms-phone.battle-open #scene-weather,html.ms-phone.battle-open #daynight-badge,html.ms-phone.battle-open #ms-location-sheet{display:none!important}html.ms-phone #scene-battle{position:relative!important;inset:auto!important;padding:0!important;overflow:visible!important;background:#17332d!important;height:auto!important}html.ms-phone #scene-battle .liga-battle{padding:8px 5px!important;overflow:visible!important;border-radius:14px;background-color:#243f35!important}html.ms-phone #scene-battle .lb-grid{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:5px!important;width:100%!important}html.ms-phone #scene-battle .lb-grid>.bt-log{grid-column:1/-1}html.ms-phone #scene-battle .lb-side{min-width:0!important;padding:8px 3px!important;border:0!important;background:#14332988!important;border-radius:12px!important}html.ms-phone #scene-battle .lb-name,html.ms-phone #scene-battle .lb-hpnum{color:#fff2d2!important;font-size:12px!important}html.ms-phone #scene-battle .lb-foe{font-size:9px!important;color:#c5ceb5!important}html.ms-phone #scene-battle .pokemon-stage{width:135px;height:135px;max-width:100%}html.ms-phone #scene-battle .lb-img.pokemon-battle-art{width:126px!important;height:126px!important}html.ms-phone #scene-battle .lb-head{padding:8px;font-size:11px!important}html.ms-phone .ms-combat-sheet{margin-top:10px}html.ms-phone .ms-combat-sheet>.ms-sheet-body{max-height:94px;padding:8px}html.ms-phone .ms-combat-sheet.expanded>.ms-sheet-body{max-height:70dvh}html.ms-phone .ms-combat-sheet .lb-actionbar{display:flex!important;flex-direction:column!important;background:none!important;border:0!important;padding:0!important;gap:8px!important}html.ms-phone .ms-combat-sheet .lb-ab-moves{width:100%!important;min-width:0!important}html.ms-phone .bt-move-list{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;width:100%!important}html.ms-phone .lb-move.bt-move{min-height:112px!important;padding:8px!important}html.ms-phone .bt-move-name{font-size:13px!important}html.ms-phone .lb-ab-actions{display:flex!important;justify-content:space-evenly;width:100%!important}html.ms-phone .lb-ab-btn{width:52px!important;height:48px!important}html.ms-phone .lb-ab-pop{position:static!important;padding:8px!important;flex-wrap:wrap;max-width:100%!important}html.ms-phone .lb-ab-pop button{min-width:44px;min-height:44px}html.ms-phone .ms-combat-sheet .bt-log{margin-top:12px!important}html.ms-phone .bt-log-events{max-height:180px;min-height:100px}html.ms-phone .lb-sw summary{min-height:44px}html.ms-phone .lb-headbar{min-width:50px!important}
html.ms-phone #team-modal.jp-team>.modal-content{padding:20px 8px 10px!important;background:linear-gradient(#1f4036,#102e29)!important;color:#f1dfb2!important;width:100%!important;height:94dvh}html.ms-phone #team-modal.jp-team>.modal-content>h3{color:#f1dfb2!important;padding:0 12px}html.ms-phone #team-modal.jp-team #team-list-container{display:flex!important;flex-direction:row!important;overflow:auto!important;height:auto!important;padding:4px 0 12px!important;gap:6px!important;background:none!important;border:0!important}html.ms-phone #team-list-container .jp-team-slot,html.ms-phone #team-list-container .jp-team-empty{flex:0 0 64px;width:64px;min-width:64px;padding:5px!important;display:flex;flex-direction:column;height:85px;overflow:hidden;border-radius:9px!important;background:#e6d8b2!important}html.ms-phone #team-list-container .jp-team-slot>img{width:46px;height:45px!important}html.ms-phone #team-list-container .jp-team-slot b{font-size:8px;white-space:nowrap}html.ms-phone #team-list-container .jp-team-slot small{font-size:8px}html.ms-phone #team-list-container .jp-team-slot .jp-hp,html.ms-phone #team-list-container .jp-team-slot small:last-child{display:none}html.ms-phone #team-list-container .jp-team-empty>span{font-size:8px}html.ms-phone #team-mon-details{padding:0!important;background:none!important}html.ms-phone #team-modal.jp-team .mc-hero{display:flex;flex-direction:column!important;border:0!important;border-radius:15px!important;background:radial-gradient(at 50% 25%,#57836b77,transparent),#15382f!important;color:#f0deb7!important;padding:12px 10px!important;text-align:center;gap:6px}html.ms-phone #team-modal.jp-team .mc-hero .mc-ava{width:170px!important;height:165px!important;background:none!important;border:0!important;box-shadow:none!important}html.ms-phone #team-modal.jp-team .mc-hero h3{color:#f6e8c3!important;font-size:23px!important}html.ms-phone #team-modal.jp-team .mc-pill{background:#eee0c0!important;color:#674c2e!important;font-size:10px}html.ms-phone .ms-team-sheet{margin-top:12px;background:#e9d9b2;color:#5a4026;border-color:#b49a65}html.ms-phone .ms-team-sheet .ms-grip{color:#71522f!important}html.ms-phone .ms-team-sheet .ms-sheet-body{max-height:85px}html.ms-phone .ms-team-sheet.expanded .ms-sheet-body{max-height:none}html.ms-phone #team-modal.jp-team .mc-cols{display:block!important;background:none!important;padding:4px!important}html.ms-phone #team-modal.jp-team .team-actions-row{display:flex!important;flex-direction:column;padding:10px 0;gap:8px}html.ms-phone .team-actions-row button{min-height:46px}
}
@media(max-width:640px), (max-width:960px) and (max-height:500px) and (pointer:coarse){html.ms-phone #mobile-bottom-nav{transform:none!important}html.ms-phone #team-modal.jp-team .diary-book-pages{height:auto!important;max-height:none!important;overflow:visible!important}html.ms-phone #team-modal.jp-team #team-mon-details{height:auto!important;max-height:none!important;overflow:visible!important}html.ms-phone #team-modal.jp-team #team-mon-details .mc-hero :is(h3,h3 span,h3 b){color:#f6e8c3!important}html.ms-phone #scene-battle .liga-battle{overflow-x:clip!important}html.ms-phone #ms-location-sheet h3,html.ms-phone #ms-location-sheet .tj-routes h3{color:#eedcb3!important}.ms-dossier-tabs{display:flex;gap:7px;margin:5px 0 12px}.ms-dossier-tabs button{flex:1;min-height:44px;background:#b79a5e33;color:#684b28;border:1px solid #ac8c5155;border-radius:6px;font:12px Arial;cursor:pointer}.ms-dossier-tabs button[aria-pressed=true]{background:#8b7042;color:#fff0ce}.ms-team-sheet[data-tab=stats] .mc-cols>div:last-child,.ms-team-sheet[data-tab=moves] .mc-cols>div:first-child{display:none!important}}
@media(prefers-reduced-motion:reduce){.ms-sheet-body{transition:none}}

@media(max-width:640px), (max-width:960px) and (max-height:500px) and (pointer:coarse){html.ms-phone #team-modal.jp-team .mc-hero .mc-meta{color:#d7d1b0!important}html.ms-phone #team-modal.jp-team .mc-hero button{color:#f5e4bd!important;border-color:#ae9866!important;background:#846f3e!important}}

@media(max-width:640px), (max-width:960px) and (max-height:500px) and (pointer:coarse){html.ms-phone #team-modal.jp-team #team-mon-details .mc-hero>div>div:last-child{color:#ced3b8!important}html.ms-phone #team-modal.jp-team #team-mon-details .mc-hero h3 button{color:#fff0ca!important;background:#745b2e!important}}

@media (min-width:641px) and (max-width:960px) and (max-height:500px) and (pointer:coarse){html.ms-phone #mobile-bottom-nav{position:fixed;inset:auto 0 0;z-index:980;width:100%}html.ms-phone #mobile-more-sheet{position:fixed;inset:auto 0 0;z-index:1100;border:1px solid #bba16a;border-radius:22px 22px 0 0;display:none}html.ms-phone #mobile-more-sheet.open{display:block}html.ms-phone #divDock{display:none!important}html.ms-phone #game-screen{max-width:680px!important;margin:auto}html.ms-phone #scene-box{height:270px!important;min-height:270px!important}html.ms-phone #scene-npcs img{max-height:190px!important}}

html.ms-phone #game-screen{zoom:1!important}html.ms-phone body.landing-active :is(#mobile-bottom-nav,#mobile-chat-fab,#mobile-more-sheet,#mobile-chat-sheet){display:none!important}html.ms-phone #game-screen>div{position:static!important;max-width:100%!important;box-sizing:border-box}

html.ms-phone,html.ms-phone body{max-width:100%;overflow-x:clip}html.ms-phone #auth-screen{width:100%;max-width:100vw!important;box-sizing:border-box}

/* The expanded dossier belongs to the window scroll; an empty inner scrollport trapped touch swipes. */
html.ms-phone #team-modal.jp-team>.modal-content{overflow-y:auto!important;overscroll-behavior-y:contain;-webkit-overflow-scrolling:touch}html.ms-phone .ms-team-sheet>.ms-sheet-body{overflow:hidden;overscroll-behavior:auto}html.ms-phone .ms-team-sheet.expanded>.ms-sheet-body{overflow:visible}html.ms-phone #team-modal.jp-team .diary-book-pages{display:block!important}html.ms-phone #team-modal.jp-team .diary-spine{display:none}

/* Fit scroll areas to the space left by the header, including short landscape screens. */
html.ms-phone #pokedex-modal.research-atlas>.modal-content{height:94dvh}
html.ms-phone #pokedex-modal.research-atlas .dex-catalog-pages{display:flex;min-height:0}
html.ms-phone #pokedex-modal.research-atlas #pokedex-grid-container{height:auto!important;max-height:none!important;min-height:0;flex:1}
html.ms-phone #pokedex-modal.research-atlas>.modal-content>:not(.dex-catalog-pages){flex-shrink:0}
html.ms-phone #trainers-modal.jp-directory>.modal-content{display:flex;flex-direction:column;height:94dvh;min-height:0}
html.ms-phone #trainers-modal.jp-directory #trainers-list{min-height:0;max-height:none!important;flex:1}
html.ms-phone #trainers-modal.jp-directory>.modal-content>:not(#trainers-list){flex-shrink:0}
html.ms-phone .ts-window.modal-content{height:94dvh}
html.ms-phone .ts-window :is(.ts-header,.ts-tabs,.ts-footer){flex-shrink:0}
html.ms-phone .ts-catalog{min-height:0}
@media (min-width:641px) and (max-width:960px) and (max-height:500px) and (pointer:coarse){
 html.ms-phone .ts-header{padding:8px 50px 8px 14px;gap:12px}
 html.ms-phone .ts-header>img{height:40px;width:30px}
 html.ms-phone .ts-header h2{font-size:21px!important}
 html.ms-phone .ts-header p{display:none}
 html.ms-phone .ts-tabs{padding-top:5px}
 html.ms-phone .ts-tabs button{padding:8px 18px}
 html.ms-phone .ts-body{grid-template-columns:125px minmax(0,1fr) 240px}
 html.ms-phone .ts-categories{padding:8px}
}
/* v153: the scene fills its frame and continues behind the phone header. */
html.ms-phone body:not(.landing-active)::before{background:#102821!important}
html.ms-phone:not(.battle-open):not(.living-scene) body:not(.landing-active) #game-screen{padding:0!important;gap:0!important;max-width:100%!important}
html.ms-phone:not(.battle-open):not(.living-scene) body:not(.landing-active) #scene-box{height:clamp(390px,58svh,520px)!important;min-height:390px!important;border:0!important;border-radius:0!important;box-shadow:none!important;background:#1e493b!important}
html.ms-phone:not(.battle-open):not(.living-scene) body:not(.landing-active) #scene-art{position:absolute!important;inset:0!important;height:100%!important;min-height:0!important;max-height:none!important;width:100%!important;padding:0!important;border:0!important;border-radius:0!important;clip-path:none!important;box-shadow:none!important}
html.ms-phone:not(.battle-open):not(.living-scene) body:not(.landing-active) #scene-art img.parallax-img{object-fit:cover!important}
html.ms-phone:not(.battle-open):not(.living-scene) body:not(.landing-active) #divDock{position:absolute!important;top:0!important;left:0!important;right:0!important;width:100%!important;box-sizing:border-box!important;height:58px!important;min-height:0!important;display:flex!important;justify-content:center!important;padding:6px 12px!important;margin:0!important;border:0!important;box-shadow:none!important;background:linear-gradient(#173b30b0,transparent)!important;backdrop-filter:none!important;z-index:300}
html.ms-phone:not(.battle-open):not(.living-scene) #divDock.hidden{display:none!important}
html.ms-phone:not(.battle-open):not(.living-scene) #logo-menu-toggle{min-height:44px!important;gap:7px!important;background:#113d2d66!important;border:1px solid #d4c69c66!important;border-radius:10px!important;padding:4px 9px!important}
html.ms-phone:not(.battle-open):not(.living-scene) #logo-menu-toggle img:first-child{width:30px!important;height:30px!important;border:0!important;box-shadow:none!important;border-radius:5px!important}
html.ms-phone:not(.battle-open):not(.living-scene) #logo-menu-toggle img:last-child{height:29px!important;border:0!important;box-shadow:none!important;border-radius:4px!important}
html.ms-phone:not(.battle-open):not(.living-scene) #scene-loc-name{top:68px!important;max-width:80%!important}
html.ms-phone:not(.battle-open):not(.living-scene) #scene-weather{top:135px!important;right:12px!important}
html.ms-phone:not(.battle-open):not(.living-scene) #daynight-badge{bottom:28px!important;left:12px!important}
html.ms-phone:not(.battle-open):not(.living-scene) #scene-npcs{bottom:16px!important}
html.ms-phone #ms-location-sheet{border-radius:22px 22px 0 0!important;margin-top:-18px!important}
@media(min-width:641px) and (max-height:500px) and (pointer:coarse){html.ms-phone:not(.battle-open):not(.living-scene) body:not(.landing-active) #scene-box{height:340px!important;min-height:340px!important}html.ms-phone:not(.battle-open):not(.living-scene) #scene-loc-name{top:65px!important}html.ms-phone:not(.battle-open):not(.living-scene) #scene-weather{top:72px!important}}
