/* ================================================================
   JALEXSI Profile Cosmetics Renderer v1
   ================================================================ */

.profile-cosmetic-background {
    position: absolute;
    inset: 0;
    z-index: 0;

    overflow: hidden;
    pointer-events: none;
}

.profile-cosmetic-background img {
    width: 100%;
    height: 100%;

    display: block;
    object-fit: cover;
    object-position: center;
}

.player-profile-hero
> .profile-cosmetic-background img {
    opacity: .60;
    filter: saturate(.94) contrast(1.04);
}

.player-profile-hero
> .profile-cosmetic-background::after {
    content: "";
    position: absolute;
    inset: 0;

    background:
        linear-gradient(
            90deg,
            rgba(4, 6, 13, .28),
            rgba(4, 6, 13, .70) 58%,
            rgba(4, 6, 13, .88)
        ),
        linear-gradient(
            0deg,
            rgba(4, 6, 13, .72),
            transparent 62%
        );
}

.player-profile-hero.has-profile-cosmetics-background::before {
    z-index: 1;

    background:
        radial-gradient(
            circle at 84% -10%,
            rgba(84, 105, 255, .20),
            transparent 40%
        );
}

.player-profile-hero.has-profile-cosmetics-background
.player-profile-hero__ambient {
    z-index: 1;
    opacity: .72;
}

.profile-cosmetic-avatar {
    --profile-cosmetic-rarity: #8e3cff;

    position: relative;
    z-index: 2;

    flex: 0 0 auto;
    isolation: isolate;
}

.profile-cosmetic-avatar--public {
    width: 124px;
    height: 124px;
}

.profile-cosmetic-avatar--compact {
    width: 68px;
    height: 68px;
}

.profile-cosmetic-avatar__base {
    position: absolute;
    inset: 6px;
    z-index: 1;

    overflow: hidden;

    display: grid;
    place-items: center;

    border: 1px solid rgba(160, 101, 255, .58);
    border-color:
        color-mix(
            in srgb,
            var(--profile-cosmetic-rarity) 62%,
            rgba(255, 255, 255, .16)
        );

    border-radius: 20px;

    color: #fff;
    background:
        linear-gradient(
            135deg,
            #7041e7,
            #9e5bff
        );

    box-shadow:
        0 0 0 4px rgba(6, 9, 18, .82),
        0 0 30px rgba(142, 60, 255, .24);

    box-shadow:
        0 0 0 4px rgba(6, 9, 18, .82),
        0 0 30px
        color-mix(
            in srgb,
            var(--profile-cosmetic-rarity) 24%,
            transparent
        );
}

.profile-cosmetic-avatar--compact
.profile-cosmetic-avatar__base {
    inset: 5px;
    border-radius: 13px;
}

.profile-cosmetic-avatar__base img {
    width: 100%;
    height: 100%;

    display: block;
    object-fit: cover;
}

.profile-cosmetic-avatar__base > span {
    font-size: 42px;
    font-weight: 900;
}

.profile-cosmetic-avatar--compact
.profile-cosmetic-avatar__base > span {
    font-size: 22px;
}

.profile-cosmetic-avatar__frame {
    position: absolute;
    inset: -2px;
    z-index: 3;

    width: calc(100% + 4px);
    height: calc(100% + 4px);

    display: block;
    object-fit: contain;

    pointer-events: none;

    filter:
        drop-shadow(
            0 0 11px
            rgba(142, 60, 255, .42)
        );

    filter:
        drop-shadow(
            0 0 11px
            color-mix(
                in srgb,
                var(--profile-cosmetic-rarity) 44%,
                transparent
            )
        );
}

.player-profile-name-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.player-profile-name-row h1 {
    margin: 5px 0 0;
}

.profile-cosmetic-badge {
    --profile-cosmetic-rarity: #8e3cff;

    max-width: 190px;
    min-height: 28px;
    padding: 4px 8px 4px 5px;

    display: inline-flex;
    align-items: center;
    gap: 6px;

    overflow: hidden;

    border: 1px solid rgba(142, 60, 255, .48);
    border-color:
        color-mix(
            in srgb,
            var(--profile-cosmetic-rarity) 52%,
            rgba(255, 255, 255, .08)
        );

    border-radius: 999px;

    color: #c9a9ff;
    color:
        color-mix(
            in srgb,
            var(--profile-cosmetic-rarity) 48%,
            #fff
        );

    background: rgba(5, 8, 16, .78);

    box-shadow: 0 0 18px rgba(142, 60, 255, .18);
    box-shadow:
        0 0 18px
        color-mix(
            in srgb,
            var(--profile-cosmetic-rarity) 18%,
            transparent
        );

    font-size: 7px;
    font-weight: 850;
    white-space: nowrap;
}

.profile-cosmetic-badge img,
.profile-cosmetic-badge i {
    width: 18px;
    height: 18px;

    flex: 0 0 18px;

    display: grid;
    place-items: center;

    object-fit: contain;
    border-radius: 50%;
}

.profile-cosmetic-badge i {
    color: var(--profile-cosmetic-rarity);
    font-size: 9px;
    font-style: normal;
}

