/* ==========================================================
   COMMUNITY RANKING
   ========================================================== */

.ranking-page {
    padding:
        clamp(28px, 5vw, 56px)
        0
        20px;
}


/* ==========================================================
   HERO
   ========================================================== */

.ranking-hero {
    position: relative;
    overflow: hidden;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 40px;

    margin-bottom:
        clamp(26px, 4vw, 38px);

    padding:
        clamp(28px, 5vw, 52px);

    border-radius: var(--radius-xl);

    color: #ffffff;

    background:
        linear-gradient(
            135deg,
            #022d59 0%,
            #075ca5 58%,
            #1388da 100%
        );

    box-shadow: var(--shadow-md);
}

.ranking-hero::before {
    content: "";

    position: absolute;

    width: 280px;
    height: 280px;

    top: -120px;
    right: 90px;

    border-radius: 50%;

    background:
        rgba(
            255,
            255,
            255,
            0.07
        );
}

.ranking-hero::after {
    content: "";

    position: absolute;

    width: 220px;
    height: 220px;

    right: -70px;
    bottom: -120px;

    border-radius: 50%;

    background:
        rgba(
            255,
            211,
            54,
            0.13
        );
}

.ranking-hero-copy {
    position: relative;
    z-index: 2;

    max-width: 720px;
}

.ranking-eyebrow {
    display: inline-flex;
    align-items: center;

    margin-bottom: 15px;

    padding: 7px 12px;

    border-radius: 999px;

    background:
        rgba(
            255,
            255,
            255,
            0.12
        );

    color: #ffffff;

    font-size: 0.82rem;
    font-weight: 800;

    letter-spacing: 0.03em;
}

.ranking-hero h1 {
    max-width: 700px;

    margin-bottom: 16px;

    color: #ffffff;
}

.ranking-hero h1 span {
    color: #ffd336;
}

.ranking-hero p {
    max-width: 660px;

    margin-bottom: 0;

    color:
        rgba(
            255,
            255,
            255,
            0.82
        );

    font-size: 1.02rem;
    line-height: 1.7;
}

.ranking-hero-icon {
    position: relative;
    z-index: 2;

    flex-shrink: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    width:
        clamp(
            110px,
            13vw,
            160px
        );

    height:
        clamp(
            110px,
            13vw,
            160px
        );

    border:
        1px solid
        rgba(
            255,
            255,
            255,
            0.20
        );

    border-radius: 36px;

    background:
        rgba(
            255,
            255,
            255,
            0.10
        );

    box-shadow:
        inset
        0 1px 0
        rgba(
            255,
            255,
            255,
            0.16
        );

    font-size:
        clamp(
            4rem,
            8vw,
            6rem
        );

    transform: rotate(4deg);
}


/* ==========================================================
   POINT RULES
   ========================================================== */

.ranking-rules {
    width: min(
        100%,
        760px
    );

    margin:
        0 auto
        clamp(34px, 5vw, 48px);
}

.ranking-rules .card-body {
    padding: 18px;
}

.ranking-rules-items {
    display: grid;

    grid-template-columns:
        repeat(
            2,
            minmax(0, 1fr)
        );

    gap: 14px;
}

.ranking-rule {
    min-width: 0;

    display: flex;
    align-items: center;

    gap: 13px;

    padding: 14px 16px;

    border:
        1px solid
        #e1e8ef;

    border-radius: var(--radius-md);

    background:
        linear-gradient(
            135deg,
            #f8fbff 0%,
            #eef6fd 100%
        );
}

.ranking-rule-icon {
    flex-shrink: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    width: 44px;
    height: 44px;

    border-radius: 13px;

    background: #ffffff;

    font-size: 1.45rem;

    box-shadow:
        0 3px 9px
        rgba(
            3,
            58,
            105,
            0.08
        );
}

.ranking-rule > div {
    min-width: 0;

    display: flex;
    flex-direction: column;

    gap: 2px;
}

.ranking-rule strong {
    color: #075ca5;

    font-size: 1rem;
    font-weight: 900;
}

.ranking-rule span:not(.ranking-rule-icon) {
    color: var(--color-text-soft);

    font-size: 0.8rem;
}


/* ==========================================================
   USER POSITION
   ========================================================== */

.ranking-user-position {
    width: min(
        100%,
        900px
    );

    margin:
        0 auto
        clamp(34px, 5vw, 48px);
}

.ranking-user-card {
    overflow: hidden;

    border-top:
        4px solid
        #1687e9;

    background:
        linear-gradient(
            135deg,
            #ffffff 0%,
            #f2f8ff 100%
        );
}

.ranking-user-label {
    margin-bottom: 13px;

    color: #075ca5;

    font-size: 0.76rem;
    font-weight: 900;

    letter-spacing: 0.07em;

    text-transform: uppercase;
}

.ranking-user-content {
    display: grid;

    grid-template-columns:
        58px
        52px
        minmax(0, 1fr)
        auto;

    align-items: center;

    gap: 14px;
}

.ranking-user-rank {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 52px;
    height: 52px;

    border-radius: 50%;

    background: #e8f3ff;

    color: #075ca5;

    font-size: 1.05rem;
    font-weight: 900;
}

