/* Feelings Pond: its own look (a still pond at dusk, a lily pad, smooth feeling pebbles).
   Calm by design: soft warm colors, slow smooth motion (0.4 to 0.8 s, ease in and out), one thing moving at a time,
   nothing loops, nothing flashes. */
:root {
  --sky: #f8e3cf;
  --sky-2: #f1cfc0;
  --card: #fffaf2;
  --ink: #2f3b2c;
  --soft: #6b6458;
  --water: #7fb0bb;
  --water-d: #5e8f9c;
  --pad: #7db66f;
  --pad-d: #5a9150;
  --stone: #efe7da;
  --stone-d: #cbbca6;
  --green: #3f9a62;
  --green-d: #2b774a;
  --sun: #f4c55a;
  --radius: 20px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100dvh;
  background: linear-gradient(180deg, var(--sky-2), var(--sky) 40%, #fbeedd);
  color: var(--ink);
  font: 500 18px/1.45 'Fredoka', system-ui, sans-serif;
  overscroll-behavior: none;
}
h1, h2 { font-weight: 700; line-height: 1.1; margin: 0; }
button { font: inherit; color: inherit; cursor: pointer; }
a { color: #2d5f7a; }

/* top bar */
.top { display: flex; align-items: center; gap: 10px; padding: max(10px, env(safe-area-inset-top)) 16px 6px; min-height: 64px; }
.grow { flex: 1; }
.round {
  min-height: 48px; min-width: 48px; border: 3px solid var(--ink); border-radius: 16px; background: var(--card);
  box-shadow: 0 4px 0 var(--ink); font-weight: 700; padding: 6px; display: inline-flex; align-items: center; justify-content: center;
}
.round:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
#sound .mute { display: none; }
#sound[aria-pressed='false'] .mute { display: inline; }
#sound[aria-pressed='false'] .waves { display: none; }

main { max-width: 1600px; margin: 0 auto; padding: 0 16px calc(28px + env(safe-area-inset-bottom)); overflow-x: clip; }
.screen { display: grid; gap: 16px; }

/* the pond */
.pond {
  position: relative; border: 3px solid var(--ink); border-radius: 28px; overflow: hidden; height: clamp(190px, 30dvh, 260px);
  background:
    radial-gradient(ellipse 60% 18% at 30% 30%, #ffffff30, transparent 70%),
    radial-gradient(ellipse 50% 14% at 75% 60%, #ffffff22, transparent 70%),
    linear-gradient(180deg, #a9cdd1, var(--water) 55%, var(--water-d));
  box-shadow: 0 6px 0 #2f3b2c33;
}
.pad {
  position: absolute; left: 3%; bottom: 6%; width: 54%; height: 32%; border-radius: 50%;
  background: radial-gradient(ellipse at 50% 40%, #93c785, var(--pad) 60%, var(--pad-d));
  box-shadow: 0 6px 0 #2f3b2c2a;
}
.pad::after { content: ''; position: absolute; left: 50%; top: 8%; width: 14%; height: 46%; background: linear-gradient(90deg, transparent 45%, #5a915066 46% 54%, transparent 55%); transform: rotate(-35deg); pointer-events: none; }
/* Pip sits on the pad: about 62% of the pond's height (the pad is 32% of it). */
.pip, .pad > img {
  position: absolute; z-index: 1; left: 50%; bottom: 34%; height: 194%; width: auto; aspect-ratio: 200 / 180; transform: translateX(-50%);
  border: 0; padding: 0; background: none; display: block;
}
.pip .pip-svg { width: 100%; height: 100%; display: block; animation: fade .5s ease-in-out; }
/* No moment picture (Faces, the home, All done): the pad sits in the middle. */
.pond.solo .pad, .pond.demo .pad, .calm-pond .pad { left: 50%; transform: translateX(-50%); }
.pond.demo { height: clamp(170px, 30dvh, 230px); }
.moment {
  position: absolute; right: 5%; top: 8%; margin: 0; width: min(38%, 150px); aspect-ratio: 1; border-radius: 24px; background: var(--card);
  border: 3px solid var(--ink); padding: 14px; box-shadow: 0 5px 0 #2f3b2c33; animation: fade .6s ease-in-out;
}
.moment img { width: 100%; height: 100%; object-fit: contain; display: block; }

/* home */
.hero { text-align: center; display: grid; gap: 8px; padding-top: 4px; }
.hero h1 { font-size: clamp(32px, 9vw, 52px); }
.lede { margin: 0; font-size: 20px; color: var(--soft); }

.big {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 76px;
  border: 3px solid var(--ink); border-radius: 24px; font-size: 30px; font-weight: 700; box-shadow: 0 7px 0 var(--ink); padding: 10px 20px;
}
.big:active { transform: translateY(5px); box-shadow: 0 2px 0 var(--ink); }
.big.go { background: var(--green); color: #fff; text-shadow: 0 2px 0 #0003; }
.big.plain { background: var(--card); font-size: 24px; min-height: 64px; }

.pick { border: 0; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.pick legend { font-weight: 700; font-size: 18px; margin-bottom: 8px; padding: 0; }
.pick button {
  border: 3px solid var(--ink); border-radius: 18px; background: var(--card); box-shadow: 0 4px 0 var(--ink); padding: 10px 6px;
  display: grid; justify-items: center; align-content: start; gap: 4px; font-weight: 700; font-size: 18px; line-height: 1.15; min-height: 80px;
}
.pick button img { width: 40px; height: 40px; }
.pick button small { font-size: 14px; font-weight: 500; color: var(--soft); }
.pick button[aria-pressed='true'] { background: #e1f2e4; border-color: var(--green-d); box-shadow: 0 4px 0 var(--green-d); outline: 3px solid var(--green); outline-offset: 1px; }
.pick button:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips legend { width: 100%; }
.chips button { display: inline-flex; min-height: 48px; padding: 6px 14px; font-size: 18px; align-items: center; }

.grownups, .about { background: var(--card); border: 3px solid var(--ink); border-radius: var(--radius); padding: 14px 16px; box-shadow: 0 5px 0 #2f3b2c33; }
.grownups summary { font-weight: 700; cursor: pointer; min-height: 32px; }
.grownups p, .about p { margin: 10px 0 0; }
.about h2 { font-size: 22px; }
.small { font-size: 14px; color: var(--soft); }

/* play */
#play-screen { gap: 12px; }
.dots { list-style: none; display: flex; justify-content: center; gap: 6px; margin: 0; padding: 0; }
.dots li { width: 16px; height: 16px; border-radius: 50%; background: #ead7c3; border: 2px solid #c8ad91; }
.dots li.now { background: var(--sun); border-color: var(--ink); }
.dots li.done { background: var(--pad); border-color: var(--pad-d); }
.ask { margin: 0; text-align: center; font-size: 22px; font-weight: 600; min-height: 32px; }
.praise { margin: 0; text-align: center; min-height: 30px; font-size: 22px; font-weight: 700; color: var(--green-d); }

/* feeling pebbles: smooth stones with a face and its word */
.pebbles { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.pebble {
  width: clamp(80px, calc((100vw - 64px) / 4), 128px); min-height: 100px; padding: 10px 4px 8px; display: grid; justify-items: center; gap: 4px;
  border: 3px solid var(--ink); border-radius: 46% 54% 44% 56% / 52% 48% 52% 48%; background: radial-gradient(circle at 35% 30%, #fffdf8, var(--stone) 60%, #e3d8c6);
  box-shadow: 0 5px 0 var(--stone-d); touch-action: none; position: relative;
  transition: box-shadow .6s ease-in-out;
}
.pebble img { width: 58%; aspect-ratio: 1; pointer-events: none; }
.pebble span { font-size: 17px; font-weight: 700; pointer-events: none; }
.pebble:active { box-shadow: 0 2px 0 var(--stone-d); }
.pebble.dragging { z-index: 20; box-shadow: 0 14px 16px #0003; }
/* The hint: the screen dims around it (spotlight.js, Doug's standing rule Oct 6: no circles). */
.pebble.picked { background: radial-gradient(circle at 35% 30%, #fff, #e1f2e4 60%, #cbe8cf); border-color: var(--green-d); }
.pebble.other { opacity: .55; }
.pebble.not-yet { animation: settle .6s ease-in-out; }

/* level 3: what can Pip do? */
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.step {
  display: grid; justify-items: center; align-content: center; gap: 6px; min-height: 120px; padding: 8px 6px; text-align: center;
  font-size: 18px; font-weight: 700; line-height: 1.15;
  border: 3px solid var(--ink); border-radius: 22px; background: var(--card); box-shadow: 0 5px 0 var(--ink);
  transition: box-shadow .6s ease-in-out;
}
.step img { width: 48px; height: 48px; }
.step:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--ink); }
.step.picked { background: #e1f2e4; border-color: var(--green-d); }
.step.other { opacity: .55; }
.step.not-yet { animation: settle .6s ease-in-out; }
.steps { animation: fade .5s ease-in-out; }
.next { animation: fade .5s ease-in-out both; }

.breathe-btn {
  justify-self: center; display: inline-flex; align-items: center; gap: 10px; min-height: 56px; padding: 8px 20px;
  border: 3px solid var(--water-d); border-radius: 999px; background: #eaf4f5; color: #2b5560; font-size: 19px; font-weight: 700;
}
.bubble-mini { width: 24px; height: 24px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff, #bfe0e6 60%, #8fc3cd); border: 2px solid var(--water-d); }

/* Breathe with Pip: a bubble that grows while the child holds it. */
.breathe-layer { position: fixed; inset: 0; z-index: 40; background: #2f3b2c88; display: grid; place-items: center; padding: 16px; animation: fade .5s ease-in-out; }
.breathe-card { width: min(420px, 100%); background: var(--card); border: 3px solid var(--ink); border-radius: 26px; padding: 22px 18px; display: grid; justify-items: center; gap: 18px; }
.breathe-help { margin: 0; font-size: 22px; font-weight: 600; text-align: center; min-height: 32px; }
.bubble {
  width: 120px; height: 120px; margin: 60px 0; border-radius: 50%; border: 3px solid var(--water-d); touch-action: none;
  background: radial-gradient(circle at 35% 30%, #fff, #cfe8ec 55%, #8fc3cd);
  transform: scale(var(--grow, 1)); transition: transform .8s ease-in-out;
}

/* finish */
#finish { text-align: center; padding-top: 6px; }
.cheer { font-size: clamp(30px, 8vw, 44px); }
.calm-pond { height: clamp(170px, 28dvh, 230px); }
.faces { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; animation: fade .6s ease-in-out both; }
.faces figure { margin: 0; width: 76px; display: grid; justify-items: center; gap: 2px; background: var(--card); border: 3px solid var(--ink); border-radius: 18px; padding: 6px 2px; }
.faces img { width: 44px; height: 44px; }
.faces figcaption { font-size: 14px; font-weight: 700; }
.talk { margin: 0; background: #fff4e3; border: 2px dashed #c8ad91; border-radius: 16px; padding: 12px 14px; text-align: left; font-size: 18px; }

/* Evening look (after 6 PM unless a grown-up changes it): dimmer and warmer, same layout. */
body.evening { --sky: #e6cdb6; --sky-2: #d9b9a8; --card: #f3e6d0; }
body.evening main, body.evening .top, body.evening .breathe-card { filter: brightness(.86) sepia(.18); }

/* Motion: slow, smooth, once. Nothing loops. */
@keyframes fade { from { opacity: 0; } }
@keyframes settle { 40% { opacity: .6; transform: translateY(-6px); } }

@media (min-width: 700px) {
  .big { max-width: 520px; justify-self: center; }
  .steps { max-width: 560px; width: 100%; justify-self: center; }
}
/* short, wide screens (a phone held sideways): the pond beside the pebbles */
@media (orientation: landscape) and (max-height: 520px) {
  #play-screen { grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); align-items: start; column-gap: 18px; row-gap: 8px; }
  #play-screen .dots { grid-column: 1 / -1; }
  #play-screen .pond { grid-row: span 6; height: min(62dvh, 280px); }
  .pebble { width: clamp(80px, calc((55vw - 70px) / 4), 120px); min-height: 92px; padding-top: 6px; }
  .step { min-height: 96px; font-size: 16px; }
  .step img { width: 38px; height: 38px; }
  .praise { font-size: 19px; }
  .big { min-height: 60px; font-size: 24px; }
  .pond.demo, .calm-pond { height: 170px; }
}
/* The grown-ups text under the game (own site only, hidden under the Child lock). */
.grown-text { display: grid; gap: 8px; }
.grown-text h2 { margin: 8px 0 0; }
.grown-text h3 { margin: 6px 0 0; font-size: 19px; }
.grown-text p, .grown-text ul { margin: 0; }
.grown-text ul { padding-left: 22px; display: grid; gap: 4px; }
/* For parents: why, what they learn, how it is designed (written from games.js by web/kids-site/pages.mjs). */
.parents { display: grid; gap: 8px; }
.parents h2 { margin: 8px 0 0; }
.parents p { margin: 0; }
