:root {
  --sky-top: #6ec6ff;
  --sky-bottom: #b8ecff;
  --ink: #2a2350;
  --font: 'Baloo 2', 'Fredoka', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

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

html, body {
  height: 100%;
  width: 100%;
  overflow: hidden;
  background: #6ec6ff;
  font-family: var(--font);
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
  overscroll-behavior: none;
}

#stage {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
}

#game {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;   /* we handle pointer events ourselves */
  cursor: pointer;
}

.back-link {
  position: fixed;
  top: max(12px, env(safe-area-inset-top));
  left: max(12px, env(safe-area-inset-left));
  z-index: 50;
  font-family: var(--font);
  font-weight: 700;
  font-size: clamp(15px, 2.2vw, 19px);
  color: #fff;
  text-decoration: none;
  background: rgba(42, 35, 80, 0.32);
  padding: 8px 14px;
  border-radius: 999px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: transform .12s ease, background .12s ease;
}
.back-link:hover { background: rgba(42, 35, 80, 0.5); transform: translateY(-1px); }
.back-link:active { transform: scale(0.96); }

/* Shift the arcade fullscreen button left so it doesn't overlap the
   canvas-drawn mute button (circle at W-36, radius 26 => ~62px from right). */
.arcade-ui-fs {
  right: max(70px, calc(70px + env(safe-area-inset-right)));
}

/* Respect motion preferences for the only non-canvas transitions. */
@media (prefers-reduced-motion: reduce) {
  .back-link { transition: none; }
}
