/* Continuous leaderboard journey: score first, then the player plate visibly
   passes every displaced competitor while the standings viewport follows it. */
.crowndoku-rank-board.rank-climbing {
  overflow: visible;
}

.crowndoku-rank-board.rank-climbing .contest-board-scroll {
  scroll-behavior: auto;
  overscroll-behavior: contain;
}

.crowndoku-rank-board.rank-climbing .rank-motion-player {
  position: relative;
  z-index: 8;
  will-change: transform, filter;
  animation: crowndoku-rank-climb var(--ctg-rank-journey-duration, var(--crowndoku-rank-motion-duration, .84s)) linear both !important;
}

.crowndoku-rank-board.rank-climbing .rank-motion-shifted {
  position: relative;
  z-index: 3;
  will-change: transform, filter;
  animation: ctg-rank-yield-step var(--ctg-rank-pass-duration, 150ms) var(--ctg-rank-yield-delay, 0ms) cubic-bezier(.18, .86, .26, 1) both !important;
}

.crowndoku-rank-board.rank-climbing .rank-motion-player::after {
  animation-duration: var(--ctg-rank-journey-duration, var(--crowndoku-rank-motion-duration, .84s)) !important;
}

/* Kept under the original animation name so the existing settle/chime hooks
   fire only after this complete journey has finished. */
@keyframes crowndoku-rank-climb {
  0% {
    transform: translateY(calc(var(--rank-steps) * var(--crowndoku-rank-row-step))) scale(.985);
    filter: brightness(.94) saturate(.94);
  }
  88% {
    transform: translateY(0) scale(1.018);
    filter: brightness(1.22) saturate(1.12);
  }
  95% {
    transform: translateY(-2px) scale(1.035);
    filter: brightness(1.3) saturate(1.14);
  }
  100% {
    transform: translateY(0) scale(1);
    filter: brightness(1) saturate(1);
  }
}

@keyframes ctg-rank-yield-step {
  0% {
    transform: translateY(calc(-1 * var(--crowndoku-rank-row-step)));
    filter: brightness(.88) saturate(.9);
  }
  72% {
    transform: translateY(2px);
    filter: brightness(1.12) saturate(1.06);
  }
  100% {
    transform: translateY(0);
    filter: brightness(1) saturate(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .crowndoku-rank-board.rank-climbing .rank-motion-player,
  .crowndoku-rank-board.rank-climbing .rank-motion-shifted {
    animation: none !important;
    filter: none;
    transform: none;
  }
}
