html,
body {
  margin: 0;
  height: 100%;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  overflow: hidden;
  background-color: #000;   /* the same black the canvas paints around the picture */
}

#picture {
  display: block;
  width: min(80vmin, 1024px);
  height: auto;
  aspect-ratio: 1;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

#stage {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  visibility: hidden;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

/* Set by js/main.js once the canvas shows exactly what the <img> shows. */
.handed-off #stage {
  visibility: visible;
}

.handed-off #picture {
  visibility: hidden;
}

/* ?stats overlay */
.stats {
  position: fixed;
  top: max(8px, env(safe-area-inset-top));
  left: max(8px, env(safe-area-inset-left));
  padding: 4px 8px;
  font: 12px/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: #fff;
  background: rgb(0 0 0 / 0.55);
  border-radius: 4px;
  pointer-events: none;
  white-space: pre;
}
