/* A Mouse in Space — mobile-first controls and adaptive mini-game view, V3.2 */
@media (pointer:coarse){
  .touch-controls{display:flex;}
  .game-shell button{ -webkit-tap-highlight-color:transparent; }
  .control-btn{touch-action:none;-webkit-user-select:none;user-select:none;-webkit-touch-callout:none;overscroll-behavior:contain}
  .control-btn.pressed{transform:scale(.94);filter:brightness(1.17)}
  #gameCanvas{image-rendering:auto}
}
.mobile-game-tip{display:none}
@media (max-width:700px){
  .demo-section{padding-top:68px;padding-bottom:75px}
  .demo-section>.container{padding-inline:max(9px,env(safe-area-inset-left));padding-right:max(9px,env(safe-area-inset-right))}
  .demo-title-row{padding-inline:9px}
  .game-shell{margin-top:24px;border-radius:16px;box-shadow:0 12px 50px #020917bd}
  .game-topbar{padding:9px 12px 8px;gap:4px;flex-wrap:wrap}
  .game-topbar>div:first-child{width:100%;min-width:0;gap:6px}
  .game-topbar .game-live-dot{width:7px;height:7px}
  .game-topbar .sprite-v3-chip,.game-topbar small{display:none}
  .game-topbar b{font-size:.65rem;letter-spacing:.08em}
  .game-header-actions{width:100%!important;display:flex;justify-content:space-between;gap:8px;flex-wrap:nowrap}
  .game-stats{font-size:.88rem;gap:12px;min-width:0}
  .game-fullscreen-btn{padding:6px 10px;min-height:41px;font-size:.81rem;flex-shrink:0}
  .game-statusline{display:flex;align-items:center;gap:9px;padding:8px 10px;font-size:.71rem;min-height:35px}
  .game-statusline span:first-child{font-size:.69rem}
  .game-statusline span:last-child{white-space:nowrap;text-align:right;overflow:hidden;text-overflow:ellipsis;font-size:.7rem}
  .game-frame{aspect-ratio:var(--game-ratio,540 / 560);height:auto;min-height:0;touch-action:pan-y}
  #gameCanvas{object-fit:contain!important;width:100%;height:100%;}
  .demo-controls{padding:10px 9px 9px;display:flex;align-items:center;justify-content:center;flex-wrap:wrap;gap:9px;background:#0b1c3a;touch-action:manipulation}
  .desktop-hint{display:none}
  .touch-controls{display:grid!important;grid-template-columns:repeat(2,minmax(54px,70px)) minmax(82px,1fr) minmax(82px,1fr);width:100%;gap:10px;align-items:stretch;order:0}
  .control-btn,.jump-btn,.action-btn{font-size:1.17rem;line-height:1.1;width:100%;min-width:0!important;height:58px;min-height:58px;border-radius:15px;border-width:2px;box-shadow:inset 0 -4px 0 #0003}
  .jump-btn,.action-btn{font-size:.83rem;letter-spacing:.025em;white-space:nowrap}
  .game-reset{order:2;min-height:43px;padding:7px 13px;font-size:.83rem;border-radius:12px}
  #gameSound,#gamePauseBtn{font-size:1.1rem;min-height:43px;min-width:48px;padding:5px 9px}
  .mobile-game-tip{display:block;margin:9px 6px 0;color:#bad6ff;font-size:.79rem;line-height:1.45;text-align:center}
  html[lang="de"] .mobile-game-tip .tip-en,html[lang="en"] .mobile-game-tip .tip-de{display:none}
  .game-shell:fullscreen,.game-shell:-webkit-full-screen,.game-shell.is-fullscreen-fallback{padding:env(safe-area-inset-top,0px) env(safe-area-inset-right,0px) env(safe-area-inset-bottom,0px) env(safe-area-inset-left,0px)!important}
  .game-shell:fullscreen .game-frame,.game-shell:-webkit-full-screen .game-frame,.game-shell.is-fullscreen-fallback .game-frame{touch-action:none;min-height:0!important}
  .game-shell:fullscreen .demo-controls,.game-shell:-webkit-full-screen .demo-controls,.game-shell.is-fullscreen-fallback .demo-controls{display:flex!important;flex-wrap:wrap!important;justify-content:center!important;gap:6px;padding:6px 7px 7px}
  .game-shell:fullscreen .touch-controls,.game-shell:-webkit-full-screen .touch-controls,.game-shell.is-fullscreen-fallback .touch-controls{display:grid!important;flex:1 0 100%;grid-template-columns:repeat(2,minmax(56px,72px)) minmax(80px,1fr) minmax(80px,1fr);gap:8px}
  .game-shell:fullscreen .control-btn,.game-shell:-webkit-full-screen .control-btn,.game-shell.is-fullscreen-fallback .control-btn{width:100%;height:54px;min-height:54px;min-width:0!important}
  .game-shell:fullscreen .game-reset,.game-shell:-webkit-full-screen .game-reset,.game-shell.is-fullscreen-fallback .game-reset{height:41px;min-height:41px;padding:7px 12px}
  .game-shell:fullscreen .game-topbar,.game-shell:-webkit-full-screen .game-topbar,.game-shell.is-fullscreen-fallback .game-topbar{min-height:0;padding:5px 10px 4px}
  .game-shell:fullscreen .game-statusline,.game-shell:-webkit-full-screen .game-statusline,.game-shell.is-fullscreen-fallback .game-statusline{min-height:29px;padding:4px 10px}
  .game-shell:fullscreen .game-start,.game-shell:fullscreen .game-result,.game-shell:fullscreen .game-interlude,.game-shell:fullscreen .game-puzzle,.game-shell:fullscreen .game-pause,.game-shell.is-fullscreen-fallback .game-start,.game-shell.is-fullscreen-fallback .game-result,.game-shell.is-fullscreen-fallback .game-interlude,.game-shell.is-fullscreen-fallback .game-puzzle,.game-shell.is-fullscreen-fallback .game-pause{overflow:auto!important;display:flex;flex-direction:column;align-items:center;justify-content:flex-start;padding:7px 8px;overscroll-behavior:contain;touch-action:pan-y}
  .game-shell:fullscreen .game-intro-card,.game-shell.is-fullscreen-fallback .game-intro-card{flex:0 0 auto;width:min(100%,490px);margin:auto;padding:10px 12px!important;max-height:none}
  .game-shell:fullscreen .game-intro-card h3,.game-shell.is-fullscreen-fallback .game-intro-card h3{font-size:clamp(1.25rem,4.4vw,1.9rem);margin:6px 0;line-height:1.11}
  .game-shell:fullscreen .game-intro-card p,.game-shell.is-fullscreen-fallback .game-intro-card p{font-size:.79rem;line-height:1.3;margin-bottom:8px}
  .game-shell:fullscreen .demo-setup,.game-shell.is-fullscreen-fallback .demo-setup{max-width:290px;margin-bottom:7px}
  .game-shell:fullscreen .demo-setup select,.game-shell.is-fullscreen-fallback .demo-setup select{min-height:42px;padding:5px 7px}
  .game-shell:fullscreen .game-intro-card .btn,.game-shell.is-fullscreen-fallback .game-intro-card .btn{min-height:43px;padding:9px 18px}
}
@media (max-width:700px) and (orientation:landscape){
  .game-frame{aspect-ratio:var(--game-ratio,1000 / 560)}
  .game-shell:fullscreen .game-topbar,.game-shell:-webkit-full-screen .game-topbar,.game-shell.is-fullscreen-fallback .game-topbar{flex-wrap:nowrap;gap:10px;min-height:35px}
  .game-shell:fullscreen .game-topbar>div:first-child,.game-shell.is-fullscreen-fallback .game-topbar>div:first-child{width:auto}
  .game-shell:fullscreen .game-header-actions,.game-shell.is-fullscreen-fallback .game-header-actions{width:auto!important}
}
/* Short-height phones and landscape Android / iOS: dedicate most of the viewport to gameplay */
@media (pointer:coarse) and (orientation:landscape) and (max-height:550px){
  .game-shell:fullscreen .game-topbar,.game-shell:-webkit-full-screen .game-topbar,.game-shell.is-fullscreen-fallback .game-topbar{display:flex;align-items:center;flex-wrap:nowrap;min-height:30px;max-height:35px;padding:3px 10px}
  .game-shell:fullscreen .game-topbar>div:first-child,.game-shell:-webkit-full-screen .game-topbar>div:first-child,.game-shell.is-fullscreen-fallback .game-topbar>div:first-child{display:none}
  .game-shell:fullscreen .game-header-actions,.game-shell:-webkit-full-screen .game-header-actions,.game-shell.is-fullscreen-fallback .game-header-actions{width:100%!important;justify-content:space-between}
  .game-shell:fullscreen .game-fullscreen-btn,.game-shell:-webkit-full-screen .game-fullscreen-btn,.game-shell.is-fullscreen-fallback .game-fullscreen-btn{min-height:33px;padding:3px 8px}
  .game-shell:fullscreen .game-statusline,.game-shell:-webkit-full-screen .game-statusline,.game-shell.is-fullscreen-fallback .game-statusline{min-height:0!important;max-height:0!important;overflow:hidden;padding:0!important;border:0}
  .game-shell:fullscreen .demo-controls,.game-shell:-webkit-full-screen .demo-controls,.game-shell.is-fullscreen-fallback .demo-controls{flex-wrap:nowrap!important;justify-content:space-between!important;gap:5px;padding:3px 9px!important;min-height:52px}
  .game-shell:fullscreen .touch-controls,.game-shell:-webkit-full-screen .touch-controls,.game-shell.is-fullscreen-fallback .touch-controls{flex:1 1 auto;width:auto;grid-template-columns:repeat(2,minmax(49px,68px)) repeat(2,minmax(66px,98px));gap:6px;margin-right:auto}
  .game-shell:fullscreen .control-btn,.game-shell:-webkit-full-screen .control-btn,.game-shell.is-fullscreen-fallback .control-btn{height:48px;min-height:48px!important;border-radius:12px}
  .game-shell:fullscreen .game-reset,.game-shell:-webkit-full-screen .game-reset,.game-shell.is-fullscreen-fallback .game-reset{height:44px;min-height:44px;font-size:.78rem;padding:4px 7px;flex:none}
  .game-shell:fullscreen .game-reset span:nth-child(2),.game-shell.is-fullscreen-fallback .game-reset span:nth-child(2){display:none}
  .game-shell:fullscreen .game-intro-card,.game-shell.is-fullscreen-fallback .game-intro-card{padding:4px 11px!important;max-width:540px}
  .game-shell:fullscreen .game-intro-card h3,.game-shell.is-fullscreen-fallback .game-intro-card h3{font-size:1.25rem;margin:3px 0}
  .game-shell:fullscreen .game-intro-card p,.game-shell.is-fullscreen-fallback .game-intro-card p{font-size:.72rem;margin:2px 0 6px}
  .game-shell:fullscreen .game-mini-tag,.game-shell.is-fullscreen-fallback .game-mini-tag{display:none}
  .game-shell:fullscreen .demo-setup,.game-shell.is-fullscreen-fallback .demo-setup{gap:0;margin-bottom:4px}
  .game-shell:fullscreen .demo-setup select,.game-shell.is-fullscreen-fallback .demo-setup select{min-height:33px;padding:3px}
  .game-shell:fullscreen .game-intro-card .btn,.game-shell.is-fullscreen-fallback .game-intro-card .btn{min-height:37px;padding:6px 18px}
  .game-shell:fullscreen .game-interlude img,.game-shell.is-fullscreen-fallback .game-interlude img,.game-shell:fullscreen .game-puzzle img,.game-shell.is-fullscreen-fallback .game-puzzle img{width:54px;height:54px;margin:0 auto}
}
@media (max-width:360px){
  .game-header-actions{gap:4px}.game-stats{gap:7px;font-size:.76rem}
  .touch-controls{grid-template-columns:repeat(2,minmax(42px,1fr)) repeat(2,minmax(63px,1.5fr));gap:5px}
  .control-btn,.jump-btn,.action-btn{height:54px;min-height:54px;font-size:.95rem}
  .game-shell:fullscreen .control-btn,.game-shell.is-fullscreen-fallback .control-btn{height:50px;min-height:50px}
  .game-fullscreen-btn{font-size:.72rem;padding:4px 7px}
}

/* Mobile landscape must not depend on hover or browser pointer-type detection. */
@media (orientation:landscape) and (max-height:550px) and (max-width:980px){
  .game-shell:fullscreen .demo-controls,.game-shell:-webkit-full-screen .demo-controls,.game-shell.is-fullscreen-fallback .demo-controls{flex:0 0 auto!important;flex-wrap:nowrap!important;gap:6px!important;padding:3px 7px!important;min-height:55px!important;justify-content:space-between!important}
  .game-shell:fullscreen .touch-controls,.game-shell:-webkit-full-screen .touch-controls,.game-shell.is-fullscreen-fallback .touch-controls{display:grid!important;flex:0 0 auto!important;width:auto!important;grid-template-columns:58px 58px 93px 93px!important;gap:7px!important;margin-right:auto!important;}
  .game-shell:fullscreen .control-btn,.game-shell:-webkit-full-screen .control-btn,.game-shell.is-fullscreen-fallback .control-btn{height:48px!important;min-height:48px!important;width:100%!important;font-size:.79rem!important;}
  .game-shell:fullscreen .game-reset,.game-shell:-webkit-full-screen .game-reset,.game-shell.is-fullscreen-fallback .game-reset{min-height:42px!important;height:42px!important;flex:0 0 auto;padding:4px 8px!important}
  .game-shell:fullscreen .game-reset span:nth-child(2),.game-shell.is-fullscreen-fallback .game-reset span:nth-child(2){display:none}
  .game-shell:fullscreen .game-topbar,.game-shell:-webkit-full-screen .game-topbar,.game-shell.is-fullscreen-fallback .game-topbar{min-height:34px!important;max-height:36px;flex-wrap:nowrap!important;padding:2px 10px!important}
  .game-shell:fullscreen .game-topbar>div:first-child,.game-shell.is-fullscreen-fallback .game-topbar>div:first-child{display:none!important}
  .game-shell:fullscreen .game-header-actions,.game-shell.is-fullscreen-fallback .game-header-actions{width:100%!important;justify-content:space-between!important}
  .game-shell:fullscreen .game-statusline,.game-shell:-webkit-full-screen .game-statusline,.game-shell.is-fullscreen-fallback .game-statusline{display:none!important}
  .game-shell:fullscreen .game-frame,.game-shell.is-fullscreen-fallback .game-frame{flex:1 1 auto!important}
}
@media (orientation:landscape) and (max-height:550px) and (max-width:720px){
 .game-shell:fullscreen .touch-controls,.game-shell.is-fullscreen-fallback .touch-controls{grid-template-columns:50px 50px 80px 80px!important;gap:5px!important}
 .game-shell:fullscreen .game-reset,.game-shell.is-fullscreen-fallback .game-reset{min-width:37px!important;padding:3px 6px!important}
}
/* Hidden overlays must remain hidden in fullscreen (otherwise a stale Pause screen covers the game). */
.game-shell:fullscreen [hidden],.game-shell:-webkit-full-screen [hidden],.game-shell.is-fullscreen-fallback [hidden]{display:none!important}
@media (orientation:landscape) and (max-height:550px) and (max-width:980px){
  .game-shell:fullscreen .desktop-hint,.game-shell:-webkit-full-screen .desktop-hint,.game-shell.is-fullscreen-fallback .desktop-hint{display:none!important}
  .game-shell:fullscreen .touch-controls,.game-shell:-webkit-full-screen .touch-controls,.game-shell.is-fullscreen-fallback .touch-controls{flex-shrink:1!important;min-width:0!important;grid-template-columns:repeat(2,minmax(48px,64px)) repeat(2,minmax(73px,96px))!important}
  .game-shell:fullscreen .touch-controls .control-btn,.game-shell:-webkit-full-screen .touch-controls .control-btn,.game-shell.is-fullscreen-fallback .touch-controls .control-btn{min-width:0!important;max-width:100%!important;white-space:nowrap!important;padding:0 6px!important}
  .game-shell:fullscreen .demo-controls,.game-shell:-webkit-full-screen .demo-controls,.game-shell.is-fullscreen-fallback .demo-controls{overflow:hidden!important}
}
@media (max-width:720px) and (orientation:landscape) and (max-height:550px){
  .game-shell:fullscreen .touch-controls,.game-shell.is-fullscreen-fallback .touch-controls{grid-template-columns:50px 50px 80px 80px!important}
}
/* Letterboxed areas become gentle cinematic scenery rather than stark black bars. */
.game-shell:fullscreen .game-frame,.game-shell:-webkit-full-screen .game-frame,.game-shell.is-fullscreen-fallback .game-frame{background:linear-gradient(90deg,#08162dde,#121c41e5),url('assets/hangar.webp') center /cover no-repeat!important}