.ranking-user-info {
    min-width: 0;

    display: flex;
    flex-direction: column;

    gap: 3px;
}

.ranking-user-info strong {
    overflow: hidden;

    color: var(--color-text);

    font-size: 1rem;
    font-weight: 900;

    text-overflow: ellipsis;
    white-space: nowrap;
}

.ranking-user-info span {
    color: var(--color-text-soft);

    font-size: 0.78rem;
}

.ranking-user-points {
    min-width: 72px;

    display: flex;
    flex-direction: column;
    align-items: flex-end;

    gap: 1px;

    text-align: right;
}

.ranking-user-points strong {
    color: #075ca5;

    font-size: 1.4rem;
    font-weight: 900;
}

.ranking-user-points span {
    color: var(--color-text-soft);

    font-size: 0.7rem;
    font-weight: 700;
}


/* ==========================================================
   SECTION
   ========================================================== */

.ranking-section {
    width: min(
        100%,
        900px
    );

    margin:
        0 auto
        46px;
}

.ranking-section-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;

    gap: 30px;

    margin-bottom: 24px;
}

.ranking-section-heading h2 {
    margin-bottom: 8px;
}

.ranking-section-heading p {
    max-width: 680px;

    margin-bottom: 0;

    color: var(--color-text-soft);
}

.ranking-section-kicker {
    display: block;

    margin-bottom: 7px;

    color: #075ca5;

    font-size: 0.78rem;
    font-weight: 900;

    letter-spacing: 0.07em;

    text-transform: uppercase;
}

.ranking-count {
    flex-shrink: 0;

    display: flex;
    align-items: center;

    gap: 8px;

    padding: 10px 14px;

    border:
        1px solid
        var(--color-border);

    border-radius: 999px;

    background: var(--color-surface);
}

.ranking-count strong {
    color: #075ca5;

    font-size: 1.05rem;
}

.ranking-count span {
    color: var(--color-text-soft);

    font-size: 0.82rem;
    font-weight: 700;
}


/* ==========================================================
   RANKING LIST
   ========================================================== */

.ranking-list {
    display: flex;
    flex-direction: column;

    gap: 10px;
}


/* ==========================================================
   RANKING ROW
   ========================================================== */

.ranking-row {
    overflow: hidden;

    transition:
        transform var(--transition),
        box-shadow var(--transition);
}

.ranking-row:hover {
    transform: translateY(-2px);

    box-shadow: var(--shadow-md);
}

.ranking-row .card-body {
    display: grid;

    grid-template-columns:
        58px
        52px
        minmax(0, 1fr)
        auto;

    align-items: center;

    gap: 14px;

    padding:
        14px
        18px;
}


/* ==========================================================
   POSITION
   ========================================================== */

.ranking-position {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 48px;
    height: 48px;

    border-radius: 50%;

    background: #f1f5f8;

    color: #075ca5;

    font-size: 1rem;
    font-weight: 900;
}


/* ==========================================================
   AVATAR
   ========================================================== */

.ranking-avatar {
    display: block;

    width: 48px;
    height: 48px;

    object-fit: cover;

    border:
        2px solid
        #ffffff;

    border-radius: 50%;

    background: #edf3f8;

    box-shadow:
        0 2px 8px
        rgba(
            0,
            0,
            0,
            0.10
        );
}


/* ==========================================================
   PLAYER
   ========================================================== */

.ranking-player {
    min-width: 0;

    display: flex;
    flex-direction: column;

    gap: 3px;
}

.ranking-player strong {
    overflow: hidden;

    color: var(--color-text);

    font-size: 0.96rem;
    font-weight: 900;

    text-overflow: ellipsis;
    white-space: nowrap;
}

.ranking-player span {
    color: var(--color-text-soft);

    font-size: 0.76rem;
}


/* ==========================================================
   POINTS
   ========================================================== */

.ranking-points {
    min-width: 72px;

    display: flex;
    flex-direction: column;
    align-items: flex-end;

    gap: 1px;

    text-align: right;
}

.ranking-points strong {
    color: #075ca5;

    font-size: 1.25rem;
    font-weight: 900;
}

.ranking-points span {
    color: var(--color-text-soft);

    font-size: 0.68rem;
    font-weight: 700;
}


/* ==========================================================
   PODIUM
   ========================================================== */

.ranking-row-podium {
    position: relative;
}

.ranking-row-1 {
    border-left:
        4px solid
        #e4b313;

    background:
        linear-gradient(
            135deg,
            #ffffff 0%,
            #fff9df 100%
        );
}

.ranking-row-2 {
    border-left:
        4px solid
        #a9b3bd;

    background:
        linear-gradient(
            135deg,
            #ffffff 0%,
            #f4f6f8 100%
        );
}

.ranking-row-3 {
    border-left:
        4px solid
        #bd7844;

    background:
        linear-gradient(
            135deg,
            #ffffff 0%,
            #fff3eb 100%
        );
}

.ranking-row-1 .ranking-position {
    background: #fff1ad;
}

