.leaderbord-page {
    position: relative;
    background-color: #08111f;
    background-image:
        linear-gradient(
            180deg,
            #050914 0%,
            #07101f 38%,
            #08111f 100%
        );
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
    overflow-x: hidden;
}

.leaderbord-page::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(ellipse at 18% 30%, rgba(180, 116, 255, 0.18), transparent 34%),
        radial-gradient(ellipse at 78% 22%, rgba(90, 190, 255, 0.13), transparent 30%),
        radial-gradient(ellipse at 58% 88%, rgba(116, 82, 255, 0.12), transparent 36%);
    filter: blur(20px);
    opacity: 0.75;
}

.leaderbord-page .page {
    display: flex;
    align-items: flex-start;
    position: relative;
    z-index: 1;
}

.leaderbord-main {
    margin-top: 18px;
}

.leaderbord-header {
    text-align: center;
    margin: 26px auto 34px;
    max-width: 820px;
}

.leaderbord-kicker {
    margin: 0 0 10px;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 2.4px;
    color: #a86cff;
    text-transform: uppercase;
}

.leaderbord-title {
    margin: 0 0 14px;
    font-size: 52px;
    font-weight: 900;
    line-height: 1.05;
    color: #f4f7ff;
    letter-spacing: -1px;
}

.leaderbord-subtitle {
    margin: 0;
    font-size: 17px;
    line-height: 1.6;
    color: #aeb8d6;
}

.leaderbord-explainer {
    margin: 0 auto 24px;
    padding: 18px 20px;
    border-radius: 16px;
    border: 1px solid rgba(126, 170, 255, 0.18);
    background: linear-gradient(180deg, rgba(10, 16, 33, 0.92), rgba(8, 14, 30, 0.86));
}

.leaderbord-explainer h2 {
    margin: 0 0 8px;
    color: #f4f7ff;
    font-size: 26px;
}

.leaderbord-explainer p {
    margin: 0;
    color: #bcc7e4;
    line-height: 1.6;
    font-size: 16px;
}

.leaderbord-explainer p + p {
    margin-top: 8px;
}

.leaderbord-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.leaderbord-overview-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(240px, 0.65fr);
    gap: 20px;
    margin-bottom: 24px;
}

