/* ---- Leaderboard Styles ---- */
.leaderboard-section {
    margin-bottom: 3rem;
}

.leaderboard-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.leaderboard-subtitle {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-style: italic;
}

.table-container {
    width: 100%;
    overflow-x: auto;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

[data-theme="light"] .table-container {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px;
    text-align: left;
}

.leaderboard-table th,
.leaderboard-table td {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--divider-color);
}

.leaderboard-table th {
    font-family: var(--font-heading);
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--ai-color);
    text-transform: uppercase;
    letter-spacing: 1px;
    background: rgba(0, 243, 255, 0.05);
    white-space: nowrap;
}

.leaderboard-table th.sortable {
    cursor: pointer;
    transition: background 0.2s;
    user-select: none;
}

.leaderboard-table th.sortable:hover {
    background: rgba(0, 243, 255, 0.1);
}

[data-theme="light"] .leaderboard-table th {
    background: rgba(0, 119, 182, 0.05);
}

[data-theme="light"] .leaderboard-table th.sortable:hover {
    background: rgba(0, 119, 182, 0.1);
}

.sort-icon {
    display: inline-block;
    width: 12px;
    font-size: 0.75rem;
    opacity: 0.5;
    margin-left: 5px;
}

th.sortable:hover .sort-icon {
    opacity: 1;
}

.leaderboard-table tbody tr {
    transition: background 0.2s, transform 0.2s;
}

.leaderboard-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

[data-theme="light"] .leaderboard-table tbody tr:hover {
    background: rgba(0, 0, 0, 0.02);
}

.col-rank {
    width: 60px;
    text-align: center;
    font-weight: 700;
    font-family: var(--font-heading);
    color: var(--text-muted);
}

.model-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.dev-icon {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    object-fit: contain;
    background: rgba(255, 255, 255, 0.05);
}

[data-theme="light"] .dev-icon {
    background: rgba(0, 0, 0, 0.03);
}

/* Emphasize top 3 ranks */
.rank-1 { color: #ffd700; font-size: 1.25em; text-shadow: 0 0 10px rgba(255,215,0,0.4); }
.rank-2 { color: #c0c0c0; font-size: 1.15em; text-shadow: 0 0 10px rgba(192,192,192,0.4); }
.rank-3 { color: #cd7f32; font-size: 1.1em; text-shadow: 0 0 10px rgba(205,127,50,0.4); }

.model-name-wrapper {
    display: flex;
    flex-direction: column;
}

.model-name {
    font-weight: 600;
    font-size: 1.05rem;
    color: var(--text-color);
}

.developer-name {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.score-bar-container {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.score-bar-bg {
    flex-grow: 1;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

[data-theme="light"] .score-bar-bg {
    background: rgba(0, 0, 0, 0.1);
}

.score-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--human-color), var(--ai-color));
    border-radius: 4px;
    width: 0; /* Set inline via JS */
    transition: width 1s cubic-bezier(0.22, 1, 0.36, 1);
}

.score-value {
    font-family: var(--font-heading);
    font-weight: 700;
    width: 30px;
    text-align: right;
}

.col-speed {
    color: #4cd137;
    font-family: monospace;
    font-size: 1.05rem;
}

.col-price {
    font-family: monospace;
    font-size: 1.05rem;
}

.col-context {
    color: var(--text-muted);
    font-size: 0.9rem;
}
