[data-field-guide]{
  display:flex;align-items:center;justify-content:center;margin-top:14px;
  min-height:48px;width:100%;border:1px solid #8caf9bbf;border-radius:12px;
  background:#223733d9;color:#eff3ec;font-weight:700;text-decoration:none
}
[data-field-guide]:hover{background:#344948}
#fieldGuide{
  position:fixed;inset:0;margin:auto;padding:0;width:min(900px,calc(100% - 28px));
  height:calc(100% - 28px);max-width:none;max-height:none;overflow:hidden;
  color:#f3f6ec;background:#132127;border:1px solid #526c6c;border-radius:15px
}
#fieldGuide[open]{display:flex;flex-direction:column}
#fieldGuide::backdrop{background:#080e12c9}
#fieldGuide form{
  display:flex;justify-content:flex-end;align-items:center;flex:none;
  padding:6px max(12px,env(safe-area-inset-right)) 6px max(12px,env(safe-area-inset-left));
  border-bottom:1px solid #435b61;background:#182b31
}
#fieldGuide button{
  min-height:44px;padding:6px 16px;border:1px solid #779594;border-radius:8px;
  color:inherit;background:#263f42;font:700 15px var(--body);cursor:pointer
}
#fieldGuide iframe{display:block;flex:1;width:100%;min-height:0;border:0}
@media(max-width:640px){
  #fieldGuide{width:100%;height:100%;height:100dvh;border:0;border-radius:0}
  #fieldGuide form{padding-top:max(6px,env(safe-area-inset-top))}
}
/* Keep controls inside the physical display cutouts in standalone mode. */
#app{height:100%;height:100dvh;min-height:0}
#c{touch-action:none}
.overlay{overscroll-behavior:contain}
#hud{padding-top:max(14px,env(safe-area-inset-top));padding-left:max(20px,env(safe-area-inset-left));padding-right:max(20px,env(safe-area-inset-right))}
#sheet{padding-bottom:max(10px,env(safe-area-inset-bottom))}
#act{bottom:max(24px,calc(env(safe-area-inset-bottom) + 12px));right:max(20px,calc(env(safe-area-inset-right) + 12px))}
#joy{bottom:max(22px,calc(env(safe-area-inset-bottom) + 10px));left:max(18px,calc(env(safe-area-inset-left) + 10px))}
@media(pointer:coarse){
  #app{--safe-top:env(safe-area-inset-top,0px)}
  #snd,#hint,#gfx{top:calc(58px + var(--safe-top))!important;min-height:38px}
  #mm,.playing #fieldSidebar{top:calc(102px + var(--safe-top))}
  .cine.playing #fieldSidebar{top:calc(54px + var(--safe-top))}
  #choices{max-height:min(43dvh,360px);overflow-y:auto;touch-action:pan-y;overscroll-behavior:contain}
  #title .wrap{justify-content:flex-start;padding-top:calc(26px + var(--safe-top));padding-bottom:max(20px,env(safe-area-inset-bottom))}
  #title .keys{font-size:12px}
}
@media(pointer:coarse) and (max-height:490px){
  #joy{width:86px;height:86px}#mm{display:none!important}
  #title .wrap{max-width:530px}#title h1{font-size:40px}
  #choices{max-height:38dvh}#sheet #box{min-height:0;padding:8px 12px}#sheet #face{width:44px;height:44px}
}

