/* ========== Leaderboard Page Styles ========== */

/* Page Hero */
.page-hero {
    padding: 140px 40px 60px;
    text-align: center;
    background: var(--bg2);
}
.page-hero h1 {
    font-size: clamp(36px, 5vw, 56px);
    font-weight: 900;
    letter-spacing: -1.5px;
    margin-bottom: 16px;
}
.page-hero p {
    font-size: 19px;
    font-weight: 300;
    color: var(--fg2);
    line-height: 1.7;
    max-width: 600px;
    margin: 0 auto;
}

/* Leaderboard Section */
.leaderboard-section {
    padding: 60px 0;
}

/* Mode Tabs */
.lb-mode-tabs {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 32px;
}
.lb-mode-tab {
    padding: 10px 28px;
    border: 2px solid var(--border-light);
    border-radius: 980px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    background: transparent;
    color: var(--fg2);
    transition: all .25s ease;
    font-family: inherit;
}
.lb-mode-tab:hover {
    border-color: var(--accent);
    color: var(--accent);
}
.lb-mode-tab.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    box-shadow: 0 2px 12px rgba(59,130,246,.25);
}

/* Game Mode Column */
.lb-mode-cell {
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}
.lb-mode-tag {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 980px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .3px;
}
.lb-mode-tag-standard {
    background: rgba(46,204,113,.12);
    color: #27ae60;
}
.lb-mode-tag-custom {
    background: rgba(155,89,182,.12);
    color: #8e44ad;
}

/* Empty State */
.lb-empty {
    text-align: center;
    padding: 80px 20px;
    color: var(--fg3);
}
.lb-empty i {
    font-size: 48px;
    margin-bottom: 20px;
    opacity: .3;
}
.lb-empty p {
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 8px;
}
.lb-empty .sub {
    font-size: 14px;
    font-weight: 300;
    color: var(--fg3);
}

/* Table */
.lb-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--card);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,.06), 0 8px 24px rgba(0,0,0,.04);
}
.lb-table thead {
    background: var(--bg2);
}
.lb-table th {
    padding: 16px 20px;
    font-size: 13px;
    font-weight: 600;
    color: var(--fg3);
    text-transform: uppercase;
    letter-spacing: .5px;
    text-align: left;
    border-bottom: 1px solid var(--border-light);
}
.lb-table td {
    padding: 14px 20px;
    font-size: 15px;
    color: var(--fg);
    border-bottom: 1px solid var(--border-light);
    transition: background .2s;
}
.lb-table tbody tr:hover {
    background: var(--card-hover);
}
.lb-table tbody tr:last-child td {
    border-bottom: none;
}

/* Rank Column */
.lb-rank {
    font-weight: 700;
    font-size: 16px;
    text-align: center;
    min-width: 48px;
}
.rank-gold td { background: rgba(255,215,0,.06); }
.rank-silver td { background: rgba(192,192,192,.06); }
.rank-bronze td { background: rgba(205,127,50,.06); }
.rank-gold:hover td { background: rgba(255,215,0,.12) !important; }
.rank-silver:hover td { background: rgba(192,192,192,.12) !important; }
.rank-bronze:hover td { background: rgba(205,127,50,.12) !important; }

/* Name Column */
.lb-name {
    font-weight: 600;
    color: var(--fg);
}

/* GUID Column */
.lb-guid {
    font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
    font-size: 12px;
    color: var(--fg3);
}

/* Score Column */
.lb-score {
    font-weight: 700;
    font-size: 15px;
    color: var(--accent);
    white-space: nowrap;
}

/* Date Column */
.lb-date {
    font-size: 13px;
    color: var(--fg3);
    white-space: nowrap;
}

/* Replay Button Column */
.lb-replay-cell {
    text-align: center;
    min-width: 80px;
}

.lb-replay-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--red), var(--orange));
    color: #fff;
    font-size: 16px;
    text-decoration: none;
    transition: all .3s cubic-bezier(.25,.46,.45,.94);
    box-shadow: 0 2px 8px rgba(231,76,60,.3);
}

.lb-replay-btn:hover {
    transform: scale(1.15);
    box-shadow: 0 4px 16px rgba(231,76,60,.5);
}

.lb-no-replay {
    color: var(--fg3);
    opacity: .4;
    font-size: 14px;
}

/* ========== Victory Modal Leaderboard Section ========== */
.leaderboard-section.hidden { display: none; }

.leaderboard-divider {
    width: 100%;
    height: 1px;
    background: rgba(255,255,255,.15);
    margin: 16px 0;
}

.leaderboard-title {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 12px;
    text-align: center;
}

.leaderboard-stats {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 14px;
}

.lb-stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
}

.lb-stat-row .lb-label {
    color: rgba(255,255,255,.6);
}

.lb-stat-row .lb-value {
    color: #fff;
    font-weight: 600;
    font-family: 'SF Mono', Monaco, monospace;
}

.leaderboard-input-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.lb-name-label {
    color: rgba(255,255,255,.7);
    font-size: 14px;
    white-space: nowrap;
}

.lb-name-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid rgba(255,255,255,.2);
    border-radius: 8px;
    background: rgba(255,255,255,.1);
    color: #fff;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: border-color .2s;
}
.lb-name-input::placeholder {
    color: rgba(255,255,255,.3);
}
.lb-name-input:focus {
    border-color: rgba(255,255,255,.5);
}

.leaderboard-btns {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.lb-btn {
    padding: 10px 24px;
    border: none;
    border-radius: 980px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: all .3s;
}

.lb-btn-submit {
    background: #fff;
    color: var(--fg);
}
.lb-btn-submit:hover {
    transform: scale(1.04);
    box-shadow: 0 4px 16px rgba(0,0,0,.2);
}

.lb-btn-skip {
    background: transparent;
    color: rgba(255,255,255,.6);
    border: 1px solid rgba(255,255,255,.2);
}
.lb-btn-skip:hover {
    color: #fff;
    border-color: rgba(255,255,255,.5);
}

.lb-submitted-msg {
    text-align: center;
    color: #4ade80;
    font-weight: 600;
    font-size: 15px;
    padding: 8px;
    animation: fadeInUp .3s ease;
}

.lb-submitted-msg.hidden { display: none; }

/* Upload Progress Bar */
.lb-progress-wrap {
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.lb-progress-wrap.hidden { display: none; }

.lb-progress-bar {
    flex: 1;
    height: 8px;
    background: rgba(255,255,255,.1);
    border-radius: 4px;
    overflow: hidden;
}

.lb-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #60a5fa);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.lb-progress-text {
    font-size: 12px;
    font-weight: 600;
    color: #60a5fa;
    min-width: 36px;
    text-align: right;
}

/* Victory Buttons Group */
.victory-btns {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 20px;
}

.view-leaderboard-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    border: none;
    border-radius: 8px;
    padding: 14px 28px;
    color: #fff;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    font-family: inherit;
}

.view-leaderboard-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.3);
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ========== Responsive ========== */
@media (max-width: 768px) {
    .page-hero {
        padding: 120px 24px 40px;
    }
    .lb-table th,
    .lb-table td {
        padding: 10px 12px;
        font-size: 13px;
    }
    .lb-guid {
        display: none;
    }
    .lb-table th:last-child {
        display: none;
    }
}

@media (max-width: 480px) {
    .page-hero h1 {
        font-size: 32px;
    }
    .page-hero p {
        font-size: 16px;
    }
    .lb-table th:nth-child(4),
    .lb-table td:nth-child(4) {
        display: none;
    }
}
