/* Library layout motion. Short (about 0.2 s) so nothing feels slower. Settings > Reduce motion (.ls.rm, in
   libpolish.css) and Windows' own "show animations" setting both switch all of it off. */
.ls{--mo-out:cubic-bezier(.23,1,.32,1)}

/* 1. Page changes: the new page fades in and rises a little. */
.ls-page{animation:moPage .24s var(--mo-out)}
@keyframes moPage{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}

/* 2. Opening a game: the banner settles in from slightly zoomed, the rest follows. */
.ls-page .gp-band{animation:moBand .45s var(--mo-out)}
@keyframes moBand{from{opacity:.4;transform:scale(1.025)}to{opacity:1;transform:none}}
.ls-page .gp-tabs,.ls-page .gp-tabs~*{animation:moPage .3s var(--mo-out) .06s backwards}

/* 3. Covers: the first rows fade in one after another. */
.ls-page .lg-grid>*,.ls-page .rp-jump>*,.ls-page .fv-grid>*{animation:moCover .32s var(--mo-out) backwards}
@keyframes moCover{from{opacity:0;transform:translateY(10px) scale(.98)}to{opacity:1;transform:none}}
.ls-page :is(.lg-grid,.rp-jump,.fv-grid)>:nth-child(2){animation-delay:.03s}
.ls-page :is(.lg-grid,.rp-jump,.fv-grid)>:nth-child(3){animation-delay:.06s}
.ls-page :is(.lg-grid,.rp-jump,.fv-grid)>:nth-child(4){animation-delay:.09s}
.ls-page :is(.lg-grid,.rp-jump,.fv-grid)>:nth-child(5){animation-delay:.12s}
.ls-page :is(.lg-grid,.rp-jump,.fv-grid)>:nth-child(6){animation-delay:.15s}
.ls-page :is(.lg-grid,.rp-jump,.fv-grid)>:nth-child(7){animation-delay:.18s}
.ls-page :is(.lg-grid,.rp-jump,.fv-grid)>:nth-child(8){animation-delay:.21s}
.ls-page :is(.lg-grid,.rp-jump,.fv-grid)>:nth-child(9){animation-delay:.24s}
.ls-page :is(.lg-grid,.rp-jump,.fv-grid)>:nth-child(10){animation-delay:.27s}
.ls-page :is(.lg-grid,.rp-jump,.fv-grid)>:nth-child(n+11){animation-delay:.3s}

/* 4. Tabs: one underline that slides to the picked tab. */
.ls .gp-tabs,.ls .lg-tabs{position:relative}
.ls .gp-tab.on::after,.ls .lg-tab.on::after{display:none}
.tab-ink{position:absolute;left:0;bottom:-1px;height:2px;border-radius:2px;background:var(--accent);pointer-events:none;opacity:0;transition:transform .28s var(--mo-out),width .28s var(--mo-out)}
.tab-ink.still{transition:none}

/* 5. Hover and press: covers lift (already in libgames.css) and press in; buttons give a small press. */
.ls .lg-cover:active .lg-art{transform:translateY(-1px) scale(.98);transition-duration:.08s}
.ls :is(.gp-cta,.gp-chip,.st-btn,.ln-btn,.ln-cta,.ls-pill,.rp-mini,.np-btn,.ls-rbtn,.ls-me,.ap-btn,.lg-ab,.rp-arr button,.ac-more,.lg-dd,.lg-add){transition:transform .12s var(--mo-out),background-color .15s,border-color .15s,color .15s,opacity .15s}
.ls :is(.gp-cta,.gp-chip,.st-btn,.ln-btn,.ln-cta,.ls-pill,.rp-mini,.np-btn,.ls-rbtn,.ls-me,.ap-btn,.lg-ab,.rp-arr button,.ac-more,.lg-dd,.lg-add):active:not(:disabled){transform:scale(.96)}
.ls .rp-s:active,.ls .am-row:active{transform:scale(.99);transition:transform .08s}

/* 6. Small touches. */
/* The heart pops when a game becomes a favourite. */
/* Bars grow in: This week, achievement progress, rarity. */
.ls-page .rp-bars i{transform-origin:bottom;animation:moGrowY .5s var(--mo-out) .1s backwards}
.ls-page .rp-bars div:nth-child(2) i{animation-delay:.14s}.ls-page .rp-bars div:nth-child(3) i{animation-delay:.18s}
.ls-page .rp-bars div:nth-child(4) i{animation-delay:.22s}.ls-page .rp-bars div:nth-child(5) i{animation-delay:.26s}
.ls-page .rp-bars div:nth-child(6) i{animation-delay:.3s}.ls-page .rp-bars div:nth-child(7) i{animation-delay:.34s}
@keyframes moGrowY{from{transform:scaleY(0)}to{transform:none}}
.ls-page :is(.ac-bar,.ac-rb) i{transform-origin:left;animation:moGrowX .6s var(--mo-out) .1s backwards}
@keyframes moGrowX{from{transform:scaleX(0)}to{transform:none}}
/* Toasts slide in from the side in this layout. */
[data-tb="0"] .sd-toasts>*{animation:moToast .32s var(--mo-out)!important}
@keyframes moToast{from{opacity:0;transform:translateX(24px) scale(.98)}to{opacity:1;transform:none}}

