* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.footer-credit {
    text-align: center;
    padding: 2rem;
    color: #a855f7;
    font-size: 0.95rem;
    font-weight: 500;
    text-shadow: 0 0 10px rgba(168, 85, 247, 0.6), 
                 0 0 20px rgba(168, 85, 247, 0.4),
                 0 0 30px rgba(168, 85, 247, 0.2);
    animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { 
        text-shadow: 0 0 10px rgba(168, 85, 247, 0.6), 
                     0 0 20px rgba(168, 85, 247, 0.4),
                     0 0 30px rgba(168, 85, 247, 0.2);
    }
    50% { 
        text-shadow: 0 0 15px rgba(168, 85, 247, 0.8), 
                     0 0 30px rgba(168, 85, 247, 0.6),
                     0 0 45px rgba(168, 85, 247, 0.4);
    }
}

.footer-credit .heart {
    color: #ef4444;
    animation: heartbeat 1.5s ease-in-out infinite;
}

@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    10%, 30% { transform: scale(1.1); }
    20%, 40% { transform: scale(1); }
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Inter', sans-serif;
    background: #0a0014;
    color: #ffffff;
    min-height: 100vh;
    overflow-x: hidden;
}

.bg-image {
    position: fixed;
    inset: 0;
    background-image: url('./void-hero.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.2;
    z-index: -3;
    pointer-events: none;
}

.bg-gradient {
    position: fixed;
    inset: 0;
    background: radial-gradient(circle at 50% 40%, rgba(168, 85, 247, 0.08) 0%, transparent 60%),
                radial-gradient(circle at 80% 20%, rgba(139, 92, 246, 0.06) 0%, transparent 50%),
                radial-gradient(circle at 20% 80%, rgba(168, 85, 247, 0.05) 0%, transparent 50%);
    z-index: -2;
    pointer-events: none;
}

.bg-noise {
    position: fixed;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulance type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    opacity: 0.02;
    z-index: -1;
    pointer-events: none;
}

nav {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(10, 0, 20, 0.8);
    backdrop-filter: blur(40px) saturate(180%);
    border-bottom: 1px solid rgba(168, 85, 247, 0.12);
    box-shadow: 0 4px 30px rgba(168, 85, 247, 0.1);
}

.nav-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 3rem;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    min-width: 150px;
}

.logo-img {
    height: 40px;
    width: auto;
    object-fit: contain;
}

.logo-text {
    font-size: 1.3rem;
    font-weight: 700;
    color: rgba(168, 85, 247, 0.8);
}

.nav-center {
    display: flex;
    gap: 0.5rem;
    flex: 1;
    justify-content: center;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-link {
    padding: 0.6rem 1.2rem;
    color: rgba(255, 255, 255, 0.5);
    text-decoration: none;
    border-radius: 10px;
    transition: all 0.2s ease;
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: transparent;
    border: 1px solid transparent;
    cursor: pointer;
}

.nav-link:hover {
    color: rgba(255, 255, 255, 0.9);
    background: rgba(168, 85, 247, 0.08);
    border-color: rgba(168, 85, 247, 0.15);
}

.nav-link.active {
    color: #a855f7;
    background: rgba(168, 85, 247, 0.12);
    border-color: rgba(168, 85, 247, 0.2);
}

.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 50%;
    transform: translateX(-50%);
    width: 450px;
    background: rgba(10, 0, 20, 0.98);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(168, 85, 247, 0.2);
    border-radius: 12px;
    padding: 0.5rem;
    display: none;
    grid-template-columns: 1fr 1fr;
    gap: 0.25rem;
    box-shadow: 0 10px 40px rgba(168, 85, 247, 0.2);
    z-index: 1000;
}

.dropdown.active .dropdown-menu {
    display: grid;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s ease;
    font-weight: 600;
    font-size: 0.95rem;
}

.dropdown-item:hover {
    background: rgba(168, 85, 247, 0.15);
    color: #a855f7;
}

.search-container {
    position: relative;
    min-width: 200px;
}

.search-input {
    width: 280px;
    padding: 0.7rem 1rem 0.7rem 2.8rem;
    background: rgba(10, 0, 20, 0.7);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(168, 85, 247, 0.15);
    border-radius: 12px;
    color: #ffffff;
    font-size: 0.9rem;
    outline: none;
    transition: all 0.2s ease;
}

.search-input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.search-input:focus {
    border-color: rgba(168, 85, 247, 0.4);
    box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.1);
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    opacity: 0.4;
    pointer-events: none;
    z-index: 2;
    color: #a855f7;
}

