/* AMBA WORLD v99 - camera / viewport correction. Keep portrait layout except a
   new Guilin player-following viewport. Asset images and gameplay physics unchanged.

   A 1280x720 scene cannot simultaneously fill an ultrawide phone and retain
   every sky pixel without distortion. Anchor COVER to the bottom so terrain,
   river, landing surfaces and characters remain visible; crop upper sky only.
*/
@media (pointer:coarse) and (orientation:landscape),
       (orientation:landscape) and (max-height:650px) {
 html,body{margin:0!important;width:100%!important;height:100%!important;overflow:hidden!important}
 #shell,#guilinRoot,#singaporeRoot{width:100dvw!important;height:100dvh!important;max-width:none!important;max-height:none!important;overflow:hidden!important}
 #shell > #game,#guilinRoot > #guilinCanvas,#singaporeRoot > #singaporeCanvas{
   position:absolute!important;inset:0!important;width:100%!important;height:100%!important;
   max-width:none!important;max-height:none!important;display:block!important;
   object-fit:cover!important;object-position:center bottom!important;
   transform:none!important;image-rendering:auto!important;
 }
 #shell > #ambaSakuraPortraitView,#guilinRoot > #ambaGuilinPortraitView,
 #singaporeRoot > #ambaSingaporePortraitView{display:none!important}
}
/* Guilin's source canvas contains the whole river, but its former centred
   portrait crop could show Lian while AMBA (x=160) was offscreen. The view
   now copies each real frame, following AMBA and displaying the full Y range. */
#ambaGuilinPortraitView{display:none!important}
@media (pointer:coarse) and (orientation:portrait) and (max-width:820px){
 #guilinRoot.guilin-v99-portrait-ready > #guilinCanvas{opacity:0!important}
 #guilinRoot.guilin-v99-portrait-ready > #ambaGuilinPortraitView{
   display:block!important;position:absolute!important;inset:0!important;
   width:100%!important;height:100%!important;object-fit:fill!important;
   z-index:0!important;pointer-events:none!important;image-rendering:auto!important
 }
 #guilinRoot > .guilin-hud,#guilinRoot > .guilin-objective,
 #guilinRoot > .guilin-controls,#guilinRoot > .guilin-tip{z-index:3!important}
 #guilinRoot > .guilin-screen,#guilinRoot > .guilin-battle,
 #guilinRoot > .guilin-pause-card{z-index:6!important}
}
