After doing a lot of research, I found there was one single line missing in my script that immediately made mobile view work exactly as expected. Here is the line I was missing:
<meta name="viewport" content="width=device-width"width, initial-scale="1scale=1.0"/>
Source: https://developer.mozilla.org/en-US/docs/Mozilla/Mobile/Viewport_meta_tag