/* ======================================================= */
/* 0. CONFIGURATION & VARIABLES                            */
/* ======================================================= */

:root {
    /* Farben */
    --color-primary-dark: #011638;      /* Haupt-Hintergrund */
    --color-secondary-red: #6B0504;     /* Rot-Akzent */
    --color-accent-blue: #009FFD;       /* Helles Cyan-Blau */
    --color-neutral-olive: #3E5641;     /* Neutraler Akzent */

    /* Text Farben */
    --color-text-primary: #ffffff;
    --color-text-secondary: #b3b3b3;
    --color-text-accent: var(--color-accent-blue);
    --color-text-light: #f0f0f0;

    /* Overlay Backgrounds */
    --container-bg: rgba(255, 255, 255, 0.05);
    --color-dark-overlay: rgba(0, 0, 0, 0.4);
    --color-modal-bg: rgba(0, 0, 0, 0.8);

    /* Mapping für Legacy Code */
    --color-background-dark: var(--color-primary-dark);
    --color-red-main: var(--color-secondary-red);
    --color-blue-main: var(--color-accent-blue);
    --color-neutral-accent: var(--color-neutral-olive);
    --color-box-background: var(--color-primary-dark);
    --color-shadow: rgba(0, 0, 0, 0.3);

    /* Spacings */
    --spacing-sm: 10px;
    --spacing-md: 20px;
    --spacing-lg: 30px;
}

/* GLOBAL RESET */
*, *::before, *::after {
    box-sizing: border-box;
}

/* ======================================================= */
/* 1. BASE STYLES & TYPOGRAPHY                             */
/* ======================================================= */

body, html {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

body {
    background-color: var(--color-background-dark);
    color: var(--color-text-primary);
    display: flex;
    flex-direction: column;
    font-family: 'Roboto', sans-serif;
    font-size: 16px;
    line-height: 1.6;
    overflow: hidden; /* Scrollbar nur in den Containern */
}

/* HINTERGRÜNDE */
body.home-page, body.info-page {
    background-image: 
        radial-gradient(circle at top left, var(--color-accent-blue) 0.1, transparent 50%),
        radial-gradient(circle at bottom right, var(--color-red-main) 0.1, transparent 50%),
        linear-gradient(135deg, var(--color-background-dark), #24243e);
    background-size: 100% 100%;
    background-attachment: fixed;
}

/* HEADINGS */
h1, h2, h3, h4 {
    color: var(--color-text-accent);
    font-weight: 500;
    letter-spacing: 0.5px;
    margin-bottom: var(--spacing-md);
    margin-top: 0;
    text-align: center;
}

h1 { font-size: 2.2rem; margin-bottom: 15px; } 
h2 { color: var(--color-text-primary); font-size: 1.5rem; text-transform: uppercase; border-bottom: 1px solid rgba(255,255,255,0.1); padding-bottom: 5px; }
h3 { color: var(--color-text-accent); font-size: 1.2rem; }
p { color: var(--color-text-secondary); font-size: 1rem; margin-bottom: 1rem; }

/* ======================================================= */
/* 2. LAYOUT & NAVIGATION                                  */
/* ======================================================= */

main {
    flex-grow: 1;
    padding-top: 60px; /* Platz für Navbar */
    width: 100%;
    max-height: 100vh;
    box-sizing: border-box;
}

.navbar {
    background-color: rgba(1, 22, 56, 0.95);
    box-shadow: 0 4px 10px var(--color-shadow);
    padding: 0;
    position: fixed;
    text-align: center;
    top: 0;
    width: 100%;
    z-index: 1000;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.navbar a, .navbar button {
    background-color: transparent;
    border: none;
    color: var(--color-text-light);
    cursor: pointer;
    font-size: 1.1em;
    font-weight: bold;
    padding: 18px 20px;
    text-decoration: none;
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
}

.navbar a:hover, .navbar a.active, .navbar button:hover {
    border-bottom: 3px solid var(--color-blue-main);
    color: var(--color-blue-main);
    background: rgba(255,255,255,0.05);
}

.main-layout {
    display: grid;
    /* Linke und Rechte Spalte fix, Mitte flexibel */
    grid-template-columns: 320px minmax(400px, 600px) 320px;
    justify-content: center;
    gap: 20px;
    height: calc(100vh - 60px); /* Volle Höhe minus Header */
    padding: 10px 20px;
    max-width: 1800px;
    margin: 0 auto;
}

/* SPALTEN SCROLLING */
.left-column, .right-column {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow-y: auto;
    scrollbar-width: thin;
    padding: 5px;
}

/* WICHTIG: FIX FÜR MITTLERE SPALTE (Buttons oben halten) */
.middle-column {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow-y: auto;
    scrollbar-width: none;
    padding: 5px;
    
    /* Der entscheidende Fix: */
    justify-content: flex-start; 
    gap: 15px; 
    -ms-overflow-style: none;
}

/* Box Style (Basis für Module) */
.box-style {
    background-color: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 15px;
}

/* Webkit Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #222; border-radius: 3px; }
::-webkit-scrollbar-thumb { background: var(--color-accent-blue); border-radius: 3px; }

/* ======================================================= */
/* 2a. NEWS TICKER (Fixed Top)                             */
/* ======================================================= */

#news-ticker-container {
    position: fixed;
    top: 60px; /* Unter Navbar */
    left: 0;
    width: 100%;
    height: 30px;
    background-color: var(--color-primary-dark);
    border-bottom: 1px solid var(--color-accent-blue);
    z-index: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.5);
}

#news-ticker-bar {
    background-color: #111;       /* Fast schwarz */
    border-bottom: 2px solid #009ffd; /* Blaue Linie unten */
    color: #fff;
    padding: 5px 10px;
    font-size: 0.9rem;
    font-family: monospace;       /* Computer-Schrift */
    white-space: nowrap;          /* Text in einer Zeile */
    overflow: hidden;             /* Was zu lang ist, abschneiden */
    text-align: center;
}

#news-ticker-text {
    display: inline-block;
    transition: opacity 0.5s ease-in-out; /* Weiches Einblenden */
    color: #FFD700;               /* Goldene Schrift */
}

/* ======================================================= */
/* 3. SMILEY & LINKES DASHBOARD (KOMPAKT)                  */
/* ======================================================= */

#smiley_button {
    /* Button-Größe deutlich reduziert, damit er in die Spalte passt */
    width: 180px;  
    height: 180px;
    background: rgba(0, 159, 253, 0.1);
    border: 3px solid #009ffd;
    border-radius: 50%;
    cursor: pointer;
    outline: none;
    position: relative;
    overflow: hidden; 
    
    /* Perfekte Zentrierung */
    display: flex;
    justify-content: center;
    align-items: center;
    
    /* Damit er nicht die ganze Breite einnimmt */
    margin: 10px auto; 
    
    box-shadow: 0 0 20px rgba(0, 159, 253, 0.2);
    transition: transform 0.1s ease;
    user-select: none;
}

/* Für Emojis als Text */
#smiley_button {
    font-size: 80px; 
    line-height: 1;
}

/* Für Skin-Bilder */
#smiley_button img {
    width: 70%;      
    height: 70%;     
    object-fit: contain; 
    pointer-events: none;
}

/* Klick-Animation */
#smiley_button:active {
    transform: scale(0.95);
}

/* Linke Stats Box */
.stats-box {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

/* Pet Display in der Sidebar */
#active_pet_display {
    transition: all 0.3s ease;
}

#active_pet_display img.active-pet-img {
    width: 50px; height: 50px;
    border-radius: 50%;
    border: 2px solid #FFD700;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.4);
    flex-shrink: 0;
}

#active_pet_display div { display: flex; flex-direction: column; text-align: left; }
#active_pet_display span { font-size: 0.95rem; font-weight: bold; color: #fff; margin-bottom: 2px; }
#active_pet_display .pet-tooltip { font-size: 0.8rem; color: #aaa; cursor: help; }

/* Combo-Zähler über dem Smiley */
.combo-display {
    position: absolute;
    top: -40px;
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--color-accent-blue);
    text-shadow: 0 0 10px rgba(0, 159, 253, 0.8);
    pointer-events: none;
    opacity: 0;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.2s;
}