.profile-cosmetic-badge > span {
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Public profile equipment */

.player-showcase-grid {
    grid-template-columns:
        repeat(
            auto-fit,
            minmax(125px, 1fr)
        );
}

.player-showcase-slot {
    --profile-cosmetic-rarity: #8e3cff;

    position: relative;
    overflow: hidden;

    aspect-ratio: auto;
    min-height: 154px;
    padding: 10px;

    display: flex;
    align-items: stretch;
    justify-content: flex-end;
    flex-direction: column;
    gap: 4px;
}

.player-showcase-slot.is-equipped {
    border-style: solid;
    border-color: rgba(142, 60, 255, .34);
    border-color:
        color-mix(
            in srgb,
            var(--profile-cosmetic-rarity) 35%,
            rgba(255, 255, 255, .05)
        );

    background:
        radial-gradient(
            circle at 50% 16%,
            rgba(142, 60, 255, .16),
            transparent 56%
        ),
        rgba(4, 7, 15, .70);

    background:
        radial-gradient(
            circle at 50% 16%,
            color-mix(
                in srgb,
                var(--profile-cosmetic-rarity) 17%,
                transparent
            ),
            transparent 56%
        ),
        rgba(4, 7, 15, .70);
}

.player-showcase-slot.is-equipped::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;

    height: 2px;

    background: var(--profile-cosmetic-rarity);
    box-shadow:
        0 0 11px
        var(--profile-cosmetic-rarity);
}

.player-showcase-slot__preview {
    min-height: 88px;
    margin-bottom: 3px;

    display: grid;
    place-items: center;
}

.player-showcase-slot__preview img {
    width: 100%;
    height: 88px;

    display: block;
    object-fit: contain;
}

.player-showcase-slot__preview > span {
    color: #7c54b4;
    font-size: 24px;
}

.player-showcase-slot strong {
    overflow: hidden;

    color: #c8cddd;

    font-size: 8px;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.player-showcase-slot small {
    overflow: hidden;

    color: #69738b;

    font-size: 6px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.player-showcase-slot.is-equipped small {
    color: #8f79b6;
    color:
        color-mix(
            in srgb,
            var(--profile-cosmetic-rarity) 52%,
            #8d96aa
        );
}

/* Account profile preview */

.account-style-preview__mock.profile-cosmetic-preview {
    position: relative;
    overflow: hidden;

    min-height: 142px;
    padding: 18px;

    display: block;
    isolation: isolate;
}

.profile-cosmetic-preview
> .profile-cosmetic-background img {
    opacity: .58;
    filter: saturate(.92) contrast(1.05);
}

.profile-cosmetic-preview::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;

    pointer-events: none;

    background:
        linear-gradient(
            90deg,
            rgba(4, 7, 15, .34),
            rgba(4, 7, 15, .88)
        );
}

.profile-cosmetic-preview__content {
    position: relative;
    z-index: 2;

    min-height: 106px;

    display: flex;
    align-items: center;
    gap: 13px;
}

.profile-cosmetic-preview__identity {
    min-width: 0;

    display: grid;
    gap: 8px;
}

.account-style-preview__mock
.profile-cosmetic-preview__identity > div {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 7px;
}

.account-style-preview__mock
.profile-cosmetic-preview__identity strong {
    overflow-wrap: anywhere;
    font-size: 12px;
}

.account-style-preview__mock
.profile-cosmetic-preview__identity > span {
    color: #929bb0;
    font-size: 7px;
}

.account-style-preview__mock
.profile-cosmetic-badge {
    max-width: 140px;
    min-height: 24px;
}

.account-style-preview__mock
.profile-cosmetic-badge img,
.account-style-preview__mock
.profile-cosmetic-badge i {
    width: 15px;
    height: 15px;
    flex-basis: 15px;
}

.account-cosmetic-slots {
    margin-top: 10px;

    display: grid;
    grid-template-columns:
        repeat(2, minmax(0, 1fr));
    gap: 6px;
}

.account-cosmetic-slots > div {
    min-width: 0;
    min-height: 42px;
    padding: 8px 9px;

    display: grid;
    align-content: center;
    gap: 3px;

    border:
        1px solid rgba(255, 255, 255, .045);

    border-radius: 7px;

    background: rgba(4, 7, 15, .54);
}

.account-cosmetic-slots > div.is-equipped {
    border-color: rgba(142, 60, 255, .23);
    background: rgba(113, 55, 208, .065);
}

.account-cosmetic-slots span {
    color: #626c84;
    font-size: 6px;
}

.account-cosmetic-slots strong {
    overflow: hidden;

    color: #7f899f;

    font-size: 7px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.account-cosmetic-slots
> div.is-equipped strong {
    color: #c0c6d5;
}

.account-cosmetic-manage {
    width: fit-content;
    margin-top: 13px;
}

@media (max-width: 780px) {
    .profile-cosmetic-avatar--public {
        width: 112px;
        height: 112px;
    }

    .player-profile-name-row {
        align-items: flex-start;
        flex-direction: column;
        gap: 7px;
    }
}

@media (max-width: 520px) {
    .profile-cosmetic-avatar--public {
        width: 96px;
        height: 96px;
    }

    .profile-cosmetic-avatar--public
    .profile-cosmetic-avatar__base > span {
        font-size: 32px;
    }

    .account-cosmetic-slots {
        grid-template-columns: 1fr;
    }

    .profile-cosmetic-preview__content {
        align-items: flex-start;
        flex-direction: column;
    }

    .account-cosmetic-manage {
        width: 100%;
        justify-content: center;
    }
}
