/* --- Fonts Import --- */
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;700&family=Lato:wght@300;400;700&display=swap');

/* --- Variables & Reset --- */
:root {
    --bg-body: #010408;        
    --bg-sidebar: #0a0a0a;    
    --bg-card: #121212;        
    --bg-hover: #1f1f1f;       
    
    --primary: #d4af37;       
    --primary-dim: #8a701e;    
    
    --success: #10b981;        
    --danger: #f43f5e;         
    
    --text-main: #e5e5e5;     
    --text-muted: #737373;     
    
    --border: #262626;         
    --border-active: #404040;  
    
    --radius: 2px;             
    
    --font-heading: 'Cinzel', serif;
    --font-main: 'Lato', sans-serif;
    
    --shadow-panel: 0 4px 20px rgba(0, 0, 0, 0.8);
    --glow-primary: 0 0 10px rgba(212, 175, 55, 0.15);
}

* { box-sizing: border-box; }

body {
    margin: 0; 
    display: flex; 
    font-family: var(--font-main);
    background-color: var(--bg-body); 
    color: var(--text-main);
    height: 100vh; 
    overflow: hidden;
    
    background-image: 
        radial-gradient(circle at 70% 20%, rgba(255, 255, 255, 0.03) 1%, transparent 6%),
        radial-gradient(circle at 30% 80%, rgba(255, 255, 255, 0.04) 1%, transparent 8%),
        radial-gradient(circle at 10% 50%, rgba(255, 255, 255, 0.02) 1%, transparent 7%),
        radial-gradient(circle at 90% 60%, rgba(255, 255, 255, 0.03) 1%, transparent 9%),
        radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.01) 1%, transparent 10%),
        radial-gradient(circle at 50% 50%, rgba(10, 20, 40, 0.5) 0%, transparent 70%);

    background-size: 100% 100%, 150% 150%, 120% 120%, 140% 140%, 100% 100%, 100% 100%;
    background-position: 0 0, -20px -20px, 30px 30px, -40px 10px, 50px -50px, 0 0;
    background-attachment: fixed;
}

h1, h2, h3 { 
    margin: 0; 
    font-family: var(--font-heading); 
    color: #fff; 
    font-weight: 600; 
    letter-spacing: 0.5px;
}

h1 { color: var(--primary); text-transform: uppercase; font-size: 24px; }

button { font-family: var(--font-main); }

/* --- Custom Scrollbar --- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #333; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* --- Main Sidebar (Left) --- */
.sidebar {
    width: 260px; 
    background-color: rgba(10, 10, 10, 0.98); 
    border-right: 1px solid var(--border); 
    display: flex;
    flex-direction: column; 
    padding: 10px 10px; 
    flex-shrink: 0;
    position: relative;
    z-index: 500; 
    backdrop-filter: blur(10px); 
    height: 100vh; 
    overflow: hidden; 
}

.sidebar-header h3 {
    color: var(--primary); 
    margin-bottom: 10px;
    padding-left: 10px; 
    font-size: 16px; 
    letter-spacing: 2px;
    border-bottom: none; 
    padding-bottom: 10px; 
    text-transform: uppercase;
    text-shadow: var(--glow-primary);
}

.sidebar-section { 
    margin-bottom: 5px; 
    display: flex; 
    flex-direction: column; 
    gap: 2px;
    flex-shrink: 0; 
}

.sidebar-section:nth-of-type(2) {
    flex: 0 0 auto;
    margin-bottom: 10px;
}

.sidebar-section:has(.scrollable-skills),
.sidebar-section:nth-of-type(3) {
    flex: 1;
    min-height: 0;
    margin-bottom: 0;
}

.section-title {
    color: var(--text-muted);
    font-family: var(--font-main); 
    font-size: 10px;
    text-transform: uppercase; 
    font-weight: 700;
    margin-bottom: 4px; 
    padding-left: 12px;
    letter-spacing: 1.5px;
    opacity: 0.7;
    margin-top: 4px;
}

.scrollable-skills {
    flex: 1;           
    overflow-y: auto;  
    display: flex;
    flex-direction: column; 
    gap: 2px; 
    padding-right: 5px;
}

.sidebar-btn {
    background: transparent; 
    border: 1px solid transparent; 
    color: #a1a1aa; 
    padding: 8px 12px; 
    border-radius: var(--radius);
    text-align: left; 
    cursor: pointer; 
    transition: all 0.2s ease;
    font-size: 14px; 
    display: flex; 
    align-items: center; 
    gap: 12px;
    font-weight: 400;
}

.sidebar-btn i { width: 20px; text-align: center; color: #525252; transition: color 0.2s;}

.sidebar-btn:hover { 
    background-color: rgba(255, 255, 255, 0.03); 
    color: #fff; 
}

.sidebar-btn:hover i { color: var(--primary); }

.sidebar-btn.active { 
    background: linear-gradient(90deg, rgba(212, 175, 55, 0.1) 0%, transparent 100%);
    border-left: 2px solid var(--primary);
    color: #fff; 
    border-radius: 0 var(--radius) var(--radius) 0;
}
.sidebar-btn.active i { color: var(--primary); text-shadow: 0 0 8px rgba(212, 175, 55, 0.6); }

.sidebar-footer { 
    margin-top: 0; 
    padding-top: 15px; 
    border-top: 1px solid var(--border); 
    flex-shrink: 0; 
}

/* --- Main Layout --- */
.main-layout { 
    flex: 1; 
    display: flex; 
    flex-direction: column; 
    height: 100vh; 
    overflow: hidden; 
    margin-left: 0; 
    transition: margin-left 0.3s ease, width 0.3s ease;
}


.main-layout.shifted {
    margin-left: 220px; 
    width: calc(100% - 220px - 260px); 
}

/* --- Top Bar --- */
.top-bar {
    height: 64px; 
    border-bottom: 1px solid var(--border); 
    background-color: rgba(10, 10, 10, 0.8);
    backdrop-filter: blur(10px);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 25px;
    z-index: 50;
    position: relative; 
}

.account-controls { display: flex; align-items: center; gap: 20px; }

.coin-badge {
    color: #fbbf24; 
    font-size: 14px; 
    font-weight: 600;
    font-family: var(--font-main);
    display: flex; align-items: center; gap: 8px;
    text-shadow: 0 0 10px rgba(251, 191, 36, 0.3);
}

#accountDisplay { 
    font-size: 14px; 
    font-weight: 600; 
    display: flex; 
    align-items: center; 
    gap: 10px; 
    color: #fff;
}

#logoutBtn {
    background: transparent; 
    border: 1px solid var(--border);
    color: var(--text-muted); 
    padding: 6px 12px; 
    border-radius: var(--radius); 
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
}
#logoutBtn:hover { color: #fff; border-color: #fff; }

/* --- Global Progress --- */
#globalProgressWrapper {
    flex: 1; display: flex; justify-content: center; align-items: center; gap: 20px;
}
.progress-layout {
    display: flex; flex-direction: column; align-items: center; gap: 4px; width: 100%; max-width: 500px;
}
.progress-row {
    display: flex; align-items: center; gap: 12px; width: 100%;
}
#globalProgressContainer {
    flex: 1; height: 6px; 
    background: #1f1f1f;
    border-radius: 3px; 
    overflow: hidden;
    position: relative;
}

