/* ============================================
   TIER BADGE OVERRIDE - copy từ mctier.css
   size-9 = 36px container, size-4 = 16px icon
   ============================================ */

/* Override icon circle - VIỀN THEO MÀU TIER */
.player-tiers [title*="HT1"] > div:first-child,
.player-tiers [title*="HT2"] > div:first-child,
.player-tiers [title*="HT3"] > div:first-child,
.player-tiers [title*="HT4"] > div:first-child,
.player-tiers [title*="HT5"] > div:first-child,
.player-tiers [title*="LT1"] > div:first-child,
.player-tiers [title*="LT2"] > div:first-child,
.player-tiers [title*="LT3"] > div:first-child,
.player-tiers [title*="LT4"] > div:first-child,
.player-tiers [title*="LT5"] > div:first-child {
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    min-height: 44px !important;
    background-color: #0a0e14 !important;
    box-shadow: none !important;
}

/* Viền theo màu tier foreground — copy từ mctier.css CSS variables */
.player-tiers [title*="HT1"] > div:first-child { border: 2px solid #e8ba3a !important; } /* --ht1-foreground */
.player-tiers [title*="HT2"] > div:first-child { border: 2px solid #c4d3e7 !important; } /* --ht2-foreground */
.player-tiers [title*="HT3"] > div:first-child { border: 2px solid #f89f5a !important; } /* --ht3-foreground */
.player-tiers [title*="HT4"] > div:first-child { border: 2px solid #81749a !important; } /* --ht4-foreground */
.player-tiers [title*="HT5"] > div:first-child { border: 2px solid #8f82a8 !important; } /* --ht5-foreground */
.player-tiers [title*="LT1"] > div:first-child { border: 2px solid #d5b355 !important; } /* --lt1-foreground */
.player-tiers [title*="LT2"] > div:first-child { border: 2px solid #a0a7b2 !important; } /* --lt2-foreground */
.player-tiers [title*="LT3"] > div:first-child { border: 2px solid #c67b42 !important; } /* --lt3-foreground */
.player-tiers [title*="LT4"] > div:first-child { border: 2px solid #655b79 !important; } /* --lt4-foreground */
.player-tiers [title*="LT5"] > div:first-child { border: 2px solid #655b79 !important; } /* --lt5-foreground */

/* Icon bên trong: size-4 = 16px (mctier.css) */
.player-tiers [title*="HT"] > div:first-child img,
.player-tiers [title*="LT"] > div:first-child img {
    width: 22px !important;
    height: 22px !important;
    max-width: 22px !important;
    max-height: 22px !important;
}

/* Tier label */
.player-tiers [title*="HT"] > span,
.player-tiers [title*="LT"] > span {
    font-size: 11px !important;
    padding: 2px 5px !important;
    border-radius: 5px !important;
    margin-top: 2px !important;
}

/* Label colors — copy từ mctier.css: --htN / --htN-foreground */
.player-tiers [title*="HT1"] > span { background: #6d5d2c !important; color: #e8ba3a !important; border: none !important; }
.player-tiers [title*="HT2"] > span { background: #5e6979 !important; color: #c4d3e7 !important; border: none !important; }
.player-tiers [title*="HT3"] > span { background: #6b4b36 !important; color: #f89f5a !important; border: none !important; }
.player-tiers [title*="HT4"] > span { background: #303144 !important; color: #81749a !important; border: none !important; }
.player-tiers [title*="HT5"] > span { background: #2b2c3d !important; color: #8f82a8 !important; border: none !important; }
.player-tiers [title*="LT1"] > span { background: #584c25 !important; color: #d5b355 !important; border: none !important; }
.player-tiers [title*="LT2"] > span { background: #4a505a !important; color: #a0a7b2 !important; border: none !important; }
.player-tiers [title*="LT3"] > span { background: #593722 !important; color: #c67b42 !important; border: none !important; }
.player-tiers [title*="LT4"] > span { background: #2c2e40 !important; color: #655b79 !important; border: none !important; }
.player-tiers [title*="LT5"] > span { background: #262a3a !important; color: #655b79 !important; border: none !important; }

/* Player list luôn hiển thị */
.player-list {
    opacity: 1;
}

/* Unranked/empty */
.player-tiers [title*="Unranked"] > div:first-child {
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    min-height: 44px !important;
    border: 2px dashed rgba(255,255,255,0.12) !important;
    background: rgba(255,255,255,0.02) !important;
    box-shadow: none !important;
}

.player-tiers [title*="Unranked"] > div:first-child img {
    width: 22px !important;
    height: 22px !important;
    max-width: 22px !important;
    max-height: 22px !important;
    opacity: 0.15 !important;
    filter: grayscale(1) !important;
}

.player-tiers [title*="Unranked"] > span {
    color: rgba(255,255,255,0.18) !important;
    background: transparent !important;
    border: none !important;
    font-size: 11px !important;
}

/* Container mỗi chip: 44px circle + padding = 48px */
.player-tiers > div {
    width: 48px !important;
}


/* ============================================
   TIER TABLE STYLING - GAMING DASHBOARD
   ============================================ */

#leaderboard-wrapper {
    width: 100%;
}

.table-scroll {
    width: 100%;
    overflow-x: auto;
}

.fixed-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 8px 0;
    table-layout: fixed;
    border: none;
}

.fixed-table tbody {
    border: none;
}

.fixed-table tbody tr:last-child td {
    border-bottom: none;
}

/* TIER HEADERS - Gaming Style */
.tier-header {
    padding: 0;
    text-align: center;
    font-weight: 700;
    border: none;
    position: relative;
}

.tier-header-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 12px;
    border-radius: 10px 10px 0 0;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    transition: background 0.2s ease;
    border: none;
    box-shadow: none;
}

.tier-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    object-fit: contain;
}

.tier-text {
    font-size: 15px;
}

/* Tier 1 - Gold */
.tier-1 .tier-header-content {
    background: linear-gradient(135deg, #5c4400 0%, #7a5a00 100%);
    color: #f4b400;
}

/* Tier 2 - Silver */
.tier-2 .tier-header-content {
    background: linear-gradient(135deg, #2a2e38 0%, #3a3f4d 100%);
    color: #c4d3e7;
}

/* Tier 3 - Bronze */
.tier-3 .tier-header-content {
    background: linear-gradient(135deg, #4e342e 0%, #6b4b36 100%);
    color: #f89f5a;
}

/* Tier 4 - Dark Blue */
.tier-4 .tier-header-content {
    background: linear-gradient(135deg, #1a1f2e 0%, #252b3d 100%);
    color: #8b9dc3;
}

/* Tier 5 - Dark Gray */
.tier-5 .tier-header-content {
    background: linear-gradient(135deg, #1a1f2e 0%, #252b3d 100%);
    color: #7a8599;
}

/* PLAYER CARDS - Gaming Style (Horizontal Layout) */
.fixed-table tbody td {
    padding: 1px 2px;
    vertical-align: top;
}

.fixed-table .player {
    background: #1e2a3a;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: background 0.15s ease;
    cursor: pointer;
}

.fixed-table .player:hover {
    background: #263244;
    border-color: rgba(255, 255, 255, 0.14);
}

.fixed-table .player:hover .arrow-icon {
    color: #94a3b8 !important;
    transform: translateY(-2px);
}

.fixed-table .ht-player {
    background: #263244;
    border-color: rgba(58, 159, 191, 0.2);
}

.fixed-table .ht-player:hover {
    background: #3e4f68;
    border-color: rgba(58, 159, 191, 0.35);
}

.fixed-table .ht-player .arrow-icon {
    color: rgba(178, 218, 255, 0.6) !important;
}

.fixed-table .ht-player:hover .arrow-icon {
    color: rgba(178, 218, 255, 0.9) !important;
}

.fixed-table .player .avatar {
    border: none !important;
    transition: none;
}

.fixed-table .player:hover .avatar {
    border: none !important;
}

.fixed-table .player .player-name {
    color: #e4e8f0;
    font-weight: 600;
}

/* Skeleton loading */
.skeleton-player {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    background: #1a1f2e;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 6px;
}

.skeleton {
    background: linear-gradient(90deg, rgba(255,255,255,0.03) 25%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.03) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: 4px;
}

.skeleton-avatar-sm {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    flex-shrink: 0;
}

.skeleton-avatar-md {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    flex-shrink: 0;
}

.skeleton-avatar-sm-new {
    width: 28px;
    height: 28px;
    border-radius: 3px;
    flex-shrink: 0;
}

.skeleton-avatar-xs {
    width: 20px;
    height: 20px;
    border-radius: 2px;
    flex-shrink: 0;
}

.skeleton-name-sm {
    width: 70px;
    height: 12px;
}

.skeleton-name-md {
    width: 80px;
    height: 13px;
}

.skeleton-name-xs {
    width: 60px;
    height: 10px;
}

.skeleton-name-xxs {
    width: 50px;
    height: 8px;
}

.skeleton-icon {
    width: 16px;
    height: 16px;
    border-radius: 2px;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Responsive */
@media (max-width: 768px) {
    .fixed-table {
        border-spacing: 4px 0;
    }
    
    .tier-header-content {
        padding: 10px 8px;
        font-size: 13px;
        gap: 4px;
    }
    
    .tier-icon {
        width: 16px;
        height: 16px;
    }
    
    .tier-text {
        font-size: 12px;
    }
    
    .fixed-table .player {
        padding: 10px 6px !important;
    }
}
