/* RAMZ-PAD v1.0 - from Pixel Hero v2.1. Drop-in touch layout for Ramz-AI-Studio games.
   Requires <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no,viewport-fit=cover"> */
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent;-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}
html,body{margin:0;height:100%;overflow:hidden;touch-action:none;background:#0e1626}
html{--sl:max(env(safe-area-inset-left),12px);--sr:max(env(safe-area-inset-right),12px);--st:max(env(safe-area-inset-top),8px);--sb:max(env(safe-area-inset-bottom),24px)}
body.native{--sl:max(env(safe-area-inset-left),28px);--sr:max(env(safe-area-inset-right),28px);--sb:max(env(safe-area-inset-bottom),28px)}
#app,#stage{position:fixed;inset:0;overflow:hidden}
canvas#c{position:absolute;inset:0;display:block;width:100%;height:100%}
/* control strip: overlays the world, never reserves space */
#rp{display:none;position:absolute;bottom:var(--sb);left:var(--sl);right:var(--sr);height:112px;align-items:flex-end;justify-content:space-between;pointer-events:none;z-index:6}
body.touch #rp{display:flex}
.rp-btn{pointer-events:auto;width:56px;height:56px;border-radius:50%;border:1.5px solid #ffffff88;background:#13233a44;color:#fff;font-size:26px;display:flex;align-items:center;justify-content:center;touch-action:none;font-family:inherit}
.rp-btn.on{background:#ffca2888;border-color:#ffe082}
#rp-dpad{display:grid;grid-template-columns:56px 96px;gap:8px 12px}
#rp-right{width:96px;height:96px;margin-top:-40px;font-size:30px;grid-area:1/2}   /* forward = same size as jump */
#rp-left{grid-area:1/1}
#rp-down{grid-area:2/1/3/3;justify-self:center}
#rp-acts{position:relative;width:162px;height:96px}
#rp-acts .rp-btn{position:absolute}
#rp-jump{width:96px;height:96px;right:0;bottom:0;font-size:16px;font-weight:700;background:#783c4244}
#rp-bomb{width:62px;height:62px;right:100px;bottom:54px;font-size:13px;font-weight:700;background:#69462444} /* diagonal up-left of jump */
/* HUD + pause/mute */
#rp-hud{position:absolute;top:var(--st);left:var(--sl);right:calc(var(--sr) + 90px);min-height:30px;display:flex;align-items:center;gap:14px;font:bold 14px monospace;color:#fff;text-shadow:1px 2px #000;z-index:5;white-space:nowrap}
#rp-top{position:absolute;top:var(--st);right:var(--sr);display:flex;gap:6px;z-index:5}   /* pause, then mute */
.rp-tb{width:34px;height:32px;border-radius:9px;border:1px solid #ffffff77;background:#0e162699;color:#fff;font-size:16px;display:flex;align-items:center;justify-content:center}
/* portrait */
@media(orientation:portrait){
 body.native{--sl:max(env(safe-area-inset-left),8px);--sr:max(env(safe-area-inset-right),8px)}
 #rp{height:126px}.rp-btn{width:62px;height:62px}
 #rp-dpad{grid-template-columns:62px 104px;column-gap:6px}
 #rp-right{width:104px;height:104px;margin-top:-42px}
 #rp-acts{width:174px;height:104px}
 #rp-jump{width:104px;height:104px;font-size:17px}
 #rp-bomb{width:66px;height:66px;right:108px;bottom:58px;font-size:14px}
 #rp-hud{gap:8px;font-size:11px;flex-wrap:wrap;right:calc(var(--sr) + 80px)}
}
/* narrow portrait (<393px wide) */
@media(orientation:portrait) and (max-width:392px){
 #rp-dpad{grid-template-columns:62px 92px;column-gap:4px}
 #rp-right{width:92px;height:92px;margin-top:-30px}
 #rp-acts{width:154px}
 #rp-jump{width:92px;height:92px}
 #rp-bomb{width:58px;height:58px;right:96px}
}
