* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0; width: 100%; overflow: hidden; background: #050301;
  height: 100vh; height: 100dvh;            /* dvh: the real usable height once mobile browser UI bars settle */
  overscroll-behavior: none;                /* no pull-to-refresh */
  touch-action: none;                       /* no pinch-zoom or pan while the stage is active — gestures own the canvas */
}
body { font-family: ui-sans-serif, system-ui, "Segoe UI", sans-serif; color: #ffe3b0; -webkit-user-select: none; user-select: none; }

#stage { position: fixed; inset: 0; display: block; width: 100vw; height: 100vh; height: 100dvh; border: 0; outline: 0; touch-action: none; }
#cam { position: fixed; width: 2px; height: 2px; opacity: 0; pointer-events: none; }

@media (max-width: 600px), (orientation: portrait) {
  button.primary { padding: 15px 26px; font-size: 15px; min-height: 48px; }   /* a real touch target */
}
@supports (padding: max(0px)) {
  .start { padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); }
}

/* The start layer is just a centred button over a blurred, slightly darkened copy of the canvas. */
.start {
  position: fixed; inset: 0; z-index: 100;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  background: rgba(5, 3, 1, 0.35);
  -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
}
.start[hidden] { display: none; }
button.primary {
  font: inherit; font-weight: 600; font-size: 15px; letter-spacing: 0.03em;
  padding: 13px 26px; border-radius: 999px; border: 1px solid rgba(255, 178, 56, 0.55);
  background: linear-gradient(180deg, #ffb238, #d9700f); color: #1a0e02; cursor: pointer;
}
button.primary:hover { filter: brightness(1.08); }
button.primary:disabled { opacity: 0.6; cursor: progress; filter: none; }
.start-msg { margin: 0; min-height: 18px; font-size: 13px; color: #ffe3b0; text-shadow: 0 1px 6px rgba(0, 0, 0, 0.7); text-align: center; max-width: 80vw; }

.hint {
  position: fixed; left: 50%; bottom: max(8%, env(safe-area-inset-bottom)); z-index: 40;
  transform: translate(-50%, 8px); padding: 10px 18px; border-radius: 999px;
  font-size: 15px; letter-spacing: 0.02em; color: #ffe3b0; pointer-events: none;
  background: rgba(14, 8, 3, 0.66); border: 1px solid rgba(255, 178, 56, 0.28);
  opacity: 0; transition: opacity 0.35s ease, transform 0.35s ease;
}
.hint.show { opacity: 1; transform: translate(-50%, 0); }
