@font-face { font-family: "Andika"; src: url("../fonts/andika-700.woff2") format("woff2"); font-weight: 400 900; font-display: swap; }
@font-face { font-family: "Fredoka"; src: url("../fonts/fredoka-700.woff2") format("woff2"); font-weight: 300 700; font-display: swap; }

:root {
  --ink: #2d3047;
  --sky1: #8fe0ff; --sky2: #d7f6ff;
  --green: #06d6a0; --yellow: #ffd166; --pink: #ef476f; --blue: #118ab2; --purple: #9b5de5;
  --card: #fffdf7;
  --shadow: 0 6px 0 rgba(45, 48, 71, .18), 0 10px 24px rgba(45, 48, 71, .12);
  --tap: clamp(64px, 9vmin, 96px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: linear-gradient(var(--sky1), var(--sky2)); color: var(--ink);
  font-family: "Fredoka", ui-rounded, "Arial Rounded MT Bold", system-ui, sans-serif; font-weight: 600;
  -webkit-user-select: none; user-select: none; touch-action: manipulation; overscroll-behavior: none; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; padding: 0; touch-action: manipulation; }
button:focus-visible { outline: 4px solid var(--blue); outline-offset: 3px; }
.grapheme { font-family: "Andika", "Comic Sans MS", sans-serif; font-weight: 700; letter-spacing: .02em; }
.emoji { font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; line-height: 1; }
.hidden { display: none !important; }
svg { display: block; overflow: visible; }

.screen { position: fixed; inset: 0; overflow: hidden; padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }

/* ---------- start splash ---------- */
#start { position: fixed; inset: 0; z-index: 50; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2vmin;
  background: radial-gradient(circle at 50% 40%, #fff7d1, #ffd166 45%, #ff9f43); }
.start-pip { width: min(46vmin, 360px); animation: bob 2.4s ease-in-out infinite; }
.start-title, .title { font-size: clamp(42px, 9vmin, 92px); font-weight: 700; color: #fff; text-shadow: 0 5px 0 var(--ink), 0 0 2px var(--ink); -webkit-text-stroke: 3px var(--ink); paint-order: stroke fill; }
.start-title span:last-child, .title span:last-child { color: var(--green); }
.start-play { width: clamp(90px, 16vmin, 140px); height: clamp(90px, 16vmin, 140px); border-radius: 50%; background: var(--green); color: #fff; font-size: clamp(40px, 8vmin, 70px);
  display: grid; place-items: center; box-shadow: var(--shadow); border: 5px solid var(--ink); opacity: .4; transition: opacity .3s; padding-left: .12em; }
#start.ready .start-play { opacity: 1; animation: pulse 1.6s ease-in-out infinite; }
#credit { position: fixed; bottom: max(8px, env(safe-area-inset-bottom)); left: 0; right: 0; z-index: 51; margin: 0; text-align: center; font-size: 13px; opacity: .6; pointer-events: none; }
.start-hint { font-size: clamp(16px, 2.6vmin, 24px); opacity: .8; }

/* ---------- shared bits ---------- */
.cloud { position: absolute; width: 18vmin; height: 7vmin; background: #fff; border-radius: 99px; opacity: .9; animation: drift 40s linear infinite; }
.cloud::before, .cloud::after { content: ""; position: absolute; background: #fff; border-radius: 50%; }
.cloud::before { width: 8vmin; height: 8vmin; left: 3vmin; top: -4vmin; }
.cloud::after { width: 6vmin; height: 6vmin; left: 9vmin; top: -2.6vmin; }
.sky-deco { position: absolute; inset: 0; pointer-events: none; }
.back-btn, .replay-btn, .home-btn, .again-btn, .next-btn, .go-btn {
  width: var(--tap); height: var(--tap); border-radius: 50%; background: #fff; border: 4px solid var(--ink); box-shadow: var(--shadow);
  font-size: calc(var(--tap) * .45); display: grid; place-items: center; transition: transform .1s, scale .1s; }
.back-btn:active, .replay-btn:active, .game-btn:active, .profile-card:active, .node:active, .pic-card:active, .egg-btn:active, .leaf:active, .bone:active, .stone:active, .word-card:active, .next-btn:active { scale: .94; }
.replay-btn { background: var(--yellow); width: calc(var(--tap) * 1.15); height: calc(var(--tap) * 1.15); }
.next-btn { position: fixed; right: 3vmin; bottom: 3vmin; background: var(--green); color: #fff; width: calc(var(--tap) * 1.3); height: calc(var(--tap) * 1.3); font-size: calc(var(--tap) * .7); z-index: 5; }
.stars { display: inline-flex; gap: 2px; font-size: 1.1em; }
.stars span { color: #d9dce6; text-shadow: 0 1px 0 rgba(0,0,0,.15); }
.stars span.on { color: #ffb703; }
.pip-corner { position: fixed; left: 1.5vmin; bottom: 1vmin; z-index: 4; }
.pip-btn { position: relative; width: clamp(110px, 20vmin, 180px); }
.pip-btn .bubble { position: absolute; right: -10px; top: -6px; background: #fff; border: 3px solid var(--ink); border-radius: 50%; width: 46px; height: 46px; display: grid; place-items: center; font-size: 22px; box-shadow: var(--shadow); }
.pip-mini { position: fixed; left: 1vmin; bottom: 0; width: clamp(80px, 13vmin, 130px); pointer-events: none; opacity: .95; }

/* parent gate */
.parent-btn { position: fixed; top: 1.6vmin; right: 1.6vmin; z-index: 6; display: flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 99px; background: rgba(255,255,255,.75); border: 3px solid var(--ink); font-size: 22px; overflow: hidden; }
.parent-btn small { font-size: 11px; line-height: 1.05; text-align: left; }
.parent-btn .ring { position: absolute; inset: 0; background: var(--yellow); transform-origin: left; transform: scaleX(0); z-index: -1; }
.parent-btn.holding .ring { transform: scaleX(1); transition: transform 2s linear; }
.parent-btn.hint::after { content: "Press and hold"; position: absolute; right: 0; top: 110%; background: var(--ink); color: #fff; font-size: 13px; padding: 4px 8px; border-radius: 8px; white-space: nowrap; }
.parent-btn { overflow: visible; }

/* ---------- profiles ---------- */
.profiles { overflow-y: auto; display: flex; flex-direction: column; align-items: center; padding-top: 4vmin; padding-bottom: 22vmin; }
.profiles .title { margin: 2vmin 0 3vmin; }
.profile-grid { display: flex; flex-wrap: wrap; gap: 3vmin; justify-content: center; max-width: 1100px; padding: 0 3vmin; }
.profile-card { width: clamp(170px, 24vmin, 240px); background: var(--card); border: 4px solid var(--ink); border-radius: 28px; box-shadow: var(--shadow); padding: 14px 10px 12px; display: flex; flex-direction: column; align-items: center; gap: 4px; animation: pop .4s both; }
.profile-card svg { width: 88%; }
.pname { font-size: clamp(22px, 3.4vmin, 32px); font-weight: 700; }
.pmeta { font-size: 16px; opacity: .7; }
.profile-card.add { background: rgba(255,255,255,.6); border-style: dashed; justify-content: center; min-height: clamp(200px, 28vmin, 260px); }
.plus { font-size: 80px; line-height: 1; color: var(--green); }

/* new profile */
.new-profile { overflow-y: auto; padding: 3vmin; background: linear-gradient(#c9f5e5, #e8fff6); }
.new-profile h2 { text-align: center; font-size: clamp(30px, 5vmin, 46px); margin: 0 0 2vmin; }
.new-profile .back-btn { position: absolute; left: 3vmin; top: 3vmin; }
.np { display: flex; flex-wrap: wrap; gap: 3vmin; justify-content: center; align-items: center; }
.np-preview { width: min(40vmin, 340px); }
.np-form { display: flex; flex-direction: column; gap: 12px; max-width: 560px; width: 100%; }
.np-label { font-size: 20px; } .np-label small { opacity: .6; font-size: 15px; }
.np-name { font: inherit; font-size: 30px; padding: 12px 18px; border-radius: 18px; border: 4px solid var(--ink); width: 100%; -webkit-user-select: text; user-select: text; }
.np-species { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 10px; }
.sp { background: #fff; border: 3px solid #cfd5e3; border-radius: 18px; padding: 6px; }
.sp.sel { border-color: var(--ink); background: #fff7d1; transform: scale(1.05); }
.np-colors { display: flex; gap: 14px; }
.swatch { width: 56px; height: 56px; border-radius: 50%; border: 4px solid #fff; box-shadow: 0 0 0 3px #cfd5e3; }
.swatch.sel { box-shadow: 0 0 0 4px var(--ink); }
.go-btn { width: auto; height: auto; border-radius: 99px; padding: 16px 28px; font-size: 28px; background: var(--green); color: #fff; align-self: flex-start; }

/* ---------- island map ---------- */
.map .island { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.map-top { position: absolute; top: 0; left: 0; right: 0; display: flex; justify-content: space-between; align-items: center; padding: 1.6vmin 2vmin; z-index: 3; }
.me { display: flex; align-items: center; gap: 8px; background: rgba(255,255,255,.85); border: 4px solid var(--ink); border-radius: 99px; padding: 4px 18px 4px 6px; box-shadow: var(--shadow); font-size: clamp(20px, 3vmin, 28px); }
.me svg { width: clamp(56px, 8vmin, 76px); }
.map-actions { display: flex; gap: 12px; }
.nest-btn, .mix-btn { width: calc(var(--tap) * 1.1); height: calc(var(--tap) * 1.1); border-radius: 26px; background: #fff; border: 4px solid var(--ink); box-shadow: var(--shadow); font-size: calc(var(--tap) * .45); display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; }
.nest-btn small, .mix-btn small { font-size: 17px; margin-top: 4px; }
.mix-btn { background: #e5d8ff; }
.node { position: absolute; transform: translate(-50%, -50%); width: clamp(96px, 15vmin, 140px); height: clamp(96px, 15vmin, 140px); border-radius: 50%;
  background: radial-gradient(circle at 50% 35%, #fff, #fff 55%, var(--c)); border: 5px solid var(--ink); box-shadow: var(--shadow); display: flex; flex-direction: column; align-items: center; justify-content: center; z-index: 2; }
.node-num { position: absolute; top: -14px; left: -10px; width: 40px; height: 40px; border-radius: 50%; background: var(--c); border: 4px solid var(--ink); display: grid; place-items: center; font-size: 20px; color: #fff; text-shadow: 0 2px 0 rgba(0,0,0,.25); }
.node-sounds { font-size: clamp(20px, 3.4vmin, 30px); line-height: 1.05; max-width: 90%; text-align: center; word-spacing: -.05em; }
.node-stars { font-size: clamp(12px, 1.8vmin, 16px); background: #fff; border-radius: 99px; padding: 1px 8px; border: 2px solid var(--ink); position: absolute; bottom: -12px; white-space: nowrap; }
.node.locked { filter: grayscale(.85) brightness(.95); opacity: .85; }
.node.current { animation: glowpulse 1.6s ease-in-out infinite; }
.node.current::after { content: "👇"; position: absolute; top: -62px; font-size: 44px; animation: bob 1.2s ease-in-out infinite; }

/* ---------- level ---------- */
.level { overflow-y: auto; padding-bottom: 24vmin; }
.level-bg { position: fixed; inset: 0; background: linear-gradient(160deg, color-mix(in srgb, var(--c) 45%, #fff), #fffdf3); z-index: -1; }
.level-top { display: flex; align-items: center; gap: 2vmin; padding: 2vmin 3vmin; }
.level-top h2 { margin: 0; font-size: clamp(28px, 5vmin, 48px); display: flex; align-items: center; gap: 12px; }
.level-top h2 small { font-size: .55em; opacity: .7; }
.lvl-num { display: inline-grid; place-items: center; width: 1.4em; height: 1.4em; border-radius: 50%; background: var(--c, var(--green)); color: #fff; border: 3px solid var(--ink); font-size: .8em; }
.sound-tiles { display: flex; flex-wrap: wrap; gap: 2vmin; justify-content: center; padding: 1vmin 3vmin 3vmin; }
.sound-tile { width: clamp(96px, 14vmin, 130px); height: clamp(110px, 16vmin, 150px); background: #fff; border: 4px solid var(--ink); border-radius: 24px; box-shadow: var(--shadow); display: flex; flex-direction: column; align-items: center; justify-content: center; }
.sound-tile .grapheme { font-size: clamp(44px, 7vmin, 66px); line-height: 1; }
.sound-tile .emoji { font-size: clamp(28px, 4vmin, 38px); }
.heart-tile { background: #f3ebff; }
.heart-tile .grapheme { font-size: clamp(30px, 5vmin, 46px); }
.game-grid { display: grid; grid-template-columns: repeat(var(--cols, 3), minmax(0, 230px)); justify-content: center; gap: 2.4vmin; padding: 0 4vmin; max-width: 1200px; margin: 0 auto; }
.game-btn { background: var(--card); border: 4px solid var(--ink); border-radius: 28px; box-shadow: var(--shadow); padding: 16px 8px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.gicon { font-size: clamp(54px, 9vmin, 84px); line-height: 1.1; font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; }
.gname { font-size: clamp(17px, 2.5vmin, 22px); }
.game-btn .stars { font-size: 28px; }
.game-btn.next { background: #fff7d1; animation: glowpulse 1.6s ease-in-out infinite; }

/* ---------- game screens ---------- */
.game { background: linear-gradient(#bdf0ff, #f2fff0 60%, #d6f5c4); }
.game-top { position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: center; justify-content: space-between; gap: 2vmin; padding: 1.6vmin 2vmin; z-index: 4; }
.progress { display: flex; gap: 1.2vmin; flex-wrap: wrap; justify-content: center; }
.pdot { width: clamp(22px, 3.4vmin, 34px); height: clamp(28px, 4.2vmin, 42px); border-radius: 50% 50% 46% 46% / 60% 60% 40% 40%; background: #fff; border: 3px solid var(--ink); opacity: .55; transition: all .3s; }
.pdot.now { opacity: 1; transform: scale(1.2); background: #fff7d1; }
.pdot.done { opacity: 1; background: var(--green); }
.pdot.done-help { opacity: 1; background: var(--yellow); }
.stage { position: absolute; top: calc(var(--tap) * 1.15 + 3.2vmin); left: 0; right: 0; bottom: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4vmin; padding: 2vmin 3vmin 6vmin; }

/* egg hunt */
.nest-row { display: flex; gap: clamp(14px, 3vmin, 40px); align-items: flex-end; justify-content: center; flex-wrap: wrap; position: relative; z-index: 1; }
.egg-btn { position: relative; width: clamp(110px, min(24vmin, 20vw), 230px); animation: pop .45s var(--d) both; }
.egg-letter { font-family: "Andika", "Comic Sans MS", sans-serif; font-weight: 700; fill: var(--ink); stroke: #fffaf0; stroke-width: 6px; paint-order: stroke fill; }
.nest-base { width: min(92vw, 900px); height: 9vmin; margin-top: -8vmin; border-radius: 50%; background: repeating-linear-gradient(100deg, #c08552 0 10px, #a86b3c 10px 18px); border: 4px solid #7a4a26; }
.egg-btn.hatching svg { animation: shake .4s; }
.peek { position: absolute; left: 10%; right: 10%; top: -24%; animation: peek .6s both; pointer-events: none; }

/* dino snack */
.snack { display: flex; align-items: center; gap: 6vmin; }
.snack-dino { width: clamp(200px, 34vmin, 340px); transform-origin: 70% 60%; }
.snack-dino.chomp { animation: chomp .5s 2; }
.leaf-row { display: flex; gap: clamp(16px, 4vmin, 50px); }
.leaf { width: clamp(110px, 17vmin, 170px); height: clamp(110px, 17vmin, 170px); border-radius: 0 70% 0 70%; background: radial-gradient(circle at 30% 30%, #9bf09b, #3cc46a); border: 5px solid #1d7a43; box-shadow: var(--shadow); display: grid; place-items: center; transition: transform .2s, opacity .4s; }
.leaf .grapheme { font-size: clamp(50px, 8vmin, 80px); color: var(--ink); }
.leaf.eaten { transform: translateX(-40vw) scale(.2) rotate(-90deg); opacity: 0; transition: all .6s ease-in; }

/* pictures */
.pic-row { display: flex; gap: clamp(16px, 4vmin, 50px); flex-wrap: wrap; justify-content: center; }
.pic-card { width: clamp(130px, 21vmin, 200px); height: clamp(130px, 21vmin, 200px); background: #fff; border: 5px solid var(--ink); border-radius: 30px; box-shadow: var(--shadow); display: grid; place-items: center; }
.pic-card .emoji { font-size: clamp(70px, 12vmin, 120px); }
.pic-card.big { width: clamp(150px, 26vmin, 240px); height: clamp(150px, 26vmin, 240px); }
.pic-card.big .emoji { font-size: clamp(90px, 15vmin, 150px); }

/* robot */
.robot { position: relative; width: clamp(200px, 34vmin, 320px); }
.robot .beep { position: absolute; left: 6%; top: 18%; font-size: 34px; background: #fff; border-radius: 50%; border: 3px solid var(--ink); width: 54px; height: 54px; display: grid; place-items: center; }
.robot.talking svg { animation: talk .25s 8 alternate; }

/* stomp & read */
.read { display: flex; flex-direction: column; align-items: center; gap: 2vmin; }
.stones { position: relative; display: flex; gap: clamp(10px, 2.4vmin, 26px); padding-top: clamp(90px, 15vmin, 140px); }
.stomper { position: absolute; top: 0; left: 0; width: clamp(90px, 14vmin, 130px); transition: transform .35s cubic-bezier(.3, 1.6, .5, 1); transform: translateX(-90%); pointer-events: none; }
.stomper.hop svg { animation: hop .35s; }
.stone { width: clamp(110px, 17vmin, 160px); height: clamp(110px, 17vmin, 160px); border-radius: 46% 54% 50% 50% / 55% 50% 50% 45%; background: radial-gradient(circle at 35% 30%, #f1e7da, #c9b29a); border: 5px solid #6d5844; box-shadow: var(--shadow); display: flex; flex-direction: column; align-items: center; justify-content: center; }
.stone .grapheme { font-size: clamp(60px, 10vmin, 96px); line-height: 1; }
.stone .dot { width: 18px; height: 18px; border-radius: 50%; background: var(--pink); margin-top: 4px; }
.stone .bar { width: 60%; height: 12px; border-radius: 8px; background: var(--pink); margin-top: 6px; }
.stone.pulse { animation: glowpulse 1.2s ease-in-out infinite; }
.stone.tapped { background: radial-gradient(circle at 35% 30%, #fff8d6, #ffd166); }
.stone.flash { transform: scale(1.12); background: radial-gradient(circle at 35% 30%, #fff, #8ef0c9); transition: transform .1s; }
.smoosh { font-size: clamp(22px, 3.4vmin, 32px); padding: 10px 26px; border-radius: 99px; background: #fff; border: 4px solid var(--ink); box-shadow: var(--shadow); }

/* fossil builder */
.build { display: flex; align-items: center; gap: 5vmin; flex-wrap: wrap; justify-content: center; }
.boxes { display: flex; gap: 1.6vmin; }
.box { width: clamp(100px, 15vmin, 150px); height: clamp(110px, 17vmin, 160px); border: 5px dashed #8a6a4c; border-radius: 22px; background: rgba(177, 132, 89, .25); display: grid; place-items: center; }
.box.current { border-color: var(--pink); background: rgba(255, 209, 102, .35); animation: glowpulse 1.4s ease-in-out infinite; }
.box.filled { border-style: solid; background: #fff; border-color: var(--ink); animation: none; }
.box .grapheme { font-size: clamp(56px, 9vmin, 90px); }
.bone-row { display: flex; gap: clamp(44px, 6vmin, 64px); padding: 0 40px; flex-wrap: wrap; justify-content: center; }
.bone { position: relative; width: clamp(120px, 17vmin, 170px); height: clamp(80px, 11vmin, 110px); background: #fffaf0; border: 4px solid var(--ink); border-radius: 30px; box-shadow: var(--shadow); display: grid; place-items: center; }
.bone::before, .bone::after { content: ""; position: absolute; width: 34%; height: 46%; border-radius: 50%; background: #fffaf0; border: 4px solid var(--ink); z-index: -1; }
.bone::before { left: -14%; top: -14%; box-shadow: 0 calc(clamp(80px, 11vmin, 110px) * .62) 0 -4px #fffaf0, 0 calc(clamp(80px, 11vmin, 110px) * .62) 0 0 var(--ink); }
.bone::after { right: -14%; top: -14%; box-shadow: 0 calc(clamp(80px, 11vmin, 110px) * .62) 0 -4px #fffaf0, 0 calc(clamp(80px, 11vmin, 110px) * .62) 0 0 var(--ink); }
.bone .grapheme { font-size: clamp(46px, 7vmin, 70px); position: relative; }
.bone.used { opacity: .2; pointer-events: none; }

/* heart words */
.heart-card { display: flex; gap: 6px; background: #fff; border: 5px solid var(--ink); border-radius: 32px; padding: 3vmin 5vmin 2vmin; box-shadow: var(--shadow); }
.hpart { display: flex; flex-direction: column; align-items: center; padding: 0 6px; border-radius: 18px; }
.hpart .grapheme { font-size: clamp(90px, 18vmin, 180px); line-height: 1.05; }
.hpart .heart { font-size: clamp(32px, 6vmin, 56px); height: 1.1em; animation: bob 1.4s ease-in-out infinite; }
.hpart:not(.is-heart)::before { content: ""; height: clamp(35px, 6.6vmin, 62px); }
.hpart.is-heart .grapheme { color: var(--purple); }
.word-row { display: flex; gap: clamp(16px, 4vmin, 44px); flex-wrap: wrap; justify-content: center; }
.word-card { min-width: clamp(160px, 24vmin, 240px); padding: 2vmin 3vmin; background: #fff; border: 5px solid var(--ink); border-radius: 26px; box-shadow: var(--shadow); }
.word-card .grapheme { font-size: clamp(56px, 10vmin, 100px); }

/* meet the sounds */
.meet { display: flex; gap: 4vmin; align-items: center; justify-content: center; flex-wrap: wrap; width: 100%; }
.meet-card { display: flex; flex-direction: column; align-items: center; gap: 2vmin; background: #fff; border: 5px solid var(--ink); border-radius: 36px; padding: 2vmin 4vmin; box-shadow: var(--shadow); }
.big-letter { font-size: clamp(110px, 24vmin, 230px); line-height: 1; color: var(--blue); }
.mnemonic { display: flex; align-items: center; gap: 12px; background: #f1fbff; border-radius: 99px; padding: 8px 22px 8px 12px; border: 3px solid #b9e3f5; }
.mnemonic .emoji { font-size: clamp(48px, 8vmin, 76px); }
.mnemonic .key { font-size: clamp(22px, 3.6vmin, 34px); }
.trace-wrap { position: relative; width: clamp(280px, 44vmin, 480px); height: clamp(260px, 46vmin, 460px); background: #fff; border: 5px solid var(--ink); border-radius: 36px; box-shadow: var(--shadow); overflow: hidden; touch-action: none; }
.trace { position: absolute; inset: 0; touch-action: none; cursor: crosshair; }
.trace-hint { position: absolute; right: 14px; bottom: 10px; font-size: 40px; pointer-events: none; animation: bob 1.4s ease-in-out infinite; }
.trace-wrap.tracing .trace-hint, .trace-wrap:not(.ready) .trace-hint { display: none; }
.trace-wrap.traced { box-shadow: 0 0 0 8px var(--green), var(--shadow); }

/* feedback states */
.right { box-shadow: 0 0 0 8px var(--green), var(--shadow) !important; transform: scale(1.06); transition: transform .2s; }
.glow { animation: glowpulse 1s ease-in-out infinite; box-shadow: 0 0 0 8px var(--yellow), var(--shadow); }
.egg-btn.glow, .egg-btn.right { border-radius: 50%; }
.wobble { animation: wobble .5s; }
.pop { animation: pop .45s both; }
.hop { animation: hop .4s; }

/* ---------- reward ---------- */
.reward { background: radial-gradient(circle at 50% 55%, #fff9e0, #ffe08a 50%, #ffb347); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2vmin; }
.reward-stars .stars { font-size: clamp(50px, 9vmin, 90px); }
.big-egg { position: relative; width: min(46vmin, 380px); animation: pop .6s both; }
.big-egg.shake { animation: shake .4s; }
.big-egg.hatched { width: min(62vmin, 520px); }
.big-egg .shell-l { position: absolute; width: 40%; left: -10%; bottom: -4%; transform: rotate(-30deg); opacity: .85; }
.hatchling { animation: hatch .8s cubic-bezier(.3, 1.6, .5, 1) both; }
.reward-actions { display: flex; gap: 4vmin; }
.reward-actions button { width: calc(var(--tap) * 1.3); height: calc(var(--tap) * 1.3); font-size: calc(var(--tap) * .6); }
.reward-actions .home-btn { background: var(--green); color: #fff; }
.confetti { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }
.confetti i { position: absolute; top: 55%; width: 14px; height: 20px; border-radius: 3px; animation: confetti 1.6s ease-out forwards; }

/* break */
.break { background: linear-gradient(#2b2d6e, #5a4fa3); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3vmin; }
.break h2 { font-size: clamp(34px, 6vmin, 60px); margin: 0; }
.sleep-wrap { position: relative; width: min(50vmin, 400px); }
.zzz { position: absolute; right: 0; top: -10%; font-size: 60px; animation: bob 2s ease-in-out infinite; }
.zzz span { font-size: .7em; margin-left: 6px; }
.break .home-btn { color: var(--ink); }

/* ---------- nest ---------- */
.nest { overflow-y: auto; background: linear-gradient(#ffe9c7, #fff7e6); padding-bottom: 6vmin; }
.nest-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(clamp(110px, 16vmin, 160px), 1fr)); gap: 2vmin; padding: 0 3vmin; }
.nest-dino { position: relative; background: #fff; border-radius: 22px; border: 3px solid #f0d9b5; padding: 8px; }
.nest-dino.got { border-color: var(--ink); box-shadow: var(--shadow); }
.nest-dino .count { position: absolute; right: 8px; top: 6px; background: var(--yellow); border: 2px solid var(--ink); border-radius: 99px; padding: 0 8px; font-size: 15px; }

/* ---------- parent area ---------- */
.parent { overflow-y: auto; background: #f6f7fb; font-weight: 400; font-size: 17px; line-height: 1.5; padding-bottom: 6vmin; -webkit-user-select: text; user-select: text; }
.parent b, .parent h2, .parent h3 { font-weight: 700; }
.parent-top { display: flex; align-items: center; gap: 16px; padding: 16px 20px 8px; }
.parent-top .back-btn { width: 56px; height: 56px; font-size: 26px; }
.parent-top h2 { margin: 0; font-size: 28px; }
.tabs { display: flex; gap: 8px; padding: 6px 20px 12px; flex-wrap: wrap; position: sticky; top: 0; background: #f6f7fb; z-index: 2; }
.tab { padding: 10px 18px; border-radius: 99px; background: #fff; border: 2px solid #cfd5e3; font-weight: 600; }
.tab.sel { background: var(--ink); color: #fff; border-color: var(--ink); }
.parent-body { max-width: 980px; margin: 0 auto; padding: 0 20px; }
.card { background: #fff; border-radius: 18px; padding: 14px 22px; margin: 0 0 14px; box-shadow: 0 2px 8px rgba(0,0,0,.06); }
.card h3 { margin: 6px 0 8px; font-size: 21px; display: flex; align-items: center; gap: 10px; }
.card ul { padding-left: 22px; margin: 6px 0; } .card li { margin: 5px 0; }
.games-list { list-style: none; padding-left: 0 !important; } .games-list .gi { display: inline-block; width: 34px; font-size: 22px; }
.muted { color: #667; font-size: 15px; }
.sound-table { display: flex; flex-direction: column; gap: 4px; }
.srow { display: grid; grid-template-columns: 52px 70px 150px 90px 1fr; align-items: center; gap: 10px; padding: 6px 0; border-top: 1px solid #eef0f5; }
.srow.tricky { grid-template-columns: 52px 1fr; }
.srow .play { width: 46px; height: 46px; border-radius: 50%; background: var(--green); color: #fff; font-size: 18px; box-shadow: 0 3px 0 rgba(0,0,0,.15); }
.sg { font-size: 34px; text-align: center; }
.se { font-size: 16px; }
.kind { font-size: 13px; border-radius: 99px; padding: 2px 8px; text-align: center; background: #eef; }
.kind.stretchy { background: #d9f7ea; } .kind.bouncy { background: #ffe7d1; } .kind.vowel { background: #e8e0ff; }
.st { font-size: 15px; }
.chip { padding: 4px 12px; border-radius: 99px; background: #f3ebff; border: 2px solid #d6c4ff; font-family: "Andika", sans-serif; font-weight: 700; margin: 2px; }
.level-card { border-left: 10px solid var(--c); }
.big-g { font-size: 24px; }
.prow { display: grid; grid-template-columns: 44px minmax(260px, auto) 1fr; gap: 10px; align-items: center; padding: 6px 0; border-top: 1px solid #eef0f5; }
.prow.locked { opacity: .45; }
.prow .lvl-num { font-size: 16px; width: 34px; height: 34px; }
.pstars { font-size: 15px; } .pstars .stars { font-size: 13px; margin-right: 6px; }
.mchip { display: inline-block; min-width: 34px; text-align: center; padding: 2px 8px; margin: 2px; border-radius: 10px; font-family: "Andika", sans-serif; font-weight: 700; font-size: 17px; border: 2px solid transparent; }
.mchip.new { background: #eef0f5; color: #889; } .mchip.learning { background: #fff1c2; border-color: #ffd166; } .mchip.secure { background: #c9f5e2; border-color: #06d6a0; }
.legend { margin: 4px 0 8px; }
.ph svg { width: 56px; }
.setrow { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 8px 0; border-top: 1px solid #eef0f5; }
.setrow svg { width: 54px; }
.small { padding: 8px 14px; border-radius: 10px; background: #eef0f5; font-weight: 600; font-size: 15px; }
.small.danger { background: #ffe0e6; color: #b0123a; }
select { font: inherit; padding: 6px 10px; border-radius: 10px; }
.vmsg { margin: 10px 0 4px; padding: 10px 14px; border-radius: 12px; font-size: 15px; }
.vmsg.warn { background: #fff1c2; border: 2px solid #ffd166; }
.vmsg.ok { background: #d9f7ea; border: 2px solid var(--green); }
.vsummary { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 8px 0 4px; font-weight: 600; }
.vlist { display: flex; flex-direction: column; }
.vrow { display: grid; grid-template-columns: 96px 1fr 130px auto; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid #eef0f5; }
.vrow.own .vg { color: var(--purple); }
.vg { font-size: 34px; text-align: center; line-height: 1.1; }
.vinfo { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 16px; }
.vkey { font-weight: 600; }
.vtip { flex-basis: 100%; font-size: 14px; color: #556; }
.vstate { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.vbadge { font-size: 13px; font-weight: 700; border-radius: 99px; padding: 3px 10px; }
.vbadge.built { background: #eef0f5; color: #667; }
.vbadge.mine { background: #efe6ff; color: #6a3fc7; border: 2px solid #d6c4ff; }
.vbadge.new { background: #fff1c2; border: 2px solid #ffd166; }
.vbadge.rec { background: #ffe0e6; color: #b0123a; animation: pulse 1.2s ease-in-out infinite; }
.vmeter { width: 110px; height: 8px; border-radius: 99px; background: #eef0f5; overflow: hidden; }
.vmeter i { display: block; height: 100%; width: 0; background: var(--green); transition: width .08s linear; }
.vactions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.vbtn { min-height: 44px; padding: 8px 14px; border-radius: 12px; background: #eef0f5; font-weight: 600; font-size: 15px; white-space: nowrap; }
.vbtn.record { background: #ffe0e6; color: #b0123a; }
.vbtn.stop { background: #b0123a; color: #fff; min-width: 110px; }
.vbtn.save { background: var(--green); color: #fff; }
.vbtn.play, .vbtn.play-new { background: #d9f7ea; }
@media (max-width: 960px) {
  .vrow { grid-template-columns: 80px 1fr auto; row-gap: 8px; }
  .vg { grid-row: span 2; }
  .vstate { align-items: flex-end; }
  .vactions { grid-column: 2 / -1; justify-content: flex-start; }
}
@media (max-width: 480px) {
  .vrow { grid-template-columns: 56px 1fr auto; }
  .vg { font-size: 28px; }
}

/* ---------- animations ---------- */
@keyframes pop { 0% { transform: scale(.3); opacity: 0; } 70% { transform: scale(1.08); opacity: 1; } 100% { transform: scale(1); } }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.08); } }
@keyframes glowpulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 209, 102, .9), var(--shadow); } 50% { box-shadow: 0 0 0 12px rgba(255, 209, 102, .55), var(--shadow); } }
@keyframes wobble { 0%, 100% { transform: rotate(0); } 20% { transform: rotate(-9deg); } 40% { transform: rotate(8deg); } 60% { transform: rotate(-6deg); } 80% { transform: rotate(4deg); } }
@keyframes shake { 0%, 100% { transform: translateX(0) rotate(0); } 25% { transform: translateX(-8px) rotate(-6deg); } 75% { transform: translateX(8px) rotate(6deg); } }
@keyframes hop { 0%, 100% { transform: translateY(0); } 45% { transform: translateY(-26px); } }
@keyframes peek { from { transform: translateY(40%) scale(.5); opacity: 0; } to { transform: translateY(0) scale(1); opacity: 1; } }
@keyframes chomp { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(-8deg) scale(1.05); } }
@keyframes talk { from { transform: translateY(0) rotate(0); } to { transform: translateY(-5px) rotate(2deg); } }
@keyframes hatch { 0% { transform: translateY(30%) scale(.2); opacity: 0; } 100% { transform: translateY(0) scale(1); opacity: 1; } }
@keyframes confetti { 0% { transform: translate(0, 0) rotate(0); opacity: 1; } 100% { transform: translate(var(--x), calc(var(--y) + 80vh)) rotate(var(--r)); opacity: 0; } }
@keyframes drift { from { transform: translateX(-10vw); } to { transform: translateX(10vw); } }
.bounce-in { animation: pop .45s both; }

@media (max-height: 560px) {
  .stage { gap: 2vmin; }
  .nest-base { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
