/* Responsive-only transplant from go daddy escape big.zip.
   Intentionally does NOT change room artwork, scene aspect ratio, hotspots, puzzles,
   avatar coordinates, or desktop layout. */
:root{
  --ui-safe-top:env(safe-area-inset-top,0px);
  --ui-safe-right:env(safe-area-inset-right,0px);
  --ui-safe-bottom:env(safe-area-inset-bottom,0px);
  --ui-safe-left:env(safe-area-inset-left,0px);
}
html,body{
  width:100%!important;
  min-width:0!important;
  margin:0!important;
  overflow:hidden!important;
  overscroll-behavior:none!important;
  -webkit-text-size-adjust:100%!important;
  text-size-adjust:100%!important;
}
/* Android/iOS dynamic viewport: size the outer app only.
   The existing room geometry remains untouched. */
body,.app-shell{
  min-height:100vh!important;
  min-height:100dvh!important;
}
.app-shell{
  position:fixed!important;
  inset:0!important;
  width:100%!important;
  height:100vh!important;
  height:100dvh!important;
  min-width:0!important;
  overflow:hidden!important;
}
.room-column,.stage-wrap,.stage{
  min-width:0!important;
  min-height:0!important;
}
/* Do not use visualViewport pixel heights; browser CSS viewport units remain stable. */
@supports(height:100svh){
  @media(max-width:1100px){
    body,.app-shell{min-height:100svh!important;}
  }
}
/* Safe-area and touch sizing only; no room geometry changes. */
@media(max-width:1100px){
  .panel-toggle{
    top:calc(8px + var(--ui-safe-top))!important;
    right:calc(8px + var(--ui-safe-right))!important;
    min-width:44px!important;
    min-height:44px!important;
    touch-action:manipulation!important;
  }
  .side-panel{
    max-height:calc(100dvh - 16px - var(--ui-safe-top) - var(--ui-safe-bottom))!important;
    overscroll-behavior:contain!important;
    -webkit-overflow-scrolling:touch!important;
  }
  .panel-close,.panel-section button,.panel-section select,.panel-section input{min-height:44px!important;}
  .panel-section textarea{font-size:16px!important;}
}
.overlay{
  padding:calc(10px + var(--ui-safe-top)) calc(10px + var(--ui-safe-right)) calc(10px + var(--ui-safe-bottom)) calc(10px + var(--ui-safe-left))!important;
  overflow:auto!important;
  -webkit-overflow-scrolling:touch!important;
}
.entry-card{
  max-width:100%!important;
  max-height:calc(100dvh - 20px - var(--ui-safe-top) - var(--ui-safe-bottom))!important;
  overflow:auto!important;
}
.entry-card input,.entry-card select,.entry-card textarea{font-size:16px!important;}
.entry-card button{min-height:44px!important;}
/* Keep existing puzzle artwork and coordinates; only constrain modal viewport. */
.puzzle-modal,.knight-tour-modal,.eight-queens-modal{
  max-width:100vw!important;
  max-height:100dvh!important;
}
@media(max-width:600px){
  .player-name{max-width:120px!important;}
  .overhead-pm{max-width:min(160px,48vw)!important;}
}
