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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #0a0a12;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

canvas#game {
  display: block;
  width: 100vw;
  height: 100vh;
  width: calc(100dvw - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px));
  height: calc(100dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
  margin-top: env(safe-area-inset-top, 0px);
  margin-left: env(safe-area-inset-left, 0px);
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: -webkit-crisp-edges;
  cursor: crosshair;
}

/* --- Start overlay --- */
#start-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
}

#start-overlay.hidden {
  display: none;
}

#start-text {
  color: #6a8a5a;
  font-family: monospace;
  font-size: 14px;
  letter-spacing: 4px;
  text-transform: lowercase;
  animation: pulse 2s ease-in-out infinite;
}

/* --- Rotate prompt --- */
#rotate-prompt {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #0a0a12;
  z-index: 20;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

#rotate-prompt.visible {
  display: flex;
}

#rotate-icon {
  font-size: 48px;
  color: #4a6a4a;
  animation: rock 2s ease-in-out infinite;
}

#rotate-text {
  color: #4a6a4a;
  font-family: monospace;
  font-size: 13px;
  letter-spacing: 3px;
  text-transform: lowercase;
}

/* Hide canvas when rotate prompt is showing (controlled by JS) */
body.show-rotate canvas#game,
body.show-rotate #start-overlay {
  display: none;
}

@keyframes pulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

@keyframes rock {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(25deg); }
  75% { transform: rotate(-25deg); }
}