#globalProgressBar {
    height: 100%; width: 0%; 
    background: var(--primary);
    box-shadow: 0 0 10px var(--primary);
    border-radius: 3px; 
    transition: width 0.1s linear;
}

#globalTaskInfo {
    font-size: 12px; color: var(--text-main);
    font-family: var(--font-main);
    font-weight: 600;
    letter-spacing: 0.5px;
}
#stopTaskBtn {
    background: transparent; 
    border: 1px solid var(--border);
    color: var(--text-muted); 
    width: 24px; height: 24px;
    border-radius: 4px; 
    cursor: pointer; 
    display: flex;
    align-items: center; justify-content: center; 
    font-size: 10px;
    transition: all 0.2s;
}
#stopTaskBtn:hover { border-color: var(--danger); color: var(--danger); box-shadow: 0 0 8px rgba(244, 63, 94, 0.2); }
#globalQueueInfo { font-size: 11px; color: var(--text-muted); }

/* --- Content Area --- */
.content { 
    flex: 1; 
    padding: 40px; 
    overflow-y: auto; 
    position: relative;
}

.welcome-screen { text-align: center; margin-top: 150px; color: var(--text-muted); font-weight: 300; font-size: 18px; }

/* --- Cards & Grids --- */
.grid-container { 
    display: grid; 
    grid-template-columns: repeat(8, 1fr); 
    gap: 15px; 
}

.item-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 6px; 
    padding: 10px; 
    height: 90px; 
    display: flex; align-items: center; justify-content: center;
    position: relative; 
    cursor: pointer; 
    transition: all 0.2s ease;
}
.item-card:hover { 
    transform: translateY(-2px); 
    background: rgba(255, 255, 255, 0.07);
    border-color: var(--primary); 
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
}
.item-card img { 
    width: 45px; 
    height: 45px; 
    object-fit: contain; 
    filter: drop-shadow(0 5px 5px rgba(0,0,0,0.7)); 
}

.item-qty {
    position: absolute; bottom: 4px; right: 6px; font-size: 11px;
    font-weight: 700; color: rgba(255,255,255,0.8);
    background: rgba(0,0,0,0.6); padding: 1px 4px; border-radius: 3px;
    font-family: var(--font-main);
}

/* --- Profile --- */
.profile-layout { display: flex; gap: 30px; }
.profile-column { flex: 1; display: flex; flex-direction: column; gap: 15px; }

.skill-card {
    position: relative;
    overflow: visible !important; 
    z-index: 1;
    transition: transform 0.2s, z-index 0s; 
    padding-left: 15px;
}
.skill-card:hover {
    z-index: 100; 
    background: rgba(255, 255, 255, 0.08); 
}
.skill-card::before {
    content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--border-active);
}

.skill-header { display: flex; justify-content: space-between; margin-bottom: 10px; font-size: 14px; color: #fff; font-family: var(--font-main); }
.skill-header strong { font-weight: 600; letter-spacing: 0.5px; }

.skill-bar-bg {
    width: 100%;
    height: 8px; 
    background-color: #333;
    border-radius: 4px;
    margin-top: 5px;
    overflow: hidden !important; 
    position: relative;           
    z-index: 2;                  
}
.skill-bar-fill { 
    height: 100%; 
    background: var(--success);
    box-shadow: 0 0 5px rgba(16, 185, 129, 0.4);
}
.buff-text { color: var(--success); font-size: 11px; margin-left: 5px; font-weight: bold; }

/* --- Buttons --- */
.btn-primary { 
    background: var(--primary);
    color: #000; 
    border: none;
    padding: 10px 20px; 
    border-radius: 2px; 
    cursor: pointer; 
    font-weight: 700; 
    font-family: var(--font-main);
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 1px;
    transition: all 0.2s;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}
.btn-primary:hover { 
    background: #fcd34d;
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.4);
}

.btn-secondary { 
    background: rgba(255, 255, 255, 0.05); 
    color: #e5e5e5; 
    border: 1px solid var(--border);
    padding: 9px 18px; 
    border-radius: 2px; 
    cursor: pointer; 
    font-family: var(--font-main);
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 1px;
    transition: all 0.2s;
}
.btn-secondary:hover { background: rgba(255, 255, 255, 0.1); border-color: #666; color: #fff; }

.btn-cancel { 
    background: transparent; 
    border: 1px solid transparent; 
    color: var(--text-muted); 
    padding: 8px 16px; 
    border-radius: 4px; 
    cursor: pointer; 
    font-family: var(--font-main);
    font-size: 12px;
}
.btn-cancel:hover { color: #fff; }

/* --- Modals --- */
.modal-overlay {
    display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.7); backdrop-filter: blur(5px); z-index: 2000;
    justify-content: center; align-items: center;
}
.modal-card {
    background: #141414; 
    border: 1px solid var(--border);
    border-top: 2px solid var(--primary); 
    border-radius: 4px;
    padding: 30px; 
    width: 400px; max-width: 90%;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8); 
    color: var(--text-main);
    display: flex; flex-direction: column; gap: 20px; max-height: 85vh; overflow-y: auto;
    position: relative;
}
.modal-card::before { display: none; }

.market-modal-grid { display: flex; gap: 20px; align-items: center; }
.market-modal-grid img { 
    width: 80px; height: 80px; object-fit: contain; 
    filter: drop-shadow(0 0 15px rgba(212, 175, 55, 0.1));
}
.market-inputs { flex: 1; display: flex; flex-direction: column; gap: 10px; }
.input-with-btn { display: flex; gap: 5px; }
.input-with-btn input { flex: 1; }
.modal-actions { display: flex; gap: 10px; margin-top: 10px; }
.modal-actions button { flex: 1; }

input { 
    background: #0a0a0a; 
    border: 1px solid #333; 
    padding: 12px; 
    border-radius: 2px; 
    color: #fff; 
    width: 100%; 
    font-family: var(--font-main);
    transition: border 0.2s;
}
input:focus { outline: none; border-color: var(--primary); }

/* --- Login --- */
#loginBox { width: 600px; display: flex; flex-direction: column; align-items: center; }
.login-forms { display: flex; width: 100%; margin-top: 20px; gap: 40px; }
.form-group { flex: 1; display: flex; flex-direction: column; gap: 10px; }
.divider { width: 1px; background: #333; }

/* --- Market Table */
.market-table { width: 100%; border-collapse: separate; border-spacing: 0 4px; font-size: 13px; margin-top: 10px; }
.market-table th { 
    color: var(--text-muted); 
    font-family: var(--font-main);
    font-weight: 600; 
    text-transform: uppercase;
    font-size: 11px;
    text-align: left; 
    padding: 8px 12px; 
    border: none;
}
.market-table td { 
    padding: 10px 12px; 
    background: #1a1a1a; 
    color: #eee; 
}
.market-table td:first-child { border-top-left-radius: 4px; border-bottom-left-radius: 4px; }
.market-table td:last-child { border-top-right-radius: 4px; border-bottom-right-radius: 4px; }

.trade-action-btn { font-size: 10px; padding: 4px 10px; letter-spacing: 0.5px; }

.market-nav {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 10px;
    overflow-x: auto; 
}

.market-nav-btn {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-muted);
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-family: var(--font-main);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 12px;
    transition: all 0.2s;
    position: relative;
}

