* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Arial, sans-serif;
    background: #09090b;
    color: white;
    overflow-x: hidden;
    position: relative;
}

/* Animierter Hintergrund */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 30%, #141417 0%, #09090b 70%);
    z-index: -2;
}

body::after {
    content: "";
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 70% 80%, rgba(41, 185, 75, 0.06) 0%, transparent 40%),
                radial-gradient(circle at 20% 20%, rgba(52, 152, 219, 0.04) 0%, transparent 35%);
    z-index: -1;
    animation: backgroundShift 25s ease infinite alternate;
}

@keyframes backgroundShift {
    0% { transform: translate(0, 0) rotate(0deg); }
    100% { transform: translate(5%, 5%) rotate(5deg); }
}

main {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 20px;
}

.main-logo {
    width: 380px;
    margin-bottom: 25px;
    filter: drop-shadow(0 0 15px rgba(41, 185, 75, 0.2));
}

/* TOP BUTTONS */
.top-buttons {
    display: flex;
    gap: 12px;
    margin-bottom: 35px;
    flex-wrap: wrap;
    justify-content: center;
}

.btn {
    padding: 12px 26px;
    background: rgba(20, 20, 25, 0.7);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(41, 185, 75, 0.3);
    color: #f4f4f5;
    border-radius: 12px;
    cursor: pointer;
    text-decoration: none;
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 1px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn:hover {
    background: #29b94b;
    color: #000;
    border-color: #29b94b;
    box-shadow: 0 0 20px rgba(41, 185, 75, 0.4);
    transform: translateY(-2px);
}

/* LAYOUT */
.content-wrapper {
    display: flex;
    gap: 25px;
    width: 100%;
    max-width: 1350px;
    align-items: start;
}

/* LEADERBOARD */
.leaderboard {
    flex: 1;
    background: rgba(14, 14, 18, 0.75);
    backdrop-filter: blur(12px);
    padding: 30px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.04);
    box-shadow: 0 15px 35px rgba(0,0,0,0.6);
    overflow-x: auto;
    max-width: 100%;
    scrollbar-width: thin;
    scrollbar-color: #29b94b rgba(0, 0, 0, 0.3);
}

/* Schicker, dunkler Scrollbalken für Chrome, Safari und Edge direkt unter der Tabelle */
.leaderboard::-webkit-scrollbar {
    height: 6px;
}

.leaderboard::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
}

.leaderboard::-webkit-scrollbar-thumb {
    background: #29b94b;
    border-radius: 10px;
}

.leaderboard-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    gap: 20px;
    flex-wrap: wrap;
}

h1 {
    color: #29b94b;
    letter-spacing: 1.5px;
    font-size: 28px;
    text-shadow: 0 0 10px rgba(41, 185, 75, 0.15);
}

/* SEARCHBAR WITH AUTOCOMPLETE */
.search-container {
    position: relative;
    width: 280px;
}

#searchInput {
    width: 100%;
    padding: 12px 18px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    background: rgba(24, 24, 28, 0.6);
    color: white;
    font-size: 14px;
    transition: all 0.3s ease;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.3);
}

#searchInput:focus {
    outline: none;
    border-color: #29b94b;
    background: rgba(30, 30, 36, 0.9);
    box-shadow: 0 0 20px rgba(41, 185, 75, 0.2);
}

.autocomplete-dropdown {
    position: absolute;
    top: 110%;
    left: 0;
    width: 100%;
    background: #0e0e12;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    max-height: 250px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 10px 25px rgba(0,0,0,0.7);
}

.autocomplete-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    cursor: pointer;
    transition: background 0.2s;
}

.autocomplete-item:hover {
    background: rgba(41, 185, 75, 0.1);
}

.autocomplete-item img {
    width: 24px;
    height: 24px;
    border-radius: 4px;
}

.autocomplete-item .ac-pts {
    margin-left: auto;
    font-size: 12px;
    color: #666;
}

