

.leaderboard-panel {
    background: linear-gradient(160deg, #181930 0%, #12131f 50%, #161726 100%);
    border-radius: 16px;
    padding: 32px 36px;
    margin-bottom: 24px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    position: relative;
    overflow: hidden;
}

.leaderboard-panel::before {
    content: '';
    position: absolute;
    top: -50%;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    height: 400px;
    background: radial-gradient(circle, rgba(91, 106, 191, 0.06) 0%, transparent 70%);
    pointer-events: none;
}

.leaderboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
    position: relative;
    z-index: 1;
}

.leaderboard-header h2 {
    margin: 0;
    font-size: 1.6em;
    font-weight: 700;
    color: #e2e6ec;
}

.leaderboard-stats {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.stats-group {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.stat-badge {
    background: rgba(91, 106, 191, 0.12);
    color: #7a8add;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.82em;
    font-weight: 500;
    border: 1px solid rgba(91, 106, 191, 0.15);
}

.stat-badge strong {
    font-weight: 700;
    color: #8b9aff;
}

.total-words-badge {
    background: rgba(91, 106, 191, 0.12);
    color: #7a8add;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.82em;
    font-weight: 500;
    border: 1px solid rgba(91, 106, 191, 0.15);
}

.total-words-badge strong {
    font-weight: 700;
}

.leaderboard-stats-detail {
    margin-top: 28px;
    margin-bottom: 32px;
    padding: 20px 24px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    position: relative;
    z-index: 1;
}

.stats-detail-header h3 {
    margin: 0 0 16px 0;
    font-size: 1.1em;
    font-weight: 600;
    color: #e2e6ec;
}

.stats-detail-content {
    color: rgba(200, 204, 212, 0.7);
}

.stats-placeholder {
    color: rgba(200, 204, 212, 0.5);
    font-size: 0.9em;
    text-align: center;
    padding: 12px;
}

.length-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}

.length-stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    font-size: 0.9em;
    transition: all 0.2s;
}

.length-stat-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(91, 106, 191, 0.2);
}

.length-label {
    color: rgba(200, 204, 212, 0.7);
}

.length-count {
    color: #7a8add;
    font-weight: 600;
    font-size: 1.05em;
}

.refresh-btn {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: rgba(200, 204, 212, 0.5);
    width: 36px;
    height: 36px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1em;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.refresh-btn:hover {
    background: rgba(91, 106, 191, 0.1);
    color: #c8ccd4;
    border-color: rgba(91, 106, 191, 0.2);
}

.refresh-btn.spinning {
    animation: spin 0.6s ease;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.leaderboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 32px;
    position: relative;
    z-index: 1;
}

.leaderboard-table-wrap {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 14px;
    overflow: hidden;
}

.table-title {
    padding: 18px 22px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.table-title.rare {
    background: linear-gradient(135deg, rgba(74, 122, 191, 0.08), transparent);
}

.table-title.popular {
    background: linear-gradient(135deg, rgba(191, 106, 74, 0.08), transparent);
}

.table-icon {
    font-size: 1.4em;
}

.table-title h3 {
    color: #e2e6ec;
    font-size: 1.05em;
    font-weight: 700;
    margin: 0;
}

.table-subtitle {
    color: rgba(200, 204, 212, 0.3);
    font-size: 0.78em;
    width: 100%;
    margin-top: -2px;
}

.table-body {
    padding: 8px;
    max-height: 480px;
    overflow-y: auto;
}

.table-placeholder {
    text-align: center;
    color: rgba(200, 204, 212, 0.25);
    padding: 40px 20px;
    font-style: italic;
    font-size: 0.9em;
}

.lb-row {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    border-radius: 8px;
    transition: background 0.15s;
    gap: 12px;
}

.lb-row:hover {
    background: rgba(255, 255, 255, 0.03);
}

.lb-row.rank-1 {
    background: rgba(255, 215, 0, 0.06);
}

.lb-row.rank-1:hover {
    background: rgba(255, 215, 0, 0.1);
}

.lb-row.rank-2 {
    background: rgba(192, 192, 192, 0.04);
}

.lb-row.rank-3 {
    background: rgba(205, 127, 50, 0.04);
}

.lb-rank {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 0.82em;
    font-weight: 700;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.04);
    color: rgba(200, 204, 212, 0.5);
}

.rank-1 .lb-rank {
    background: rgba(255, 215, 0, 0.15);
    color: #ffd700;
}

.rank-2 .lb-rank {
    background: rgba(192, 192, 192, 0.12);
    color: #c0c0c0;
}

.rank-3 .lb-rank {
    background: rgba(205, 127, 50, 0.12);
    color: #cd7f32;
}

.lb-word {
    flex: 1;
    color: #c8ccd4;
    font-size: 0.95em;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rank-1 .lb-word {
    color: #e2e6ec;
    font-weight: 600;
}

.lb-count {
    font-size: 0.82em;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 12px;
    flex-shrink: 0;
}

.rare .lb-count {
    background: rgba(74, 122, 191, 0.12);
    color: #6a9fd8;
}

.popular .lb-count {
    background: rgba(191, 106, 74, 0.12);
    color: #d89a6a;
}

.table-body::-webkit-scrollbar {
    width: 6px;
}

.table-body::-webkit-scrollbar-track {
    background: transparent;
}

.table-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.06);
    border-radius: 6px;
}

.table-body::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.1);
}


.leaderboard-stats-detail {
    margin-top: 28px;
    margin-bottom: 32px;
    padding: 20px 24px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    position: relative;
    z-index: 1;
}

.stats-detail-header h3 {
    margin: 0 0 16px 0;
    font-size: 1.1em;
    font-weight: 600;
    color: #e2e6ec;
}

.stats-detail-content {
    color: rgba(200, 204, 212, 0.7);
}

.stats-placeholder {
    color: rgba(200, 204, 212, 0.5);
    font-size: 0.9em;
    text-align: center;
    padding: 12px;
}

.length-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}

.length-stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    font-size: 0.9em;
    transition: all 0.2s;
}

.length-stat-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(91, 106, 191, 0.2);
}

.length-label {
    color: rgba(200, 204, 212, 0.7);
}

.length-count {
    color: #7a8add;
    font-weight: 600;
    font-size: 1.05em;
}

@media (max-width: 768px) {
    .leaderboard-panel {
        padding: 24px 18px;
    }

    .leaderboard-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .leaderboard-stats {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        width: 100%;
    }

    .stats-group {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        width: 100%;
    }

    .leaderboard-grid {
        grid-template-columns: 1fr;
    }

    .table-body {
        max-height: 320px;
    }

    .length-stats-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 8px;
    }

    .leaderboard-stats-detail {
        padding: 16px 18px;
    }
}
