/* album.css — «Альбом», the sticker book (js/games/album.js), and the family tree photos of the theme «Семья». Loaded after common.css. */

/* the screen: the title, the bookmarks, the book with arrows on both sides, the hint below */
.alscreen{position:fixed;inset:0;display:flex;flex-direction:column;align-items:center;gap:10px;overflow:hidden;
  padding:calc(max(14px,env(safe-area-inset-top)) + 10px) 16px calc(env(safe-area-inset-bottom) + 12px)}
.alscreen>:not(.sbworld):not(.sbwash):not(.tback){position:relative;z-index:2}
.alscreen>.tback{z-index:6}
.altitle{padding:10px 26px;border-radius:999px;background:#FFFBF2;color:#5B3E26;font:900 clamp(22px,3vw,32px)/1.1 Rubik,Nunito,sans-serif;
  box-shadow:0 6px 14px rgba(74,58,44,.18);white-space:nowrap}
/* bookmarks: the cover and every theme */
.altabs{display:flex;gap:8px;flex-wrap:wrap;justify-content:center;max-width:calc(100vw - 2 * clamp(90px,12vw,150px))}
.altab{position:relative;width:clamp(44px,5.4vw,60px);aspect-ratio:1/1;border:0;border-radius:14px;background:#FFFBF2;padding:5px;cursor:pointer;
  box-shadow:0 4px 10px rgba(74,58,44,.15);transition:transform .2s ease}