.main-container {
    position: relative;
    z-index: 10;
    max-width: 1600px;
    margin: 0 auto;
    padding: 2rem;
}

.info-bar {
    background: rgba(10, 0, 20, 0.5);
    backdrop-filter: blur(30px) saturate(150%);
    border: 1px solid rgba(168, 85, 247, 0.15);
    border-radius: 16px;
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.tier-tabs-container {
    margin-bottom: 1.5rem;
}

.tier-tabs {
    display: flex;
    gap: 0.5rem;
    padding: 0.5rem;
    background: rgba(10, 0, 20, 0.5);
    backdrop-filter: blur(30px) saturate(150%);
    border: 1px solid rgba(168, 85, 247, 0.15);
    border-radius: 16px;
    overflow-x: auto;
    scrollbar-width: none;
    box-shadow: 0 8px 32px rgba(168, 85, 247, 0.1);
}

.tier-tabs::-webkit-scrollbar {
    display: none;
}

.tier-tab {
    min-width: 110px;
    padding: 0.8rem 1.2rem;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
    user-select: none;
}

.tier-tab:hover {
    color: rgba(255, 255, 255, 0.8);
    background: rgba(168, 85, 247, 0.08);
    border-color: rgba(168, 85, 247, 0.2);
    transform: translateY(-2px);
}

.tier-tab.active {
    color: #a855f7;
    background: rgba(168, 85, 247, 0.15);
    border-color: rgba(168, 85, 247, 0.3);
    box-shadow: 0 4px 20px rgba(168, 85, 247, 0.25);
}

.tier-icon {
    width: 32px;
    height: 32px;
    opacity: 0.6;
}

.tier-tab:hover .tier-icon {
    opacity: 0.9;
}

.tier-tab.active .tier-icon {
    opacity: 1;
}

.tier-groups-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: 1.5rem;
}

.tier-group {
    background: rgba(10, 0, 20, 0.5);
    backdrop-filter: blur(40px) saturate(150%);
    border: 1px solid rgba(168, 85, 247, 0.15);
    border-radius: 20px;
    overflow: hidden;
}

.tier-header {
    padding: 1rem 1.5rem;
    background: rgba(10, 0, 20, 0.8);
    border-bottom: 1px solid rgba(168, 85, 247, 0.12);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.tier-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #a855f7;
}

.tier-count {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.85rem;
}

.tier-players-list {
    max-height: 600px;
    overflow-y: auto;
}

.tier-players-list::-webkit-scrollbar {
    width: 8px;
}

.tier-players-list::-webkit-scrollbar-track {
    background: rgba(10, 0, 20, 0.3);
}

.tier-players-list::-webkit-scrollbar-thumb {
    background: rgba(168, 85, 247, 0.4);
    border-radius: 4px;
}

.tier-players-list::-webkit-scrollbar-thumb:hover {
    background: rgba(168, 85, 247, 0.6);
}

.rankings-card {
    background: rgba(10, 0, 20, 0.5);
    backdrop-filter: blur(40px) saturate(150%);
    border: 1px solid rgba(168, 85, 247, 0.15);
    border-radius: 20px;
    overflow: hidden;
}

.table-header {
    display: grid;
    grid-template-columns: 60px 1fr 100px 80px;
    gap: 1rem;
    padding: 0.8rem 1.5rem;
    background: rgba(10, 0, 20, 0.8);
    border-bottom: 1px solid rgba(168, 85, 247, 0.12);
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: rgba(168, 85, 247, 0.7);
}

.player-row {
    display: grid;
    grid-template-columns: 60px 1fr 100px 80px;
    gap: 1rem;
    padding: 0.8rem 1.5rem;
    border-bottom: 1px solid rgba(168, 85, 247, 0.08);
    align-items: center;
    cursor: pointer;
    transition: all 0.2s ease;
    opacity: 0;
    animation: fadeIn 0.3s ease forwards;
}

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

.player-row:hover {
    background: rgba(168, 85, 247, 0.08);
}

.player-row:last-child {
    border-bottom: none;
}

.rank-number {
    font-size: 1.3rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.5);
}

