/* Дар · иконки, карта пути, цель дня, награды, анимации */
:root { --leaf-soft: #DDF6EA; }
[data-theme=night] { --leaf-soft: #123526; }
[data-theme=dawn] { --leaf-soft: #E7EEDD; }

/* иконки и тона */
.ico { width: 1.25em; height: 1.25em; flex: none; vertical-align: -.22em; }
.medal .ico { width: 62%; height: 62%; }
.medal.huge { width: 92px; height: 92px; border-radius: 30px; }
.medal.num { font-size: .86rem; font-weight: 800; }
.medal.onc { color: #fff; }
.t-pri { background: var(--pri-soft); color: var(--pri); }
.t-gold { background: var(--gold-soft); color: color-mix(in srgb, var(--gold) 82%, #7A4A00); }
.t-clay { background: var(--clay-soft); color: var(--clay); }
.t-sky { background: var(--sky-soft); color: var(--sky); }
.t-vio { background: var(--vio-soft); color: var(--vio); }
.t-leaf { background: var(--leaf-soft); color: var(--leaf); }
.t-off { background: var(--bg2); color: var(--muted); opacity: .6; }
.hero .em, .cover .em { color: #fff; opacity: .96; }
.hero .em .ico { width: 76px; height: 76px; } .cover .em .ico { width: 70px; height: 70px; }
.intro .medal .ico { width: 62px; height: 62px; }
.kcard .em .ico { width: 44px; height: 44px; } .kpage .em .ico { width: 84px; height: 84px; } .kpage .em.small { width: 110px; height: 110px; } .kpage .em.small .ico { width: 60px; height: 60px; }
.kcard .em, .kpage .em { color: #24427F; }
.k0 { color: #2F5BF5 !important; } .k1 { color: #0E9F8E !important; } .k2 { color: #D9822B !important; } .k3 { color: #E0527A !important; } .k4 { color: #6A55E0 !important; } .k5 { color: #B8860B !important; }
.kcard .star { color: var(--gold); } .kcard .star .ico { width: 24px; height: 24px; }
.note .lbl .ico { width: 1.3em; height: 1.3em; margin-right: 2px; }
.opt .ico, .ev .ico { width: 1.5em; height: 1.5em; color: var(--pri); margin-right: 4px; }
.pill .ico { width: 1.1em; height: 1.1em; }
.mcard .emo .ico { width: 46px; height: 46px; color: var(--pri); } .mcard.gone .emo .ico { color: var(--ok); }
.ibtn .ico { width: 24px; height: 24px; color: var(--pri); }

/* плавное появление экрана */
#app.page-in > * { animation: rise .28s ease both; }
#app.page-in > *:nth-child(2) { animation-delay: .03s; } #app.page-in > *:nth-child(3) { animation-delay: .06s; } #app.page-in > *:nth-child(4) { animation-delay: .09s; } #app.page-in > *:nth-child(n+5) { animation-delay: .12s; }

/* голубь на главной */
.dove { flex: none; border-radius: 50%; transition: transform .15s; touch-action: manipulation; }
.dove:active { transform: scale(.92); }
.dove.hopping { animation: hop .7s ease; }

/* уровень и цель дня */
.lvl { display: flex; gap: 12px; align-items: center; background: var(--card); border-radius: 20px; padding: 12px 14px; box-shadow: var(--shadow2); margin-top: 14px; }
.lvl b { font-weight: 800; letter-spacing: -.01em; } .lvl .prog { margin-top: 6px; height: 10px; } .lvl small { font-weight: 700; font-size: .78rem; }
.card .lvl { background: var(--bg); box-shadow: none; margin-top: 0; }
.goal { padding: 16px; }
.gitem { display: flex; gap: 8px; align-items: center; margin-top: 8px; font-weight: 600; font-size: .92rem; line-height: 1.25; color: var(--muted); }
.gitem .ico { width: 22px; height: 22px; color: var(--line); flex: none; }
.gitem.on { color: var(--ink); } .gitem.on .ico { color: var(--ok); }
.chest { display: flex; flex-direction: column; align-items: center; gap: 6px; flex: none; width: 104px; text-align: center; transition: transform .15s; }
.chest small { font-weight: 800; font-size: .72rem; line-height: 1.2; color: var(--muted); }
.chest[disabled] .medal { filter: grayscale(.7); opacity: .6; }
.goal.ready .chest .medal { animation: glow 1.4s ease-in-out infinite; } .goal.ready .chest small { color: color-mix(in srgb, var(--gold) 80%, #7A4A00); }
.goal.opened .chest .medal { background: var(--ok-soft); color: var(--ok); filter: none; opacity: 1; }
.chest:not([disabled]):active { transform: scale(.94); }
@keyframes glow { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--gold) 55%, transparent); transform: scale(1); } 50% { box-shadow: 0 0 0 12px transparent; transform: scale(1.06); } }

/* карта пути */
.pmap { display: flex; flex-direction: column; align-items: center; gap: 18px; padding: 24px 0 10px; }
.prow { display: flex; flex-direction: column; align-items: center; width: 190px; transform: translateX(var(--x, 0)); }
.pnode { position: relative; width: 78px; height: 78px; border-radius: 50%; display: grid; place-items: center; background: var(--card) !important; box-shadow: 0 7px 0 var(--line), var(--shadow2); transition: transform .1s, box-shadow .1s; touch-action: manipulation; }
.pnode:active { transform: translateY(5px); box-shadow: 0 2px 0 var(--line); }
.pnode .ico { width: 40px; height: 40px; }
.pnode.done { background: var(--grad) !important; color: #fff; box-shadow: 0 7px 0 color-mix(in srgb, var(--pri) 68%, #000), var(--shadow2); }
.pnode.done:active { box-shadow: 0 2px 0 color-mix(in srgb, var(--pri) 68%, #000); }
.pnode .badge { position: absolute; right: -4px; bottom: -2px; width: 26px; height: 26px; border-radius: 50%; background: var(--ok); color: #fff; display: grid; place-items: center; border: 3px solid var(--bg); }
.pnode .badge .ic { width: 13px; height: 13px; stroke-width: 3.5; }
.pnode.next::before { content: ''; position: absolute; inset: -9px; border-radius: 50%; border: 4px solid var(--pri); opacity: .5; animation: ring 1.6s ease-out infinite; }
@keyframes ring { 0% { transform: scale(.9); opacity: .7; } 100% { transform: scale(1.22); opacity: 0; } }
.pdove { position: absolute; left: -62px; top: 8px; pointer-events: none; animation: hop 2.4s ease-in-out infinite; }
.ptitle { margin-top: 12px; font-size: .82rem; font-weight: 700; line-height: 1.22; text-align: center; letter-spacing: -.01em; }

/* поздравления и награды */
.cheer { text-align: center; padding: 6px 4px 0; }
.cheer .medal { margin: 0 auto 12px; animation: pop .4s ease; }
.cheer h2 { font-size: 1.4rem; margin: 6px 0 6px; } .cheer p { line-height: 1.45; font-weight: 600; }
.awgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px 6px; }
.aw { display: flex; flex-direction: column; align-items: center; gap: 5px; text-align: center; transition: transform .12s; }
.aw:active { transform: scale(.92); }
.aw small { font-size: .64rem; font-weight: 700; line-height: 1.15; color: var(--muted); }
.aw.on small { color: var(--ink); }
.aw .medal.big { width: 56px; height: 56px; border-radius: 19px; }

/* пояснение в тесте с голубем */
.why { display: flex; gap: 10px; align-items: center; } .why .hesi { flex: none; }

/* конфетти */
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 70; overflow: hidden; }
.confetti i { position: absolute; top: 28%; display: block; opacity: 0; animation: conf 1.7s cubic-bezier(.2, .7, .4, 1) forwards; }
@keyframes conf { 0% { transform: translate(0, 0) rotate(0); opacity: 1; } 18% { transform: translate(calc(var(--dx) * .5), -150px) rotate(calc(var(--r) * .3)); opacity: 1; } 100% { transform: translate(var(--dx), var(--dy)) rotate(var(--r)); opacity: 0; } }

/* смахивание карточек */
.swipe, .kpage { touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.swipe { cursor: grab; }

/* живые нажатия */
.btn, .tile, .litem, .kcard, .choice, .opt, .chip, .ev, .mcard, .aw, .hero { touch-action: manipulation; }
.tile .medal, .gcard .medal { transition: transform .2s; }
.tile:active .medal, .gcard:active .medal { transform: scale(1.12) rotate(-6deg); }
.opt.ok { animation: yes .35s ease; } .opt.bad { animation: nope .3s ease; }
@keyframes yes { 50% { transform: scale(1.03); } } @keyframes nope { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
.prog i { position: relative; overflow: hidden; }
.prog i::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .45), transparent); transform: translateX(-100%); animation: shine 2.4s ease-in-out infinite; }
@keyframes shine { 60%, 100% { transform: translateX(100%); } }
@media (max-width: 360px) { .awgrid { grid-template-columns: repeat(3, 1fr); } .chest { width: 88px; } }

/* ===== обновление: живые уроки и истории ===== */
/* шрифт стихов — тот же современный, что и во всём приложении */
:root { --serif: 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; }
.verse .vt { font-weight: 600; letter-spacing: -.01em; line-height: 1.55; }
.verse.big .vt { font-size: 1.16rem; }
.intro .hook, .trv p, .chip, .memtxt { font-weight: 600; }

/* меню всегда внизу, кнопки шага — над ним */
.foot { bottom: calc(var(--tab) + 14px + env(safe-area-inset-bottom)); z-index: 5; }
#app.full .foot { bottom: 0; }

/* фон: медленно плывущие пятна */
#bgdeco::before, #bgdeco::after { content: ''; position: absolute; width: 60vmax; height: 60vmax; border-radius: 50%; filter: blur(60px); opacity: .5; animation: drift 26s ease-in-out infinite alternate; }
#bgdeco::before { background: var(--blob1); left: -20vmax; top: -18vmax; }
#bgdeco::after { background: var(--blob2); right: -24vmax; bottom: -22vmax; animation-duration: 32s; animation-direction: alternate-reverse; }
@keyframes drift { to { transform: translate(8vmax, 6vmax) scale(1.15); } }

/* сцена урока */
.lscene { position: relative; height: 150px; border-radius: 28px; overflow: hidden; margin-top: 6px; display: grid; place-items: center; color: #fff; box-shadow: var(--shadow); }
.lscene .big .ico { width: 92px; height: 92px; filter: drop-shadow(0 8px 14px rgba(0, 0, 0, .18)); animation: bob 3.2s ease-in-out infinite; }
.lscene .sp, .kscene .sp { position: absolute; color: #fff; opacity: .85; animation: twinkle 2.4s ease-in-out infinite; }
.sp .ico { width: 22px; height: 22px; }
.sp.s1 { left: 14%; top: 22%; } .sp.s2 { right: 16%; top: 30%; animation-delay: .8s; } .sp.s3 { left: 26%; bottom: 18%; animation-delay: 1.5s; }
@keyframes bob { 50% { transform: translateY(-8px) rotate(-3deg); } }
@keyframes twinkle { 0%, 100% { transform: scale(.6); opacity: .3; } 50% { transform: scale(1.15); opacity: 1; } }
.lscene + .intro { padding-top: 18px; }

/* шаг урока */
.lstep, .kstep { min-height: calc(100dvh - 300px); display: flex; flex-direction: column; justify-content: center; padding: 14px 0 6px; touch-action: pan-y; }
.lcard { position: relative; background: var(--card); border-radius: 28px; padding: 24px 22px; box-shadow: var(--shadow); overflow: hidden; }
.lcard h3 { font-size: 1.3rem; font-weight: 800; letter-spacing: -.02em; margin-bottom: 10px; color: var(--pri); }
.ltext { font-size: 1.14rem; line-height: 1.62; font-weight: 500; position: relative; z-index: 1; }
.lcard .wm { position: absolute; right: -18px; bottom: -22px; color: var(--pri); opacity: .07; pointer-events: none; } .lcard .wm .ico { width: 150px; height: 150px; }
.wi { display: inline-block; opacity: 0; animation: wordin .32s ease forwards; }
@keyframes wordin { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.vseal { display: flex; flex-direction: column; align-items: center; gap: 10px; width: 100%; background: var(--card); border-radius: 28px; padding: 34px 20px; box-shadow: var(--shadow); text-align: center; transition: transform .12s; }
.vseal:active { transform: scale(.97); }
.vseal .medal { animation: glow 1.6s ease-in-out infinite; }
.vseal b { font-size: 1.2rem; font-weight: 800; letter-spacing: -.02em; } .vseal small { color: var(--muted); font-weight: 700; }
.note.open { animation: pop .3s ease; font-size: 1.02rem; line-height: 1.6; padding: 18px; border-radius: 22px; }
.keyq.big { font-size: 1.5rem; padding: 34px 20px; animation: pop .4s ease; }
.gapw { display: inline-block; padding: 0 8px; border-radius: 8px; background: var(--pri-soft); color: var(--pri); font-weight: 800; letter-spacing: .02em; }
.gapw.ok { background: var(--ok-soft); color: var(--ok); animation: yes .35s ease; }
.opts.row3 { flex-direction: row; flex-wrap: wrap; } .opts.row3 .opt { flex: 1 1 30%; text-align: center; padding: 14px 8px; font-weight: 800; }
.floatup { position: absolute; z-index: 80; transform: translate(-50%, -10px); font-weight: 800; color: color-mix(in srgb, var(--gold) 80%, #7A4A00); pointer-events: none; animation: floatup .9s ease forwards; }
@keyframes floatup { to { transform: translate(-50%, -60px); opacity: 0; } }

/* сцена детской истории */
.kscene { position: relative; height: 210px; border-radius: 32px; overflow: hidden; display: grid; place-items: center; box-shadow: var(--shadow); }
.kscene .big .ico { width: 112px; height: 112px; animation: bob 2.6s ease-in-out infinite; filter: drop-shadow(0 8px 12px rgba(0, 0, 0, .12)); }
.kscene .sp { color: currentColor; }
.kscene .cl { position: absolute; height: 26px; border-radius: 26px; background: rgba(255, 255, 255, .75); animation: cloud 14s linear infinite; }
.kscene .cl.c1 { width: 86px; top: 22px; left: -90px; } .kscene .cl.c2 { width: 60px; top: 62px; left: -70px; animation-duration: 19s; animation-delay: 4s; opacity: .6; }
@keyframes cloud { to { transform: translateX(560px); } }
.kscene .fly { position: absolute; left: -70px; top: 34px; animation: fly 6s ease-in-out infinite; }
@keyframes fly { 0% { transform: translate(0, 0); } 50% { transform: translate(55vw, -18px); } 100% { transform: translate(110vw, 6px); } }
.ktext { background: var(--card); border-radius: 26px; padding: 20px; box-shadow: var(--shadow2); margin-top: 14px; }
.ktext p { font-size: 1.26rem; line-height: 1.55; font-weight: 700; } .ktext h1 { font-size: 1.8rem; font-weight: 800; letter-spacing: -.03em; line-height: 1.15; margin-bottom: 8px; }
.catch { position: relative; height: 300px; border-radius: 32px; margin-top: 12px; overflow: hidden; box-shadow: var(--shadow2); }
.bub { position: absolute; width: 78px; height: 78px; border-radius: 50%; background: rgba(255, 255, 255, .88); display: grid; place-items: center; box-shadow: 0 6px 14px rgba(0, 0, 0, .1); animation: bub 2.6s ease-in-out infinite; touch-action: manipulation; }
.bub .ico { width: 42px; height: 42px; } .bub.pop { animation: burst .3s ease forwards; pointer-events: none; }
@keyframes bub { 50% { transform: translateY(-14px); } } @keyframes burst { to { transform: scale(1.7); opacity: 0; } }
.count { font-size: 1.6rem; font-weight: 800; margin-top: 12px; color: var(--pri); }
.pickgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.pk { aspect-ratio: 1 / 1; border-radius: 30px; display: grid; place-items: center; box-shadow: var(--shadow2); transition: transform .12s; touch-action: manipulation; } .pk:active { transform: scale(.94); } .pk .ico { width: 56%; height: 56%; }
.pk.ok { box-shadow: 0 0 0 5px var(--ok); animation: yes .35s ease; } .pk.no { opacity: .35; animation: nope .3s ease; }

/* ===== экзамен по разделам и установка на телефон ===== */
.exlv { display: inline-flex; gap: 4px; } .exlv i { width: 8px; height: 8px; border-radius: 50%; background: var(--line); } .exlv i.on { background: var(--gold); }
.exq { margin-top: 12px; } .exq h2 { margin-top: 6px; }
.exres { margin-top: 12px; display: grid; gap: 11px; }
.exrow { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) 42px; align-items: center; gap: 10px; font-weight: 700; font-size: .88rem; text-align: left; line-height: 1.25; }
.exrow .prog { flex: none; } .exrow b { text-align: right; font-variant-numeric: tabular-nums; }
.exrow .prog i { animation: exgrow .9s cubic-bezier(.2, .8, .2, 1) both; transform-origin: left; }
@keyframes exgrow { from { transform: scaleX(0); } }
.isteps { display: grid; gap: 10px; margin-top: 14px; }
.istep { display: flex; align-items: center; gap: 12px; background: var(--card); border-radius: 20px; padding: 14px; box-shadow: var(--shadow2); animation: stepin .45s both; text-align: left; }
.istep:nth-child(2) { animation-delay: .08s; } .istep:nth-child(3) { animation-delay: .16s; } .istep:nth-child(4) { animation-delay: .24s; }
.istep .num { flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--pri); color: #fff; font-weight: 800; display: grid; place-items: center; }
.istep b { display: block; line-height: 1.3; } .istep small { display: block; color: var(--muted); font-weight: 600; line-height: 1.45; margin-top: 3px; }
@keyframes stepin { from { opacity: 0; transform: translateY(10px); } }
@media (prefers-reduced-motion: reduce) { .istep, .exrow .prog i { animation: none; } }
