@font-face {
  font-family: Fredoka;
  src: url("assets/fonts/fredoka-latin-wght-normal.woff2") format("woff2");
  font-weight: 300 700;
  font-display: swap;
}

@font-face {
  font-family: Nunito;
  src: url("assets/fonts/nunito-latin-wght-normal.woff2") format("woff2");
  font-weight: 200 1000;
  font-display: swap;
}

@font-face {
  font-family: "Luckiest Guy";
  src: url("assets/fonts/luckiest-guy-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}


:root {
  --sand: #f2d04a;
  --sand-dark: #dfb83c;
  --water: #2aa8a8;
  --water-deep: #1c7f84;
  --ink: #2a2438;
  --coral: #e24b3c;
  --sunflower: #ffe14a;
  --foam: #fff8ee;
  --kelp: #2f7a52;
  --sky-top: #4eb0ea;
  --sky: #2f96dc;
  --shadow: rgba(42, 36, 56, 0.22);
  --path-glow: var(--coral);
  --title-font: "Luckiest Guy", Fredoka, "Trebuchet MS", sans-serif;
  --nav-button-size: 4rem;
  --nav-inset: 0.7rem;
  --nav-gap: 0.5rem;
}

@media (max-width: 27rem), (max-height: 30rem) {
  :root {
    --nav-button-size: 3.5rem;
  }
}

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

html,
body {
  margin: 0;
  height: 100%;
  background: var(--sky);
  color: var(--ink);
  font-family: Nunito, "Trebuchet MS", sans-serif;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

#app,
.screen {
  height: 100%;
}

#app {
  height: 100dvh;
  padding: env(safe-area-inset-top) env(safe-area-inset-right)
    env(safe-area-inset-bottom) env(safe-area-inset-left);
}

.hidden {
  display: none !important;
}

.title-screen {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  background:
    linear-gradient(180deg, rgba(47, 150, 220, 0.08), rgba(242, 208, 74, 0.05)),
    url("assets/bg-menu.jpg") center / cover no-repeat;
  text-align: center;
  padding: 1.4rem 1.2rem 5.5rem;
}

.title-screen h1,
.path-progress {
  color: var(--sunflower);
  letter-spacing: 0.03em;
  paint-order: stroke fill;
}

.title-screen h1 {
  margin: 0;
  font-family: var(--title-font);
  font-weight: 400;
  font-size: clamp(2.6rem, 8vw, 5rem);
  -webkit-text-stroke: 5px var(--ink);
  text-shadow: 6px 6px 0 var(--ink);
}

.tag {
  margin: 0 0 0.6rem;
  font-size: clamp(1.1rem, 3vw, 1.5rem);
  font-weight: 800;
  max-width: 18em;
  background: var(--foam);
  border: 4px solid var(--ink);
  border-radius: 999px;
  padding: 0.28rem 0.95rem 0.38rem;
  box-shadow: 3px 3px 0 var(--ink);
}

.btn {
  appearance: none;
  border: 5px solid var(--ink);
  background: var(--sunflower);
  color: var(--ink);
  font-family: Fredoka, "Trebuchet MS", sans-serif;
  font-size: 1.6rem;
  font-weight: 600;
  padding: 0.55rem 1.4rem 0.7rem;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 6px 0 var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 var(--ink);
}

.btn:focus-visible {
  outline: 4px solid var(--coral);
  outline-offset: 4px;
}

.game-picker {
  width: min(34rem, calc(100% - 2rem));
  padding: 1.8rem clamp(0.8rem, 3vw, 1.65rem) 1.9rem;
  border: 6px solid var(--ink);
  border-radius: 1.9rem 1.5rem 1.85rem 1.55rem;
  background: url("assets/bg-menu.jpg") center / cover no-repeat, var(--sand);
  color: var(--ink);
  text-align: center;
  box-shadow: 0 9px 0 var(--ink);
}

.game-picker::backdrop,
.picture-picker::backdrop {
  background: rgba(27, 42, 74, 0.48);
}

.game-picker h2 {
  margin: 0 2.5rem 1.4rem;
  font: 400 clamp(1.4rem, 4.8vw, 2.5rem) / 1.1 "Luckiest Guy", Fredoka, "Trebuchet MS", sans-serif;
  color: var(--sunflower);
  letter-spacing: 0.025em;
  -webkit-text-stroke: 4px var(--ink);
  paint-order: stroke fill;
  text-shadow: 3px 4px 0 var(--ink);
}

.difficulty-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(0.4rem, 1.6vw, 0.9rem);
}

.difficulty-row .btn {
  min-width: 0;
  min-height: clamp(3.8rem, 15dvh, 5rem);
  padding: 0.45rem 0.2rem;
  border-width: 4px;
  border-radius: 1.15rem 0.95rem 1.05rem 1rem;
  background: var(--foam);
  gap: 0.15rem;
}

.difficulty-row .btn[aria-pressed="true"] {
  background: #a0e3df;
}

#difficulty-save-status {
  margin: 0.9rem 0 0;
  padding: 0.4rem 0.7rem;
  border-radius: 0.65rem;
  background: var(--foam);
  font-weight: 800;
}

.difficulty-star {
  display: block;
  width: min(29%, 2.35rem);
  aspect-ratio: 1;
  pointer-events: none;
}

.picker-close,
.difficulty-toggle {
  appearance: none;
  border: 3px solid var(--ink);
  background: var(--foam);
  cursor: pointer;
  box-shadow: 0 3px 0 var(--ink);
}

.picker-close {
  position: absolute;
  top: 0.55rem;
  right: 0.55rem;
  min-width: 44px;
  min-height: 44px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  font: 700 1.5rem / 1 sans-serif;
  color: var(--ink);
}

.difficulty-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.1rem;
  margin-left: auto;
  padding: 0.25rem 0.45rem;
  border-radius: 0.95rem 0.8rem 0.9rem 0.95rem;
}

.difficulty-toggle .difficulty-star {
  width: 1.35rem;
}

.picker-close:focus-visible,
.difficulty-toggle:focus-visible {
  outline: 3px solid var(--coral);
  outline-offset: 3px;
}

.back-btn,
#more-games {
  background:
    linear-gradient(rgba(255, 243, 198, 0.66), rgba(255, 243, 198, 0.44)),
    url("assets/bg-sand.jpg") center / cover no-repeat,
    var(--sand);
  border-radius: 0.95rem 0.8rem 0.9rem 0.95rem;
}

