/* Brushing Time: its own look (a soft bathroom blue, Hazel the bear cub, teal toothbrush; Doug picked mockup A, with
   B's step row from age 5, Oct 29). Calm by design: soft colors, slow smooth motion (0.4 to 0.8 s, ease in and out),
   the brush moves only when the child moves it. */
:root {
  --paper: #e7eef4;
  --card: #fffdf7;
  --linen: #f3f6f8;
  --ink: #3b2a1a;
  --soft: #5f5a52;
  --thread: #a9b8c4;
  --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 brushings, the steps, Hazel, the tools */
#play-screen { display: flex; flex-direction: column; gap: 8px; height: calc(100dvh - 92px - env(safe-area-inset-top)); min-height: 520px; }
.dots { list-style: none; display: flex; justify-content: center; gap: 10px; margin: 0; padding: 0; }
.dots li { opacity: .45; border-radius: 9px; }
.dots li svg { display: block; }
.dots li.now { opacity: 1; outline: 3px solid var(--ink); outline-offset: 1px; }
.dots li.done { opacity: .8; }
.steps { list-style: none; display: grid; grid-template-columns: repeat(5, minmax(0, 52px)); justify-content: center; gap: 8px; margin: 0; padding: 0; }
.steps li { display: grid; place-items: center; background: var(--card); border: 3px solid var(--ink); border-radius: 12px; padding: 2px; }
.steps li.now { background: var(--sun); }
.steps li.done { opacity: .75; }
.board-wrap { position: relative; flex: 1 1 auto; min-height: 220px; border-radius: 24px; background: #dfe9f0; transition: background-color .8s ease-in-out; }
.bedtime .board-wrap { background: #c3cede; }
#board { display: block; width: 100%; height: 100%; touch-action: none; }
.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; }

.tools { display: grid; grid-template-columns: repeat(var(--n, 3), minmax(0, 1fr)); gap: 10px; max-width: 640px; width: 100%; margin: 0 auto; }
.tool-btn {
  display: grid; justify-items: center; gap: 0; padding: 6px 2px 8px; min-height: 92px; background: var(--card); border: 3px solid var(--ink);
  border-radius: 18px; box-shadow: 0 4px 0 var(--ink); font-weight: 700; font-size: 14px; line-height: 1.1; overflow-wrap: anywhere;
}
.tool-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.tool-btn[aria-pressed='true'] { background: #fff1c7; }
.tool-btn svg { width: 56px; height: 56px; }

.spot { transition: opacity .5s ease-in-out; }
.spot.gone { opacity: 0 !important; }
.tool { cursor: grab; }
.tool.arrive { animation: fade .5s ease-in-out both; }

/* finish: Hazel twice, morning and bedtime */
#finish { text-align: center; padding-top: 6px; gap: 14px; }
.cheer { font-size: clamp(30px, 8vw, 44px); }
.parade { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; animation: fade .6s ease-in-out both; }
.parade figure { margin: 0; display: grid; justify-items: center; gap: 6px; padding: 10px; background: var(--card); border: 3px solid var(--ink); border-radius: 20px; }
.parade figure svg:last-of-type { width: 100%; max-width: 260px; height: auto; }
.parade figcaption { font-weight: 700; font-size: 20px; }
.talk { margin: 0; background: #f6fbff; 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; } }
@keyframes nope { 40% { opacity: .5; } }

@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); }
  .tool-btn { min-height: 64px; }
  .tool-btn span { display: none; }
  .tool-btn svg { width: 44px; height: 44px; }
  .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 figure svg:last-of-type, .tool-btn svg { filter: var(--sticker); }