.market-nav-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

.market-nav-btn.has-notification::after {
    content: '!';
    position: absolute;
    top: -2px;
    right: -2px;
    width: 14px;
    height: 14px;
    background-color: var(--danger); 
    color: white;
    font-size: 9px;
    font-weight: bold;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #141414; 
    box-shadow: 0 0 5px var(--danger);
    animation: pulseDot 2s infinite;
}

.market-nav-btn.active {
    background: var(--bg-hover);
    color: var(--primary);
    border-color: var(--border-active);
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.my-orders-container {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 4px;
    overflow: hidden;
}

.my-orders-empty {
    padding: 30px;
    text-align: center;
    color: var(--text-muted);
    font-style: italic;
}

/* --- Task Grid & Items --- */
.task-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); 
    gap: 15px; 
}

.task-item {
    background: #141414; 
    border: 1px solid #262626;
    border-radius: 4px; 
    padding: 20px; 
    display: flex;
    flex-direction: column; align-items: center; 
    cursor: pointer; 
    transition: all 0.2s;
    position: relative; 
}

.task-item:hover { 
    transform: translateY(-3px); 
    border-color: var(--primary); 
    background: #1a1a1a;
    box-shadow: 0 10px 20px rgba(0,0,0,0.4);
}

.task-item img { width: 50px; height: 50px; object-fit: contain; margin-bottom: 15px; filter: drop-shadow(0 5px 5px rgba(0,0,0,0.5)); }
.task-item span { 
    font-size: 13px; 
    font-weight: 600; 
    text-align: center; 
    color: #eee;
    font-family: var(--font-main);
}

.task-item.locked {
    filter: grayscale(50%);
    opacity: 0.8;
    border-color: rgba(239, 68, 68, 0.3);
}

.task-item.locked:hover {
    border-color: var(--danger); 
    background: rgba(239, 68, 68, 0.05);
}

/* =========================================
   CHAT SYSTEM STYLES
   ========================================= */

#chatWrapper {
    position: fixed;
    bottom: 80px; 
    right: 20px;
    

    width: 350px;
    height: 400px;

    resize: none;      
   
    overflow: hidden;  
    
   
    min-width: 300px;
    min-height: 250px;
    max-width: 90vw;   /* Maximal 90% der Bildschirmbreite */
    max-height: 85vh;  /* Maximal 85% der Bildschirmhöhe */

    background: rgba(10, 10, 10, 0.95); 
    backdrop-filter: blur(10px);        
    border: 1px solid var(--border);
    border-radius: 4px;                 
    display: none;                      
    flex-direction: column;
    z-index: 100;
    box-shadow: 0 10px 40px rgba(0,0,0,0.8);
}

#chatTabs {
    cursor: move;
    user-select: none;

    display: flex;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid var(--border);
    padding-right: 40px; 
    position: relative;
   
    flex-shrink: 0; 
}

.chat-tab {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 12px 0;
    font-family: var(--font-main);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s;
    position: relative; 
}

.chat-tab:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

.chat-tab.active {
    color: var(--primary);
    background: rgba(212, 175, 55, 0.05);
    border-bottom: 2px solid var(--primary);
}

.chat-tab.has-notification::after {
    content: '';
    position: absolute;
    top: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
    background-color: var(--danger);
    border-radius: 50%;
    box-shadow: 0 0 5px var(--danger);
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.chat-content-container {
    flex: 1;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
   
    min-height: 0; 
}

.chat-tab-content {
    display: none; 
    flex: 1;
    flex-direction: column;
    height: 100%;
    min-height: 0; 
}

.chat-tab-content.active {
    display: flex; 
    flex-direction: column; 
}

.chat-window-controls {
    position: absolute;
    top: 0;
    right: 0;
    height: 40px; /* Gleiche Höhe wie die Tabs */
    display: flex;
    align-items: center;
    padding-right: 15px;
    z-index: 110; /* Über den Tabs */
}

/* Optional: Styling für den Button selbst */
.chat-control-btn {
    background: transparent;
    border: none;
    color: #888;
    cursor: pointer;
    font-size: 16px;
    padding: 5px;
    transition: color 0.2s;
}

.chat-control-btn:hover {
    color: #fff;
}

.messages {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
    color: #ddd;
    word-wrap: break-word;
    
    /* Scrollbar Design */
    scrollbar-width: thin;
    scrollbar-color: #333 transparent;
}
.messages::-webkit-scrollbar { width: 4px; }
.messages::-webkit-scrollbar-thumb { background: #333; }

.chat-input-wrapper {
    padding: 10px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 8px;
    background: rgba(0,0,0,0.3);
}

.chatInput {
    flex: 1;
    background: #050505;
    border: 1px solid #333;
    padding: 8px 12px;
    border-radius: 2px;
    color: #fff;
    font-family: var(--font-main);
    font-size: 12px;
}
.chatInput:focus {
    border-color: var(--primary);
    outline: none;
}

.chatSendBtn {
    background: var(--primary);
    color: #000;
    border: none;
    border-radius: 2px;
    width: 36px;
    cursor: pointer;
    transition: all 0.2s;
}
.chatSendBtn:hover { background: #fcd34d; }

#openChatBtnJS {
    position: fixed; 
    bottom: 20px; 
    right: 20px; 
    z-index: 90;
    width: 45px;          
    height: 45px; 
    border-radius: 6px;   
    background: #141414;  
    color: #888;          
    border: 1px solid #333;
    font-size: 18px; 
    cursor: pointer; 
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
    display: flex;        
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

#openChatBtnJS:hover {
    border-color: #555;   
    color: #fff;
    transform: translateY(-2px);
}

.chat-notification-dot {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 12px;
    height: 12px;
    background-color: var(--danger);
    border-radius: 50%;
    border: 2px solid #000; 
    box-shadow: 0 0 5px var(--danger);
    display: none; 
    pointer-events: none;
    animation: pulseDot 2s infinite;
}

/* --- RESIZER STYLES --- */
.resizer {
    position: absolute;
    z-index: 150; /* Über allem anderen */
}

/* Ecken (Größerer Klickbereich) */
.resizer.top-left { top: -5px; left: -5px; width: 15px; height: 15px; cursor: nwse-resize; }
.resizer.top-right { top: -5px; right: -5px; width: 15px; height: 15px; cursor: nesw-resize; }
.resizer.bottom-left { bottom: -5px; left: -5px; width: 15px; height: 15px; cursor: nesw-resize; }
.resizer.bottom-right { bottom: -5px; right: -5px; width: 15px; height: 15px; cursor: nwse-resize; }

/* Seiten (Länglich) */
.resizer.top { top: -5px; left: 0; right: 0; height: 10px; cursor: ns-resize; }
.resizer.bottom { bottom: -5px; left: 0; right: 0; height: 10px; cursor: ns-resize; }
.resizer.left { top: 0; bottom: 0; left: -5px; width: 10px; cursor: ew-resize; }
.resizer.right { top: 0; bottom: 0; right: -5px; width: 10px; cursor: ew-resize; }
@keyframes pulseDot {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.8; }
    100% { transform: scale(1); opacity: 1; }
}

.close-btn-js {
    position: absolute; 
    top: 5px;            
    right: 5px;          
    width: 30px;        
    height: 30px;       
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666; 
    cursor: pointer; 
    font-size: 14px; 
    border-radius: 4px;
    z-index: 101;
    transition: all 0.2s;
}

.close-btn-js:hover {
    color: #fff;
    background: rgba(255, 68, 68, 0.2); 
}

@keyframes popIn {
    from { transform: scale(0); }
    to { transform: scale(1); }
}

/* Buff Timer */
#buffContainer {
    font-size: 12px; 
    background: rgba(16, 185, 129, 0.1); 
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.2);
    padding: 5px 12px; 
    border-radius: 20px; 
    margin-right: 15px;
    font-family: var(--font-main);
    font-weight: 600;
    display: flex; align-items: center; gap: 6px;
}

