.nirf-achievement {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 7px;

    color: var(--gold-light);
    white-space: nowrap;

    /* IMPORTANT: prevents layout movement */
    height: auto;
    width: auto;
    line-height: 1;

    /* Infinite premium animation */
    animation: nirfMasterGlow 3s ease-in-out infinite;
}

/* =========================
   TROPHY
========================= */

.nirf-trophy {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 22px;
    height: 22px;

    animation: trophyFloat 2.4s ease-in-out infinite;
}

.nirf-trophy i {
    position: relative;
    z-index: 2;

    font-size: 18px;

    animation: trophyGlow 2s ease-in-out infinite;
}

/* Golden prestige ring */

.nirf-trophy::before {
    content: "";
    position: absolute;

    width: 22px;
    height: 22px;

    border: 1px solid rgba(244,180,0,.45);
    border-radius: 50%;

    animation: trophyRing 2.5s ease-out infinite;
}

/* =========================
   TEXT
========================= */

.nirf-text {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 5px;

    overflow: hidden;
}

/* Moving golden highlight */

.nirf-text::after {
    content: "";

    position: absolute;
    top: 0;
    left: -80%;

    width: 45%;
    height: 100%;

    background: linear-gradient(
        110deg,
        transparent,
        rgba(255,255,255,.65),
        transparent
    );

    transform: skewX(-20deg);

    animation: textShimmer 3.8s linear infinite;
}

/* Rank number emphasis */

.nirf-number {
    font-weight: 800;

    text-shadow:
        0 0 4px rgba(244,180,0,.35),
        0 0 10px rgba(244,180,0,.12);

    animation: numberGlow 2.8s ease-in-out infinite;
}

/* =========================
   SPARKLES
========================= */

.nirf-spark {
    position: absolute;

    color: #ffe9a3;
    pointer-events: none;

    opacity: 0;

    text-shadow:
        0 0 5px rgba(255,215,80,.9),
        0 0 12px rgba(244,180,0,.6);
}

.spark-1 {
    top: -8px;
    left: 18px;

    animation: sparkleOne 3s ease-in-out infinite;
}

.spark-2 {
    bottom: -8px;
    left: 65%;

    animation: sparkleTwo 3.5s ease-in-out infinite;
}

.spark-3 {
    top: -6px;
    right: 3px;

    animation: sparkleThree 4s ease-in-out infinite;
}

/* =========================
   MASTER GLOW
========================= */

@keyframes nirfMasterGlow {

    0%, 100% {
        filter: brightness(1);

        text-shadow:
            0 0 2px rgba(244,180,0,.15);
    }

    50% {
        filter: brightness(1.13);

        text-shadow:
            0 0 5px rgba(244,180,0,.45),
            0 0 14px rgba(244,180,0,.20);
    }
}

/* =========================
   TROPHY FLOAT
========================= */

@keyframes trophyFloat {

    0%, 100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-2px);
    }
}

/* =========================
   TROPHY GLOW
========================= */

@keyframes trophyGlow {

    0%, 100% {
        filter:
            drop-shadow(0 0 0 rgba(244,180,0,0));
    }

    50% {
        filter:
            drop-shadow(0 0 5px rgba(244,180,0,.8))
            drop-shadow(0 0 10px rgba(244,180,0,.35));
    }
}

/* =========================
   TROPHY RING
========================= */

@keyframes trophyRing {

    0% {
        transform: scale(.7);
        opacity: .8;
    }

    70% {
        transform: scale(1.35);
        opacity: 0;
    }

    100% {
        transform: scale(1.35);
        opacity: 0;
    }
}

/* =========================
   TEXT SHIMMER
========================= */

@keyframes textShimmer {

    0% {
        left: -80%;
    }

    45%, 100% {
        left: 130%;
    }
}

/* =========================
   NUMBER GLOW
========================= */

@keyframes numberGlow {

    0%, 100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.04);
    }
}

/* =========================
   SPARKLE ANIMATIONS
========================= */

@keyframes sparkleOne {

    0%, 65%, 100% {
        opacity: 0;
        transform: scale(.4) rotate(0deg);
    }

    72% {
        opacity: 1;
        transform: scale(1.2) rotate(90deg);
    }

    82% {
        opacity: 0;
        transform: scale(.4) rotate(180deg);
    }
}

@keyframes sparkleTwo {

    0%, 55%, 100% {
        opacity: 0;
        transform: scale(.3) rotate(0deg);
    }

    65% {
        opacity: 1;
        transform: scale(1.1) rotate(90deg);
    }

    75% {
        opacity: 0;
        transform: scale(.3) rotate(180deg);
    }
}

@keyframes sparkleThree {

    0%, 70%, 100% {
        opacity: 0;
        transform: scale(.3);
    }

    78% {
        opacity: 1;
        transform: scale(1.2);
    }

    88% {
        opacity: 0;
        transform: scale(.3);
    }
}