When using scale, the content of output shifts

This is a python flask project, but I think the problem happens on the html code
I used scale on the code, which makes the output not too big and overflow the screen, however when I’m getting the result, parts still get overflown to top left corner, and the entire output shifts.
Basically the problem is output shifts to top left corner, part of content overflown and gone
Is there any way to fix it?

Repl link: