html, body {
  margin: 0;
  min-height: 100%;
  background: #140e0a;
  color: #f8e0b0;
  font-family: "Courier New", Courier, monospace;
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
}

main {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 16px;
}

#crt {
  position: relative;
  padding: 18px;
  background: #2a2118;
  border: 4px solid #4a3b2a;
  box-shadow: 0 0 0 8px #100c08, 0 18px 40px rgba(0, 0, 0, 0.45);
}

canvas {
  display: block;
  width: min(768px, calc(100vw - 72px));
  height: auto;
  aspect-ratio: 256 / 240;
  background: #001858;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.scan {
  position: absolute;
  left: 18px;
  right: 18px;
  top: 18px;
  bottom: 18px;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.14) 0 1px,
    rgba(0, 0, 0, 0) 1px 3px
  );
}

.help {
  margin: 0;
  font-size: 13px;
  text-align: center;
}

#pad {
  display: none;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

#pad button {
  min-width: 72px;
  min-height: 48px;
  border: 3px solid #f8d878;
  background: #001858;
  color: #fcfcfc;
  font-family: inherit;
  font-weight: 700;
  letter-spacing: 0.04em;
}

@media (pointer: coarse), (max-width: 800px) {
  #pad {
    display: flex;
  }
}

html.embed,
html.embed body {
  height: 100%;
  background: #000;
}

html.embed main {
  width: 100%;
  height: 100%;
  padding: 0;
  gap: 0;
}

html.embed .help,
html.embed #pad,
html.embed .scan {
  display: none;
}

html.embed #crt {
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  box-shadow: none;
  background: #000;
}

html.embed canvas {
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
}
