
        .points-header {
            background: linear-gradient(135deg, #173b70, #4269c7);
            color: #fff;
            border-radius: 18px;
            padding: 28px;
            box-shadow: 0 8px 25px rgba(23, 59, 112, .15);
        }

        .points-header h2 {
            font-weight: 750;
            margin-bottom: 8px;
        }

        .points-header p {
            margin-bottom: 0;
            opacity: .9;
        }

        .points-card {
            background: #fff;
            border: 0;
            border-radius: 16px;
            box-shadow: 0 5px 22px rgba(35, 50, 75, .07);
            overflow: hidden;
        }

        .table thead th {
            background: #edf2fc;
            color: #33476b;
            font-size: .83rem;
            text-transform: uppercase;
            letter-spacing: .4px;
            white-space: nowrap;
            padding: 15px 12px;
        }

        .table tbody td {
            padding: 13px 12px;
            vertical-align: middle;
        }

        .student-name {
            font-weight: 650;
            color: #233c69;
        }

        .rank-number {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 34px;
            height: 34px;
            border-radius: 10px;
            background: #eef2f8;
            font-weight: 700;
        }

        .rank-1 {
            background: #fff0bd;
            color: #956500;
        }

        .rank-2 {
            background: #e8edf4;
            color: #536174;
        }

        .rank-3 {
            background: #f9e1d2;
            color: #a4572d;
        }

        .badge-placeholder {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            min-width: 70px;
            min-height: 28px;
            border: 1px dashed #b7c3d8;
            border-radius: 20px;
            color: #8290a5;
            font-size: .75rem;
            background: #fafbfd;
        }

        .points-value {
            display: inline-block;
            background: #e7f7ee;
            color: #147344;
            font-weight: 750;
            padding: 6px 12px;
            border-radius: 8px;
            white-space: nowrap;
        }

        .search-box {
            max-width: 320px;
        }
.badge-placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
}

.badge-open-btn {
    border: 0;
    padding: 0;
    background: transparent;
    cursor: pointer;
    position: relative;
    z-index: 2;
}

.points-badge {
    display: block;
    width: 60px;
    height: 60px;
    object-fit: contain;
    pointer-events: none;
}

.badge-open-btn:focus-visible {
    outline: 2px solid #4269c7;
    outline-offset: 3px;
    border-radius: 6px;
}

.points-badge:hover {
    transform: scale(1.1);
}
#badgeModal {
    z-index: 1060 !important;
}

.modal-backdrop {
    z-index: 1050 !important;
}

#badgeModal .modal-content {
    position: relative;
    pointer-events: auto;
}
        @media (max-width: 576px) {
            .points-header {
                padding: 20px;
                border-radius: 13px;
            }

            .points-header h2 {
                font-size: 1.35rem;
            }

            .search-box {
                max-width: 100%;
            }
        }
		
/* Desktop and mobile leaderboard switching */
.mobile-leaderboard {
    display: none;
}

.desktop-leaderboard {
    display: block;
}

/* Mobile reader cards */
.reader-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px;
    margin: 12px;
    background: #fff;
    border: 1px solid #e4eaf3;
    border-radius: 14px;
    box-shadow: 0 3px 12px rgba(35, 50, 75, 0.06);
    transition: box-shadow 0.2s ease;
}

.reader-card:hover {
    box-shadow: 0 5px 16px rgba(35, 50, 75, 0.1);
}

.reader-rank {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;
}

.reader-rank-label {
    font-size: 0.65rem;
    color: #77849a;
    text-align: center;
    max-width: 65px;
    line-height: 1.3;
}

.reader-details {
    flex: 1;
    min-width: 0;
}

.reader-identity {
    display: flex;
    align-items: center;
    gap: 12px;
}

.reader-identity .badge-open-btn {
    flex-shrink: 0;
}

.reader-identity .points-badge {
    width: 55px;
    height: 55px;
}

.reader-name-block {
    min-width: 0;
    overflow-wrap: anywhere;
}

.reader-name-block .student-name {
    display: block;
    font-size: 0.96rem;
    line-height: 1.35;
}

.reader-class {
    margin-top: 4px;
    color: #6b778b;
    font-size: 0.82rem;
}

.reader-points {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid #edf0f5;
}

.reader-points-label {
    font-size: 0.78rem;
    color: #68758a;
}

.reader-points .points-value {
    font-size: 0.9rem;
    padding: 5px 9px;
}



/* Default: desktop/tablet shows table, hides cards */
div.points-card div.desktop-leaderboard {
    display: block !important;
}

div.points-card div.mobile-leaderboard {
    display: none !important;
}

/* Mobile: hide table and show cards */
@media only screen and (max-width: 767px) {
    div.points-card div.desktop-leaderboard {
        display: none !important;
    }

    div.points-card div.mobile-leaderboard {
        display: block !important;
    }
}


/* Leaderboard responsive layout */
.desktop-leaderboard {
    display: block;
    min-width: 0;
}

.mobile-leaderboard {
    display: none;
}

.points-card {
    background: #fff;
    color: #212529;
}

.reader-card {
    min-width: 0;
}

.reader-details {
    overflow: hidden;
}

.reader-identity {
    min-width: 0;
}

.reader-name-block .student-name {
    overflow-wrap: anywhere;
}

@media (max-width: 767.98px) {
    .desktop-leaderboard {
        display: none !important;
    }

    .mobile-leaderboard {
        display: block !important;
        padding: 4px 2px 12px;
    }

    .reader-card {
        margin: 10px 6px;
        padding: 13px;
        gap: 10px;
        border-radius: 14px;
    }

    .reader-identity .points-badge {
        width: 48px;
        height: 48px;
    }

    .reader-points {
        flex-wrap: wrap;
    }

    .points-header {
        padding: 20px 16px;
    }

    .points-header h2 {
        font-size: 1.35rem;
    }

    .search-box {
        max-width: 100%;
        width: 100%;
    }
}