@media (prefers-reduced-motion:reduce){
  .ls *,.ls *::before,.ls *::after,[data-tb="0"] .sd-toasts>*{animation:none!important;transition:none!important}
}
.ls.rm .tab-ink{transition:none}
[data-tb="0"]:has(.ls.rm) .sd-toasts>*{animation:none!important}

/* Game page favourite: a round heart button; adding a favourite makes it jump and sparkle. */
.gp-fav{position:relative;width:48px;height:48px;flex:none;display:grid;place-items:center;border-radius:99px;border:1px solid rgba(255,255,255,.2);background:rgba(20,20,22,.55);backdrop-filter:blur(8px);color:#fff;cursor:pointer;transition:transform .12s cubic-bezier(.23,1,.32,1),border-color .15s,color .15s}
.gp-fav:hover{border-color:rgba(255,255,255,.4)}
.gp-fav:active{transform:scale(.94)}
.gp-fav:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.gp-fav.on{color:#ff8fa3;border-color:rgba(255,143,163,.45)}
.gp-fav.on svg path{fill:currentColor}
.gp-fav svg{position:relative;z-index:1}

/* Favourite burst (libmotion.js heartBurst): the heart pops in with a bounce while a thin ring flashes out and
   seven pairs of rainbow dots scatter. Same on the game page heart, cover hearts and Favourites' Add. */
.ls :is(.gp-fav,.lg-fv,.fv-add).pop svg{animation:favPop .7s cubic-bezier(.17,.89,.32,1.49)}
@keyframes favPop{0%,25%{transform:scale(0)}100%{transform:scale(1)}}
.hb{position:fixed;width:0;height:0;z-index:120;pointer-events:none;transform:scale(var(--s,1))}
.hb b{position:absolute;left:0;top:0;border-radius:99px;box-sizing:border-box;opacity:0;animation:favRing .65s cubic-bezier(.23,1,.32,1)}
@keyframes favRing{0%{opacity:1;width:20px;height:20px;margin:-10px;border:6px solid #f472b6}
  60%{opacity:.9;width:84px;height:84px;margin:-42px;border:1.5px solid #a78bfa}
  100%{opacity:0;width:96px;height:96px;margin:-48px;border:1px solid #a78bfa}}
.hb i{position:absolute;left:0;top:0;width:7px;height:7px;margin:-3.5px;border-radius:99px;background:var(--c);opacity:0;animation:favDot .8s cubic-bezier(.23,1,.32,1) .12s}
.hb i.sm{width:5px;height:5px;margin:-2.5px;animation-name:favDotSm}
@keyframes favDot{0%{opacity:0;transform:rotate(var(--a)) translateY(-22px) scale(.6)}15%{opacity:1;transform:rotate(var(--a)) translateY(-28px) scale(1)}100%{opacity:0;transform:rotate(var(--a)) translateY(-42px) scale(.3)}}
@keyframes favDotSm{0%{opacity:0;transform:rotate(var(--a)) translateY(-20px) scale(.6)}15%{opacity:1;transform:rotate(var(--a)) translateY(-24px) scale(1)}100%{opacity:0;transform:rotate(var(--a)) translateY(-34px) scale(.3)}}
.ls.rm :is(.gp-fav,.lg-fv,.fv-add).pop svg{animation:none}
@media (prefers-reduced-motion:reduce){.ls :is(.gp-fav,.lg-fv,.fv-add).pop svg,.hb{animation:none;display:none}}

/* Light / dark switch (themeflip.js): the new colours are revealed through an animated shape, no cross-fade. */
::view-transition-old(root),::view-transition-new(root){animation:none;mix-blend-mode:normal}
::view-transition-new(root){z-index:2}
/* The light / dark reveal never blocks the app: clicks and the wheel pass through to the real screen below. */
::view-transition{pointer-events:none}

/* The old screen while the light / dark reveal plays: on top of everything, but the mouse goes straight through. */
.tf-snap{position:fixed;left:0;top:0;width:100vw;height:100vh;z-index:2147483000;pointer-events:none;user-select:none}