.ranking-row-2 .ranking-position {
    background: #e8edf1;
}

.ranking-row-3 .ranking-position {
    background: #f6dfcf;
}


/* ==========================================================
   FULL RANKING ACTION
   ========================================================== */

.ranking-full-action {
    display: flex;
    justify-content: center;

    margin-top: 24px;
}


/* ==========================================================
   FULL RANKING
   ========================================================== */

.ranking-full-section {
    padding-top: 8px;
}


/* ==========================================================
   PAGINATION
   ========================================================== */

.ranking-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;

    gap: 7px;

    margin-top: 26px;
}

.ranking-page-link {
    min-width: 40px;
    height: 40px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding:
        0
        10px;

    border:
        1px solid
        var(--color-border);

    border-radius: 11px;

    background: #ffffff;

    color: #075ca5;

    font-size: 0.86rem;
    font-weight: 900;

    transition:
        transform var(--transition),
        background var(--transition),
        color var(--transition),
        border-color var(--transition);
}

.ranking-page-link:hover {
    transform: translateY(-1px);

    border-color: #1687e9;

    background: #eaf4ff;
}

.ranking-page-link.active {
    border-color: #075ca5;

    background: #075ca5;

    color: #ffffff;
}


/* ==========================================================
   EMPTY STATE
   ========================================================== */

.ranking-empty {
    max-width: 760px;

    margin:
        20px auto
        0;

    text-align: center;
}

.ranking-empty .card-body {
    padding:
        clamp(
            32px,
            6vw,
            58px
        );
}

.ranking-empty-icon {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 84px;
    height: 84px;

    margin:
        0 auto
        20px;

    border-radius: 24px;

    background:
        linear-gradient(
            145deg,
            #fff8d9 0%,
            #ffefad 100%
        );

    font-size: 3rem;
}

.ranking-empty h2 {
    margin-bottom: 10px;
}

.ranking-empty p {
    max-width: 570px;

    margin:
        0 auto
        24px;

    color: var(--color-text-soft);

    line-height: 1.65;
}


/* ==========================================================
   RESPONSIVE - SMALL TABLET
   ========================================================== */

@media (max-width: 760px) {

    .ranking-hero {
        align-items: flex-start;

        padding: 30px;
    }

    .ranking-hero-icon {
        width: 100px;
        height: 100px;

        border-radius: 26px;

        font-size: 3.8rem;
    }

    .ranking-section-heading {
        align-items: flex-start;

        flex-direction: column;

        gap: 16px;
    }

}


/* ==========================================================
   RESPONSIVE - MOBILE
   ========================================================== */

@media (max-width: 640px) {

    .ranking-page {
        padding-top: 22px;
    }

    .ranking-hero {
        display: block;

        padding:
            26px
            22px;

        border-radius: var(--radius-lg);
    }

    .ranking-hero-icon {
        display: none;
    }

    .ranking-hero p {
        font-size: 0.95rem;
    }

    .ranking-rules-items {
        grid-template-columns: 1fr;
    }

    .ranking-row .card-body,
    .ranking-user-content {
        grid-template-columns:
            44px
            42px
            minmax(0, 1fr)
            auto;

        gap: 9px;
    }

    .ranking-position {
        width: 40px;
        height: 40px;

        font-size: 0.86rem;
    }

    .ranking-user-rank {
        width: 40px;
        height: 40px;

        font-size: 0.86rem;
    }

    .ranking-avatar {
        width: 40px;
        height: 40px;
    }

    .ranking-player strong,
    .ranking-user-info strong {
        font-size: 0.88rem;
    }

    .ranking-points,
    .ranking-user-points {
        min-width: 58px;
    }

    .ranking-points strong,
    .ranking-user-points strong {
        font-size: 1.05rem;
    }

}


/* ==========================================================
   RESPONSIVE - SMALL MOBILE
   ========================================================== */

@media (max-width: 420px) {

    .ranking-hero {
        padding:
            23px
            18px;
    }

    .ranking-eyebrow {
        font-size: 0.74rem;
    }

    .ranking-count {
        width: 100%;

        justify-content: center;
    }

    .ranking-row .card-body,
    .ranking-user-content {
        grid-template-columns:
            38px
            36px
            minmax(0, 1fr);

        align-items: center;
    }

    .ranking-position,
    .ranking-user-rank {
        width: 34px;
        height: 34px;

        font-size: 0.78rem;
    }

    .ranking-avatar {
        width: 34px;
        height: 34px;
    }

    .ranking-points,
    .ranking-user-points {
        grid-column:
            2 / -1;

        align-items: flex-start;

        margin-top: -2px;

        text-align: left;
    }

    .ranking-points,
    .ranking-user-points {
        flex-direction: row;
        align-items: baseline;

        gap: 5px;
    }

    .ranking-player span,
    .ranking-user-info span {
        font-size: 0.7rem;
    }

}


/* ==========================================================
   REDUCED MOTION
   ========================================================== */

@media (prefers-reduced-motion: reduce) {

    .ranking-row,
    .ranking-page-link {
        transition: none;
    }

}