/*
 * HERO AWAKENING - TRANSPARENT MODERN RPG THEME
 * Neues Design: Transparent, Modern, Futuristische RPG-Ästhetik
 * Farben: Tiefblau, leuchtendes Lila, schimmerndes Gold, dunkle Transparenz
 * Schriftarten: 'Orbitron' (Sci-Fi/Modern), 'Montserrat' (Clean/Elegant)
 */

/* Import der Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400..900&family=Montserrat:wght@300;400;700&display=swap');

/* Grundlegende Stile und Variablen */
:root {
    --primary-blue: #007bff; /* Für Akzente und interaktive Elemente */
    --accent-purple: #7b00ff; /* Leuchtendes Lila für Hervorhebungen und Glow */
    --accent-gold: #FFD700; /* Dezentes Gold für besondere Akzente */
    
    --text-light: #E0E0E0;
    --text-dark: #A0A0A0;
    
    --bg-dark-transparent: rgba(0, 0, 0, 0.7); /* Dunkle, durchscheinende Hintergründe */
    --ui-glass: rgba(255, 255, 255, 0.08); /* Heller, durchscheinender Glaseffekt */
    --ui-glass-border: rgba(255, 255, 255, 0.15); /* Rand für Glaseffekte */
    
    --glow-effect: 0 0 15px var(--accent-purple), 0 0 5px var(--accent-purple);

    --font-heading: 'Orbitron', sans-serif;
    --font-body: 'Montserrat', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    font-size: 1.1rem;
    background-color: #0d0d1e; /* Tiefer, dunkler Hintergrund */
    /* Futuristische Gittertextur im Hintergrund */
    background-image: url('data:image/svg+xml,%3Csvg width="60" height="60" viewBox="0 0 60 60" xmlns="http://www.w3.org/2000/svg"%3E%3Cg fill="%232d2d4d" fill-opacity="0.4" fill-rule="evenodd"%3E%3Cpath d="M0 0h30v30H0V0zm30 30h30v30H30V30z"/%3E%3C/g%3E%3C/svg%3E');
    color: var(--text-light);
    overflow-x: hidden;
    line-height: 1.6;
}

/* Scrollbar Styling (Modern und dezent) */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--primary-blue);
    border-radius: 4px;
    transition: background 0.3s ease;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--accent-purple);
}

/* Sidebar-Layout - Transparenter, schwebender Effekt */
.sidebar {
    position: fixed;
    left: 20px;
    top: 20px;
    width: 280px;
    height: calc(100vh - 40px);
    background: var(--ui-glass);
    backdrop-filter: blur(10px); /* Frosted Glass Effekt */
    border: 1px solid var(--ui-glass-border);
    border-radius: 15px;
    display: flex;
    flex-direction: column;
    padding: 2rem 0;
    z-index: 100;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease-in-out;
}

.sidebar-header .logo {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    font-weight: 700;
    text-align: center;
    /* Moderner Gold-Lila-Verlauf für den Titel */
    background: linear-gradient(45deg, var(--accent-purple), var(--accent-gold), var(--primary-blue));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 0 0 8px rgba(123, 0, 255, 0.6); /* Dezenter Leuchteffekt */
    margin-bottom: 3rem;
    padding: 0 1.5rem;
    letter-spacing: 2px;
}

.main-nav ul {
    list-style: none;
}

.main-nav ul li a {
    display: flex; /* Für Icon und Text */
    align-items: center;
    gap: 15px; /* Abstand zwischen Icon und Text */
    color: var(--text-dark);
    text-decoration: none;
    padding: 1.2rem 2.5rem;
    font-size: 1.15rem;
    font-family: var(--font-body);
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
    position: relative;
    overflow: hidden;
}

.main-nav ul li a::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, rgba(123, 0, 255, 0.1), rgba(123, 0, 255, 0.0));
    transform: translateX(-100%);
    transition: transform 0.3s ease-out;
    z-index: -1;
}

.main-nav ul li a:hover::before {
    transform: translateX(0);
}

.main-nav ul li a:hover {
    color: var(--text-light);
    border-left-color: var(--accent-purple);
    text-shadow: var(--glow-effect);
}

.main-nav ul li a.active {
    color: var(--text-light);
    font-weight: 700;
    border-left-color: var(--accent-purple);
    background: linear-gradient(90deg, rgba(123, 0, 255, 0.2), rgba(123, 0, 255, 0.05));
    text-shadow: var(--glow-effect);
}

