body {
  touch-action: manipulation;
}

#main {
  margin: 2vh 0;
}

#main > .term {
  display: block;
  margin: 0 auto;
  font-family: "IBM Plex Mono", monospace;
  font-optical-sizing: auto;
  font-weight: 400;
  font-style: normal;
  letter-spacing: 0;
  border: 1px dashed #777;
  background-color: #222;
  white-space: nowrap;
  overflow: hidden;
  box-shadow: 0px 0px 15px -5px rgba(0, 0, 0, 0.87);
  aspect-ratio: 1.3333;

  /* QVGA (320 x 240) */
  width: 320px;
  padding: 10px;
  font-size: 6.23px;
  line-height: 9.1px;
}

#main > .term > span {
  font-size: 100%;
}

.print {
  display: none;
}

/* Sizing for the terminal widget */
@media (min-width: 740px) and (min-height: 580px) {
  #main > .term {
    /* VGA (640 x 480) */
    width: 640px;
    padding: 10px;
    font-size: 12.8px;
    line-height: 19px;
  }
}

@media (min-width: 900px) and (min-height: 700px) {
  #main > .term {
    /* SVGA (800 x 600) */
    width: 800px;
    padding: 10px;
    font-size: 16.1px;
    line-height: 24px;
  }
}

@media (min-width: 1124px) and (min-height: 868px) {
  #main > .term {
    /* XGA (1024 x 768) */
    width: 1024px;
    padding: 15px;
    font-size: 20.6px;
    line-height: 30.5px;
  }
}

@media (min-width: 1380px) and (min-height: 1060px) {
  #main > .term {
    /* QuadVGA (1280 x 960) */
    width: 1280px;
    padding: 20px;
    font-size: 25.7px;
    line-height: 38px;
  }
}

/* Media selector to format the print scratch space */
@media print {
  body {
    align-items: start !important;
    justify-content: left !important;
    min-height: auto !important;
  }
  .term {
    display: none !important;
  }
  .print {
    display: block;
    font-family: "IBM Plex Mono", monospace;
    font-optical-sizing: auto;
    font-weight: 400;
    font-style: normal;
    font-size: 10pt;
    line-height: 12pt;
    letter-spacing: 0;
    white-space: nowrap;
    overflow: hidden;
  }
  .print > .pagebreak {
    break-before: always;
    page-break-before: always;
  }
  .print > h1 {
    font-size: 14pt;
    line-height: 16pt;
    text-decoration: underline;
    padding: 0;
    margin: 0 0 8pt 0;
  }
  .print > .row {
    padding: 0;
    margin: 0;
  }
}

/*
 * Scale the input size up even if its invisible, so that selecting it doesn't
 * trigger a "zoom in" on mobile
 */
input {
  font-size: 24px;
}
