html,body{margin:0;height:100%;overflow:hidden;background:#9cc7ee;font-family:system-ui,sans-serif;touch-action:none;user-select:none;-webkit-user-select:none}
canvas{display:block;touch-action:none}
#hud{position:fixed;top:calc(env(safe-area-inset-top,0px) + 10px);left:12px;right:12px;color:#fff;text-shadow:0 1px 3px #000;font-size:13px;pointer-events:none;display:flex;justify-content:space-between;gap:12px}
#spd{font-size:22px;font-weight:700}
#hint{position:fixed;bottom:44%;width:100%;text-align:center;color:#fff;text-shadow:0 1px 4px #000;font-size:16px;font-weight:600;pointer-events:none}
#joy{position:fixed;left:22px;bottom:calc(env(safe-area-inset-bottom,0px) + 28px);width:120px;height:120px;border-radius:50%;background:rgba(255,255,255,.18);border:2px solid rgba(255,255,255,.45);display:none;touch-action:none}
#knob{position:absolute;left:40px;top:40px;width:40px;height:40px;border-radius:50%;background:rgba(255,255,255,.75)}
.btn{position:fixed;right:20px;width:70px;height:70px;border-radius:50%;background:rgba(0,0,0,.45);color:#fff;border:2px solid rgba(255,255,255,.5);display:none;align-items:center;justify-content:center;font-weight:700;font-size:13px;touch-action:none}
#bE{bottom:calc(env(safe-area-inset-bottom,0px) + 112px)}
#bR{bottom:calc(env(safe-area-inset-bottom,0px) + 30px)}
.chip{background:rgba(15,20,30,.45);backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px);border:1px solid rgba(255,255,255,.2);border-radius:999px;padding:6px 12px;color:#fff;font-size:12px;text-shadow:none}
#hud{align-items:flex-start}
#mode{opacity:.75;margin-left:6px}
#mm{width:100px;height:100px;border-radius:50%;border:2px solid rgba(255,255,255,.6);box-shadow:0 2px 10px rgba(0,0,0,.4)}
#help{position:fixed;left:12px;bottom:12px}
body.touch #help{display:none}
#spdbox{position:fixed;right:12px;top:calc(env(safe-area-inset-top,0px) + 124px);display:none;flex-direction:column;align-items:center;padding:6px 16px;border-radius:14px;pointer-events:none}
#spdbox small{font-size:10px;opacity:.7}
body.car #spdbox{display:flex}
#ui{position:fixed;left:0;right:0;bottom:env(safe-area-inset-bottom,0px);height:240px;pointer-events:none}
#ui #joy{position:absolute;left:20px;bottom:36px;display:none;pointer-events:auto}
body.touch.foot #ui #joy{display:block}
#ui .btn{position:absolute;right:auto;display:none;flex-direction:column;pointer-events:auto;background:rgba(15,20,30,.42);backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px);border:2px solid rgba(255,255,255,.45);font-size:11px;font-weight:700;letter-spacing:.5px;line-height:1.1;box-shadow:0 3px 12px rgba(0,0,0,.35);transition:transform .08s,background .08s}
#ui .btn span{font-size:24px}
#ui .btn.on{transform:scale(.92);background:rgba(255,255,255,.35)}
body.touch.foot #ui .f,body.touch.car #ui .c{display:flex}
#ui #bE{display:none;background:rgba(40,180,90,.75)}
body.touch.foot #ui #bE.show{display:flex;animation:pl 1s infinite}
@keyframes pl{50%{transform:scale(1.08)}}
#ui #bRun{right:16px;bottom:30px;width:90px;height:90px}
#ui #bJump{right:116px;bottom:24px;width:62px;height:62px}
#ui #bE{right:20px;bottom:136px;width:74px;height:74px}
#ui #bSl{left:14px;bottom:36px;width:78px;height:78px}
#ui #bSr{left:102px;bottom:36px;width:78px;height:78px}
#ui #bGas{right:16px;bottom:30px;width:92px;height:92px;background:rgba(40,160,80,.6)}
#ui #bRev{right:116px;bottom:28px;width:56px;height:56px}
#ui #bBrk{right:116px;bottom:96px;width:64px;height:64px;background:rgba(200,50,50,.6)}
#ui #bX{right:16px;bottom:150px;width:58px;height:58px}
#ui #bX.dim{opacity:.4}
#fsw{pointer-events:auto;font-size:18px;display:flex;gap:16px;padding:4px 14px}
#fs,#rb,#sn{cursor:pointer}
body.rot{position:fixed;top:0;transform:rotate(90deg);transform-origin:0 0;margin:0}
body.rot #hud{top:10px;left:12px;right:12px}
body.rot #ui{bottom:0;left:0;right:0;height:190px}
body.rot #mm{width:78px;height:78px}
body.rot #spdbox{top:100px;right:12px}
body.rot #hint{bottom:30%}
body.rot #ui #joy{left:28px;bottom:20px}
body.rot #ui #bRun{right:16px;bottom:16px;width:76px;height:76px}
body.rot #ui #bJump{right:100px;bottom:14px;width:54px;height:54px}
body.rot #ui #bE{right:24px;bottom:104px;width:64px;height:64px}
body.rot #ui #bSl{left:20px;bottom:20px;width:66px;height:66px}
body.rot #ui #bSr{left:94px;bottom:20px;width:66px;height:66px}
body.rot #ui #bGas{right:16px;bottom:16px;width:80px;height:80px}
body.rot #ui #bRev{right:104px;bottom:14px;width:50px;height:50px}
body.rot #ui #bBrk{right:104px;bottom:72px;width:56px;height:56px}
body.rot #ui #bX{right:16px;bottom:108px;width:50px;height:50px}
body.rot #ui .btn span{font-size:20px}
#hud{left:calc(env(safe-area-inset-left,0px) + 12px);right:calc(env(safe-area-inset-right,0px) + 12px)}
#ui{left:env(safe-area-inset-left,0px);right:env(safe-area-inset-right,0px)}
@media (orientation:landscape) and (max-height:520px){
#mm{width:78px;height:78px}
#spdbox{top:calc(env(safe-area-inset-top,0px) + 100px)}
#hint{bottom:30%}
#ui{height:190px}
#ui #joy{left:28px;bottom:20px}
#ui #bRun{right:16px;bottom:16px;width:76px;height:76px}
#ui #bJump{right:100px;bottom:14px;width:54px;height:54px}
#ui #bE{right:24px;bottom:104px;width:64px;height:64px}
#ui #bSl{left:20px;bottom:20px;width:66px;height:66px}
#ui #bSr{left:94px;bottom:20px;width:66px;height:66px}
#ui #bGas{right:16px;bottom:16px;width:80px;height:80px}
#ui #bRev{right:104px;bottom:14px;width:50px;height:50px}
#ui #bBrk{right:104px;bottom:72px;width:56px;height:56px}
#ui #bX{right:16px;bottom:108px;width:50px;height:50px}
#ui .btn span{font-size:20px}
}
#acc{position:fixed;top:28%;width:100%;text-align:center;color:#ff4a3d;font:800 34px system-ui,sans-serif;text-shadow:0 2px 8px #000;pointer-events:none;opacity:0;transition:opacity .4s}
#hpb{position:fixed;left:calc(env(safe-area-inset-left,0px) + 12px);top:calc(env(safe-area-inset-top,0px) + 46px);width:120px;height:8px;border-radius:5px;background:rgba(0,0,0,.45);border:1px solid rgba(255,255,255,.3);overflow:hidden;pointer-events:none}
#hpb i{display:block;height:100%;width:100%;background:#e0453a;transition:width .15s}
body.rot #hpb{top:46px;left:12px}
#ui #bAtk{right:116px;bottom:26px;width:72px;height:72px;background:rgba(200,60,50,.6)}
@media (orientation:landscape) and (max-height:520px){#ui #bAtk{right:100px;bottom:14px;width:58px;height:58px}}
body.rot #ui #bAtk{right:100px;bottom:14px;width:58px;height:58px}
