/* Mobile immersive mode V3.3. This stylesheet intentionally wins over earlier mobile overrides. */
.game-shell.game-immersive.game-immersive {
  width:var(--fs-visible-width, 100dvw)!important;
  height:var(--fs-visible-height, 100dvh)!important;
  max-height:none!important;max-width:none!important;
  margin:0!important; border:0!important; border-radius:0!important;
  padding:0!important;box-shadow:none!important;
  display:grid!important;grid-template-rows:auto auto minmax(0,1fr) auto!important;
  overflow:hidden!important; background:#06132d!important;
  box-sizing:border-box!important;contain:layout style;
}
.game-shell.game-immersive.is-fullscreen-fallback{
  position:fixed!important;
  left:var(--fs-visible-left, 0px)!important;
  top:var(--fs-visible-top, 0px)!important;
  right:auto!important;bottom:auto!important;
  z-index:2147483640!important;
}
.game-shell.game-immersive .game-topbar,
.game-shell.game-immersive .game-statusline,
.game-shell.game-immersive .game-frame,
.game-shell.game-immersive .demo-controls {min-width:0!important;max-width:none!important;box-sizing:border-box!important;}
.game-shell.game-immersive.game-immersive .game-topbar {
  display:flex!important;flex-wrap:nowrap!important;align-items:center!important;
  min-height:0!important;max-height:none!important;height:auto!important;
  padding:calc(5px + env(safe-area-inset-top,0px)) max(9px,env(safe-area-inset-right,0px)) 5px max(9px,env(safe-area-inset-left,0px))!important;
  gap:8px!important; overflow:hidden;
}
.game-shell.game-immersive.game-immersive .game-topbar>div:first-child{display:none!important;}
.game-shell.game-immersive.game-immersive .game-header-actions{
  display:flex!important;align-items:center;justify-content:space-between!important;
  flex-wrap:nowrap!important;width:100%!important;min-width:0!important;gap:8px!important;
}
.game-shell.game-immersive.game-immersive .game-fullscreen-btn {
  min-height:39px!important;padding:5px 9px!important;flex:0 0 auto!important;
  font-size:.78rem!important;
}
.game-shell.game-immersive.game-immersive .game-statusline{
  display:flex!important;align-items:center;justify-content:center;
  height:auto!important;max-height:35px!important;min-height:0!important;
  padding:4px 10px!important;gap:8px!important;font-size:.71rem!important;
}
.game-shell.game-immersive.game-immersive .game-statusline span:last-child{white-space:nowrap!important;text-overflow:ellipsis!important;overflow:hidden!important;}
.game-shell.game-immersive.game-immersive .game-frame{
  position:relative!important; width:100%!important;height:100%!important;
  min-height:0!important;max-height:none!important;aspect-ratio:auto!important;
  flex:none!important;overflow:hidden!important;
  background:linear-gradient(130deg,#0c1c37d9,#1c2d54c7),url('assets/hangar.webp') center/cover no-repeat!important;
  touch-action:none!important;
}
.game-shell.game-immersive.game-immersive #gameCanvas{
  display:block!important;width:100%!important;height:100%!important;max-width:none!important;
  object-fit:contain!important;touch-action:none!important;
}
.game-shell.game-immersive.game-immersive .demo-controls{
  display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;
  align-items:stretch!important;justify-items:stretch!important;
  flex:none!important;gap:6px!important;
  padding:7px max(9px,env(safe-area-inset-right,0px)) calc(7px + env(safe-area-inset-bottom,0px)) max(9px,env(safe-area-inset-left,0px))!important;
  overflow:visible!important;background:#0b1c3a!important;
}
.game-shell.game-immersive.game-immersive .desktop-hint{display:none!important;}
.game-shell.game-immersive.game-immersive .touch-controls{
  display:grid!important;grid-column:1/-1!important;
  width:100%!important;min-width:0!important;
  grid-template-columns:minmax(0,1fr) minmax(0,1fr) minmax(0,1.4fr) minmax(0,1.4fr)!important;
  gap:6px!important;align-items:stretch!important;
  flex:none!important;margin:0!important;
}
.game-shell.game-immersive.game-immersive .control-btn{
  min-height:47px!important;height:47px!important;min-width:0!important;
  width:100%!important;max-width:none!important;
  padding:3px 4px!important;white-space:nowrap!important;border-radius:11px!important;
  font-size:.88rem!important;touch-action:none!important;
}
.game-shell.game-immersive.game-immersive .game-reset{
  margin:0!important;min-height:38px!important;height:38px!important;min-width:0!important;
  padding:4px 8px!important;justify-content:center!important;
  font-size:.83rem!important;border-radius:10px!important;white-space:nowrap!important;
}
.game-shell.game-immersive.game-immersive .game-reset span:nth-child(2){display:none!important;}
.game-shell.game-immersive.game-immersive [hidden]{display:none!important;}
.game-shell.game-immersive.game-immersive .game-start,
.game-shell.game-immersive.game-immersive .game-interlude,
.game-shell.game-immersive.game-immersive .game-puzzle,
.game-shell.game-immersive.game-immersive .game-pause,
.game-shell.game-immersive.game-immersive .game-result{
  inset:0!important;display:flex!important;align-items:center!important;justify-content:safe center!important;
  flex-direction:column!important;overflow-y:auto!important;overflow-x:hidden!important;
  padding:8px!important;overscroll-behavior:contain!important;touch-action:pan-y!important;
}
.game-shell.game-immersive.game-immersive .game-intro-card{
  width:min(100%,500px)!important;max-width:100%!important;max-height:none!important;
  padding:10px 12px!important;margin:auto!important;flex:0 0 auto!important;
}
.game-shell.game-immersive.game-immersive .game-intro-card h3{font-size:clamp(1.04rem,4vw,1.6rem)!important;line-height:1.15!important;margin:4px 0 7px!important;}
.game-shell.game-immersive.game-immersive .game-intro-card p{font-size:clamp(.67rem,2.3vw,.85rem)!important;line-height:1.3!important;margin-bottom:7px!important;}
.game-shell.game-immersive.game-immersive .demo-setup{margin-bottom:6px!important;gap:3px!important;}
.game-shell.game-immersive.game-immersive .demo-setup select{min-height:36px!important;padding:5px!important;}
.game-shell.game-immersive.game-immersive .game-intro-card .btn{min-height:38px!important;padding:8px 15px!important;}
/* Landscape phones have a compact one-row controller to avoid cropping gameplay. */
.game-shell.game-immersive.game-mobile-immersive.game-immersive-landscape .game-statusline{display:none!important;}
.game-shell.game-immersive.game-mobile-immersive.game-immersive-landscape .demo-controls{
  display:flex!important;flex-wrap:nowrap!important;align-items:center!important;
  justify-content:space-between!important;gap:5px!important;
  padding:3px max(8px,env(safe-area-inset-right,0px)) calc(3px + env(safe-area-inset-bottom,0px)) max(8px,env(safe-area-inset-left,0px))!important;
}
.game-shell.game-immersive.game-mobile-immersive.game-immersive-landscape .touch-controls{
  display:grid!important;flex:1 1 auto!important;min-width:0!important;width:auto!important;
  grid-template-columns:repeat(2,minmax(38px,1fr)) repeat(2,minmax(62px,1.3fr))!important;
  gap:5px!important;margin:0!important;
}
.game-shell.game-immersive.game-mobile-immersive.game-immersive-landscape .control-btn{
  height:46px!important;min-height:46px!important;font-size:.75rem!important;padding:3px!important;
}
.game-shell.game-immersive.game-mobile-immersive.game-immersive-landscape .game-reset{
  flex:0 0 40px!important;height:43px!important;min-height:43px!important;min-width:0!important;padding:3px!important;
}
.game-shell.game-immersive.game-mobile-immersive.game-immersive-landscape .game-topbar{padding:3px 9px!important;}
.game-shell.game-immersive.game-mobile-immersive.game-immersive-landscape .game-fullscreen-btn{min-height:33px!important;padding:3px 8px!important;}
.game-shell.game-immersive.game-mobile-immersive.game-immersive-landscape .game-mini-tag{display:none!important;}
.game-shell.game-immersive.game-mobile-immersive.game-immersive-landscape .game-interlude img,
.game-shell.game-immersive.game-mobile-immersive.game-immersive-landscape .game-puzzle img{width:50px!important;height:50px!important;margin:0 auto!important;}
@media (max-height:390px) and (orientation:landscape){
  .game-shell.game-immersive.game-immersive-landscape .game-reset{flex-basis:35px!important;height:39px!important;min-height:39px!important;}
  .game-shell.game-immersive.game-immersive-landscape .control-btn{height:42px!important;min-height:42px!important;}
  .game-shell.game-immersive.game-immersive-landscape .game-topbar{min-height:0!important;}
}
@media (max-width:370px){
  .game-shell.game-immersive.game-immersive .game-fullscreen-btn{font-size:.69rem!important;}
  .game-shell.game-immersive.game-immersive .game-stats{gap:5px!important;font-size:.71rem!important;}
}
/* Explicit grid placement is essential when the status row is hidden in landscape. */
.game-shell.game-immersive.game-immersive .game-topbar{grid-row:1!important;}
.game-shell.game-immersive.game-immersive .game-statusline{grid-row:2!important;}
.game-shell.game-immersive.game-immersive .game-frame{grid-row:3!important;}
.game-shell.game-immersive.game-immersive .demo-controls{grid-row:4!important;}
/* Do not inherit the site's scroll-reveal opacity/transform while immersive. */
.game-shell.game-immersive.game-immersive{
  animation:none!important;opacity:1!important;transform:none!important;
  filter:none!important;background-color:#06132d!important;
}
/* Visual viewport starts at the fixed-layout origin. Adding offsetTop shifted controls offscreen. */
.game-shell.game-immersive.is-fullscreen-fallback{left:0!important;top:0!important;}
.game-shell.game-immersive.game-immersive .game-frame{background-color:#06132d!important;}
/* The HTML hidden attribute must always outrank immersive overlay display rules. */
.game-shell.game-immersive.game-immersive [hidden],
.game-shell.game-immersive.game-immersive .game-start[hidden],
.game-shell.game-immersive.game-immersive .game-interlude[hidden],
.game-shell.game-immersive.game-immersive .game-puzzle[hidden],
.game-shell.game-immersive.game-immersive .game-pause[hidden],
.game-shell.game-immersive.game-immersive .game-result[hidden]{display:none!important;}