.main-nav ul li a .nav-icon {
    font-size: 1.4rem;
    color: var(--text-dark);
    transition: color 0.3s ease;
}

.main-nav ul li a:hover .nav-icon,
.main-nav ul li a.active .nav-icon {
    color: var(--accent-purple);
}


.sidebar-footer {
    margin-top: auto;
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-dark);
    padding: 1rem;
    text-shadow: 0 0 5px rgba(0,0,0,0.5);
}

/* Hauptinhaltsbereich */
.main-content {
    margin-left: 320px; /* Platz für die Sidebar + 40px Rand */
    width: calc(100% - 340px); /* 40px links, 20px rechts (für ästhetischen Rand) */
    padding: 20px; /* Innenabstand für den Content */
}

/* =============================================== */
/* == HERO-Sektion Anpassungen (KERN-ÄNDERUNGEN) == */
/* =============================================== */
.hero {
    /* Video-Hintergrund beibehalten, aber das Hero-Image wird darüber platziert */
    background: none; /* Wichtig: Entfernt den Standard-Image-Fallback */
    align-items: flex-end; /* Inhalt unten zentrieren */
    padding-bottom: 5vh; /* Etwas Abstand vom unteren Rand */
}

.hero-overlay {
    /* Dichteres, undurchsichtigeres Overlay für mehr Dramatik */
    background: radial-gradient(circle at center, rgba(0, 0, 0, 0.1) 0%, rgba(0, 0, 0, 0.95) 75%);
    /* Alternativ: Mehr einheitliche Verdunkelung, falls Video nicht zu sehen sein soll */
    /* background: rgba(0, 0, 0, 0.8); */
    z-index: 2;
}

.hero-content {
    position: relative;
    z-index: 3;
    animation: fadeIn 2s ease-out; /* Etwas längere Animation */
    padding: 0 20px; /* Padding für kleinere Bildschirme */
    display: flex; /* Flexbox für bessere Ausrichtung des Logos */
    flex-direction: column;
    align-items: center; /* Horizontale Zentrierung */
    max-width: 90%; /* Max. Breite für den Inhalt */
}

/* NEU: Styling für das Hero-Image-Logo */
.hero-image-logo {
    width: 100%; /* Passt sich der Breite des hero-content an */
    max-width: 800px; /* Maximale Breite für das Logo */
    height: auto; /* Höhe proportional skalieren */
    object-fit: contain; /* Bild passt in den Container, ohne abgeschnitten zu werden */
    margin-bottom: 2rem; /* Abstand zur Tagline */
    filter: drop-shadow(0 0 25px rgba(123, 0, 255, 0.9)) drop-shadow(0 0 10px rgba(255, 215, 0, 0.5)); /* Starker Glow-Effekt */
    animation: logoGlow 3s ease-in-out infinite alternate; /* Pulsierender Glow */
}

/* hero-image-logo-sidebar */
.hero-image-logo-sidebar {
    width: 75%; /* Kleinere Version für die Sidebar */
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 0 15px rgba(123, 0, 255, 0.7)) drop-shadow(0 0 6px rgba(255, 215, 0, 0.3));
    animation: logoGlow 3s ease-in-out infinite alternate;
    margin-bottom: 1rem;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

@keyframes logoGlow {
    0% { filter: drop-shadow(0 0 20px rgba(123, 0, 255, 0.8)) drop-shadow(0 0 8px rgba(255, 215, 0, 0.4)); }
    100% { filter: drop-shadow(0 0 35px rgba(123, 0, 255, 1)) drop-shadow(0 0 15px rgba(255, 215, 0, 0.6)); }
}

/* Alte game-title und tagline Stylings können bleiben, werden aber vom hero-image-logo überschrieben */
/* Wenn du NUR das Bild verwenden willst, kannst du .game-title und .tagline in home.php entfernen */
/* Wenn du sie behalten willst, aber unsichtbar machen, nutze display: none; */
.game-title {
    display: none; /* Versteckt den Text-Titel, da wir jetzt das Bild nutzen */
}

.tagline {
    font-size: 1.6rem; /* Tagline etwas kleiner und dezenter */
    margin-top: -1rem; /* Näher an das Logo rücken */
    margin-bottom: 2.5rem; /* Abstand zum Button */
    color: var(--text-light);
    text-shadow: 0 0 10px rgba(123, 0, 255, 0.5); /* Etwas subtilerer Glow */
}