/* --- Login Overlay Fix --- */
#loginOverlay {
    position: fixed;       
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85); 
    backdrop-filter: blur(8px);      
    z-index: 9999;         
    display: flex;         
    justify-content: center;
    align-items: center;
}

/* --- Quest Close Button --- */
.quest-close-btn {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 24px;
    height: 24px;
    background: #1f1f1f;
    border: 1px solid var(--border);
    border-radius: 50%;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s ease;
    z-index: 2;
    box-shadow: 0 2px 5px rgba(0,0,0,0.5);
}
.completeQuestBtn {
    padding-left: 5px !important;
    padding-right: 5px !important;
    white-space: nowrap;        
    overflow: hidden;            
    text-overflow: ellipsis;     
}

.quest-close-btn:hover {
    background: var(--danger);
    border-color: var(--danger);
    color: white;
    transform: scale(1.1);
}

/* =========================================
   SUB-SIDEBAR (LEADERBOARD)
   ========================================= */

.sub-sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    
    left: 260px; 
    width: 220px; 

    background: #080a10; 
    border-right: 1px solid #1a1a1a;
    z-index: 400; 
    padding: 20px 10px; 
    overflow-y: auto;
    
    font-size: 13px; 
    
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Wenn sie aktiv ist */
.sub-sidebar.active {
    display: block;
    opacity: 1;
    animation: fadeInSide 0.3s ease-out;
}

@keyframes fadeInSide {
    from { opacity: 0; transform: translateX(-10px); }
    to { opacity: 1; transform: translateX(0); }
}

.sub-sidebar h3 {
    color: var(--text-muted);
    font-size: 12px;
    text-transform: uppercase;
    margin-bottom: 10px;
    padding-left: 10px;
}
.leaderboard-grid {
    display: grid;
  
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr)); 
    gap: 20px; 
    margin-top: 20px;
    padding-bottom: 50px;
    width: 100%;
}

.lb-card {
 
    background: #1b1a1a;
    border: 1px solid #505050;
    border-radius: 4px;
    padding: 15px; 
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
    position: relative;
    overflow: hidden;
}

.lb-card-header {

    font-family: var(--font-heading);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    margin-bottom: 15px;
    border-bottom: 1px solid #1a1a1a; 
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 1.5px;
}

.lb-title-item {
    color: var(--primary);
    text-transform: uppercase;
}

.lb-title-val {
    color: var(--text-muted);
    font-size: 11px;
    font-family: var(--font-main);
}


.lb-columns-container {
    display: flex;
    gap: 30px;
}

.lb-column {
    flex: 1; 
    display: flex;
    flex-direction: column;
   
    position: relative; 
}
.lb-xp-col::after {
    content: '';
    position: absolute;
    right: -15px; 
    top: 0;
    bottom: 0;
    width: 1px;
    background: rgba(255, 255, 255, 0.05); 
}


.lb-column-title {

    font-family: var(--font-main);
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 5px;
    padding-left: 30px; 
}

/* --- EINTRAGS STYLING --- */
.lb-entry {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 3px 0; 
    font-size: 12px; 
    border-bottom: 1px dashed rgba(255,255,255,0.03); 
    gap: 10px;
}

.lb-rank {
    font-weight: 700;
    width: 20px; 
    text-align: center;
    color: var(--text-muted);
    font-family: var(--font-heading);
    flex-shrink: 0;
    font-size: 11px; 
}

.lb-user {
    flex: 1;
    color: #eee;
    font-family: var(--font-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;

}

.lb-val {
    color: var(--text-main);
    font-size: 10px;
    font-weight: 600;
    text-align: right;
    font-family: var(--font-main);
    flex-shrink: 0;
    opacity: 0.8; 
}


.rank-1 .lb-rank, 
.rank-2 .lb-rank, 
.rank-3 .lb-rank {
    font-size: 12px; 
}


.lb-me {
    margin-top: 6px;
    padding-top: 6px;

    border-top: 1px dashed #2a2a2a; 
    
    background: rgba(0, 0, 0, 0.2);
    
    margin-left: -15px; 
    margin-right: -15px; 
    padding-left: 15px; 
    padding-right: 15px;
    
    font-weight: 600;
    border-left: 2px solid var(--primary);
}
/* =========================================
   MOBILE RESPONSIVE DESIGN
   ========================================= */

/* --- GLOBAL FIXES GEGEN SCROLLING/ZOOM --- */
html, body {
    width: 100%;
    height: 100%;
    overflow: hidden; /* Verhindert das Scrollen des gesamten Fensters */
    position: fixed;  /* Fixiert den Body, hilft extrem gegen iOS "Bounce" */
}

/* Verhindert Auto-Zoom bei Inputs auf iPhones */
input, select, textarea {
    font-size: 16px !important; 
}

/* --- LAYOUT STRUKTUR --- */
.app-container {
    display: flex; /* Flexbox ist stabiler als Grid für Mobile Layouts */
    width: 100%;
    height: 100vh;
    overflow: hidden;
}




/* =========================================
   MOBILE ANPASSUNGEN (Kleiner als 768px)
   ========================================= */
@media (max-width: 768px) {

    /* --- SIDEBAR MOBILE (Icon Only) --- */
    .sidebar {
        width: 50px !important; /* Sehr schmal */
        transition: width 0.2s ease;
    }
    
  
    .sidebar.expanded { width: 220px !important; }

 
    .sidebar-header h3 { display: none; } /* Titel weg */
    .sidebar-header {
        height: 50px; 
        display: flex; justify-content: center; align-items: center;
        padding: 0 !important;
    }

 
    #sidebarToggle { display: block !important; }

  
    .sidebar-btn {
        padding: 0 !important;
        height: 40px !important;
        justify-content: center !important; 
    }
    
    .sidebar-btn i {
        margin: 0 !important;
        font-size: 1.1rem !important;
    }
    

    .sidebar-btn span { display: none; }

    .sidebar.expanded .sidebar-btn { justify-content: flex-start !important; padding-left: 15px !important; }
    .sidebar.expanded .sidebar-btn i { margin-right: 10px !important; }
    .sidebar.expanded .sidebar-btn span { display: inline !important; }


    .main-content {
        margin-left: 50px !important;
        width: calc(100% - 50px) !important;
        padding: 8px !important;
    }

 
    .dashboard-grid, .resources-grid, .actions-container {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr) !important; 
        gap: 6px !important;
    }

    /* Die Buttons/Karten selbst */
    .task-btn, .action-card, .resource-card {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        text-align: center !important;
        padding: 8px 4px !important;
        min-height: 70px !important;
        height: auto !important;
    }

    
    .task-btn img, .action-card img, .resource-card i {
        width: 28px !important;
        height: 28px !important;
        font-size: 1.2rem !important; 
        margin-bottom: 4px !important;
        margin-right: 0 !important;
    }

  
    .task-btn h3, .task-btn span, .action-card h4 {
        font-size: 0.7rem !important;
        line-height: 1.1 !important;
    }


    .progress-bar-container { height: 6px !important; margin-top: 4px !important; }
}
/* --- Equipment Grid Layout --- */
.equip-grid {
    display: grid;
    grid-template-columns: 80px 80px 80px;
    grid-template-rows: 80px 80px 80px 80px;
    gap: 15px;
    justify-content: center;
    margin-top: 20px;
}

