@font-face { 
    font-family: 'Trap';
    src: url('Trap-Bold-700.otf') format('opentype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Technor Semibold';
    src: url('Technor-Semibold.otf') format('opentype');
    font-weight: 600; 
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Technor Regular';
    src: url('Technor-Regular.otf') format('opentype');
    font-weight: 400; 
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Technor Light';
    src: url('Technor-Light.otf') format('opentype');
    font-weight: 300; 
    font-style: normal;
    font-display: swap;
}

:root {
    --tier-s: #ef4444;
    --tier-a: #f97316;
    --tier-b: #eab308;
    --tier-c: #84cc16;
    --tier-d: #3b82f6;
    --tier-f: #a855f7;
    --tier-bg-high: rgba(255, 255, 255, 0.05);
    --tier-bg-low: rgba(255, 255, 255, 0.02);
}

.mc-btn:hover {
    cursor: pointer;
}

.tierlist-header {
    margin-top: 120px;
    text-align: center;
    padding: 2rem;
}

.tierlist-title {
    font-family: 'Minecraft', 'VT323', monospace;
    font-size: 4rem;
    color: var(--mc-blue-light);
    margin-bottom: 1rem;
    text-shadow: 4px 4px 0 var(--mc-blue-dark);
}

.tierlist-subtitle {
    font-family: 'Poppins', sans-serif;
    font-family: 'Technor Light', 'Poppins', sans-serif;
    color: var(--text-gray);
    font-size: 1.2rem;
    max-width: 600px;
    margin: 0 auto;
}

.gamemode-selector {
    display: flex;
    justify-content: center;
    gap: 1rem;
    padding: 2rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.gamemode-selector .gamemode-item {
    font-family: 'VT323', monospace;
    font-size: 1rem;
    padding: 1rem 1.5rem;
    transition: all 0.3s ease;
    border-radius: 0px;
    border-color: var(--mc-border);
}

.fa-globe {
    color: #4aadd6 !important; /* Custom color to match images */
}

.gamemode-selector .gamemode-item i {
    margin-right: 8px;
}

.gamemode-selector .gamemode-item img {
    width: 20px;
    height: 20px;
    margin-right: 8px;
    vertical-align: middle;
    object-fit: contain;
}

.gamemode-selector .gamemode-item.active {
    border-color: var(--gm-color);
    box-shadow: 0 0 20px var(--gm-color);
    background: rgba(255, 255, 255, 0.05);
    color: white;
    transform: translateY(-3px);
}

/* Overall */
.gamemode-selector .gamemode-item:nth-child(1) { --gm-color: #64748b !important; }
.gamemode-selector .gamemode-item:nth-child(1):hover { border-color: #64748b; box-shadow: 0 0 15px #64748b; background: rgba(255, 255, 255, 0.05);}

/* Netherite Pot */
.gamemode-selector .gamemode-item:nth-child(2) { --gm-color: #8b5cf6 !important; }
.gamemode-selector .gamemode-item:nth-child(2):hover { border-color: #8b5cf6; box-shadow: 0 0 15px #8b5cf6; background: rgba(255, 255, 255, 0.05);}

/* Diamond Pot */
.gamemode-selector .gamemode-item:nth-child(3) { --gm-color: #f97316 !important; }
.gamemode-selector .gamemode-item:nth-child(3):hover { border-color: #f97316; box-shadow: 0 0 15px #f97316; background: rgba(255, 255, 255, 0.05);}
/* SMP Kit  */
.gamemode-selector .gamemode-item:nth-child(4) { --gm-color: #22c55e !important; }
.gamemode-selector .gamemode-item:nth-child(4):hover { border-color: #22c55e; box-shadow: 0 0 15px #22c55e; background: rgba(255, 255, 255, 0.05);}

/* Sword */
.gamemode-selector .gamemode-item:nth-child(5) { --gm-color: #06b6d4 !important; }
.gamemode-selector .gamemode-item:nth-child(5):hover { border-color: #06b6d4; box-shadow: 0 0 15px #06b6d4; background: rgba(255, 255, 255, 0.05);}
/* Crystal */
.gamemode-selector .gamemode-item:nth-child(6) { --gm-color: #d946ef !important; }
.gamemode-selector .gamemode-item:nth-child(6):hover { border-color: #d946ef; box-shadow: 0 0 15px #d946ef; background: rgba(255, 255, 255, 0.05); }

/* Axe */
.gamemode-selector .gamemode-item:nth-child(7) { --gm-color: #8f3505 !important; }
.gamemode-selector .gamemode-item:nth-child(7):hover { border-color: #8f3505; box-shadow: 0 0 15px #8f3505; background: rgba(255, 255, 255, 0.05); }

/* Mace */
.gamemode-selector .gamemode-item:nth-child(8) { --gm-color: #eab308 !important; }
.gamemode-selector .gamemode-item:nth-child(8):hover { border-color: #eab308; box-shadow: 0 0 15px #eab308; background: rgba(255, 255, 255, 0.05); }

/* UHC */
.gamemode-selector .gamemode-item:nth-child(9) { --gm-color: #ef4444 !important; }
.gamemode-selector .gamemode-item:nth-child(9):hover { border-color: #ef4444; box-shadow: 0 0 15px #ef4444; background: rgba(255, 255, 255, 0.05); }

.tierlist-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px 100px;
    min-height: 500px;
}

.tier-row {
    background: transparent;
    border: none;
    margin-bottom: 2rem;
    overflow: visible;
    box-shadow: none;
    backdrop-filter: none;
}

.tier-header {
    padding: 1rem 3rem;
    font-family: 'Technor Semibold', sans-serif;
    font-weight: 600;
    font-size: 2rem;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
    clip-path: polygon(
        10px 0,                 /* Top-left start */
        calc(100% - 10px) 0,    /* Top-right start */
        100% 10px,              /* Right side top helper */
        100% 100%,              /* Bottom right */
        0 100%,                 /* Bottom left */
        0 10px                  /* Left side top helper */
    );
    margin-bottom: -1px; 
    position: relative;
    z-index: 10;
}

.tier-header span:first-child {
    background: linear-gradient(to bottom, #fff, #e2e8f0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 2px 2px rgba(0,0,0,0.3));
}

.player-count {
    font-size: 0.8rem;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    background: rgba(0, 0, 0, 0.3);
    padding: 4px 12px;
    border-radius: 20px;
    color: rgba(255, 255, 255, 0.9);
}

.tier-content {
    display: flex;
    flex-direction: column;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid var(--mc-border);
    border-top: none;
    border-radius: 0 0 12px 12px;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
}

.tier-players {
    padding: 1rem;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.8rem;
    background: rgba(0, 0, 0, 0.2);
}

.player-card {
    background: rgba(30, 41, 59, 0.6);
    border: 2px solid rgba(255, 255, 255, 0.1);
    padding: 0.5rem;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    border-radius: 0;
    width: auto; 
    min-width: 0;
    box-shadow: 3px 3px 0 rgba(0,0,0,0.5);
}

.player-card.is-ht {
    border-color: rgba(255, 255, 255, 0.3);
}

.player-card:hover {
    transform: translate(-2px, -2px);
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--mc-blue);
    box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.3);
}

.player-card img {
    width: 36px;
    height: 36px;
    border-radius: 4px;
    background: rgba(0,0,0,0.3);
}

.player-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    line-height: 1.2;
}

.player-name {
    font-family: 'Trap', 'Poppins', sans-serif;
    font-weight: 700;
    color: var(--text-white);
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.ht-icon {
    font-size: 0.8rem;
    color: #4ade80; 
    filter: drop-shadow(0 0 5px rgba(74, 222, 128, 0.5));
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {transform: translateY(0);}
    40% {transform: translateY(-3px);}
    60% {transform: translateY(-1.5px);}
}

.player-region {
    font-size: 0.7rem;
    color: var(--text-gray);
    font-family: monospace;
    opacity: 0.8;
}

.player-tags {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 4px;
    flex-wrap: nowrap;
    overflow: hidden;
}

.mini-tag {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 0.65rem;
    color: var(--text-gray);
    font-family: monospace;
    background: rgba(0,0,0,0.4);
    padding: 1px 4px;
    /* border-radius: 3px; */
    white-space: nowrap;
    border: 1px solid rgba(255,255,255,0.05);
    flex-shrink: 0;
}
.mini-tag i {
    font-size: 0.65rem;
    opacity: 0.9;
}
.mini-tag img.tag-icon {
    width: 10px;
    height: 10px;
    vertical-align: middle;
}

.loading-spinner {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
    font-family: 'Minecraft', monospace;
    font-size: 1.5rem;
    color: var(--mc-blue);
    gap: 1rem;
}

.loading-spinner i {
    animation: spin 1s linear infinite;
}

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

.search-container {
    max-width: 600px;
    margin: 0 auto 2rem;
    position: relative;
    padding: 0 20px;
}

.search-input {
    width: 100%;
    background: rgba(15, 23, 42, 0.8);
    border: 2px solid var(--mc-border);
    padding: 1rem 3rem 1rem 1.5rem;
    color: white;
    font-family: 'Trap', 'Poppins', sans-serif;
    font-size: 1.1rem;
    /* border-radius: 8px;  */
    transition: all 0.2s;
}

.search-input:focus {
    outline: none;
    border-color: var(--mc-blue);
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.2);
}

.search-icon {
    position: absolute;
    right: 35px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-gray);
    pointer-events: none;
}


.tier-header span:first-child,
.tier-1 .tier-header span:first-child,
.tier-2 .tier-header span:first-child,
.tier-3 .tier-header span:first-child {
    background: none;
    -webkit-text-fill-color: inherit; 
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.player-count {
    background: rgba(0,0,0,0.2) !important;
    color: inherit !important;
    border: 1px solid rgba(255,255,255,0.2) !important;
    opacity: 0.9;
}

/* Tier 1 */
.tier-1 .tier-header {
    background: linear-gradient(110deg, #d4af37 0%, #d4af37 40%, #ffdf80 50%, #d4af37 60%, #aa8c2c 100%);
    color: #3e2723;
    text-shadow: none;
}
.tier-1 .player-card.is-ht .ht-icon { color: #f59e0b; }
.tier-1 .player-card.is-ht {
    background: linear-gradient(90deg, rgba(30, 41, 59, 0.8) 0%, rgba(212, 175, 55, 0.25) 100%);
    border-color: rgba(255, 255, 255, 0.5);
}

/* Tier 2 */
.tier-2 .tier-header {
    background: linear-gradient(110deg, #9ca3af 0%, #9ca3af 40%, #e2e8f0 50%, #9ca3af 60%, #64748b 100%);
    color: #1e293b;
    text-shadow: none;
}
.tier-2 .player-card.is-ht .ht-icon { color: #38bdf8; }
.tier-2 .player-card.is-ht {
    background: linear-gradient(90deg, rgba(30, 41, 59, 0.8) 0%, rgba(156, 163, 175, 0.25) 100%);
    border-color: rgba(255, 255, 255, 0.5);
}

/* Tier 3 */
.tier-3 .tier-header {
    background: linear-gradient(110deg, #a0522d 0%, #a0522d 40%, #cd853f 50%, #a0522d 60%, #8b4513 100%);
    color: #fff;
}
.tier-3 .player-card.is-ht .ht-icon { color: #ea580c; }
.tier-3 .player-card.is-ht {
    background: linear-gradient(90deg, rgba(30, 41, 59, 0.8) 0%, rgba(160, 82, 45, 0.25) 100%);
    border-color: rgba(255, 255, 255, 0.5);
}

/* Tier 4 */
.tier-4 .tier-header {
    background: linear-gradient(110deg, #991b1b 0%, #991b1b 40%, #f87171 50%, #991b1b 60%, #7f1d1d 100%);
    color: white; 
}
.tier-4 .player-card.is-ht .ht-icon { color: #f87171; }
.tier-4 .player-card.is-ht {
    background: linear-gradient(90deg, rgba(30, 41, 59, 0.8) 0%, rgba(153, 27, 27, 0.25) 100%);
    border-color: rgba(255, 255, 255, 0.5);
}

/* Tier 5 */
.tier-5 .tier-header {
    background: linear-gradient(110deg, #334155 0%, #334155 40%, #64748b 50%, #334155 60%, #1e293b 100%);
    color: white;
}
.tier-5 .player-card.is-ht .ht-icon { color: #94a3b8; }
.tier-5 .player-card.is-ht {
    background: linear-gradient(90deg, rgba(30, 41, 59, 0.8) 0%, rgba(79, 96, 120, 0.8) 100%);
    border-color: rgba(255, 255, 255, 0.5);
}
.tier-header {
    cursor: pointer;
    user-select: none;
}

.toggle-icon {
    display: inline-block;
    margin-right: 12px;
    transition: transform 0.3s ease;
    font-size: 0.8em;
    vertical-align: middle;
    opacity: 0.8;
}

.tier-row.collapsed .toggle-icon {
    transform: rotate(-90deg);
}

.tier-content {
    transition: max-height 0.4s ease-out, opacity 0.4s ease-out, margin 0.4s ease, border-width 0.1s linear 0s;
    opacity: 1;
    overflow: hidden;
}

.tier-row.collapsed .tier-content {
    max-height: 0;
    opacity: 0;
    margin-top: 0;
    border-width: 0;
    transition: max-height 0.4s ease-out, opacity 0.3s ease-out, margin 0.4s ease, border-width 0.1s linear 0.4s;
}

/* Scroll to Top Button */
.scroll-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--mc-blue);
    border: 2px solid var(--mc-blue-dark);
    box-shadow: 0 4px 0 var(--mc-blue-dark);
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 888;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 1.5rem;
}

.scroll-top::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    right: 2px;
    height: 2px;
    background: rgba(255, 255, 255, 0.3);
}

.scroll-top.visible {
    opacity: 1;
    visibility: visible;
}

.scroll-top:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 15px rgba(59, 130, 246, 0.4);
    background: var(--mc-blue-light);
}

.scroll-top:active {
    transform: translateY(2px);
    box-shadow: 0 0 0 var(--mc-blue-dark);
}

/* Search & Filter Styles */
.search-container {
    display: flex;
    gap: 10px;
    align-items: center;
    position: relative;
    z-index: 50;
}

.search-input-wrapper {
    position: relative;
    flex: 1;
}

.search-input {
    width: 100%;
}

.search-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-gray);
    pointer-events: none;
}

.filter-wrapper {
    position: relative;
    z-index: 50;
}

.filter-btn {
    padding: 0;
    width: 50px;
    height: 52px; 
    display: flex;
    justify-content: center;
    align-items: center;
    /* border-radius: 8px; */
    background: rgba(15, 23, 42, 0.8);
    border: 2px solid var(--mc-border);
}

.filter-btn::before {
    background: none;
}

.filter-btn:hover {
    background: rgba(30, 41, 59, 0.9);
    border-color: transparent
}

.filter-popup {
    position: absolute;
    bottom: calc(100% + 12px);
    top: auto;
    right: 0;
    width: 200px;
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid var(--mc-blue);
    /* border-radius: 8px; */
    padding: 10px;
    z-index: 9999;
    backdrop-filter: blur(10px);
    box-shadow: 0 5px 25px rgba(0,0,0,0.5);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px) scale(0.95);
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1); /* Pop effect */
}

.filter-popup.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 8px;
    margin-bottom: 8px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    font-family: 'Technor Semibold', sans-serif;
    color: white;
    font-size: 0.9rem;
}

.clear-filters {
    font-size: 0.75rem;
    color: var(--mc-blue-light);
    cursor: pointer;
    text-decoration: underline;
}

.clear-filters:hover {
    color: white;
}

.filter-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-option {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-gray);
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
    font-size: 0.9rem;
    padding: 4px;
    border-radius: 4px;
    transition: background 0.2s;
}

.filter-option:hover {
    background: rgba(255,255,255,0.05);
    color: white;
}

.filter-option input {
    display: none;
}

.checkbox-custom {
    width: 18px;
    height: 18px;
    border: 2px solid var(--text-gray);
    border-radius: 4px;
    position: relative;
    transition: all 0.2s;
}

.filter-option input:checked + .checkbox-custom {
    background: var(--mc-blue);
    border-color: var(--mc-blue);
}

.filter-option input:checked + .checkbox-custom::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 1px;
    width: 5px;
    height: 9px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Leaderboard Styles */
.leaderboard-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.lb-header {
    display: flex;
    padding: 1rem 1.5rem;
    color: var(--text-gray);
    font-family: 'Technor Semibold', sans-serif;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 1px;
}

.lb-col {
    display: flex;
    align-items: center;
}

.lb-rank { width: 100px; justify-content: center; }
.lb-player { flex: 1; padding-left: 1rem; }
.lb-region { width: 100px; justify-content: center; }
.lb-badges-col { width: 440px; justify-content: flex-end; }

.leaderboard-row {
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(90deg, #334155 0%, #334155 40px, rgba(0,0,0,0.6) 50%, #334155 calc(100% - 40px), #334155 100%);
    border: none;
    margin-bottom: 0.8rem;
    padding: 2px;
    transition: all 0.2s ease;
    cursor: pointer;
    clip-path: polygon(20px 0, 100% 0, 100% calc(100% - 20px), calc(100% - 20px) 100%, 0 100%, 0 20px);
    position: relative;
    z-index: 1;
}

.lb-inner {
    display: flex;
    align-items: center;
    width: 100%;
    height: 100%;
    margin: 0;
    background: #0f172a;
    padding: 1rem 1.5rem;
    clip-path: polygon(18.5px 0, 100% 0, 100% calc(100% - 18.5px), calc(100% - 18.5px) 100%, 0 100%, 0 18.5px);
}

.leaderboard-row:hover {
    transform: translateY(-2px);
    background: linear-gradient(90deg, #475569 0%, #475569 40px, rgba(0,0,0,0.6) 50%, #475569 calc(100% - 40px), #475569 100%);
}

.leaderboard-row:hover .lb-inner {
    background: #1e293b;
}

/* Rank Styles */
.lb-rank {
    font-family: 'Trap', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-gray);
    position: relative;
    text-align: center;
}

.rank-num {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: #111;
    border: 2px solid;
    border-image: linear-gradient(to bottom, #555 0%, #e0e0e0 100%) 1;
    position: relative;
    z-index: 2;
    margin: 0 auto;
    font-family: 'VT323', monospace;
    font-size: 1.2rem;
    color: #fff;
    box-shadow: 0 5px 10px rgba(0,0,0,0.5);
    transform: rotate(45deg);
    transition: box-shadow 0.2s;
}
.rank-num span {
    transform: rotate(-45deg);
    display: block;
    width: 100%;
    text-align: center;
}

/* Top 3 Diamond Colors */
.rank-1 {
    border-image: linear-gradient(to bottom, #eab308 0%, #fffbe6 100%) 1;
    box-shadow: 0 0 15px rgba(234, 179, 8, 0.2);
    color: #eab308;
}
.rank-2 {
    border-image: linear-gradient(to bottom, #8ea5c2 0%, #ffffff 100%) 1;
    box-shadow: 0 0 15px rgba(226, 232, 240, 0.2);
    color: #e2e8f0;
}
.rank-3 {
    border-image: linear-gradient(to bottom, #f97316 0%, #fff0e0 100%) 1;
    box-shadow: 0 0 15px rgba(249, 115, 22, 0.2);
    color: #f97316;
}

.rank-trophy {
    font-size: 1rem;
    margin-left: 5px;
    position: absolute;
    top: -5px;
    right: 15px; 
    opacity: 0.8;
}

.rank-1 .lb-rank { color: #eab308; text-shadow: 0 0 10px rgba(234, 179, 8, 0.3); }
.rank-2 .lb-rank { color: #e2e8f0; text-shadow: 0 0 10px rgba(226, 232, 240, 0.3); }
.rank-3 .lb-rank { color: #f97316; text-shadow: 0 0 10px rgba(249, 115, 22, 0.3); }

.rank-1.leaderboard-row { background: linear-gradient(90deg, #eab308 0%, #eab308 40px, rgba(0,0,0,0.6) 50%, #eab308 calc(100% - 40px), #eab308 100%); padding: 2px; }
.rank-2.leaderboard-row { background: linear-gradient(90deg, #cbd5e1 0%, #cbd5e1 40px, rgba(0,0,0,0.6) 50%, #cbd5e1 calc(100% - 40px), #cbd5e1 100%); padding: 2px; }
.rank-3.leaderboard-row { background: linear-gradient(90deg, #f97316 0%, #f97316 40px, rgba(0,0,0,0.6) 50%, #f97316 calc(100% - 40px), #f97316 100%); padding: 2px; }

/* Avatar Background for All */
.lb-avatar {
    padding: 6px;
    clip-path: polygon(10px 0, calc(100% - 10px) 0, 100% 10px, 100% calc(100% - 10px), calc(100% - 10px) 100%, 10px 100%, 0 calc(100% - 10px), 0 10px);
    width: 60px;
    height: 60px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-right: 15px;
    background: linear-gradient(135deg, rgba(51, 65, 85, 0.5), rgba(15, 23, 42, 0.8));
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
    flex-shrink: 0;
}

/* Avatar Background for Top 3 */
.rank-1 .lb-avatar { background: linear-gradient(135deg, rgba(234, 179, 8, 0.2), rgba(0,0,0,0.4)); border-color: rgba(234, 179, 8, 0.3); box-shadow: 0 0 15px rgba(234, 179, 8, 0.1); }
.rank-2 .lb-avatar { background: linear-gradient(135deg, rgba(203, 213, 225, 0.2), rgba(0,0,0,0.4)); border-color: rgba(203, 213, 225, 0.3); box-shadow: 0 0 15px rgba(203, 213, 225, 0.1); }
.rank-3 .lb-avatar { background: linear-gradient(135deg, rgba(249, 115, 22, 0.2), rgba(0,0,0,0.4)); border-color: rgba(249, 115, 22, 0.3); box-shadow: 0 0 15px rgba(249, 115, 22, 0.1); }


/* Player Info */
.lb-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.lb-info {
    margin-left: 1rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.lb-name {
    font-family: 'Technor Semibold', sans-serif;
    font-size: 1.2rem;
    color: white;
    margin-bottom: 4px;
    line-height: 1.2;
}

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

.lb-pill {
    display: inline-flex;
    align-items: center;
    font-size: 0.7rem;
    padding: 2px 8px;
    /* border-radius: 4px; */
    border: 1px solid;
    font-family: 'Technor Regular', sans-serif;
    width: fit-content;
    white-space: nowrap;
}

.lb-title-icon {
    width: 12px;
    height: 12px;
    margin-right: 6px;
    object-fit: contain;
}

.lb-points-pill {
    margin: 0;
    border-color: var(--mc-blue-light);
    color: var(--mc-blue-light); 
    background: rgba(34, 211, 238, 0.1);
    font-weight: 600;
}

/* Region */
.region-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    /* border-radius: 4px; */
    font-family: 'Poppins', sans-serif;
    font-size: 0.9rem;
    color: #e2e8f0;
}

.region-pill i {
    color: #94a3b8;
}

.lb-badges-grid {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.lb-badges-grid .badge-item {
    margin-top: 0;
    flex-direction: column;
}

@media (max-width: 900px) {
    .lb-pills {
        margin-top: 5px;
        flex-wrap: wrap;
    }
    
    .lb-badges-grid {
        justify-content: flex-start;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 4px;
        width: 100%;
    }
    
    .lb-badges-grid::-webkit-scrollbar { height: 0px; width: 0px; }
    
    .lb-badge-item .badge-icon-wrapper {
        width: 32px; 
        height: 37px; 
    }
    .lb-badge-item .badge-icon-content {
        width: 14px;
        height: 14px;
    }
    .lb-badge-item .badge-label {
        font-size: 0.7rem;
    }
    
    .lb-region.desktop-region {
         display: none !important;
    }
    
    .region-pill-mobile {
        display: inline-flex !important;
        background: rgba(0, 0, 0, 0.4);
        border: 1px solid rgba(255, 255, 255, 0.1);
        /* border-radius: 4px; */
        color: #e2e8f0;
    }
    .region-pill-mobile i { color: #94a3b8; }
}

@media (max-width: 480px) {
    .lb-badge-item .badge-icon-wrapper {
        width: 28px;
        height: 32px; 
    }
    
    .lb-badges-grid {
        justify-content: space-between;
        gap: 2px;
    }
}


.is-ht i { color: #fbbf24; }
.is-ht .lb-badge-label { color: #fbbf24; }

.is-lt i { color: #fca5a5; }
.is-lt .lb-badge-label { color: #fca5a5; }

.tier-1.is-ht .lb-badge-content { background: #1a1200; }
.tier-1.is-ht i, .tier-1.is-ht .lb-badge-label { color: #fbbf24; text-shadow: 0 0 5px rgba(251, 191, 36, 0.5); }


@media (max-width: 1024px) {
    .lb-header { display: none; }
    
    .leaderboard-row {
        padding: 0;
    }

    .lb-inner { 
        flex-wrap: wrap; 
        padding: 1.25rem 1rem;
        position: relative;
        align-items: flex-start;
        height: auto;
    }
    
    .lb-rank { 
        width: 50px; 
        height: 48px; 
        justify-content: center; 
        align-items: center;
        margin-right: 0.5rem;
        font-size: 1.4rem;
        position: relative;
    }
    
    .rank-trophy {
        position: static; 
        margin-left: 0;
        display: block;
        font-size: 0.8rem;
        margin-top: -5px;
        text-align: center;
    }
    
    .lb-player { 
        flex: 1; 
        padding-left: 0; 
        margin-bottom: 0;
        min-width: 0; 
    }

    .lb-info {
        margin-left: 0.75rem;
    }
    
    .lb-region { 
        position: absolute; 
        top: 1.25rem; 
        right: 1rem; 
        width: auto; 
    }
    
    .lb-badges-col { 
        width: 100%; 
        flex-basis: 100%;
        justify-content: flex-start; 
        border-top: none; 
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        align-items: center;
    }

    .lb-badges-col::-webkit-scrollbar { height: 4px; }
    .lb-badges-col::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }
    
    .lb-badges-grid { 
        justify-content: flex-start;
        padding-top: 1rem;
        padding-bottom: 2px; 
    }
    
    .lb-badge { width: 38px; height: 44px; flex-shrink: 0; }
    .lb-badge i { font-size: 12px; }
    .lb-badge-label { font-size: 9px; }
}

@media (max-width: 480px) {
    .lb-rank {
        display: none;
    }

    .lb-inner {
        flex-direction: column;
        align-items: stretch;
        padding-bottom: 0.5rem;
    }

    .lb-player {
        flex-direction: row; 
        align-items: center;
        text-align: left;
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .lb-info {
        align-items: flex-start;
        min-width: 0; 
    }

    .lb-badges-col {
        width: 100%;
        justify-content: center;
    }
    
    .lb-badges-grid {
        justify-content: center;
        padding-top: 1rem;
        flex-wrap: wrap;
        gap: 4px;
    }

    .lb-avatar { margin-right: 0; flex-shrink: 0; }
}
/* Discord Button Stats Styles */
.discord-btn-container {
    padding: 8px 25px !important; /* Adjust padding to accommodate taller content */
}

.discord-btn-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.2;
    text-align: left;
}

.discord-btn-title {
    font-family: 'VT323', monospace;
    font-size: 1.3rem; /* Slightly larger to stand out */
}

.discord-stats {
    display: flex;
    align-items: center;
    font-family: 'Poppins', sans-serif;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 8px;
}

.status-dot.green {
    background-color: #4ade80;
    box-shadow: 0 0 4px #4ade80;
}

.status-dot.grey {
    background-color: #94a3b8;
}

.separator {
    margin: 0 6px;
    opacity: 0.6;
}

@media (max-width: 600px) {
    .discord-btn-container {
        flex-direction: column !important;
        align-items: center !important;
        gap: 4px;
        padding: 12px 20px !important;
        height: auto !important;
    }

    .discord-btn-container i {
        margin-right: 0 !important;
        margin-bottom: 2px;
        font-size: 1.6em !important;
    }

    .discord-btn-content {
        align-items: center !important;
    }
}

.profile-link-copy-toast {
    display: none;
}

.minecraft-popup {
    margin: 20px auto;
    max-width: 600px;
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid #8B4513;
    border-radius: 5px;
    padding: 15px;
    font-family: 'VT323', monospace;
    color: #FFD700;
    text-align: center;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

.popup-content {
    font-size: 18px;
    line-height: 1.4;
}

.top-badge.discord-badge {
    color: #5865F2;
    border-color: rgba(88, 101, 242, 0.3);
    background: rgba(88, 101, 242, 0.1);
}

.top-badge.discord-badge:hover {
    background: rgba(88, 101, 242, 0.2);
    border-color: #5865F2;
}