/* Moderne Buttons mit Glow-Effekt */
.cta-button {
    display: inline-block;
    background: var(--accent-purple);
    color: var(--text-light);
    font-family: var(--font-body);
    padding: 1.2rem 3rem;
    font-size: 1.3rem;
    font-weight: 700;
    text-decoration: none;
    text-transform: uppercase;
    border: none;
    border-radius: 8px;
    box-shadow: 0 0 15px rgba(123, 0, 255, 0.5); /* Starker Glow */
    transition: all 0.3s ease-in-out;
    letter-spacing: 1.5px;
    position: relative;
    overflow: hidden;
}

.cta-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.cta-button:hover::before {
    left: 100%;
}

.cta-button:hover {
    background: var(--primary-blue);
    transform: translateY(-3px);
    box-shadow: 0 0 25px rgba(0, 123, 255, 0.7), 0 5px 15px rgba(0, 0, 0, 0.4);
}

/* Cookie Banner - Modern und dezent */
.cookie-banner {
    position: fixed;
    bottom: -100%;
    left: 0;
    width: 100%;
    background: var(--bg-dark-transparent);
    backdrop-filter: blur(8px);
    border-top: 1px solid var(--ui-glass-border);
    padding: 1.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 200;
    transition: bottom 0.5s ease-in-out;
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.4);
}

.cookie-banner.show { bottom: 0; }

.cookie-banner p {
    margin: 0;
    color: var(--text-dark);
    margin-right: 1.5rem;
    font-size: 1rem;
}

.cookie-button {
    background-color: var(--primary-blue);
    color: var(--text-light);
    border: none;
    padding: 0.8rem 1.5rem;
    cursor: pointer;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 1rem;
    border-radius: 6px;
    transition: background-color 0.3s, box-shadow 0.3s;
    box-shadow: 0 0 10px rgba(0, 123, 255, 0.3);
}

.cookie-button:hover {
    background-color: var(--accent-purple);
    box-shadow: 0 0 15px rgba(123, 0, 255, 0.5);
}

/* Loader - Modernes, sich drehendes Mana-Symbol (oder ein anderes passendes Icon) */
.server-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 4rem 0;
    min-height: 150px;
    color: var(--accent-purple);
}
.server-loader .loader-icon {
    font-size: 4rem; /* Großes Icon */
    animation: rotate-mana 2s linear infinite;
    text-shadow: var(--glow-effect);
}
.server-loader span {
    font-family: var(--font-body);
    color: var(--text-dark);
    font-size: 1.1rem;
    margin-top: 1.5rem;
    letter-spacing: 0.8px;
}
@keyframes rotate-mana {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Animationen */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Allgemeine Sektionen und Container */
.content-section {
    background: var(--bg-dark-transparent);
    backdrop-filter: blur(8px);
    border: 1px solid var(--ui-glass-border);
    border-radius: 15px;
    padding: 40px;
    margin-bottom: 30px; /* Abstand zwischen Sektionen */
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

.content-section h2, .section-title {
    font-family: var(--font-heading);
    font-size: 2.8rem;
    text-align: center;
    margin-bottom: 2.5rem;
    text-transform: uppercase;
    color: var(--text-light);
    background: linear-gradient(90deg, var(--primary-blue), var(--accent-purple));
    -webkit-background-clip: text;
    background-clip: text;
    text-shadow: var(--glow-effect);
    letter-spacing: 3px;
}

/* =============================================== */
/* == Feature Cards Anpassungen (kleine Nuancen) == */
/* =============================================== */
.features-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-top: 2rem;
}

.content-section {
    background: rgba(0, 0, 0, 0.7); /* Content-Sektionen etwas undurchsichtiger */
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 35px 0 rgba(0, 0, 0, 0.4);
}

.feature-card {
    background: rgba(0, 0, 0, 0.6); /* Karten noch dunkler */
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.feature-card:hover {
    box-shadow: 0 18px 35px rgba(0, 0, 0, 0.4), var(--glow-effect); /* Stärkerer Hover-Schatten */
    border-color: var(--accent-gold);
}

.feature-title {
    color: var(--accent-gold); /* Gold für die Feature-Titel */
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.4);
}
.feature-icon {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    color: var(--accent-purple);
    text-shadow: var(--glow-effect);
    transition: color 0.3s ease;
}
.feature-card:hover .feature-icon {
    color: var(--primary-blue);
    text-shadow: 0 0 15px rgba(0, 123, 255, 0.7);
}
.feature-title {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--accent-gold);
    margin-bottom: 0.8rem;
    text-shadow: 0 0 8px rgba(255, 215, 0, 0.3);
}
.feature-desc {
    font-size: 1rem;
    color: var(--text-dark);
}

