.exam-leaderboard {
    --leaderboard-card: #151111;
    --leaderboard-line: rgba(255, 255, 255, .08);
    --leaderboard-text: #f7f1ef;
    --leaderboard-muted: #8f8380;
    max-width: 1180px;
    margin: 0 auto;
    padding: 18px 0 60px;
}

.exam-leaderboard__header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 32px;
    margin-bottom: 26px;
}

.exam-leaderboard__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    color: #e84221;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .16em;
}

.exam-leaderboard__eyebrow::before {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #e84221;
    box-shadow: 0 0 16px rgba(232, 66, 33, .65);
    content: "";
}

.exam-leaderboard h1 {
    max-width: 800px;
    margin: 0;
    color: var(--leaderboard-text);
    font-size: clamp(34px, 5vw, 62px);
    line-height: .98;
    letter-spacing: -.055em;
}

.exam-leaderboard__header p {
    max-width: 680px;
    margin: 14px 0 0;
    color: var(--leaderboard-muted);
    font-size: 15px;
}

.exam-rating-selected span {
    color: #e84221;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.exam-rating-selected {
    display: flex;
    min-height: 86px;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 18px 22px;
    border: 1px solid var(--leaderboard-line);
    border-bottom: 0;
    border-radius: 22px 22px 0 0;
    background: linear-gradient(100deg, rgba(232, 66, 33, .07), rgba(18, 14, 14, .82) 50%);
}

.exam-rating-selected h2 {
    margin: 4px 0 0;
    color: #f5efed;
    font-size: clamp(19px, 3vw, 28px);
    letter-spacing: -.025em;
}

.exam-rating-selected > strong {
    flex: 0 0 auto;
    padding: 9px 13px;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 999px;
    color: #c9bfbc;
    background: rgba(255, 255, 255, .03);
    font-size: 12px;
}

.leaderboard-table-shell {
    overflow: hidden;
    border: 1px solid var(--leaderboard-line);
    border-radius: 0 0 22px 22px;
    background: rgba(18, 14, 14, .78);
}

.leaderboard-table__head,
.leaderboard-row {
    display: grid;
    grid-template-columns: 92px minmax(240px, 1fr) 155px 170px;
    align-items: center;
}

.leaderboard-table__head {
    min-height: 52px;
    padding: 0 22px;
    border-bottom: 1px solid var(--leaderboard-line);
    color: #706562;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .09em;
    text-transform: uppercase;
}

.leaderboard-row {
    position: relative;
    min-height: 78px;
    padding: 0 22px;
    border-bottom: 1px solid rgba(255, 255, 255, .055);
    transition: background .18s ease;
}

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

.leaderboard-row:hover {
    background: rgba(255, 255, 255, .025);
}

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

.leaderboard-avatar {
    display: grid;
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    overflow: hidden;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 14px;
    color: #f36649;
    background: linear-gradient(145deg, rgba(232, 66, 33, .14), rgba(255, 255, 255, .025));
    font-size: 14px;
    font-weight: 950;
}

.leaderboard-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.leaderboard-row__student-copy {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 3px;
}

