html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #1b1530;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: none;
  overscroll-behavior: none;
}

#game {
  width: 100vw;
  height: 100vh;
  /* the game is fitted inside the safe area (a notch, rounded corners, a home bar), so no HUD element is ever cut by them */
  box-sizing: border-box;
  padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
}

canvas {
  display: block;
  /* the game handles every touch itself: no browser pan, zoom or long-press menu on the canvas */
  touch-action: none;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

/* the game is landscape only: an upright phone or small tablet sees a friendly note instead of a tiny letterboxed game */
#rotate {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2147482000;
  background: #1b1530;
  color: #f6f8ee;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 24px;
  box-sizing: border-box;
  text-align: center;
  font: 700 clamp(24px, 6vw, 40px) / 1.15 ui-rounded, 'Arial Rounded MT Bold', system-ui, sans-serif;
}
#rotate small {
  font-size: clamp(16px, 3.4vw, 22px);
  font-weight: 400;
  opacity: 0.8;
}
.rotate-phone {
  width: 44px;
  height: 78px;
  border: 5px solid #ffc857;
  border-radius: 10px;
  animation: rotate-turn 2.6s ease-in-out infinite;
}
@keyframes rotate-turn {
  0%, 25% { transform: rotate(0deg); }
  60%, 100% { transform: rotate(-90deg); }
}
@media (prefers-reduced-motion: reduce) {
  .rotate-phone { animation: none; transform: rotate(-90deg); }
}
@media (orientation: portrait) and (max-width: 900px) {
  #rotate { display: flex; }
}
