.sudoku-leaderboard {
    max-width: 100%;
    margin: 0 auto;
    padding: 20px;
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.sudoku-leaderboard.dark {
    background-color: #1f2937;
}

.sudoku-leaderboard h2 {
    font-size: 24px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 20px;
}

.sudoku-leaderboard.dark h2 {
    color: #ffffff;
}

.leaderboard-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.leaderboard-filters select,
.leaderboard-filters button {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 14px;
    background-color: #ffffff;
    cursor: pointer;
}

.leaderboard-filters select {
    width: 100%;
    max-width: 200px;
}

.leaderboard-filters button {
    background-color: #3b82f6;
    color: #ffffff;
    border: none;
}

.leaderboard-filters button:hover {
    background-color: #2563eb;
}

.leaderboard-filters select.dark,
.leaderboard-filters button.dark {
    background-color: #374151;
    border-color: #4b5563;
    color: #ffffff;
}

.leaderboard-filters select.dark:hover,
.leaderboard-filters button.dark:hover {
    background-color: #4b5563;
}

table {
    width: 100%;
    border-collapse: collapse;
}

table thead tr {
    background-color: #f3f4f6;
}

table.dark thead tr {
    background-color: #374151;
}

table th,
table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

table.dark th,
table.dark td {
    border-bottom-color: #4b5563;
}

table th {
    font-weight: 600;
    color: #1f2937;
}

table.dark th {
    color: #ffffff;
}

table td {
    color: #4b5563;
}

table.dark td {
    color: #d1d5db;
}

table td.rank {
    font-weight: bold;
    text-align: center;
    position: relative;
    padding-left: 30px; /* Space for circle */
}

table td.rank::before {
    content: '';
    position: absolute;
    left: 5px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    background-color: #3b82f6;
    border-radius: 50%;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

table.dark td.rank::before {
    background-color: #60a5fa;
}

table td.rank-1::before {
    content: '1';
}

table td.rank-2::before {
    content: '2';
}

table td.rank-3::before {
    content: '3';
}

table td.rank-4::before {
    content: '4';
}

table td.rank-5::before {
    content: '5';
}

table td.rank-6::before {
    content: '6';
}

table td.rank-7::before {
    content: '7';
}

table td.rank-8::before {
    content: '8';
}

table td.rank-9::before {
    content: '9';
}

table td.rank-10::before {
    content: '10';
}

table tr:hover {
    background-color: #f9fafb;
}

table.dark tr:hover {
    background-color: #2d3748;
}

table tr:last-child td {
    border-bottom: none;
}

@media (max-width: 640px) {
    .leaderboard-filters {
        flex-direction: column;
    }
    table {
        display: block;
        overflow-x: auto;
    }
    table th,
    table td {
        min-width: 120px;
    }
}