/* Block Towers: its own look (a sky over grass, honey-colored wooden blocks on a wooden stand; Doug picked mockup A,
   with C for the ten-and-more level, Oct 29). Calm by design: soft colors, slow smooth motion (0.4 to 0.8 s, ease in
   and out), one block moving at a time. */
:root {
  --paper: #e3f0ee;
  --card: #fffdf7;
  --linen: #f6f1e4;
  --ink: #3b2a1a;
  --soft: #6a5a48;
  --thread: #b9a27e;
  --green: #4f8f4a;
  --green-d: #3a6f37;
  --sun: #f2c46d;
  --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 board: the tower and the tray */
#play-screen { gap: 8px; }
.dots { list-style: none; display: flex; justify-content: center; gap: 8px; margin: 0; padding: 0; }
.dots li { width: 22px; height: 22px; border-radius: 6px; background: var(--card); border: 3px dashed #8f5f34; }
.dots li.now { border-style: solid; }
.dots li.done { border-style: solid; background: #f2c46d; }
.board-wrap { position: relative; height: min(calc(100dvh - 150px - env(safe-area-inset-top)), calc((min(100vw, 792px) - 32px) * 1.5)); min-height: 260px; }
#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; width: auto; animation: fade .5s ease-in-out both; }

/* ten and more: the number sentence, each number inside its own card */
.sum { display: flex; justify-content: center; align-items: center; gap: 8px; font-weight: 700; font-size: 28px; }
.sum .card { min-width: 52px; padding: 2px 10px; text-align: center; background: var(--card); border: 3px solid var(--ink); border-radius: 12px; }
.sum .op { font-size: 26px; }
.with-sum .board-wrap { height: min(calc(100dvh - 210px - env(safe-area-inset-top)), calc((min(100vw, 792px) - 32px) * 1.5)); }

.shelf { fill: #b9824f; stroke: #3b2a1a; stroke-width: .8; }
.shelf-in { fill: #e2c294; }
.layer-tray .block, .layer-fly .block { cursor: grab; }
.block.lifted { filter: drop-shadow(0 1px 1px #0005); }
/* The hint: the screen dims around it (spotlight.js, Doug's standing rule Oct 6: no circles). */
.block.arrive { animation: fade .5s ease-in-out both; }
.block.leave { opacity: 0; transition: opacity .5s ease-in-out; pointer-events: none; }

/* finish: the towers lined up on the grass */
#finish { text-align: center; padding-top: 6px; gap: 14px; }
.cheer { font-size: clamp(30px, 8vw, 44px); }
.parade {
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; padding: 14px 10px 0; align-items: end;
  background: linear-gradient(180deg, #e3f0ee 0 82%, #cfe3b5 82%); border-radius: 20px; border: 3px solid var(--ink); animation: fade .6s ease-in-out both;
}
.parade svg { display: block; width: 100%; max-height: 300px; height: auto; }
.talk { margin: 0; background: #fffbea; 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: #d9e3dc; --card: #f3eedf; }
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; }
  .board-wrap { height: calc(100dvh - 104px); }
  .said { min-height: 0; font-size: 15px; }
  .dots li { width: 12px; height: 12px; }
  .next { min-height: 64px; font-size: 26px; }
  .with-sum .board-wrap { height: calc(100dvh - 150px); }
  .sum { font-size: 20px; }
  .sum .card { min-width: 40px; }
}

/* 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); }
