/* ---- Ranked result (RP gain / loss) animation ---- */
.rp-box { position: relative; overflow: hidden; opacity: 0; transform: translateY(14px) scale(.96); animation: rpBoxIn .5s .15s cubic-bezier(.2,.9,.3,1.2) forwards; }
.rp-box.rp-gain { border-color: rgba(52,211,153,.55); }
.rp-box.rp-loss { border-color: rgba(248,113,113,.55); }
@keyframes rpBoxIn { to { opacity: 1; transform: none; } }

.rp-box.rp-run.rp-gain { animation: rpBoxIn .5s .15s cubic-bezier(.2,.9,.3,1.2) forwards, rpGlowUp 1.6s .3s ease-out; }
.rp-box.rp-run.rp-loss { animation: rpBoxIn .5s .15s cubic-bezier(.2,.9,.3,1.2) forwards, rpShake .6s .45s ease-in-out, rpGlowDown 1.6s .3s ease-out; }
@keyframes rpGlowUp   { 0% { box-shadow: 0 0 0 rgba(52,211,153,0); } 40% { box-shadow: 0 0 34px rgba(52,211,153,.55); } 100% { box-shadow: 0 0 0 rgba(52,211,153,0); } }
@keyframes rpGlowDown { 0% { box-shadow: 0 0 0 rgba(248,113,113,0); } 40% { box-shadow: 0 0 34px rgba(248,113,113,.5); } 100% { box-shadow: 0 0 0 rgba(248,113,113,0); } }
@keyframes rpShake { 0%,100% { transform: translateX(0); } 20% { transform: translateX(-7px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(3px); } }

.rp-delta { font-size: 2.25rem; line-height: 1.1; font-variant-numeric: tabular-nums; text-shadow: 0 0 18px currentColor; }
.rp-delta.rp-pop { animation: rpPop .45s cubic-bezier(.2,1.6,.4,1); }
@keyframes rpPop { 0% { transform: scale(1); } 50% { transform: scale(1.3); } 100% { transform: scale(1); } }

.rp-bar { height: .6rem; margin-top: .6rem; background: #1f2937; border-radius: 999px; overflow: hidden; }
.rp-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, #f59e0b, #fde047); }
.rp-gain .rp-fill { background: linear-gradient(90deg, #10b981, #6ee7b7); }
.rp-loss .rp-fill { background: linear-gradient(90deg, #ef4444, #fca5a5); }
#rpTotal { font-variant-numeric: tabular-nums; }

.rp-rankchange { margin-top: .6rem; padding: .35rem .6rem; border-radius: .7rem; font-size: .75rem; letter-spacing: .04em; animation: rpRankPop .6s cubic-bezier(.2,1.5,.4,1); }
.rp-rankchange.hidden { display: none; }
.rp-promoted { background: rgba(16,185,129,.18); color: #6ee7b7; border: 1px solid rgba(52,211,153,.5); }
.rp-demoted  { background: rgba(239,68,68,.16); color: #fca5a5; border: 1px solid rgba(248,113,113,.5); }
@keyframes rpRankPop { 0% { transform: scale(.4); opacity: 0; } 100% { transform: none; opacity: 1; } }

.rp-particle { position: absolute; pointer-events: none; font-size: .8rem; font-weight: 900; opacity: 0; animation-fill-mode: forwards; animation-timing-function: ease-out; }
.rp-p-up   { bottom: -6px; color: #6ee7b7; animation-name: rpFloatUp; }
.rp-p-down { top: -6px; color: #fca5a5; animation-name: rpFloatDown; }
@keyframes rpFloatUp   { 0% { transform: translateY(0) scale(.6); opacity: 0; } 20% { opacity: 1; } 100% { transform: translateY(-110px) scale(1.2); opacity: 0; } }
@keyframes rpFloatDown { 0% { transform: translateY(0) scale(.6); opacity: 0; } 20% { opacity: 1; } 100% { transform: translateY(110px) scale(1.2); opacity: 0; } }

@media (prefers-reduced-motion: reduce) { .rp-box, .rp-box.rp-run { animation: none !important; opacity: 1; transform: none; } .rp-particle { display: none; } }

.rp-next { margin-top: .15rem; font-size: .7rem; font-weight: 700; color: #9ca3af; }
.rp-next b { color: #fbbf24; font-variant-numeric: tabular-nums; }