/* Responsives Design */
@media (max-width: 1200px) {
    .sidebar { width: 240px; }
    .main-content { margin-left: 280px; width: calc(100% - 300px); }
    .game-title { font-size: 4.5rem; }
    .tagline { font-size: 1.5rem; }
}

@media (max-width: 992px) {
    .sidebar { left: 10px; top: 10px; height: calc(100vh - 20px); width: 220px; padding: 1.5rem 0; }
    .sidebar-header .logo { font-size: 1.8rem; margin-bottom: 2rem; }
    .main-nav ul li a { padding: 1rem 1.5rem; font-size: 1.05rem; }
    .main-nav ul li a .nav-icon { font-size: 1.2rem; }
    .main-content { margin-left: 250px; width: calc(100% - 270px); padding: 15px; }
    .game-title { font-size: 3.5rem; letter-spacing: 5px; }
    .tagline { font-size: 1.2rem; }
    .cta-button { padding: 1rem 2rem; font-size: 1.1rem; }
    .content-section { padding: 30px; }
    .content-section h2, .section-title { font-size: 2.2rem; margin-bottom: 2rem; }
    .feature-icon { font-size: 3rem; }
    .feature-title { font-size: 1.4rem; }
}

@media (max-width: 768px) {
    body { font-size: 1rem; }
    .sidebar { /* Mobile Toggle Layout bleibt erhalten */
        position: fixed;
        left: 0; top: 0;
        width: 80vw; max-width: 300px;
        height: 100vh;
        background: var(--bg-dark-transparent); /* Durchscheinende Sidebar im Mobile Overlay */
        backdrop-filter: blur(10px);
        border: none;
        border-right: 1px solid var(--ui-glass-border);
        border-radius: 0; /* Keine runden Ecken für Full-Screen-Mobile-Sidebar */
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        box-shadow: 0 0 32px rgba(0,0,0,0.5);
    }
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0; left: 0;
        width: 100vw; height: 100vh;
        background: rgba(0,0,0,0.6);
        z-index: 1999;
        animation: fadeIn 0.3s;
    }
    .sidebar-overlay.show {
        /* Das Overlay bekommt eine niedrigere Ebene */
        transform: translateX(0);
    }

    .sidebar.open {
        /* Die geöffnete Sidebar bekommt die höchste Ebene */
        transform: translateX(0);
    }
    .sidebar-toggle {
        position: fixed;
        top: 15px; left: 15px;
        z-index: 2100;
        background: var(--accent-purple);
        color: var(--text-light);
        border: none;
        border-radius: 50%;
        width: 48px; height: 48px;
        display: flex; align-items: center; justify-content: center;
        font-size: 1.8rem;
        box-shadow: 0 2px 10px rgba(0,0,0,0.3), var(--glow-effect);
        cursor: pointer;
        transition: background 0.2s, box-shadow 0.2s;
    }
    .sidebar-toggle:active { background: var(--primary-blue); box-shadow: 0 0 10px rgba(0, 123, 255, 0.5); }
    
    .main-content { margin-left: 0 !important; width: 100% !important; padding: 15px; }
    .hero { border-radius: 0; } /* Keine runden Ecken für Hero auf Mobile */
    .game-title { font-size: 2.8rem; letter-spacing: 3px; }
    .tagline { font-size: 1.1rem; margin-bottom: 2rem; }
    .cta-button { padding: 0.9rem 1.8rem; font-size: 1rem; }
    .content-section { padding: 20px; margin-bottom: 20px; border-radius: 10px; }
    .content-section h2, .section-title { font-size: 1.8rem; margin-bottom: 1.5rem; }
    .features-row { grid-template-columns: 1fr; gap: 15px; }
    .feature-icon { font-size: 2.8rem; }
    .feature-title { font-size: 1.2rem; }
    .cookie-banner { flex-direction: column; text-align: center; padding: 1rem; }
    .cookie-banner p { margin-right: 0; margin-bottom: 1rem; font-size: 0.9rem; }
    .cookie-button { padding: 0.7rem 1.2rem; font-size: 0.9rem; }
}

