/*
 * Leo's Corner — shared base styles for every page.
 * Locks the page down so little fingers can't zoom, scroll, select text,
 * or trigger long-press menus. Games should build on top of this.
 */

:root {
  --sky: #7fd4ff;
  --sun: #ffd23f;
  --berry: #ff5d8f;
  --grape: #9b5de5;
  --leaf: #3ddc84;
  --tang: #ff9f1c;
  --ocean: #2f80ed;
  --cream: #fff8e7;
  --ink: #3a2e5c;

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);

  --font: "Fredoka", "Baloo 2", ui-rounded, "Arial Rounded MT Bold", system-ui, sans-serif;
}

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

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  position: fixed;
  inset: 0;
}

body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--sky);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
}

img,
svg,
canvas {
  -webkit-user-drag: none;
  user-select: none;
  display: block;
}

button {
  font: inherit;
  color: inherit;
  border: 0;
  background: none;
  padding: 0;
  cursor: pointer;
  touch-action: none;
}

/* Full-viewport stage that respects notches / home indicator. */
.stage {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  overflow: hidden;
}

/* ---------- Hold-to-exit home button (see toddler.js: mountHomeButton) ---------- */
.home-btn {
  position: fixed;
  top: calc(12px + var(--safe-top));
  left: calc(12px + var(--safe-left));
  z-index: 1000;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.55);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
  display: grid;
  place-items: center;
  font-size: 28px;
  line-height: 1;
  opacity: 0.7;
  transition: transform 0.15s ease, opacity 0.15s ease;
}
.home-btn.holding {
  transform: scale(1.12);
  opacity: 1;
}
.home-btn svg.ring {
  position: absolute;
  inset: -4px;
  width: 64px;
  height: 64px;
  transform: rotate(-90deg);
  pointer-events: none;
}
.home-btn svg.ring circle {
  fill: none;
  stroke: var(--berry);
  stroke-width: 6;
  stroke-linecap: round;
  stroke-dasharray: 188.5;
  stroke-dashoffset: 188.5;
}
.home-btn.holding svg.ring circle {
  transition: stroke-dashoffset var(--hold-ms, 900ms) linear;
  stroke-dashoffset: 0;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
