unity web builds are reaaally hard to get right. i found this tool recently and it's amazing. you import it into your assets folder and it helps combat viewport scaling issues like you had in this game. it helps a lot!
https://seansleblanc.itch.io/better-minimal-webgl-template