/* Modals (falls vorhanden, hier als Platzhalter für konsistentes Styling) */
.modal-content, .home-modal-content, #server-list-modal-content {
    background: var(--bg-dark-transparent);
    backdrop-filter: blur(12px);
    border: 1px solid var(--ui-glass-border);
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    padding: 30px;
    color: var(--text-light);
}
.modal-join-button, .join-button { /* Allgemeiner Button-Stil für Modals/andere Sektionen */
    background: var(--accent-purple);
    color: var(--text-light);
    border: none;
    border-radius: 8px;
    padding: 1rem 2rem;
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 1.1rem;
    text-transform: uppercase;
    box-shadow: 0 0 10px rgba(123, 0, 255, 0.4);
    transition: all 0.3s ease;
}
.modal-join-button:hover, .join-button:hover {
    background: var(--primary-blue);
    box-shadow: 0 0 15px rgba(0, 123, 255, 0.6);
}

/* Toast-Container und Styling */
#interactive-toast-container {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}

.interactive-toast {
    color: #fff;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.18);
    font-weight: 500;
    font-size: 1.1rem;
    opacity: 0;
    transform: translateX(100%);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.interactive-toast.show {
    opacity: 1;
    transform: translateX(0);
}

/* Toast-Typen */
.interactive-toast.info { background: #7289da; }
.interactive-toast.success { background: #2ecc71; }
.interactive-toast.error { background: #e74c3c; }
.interactive-toast.warning { background: #f39c12; }

/* Leaderboard [Mit Avatar, Details, usw.] */
#leaderboard .leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 2rem;
    background: var(--ui-glass); /* Glaseffekt für die Tabelle */
    border-radius: 10px;
    overflow: hidden; /* Wichtig für abgerundete Ecken */
}

#leaderboard .leaderboard-table th, 
#leaderboard .leaderboard-table td {
    padding: 1.2rem 1.5rem;
    text-align: left;
    border-bottom: 1px solid var(--ui-glass-border);
}

#leaderboard .leaderboard-table th {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 1px;
    background: rgba(123, 0, 255, 0.2); /* Lila Akzent im Header */
}

#leaderboard .leaderboard-table td {
    color: var(--text-dark);
    font-family: var(--font-body);
    font-size: 1rem;
    transition: color 0.3s ease;
}

#leaderboard .leaderboard-table tr {
    transition: background-color 0.3s ease;
}

#leaderboard .leaderboard-table tr:last-child td {
    border-bottom: none; /* Keine untere Linie für die letzte Zeile */
}

#leaderboard .leaderboard-table tr:hover {
    background: rgba(0, 123, 255, 0.15); /* Blauer Hover-Effekt */
}

#leaderboard .leaderboard-table tr:hover td {
    color: var(--text-light);
}

#leaderboard .leaderboard-table .player-name {
    display: flex;
    align-items: center;
    font-weight: 700;
}

#leaderboard .leaderboard-table .player-name img {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    margin-right: 1rem;
    border: 2px solid var(--ui-glass-border);
    transition: border-color 0.3s ease, transform 0.3s ease;
}

#leaderboard .leaderboard-table tr:hover .player-name img {
    border-color: var(--accent-purple);
    transform: scale(1.1);
}

#leaderboard .leaderboard-table .rank {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--accent-gold);
    text-shadow: 0 0 8px rgba(255, 215, 0, 0.5);
}

#leaderboard .leaderboard-table .score {
    font-weight: 600;
    color: var(--primary-blue);
}

#leaderboard .leaderboard-table .details-button {
    background: var(--accent-purple);
    color: var(--text-light);
    border: none;
    border-radius: 6px;
    padding: 0.6rem 1.2rem;
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 0 10px rgba(123, 0, 255, 0.4);
}

#leaderboard .leaderboard-table .details-button:hover {
    background: var(--primary-blue);
    box-shadow: 0 0 15px rgba(0, 123, 255, 0.6);
    transform: translateY(-2px);
}

/* Player Details Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 2000; /* Über der Sidebar */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
}

.modal-content {
    /* Wiederverwendung des allgemeinen Modal-Stils der Seite */
    background: var(--bg-dark-transparent);
    border: 1px solid var(--ui-glass-border);
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    color: var(--text-light);
    margin: 10% auto;
    padding: 30px 40px;
    width: 90%;
    max-width: 700px;
    position: relative;
    animation: slide-down 0.4s ease-out;
}

@keyframes slide-down {
    from { transform: translateY(-50px) scale(0.95); opacity: 0; }
    to { transform: translateY(0) scale(1); opacity: 1; }
}

.modal-close {
    color: var(--text-dark);
    position: absolute;
    top: 15px;
    right: 25px;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease, transform 0.3s ease;
}

.modal-close:hover, .modal-close:focus {
    color: var(--text-light);
    transform: rotate(90deg);
}

