* { margin: 0; padding: 0; box-sizing: border-box; }

/* Lock the page against iOS touch gestures everywhere, not just on the
   canvas: a drag that starts in the letterbox margin must steer the ship,
   not scroll, pull-to-refresh, zoom, or rubber-band the page. position:
   fixed on body is the reliable iOS Safari overscroll kill. (Carried over
   from the Brick Break / Maze Muncher iPhone passes.) */
html,
body {
  height: 100%;
  overflow: hidden;
  touch-action: none;
  overscroll-behavior: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none; /* no long-press magnifier/callout */
  -webkit-tap-highlight-color: transparent;
}

body {
  position: fixed;
  inset: 0;
  min-height: 100vh;
  min-height: 100dvh; /* iOS: track the real viewport as the URL bar hides */
  display: flex;
  align-items: center;
  justify-content: center;
  background: #05060d;
  /* Keep the board clear of the notch/home bar (viewport-fit=cover) */
  padding: env(safe-area-inset-top) env(safe-area-inset-right)
    env(safe-area-inset-bottom) env(safe-area-inset-left);
}

canvas {
  /* Fit the whole 3:4 portrait board: cap by width AND height so short
     viewports (iPad landscape, desktop) don't crop the player's lane. */
  width: min(100%, calc(100vh * 3 / 4));
  width: min(100%, calc(100dvh * 3 / 4));
  height: auto;
  aspect-ratio: 3 / 4;
  display: block;
  background: #05060d;
  touch-action: none;
}

/* --- rotate-your-phone prompt (landscape phones only) --- */
.rotate-prompt { display: none; }
@media (orientation: landscape) and (max-height: 500px) {
  .rotate-prompt {
    position: fixed;
    inset: 0;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 18px;
    background: rgba(5, 6, 13, 0.94);
  }
}
.rotate-prompt__phone {
  width: 58px;
  height: 34px;
  border: 3px solid #dbe4ff;
  border-radius: 7px;
  animation: rotate-hint 1.8s ease-in-out infinite;
}
.rotate-prompt__text {
  color: #dbe4ff;
  font: 500 14px/1.4 ui-monospace, Menlo, monospace;
  letter-spacing: 0.06em;
}
@keyframes rotate-hint {
  0%, 15% { transform: rotate(0deg); }
  55%, 85% { transform: rotate(-90deg); }
  100% { transform: rotate(0deg); }
}
