@import url("https://fonts.googleapis.com/css2?family=Montserrat:wght@400;700&display=swap");

:root {
  background: #fdfff5;
  font-family: "Montserrat", sans-serif;
  font-size: 14px;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  padding: 0;
  margin: 0;
}

h1 {
  margin-bottom: 0;
}

a {
  color: inherit;
}

main {
  display: grid;
  justify-content: center;
  justify-items: center;
  max-width: 700px;
  margin: 0 auto;
  text-align: justify;
}

body {
  display: grid;
  --body-margin: 16px;
  margin: 0 var(--body-margin);
  padding: var(--body-margin) 0;
  justify-items: center;
  grid-template-rows: auto 1fr;
}

canvas {
  max-height: 100%;
  min-height: 400px;
  padding: 10px 0 20px 0;
}

form {
  display: grid;
  grid-auto-flow: column;
  gap: 20px;
}

button {
  width: 50px;
}

input[type="number"] {
  width: 60px;
  margin-left: 10px;
}

table {
  text-align: center;
  margin: 10px 0;
}

td,
th {
  padding: 0 10px;
}

th {
  font-weight: inherit;
}

@media (max-width: 600px) {
  canvas {
    min-height: auto;
    max-width: calc(95vw - var(--body-margin));
    margin: 0 auto;
  }

  form {
    grid-auto-flow: row;
    gap: 8px;
  }

  button {
    width: 100%;
  }

  html,
  body {
    height: auto;
  }
}
