/* Rytm © 2026 — 15.13.0: warstwa ruchu i haseł marki („Dostosuj swój Rytm”). Wszystko wyłącza się przy prefers-reduced-motion. */

/* --- znak „puls” (5 słupków jak equalizer) --- */
.rytm-pulse{display:inline-flex;align-items:flex-end;gap:2px;height:1em;vertical-align:-.08em;margin-right:.35em}
.rytm-pulse i{display:block;width:.16em;min-width:3px;height:100%;border-radius:2px;background:currentColor;transform-origin:50% 100%;animation:rytm-eq 1.1s ease-in-out infinite}
.rytm-pulse i:nth-child(1){animation-delay:-.9s}.rytm-pulse i:nth-child(2){animation-delay:-.3s}.rytm-pulse i:nth-child(3){animation-delay:-.6s}
.rytm-pulse i:nth-child(4){animation-delay:-.15s}.rytm-pulse i:nth-child(5){animation-delay:-.75s}
.rytm-pulse.accent{color:var(--accent,#A4561C)}
@keyframes rytm-eq{0%,100%{transform:scaleY(.3)}50%{transform:scaleY(1)}}

/* --- rotator haseł --- */
.rytm-slogan{position:relative;display:block;height:1.5em;overflow:hidden;font-size:17px;font-weight:600;color:var(--accent,#A4561C)}
.rytm-slogan span{position:absolute;left:0;right:0;top:0;opacity:0;transform:translateY(100%);animation:rytm-slogan 21s cubic-bezier(.2,.7,.2,1) infinite}
.rytm-slogan span:nth-child(2){animation-delay:3s}.rytm-slogan span:nth-child(3){animation-delay:6s}.rytm-slogan span:nth-child(4){animation-delay:9s}
.rytm-slogan span:nth-child(5){animation-delay:12s}.rytm-slogan span:nth-child(6){animation-delay:15s}.rytm-slogan span:nth-child(7){animation-delay:18s}
@keyframes rytm-slogan{0%{opacity:0;transform:translateY(100%)}2.5%,12%{opacity:1;transform:none}14.3%,100%{opacity:0;transform:translateY(-100%)}}

/* --- nagłówek ekranu głównego --- */
.rytm-hero-title{display:flex;flex-direction:column;gap:6px;margin-top:6px}
.rytm-hero-title .ui-h1{margin:0}
.rytm-hero-title .rytm-pulse{font-size:26px;color:var(--accent,#A4561C)}

/* --- wejście ekranu (tylko przy zmianie ekranu, nie przy każdym kliknięciu) --- */
.ui.ui-enter > *{animation:rytm-in .42s cubic-bezier(.2,.7,.2,1) both}
.ui.ui-enter > *:nth-child(2){animation-delay:.04s}.ui.ui-enter > *:nth-child(3){animation-delay:.08s}.ui.ui-enter > *:nth-child(n+4){animation-delay:.12s}
.ui.ui-enter .ui-stack > .ui-card:nth-child(-n+8){animation:rytm-in .45s cubic-bezier(.2,.7,.2,1) both}
.ui.ui-enter .ui-stack > .ui-card:nth-child(2){animation-delay:.06s}.ui.ui-enter .ui-stack > .ui-card:nth-child(3){animation-delay:.1s}
.ui.ui-enter .ui-stack > .ui-card:nth-child(4){animation-delay:.14s}.ui.ui-enter .ui-stack > .ui-card:nth-child(5){animation-delay:.18s}
.ui.ui-enter .ui-stack > .ui-card:nth-child(n+6){animation-delay:.22s}
@keyframes rytm-in{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:none}}

/* --- dotyk i wybór --- */
.ui-btn,.ui-pill,.ui-slot,.ui-day,.ui-choice,.ui-member,.btn{transition:transform .12s ease,background-color .18s ease,border-color .18s ease,box-shadow .18s ease}
.ui-btn:active,.ui-pill:active,.ui-slot:active,.ui-day:active,.ui-choice:active,.btn:active{transform:scale(.96)}
.ui-slot.on,.ui-day.on,.ui-choice.on,.ui-member.on{animation:rytm-pop .28s cubic-bezier(.3,1.6,.5,1)}
@keyframes rytm-pop{0%{transform:scale(.92)}100%{transform:scale(1)}}
a.ui-card,.ui-card[onclick]{transition:transform .18s ease,box-shadow .18s ease}
@media (hover:hover){a.ui-card:hover{transform:translateY(-2px);box-shadow:0 10px 24px rgba(21,22,26,.08)}}

/* --- pasek „Następna wizyta” delikatnie oddycha --- */
.rytm-breathe{position:relative;overflow:hidden}
.rytm-breathe::after{content:'';position:absolute;inset:-40%;background:radial-gradient(circle at 30% 30%,rgba(164,86,28,.22),transparent 55%);animation:rytm-breathe 6s ease-in-out infinite;pointer-events:none}
@keyframes rytm-breathe{0%,100%{transform:translate(-6%,-4%)}50%{transform:translate(8%,6%)}}

/* --- świętowanie (rezerwacja, przełożenie, płatność) --- */
.rytm-celebrate{position:fixed;inset:0;z-index:9999;display:flex;align-items:center;justify-content:center;background:rgba(246,243,238,.86);backdrop-filter:blur(4px);animation:rytm-fade .25s ease both}
.rytm-celebrate.out{animation:rytm-fadeout .35s ease forwards}
.rytm-celebrate .box{display:flex;flex-direction:column;align-items:center;gap:10px;text-align:center;padding:24px;animation:rytm-in .4s cubic-bezier(.2,.7,.2,1) both}
.rytm-celebrate svg{width:96px;height:96px}
.rytm-celebrate .c{fill:none;stroke:#15161A;stroke-width:4;stroke-dasharray:290;stroke-dashoffset:290;animation:rytm-draw .55s ease forwards}
.rytm-celebrate .k{fill:none;stroke:#A4561C;stroke-width:6;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:70;stroke-dashoffset:70;animation:rytm-draw .35s .45s ease forwards}
.rytm-celebrate b{font-size:22px;color:#15161A}
.rytm-celebrate span{font-size:15px;color:#5D5F66}
.rytm-celebrate .rytm-pulse{font-size:22px;color:#A4561C;margin:2px 0 0}
.rytm-confetti{position:fixed;top:-12px;width:8px;height:12px;border-radius:2px;z-index:10000;animation:rytm-fall 1.6s cubic-bezier(.3,.6,.4,1) forwards;pointer-events:none}
@keyframes rytm-draw{to{stroke-dashoffset:0}}
@keyframes rytm-fade{from{opacity:0}to{opacity:1}}
@keyframes rytm-fadeout{to{opacity:0}}
@keyframes rytm-fall{0%{transform:translateY(0) rotate(0)}100%{transform:translateY(105vh) rotate(720deg);opacity:.2}}

/* --- dolny pasek: aktywna zakładka --- */
.ui-tabbar a[aria-current="page"] svg,.ui-tabbar .on svg{animation:rytm-pop .3s cubic-bezier(.3,1.6,.5,1)}

@media (prefers-reduced-motion:reduce){
  .rytm-pulse i,.rytm-slogan span,.ui.ui-enter > *,.ui.ui-enter .ui-stack > .ui-card,.rytm-breathe::after,.ui-slot.on,.ui-day.on,.ui-choice.on,.ui-member.on,.rytm-confetti{animation:none!important}
  .rytm-slogan span{position:static;opacity:1;transform:none}.rytm-slogan span:nth-child(n+2){display:none}
  .rytm-pulse i{transform:scaleY(.7)}
}
