/* Calm: soft colors, one thing per screen, big touch targets, no background motion. */
:root {
  --bg: #f6f1e8; --card: #fffdf9; --ink: #2d2a26; --muted: #7b736a; --line: #e4dccf;
  --accent: #4f9d93; --accent-ink: #fff; --hint: #ffd66b; --right: #7cc49a; --danger: #c0625a;
  --font: "Noto Sans Hebrew", "Alef", "Rubik", "Arial Hebrew", Arial, sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); font-family: var(--font); }
body { overscroll-behavior: none; user-select: none; -webkit-user-select: none; }
button { font-family: inherit; color: inherit; cursor: pointer; }
#app { min-height: 100%; }

/* home */
.home { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; position: relative; }
.home-buttons { display: flex; gap: 6vw; flex-wrap: wrap; justify-content: center; }
.big-choice { width: min(38vw, 300px); aspect-ratio: 1; border: 3px solid var(--line); border-radius: 36px; background: var(--card);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; box-shadow: 0 4px 0 var(--line); }
.big-choice:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--line); }
.big-choice:disabled { opacity: .35; }
.big-icon { font-size: min(16vw, 120px); line-height: 1; }
.letter-icon { color: var(--accent); font-weight: 700; }
.big-label { font-size: min(6vw, 34px); font-weight: 600; }
.gate { position: absolute; top: 14px; left: 14px; width: 48px; height: 48px; border-radius: 50%; border: none; background: transparent;
  font-size: 26px; color: #c9c0b3; touch-action: none; }
.gate-ring { position: absolute; inset: 0; border-radius: 50%; border: 3px solid transparent; }
.gate.holding .gate-ring { border-color: var(--accent); animation: ring 2s linear forwards; }
@keyframes ring { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0 0 0 0); } }

