/* ==========================================================================
   1. GLOBAL VARIABLES & BASE SETUP
   ========================================================================== */
:root {
    --bg: #0d0d0d;
    --card-bg: #1a1a1a;
    --inner-bg: #121212;
    --accent: #ffcc00;
    --accent-glow: rgba(255, 204, 0, 0.35);
    --text-main: #ffffff;
    --text-muted: #a0a0a0;
    --border: #2d2d2d;
}

body {
    background-color: #0d0d0d;
    color: #ffffff;
    font-family: 'Inter', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    padding-top: 100px;
    flex-direction: column;
}

/* ==========================================================================
   2. NAVIGATION BAR
   ========================================================================== */
.main-nav {
    background: rgba(26, 26, 26, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    padding: 12px 0;
    width: 100%;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
}

.nav-container {
    max-width: 1300px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 40px;
}

.nav-logo {
    height: 45px;
    transition: transform 0.3s ease;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 15px;
}

.nav-item {
    text-decoration: none;
    color: #ffffff;
    font-size: 0.85rem;
    font-weight: 800;
    letter-spacing: 1.5px;
    padding: 10px 20px;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.nav-item:hover {
    background: rgba(255, 204, 0, 0.1);
    color: var(--accent);
}

/* ==========================================================================
   3. MAIN LAYOUT & CONTAINERS
   ========================================================================== */
.main-card {
    background-color: #1a1a1a;
    padding: 40px;
    border-radius: 24px;
    width: 90%;
    max-width: 1100px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
    border: 1px solid #2d2d2d;
}

header h1 {
    font-size: 1.8rem;
    letter-spacing: 3px;
    margin-bottom: 8px;
    text-align: center;
}

header p {
    color: #777;
    text-align: center;
    margin-bottom: 30px;
    font-size: 0.95rem;
}

.section-divider {
    border: 0;
    height: 1px;
    background-image: linear-gradient(to right, rgba(255, 204, 0, 0), rgba(255, 204, 0, 0.5), rgba(255, 204, 0, 0));
    margin: 40px 0;
    box-shadow: 0 0 10px rgba(255, 204, 0, 0.1);
}

/* ==========================================================================
   4. KIT SELECTION UI
   ========================================================================== */
.kit-selection-box {
    background-color: #121212;
    border-radius: 18px;
    padding: 25px;
    margin-bottom: 40px;
    border: 1px solid #252525;
}

.kit-selection-box::-webkit-scrollbar {
    width: 6px;
}

.kit-selection-box::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 10px;
}

.button-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 15px;
}

.kit-btn {
    background-color: #242424;
    border: none;
    border-radius: 14px;
    padding: 18px 10px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    min-height: 100px;
}

.kit-btn img {
    width: 32px;
    height: 32px;
    margin-bottom: 10px;
    object-fit: contain;
    filter: drop-shadow(0 4px 4px rgba(0,0,0,0.3));
}

.kit-btn span {
    color: #a0a0a0;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.kit-btn:hover {
    background-color: #2d2d2d;
    transform: translateY(-2px);
}

/* ==========================================================================
   5. KIT SPECIFIC THEMES (DYNAMICS)
   ========================================================================== */