.rank-number.top1 {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.rank-number.top2 {
    background: linear-gradient(135deg, #e5e7eb 0%, #9ca3af 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.rank-number.top3 {
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.player-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.player-avatar {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid rgba(168, 85, 247, 0.2);
    overflow: hidden;
    background: rgba(10, 0, 20, 0.7);
}

.player-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.player-details {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.player-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
}

.player-title {
    font-size: 0.7rem;
    color: rgba(168, 85, 247, 0.7);
}

.tier-badge {
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    text-align: center;
    background: rgba(168, 85, 247, 0.12);
    color: #a855f7;
    border: 1px solid rgba(168, 85, 247, 0.2);
}

.points-badge {
    padding: 0.4rem 0.6rem;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 700;
    text-align: center;
    color: #a855f7;
}

.loading {
    text-align: center;
    padding: 4rem 2rem;
    color: rgba(255, 255, 255, 0.5);
    font-size: 1.1rem;
}

.loading-bar {
    width: 100%;
    height: 4px;
    background: rgba(168, 85, 247, 0.15);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 1rem;
}

.loading-progress {
    height: 100%;
    background: linear-gradient(90deg, #a855f7, #8b5cf6);
    border-radius: 2px;
    animation: loading 1.5s ease-in-out infinite;
}

@keyframes loading {
    0% { width: 0%; }
    50% { width: 70%; }
    100% { width: 100%; }
}

.error {
    text-align: center;
    padding: 4rem 2rem;
    color: #ef4444;
    font-size: 1.1rem;
}

.no-data {
    text-align: center;
    padding: 3rem 2rem;
    color: rgba(255, 255, 255, 0.4);
    font-size: 1rem;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 0, 20, 0.92);
    backdrop-filter: blur(10px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 2rem;
}

.modal-overlay.active {
    display: flex;
}

.player-modal {
    background: rgba(10, 0, 20, 0.95);
    border: 1px solid rgba(168, 85, 247, 0.25);
    border-radius: 24px;
    max-width: 700px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(168, 85, 247, 0.2);
}

.modal-header {
    position: relative;
    padding: 3rem 2rem 2rem;
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.15) 0%, rgba(139, 92, 246, 0.1) 100%);
    border-bottom: 1px solid rgba(168, 85, 247, 0.15);
    text-align: center;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.5);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.player-skin {
    width: 200px;
    height: 400px;
    margin: 0 auto 1.5rem;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(168, 85, 247, 0.2);
    border: 3px solid rgba(168, 85, 247, 0.3);
    background: rgba(10, 0, 20, 0.5);
}

.player-skin img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.modal-player-name {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #a855f7;
}

.modal-player-title {
    font-size: 1rem;
    color: rgba(168, 85, 247, 0.8);
    margin-bottom: 1rem;
}

.namemc-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: rgba(168, 85, 247, 0.15);
    border: 1px solid rgba(168, 85, 247, 0.3);
    border-radius: 12px;
    color: #a855f7;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
}

.namemc-link:hover {
    background: rgba(168, 85, 247, 0.25);
    border-color: rgba(168, 85, 247, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(168, 85, 247, 0.3);
}

.modal-body {
    padding: 2rem;
}

.stat-section {
    margin-bottom: 2rem;
}

.stat-section-title {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: rgba(168, 85, 247, 0.7);
    margin-bottom: 1rem;
    font-weight: 700;
}

.overall-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.stat-box {
    background: rgba(168, 85, 247, 0.08);
    border: 1px solid rgba(168, 85, 247, 0.15);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: #a855f7;
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mode-stats {
    display: grid;
    gap: 1rem;
}

.mode-stat-card {
    background: rgba(168, 85, 247, 0.08);
    border: 1px solid rgba(168, 85, 247, 0.15);
    border-radius: 12px;
    padding: 1rem;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 1rem;
}

.mode-icon {
    width: 32px;
    height: 32px;
}

.mode-info h4 {
    font-size: 0.95rem;
    color: #a855f7;
    margin-bottom: 0.2rem;
    text-transform: capitalize;
}

.mode-info p {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
}

@media (max-width: 1200px) {
    .tier-groups-container {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1024px) {
    .nav-center {
        display: none;
    }
    .dropdown-menu {
        width: 350px;
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .nav-container {
        padding: 1rem;
        gap: 1rem;
    }
    .main-container {
        padding: 1rem;
    }
    .overall-stats {
        grid-template-columns: 1fr;
    }
    .modal-overlay {
        padding: 1rem;
    }
}
</style>
</head>
<body>
    <div class="bg-image"></div>
    <div class="bg-gradient"></div>
    <div class="bg-noise"></div>

    <nav>
        <div class="nav-container">
            <div class="logo-section" onclick="window.location.href='/'">
                <img src="icon.png" alt="VoidTiers" class="logo-img">
                <div class="logo-text">VoidTiers</div>
            </div>
            
            <div class="nav-center">
                <a href="/" class="nav-link">Home</a>
                <a href="#rankings" class="nav-link active">Rankings</a>
            </div>
            
            <div class="nav-right">
                <a href="https://discord.gg/YgWxv3e6Gg" target="_blank" class="nav-link discord-link">
                    <svg viewBox="0 0 127.14 96.36" width="20" height="20" fill="currentColor">
                        <path d="M107.7,8.07A105.15,105.15,0,0,0,81.47,0a72.06,72.06,0,0,0-3.36,6.83A97.68,97.68,0,0,0,49,6.83,72.37,72.37,0,0,0,45.64,0A105.89,105.89,0,0,0,19.39,8.09C2.79,32.65-1.71,56.6.54,80.21h0A105.73,105.73,0,0,0,32.71,96.36,77.7,77.7,0,0,0,39.6,85.25a68.42,68.42,0,0,1-10.85-5.18c.91-.66,1.8-1.34,2.66-2a77.15,77.15,0,0,0,64.32,0c.87.71,1.76,1.39,2.66,2a68.68,68.68,0,0,1-10.87,5.23,77,77,0,0,0,6.89,11.1A105.25,105.25,0,0,0,126.6,80.22h0C129.24,52.84,122.09,29.11,107.7,8.07ZM42.45,65.69C36.18,65.69,31,60.55,31,53.88s5-11.8,11.47-11.8c6.52,0,11.63,5.16,11.63,11.81S48.91,65.69,42.45,65.69Zm42.24,0C78.41,65.69,73.25,60.55,73.25,53.88s5-11.8,11.47-11.8c6.53,0,11.63,5.16,11.63,11.81S91.16,65.69,84.69,65.69Z"/>
                    </svg>
                    Discord
                </a>
                <div class="search-container">
                    <svg class="search-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
                        <circle cx="11" cy="11" r="8"></circle>
                        <path d="m21 21-4.35-4.35"></path>
                    </svg>
                    <input type="text" class="search-input" placeholder="Search player..." id="searchInput">
                </div>
            </div>
        </div>
    </nav>

    <div class="main-container">
        <div class="info-bar">
            <div style="color: rgba(255, 255, 255, 0.6); font-size: 0.9rem;">
                <strong style="color: rgba(168, 85, 247, 0.8);">VoidTiers</strong> • Minecraft PvP Rankings
            </div>
            <div style="color: rgba(255, 255, 255, 0.4); font-size: 0.85rem;" id="playerCount">
                Loading...
            </div>
        </div>

        <div class="tier-tabs-container">
            <div class="tier-tabs" id="tierTabs"></div>
        </div>

        <div id="playersContainer">
            <div class="loading">
                Loading players...
                <div class="loading-bar">
                    <div class="loading-progress"></div>
                </div>
            </div>
        </div>
    </div>

    <div class="modal-overlay" id="playerModal" onclick="closeModal(event)">
        <div class="player-modal" onclick="event.stopPropagation()">
            <div class="modal-header">
                <button class="modal-close" onclick="closeModal()">&times;</button>
                <div class="player-skin" id="modalSkin">
                    <img src="" alt="Player Skin">
                </div>
                <h2 class="modal-player-name" id="modalPlayerName">Loading...</h2>
                <div class="modal-player-title" id="modalPlayerTitle">Combat Master</div>
                <a href="#" target="_blank" class="namemc-link" id="namemcLink">
                    <svg width="20" height="20" fill="currentColor" viewBox="0 0 24 24">
                        <path d="M14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3m-2 16H5V5h7V3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7h-2v7z"/>
                    </svg>
                    View on NameMC
                </a>
            </div>

            <div class="modal-body">
                <div class="stat-section">
                    <div class="stat-section-title">Overall Stats</div>
                    <div class="overall-stats">
                        <div class="stat-box">
                            <div class="stat-value" id="modalTotal">0</div>
                            <div class="stat-label">Total Points</div>
                        </div>
                        <div class="stat-box">
                            <div class="stat-value" id="modalRank">#1</div>
                            <div class="stat-label">Overall Rank</div>
                        </div>
                    </div>
                </div>
                <div class="stat-section">
                    <div class="stat-section-title">Game Modes</div>
                    <div class="mode-stats" id="modalModeStats"></div>
                </div>
            </div>
        </div>
    </div>

    <script type="module" src="script.js"></script>
    
    <footer class="footer-credit">
        made with <span class="heart">❤️</span> by frqme
    </footer>
</body>
</html>