/* TABS (NAVIGATION) WITH ICONS */
.kit-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 25px;
    background: rgba(0, 0, 0, 0.3);
    padding: 6px;
    border-radius: 14px;
}

.kit-tab {
    flex: 1;
    padding: 12px;
    font-size: 13px;
    background: transparent;
    border: none;
    border-radius: 10px;
    color: #71717a;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.tab-icon {
    width: 18px;
    height: 18px;
    object-fit: contain;
    image-rendering: pixelated;
}

.kit-tab[data-cat="all"] {
    background: rgba(41, 185, 75, 0.03);
    border: 1px solid rgba(41, 185, 75, 0.1);
    color: #a1a1aa;
}

.kit-tab:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.02);
}

.kit-tab.active {
    background: #29b94b !important;
    color: black !important;
    border: 1px solid #29b94b !important;
    box-shadow: 0 4px 12px rgba(41, 185, 75, 0.25);
}

/* TABLE */
table {
    width: 100%;
    border-collapse: collapse;
}

.info-bar {
    background: rgba(24, 24, 28, 0.5);
    color: #29b94b;
    font-weight: bold;
    font-size: 13px;
    text-align: left;
    letter-spacing: 1px;
}

.info-bar th { padding: 18px; }
.info-bar th:nth-child(1) { width: 110px; }
.info-bar th:nth-child(3) { width: 140px; }

/* Ausrichtung für den "RANK" Tabellenkopf passend zum Spalteninhalt */
.info-bar th:nth-child(4) { 
    width: 360px; 
    text-align: left;    /* Erzwingt Links-Ausrichtung statt Zentrierung */
    padding-left: 45px;  /* Schiebt das Wort "RANK" exakt über die Badges */
}

/* CLEAN LEADERBOARD ROW EFFECT */
tr.clickable-row {
    border-bottom: 1px solid rgba(255, 255, 255, 0.02);
    cursor: pointer;
    transition: transform 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

tr.clickable-row td {
    padding: 18px;
    vertical-align: middle;
}

tr.clickable-row:hover { 
    background: rgba(255, 255, 255, 0.04) !important; 
    transform: scale(1.012);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.35);
    position: relative;
    z-index: 5;
}

/* TREND INDEX & PODIUMS */
.pos-cell {
    display: flex;
    align-items: center;
    gap: 8px;
}

