/* One meadow. The song stays on the page with the letters, words, and stories. */
:root {
  --ink: #243232;
  --cream: #f6f1e6;
  --nest: #fffaf3;
  --line: #e4d5c0;
  --quiet: #d96b6b;
  --hear: #e7f2f8;
  --hear-line: #3d7ea6;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100vh;
  padding-bottom: calc(132px + env(safe-area-inset-bottom));
  color: var(--ink);
  font-family: "Comic Sans MS", "Chalkboard SE", "Segoe UI", "Trebuchet MS", "Gill Sans", sans-serif;
  font-variant-ligatures: none;
  background:
    radial-gradient(880px 380px at 50% -80px, #fff1b8 0%, rgba(255, 241, 184, 0) 62%),
    linear-gradient(180deg, #b7def2 0%, #e8f5fb 24%, #fbf6ea 52%, #e3f2c8 100%);
  background-attachment: fixed;
}
button, summary { font: inherit; color: inherit; }
button {
  position: relative;
  border: 3px solid transparent;
  background: #fff;
  border-radius: 22px;
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
button:focus-visible {
  outline: 4px solid var(--hear-line);
  outline-offset: 3px;
}
.ear {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.top { padding: 14px 12px 2px; text-align: center; }
h1 {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0;
  font-size: clamp(36px, 8vw, 60px);
  letter-spacing: 0.02em;
  font-weight: 800;
}
.sun {
  width: 0.68em;
  height: 0.68em;
  border-radius: 50%;
  background: #f6d35a;
  box-shadow: 0 0 0 0.14em #f8e7a4;
  flex: 0 0 auto;
}
.status {
  margin: 6px auto 0;
  max-width: 36rem;
  min-height: 1.35em;
  font-size: clamp(20px, 4vw, 28px);
  line-height: 1.25;
  font-weight: 800;
}
.page { max-width: 1180px; margin: 0 auto; padding: 6px 10px 12px; }
.mat {
  background: rgba(255, 250, 243, 0.94);
  border: 4px solid #fff;
  border-radius: 36px;
  box-shadow: 0 8px 0 #d5e4b4;
  padding: 10px;
}
.spots, .row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}
.spots {
  padding: 10px 8px;
  border-radius: 28px;
  background: linear-gradient(#e7f4cc, #cfe6b0);
}
.spot, .animal {
  width: 100px;
  min-height: 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 6px 4px 8px;
  border-color: #8eae72;
  border-style: dashed;
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.55);
  box-shadow: 0 5px 0 rgba(36, 50, 50, 0.1);
}
.animal {
  width: 80px;
  min-height: 78px;
  border-style: solid;
  border-color: #fff;
  touch-action: none;
}
.spot.filled { border-style: solid; border-color: #fff; }
.animal.picked { box-shadow: 0 0 0 4px #fff, 0 0 0 8px var(--ink); }
.animal.here { box-shadow: inset 0 0 0 4px #fff; }
.animal.picked.here { box-shadow: 0 0 0 4px #fff, 0 0 0 8px var(--ink); }
.pillow {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  box-shadow: inset 0 -5px 0 rgba(170, 196, 130, 0.45);
}
.face { width: 48px; height: 48px; display: block; }
.who { font-size: 16px; font-weight: 800; line-height: 1.1; }
.friends { margin-top: 10px; }
.wordline, .actions, .boxes, .tiles, .strip, .dots, .sentence {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 10px auto 0;
}
.wordline button, .actions button, .tiles button {
  min-height: 56px;
  padding: 8px 12px;
  font-size: 22px;
  font-weight: 800;
  border-color: var(--line);
}
.wordline button.ph {
  min-width: 76px;
  min-height: 76px;
  font-size: 40px;
  background: var(--hear);
  border-color: var(--hear-line);
}
.wordline .go { min-width: 128px; min-height: 76px; font-size: 28px; }
.actions .go, .wordline .go, #play {
  background: var(--hear);
  border-color: var(--hear-line);
}
.actions button { flex: 1 1 42%; max-width: 220px; white-space: nowrap; }
.actions .go { flex: 1 1 100%; max-width: 440px; }
.jumps {
  display: flex;
  justify-content: center;
  gap: 8px;
  max-width: 680px;
  margin: 12px auto 0;
}
.jumps button {
  flex: 1 1 0;
  max-width: 190px;
  min-height: 88px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 6px 4px 8px;
  background: var(--nest);
  border: 4px solid #fff;
  border-radius: 28px;
  box-shadow: 0 6px 0 #e4d3b8;
}
.jumps .pic { width: 58px; height: 58px; }
.jumps .who { font-size: 18px; }
.lessons { display: flex; flex-direction: column; gap: 14px; margin-top: 12px; }
.lesson {
  min-width: 0;
  background: var(--nest);
  border: 4px solid #fff;
  border-radius: 32px;
  box-shadow: 0 8px 0 #e7d7c0;
  padding: 12px 10px 16px;
  container-type: inline-size;
  scroll-margin-top: 8px;
}
.lesson.letters { box-shadow: 0 8px 0 #f0c4a8; }
.lesson.words { box-shadow: 0 8px 0 #b5d7a4; background: #f7fff3; }
.lesson.story { box-shadow: 0 8px 0 #b5d0e6; background: #f5fbff; }
.part {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0;
  font-size: 28px;
  font-weight: 800;
}
.part .pic { width: 52px; height: 52px; }
.pic { width: 84px; height: 84px; display: block; }
.lettertop {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.lettertop .nest { width: min(190px, 48%); min-height: 112px; margin: 8px 0 0; }
.lettertop .hero { margin: 0; }
.hero { display: flex; justify-content: center; margin-top: 4px; }
.lesson .hero .pic { width: 104px; height: 104px; }
.nest {
  width: min(100%, 280px);
  min-height: 132px;
  margin: 8px auto 0;
  border-radius: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: #fff;
  border: 3px solid #f0d8c4;
}
.giant {
  font-size: 104px;
  font-size: clamp(88px, 30cqi, 150px);
  line-height: 0.8;
  font-weight: 800;
}
.partner {
  font-size: 40px;
  font-weight: 800;
  align-self: flex-end;
  margin-bottom: 16px;
}
.keyword {
  margin: 10px 0 0;
  text-align: center;
  font-size: 34px;
  font-size: clamp(26px, 12cqi, 48px);
  font-weight: 800;
  letter-spacing: 0.06em;
}
.keyword .key { text-decoration: underline; text-underline-offset: 6px; }
.boxes { gap: 8px; }
.box, .tiles button {
  width: 68px;
  min-width: 68px;
  height: 76px;
  font-size: 38px;
  font-weight: 800;
}
.box {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 3px dashed var(--line);
  border-radius: 18px;
  background: #fff;
}
.box.filled { border-style: solid; }
.boxes.ready .box { background: #e7f6df; border-style: solid; border-color: #6a9a55; }
.slot.lit, .box.lit, .storyword.lit { background: #fff3c4; }
.sentence { max-width: 40rem; gap: 6px; }
.storyword {
  min-height: 58px;
  padding: 6px 10px;
  font-size: 30px;
  font-weight: 800;
  border-color: transparent;
  background: transparent;
}
.find {
  margin: 12px auto 0;
  width: fit-content;
  background: #fff3c4;
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 24px;
  font-weight: 800;
}
.strip { flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; padding: 4px 2px 10px; }
.strip button {
  flex: 0 0 52px;
  height: 60px;
  font-size: 26px;
  font-weight: 800;
  border-color: var(--line);
}
.strip button[aria-current="true"] { border-color: var(--ink); background: #fff; }
.dots { gap: 6px; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: #e4d5c0; }
.dot.on { background: var(--ink); }
.dot.did { background: #8fbf78; }
.mine { margin-top: 12px; text-align: center; }
.label { margin: 0 0 6px; font-size: 20px; font-weight: 800; }
.bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 3;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 8px 8px calc(10px + env(safe-area-inset-bottom));
  background: rgba(232, 242, 214, 0.97);
  box-shadow: 0 -8px 16px rgba(36, 50, 50, 0.05);
}
.volumes, .sound { display: flex; gap: 8px; justify-content: center; }
.bar button {
  min-width: 76px;
  min-height: 48px;
  padding: 8px 12px;
  font-size: 18px;
  font-weight: 800;
  border-color: var(--line);
}
.bar button[hidden] { display: none; }
.bar button[aria-pressed="true"] { border-color: var(--ink); }
.quiet { background: #f8e4e4; border-color: var(--quiet); color: #6d2e2e; }
body.wiggle .spot.filled .face { animation: bob 1.4s ease-in-out infinite; }
@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
.grown {
  max-width: 40rem;
  margin: 8px auto 12px;
  padding: 0 16px 8px;
  font-size: 16px;
}
.grown summary { cursor: pointer; font-weight: 800; }
.grown p { margin: 8px 0 0; line-height: 1.45; }
@media (max-width: 560px) {
  body { padding-bottom: calc(156px + env(safe-area-inset-bottom)); }
  .lessons { margin-top: 242px; }
  .bar { gap: 6px; }
  .volumes { flex: 1 1 auto; gap: 6px; }
  .volumes button, #wiggle {
    flex: 1 1 0;
    min-width: 0;
    padding: 6px 2px;
    font-size: 16px;
  }
  .sound { flex: 1 1 100%; }
  .sound .quiet, .sound #play { flex: 1; }
  .top { padding: 8px 8px 0; }
  h1 { font-size: 34px; }
  .status { font-size: 20px; }
  .page { padding: 4px 8px 8px; }
  .mat { padding: 8px; }
  .jumps .pic { width: 52px; height: 52px; }
  .jumps .who { font-size: 16px; }
  .lesson .hero .pic { width: 92px; height: 92px; }
  .storyword { font-size: 26px; }
}
@media (min-width: 561px) {
  .spot, .animal { width: 112px; min-height: 116px; }
  .face { width: 64px; height: 64px; }
  .who { font-size: 18px; }
  .pillow { width: 52px; height: 52px; }
  .bar button { min-width: 92px; min-height: 52px; font-size: 20px; }
  body { padding-bottom: calc(108px + env(safe-area-inset-bottom)); }
}
@media (min-width: 760px) and (max-width: 999px) {
  .animal { width: 96px; min-height: 104px; }
}
@media (min-width: 760px) {
  body {
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding-bottom: 0;
  }
  .top, .grown, .bar { flex: 0 0 auto; }
  main { flex: 1 1 auto; min-height: 0; overflow: auto; }
  .bar { position: static; }
  .grown { max-height: 24vh; overflow: auto; }
  .lessons { display: grid; grid-template-columns: 1fr 1fr; align-items: start; }
  #letters { grid-column: 1 / -1; }
  .actions button { flex: 1 1 30%; }
}
@media (min-width: 1000px) {
  .jumps { display: none; }
  .lessons { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  #letters { grid-column: auto; }
  .box, .tiles button { width: 56px; min-width: 56px; height: 66px; font-size: 30px; }
  .lesson .hero .pic { width: 88px; height: 88px; }
  .part { font-size: 24px; }
  .part .pic { width: 44px; height: 44px; }
}
@media (min-width: 760px) and (max-height: 860px) {
  .lettertop .nest { min-height: 84px; }
  .lettertop .hero .pic, #words .hero .pic, #story .hero .pic { width: 68px; height: 68px; }
  .giant { font-size: 72px; }
  .partner { font-size: 28px; margin-bottom: 8px; }
  .keyword { margin-top: 4px; }
  .actions, .boxes, .tiles, .sentence { margin-top: 6px; }
  .box, .tiles button { width: 50px; min-width: 50px; height: 54px; font-size: 26px; }
  .part .pic { width: 36px; height: 36px; }
  .part { font-size: 20px; margin-bottom: 0; }
  .find { margin-top: 6px; padding: 4px 12px; }
}
@media (min-width: 1000px) and (max-height: 820px) {
  .top { padding-top: 8px; }
  h1 { font-size: 36px; }
  .status { font-size: 18px; margin-top: 2px; }
  .page { padding-top: 0; }
  .mat { padding: 6px; }
  .spots { padding: 6px 6px; }
  .spot, .animal { min-height: 82px; width: 96px; padding-top: 4px; padding-bottom: 4px; }
  .face { width: 44px; height: 44px; }
  .friends { margin-top: 6px; }
}
