/* Snack Stop: its own look (warm picnic cream, a teal snack machine, Nutmeg the field mouse; Doug picked mockup A, then
   B's pennies from age 5, Oct 29). Calm by design: soft colors, slow smooth motion (0.4 to 0.8 s, ease in and out),
   one thing moves at a time. */
:root {
  --paper: #f3eedd;
  --card: #fffdf7;
  --linen: #f8f4e8;
  --ink: #3b2a1a;
  --soft: #5f5a52;
  --thread: #c9b98f;
  --green: #3f8f8a;
  --green-d: #2f6f6b;
  --sun: #f6c744;
  --radius: 20px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100dvh;
  /* Look B (Doug, Nov 3): the bright blue field comes from look-b.css; this is only the color before it loads. */
  background-color: #1f5fbf;
  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: #2f5f8f; }
[hidden] { display: none !important; }

/* 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; }
.brand svg { display: block; }
.back, .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;
}
.back:active, .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(24px + env(safe-area-inset-bottom)); }
.screen { display: grid; gap: 18px; }

/* home */
.hero { text-align: center; display: grid; gap: 8px; justify-items: center; }
.hero h1 { font-size: clamp(34px, 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: 8px 4px 10px;
  display: grid; justify-items: center; align-content: start; gap: 2px; font-weight: 700; font-size: 17px; line-height: 1.15; min-height: 56px;
}
.pick button svg { width: min(22vw, 96px); height: auto; margin-bottom: 4px; }
.pick button small { font-size: 14px; font-weight: 500; color: var(--soft); }
.pick button[aria-pressed='true'] { background: #e3f0de; 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 #4a362033; }
.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); }
.grown-text, .parents { display: grid; gap: 8px; }
.grown-text h2, .parents h2 { margin: 8px 0 0; }
.grown-text h3 { margin: 6px 0 0; font-size: 19px; }
.grown-text p, .grown-text ul, .parents p { margin: 0; }
.grown-text ul { padding-left: 22px; display: grid; gap: 6px; }

/* the play screen: the snacks, the machine and Nutmeg, the keypad (or the pennies) */
#play-screen { display: flex; flex-direction: column; gap: 8px; height: calc(100dvh - 92px - env(safe-area-inset-top)); min-height: 560px; }
.dots { list-style: none; display: flex; justify-content: center; gap: 10px; margin: 0; padding: 0; }
.dots li { width: 18px; height: 18px; border-radius: 6px; border: 3px solid var(--ink); background: var(--card); opacity: .5; }
.dots li.now { opacity: 1; background: var(--sun); }
.dots li.done { opacity: .9; background: var(--green); }
.board-wrap { position: relative; flex: 1 1 auto; min-height: 220px; border-radius: 24px; background: #f8f3e3; }
#board { display: block; width: 100%; height: 100%; touch-action: manipulation; }
#board .win { cursor: pointer; }
.said { margin: 0; min-height: 26px; text-align: center; font-size: 17px; color: var(--ink); }
.next { position: absolute; z-index: 2; left: 16px; right: 16px; bottom: 16px; width: auto; animation: fade .5s ease-in-out both; }

/* the keypad: 1 to 9 in three equal rows */
.keys { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; max-width: 420px; width: 100%; margin: 0 auto; }
.keys button {
  min-height: 52px; background: var(--card); border: 3px solid var(--ink); border-radius: 14px; box-shadow: 0 4px 0 var(--ink);
  font-size: 28px; font-weight: 700; line-height: 1;
}
.keys button:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }

/* paying: the price spots, then the penny tray */
.pay { display: grid; gap: 10px; max-width: 520px; width: 100%; margin: 0 auto; }
.spots { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; min-height: 48px; }
.spot { width: 44px; height: 44px; border-radius: 50%; border: 3px dashed var(--thread); background: var(--linen); transition: background-color .5s ease-in-out, border-color .5s ease-in-out; }
.spot.in { border: 3px solid var(--ink); background: #c98a4b; }
.purse { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; padding: 8px; border-radius: 18px; background: #e6dcbc; border: 3px solid var(--ink); }
.penny {
  min-height: 64px; border: 3px solid var(--ink); border-radius: 50%; aspect-ratio: 1; justify-self: center; width: 64px;
  background: #c98a4b; color: #fff; font-size: 18px; font-weight: 700; box-shadow: 0 4px 0 var(--ink); padding: 0;
}
.penny:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.penny-fly {
  position: fixed; z-index: 40; border: 3px solid var(--ink); border-radius: 50%; background: #c98a4b; pointer-events: none;
  transform-origin: center; transition: transform .6s ease-in-out;
}
.snack.eaten { opacity: 0; transition: opacity .5s ease-in-out; }

/* finish: Nutmeg's picnic */
#finish { text-align: center; padding-top: 6px; gap: 14px; }
.cheer { font-size: clamp(30px, 8vw, 44px); }
.parade { animation: fade .6s ease-in-out both; }
.parade svg { width: 100%; max-width: 560px; height: auto; }
.talk { margin: 0; background: #fffaf0; border: 2px dashed var(--thread); 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 { --paper: #dde3e6; --card: #f3efe4; }
body.evening main, body.evening .top { filter: brightness(.86) sepia(.18); }

/* Motion: slow, smooth, once. Nothing loops or shakes. */
@keyframes fade { from { opacity: 0; } }

@media (min-width: 700px) {
  .big { max-width: 520px; justify-self: center; }
  .next { max-width: none; }
}
/* short, wide screens (a phone held sideways): less room above the board */
@media (orientation: landscape) and (max-height: 520px) {
  .top { min-height: 52px; padding-top: max(4px, env(safe-area-inset-top)); padding-bottom: 2px; }
  #play-screen { min-height: 0; height: calc(100dvh - 64px); }
  .keys button { min-height: 40px; font-size: 22px; }
  .penny { min-height: 48px; width: 48px; }
  .said { min-height: 0; font-size: 15px; }
  .next { min-height: 64px; font-size: 26px; }
}

/* Hear it again: a big speaker beside the line, for children who cannot read it (Doug, Oct 20: "audio is crucial"). */
.said-row { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 0 16px 8px; }
.hear { flex: none; width: 56px; height: 56px; border: 3px solid var(--ink); border-radius: 50%; background: var(--card); color: var(--ink); box-shadow: 0 4px 0 var(--ink); display: grid; place-items: center; padding: 0; cursor: pointer; }
.hear:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--ink); }
.said-row .said { flex: 0 1 auto; min-width: 0; }

/* Sticker pieces (Doug, Oct 30: "1 with the storybook backgrounds"): a thin dark edge round each picture, like the home
   tiles, so it stands out on the storybook background. */
.parade svg { filter: var(--sticker); }
