:root {
  color-scheme: light;
  --ink: #22272c;
  --paper: #f7f6ef;
  --rim: #2f3438;
  --shadow: rgba(29, 31, 33, 0.18);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
}

body {
  margin: 0;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(40, 125, 125, 0.18), transparent 38%),
    linear-gradient(315deg, rgba(194, 90, 60, 0.18), transparent 36%),
    #eef1ed;
  color: var(--ink);
  font-family: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

.app {
  display: grid;
  min-height: 100dvh;
  place-items: center;
}

.stage {
  --frame: clamp(3px, 0.7vmin, 7px);
  aspect-ratio: 16 / 9;
  width: min(100vw, calc(100dvh * 16 / 9));
  max-width: 100vw;
  max-height: 100dvh;
  background: var(--paper);
  outline: var(--frame) solid var(--rim);
  outline-offset: calc(var(--frame) * -1);
  box-shadow: 0 22px 70px var(--shadow);
  overflow: hidden;
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: pointer;
  image-rendering: pixelated;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

@media (orientation: portrait) {
  .stage {
    aspect-ratio: 9 / 16;
    width: min(100vw, calc(100dvh * 9 / 16));
  }
}
