/* v110 final polish: keep native orientation selection, seam-free phone view,
   raised storybook nameplates and unobstructed HUDs across three countries. */
@media (pointer:coarse) and (orientation:portrait) and (max-width:820px){
  /* Do not hide the source until the follow view has its first complete frame. */
  #singaporeRoot.sg-portrait-continue:not(.sg-v110-portrait-ready) > #singaporeCanvas{
    opacity:1!important;
  }
  #singaporeRoot.sg-portrait-continue:not(.sg-v110-portrait-ready) > #ambaSingaporePortraitView{
    display:none!important;
  }
  /* Four tool buttons wrap on phones: place the micro HUD below both rows. */
  #singaporeRoot > .amba-mini-hud{top:calc(env(safe-area-inset-top,0px) + 132px)!important;}
}
/* Name pills should visibly float above the ivory text panel, not be clipped
   by the scrolling copy or hidden under the image window. */
#shell :is(#npcDialog,#dialog,#sparkScene) .guardian-dialogbox,
#guilinRoot #guilinDialog :is(.guilin-country-story,.guilin-lian-story) .guardian-dialogbox{
  overflow:visible!important;
  isolation:isolate;
}
#shell :is(#npcDialog,#dialog,#sparkScene) .guardian-dialogbox > .nameplate,
#guilinRoot #guilinDialog .guardian-dialogbox > .nameplate{
  z-index:50!important;
  top:-15px!important;
  transform:none!important;
  color:#654023!important;
  background:linear-gradient(180deg,#fff2b9,#e9c77a)!important;
  border:1px solid #d2a85b!important;
  box-shadow:0 4px 0 #bc9555,0 6px 12px #35243b35!important;
  white-space:nowrap!important;
}
/* In the two-column landscape cards, leave a little room for the raised pill. */
@media (orientation:landscape){
  #shell :is(#npcDialog:not(.amba-country-intro),#dialog,#sparkScene) .guardian-dialogbox .dialog-copy,
  #guilinRoot #guilinDialog .guardian-dialogbox .dialog-copy{
    padding-top:max(20px,2.5dvh)!important;
  }
  #shell :is(#npcDialog:not(.amba-country-intro),#dialog,#sparkScene) .guardian-dialogbox > .nameplate,
  #guilinRoot #guilinDialog .guardian-dialogbox > .nameplate{
    top:-13px!important;
  }
}
