add the following to styles.css for portrait mode
@media (orientation: portrait) {
  #main {
    flex-direction:column;
  }
  #buttons {
    flex-direction:row;
    justify-content: center;
    flex-wrap:wrap;
    margin: 0;
    margin-top:2vmin;
  }
}