/* Gameplay owns two-thumb gestures. Menus, pause and the portfolio keep pinch zoom.
   The stage ancestor also covers contacts on different controls without a viewport lock. */
.kg-runner[open][data-game-controls="active"] .kg-stage,
.kg-runner[open][data-game-controls="active"] .kg-stage *{touch-action:none}

/* Touch-only fight layout: movement on the left, four actions in a spaced diamond.
   Mouse/trackpad desktop layouts and the runner's three-action layout are unchanged. */
@media (hover:none) and (pointer:coarse){
 .kg-runner[data-boss]:not([data-boss=""]) .kg-stage{--kg-touch-size:48px;--kg-touch-gap:12px}
 .kg-runner[data-boss]:not([data-boss=""]) .kg-stage .kg-controls{
  display:grid;left:12px;right:12px;bottom:max(12px,env(safe-area-inset-bottom));
  grid-template-columns:minmax(0,1fr) repeat(3,var(--kg-touch-size));
  grid-template-rows:repeat(3,var(--kg-touch-size));gap:var(--kg-touch-gap);
  align-items:center;justify-content:normal;
 }
 .kg-runner[data-boss]:not([data-boss=""]) .kg-controls :is(.kg-jump,.kg-slam,.kg-fire,.kg-melee){
  width:var(--kg-touch-size);height:var(--kg-touch-size);min-width:44px;min-height:44px;max-width:none;margin:0;
 }
 .kg-runner[data-boss]:not([data-boss=""]) .kg-jump{grid-column:3;grid-row:1}
 .kg-runner[data-boss]:not([data-boss=""]) .kg-melee{grid-column:2;grid-row:2}
 .kg-runner[data-boss]:not([data-boss=""]) .kg-fire{grid-column:4;grid-row:2}
 .kg-runner[data-boss]:not([data-boss=""]) .kg-slam{grid-column:3;grid-row:3}
 .kg-runner[data-boss]:not([data-boss=""]) .kg-controls .kg-pause{
  position:static;grid-column:1;grid-row:2;justify-self:start;align-self:center;order:0;
  min-width:44px;min-height:44px;margin:0;padding:8px;
 }
 .kg-runner[data-boss]:not([data-boss=""]) .kg-move{left:12px;bottom:max(12px,env(safe-area-inset-bottom));gap:var(--kg-touch-gap)}
 .kg-runner[data-boss]:not([data-boss=""]) .kg-move button{width:var(--kg-touch-size);height:var(--kg-touch-size);min-width:44px;min-height:44px}
 .kg-runner[data-boss]:not([data-boss=""]) :is(.kg-jump-icon,.kg-slam-icon,.kg-fire-icon){width:40px;height:40px}
 .kg-runner[data-boss]:not([data-boss=""]) :is(.kg-jump-label,.kg-slam-label){font-size:7px;bottom:4px}
 .kg-runner[data-boss]:not([data-boss=""]) .kg-melee b{font-size:22px}
 .kg-runner[data-boss]:not([data-boss=""]) .kg-melee span{font-size:8px}
 .kg-runner[data-boss]:not([data-boss=""]) .kg-stage .kg-guide{
  left:12px;right:12px;max-width:none;text-align:center;
  bottom:calc(max(12px,env(safe-area-inset-bottom)) + 3*var(--kg-touch-size) + 2*var(--kg-touch-gap) + 12px);
 }
}
@media (hover:none) and (pointer:coarse) and (max-height:500px) and (orientation:landscape){
 .kg-runner[data-boss]:not([data-boss=""]) .kg-stage{--kg-touch-size:44px;--kg-touch-gap:10px}
}
