* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: #13282b;
  color: #e8f0d0;
  font: 14px monospace;
  min-height: 100vh;
  display: grid;
  place-items: center;
}
main {
  width: min(960px, 100%);
  padding: 20px;
}
header {
  display: flex;
  justify-content: space-between;
  padding: 14px 0;
  color: #b5d7a1;
}
#screen {
  position: relative;
  width: 720px;
  height: 480px;
  margin: auto;
  box-shadow:
    0 0 0 8px #416961,
    0 0 0 12px #0a181c;
  background: #406850;
}
canvas {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  outline: 0;
}
footer {
  text-align: center;
  padding: 28px 0 0;
  font-size: 12px;
  color: #abc1ac;
}
#note {
  text-align: center;
  font-size: 12px;
  color: #819f95;
}
#overlay {
  position: absolute;
  inset: 0;
  background: #11283399;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 12px;
  gap: 10px;
}
#overlay[hidden],
#dialog[hidden] {
  display: none;
}
nav,
section,
#dialog {
  background: #f8f8d8;
  color: #283840;
  border: 4px double #486080;
  box-shadow: 0 0 0 3px #f8f8d8;
  border-radius: 4px;
  padding: 12px;
}
nav {
  display: grid;
  gap: 2px;
  min-width: 155px;
}
button {
  font: inherit;
  color: inherit;
  border: 0;
  background: transparent;
  padding: 9px;
  text-align: left;
  cursor: pointer;
}
button:hover,
button:focus {
  background: #b8d8d0;
  outline: 0;
}
section:empty {
  display: none;
}
section {
  max-width: 65%;
  max-height: 90%;
  overflow: auto;
}
#dialog {
  position: absolute;
  bottom: 12px;
  left: 12px;
  right: 12px;
  min-height: 75px;
  white-space: pre-line;
}
h2 {
  font-size: 16px;
}
@media (max-width: 760px) {
  #screen {
    width: 480px;
    height: 320px;
  }
  main {
    padding: 16px;
  }
}
@media (max-width: 510px) {
  #screen {
    width: 240px;
    height: 160px;
  }
  header {
    display: block;
    font-size: 11px;
  }
  footer {
    line-height: 1.8;
  }
  #overlay {
    font-size: 9px;
    padding: 5px;
  }
  nav {
    min-width: 95px;
    padding: 3px;
  }
  button {
    padding: 3px;
  }
  #dialog {
    font-size: 10px;
    padding: 5px;
    min-height: 45px;
  }
}