.trend {
    font-size: 11px;
    font-weight: bold;
    padding: 2px 5px;
    border-radius: 4px;
}
.trend.up { color: #2ecc71; background: rgba(46, 204, 113, 0.1); }
.trend.down { color: #e74c3c; background: rgba(231, 76, 60, 0.1); }
.trend.steady { color: #71717a; background: rgba(113, 113, 122, 0.1); }

/* PODIUM GLOWS */
.podium-1 { text-shadow: 0 0 12px rgba(241, 196, 15, 0.6); color: #f1c40f !important; font-weight: 900; }
.podium-2 { text-shadow: 0 0 12px rgba(189, 195, 199, 0.5); color: #bdc3c7 !important; font-weight: 900; }
.podium-3 { text-shadow: 0 0 12px rgba(230, 126, 34, 0.5); color: #e67e22 !important; font-weight: 900; }

.head.p1 { border-color: #f1c40f !important; box-shadow: 0 0 10px rgba(241, 196, 15, 0.3); }
.head.p2 { border-color: #bdc3c7 !important; box-shadow: 0 0 10px rgba(189, 195, 199, 0.2); }
.head.p3 { border-color: #e67e22 !important; box-shadow: 0 0 10px rgba(230, 126, 34, 0.2); }

.player-cell { display: flex; align-items: center; }

img.head {
    width: 36px !important;
    height: 36px !important;
    border-radius: 8px;
    margin-right: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.name { font-size: 15px; font-weight: 600; }

/* RANKS & BADGES */
.rank-tag {
    background: rgba(0, 0, 0, 0.2);
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid #333;
    font-size: 12px;
    display: inline-block;
    font-weight: bold;
}

.rank-icon {
    width: 28px;
    height: 28px;
    vertical-align: middle;
    object-fit: contain;
    image-rendering: pixelated;
}

/* --- NEU: AUSRICHTUNG DER INHALTE IN DER RANK-ZEILE UND KIT-ICONS DANEBEN --- */
.rank-cell-content {
    display: flex;
    align-items: center;
    gap: 15px;          /* Abstand zwischen Rank-Tag/Box und dem Kit-Icon */
    padding-left: 27px; /* Schiebt den Inhalt in der Zeile sauber nach rechts */
}

.rank-kit-icon {
    width: 22px;
    height: 22px;
    object-fit: contain;
    image-rendering: pixelated;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4));
}

/* GROSSE CLEAN-BOXEN FÜR DIE ALL-ANSICHT */
.rank-all-container { 
    display: flex; 
    gap: 12px; 
}

.all-view-box {
    position: relative;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 6px;
    width: 64px;
    height: 64px;
    text-align: center;
}

.all-view-box img {
    width: 24px;
    height: 24px;
    image-rendering: pixelated;
    margin-bottom: 4px;
}

.all-view-box .mini-rank-text {
    font-size: 10px;
    font-weight: bold;
    text-transform: uppercase;
}

/* EXTRA CLEANER HOVER-TOOLTIP MIT RAHMEN & SCHWARZEM HINTERGRUND */
.all-view-box .tooltip {
    display: none;
    position: absolute;
    bottom: 115%;
    left: 50%;
    transform: translateX(-50%);
    background: #0d0d0d !important;
    border: 2px solid #222 !important;
    border-radius: 6px;
    padding: 8px 12px;
    color: #fff;
    font-size: 12px;
    white-space: nowrap;
    z-index: 9999;
    box-shadow: 0 5px 15px rgba(0,0,0,0.6);
    pointer-events: none;
}

.all-view-box:hover .tooltip {
    display: block;
}

.tooltip-title { font-size: 11px; text-transform: uppercase; color: #666; font-weight: bold; }
.tooltip-rank { font-size: 14px; font-weight: 800; margin-bottom: 3px; }
.tooltip-pts { font-size: 12px; color: #a1a1aa; }

/* FARBMAPPING FÜR DIE RÄNGE */
.rank-unranked { border-color: #52525b; color: #71717a; }
.rank-iron     { border-color: #e4e4e7; color: #ffffff; }
.rank-gold     { border-color: #eab308; color: #f1c40f; }
.rank-diamond  { border-color: #06b6d4; color: #3498db; }
.rank-emerald  { border-color: #10b981; color: #2ecc71; }
.rank-master   { border-color: #a855f7; color: #9b59b6; }
.rank-elite    { border-color: #ef4444; color: #e74c3c; }
.rank-legend   { border-color: #b91c1c; color: #c0392b; }
.rank-pro      { border-color: #f97316; color: #e67e22; }

/* UNIVERSALER SCHLIESSEN-BUTTON (X) */
.close-sidebar {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 26px;
    line-height: 1;
    color: #555;
    cursor: pointer;
    transition: color 0.2s;
    z-index: 100;
}
.close-sidebar:hover { 
    color: #ef4444; 
}

/* SIDEBAR & COMPARISON SYSTEM */
.profile-sidebar {
    width: 400px;
    background: rgba(14, 14, 18, 0.85);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(41, 185, 75, 0.3);
    border-radius: 20px;
    padding: 25px;
    position: sticky;
    top: 20px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.6);
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.3s;
}

.profile-sidebar.compare-mode {
    width: 800px; 
    border-color: rgba(52, 152, 219, 0.4);
}

#player2Column, 
#compareDivider {
    display: none !important;
}

.profile-sidebar.compare-mode #player2Column {
    display: flex !important;
}

.profile-sidebar.compare-mode #compareDivider {
    display: block !important;
}

.sidebar-top-nav {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    position: relative;
    padding-right: 40px;
}

.compare-btn-trigger {
    width: 100%;
    padding: 10px;
    background: rgba(41, 185, 75, 0.1);
    border: 1px solid rgba(41, 185, 75, 0.3);
    border-radius: 10px;
    color: #29b94b;
    font-weight: bold;
    cursor: pointer;
    transition: 0.2s;
}
.compare-btn-trigger:hover { 
    background: #29b94b; 
    color: black; 
}

.profile-sidebar.compare-mode .compare-btn-trigger {
    background: rgba(231, 76, 60, 0.1);
    border-color: rgba(231, 76, 60, 0.3);
    color: #e74c3c;
}
.profile-sidebar.compare-mode .compare-btn-trigger:hover {
    background: #e74c3c;
    color: white;
}

.sidebar-layout-grid {
    display: flex;
    gap: 20px;
    width: 100%;
}

.sidebar-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.compare-v-divider {
    width: 1px;
    background: rgba(255, 255, 255, 0.08);
    align-self: stretch;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 15px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    padding-bottom: 15px;
    margin-bottom: 15px;
}
.sidebar-header img { border-radius: 10px; width: 48px; height: 48px; }

.profile-global-placement {
    font-size: 13px;
    color: #f1c40f;
    background: rgba(241, 196, 15, 0.1);
    border: 1px solid rgba(241, 196, 15, 0.3);
    padding: 2px 8px;
    border-radius: 6px;
    width: fit-content;
    margin-top: 4px;
    font-weight: bold;
}

.stats-grid-main {
    display: grid;
    grid-template-columns: repeat(3, 1fr); 
    gap: 8px;
    margin-bottom: 20px;
}

.stat-box {
    background: rgba(255, 255, 255, 0.02);
    padding: 12px;
    border-radius: 10px;
    font-size: 15px;
    border: 1px solid rgba(255, 255, 255, 0.04);
    text-align: center;
}
.stat-box small { display: block; color: #666; font-size: 10px; text-transform: uppercase; margin-top: 4px; letter-spacing: 0.5px;}

.text-gold { color: #f1c40f; font-weight: bold; }
.text-streak { color: #e67e22; font-weight: bold; }
.text-best { color: #e74c3c; font-weight: bold; }

.section-title {
    font-size: 14px;
    color: #29b94b;
    margin-bottom: 15px;
    border-left: 3px solid #29b94b;
    padding-left: 10px;
    font-weight: bold;
    letter-spacing: 0.5px;
}

.modal-kits-container { display: flex; flex-direction: column; gap: 12px; }
.modal-kit-card { background: rgba(255,255,255,0.01); border-radius: 12px; padding: 14px; border: 1px solid rgba(255,255,255,0.04); }
.kit-card-header { display: flex; justify-content: space-between; font-size: 14px; margin-bottom: 8px; }
.kit-placement-tag { background: rgba(0,0,0,0.3); color: #f1c40f; padding: 2px 6px; border-radius: 4px; font-size: 11px; font-weight: bold; border: 1px solid rgba(241, 196, 15, 0.3); }
.kit-card-details { display: flex; justify-content: space-between; font-size: 12px; color: #777; margin-bottom: 10px; }
.progress-bar-container { width: 100%; height: 14px; background: rgba(0,0,0,0.3); border-radius: 10px; overflow: hidden; position: relative; }
.progress-bar-fill { height: 100%; width: 0%; transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1); }
.progress-percentage { position: absolute; width: 100%; text-align: center; top: 0; left: 0; font-size: 10px; font-weight: bold; color: #fff; line-height: 14px; }

/* INFO MODAL & LIST CLOSES INCLUDED */
.info-modal {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.7); backdrop-filter: blur(8px);
    display: flex; justify-content: center; align-items: center; z-index: 2000;
}
.info-modal-content {
    background: #0e0e12; 
    border: 1px solid rgba(41, 185, 75, 0.3);
    padding: 30px; 
    border-radius: 20px; 
    max-width: 450px; 
    width: 90%;
    position: relative;
    max-height: 70vh; 
    display: flex; 
    flex-direction: column;
}
.info-modal-list {
    margin-top: 20px; display: flex; flex-direction: column; gap: 8px;
    overflow-y: auto; padding-right: 4px; scroll-behavior: smooth;
    scrollbar-width: thin; scrollbar-color: rgba(41, 185, 75, 0.3) transparent;
}
.info-modal-list::-webkit-scrollbar { width: 5px; }
.info-modal-list::-webkit-scrollbar-track { background: transparent; }
.info-modal-list::-webkit-scrollbar-thumb { background: rgba(41, 185, 75, 0.3); border-radius: 10px; }

.info-modal-item { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    padding: 12px 16px; 
    background: rgba(255,255,255,0.01); 
    border-radius: 10px; 
    border-bottom: 1px solid rgba(255,255,255,0.05); 
}

.hidden { display: none !important; }

/* --- SKIN-AUSSCHNITT DESIGN --- */
img.skin-bust {
    width: 42px !important;
    height: 56px !important;
    object-fit: contain;
    margin-right: 14px;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.3));
    transition: transform 0.2s ease;
    image-rendering: pixelated;
}

tr.clickable-row:hover img.skin-bust {
    transform: translateY(-2px) scale(1.05);
}

/* --- EDLER GLOW FÜR DIE TOP 3 ZEILEN --- */
tr.clickable-row:has(.podium-1) {
    background: linear-gradient(90deg, rgba(241, 196, 15, 0.02) 0%, transparent 60%) !important;
}
tr.clickable-row:has(.podium-2) {
    background: linear-gradient(90deg, rgba(189, 195, 199, 0.02) 0%, transparent 60%) !important;
}
tr.clickable-row:has(.podium-3) {
    background: linear-gradient(90deg, rgba(230, 126, 34, 0.02) 0%, transparent 60%) !important;
}

img.skin-bust.p1 { filter: drop-shadow(0 0 8px rgba(241, 196, 15, 0.25)); }
img.skin-bust.p2 { filter: drop-shadow(0 0 8px rgba(189, 195, 199, 0.2)); }
img.skin-bust.p3 { filter: drop-shadow(0 0 8px rgba(230, 126, 34, 0.2)); }

tr.clickable-row:has(.podium-1) {
    position: relative;
    overflow: hidden;
    background: linear-gradient(90deg, rgba(241, 196, 15, 0.04) 0%, transparent 60%) !important;
}

tr.clickable-row:has(.podium-1)::after {
    content: '';
    position: absolute;
    top: 0; left: -150%;
    width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(241, 196, 15, 0.15), transparent);
    transform: skewX(-25deg);
    animation: shineEffect 6s infinite ease-in-out;
    pointer-events: none;
}

@keyframes shineEffect {
    0% { left: -150%; }
    15% { left: 150%; }
    100% { left: 150%; }
}

/* Dynamische Winrate Einfärbungen */
.wr-godlike {
    color: #f1c40f; 
    font-weight: bold;
    text-shadow: 0 0 10px rgba(241, 196, 15, 0.5);
    animation: pulseGlow 2s infinite alternate;
}
.wr-good { color: #2ecc71; font-weight: bold; }
.wr-average { color: #a1a1aa; }
.wr-bad { color: #e74c3c; opacity: 0.8; }

@keyframes pulseGlow {
    0% { text-shadow: 0 0 5px rgba(241, 196, 15, 0.3); }
    100% { text-shadow: 0 0 12px rgba(241, 196, 15, 0.6); }
}

tr.clickable-row {
    transform-style: preserve-3d;
}

.all-view-box .tooltip {
    transition: opacity 0.2s ease, transform 0.2s ease;
    opacity: 0;
    display: block !important;
    pointer-events: none;
    transform: translateX(-50%) translateY(10px);
}

.all-view-box:hover .tooltip {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

html, body {
    overflow-x: hidden;
    width: 100%;
}