/**
 * Void Ground - Mission Leaderboard Stylesheet
 * Leonardo da Vinci Manuscript Expedition Ledger Theme
 */

.leaderboard-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #100804 url('assets/wood-table.jpg') center center / cover no-repeat !important;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 500;
    opacity: 1;
    padding: 12px 64px;
    box-sizing: border-box;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

.leaderboard-modal-overlay.hidden {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

.leaderboard-ledger-box {
    position: relative;
    width: 100% !important;
    max-width: 1584px !important;
    height: 97% !important;
    max-height: 842px !important;
    overflow: visible;
    background: #f4ebd6 url('assets/deckle-paper.jpg') repeat;
    background-size: cover;
    border: 2px solid #5a3e1b;
    border-radius: 8px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.85), inset 0 0 60px rgba(90, 56, 20, 0.25);
    display: flex;
    flex-direction: column;
    padding: 22px 28px;
    box-sizing: border-box;
    font-family: 'Cinzel', 'Palatino Linotype', 'Book Antiqua', Georgia, serif;
    color: #2b1d0c;
}

/* Renaissance Brass Corners */
.lb-corner {
    position: absolute;
    width: 22px;
    height: 22px;
    pointer-events: none;
    z-index: 2;
}

.lb-corner.tl {
    top: 6px;
    left: 6px;
    border-top: 2.5px solid #a67c38;
    border-left: 2.5px solid #a67c38;
}

.lb-corner.tr {
    top: 6px;
    right: 6px;
    border-top: 2.5px solid #a67c38;
    border-right: 2.5px solid #a67c38;
}

.lb-corner.bl {
    bottom: 6px;
    left: 6px;
    border-bottom: 2.5px solid #a67c38;
    border-left: 2.5px solid #a67c38;
}

.lb-corner.br {
    bottom: 6px;
    right: 6px;
    border-bottom: 2.5px solid #a67c38;
    border-right: 2.5px solid #a67c38;
}

/* Header */
.lb-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 2px solid #7c5828;
    padding-bottom: 14px;
    margin-bottom: 14px;
}

.lb-chapter-badge {
    font-size: 12px;
    letter-spacing: 2.2px;
    color: #8c5d2e;
    font-weight: 700;
    text-transform: uppercase;
    display: block;
    margin-bottom: 3px;
}

.lb-main-title {
    margin: 0;
    font-size: 26.5px;
    letter-spacing: 2.8px;
    color: #381f08;
    text-shadow: 1px 1px 0 rgba(255, 255, 255, 0.4);
}

.lb-subtitle {
    display: none !important;
}

.lb-header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
}

.lb-action-btn {
    background: linear-gradient(180deg, #dfcfb2 0%, #c4ab84 100%);
    border: 2px solid #6e4a21;
    border-radius: 6px;
    color: #3b230f;
    font-family: 'Cinzel', Georgia, serif;
    font-size: 17.5px;
    font-weight: 800;
    letter-spacing: 0.8px;
    padding: 10px 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.2s ease;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.22);
}

.lb-action-btn svg {
    width: 22px;
    height: 22px;
    stroke-width: 2.2;
}

.lb-action-btn:hover {
    background: linear-gradient(180deg, #ebdcc3 0%, #d4bc94 100%);
    border-color: #8c5d2e;
    transform: translateY(-1px);
    box-shadow: 0 5px 12px rgba(0, 0, 0, 0.28);
}

.lb-close-btn {
    background: none;
    border: none;
    font-size: 54px;
    line-height: 1;
    color: #63431f;
    cursor: pointer;
    padding: 4px 10px;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s, transform 0.15s;
}

.lb-close-btn:hover {
    color: #b91c1c;
    transform: scale(1.15);
}

/* Tier Filter Tabs */
.lb-tier-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 14px;
    border-bottom: 1px solid rgba(124, 88, 40, 0.3);
    padding-bottom: 10px;
}

.lb-tab-btn {
    background: #e0d0b4;
    border: 1.5px solid #8c673b;
    border-radius: 4px;
    padding: 9px 22px;
    font-family: 'Cinzel', Georgia, serif;
    font-size: 14.5px;
    font-weight: 700;
    letter-spacing: 1.3px;
    color: #4a2f13;
    cursor: pointer;
    transition: all 0.18s ease;
}

.lb-tab-btn:hover {
    background: #ebe0cb;
    border-color: #a87944;
    color: #2b1704;
}

