html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #181425;
  overscroll-behavior: none;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
}
#game {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background: #181425;
}
#screen {
  position: fixed;
  left: 0;
  top: 0;
  display: block;
  background: #181425;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
  image-rendering: pixelated;
  touch-action: none;
  pointer-events: none;
  outline: none;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
noscript p {
  position: fixed; inset: 0; margin: 0; display: grid; place-items: center;
  color: #c0cbdc; font: 16px monospace; background: #181425;
}

/* Rotate screen: touch device in portrait. */
#rotate {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10;
  background: #181425;
  color: #ead4aa;
  font: bold 18px/1.4 ui-monospace, Menlo, Consolas, monospace;
  letter-spacing: 2px;
  text-align: center;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 28px;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
@media (pointer: coarse) and (orientation: portrait) {
  #rotate { display: flex; }
}
html.portrait-blocked #rotate { display: flex; }
#rotate svg {
  width: 96px;
  height: 96px;
  image-rendering: pixelated;
  shape-rendering: crispEdges;
  animation: rot-turn 2.4s steps(12, end) infinite;
}
#rotate p { margin: 0; text-shadow: 2px 2px 0 #3e2731; }
#rotate small { display: block; margin-top: 8px; font-size: 12px; letter-spacing: 1px; color: #8b9bb4; }
@keyframes rot-turn {
  0%, 15% { transform: rotate(0deg); }
  55%, 85% { transform: rotate(-90deg); }
  100% { transform: rotate(-90deg); }
}
@media (prefers-reduced-motion: reduce) {
  #rotate svg { animation: none; transform: rotate(-90deg); }
}
