main {
  padding: 1em;
  display: flex;
  flex-direction: column;
  gap: 1em;
  /* main is the scroll container (html/body form a fixed shell), so the
     pre-game page must scroll here on small devices */
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* Center on roomy screens without the flex margin:auto overflow trap that
   clips content on short viewports — use safe centering instead. */
.main-free,
.main-bordered {
  margin-top: auto;
  margin-bottom: auto;
}

@media (max-height: 40em) {
  .main-free,
  .main-bordered {
    margin-top: 0;
    margin-bottom: 0;
  }
}

.main-bordered {
  border: 0.2em solid var(--secondary);
  border-radius: 0.5em;
  padding: 1em;
}

.main-bordered > .link {
  display: block;
  padding: 0.5em;
}

.main-bordered > .link:hover {
  color: var(--tertiary);
}

/* MEDIA QUERIES */

/* regular css for mobile and tablet portrait */

/* landscape */
@media screen and (orientation: landscape) and (min-width: 37.5em),
  /* mobile-landscape-max */ screen and (min-width: 56.25em) {
  /* tablet-landscape-min */
  main {
    flex-direction: row;
  }

  .main-free {
    flex: 2;
    padding-left: calc(100% * 0.1);
    padding-right: calc(100% * 0.1);
  }

  .main-bordered {
    flex: 1;
  }
}
