html,
body {
  background: #ddd;
  margin: 0;
  font-family: Arial, sans-serif;
  height: 100%;
  display: flex;
  flex-direction: column;
}
#cvs.pixelated {
  image-rendering: optimizeSpeed;
  image-rendering: -moz-crisp-edges;
  image-rendering: -o-crisp-edges;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: optimize-contrast;
  image-rendering: crisp-edges;
  image-rendering: pixelated;
  -ms-interpolation-mode: nearest-neighbor;
}
#code {
  height: 20em;
  flex-basis: 100%;
  font-family: monospace;
}
#controls {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
}
#controls > * {
  flex-grow: 1;
}
#log {
  margin: 0;
  flex-basis: 100%;
}
#log:not(:empty) {
  /* border: 1px solid red; */
  margin: 1em 0;
  padding: 0.5em;
}
a {
  color: #007;
}
footer {
  text-align: center;
}

.button {
  border: 1px solid black;
  background: linear-gradient(to bottom, #eee, #ccc);
  border-radius: 2px;
  margin: 0.1em;
  padding: 0.5em 1em;
  text-align: center;
  text-decoration: none;
  color: black;
  font-size: 1em;
}
.button[disabled] {
  color: #888;
}
.button:active {
  background: linear-gradient(to bottom, #ccc, #eee);
}

body.text {
  padding: 1em;
  max-width: 76ch;
  margin: 0 auto;
}

#output {
  position: relative;
  flex-grow: 1;
}

#zoom {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
}
#output footer {
  position: absolute;
  bottom: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.8);
  padding: 0.1em;
  display: flex;
  flex-direction: column;
}

/* pinch zoom stuff */
pinch-zoom {
  display: block;
  overflow: hidden;
  touch-action: none;
  --scale: 1;
  --x: 0;
  --y: 0;
}

pinch-zoom > * {
  transform: translate(var(--x), var(--y)) scale(var(--scale));
  transform-origin: 0 0;
  will-change: transform;
}