.slot-head { grid-column: 2; grid-row: 1; }
.slot-body { grid-column: 2; grid-row: 2; }
.slot-legs { grid-column: 2; grid-row: 3; }
.slot-shoes { grid-column: 2; grid-row: 4; }

.slot-tool { grid-column: 1; grid-row: 2; } 
.slot-pet   { grid-column: 1; grid-row: 1; margin-top: auto;} 

.slot-necklace { grid-column: 3; grid-row: 2; } 
.slot-ring     { grid-column: 3; grid-row: 3; } 

.equip-slot {
    width: 80px; height: 80px;
    border-radius: 8px;
    background: #111;
    border: 1px solid #333;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    position: relative;
    transition: all 0.2s;
}

.equip-slot.filled {
    border-color: var(--primary);
    background: rgba(212, 175, 55, 0.05);
    cursor: pointer;
}

.equip-slot i { font-size: 24px; color: #333; }
.equip-slot img { width: 45px; height: 45px; object-fit: contain; filter: drop-shadow(0 0 5px rgba(0,0,0,0.5)); }

.equip-label {
    position: absolute; bottom: 2px;
    font-size: 9px; color: #666; text-transform: uppercase;
    width: 100%; text-align: center; pointer-events: none;
}

/* --- TOAST NOTIFICATION --- */
#toastNotification {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: #1f1f1f;
    color: #fff;
    padding: 12px 24px;
    border-radius: 4px;
    border-left: 4px solid var(--primary);
    box-shadow: 0 5px 20px rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 10000;
    font-size: 13px;
    font-family: var(--font-main);
    
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
    transform: translate(-50%, 20px); 
}

#toastNotification.toast-show {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, 0); 
}

#toastNotification.error {
    border-left-color: var(--danger);
}
#toastNotification.success {
    border-left-color: var(--success);
}

/* --- MARKT LAYOUT EXTRAS --- */
.market-header-controls {
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    margin-bottom: 15px;
    gap: 15px;
}

.market-search-wrapper {
    position: relative;
    width: 250px;
}

.market-search-input {
    width: 100%;
    padding: 8px 10px 8px 35px; 
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: #fff;
    font-size: 12px;
    font-family: var(--font-main);
}

.market-search-input:focus {
    border-color: var(--primary);
    outline: none;
    background: rgba(255,255,255,0.08);
}

.market-search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 12px;
    pointer-events: none;
}

/* --- Queue Button --- */
.icon-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    width: 24px; height: 24px;
    border-radius: 4px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 10px;
    transition: all 0.2s;
    position: relative;
}
.icon-btn:hover { border-color: var(--primary); color: var(--primary); }

.badge-count {
    position: absolute;
    top: -5px; right: -5px;
    background: var(--primary);
    color: #000;
    font-size: 9px; font-weight: bold;
    width: 14px; height: 14px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.5);
    pointer-events: none;
}

.queue-dropdown {
    display: none; 
    position: absolute;
    top: 30px; 
    right: 0;
    width: 220px;
    background: #141414;
    border: 1px solid #333;
    border-radius: 4px;
    padding: 10px;
    z-index: 1000;
    box-shadow: 0 5px 15px rgba(0,0,0,0.8);
}
.queue-dropdown.show { display: block !important; }

.queue-item-row {
    display: flex; align-items: center; gap: 8px;
    padding: 6px 0; border-bottom: 1px solid #222;
    font-size: 11px; color: #ccc;
}
.queue-item-row:last-child { border-bottom: none; }
.queue-item-row img { width: 16px; height: 16px; object-fit:contain; }

/* --- STAT TOOLTIPS --- */
.stat-tooltip-wrapper {
    position: relative;
    cursor: help;
}

.stat-tooltip-content {
    visibility: hidden;
    width: 180px; 
    background-color: #0f0f0f; 
    border: 1px solid #444;
    padding: 10px;
    border-radius: 4px;
    position: absolute;
    bottom: 25px; 
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
    box-shadow: 0 10px 25px rgba(0,0,0,0.9);
    font-size: 11px;
    line-height: 1.5;
    color: #ccc;
    text-align: left;
}

.stat-tooltip-content::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #444 transparent transparent transparent;
}

.stat-tooltip-wrapper:hover .stat-tooltip-content {
    visibility: visible;
    opacity: 1;
}

.tooltip-row {
    display: flex;
    justify-content: space-between;
    width: 100%;
}
.tooltip-row span:nth-child(2) {
    font-weight: bold;
    color: #fff;
}
.tooltip-header {
    margin-bottom: 5px; 
    border-bottom: 1px solid #333; 
    padding-bottom: 3px; 
    font-weight: bold; 
    color: #fff;
    text-align: center;
}
.tooltip-row.total {
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid #444;
    color: #FFD700; 
    font-weight: bold;
}

/* --- 2. DRAGGABLE RECIPE WINDOW --- */
#recipePinWindow {
    position: fixed;
    top: 100px;
    right: 20px;
    width: 220px;
    background: rgba(15, 15, 15, 0.95);
    border: 1px solid #444;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.8);
    z-index: 99999; 
    display: none; 
    backdrop-filter: blur(5px);
}

#recipeWindowHeader {
    padding: 8px 10px;
    background: rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid #333;
    border-radius: 8px 8px 0 0;
    cursor: move; 
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    font-weight: bold;
    color: #FFD700;
}

#recipeWindowContent {
    padding: 10px;
    font-size: 12px;
    color: #ccc;
}

