/* HUD gaps let taps reach the world; only the actual controls receive input. */
.topActions,.bottomActions,#touch,#touch>div{pointer-events:none}
.topActions button,.bottomActions button,#touch button{pointer-events:auto}
#stage{-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent}
input,textarea{-webkit-user-select:text;user-select:text}
.panel,.puzzleInfo{touch-action:pan-y;overscroll-behavior:contain}
@media(any-pointer:coarse){
 #touch{display:block;left:2%;bottom:4%;margin:0;padding:0}
 #touch button{min-width:48px;min-height:48px;padding:8px;margin:3px}
 button:hover,button:active{transform:none}
 .puzzleExit,.stopExit,.practiceExit{min-width:44px!important;min-height:44px!important;z-index:6}
 .puzzleInfo button,.topActions button,.bottomActions button{min-height:44px;font-size:13px;padding:8px 12px}
 .bottomActions{max-width:48%;flex-wrap:wrap;justify-content:flex-end;bottom:3%;right:2%;padding:0}
 .dialog small button{min-width:72px;min-height:40px;font-size:12px!important;padding:6px 9px!important}
 .mathChoices{flex-wrap:wrap;gap:10px}.mathChoices button{min-height:50px}
 .puzzleInfo{padding-top:44px}.puzzleInfo h2{padding-right:0}
 #toast{white-space:normal;max-width:80%;width:max-content}
}
.touch-input button:hover,.touch-input button:active{transform:none}
.touch-input #touch{display:none}
#movePadToggle{display:none;position:absolute;left:2%;bottom:3%;min-height:44px;padding:7px 12px;z-index:1}
.touch-input #movePadToggle{display:block}
.show-move-pad #touch{display:block;bottom:16%}
#stage.has-modal #movePadToggle,#stage.has-modal #touch{visibility:hidden;pointer-events:none}
#stage.has-modal #hud button{pointer-events:none}
@media(any-pointer:coarse){
 #touch{display:none}#movePadToggle{display:block}.show-move-pad #touch{display:block;bottom:16%}
 .bottomActions{flex-wrap:nowrap;max-width:none;gap:6px}
 .bottomActions button{min-width:52px;font-size:0;padding:9px}
 .bottomActions button::after{font-size:14px}
 .bottomActions [data-action=observe]::after{content:'观察'}
 .bottomActions [data-action=buddy]::after{content:'弟弟'}
 .bottomActions [data-action=interact]::after{content:'互动'}
 .bottomActions [data-action=hint]::after{content:'提示'}
}
@media(any-pointer:coarse) and (max-height:540px){
 .puzzleShell{inset:2% 2%;border-radius:18px}
 .boardWrap{width:58%}.puzzleInfo{width:42%;padding:40px 10px 12px}
 .puzzleInfo h2{margin:4px 0}.puzzleInfo .row{margin:6px 0}
 .puzzleInfo button{min-height:44px;padding:7px 9px;font-size:12px}
 #touch button{min-width:46px;min-height:46px;margin:2px}
 .top{padding:4px;left:2%;right:2%;top:2%}.topActions button{min-width:44px;padding:7px 10px}
 .chapter{padding:7px 12px}.chapter strong{font-size:16px}
 .menuFoot>span{display:none}.menuFoot{justify-content:flex-end}
}
