html, body {
  margin: 0;
  padding: 0;
  background: #1a1a3a;
  overflow: hidden;
  touch-action: none;            /* no scroll/zoom while tapping */
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}

/* Pin the page to the visible screen so the browser's address bar
   can't push the game down. dvh = height that excludes browser bars. */
body {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
}

canvas {
  display: block;
  touch-action: none;
}

/* Used by main.js to read the notch / rounded-corner safe areas. */
#safe-probe {
  position: fixed;
  visibility: hidden;
  pointer-events: none;
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
}

/* "Rotate your phone" overlay: shown on touch devices held upright. */
#rotate {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10;
  background: #1a1a3a;
  color: #fff;
  font: 800 24px "Trebuchet MS", system-ui, sans-serif;
  text-align: center;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
}

#rotate .phone {
  width: 60px;
  height: 100px;
  border: 6px solid #ffcc00;
  border-radius: 12px;
  animation: turn 1.6s ease-in-out infinite;
}

@keyframes turn {
  0%, 25% { transform: rotate(0deg); }
  60%, 100% { transform: rotate(-90deg); }
}

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

/* Rotate prompt turned off in config.js (SHOW_ROTATE_PROMPT = false). */
body.no-rotate-prompt #rotate { display: none !important; }
body.no-rotate-prompt canvas { visibility: visible !important; }