.combo-display.active {
    opacity: 1;
    transform: scale(1.2);
}

/* Kleiner Text unter dem Multiplikator */
.combo-text {
    font-size: 0.7rem;
    display: block;
    text-align: center;
    color: #fff;
    text-transform: uppercase;
}

/* ======================================================= */
/* 4. RECHTE SPALTE & GEBÄUDE (HOLO STYLE)                 */
/* ======================================================= */

/* Container für Gebäude */
.building-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
}

/* Einzelne Gebäude-Karte */
.building-item {
    /* Dunkelblauer Hintergrund wie im Bild */
    background-color: #0b1629; 
    border: 1px solid #005a8d;  /* Dunkleres Blau für den Rand */
    border-radius: 6px;
    padding: 8px 10px;
    margin-bottom: 8px;
    
    display: flex;
    flex-direction: column;
    gap: 5px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
}

.building-header {
    display: flex; 
    justify-content: space-between; 
    align-items: center;
}

.building-name {
    font-weight: bold;
    color: #fff;
    font-size: 1.0rem;
}

.building-item:hover {
    background-color: rgba(255, 255, 255, 0.08);
    border-color: var(--color-accent-blue);
    transform: translateX(-3px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

/* Titelzeile */
.building-item h3 {
    margin: 0;
    font-size: 0.95rem;
    color: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: left;
}

/* Anzahl Badge */
.building-item h3 span {
    background: rgba(0, 159, 253, 0.15);
    color: var(--color-accent-blue);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: bold;
}

/* Info Text */
.building-item .production {
    font-size: 0.75rem;
    color: #aaa;
    margin-bottom: 5px;
}

/* Buttons */
.building-item .button-group {
    display: flex;
    gap: 4px;
    margin-top: auto;
    width: 100%;
}

/* === EINZELNER KAUF-BUTTON IN DER KARTE === */
.building-item .btn-buy {
    width: 100%; /* Volle Breite */
    height: 35px;
    font-size: 0.9rem;
    border-radius: 6px;
    display: flex;
    justify-content: space-between; /* Text links, Preis rechts */
    padding: 0 10px;
    background-color: rgba(0, 0, 0, 0.3);
    border: 1px solid #444;
    color: #ccc;
    cursor: pointer;
    transition: all 0.1s;
    align-items: center;
}

/* Aktive Buttons */
.building-item .btn-buy:not(:disabled) {
    background-color: rgba(0, 159, 253, 0.15);
    border-color: var(--color-accent-blue);
    color: #fff;
}

.building-item .btn-buy:not(:disabled):hover {
    background-color: var(--color-accent-blue);
    color: #000;
    font-weight: bold;
}

.building-item .btn-buy:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Effekt für kaufbare Gebäude */
.building-item.affordable {
    border-color: var(--color-accent-blue);
    box-shadow: 0 0 12px rgba(0, 159, 253, 0.4);
    transition: all 0.3s ease;
}

/* Optional: Ein ganz leichtes Pulsieren, damit es lebendiger wirkt */
.building-item.affordable:not(:hover) {
    animation: affordable-pulse 2s infinite ease-in-out;
}

@keyframes affordable-pulse {
    0% { box-shadow: 0 0 8px rgba(0, 159, 253, 0.3); }
    50% { box-shadow: 0 0 15px rgba(0, 159, 253, 0.6); }
    100% { box-shadow: 0 0 8px rgba(0, 159, 253, 0.3); }
}

/* ======================================================= */
/* 5. GLOBALE BUTTONS & UPGRADES                           */
/* ======================================================= */

/* === MULTIPLIKATOR TOGGLES (RECHTS) === */
.buy-amount-container {
    display: flex;
    gap: 5px;
    margin-bottom: 10px;
    padding: 5px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-toggle {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid #444;
    color: #888;
    padding: 5px 0;
    cursor: pointer;
    border-radius: 4px;
    font-weight: bold;
    font-size: 0.8rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    transform: translateY(-1px);
}

.btn-toggle.active {
    background: var(--color-accent-blue);
    color: #000;
    border-color: var(--color-accent-blue);
    box-shadow: 0 0 10px rgba(0, 159, 253, 0.4);
}

/* Globale Buttons */
.btn-primary, .btn-confirm, .btn-danger, .btn-prestige, .btn-cancel, .btn-feature {
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    padding: 10px 15px;
    text-align: center;
    transition: background 0.2s, transform 0.1s, box-shadow 0.2s;
    color: #fff;
}

.btn-primary { background-color: var(--color-blue-main); color: #000; }
.btn-primary:hover { 
    background-color: #33baff; 
    transform: translateY(-2px);
    box-shadow: 0 0 15px var(--color-accent-blue);
}

.btn-danger, .btn-prestige { background-color: var(--color-red-main); }
.btn-danger:hover { 
    background-color: #8a0806; 
    transform: translateY(-2px);
    box-shadow: 0 0 15px var(--color-secondary-red);
}

.btn-cancel { background-color: var(--color-neutral-accent); }

/* Feedback beim Klicken für alle Buttons */
.btn-primary:active, .btn-confirm:active, .btn-danger:active, .btn-prestige:active, .btn-toggle:active {
    transform: scale(0.95);
}

#open_diamond_mine_button:hover { 
    color: #009FFD; 
    border-color: #009FFD;
    box-shadow: 0 0 10px rgba(0, 159, 253, 0.3);
}

#open_guilds_button:hover { 
    color: #ff5252; 
    border-color: #6B0504;
    box-shadow: 0 0 10px rgba(107, 5, 4, 0.3);
}

/* Upgrade Liste (Mitte) */
.research-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 10px;
    margin-bottom: 8px;
    min-height: 60px;
    flex-shrink: 0; 
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.research-item:hover { 
    background-color: rgba(255, 255, 255, 0.08); 
    border-color: var(--color-accent-blue);
    transform: scale(1.02);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.research-content { flex-grow: 1; margin-right: 10px; overflow: hidden; }
.research-title-row { display: flex; align-items: baseline; gap: 8px; }
.research-group-name { font-size: 0.7rem; color: var(--color-accent-blue); text-transform: uppercase; }
.research-name { font-weight: bold; color: #fff; font-size: 0.9rem; }
.research-desc { font-size: 0.75rem; color: #aaa; }

/* Glow für kaufbare Upgrades in der Mitte */
.research-item.affordable {
    border-color: var(--color-accent-blue);
    box-shadow: 0 0 15px rgba(0, 159, 253, 0.4);
    background-color: rgba(0, 159, 253, 0.08); /* Leicht helleres Blau im Hintergrund */
}

/* Pulsieren für kaufbare Upgrades */
.research-item.affordable:not(:hover) {
    animation: upgrade-glow-pulse 2s infinite ease-in-out;
}

@keyframes upgrade-glow-pulse {
    0% { box-shadow: 0 0 5px rgba(0, 159, 253, 0.2); }
    50% { box-shadow: 0 0 15px rgba(0, 159, 253, 0.5); }
    100% { box-shadow: 0 0 5px rgba(0, 159, 253, 0.2); }
}

.btn-buy-research {
    background: var(--color-blue-main);
    color: #000; /* Schwarz auf Blau für bessere Lesbarkeit */
    border: none;
    border-radius: 4px;
    padding: 5px 10px;
    cursor: pointer;
    font-size: 0.8rem;
    min-width: 80px;
    font-weight: bold;
    transition: all 0.2s;
}

.btn-buy-research:not(:disabled) {
    box-shadow: 0 0 8px rgba(0, 159, 253, 0.4);
}

.btn-buy-research:not(:disabled):hover {
    filter: brightness(1.2);
    box-shadow: 0 0 12px rgba(0, 159, 253, 0.6);
}

.btn-buy-research:disabled { 
    background: #333; 
    color: #777; 
    cursor: not-allowed;
    box-shadow: none;
}
/* ======================================================= */
/* 6. MODALS & POPUPS                                      */
/* ======================================================= */

/* Update für den Modal-Hintergrund */
.modal {
    background-color: rgba(0, 0, 0, 0.6); /* Etwas transparenter */
    backdrop-filter: blur(8px);           /* Der magische Blur-Effekt */
    -webkit-backdrop-filter: blur(8px);
    display: none; 
    align-items: center;
    justify-content: center;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 2000;
    padding: 20px;
    opacity: 0;                           /* Start für Animation */
    transition: opacity 0.3s ease;
}

/* Wenn das Modal angezeigt wird (Logik via JS oder CSS-Klasse) */
.modal[style*="display: flex"] {
    opacity: 1;
}

/* Update für den Modal-Inhalt mit Einfliege-Animation */
.modal-content {
    background-color: rgba(11, 16, 25, 0.95); /* Glas-Look */
    border: 1px solid var(--color-accent-blue);
    border-radius: 12px;
    box-shadow: 0 0 50px rgba(0, 159, 253, 0.2);
    max-height: 90vh;
    max-width: 900px;
    width: 95%;
    display: flex;
    flex-direction: column;
    padding: 20px;
    
    /* Animation beim Erscheinen */
    transform: scale(0.8) translateY(20px);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Skalierung auf Normalgröße, wenn das Modal aktiv ist */
.modal[style*="display: flex"] .modal-content {
    transform: scale(1) translateY(0);
}

.modal-content.large { max-width: 1000px; }
.modal-content h2 { margin-top: 0; color: var(--color-accent-blue); border-bottom: 1px solid #333; padding-bottom: 10px; }
.page-container { overflow-y: auto; flex-grow: 1; padding-right: 5px; }
.modal-buttons { margin-top: 20px; text-align: right; border-top: 1px solid #333; padding-top: 10px; }

/* Settings Slider */
.settings-section { background: rgba(255,255,255,0.05); padding: 15px; border-radius: 8px; margin-bottom: 15px; text-align: center; }
input[type=range] { width: 100%; cursor: pointer; }
#save-data-textarea { width: 100%; background: #000; color: #009FFD; border: 1px solid #333; padding: 10px; }

/* Toast Notifications */
#toast-container { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); z-index: 10000; pointer-events: none; display: flex; flex-direction: column; gap: 10px; }
.toast { background: rgba(0,0,0,0.9); color: #fff; padding: 12px 24px; border-radius: 8px; border-left: 5px solid var(--color-accent-blue); box-shadow: 0 4px 12px rgba(0,0,0,0.5); opacity: 0; transform: translateY(-20px); transition: all 0.3s; }
.toast.show { opacity: 1; transform: translateY(0); }
.toast.success { border-color: #FFD700; color: #FFD700; }

#cloud-controls button {
    margin: 5px;
    min-width: 120px;
}

/* ======================================================= */
/* 7. PRESTIGE TREE (DRAG & DROP CANVAS)                   */
/* ======================================================= */

#prestige-tree-container {
    position: relative;
    width: 100%;
    height: 500px;
    background: radial-gradient(circle at center, #0b0f19 0%, #000 100%);
    border: 1px solid var(--color-accent-blue);
    border-radius: 8px;
    overflow: hidden;
    cursor: grab;
    user-select: none;
    background-image: 
        linear-gradient(rgba(0, 159, 253, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 159, 253, 0.05) 1px, transparent 1px);
    background-size: 40px 40px;
}

#prestige-tree-container:active { cursor: grabbing; }

#prestige-tree-world {
    position: absolute;
    top: 0; left: 0;
    transform-origin: 0 0;
    will-change: transform;
}

#prestige-lines {
    position: absolute;
    top: 0; left: 0;
    pointer-events: none;
    z-index: 1;
}

.skill-node {
    position: absolute;
    width: 50px; height: 50px;
    border-radius: 50%;
    background-color: #0b0f19;
    border: 3px solid #6B0504;
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 24px;
    z-index: 10;
    transform: translate(-50%, -50%);
    cursor: pointer;
    box-shadow: 0 0 10px rgba(0,0,0,0.5);
    transition: transform 0.1s;
}

.skill-node:hover { transform: translate(-50%, -50%) scale(1.2); z-index: 100; }
.skill-node.purchased { background-color: var(--color-accent-blue); border-color: #fff; box-shadow: 0 0 15px var(--color-accent-blue); }
.skill-node.available { background-color: var(--color-neutral-olive); border-color: var(--color-accent-blue); }
.skill-node.locked { opacity: 0.6; border-color: #333; }

#prestige-tooltip-modal {
    position: fixed !important;
    background: rgba(10, 10, 25, 0.95);
    border: 1px solid #FFD700;
    padding: 15px;
    border-radius: 6px;
    z-index: 9999;
    pointer-events: none;
    box-shadow: 0 5px 20px rgba(0,0,0,0.8);
    max-width: 300px;
    color: #fff;
}

/* ======================================================= */
/* 8. FLOATING TEXT & EFFECTS                              */
/* ======================================================= */

.floating-text, .click-effect {
    position: fixed;
    pointer-events: none;
    color: #fff;
    font-weight: bold;
    font-size: 1.2rem;
    animation: floatUp 1s ease-out forwards;
    z-index: 5000;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
}

.click-effect { color: var(--color-accent-blue); font-size: 1.5rem; }
.click-effect.crit-style { color: #ff3333; font-size: 2.5rem; text-shadow: 0 0 10px red; font-weight: 900; }

@keyframes floatUp {
    0% { opacity: 1; transform: translateY(0) scale(1); }
    100% { opacity: 0; transform: translateY(-50px) scale(1.2); }
}

/* ======================================================= */
/* 9. OTHER MODULES (Mine, Guilds, Info)                   */
/* ======================================================= */

/* === ⛏️ DIAMANTEN MINE === */
.mine-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    margin: 20px auto;
    max-width: 400px;
    aspect-ratio: 1 / 1;
    user-select: none;
    -webkit-user-select: none;
}

.mine-tile {
    background: #444;
    border: 2px solid #222;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    position: relative;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.5);
    transition: none !important; 
    transform: none !important;
}

.mine-tile.hidden { background: linear-gradient(135deg, #5a5a5a, #3a3a3a); }
.mine-tile.revealed { background: #222; border-color: #111; cursor: default; box-shadow: inset 2px 2px 5px rgba(0,0,0,0.8); }
.mine-tile:hover { filter: brightness(1.2); background-color: #555; z-index: 1; }
.mine-tile:active { filter: brightness(0.8); background-color: #333; border-color: #000; }

.loot-stone { color: #666; font-size: 1.2rem; }
.loot-diamond { color: #00e5ff !important; text-shadow: 0 0 8px rgba(0, 159, 253, 0.6); font-weight: bold; }
.loot-gold { color: #FFD700 !important; text-shadow: 0 0 5px rgba(255, 235, 59, 0.5); }
.loot-fossil { color: #e0e0e0 !important; text-shadow: 0 0 5px rgba(255, 255, 255, 0.4); font-weight: bold; }

.loot-passage { 
    font-size: 2rem; 
    animation: pulse 1.5s infinite ease-in-out; 
    filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.5));
}

@keyframes pulse {
    0% { transform: scale(1); filter: brightness(1); }
    50% { transform: scale(1.15); filter: brightness(1.3); }
    100% { transform: scale(1); filter: brightness(1); }
}

.mine-nav {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    border-bottom: 1px solid #444;
    padding-bottom: 10px;
    min-height: 45px; 
}

.mine-nav button {
    flex: 1;
    padding: 10px;
    cursor: pointer;
    border: 1px solid #444;
    background: #222;
    color: #aaa;
    border-radius: 6px;
    transition: background-color 0.2s, color 0.2s, border-color 0.2s;
    transform: none !important;
}

.mine-nav button:hover { background: #333; color: #fff; border-color: #666; }
.mine-nav button:not(.btn-cancel) {
    background: #009ffd !important;
    color: #000 !important;
    font-weight: bold;
    border-color: #009ffd !important;
    box-shadow: 0 0 10px rgba(0, 159, 253, 0.4);
}

.mine-tile > * { pointer-events: none !important; }
.mine-grid, .mine-nav { user-select: none; -webkit-user-select: none; }
.mine-nav button { border: 1px solid transparent; transform: translateZ(0); }

.tool-bar { transition: all 0.2s ease; }
.btn-tool {
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid #555;
    background: #333;
    cursor: pointer;
    font-size: 1.1rem;
    min-width: 60px;
    transition: background 0.1s, border-color 0.1s;
    transform: none !important;
}
.btn-tool:hover { background: #444; border-color: #777; }
.btn-tool:active { background: #222; }

.loot-emerald {
    color: #00ff88;
    text-shadow: 0 0 10px #00ff88;
    font-size: 1.5em;
    animation: pulse 1s infinite alternate;
}

/* Info Grid */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
    padding: 10px 0;
}

.info-upgrade-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid #444;
    border-radius: 8px;
    padding: 10px;
    text-align: center;
}
.info-upgrade-item.bought-upgrade { border-left: 4px solid var(--color-accent-blue); }

#info_global_upgrades_container, #info_buildings_container, #info_achievements_container, #info_pets_container {
    overflow-y: auto;
    flex: 1;
    min-height: 0;
    padding-right: 5px;
    margin-bottom: 10px;
    border-bottom: 1px solid #333;
}

/* ======================================================= */
/* 10. RNG Events                                          */
/* ======================================================= */

.rng-event-object {
    position: fixed;
    width: 60px;
    height: 60px;
    cursor: pointer;
    z-index: 9999;
    font-size: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    animation: bounceAround 10s linear infinite, glowPulse 1.5s ease-in-out infinite;
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.5));
}

@keyframes glowPulse {
    0% { transform: scale(1); filter: drop-shadow(0 0 5px gold); }
    50% { transform: scale(1.2); filter: drop-shadow(0 0 20px white); }
    100% { transform: scale(1); filter: drop-shadow(0 0 5px gold); }
}

@keyframes bounceAround {
    0% { margin-left: 0px; margin-top: 0px; }
    25% { margin-left: 50px; margin-top: 100px; }
    50% { margin-left: -50px; margin-top: 200px; }
    75% { margin-left: 100px; margin-top: 50px; }
    100% { margin-left: 0px; margin-top: 0px; }
}

/* ======================================================= */
/* 11. Skills                                              */
/* ======================================================= */

.btn-skill {
    width: 100%;
    min-height: 65px;
    background: rgba(0, 0, 0, 0.6);
    border: 2px solid #333;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-skill.ready { border-color: #009FFD; box-shadow: 0 0 10px rgba(0, 159, 253, 0.3); }
.btn-skill.ready .skill-timer { color: #009FFD; }

.btn-skill.is-active { border-color: #4CAF50 !important; background: rgba(76, 175, 80, 0.15); box-shadow: 0 0 15px rgba(76, 175, 80, 0.5); }
.btn-skill.is-active .skill-timer { color: #4CAF50 !important; }

.btn-skill:disabled { border-color: #f44336; background: rgba(244, 67, 54, 0.1); cursor: not-allowed; }
.btn-skill:disabled .skill-timer { color: #f44336; }

.skill-timer { font-size: 0.75rem; font-weight: bold; margin-top: 4px; letter-spacing: 1px; }

/* ======================================================= */
/* 12. Pets                                                */
/* ======================================================= */

.pet-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    padding: 10px;
}

.pet-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid #444;
    border-radius: 12px;
    padding: 15px;
    text-align: center;
    transition: transform 0.2s, border-color 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}
.pet-item:hover { transform: translateY(-2px); background: rgba(255, 255, 255, 0.08); }

.pet-item.active { border: 2px solid #4CAF50; box-shadow: 0 0 15px rgba(76, 175, 80, 0.3); background: rgba(76, 175, 80, 0.05); }
.pet-item.bought { border-color: #009ffd; }

.pet-icon { font-size: 3rem; margin-bottom: 10px; filter: drop-shadow(0 0 5px rgba(255,255,255,0.3)); }
.pet-name { font-weight: bold; color: #fff; margin-bottom: 5px; font-size: 1.1rem; }
.pet-desc { font-size: 0.8rem; color: #aaa; min-height: 40px; margin-bottom: 10px; }
.pet-actions button { width: 100%; margin-top: 5px; font-size: 0.85rem; padding: 6px; }

#pet-lock-message {
    text-align: center;
    padding: 40px;
    color: #ff5252;
    background: rgba(255, 0, 0, 0.05);
    border: 1px dashed #ff5252;
    border-radius: 10px;
    margin: 20px;
}

/* ======================================================= */
/* 13. MEDIA QUERIES                                       */
/* ======================================================= */

@media (max-width: 1400px) {
    .main-layout { grid-template-columns: 280px 1fr 280px; gap: 10px; padding: 10px; }
}

@media (max-width: 950px) {
    .main-layout { grid-template-columns: 1fr; height: auto; overflow-y: auto; }
    .left-column, .middle-column, .right-column { height: auto; overflow: visible; }
    .navbar { position: relative; }
    main { padding-top: 0; }
}

/* ======================================================= */
/* 14. VISUAL FEEDBACK (Screen Shake)                      */
/* ======================================================= */

@keyframes shake-animation {
    0% { transform: translate(1px, 1px) rotate(0deg); }
    10% { transform: translate(-1px, -2px) rotate(-1deg); }
    20% { transform: translate(-3px, 0px) rotate(1deg); }
    30% { transform: translate(3px, 2px) rotate(0deg); }
    40% { transform: translate(1px, -1px) rotate(1deg); }
    50% { transform: translate(-1px, 2px) rotate(-1deg); }
    60% { transform: translate(-3px, 1px) rotate(0deg); }
    70% { transform: translate(3px, 1px) rotate(-1deg); }
    80% { transform: translate(-1px, -1px) rotate(1deg); }
    90% { transform: translate(1px, 2px) rotate(0deg); }
    100% { transform: translate(1px, -2px) rotate(-1deg); }
}

.shake-effect { animation: shake-animation 0.3s; animation-iteration-count: 1; }

.boss-hit-effect {
    animation: shake-animation 0.2s;
    border-color: #ff5252 !important;
    background-color: rgba(255, 0, 0, 0.1) !important;
}

#big-bang-overlay {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    background: white; opacity: 0; pointer-events: none; z-index: 99999;
    transition: opacity 0.1s ease-in;
}

.flash-bang { animation: flash-animation 2.5s forwards; }

@keyframes flash-animation {
    0% { opacity: 0; } 5% { opacity: 1; } 20% { opacity: 1; } 100% { opacity: 0; }
}

/* ======================================================= */
/* 15. SYSTEM: CUSTOM TOOLTIP & BUFF BAR                   */
/* ======================================================= */

#custom-tooltip {
    position: fixed; display: none; background: rgba(20, 20, 25, 0.95);
    border: 1px solid #444; border-left: 4px solid var(--color-primary-dark);
    padding: 12px; border-radius: 4px; color: #fff; font-size: 0.9rem;
    pointer-events: none; z-index: 100000; box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    max-width: 300px; white-space: pre-line; backdrop-filter: blur(4px);
}

#custom-tooltip h4 { margin: 0 0 5px 0; color: var(--color-accent-blue); font-size: 1rem; border-bottom: 1px solid #444; padding-bottom: 4px; }
#custom-tooltip .tooltip-stat { display: flex; justify-content: space-between; font-size: 0.85rem; margin-bottom: 2px; }
#custom-tooltip .highlight-green { color: #4CAF50; }
#custom-tooltip .highlight-red { color: #ff5252; }
#custom-tooltip .highlight-gold { color: #FFD700; }

.buff-bar { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 10px; min-height: 5px; }
.buff-badge { display: flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 6px; font-size: 0.8rem; font-weight: bold; box-shadow: 0 2px 5px rgba(0,0,0,0.3); border: 1px solid transparent; transition: all 0.2s; }
.buff-badge.good { background: rgba(76, 175, 80, 0.15); border-color: #4CAF50; color: #4CAF50; }
.buff-badge.bad { background: rgba(244, 67, 54, 0.15); border-color: #f44336; color: #f44336; }

/* ======================================================= */
/* 16. CHAT SYSTEM (Final Theme Version)                   */
/* ======================================================= */

/* 1. Haupt-Container */
#main-chat-container {
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 360px;
    height: 380px;
    background-color: rgba(1, 22, 56, 0.95); 
    border: 1px solid #009ffd;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    z-index: 9999;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow: hidden;
    transition: all 0.3s ease;
}

#main-chat-container.chat-minimized { height: 42px; width: 280px; border-color: #444; }

/* 2. Header */
.chat-header {
    display: flex; align-items: center; padding: 0 10px; height: 42px;
    background: rgba(0, 0, 0, 0.4); border-bottom: 1px solid rgba(0, 159, 253, 0.3); gap: 10px; 
}

/* 3. Tabs */
.chat-tabs { display: flex; gap: 4px; flex-shrink: 0; }
.btn-chat-tab {
    position: relative; background: transparent; border: 1px solid transparent; color: #889;
    padding: 4px 8px; font-size: 0.85rem; cursor: pointer; border-radius: 4px; transition: all 0.2s; font-family: inherit;
}
.btn-chat-tab:hover { color: #fff; background: rgba(255, 255, 255, 0.05); }
.btn-chat-tab.active { background: rgba(0, 159, 253, 0.2); border: 1px solid #009ffd; color: #fff; text-shadow: 0 0 5px rgba(0, 159, 253, 0.5); }

/* 4. Name */
#chat-user-display {
    flex-grow: 1; display: flex; justify-content: center; align-items: center;
    background: transparent !important; border: none !important; box-shadow: none !important;
    font-size: 0.8rem; color: #aaa; white-space: nowrap; overflow: hidden; cursor: pointer;
}
#current-player-name { color: #009ffd; font-weight: bold; margin-left: 5px; }
#chat-user-display:hover #current-player-name { text-decoration: underline; color: #fff; }

/* 5. Controls */
.header-controls { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
#btn-chat-mute { background: transparent; border: none; cursor: pointer; font-size: 1rem; padding: 0; opacity: 0.6; color: #fff; transition: transform 0.2s; }
#btn-chat-mute:hover { opacity: 1; transform: scale(1.1); }
#btn-chat-mute.muted { color: #ff4444; opacity: 1; }
#btn-chat-toggle { background: transparent; border: none; color: #aaa; font-weight: bold; cursor: pointer; font-size: 1.2rem; line-height: 1; padding: 0; }
#btn-chat-toggle:hover { color: #fff; }

/* 6. Content */
#chat-content-wrapper {
    display: flex; flex-direction: column; height: 100%; flex: 1; min-height: 0;
    background: rgba(0, 0, 0, 0.2); overflow: hidden;
}

#chat-messages { flex: 1; overflow-y: auto; padding: 10px; display: flex; flex-direction: column; gap: 6px; }

.chat-msg { font-size: 0.85rem; line-height: 1.35; word-wrap: break-word; color: #e0e0e0; padding: 2px 0; }
.chat-msg strong { color: #009ffd; cursor: pointer; }
.chat-msg.system { color: #ffd700; font-style: italic; font-size: 0.8rem; border-bottom: 1px solid rgba(255, 215, 0, 0.2); padding-bottom: 4px; margin-bottom: 4px; }
.chat-msg.guild { border-left: 3px solid #3e5641; padding-left: 8px; background: rgba(62, 86, 65, 0.1); }

/* 7. Input */
.chat-input-area { display: flex; padding: 10px; background: rgba(0, 0, 0, 0.3); border-top: 1px solid rgba(0, 159, 253, 0.2); gap: 8px; flex-shrink: 0; }
#chat-input { flex: 1; background: rgba(0, 0, 0, 0.5); border: 1px solid #444; color: #fff; padding: 8px 10px; border-radius: 4px; font-size: 0.9rem; outline: none; font-family: inherit; }
#chat-input:focus { border-color: #009ffd; box-shadow: 0 0 5px rgba(0, 159, 253, 0.3); }

#btn-chat-send {
    width: 40px; background: linear-gradient(135deg, #009ffd, #0077c2); border: none; border-radius: 4px; cursor: pointer;
    font-size: 1.1rem; display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}
#btn-chat-send:hover { filter: brightness(1.1); transform: translateY(-1px); }
#btn-chat-send:active { transform: translateY(1px); }

#chat-messages::-webkit-scrollbar { width: 6px; }
#chat-messages::-webkit-scrollbar-track { background: rgba(0,0,0,0.3); }
#chat-messages::-webkit-scrollbar-thumb { background: #333; border-radius: 3px; }
#chat-messages::-webkit-scrollbar-thumb:hover { background: #009ffd; }

.notification-dot {
    display: none; position: absolute; top: -3px; right: -3px; width: 9px; height: 9px;
    background-color: #ff3333; border-radius: 50%; box-shadow: 0 0 4px #ff0000; z-index: 10;
}
.btn-chat-tab.has-notification .notification-dot { display: block; }

/* 8. Gilden-Liste (Styling für zukünftige Nutzung) */
.guild-list-container { flex: 1; display: flex; flex-direction: column; background: rgba(0, 0, 0, 0.3); overflow: hidden; }
.guild-list-header { display: grid; grid-template-columns: 40px 1fr 1fr; padding: 8px; background: rgba(0, 159, 253, 0.2); font-weight: bold; color: #009ffd; font-size: 0.8rem; border-bottom: 1px solid #333; }
#guild-list-body { flex: 1; overflow-y: auto; padding: 5px; }
.guild-member-row { display: grid; grid-template-columns: 40px 1fr 1fr; align-items: center; padding: 6px 4px; border-bottom: 1px solid rgba(255,255,255,0.05); font-size: 0.85rem; color: #ccc; }
.guild-member-row:hover { background: rgba(255,255,255,0.05); }
.rank { color: #666; font-size: 0.75rem; text-align: center; }
.score { color: #ffd700; text-align: right; font-family: monospace; }
.name { display: flex; align-items: center; gap: 5px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.highlight-me { color: #009ffd; font-weight: bold; }

#btn-guild-list { background: transparent; border: 1px solid #444; color: #ddd; cursor: pointer; border-radius: 4px; padding: 2px 6px; }
#btn-guild-list:hover { background: rgba(255,255,255,0.1); }
#btn-guild-list.active { background: #009ffd; color: #fff; border-color: #009ffd; }

#building-tooltip {
    background-color: rgba(15, 20, 30, 0.95); /* Fast schwarzer Hintergrund, 95% deckend */
    border: 2px solid #009ffd;               /* Dein typischer blauer Rand */
    border-radius: 8px;                      /* Abgerundete Ecken */
    padding: 12px;                           /* Platz innen */
    color: #ffffff;                          /* Weiße Schrift */
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);  /* Schatten für 3D-Effekt */
    pointer-events: none;                    /* WICHTIG: Damit die Maus durchklicken kann */
    font-size: 0.9rem;                       /* Lesbare Größe */
    min-width: 220px;                        /* Mindestbreite */
    z-index: 9999;                           /* Immer ganz oben */
    backdrop-filter: blur(5px);              /* Leichter Milchglas-Effekt (optional) */
}

/* --- Stats Box Bereinigung --- */
.stats-header {
    color: var(--color-accent-blue);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 5px;
    margin-bottom: 10px;
    font-size: 1.1rem;
    letter-spacing: 1px;
}

.stats-main-display {
    text-align: center;
    margin-bottom: 10px;
}

.stats-label-small {
    font-size: 0.7rem;
    color: #888;
    text-transform: uppercase;
}

.stats-value-large {
    font-size: 2.0rem;
    font-weight: bold;
    color: #fff;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
    line-height: 1.1;
}

.stats-grid-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5px;
    margin-bottom: 8px;
}

.stats-card-small {
    background: rgba(255, 255, 255, 0.05);
    padding: 5px;
    border-radius: 6px;
    text-align: center;
}

.stats-value-medium {
    font-size: 1.0rem;
    font-weight: bold;
    color: var(--color-accent-blue);
}

.stats-subtext {
    font-size: 0.65rem;
    color: #666;
}

.global-boost-box {
    background: rgba(0, 159, 253, 0.1);
    border: 1px solid var(--color-accent-blue);
    padding: 4px;
    border-radius: 4px;
    text-align: center;
    margin-bottom: 8px;
    font-size: 0.8rem;
}

.diamond-display-box {
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 5px;
}

.diamond-text {
    font-size: 1rem;
    color: #b9f2ff;
    text-shadow: 0 0 5px #009ffd;
    font-weight: bold;
}
/* ======================================================= */
/* 17. CLICK PARTICLES                                     */
/* ======================================================= */

.click-particle {
    position: fixed;
    pointer-events: none;
    z-index: 10000; /* Über allem anderen */
    font-size: 1.2rem;
    user-select: none;
    animation: particle-fly 0.8s ease-out forwards;
}

@keyframes particle-fly {
    0% { 
        transform: translate(-50%, -50%) scale(1); 
        opacity: 1; 
    }
    100% { 
        /* Die Variablen --tw-x/y werden per JavaScript berechnet */
        transform: translate(var(--tw-x), var(--tw-y)) scale(0) rotate(360deg); 
        opacity: 0; 
    }
}

/* Combo-Zähler Styling */
.combo-display {
    position: absolute;
    top: -45px; /* Position über dem Smiley */
    left: 50%;
    transform: translateX(-50%) scale(0.5);
    width: 100px;
    text-align: center;
    font-weight: bold;
    color: var(--color-accent-blue);
    text-shadow: 0 0 10px rgba(0, 159, 253, 0.8);
    pointer-events: none;
    opacity: 0;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 100;
}

/* Wenn die Combo aktiv ist */
.combo-display.active {
    opacity: 1;
    transform: translateX(-50%) scale(1.1);
}

#combo-value {
    font-size: 1.6rem;
    display: block;
    line-height: 1;
}

.combo-text {
    font-size: 0.7rem;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Cloud Status Styles */
#cloud-save-status.saving {
    color: #009ffd;
    text-shadow: 0 0 10px #009ffd;
    animation: cloud-pulse 1s infinite alternate;
}

#cloud-save-status.success {
    color: #4CAF50;
    text-shadow: 0 0 8px #4CAF50;
}

#cloud-save-status.error {
    color: #ff5252;
    animation: shake-effect 0.3s ease-in-out;
}

@keyframes cloud-pulse {
    from { opacity: 0.5; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1.1); }
}

/* Museum Modal Layout */
.museum-layout {
    max-width: 900px;
    background: radial-gradient(circle at center, #011638 0%, #000 100%); /* Dunkles Blau zu Schwarz */
    border: 2px solid #333;
}

.museum-info-banner {
    background: rgba(0, 159, 253, 0.1);
    border: 1px solid var(--color-accent-blue);
    padding: 10px;
    text-align: center;
    border-radius: 8px;
    margin-bottom: 20px;
    color: #ccc;
    font-style: italic;
}

/* Artefakt Karten */
.artifact-card {
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid #444;
}

.artifact-card.owned {
    border-color: #ffd700; /* Gold für gefundene Stücke */
    background: rgba(255, 215, 0, 0.05);
}

.artifact-card.missing {
    opacity: 0.6;
    filter: grayscale(1);
}

.artifact-card.owned:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 10px 20px rgba(255, 215, 0, 0.2);
}

/* Seltenheits-Glanz */
.artifact-card.owned::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.1), transparent);
    transform: rotate(45deg);
    animation: shine 4s infinite;
}

@keyframes shine {
    0% { left: -150%; }
    20% { left: 150%; }
    100% { left: 150%; }
}

.artifact-icon {
    margin-bottom: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 60px;
}
/* ======================================================= */
/* 18. GUILD UI OVERRIDES (Contrast & Logic Fixes)         */
/* ======================================================= */
.mercenary-status-recovering {
    color: #ff4444 !important;
    font-weight: bold;
    text-shadow: 0 0 5px rgba(255, 68, 68, 0.5);
}

/* --- SÖLDNER & KARTEN --- */
.mercenary-card.active-merc {
    box-shadow: 0 0 15px rgba(0, 159, 253, 0.5);
    transform: scale(1.05);
    border-color: var(--color-accent-blue) !important;
}

/* --- REKRUTIERUNG & SPENDEN (Sekundär-Buttons) --- */
#btn-recruit, .btn-donate {
    background: #011638 !important; /* Dunkles Blau */
    color: #009ffd !important;      /* Akzent Blau */
    border: 1px solid #009ffd !important;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    font-weight: bold;
    transition: all 0.2s ease;
}

#btn-recruit:hover:not(:disabled), .btn-donate:hover:not(:disabled) {
    background: #009ffd !important;
    color: #011638 !important; /* Invertiert beim Hover für Kontrast */
    transform: translateY(-2px);
}

/* --- SPEZIAL-BUTTON (10% Spenden) --- */
#btn-donate-all {
    background: #009ffd !important;
    color: #011638 !important; /* Dunkler Text auf Blau */
    font-weight: bold;
    border: none !important;
    cursor: pointer;
    transition: all 0.2s ease;
}

#btn-donate-all:hover {
    filter: brightness(1.2);
    box-shadow: 0 0 15px rgba(0, 159, 253, 0.6);
}

/* --- QUEST BUTTONS --- */
.btn-assign-quest {
    background: #011638 !important;
    color: #009ffd !important;
    border: 1px solid #009ffd !important;
    font-weight: bold;
    cursor: pointer;
}

.btn-assign-quest:hover:not(:disabled) {
    background: #009ffd !important;
    color: #011638 !important;
}

.btn-claim-quest {
    background: linear-gradient(to bottom, #4CAF50, #2E7D32) !important;
    color: #ffffff !important;
    border: 1px solid #1B5E20 !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.4);
    cursor: pointer;
}

.btn-claim-quest:hover {
    background: #45a049 !important;
    transform: translateY(-1px);
}

/* --- BOSS RAID BUTTONS --- */
.boss-btn-active {
    background: linear-gradient(135deg, #6B0504, #911b1b) !important;
    color: #ffffff !important;
    font-weight: bold;
    box-shadow: 0 0 15px rgba(107, 5, 4, 0.5);
    cursor: pointer;
    animation: boss-pulse 2s infinite;
}

@keyframes boss-pulse {
    0% { box-shadow: 0 0 5px rgba(107, 5, 4, 0.5); }
    50% { box-shadow: 0 0 20px rgba(255, 0, 0, 0.7); }
    100% { box-shadow: 0 0 5px rgba(107, 5, 4, 0.5); }
}

/* --- GILDEN-FUNK (NOTIFICATIONS) --- */
#btn-toggle-notifications {
    background: #1a1a1a !important; 
    color: #009ffd !important;      
    border: 1px solid #009ffd !important;
    padding: 8px 16px;
    border-radius: 4px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
}

#btn-toggle-notifications:hover {
    background: #009ffd !important;
    color: #000000 !important;
}

/* --- GLOBALER STATUS: DEAKTIVIERT --- */
button:disabled, .boss-btn-cooldown {
    background: #222222 !important;
    color: #555555 !important;
    border: 1px solid #333333 !important;
    cursor: not-allowed !important;
    opacity: 1 !important; 
    box-shadow: none !important;
    transform: none !important;
}

/* ======================================================= */
/* 19. SMILEYPEDIA (WIKI) LAYOUT                           */
/* ======================================================= */

.wiki-sidebar {
    width: 200px;
    background: #0b0b0b;
    border-right: 1px solid #333;
    display: flex;
    flex-direction: column;
    padding: 10px;
    gap: 5px;
    flex-shrink: 0;
}

.wiki-nav-btn {
    background: transparent;
    border: none;
    color: #aaa;
    text-align: left;
    padding: 12px 15px;
    cursor: pointer;
    border-radius: 5px;
    font-weight: bold;
    transition: all 0.2s;
    font-size: 0.95rem;
}

.wiki-nav-btn:hover {
    background: rgba(255,255,255,0.05);
    color: #fff;
    padding-left: 20px;
}

.wiki-nav-btn.active {
    background: var(--color-accent-blue);
    color: #011638;
    box-shadow: 0 0 10px rgba(0, 159, 253, 0.3);
}

.wiki-content-area {
    flex: 1;
    padding: 25px;
    overflow-y: auto;
    background: radial-gradient(circle at center, #1a1a1a 0%, #000 100%);
}

/* Mobile Responsiveness */
@media (max-width: 700px) {
    #wiki-modal .modal-content > div {
        flex-direction: column;
    }
    .wiki-sidebar {
        width: 100%;
        flex-direction: row;
        overflow-x: auto;
        border-right: none;
        border-bottom: 1px solid #333;
        height: 60px;
        align-items: center;
    }
    .wiki-nav-btn {
        white-space: nowrap;
        padding: 8px 15px;
    }
}

.artifact-card {
    transition: transform 0.2s;
}
.artifact-card.owned:hover {
    transform: scale(1.05);
    background: rgba(255, 215, 0, 0.1) !important;
}
/* ======================================================= */
/* 20. WARDROBE / SKINS INTERFACE                          */
/* ======================================================= */

/* Das Grid im Modal */
#wardrobe-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 15px;
    padding: 10px;
}

/* Die einzelne Skin-Karte */
.skin-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid #444;
    border-radius: 12px;
    padding: 15px;
    text-align: center;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 160px;
}

.skin-card:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.08);
    border-color: #888;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

/* Wenn ausgerüstet */
.skin-card.active-skin {
    border: 2px solid #4CAF50;
    background: rgba(76, 175, 80, 0.05);
    box-shadow: 0 0 20px rgba(76, 175, 80, 0.2);
}

/* Das Emoji Icon */
.skin-icon {
    font-size: 3.5rem;
    margin-bottom: 10px;
    filter: drop-shadow(0 0 5px rgba(0,0,0,0.5));
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Skin Buttons */
.btn-buy-skin, .btn-equip-skin {
    width: 100%;
    margin-top: auto;
    font-size: 0.8rem;
    padding: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* --- SPEZIAL-ANIMATIONEN FÜR SKINS --- */

/* 1. Geist (Schweben & Transparent) */
.ghost-anim {
    animation: ghost-float 3s ease-in-out infinite;
    opacity: 0.8;
}
@keyframes ghost-float {
    0%, 100% { transform: translateY(0); opacity: 0.8; }
    50% { transform: translateY(-10px); opacity: 0.5; filter: drop-shadow(0 10px 5px rgba(255,255,255,0.2)); }
}

/* 2. Glitch (Verzerrung & Farben) */
.glitch-anim {
    position: relative;
    animation: glitch-skew 2s infinite linear alternate-reverse;
}
@keyframes glitch-skew {
    0% { transform: skew(0deg); }
    20% { transform: skew(-2deg); filter: drop-shadow(-2px 0 #ff00c1); }
    40% { transform: skew(2deg); filter: drop-shadow(2px 0 #00fff9); }
    60% { transform: skew(0deg); }
    80% { transform: skew(-1deg); }
    100% { transform: skew(0deg); }
}

/* 3. König (Goldenes Leuchten) */
.king-glow {
    animation: king-shine 3s infinite;
}
@keyframes king-shine {
    0% { filter: drop-shadow(0 0 5px gold); transform: scale(1); }
    50% { filter: drop-shadow(0 0 25px gold); transform: scale(1.05); }
    100% { filter: drop-shadow(0 0 5px gold); transform: scale(1); }
}

/* 4. Party (Wackeln) */
.party-anim { /* Falls du das css-Feld im JS noch hinzufügst */
    animation: party-dance 0.5s infinite;
}
@keyframes party-dance {
    0% { transform: rotate(0deg); }
    25% { transform: rotate(10deg); }
    75% { transform: rotate(-10deg); }
    100% { transform: rotate(0deg); }
}
/* WICHTIG für Market & Skins */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85); /* Dunkler Hintergrund */
    backdrop-filter: blur(5px);
    z-index: 3000; /* Muss über allem liegen */
    display: none; /* Standardmäßig ausgeblendet */
    align-items: center;
    justify-content: center;
}

/* Close Button in dynamischen Modals */
.close-modal {
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 2rem;
    color: #fff;
    cursor: pointer;
    z-index: 10;
}
.close-modal:hover { color: #ff5252; }

/* ======================================================= */
/* ✨ FEATURE BUTTONS 2.0 (Lebendig & Bunt)              */
/* ======================================================= */

.feature-button-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* 2 Reihen à 3 Buttons */
    gap: 8px;
    margin-bottom: 15px;
    flex-shrink: 0;
    width: 100%;
}

.feature-button-grid button {
    position: relative;
    height: 60px;
    font-size: 0.75rem;
    font-weight: bold;
    color: #eee;
    background: linear-gradient(180deg, rgba(30, 30, 40, 0.9) 0%, rgba(10, 10, 15, 0.95) 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    
    /* 👇 DAS IST NEU: Schiebt den Inhalt hoch */
    padding-bottom: 8px; 
    
    box-shadow: 0 4px 0 rgba(0,0,0,0.5); /* 3D-Effekt unten */
}

/* Das Icon im Button */
.feature-button-grid button span {
    font-size: 1.6rem;
    margin-bottom: 2px;
    display: block;
    filter: drop-shadow(0 0 5px rgba(0,0,0,0.5));
    transition: transform 0.2s ease;
}

/* --- INTERAKTION --- */

/* Drücken (Klick) */
.feature-button-grid button:active {
    transform: translateY(4px); /* Geht nach unten */
    box-shadow: 0 0 0 rgba(0,0,0,0); /* Schatten weg */
}

/* Hover Allgemein */
.feature-button-grid button:hover {
    transform: translateY(-2px);
    background: linear-gradient(180deg, rgba(50, 50, 60, 0.9) 0%, rgba(20, 20, 30, 0.95) 100%);
    color: #fff;
}

.feature-button-grid button:hover span {
    transform: scale(1.2) rotate(5deg); /* Icon wächst und wackelt */
}

/* --- INDIVIDUELLE FARBEN & LEUCHTEN --- */

/* 🐾 Pet Shop: Natur-Grün */
#open_pet_shop_button { border-bottom: 3px solid #4CAF50; }
#open_pet_shop_button:hover { box-shadow: 0 0 15px rgba(76, 175, 80, 0.4), 0 4px 0 rgba(0,0,0,0.5); border-color: #4CAF50; }

/* 💎 Mine: Diamant-Cyan */
#open_diamond_mine_button { border-bottom: 3px solid #00E5FF; }
#open_diamond_mine_button:hover { box-shadow: 0 0 15px rgba(0, 229, 255, 0.4), 0 4px 0 rgba(0,0,0,0.5); border-color: #00E5FF; }

/* ⚔️ Gilden: Kampf-Rot */
#open_guilds_button { border-bottom: 3px solid #FF5252; }
#open_guilds_button:hover { box-shadow: 0 0 15px rgba(255, 82, 82, 0.4), 0 4px 0 rgba(0,0,0,0.5); border-color: #FF5252; }

/* 👾 Market: Neon-Lila */
#open_blackmarket_button { border-bottom: 3px solid #D500F9; color: #e1bee7 !important; }
#open_blackmarket_button:hover { box-shadow: 0 0 15px rgba(213, 0, 249, 0.4), 0 4px 0 rgba(0,0,0,0.5); border-color: #D500F9; }

/* 🎩 Skins: Weiß/Edel */
#open_wardrobe_button { border-bottom: 3px solid #ffffff; }
#open_wardrobe_button:hover { box-shadow: 0 0 15px rgba(255, 255, 255, 0.3), 0 4px 0 rgba(0,0,0,0.5); border-color: #ffffff; }

/* 🏆 Erfolge: Gold */
#show_achievements_button { border-bottom: 3px solid #FFD700; background-color: rgba(255, 215, 0, 0.05) !important; }
#show_achievements_button:hover { box-shadow: 0 0 15px rgba(255, 215, 0, 0.4), 0 4px 0 rgba(0,0,0,0.5); border-color: #FFD700; }

/* Deaktivierte Buttons (grau) */
.feature-button-grid button[style*="display: none"] {
    display: none !important;
}

/* ======================================================= */
/* 👾 SCHWARZMARKT (GEM EMPIRE) STYLES                     */
/* ======================================================= */
.purple-card {
    background: linear-gradient(145deg, #120024 0%, #05000a 100%);
    border: 1px solid #4a148c;
    border-radius: 8px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0,0,0,0.6);
    min-height: 180px; 
}
.purple-card:hover {
    transform: translateY(-5px);
    border-color: #d500f9;
    box-shadow: 0 0 20px rgba(213, 0, 249, 0.2);
    z-index: 10;
}
.purple-card.maxed {
    border-color: #00e676;
    opacity: 0.7;
}
.purple-btn {
    background: linear-gradient(90deg, #6200ea 0%, #d500f9 100%);
    border: none;
    color: white;
    padding: 10px;
    border-radius: 6px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    margin-top: auto; 
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
    transition: 0.2s;
    width: 100%;
}
.purple-btn:hover:not(:disabled) {
    box-shadow: 0 0 15px rgba(213, 0, 249, 0.6);
    filter: brightness(1.2);
}
.purple-btn:disabled {
    background: transparent;
    border: 1px solid #444;
    color: #666;
    cursor: not-allowed;
    box-shadow: none;
}
.purple-header-glow {
    text-shadow: 0 0 10px #d500f9, 0 0 20px #651fff;
}
.exchange-box {
    background: linear-gradient(90deg, #1a0033 0%, #000 100%);
    border: 1px solid #d500f9;
    border-radius: 8px;
    padding: 20px;
    margin-top: 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 0 15px rgba(213, 0, 249, 0.2);
}
.exchange-btn {
    background: #d500f9; color: #fff; border: none; padding: 10px 20px;
    font-weight: bold; border-radius: 4px; cursor: pointer; text-transform: uppercase;
}
.exchange-btn:hover { box-shadow: 0 0 10px #d500f9; }
.exchange-btn:disabled { background: #444; color: #888; cursor: not-allowed; box-shadow: none; }

/* ======================================================= */
/* 🎩 SKINS & VISUALS STYLES                               */
/* ======================================================= */
.skin-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid #444;
    border-radius: 8px;
    padding: 10px;
    text-align: center;
    transition: 0.2s;
    position: relative;
}
.skin-card:hover { transform: translateY(-3px); border-color: #aaa; }
.skin-card.active-skin { border-color: #4CAF50; background: rgba(76, 175, 80, 0.1); box-shadow: 0 0 10px rgba(76, 175, 80, 0.3); }
.skin-icon { font-size: 3rem; margin-bottom: 5px; }

/* Spezial-Effekte Animationen */
@keyframes ghost-float { 0%,100% { opacity: 0.8; transform: translateY(0); } 50% { opacity: 0.4; transform: translateY(-5px); } }
.ghost-anim { animation: ghost-float 3s infinite ease-in-out; }

@keyframes glitch-skew { 0% { transform: skew(0deg); } 20% { transform: skew(-10deg); } 40% { transform: skew(10deg); } 100% { transform: skew(0deg); } }
.glitch-anim { animation: glitch-skew 0.5s infinite; filter: drop-shadow(2px 0 red) drop-shadow(-2px 0 blue); }

@keyframes king-shine { 0% { filter: drop-shadow(0 0 5px gold); } 50% { filter: drop-shadow(0 0 20px gold); } 100% { filter: drop-shadow(0 0 5px gold); } }
.king-glow { animation: king-shine 2s infinite; }

/* ======================================================= */
/* MEGA SKILL TREE (Vollbild Modal & Knoten-Größen)        */
/* ======================================================= */

/* 1. Macht das Modal fast so groß wie den gesamten Bildschirm */
#skill_tree_modal .modal-content {
    max-width: 95vw !important;
    height: 90vh !important;
    max-height: 90vh !important;
    display: flex;
    flex-direction: column;
    padding: 20px;
    background: #0a0a0a !important; /* Sehr dunkler Hintergrund */
    border: 1px solid #7c4dff !important;
    box-shadow: 0 0 50px rgba(124, 77, 255, 0.2) !important;
}

/* 2. Der Bereich, in dem du den Tree verschiebst (Pan-Container) */
#prestige-tree-container {
    width: 100%;
    flex: 1; /* Nimmt den restlichen Platz ein */
    overflow: hidden; /* WICHTIG: Verhindert unschöne Scrollbalken */
    background: radial-gradient(circle at center, #1a0033 0%, #000 100%);
    border-radius: 8px;
    border: 2px solid #333;
    position: relative;
    cursor: grab;
}

#prestige-tree-container:active {
    cursor: grabbing;
}

/* 3. Optisches Upgrade für die Linien-Ansicht */
#prestige-lines {
    filter: drop-shadow(0 0 3px rgba(0, 159, 253, 0.5));
}

/* ======================================================= */
/* SKILL TREE KNOTEN-GRÖSSEN (Moderat & Elegant)           */
/* ======================================================= */

/* Die wichtigste Regel: Zentriert jeden Knoten EXAKT auf der Koordinate (Linien-Kreuzung) */
.skill-node {
    position: absolute !important;
    transform: translate(-50%, -50%) !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    margin: 0 !important; /* Löscht alle alten, fehlerhaften Abstände */
}

/* 4. Kleine Reise-Knoten (1-3 Punkte) */
.skill-node.node-tier-travel {
    width: 32px !important;
    height: 32px !important;
    border-radius: 50% !important;
    font-size: 0.9rem !important;
    border: 2px solid #555 !important;
}

/* 5. Wichtige Keystones (5-10 Punkte) */
.skill-node.node-tier-keystone {
    width: 44px !important;
    height: 44px !important;
    border-radius: 10px !important;
    font-size: 1.2rem !important;
    border: 2px solid #FFD700 !important;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.5) !important;
}

/* 6. Die äußeren Götter-Knoten (25+ Punkte) */
.skill-node.node-tier-god {
    width: 56px !important;
    height: 56px !important;
    border-radius: 50% !important; 
    font-size: 1.5rem !important;
    border: 3px solid #e040fb !important;
    box-shadow: 0 0 20px rgba(224, 64, 251, 0.8) !important;
}

/* Animation für normale Treffer am Boss */
.boss-hit-shake {
    animation: bossShake 0.15s ease-in-out;
}

/* Animation für Kritische Treffer (Heftiger) */
.boss-crit-shake {
    animation: bossCrit 0.25s ease-in-out;
}

@keyframes bossShake {
    0% { transform: scale(1); filter: brightness(1); }
    50% { transform: scale(0.95) rotate(2deg); filter: brightness(1.5) sepia(1) saturate(5) hue-rotate(-50deg); } /* Kurzes Aufleuchten in Rot-Orange */
    100% { transform: scale(1) rotate(0deg); filter: brightness(1); }
}

@keyframes bossCrit {
    0% { transform: scale(1); }
    25% { transform: scale(0.9) translate(-10px, 5px) rotate(-5deg); filter: brightness(2) contrast(2); }
    50% { transform: scale(1.1) translate(10px, -5px) rotate(5deg); }
    75% { transform: scale(0.95) translate(-5px, -5px); }
    100% { transform: scale(1); filter: brightness(1); }
}
.floating-text.glitch { color: #d500f9; font-weight: bold;}

/* Der Schwarzmarkt-Button im 3D-Look */
.purple-btn {
    background: #7c4dff;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: bold;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow: 0 4px 0 #4a148c; /* Dunklerer lila Schatten für 3D-Effekt */
    transition: all 0.1s;
    width: 100%;
}

.purple-btn:hover:not(:disabled) {
    background: #9575cd;
    transform: translateY(-1px);
    box-shadow: 0 5px 0 #4a148c;
}

.purple-btn:active:not(:disabled) {
    transform: translateY(3px); /* Drückt den Button nach unten */
    box-shadow: 0 1px 0 #4a148c;
}

.purple-btn:disabled {
    background: #333;
    color: #777;
    box-shadow: none;
    cursor: not-allowed;
}

/* Der Kaufen/Ausrüsten-Button im Kleiderschrank */
.btn-buy-skin, .btn-equip-skin {
    background: #2c3e50; /* Edles Dunkelblau/Grau */
    color: #fff;
    border: none;
    padding: 8px 15px;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 0 #1a252f;
    transition: all 0.1s;
    width: 100%;
}

.btn-buy-skin:hover:not(:disabled), .btn-equip-skin:hover:not(:disabled) {
    background: #34495e;
    transform: translateY(-1px);
    box-shadow: 0 5px 0 #1a252f;
}

.btn-buy-skin:active:not(:disabled), .btn-equip-skin:active:not(:disabled) {
    transform: translateY(3px);
    box-shadow: 0 1px 0 #1a252f;
}

/* Spezial-Zustand für den aktuell aktiven Skin */
.skin-card.active-skin {
    border: 2px solid #009ffd !important;
    background: rgba(0, 159, 253, 0.15) !important;
    box-shadow: 0 0 15px rgba(0, 159, 253, 0.3);
}