.leaderboard-row__student-copy strong {
    overflow: hidden;
    color: #e6ddda;
    font-size: 15px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.leaderboard-row__student-copy small {
    overflow: hidden;
    color: #766a67;
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.leaderboard-row__score {
    display: flex;
    align-items: baseline;
    gap: 5px;
}

.leaderboard-row__score strong {
    color: #fff;
    font-size: 19px;
    font-weight: 950;
}

.leaderboard-row__score span,
.leaderboard-row__date {
    color: #847875;
    font-size: 11px;
}

.rank-medal {
    display: inline-grid;
    width: 36px;
    height: 36px;
    place-items: center;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 950;
}

.rank-medal--gold {
    color: #ffd061;
    border: 1px solid rgba(255, 207, 93, .32);
    background: rgba(255, 195, 61, .07);
}

.rank-medal--silver {
    color: #d8e1e8;
    border: 1px solid rgba(217, 227, 235, .22);
    background: rgba(217, 227, 235, .055);
}

.rank-medal--bronze {
    color: #dc8c59;
    border: 1px solid rgba(215, 128, 73, .24);
    background: rgba(205, 112, 55, .055);
}

.rank-number {
    display: inline-grid;
    width: 36px;
    height: 36px;
    place-items: center;
    color: #756966;
    font-size: 12px;
    font-weight: 850;
}

.leaderboard-row--rank-1 {
    background: linear-gradient(90deg, rgba(255, 194, 63, .055), transparent 45%);
}

.leaderboard-row--rank-2 {
    background: linear-gradient(90deg, rgba(207, 220, 231, .04), transparent 45%);
}

.leaderboard-row--rank-3 {
    background: linear-gradient(90deg, rgba(202, 113, 59, .045), transparent 45%);
}

.leaderboard-empty {
    padding: 70px 30px;
    border: 1px solid var(--leaderboard-line);
    border-radius: 0 0 22px 22px;
    background: var(--leaderboard-card);
    text-align: center;
}

.leaderboard-empty strong {
    color: var(--leaderboard-text);
    font-size: 24px;
}

.leaderboard-empty p {
    color: var(--leaderboard-muted);
}

html[data-theme="light"] .exam-leaderboard {
    --leaderboard-card: #fffaf8;
    --leaderboard-line: rgba(67, 37, 29, .1);
    --leaderboard-text: #241815;
    --leaderboard-muted: #7e6c67;
}

html[data-theme="light"] .leaderboard-table-shell {
    background: rgba(255, 252, 250, .88);
}

html[data-theme="light"] .exam-rating-selected h2,
html[data-theme="light"] .leaderboard-row__student-copy strong,
html[data-theme="light"] .leaderboard-row__score strong {
    color: #2a1b17;
}

html[data-theme="light"] .exam-rating-selected {
    background: linear-gradient(100deg, rgba(232, 66, 33, .08), rgba(255, 252, 250, .92) 55%);
}

html[data-theme="light"] .exam-rating-selected > strong {
    color: #5f4f4a;
    border-color: rgba(67, 37, 29, .14);
    background: rgba(255, 255, 255, .78);
}

html[data-theme="light"] .leaderboard-table__head,
html[data-theme="light"] .leaderboard-row__student-copy small,
html[data-theme="light"] .leaderboard-row__score span,
html[data-theme="light"] .leaderboard-row__date {
    color: #655651;
}

html[data-theme="light"] .leaderboard-row {
    border-bottom-color: rgba(67, 37, 29, .1);
}

html[data-theme="light"] .leaderboard-row:hover {
    background: rgba(184, 48, 22, .035);
}

html[data-theme="light"] .leaderboard-avatar {
    color: #b3260b;
    border-color: rgba(179, 38, 11, .16);
    background: linear-gradient(145deg, rgba(232, 66, 33, .13), rgba(255, 255, 255, .72));
}

html[data-theme="light"] .rank-medal--gold {
    color: #704600;
    border-color: #d7a526;
    background: #fff0bd;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .65);
}

html[data-theme="light"] .rank-medal--silver {
    color: #46515a;
    border-color: #9ba7b0;
    background: #e8edf1;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .72);
}

html[data-theme="light"] .rank-medal--bronze {
    color: #7a3b16;
    border-color: #c57a4a;
    background: #f9dfcf;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .65);
}

html[data-theme="light"] .rank-number {
    color: #514540;
}

html[data-theme="light"] .leaderboard-row--rank-1 {
    background: linear-gradient(90deg, rgba(255, 196, 55, .12), transparent 48%);
}

html[data-theme="light"] .leaderboard-row--rank-2 {
    background: linear-gradient(90deg, rgba(128, 145, 158, .09), transparent 48%);
}

html[data-theme="light"] .leaderboard-row--rank-3 {
    background: linear-gradient(90deg, rgba(190, 96, 40, .09), transparent 48%);
}

@media (max-width: 820px) {
    .exam-leaderboard {
        padding-top: 5px;
    }

    .exam-leaderboard__header {
        align-items: stretch;
        flex-direction: column;
        gap: 18px;
        margin-bottom: 20px;
    }

    .exam-leaderboard__header > div {
        min-width: 0;
    }

    .exam-leaderboard__header h1 {
        overflow-wrap: normal;
        word-break: normal;
    }

    .exam-leaderboard__header .rating-table-selector {
        width: 100%;
        flex: 0 0 auto;
    }

    .exam-rating-selected {
        min-height: 78px;
        padding: 15px;
    }

    .exam-rating-selected > strong {
        display: none;
    }

    .leaderboard-table__head {
        display: none;
    }

    .leaderboard-row {
        grid-template-columns: 42px minmax(0, 1fr) auto;
        gap: 9px;
        min-height: 78px;
        padding: 10px 13px;
    }

    .leaderboard-row__date {
        grid-column: 2 / 4;
        margin-top: -13px;
    }

    .leaderboard-avatar {
        width: 40px;
        height: 40px;
        flex-basis: 40px;
        border-radius: 12px;
    }

    .leaderboard-row__score span {
        display: none;
    }
}
