/* Touch overlays only. Pixel Blocks and desktop controls remain unchanged. */
.joystick-replaced{display:none!important}
.joystick-controls{position:absolute!important;display:none!important;margin:0!important;padding:0!important;min-height:0!important;border:0!important;background:transparent!important;z-index:15;pointer-events:none;box-sizing:border-box;touch-action:none;-webkit-user-select:none;user-select:none;-webkit-touch-callout:none;--stick-size:92px;--button-size:54px;--control-gap:7px;--edge:16px;}
.has-touch .joystick-controls{display:block!important}
.joystick-controls.joystick-inactive{display:none!important}
.joystick-controls .arcade-joystick{position:absolute!important;display:block!important;left:max(var(--edge),env(safe-area-inset-left));bottom:max(var(--edge),env(safe-area-inset-bottom));width:var(--stick-size);height:var(--stick-size);box-sizing:border-box;border:2px solid #d9f1f5;border-radius:50%;background:#a9d7df66;box-shadow:inset 0 0 0 6px #efffff20;opacity:.30;pointer-events:auto;touch-action:none;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none;}
.joystick-thumb{position:absolute;left:50%;top:50%;width:44%;height:44%;border-radius:50%;border:2px solid #eefefa;background:#c1eee5;transform:translate(-50%,-50%);pointer-events:none;box-sizing:border-box;}
.arcade-joystick.engaged{opacity:.65}
.joystick-controls .joystick-actions{position:absolute!important;display:grid!important;grid-template-columns:repeat(3,var(--button-size));grid-template-rows:repeat(3,var(--button-size));gap:var(--control-gap)!important;right:max(var(--edge),env(safe-area-inset-right));bottom:max(var(--edge),env(safe-area-inset-bottom));top:auto!important;transform:none!important;width:max-content;max-width:none!important;pointer-events:none;}
.joystick-controls .joystick-actions button{pointer-events:auto;touch-action:none;-webkit-user-select:none;user-select:none;-webkit-touch-callout:none;min-width:0!important;min-height:0!important;width:var(--button-size)!important;height:var(--button-size)!important;padding:3px!important;border:1px solid #e2f9fc!important;border-radius:50%!important;background:#214354!important;color:#fff!important;font:bold 10px Arial,sans-serif!important;box-shadow:inset 0 0 0 3px #d4f1f51a!important;text-shadow:none!important;opacity:.32;overflow-wrap:anywhere;}
.joystick-controls button:active,.joystick-controls button.held,.joystick-controls button.touch-active{opacity:.65!important;background:#588692!important;}
.joystick-controls.joystick-compact{--stick-size:76px;--button-size:46px;--control-gap:5px;--edge:12px;}
.joystick-controls.joystick-tiny{--stick-size:68px;--button-size:40px;--control-gap:4px;--edge:8px;}
.has-touch .joystick-screen{touch-action:none;-webkit-user-select:none;user-select:none;-webkit-touch-callout:none;}
.has-touch .joystick-screen:fullscreen{display:flex!important;align-items:center!important;justify-content:center!important;min-height:0!important;width:100%!important;height:100dvh!important;padding:0!important;aspect-ratio:auto!important;}
.has-touch .joystick-screen:fullscreen>canvas{position:static!important;width:100%!important;height:100%!important;max-width:100%!important;max-height:100%!important;min-height:0!important;object-fit:contain;}
.joystick-landscape-back{display:none}
html.joystick-landscape-active,html.joystick-landscape-active body{overflow:hidden!important;overscroll-behavior:none;}
.has-touch .cabinet.joystick-landscape{position:fixed!important;z-index:1000;top:var(--touch-view-top,0)!important;left:var(--touch-view-left,0)!important;width:var(--touch-view-width,100vw)!important;height:var(--touch-view-height,100dvh)!important;min-width:0!important;max-width:none!important;margin:0!important;padding:0!important;display:flex!important;flex-direction:column;border-radius:0!important;border:0!important;box-sizing:border-box;}
.joystick-landscape>.top,.joystick-landscape>.cabinet-top,.joystick-landscape>.bar:not(.foot):not(.bottom){display:flex!important;flex:0 0 24px!important;height:24px!important;min-height:0!important;padding:0 max(8px,env(safe-area-inset-right)) 0 max(8px,env(safe-area-inset-left))!important;gap:8px;font-size:8px!important;}
.joystick-landscape>.top button,.joystick-landscape>.cabinet-top button,.joystick-landscape>.bar button{padding:0 8px!important;font-size:18px!important;}
.joystick-landscape .joystick-landscape-back{display:block;color:#f5d58b;text-decoration:none;font:11px monospace;white-space:nowrap;}
.joystick-landscape>.screen{position:relative!important;display:flex!important;align-items:center!important;justify-content:center!important;flex:1 1 0!important;min-height:0!important;width:100%!important;height:auto!important;aspect-ratio:auto!important;overflow:hidden;background:#10222d;}
.joystick-landscape>.screen>canvas{position:static!important;display:block!important;width:100%!important;height:100%!important;max-width:100%!important;max-height:100%!important;min-height:0!important;aspect-ratio:auto!important;object-fit:contain!important;flex:0 1 auto;}
.joystick-landscape>.bottom,.joystick-landscape>.cabinet-bottom,.joystick-landscape>.foot{display:none!important;}
.joystick-landscape .screen>#modal,.joystick-landscape .screen>#bd-modal,.joystick-landscape .screen>#overlay{overflow:auto!important;justify-content:flex-start!important;padding:8px!important;}
.joystick-landscape .screen #modal h2,.joystick-landscape .screen #bd-modal h2{font-size:20px!important;margin:0!important;}
