* {
  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 move the paddle,
   not scroll, pull-to-refresh, or rubber-band the page. position: fixed on
   body is the reliable iOS Safari overscroll kill; overscroll-behavior
   covers browsers that support it. */
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: #05070c;
  /* Keep the board clear of the iPhone 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 4:3 board in the viewport: cap by width AND height so
     landscape phones don't crop the bottom of the playfield. */
  width: min(100%, calc(100vh * 4 / 3));
  width: min(100%, calc(100dvh * 4 / 3));
  height: auto;
  aspect-ratio: 4 / 3;
  border-radius: 8px;
  box-shadow: 0 0 40px rgba(17, 138, 178, 0.25);
  cursor: none;
  touch-action: none; /* stop iOS scroll/zoom gestures fighting the game */
}

/* --- rotate-your-phone prompt (portrait phones only) --- */
.rotate-prompt {
  display: none;
}
@media (orientation: portrait) and (max-width: 700px) {
  .rotate-prompt {
    position: fixed;
    inset: 0;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 18px;
    background: rgba(10, 10, 12, 0.94);
  }
}
.rotate-prompt__phone {
  width: 34px;
  height: 58px;
  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;
  margin: 0;
}
@keyframes rotate-hint {
  0%, 15% { transform: rotate(0deg); }
  55%, 85% { transform: rotate(90deg); }
  100% { transform: rotate(0deg); }
}
