/* ================================
   PAGE
================================ */
.cpl-v2-page {
    padding: 20px;
    max-width: 100%;
}

/* ================================
   TITLE
================================ */
.cpl-v2-title {
    font-size: 30px;
    color: #f5c542;
    font-weight: 900;
    margin-bottom: 20px;
    letter-spacing: 0.5px;
    text-shadow: 0 0 10px rgba(245,197,66,0.4);
}

/* ================================
   TOP CARDS
================================ */
.cpl-v2-cards {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-top: 20px;
    margin-bottom: 26px;
    width: 100%;
}

.cpl-v2-card {
    background: linear-gradient(145deg, #1b1f2a, #0f131c);
    padding: 20px;
    border-radius: 16px;
    text-align: center;
    color: #fff;
    box-shadow: 0 10px 22px rgba(0,0,0,0.35);
    border: 1px solid rgba(255,255,255,0.06);
    transition: 0.2s;
    position: relative;
    overflow: hidden;
}

.cpl-v2-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 28px rgba(0,0,0,0.45);
}

.cpl-v2-card .icon {
    font-size: 30px;
    margin-bottom: 8px;
}

.cpl-v2-card .num {
    font-size: 34px;
    font-weight: 900;
    color: #f5c542;
    margin-bottom: 6px;
    text-shadow:
        0 0 6px rgba(245,197,66,0.5),
        0 0 12px rgba(245,197,66,0.4),
        0 0 18px rgba(245,197,66,0.3);
}

.cpl-v2-card .label {
    font-size: 13px;
    font-weight: 600;
    color: #e2e8f0;
    letter-spacing: 0.3px;
}

.cpl-v2-card:nth-child(1) .icon { color: #f5c542; }
.cpl-v2-card:nth-child(2) .icon { color: #facc15; }
.cpl-v2-card:nth-child(3) .icon { color: #ef4444; }

/* ================================
   LEADERBOARD
================================ */
.cpl-v2-leaderboard {
    margin-top: 28px;
    background: linear-gradient(135deg, #0b1020, #111a35);
    border: 2px solid #ffd800;
    border-radius: 16px;
    padding: 18px;
    color: #fff;
    box-shadow: 0 10px 22px rgba(0,0,0,0.25);
}

.cpl-v2-subtitle {
    font-size: 22px;
    font-weight: 800;
    color: #f5c542;
    margin-bottom: 14px;
}

.cpl-v2-table-wrap {
    overflow-x: auto;
}

.cpl-v2-table {
    width: 100%;
    min-width: 980px;
    border-collapse: collapse;
    background: rgba(255,255,255,0.02);
    border-radius: 12px;
    overflow: hidden;
}

/* sortable header */
.cpl-v2-table thead th {
    background: rgba(255,255,255,0.06);
    color: #f5c542;
    text-align: left;
    padding: 12px 10px;
    font-size: 13px;
    font-weight: 800;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    position: sticky;
    top: 0;
    z-index: 2;
}

.cpl-v2-table thead th.cpl-sortable {
    cursor: pointer;
    user-select: none;
    position: sticky;
    padding-right: 26px;
}

.cpl-v2-table thead th.cpl-sortable::after {
    content: "↕";
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    color: rgba(255,255,255,0.45);
}

.cpl-v2-table thead th.cpl-sortable[data-sort-dir="asc"]::after {
    content: "▲";
    color: #f5c542;
}

.cpl-v2-table thead th.cpl-sortable[data-sort-dir="desc"]::after {
    content: "▼";
    color: #f5c542;
}

.cpl-v2-table tbody td {
    padding: 10px;
    color: #fff;
    font-size: 14px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.cpl-v2-table tbody tr {
    transition: 0.2s;
}

.cpl-v2-table tbody tr:hover {
    background: rgba(245,197,66,0.08);
    transform: scale(1.01);
}

.cpl-v2-table tbody td:nth-child(4),
.cpl-v2-table tbody td:nth-child(8) {
    color: #f5c542;
    font-weight: 700;
}

/* player cell + avatar */
.cpl-v2-player-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cpl-v2-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
    background: #f5c542;
    color: #000;
    font-weight: 900;
    position: relative;
    flex: 0 0 32px;
}

.cpl-v2-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cpl-v2-avatar-fallback {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.cpl-v2-player-meta strong {
    color: #fff;
    font-size: 14px;
}

/* Top 3 */
.cpl-v2-rank-1 {
    background: rgba(255, 215, 0, 0.10);
    box-shadow: inset 0 0 0 1px rgba(255,215,0,0.18);
}

.cpl-v2-rank-2 {
    background: rgba(192, 192, 192, 0.08);
}

.cpl-v2-rank-3 {
    background: rgba(205, 127, 50, 0.08);
}

.cpl-v2-rank-1 td:first-child {
    color: gold;
    font-weight: 900;
}

.cpl-v2-rank-2 td:first-child {
    color: silver;
    font-weight: 900;
}

.cpl-v2-rank-3 td:first-child {
    color: #cd7f32;
    font-weight: 900;
}

.cpl-v2-empty {
    color: #cbd5e1;
    padding: 10px 0;
}

/* ================================
   MOBILE
================================ */
@media (max-width: 640px) {
    .cpl-v2-cards {
        grid-template-columns: 1fr;
    }

    .cpl-v2-subtitle {
        font-size: 18px;
    }

    /* إخفاء بعض الأعمدة الأقل أهمية على الموبايل */
    .cpl-v2-table th:nth-child(5),
    .cpl-v2-table td:nth-child(5),
    .cpl-v2-table th:nth-child(6),
    .cpl-v2-table td:nth-child(6),
    .cpl-v2-table th:nth-child(9),
    .cpl-v2-table td:nth-child(9),
    .cpl-v2-table th:nth-child(10),
    .cpl-v2-table td:nth-child(10) {
        display: none;
    }
}