/* --- 1.19+ Version Kits --- */
.kit-btn.maceTier.active, .kit-btn.maceTier:hover { border-color: #74b9ff !important; box-shadow: 0 0 15px rgba(116, 185, 255, 0.4); }
.kit-btn.maceTier.active { background-color: #74b9ff !important; color: #000 !important; }

.kit-btn.swordTier.active, .kit-btn.swordTier:hover { border-color: #0984e3 !important; box-shadow: 0 0 15px rgba(9, 132, 227, 0.4); }
.kit-btn.swordTier.active { background-color: #0984e3 !important; }

.kit-btn.axeTier.active, .kit-btn.axeTier:hover { border-color: #d63031 !important; box-shadow: 0 0 15px rgba(214, 48, 49, 0.4); }
.kit-btn.axeTier.active { background-color: #d63031 !important; }

.kit-btn.smpTier.active, .kit-btn.smpTier:hover { border-color: #2e86de !important; box-shadow: 0 0 15px rgba(46, 134, 222, 0.4); }
.kit-btn.smpTier.active { background-color: #2e86de !important; }

.kit-btn.potTier.active, .kit-btn.potTier:hover,
.kit-btn.nethPot.active, .kit-btn.nethPot:hover { border-color: #ef5285 !important; box-shadow: 0 0 15px rgba(239, 82, 133, 0.4); }
.kit-btn.potTier.active, .kit-btn.nethPot.active { background-color: #ef5285 !important; }

.kit-btn.vanillaTier.active, .kit-btn.vanillaTier:hover,
.kit-btn.uhcTier.active, .kit-btn.uhcTier:hover { border-color: #f1c40f !important; box-shadow: 0 0 15px rgba(241, 196, 15, 0.4); }
.kit-btn.vanillaTier.active, .kit-btn.uhcTier.active { background-color: #f1c40f !important; color: #000 !important; }

/* --- 1.8 Version Kits --- */
.kit-btn.boxingTier.active, .kit-btn.boxingTier:hover { border-color: #ffffff !important; box-shadow: 0 0 15px rgba(255, 255, 255, 0.3); }
.kit-btn.boxingTier.active { background-color: #ffffff !important; color: #000 !important; }

.kit-btn.fireballTier.active, .kit-btn.fireballTier:hover { border-color: #e67e22 !important; box-shadow: 0 0 15px rgba(230, 126, 34, 0.4); }
.kit-btn.fireballTier.active { background-color: #e67e22 !important; }

.kit-btn.bridgeTier.active, .kit-btn.bridgeTier:hover,
.kit-btn.skywarsTier.active, .kit-btn.skywarsTier:hover { border-color: #00d2d3 !important; box-shadow: 0 0 15px rgba(0, 210, 211, 0.4); }
.kit-btn.bridgeTier.active, .kit-btn.skywarsTier.active { background-color: #00d2d3 !important; color: #000 !important; }

.kit-btn.soupTier.active, .kit-btn.soupTier:hover { border-color: #a29bfe !important; box-shadow: 0 0 15px rgba(162, 155, 254, 0.4); }
.kit-btn.soupTier.active { background-color: #a29bfe !important; color: #000 !important; }

.kit-btn.nodebuffTier.active, .kit-btn.nodebuffTier:hover { border-color: #2ecc71 !important; box-shadow: 0 0 15px rgba(46, 204, 113, 0.4); }
.kit-btn.nodebuffTier.active { background-color: #2ecc71 !important; color: #000 !important; }

/* ==========================================================================
   6. LEADERBOARD TABLE DESIGN
   ========================================================================== */
.leaderboard-section h2 {
    font-size: 1.2rem;
    color: #ffcc00;
    margin-bottom: 20px;
    text-align: left;
    padding-left: 10px;
    border-left: 4px solid #ffcc00;
}

.table-wrapper {
    background: #121212;
    border-radius: 15px;
    overflow: hidden;
    border: 1px solid #252525;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    background-color: #181818;
    color: #555;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    padding: 15px;
    text-align: left;
    letter-spacing: 1px;
}

td {
    padding: 16px 15px;
    border-bottom: 1px solid #1e1e1e;
    font-size: 1rem;
    color: #e0e0e0;
}

tr:last-child td {
    border-bottom: none;
}

.rank-cell {
    color: #ffcc00;
    font-weight: bold;
    width: 80px;
}

/* ==========================================================================
   7. PLAYER INFO & KIT ICONS (OVERALL VIEW)
   ========================================================================== */
.player-info.xlarge .player-name-tag {
    font-size: 1.5rem;
    font-weight: 900;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.player-torso {
    width: 50px;
    height: auto;
    image-rendering: pixelated;
    filter: drop-shadow(2px 4px 6px rgba(0,0,0,0.4));
}

.kits-column {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 15px 0;
}

.kit-group-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.7rem;
    color: #666;
}

.kit-group-row strong {
    width: 45px;
    color: #aaa;
}

.mini-kit-icon {
    position: relative;
    background: #252525;
    padding: 6px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #333;
    width: 38px;
    height: 38px;
    transition: transform 0.2s;
}

.mini-kit-icon:hover {
    transform: scale(1.1);
    border-color: #ffcc00;
}

.mini-kit-icon img {
    width: 24px;
    height: 24px;
}

.mini-rank {
    position: absolute;
    top: -7px;
    right: -7px;
    background: #ffcc00;
    color: #000;
    font-size: 0.7rem;
    font-weight: 800;
    padding: 2px 5px;
    border-radius: 5px;
    border: 1px solid #000;
    z-index: 2;
    line-height: 1;
}

.not-played {
    opacity: 0.3;
    filter: grayscale(1);
}

.kit-pts-earn {
    color: #4cd137;
    font-weight: bold;
    font-family: monospace;
    text-align: right;
}

/* ==========================================================================
   8. RANKING BADGES & ANIMATIONS
   ========================================================================== */
.master-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
    display: inline-block;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.master-badge::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -60%;
    width: 20%;
    height: 200%;
    background: rgba(255, 255, 255, 0.4);
    transform: rotate(30deg);
    animation: shiny-sweep 3s infinite linear;
}

@keyframes shiny-sweep {
    0% { left: -60%; }
    20% { left: 120%; }
    100% { left: 120%; }
}

.shiny-19 {
    background: linear-gradient(135deg, #0072ff, #00c6ff);
    color: white;
    box-shadow: 0 0 10px rgba(0, 114, 255, 0.5);
}

.shiny-18 {
    background: linear-gradient(135deg, #eb3349, #f45c43);
    color: white;
    box-shadow: 0 0 10px rgba(235, 51, 73, 0.5);
}

/* ==========================================================================
   9. MODAL & POPUP SYSTEM
   ========================================================================== */
.modal {
    display: none; 
    position: fixed; 
    z-index: 2000; 
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.85);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: #1a1a1a;
    margin: 5% auto;
    padding: 30px;
    border: 1px solid #ffcc00;
    border-radius: 20px;
    width: 80%;
    max-width: 700px;
    color: white;
    position: relative;
    box-shadow: 0 0 30px rgba(255, 204, 0, 0.2);
    max-height: 80vh;
    overflow-y: auto;
}

.large-modal { max-width: 900px !important; }

.close-modal {
    color: #aaa;
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close-modal:hover { color: #ffcc00; }

.modal-title {
    color: #ffcc00;
    text-align: center;
    font-size: 1.8rem;
    margin-bottom: 25px;
    font-weight: 900;
    text-transform: uppercase;
    border-bottom: 2px solid #333;
    padding-bottom: 10px;
}

.modal-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.border-left {
    border-left: 1px solid #333;
    padding-left: 30px;
}

.point-item {
    display: flex;
    justify-content: space-between;
    background: #222;
    padding: 5px 12px;
    border-radius: 6px;
    margin-bottom: 5px;
    font-family: monospace;
}

.point-item b { color: #ffcc00; }

/* ==========================================================================
   10. PLAYER DETAILS CARD (SPECIFIC MODAL)
   ========================================================================== */
.player-detail-card {
    max-width: 850px !important;
    background: radial-gradient(circle at top right, #1e1e1e, #111) !important;
    border: 2px solid #333 !important;
}

.player-detail-flex {
    display: flex;
    gap: 40px;
    align-items: flex-start;
}

.player-visuals {
    flex: 1;
    text-align: center;
    background: rgba(0,0,0,0.3);
    padding: 20px;
    border-radius: 15px;
}

.full-skin {
    width: 100%;
    max-width: 250px;
    filter: drop-shadow(0 10px 20px rgba(0,0,0,0.5));
    transition: transform 0.3s;
}

.full-skin:hover { transform: scale(1.05); }

.uuid-text {
    font-family: monospace;
    font-size: 0.7rem;
    color: #444;
    margin-top: 15px;
    word-break: break-all;
}

.player-stats-info { flex: 2; }

.total-pts-box {
    background: #ffcc00;
    color: #000;
    display: inline-block;
    padding: 8px 20px;
    font-weight: 900;
    border-radius: 8px;
    margin: 15px 0;
    font-size: 1.2rem;
}

.modal-kits-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 30px;
}

.modal-kit-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    background: rgba(255,255,255,0.03);
    padding: 5px 10px;
    border-radius: 6px;
}

.modal-kit-item img { width: 20px; height: 20px; }

/* ==========================================================================
   11. FOOTER & EXTERNAL LINKS
   ========================================================================== */
.main-footer {
    width: 100%;
    background-color: var(--card-bg);
    border-top: 1px solid var(--border);
    padding: 30px 0;
    margin-top: 50px;
}

.footer-content {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}

.footer-content p {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 700;
}

.discord-link {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    background: #252525;
    padding: 10px 20px;
    border-radius: 12px;
    border: 1px solid var(--border);
    transition: all 0.3s;
}

.discord-link img { width: 24px; height: 24px; }
.discord-link span { color: #fff; font-weight: 700; font-size: 0.9rem; }

.discord-link:hover {
    background: #5865F2;
    transform: translateY(-2px);
}

/* ==========================================================================
   12. LOADING SCREEN UI
   ========================================================================== */
#loader-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #0d0d0d;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s;
}

.loader-content {
    text-align: center;
    width: 300px;
}

.loader-text {
    color: var(--accent);
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    letter-spacing: 3px;
    margin-bottom: 15px;
    font-weight: 800;
}

.loader-bar-container {
    width: 100%;
    height: 4px;
    background: #1a1a1a;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #333;
}

#loader-bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #ffcc00, #ffecb3);
    box-shadow: 0 0 15px var(--accent-glow);
    transition: width 0.4s ease;
}

.loader-hidden {
    opacity: 0;
    visibility: hidden;
}

/* ==========================================================================
   13. RESPONSIVE DESIGN & QUERIES
   ========================================================================== */
@media (max-width: 768px) {
    .modal-split { grid-template-columns: 1fr; }
    .border-left { border-left: none; padding-left: 10px; border-top: 1px solid #333; padding-top: 20px; }
    .player-detail-flex { flex-direction: column; align-items: center; }
    .modal-kits-grid { grid-template-columns: 1fr; }
}