:root {
    color-scheme: dark;

    --bg: #0d1117;
    --panel: #151b23;
    --panel-2: #111820;
    --panel-hover: #19232d;
    --line: #28323d;
    --line-soft: #202934;

    --text: #f4f7fa;
    --muted: #98a7b7;
    --faint: #70808f;

    --accent: #49c8ff;

    --green: #4ddd91;
    --gold: #ffd56a;

    --max: 1180px;
}


* {
    box-sizing: border-box;
}


html,
body {
    min-height: 100%;
    margin: 0;

    background: var(--bg);
    color: var(--text);

    font-family:
        Arial,
        Helvetica,
        sans-serif;
}


body {
    font-size: 16px;
    line-height: 1.45;
}


a {
    color: inherit;
    text-decoration: none;
}


button,
input {
    font: inherit;
}


button {
    color: inherit;
}


.site-header {
    position: sticky;
    top: 0;
    z-index: 50;

    border-bottom:
        1px solid
        var(--line);

    background:
        #0d1117;
}


.header-inner {
    width:
        min(
            calc(100% - 32px),
            var(--max)
        );

    min-height: 64px;

    margin: 0 auto;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 24px;
}


.brand {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: .7px;
}


.brand span {
    color: var(--accent);
}


.nav {
    display: flex;
    align-items: center;
    gap: 6px;
}


.nav a {
    padding: 9px 12px;

    border-radius: 8px;

    color: var(--muted);

    font-size: 14px;
    font-weight: 700;
}


.nav a:hover,
.nav a.active {
    color: var(--text);
    background: #1b242e;
}


.page {
    width:
        min(
            calc(100% - 32px),
            var(--max)
        );

    margin: 0 auto;

    padding:
        42px 0
        72px;
}


.loading-shell {
    padding:
        90px 20px;

    color: var(--muted);

    text-align: center;
}


.profile-hero {
    position: relative;

    min-height: 245px;

    display: flex;
    align-items: flex-end;
    justify-content: space-between;

    gap: 32px;

    padding: 34px;

    overflow: hidden;

    border:
        1px solid
        var(--line);

    border-radius: 18px;

    background:
        var(--panel);
}


.identity {
    min-width: 0;

    display: flex;
    align-items: center;

    gap: 22px;
}


.avatar {
    width: 116px;
    height: 116px;

    flex: 0 0 auto;

    overflow: hidden;

    display: grid;
    place-items: center;

    border:
        2px solid
        var(--line);

    border-radius: 14px;

    background:
        #0b1015;

    color: var(--accent);

    font-size: 34px;
    font-weight: 800;
}


.avatar img {
    width: 100%;
    height: 100%;

    display: block;

    object-fit: cover;
}


.identity-copy {
    min-width: 0;
}


.identity-line {
    display: flex;
    align-items: center;

    flex-wrap: wrap;

    gap: 10px;
}


.profile-name {
    margin: 0;

    overflow: hidden;

    font-size:
        clamp(
            34px,
            5vw,
            52px
        );

    line-height: 1;

    letter-spacing: -1.6px;

    white-space: nowrap;
    text-overflow: ellipsis;
}


.claimed {
    padding:
        5px 8px;

    border:
        1px solid
        #315b70;

    border-radius: 6px;

    color: var(--accent);

    font-size: 10px;
    font-weight: 800;

    letter-spacing: .7px;

    text-transform: uppercase;
}


.profile-login {
    margin-top: 8px;

    color: var(--muted);

    font-size: 15px;
}


.profile-headline {
    max-width: 620px;

    margin-top: 11px;

    color: #d5dde4;

    font-size: 16px;
}


.profile-bio {
    max-width: 620px;

    margin:
        8px 0 0;

    color: var(--muted);

    font-size: 14px;
}


.rank-block {
    min-width: 180px;

    flex: 0 0 auto;

    text-align: right;
}


.rank-label {
    color: var(--faint);

    font-size: 11px;
    font-weight: 800;

    letter-spacing: .8px;

    text-transform: uppercase;
}


.rank-number {
    margin-top: 3px;

    color: var(--accent);

    font-size:
        clamp(
            42px,
            7vw,
            68px
        );

    font-weight: 800;

    line-height: 1;
}


.rank-copy {
    margin-top: 6px;

    color: var(--muted);

    font-size: 12px;
}


.owner-actions {
    display: flex;
    flex-wrap: wrap;

    gap: 8px;

    margin-top: 14px;
}