.pin-recipe-btn {
    background: transparent;
    border: none;
    color: #666;
    cursor: pointer;
    font-size: 14px;
    transition: color 0.2s;
    padding: 0 5px;
}
.pin-recipe-btn:hover {
    color: #3b82f6;
}

.inventory-nav {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 1px solid #333;
    padding-bottom: 10px;
}

.inventory-nav-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid #444;
    color: #888; 
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    transition: all 0.2s;
}

.inventory-nav-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ccc;
}

.inventory-nav-btn.active {
    background: #3b82f6 !important; 
    color: white !important;
    border-color: #2563eb !important;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.3);
}

/* --- Shop Styles --- */
.shop-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.shop-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform 0.2s;
}
.shop-card:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
}

.shop-card-header {
    padding: 15px;
    background: rgba(255,255,255,0.05);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.shop-card-header h3 { margin: 0; font-size: 16px; color: var(--primary); }

.buff-badge {
    background: var(--primary-dim);
    color: #fff;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: bold;
}

.shop-card-body { padding: 15px; min-height: 100px; display: flex; flex-direction: column; justify-content: space-between; }
.shop-card-body p { font-size: 13px; color: var(--text-muted); margin-bottom: 15px; line-height: 1.4; }

.cost-display {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: bold;
    color: var(--text-main);
    margin-bottom: 15px;
}

/* --- World Buffs Bar --- */
.world-buffs-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    height: 40px; 
}

.active-buff-icon {
    width: 40px;
    height: 40px;
    background: var(--bg-card);
    border: 1px solid var(--primary);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    cursor: help;
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.2);
    animation: pulse-gold 2s infinite;
}

.active-buff-icon i { color: var(--primary); font-size: 18px; }

.active-buff-icon:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    top: 110%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.9);
    border: 1px solid var(--border);
    color: #fff;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 100;
    pointer-events: none;
}

@keyframes pulse-gold {
    0% { box-shadow: 0 0 0 0 rgba(212, 175, 55, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(212, 175, 55, 0); }
    100% { box-shadow: 0 0 0 0 rgba(212, 175, 55, 0); }
}

/* --- LOOT POPUP (KOMPAKT & CLEAN) --- */
#lootPopupContainer {
    position: fixed;
    top: 90px;
    left: 280px;
    display: flex;
    flex-direction: column;
    gap: 4px; 
    z-index: 2000;
    pointer-events: none;
}

.loot-toast {
    background: rgba(10, 10, 10, 0.9); 
    border: 1px solid #333;
    border-left: 2px solid #10b981; 
    border-radius: 2px;
    padding: 6px 10px; 
    min-width: auto; 
    
    display: inline-flex; 
    align-items: center;
    gap: 8px; 
    
    box-shadow: 0 2px 5px rgba(0,0,0,0.5);
    
    animation: slideInLeft 0.2s ease-out;
    opacity: 1;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.loot-toast-amount {
    color: #10b981;
    font-weight: 700;
    font-family: var(--font-main);
    font-size: 12px; 
}

.loot-toast-img {
    width: 18px; 
    height: 18px;
    object-fit: contain;
}

.loot-toast-name {
    color: #ccc;
    font-size: 12px; 
    font-weight: 500;
    font-family: var(--font-main);
}

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-10px); }
    to { opacity: 1; transform: translateX(0); }
}

.sub-sidebar-btn {
    background: transparent; 
    border: 1px solid transparent; 
    color: #a1a1aa; 
    padding: 8px 12px; 
    border-radius: var(--radius);
    text-align: left; 
    cursor: pointer; 
    transition: all 0.2s ease;
    font-size: 13px; 
    display: flex; 
    align-items: center; 
    gap: 12px;
    font-weight: 400;
    width: 100%;
    font-family: var(--font-main);
    margin-bottom: 2px;
}

.sub-sidebar-btn i { 
    width: 20px; 
    text-align: center; 
    color: #525252; 
    transition: color 0.2s;
    font-size: 14px;
}

.sub-sidebar-btn:hover { 
    background-color: rgba(255, 255, 255, 0.03); 
    color: #fff; 
}

.sub-sidebar-btn:hover i { 
    color: var(--primary); 
}

.sub-sidebar-btn.active { 
    background: linear-gradient(90deg, rgba(212, 175, 55, 0.1) 0%, transparent 100%);
    border-left: 2px solid var(--primary);
    color: #fff; 
    border-radius: 0 var(--radius) var(--radius) 0;
}

.sub-sidebar-btn.active i { 
    color: var(--primary); 
    text-shadow: 0 0 8px rgba(212, 175, 55, 0.6); 
}

/* --- HOUSING STYLES --- */
.housing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.house-card {
    background: #141414;
    border: 1px solid #333;
    border-radius: 4px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.house-header {
    background: rgba(255,255,255,0.05);
    padding: 10px 15px;
}

.house-body {
    padding: 15px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.house-level {
    font-size: 14px;
    color: #fff;
    font-weight: bold;
    margin-bottom: 5px;
}

.house-desc {
    font-size: 12px;
    color: #888;
    margin-bottom: 15px;
    font-style: italic;
    min-height: 30px;
}

.house-bonus {
    font-size: 11px;
    color: #ccc;
    background: rgba(255,255,255,0.03);
    padding: 4px 8px;
    border-radius: 2px;
    margin-bottom: 2px;
}

.house-bonus.global {
    color: var(--primary);
    border: 1px solid rgba(212, 175, 55, 0.2);
}

/* --- HOUSING COST UPDATE --- */

.house-cost-container {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid #333;
    border-radius: 4px;
    padding: 8px;
    margin-bottom: 10px;
}

.cost-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 12px;
}

.cost-row:last-child {
    border-bottom: none;
}

.cost-info {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #ddd;
}

.cost-info img {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

.cost-numbers {
    font-family: monospace;
    font-size: 13px;
    font-weight: bold;
}

.val-green {
    color: #2ecc71; 
}

.val-red {
    color: #ef4444; 
}

.val-sep {
    color: #666;
    margin: 0 2px;
}

.val-req {
    color: #aaa;
}

.max-level-badge {
    color: #FFD700;
    font-weight: bold;
    text-align: center;
    padding: 20px;
    background: rgba(212, 175, 55, 0.1);
    border: 1px dashed rgba(212, 175, 55, 0.3);
    border-radius: 4px;
    margin-top: auto;
    margin-bottom: 15px;
}


/* --- PETS PANEL --- */

.equipped-pet-display {
    background: rgba(212, 175, 55, 0.1);
    border: 1px solid var(--primary-dim);
    border-radius: var(--radius);
    padding: 10px 15px;
    margin-bottom: 20px;
    text-align: center;
    font-size: 14px;
    color: var(--text-main);
    font-weight: 600;
}

.equipped-pet-display .pet-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.equipped-pet-display .pet-info i {
    font-size: 20px;
    color: var(--primary);
}

.equipped-pet-display .pet-level {
    color: var(--primary);
}

.pets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 15px;
}

.pet-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: all 0.2s;
}

.pet-card.equipped {
    border-color: var(--primary);
    box-shadow: var(--glow-primary);
}