.modal-details h3 {
    font-family: var(--font-heading);
    font-size: 2rem;
    text-align: center;
    margin-bottom: 2rem;
    color: var(--text-light);
    background: linear-gradient(90deg, var(--primary-blue), var(--accent-purple));
    -webkit-background-clip: text;
    background-clip: text;
    text-shadow: var(--glow-effect);
    border-bottom: none;
}

.modal-details .detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
}

.modal-details .detail-item {
    background: var(--ui-glass);
    padding: 1.5rem;
    border-radius: 10px;
    border: 1px solid var(--ui-glass-border);
}

.modal-details .detail-item h4 {
    margin-top: 0;
    margin-bottom: 1rem;
    font-family: var(--font-heading);
    color: var(--accent-gold);
    font-size: 1.2rem;
    text-shadow: 0 0 8px rgba(255, 215, 0, 0.4);
    border-bottom: 1px solid var(--ui-glass-border);
    padding-bottom: 0.5rem;
}

.modal-details ul {
    list-style-type: none;
    padding: 0;
}

.modal-details li {
    background: rgba(0, 123, 255, 0.1);
    color: var(--text-dark);
    margin-bottom: 8px;
    padding: 8px 12px;
    border-radius: 5px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.modal-details li:hover {
    background: rgba(0, 123, 255, 0.2);
    color: var(--text-light);
    transform: translateX(5px);
}

.modal-details .detail-item p {
    color: var(--text-dark);
    line-height: 1.8;
}

.modal-details .detail-item p strong {
    color: var(--text-light);
}

/* Avatar im Spieler-Detail-Modal */
.modal-details .detail-avatar-container {
    display: flex;
    justify-content: center;
    margin: 0 auto 1.5rem auto; /* Zentriert und mit Abstand nach unten */
}

.modal-details .detail-avatar-container img {
    width: 128px;
    height: 128px;
    background: var(--ui-glass);
    border: 2px solid var(--ui-glass-border);
    border-radius: 15px;
    padding: 5px;
    object-fit: contain; /* Wichtig, damit Minecraft-Köpfe nicht abgeschnitten werden */
    image-rendering: pixelated; /* Sorgt für scharfe Pixel-Art */
    transition: all 0.3s ease; /* Alle Übergänge hier definieren */
    cursor: pointer;
}

.modal-details .detail-avatar-container img:hover {
    border-color: var(--accent-purple);
    transform: translateY(-5px) scale(1.05); /* Kombinierter Schwebe- und Skalierungseffekt */
    box-shadow: 0 0 20px rgba(123, 0, 255, 0.6); /* Ein einziger, starker Schatten */
}

/* Stile für die Achievement-Liste im Modal */
.detail-item-full-width {
    grid-column: 1 / -1; /* Sorgt dafür, dass dieses Element die volle Breite einnimmt */
}

.modal-details .detail-item ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

.modal-details .detail-item li {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    background: rgba(0, 123, 255, 0.1);
    color: var(--text-dark);
    margin-bottom: 8px;
    padding: 10px 12px;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.modal-details .detail-item li:hover {
    background: rgba(0, 123, 255, 0.2);
    color: var(--text-light);
    transform: translateX(5px);
}

.modal-details .detail-item li .fa-trophy {
    color: var(--accent-gold);
    text-shadow: 0 0 5px rgba(255, 215, 0, 0.5);
}

.modal-details .detail-item li .achievement-date {
    margin-left: auto;
    font-size: 0.85rem;
    opacity: 0.7;
    white-space: nowrap;
}


/* Suchleiste für Leaderboard */
.leaderboard-controls {
    margin-bottom: 2rem;
    display: flex;
    justify-content: center;
}

.search-bar {
    width: 100%;
    max-width: 500px;
    position: relative;
}

.search-bar input {
    width: 100%;
    padding: 0.8rem 1.5rem;
    background: var(--ui-glass);
    border: 1px solid var(--ui-glass-border);
    border-radius: 8px;
    color: var(--text-light);
    font-family: var(--font-body);
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

.search-bar input:focus {
    outline: none;
    border-color: var(--accent-purple);
    box-shadow: var(--glow-effect);
}

/* Mobile Version des Leaderboards/Modals */
@media (max-width: 576px) {
    .modal-content {
        margin: 20% auto;
        padding: 20px;
        width: 95%;
    }
    .modal-details .detail-grid {
        grid-template-columns: 1fr;
    }
    .leaderboard-controls {
        flex-direction: column;
        align-items: center;
    }
    .search-bar {
        max-width: 100%;
        margin-bottom: 1rem;
    }

    /* Responsive Leaderboard Tabelle */
    #leaderboard .leaderboard-table thead {
        display: none; /* Kopfzeile ausblenden, da die Labels in die Zellen wandern */
    }

    #leaderboard .leaderboard-table tr {
        display: block; /* Jede Zeile wird zu einem Block/einer Karte */
        margin-bottom: 1.5rem;
        border: 1px solid var(--ui-glass-border);
        border-radius: 8px;
        padding: 1rem;
    }

    #leaderboard .leaderboard-table td {
        display: flex;
        justify-content: space-between; /* Label links, Wert rechts */
        align-items: center;
        padding: 0.8rem 0.5rem;
        border-bottom: 1px dashed var(--ui-glass-border); /* Dezenter Trenner */
    }

    #leaderboard .leaderboard-table tr td:last-child {
        border-bottom: none; /* Kein Trenner für das letzte Element */
    }

    /* Fügt die Spaltenüberschriften vor den Werten ein */
    #leaderboard .leaderboard-table td::before {
        font-weight: 700;
        color: var(--text-light);
        margin-right: 1rem;
    }

    /* Weist die Labels den Zellen per CSS zu (keine JS-Änderung nötig) */
    #leaderboard .leaderboard-table td:nth-of-type(1)::before { content: 'Rank'; }
    #leaderboard .leaderboard-table td:nth-of-type(2)::before { display: none; } /* Spielername braucht kein Label */
    #leaderboard .leaderboard-table td:nth-of-type(3)::before { content: 'Class'; }
    #leaderboard .leaderboard-table td:nth-of-type(4)::before { content: 'Level'; }
    #leaderboard .leaderboard-table td:nth-of-type(5)::before { content: 'Experience'; }
    #leaderboard .leaderboard-table td:nth-of-type(6)::before { display: none; } /* Button braucht kein Label */

    #leaderboard .leaderboard-table td:nth-of-type(2) { /* Spielername-Zelle */
        order: -1; /* Spielernamen immer ganz oben in der Karte anzeigen */
        padding-bottom: 1rem;
        margin-bottom: 1rem;
    }

    #leaderboard .leaderboard-table td:nth-of-type(6) { /* Button-Zelle */
        justify-content: center; /* Button zentrieren */
        padding-top: 1rem;
    }
}

