vanilla JS and canvas plus a hefty bit of technical help from Claude.

It seems you draw everything every frame onto the canvas? The result is quite GPU heavy, for your next game I would recommend looking into a graphic libary like pixijs, to make use of the webgl/webgpu .. then it would run smooth even on old mobile phones.

check out raylib, it should be amazing for this :)