.leaderbord-overview-card {
    position: relative;
    overflow: hidden;
    min-height: 168px;
    padding: 18px 18px 16px;
    border-radius: 20px;
    border: 1px solid rgba(126, 170, 255, 0.18);
    background: linear-gradient(180deg, rgba(10, 16, 33, 0.92), rgba(8, 14, 30, 0.86));
    box-shadow:
        0 14px 34px rgba(0, 0, 0, 0.24),
        0 0 0 1px rgba(120, 160, 255, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.leaderbord-overview-head {
    margin-bottom: 14px;
}

.leaderbord-overview-head h2 {
    margin: 0;
    color: #f4f7ff;
    font-size: 24px;
    font-weight: 900;
    letter-spacing: -0.5px;
}

.leaderbord-distribution-chart {
    --distribution-offset-top: 8px;
    --distribution-plot-height: 118px;
    --distribution-label-row: 18px;
    height: 144px;
    display: grid;
    grid-template-columns: 46px 1fr;
    gap: 10px;
    align-items: start;
}

.leaderbord-distribution-axis {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: calc(var(--distribution-plot-height) + var(--distribution-label-row));
    margin-top: var(--distribution-offset-top);
    padding-bottom: var(--distribution-label-row);
    color: #90a0c7;
    font-size: 12px;
    font-weight: 800;
}

.leaderbord-distribution-axis span {
    display: block;
    line-height: 1;
}

.leaderbord-distribution-bars {
    display: grid;
    gap: 10px;
    align-items: end;
    position: relative;
    margin-top: var(--distribution-offset-top);
    height: calc(var(--distribution-plot-height) + var(--distribution-label-row));
}

.leaderbord-distribution-bars::before {
    content: "";
    position: absolute;
    inset: 0 0 var(--distribution-label-row) 0;
    background: repeating-linear-gradient(
        to top,
        rgba(255, 255, 255, 0.00) 0,
        rgba(255, 255, 255, 0.00) 23%,
        rgba(126, 170, 255, 0.08) 24%,
        rgba(126, 170, 255, 0.08) 24.7%
    );
    pointer-events: none;
}

.leaderbord-distribution-item {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-rows: var(--distribution-plot-height) var(--distribution-label-row);
    align-items: center;
    gap: 8px;
    height: 100%;
    min-width: 0;
}

.leaderbord-distribution-bar-wrap {
    display: flex;
    align-items: end;
    width: 100%;
    height: var(--distribution-plot-height);
    min-height: 0;
}

.leaderbord-distribution-bar {
    width: 100%;
    min-height: 4px;
    border-radius: 10px 10px 4px 4px;
    background: linear-gradient(180deg, #9c74ff 0%, #6b5cff 100%);
    box-shadow:
        0 0 16px rgba(139, 92, 255, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.20);
}

.leaderbord-distribution-item-current .leaderbord-distribution-bar {
    background: linear-gradient(180deg, #ffc26b 0%, #ff9a3c 52%, #ff7a1a 100%);
    box-shadow:
        0 0 20px rgba(255, 162, 67, 0.30),
        0 0 30px rgba(255, 136, 26, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.30);
}

.leaderbord-distribution-label {
    color: #9da7ca;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.leaderbord-users-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.leaderbord-users-total {
    display: block;
    margin-bottom: 8px;
    color: #f4f7ff;
    font-size: 42px;
    font-weight: 900;
    line-height: 1;
    letter-spacing: -1px;
}

.leaderbord-users-growth {
    display: inline-block;
    color: #43d68f;
    font-size: 15px;
    font-weight: 800;
}

.leaderbord-users-sparkline {
    position: relative;
    height: 48px;
    margin-top: 18px;
}

.leaderbord-users-sparkline::before {
    content: "";
    position: absolute;
    inset: 2px 0 0;
    background-repeat: no-repeat;
    background-position: center;
    background-size: 100% 100%;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 220 48' preserveAspectRatio='none'%3E%3Cpath d='M4 39 C16 40 22 36 31 34 C40 32 48 36 58 30 C68 24 75 28 86 20 C95 13 104 16 114 11 C126 5 138 12 149 9 C161 6 170 11 182 5 C191 1 201 7 210 4 C213 3 215 2 216 2' fill='none' stroke='%237eaaff' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.leaderbord-users-sparkline::after {
    content: "";
    position: absolute;
    inset: 2px 0 0;
    background-repeat: no-repeat;
    background-position: center;
    background-size: 100% 100%;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 220 48' preserveAspectRatio='none'%3E%3Cpath d='M4 39 C16 40 22 36 31 34 C40 32 48 36 58 30 C68 24 75 28 86 20 C95 13 104 16 114 11 C126 5 138 12 149 9 C161 6 170 11 182 5 C191 1 201 7 210 4 C213 3 215 2 216 2' fill='none' stroke='rgba(126,170,255,0.34)' stroke-width='8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    filter: blur(8px);
    opacity: 0.85;
}

.leaderbord-current-card {
    display: block;
    margin-bottom: 26px;
    padding: 22px 26px;
    border-radius: 24px;
    border: 1px solid rgba(156, 190, 255, 0.34);
    background:
        linear-gradient(135deg, rgba(11, 18, 38, 0.96), rgba(8, 14, 30, 0.90));
    box-shadow:
        0 0 0 1px rgba(176, 124, 255, 0.10),
        0 0 0 2px rgba(126, 170, 255, 0.08),
        0 0 24px rgba(120, 162, 255, 0.12),
        0 0 36px rgba(168, 108, 255, 0.10),
        0 18px 45px rgba(0, 0, 0, 0.30),
        0 0 0 1px rgba(120, 160, 255, 0.06),
        0 0 18px rgba(95, 120, 255, 0.08),
        0 0 30px rgba(168, 108, 255, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    overflow: hidden;
    position: relative;
}

.leaderbord-current-card-hidden {
    display: none;
}

.leaderbord-current-glow {
    position: absolute;
    inset: auto -80px -90px auto;
    width: 280px;
    height: 220px;
    background:
        radial-gradient(circle, rgba(168, 108, 255, 0.12), transparent 60%),
        radial-gradient(circle at 30% 40%, rgba(93, 162, 255, 0.08), transparent 56%);
    pointer-events: none;
}

.leaderbord-current-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    min-width: 0;
    position: relative;
    z-index: 1;
}

.leaderbord-current-copy {
    min-width: 0;
    flex: 1 1 auto;
}

.leaderbord-current-label {
    margin: 0 0 10px;
    color: #aeb8d6;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 1.4px;
    text-transform: uppercase;
}

.leaderbord-current-player {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.leaderbord-current-rank {
    min-width: 56px;
    padding: 10px 14px;
    border-radius: 14px;
    text-align: center;
    color: #ffffff;
    font-size: 24px;
    font-weight: 900;
    line-height: 1;
    background: linear-gradient(180deg, rgba(17, 24, 48, 0.96), rgba(12, 19, 38, 0.96));
    border: 1px solid rgba(126, 170, 255, 0.16);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.leaderbord-current-player img {
    width: 50px;
    height: 50px;
    border-radius: 15px;
    object-fit: cover;
    border: 1px solid rgba(190, 140, 255, 0.20);
}

.leaderbord-current-name-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex-wrap: wrap;
}

.leaderbord-current-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #f5f7ff;
    font-size: 24px;
    font-weight: 900;
    letter-spacing: -0.4px;
}

.leaderbord-current-meta {
    display: flex;
    align-items: center;
    gap: 30px;
    flex: 0 0 auto;
    padding-left: 28px;
    border-left: 1px solid rgba(126, 170, 255, 0.16);
}

.leaderbord-current-meta-item {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 145px;
}

.leaderbord-current-stat-icon {
    flex: 0 0 auto;
    width: 36px;
    height: 36px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    color: #c785ff;
    font-size: 17px;
    background: rgba(168, 108, 255, 0.08);
    border: 1px solid rgba(168, 108, 255, 0.10);
}

.leaderbord-current-stat-copy {
    min-width: 0;
}

.leaderbord-current-stat-label {
    display: block;
    margin-bottom: 6px;
    color: #9da7ca;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 1.3px;
    text-transform: uppercase;
}

.leaderbord-current-stat-value {
    color: #ffffff;
    font-size: 24px;
    font-weight: 900;
    line-height: 1;
}

.leaderbord-window {
    width: 100%;
    min-height: 520px;
    border-radius: 24px;
    border: 1px solid rgba(126, 170, 255, 0.24);
    background: rgba(8, 14, 30, 0.78);
    box-shadow:
        0 18px 45px rgba(0, 0, 0, 0.30),
        0 0 0 1px rgba(120, 160, 255, 0.06),
        0 0 18px rgba(95, 120, 255, 0.08),
        0 0 30px rgba(168, 108, 255, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    overflow: hidden;
}

.leaderbord-window-header {
    padding: 22px 24px;
    border-bottom: 1px solid rgba(126, 170, 255, 0.12);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.leaderbord-window-header h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 900;
    color: #f4f7ff;
}

.leaderbord-window-header span {
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 1.6px;
    text-transform: uppercase;
    color: #8fa4d8;
}

.leaderbord-list {
    padding: 14px;
}

.leaderbord-row {
    display: grid;
    grid-template-columns: 58px 1fr auto;
    align-items: center;
    gap: 14px;
    min-height: 64px;
    padding: 10px 12px;
    border-radius: 16px;
    border: 1px solid rgba(126, 170, 255, 0.08);
    background: rgba(255, 255, 255, 0.025);
    margin-bottom: 10px;
}

.leaderbord-row:last-child {
    margin-bottom: 0;
}

.leaderbord-rank {
    font-size: 17px;
    font-weight: 900;
    color: #a86cff;
}

.leaderbord-player {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.leaderbord-player img {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    object-fit: cover;
    border: 1px solid rgba(140, 170, 255, 0.18);
}

.leaderbord-player span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 17px;
    font-weight: 800;
    color: #f3f6ff;
}

.leaderbord-value {
    font-size: 17px;
    font-weight: 900;
    color: #dce6ff;
    text-align: right;
}

.leaderbord-loading,
.leaderbord-empty {
    margin: 0;
    padding: 24px;
    text-align: center;
    color: #9ba8c8;
    font-size: 17px;
    line-height: 1.5;
}

.leaderbord-row-current {
    border-color: rgba(176, 124, 255, 0.48);
    background: linear-gradient(180deg, rgba(168, 108, 255, 0.16), rgba(102, 132, 255, 0.10));
    box-shadow:
        0 0 0 1px rgba(188, 140, 255, 0.10),
        0 0 18px rgba(168, 108, 255, 0.16),
        0 0 28px rgba(93, 162, 255, 0.10),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.leaderbord-row-current .leaderbord-rank {
    color: #e0b6ff;
}

.leaderbord-row-current .leaderbord-player img {
    border-color: rgba(190, 140, 255, 0.34);
    box-shadow: 0 0 12px rgba(168, 108, 255, 0.14);
}

.leaderbord-row-current .leaderbord-player span,
.leaderbord-row-current .leaderbord-value {
    color: #ffffff;
}

.leaderbord-badge {
    display: inline-flex;
    align-items: center;
    margin-left: 8px;
    padding: 2px 7px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 900;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: #ffffff;
    background: rgba(168, 108, 255, 0.78);
    box-shadow: 0 0 10px rgba(168, 108, 255, 0.18);
}

.leaderbord-badge-large {
    margin-left: 0;
    padding: 5px 10px;
    font-size: 14px;
    letter-spacing: 0.8px;
}

.leaderbord-current-separator {
    position: relative;
    height: 12px;
    margin: 20px 0 16px;
}

.leaderbord-current-separator::before,
.leaderbord-current-separator::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.04), rgba(164, 188, 255, 0.28), rgba(255, 255, 255, 0.04));
    box-shadow: 0 0 10px rgba(126, 170, 255, 0.10);
}

.leaderbord-current-separator::before {
    top: 1px;
}

.leaderbord-current-separator::after {
    bottom: 1px;
}

@media (max-width: 900px) {
    .leaderbord-main {
        margin-top: 14px;
    }

    .leaderbord-header {
        margin: 20px auto 24px;
        text-align: left;
    }

    .leaderbord-title {
        font-size: clamp(34px, 9vw, 46px);
        letter-spacing: 0;
    }

    .leaderbord-subtitle,
    .leaderbord-explainer p {
        font-size: 15px;
        line-height: 1.55;
    }

    .leaderbord-explainer {
        padding: 16px;
        border-radius: 16px;
    }

    .leaderbord-explainer h2 {
        font-size: 22px;
        line-height: 1.2;
    }

    .leaderbord-overview-grid,
    .leaderbord-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 16px;
    }

    .leaderbord-current-main {
        align-items: stretch;
        flex-direction: column;
        gap: 18px;
    }

    .leaderbord-current-meta {
        width: 100%;
        padding-left: 0;
        border-left: 0;
        border-top: 1px solid rgba(126, 170, 255, 0.16);
        padding-top: 16px;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .leaderbord-current-meta-item {
        min-width: 0;
        padding: 12px;
        border-radius: 14px;
        background: rgba(255, 255, 255, 0.025);
        border: 1px solid rgba(126, 170, 255, 0.10);
    }

    .leaderbord-current-name {
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
        overflow-wrap: anywhere;
        line-height: 1.16;
    }
}

@media (max-width: 600px) {
    .leaderbord-page .container {
        width: 100%;
        max-width: none;
        padding-inline: 12px;
    }

    .leaderbord-overview-card,
    .leaderbord-current-card,
    .leaderbord-window {
        border-radius: 18px;
    }

    .leaderbord-overview-card {
        min-height: auto;
        padding: 16px;
    }

    .leaderbord-overview-head h2,
    .leaderbord-window-header h2 {
        font-size: 20px;
        line-height: 1.2;
    }

    .leaderbord-distribution-chart {
        grid-template-columns: 34px 1fr;
        gap: 8px;
    }

    .leaderbord-distribution-bars {
        gap: 6px;
    }

    .leaderbord-distribution-label {
        font-size: 11px;
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
        line-height: 1.1;
    }

    .leaderbord-users-total {
        font-size: 36px;
    }

    .leaderbord-current-card {
        padding: 16px;
        margin-bottom: 18px;
    }

    .leaderbord-current-player {
        align-items: flex-start;
        gap: 10px;
    }

    .leaderbord-current-player img {
        width: 44px;
        height: 44px;
        border-radius: 13px;
        flex: 0 0 44px;
    }

    .leaderbord-current-name {
        font-size: 20px;
    }

    .leaderbord-current-meta {
        grid-template-columns: minmax(0, 1fr);
    }

    .leaderbord-current-stat-value {
        font-size: 21px;
        line-height: 1.15;
        white-space: normal;
        overflow-wrap: anywhere;
    }

    .leaderbord-window {
        min-height: auto;
    }

    .leaderbord-window-header {
        padding: 16px;
        align-items: flex-start;
        gap: 8px;
    }

    .leaderbord-window-header span {
        white-space: nowrap;
    }

    .leaderbord-list {
        padding: 10px;
    }

    .leaderbord-row {
        grid-template-columns: 44px minmax(0, 1fr);
        grid-template-areas:
            "rank player"
            "rank value";
        align-items: start;
        gap: 4px 10px;
        min-height: 0;
        padding: 12px;
        border-radius: 14px;
    }

    .leaderbord-rank {
        grid-area: rank;
        align-self: center;
        font-size: 16px;
    }

    .leaderbord-player {
        grid-area: player;
        align-items: flex-start;
        min-width: 0;
    }

    .leaderbord-player img {
        width: 34px;
        height: 34px;
        border-radius: 10px;
        flex: 0 0 34px;
    }

    .leaderbord-player span {
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
        overflow-wrap: anywhere;
        line-height: 1.2;
        font-size: 15px;
    }

    .leaderbord-value {
        grid-area: value;
        text-align: left;
        font-size: 15px;
        line-height: 1.25;
        white-space: normal;
        overflow-wrap: anywhere;
    }

    .leaderbord-badge {
        margin-left: 0;
        margin-top: 4px;
        width: fit-content;
    }
}

@media (max-width: 380px) {
    .leaderbord-page .container {
        padding-inline: 10px;
    }

    .leaderbord-row {
        grid-template-columns: 38px minmax(0, 1fr);
        gap: 4px 8px;
        padding: 10px;
    }

    .leaderbord-player {
        gap: 9px;
    }

    .leaderbord-player img {
        width: 32px;
        height: 32px;
        flex-basis: 32px;
    }
}