.lb-tab-btn.active {
    background: linear-gradient(180deg, #4d2b0e 0%, #2e1604 100%);
    border-color: #d4a359;
    color: #faebd7;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.35), inset 0 0 4px rgba(250, 235, 215, 0.3);
}

/* Status Bar */
.lb-status-bar {
    display: none !important;
    justify-content: space-between;
    align-items: center;
    background: rgba(90, 56, 20, 0.08);
    border: 1px dashed rgba(124, 88, 40, 0.4);
    border-radius: 4px;
    padding: 8px 16px;
    margin-bottom: 12px;
    font-size: 14px;
    color: #4a2f13;
}

.lb-status-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.lb-status-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #16a34a;
    box-shadow: 0 0 6px rgba(22, 163, 74, 0.6);
}

.lb-verified-badge {
    color: #15803d;
    font-weight: 700;
    letter-spacing: 0.5px;
    font-size: 13.5px;
}

/* Leaderboard Table Wrapper */
.lb-table-wrapper {
    position: relative;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    border: 1px solid #9c7444;
    background: rgba(254, 252, 248, 0.65);
    border-radius: 4px;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.08);
}

.lb-table-wrapper::-webkit-scrollbar {
    width: 7px;
}

.lb-table-wrapper::-webkit-scrollbar-track {
    background: #ebdcc3;
}

.lb-table-wrapper::-webkit-scrollbar-thumb {
    background: #8c673b;
    border-radius: 3px;
}

.lb-table {
    width: 100%;
    height: 100%;
    border-collapse: collapse;
    font-size: 18px;
    text-align: left;
}

.lb-table tbody {
    height: 100%;
}

.lb-table thead th {
    position: sticky;
    top: 0;
    background: #3e240c;
    color: #f7eedc;
    padding: 15px 18px;
    font-size: 16.5px;
    letter-spacing: 1.6px;
    font-weight: 700;
    text-transform: uppercase;
    border-bottom: 2px solid #8c673b;
    z-index: 3;
}

.lb-table tbody tr {
    border-bottom: 1px solid rgba(140, 103, 59, 0.2);
    transition: background-color 0.12s ease;
}

.lb-table tbody tr:hover {
    background: rgba(224, 208, 180, 0.45);
}

.lb-table td {
    padding: 14px 18px;
    vertical-align: middle;
}

/* Rank Styling */
.lb-medal {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-weight: 800;
    font-size: 19px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.25);
}

