/* ============================================
   Kaseora — Global Leaderboard Styles
   ============================================ */

.lb-page {
    padding: 40px 20px 80px;
    max-width: 960px;
    margin: 0 auto;
}

/* ── Header ────────────────────────── */
.lb-header {
    text-align: center;
    margin-bottom: 32px;
}

.lb-title {
    font-family: 'Cinzel', serif;
    font-size: 2rem;
    font-weight: 700;
    color: var(--gold);
    margin-bottom: 6px;
    letter-spacing: 0.02em;
}

.lb-subtitle {
    font-size: 0.88rem;
    color: var(--text-secondary);
}

/* ── Tabs ──────────────────────────── */
.lb-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0;
    overflow-x: auto;
}

.lb-tab {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-family: 'Cinzel', serif;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 10px 20px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
    white-space: nowrap;
}

.lb-tab:hover {
    color: var(--text-primary);
}

.lb-tab.active {
    color: var(--gold);
    border-bottom-color: var(--gold);
}

/* ── Sub-tabs (military attack/defense) ── */
.lb-sub-tabs {
    display: flex;
    gap: 2px;
    margin-bottom: 16px;
}

.lb-sub-tab {
    background: var(--bg-medium);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-weight: 500;
    padding: 6px 16px;
    cursor: pointer;
    border-radius: var(--radius);
    transition: all 0.2s;
}

.lb-sub-tab:hover {
    color: var(--text-primary);
    border-color: var(--border-hover);
}

.lb-sub-tab.active {
    background: var(--bg-light);
    color: var(--gold);
    border-color: var(--gold-dark);
}

/* ── Panels ────────────────────────── */
.lb-panel {
    display: none;
}

.lb-panel.active {
    display: block;
    animation: lbFadeIn 0.25s ease;
}

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

.lb-sub-panel {
    display: none;
}

.lb-sub-panel.active {
    display: block;
}

.lb-panel-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
    padding: 16px 20px;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

.lb-panel-icon {
    font-size: 1.8rem;
    line-height: 1;
}

.lb-panel-header h2 {
    font-family: 'Cinzel', serif;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-bright);
    margin-bottom: 2px;
}

.lb-panel-header p {
    font-size: 0.82rem;
    color: var(--text-secondary);
}

/* ── Table ─────────────────────────── */
.lb-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--bg-dark);
}

.lb-tbl {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 2px;
    font-size: 0.88rem;
}

.lb-tbl thead {
    background: var(--bg-medium);
}

.lb-tbl th {
    font-family: 'Cinzel', serif;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.lb-tbl td {
    padding: 10px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.03);
    vertical-align: middle;
}

.lb-tbl tbody tr {
    transition: background 0.15s;
}

.lb-tbl tbody tr:hover {
    background: rgba(201, 168, 76, 0.04);
}

.lb-tbl tbody tr.me {
    background: rgba(201, 168, 76, 0.08);
}

.lb-tbl tbody tr.me td {
    color: var(--gold-light);
}

/* Columns */
.col-rank {
    width: 48px;
    text-align: center;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.col-rank.medal-gold { color: #ffd700; text-shadow: 0 0 8px rgba(255,215,0,0.4); }
.col-rank.medal-silver { color: #c0c0c0; text-shadow: 0 0 6px rgba(192,192,192,0.3); }
.col-rank.medal-bronze { color: #cd7f32; text-shadow: 0 0 6px rgba(205,127,50,0.3); }

.col-race {
    width: 32px;
    text-align: center;
    font-size: 1rem;
}

.col-player {
    font-weight: 600;
}

.col-player a {
    color: var(--text-bright);
    transition: color 0.2s;
}

.col-player a:hover {
    color: var(--gold);
}

.col-num {
    text-align: right;
    font-family: 'Fira Sans', sans-serif;
    font-variant-numeric: tabular-nums;
    color: var(--text-secondary);
    white-space: nowrap;
}

.col-atk { color: #f66; }
.col-def { color: #5ba8d4; }
.col-gold { color: var(--gold); }
.col-title { color: #ff9800; }

th.col-num { text-align: right; }
th.col-rank { text-align: center; }

.lb-empty {
    text-align: center;
    color: var(--text-dim);
    padding: 40px 20px;
    font-style: italic;
}

/* ── Responsive ────────────────────── */
@media (max-width: 640px) {
    .lb-page {
        padding: 24px 12px 60px;
    }

    .lb-title {
        font-size: 1.5rem;
    }

    .lb-tab {
        font-size: 0.8rem;
        padding: 8px 12px;
    }

    .lb-tbl {
        font-size: 0.82rem;
    }

    .lb-tbl th,
    .lb-tbl td {
        padding: 8px 8px;
    }

    .lb-panel-header {
        padding: 12px 14px;
    }

    .lb-panel-icon {
        font-size: 1.4rem;
    }

    .lb-panel-header h2 {
        font-size: 1rem;
    }
}