.pet-card.unlocked:hover {
    background: var(--bg-hover);
    cursor: pointer;
}

.pet-card.locked {
    opacity: 0.4;
    cursor: default;
}

.pet-icon-container {
    width: 60px;
    height: 60px;
    background: rgba(212, 175, 55, 0.05);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
    border: 1px solid rgba(212, 175, 55, 0.1);
}

.pet-card i {
    font-size: 28px;
    color: var(--primary);
}

.pet-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 5px;
}

.pet-level-info {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.pet-bonus {
    font-size: 12px;
    color: var(--success);
    margin-bottom: 15px;
    padding: 5px;
    background: rgba(16, 185, 129, 0.1);
    border-radius: 2px;
}

.pet-cost-info {
    font-size: 11px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 10px;
}

.pet-actions {
    display: flex;
    gap: 5px;
    width: 100%;
}

.pet-actions .btn-small {
    padding: 5px 10px;
    font-size: 12px;
    flex: 1;
}

/* --- CHEST MODAL --- */
.modal-overlay .offline-loot-list {
    max-height: 250px;
    overflow-y: auto;
    border: 1px solid var(--border);
    padding: 10px;
    border-radius: 4px;
}

.chest-result-row {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    font-size: 14px;
    color: var(--text-main);
}

.chest-result-row.pet-chest {
    color: var(--primary);
    font-weight: 600;
}

.pet-select-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    padding: 15px;
    border-radius: 6px;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.pet-select-card:hover {
    border-color: var(--text-muted);
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-2px);
}


.pet-select-card.selected {
    border-color: var(--primary);          
    background: rgba(212, 175, 55, 0.15);  
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.3);
}

.pets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
    margin-bottom: 20px;
    max-height: 400px;
    overflow-y: auto;
}


#lootModal {
    position: fixed; 
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8); 
    backdrop-filter: blur(4px); 
    display: none; 
    justify-content: center;
    align-items: center;
    z-index: 100000 !important; 
}

.loot-modal-content {
    width: 500px;
    max-width: 90%;
    background: #1a1a1a;
    border: 1px solid var(--primary);
    box-shadow: 0 0 50px rgba(212, 175, 55, 0.2);
    animation: popIn 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28);
    display: flex;
    flex-direction: column;
    padding: 0; 
}

.loot-header {
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    text-align: center;
}

.loot-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 15px;
    max-height: 400px;
    overflow-y: auto;
    padding: 20px;
}


.loot-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid #333;
    border-radius: 6px;
    padding: 15px 5px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    position: relative;
    color: #fff;
}

.loot-card img {

    width: 54px;  
    height: 54px;

    flex: 0 0 54px; 
    max-width: 100%; 

    object-fit: contain;

    margin-bottom: 8px; 

    background: rgba(255, 255, 255, 0.02);
    border-radius: 4px;
    padding: 2px;

    filter: drop-shadow(0 0 5px rgba(0,0,0,0.5));
}

/* --- FACTION DASHBOARD STYLES --- */
.faction-tabs-wrapper {
    display: flex;       
    width: 100%;       
    gap: 5px;           
    margin-bottom: 20px;
    background: rgba(255, 255, 255, 0.03);
    padding: 5px;
    border-radius: 4px;
    border: 1px solid #333;
}

.faction-tab-btn {
    flex: 1;             
    background: transparent;
    border: none;
    padding: 12px 5px;  
    color: #888;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
}

.faction-tab-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

.faction-tab-btn.active {
    color: #d4af37;     
    background: rgba(212, 175, 55, 0.1);
}

.faction-tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: #d4af37;
}

#member-list-content table {
    width: 100%;
    border-spacing: 0;
    border-collapse: collapse;
}

#member-list-content th, 
#member-list-content td {
    vertical-align: middle; 
}


.btn-claim-war {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: 1px solid #34d399;
    padding: 6px 12px;
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
    border-radius: 4px;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.3);
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 5px;
}

.btn-claim-war:hover {
    transform: translateY(-1px);
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.5);
    background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
}

.btn-claim-war:active {
    transform: translateY(1px);
}

.rank-badge {
    display: inline-block;
    padding: 2px 6px;
    background: #333;
    border-radius: 3px;
    font-size: 10px;
    color: #ffd700;
    margin-left: 5px;
    border: 1px solid #555;
}

/* --- Sort --- */
.game-dropdown {

    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;

 
    background-color: #242424;
    color: #e5e5e5;
    border: 1px solid #444;
    border-radius: 4px;
    
   
    padding: 6px 30px 6px 12px; 
    font-size: 13px;
    font-family: inherit; 
    cursor: pointer;
    outline: none;
    transition: all 0.2s ease;

 
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23d4af37' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 14px;
}


.game-dropdown:hover {
    background-color: #333;
    border-color: #666;
}


.game-dropdown:focus {
    border-color: #d4af37; 
    box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.1);
}


.game-dropdown option {
    background-color: #2a2a2a;
    color: #fff;
    padding: 10px;
}


.shop-grid {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    align-items: flex-start; 
    margin-top: 10px; 
}

/* Die Karte selbst */
.shop-card {
    background: linear-gradient(145deg, rgba(255,255,255,0.03) 0%, rgba(255,255,255,0.01) 100%);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 25px;
    width: 300px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    overflow: visible; 
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1); /* Weiche Animation */
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
}

/* Hover Effekt: Karte hebt sich und leuchtet */
.shop-card:hover {
    transform: translateY(-7px); /* Schwebt nach oben */
    background: linear-gradient(145deg, rgba(255,255,255,0.06) 0%, rgba(255,255,255,0.02) 100%);
    box-shadow: 0 15px 30px rgba(0,0,0,0.5); /* Tieferer Schatten */
 
}

/* Icon Styling */
.shop-card-icon {
    font-size: 48px;
    margin-bottom: 15px;
    filter: drop-shadow(0 0 10px rgba(0,0,0,0.5)); /* Kleiner Schein um das Icon */
    transition: transform 0.3s ease;
}

.shop-card:hover .shop-card-icon {
    transform: scale(1.1); /* Icon wächst leicht beim Hover */
}

/* Text Styling */
.shop-card h3 {
    color: var(--text-main);
    font-family: var(--font-heading);
    margin: 0 0 10px 0;
    font-size: 1.2rem;
}

.shop-card p {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.5;
    min-height: 45px; /* Feste Mindesthöhe verhindert Springen */
    margin-bottom: 15px;
}

/* Preis Anzeige */
.shop-cost {
    background: rgba(0,0,0,0.3);
    padding: 8px 15px;
    border-radius: 20px;
    border: 1px solid var(--border);
    margin: 15px 0 20px 0;
    font-weight: 600;
    font-size: 0.9rem;
    color: #eab308; 
    display: flex;
    align-items: center;
    gap: 10px;
}
#worldBuffsDisplay {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    left: 60px; /* Platz für Menü */
    display: flex;
    gap: 8px;
    z-index: 2000;
    pointer-events: none;
}