.action {
    min-height: 38px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding:
        0 14px;

    border:
        1px solid
        var(--line);

    border-radius: 8px;

    background:
        #1a242e;

    color: var(--text);

    font-size: 13px;
    font-weight: 800;

    cursor: pointer;
}


.action.primary {
    border-color: #326c87;

    color: var(--accent);
}


.action:hover {
    background: #202d38;
}


.profile-stats {
    display: grid;

    grid-template-columns:
        repeat(
            4,
            minmax(0,1fr)
        );

    margin-top: 14px;

    overflow: hidden;

    border:
        1px solid
        var(--line);

    border-radius: 14px;

    background:
        var(--panel);
}


.stat {
    min-width: 0;

    padding:
        19px 20px;

    border-right:
        1px solid
        var(--line-soft);
}


.stat:last-child {
    border-right: 0;
}


.stat-value {
    display: block;

    font-size: 24px;
    font-weight: 800;
}


.stat-label {
    display: block;

    margin-top: 5px;

    color: var(--muted);

    font-size: 11px;
    font-weight: 700;

    letter-spacing: .45px;

    text-transform: uppercase;
}


.profile-tabs {
    display: flex;

    gap: 4px;

    margin-top: 28px;

    overflow-x: auto;

    border-bottom:
        1px solid
        var(--line);
}


.profile-tab {
    flex: 0 0 auto;

    min-height: 45px;

    padding:
        0 17px;

    border: 0;
    border-bottom:
        2px solid
        transparent;

    background:
        transparent;

    color: var(--muted);

    font-size: 14px;
    font-weight: 800;

    cursor: pointer;
}


.profile-tab:hover {
    color: var(--text);
}


.profile-tab.active {
    border-bottom-color:
        var(--accent);

    color: var(--text);
}


.profile-pane {
    display: none;

    padding-top: 24px;
}


.profile-pane.active {
    display: block;
}


.section {
    margin-bottom: 28px;
}


.section-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;

    gap: 16px;

    margin-bottom: 12px;
}


.section-title {
    margin: 0;

    font-size: 22px;
    line-height: 1.1;

    letter-spacing: -.4px;
}


.section-subtitle {
    margin:
        5px 0 0;

    color: var(--muted);

    font-size: 13px;
}


.section-count {
    color: var(--faint);

    font-size: 12px;
}


.spotlight-grid {
    display: grid;

    grid-template-columns:
        repeat(
            2,
            minmax(0,1fr)
        );

    gap: 14px;
}


.spotlight {
    min-height: 150px;

    display: flex;
    align-items: center;

    gap: 18px;

    padding: 18px;

    border:
        1px solid
        var(--line);

    border-radius: 14px;

    background:
        var(--panel);
}


.spotlight-art {
    width: 96px;
    height: 96px;

    flex: 0 0 auto;

    display: grid;
    place-items: center;

    overflow: hidden;

    border-radius: 10px;

    background: #0b1015;
}


.spotlight-art img {
    width: 100%;
    height: 100%;

    object-fit: contain;

    padding: 7px;
}


.spotlight-label {
    color: var(--accent);

    font-size: 10px;
    font-weight: 800;

    letter-spacing: .7px;

    text-transform: uppercase;
}


.spotlight-title {
    margin-top: 5px;

    font-size: 18px;
    font-weight: 800;
}


.spotlight-meta {
    margin-top: 7px;

    color: var(--muted);

    font-size: 12px;
}


.badge-grid {
    display: grid;

    grid-template-columns:
        repeat(
            6,
            minmax(0,1fr)
        );

    gap: 10px;
}


.badge-card {
    min-width: 0;

    padding: 11px;

    border:
        1px solid
        var(--line-soft);

    border-radius: 12px;

    background:
        var(--panel);
}


.badge-card:hover {
    border-color: #3c4c5c;

    background:
        var(--panel-hover);
}


.badge-art {
    aspect-ratio: 1/1;

    display: grid;
    place-items: center;

    overflow: hidden;

    border-radius: 9px;

    background:
        #0b1015;
}


.badge-art img {
    width: 100%;
    height: 100%;

    object-fit: contain;

    padding: 8px;
}


.badge-name {
    margin-top: 9px;

    overflow: hidden;

    color: #e7edf2;

    font-size: 12px;
    font-weight: 800;

    white-space: nowrap;
    text-overflow: ellipsis;
}


.badge-meta {
    margin-top: 3px;

    color: var(--faint);

    font-size: 10px;
}