.back-btn {
  appearance: none;
  border: 4px solid var(--ink);
  color: var(--ink);
  font-family: Fredoka, "Trebuchet MS", sans-serif;
  font-size: 1rem;
  font-weight: 700;
  padding: 0.12rem 0.6rem;
  cursor: pointer;
  box-shadow: 0 3px 0 var(--ink);
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.back-btn[data-back] {
  justify-content: center;
  padding: 0;
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 0.08em;
  flex-shrink: 0;
}

.btn-icon img {
  width: 1.35em;
  height: 1.35em;
  object-fit: contain;
  pointer-events: none;
}

.back-btn .btn-icon img {
  width: 2.25rem;
  height: 2.25rem;
}

.back-btn:focus-visible {
  outline: 3px solid var(--coral);
  outline-offset: 3px;
}

.games-home {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 44px;
}

.games-home::before {
  content: "";
  width: 1.35rem;
  height: 1.35rem;
  background: url("assets/icon-beach-hut.png") center / contain no-repeat;
}

.menu-profiles {
  position: absolute;
  top: 0.5rem;
  left: var(--nav-inset);
  min-height: var(--nav-button-size);
  text-decoration: none;
}

.sound-toggle {
  appearance: none;
  position: fixed;
  top: calc(env(safe-area-inset-top) + 0.5rem);
  right: calc(env(safe-area-inset-right) + var(--nav-inset));
  z-index: 50;
  display: grid;
  place-items: center;
  width: var(--nav-button-size);
  height: var(--nav-button-size);
  padding: 5px;
  border: 3px solid var(--ink);
  border-radius: 0.95rem 0.8rem 0.9rem 0.95rem;
  background: linear-gradient(#fff3c6bb, #fff3c688), url("assets/bg-sand.jpg") center / cover;
  box-shadow: 0 3px 0 var(--ink);
  cursor: pointer;
  touch-action: manipulation;
}

.sound-toggle:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 var(--ink);
}

.sound-toggle:focus-visible {
  outline: 3px solid var(--coral);
  outline-offset: 3px;
}

.sound-mark {
  position: relative;
  display: block;
  width: 31px;
  height: 28px;
  transform: scale(1.15);
}

.speaker-box {
  position: absolute;
  top: 8px;
  left: 1px;
  width: 10px;
  height: 13px;
  border: 3px solid var(--ink);
  border-radius: 3px;
  background: #f4bd4f;
}

.speaker-cone {
  position: absolute;
  inset: 2px 13px 2px 5px;
  background: var(--ink);
  clip-path: polygon(0 31%, 100% 0, 100% 100%, 0 69%);
}

.speaker-cone::after {
  content: "";
  position: absolute;
  inset: 4px 3px;
  background: #f4bd4f;
  clip-path: polygon(0 31%, 100% 0, 100% 100%, 0 69%);
}

.sound-waves {
  position: absolute;
  top: 2px;
  right: 0;
  width: 12px;
  height: 24px;
  border-right: 3px solid var(--ink);
  border-radius: 50%;
}

.sound-waves::after {
  content: "";
  position: absolute;
  top: 6px;
  right: 4px;
  width: 6px;
  height: 12px;
  border-right: 3px solid var(--ink);
  border-radius: 50%;
}

.sound-slash {
  display: none;
  position: absolute;
  top: 12px;
  left: 0;
  width: 33px;
  height: 4px;
  background: var(--ink);
  border-radius: 3px;
  transform: rotate(-45deg);
  box-shadow: 0 0 0 2px #fff3c6;
}

.sound-toggle[aria-pressed="false"] .sound-waves {
  visibility: hidden;
}

.sound-toggle[aria-pressed="false"] .sound-slash {
  display: block;
}

.difficulty-picker .sound-toggle {
  position: absolute;
  top: 0.55rem;
  left: 0.55rem;
  right: auto;
}

.difficulty-picker h2 {
  margin-inline: calc(var(--nav-button-size) - 0.5rem);
}

.exhibits {
  display: flex;
  gap: 1.2rem;
  justify-content: center;
  flex-wrap: wrap;
  width: min(1100px, 100%);
}

.exhibit {
  appearance: none;
  flex: 1 1 220px;
  max-width: 320px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding: 1rem 1rem 1.1rem;
  border: 6px solid var(--ink);
  border-radius: 1.6rem;
  background: var(--foam);
  color: var(--ink);
  cursor: pointer;
  box-shadow: 0 8px 0 var(--ink);
  transform: translateY(0);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.exhibit.is-on,
.exhibit:hover,
.exhibit:focus-visible {
  transform: translateY(-8px) rotate(-1.2deg);
  box-shadow: 0 14px 0 var(--ink);
  outline: none;
}

.exhibit[data-game="path"].is-on,
.exhibit[data-game="path"]:hover,
.exhibit[data-game="path"]:focus-visible {
  transform: translateY(-8px) rotate(1.2deg);
}

.exhibit.hop {
  animation: hop 0.32s ease;
}

.exhibit-name {
  font-family: Fredoka, "Trebuchet MS", sans-serif;
  font-size: 1.55rem;
  font-weight: 700;
}

.exhibit-blurb {
  font-size: 1rem;
  font-weight: 800;
  opacity: 0.8;
}

.exhibit-art {
  position: relative;
  width: 100%;
  height: 110px;
  margin-bottom: 0.2rem;
}

.tidy-art {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 0.3rem;
}

.tidy-art img,
.path-art img {
  width: 74px;
  height: 74px;
  object-fit: contain;
  pointer-events: none;
}

.puzzle-art {
  display: flex;
  align-items: center;
  justify-content: center;
}

.puzzle-thumb {
  position: relative;
  width: 120px;
  height: 90px;
  border-radius: 0.8rem;
  border: 4px solid var(--ink);
  overflow: hidden;
  pointer-events: none;
}

.puzzle-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.puzzle-seams {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.path-art {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.4rem 0.8rem;
}

.paint-art {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

.paint-thumb {
  position: relative;
  width: 90px;
  height: 90px;
  border-radius: 0.8rem;
  border: 4px solid var(--ink);
  overflow: hidden;
  pointer-events: none;
  background: var(--foam);
}

.paint-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.paint-thumb-pots {
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
}

.paint-thumb-pot {
  width: 1.45rem;
  height: 1.45rem;
  border-radius: 50%;
  border: 3px solid var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: Nunito, sans-serif;
  font-weight: 800;
  font-size: 0.72rem;
  color: var(--ink);
  box-shadow: 2px 2px 0 var(--ink);
}

.menu-kid {
  width: 8.4rem;
  flex-shrink: 0;
}

.menu-kid.is-hero {
  width: 7.6rem;
  margin: 0.15rem 0 0.35rem;
}

.kid-art {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
  filter: drop-shadow(3px 4px 0 var(--shadow));
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
  transform-origin: 50% 100%;
}

.kid-art.is-looking-right {
  transform: scaleX(-1);
}

.kid-art.is-nodding {
  animation: kid-nod 0.55s ease;
}

.kid-art.is-hmm {
  animation: kid-hmm 0.55s ease;
}

.kid-art.is-fidgeting {
  animation: kid-fidget 0.7s ease;
}

.kid-art.is-hinting {
  animation: hop 0.46s ease;
}

.kid-art.is-sparkling {
  animation: celebrate-pop 0.62s ease;
}

.kid-button {
  appearance: none;
  position: relative;
  display: block;
  width: 100%;
  min-height: 44px;
  padding: 0;
  border: 0;
  border-radius: 0.9rem;
  background: transparent;
  cursor: pointer;
  pointer-events: auto;
}

.kid-button:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 2px;
}

.kid-sparkles {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.kid-art.is-sparkling + .kid-sparkles::before,
.kid-art.is-sparkling + .kid-sparkles::after {
  content: "";
  position: absolute;
  top: 17%;
  left: -0.25rem;
  width: clamp(1.25rem, 3vw, 2rem);
  aspect-ratio: 1;
  background: url("assets/icon-star.svg") center / contain no-repeat;
  --star-drift: -0.55rem;
  --star-tilt: -24deg;
  animation: kid-star-pop 0.66s ease-out both;
}

.kid-art.is-sparkling + .kid-sparkles::after {
  top: 5%;
  right: 0.05rem;
  left: auto;
  width: clamp(1rem, 2.5vw, 1.55rem);
  --star-drift: 0.15rem;
  --star-tilt: 24deg;
  animation-delay: 0.06s;
}

@keyframes kid-star-pop {
  from { opacity: 0; transform: translateY(0.4rem) scale(0.35); }
  30% { opacity: 1; transform: translateY(0) scale(1.08); }
  65% { opacity: 1; }
  to { opacity: 0; transform: translate(var(--star-drift), -1.3rem) rotate(var(--star-tilt)) scale(0.8); }
}

.kid-hint {
  position: absolute;
  right: 0;
  bottom: calc(100% + 0.45rem);
  display: grid;
  grid-template-columns: 1.55rem 1fr;
  align-items: center;
  gap: 0.4rem;
  width: max-content;
  max-width: 12rem;
  margin: 0;
  padding: 0.45rem 0.55rem;
  border: 3px solid var(--ink);
  border-radius: 0.95rem;
  background: var(--foam);
  box-shadow: 2px 3px 0 var(--ink);
  font: 600 clamp(0.87rem, 2.4vw, 1.04rem)/1.16 Fredoka, "Trebuchet MS", sans-serif;
  pointer-events: none;
  transform-origin: right bottom;
}

.kid-hint:empty {
  opacity: 0;
}

.kid-hint:not(:empty) {
  animation: kid-hint-pop 0.28s ease-out;
}

.kid-hint::before {
  content: "";
  height: 1.55rem;
  background: url("assets/icon-star.svg") center / contain no-repeat;
}

.kid-hint::after {
  content: "";
  position: absolute;
  right: 1.15rem;
  bottom: -0.47rem;
  width: 0.7rem;
  aspect-ratio: 1;
  border-right: 3px solid var(--ink);
  border-bottom: 3px solid var(--ink);
  background: var(--foam);
  transform: rotate(45deg);
}

@keyframes kid-hint-pop {
  from { opacity: 0; transform: scale(0.83); }
  70% { transform: scale(1.035); }
  to { transform: scale(1); }
}

@keyframes kid-nod {
  0%, 100% { transform: translateY(0); }
  40% { transform: translateY(6px); }
}

@keyframes kid-hmm {
  0%, 100% { transform: rotate(0deg); }
  35% { transform: rotate(-8deg); }
  70% { transform: rotate(4deg); }
}

@keyframes kid-fidget {
  0%, 100% { transform: translateY(0); }
  30% { transform: translateY(-7px); }
  55% { transform: translateY(0); }
  75% { transform: translateY(-3px); }
}

.sun {
  position: absolute;
  top: 8%;
  right: 12%;
  width: 6.2rem;
  height: 6.2rem;
  object-fit: contain;
  filter: drop-shadow(4px 4px 0 var(--shadow));
}

.sun.small {
  position: static;
  width: 2.8rem;
  height: 2.8rem;
  pointer-events: none;
}

.play-screen {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr 18px minmax(34%, 280px);
  background: var(--sand);
}

.sky {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: var(--nav-gap);
  padding-block: 0.5rem;
  /* Leave space at the end of the row for the fixed sound button. */
  padding-inline: var(--nav-inset) calc(var(--nav-inset) + var(--nav-button-size) + var(--nav-gap));
  background:
    url("assets/bg-sky.jpg") center top / cover no-repeat,
    var(--sky);
  border-bottom: 5px solid var(--ink);
}

.sky button {
  min-width: var(--nav-button-size);
  min-height: var(--nav-button-size);
}

.sky-with-hint {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto var(--nav-button-size);
  grid-template-areas: "games hint difficulty .";
  padding-inline: var(--nav-inset);
}

.sky-with-hint .back-btn {
  grid-area: games;
}

.sky-with-hint .difficulty-toggle {
  grid-area: difficulty;
}

.hint {
  grid-area: hint;
  margin: 0;
  text-align: center;
  font-family: Fredoka, "Trebuchet MS", sans-serif;
  font-size: 1.15rem;
  font-weight: 600;
}

.path-progress {
  font-family: var(--title-font);
  font-size: 2rem;
  font-weight: 400;
  -webkit-text-stroke: 2.5px var(--ink);
  text-shadow: 3px 3px 0 var(--ink);
}

.round-progress {
  font-size: 2rem;
  line-height: 1;
  color: var(--sunflower);
  -webkit-text-stroke: 2px var(--ink);
  paint-order: stroke fill;
  text-shadow: 3px 3px 0 var(--ink);
}

@media (max-width: 32rem) {
  .sky-with-hint {
    grid-template-areas:
      "games . difficulty ."
      "hint hint hint hint";
  }
}

.sand-stage {
  min-height: 0;
  display: flex;
  align-items: flex-end;
  gap: 0.2rem;
  background:
    radial-gradient(circle at 18% 72%, var(--sand-dark) 0 7px, transparent 8px),
    radial-gradient(circle at 72% 28%, var(--sand-dark) 0 5px, transparent 6px),
    radial-gradient(circle at 48% 58%, var(--sand-dark) 0 4px, transparent 5px),
    url("assets/bg-sand.jpg") center / cover no-repeat;
}

.sand-kid {
  position: relative;
  z-index: 1;
  width: 6.2rem;
  flex-shrink: 0;
  padding: 0 0.3rem 0.6rem 0.6rem;
  pointer-events: none;
}

.sand-kid .kid-hint {
  right: auto;
  left: 0.5rem;
  transform-origin: left bottom;
}

.sand-kid .kid-hint::after {
  right: auto;
  left: 1rem;
}

@media (orientation: landscape) and (max-height: 30rem) {
  .sand-kid .kid-hint {
    left: calc(100% + 0.5rem);
    bottom: 0.6rem;
  }

  .sand-kid .kid-hint::after {
    left: -0.47rem;
    bottom: 0.9rem;
    transform: rotate(135deg);
  }
}

.sand {
  position: relative;
  flex: 1;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-content: flex-end;
  justify-content: center;
  gap: 1.4rem 1.8rem;
  padding: 1.4rem 1.6rem 1.4rem;
  background: transparent;
}

.surf {
  background:
    repeating-linear-gradient(
      -8deg,
      var(--foam) 0 14px,
      transparent 14px 28px
    );
  border-top: 4px solid var(--ink);
  border-bottom: 4px solid var(--ink);
}

.tide {
  display: flex;
  justify-content: space-evenly;
  align-items: stretch;
  gap: 1rem;
  padding: 1rem 1rem 1.2rem;
  background:
    linear-gradient(180deg, rgba(26, 127, 132, 0.2), rgba(26, 127, 132, 0.45)),
    url("assets/bg-water.jpg") center / cover no-repeat;
}

.pool {
  --pool-piece-gap: 0.2rem;
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding: clamp(2.75rem, 6.5dvh, 4rem) 0.45rem 0.55rem;
  background: radial-gradient(circle at 40% 30%, #6fe0d2 0 28%, #1f8c90 70%);
  border: 6px solid var(--ink);
  border-radius: 46% 54% 48% 52% / 50% 44% 56% 50%;
  box-shadow: inset 0 -16px 0 rgba(27, 42, 74, 0.12);
}

.pool:nth-child(2) {
  border-radius: 52% 48% 56% 44% / 46% 54% 46% 54%;
}

.pool:nth-child(3) {
  border-radius: 44% 56% 50% 50% / 54% 46% 54% 46%;
}

.pool-art {
  width: 5.25rem;
  max-width: 100%;
  height: 5.25rem;
  flex-shrink: 0;
  padding: clamp(0.15rem, 0.6dvh, 0.35rem);
  background: var(--foam);
  border: 3px solid var(--ink);
  border-radius: 0.75rem;
  box-shadow: 0 2px 0 var(--shadow);
}

.pool-art img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}

.pool-art.is-pair {
  width: 7.5rem;
  display: flex;
  gap: 0.25rem;
}

.pool-art.is-pair img {
  flex: 1;
  min-width: 0;
}

.pool-catch {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: var(--pool-piece-gap);
  width: 100%;
}

.piece {
  width: 128px;
  height: 128px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: grab;
  touch-action: none;
  border-radius: 1.2rem;
}

.piece:focus-visible {
  outline: 4px solid var(--coral);
  outline-offset: 4px;
}

.piece .piece-art {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(3px 4px 0 var(--shadow));
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

.piece.dragging {
  cursor: grabbing;
  z-index: 20;
  position: fixed;
  margin: 0;
  filter: none;
}

.piece.selected {
  outline: 5px solid var(--sunflower);
  outline-offset: 4px;
  background: rgba(255, 210, 63, 0.25);
}

.piece.in-pool {
  width: 68px;
  height: auto;
  aspect-ratio: 1;
  cursor: default;
  pointer-events: none;
}

.piece.in-pool .piece-art {
  filter: none;
}

.piece:nth-child(2n) {
  transform: rotate(-6deg);
}

.piece:nth-child(3n) {
  transform: rotate(7deg);
}

.piece.dragging,
.piece.in-pool {
  transform: none;
}

.pool.splash .piece:last-child {
  animation: splash 0.45s ease;
}

.pool.wiggle {
  animation: wiggle 0.4s ease;
}

.cheer {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  background: rgba(27, 42, 74, 0.28);
  z-index: 30;
  pointer-events: none;
}

.cheer-kid {
  width: 10.5rem;
}

.cheer-kid.is-cheering {
  animation: celebrate-pop 0.7s ease;
}

.cheer-words {
  margin: 0;
  padding: 0.6rem 1.4rem;
  background: var(--foam);
  border: 6px solid var(--ink);
  border-radius: 1.4rem;
  font-family: "Luckiest Guy", Fredoka, "Trebuchet MS", sans-serif;
  font-size: clamp(2.2rem, 7vw, 3.6rem);
  font-weight: 400;
  box-shadow: 6px 6px 0 var(--ink);
  text-shadow: 4px 4px 0 var(--sunflower);
}

.cheer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  justify-content: center;
  pointer-events: auto;
}

.cheer.is-puzzle {
  background: transparent;
  justify-content: flex-end;
  gap: 0.55rem;
  padding: 0 1rem 0.9rem;
  pointer-events: none;
}

.cheer.is-puzzle .cheer-kid {
  width: 7.2rem;
  pointer-events: none;
}

.cheer.is-puzzle .cheer-words {
  font-size: clamp(1.8rem, 5.5vw, 2.8rem);
}

.cheer.is-puzzle .cheer-words,
.cheer.is-puzzle .cheer-actions {
  pointer-events: auto;
}

.puzzle-screen.is-won .puzzle-kid,
.puzzle-screen.is-won .puzzle-preview,
.puzzle-screen.is-won .puzzle-tidy {
  display: none;
}

.puzzle-screen.is-won .sky {
  visibility: hidden;
}

.path-screen {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  background: url("assets/bg-sand.jpg") center / cover no-repeat, var(--sand);
}

.path-stage {
  --path-tile: min(18vw, 104px);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 1rem;
  min-height: 0;
  container-type: size;
}

.path-board {
  grid-column: 2;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.path-kid {
  grid-column: 3;
  justify-self: start;
  width: 7rem;
  margin-left: 0.6rem;
}

.path-stage .path-kid {
  position: relative;
  z-index: 1;
  pointer-events: none;
}

.path-kid.is-cheering {
  width: 9.2rem;
  animation: celebrate-pop 0.7s ease;
}

.puzzle-picker {
  width: min(48rem, calc(100% - 2rem));
  max-height: calc(100dvh - 2rem);
  padding: 1rem clamp(0.45rem, 2vw, 1.3rem) 0.65rem;
}

.puzzle-picker[open] {
  display: flex;
  flex-direction: column;
}

.puzzle-picker h2 {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  min-height: 44px;
  margin: 0.15rem 2.5rem 0.65rem;
}

.puzzle-options {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-content: start;
  gap: clamp(0.4rem, 1.5vw, 0.9rem);
  padding: 0.3rem 0.3rem 0.5rem;
  overflow-y: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
}

.puzzle-option {
  appearance: none;
  padding: 0.22rem;
  border: 3px solid var(--ink);
  border-radius: 0.8rem;
  background: var(--foam);
  box-shadow: 0 3px 0 var(--ink);
  cursor: pointer;
}

.puzzle-option img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 0.4rem;
}

.puzzle-option:hover {
  background: var(--sunflower);
}

.puzzle-option:focus-visible {
  outline: 3px solid var(--coral);
  outline-offset: 2px;
}

@media (max-width: 599px) {
  .puzzle-options {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (orientation: landscape) and (min-width: 480px) and (max-height: 560px) {
  .puzzle-options {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

.puzzle-stage {
  position: relative;
  min-height: 0;
  overflow: hidden;
}

.puzzle-stage::before {
  --towel-stripe: #f6d9a6;
  --towel-stripes: linear-gradient(to right,
    transparent 22%, var(--towel-stripe) 22% 39%,
    transparent 39% 61%, var(--towel-stripe) 61% 78%, transparent 78%);
  content: "";
  position: absolute;
  /* Leave a sand border and cover about 75% of the play area. */
  inset: 6.7%;
  border: 1px solid #7e203a;
  border-radius: clamp(12px, 2vw, 22px);
  background:
    var(--towel-stripes) left center / clamp(24px, 7%, 64px) 100% no-repeat,
    var(--towel-stripes) right center / clamp(24px, 7%, 64px) 100% no-repeat,
    #a72c4e;
  box-shadow: inset 0 0 0 3px rgb(255 231 217 / 14%), 0 4px 8px rgb(85 52 31 / 26%);
  pointer-events: none;
}

.puzzle-field {
  position: absolute;
  inset: 0;
  touch-action: none;
  cursor: default;
}

.puzzle-kid {
  position: absolute;
  right: 0.4rem;
  bottom: 0.4rem;
  z-index: 5;
  pointer-events: none;
}

.puzzle-preview {
  appearance: none;
  position: absolute;
  left: 0.7rem;
  top: 0.7rem;
  z-index: 6;
  width: 96px;
  padding: 0;
  border: 5px solid var(--ink);
  border-radius: 0.85rem;
  background: var(--foam);
  box-shadow: 0 4px 0 var(--ink);
  cursor: pointer;
  overflow: hidden;
}

.puzzle-preview img {
  display: block;
  width: 100%;
  height: 72px;
  object-fit: cover;
  pointer-events: none;
}

.puzzle-tidy {
  appearance: none;
  position: absolute;
  right: 0.4rem;
  bottom: 12rem;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3.8rem;
  height: 3.8rem;
  padding: 0;
  border: 4px solid var(--ink);
  background: var(--foam);
  color: var(--ink);
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 3px 0 var(--ink);
}

.puzzle-tidy-mark {
  width: 2.55rem;
  height: 2.55rem;
  display: block;
}

.puzzle-peek {
  position: fixed;
  inset: 0;
  margin: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  border: 0;
  background: transparent;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.2rem;
}

.puzzle-peek:not([open]) {
  display: none;
}

.puzzle-peek-dim {
  appearance: none;
  position: absolute;
  inset: 0;
  border: 0;
  padding: 0;
  background: rgba(27, 42, 74, 0.45);
  cursor: pointer;
}

.puzzle-peek-frame {
  position: relative;
  z-index: 1;
  max-width: min(92vw, 720px);
  max-height: 82%;
  border: 6px solid var(--ink);
  border-radius: 1.1rem;
  background: var(--foam);
  box-shadow: 6px 6px 0 var(--ink);
  overflow: hidden;
}

.puzzle-peek-frame img {
  display: block;
  max-width: 100%;
  max-height: 78vh;
  object-fit: contain;
}

.puzzle-peek-close {
  appearance: none;
  position: absolute;
  top: 0.4rem;
  right: 0.4rem;
  width: 2.2rem;
  height: 2.2rem;
  border: 4px solid var(--ink);
  border-radius: 999px;
  background: var(--sunflower);
  color: var(--ink);
  font-family: Fredoka, "Trebuchet MS", sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 3px 0 var(--ink);
}

@media (max-width: 700px) {
  .puzzle-preview {
    width: 80px;
  }

  .puzzle-preview img {
    height: 60px;
  }

  .puzzle-tidy {
    bottom: 8.2rem;
    width: 3.3rem;
    height: 3.3rem;
  }

  .puzzle-tidy-mark {
    width: 2.15rem;
    height: 2.15rem;
  }
}

.jig {
  appearance: none;
  position: absolute;
  padding: 0;
  border: 0;
  background: transparent;
  overflow: visible;
  cursor: grab;
  touch-action: none;
  pointer-events: none;
  filter: drop-shadow(3px 4px 0 var(--shadow));
}

.jig svg {
  display: block;
  overflow: visible;
  pointer-events: none;
}

.jig svg > path {
  pointer-events: fill;
}

.jig.dragging {
  cursor: grabbing;
  z-index: 8;
  filter: drop-shadow(5px 7px 0 var(--shadow));
}

.paint-screen {
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.picture-picker {
  width: min(44rem, calc(100% - 1.5rem));
  max-height: calc(100dvh - 1.5rem);
  padding: 0.8rem clamp(0.7rem, 2.5vw, 1.4rem) 1.2rem;
  border: 5px solid var(--ink);
  border-radius: 1.9rem 1.5rem 1.85rem 1.55rem;
  background: linear-gradient(#fff3c6ee, #fff3c699), url("assets/bg-sand.jpg") center / cover, var(--sand);
  color: var(--ink);
  box-shadow: 0 7px 0 var(--ink);
  overflow-y: auto;
  touch-action: pan-y;
}

.picture-picker h2 {
  margin: 0.25rem 2.8rem 0.9rem;
  min-height: 2rem;
  text-align: center;
  font: 700 clamp(1.45rem, 4vw, 2.25rem) / 1.1 Fredoka, "Trebuchet MS", sans-serif;
}

.picture-choices {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
}

.picture-choice.btn {
  display: grid;
  justify-items: center;
  gap: 0.25rem;
  padding: 0.4rem 0.3rem;
  border-width: 3px;
  border-radius: 1rem 0.85rem 0.95rem 0.85rem;
  background: var(--foam);
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  box-shadow: 0 4px 0 var(--ink);
  touch-action: manipulation;
}

.picture-choice[aria-current="true"] {
  background: #a0e3df;
}

.picture-choice svg {
  display: block;
  width: min(100%, clamp(3rem, 14dvh, 8rem));
  aspect-ratio: 1;
  border: 2px solid var(--ink);
  border-radius: 0.55rem;
  stroke: var(--ink);
  stroke-width: 0.65;
  stroke-linejoin: round;
  stroke-linecap: round;
  pointer-events: none;
}

@media (max-width: 34rem) {
  .picture-choices {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 34rem) and (max-height: 44rem) {
  .picture-choices {
    row-gap: 0.5rem;
  }

  .picture-choice.btn {
    padding-block: 0.3rem;
  }

  .picture-choice svg {
    width: min(100%, clamp(3rem, 11dvh, 8rem));
  }
}

.picture-toggle.btn {
  margin-right: auto;
  padding: 4px;
  border-width: 4px;
  border-radius: 0.95rem 0.8rem 0.9rem 0.95rem;
  background: var(--foam);
  box-shadow: 0 3px 0 var(--ink);
}

@media (max-width: 27rem) {
  .paint-sky .sun.small {
    display: none;
  }
}

.paint-stage {
  position: relative;
  min-height: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0.6rem 0.6rem 0.2rem;
}

.paint-page {
  position: relative;
  width: min(72vw, 52vh, 420px);
  aspect-ratio: 1;
  background: #fff8ee;
  border: 5px solid var(--ink);
  border-radius: 1.1rem;
  overflow: hidden;
  box-shadow: 5px 5px 0 var(--ink);
}

.paint-blobs {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
}

.paint-labels {
  position: absolute;
  inset: 0;
  z-index: 3;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.paint-labels [data-cell] {
  pointer-events: auto;
  cursor: pointer;
}

.paint-pot > svg {
  width: 1.25em;
  height: 1.25em;
  display: block;
  margin: auto;
}

.paint-blobs path.kid-hint-target {
  stroke: #08838b;
  stroke-width: 2.2;
}

.paint-blobs path.paint-mismatch {
  stroke: #ba3240;
  stroke-width: 2.1;
}

#pilot-status {
  color: #17384e;
  background: #fff8e5;
  border-radius: 1em;
  padding: 0.4em 0.8em;
  margin: 0;
}

.paint-blobs path {
  cursor: pointer;
  transform-box: fill-box;
  transform-origin: center;
  stroke: #2a2438;
  stroke-width: 1.1;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.paint-blobs [data-cell] {
  pointer-events: fill;
}

.paint-blobs path.paint-ink {
  pointer-events: none;
  cursor: default;
}

.paint-blobs path.wiggle {
  animation: wiggle 0.4s ease;
}

.paint-kid {
  position: absolute;
  right: 0.4rem;
  bottom: 0.4rem;
  z-index: 4;
  width: 6.4rem;
  pointer-events: none;
}

.kid-hint-target {
  outline: 4px solid #087a72;
  outline-offset: 2px;
}

.paint-pots {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.7rem 0.7rem 0.9rem;
  background: var(--water);
  border-top: 5px solid var(--ink);
}

.paint-pot {
  appearance: none;
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 50%;
  border: 4px solid var(--ink);
  font-family: Nunito, sans-serif;
  font-weight: 800;
  font-size: 1.2rem;
  color: var(--ink);
  cursor: pointer;
  box-shadow: 3px 3px 0 var(--ink);
}

.paint-pot.is-on {
  box-shadow: 0 0 0 4px var(--sunflower), 3px 3px 0 var(--ink);
}

.paint-pot:disabled {
  cursor: default;
  box-shadow: none;
  font-size: 1.4rem;
  color: var(--foam);
  -webkit-text-stroke: 2px var(--ink);
  paint-order: stroke fill;
}

.done-btn {
  appearance: none;
  border: 4px solid var(--ink);
  background: var(--sunflower);
  color: var(--ink);
  font-family: Fredoka, "Trebuchet MS", sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
  padding: 0.28rem 0.75rem 0.38rem;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 3px 0 var(--ink);
}

.done-btn:focus-visible {
  outline: 3px solid var(--coral);
  outline-offset: 3px;
}

.crayon-blobs {
  pointer-events: none;
  z-index: 1;
}

.paint-blobs.crayon-blobs path {
  stroke: none;
  cursor: default;
}

.crayon-canvas {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: crosshair;
}

.crayon-lines {
  pointer-events: none;
  z-index: 3;
}

.paint-blobs.crayon-lines path {
  fill: none;
  cursor: default;
}

.paint-pot.crayon-pot {
  font-size: 0;
  color: transparent;
}

.crayon-toolbar {
  align-items: center;
  gap: 0.85rem;
}

.crayon-shell {
  position: absolute;
  top: 5.5rem;
  left: 1rem;
  padding: 0.35rem;
}

.crayon-shell img {
  width: 3rem;
  height: 3rem;
  object-fit: contain;
}

#crayon-retry-save, #paint-retry, #puzzle-retry, #tidy-retry, #path-retry {
  position: absolute;
  z-index: 8;
  right: 1rem;
  bottom: 1rem;
}

.crayon-colors,
.crayon-actions {
  display: flex;
  justify-content: center;
  gap: 0.55rem;
}

.crayon-colors {
  flex-wrap: wrap;
}

.crayon-tool {
  appearance: none;
  display: grid;
  place-items: center;
  width: 3.25rem;
  height: 3.25rem;
  padding: 0;
  border: 4px solid var(--ink);
  border-radius: 1rem 0.85rem 0.95rem 0.85rem;
  background: linear-gradient(#fff3c6bb, #fff3c688), url("assets/bg-sand.jpg") center / cover;
  box-shadow: 3px 3px 0 var(--ink);
  cursor: pointer;
  touch-action: manipulation;
}

.crayon-tool[aria-pressed="true"] {
  box-shadow: 0 0 0 4px var(--sunflower), 3px 3px 0 var(--ink);
}

.crayon-tool:disabled {
  opacity: 0.5;
  box-shadow: none;
  cursor: default;
}

.crayon-tool:focus-visible {
  outline: 3px solid var(--coral);
  outline-offset: 3px;
}

.eraser-mark {
  width: 30px;
  height: 19px;
  border: 3px solid var(--ink);
  border-radius: 5px;
  background: linear-gradient(90deg, #ed91a1 0 57%, var(--ink) 57% 68%, #ffedc5 68% 100%);
  transform: rotate(-40deg);
}

.undo-mark {
  position: relative;
  width: 24px;
  height: 18px;
  margin-left: 6px;
  margin-top: 4px;
  border: 4px solid var(--ink);
  border-left: 0;
  border-radius: 0 10px 10px 0;
}

.undo-mark::before {
  content: "";
  position: absolute;
  top: -9px;
  left: -6px;
  width: 12px;
  height: 14px;
  background: var(--ink);
  clip-path: polygon(0 50%, 84% 0, 100% 12%, 100% 88%, 84% 100%);
}

.crayon-screen.is-won .crayon-actions {
  visibility: hidden;
}

.crayon-screen.is-won .crayon-kid {
  display: none;
}

.crayon-screen.is-won .done-btn {
  visibility: hidden;
}

.cheer.is-paint {
  background: transparent;
  justify-content: flex-end;
  gap: 0.55rem;
  padding: 0 1rem 0.9rem;
  pointer-events: none;
}

.cheer.is-paint .cheer-kid {
  width: 7.2rem;
  pointer-events: none;
}

.cheer.is-paint .cheer-words {
  font-size: clamp(1.8rem, 5.5vw, 2.8rem);
}

.cheer.is-paint .cheer-words,
.cheer.is-paint .cheer-actions {
  pointer-events: auto;
}

.paint-screen.is-won .paint-kid {
  display: none;
}

@media (orientation: landscape) {
  .menu-screen {
    justify-content: safe center;
    gap: clamp(0.35rem, 1.3dvh, 0.8rem);
    padding: 1rem clamp(1rem, 3vw, 2.5rem) clamp(2.35rem, 8dvh, 5rem);
    overflow: auto;
    touch-action: pan-y;
  }

  .menu-screen h1 {
    font-size: clamp(2.15rem, 9dvh, 4.6rem);
  }

  .menu-screen .tag {
    margin-bottom: 0;
    font-size: clamp(0.95rem, 2.7dvh, 1.5rem);
  }

  .menu-screen .sun {
    top: 5%;
    right: 8%;
    width: clamp(3rem, 13dvh, 6.2rem);
    height: auto;
    pointer-events: none;
  }

  .menu-kid.is-hero {
    width: clamp(3.6rem, 9.5dvh, 7.6rem);
  }

  .exhibits {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    align-items: stretch;
    gap: clamp(0.45rem, 1.7vw, 1.2rem);
  }

  .exhibit {
    min-width: 0;
    justify-content: center;
    padding: clamp(0.35rem, 1.3dvh, 1rem) clamp(0.35rem, 1.3vw, 1rem);
    border-width: clamp(3px, 0.5vw, 6px);
    border-radius: clamp(0.8rem, 2vw, 1.6rem);
  }

  .exhibit-art {
    height: clamp(3rem, 11dvh, 6rem);
  }

  .tidy-art,
  .path-art {
    align-items: center;
  }

  .path-art {
    padding: 0;
  }

  .tidy-art img,
  .path-art img {
    min-width: 0;
    width: min(31%, 74px);
    height: clamp(2rem, 11dvh, 4.6rem);
  }

  .path-art img {
    width: min(45%, 74px);
  }

  .puzzle-thumb,
  .paint-thumb {
    min-width: 0;
    max-width: 100%;
    height: min(12dvh, 90px);
  }

  .paint-thumb-pots {
    flex-shrink: 0;
    gap: 0.12rem;
  }

  .paint-thumb-pot {
    width: clamp(0.8rem, 3dvh, 1.45rem);
    height: clamp(0.8rem, 3dvh, 1.45rem);
    border-width: 2px;
    font-size: 0.62rem;
  }

  .exhibit-name {
    font-size: clamp(0.95rem, min(2.1vw, 2.8dvh), 1.55rem);
  }

  .exhibit-blurb {
    font-size: clamp(0.72rem, 1.45vw, 1rem);
  }

  .play-screen {
    grid-template-rows: auto minmax(0, 1fr) 12px minmax(8rem, 34%);
  }

  .sand-stage {
    align-items: center;
  }

  .sand-kid {
    align-self: flex-end;
    width: clamp(3.6rem, 11vw, 7rem);
  }

  .sand {
    gap: clamp(0.4rem, 1.7vw, 1.3rem);
    padding: 0.55rem;
  }

  .sand .piece {
    width: clamp(3rem, min(11vw, 17dvh), 7.75rem);
    height: clamp(3rem, min(11vw, 17dvh), 7.75rem);
  }

  .tide {
    gap: clamp(0.4rem, 2vw, 1rem);
    padding: clamp(0.35rem, 1.5dvh, 1rem);
  }

  .pool {
    gap: 0.2rem;
    padding: clamp(0.55rem, 2dvh, 1rem) 0.6rem 0.3rem;
  }

  .pool-art {
    width: clamp(2.4rem, 11dvh, 5.25rem);
    height: clamp(2.4rem, 11dvh, 5.25rem);
  }

  .piece.in-pool {
    width: min(clamp(1.7rem, min(5vw, 7.5dvh), 3.75rem), calc((100% - 4 * var(--pool-piece-gap)) / 5));
  }

  .path-stage {
    --path-side: clamp(3.75rem, 11vw, 8rem);
    --path-tile: min(6.5rem, calc((100vw - 2 * var(--path-side) - 4.5rem) / 6), calc((100cqh - 1.65rem) / 4));
  }

  .path-stage .path-kid,
  .path-stage .path-kid.is-cheering {
    width: var(--path-side);
  }

  .puzzle-kid,
  .paint-kid {
    width: clamp(3.5rem, 16dvh, 7rem);
  }

  .paint-page {
    width: min(65vw, calc(100dvh - 9rem), 31rem);
  }

  .paint-pot {
    width: clamp(2.75rem, 9dvh, 3.25rem);
    height: clamp(2.75rem, 9dvh, 3.25rem);
  }

  .cheer-kid {
    width: clamp(5.5rem, 25dvh, 10.5rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  .paint-blobs path.wiggle,
  .paint-pot {
    animation: none;
  }
}

.path-row {
  display: flex;
  gap: 0.55rem;
  justify-content: center;
}

.tile {
  appearance: none;
  width: var(--path-tile);
  height: var(--path-tile);
  padding: 0;
  border: 5px solid var(--ink);
  border-radius: 1.1rem;
  background: url("assets/tile-sand.png") center / cover no-repeat;
  cursor: pointer;
  position: relative;
  box-shadow: 3px 4px 0 var(--shadow);
}

.tile.rock {
  background-image: url("assets/tile-rock.png");
  cursor: default;
}

.tile.water {
  background-image: url("assets/tile-water.png");
  cursor: default;
}

.tile.goal,
.tile.here {
  background-image: url("assets/tile-sand.png");
}

.tile.legal {
  box-shadow:
    0 0 0 5px var(--path-glow),
    0 0 16px 3px color-mix(in srgb, var(--path-glow) 70%, transparent),
    3px 4px 0 var(--shadow);
  animation: glow 1.2s ease-in-out infinite;
}

.tile.kid-hint-target {
  --path-glow: #087a72;
}

.tile .glyph {
  width: 78%;
  height: 78%;
  display: block;
  margin: 0 auto;
  object-fit: contain;
  pointer-events: none;
}

.tile.wiggle {
  animation: wiggle 0.4s ease;
}

.tile.splash {
  animation: splash 0.45s ease;
}

@keyframes splash {
  0% { transform: scale(1); }
  40% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

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

@keyframes hop {
  0% { transform: translateY(-8px); }
  40% { transform: translateY(-22px) scale(1.04); }
  100% { transform: translateY(0); }
}

@keyframes celebrate-pop {
  0% { transform: translateY(8px) scale(0.94); }
  40% { transform: translateY(-22px) scale(1.08); }
  70% { transform: translateY(-6px) scale(1.02); }
  100% { transform: translateY(0) scale(1); }
}

@keyframes glow {
  0%, 100% {
    box-shadow:
      0 0 0 5px var(--path-glow),
      0 0 14px 2px color-mix(in srgb, var(--path-glow) 55%, transparent),
      3px 4px 0 var(--shadow);
  }
  50% {
    box-shadow:
      0 0 0 7px var(--path-glow),
      0 0 22px 6px color-mix(in srgb, var(--path-glow) 85%, transparent),
      3px 4px 0 var(--shadow);
  }
}

@media (max-width: 980px) {
  .exhibits {
    flex-wrap: wrap;
  }
}

@media (max-width: 700px) {
  .piece {
    width: 96px;
    height: 96px;
  }

  .tide {
    gap: 0.45rem;
    padding: 0.7rem 0.45rem 0.9rem;
  }

  .menu-kid,
  .menu-kid.is-hero {
    width: 5.6rem;
  }

  .sand-kid {
    width: 4.4rem;
    padding: 0 0 0.4rem 0.25rem;
  }

  .path-kid {
    width: 5.2rem;
  }

  .path-kid.is-cheering {
    width: 6.6rem;
  }

  .puzzle-kid {
    width: 4.6rem;
  }

  .puzzle-thumb {
    width: 96px;
    height: 72px;
  }

  .paint-thumb {
    width: 72px;
    height: 72px;
  }

  .paint-page {
    width: min(92vw, 56vh, 460px);
  }

  .paint-kid {
    right: 0.2rem;
    bottom: 0.2rem;
    width: 4.6rem;
  }

  .cheer-kid {
    width: 8rem;
  }

  .cheer.is-puzzle .cheer-kid,
  .cheer.is-paint .cheer-kid {
    width: 5.6rem;
  }

  .exhibits {
    flex-direction: column;
    align-items: stretch;
  }

  .exhibit {
    max-width: none;
  }

  .title-screen {
    padding-bottom: 1.6rem;
    justify-content: flex-start;
    padding-top: calc(var(--nav-button-size) + 1.4rem);
    overflow: auto;
  }

  .title-screen h1 {
    -webkit-text-stroke-width: 3px;
    text-shadow: 4px 4px 0 var(--ink);
  }

  .tidy-art img,
  .path-art img {
    width: 58px;
    height: 58px;
  }

  .menu-screen .sun {
    top: 0.5rem;
    right: 0.6rem;
    width: 3.2rem;
    height: 3.2rem;
  }

  .tile {
    border-width: 4px;
  }
}

@media (max-width: 700px) and (orientation: portrait) {
  .pool-art {
    width: 4.25rem;
    max-width: 85%;
    height: 4.25rem;
  }

  .piece.in-pool {
    width: min(2.25rem, calc((100% - var(--pool-piece-gap)) / 2));
  }

  .path-stage {
    --path-tile: min(16vw, 72px, calc((100cqw - 2.75rem) / 6));
    position: relative;
  }

  .path-stage .path-kid {
    position: absolute;
    right: 0.6rem;
    bottom: 0.6rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .btn,
  .pool.splash .piece:last-child,
  .pool.wiggle,
  .tile.legal,
  .tile.wiggle,
  .tile.splash,
  .exhibit.hop,
  .cheer-kid,
  .cheer-kid.is-cheering,
  .path-kid.is-cheering {
    animation: none;
    transition: none;
  }

  .kid-art.is-nodding,
  .kid-art.is-hmm,
  .kid-art.is-fidgeting,
  .kid-art.is-hinting,
  .kid-art.is-sparkling,
  .kid-art.is-sparkling + .kid-sparkles::before,
  .kid-art.is-sparkling + .kid-sparkles::after,
  .kid-hint:not(:empty) {
    animation: none;
  }
}

.activity-art {
  display: grid;
  place-items: center;
}

.activity-art img {
  width: min(100%, 7rem);
  height: 100%;
  min-height: 0;
  object-fit: contain;
  pointer-events: none;
}

.beach-activity {
  overflow-y: auto;
  touch-action: pan-y;
  background: url("assets/bg-menu.jpg") center / cover no-repeat var(--sand);
  padding: clamp(0.45rem, 1.8dvh, 1.1rem);
  text-align: center;
}

.beach-activity :is(.picnic-heading, .hunt-heading) {
  flex-wrap: wrap;
  margin: 0 auto 0.6rem;
  padding-inline: 0.25rem calc(var(--nav-button-size) + var(--nav-inset));
}

.beach-activity h2 {
  margin: 0;
  color: var(--sunflower);
  font: 400 clamp(1.35rem, 4vw, 2.5rem) / 1.15 var(--title-font);
  letter-spacing: 0.025em;
  -webkit-text-stroke: 4px var(--ink);
  paint-order: stroke fill;
  text-shadow: 2px 3px var(--ink);
}

.beach-activity :is(.picnic-picker, .hunt-picker) {
  padding: clamp(4rem, 13dvh, 8rem) 0.3rem 1rem;
}

.beach-activity :is(.picnic-picker, .hunt-picker) h2 {
  margin: 0 0 0.8rem;
  font-size: clamp(2rem, 6.5vw, 4.25rem);
  -webkit-text-stroke-width: 5px;
  text-shadow: 3px 4px var(--ink);
}

:where(.beach-activity) :is(.picnic-button, .hunt-button, .picnic-host, .hunt-avatar, .picnic-card, .hunt-card, .hunt-speaker) {
  appearance: none;
  border: 3px solid var(--ink);
  border-radius: 0.95rem 0.8rem 0.9rem 0.85rem;
  background: var(--foam);
  box-shadow: 0 3px var(--ink);
  color: var(--ink);
  padding: 0.35rem 0.7rem;
  font: 600 1rem / 1.1 Fredoka, "Trebuchet MS", sans-serif;
  cursor: pointer;
}

:where(.beach-activity) :is(.picnic-card, .hunt-card) {
  border-width: 4px;
  border-radius: 1.25rem 1.1rem 1.2rem 1rem;
  box-shadow: 0 5px var(--ink);
  padding: clamp(0.4rem, 1.8vw, 0.85rem);
  font-size: clamp(1rem, 2.5vw, 1.4rem);
}

.beach-activity :is(.picnic-card, .hunt-card):hover {
  background: #fff2c6;
}

.beach-activity :is(.picnic-status, .hunt-status):not(:empty), .picnic-picker > p {
  width: fit-content;
  max-width: 100%;
  margin: 0.5rem auto 0.75rem;
  border: 2px solid var(--ink);
  border-radius: 0.7rem;
  background: var(--foam);
  padding: 0.15rem 0.6rem;
  font-weight: 800;
}

.beach-activity button:focus-visible {
  outline: 3px solid var(--coral);
  outline-offset: 3px;
}

@media (max-width: 30rem) {
  .beach-activity :is(.picnic-heading, .hunt-heading) {
    padding: 0.55rem 0 0;
  }

  .beach-activity :is(.picnic-heading, .hunt-heading) h2 {
    order: -1;
    width: 100%;
    min-height: 2.5rem;
    padding-inline: calc(var(--nav-button-size) + var(--nav-gap));
  }
}

.tidy-pilot-piece {
  display: block;
  object-fit: contain;
  width: clamp(30px, 5vw, 62px);
  height: clamp(30px, 5vw, 62px);
}

.tidy-pilot-piece.size-small {
  transform: scale(0.667);
}

.tidy-pool-swatch, .tidy-pool-size {
  display: inline-block;
  flex: 0 0 auto;
  width: clamp(20px, 3vw, 38px);
  height: clamp(20px, 3vw, 38px);
  border: 2px solid #283045;
  border-radius: 45%;
}

.tidy-pool-swatch.is-orange { background: #e9802b; }
.tidy-pool-swatch.is-blue { background: #57b8e9; }
.tidy-pool-size { background: #fff8e4; }
.tidy-pool-size.is-small { transform: scale(0.667); }
.tidy-kind-sample { filter: grayscale(1); }

.tidy-many-pools {
  width: min(100%, 1100px);
  gap: clamp(3px, 1vw, 12px);
}

.tidy-many-pools .pool {
  min-width: 0;
  flex: 1 1 0;
}

.tidy-many-pools .pool-art img {
  max-width: min(100%, 48px);
}