.active-buff-pill {
    pointer-events: auto;

    background: #0f0f0f; 
    border: 1px solid #333;

    border-radius: 50px; 
    padding: 3px 10px 3px 3px; 
    height: 32px; 
    
    display: flex;
    align-items: center;
    gap: 8px;
    
    font-size: 0.8rem;
    font-weight: 600;
    color: #eee;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
    position: relative;
    transition: transform 0.2s ease;
}

.active-buff-pill:hover {
    transform: translateY(-2px);
    border-color: #555;
}

/* Das runde Icon Design */
.buff-icon-circle {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 5px rgba(0,0,0,0.3);
}

.buff-tooltip-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 8px;
    font-size: 0.8rem;
}

.buff-tooltip-table th {
    text-align: left;
    border-bottom: 1px solid #444;
    padding-bottom: 4px;
    color: var(--text-muted);
    font-weight: normal;
    font-size: 0.75rem;
}

.buff-tooltip-table td {
    padding: 4px 0;
    color: var(--text-main);
}

.buff-tooltip-table td.amount {
    text-align: right;
    color: var(--primary);
    font-variant-numeric: tabular-nums; /* Zahlen untereinander */
}

.buff-header {
    font-family: var(--font-heading);
    color: var(--primary);
    margin-bottom: 4px;
    font-size: 0.95rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 5px;
}

.buff-desc {
    color: #aaa;
    font-size: 0.75rem;
    margin-bottom: 8px;
    font-style: italic;
}
/* Container für die Notes */
.patchnotes-container {
    padding: 20px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    min-height: 300px;
    font-family: 'Consolas', 'Monaco', monospace; /* Wirkt technischer */
    line-height: 1.6;
    color: var(--text-muted);
}


.patch-version {
    color: var(--primary);
    font-family: var(--font-heading);
    margin-top: 25px;
    margin-bottom: 10px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 5px;
    font-size: 1.2rem;
}

.patch-version:first-child {
    margin-top: 0;
}


.patch-item {
    color: var(--text-main);
    padding-left: 15px;
    position: relative;
}

.patch-item:hover {
    color: var(--primary-dim);
}


.notification-dot {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 10px;
    height: 10px;
    background-color: #ef4444; 
    border-radius: 50%;
    border: 1px solid #1f2937; 
    box-shadow: 0 0 5px rgba(239, 68, 68, 0.5);
    display: none; 
    z-index: 10;
    pointer-events: none; 
}


.sidebar-btn {
    position: relative;
}
/* --- PROFILE OVERVIEW LAYOUT --- */
.overview-container {
    display: grid;
    grid-template-columns: 1fr 1fr; 
    gap: 20px; 
    
    align-items: flex-start; 
}

/* Linke Spalte: Skills untereinander */
.overview-skills {
    display: flex;
    flex-direction: column; 
    gap: 10px;
}
/* Erzwingt, dass die Skill-Karten die volle Breite nehmen */
.overview-skills .skill-card { 
    width: 100% !important; 
    flex: none !important;
}

/* Rechte Spalte: Charakter & Stats */
.char-preview-panel {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
}


.char-doll-container {
    position: relative;
    width: 200px;  /* Anpassen je nach Bildgröße */
    height: 300px; /* Anpassen je nach Bildgröße */
    margin-bottom: 15px;
    background: radial-gradient(circle at center, rgba(255,255,255,0.05) 0%, transparent 70%);
}

/* Die einzelnen Bild-Ebenen */
.doll-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain; /* Verhindert Verzerrung */
    pointer-events: none; /* Klicks gehen durch */
}

/* Stats Box unter dem Char */
.char-stats-box {
    width: 100%;
    background: rgba(0,0,0,0.5);
    padding: 10px;
    border-radius: 4px;
    font-size: 0.9rem;
    border-top: 1px solid var(--border);
}

.stat-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
    color: var(--text-muted);
}
.stat-val {
    color: var(--primary);
    font-weight: bold;
}

/* Mobile Anpassung: Untereinander statt nebeneinander */
@media (max-width: 768px) {
    .overview-container {
        grid-template-columns: 1fr;
    }
    .char-preview-panel {
        order: -1; 
    }
}

/* --- PODIUM STYLES --- */
.podium-container {
    display: flex;
    justify-content: center;
    align-items: flex-end; /* Unten bündig */
    gap: 15px;
    margin-bottom: 30px;
    padding-top: 20px;
}

.podium-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    width: 100px;
    transition: transform 0.2s;
}

.podium-step:hover {
    transform: translateY(-5px);
}

/* Avatar Bild */
.podium-avatar {


    width: 80px; /* Standard Breite */
    height: 100px; /* Standard Höhe */
    
    /* border: 3px solid #444; <--- Ränder entfernen, um Charakter freizustellen */
    border: none;
    background-color: transparent; /* Hintergrund entfernen */
    
    object-fit: contain; /* Bildgröße beibehalten */
    margin-bottom: -10px; 
    z-index: 2;
    box-shadow: none; /* Schatten entfernen, falls der Charakter selbst einen hat */
}

/* Der Block unter dem Avatar */
.podium-base {
    width: 100%;
    border-radius: 8px 8px 0 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding-bottom: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
    color: #111; /* Dunkler Text auf Gold/Silber/Bronze */
    font-weight: bold;
}

.podium-rank {
    font-size: 24px;
    font-weight: 900;
    opacity: 0.7;
}

.podium-name {
    margin-top: 5px;
    font-size: 14px;
    color: #ddd; /* Name außerhalb des Blocks oder Farbe anpassen */
    font-weight: bold;
    text-shadow: 0 2px 2px rgba(0,0,0,0.8);
    cursor: pointer;
}

.podium-val {
    font-size: 12px;
    color: #aaa;
}

/* --- FARBEN & HÖHEN --- */

/* 1. Platz (Mitte) */
.rank-1 .podium-avatar {
    width: 120px; 
    height: 150px; 

    border: none;
    box-shadow: none;
}
.rank-1 .podium-base {
    height: 110px; /* Am höchsten */
    background: linear-gradient(to bottom, #FFD700, #B8860B);
}

/* 2. Platz (Links) */
.rank-2 .podium-avatar {
    width: 90px;
    height: 120px;
    border: none;
}
.rank-2 .podium-base {
    height: 80px;
    background: linear-gradient(to bottom, #C0C0C0, #7f8c8d);
}

/* 3. Platz (Rechts) */
.rank-3 .podium-avatar {
    border-color: #CD7F32;
}
.rank-3 .podium-avatar {
    width: 80px;
    height: 100px;
    border: none;
}
.rank-3 .podium-base {
    height: 60px; /* Die niedrigste Stufe */
    background: linear-gradient(to bottom, #CD7F32, #8B4513); /* Bronze Verlauf */
}

#mini-avatar-container {
    width: 60px;   
    height: 60px;  
    
    overflow: hidden;
    border-radius: 50%; /* Macht es kreisrund. Entferne dies, wenn es eckig sein soll */
    background-color: #00000000;
    border: 2px solid #303031;
    
    /* Falls das Bild im Header die Ausrichtung stört, hilft oft: */
    display: inline-block;
    vertical-align: middle;
}