.lb-medal.gold {
    background: linear-gradient(135deg, #fef08a 0%, #eab308 50%, #ca8a04 100%);
    color: #422006;
    border: 1.5px solid #a16207;
}

.lb-medal.silver {
    background: linear-gradient(135deg, #f1f5f9 0%, #cbd5e1 50%, #94a3b8 100%);
    color: #0f172a;
    border: 1.5px solid #64748b;
}

.lb-medal.bronze {
    background: linear-gradient(135deg, #fed7aa 0%, #f97316 50%, #c2410c 100%);
    color: #431407;
    border: 1.5px solid #9a3412;
}

.lb-medal.normal {
    background: #e2d3bc;
    color: #4a2f13;
    border: 1px solid #9c7444;
    font-size: 17.5px;
}

/* User & Score */
.lb-username {
    font-weight: 700;
    color: #2b1704;
    font-size: 21px;
    letter-spacing: 0.5px;
}

.col-score {
    text-align: right;
}

.lb-score-val {
    font-family: 'Cinzel', Georgia, serif;
    font-size: 24px;
    font-weight: 800;
    color: #78350f;
}

.lb-score-pts {
    font-size: 16px;
    font-weight: 700;
    color: #92400e;
    margin-left: 3px;
}

/* Wave & Boss Badge */
.col-wave {
    text-align: center;
}

.lb-wave-box {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.lb-wave-text {
    font-size: 17.5px;
    font-weight: 700;
    color: #3b230f;
}

.lb-boss-badge {
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.8px;
    padding: 4px 10px;
    border-radius: 4px;
    text-transform: uppercase;
}

.lb-boss-badge.victory {
    background: rgba(22, 101, 52, 0.15);
    border: 1px solid #16a34a;
    color: #15803d;
}

.lb-boss-badge.partial {
    background: rgba(146, 64, 14, 0.12);
    border: 1px solid #b45309;
    color: #92400e;
}

.col-time {
    text-align: center;
    font-weight: 600;
    color: #4a2f13;
    font-family: monospace;
    font-size: 19px;
}

.col-date {
    text-align: right;
    font-size: 17.5px;
    color: #63431f;
}

/* Top 3 row subtle emphasis */
.lb-row.rank-1 {
    background: rgba(254, 240, 138, 0.2);
}

.lb-row.rank-2 {
    background: rgba(241, 245, 249, 0.2);
}

.lb-row.rank-3 {
    background: rgba(254, 215, 170, 0.2);
}

/* State Loaders & Empty */
.lb-state-box {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: #5c3c1b;
}

.lb-state-box.hidden {
    display: none !important;
}

.lb-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid #dfcfb2;
    border-top: 3px solid #8c5d2e;
    border-radius: 50%;
    margin: 0 auto 12px auto;
    animation: lbSpin 0.9s linear infinite;
}

@keyframes lbSpin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.lb-empty-icon {
    font-size: 32px;
    color: #a87944;
    margin-bottom: 6px;
}

.lb-state-box h3 {
    margin: 0 0 6px 0;
    font-size: 15px;
    color: #3b230f;
}

.lb-state-box p {
    margin: 0;
    font-size: 11.5px;
    color: #63431f;
    max-width: 320px;
    line-height: 1.4;
}

/* Symmetrical Pagination Bar (5 items per page with < >) */
.lb-pagination-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 12px;
    padding: 8px 0;
    flex-shrink: 0;
}

.lb-page-btn {
    background: #dfcdab;
    border: 1.5px solid #8e6a39;
    border-radius: 6px;
    color: #3b230f;
    font-size: 22px;
    font-weight: 900;
    min-width: 53px;
    height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.18s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.18);
    font-family: inherit;
    line-height: 1;
}

.lb-page-btn:hover:not(:disabled) {
    background: #faebd7;
    border-color: #baa06e;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.25);
}

.lb-page-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.lb-page-info {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 19px;
    font-weight: 800;
    color: #451a03;
    letter-spacing: 0.8px;
}

/* Footer & Calculation Note */
.lb-footer {
    display: none !important;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1.5px dashed rgba(124, 88, 40, 0.45);
    flex-shrink: 0;
}

.lb-footer-note {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 14.5px;
    /* Enlarged and legible */
    font-weight: 700;
    font-style: normal;
    color: #451a03;
    letter-spacing: 0.35px;
    line-height: 1.4;
    text-align: center;
}

/* Mode Switcher (Mission vs Battleground Top 1000) */
.lb-mode-switcher {
    display: inline-flex;
    background: #dccbb0;
    border: 2px solid #7c5828;
    border-radius: 6px;
    padding: 3px;
    gap: 4px;
}

.lb-mode-btn {
    background: transparent;
    border: 1.5px solid transparent;
    border-radius: 4px;
    padding: 9px 20px;
    font-family: 'Cinzel', Georgia, serif;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 1px;
    color: #5c3c1b;
    cursor: pointer;
    transition: all 0.16s ease;
}

.lb-mode-btn:hover {
    color: #2b1704;
    background: rgba(255, 255, 255, 0.35);
}

.lb-mode-btn.active {
    background: #3e240c;
    border-color: #b5833d;
    color: #faebd7;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.lb-tier-tabs.hidden,
.lb-my-standing-banner.hidden {
    display: none !important;
}

/* Player Standing Banner (Battleground Mode) */
.lb-my-standing-banner {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    background: #2b190b;
    border: 2px solid #9c7444;
    border-radius: 6px;
    padding: 10px 18px;
    margin-bottom: 12px;
    color: #f7eedc;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.lb-standing-item {
    display: flex;
    flex-direction: column;
    gap: 3px;
    border-right: 1px solid rgba(212, 163, 89, 0.25);
    padding-right: 10px;
}

.lb-standing-item:last-child {
    border-right: none;
    padding-right: 0;
}

.lb-standing-label {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1.2px;
    color: #d4b280;
}

.lb-standing-val {
    font-size: 16.5px;
    font-weight: 900;
    color: #fdf6e6;
}

.lb-standing-val.rank-pill {
    color: #fbbf24;
}

.lb-row-me {
    background: rgba(180, 83, 9, 0.14) !important;
}

.lb-you-badge {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 800;
    background: #78350f;
    color: #fef3c7;
    border: 1px solid #b45309;
    border-radius: 4px;
    letter-spacing: 0.8px;
}