/* ── The lesson's motion (phaseb.css: dkFade 185-256, the rating flight and its caption
   2626-2790, progress juice 108-168). Moved in JS by rating_flight.js; with "reduce motion"
   nothing here moves. ── */
#card:not(.hidden) #panel { animation: dkFade 0.4s cubic-bezier(.2,.8,.3,1); }
#panel { transition: max-width 0.35s cubic-bezier(.2,.8,.3,1); }
@keyframes dkFade {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
/* A review missed, or the lesson's last card: the card stays up, dimmed, until the reply. A
   filter, not `opacity`, which the card's fade-in and rise animate over. */
#card.is-waiting #panel { filter: opacity(0.6); }

/* The rated card's copy (rating_flight.js pin), fixed where the card was. */
.pl-flight { position: fixed; z-index: 60; pointer-events: none; will-change: transform, opacity; }
.pl-flight > .dk-modal { margin: 0; height: 100%; }

/* The line above the rated card: a streak word, then "Back in 4 days". */
.pbfb-caption {
  position: fixed;
  z-index: 70;
  translate: -50% -100%;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  max-width: 92vw;
  text-align: center;
  overflow-wrap: anywhere;
  pointer-events: none;
}
.pbfb-caption__praise {
  position: relative;
  font: 800 21px/1.2 var(--font-jp);
  color: var(--pbfb-accent, #6f6d92);
  letter-spacing: 0.01em;
  text-shadow: 0 1px 2px rgba(48,40,78,0.28), 0 0 2px rgba(48,40,78,0.40);
}
.pbfb-caption__praise::before {
  content: "";
  position: absolute; left: 50%; top: 52%;
  width: 172%; height: 340%;
  transform: translate(-50%, -50%) scale(.4);
  background: radial-gradient(closest-side,
    color-mix(in srgb, var(--pbfb-accent, #6f6d92) 42%, transparent) 0%, transparent 74%);
  opacity: 0; z-index: -1; pointer-events: none;
  filter: blur(3px);
}
.pbfb-sparkles { position: absolute; left: 50%; top: 46%; width: 0; height: 0; }
.pbfb-sparkle {
  position: absolute; left: 0; top: 0;
  width: var(--sz, 4px); height: var(--sz, 4px);
  margin: calc(var(--sz, 4px) / -2);
  border-radius: 50%;
  background: radial-gradient(circle,
    color-mix(in srgb, var(--pbfb-accent, #6f6d92) 88%, #fff) 0%,
    var(--pbfb-accent, #6f6d92) 52%, transparent 72%);
  opacity: 0;
}
.pbfb-caption--pop .pbfb-caption__praise { animation: pbfbPraisePop 560ms cubic-bezier(.2,.8,.25,1) both; }
.pbfb-caption--pop.pbfb-caption--milestone .pbfb-caption__praise::before { animation: pbfbGlowBloom 940ms ease-out both; }
.pbfb-caption--pop .pbfb-sparkle { animation: pbfbSparkle 900ms cubic-bezier(.25,.7,.3,1) var(--dl, 0ms) both; }
@keyframes pbfbPraisePop {
  0% { transform: scale(.56); }
  52% { transform: scale(1.10); }
  76% { transform: scale(.975); }
  100% { transform: scale(1); }
}
@keyframes pbfbGlowBloom {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(.35); }
  28% { opacity: .8; }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.3); }
}
@keyframes pbfbSparkle {
  0% { opacity: 0; transform: translate(0, 0) scale(.3); }
  25% { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--dx, 0), var(--dy, 0)) scale(1); }
}
.pbfb-caption__interval {
  font: 600 13.5px/1.3 var(--font-display);
  letter-spacing: 0.14em; text-transform: uppercase;
  color: #4d78ab;
  text-shadow: 0 1px 2px rgba(255,255,255,0.55), 0 0 1px rgba(255,255,255,0.7);
}
.pbfb-caption__interval:empty { display: none; }
:root:has(.atmosphere.is-night) .pbfb-caption__interval,
:root:has(.atmosphere.is-caught-up) .pbfb-caption__interval {
  color: #aebef4;
  text-shadow: 0 1px 3px rgba(10,14,34,0.6), 0 0 2px rgba(10,14,34,0.5);
}
:root:has(.atmosphere.is-night) .pbfb-caption__praise,
:root:has(.atmosphere.is-caught-up) .pbfb-caption__praise {
  color: var(--pbfb-accent, #b7b4e0);
  text-shadow: 0 1px 3px rgba(10,14,34,0.55);
}

/* Progress: the count ticks with each card and pops gold every 10, the bar flashes. */
.dk-progress__num > span { display: inline-block; }
#progress_current.is-tick { animation: pbNumTick 0.26s ease-out; }
#progress_current.is-pop { animation: pbNumPop 0.46s cubic-bezier(0.34,1.7,0.5,1); }
.dk-progress__bar.is-levelup .dk-progress__fill {
  box-shadow: 0 0 14px 2px rgba(176,140,255,0.9); filter: brightness(1.3);
}
@keyframes pbNumTick { 0% { transform: scale(1); } 45% { transform: scale(1.22); } 100% { transform: scale(1); } }
@keyframes pbNumPop {
  0% { transform: scale(1); }
  36% { transform: scale(1.5); color: var(--gold); }
  100% { transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  #card:not(.hidden) #panel, #progress_current.is-tick, #progress_current.is-pop { animation: none; }
  #panel { transition: none; }
  .dk-progress__bar.is-levelup .dk-progress__fill { box-shadow: none; filter: none; }
}
