/* ============================================================
   Top Player Widget — Premium Card Style (Right Aligned Only)
   ============================================================ */

.ls-top-players { 
    font-family: inherit; 
    width: 100%; 
}

/* ── Header ── */
.ls-top-header { 
    display: flex; 
    align-items: center; 
    gap: 12px; 
    margin-bottom: 16px; 
    justify-content: space-between; /* บังคับหัวข้อไปซ้าย Dropdown ไปขวา */
}

.ls-top-heading { 
    margin: 0; 
    line-height: 1.2; 
    letter-spacing: -0.02em; 
    flex-shrink: 0; 
}

/* ── Custom Dropdown (Fixed Right) ── */
.ls-league-dropdown { 
    position: relative; 
    display: inline-block; 
    flex-basis: content !important;
}

.ls-league-btn {
    display: inline-flex; 
    align-items: center; 
    gap: 8px;
    padding: 7px 12px 7px 10px;
    border: 1.5px solid #e2e8f0; 
    border-radius: 8px;
    background: #fff; 
    color: #0f172a;
    cursor: pointer; 
    font-size: 13px; 
    font-weight: 600;
    white-space: nowrap; 
    min-width: 110px;
    transition: border-color .18s, box-shadow .18s;
}

.ls-league-btn:hover { 
    border-color: #94a3b8; 
    box-shadow: 0 2px 8px rgba(0,0,0,.08); 
}

.ls-btn-logo { width: 24px; height: 24px; object-fit: contain; flex-shrink: 0; }
.ls-btn-text { flex: 1; text-align: left; }
.ls-btn-arrow { font-size: 10px; opacity: .45; transition: transform .18s; flex-shrink: 0; }
.ls-league-btn[aria-expanded="true"] .ls-btn-arrow { transform: rotate(180deg); }

/* Panel เด้งลงมาและเกาะขอบขวาเสมอ */
.ls-league-panel {
    display: none;
    position: absolute; 
    top: calc(100% + 6px); 
    right: 0; /* เกาะขอบขวาของปุ่ม */
    min-width: 200px; 
    max-height: 320px; 
    overflow-y: auto;
    list-style: none; 
    margin: 0; 
    padding: 6px;
    border: 1.5px solid #e2e8f0; 
    border-radius: 10px;
    background: #fff; 
    box-shadow: 0 8px 24px rgba(0,0,0,.12);
    z-index: 9999;
}

.ls-league-panel.open { 
    display: block; 
    animation: ls-panel-in .15s ease; 
}

@keyframes ls-panel-in { 
    from { opacity: 0; transform: translateY(-5px); } 
    to { opacity: 1; transform: translateY(0); } 
}

.ls-league-opt {
    display: flex; 
    align-items: center; 
    gap: 10px;
    padding: 8px 10px; 
    border-radius: 7px;
    cursor: pointer; 
    font-size: 13px; 
    font-weight: 500; 
    color: #0f172a;
    transition: background .13s;
}

.ls-league-opt:hover { background: #f1f5f9; }
.ls-league-opt.selected { background: #f1f5f9; font-weight: 700; }
.ls-league-opt-logo { width: 24px; height: 24px; object-fit: contain; flex-shrink: 0; }
.ls-league-opt-name { flex: 1; white-space: nowrap; }

/* ── Grid ── */
.ls-players-grid { 
    display: grid; 
    gap: 10px; 
}

.ls-loading, .ls-empty, .ls-error { 
    text-align: center; 
    padding: 24px 16px; 
    font-size: 14px; 
    opacity: .55; 
}

/* ── Card ── */
.ls-player-card {
    position: relative; 
    display: flex; 
    align-items: center; 
    gap: 14px;
    border-radius: 14px; 
    overflow: hidden;
    transition: transform .22s ease, box-shadow .22s ease;
}

/* Rank Accent Lines */
.ls-player-card.ls-rank-1::before,
.ls-player-card.ls-rank-2::before,
.ls-player-card.ls-rank-3::before {
    content: ''; 
    position: absolute; 
    left: 0; 
    top: 0; 
    bottom: 0; 
    width: 4px;
    border-radius: inherit; 
    border-top-right-radius: 0; 
    border-bottom-right-radius: 0;
}

.ls-player-rank { 
    font-size: 22px; 
    font-weight: 900; 
    min-width: 30px; 
    text-align: center; 
    flex-shrink: 0; 
    letter-spacing: -0.04em; 
    line-height: 1; 
    font-variant-numeric: tabular-nums; 
}

.ls-photo-wrap { position: relative; flex-shrink: 0; }
.ls-player-photo { 
    display: block; 
    width: 52px; 
    height: 52px; 
    border-radius: 50%; 
    object-fit: cover; 
    object-position: top center; 
    border: 2px solid rgba(255,255,255,.15); 
}

.ls-photo-placeholder { 
    width: 52px; 
    height: 52px; 
    border-radius: 50%; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    font-size: 20px; 
    font-weight: 700; 
    color: #fff; 
    flex-shrink: 0; 
}

.ls-player-info { 
    flex: 1; 
    min-width: 0; 
    display: flex; 
    flex-direction: column; 
    gap: 3px; 
}

.ls-player-name { 
    font-size: 14px; 
    font-weight: 700; 
    line-height: 1.25; 
    white-space: nowrap; 
    overflow: hidden; 
    text-overflow: ellipsis; 
    letter-spacing: -0.01em; 
}

.ls-player-club { 
    font-size: 12px; 
    font-weight: 400; 
    line-height: 1.3; 
    white-space: nowrap; 
    overflow: hidden; 
    text-overflow: ellipsis; 
}

.ls-player-value-wrap { 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    flex-shrink: 0; 
    gap: 2px; 
}

.ls-player-value { 
    font-size: 22px; 
    font-weight: 900; 
    line-height: 1; 
    letter-spacing: -0.04em; 
    font-variant-numeric: tabular-nums; 
}

.ls-value-label { 
    font-size: 10px; 
    font-weight: 600; 
    text-transform: uppercase; 
    letter-spacing: .06em; 
    line-height: 1; 
}

/* ── Animation ── */
@keyframes ls-card-in { 
    from { opacity: 0; transform: translateY(14px); } 
    to { opacity: 1; transform: translateY(0); } 
}

.ls-players-grid .ls-player-card { 
    animation: ls-card-in .32s ease both; 
}

/* Staggered Delay */
.ls-player-card:nth-child(1)  { animation-delay: .03s; }
.ls-player-card:nth-child(2)  { animation-delay: .07s; }
.ls-player-card:nth-child(3)  { animation-delay: .11s; }
.ls-player-card:nth-child(4)  { animation-delay: .14s; }
.ls-player-card:nth-child(5)  { animation-delay: .17s; }
.ls-player-card:nth-child(6)  { animation-delay: .20s; }
.ls-player-card:nth-child(7)  { animation-delay: .23s; }
.ls-player-card:nth-child(8)  { animation-delay: .26s; }
.ls-player-card:nth-child(9)  { animation-delay: .29s; }
.ls-player-card:nth-child(10) { animation-delay: .32s; }