.information-text {
    font-size: 1rem;
    color: var(--text-dark);
    margin-top: 1rem;
    text-align: center;
    border-left: 4px solid var(--accent-purple);
    padding-left: 1rem;
    background-color: rgba(123, 0, 255, 0.05);
    border-radius: 8px;
}

.badge {
    display: inline-block;
    padding: 0.3rem 0.7rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
    color: #fff;
    box-shadow: 0 0 8px rgba(0,0,0,0.2);
}

.badge-warrior { background: linear-gradient(45deg, #C0392B, #E74C3C); } /* Rot-Töne für Krieger */
.badge-mage { background: linear-gradient(45deg, #8E44AD, #9B59B6); } /* Lila-Töne für Magier */
.badge-archer { background: linear-gradient(45deg, #3498DB, #2980B9); } /* Blau-Töne für Archer */
.badge-healer { background: linear-gradient(45deg, #27AE60, #2ECC71); } /* Grün-Töne für Heiler */
.badge-rogue { background: linear-gradient(45deg, #F39C12, #E67E22); } /* Orange-Töne für Schurken */
.badge-registered { background: linear-gradient(45deg, #34495E, #2C3E50); } /* Dunkle Töne für Registrierte */
.badge-guest { background: linear-gradient(45deg, #F1C40F, #E74C3C); } /* Helle Rottöne für Unregistrierte */
.badge-unknown { background: linear-gradient(45deg, #95A5A6, #7F8C8D); } /* Grautöne für Unbekannte Klassen */
.badge-beta { background: linear-gradient(45deg, #D35400, #E67E22); } /* Orange-Töne für Beta-Tester */

/* Mystische Items [Minecraft Item, Icon, Modals mit Mehr Details, Damage, Fähigkeit, usw.] - BEREINIGTE VERSION */
#mystic-items .items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-top: 2rem;
}

#mystic-items .items-grid .item-card {
    background: var(--ui-glass);
    border: 1px solid var(--ui-glass-border);
    border-radius: 10px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    display: flex;
    flex-direction: column;
    cursor: pointer;
}

#mystic-items .items-grid .item-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 18px 35px rgba(0, 0, 0, 0.4), var(--glow-effect);
    border-color: var(--accent-gold);
}

#mystic-items .items-grid .item-card .item-icon {
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

#mystic-items .items-grid .item-card .item-icon img {
    transition: transform 0.3s ease;
    width: 64px;
    height: 64px;
    object-fit: contain;
    image-rendering: pixelated;
}

#mystic-items .items-grid .item-card:hover .item-icon img {
    transform: scale(1.1);
}

#mystic-items .items-grid .item-card .item-name {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    margin-bottom: 0.5rem;
    color: var(--accent-gold);
    text-shadow: 0 0 8px rgba(255, 215, 0, 0.4);
}

#mystic-items .items-grid .item-card .item-desc {
    font-size: 1rem;
    color: var(--text-dark);
    margin-bottom: 1.5rem;
    line-height: 1.6;
    flex-grow: 1;
}

#mystic-items .items-grid .item-card .item-damage {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 1rem;
}

#mystic-items .items-grid .item-card .item-damage i {
    color: var(--accent-gold);
    margin-right: 0.5rem;
}

#mystic-items .items-grid .item-card .item-effects {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid var(--ui-glass-border);
}

#mystic-items .items-grid .item-card .effect-tag {
    background: rgba(0, 123, 255, 0.2);
    color: #87CEFA; /* Light Sky Blue */
    border: 1px solid rgba(0, 123, 255, 0.5);
    border-radius: 20px;
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
    font-weight: 700;
}

#mystic-items .items-grid .item-card .effect-tag.fire {
    background: rgba(255, 87, 34, 0.2);
    color: #FFA07A; /* Light Salmon */
    border-color: rgba(255, 87, 34, 0.5);
}

/* Modal für Item Details */
.item-modal {
    display: none;
    position: fixed; z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.item-modal-content {
    background: var(--bg-dark-transparent);
    border: 1px solid var(--ui-glass-border);
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    color: var(--text-light);
    margin: 10% auto;
    padding: 2.5rem;
    width: 90%;
    max-width: 650px;
    position: relative;
    animation: slide-down 0.4s ease-out;
}

.item-modal-close {
    color: var(--text-dark);
    position: absolute; top: 15px; right: 25px;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease, transform 0.3s ease;
}
.item-modal-close:hover, .item-modal-close:focus {
    color: var(--text-light);
    transform: rotate(90deg);
}

.item-modal-grid {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 2rem;
    align-items: flex-start;
    margin-bottom: 2rem;
}

.item-modal-icon-container img {
    width: 120px;
    height: 120px;
    image-rendering: pixelated;
    background: var(--ui-glass);
    border-radius: 8px;
    padding: 10px;
}

.item-modal-info .item-name {
    font-size: 2.2rem;
    margin-top: 0;
}

.item-modal-stats {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.stat-damage {
    font-size: 1.1rem;
    color: var(--text-dark);
}
.stat-damage strong {
    color: var(--accent-gold);
    font-size: 1.3rem;
}

.item-modal-effects h4, .item-modal-lore h4 {
    font-family: var(--font-heading);
    color: var(--accent-purple);
    margin-bottom: 0.8rem;
    border-bottom: 1px solid var(--ui-glass-border);
    padding-bottom: 0.5rem;
}

.effects-tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.item-modal-lore p {
    color: var(--text-dark);
    line-height: 1.7;
    font-size: 1.05rem;
}

/* Mobile Anpassungen für das Item-Modal */
@media (max-width: 576px) {
    .item-modal-content {
        padding: 1.5rem;
    }
    .item-modal-grid {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 1rem;
    }
    .item-modal-icon-container {
        margin: 0 auto;
    }
    .item-modal-info .item-name {
        font-size: 1.8rem;
    }
    .item-modal-stats {
        justify-content: center;
    }
}

/* Leaderboard Controls */
.leaderboard-controls {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.search-bar {
    flex-grow: 1;
    min-width: 250px;
}

.sort-controls {
    display: flex;
    gap: 1rem;
}

.sort-controls select {
    padding: 0.8rem 1rem;
    background: var(--ui-glass);
    border: 1px solid var(--ui-glass-border);
    border-radius: 8px;
    color: var(--text-light);
    font-family: var(--font-body);
    font-size: 1rem;
    cursor: pointer;
}

.sort-controls select:focus {
    outline: none;
    border-color: var(--accent-purple);
    box-shadow: var(--glow-effect);
}

/* Mobile Anpassungen */
@media (max-width: 768px) {
    .leaderboard-controls {
        flex-direction: column;
        align-items: stretch;
    }
}