html, body {
  margin: .5em;
  padding: 0;
  font-family: sans-serif;
}

:root {
  --dim: 30rem;
}

@media only screen and ((max-width: 30em) or (max-height: 30em)) {
  :root {
    --dim: 80vmin;
  }
}

#main {
  display: grid;
  gap: .5em;
}

@media only screen and (max-height: 30em) {
  #main {
    grid-template-rows: auto auto;
    grid-auto-flow: column;
  }
}

#entry-row {
  display: flex;
  width: var(--dim);
  gap: .5em;
  align-items: center;
}

#canvas-cont {
  position: relative;
}

#canvas-cont, img {
  width: var(--dim);
  height: var(--dim);
}

canvas {
  width: 100%;
  height: 100%;
}

#overlay {
  width: 100%;
  height: 100%;
  position: absolute;
  left: 0;
  top: 0;
  background: gray;
  text-align: center;
  line-height: var(--dim);
  font-size: calc(var(--dim) / 5);
}

label {
  display: block;
  white-space: nowrap;
}

input {
  flex: 1;
  min-width: 0pt;
  text-transform: uppercase;
  text-align: center;
  font: inherit;
  font-size: 150%;
  box-sizing: border-box;
}

input:invalid {
  background: #FF000010;
  box-shadow: 0px 0px 5px red;
}

#target-row {
  font-weight: bold;
}
