/* Baby's app. Big targets, no text for her (the grown-up tip is the only
   writing in a round), works in Silk on a Fire tablet (no :has, no nesting). */
:root {
  --bg: #fff4dc;
  --ink: #3a2e2a;
  --soft: #7a6a60;
  --go: #2fae6a;
  --card: #ffffff;
  --line: #eadcc4;
  --show: #ffd23f;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
  overscroll-behavior: none;
}
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; touch-action: manipulation; }
main { min-height: 100vh; display: flex; flex-direction: column; align-items: center; padding: 16px; }

/* home */
.home { justify-content: center; gap: 12px; position: relative; }
.gear { position: absolute; top: 10px; right: 10px; font-size: 22px; opacity: .45; padding: 10px; }
.baby-big { padding: 0; }
.go {
  width: 120px; height: 120px; border-radius: 50%;
  background: var(--go); color: #fff; font-size: 54px; line-height: 1;
  box-shadow: 0 6px 0 #1f8a52; animation: pulse 1.6s ease-in-out infinite;
}
.go:active { transform: translateY(4px); box-shadow: 0 2px 0 #1f8a52; }
@keyframes pulse { 50% { transform: scale(1.06); } }

/* round */
.round { justify-content: flex-start; gap: 8px; position: relative; }
.tip {
  margin: 0; max-width: 560px; width: 100%; padding: 8px 12px; border-radius: 12px;
  background: rgba(255, 255, 255, .7); color: var(--soft); font-size: 15px; text-align: center;
  text-wrap: pretty;
}
.corner { position: absolute; left: 6px; bottom: 6px; pointer-events: none; }
.stage { flex: 1; width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; }
.next { margin-top: 8px; }
.things { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; max-width: 640px; }
.thing { border-radius: 20px; padding: 6px; transition: transform .2s; }
.thing.on { background: #fff; box-shadow: 0 0 0 5px var(--show); transform: scale(1.08); }
.choices { display: flex; gap: 22px; justify-content: center; flex-wrap: wrap; }
.choice {
  background: var(--card); border-radius: 28px; padding: 14px; min-width: 150px; min-height: 150px;
  box-shadow: 0 5px 0 var(--line); display: flex; align-items: center; justify-content: center;
}
.choice.dim { opacity: .45; }
.choice.show { box-shadow: 0 0 0 8px var(--show); animation: pulse 1s ease-in-out infinite; }
.choice.right { box-shadow: 0 0 0 8px var(--go); }
.big-letter, .letter { font-size: 120px; font-weight: 800; line-height: 1; font-family: "Andika", "Comic Sans MS", system-ui, sans-serif; }
.letter { background: var(--card); border-radius: 32px; width: 200px; height: 200px; box-shadow: 0 6px 0 var(--line); color: #5b5bd6; }
.big-letter { display: block; width: 130px; color: #5b5bd6; }
.target { padding: 10px; background: var(--card); border-radius: 28px; }
.beats { display: flex; gap: 14px; }
.beat { width: 34px; height: 34px; border-radius: 50%; background: #fff; border: 4px solid var(--line); }
.beat.on { background: var(--show); border-color: #e6b800; }
.drum { padding: 0; }
.drum:active { transform: scale(.94); }
.mission { font-size: 22px; max-width: 480px; text-align: center; text-wrap: balance; background: var(--card); padding: 18px; border-radius: 20px; }

/* Baby talking: his mouth opens and closes while a line plays */
.baby .mouth { transform-origin: 100px 136px; transform-box: view-box; }
.baby-talking .baby .mouth { animation: talk .28s ease-in-out infinite alternate; }
@keyframes talk { from { transform: scaleY(.6); } to { transform: scaleY(1.25); } }

/* grown-ups */
.grown { gap: 8px; max-width: 560px; margin: 0 auto; align-items: stretch; }
.grown h1 { margin: 8px 0; text-wrap: balance; }
.grown h2 { margin: 16px 0 4px; font-size: 18px; text-wrap: balance; }
.grown p { margin: 4px 0; text-wrap: pretty; }
.small { font-size: 14px; color: var(--soft); }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.pill { background: var(--card); border-radius: 999px; padding: 12px 18px; min-height: 48px; min-width: 48px; box-shadow: 0 3px 0 var(--line); font-size: 17px; }
.pill.on { background: var(--go); color: #fff; }
.pill.quiet { margin-top: 18px; align-self: center; }
.pill:disabled { opacity: .4; }
.level { display: flex; align-items: center; gap: 10px; }
.level span { flex: 1; }
.level b { min-width: 96px; text-align: center; white-space: nowrap; }

@media (max-width: 520px) {
  .choice { min-width: 130px; min-height: 130px; }
  .letter { width: 160px; height: 160px; font-size: 100px; }
}

/* Baby's crib */
.crib-wrap { padding: 0; width: 100%; max-width: 760px; display: block; }
.crib { width: 100%; height: auto; display: block; border-radius: 24px; box-shadow: 0 6px 0 var(--line); }
.home.asleep { justify-content: center; }
.toy { cursor: pointer; }
.toy .move { transform-box: fill-box; transform-origin: 50% 80%; }
.do-wiggle { animation: wiggle .6s ease-in-out; }
.do-squeak { animation: squish .4s ease-in-out; }
.do-bounce { animation: bounce .6s ease-out; }
.do-shake { animation: shake .5s ease-in-out; }
.do-spin { animation: wiggle 1.6s ease-in-out; }
.do-glow { animation: glow 1.2s ease-in-out; }
.do-glow .glow { animation: glowon 1.2s ease-in-out; }
@keyframes wiggle { 25% { transform: rotate(-10deg); } 75% { transform: rotate(10deg); } }
@keyframes squish { 50% { transform: scale(1.2, .8); } }
@keyframes bounce { 40% { transform: translateY(-24px); } 70% { transform: translateY(0); } 85% { transform: translateY(-8px); } }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
@keyframes glow { 50% { transform: scale(1.15); } }
@keyframes glowon { 50% { opacity: .8; } }
.toy.want .move { animation: pulse 1s ease-in-out infinite; }
.toy.want { filter: drop-shadow(0 0 6px #ffd23f); }
.moon { background: #3d4a8c; box-shadow: 0 6px 0 #2a3366; font-size: 52px; animation: none; }
.moon.sleepy { animation: pulse 1.2s ease-in-out infinite; }

@media (prefers-reduced-motion: reduce) {
  .go, .choice.show, .moon.sleepy, .toy.want .move, .baby-talking .baby .mouth { animation: none; }
}