.showcase {
    display: flex;

    flex-wrap: wrap;

    gap: 10px;
}


.showcase .badge-card {
    width: 138px;
}


.collection-grid,
.achievement-grid {
    display: grid;

    grid-template-columns:
        repeat(
            3,
            minmax(0,1fr)
        );

    gap: 12px;
}


.collection-card,
.achievement-card {
    min-width: 0;

    padding: 17px;

    border:
        1px solid
        var(--line);

    border-radius: 13px;

    background:
        var(--panel);
}


.collection-card:hover {
    background:
        var(--panel-hover);
}


.collection-title,
.achievement-title {
    font-size: 15px;
    font-weight: 800;
}


.collection-meta,
.achievement-meta {
    margin-top: 7px;

    color: var(--muted);

    font-size: 12px;
}


.progress-track {
    height: 5px;

    margin-top: 12px;

    overflow: hidden;

    border-radius: 999px;

    background:
        #26313c;
}


.progress-bar {
    height: 100%;

    border-radius: inherit;

    background:
        var(--accent);
}


.history-list {
    overflow: hidden;

    border:
        1px solid
        var(--line);

    border-radius: 13px;

    background:
        var(--panel);
}


.history-row {
    min-height: 50px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 16px;

    padding:
        10px 15px;

    border-bottom:
        1px solid
        var(--line-soft);

    font-size: 13px;
}


.history-row:last-child {
    border-bottom: 0;
}


.history-primary {
    font-weight: 800;
}


.history-secondary {
    color: var(--muted);
}


.empty-state {
    padding:
        42px 20px;

    border:
        1px solid
        var(--line);

    border-radius: 13px;

    background:
        var(--panel);

    color: var(--muted);

    text-align: center;
}


.private-profile,
.logged-out {
    max-width: 640px;

    margin:
        80px auto;

    padding:
        36px;

    border:
        1px solid
        var(--line);

    border-radius: 16px;

    background:
        var(--panel);

    text-align: center;
}


.private-profile h1,
.logged-out h1 {
    margin:
        0 0
        12px;

    font-size: 32px;
}


.private-profile p,
.logged-out p {
    margin:
        0 auto
        22px;

    max-width: 500px;

    color: var(--muted);
}


.error-state {
    padding:
        70px 20px;

    color: #ffaaaa;

    text-align: center;
}


@media (
    max-width:
    920px
) {

    .badge-grid {
        grid-template-columns:
            repeat(
                4,
                minmax(0,1fr)
            );
    }


    .collection-grid,
    .achievement-grid {
        grid-template-columns:
            repeat(
                2,
                minmax(0,1fr)
            );
    }
}


@media (
    max-width:
    720px
) {

    .header-inner {
        width:
            calc(
                100% - 22px
            );

        min-height: 58px;

        padding:
            9px 0;
    }


    .brand {
        font-size: 18px;
    }


    .nav {
        gap: 2px;
    }


    .nav a {
        padding:
            8px 7px;

        font-size: 12px;
    }


    .page {
        width:
            calc(
                100% - 22px
            );

        padding:
            28px 0
            52px;
    }


    .profile-hero {
        min-height: 0;

        align-items: flex-start;

        flex-direction: column;

        padding: 22px;
    }


    .identity {
        align-items: flex-start;

        gap: 14px;
    }


    .avatar {
        width: 76px;
        height: 76px;

        border-radius: 11px;

        font-size: 22px;
    }


    .profile-name {
        font-size: 30px;
    }


    .rank-block {
        min-width: 0;

        text-align: left;
    }


    .rank-number {
        font-size: 44px;
    }


    .profile-stats {
        grid-template-columns:
            repeat(
                2,
                minmax(0,1fr)
            );
    }


    .stat:nth-child(2) {
        border-right: 0;
    }


    .stat:nth-child(-n+2) {
        border-bottom:
            1px solid
            var(--line-soft);
    }


    .spotlight-grid {
        grid-template-columns: 1fr;
    }


    .badge-grid {
        grid-template-columns:
            repeat(
                3,
                minmax(0,1fr)
            );
    }


    .collection-grid,
    .achievement-grid {
        grid-template-columns: 1fr;
    }
}


@media (
    max-width:
    440px
) {

    .nav a:first-child {
        display: none;
    }


    .badge-grid {
        grid-template-columns:
            repeat(
                2,
                minmax(0,1fr)
            );
    }


    .profile-tab {
        padding:
            0 12px;

        font-size: 12px;
    }
}
