The viewport code hard sets blockly to fit perfectly in landscape. So when you turn portrait it stays the same width, which is wider than the screen. Thus `width: 100%` becomes bigger than the screen. `window.innerWidth` is exactly the viewable window, so the image is the right size.