.altab img{width:100%;height:100%;object-fit:contain}
.altab.on{box-shadow:0 0 0 4px #F3C96B,0 6px 12px rgba(74,58,44,.2);transform:translateY(-3px)}
.altab.locked img{filter:grayscale(1);opacity:.5}
.aldot{position:absolute;top:-4px;right:-4px;width:14px;height:14px;border-radius:50%;background:#E5484D;box-shadow:0 0 0 3px #fff}

/* the book: a 4:3 page in a cream paper cover, with a soft fold shadow on the left like a bound page */
.alstage{flex:1 1 auto;min-height:0;width:100%;display:flex;align-items:center;justify-content:center;gap:clamp(6px,1.5vw,18px);touch-action:none;container-type:size}
.albook{position:relative;flex:0 0 auto;width:min(calc(100cqw - 2 * clamp(46px,6vw,70px) - 2 * clamp(6px,1.5vw,18px) - 20px),calc((100cqh - 16px) * 4 / 3));
  aspect-ratio:4/3;container-type:size;perspective:1600px}
.alpage{position:absolute;inset:0;background-size:cover;background-position:center;border-radius:6px 18px 18px 6px;overflow:hidden;
  box-shadow:0 0 0 7px #FFFBF2,-10px 0 0 7px #EADFCB,0 16px 34px rgba(74,58,44,.3);transform-origin:left center}
/* the page is softened so the stickers stand out, and the fold shadow sits on top of it */
.alpage::before{content:'';position:absolute;inset:0;background:rgba(255,251,242,.38);pointer-events:none}
.alpage::after{content:'';position:absolute;inset:0 auto 0 0;width:7%;background:linear-gradient(90deg,rgba(74,58,44,.22),rgba(74,58,44,0));pointer-events:none;z-index:8}
/* turning the page */
.alpage.alnext{animation:alnext .5s ease-out}
.alpage.alprev{animation:alprev .5s ease-out}
@keyframes alnext{from{transform:rotateY(-24deg) translateX(4%);opacity:.3}to{transform:none;opacity:1}}
@keyframes alprev{from{transform:translateX(-6%);opacity:.3}to{transform:none;opacity:1}}
.alarrow{flex:0 0 auto;width:clamp(46px,6vw,70px);aspect-ratio:1/1;border:0;border-radius:50%;background:#FFFBF2;color:#5B3E26;cursor:pointer;
  font:900 clamp(30px,4vw,48px)/1 Nunito,sans-serif;box-shadow:0 6px 14px rgba(74,58,44,.2)}
.alarrow:disabled{opacity:.3;cursor:default}

/* the cover: drawn for now (cream with the title and how many are collected), a picture IMG['album-cover'] replaces it */
.alcover{background-color:#F6EFE6}
.alcover::before{background:none}
.alcovert{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2cqh;z-index:2;color:#5B3E26;text-align:center}
.alcovert b{font:900 14cqh/1 Rubik,Nunito,sans-serif}
.alcovert span{font:800 5.5cqh/1.2 Nunito,sans-serif;background:#FFFBF2;padding:1cqh 3cqh;border-radius:999px;box-shadow:0 2px 8px rgba(74,58,44,.15)}

/* a sticker place: its picture sits in the middle; not earned yet — a pale grey sketch, earned — in colour with a white paper edge */
.alst{position:absolute;z-index:5;width:15%;aspect-ratio:1/1;padding:0;border:0;background:none;cursor:pointer;
  transform:translate(-50%,-50%) rotate(var(--r,0deg))}
.alst img{width:100%;height:100%;object-fit:contain;pointer-events:none;filter:grayscale(1) contrast(.55) brightness(1.3);opacity:.42;transition:filter .5s,opacity .5s}
.alst.got img{filter:drop-shadow(2px 0 0 #fff) drop-shadow(-2px 0 0 #fff) drop-shadow(0 2px 0 #fff) drop-shadow(0 -2px 0 #fff) drop-shadow(0 5px 6px rgba(74,58,44,.3));opacity:1}
/* a new sticker sticks on: drops onto its place, one after another */
.alst.stick img{animation:alstick .6s cubic-bezier(.3,1.4,.5,1) both;animation-delay:calc(.45s + var(--k,0) * .35s)}
@keyframes alstick{0%{transform:scale(1.8) rotate(-12deg);opacity:0}60%{opacity:1}100%{transform:none;opacity:1}}
.alst.alhop img{animation:alhop .45s ease}
@keyframes alhop{0%,100%{transform:none}40%{transform:translateY(-10%) scale(1.08)}}
.alst.alno img{animation:alno .4s ease}
@keyframes alno{0%,100%{transform:none}25%{transform:rotate(-6deg)}75%{transform:rotate(6deg)}}

/* a page that is not open yet */
.allock{position:absolute;inset:0;z-index:9;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;padding:20px;
  background:rgba(255,248,236,.55);color:#5B3E26;font:800 clamp(16px,2.2vw,24px)/1.2 Nunito,sans-serif;text-align:center}
.allock span{font-size:2.4em}

/* below the book */
.altraybox{width:100%;max-width:1100px;display:flex;flex-direction:column;align-items:center;gap:6px}
.alhint{margin:0;padding:6px 14px;border-radius:12px;background:rgba(255,251,242,.92);color:#5B3E26;
  font:700 clamp(14px,1.8vw,18px)/1.25 Nunito,sans-serif;text-align:center;max-width:46em}
.altest{font-size:13px!important;padding:6px 12px!important;opacity:.7}

/* the new sticker on the «Все уровни пройдены!» card, and the dot on the «Альбом» button */
.alnew{display:flex;align-items:center;gap:10px;padding:8px 14px;border-radius:14px;background:#FBEFD0;color:#5B3E26;font:800 18px/1.2 Nunito,sans-serif}
.alnew img{width:56px;height:56px;object-fit:contain}
.halbum.alhas{position:relative}
.halbum.alhas::after{content:'';position:absolute;top:2px;right:2px;width:14px;height:14px;border-radius:50%;background:#E5484D;box-shadow:0 0 0 3px #fff}

/* «Наряди семью» (album.js: dressHTML): the tree fills the screen, the child's photo big in the middle, decorations to drag */
.dsscreen{position:fixed;inset:0;overflow:hidden;background:#A9D0F5}
.dsbg{position:absolute;inset:-40px;background-size:cover;background-position:center;filter:blur(22px) saturate(.9) brightness(1.04);pointer-events:none}
/* the tree is always whole: as wide or as tall as the screen allows, the sides fading into its blurred copy */
.dsbox{position:absolute;left:50%;top:50%;width:min(100vw,calc(100vh * var(--ar)));aspect-ratio:var(--ar);transform:translate(-50%,-50%);
  background-size:100% 100%;touch-action:none;
  -webkit-mask-image:linear-gradient(90deg,transparent,#000 3%,#000 97%,transparent);mask-image:linear-gradient(90deg,transparent,#000 3%,#000 97%,transparent)}
.dsscreen>#back{z-index:6}
.dsreset{position:absolute;right:clamp(12px,2vw,22px);top:max(14px,env(safe-area-inset-top));z-index:6;width:clamp(58px,6.6vw,76px);height:clamp(58px,6.6vw,76px)}
.dsfr{position:absolute;z-index:4;width:10.5%;transform:translate(-50%,-50%);border:0;background:none;padding:0;cursor:pointer;
  display:flex;flex-direction:column;align-items:center;gap:4px}
.dsfr.dskid{width:16%}
.dsimg{width:100%;aspect-ratio:1/1;border-radius:50%;overflow:hidden;background:#fff;box-shadow:0 0 0 .45vw #FFFBF2,0 .7vw 1.4vw rgba(74,58,44,.3)}
.dsfr.dskid .dsimg{box-shadow:0 0 0 .6vw #FFFBF2,0 0 0 1.1vw #F3C96B,0 1vw 2vw rgba(74,58,44,.32)}
.dsimg img{width:100%;height:100%;object-fit:cover}
.dsfr b{font:800 clamp(11px,1.3vw,17px)/1.1 Nunito,sans-serif;color:#5B3E26;background:#FFFBF2;padding:2px 9px;border-radius:999px;white-space:nowrap;
  box-shadow:0 2px 6px rgba(74,58,44,.18)}
.dsfr.dskid b{font-size:clamp(13px,1.6vw,21px)}
.dsfr.alhop .dsimg{animation:alhop .45s ease}
.dsacc{position:absolute;z-index:7;width:11%;aspect-ratio:1/1;cursor:grab;touch-action:none;
  transform:translate(-50%,-50%) rotate(var(--r,0deg)) scale(var(--s,1))}
.dsacc img,.dstray img,.dsghost img{width:100%;height:100%;object-fit:contain;pointer-events:none;filter:drop-shadow(0 4px 5px rgba(74,58,44,.3))}
/* the tray of decorations over the grass at the bottom */
.dstraybox{position:absolute;left:50%;bottom:calc(env(safe-area-inset-bottom) + 12px);transform:translateX(-50%);z-index:6;max-width:calc(100vw - 24px);
  padding:8px 10px;border-radius:26px;background:rgba(255,251,242,.92);box-shadow:0 8px 20px rgba(74,58,44,.2)}
.dstrayrow{display:flex;gap:8px;overflow-x:auto;max-width:100%;scrollbar-width:none}
.dstrayrow::-webkit-scrollbar{display:none}
.dstray{position:relative;flex:0 0 auto;width:clamp(54px,6.4vw,74px);aspect-ratio:1/1;padding:7px;border-radius:16px;cursor:grab;touch-action:none;background:#F6EEDF}
.dstray.locked{cursor:default}
.dstray.locked img{filter:grayscale(1);opacity:.35}
.dstray.locked i{position:absolute;right:3px;bottom:1px;font-style:normal;font-size:clamp(13px,1.6vw,18px)}
.dsghost{position:fixed;left:0;top:0;z-index:100;pointer-events:none}

/* theme «Семья» (themes/family/theme.js) */
/* «Учим слова» on a wide screen: the whole room fits, its soft blurred continuation fills the sides */
.wstage.wfit{width:min(100vw,calc(100vh * var(--ar)))!important;
  -webkit-mask-image:linear-gradient(90deg,transparent,#000 4%,#000 96%,transparent);mask-image:linear-gradient(90deg,transparent,#000 4%,#000 96%,transparent)}
.wstagebg{position:absolute;inset:-40px;z-index:0;background-size:cover;background-position:center;filter:blur(22px) saturate(.9) brightness(1.03);pointer-events:none}
/* the floor lamp: a warm light that breathes, clearly seen */
.fwallin .flamp{width:30%;opacity:1;background:radial-gradient(closest-side,rgba(255,232,170,.9),rgba(255,214,140,.5) 45%,rgba(255,206,130,0));
  animation:flamp2 2.8s ease-in-out infinite alternate;transition:width .8s ease}
@keyframes flamp2{from{opacity:.55;transform:translate(-50%,-50%) scale(.92)}to{opacity:1;transform:translate(-50%,-50%) scale(1.06)}}
/* evening: the room goes dusky, only the lamp's circle and the photos glow */
.fdusk{position:absolute;inset:0;opacity:0;transition:opacity 1.2s ease;pointer-events:none;
  background:radial-gradient(circle at var(--lx) var(--ly),rgba(40,26,40,0) 0 8%,rgba(40,26,40,.38) 24%,rgba(30,20,35,.58) 60%)}
.fwallin.night .fdusk{opacity:1}
.fwallin.night .flamp{width:46%}
.fwallin.night .ffr{box-shadow:0 0 0 2px rgba(255,226,170,.6),0 0 22px 4px rgba(255,214,150,.55)}
.fwallin .ffr{transition:box-shadow 1.2s ease}
/* «в гости»: the photo walks out of its frame sideways and comes into another one */
.ffr.walk img{animation:none!important;transition:transform .9s ease-in-out}
body.calm .ffr.walk img{transition-duration:1.4s}
body.calm .fwallin .flamp{animation-duration:5s}
@media (prefers-reduced-motion:reduce){.fwallin .flamp{animation:none}}

/* the first screen: the meadow is shifted a little above its middle, so the top with the bird is seen and the scene does not sink */
.hub>.sbworld{background-position:center 30%!important}
/* the first screen cards: the pictures carry their own round badge, so no coloured circle is drawn under them (it never lined up) */
.hcard .hart{background:none!important;box-shadow:none!important}

/* the first screen: a card that is coming soon («Алфавит») — a «скоро» ribbon in the corner, the picture a little pale */
.hcard.hcsoon{position:relative}
.hcard.hcsoon .hart{display:flex;align-items:center;justify-content:center;font-size:clamp(44px,6vw,72px);line-height:1}
.hcard.hcsoon .hart>*{opacity:.75}
.hsoonl{position:absolute;top:10px;right:10px;padding:3px 12px;border-radius:999px;background:#F3C96B;color:#5B3E26;font:900 clamp(12px,1.4vw,15px)/1.3 Nunito,sans-serif;
  transform:rotate(6deg);box-shadow:0 3px 8px rgba(74,58,44,.2)}

/* «Перед сном» (js/games/blow.js): the choice of four quiet tasks over the evening picture */
.slscreen{position:fixed;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:clamp(16px,3vh,32px);overflow:hidden;
  padding:calc(max(14px,env(safe-area-inset-top)) + 70px) 18px calc(env(safe-area-inset-bottom) + 20px)}
.slscreen>.sbworld{position:absolute;inset:0;background-size:cover;background-position:center}
.slwash{position:absolute;inset:0;background:linear-gradient(180deg,rgba(120,96,170,.10),rgba(150,110,170,.04) 60%,rgba(90,70,130,.12));pointer-events:none}
.slscreen>.altitle{position:relative;z-index:2}
.slcards{position:relative;z-index:2;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:clamp(12px,2vw,24px);width:min(1100px,100%)}
.slcards.n3{grid-template-columns:repeat(3,minmax(0,1fr));width:min(860px,100%)}
.slcards.n1{grid-template-columns:minmax(0,320px);justify-content:center}
.slcards.n2{grid-template-columns:repeat(2,minmax(0,300px));justify-content:center}
@media (max-width:820px){.slcards,.slcards.n3{grid-template-columns:repeat(2,minmax(0,1fr))}}
.slcard{display:flex;flex-direction:column;align-items:center;gap:6px;padding:clamp(14px,2vw,22px) 12px;border:0;border-radius:26px;cursor:pointer;
  background:#FFFBF2;color:#4A3324;text-align:center;box-shadow:0 8px 20px rgba(40,30,60,.22);transition:transform .2s ease}
.slcard:active{transform:scale(.97)}
.slpic{display:flex;align-items:center;justify-content:center;width:72%;aspect-ratio:1/1;font-size:clamp(48px,7vw,84px);line-height:1}
.slpic img,.slpic .emo{width:100%;height:100%;object-fit:contain}
/* a tale's card: its first page as a little book cover */
.slcard[data-story] .slpic{width:100%;aspect-ratio:16/10}
.slcard[data-story] .slpic img{object-fit:cover;border-radius:16px;box-shadow:0 3px 8px rgba(74,58,44,.18)}
.slcard b{font:900 clamp(17px,2.1vw,24px)/1.15 Rubik,Nunito,sans-serif}
.slcard span:last-child{font:700 clamp(13px,1.5vw,16px)/1.3 Nunito,sans-serif;color:#7A604A}
/* «Перед сном» cards: lilac paper with a darker lilac layer underneath (like the title plaque),
   a soft warm glow around the frame with no hard edge, like the light of a night lamp; a tap makes the glow brighter.
   The paper is a touch deeper than the plaque, so the cream pictures (the cloud, the music box) stand out on it */
.slcard{--sl:#E6DBF4;--sle:#C4AEE0;background:var(--sl);color:#4F3A6B;
  box-shadow:inset 0 2px 0 rgba(255,255,255,.6),0 6px 0 var(--sle),0 0 30px 8px rgba(255,214,120,.45),0 16px 28px rgba(40,26,70,.25)}
.slcard span:last-child{color:#6E5A88}
.slcard:active{box-shadow:inset 0 2px 0 rgba(255,255,255,.6),0 3px 0 var(--sle),0 0 38px 14px rgba(255,214,120,.7),0 10px 20px rgba(40,26,70,.25)}
/* each card its own night tone, one after another: lilac, blue-lilac, pink-lilac (the paper and the layer under it) */
.slcard:nth-child(3n+2){--sl:#DDE0F6;--sle:#B3BAE3}
.slcard:nth-child(3n+3){--sl:#F0DDEC;--sle:#D8B4CF}
/* «Подыши с шариком»: the paper balloon */
.balloon .brimg{display:block;height:min(52vh,420px);width:auto}
/* the blowing cloud instead of the microphone: it puffs up a little when the child blows (--lv from the microphone) */
.vu .vublow{width:86%;height:86%;object-fit:contain;transform:scale(calc(1 + var(--lv,0) * .18));transition:transform .12s ease}
/* a blowing task («Перед сном»): the scene fills the whole screen, the word, the hint and the blowing cloud lie over it.
   The old framed-scene sizes of .bcard / .bfull in css/style.css must not win here, hence !important */
.blscreen{position:fixed;inset:0;overflow:hidden;background:#3F3A63}
.blscreen .bcard.blfull{position:absolute!important;inset:0!important;width:100%!important;height:100%!important;max-width:none!important;max-height:none!important;
  margin:0!important;transform:none!important;border-radius:0!important;box-shadow:none!important;border:0!important;aspect-ratio:auto!important;background:none!important;padding:0!important}
.blscreen .blfull>svg.bfull{position:absolute!important;inset:0!important;width:100%!important;height:100%!important;max-width:none!important;max-height:none!important;transform:none!important;margin:0!important}
.blscreen>#back{position:absolute;z-index:6}
.blq{position:absolute;left:50%;top:calc(max(14px,env(safe-area-inset-top)) + 8px);transform:translateX(-50%);z-index:5;pointer-events:none;
  padding:.25em 1em;border-radius:999px;background:rgba(255,251,242,.9);color:#4A3324;font:900 clamp(26px,4.4vw,48px)/1.1 Rubik,Nunito,sans-serif;
  box-shadow:0 6px 16px rgba(40,30,60,.22);white-space:nowrap}
.blbottom{position:absolute;left:0;right:0;bottom:calc(env(safe-area-inset-bottom) + 14px);z-index:5;display:flex;flex-direction:column;align-items:center;gap:10px;pointer-events:none}
.blhint{margin:0;max-width:min(92vw,640px);padding:6px 14px;border-radius:14px;background:rgba(255,251,242,.85);color:#5E4636;
  font:700 clamp(13px,1.6vw,16px)/1.35 Nunito,sans-serif;text-align:center}
.blbottom .vu{pointer-events:auto}
@media (max-width:600px){.blq{top:calc(max(14px,env(safe-area-inset-top)) + 78px)}}
/* «Поверни телефон» (js/core/rotate.js): over a wide picture screen on a phone held upright */
.rotover{position:fixed;inset:0;z-index:90;display:none;flex-direction:column;align-items:center;justify-content:center;gap:22px;
  background:#F6EEDF;color:#4A3324;text-align:center;padding:24px}
.rotover.on{display:flex}
.rotover b{font:900 clamp(24px,7vw,34px)/1.2 Rubik,Nunito,sans-serif;max-width:12em}
.rotpic{display:flex;align-items:center;justify-content:center;width:min(46vw,200px);aspect-ratio:1/1;font-size:min(30vw,130px);line-height:1}
.rotpic>*{width:100%;height:100%;object-fit:contain;display:flex;align-items:center;justify-content:center;animation:rotturn 2.6s ease-in-out infinite}
@keyframes rotturn{0%,20%{transform:rotate(0)}50%,80%{transform:rotate(-90deg)}100%{transform:rotate(0)}}
/* the paper picture already shows the turning arrow: it only rocks gently */
.rotpic>img{animation:rotrock 2.4s ease-in-out infinite}
@keyframes rotrock{0%,100%{transform:rotate(-8deg)}50%{transform:rotate(8deg)}}
.rotback{position:absolute;left:14px;top:max(14px,env(safe-area-inset-top))}

/* «Зайчик на ветру» (js/games/blow.js: bunnyHTML): a big paper bunny face; the child blows straight at it, streaks of wind fly from the middle out */
.bnsky{position:absolute;inset:0;background:radial-gradient(ellipse at 50% 58%,#FFF8EE 0%,#F6EEDF 48%,#E4ECF3 100%)}
.bnwind{position:absolute;inset:0;opacity:0;pointer-events:none;overflow:hidden}
.bnwind i{position:absolute;left:50%;top:55%;width:18vmax;height:5px;margin-top:-2.5px;border-radius:5px;transform-origin:0 50%;
  background:linear-gradient(90deg,rgba(170,200,225,0),rgba(170,200,225,.85));animation:bnwind 1.1s linear infinite}
.bnwind i:nth-child(even){height:3px;width:12vmax;animation-duration:.85s}
@keyframes bnwind{from{transform:rotate(var(--a)) translateX(4vmax);opacity:0}25%{opacity:1}to{transform:rotate(var(--a)) translateX(60vmax);opacity:0}}
.bnface{position:absolute;left:50%;top:57%;width:min(50vh,52vw);aspect-ratio:1/1;transform:translate(-50%,-50%)}
.bnheadbox{position:absolute;inset:0;z-index:2;transform-origin:50% 60%;will-change:transform}
.bnheadbox .bnhead{position:relative;z-index:1;width:100%;height:100%;object-fit:contain;display:block}
/* the in-between faces and the full-wind face lie over the calm one and fade in as the wind grows */
.bnheadbox .bnhead.bnfr{position:absolute;inset:0;z-index:2;opacity:0;transition:opacity .35s ease}
.bnheadbox .bnemo{display:flex;align-items:center;justify-content:center;font-size:min(48vh,44vw);line-height:1}
/* the ears sit behind the head, their bases hidden under its top. Each is three linked pieces of the same picture
   (base → middle → tip, each standing on the one below) that tilt back in 3D, so a wave runs along the ear */
.bnear{position:absolute;z-index:0;top:-38%;width:22%;height:58%;transform-origin:50% 92%;will-change:transform;perspective:420px;transform-style:preserve-3d}
.bnear.l{left:22%}.bnear.r{left:56%}
.bnseg{position:absolute;left:0;bottom:0;width:100%;height:33.4%;background-repeat:no-repeat;background-size:100% 300%;transform-origin:50% 100%;transform-style:preserve-3d;will-change:transform}
.bnseg.s1{background-position:50% 100%}
.bnseg.s2,.bnseg.s3{bottom:99%;height:100%}
.bnseg.s2{background-position:50% 50%}
.bnseg.s3{background-position:50% 0%}
.bnface.bnlaugh{animation:bnlaugh .5s ease-in-out 4}
@keyframes bnlaugh{0%,100%{transform:translate(-50%,-50%) rotate(0)}25%{transform:translate(-50%,-52%) rotate(-4deg)}75%{transform:translate(-50%,-52%) rotate(4deg)}}
@media (prefers-reduced-motion:reduce){.bnwind i{animation:none}.bnface.bnlaugh{animation:none}}

/* the candle blown out: the room goes dark, slowly (the card .bcard is already positioned by css/style.css) */
.bcard::after{content:'';position:absolute;inset:0;border-radius:inherit;background:rgba(24,18,38,.62);opacity:0;transition:opacity 2.5s ease;pointer-events:none}
.bcard.bnight::after{opacity:1}
/* «Одуванчик»: the seeds that became stars twinkle softly */
.dstar{animation:dstar 3s ease-in-out infinite alternate}
@keyframes dstar{from{opacity:.55}to{opacity:1}}

/* «Колыбельные» (js/games/bedtime.js): the dim bedroom, the turning paper mobile, the tunes */
.lullscreen{position:fixed;inset:0;overflow:hidden;background:#3F3A63;display:flex;flex-direction:column;align-items:center}
.lullbg{position:absolute;inset:0;background:#6E5E86 center/cover no-repeat}
.lulldim{position:absolute;inset:0;background:#1E1830;opacity:.15;transition:opacity 1s linear;pointer-events:none}
.lullscreen>#back{position:absolute;z-index:6}
.lulltitle{position:relative;z-index:3;margin-top:calc(max(14px,env(safe-area-inset-top)) + 8px)}
.mobile{position:relative;z-index:3;width:min(70vw,520px);height:auto;margin-top:clamp(4px,2vh,24px);overflow:visible}
.mobbar{transform-origin:100px 0;animation:mobturn 9s ease-in-out infinite alternate}
@keyframes mobturn{from{transform:rotate(-5deg)}to{transform:rotate(5deg)}}
.mobit{animation:mobit 4.5s ease-in-out infinite alternate}
@keyframes mobit{from{transform:rotate(-7deg)}to{transform:rotate(7deg)}}
body.calm .mobbar,body.calm .mobit{animation-duration:14s}
/* the music box under the mobile: arrows on both sides, the name, a dot for every tune, «Все подряд» with its minutes */
.lullscreen .mobile{width:min(70vw,520px,56vh)}
.lullplayer{position:absolute;left:50%;bottom:calc(env(safe-area-inset-bottom) + 18px);transform:translateX(-50%);z-index:4;width:min(94vw,560px);
  display:flex;flex-direction:column;align-items:center;gap:8px}
.lullbar{display:flex;align-items:center;justify-content:center;gap:clamp(18px,4vw,44px)}
.lullarr{width:clamp(58px,7vw,78px);height:clamp(58px,7vw,78px);font:900 clamp(30px,4vw,44px)/1 Nunito,sans-serif}
/* the box itself: the paper music box stands on its own (no tile), with a thin paper outline and a soft lilac glow behind it; it rocks gently while a tune plays */
.lullbox{position:relative;width:min(clamp(150px,20vw,230px),26vh);aspect-ratio:1/1;border:0;border-radius:50%;padding:0;cursor:pointer;
  background:radial-gradient(closest-side,rgba(233,222,248,.85),rgba(233,222,248,.35) 62%,rgba(233,222,248,0))}
.lullbox:active{transform:translateY(3px)}
.lullboxpic{display:flex;width:100%;height:100%;align-items:center;justify-content:center;font-size:clamp(60px,9vw,96px);line-height:1}
.lullboxpic img{width:88%;height:88%;object-fit:contain;transform-origin:50% 90%;
  filter:drop-shadow(3px 0 0 #FFF8EA) drop-shadow(-3px 0 0 #FFF8EA) drop-shadow(0 3px 0 #FFF8EA) drop-shadow(0 -3px 0 #FFF8EA) drop-shadow(0 10px 12px rgba(20,14,40,.35))}
.lullscreen.playing .lullboxpic img{animation:lullrock 1.8s ease-in-out infinite alternate}
@keyframes lullrock{from{transform:rotate(-2.5deg)}to{transform:rotate(2.5deg) translateY(-2%)}}
.lullplaybtn{position:absolute;right:2%;bottom:4%;width:clamp(46px,5.2vw,56px);height:clamp(46px,5.2vw,56px);border-radius:50%;background:#F3C96B;color:#4A3324;
  display:flex;align-items:center;justify-content:center;font:900 18px Nunito,sans-serif;box-shadow:0 0 0 4px #FFFBF2,0 4px 10px rgba(20,14,40,.25)}
.lullname{max-width:100%;padding:6px 22px;border-radius:999px;background:rgba(255,251,242,.94);color:#4A3324;text-align:center;
  font:900 clamp(18px,2.4vw,24px)/1.2 Nunito,sans-serif;box-shadow:0 4px 12px rgba(20,14,40,.25)}
.lulldots{display:flex;gap:6px}
.lulldots i{width:8px;height:8px;border-radius:4px;background:rgba(255,251,242,.5);transition:width .25s}
.lulldots i.on{width:22px;background:#FFFBF2}
.lullsong{display:flex;align-items:center;gap:10px;min-height:52px;padding:6px 18px 6px 8px;border:0;border-radius:999px;cursor:pointer;
  background:rgba(255,251,242,.92);color:#4A3324;box-shadow:0 6px 16px rgba(20,14,40,.3)}
.lullsong b{font:800 clamp(15px,1.8vw,18px) Nunito,sans-serif}
.lullico{display:flex;align-items:center;justify-content:center;width:38px;height:38px;border-radius:50%;background:#E8E0F3;color:#4A3324;font:900 16px Nunito,sans-serif}
.lullsong.on{background:#FBEFD0}
.lullsong.on .lullico{background:#F3C96B}
.lullallrow{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:10px;margin-top:2px}
.lullsong.lullall{background:#FFF3D4}
.lullmins{display:flex;gap:6px;padding:5px;border-radius:999px;background:rgba(255,251,242,.85);box-shadow:0 4px 12px rgba(20,14,40,.25)}
.lullmin{min-height:40px;padding:0 14px;border:0;border-radius:999px;background:transparent;color:#4A3324;font:800 15px Nunito,sans-serif;cursor:pointer}
.lullmin.on{background:#4A3324;color:#FFFBF2}
body.calm .lullscreen.playing .lullboxpic img{animation-duration:3s}
@media (prefers-reduced-motion:reduce){.lullscreen.playing .lullboxpic img{animation:none}}

/* ---------- «Весёлый счёт»: Считаем утят (js/games/ducks.js) ---------- */
.duscreen{position:fixed;inset:0;overflow:hidden;background:#9CC9F0}
.dusky{position:absolute;inset:0;background:linear-gradient(180deg,#9CC9F0 0%,#B9DBF4 45%,#C9E3A8 46%,#B9D78F 100%)}
.dustage{position:absolute;inset:0;display:flex;align-items:flex-end;justify-content:center;overflow:hidden}
/* the pond picture at its own proportions, anchored to the bottom (on a very wide screen some sky is cut, never the bank);
   everything in it is placed in % of the picture */
.duboard{position:relative;flex:none;background-size:100% 100%;background-repeat:no-repeat;overflow:visible;touch-action:none}
/* the title on top; under it the stars, and under the stars the level dots (js/core/levels-ui.js puts them under #stars by itself) */
.dutitle{position:absolute;left:50%;top:calc(env(safe-area-inset-top) + 1.5vh);transform:translateX(-50%);height:12vh;max-width:56vw;width:auto;object-fit:contain;z-index:5;pointer-events:none;filter:drop-shadow(0 4px 8px rgba(40,30,60,.2))}
.duscreen .g2stars,.shscreen .g2stars{left:50%;right:auto;top:calc(env(safe-area-inset-top) + 14vh);transform:translateX(-50%) scale(.85);transform-origin:50% 0;z-index:8}
/* the stars: under the title (see .dutitle above) */
.dufx{position:absolute;inset:0;z-index:2;pointer-events:none}
/* a duckling: left/top is the point under its feet; the hit area is a little bigger than the picture */
.duduck{position:absolute;transform:translate(-50%,-100%);aspect-ratio:1/1;border:0;padding:0;background:transparent;cursor:pointer;z-index:3;
  -webkit-tap-highlight-color:transparent;transition:left .5s ease,top .5s ease;transform-origin:50% 100%}
.duduck::before{content:'';position:absolute;inset:-14%;border-radius:50%}
.duduck img{width:100%;height:100%;object-fit:contain;display:block;transform-origin:50% 100%;pointer-events:none;
  filter:drop-shadow(0 6px 6px rgba(40,30,60,.22))}
.duduck.mirror img{transform:scaleX(-1)}
/* waiting on the bank: a gentle sway, each at its own pace */
.duduck.idle img{animation:dusway var(--s,3.6s) ease-in-out var(--d,0s) infinite alternate}
@keyframes dusway{from{transform:rotate(-2.5deg) translateY(0)}to{transform:rotate(2.5deg) translateY(-1.5%)}}
.duduck.mirror.idle img{animation-name:duswaym}
@keyframes duswaym{from{transform:scaleX(-1) rotate(2.5deg)}to{transform:scaleX(-1) rotate(-2.5deg) translateY(-1.5%)}}
/* a hint: the duckling wiggles; a spoken hint: it glows */
.duduck.hint img{animation:duwig .9s ease-in-out 2}
@keyframes duwig{0%,100%{transform:rotate(0)}25%{transform:rotate(-8deg) translateY(-4%)}75%{transform:rotate(8deg) translateY(-4%)}}
.duduck.glow img{filter:drop-shadow(0 0 10px #FFE98A) drop-shadow(0 0 22px rgba(255,214,110,.9)) drop-shadow(0 6px 6px rgba(40,30,60,.22))}
/* the jump: a crouch, an arc to the water (--dx, --dy are set by the game), a little squash on landing */
.duduck.jump{transition:none;z-index:4;animation:dujump .64s cubic-bezier(.3,.6,.4,1) forwards}
@keyframes dujump{0%{transform:translate(-50%,-100%) scale(1.05,.9)}18%{transform:translate(-50%,-100%) scale(.95,1.1)}
  55%{transform:translate(calc(-50% + var(--dx)*.55),calc(-100% + var(--dy)*.55 - 22vh)) rotate(8deg)}
  100%{transform:translate(calc(-50% + var(--dx)),calc(-100% + var(--dy))) scale(1.08,.92)}}
/* in the water: the same duckling, its lower third under a wave drawn here; it bobs, and rings go out from it now and then */
.duduck.swim{z-index:3}
.duduck.swim img{clip-path:inset(0 0 34% 0);animation:duswim var(--s,3.6s) ease-in-out var(--d,0s) infinite alternate}
@keyframes duswim{from{transform:translate(-2%,0) rotate(-3deg)}to{transform:translate(2%,-3%) rotate(3deg)}}
.duduck .duwave,.duduck .during{display:none;pointer-events:none}
.duduck.swim .duwave{display:block;position:absolute;left:-3%;right:-3%;bottom:31%;height:6%;border-radius:50%;z-index:2;
  background:rgba(150,200,238,.92);box-shadow:0 -1px 0 rgba(255,255,255,.55) inset,0 2px 3px rgba(80,140,200,.25)}
.duduck.swim .duwave::after{content:'';position:absolute;left:14%;right:14%;top:-18%;height:60%;border-radius:50%;background:rgba(255,255,255,.35)}
.duduck.swim .during{display:block;position:absolute;left:-16%;right:-16%;bottom:28%;height:14%;border-radius:50%;z-index:1;
  border:1.5px solid rgba(255,255,255,.55);opacity:0;animation:during 5s ease-out var(--d,0s) infinite}
@keyframes during{0%{transform:scale(.7);opacity:0}10%{opacity:.6}100%{transform:scale(1.7);opacity:0}}
/* dragged: lifted, bigger shadow; let go outside the water: it walks back */
.duduck.drag{transition:none;z-index:6}
.duduck.drag img{animation:none;transform:scale(1.08) translateY(-3%);filter:drop-shadow(0 16px 14px rgba(40,30,60,.3))}
.duduck.goback{transition:transform .45s cubic-bezier(.3,1.4,.5,1)}
/* the round is done: a happy hop; then they swim off to the reeds */
.duduck.hop img{animation:duhop .5s ease-out 2}
@keyframes duhop{0%,100%{transform:translateY(0)}50%{transform:translateY(-14%) rotate(-4deg)}}
.duduck.away{transition:left 1.6s ease-in,top 1.6s ease-in,opacity 1.2s ease-in .5s;left:112% !important;opacity:0}
/* ripples: rings that grow and fade from a point */
.duripple{position:absolute;width:6%;aspect-ratio:2.4/1;transform:translate(-50%,-50%);border-radius:50%;border:2px solid rgba(255,255,255,.75);
  box-shadow:0 0 0 1px rgba(90,150,210,.25) inset;opacity:0;animation:duripple 1.9s ease-out var(--d,0s) forwards}
.duripple.big{width:9%;border-width:3px}
@keyframes duripple{0%{transform:translate(-50%,-50%) scale(.3);opacity:.9}100%{transform:translate(-50%,-50%) scale(2.6);opacity:0}}
.dusplash{position:absolute;width:16%;transform:translate(-50%,-80%);animation:dusplash .85s ease-out forwards;pointer-events:none}
@keyframes dusplash{0%{transform:translate(-50%,-70%) scale(.3);opacity:0}30%{opacity:1}100%{transform:translate(-50%,-100%) scale(1.1);opacity:0}}
/* the big paper number over the water */
.dunum{position:absolute;height:24%;width:auto;transform:translate(-50%,-50%);z-index:5;pointer-events:none;filter:drop-shadow(0 8px 10px rgba(40,30,60,.25))}
.dunum.pop{animation:dunum .6s cubic-bezier(.3,1.5,.5,1)}
@keyframes dunum{0%{transform:translate(-50%,-50%) scale(.6);opacity:0}60%{transform:translate(-50%,-50%) scale(1.08);opacity:1}100%{transform:translate(-50%,-50%) scale(1)}}
.dunum.away{transition:opacity .6s;opacity:0}
/* the paper hand: taps twice, or slides along the way to the water */
.duhand{position:absolute;height:14%;width:auto;z-index:7;pointer-events:none;opacity:0;transform-origin:30% 20%}
.duhand.tap{animation:duhtap 2.8s ease-in-out forwards}
@keyframes duhtap{0%{opacity:0;transform:scale(1)}15%{opacity:.85}30%{transform:scale(.85) translateY(6%)}45%{transform:scale(1)}60%{transform:scale(.85) translateY(6%)}75%{transform:scale(1)}100%{opacity:0}}
.duhand.drag{animation:duhdrag 3.6s ease-in-out forwards}
@keyframes duhdrag{0%{opacity:0;transform:translate(0,0)}15%{opacity:.85;transform:scale(.9) translate(0,0)}70%{opacity:.85;transform:scale(.9) translate(var(--dx),var(--dy))}100%{opacity:0;transform:scale(.9) translate(var(--dx),var(--dy))}}
body.calm .duduck.idle img,body.calm .duduck.swim img{animation-duration:6s}
@media (prefers-reduced-motion:reduce){.duduck.idle img,.duduck.swim img,.duduck.swim .during{animation:none}}

/* ---------- «Овечки домой» (js/games/sheep.js) ---------- */
.shscreen{position:fixed;inset:0;overflow:hidden;background:#BFE0F5}
.shsky{position:absolute;inset:0;background:linear-gradient(180deg,#BFE0F5 0%,#D6ECF8 40%,#CFE5A6 41%,#B6D58A 100%)}
.shboard{position:relative;flex:none;background-size:100% 100%;background-repeat:no-repeat;touch-action:none}
/* while the farm picture is missing: a paper meadow with hills */
.shboard.plain{background:radial-gradient(120% 60% at 30% 108%,#A9CF7E 0 60%,transparent 61%),radial-gradient(90% 40% at 80% 46%,#BFDDA0 0 60%,transparent 61%),
  linear-gradient(180deg,#CDE7F7 0%,#DCEFF9 38%,#C6E29C 39%,#B4D487 100%)}
.shsheep{position:absolute;transform:translate(-50%,-100%);aspect-ratio:1/1;border:0;padding:0;background:transparent;cursor:pointer;z-index:4;
  -webkit-tap-highlight-color:transparent;transform-origin:50% 100%;display:flex;align-items:flex-end;justify-content:center}
.shsheep::before{content:'';position:absolute;inset:-12%;border-radius:50%}
.shsheep img,.shsheep .em{width:100%;height:100%;object-fit:contain;display:block;transform-origin:50% 100%;pointer-events:none;
  filter:drop-shadow(0 6px 6px rgba(40,30,60,.2))}
.shsheep .em{font-size:calc(var(--h,1)*1em);line-height:1}
/* the emoji sheep while sheep.webp is missing: as tall as its button */
.shsheep{container-type:size}
.shemo{display:block;font-size:82cqh;line-height:1;transform-origin:50% 100%;pointer-events:none}
.shsheep.mirror .shemo{transform:scaleX(-1)}
.shsheep.graze .shemo{animation:shgraze var(--s,4s) ease-in-out var(--d,0s) infinite}
.shsheep.walk .shemo{animation:shtrot .32s ease-in-out infinite alternate}
.shsheep.hop .shemo{animation:duhop .5s ease-out 2}
.shsheep.hint .shemo{animation:duwig .9s ease-in-out 2}
.shsheep.mirror img,.shsheep.mirror .em{transform:scaleX(-1)}
/* grazing: the head goes down to the grass and up again, each sheep at its own pace */
.shsheep.graze img,.shsheep.graze .em{animation:shgraze var(--s,4s) ease-in-out var(--d,0s) infinite}
@keyframes shgraze{0%,60%,100%{transform:rotate(0)}70%,85%{transform:rotate(4deg) translateY(2%)}}
.shsheep.mirror.graze img,.shsheep.mirror.graze .em{animation-name:shgrazem}
@keyframes shgrazem{0%,60%,100%{transform:scaleX(-1) rotate(0)}70%,85%{transform:scaleX(-1) rotate(4deg) translateY(2%)}}
/* walking to the gate: a little trot */
.shsheep.walk img,.shsheep.walk .em{animation:shtrot .32s ease-in-out infinite alternate}
@keyframes shtrot{from{transform:translateY(0) rotate(-2deg)}to{transform:translateY(-5%) rotate(2deg)}}
/* inside the pen: behind the front of the fence; a happy hop when the gate closes */
.shsheep.inside{z-index:2}
.shsheep.hint img,.shsheep.hint .em{animation:duwig .9s ease-in-out 2}
.shsheep.glow img,.shsheep.glow .em{filter:drop-shadow(0 0 10px #FFE98A) drop-shadow(0 0 22px rgba(255,214,110,.9))}
.shsheep.hop img,.shsheep.hop .em{animation:duhop .5s ease-out 2}
.shsheep.drag{transition:none!important;z-index:6}
.shsheep.drag img,.shsheep.drag .em{animation:none;filter:drop-shadow(0 16px 14px rgba(40,30,60,.3))}
.shsheep.goback{transition:transform .45s cubic-bezier(.3,1.4,.5,1)}
.shsheep.away{transition:opacity 1s ease-in .3s!important;opacity:0}
/* the pen: the front of the fence over the sheep inside; the gate leaf turns on its left edge */
.shfence{position:absolute;z-index:3;pointer-events:none}
.shfence img,.shfence svg{width:100%;height:100%;object-fit:fill;display:block}
/* the pen: one picture cut in two — the back and side fences behind the sheep, the front fence over the sheep inside */
.shpen{position:absolute;pointer-events:none;object-fit:fill;display:block}
.shpen.behind{z-index:1}
.shpen.front{z-index:3}
/* levels 3–4: the button that closes the gate — a round paper button with the gate on it, above the gate post;
   it wakes up (a soft yellow ring) once the first sheep is in */
.shclose{position:absolute;z-index:6;margin:-4% 0 0 -4%;width:8%;aspect-ratio:1/1;border:0;border-radius:50%;padding:1.4%;cursor:pointer;
  background:#FFFBF2;box-shadow:0 5px 0 #E7D7BC,0 10px 20px rgba(40,30,60,.22);opacity:.55;transition:opacity .3s,box-shadow .3s}
.shclose img{width:100%;height:100%;object-fit:contain;pointer-events:none}
.shclose.ready{opacity:1;box-shadow:0 0 0 4px #F3C96B,0 5px 0 #E7D7BC,0 10px 20px rgba(40,30,60,.22)}
.shclose.hop{animation:duhop .5s ease-out 1}
.shclose.glow{box-shadow:0 0 0 5px #F3C96B,0 0 24px 8px rgba(255,214,110,.8),0 5px 0 #E7D7BC}
/* the gate: the drawn farm gate, hinges on the left post. Open, it is swung all the way out and lies flat in the picture's plane on the
   other side of the hinge post (mirrored), along the line of the front fence, on the meadow; the gap is free for the sheep.
   Shutting, it swings over on its hinges (through edge-on) into the gap. On levels 1–2 it shuts by itself when the round is done;
   on levels 3–4 the child shuts it with a tap on the gate or the gap (.shgatehit). A hint lights it up in yellow */
.shgate{position:absolute;z-index:4;pointer-events:none;transform-origin:0 50%;transform:scaleX(-1);
  transition:transform .6s cubic-bezier(.4,0,.3,1);filter:drop-shadow(0 4px 4px rgba(40,30,60,.18))}
.shgate.closed{transform:scaleX(1)}
.shgate.glow{filter:drop-shadow(0 0 8px #FFE98A) drop-shadow(0 0 18px rgba(255,214,110,.9))}
.shgatehit{position:absolute;z-index:5;border:0;padding:0;margin:0;background:transparent;cursor:pointer;-webkit-tap-highlight-color:transparent}
.shgatehit::before{content:'';position:absolute;inset:-18% -10%}
.shgate img,.shgate svg{width:100%;height:100%;object-fit:fill;display:block}
/* the task in the bottom left corner, over the bushes, out of the sheep's way: the big paper number, and on levels 1–2 an empty place
   for each sheep that fills when it is in. On levels 3–4 only the number is there: how many the child has to keep in mind and count out */
.shdots{position:fixed;left:calc(env(safe-area-inset-left) + 2vw);bottom:calc(env(safe-area-inset-bottom) + 2vh);z-index:6;display:flex;align-items:center;gap:1.2vh;
  padding:.8vh 2vh .8vh 1.4vh;border-radius:999px;background:rgba(255,251,242,.94);box-shadow:0 4px 12px rgba(40,30,60,.18)}
.shdots.only{padding:.8vh 1.4vh}
.shnum{height:9vh;width:auto;margin-right:.6vh;filter:drop-shadow(0 3px 3px rgba(40,30,60,.2))}
.shdots i{position:relative;display:flex;align-items:center;justify-content:center;width:7vh;height:7vh;font-style:normal;font-size:5vh;line-height:1;
  border-radius:50%;border:.35vh dashed #CDB79A;transition:border-color .3s}
.shdots i img{width:88%;height:88%;object-fit:contain;opacity:0;transform:scale(.6);transition:opacity .3s,transform .35s cubic-bezier(.3,1.5,.5,1)}
.shdots i.on{border-color:transparent}
.shdots i.on img{opacity:1;transform:scale(1.1)}
body.calm .shsheep.graze img,body.calm .shsheep.graze .em{animation-duration:7s}
@media (prefers-reduced-motion:reduce){.shsheep img,.shsheep .em{animation:none!important}.shgate{transition:none}}

/* ---------- «Морковки для зайчика» (js/games/carrots.js) ---------- */
.cascreen{position:fixed;inset:0;overflow:hidden;background:#BFE0F5}
.cascreen .g2stars{left:50%;right:auto;top:calc(env(safe-area-inset-top) + 14vh);transform:translateX(-50%) scale(.85);transform-origin:50% 0;z-index:8}
.catitle{top:calc(env(safe-area-inset-top) + 2vh)}
.caboard{position:relative;flex:none;background-size:100% 100%;background-repeat:no-repeat;touch-action:none}
/* while the garden picture is missing: a meadow, and the bed with two rows of dark soil */
.caboard.plain{background:linear-gradient(180deg,#CDE7F7 0%,#DCEFF9 36%,#C6E29C 37%,#B4D487 100%)}
.cabed{position:absolute;left:3%;top:50%;width:54%;height:42%;border-radius:40px;background:#B98B5B;box-shadow:inset 0 6px 0 rgba(255,255,255,.15),0 6px 0 #8F6A45}
.cabed::before,.cabed::after{content:'';position:absolute;left:4%;right:4%;height:16%;border-radius:20px;background:#8F6A45}
.cabed::before{top:22%}.cabed::after{top:74%}
/* a carrot: left/top is the point at the ground; it leans a little; while waiting it sways like in the wind */
.cacarrot{position:absolute;transform:translate(-50%,-100%) rotate(var(--r,0deg));aspect-ratio:.48;border:0;padding:0;background:transparent;cursor:pointer;z-index:3;
  transform-origin:50% 100%;-webkit-tap-highlight-color:transparent;container-type:size}
.cacarrot::before{content:'';position:absolute;inset:-10% -40%}
.cacarrot img{width:100%;height:100%;object-fit:contain;pointer-events:none;filter:drop-shadow(0 4px 4px rgba(40,30,60,.2));
  transform-origin:50% 100%;animation:casway 3.4s ease-in-out var(--d,0s) infinite alternate}
.caemo{display:block;font-size:80cqh;line-height:1;text-align:center;pointer-events:none;transform-origin:50% 100%;animation:casway 3.4s ease-in-out var(--d,0s) infinite alternate}
@keyframes casway{from{transform:rotate(-3deg)}to{transform:rotate(3deg)}}
.cacarrot.hint img,.cacarrot.hint .caemo,.cacarrot.nope img,.cacarrot.nope .caemo{animation:duwig .8s ease-in-out 2}
.cacarrot.glow img,.cacarrot.glow .caemo{filter:drop-shadow(0 0 8px #FFE98A) drop-shadow(0 0 18px rgba(255,214,110,.9))}
.cacarrot.drag{z-index:7}
.cacarrot.drag img,.cacarrot.drag .caemo{animation:none;transform:scale(1.12);filter:drop-shadow(0 14px 12px rgba(40,30,60,.3))}
.cacarrot.goback{transition:transform .45s cubic-bezier(.3,1.4,.5,1)}
/* pulled out and into the basket: up, an arc, and it lands standing in the basket, leaning a little */
.cacarrot.fly{z-index:7;animation:cafly .56s cubic-bezier(.4,.1,.4,1) forwards}
@keyframes cafly{0%{transform:translate(-50%,-100%) rotate(var(--r,0deg))}25%{transform:translate(-50%,-125%) rotate(0)}
  100%{transform:translate(calc(-50% + var(--dx)),calc(-100% + var(--dy))) rotate(var(--ri,0deg)) scale(.85)}}
/* in the basket: big enough to see and count, standing among the others; no longer tappable */
.cacarrot.in{z-index:5;pointer-events:none;transform:translate(-50%,-100%) rotate(var(--ri,0deg)) scale(.85)}
.cacarrot.in img,.cacarrot.in .caemo{animation:none}
/* growing in the bed: the lower part of the carrot is in the ground — hidden, with a small mound of soil over the cut;
   pulled out (dragged or flying) it shows whole */
.cacarrot:not(.in):not(.fly):not(.drag) img{clip-path:inset(0 0 44% 0)}
.cacarrot:not(.in):not(.fly):not(.drag)::after{content:'';position:absolute;left:2%;right:2%;top:47%;height:15%;pointer-events:none;
  background:radial-gradient(closest-side circle at 22% 62%,#A86A3E 0 88%,transparent 92%),radial-gradient(closest-side circle at 52% 48%,#B07244 0 90%,transparent 94%),
    radial-gradient(closest-side circle at 80% 64%,#A2643A 0 88%,transparent 92%);background-size:46% 100%,48% 100%,44% 100%;
  background-position:0 0,52% 0,100% 0;background-repeat:no-repeat;filter:drop-shadow(0 2px 2px rgba(60,30,10,.3))}
/* the basket: the back with the inside (.cabasket) under the carrots, the front wall (.cafront) over them */
.cabasket.cafront{z-index:6;pointer-events:none}
/* after the count is reached, the carrots left in the bed are a little paler: they are not needed */
.cacarrot.done{opacity:.6}
/* the basket, and how many are in it */
.cabasket{position:absolute;z-index:4;container-type:size;display:flex;align-items:flex-end;justify-content:center}
.cabasket img{width:100%;height:100%;object-fit:contain;filter:drop-shadow(0 6px 6px rgba(40,30,60,.22))}
.cabasket .caemo{font-size:90cqh;animation:none}
.cabasket.bounce{animation:cabounce .45s ease-out}
@keyframes cabounce{0%,100%{transform:scale(1)}40%{transform:scale(1.08,.92)}70%{transform:scale(.97,1.04)}}
/* how many are in the basket: our paper number, without a plate */
.cacount{position:absolute;right:-10%;top:-6%;width:34%;aspect-ratio:1/1;font:0/0 a}
.cacount img{width:100%;height:100%;object-fit:contain;filter:drop-shadow(0 3px 4px rgba(40,30,60,.25))}
.cacount:empty{display:none}
.cacount.pop{animation:capop .45s cubic-bezier(.3,1.5,.5,1)}
@keyframes capop{0%{transform:scale(.5)}100%{transform:scale(1)}}
/* the bunny: one picture; it breathes while it waits and jumps for joy at the end */
.cabunny{position:absolute;z-index:3;transform:translate(-50%,-100%);aspect-ratio:.56;container-type:size;pointer-events:none;transform-origin:50% 100%}
.cabunny img{width:100%;height:100%;object-fit:contain;transform-origin:50% 100%;animation:cabreath 3.2s ease-in-out infinite;filter:drop-shadow(0 8px 8px rgba(40,30,60,.2))}
.cabunny .caemo{font-size:70cqh;animation:cabreath 3.2s ease-in-out infinite}
@keyframes cabreath{0%,100%{transform:scale(1)}50%{transform:scale(1.02,.98)}}
.cabunny.happy img,.cabunny.happy .caemo{animation:cajoy .5s ease-out 3}
@keyframes cajoy{0%,100%{transform:translateY(0)}45%{transform:translateY(-14%) rotate(-4deg)}70%{transform:translateY(-6%) rotate(3deg)}}
/* the number cards: come up over the garden, the right one grows, a wrong one sways */
.cacards{position:absolute;z-index:7;transform:translate(-50%,-50%);display:flex;gap:2.4vh}
.cacards[hidden]{display:none}
.cacards.show{animation:dunum .5s cubic-bezier(.3,1.4,.5,1)}
.cacard{width:15vh;height:15vh;border:0;border-radius:22px;background:#FFFBF2;padding:1.6vh;cursor:pointer;display:flex;align-items:center;justify-content:center;
  box-shadow:0 6px 0 #E7D7BC,0 12px 22px rgba(40,30,60,.22);transition:transform .25s}
.cacard img{width:100%;height:100%;object-fit:contain;pointer-events:none}
.cacard b{font:900 9vh/1 Rubik,Nunito,sans-serif;color:#4A3324}
.cacard:active{transform:translateY(3px)}
.cacard.nope,.cacard.hint{animation:duwig .7s ease-in-out 2}
.cacard.right{transform:scale(1.18);box-shadow:0 0 0 5px #F3C96B,0 0 26px 8px rgba(255,214,110,.7),0 6px 0 #E7D7BC}
body.calm .cacarrot img,body.calm .cacarrot .caemo{animation-duration:6s}
@media (prefers-reduced-motion:reduce){.cacarrot img,.cacarrot .caemo,.cabunny img,.cabunny .caemo{animation:none!important}}

/* ---------- the drawn «Молодец! Задание выполнено!» screen after five stars (party() in js/games/colour-mat.js):
   the picture fills the screen (the words stay in its middle on any screen shape), it comes in with a soft pop, the confetti falls over it */
.party.partyart{padding:0;background:#FBEBC9}
.pdone{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;object-position:50% 30%;animation:pdonein .55s cubic-bezier(.3,1.3,.5,1) both}
@keyframes pdonein{from{transform:scale(1.08);opacity:0}to{transform:scale(1);opacity:1}}
.party.partyart .conf{z-index:2}
@media (prefers-reduced-motion:reduce){.pdone{animation:none}}

/* ---------- «Цветной коврик» (js/games/colour-mat.js) in the paper style ---------- */
/* the menu: level cards like the first screen's; the chosen level has a yellow ring; the two settings in a cream panel under them */
.jmenu .hcard.on{box-shadow:0 0 0 5px #F3C96B,0 12px 26px rgba(40,30,60,.2)}
.jmenu .jart{display:flex;align-items:center;justify-content:center;gap:.08em;font-size:clamp(34px,5vw,64px);line-height:1}
.jmenu .jart img{width:auto;height:1em}
.jmenu .jart>img:only-child:not(.em){width:86%;height:86%;object-fit:contain}
/* the paper squares, feet and hand on the level cards (jumpLvArt in js/games/colour-mat.js) */
.jmenu .jart>img.jmini{width:auto!important;height:1.25em!important;object-fit:contain;filter:drop-shadow(0 3px 4px rgba(74,58,44,.2))}
.jmenu .jart>img.jmini:only-child{height:1.6em!important}
/* the settings stand in the page's flow under the level cards (not pinned to the bottom), so they never cover the cards;
   on a low screen the page scrolls a little instead */
.jopts{position:relative;z-index:5;display:flex;flex-wrap:wrap;justify-content:center;gap:10px 24px;width:fit-content;
  margin:clamp(14px,2.6vh,28px) auto calc(env(safe-area-inset-bottom) + 18px);
  padding:10px 20px;border-radius:22px;background:rgba(255,251,242,.94);box-shadow:0 6px 16px rgba(40,30,60,.18);max-width:94vw}
.jopts .seg{margin:0}
.jopts .jtip{flex:1 1 100%;margin:0;font:600 clamp(12px,1.3vw,15px)/1.35 Nunito,sans-serif;color:#7A604A;text-align:center}
/* the level cards a little lower, so the settings panel under them never covers them */
.jmenu .hart{width:52%!important}
.jmenu .hcard{padding-bottom:12px}
/* round buttons stay round (the sound and «Дальше») */
.jsound,.jnext{width:clamp(58px,7vw,76px)!important;height:clamp(58px,7vw,76px)!important;flex:none;padding:0}
.jsound svg,.jnext svg{width:55%;height:55%}
/* the task's pictures on the label: the paper square of each colour, with its number or the foot / the hand;
   in «сначала … потом …» the jump arrow between the two */
.jlabel{display:flex;align-items:center;gap:.5em}
.jchips{display:flex;align-items:center;gap:.2em}
.jchip{display:flex;align-items:center;justify-content:center;width:1.6em;height:1.6em;font-style:normal;background:var(--img) center/contain no-repeat}
.jchip b{display:flex;align-items:center;justify-content:center;width:1.5em;height:1.5em;border-radius:50%;background:#FFFBF2;color:#5B3E26;
  font:900 .62em/1 Rubik,Nunito,sans-serif;box-shadow:0 1px 3px rgba(74,58,44,.25)}
.jchip img.jpart{width:68%;height:68%}
.jarrow{height:.8em;width:auto;align-self:flex-start}
.jpart{display:block;width:100%;height:100%;object-fit:contain}
.jpart.mirror{transform:scaleX(-1)}
/* the game */
.jscreen{position:fixed;inset:0;overflow:hidden}
.jscreen .g2stars{position:absolute;left:50%;top:calc(env(safe-area-inset-top) + 1.5vh);transform:translateX(-50%) scale(.85);transform-origin:50% 0;z-index:6}
.jsound{position:absolute;right:calc(env(safe-area-inset-right) + 16px);top:calc(env(safe-area-inset-top) + 14px);z-index:6}
/* the task: a paper label taped over the mat */
.jlabel{position:absolute;left:50%;top:calc(env(safe-area-inset-top) + 11vh);transform:translateX(-50%) rotate(-1deg);z-index:5;max-width:82vw;padding:.4em 1.2em;
  background:#FFFBF2;color:#4A3324;font:900 clamp(20px,3vw,36px)/1.2 Rubik,Nunito,sans-serif;text-align:center;border-radius:6px;
  box-shadow:0 6px 14px rgba(40,30,60,.2)}
.jlabel::before,.jlabel::after{content:'';position:absolute;top:-10px;width:56px;height:20px;background:rgba(234,222,190,.85);box-shadow:0 1px 2px rgba(0,0,0,.08)}
.jlabel::before{left:-14px;transform:rotate(-24deg)}.jlabel::after{right:-14px;transform:rotate(24deg)}
.jstage{position:absolute;left:0;right:0;top:calc(env(safe-area-inset-top) + 25vh);bottom:calc(env(safe-area-inset-bottom) + 17vh);display:flex;align-items:center;justify-content:center}
/* the play mat: the cream paper mat (assets/img/mat/mat.webp), lying a little askew. It is laid round the squares by its edges
   (border-image), so its round corners and darker rim keep their shape whether the squares stand in a square or in a row.
   --s is the size of a square (set by fitTiles); the rim is a third of it */
.jrug{--s:120px;border:calc(var(--s)*.34) solid transparent;border-image-source:url('../assets/img/mat/mat.webp');border-image-slice:120 fill;border-image-repeat:stretch;
  transform:rotate(-1deg);filter:drop-shadow(0 10px 14px rgba(40,30,60,.22))}
.jscreen .tiles{display:grid}
/* the squares: the paper square of each colour (assets/img/mat/tile-*.webp); the old felt look of css/style.css is switched off */
.jscreen .tile{border-radius:0;background:var(--img) center/100% 100% no-repeat!important;box-shadow:none!important;outline:0;transition:opacity .35s,transform .35s,filter .35s}
.jscreen .tile::after{display:none}
/* the square to jump on: a little bigger, with a cream edge and a soft yellow glow round its own shape */
.jscreen .tile.lit{transform:scale(1.06);box-shadow:none!important;animation:none!important;
  filter:drop-shadow(0 0 3px #FFFBF2) drop-shadow(0 0 2px #FFFBF2) drop-shadow(0 0 calc(var(--s)*.08) rgba(243,201,107,.95))}
.jscreen .tile.dim{opacity:.5;filter:saturate(.75)}
/* on a square: its number on a cream paper circle, or the paper foot / hand */
.jscreen .tbadge{inset:auto;left:50%;top:50%;transform:translate(-50%,-50%);width:calc(var(--s)*.44);height:calc(var(--s)*.44);border-radius:50%;
  background:#FFFBF2;color:#5B3E26;font:900 calc(var(--s)*.3)/1 Rubik,Nunito,sans-serif;text-shadow:none;box-shadow:0 calc(var(--s)*.02) calc(var(--s)*.05) rgba(74,58,44,.28)}
.jscreen .tbadge.part{left:16%;top:14%;right:16%;bottom:16%;width:auto;height:auto;transform:none;border-radius:0;background:none;box-shadow:none;
  filter:drop-shadow(2px 0 0 #FFF8EA) drop-shadow(-2px 0 0 #FFF8EA) drop-shadow(0 2px 0 #FFF8EA) drop-shadow(0 -2px 0 #FFF8EA)
    drop-shadow(0 calc(var(--s)*.025) calc(var(--s)*.03) rgba(74,58,44,.3))}
/* the grown-up's buttons: a big round paper «Прыгнула!» and a small «Дальше» */
.jbar{position:absolute;left:50%;bottom:calc(env(safe-area-inset-bottom) + 2.5vh);transform:translateX(-50%);z-index:6;display:flex;align-items:center;gap:18px}
.jok{display:flex;align-items:center;gap:.5em;border:0;border-radius:999px;padding:.45em 1.4em .45em .5em;cursor:pointer;background:#FFFBF2;color:#4A3324;
  font:900 clamp(20px,2.6vw,30px)/1 Rubik,Nunito,sans-serif;box-shadow:0 6px 0 #E7D7BC,0 12px 22px rgba(40,30,60,.22)}
.jok span{display:flex;align-items:center;justify-content:center;width:1.9em;height:1.9em;border-radius:50%;background:#5BA862;color:#fff;font-size:1em}
.jok:active{transform:translateY(4px);box-shadow:0 2px 0 #E7D7BC,0 8px 16px rgba(40,30,60,.2)}

/* ---------- «Цвета и формы»: the desk picture is shown whole, so the wooden table stays visible around the sheet of paper on every screen
   (stretched a little to the screen instead of cut at the sides); the label's paint is a round dab, not a smear */
.cgdesk.art{background-size:100% 100%!important;background-position:center!important}
.cglabel img{aspect-ratio:1/1;width:auto}

/* ---------- pages in the first screen's look (hubPage in js/core/views.js): Игротека, «Говорим», «Счёт».
   They take everything from the first screen (.hub, .htitle, .hcard); here only what is needed when there are more than four cards:
   the cards wrap into rows and get a little smaller, and the rows scroll if they do not fit */
.hubsub .hcards{flex-wrap:wrap;justify-content:center;align-content:center}
.hubsub.many .hcards{gap:clamp(10px,1.6vw,22px);max-height:72vh;overflow-y:auto;padding:4px 2vw 12px}
.hubsub.many .hcard{flex:none;width:clamp(130px,15vw,210px)}
.hubsub.many .hname{font-size:clamp(16px,1.9vw,24px)}
.hubsub .tback{z-index:6}
.cnlabel{position:absolute;left:50%;top:calc(env(safe-area-inset-top) + 2.5vh);transform:translateX(-50%);z-index:5;padding:.3em 1.2em;border-radius:999px;
  background:#FFFBF2;color:#4A3324;font:900 clamp(24px,3.4vw,40px)/1.1 Rubik,Nunito,sans-serif;box-shadow:0 6px 0 #E7D7BC,0 12px 24px rgba(40,30,60,.22);white-space:nowrap}
.cncards{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;gap:clamp(14px,3vw,36px);padding:12vh 4vw 4vh;flex-wrap:wrap}
.cncard{display:flex;flex-direction:column;align-items:center;gap:.4em;width:clamp(170px,26vw,300px);padding:clamp(14px,2vw,24px);border:0;border-radius:28px;cursor:pointer;
  background:#FFFBF2;color:#4A3324;box-shadow:inset 0 -5px 0 rgba(122,86,54,.08),0 12px 26px rgba(40,30,60,.22)}
.cncard:active{transform:translateY(3px)}
.cnpic{display:flex;align-items:center;justify-content:center;width:72%;aspect-ratio:1/1;font-size:clamp(60px,9vw,110px)}
.cnpic img{width:100%;height:100%;object-fit:contain}
.cncard b{font:900 clamp(18px,2.2vw,26px)/1.15 Nunito,sans-serif;text-align:center}
.cncard span:last-child{font:700 clamp(13px,1.5vw,16px)/1.3 Nunito,sans-serif;color:#7A604A;text-align:center}

/* «Сказки» (js/games/bedtime.js): a picture book page — the picture across the whole width, the lines lie right on it (no plate),
   kept readable by a soft light glow around the letters; the page turns at the sides of the lines */
.storyscreen{position:fixed;inset:0;overflow:hidden;background:#F6EEDF}
/* the picture fills the screen from the top: on a wide screen a strip of the calm bottom may be cut, never the sides */
.storypic{position:absolute;inset:0;display:flex;align-items:flex-start;justify-content:center}
.storypic img{width:100%;height:100%;object-fit:cover;object-position:center top}
/* held upright (iPad): the whole width of the picture at the top, the lines below it on cream paper */
@media (orientation:portrait){.storypic img{height:auto;object-fit:contain}}
.storyemo{display:flex;gap:clamp(8px,2vw,24px);flex-wrap:wrap;justify-content:center;padding:12vh 10% 0}
.storyemo .emo,.storyemo img{width:clamp(70px,13vw,150px);height:clamp(70px,13vw,150px)}
.storyscreen>#back{position:absolute;z-index:6}
.storybar{position:absolute;left:0;right:0;bottom:calc(env(safe-area-inset-bottom) + 4px);z-index:4;display:flex;align-items:flex-end;justify-content:center;
  gap:clamp(8px,1.6vw,18px);padding:0 clamp(10px,2vw,24px)}
.storytext{flex:0 1 920px;min-width:0;box-sizing:border-box;max-height:42vh;overflow-y:auto;padding:6px 10px;background:none;text-align:center;color:#3B2618;
  text-shadow:0 0 2px #FFFBF2,0 0 5px #FFFBF2,0 0 10px rgba(255,251,242,.95),0 0 18px rgba(255,251,242,.8)}
.storytext.long p{font-size:clamp(15px,1.9vw,21px);line-height:1.38}
.storytext p{margin:0;font:900 clamp(18px,2.4vw,26px)/1.4 Nunito,sans-serif}
.storypg{display:block;margin-top:4px;font:800 13px Nunito,sans-serif;color:#5E4636}
.storynav{flex:0 0 auto;width:clamp(52px,6.4vw,76px);height:clamp(52px,6.4vw,76px);font:900 clamp(28px,3.6vw,42px)/1 Nunito,sans-serif}
.storynav:disabled{opacity:.35}
.storyagain{position:absolute;right:clamp(12px,2vw,22px);top:max(14px,env(safe-area-inset-top));z-index:6;width:clamp(56px,6.4vw,72px);height:clamp(56px,6.4vw,72px);font-size:clamp(22px,2.6vw,28px)}
.storyagain img{width:62%;height:62%;object-fit:contain}
/* the end of a tale: the last picture dimmed, the plaque «Конец», three big picture buttons */
.stenddim{position:absolute;inset:0;z-index:2;background:rgba(36,26,48,.45);animation:stenddim 1.6s ease both}
@keyframes stenddim{from{opacity:0}to{opacity:1}}
.stendbox{position:absolute;inset:0;z-index:4;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:clamp(14px,3vh,30px);padding:70px 16px 20px;
  animation:stendin .9s .3s ease both}
@keyframes stendin{from{opacity:0;transform:translateY(14px)}to{opacity:1;transform:none}}
.stendplate{width:min(60vw,460px);height:auto;filter:drop-shadow(0 8px 16px rgba(20,14,30,.3))}
.stendword{padding:.2em 1.1em;border-radius:999px;background:#FFFBF2;color:#5B3E26;font:900 clamp(40px,7vw,72px)/1.1 Rubik,Nunito,sans-serif;
  box-shadow:0 10px 24px rgba(20,14,30,.3)}
.stendcards{display:flex;flex-wrap:wrap;justify-content:center;gap:clamp(10px,2vw,22px);width:min(860px,100%)}
.stendcard{flex:0 1 190px;min-width:120px;padding:clamp(10px,1.6vw,16px) 10px}
.stendcard .slpic{width:min(70%,22vh)}
.stendcard .slpic svg{width:100%;height:100%}
.stendcard .slpic .stcover{width:100%;height:100%;object-fit:cover;border-radius:14px;box-shadow:0 3px 8px rgba(74,58,44,.18)}
.stendprev{position:absolute;left:clamp(10px,2vw,24px);bottom:calc(env(safe-area-inset-bottom) + 14px);z-index:5}
/* «А теперь пора спать!» at the end of the chain «Подуй» */
.slendtext{padding:.25em 1em;border-radius:999px;background:rgba(255,251,242,.92);color:#4A3324;font:900 clamp(26px,4.4vw,48px)/1.15 Nunito,sans-serif;
  box-shadow:0 8px 20px rgba(20,14,30,.3);text-align:center}

/* ---------- «Перед сном»: soft lilac headings ----------
   The title plaque is two layers of lilac paper (a darker one peeking out underneath), a little paper moon on the left and a twinkling star on the right.
   The other headings of the section (the blowing word, «А теперь пора спать!») get the same lilac paper, without the moon and star. */
.sltitle{position:relative;z-index:4;padding:.32em clamp(2.1em,6vw,2.6em) .38em;border-radius:999px;background:#EEE5F8;color:#5A4475;
  font:900 clamp(26px,3.6vw,40px)/1.1 Rubik,Nunito,sans-serif;letter-spacing:.01em;white-space:nowrap;
  box-shadow:inset 0 2px 0 rgba(255,255,255,.7),0 5px 0 #CDB9E6,0 12px 24px rgba(40,26,70,.3)}
.sltitle::before,.sltitle::after{content:'';position:absolute;top:50%;width:1.05em;height:1.05em;background:center/contain no-repeat;pointer-events:none}
.sltitle::before{left:.62em;transform:translateY(-52%) rotate(-12deg);
  background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M15 2.6a9.4 9.4 0 1 0 6.6 15.9A7.6 7.6 0 1 1 15 2.6z' fill='%23E2B95A' transform='translate(0 .8)'/><path d='M15 2.6a9.4 9.4 0 1 0 6.6 15.9A7.6 7.6 0 1 1 15 2.6z' fill='%23F6D77E'/></svg>")}
.sltitle::after{right:.62em;transform:translateY(-52%);animation:sltwinkle 3.2s ease-in-out infinite alternate;
  background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M12 2.5l2.8 5.9 6.4.8-4.7 4.4 1.2 6.4L12 17l-5.7 3 1.2-6.4-4.7-4.4 6.4-.8z' fill='%23E2B95A' transform='translate(0 .9)'/><path d='M12 2.5l2.8 5.9 6.4.8-4.7 4.4 1.2 6.4L12 17l-5.7 3 1.2-6.4-4.7-4.4 6.4-.8z' fill='%23F6D77E'/></svg>")}
@keyframes sltwinkle{from{transform:translateY(-52%) rotate(-8deg) scale(.92)}to{transform:translateY(-52%) rotate(8deg) scale(1.06)}}
body.calm .sltitle::after{animation-duration:5s}
@media (prefers-reduced-motion:reduce){.sltitle::after{animation:none}}
.blq,.slendtext{background:#EEE5F8;color:#5A4475;box-shadow:inset 0 2px 0 rgba(255,255,255,.7),0 5px 0 #CDB9E6,0 12px 24px rgba(40,26,70,.3)}
/* «Колыбельные»: the mobile's cord comes out from under the plaque; the arc only sways a little */
.lullscreen .mobile{margin-top:-8px}
.mobbar{animation-name:mobturn2}
@keyframes mobturn2{from{transform:rotate(-3deg)}to{transform:rotate(3deg)}}

/* ---------- «Цветной коврик»: the meadow behind the game is soft, so the eye goes to the mat; it keeps its own green and blue,
   so the screen is not all cream ---------- */
.jscreen>.sbworld{inset:-30px;filter:blur(7px)}
/* the page titles («Игротека», «Говорим», «Счёт», the «Цветной коврик» menu) stay the plain white plate of the first screen */
/* Игротека (hubPage with the class gamespage): three big cards in a row, as before; with more rows the page scrolls */
.hubsub.gamespage{overflow-y:auto;-webkit-overflow-scrolling:touch;justify-content:flex-start!important}
.gamespage .hcards{display:grid!important;grid-template-columns:repeat(3,minmax(0,clamp(220px,27vw,330px)))!important;justify-content:center;
  align-content:start!important;align-items:start!important;flex:none!important;height:auto!important;max-height:none!important;overflow:visible!important;
  margin:clamp(12px,2.4vh,26px) auto 0!important;
  gap:clamp(14px,2.2vw,28px)!important;flex-wrap:nowrap;padding-bottom:calc(env(safe-area-inset-bottom) + 24px)}
.gamespage .hcard{width:auto!important;max-width:none!important}
@media (orientation:portrait),(max-width:700px){.gamespage .hcards{grid-template-columns:repeat(2,minmax(0,clamp(160px,40vw,300px)))!important}}
/* the task over the mat: on its own wavy banner (white paper over a warm brown layer, assets/img/mat/label.webp):
   brown keeps it apart from the sky and from the four colours of the squares */
.jlabel{transform:translateX(-50%);background:url('../assets/img/mat/label.webp') center/100% 100% no-repeat;border-radius:0;box-shadow:none;
  padding:.8em 1.8em .9em;white-space:nowrap;max-width:94vw;font-size:clamp(18px,2.6vw,34px);filter:drop-shadow(0 8px 12px rgba(74,58,44,.18))}
.jlabel::before,.jlabel::after{display:none}
.jlabel #jq{font-size:inherit}

/* ---------- Игротека: the title on the same paper cloud with leaves as the theme screens; the cards come right under it ---------- */
.gscreen .gplate{z-index:3;width:clamp(300px,36vw,480px)}
.gscreen .gplate span{font-size:clamp(30px,4.2vw,54px)}
/* the meadow lies exactly as on the first screen (album.css: .hub>.sbworld), so going into Игротека the picture does not jump */
.gscreen>.sbworld{background-position:center 30%!important}
.gscreen .tgrid,.gscreen .tgrid.four{padding-top:clamp(12px,2vh,24px)!important}

/* a theme's title sign on «Учим слова»: each language has its own picture, and a longer word makes it a little wider («Animals» vs «Звери»).
   The sign keeps its own shape inside its place instead of being squeezed to the Russian one */
.wlogo img{object-fit:contain}
/* a theme whose world is brighter and stronger than the others (themes/<n>/theme.js: soft:true — «Одежда», «Посуда», «Природа»):
   its picture is made a little paler and softer, so all the worlds feel like one book. The sign and the tiles stay as they are */
.wsoft>.sbworld,.wsoft>.wstage{filter:saturate(.74) contrast(.92) brightness(1.04)}

/* ---------- the language: a small flag beside the code on the first screen's button, and in the list (behind the parent gate) ---------- */
.lflag{display:inline-flex;flex:none;width:28px;height:19px;border-radius:5px;overflow:hidden;box-shadow:0 0 0 1.5px rgba(74,58,44,.18)}
.lflag svg{width:100%;height:100%;display:block}
.langmenu .lopt{cursor:pointer}
.langmenu .lopt .lflag{width:40px;height:27px;border-radius:7px}
.langmenu .lopt.on{box-shadow:0 0 0 3px #F3C96B}
.langmenu .lopt.off{cursor:default;background:#F3EADB;opacity:.6}
.langmenu .lsoon{margin-left:auto;padding:3px 10px;border-radius:999px;background:#F3C96B;color:#5B3E26;font:900 13px/1.3 Nunito,sans-serif}

/* ---------- «Сделай как я»: the paper girl (js/games/listen-imitate.js: kidPicHTML). All her pictures lie on top of each other, only one is seen;
   the game moves the whole girl a little (a squash, a hop) and her shadow shrinks when she is in the air ---------- */
.kidpic{position:relative;height:min(52vh,60vmin);aspect-ratio:1;margin:0 auto}
.kidwho{position:absolute;inset:0;transform-origin:50% 99%;transition:transform .3s cubic-bezier(.45,0,.25,1)}
/* two poses overlap for a moment while one fades into the other, so the girl changes pose softly instead of jumping */
.kidwho img{position:absolute;inset:0;width:100%;height:100%;object-fit:contain;opacity:0;transition:opacity .17s ease}
.kidwho img.on{opacity:1}
.kidwho img.mir{transform:scaleX(-1)}
.kidshadow{position:absolute;left:30%;right:30%;bottom:0;height:5%;border-radius:50%;background:rgba(74,58,44,.16);transition:transform .3s cubic-bezier(.45,0,.25,1),opacity .3s}
body.calm .kidwho img{transition-duration:.28s}
/* the screen of «Сделай как я»: one column on the middle line — the stars, the words, the girl as big as the space allows, the task, the buttons */
.cpscreen{position:fixed;inset:0;display:flex;flex-direction:column;align-items:center;box-sizing:border-box;background:#F4EBDD;
  padding:max(10px,env(safe-area-inset-top)) 16px calc(env(safe-area-inset-bottom) + 16px)}
.cpscreen .bar{position:relative;width:100%;display:flex;justify-content:center;align-items:flex-start;min-height:64px}
.cpscreen .bar .stars{margin:0 auto}
.cpscreen .bar .ctl{position:absolute;right:0;top:0}
.cpscreen .q{text-align:center;margin:6px 0 0}
.cpscreen .stage{flex:1;min-height:0;width:100%;display:flex;align-items:center;justify-content:center}
.cpscreen .kidwrap{height:100%;display:flex;align-items:center;justify-content:center}
.cpscreen .kidpic{height:min(100%,64vmin)}
.cpscreen .actline,.cpscreen .hintline{text-align:center;margin-left:auto;margin-right:auto}
/* the grown-up's buttons: paper pills with drawn icons, the same look as the rest of the game */
.cpbar{display:flex;justify-content:center;flex-wrap:wrap;gap:14px;width:100%;margin-top:8px}
.cpbar .pbtn{display:inline-flex;align-items:center;gap:.45em;border:0;border-radius:999px;padding:.7em 1.4em;background:#FFFBF2;color:#5B3E26;
  font:900 clamp(18px,2.4vw,26px)/1 Nunito,sans-serif;box-shadow:0 4px 0 #E2D2B2,0 8px 14px rgba(74,58,44,.12)}
.cpbar .pbtn.ok{background:#7DB46C;color:#FFFBF2;box-shadow:0 4px 0 #5E9150,0 8px 14px rgba(74,58,44,.15)}
.cpbar .pbtn svg{width:1.15em;height:1.15em;flex:none}
.cpbar .pbtn:active{transform:translateY(3px);box-shadow:0 1px 0 #E2D2B2}
.cpbar .pbtn.ok:active{box-shadow:0 1px 0 #5E9150}

/* ---------- «Волшебная кисть» (js/games/drawing.js: brushHTML, fitBrush): the paper takes all the room between the top bar and the paints ---------- */
.brscreen{position:fixed;inset:0;display:flex;flex-direction:column;box-sizing:border-box;background:#F4EBDD;
  padding:max(8px,env(safe-area-inset-top)) max(10px,env(safe-area-inset-right)) calc(env(safe-area-inset-bottom) + 8px) max(10px,env(safe-area-inset-left))}
.brscreen .stage{flex:1 1 auto;min-height:0;width:100%;padding:0;margin:6px 0 0;display:flex;align-items:stretch;justify-content:center;box-sizing:border-box}
.brscreen .brboard{flex:none;max-width:none;max-height:none;aspect-ratio:auto;border-radius:clamp(16px,2vw,26px);background:#FFFDF8;
  box-shadow:0 0 0 5px rgba(255,251,242,.9),0 10px 24px rgba(74,58,44,.16);overflow:hidden}
.brscreen .brboard canvas{display:block;width:100%!important;height:100%!important;touch-action:none}
.brscreen .pal{flex:none;margin:6px auto 0}

/* ---------- «Дорожки» (js/games/drawing.js: roadsHTML): the paper meadow covers the screen, the road lies in the biggest square that fits ---------- */
.rdscreen{position:fixed;inset:0;display:flex;flex-direction:column;box-sizing:border-box;background-size:cover;background-position:center;background-color:#BFD49C;
  padding:max(8px,env(safe-area-inset-top)) max(10px,env(safe-area-inset-right)) calc(env(safe-area-inset-bottom) + 10px) max(10px,env(safe-area-inset-left))}
.rdscreen .stage{flex:1 1 auto;min-height:0;width:100%;padding:0;margin:4px 0 0;display:flex;align-items:center;justify-content:center}
.rdscreen .roadboard{background:none!important;box-shadow:none!important;border:0!important}
.rdscreen .roadboard svg{filter:drop-shadow(0 4px 5px rgba(74,58,44,.18))}
/* the paper pieces on the road get a thin cream edge, so even the grass reads on the green meadow */
.rpic{display:block;width:1.15em;height:1.15em;object-fit:contain;
  filter:drop-shadow(2px 0 0 #FFF8EA) drop-shadow(-2px 0 0 #FFF8EA) drop-shadow(0 2px 0 #FFF8EA) drop-shadow(0 -2px 0 #FFF8EA) drop-shadow(0 5px 5px rgba(74,58,44,.25))}
.rdscreen .rgoal{filter:drop-shadow(.5px 0 0 #FFF8EA) drop-shadow(-.5px 0 0 #FFF8EA) drop-shadow(0 .5px 0 #FFF8EA) drop-shadow(0 -.5px 0 #FFF8EA)}

/* ---------- «Раскраска»: the finished picture comes alive (js/games/drawing.js: PAINT_LIVE) ---------- */
/* the details are hidden while the child colours, and fade in when the last part is done */
.paint .live,.paint .under{opacity:0;transition:opacity .6s ease;pointer-events:none}
.paint.alive .live,.paint.alive .under{opacity:1}
.paint.alive .reg{cursor:pointer}
.paint svg *{transform-box:view-box}
/* butterfly: the wings flap towards the body, the butterfly floats up and down */
.pic0.alive .flap{transform-origin:50px 50px;animation:pflap .55s ease-in-out infinite alternate}
@keyframes pflap{from{transform:scaleX(1)}to{transform:scaleX(.45)}}
.pic0.alive .pwhole{animation:pfloat 3s ease-in-out infinite}
@keyframes pfloat{0%,100%{transform:translate(0,0)}25%{transform:translate(-3px,-6px)}75%{transform:translate(3px,-3px)}}
/* house: smoke rises from the chimney, the windows glow, the sun turns */
.pic1.alive .smoke circle{animation:psmoke 3s ease-out infinite;opacity:0}
.pic1.alive .smoke circle:nth-child(2){animation-delay:1s}.pic1.alive .smoke circle:nth-child(3){animation-delay:2s}
@keyframes psmoke{0%{opacity:0;transform:translate(0,6px) scale(.5)}25%{opacity:.95}100%{opacity:0;transform:translate(4px,-10px) scale(1.4)}}
.pic1 .smoke circle{transform-box:fill-box;transform-origin:center}
.pic1.alive .glow{animation:pglow 2.4s ease-in-out infinite alternate}
@keyframes pglow{from{filter:brightness(1)}to{filter:brightness(1.25) drop-shadow(0 0 2px #FFE59A)}}
.pic1.alive .rays{transform-origin:87px 12px;animation:prays 9s linear infinite}
@keyframes prays{to{transform:rotate(360deg)}}
.pic1.alive .posy{animation:psway 2.6s ease-in-out infinite alternate;transform-origin:50px 90px}
/* fish: swims to and fro, the tail wags, bubbles go up */
.pic2.alive .pwhole{animation:pswim 3.4s ease-in-out infinite}
@keyframes pswim{0%,100%{transform:translate(4px,0) rotate(1deg)}50%{transform:translate(-6px,-3px) rotate(-2deg)}}
.pic2.alive .tail{transform-origin:69px 50px;animation:ptail .45s ease-in-out infinite alternate}
@keyframes ptail{from{transform:rotate(-12deg)}to{transform:rotate(12deg)}}
.pic2.alive .bubbles circle{transform-box:fill-box;transform-origin:center;opacity:0;animation:pbub 2.6s ease-out infinite}
.pic2.alive .bubbles circle:nth-child(2){animation-delay:.9s}.pic2.alive .bubbles circle:nth-child(3){animation-delay:1.8s}
@keyframes pbub{0%{opacity:0;transform:translate(0,8px) scale(.5)}20%{opacity:1}100%{opacity:0;transform:translate(-2px,-14px) scale(1.1)}}
/* flower: sways in the wind from the bottom of the stem; a bee flies round it, its wings buzzing */
.pic3.alive .pwhole{transform-origin:50px 92px;animation:psway 2.2s ease-in-out infinite alternate}
@keyframes psway{from{transform:rotate(-4deg)}to{transform:rotate(4deg)}}
.pic3.alive .bee{animation:pbee 6s linear infinite}
@keyframes pbee{0%{transform:translate(78px,24px)}25%{transform:translate(62px,8px)}50%{transform:translate(24px,18px)}75%{transform:translate(30px,44px)}100%{transform:translate(78px,24px)}}
.pic3.alive .bwing{transform-box:fill-box;transform-origin:50% 100%;animation:pbuzz .12s linear infinite alternate}
@keyframes pbuzz{to{transform:scaleY(.4)}}
/* car: bobs a little, the wheels turn, the road runs under it, puffs come out at the back */
.pic4.alive .pwhole{animation:pbob .35s ease-in-out infinite alternate}
@keyframes pbob{to{transform:translateY(-1px)}}
.pic4.alive .spin{animation:pspin .6s linear infinite}
@keyframes pspin{to{transform:rotate(360deg)}}
.pic4.alive .road{animation:proad .5s linear infinite}
@keyframes proad{to{stroke-dashoffset:14}}
.pic4.alive .puff circle{transform-box:fill-box;transform-origin:center;opacity:0;animation:ppuff 1.2s ease-out infinite}
.pic4.alive .puff circle:nth-child(2){animation-delay:.6s}
@keyframes ppuff{0%{opacity:0;transform:scale(.4)}30%{opacity:.9}100%{opacity:0;transform:translate(-6px,-3px) scale(1.5)}}
/* ball: bounces and turns, squashing a little when it lands; the shadow on the ground grows as it comes down */
.pic5.alive .pwhole{transform-origin:50px 86px;animation:pbounce 1.1s cubic-bezier(.3,0,.7,1) infinite}
@keyframes pbounce{0%,100%{transform:translateY(0) scale(1.06,.94)}12%{transform:translateY(-4px) scale(1,1)}50%{transform:translateY(-22px)}88%{transform:translateY(-4px) scale(1,1)}}
.pic5.alive .bshadow{transform-box:fill-box;transform-origin:center;animation:pbshadow 1.1s cubic-bezier(.3,0,.7,1) infinite}
@keyframes pbshadow{0%,100%{transform:scale(1);opacity:1}50%{transform:scale(.6);opacity:.5}}
body.calm .paint.alive *{animation-duration:2.6s!important}
@media (prefers-reduced-motion:reduce){.paint.alive *{animation:none!important}}
