html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: #10131c;
  color: #8f9bb3;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
}

body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  /* dvh keeps the game on screen while a phone browser slides its bars away. */
  min-height: 100dvh;
  padding: env(safe-area-inset-top) env(safe-area-inset-right)
           env(safe-area-inset-bottom) env(safe-area-inset-left);
  box-sizing: border-box;
  touch-action: none;
}

#stage {
  position: relative;
  line-height: 0;
}

#screen {
  display: block;
  background: #79c9f0;
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
  box-shadow: 0 0 0 2px #2a3348, 0 18px 44px rgba(0, 0, 0, 0.55);
  touch-action: none;
}

#splash {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  line-height: 1.4;
  color: #d7e3f4;
  background: #10131c;
}

#footer {
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.02em;
  text-align: center;
}

#full {
  font: inherit;
  font-size: 13px;
  padding: 8px 18px;
  border: 0;
  border-radius: 999px;
  background: #2a3348;
  color: #d7e3f4;
}

/* A touch device gets no keyboard hints and no wasted space around the canvas:
   the on screen pad is drawn inside the game, so the canvas is the whole thing. */
@media (pointer: coarse) {
  #footer { display: none; }
}

@media (max-height: 420px) {
  #footer { display: none; }
}

/* Held in portrait, a 480 by 288 screen ends up postage stamp sized. Saying so is
   kinder than letting a small person squint at it. */
#rotate {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
  font-size: 16px;
  line-height: 1.5;
  color: #d7e3f4;
  background: #10131c;
  z-index: 10;
}

@media (pointer: coarse) and (orientation: portrait) {
  #rotate { display: flex; }
}