/* game */
.game { min-height: 100vh; display: flex; flex-direction: column; padding: 14px 20px 28px; }
.topbar { display: flex; align-items: center; justify-content: space-between; }
.home-btn { border: none; background: transparent; font-size: 30px; opacity: .55; width: 56px; height: 56px; }
.dots { display: flex; gap: 8px; }
.dot { width: 14px; height: 14px; border-radius: 50%; background: var(--line); }
.dot.done { background: var(--accent); }
.dot.now { background: var(--card); border: 3px solid var(--accent); }
.prompt { flex: 1; display: flex; align-items: center; justify-content: center; min-height: 34vh; }
.speaker { border: none; background: var(--card); border-radius: 50%; width: 64px; height: 64px; font-size: 30px; box-shadow: 0 3px 0 var(--line); }
.speaker.big { width: 140px; height: 140px; font-size: 64px; }
.picture-wrap { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.picture { width: min(52vw, 42vh, 380px); height: min(52vw, 42vh, 380px); object-fit: cover; border-radius: 28px; background: var(--card); border: 3px solid var(--line); }
.picture.emoji { display: flex; align-items: center; justify-content: center; font-size: min(30vw, 24vh, 220px); }
.choices { display: flex; gap: 4vw; justify-content: center; flex-wrap: wrap; padding-top: 10px; }
.choice { min-width: min(26vw, 200px); height: min(26vw, 22vh, 200px); padding: 0 18px; border-radius: 30px; border: 4px solid var(--line);
  background: var(--card); font-size: min(17vw, 15vh, 140px); line-height: 1; font-weight: 700; box-shadow: 0 4px 0 var(--line);
  transition: opacity .4s, box-shadow .4s, border-color .4s, transform .15s; }
.choice.word { font-size: min(10vw, 9vh, 76px); font-weight: 600; min-width: min(36vw, 280px); }
.choices.n4 .choice { min-width: min(20vw, 170px); height: min(20vw, 19vh, 170px); font-size: min(13vw, 12vh, 110px); }
.choices.n4 .choice.word { font-size: min(7vw, 7vh, 56px); min-width: min(24vw, 220px); }
.choice:active { transform: translateY(3px); }
/* Errorless hint: the right answer glows. The glow fades over the next answers (3 → 1). */
.choice.hint-3 { border-color: var(--hint); box-shadow: 0 0 0 10px rgba(255, 214, 107, .55), 0 4px 0 var(--line); transform: scale(1.06); }
.choice.hint-2 { border-color: var(--hint); box-shadow: 0 0 0 6px rgba(255, 214, 107, .35), 0 4px 0 var(--line); }
.choice.hint-1 { border-color: #f3e2b0; box-shadow: 0 0 0 3px rgba(255, 214, 107, .2), 0 4px 0 var(--line); }
.choice.dim { opacity: .4; }
.choice.right { border-color: var(--right); background: #eaf6ee; box-shadow: 0 0 0 10px rgba(124, 196, 154, .35); transform: scale(1.06); }

/* end */
.end { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; }
.end-mark { font-size: 120px; animation: soft 1.2s ease-out; }
@keyframes soft { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.end-text { font-size: 56px; font-weight: 700; }
.end-btn { border: 3px solid var(--line); background: var(--card); border-radius: 28px; font-size: 54px; width: 130px; height: 110px; box-shadow: 0 4px 0 var(--line); }

/* parent */
.parent { max-width: 860px; margin: 0 auto; padding: 18px 16px 60px; user-select: text; -webkit-user-select: text; }
.parent-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.parent h1 { font-size: 26px; margin: 8px 0; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 16px; margin: 14px 0; }
.card h2 { font-size: 20px; margin: 0 0 10px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.card h3 { font-size: 16px; margin: 14px 0 6px; color: var(--muted); }
.muted { color: var(--muted); font-size: 14px; margin: 4px 0 8px; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.row:first-of-type { border-top: none; }
.row-label { font-size: 16px; }
.seg { display: flex; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.seg button { border: none; background: transparent; padding: 10px 16px; font-size: 16px; min-width: 56px; }
.seg button.on { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip.letter { position: relative; width: 54px; height: 54px; border-radius: 14px; border: 2px solid var(--line); background: #fff; font-size: 28px; font-weight: 700; color: #b9b0a3; }
.chip.letter.on { border-color: var(--accent); color: var(--ink); background: #eef7f5; }
.meter { position: absolute; bottom: 5px; left: 10px; right: 10px; height: 4px; border-radius: 2px; background: var(--line); }
.meter.m1 { background: linear-gradient(to left, var(--accent) 33%, var(--line) 33%); }
.meter.m2 { background: linear-gradient(to left, var(--accent) 66%, var(--line) 66%); }
.meter.m3 { background: var(--accent); }
.wrow { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.thumb { width: 48px; height: 48px; border-radius: 10px; object-fit: cover; flex: none; background: #fff; border: 1px solid var(--line); }
.thumb.emoji { display: inline-flex; align-items: center; justify-content: center; font-size: 30px; }
.wtext { flex: 1; font-size: 24px; font-weight: 600; }
.wvoice { font-size: 18px; }
.wrow select { font: inherit; font-size: 15px; padding: 8px; border-radius: 10px; border: 1px solid var(--line); background: #fff; }
.icon { border: 1px solid var(--line); background: #fff; border-radius: 10px; width: 42px; height: 42px; font-size: 18px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line); background: #fff; border-radius: 12px; padding: 10px 16px; font-size: 16px; cursor: pointer; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
.btn.danger { color: var(--danger); border-color: #e9c3bf; }
.btn.small { padding: 4px 10px; font-size: 14px; }
.btn.recording { background: #fbe9e7; border-color: var(--danger); }
.btns { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.btns.end { margin-top: 18px; }

/* word editor */
.overlay { position: fixed; inset: 0; background: rgba(45, 42, 38, .35); display: flex; align-items: flex-start; justify-content: center; padding: 16px; overflow: auto; z-index: 10; }
.modal { background: var(--card); border-radius: 20px; padding: 18px; width: min(560px, 100%); margin-top: 4vh; user-select: text; -webkit-user-select: text; }
.modal h2 { margin: 0 0 12px; }
.field { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; font-size: 15px; color: var(--muted); }
.text-in { font: inherit; font-size: 34px; padding: 10px 14px; border-radius: 12px; border: 2px solid var(--line); color: var(--ink); background: #fff; }
.text-in:focus { outline: none; border-color: var(--accent); }
.fix-line { font-size: 14px; color: var(--muted); min-height: 1em; }
.pic-row { display: flex; gap: 14px; align-items: flex-start; }
.edit-pic { width: 130px; height: 130px; border-radius: 16px; border: 2px dashed var(--line); display: flex; align-items: center; justify-content: center; overflow: hidden; background: #fff; flex: none; }
.edit-pic img { width: 100%; height: 100%; object-fit: cover; }
.edit-pic .emoji { font-size: 64px; }
.col { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.emoji-in { font-size: 28px; width: 90px; padding: 6px; text-align: center; border-radius: 10px; border: 1px solid var(--line); }

/* motion is controlled by html[data-motion] (see the end of this file) */

/* child profiles */
.me { position: absolute; top: 12px; right: 14px; border: none; background: transparent; padding: 0; }
.me-photo { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; border: 3px solid var(--card); box-shadow: 0 2px 0 var(--line); display: inline-flex; align-items: center; justify-content: center; font-size: 40px; background: var(--card); }
.pick-photo { width: 70%; aspect-ratio: 1; border-radius: 50%; object-fit: cover; display: inline-flex; align-items: center; justify-content: center; font-size: min(18vw, 120px); }
.kids { display: flex; flex-wrap: wrap; gap: 10px; }
.kid { display: flex; align-items: center; gap: 6px; border: 2px solid var(--line); border-radius: 16px; padding: 6px; background: #fff; }
.kid.on { border-color: var(--accent); background: #eef7f5; }
.kid.add { padding: 12px 18px; font-size: 16px; color: var(--accent); font-weight: 600; border-style: dashed; }
.kid-pick { display: flex; align-items: center; gap: 8px; border: none; background: transparent; font-size: 18px; font-weight: 600; }
.kid-photo { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; display: inline-flex; align-items: center; justify-content: center; font-size: 28px; }
.snap { display: flex; align-items: center; gap: 16px; width: 100%; text-align: start; border: 2px solid var(--accent); background: #eef7f5; border-radius: 18px; padding: 14px 18px; margin: 14px 0; font-size: 20px; }
.snap small { font-size: 14px; color: var(--muted); }
.snap-icon { font-size: 44px; }
.onboarding { padding-top: 8vh; }
.onboarding p { font-size: 18px; line-height: 1.6; }
.modal label.wrow { cursor: pointer; }
.modal label.wrow input { width: 22px; height: 22px; }

/* parent code pad */
.modal.pin { width: min(340px, 100%); text-align: center; }
.pin-dots { display: flex; gap: 14px; justify-content: center; margin: 10px 0 16px; }
.pin-dots span { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--accent); }
.pin-dots span.on { background: var(--accent); }
.pin-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 10px; }
.pin-key { height: 62px; border-radius: 14px; border: 1px solid var(--line); background: #fff; font-size: 26px; }
.pin-msg { min-height: 1.4em; }

/* parent's own voice */
.vrow { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-top: 1px solid var(--line); }
.vbig { font-size: 30px; font-weight: 700; width: 40px; text-align: center; }
.vlabel { flex: 1; font-size: 18px; }
.vstate { font-size: 13px; color: var(--muted); }
.vstate.mine { color: var(--accent); font-weight: 600; }

/* four games on the home screen */
.home-buttons.n3 .big-choice, .home-buttons.n4 .big-choice { width: min(36vw, 26vh, 240px); }
.home-buttons.n4 { max-width: 640px; gap: 4vw; }
.home-buttons.n3 .big-icon, .home-buttons.n4 .big-icon { font-size: min(13vw, 10vh, 96px); }
.home-buttons.n3 .big-label, .home-buttons.n4 .big-label { font-size: min(5.5vw, 4vh, 30px); }
/* "מה חסר?" */
.picture.small { width: min(42vw, 30vh, 300px); height: min(42vw, 30vh, 300px); }
.picture.small.emoji { font-size: min(24vw, 18vh, 170px); }
.gap-word { font-size: min(14vw, 10vh, 96px); font-weight: 700; display: flex; align-items: center; gap: 4px; }
.gap-box { display: inline-flex; align-items: center; justify-content: center; min-width: 1.1em; height: 1.2em; border: 4px dashed var(--hint);
  border-radius: 18px; color: #c9b27a; transition: background .3s, border-color .3s; }
.gap-box.filled { border-style: solid; border-color: var(--right); background: #eaf6ee; color: var(--ink); }
/* syllables keep their niqqud big and clear */
.choice.syl { font-size: min(15vw, 13vh, 120px); }
/* voice fix (parent) */
.icon.fix { opacity: .75; }
.vrow.picked { background: #eef7f5; border-radius: 10px; }
.seg.wrap { flex-wrap: wrap; }

/* fireworks */
.fireworks { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 50; }

/* more tiles on the home screen */
.home-buttons.n5, .home-buttons.n6, .home-buttons.n7, .home-buttons.n8 { max-width: 900px; gap: 3vw; }
.home-buttons.n5 .big-choice, .home-buttons.n6 .big-choice, .home-buttons.n7 .big-choice, .home-buttons.n8 .big-choice { width: min(27vw, 22vh, 190px); border-radius: 28px; }
.home-buttons.n5 .big-icon, .home-buttons.n6 .big-icon, .home-buttons.n7 .big-icon, .home-buttons.n8 .big-icon { font-size: min(10vw, 8vh, 72px); }
.home-buttons.n5 .big-label, .home-buttons.n6 .big-label, .home-buttons.n7 .big-label, .home-buttons.n8 .big-label { font-size: min(4.6vw, 3.4vh, 24px); }
.album-btn { position: absolute; top: 18px; right: 96px; width: 60px; height: 60px; border-radius: 50%; border: 3px solid var(--line); background: var(--card); font-size: 30px; }
.wobble { animation: wobble .45s; }
@keyframes wobble { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }

/* build a word */
.reveal { position: relative; }
.cover { position: absolute; inset: 0; display: grid; border-radius: 28px; overflow: hidden; grid-template-columns: repeat(3, 1fr); }
.cover.n2 { grid-template-columns: repeat(2, 1fr); } .cover.n4 { grid-template-columns: repeat(2, 1fr); }
.tile { background: #e9dfcf; border: 2px solid #f6f1e9; transition: opacity .5s, transform .5s; }
.tile.gone { opacity: 0; transform: scale(.6); }
.slots { display: flex; gap: 10px; justify-content: center; margin: 14px 0 4px; }
.slot { width: min(15vw, 11vh, 92px); height: min(15vw, 11vh, 92px); border: 4px dashed var(--line); border-radius: 18px; display: flex; align-items: center; justify-content: center;
  font-size: min(11vw, 8vh, 70px); font-weight: 700; background: #fffdf8; }
.slot.filled { border-style: solid; border-color: var(--right); background: #eaf6ee; }
.built-word { text-align: center; font-size: min(9vw, 6vh, 52px); font-weight: 700; color: var(--accent); min-height: 1.3em; opacity: 0; transition: opacity .4s; }
.built-word.shown { opacity: 1; }
.choices.tray { gap: 3vw; }
.choice.small-l { min-width: min(17vw, 120px); height: min(17vw, 14vh, 120px); font-size: min(12vw, 10vh, 84px); border-radius: 24px; }
.choice.used { opacity: .2; }
.picture.small { position: relative; }

/* bubbles */
.game.bubbles { overflow: hidden; }
.bubble-head { display: flex; align-items: center; justify-content: center; gap: 24px; padding: 6px 0; position: relative; z-index: 2; }
.bmeter { display: flex; gap: 8px; }
.bmeter span { width: 26px; height: 26px; border-radius: 50%; border: 3px solid var(--line); background: #fff; transition: background .3s; }
.bmeter span.on { background: var(--right); border-color: var(--right); }
.sky { position: fixed; inset: 0; pointer-events: none; }
.bubble { position: absolute; bottom: -160px; pointer-events: auto; border-radius: 50%; border: 3px solid hsla(var(--hue), 60%, 70%, .9);
  background: radial-gradient(circle at 26% 22%, #fff 0 7%, hsla(var(--hue), 80%, 88%, .75) 13% 70%, hsla(var(--hue), 70%, 78%, .9));
  font-size: 48px; font-weight: 700; color: #3b3a36; animation-name: rise; animation-timing-function: linear; touch-action: none; }
.bubble.hinted { box-shadow: 0 0 0 5px rgba(255, 214, 107, .7); }
.bubble.popped { animation: popout .3s forwards !important; }
@keyframes rise { from { transform: translateY(0); } to { transform: translateY(calc(-100vh - 220px)); } }
@keyframes popout { to { transform: scale(1.5); opacity: 0; } }

/* memory */
.mgrid { display: grid; gap: 3vw; justify-content: center; grid-template-columns: repeat(3, min(26vw, 22vh, 180px)); padding-top: 3vh; }
.mgrid.n8 { grid-template-columns: repeat(4, min(21vw, 22vh, 170px)); }
.mcard { aspect-ratio: 1; border-radius: 24px; border: 4px solid var(--line); background: var(--accent); position: relative; padding: 0; overflow: hidden; box-shadow: 0 4px 0 var(--line); }
.mback { color: #fff; font-size: 56px; }
.mfront { position: absolute; inset: 0; background: var(--card); display: none; align-items: center; justify-content: center; }
.mcard.up .mfront { display: flex; } .mcard.up .mback { display: none; }
.mcard.done { border-color: var(--right); box-shadow: 0 0 0 6px rgba(124, 196, 154, .35); }
.mletter { font-size: min(14vw, 13vh, 110px); font-weight: 700; }
.mpic { width: 100%; height: 100%; object-fit: cover; } .mpic.emoji { font-size: min(14vw, 13vh, 100px); display: flex; align-items: center; justify-content: center; }

/* stickers */
.new-sticker { font-size: 110px; border: none; background: transparent; animation: wobble 1s 2; }
.album { min-height: 100vh; display: flex; flex-direction: column; }
.pager { display: flex; align-items: center; gap: 10px; font-size: 22px; }
.sheet { position: relative; flex: 1; margin: 10px 16px; min-height: 60vh; border-radius: 28px; background: #fffdf8;
  background-image: radial-gradient(#efe6d6 1.5px, transparent 1.5px); background-size: 26px 26px; border: 3px solid var(--line); }
.sticker { position: absolute; font-size: 72px; line-height: 1; cursor: grab; touch-action: none; user-select: none; filter: drop-shadow(0 3px 2px rgba(0,0,0,.15)); }
.sticker.in-hand { position: relative; font-size: 96px; animation: wobble 1s infinite; }
.sticker.drag { z-index: 60; animation: none; }
.hand { display: flex; justify-content: center; padding: 8px 0 18px; }

/* feedback: what she chose (word game) and the "כל הכבוד" star */
.choice { position: relative; }
.choice.chosen { border-color: #d8cfc2; }
.peek { position: absolute; bottom: calc(100% + 10px); left: 50%; transform: translateX(-50%); background: var(--card); border: 3px solid var(--line);
  border-radius: 22px; padding: 10px 14px; display: flex; flex-direction: column; align-items: center; gap: 4px; box-shadow: 0 6px 18px rgba(0,0,0,.12); z-index: 5; }
.peek img { width: min(30vw, 22vh, 180px); height: min(30vw, 22vh, 180px); object-fit: cover; border-radius: 16px; }
.peek-emoji { font-size: min(22vw, 16vh, 130px); line-height: 1.1; }
.peek-word { font-size: min(7vw, 5vh, 40px); font-weight: 700; color: var(--ink); }
.cheer { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; z-index: 40;
  animation: cheer 1.7s ease-out forwards; }
.cheer-star { font-size: min(34vw, 30vh, 240px); line-height: 1; filter: drop-shadow(0 6px 10px rgba(0,0,0,.15)); }
.cheer-text { font-size: min(11vw, 8vh, 72px); font-weight: 800; color: var(--accent); background: rgba(255,253,248,.85); padding: 0 18px; border-radius: 20px; }
@keyframes cheer { 0% { opacity: 0; transform: scale(.6); } 15% { opacity: 1; transform: scale(1.05); } 25% { transform: scale(1); } 80% { opacity: 1; } 100% { opacity: 0; } }

/* up to 12 tiles on the home screen */
.home-buttons.n9, .home-buttons.n10, .home-buttons.n11, .home-buttons.n12 { max-width: 980px; gap: 2.2vw; }
.home-buttons.n9 .big-choice, .home-buttons.n10 .big-choice, .home-buttons.n11 .big-choice, .home-buttons.n12 .big-choice { width: min(21vw, 19vh, 170px); border-radius: 24px; gap: 6px; }
.home-buttons.n9 .big-icon, .home-buttons.n10 .big-icon, .home-buttons.n11 .big-icon, .home-buttons.n12 .big-icon { font-size: min(8vw, 7vh, 60px); }
.home-buttons.n9 .big-label, .home-buttons.n10 .big-label, .home-buttons.n11 .big-label, .home-buttons.n12 .big-label { font-size: min(3.8vw, 2.9vh, 21px); }

/* memory: smaller rounds, word under the picture */
.mgrid.n4 { grid-template-columns: repeat(2, min(30vw, 30vh, 220px)); }
.mgrid.n6 { grid-template-columns: repeat(3, min(26vw, 28vh, 200px)); }
.mpicwrap { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 100%; height: 100%; gap: 2px; }
.mpicwrap .mpic { width: 100%; height: 70%; object-fit: cover; } .mpicwrap .mpic.emoji { font-size: min(10vw, 9vh, 76px); height: auto; }
.mword { font-size: min(5vw, 3.6vh, 30px); font-weight: 700; }
.mword .first, .board-card .first { color: var(--accent); }

/* feed the hedgehog */
.friend { border: none; background: transparent; display: flex; flex-direction: column; align-items: center; }
.friend-face { font-size: min(36vw, 32vh, 240px); line-height: 1; transition: transform .2s; }
.friend-face.munch { animation: munch .6s 2; }
@keyframes munch { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.12, .9); } }
.friend-ask { font-size: 28px; margin-top: -10px; background: var(--card); border-radius: 50%; padding: 6px 10px; border: 2px solid var(--line); }
.cookie { width: min(22vw, 18vh, 150px); height: min(22vw, 18vh, 150px); border-radius: 50%; border: 5px solid #e2c48f;
  background: radial-gradient(circle at 30% 30%, #f7dfae, #e8c07f); font-size: min(12vw, 10vh, 84px); font-weight: 700; color: #4a3520;
  box-shadow: 0 4px 0 #cfa86a; transition: transform .45s ease-in, opacity .45s; }
.cookie.eaten { opacity: 0; }
.cookie.hint-1 { box-shadow: 0 0 0 5px rgba(255, 214, 107, .55), 0 4px 0 #cfa86a; }
.cookie.hint-2 { box-shadow: 0 0 0 8px rgba(255, 214, 107, .8), 0 4px 0 #cfa86a; }

/* sort into baskets */
.sort-stage { min-height: 46vh; display: flex; align-items: center; justify-content: center; }
.sort-card { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.baskets { display: flex; justify-content: center; gap: 8vw; }
.basket { width: min(38vw, 30vh, 260px); min-height: min(30vw, 24vh, 200px); border-radius: 30px; border: 4px solid var(--line); background: var(--card);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; box-shadow: 0 4px 0 var(--line); }
.basket.hint-1 { border-color: #f3e2b0; box-shadow: 0 0 0 4px rgba(255, 214, 107, .3), 0 4px 0 var(--line); }
.basket.hint-2 { border-color: var(--hint); box-shadow: 0 0 0 8px rgba(255, 214, 107, .5), 0 4px 0 var(--line); }
.basket-letter { font-size: min(14vw, 11vh, 90px); font-weight: 700; line-height: 1; }
.basket-icon { font-size: min(9vw, 7vh, 54px); line-height: 1; }
.basket-in { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; min-height: 36px; }
.mini { width: 36px; height: 36px; border-radius: 8px; object-fit: cover; } .mini.emoji { font-size: 28px; width: auto; height: auto; }

/* trace with a finger */
.trace-wrap { display: flex; justify-content: center; padding-top: 1vh; }
.trace-canvas { background: #fffdf8; border: 3px solid var(--line); border-radius: 28px; touch-action: none; }
.btns.center { justify-content: center; gap: 24px; margin-top: 10px; }

/* free letter board */
.board-pic { min-height: 34vh; display: flex; align-items: center; justify-content: center; }
.board-card { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.board-img { width: min(34vw, 26vh, 220px); height: min(34vw, 26vh, 220px); object-fit: cover; border-radius: 24px; }
.board-img.emoji { display: flex; align-items: center; justify-content: center; font-size: min(26vw, 20vh, 170px); }
.board-big { font-size: min(30vw, 24vh, 200px); font-weight: 700; color: var(--accent); }
.board-card .mword { font-size: min(9vw, 6vh, 52px); }
.board-keys { display: grid; grid-template-columns: repeat(8, 1fr); gap: 8px; max-width: 900px; margin: 0 auto; padding: 0 12px 16px; }
.bkey { aspect-ratio: 1; border-radius: 18px; border: 3px solid var(--line); background: var(--card); font-size: min(7vw, 6vh, 48px); font-weight: 700; box-shadow: 0 3px 0 var(--line); }
.bkey.jump { animation: jump .5s; }
@keyframes jump { 0%, 100% { transform: translateY(0); } 40% { transform: translateY(-14px) scale(1.12); } }


/* ================= look & motion (v2) =================
   A soft meadow: light sky, two quiet hills at the bottom, a couple of clouds.
   Motion levels: html[data-motion=full|calm|off]. Calm = fades only. Off = nothing moves. */
html { --rise: 16px; --pop: .94; --ease: cubic-bezier(.22, .8, .3, 1);
  background: linear-gradient(180deg, #e6f2ef 0%, #f3f0e6 48%, #f6f1e8 100%) fixed; }
html[data-motion=calm] { --rise: 0px; --pop: 1; }
html[data-motion=off] *, html[data-motion=off] *::before, html[data-motion=off] *::after { animation: none !important; transition: none !important; }
body { background: transparent; }
body::before { content: ''; position: fixed; left: 0; right: 0; bottom: 0; height: 17vh; z-index: -1; pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 200' preserveAspectRatio='none'%3E%3Cpath d='M0 110 C220 50 420 60 620 105 S1000 165 1200 85 V200 H0Z' fill='%23dcefe4'/%3E%3Cpath d='M0 155 C260 105 520 125 720 148 S1060 118 1200 138 V200 H0Z' fill='%23cbe6d6'/%3E%3C/svg%3E") bottom / 100% 100% no-repeat; }
body::after { content: ''; position: fixed; top: 7vh; left: -30vw; width: 160vw; height: 22vh; z-index: -1; pointer-events: none; opacity: .9;
  background:
    radial-gradient(closest-side, #fff 60%, transparent) 12% 30% / 190px 60px no-repeat,
    radial-gradient(closest-side, #fff 60%, transparent) 17% 18% / 110px 54px no-repeat,
    radial-gradient(closest-side, #fff 60%, transparent) 68% 62% / 230px 64px no-repeat,
    radial-gradient(closest-side, #fff 60%, transparent) 73% 48% / 120px 58px no-repeat; }
html[data-motion=full] body::after { animation: drift 90s linear infinite alternate; }
@keyframes drift { to { transform: translateX(18vw); } }
.parent, .album { position: relative; }
.parent .card { box-shadow: 0 2px 8px rgba(60, 50, 30, .05); }

/* screen change: a soft fade (no movement, so fixed layers like the bubble sky stay put) */
.enter { animation: screen-in .35s ease-out backwards; }
@keyframes screen-in { from { opacity: 0; } }
@keyframes rise-in { from { opacity: 0; transform: translateY(var(--rise)) scale(var(--pop)); } }

/* home tiles: own soft color, icon on a white badge */
.big-choice { --tint: 170; border: 3px solid hsl(var(--tint) 38% 84%);
  background: linear-gradient(180deg, hsl(var(--tint) 70% 97.5%), hsl(var(--tint) 55% 91.5%));
  box-shadow: 0 5px 0 hsl(var(--tint) 32% 80%), 0 12px 24px hsl(var(--tint) 30% 40% / .10);
  animation: rise-in .55s var(--ease) backwards; animation-delay: calc(var(--i, 0) * 55ms);
  transition: transform .18s var(--ease), box-shadow .18s; }
.big-choice:active { transform: translateY(4px); box-shadow: 0 1px 0 hsl(var(--tint) 32% 80%); }
.icon-badge { width: 62%; aspect-ratio: 1; border-radius: 50%; background: #fff; display: flex; align-items: center; justify-content: center;
  box-shadow: inset 0 -5px 0 hsl(var(--tint) 45% 92%), 0 2px 6px hsl(var(--tint) 30% 40% / .10); }
.big-choice .big-icon { font-size: min(9vw, 66px); }
.big-label { color: hsl(var(--tint) 25% 24%); }
html[data-motion=full] .big-icon { animation: float 5.5s ease-in-out infinite; animation-delay: calc(var(--i, 0) * -.8s); display: inline-block; }
@keyframes float { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-5px) rotate(-3deg); } }
.home-buttons.n9 .big-choice, .home-buttons.n10 .big-choice, .home-buttons.n11 .big-choice, .home-buttons.n12 .big-choice { width: min(19vw, 19vh, 168px); }
.home-buttons.n9 .big-icon, .home-buttons.n10 .big-icon, .home-buttons.n11 .big-icon, .home-buttons.n12 .big-icon { font-size: min(5.2vw, 5vh, 46px); }
.album-btn, .me { transition: transform .2s var(--ease); }
/* phone: three big columns that fill the width */
@media (max-width: 640px) {
  .home { align-items: center; padding: 84px 14px 18vh; }
  .home .home-buttons { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; width: 100%; max-width: 460px; }
  .home .home-buttons .big-choice { width: auto; border-radius: 24px; gap: 6px; padding: 8px 4px; }
  .home .home-buttons .big-icon { font-size: 10vw; }
  .home .home-buttons .big-label { font-size: 4vw; line-height: 1.15; }
  .home .home-buttons.n2 { grid-template-columns: repeat(2, 1fr); } .home .home-buttons.n1 { grid-template-columns: 1fr; }
}

/* answer buttons, cards and pictures */
.choice { background: linear-gradient(180deg, #fff, #fbf6ee); }
.choices > *, .mgrid > *, .baskets > *, .board-keys > *, .tray > *, .slots > * { animation: rise-in .45s var(--ease) backwards; }
.choices > :nth-child(1), .mgrid > :nth-child(1), .baskets > :nth-child(1), .tray > :nth-child(1) { animation-delay: 70ms; }
.choices > :nth-child(2), .mgrid > :nth-child(2), .baskets > :nth-child(2), .tray > :nth-child(2) { animation-delay: 140ms; }
.choices > :nth-child(3), .mgrid > :nth-child(3), .baskets > :nth-child(3), .tray > :nth-child(3) { animation-delay: 210ms; }
.choices > :nth-child(4), .mgrid > :nth-child(4), .baskets > :nth-child(4), .tray > :nth-child(4) { animation-delay: 280ms; }
.choices > :nth-child(5), .mgrid > :nth-child(5), .baskets > :nth-child(5), .tray > :nth-child(5) { animation-delay: 350ms; }
.choices > :nth-child(6), .mgrid > :nth-child(6), .baskets > :nth-child(6), .tray > :nth-child(6) { animation-delay: 420ms; }
.choices > :nth-child(7), .mgrid > :nth-child(7), .baskets > :nth-child(7), .tray > :nth-child(7) { animation-delay: 490ms; }
.choices > :nth-child(8), .mgrid > :nth-child(8), .baskets > :nth-child(8), .tray > :nth-child(8) { animation-delay: 560ms; }
.board-keys > :nth-child(1) { animation-delay: 18ms; }
.board-keys > :nth-child(2) { animation-delay: 36ms; }
.board-keys > :nth-child(3) { animation-delay: 54ms; }
.board-keys > :nth-child(4) { animation-delay: 72ms; }
.board-keys > :nth-child(5) { animation-delay: 90ms; }
.board-keys > :nth-child(6) { animation-delay: 108ms; }
.board-keys > :nth-child(7) { animation-delay: 126ms; }
.board-keys > :nth-child(8) { animation-delay: 144ms; }
.board-keys > :nth-child(9) { animation-delay: 162ms; }
.board-keys > :nth-child(10) { animation-delay: 180ms; }
.board-keys > :nth-child(11) { animation-delay: 198ms; }
.board-keys > :nth-child(12) { animation-delay: 216ms; }
.board-keys > :nth-child(13) { animation-delay: 234ms; }
.board-keys > :nth-child(14) { animation-delay: 252ms; }
.board-keys > :nth-child(15) { animation-delay: 270ms; }
.board-keys > :nth-child(16) { animation-delay: 288ms; }
.board-keys > :nth-child(17) { animation-delay: 306ms; }
.board-keys > :nth-child(18) { animation-delay: 324ms; }
.board-keys > :nth-child(19) { animation-delay: 342ms; }
.board-keys > :nth-child(20) { animation-delay: 360ms; }
.board-keys > :nth-child(21) { animation-delay: 378ms; }
.board-keys > :nth-child(22) { animation-delay: 396ms; }
html[data-motion=full] .choice.right { animation: yay .6s var(--ease); }
@keyframes yay { 0% { transform: scale(1); } 40% { transform: scale(1.14) rotate(-2deg); } 70% { transform: scale(1.03); } 100% { transform: scale(1.06); } }
.picture { box-shadow: 0 10px 26px rgba(60, 50, 30, .10); }
.picture.emoji, .mpic.emoji, .board-img.emoji { background: radial-gradient(circle at 50% 42%, #fff 0 46%, #f2ece1 100%); }
.picture-wrap, .prompt > * { animation: rise-in .5s var(--ease) backwards; animation-delay: 60ms; }
.speaker { transition: transform .15s var(--ease); } .speaker:active { transform: scale(.94); }
html[data-motion=full] .speaker.big { animation: breathe 3.4s ease-in-out infinite; }
@keyframes breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.04); } }
.dot { transition: background .4s, transform .4s; }
html[data-motion=full] .dot.now { animation: breathe 2.6s ease-in-out infinite; }

/* memory: real flip */
.mcard { background: transparent; border: none; box-shadow: none; overflow: visible; }
.mcard .mback, .mcard .mfront { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; border-radius: 24px; overflow: hidden;
  border: 4px solid var(--line); box-shadow: 0 4px 0 var(--line); backface-visibility: hidden; -webkit-backface-visibility: hidden;
  transition: transform .55s var(--ease), border-color .3s, box-shadow .3s; }
.mcard .mback { transform: perspective(900px) rotateY(0); color: #fff; font-size: min(10vw, 52px);
  background: radial-gradient(circle at 30% 28%, rgba(255,255,255,.28) 0 9%, transparent 10%), radial-gradient(circle at 72% 70%, rgba(255,255,255,.2) 0 7%, transparent 8%),
    linear-gradient(145deg, #5fb0a5, #3f8a80); border-color: #3f8a80; box-shadow: 0 4px 0 #2f6d65; }
.mcard .mfront { transform: perspective(900px) rotateY(180deg); background: linear-gradient(180deg, #fff, #fbf6ee); }
.mcard.up .mback { display: flex; transform: perspective(900px) rotateY(-180deg); }
.mcard.up .mfront { transform: perspective(900px) rotateY(0); }
.mcard.done { box-shadow: none; }
.mcard.done .mfront { border-color: var(--right); box-shadow: 0 0 0 6px rgba(124, 196, 154, .35), 0 4px 0 var(--right); }
html[data-motion=full] .mcard.done { animation: yay .6s var(--ease); }

/* hedgehog: breathes, hops and chews */
.friend-face { display: inline-block; transform-origin: 50% 90%; filter: drop-shadow(0 8px 8px rgba(60, 50, 30, .12)); }
html[data-motion=full] .friend-face { animation: breathe 3.2s ease-in-out infinite; }
html .friend-face.munch { animation: munch .7s var(--ease) 2; }
@keyframes munch { 0%, 100% { transform: translateY(0) scale(1); } 30% { transform: translateY(-16px) scale(1.04, .97); } 60% { transform: translateY(0) scale(1.08, .92); } }
html[data-motion=calm] .friend-face.munch { animation: none; }
.cookie { transition: transform .5s var(--ease), opacity .5s; }

/* celebration */
html[data-motion=calm] .cheer { animation: cheer-calm 1.7s ease-out forwards; }
@keyframes cheer-calm { 0% { opacity: 0; } 15%, 80% { opacity: 1; } 100% { opacity: 0; } }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 39; overflow: hidden; }
.confetti i { position: absolute; top: -24px; width: 12px; height: 18px; border-radius: 3px; opacity: .9; animation: fall 2.6s ease-in forwards; }
.confetti i.round { width: 14px; height: 14px; border-radius: 50%; }
@keyframes fall { 0% { transform: translate(0, 0) rotate(0); opacity: 0; } 10% { opacity: .95; } 100% { transform: translate(var(--dx), 105vh) rotate(var(--r)); opacity: .7; } }
.end-mark { filter: drop-shadow(0 8px 12px rgba(200, 150, 30, .25)); }
html[data-motion=full] .end-mark { animation: soft 1.2s var(--ease), float 4s ease-in-out 1.2s infinite; }

/* sort, trace, board */
.basket { background: linear-gradient(180deg, #fff, #fbf3e6); transition: transform .2s var(--ease); }
.sort-card { animation: rise-in .45s var(--ease) backwards; }
.trace-canvas { box-shadow: 0 10px 26px rgba(60, 50, 30, .08); }
.bkey { background: linear-gradient(180deg, #fff, #f7f1e7); }
.board-card { animation: rise-in .4s var(--ease) backwards; }

/* eye-loop fixes: centered last row on phone, bigger tablet tiles and phone memory cards */
@media (max-width: 640px) {
  .home .home-buttons { display: flex; flex-wrap: wrap; justify-content: center; }
  .home .home-buttons .big-choice { width: calc((100% - 24px) / 3); }
  .mgrid.n4 { grid-template-columns: repeat(2, 40vw); gap: 5vw; }
  .mgrid.n6, .mgrid.n8 { grid-template-columns: repeat(3, 28vw); gap: 3vw; }
}
@media (min-width: 641px) {
  .home-buttons.n9, .home-buttons.n10, .home-buttons.n11, .home-buttons.n12 { gap: 22px; max-width: 1000px; }
  .home-buttons.n9 .big-choice, .home-buttons.n10 .big-choice, .home-buttons.n11 .big-choice, .home-buttons.n12 .big-choice { width: min(16vw, 23vh, 190px); }
  .home-buttons.n9 .big-icon, .home-buttons.n10 .big-icon, .home-buttons.n11 .big-icon, .home-buttons.n12 .big-icon { font-size: min(5vw, 7vh, 58px); }
  .home-buttons.n9 .big-label, .home-buttons.n10 .big-label, .home-buttons.n11 .big-label, .home-buttons.n12 .big-label { font-size: min(2.2vw, 3vh, 22px); }
}
.mpicwrap .mpic.emoji { background: transparent; height: auto; }
@media (max-width: 640px) { .mpicwrap .mpic.emoji { font-size: 17vw; } .mword { font-size: 6vw; } }
