@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;800&display=swap');

:root {
    --bg-dark: #09090b; 
    --text: #ffffff; 
    --text-muted: #a1a1aa;
    --primary: #3b82f6; 
    --primary-glow: rgba(59, 130, 246, 0.5);
    --success: #22c55e; 
    --danger: #ef4444; 
    --chaos: #ef4444; 
    --glass-bg: rgba(20, 20, 25, 0.6); 
    --glass-border: rgba(255, 255, 255, 0.08); 
    --glass-blur: 16px;
}

* { 
    box-sizing: border-box; 
    margin: 0; 
    padding: 0; 
}

body { 
    font-family: 'Inter', sans-serif; 
    background-color: var(--bg-dark); 
    color: var(--text); 
    min-height: 100vh; 
    overflow-x: hidden; 
    position: relative; 
}

#bgCanvas { 
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    z-index: -1; 
    pointer-events: none; 
}

.glass { 
    background: var(--glass-bg); 
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3); 
    backdrop-filter: blur(var(--glass-blur)); 
    -webkit-backdrop-filter: blur(var(--glass-blur)); 
    border: 1px solid var(--glass-border); 
    border-radius: 20px; 
}

#initial-loader { 
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100vw; 
    height: 100vh; 
    background: var(--bg-dark); 
    z-index: 999999; 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    justify-content: center; 
    transition: opacity 0.5s ease, visibility 0.5s; 
}

.loader-spinner { 
    width: 50px; 
    height: 50px; 
    border: 4px solid var(--glass-border); 
    border-top-color: var(--primary); 
    border-radius: 50%; 
    animation: spin 1s linear infinite; 
    margin-bottom: 20px; 
}
@keyframes spin { 100% { transform: rotate(360deg); } }

.fade-transition { transition: opacity 0.4s ease, transform 0.4s ease; }
.screen-hidden { opacity: 0; transform: translateY(20px); pointer-events: none; position: absolute; width: 100%; visibility: hidden; }
.screen-active { opacity: 1; transform: translateY(0); position: relative; visibility: visible; }

#online-counter { 
    position: absolute; 
    top: 20px; 
    left: 20px; 
    padding: 8px 15px; 
    display: flex; 
    align-items: center; 
    gap: 10px; 
    font-weight: 600; 
    z-index: 100; 
    border-radius: 50px;
}

.online-dot {
    display: inline-block; 
    width: 10px; 
    height: 10px; 
    border-radius: 50%; 
    background: var(--success); 
    box-shadow: 0 0 8px var(--success);
    animation: pulse-green 2s infinite;
}

@keyframes pulse-green {
    0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4); }
    70% { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); }
    100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

#toast-container { position: fixed; bottom: 20px; right: 20px; z-index: 100000; display: flex; flex-direction: column; gap: 12px; pointer-events: none; }.toast { padding: 16px 20px; border-radius: 12px; color: white; display: flex; align-items: center; gap: 12px; animation: slideInRight 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; font-weight: 600; font-size: 0.95em; min-width: 250px; pointer-events: auto; background: rgba(20, 20, 25, 0.95); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); box-shadow: 0 8px 24px rgba(0,0,0,0.5); }
.toast.success { border-left: 4px solid var(--success); border-top: 1px solid rgba(34,197,94,0.3); border-right: 1px solid rgba(34,197,94,0.3); border-bottom: 1px solid rgba(34,197,94,0.3); }
.toast.info { border-left: 4px solid var(--primary); border-top: 1px solid rgba(59, 130, 246, 0.3); border-right: 1px solid rgba(59, 130, 246, 0.3); border-bottom: 1px solid rgba(59, 130, 246, 0.3); }
.toast.error { border-left: 4px solid var(--danger); border-top: 1px solid rgba(239,68,68,0.3); border-right: 1px solid rgba(239,68,68,0.3); border-bottom: 1px solid rgba(239,68,68,0.3); }
.toast svg { flex-shrink: 0; width: 22px; height: 22px; }
.toast.success svg { color: var(--success); }
.toast.info svg { color: var(--primary); }
.toast.error svg { color: var(--danger); }
.toast.fade-out { animation: fadeOutToast 0.4s ease forwards; }
@keyframes slideInRight { from { transform: translateX(120%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes fadeOutToast { to { transform: translateX(120%); opacity: 0; } }

.modal-overlay { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: rgba(0,0,0,0.6); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); z-index: 10000; display: flex; align-items: center; justify-content: center; opacity: 0; pointer-events: none; transition: opacity 0.3s ease; }
.modal-overlay.active { opacity: 1; pointer-events: auto; }
.modal-card { width: 90%; max-width: 550px; padding: 35px; text-align: center; transform: translateY(30px); transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); position: relative; overflow: hidden; }
.modal-overlay.active .modal-card { transform: translateY(0); }
.modal-close { position: absolute; top: 15px; right: 20px; background: none; border: none; color: var(--text-muted); font-size: 24px; cursor: pointer; padding: 0; transition: color 0.2s; width: auto; z-index: 10;}
.modal-close:hover { color: white; }

.success-layer { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: var(--glass-bg); display: flex; flex-direction: column; align-items: center; justify-content: center; opacity: 0; pointer-events: none; transition: opacity 0.4s ease; z-index: 20; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.success-layer.active { opacity: 1; pointer-events: auto; }
.success-circle { width: 80px; height: 80px; border-radius: 50%; background: rgba(34, 197, 94, 0.2); display: flex; align-items: center; justify-content: center; border: 2px solid var(--success); margin-bottom: 20px; transform: scale(0.5); transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
.success-layer.active .success-circle { transform: scale(1); }
.success-circle svg { width: 40px; height: 40px; color: var(--success); }

.header { display: flex; justify-content: center; align-items: center; padding: 1.5rem 2rem; margin-bottom: 5px; border-radius: 0 0 20px 20px; border-top: none; flex-direction: column; gap: 15px; }
.branding-container { display: flex; flex-direction: column; align-items: center; text-align: center; margin: 0 auto; }
.logo { height: 70px; filter: drop-shadow(0 0 10px rgba(0,0,0,0.6)); margin-bottom: 10px; animation: float 6s ease-in-out infinite; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.minecraft-title { font-family: 'Minecraft', sans-serif; font-size: 28px; color: var(--text); text-transform: uppercase; letter-spacing: 2px; text-shadow: 0 2px 5px rgba(0,0,0,0.5); }

#market-status-banner { 
    display: inline-flex; 
    align-items: center; 
    justify-content: center; 
    gap: 8px; 
    padding: 10px 20px; 
    font-weight: 600; 
    border-radius: 50px; 
    font-size: 0.95em; 
    transition: all 0.3s ease; 
    backdrop-filter: blur(10px);
    letter-spacing: 0.5px;
}
.banner-open { background: rgba(34, 197, 94, 0.1); border: 1px solid rgba(34, 197, 94, 0.3); color: var(--success); box-shadow: 0 0 15px rgba(34, 197, 94, 0.1); }
.banner-closed { background: rgba(239, 68, 68, 0.1); border: 1px solid rgba(239, 68, 68, 0.3); color: var(--danger); box-shadow: 0 0 15px rgba(239, 68, 68, 0.1); }
.status-icon { width: 18px; height: 18px; }

.navbar { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; padding: 10px; border-radius: 15px; margin-bottom: 30px; }
.nav-btn { background: transparent; color: var(--text-muted); border: none; padding: 12px 24px; font-size: 16px; font-weight: 600; border-radius: 10px; cursor: pointer; transition: 0.3s; }
.nav-btn:hover { color: white; background: rgba(255,255,255,0.05); }
.nav-btn.active { background: rgba(59, 130, 246, 0.2); color: var(--primary); box-shadow: 0 0 15px rgba(59, 130, 246, 0.3); }

#user-profile-container { position: absolute; right: 2rem; top: 40px; z-index: 50; }
#user-profile-container.pop-to-front { z-index: 10001; }

#user-profile { display: flex; align-items: center; gap: 15px; padding: 8px 15px; border-radius: 50px; cursor: pointer; transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); position: relative; border: 1px solid var(--glass-border); }
#user-profile:hover { background: rgba(255,255,255,0.1); }

#user-profile.highlight-pulse-success { box-shadow: 0 0 0 2px var(--success), 0 0 30px rgba(34, 197, 94, 0.4) !important; transform: scale(1.08); background: rgba(34, 197, 94, 0.15) !important; border-color: var(--success) !important; }
#user-profile.highlight-pulse-danger { box-shadow: 0 0 0 2px var(--danger), 0 0 30px rgba(239, 68, 68, 0.4) !important; transform: scale(1.08); background: rgba(239, 68, 68, 0.15) !important; border-color: var(--danger) !important; }

.user-info { display: flex; flex-direction: column; text-align: right; }
#username-display { font-weight: 600; letter-spacing: 0.5px; }

.balance-container { position: relative; display: flex; flex-direction: column; align-items: flex-end; }
#balance-display { color: var(--success); font-weight: 800; font-size: 1.1em; text-shadow: 0 0 10px rgba(34, 197, 94, 0.4); transition: text-shadow 0.3s; }
#balance-diff { position: absolute; top: 100%; right: 0; opacity: 0; font-weight: bold; font-size: 0.9em; pointer-events: none; z-index: 10; white-space: nowrap; }

#player-skin { width: 44px; height: 44px; border-radius: 10px; border: 2px solid var(--glass-border); box-shadow: 0 0 10px var(--primary-glow); }

#profile-dropdown { position: absolute; top: 70px; right: 0; width: 180px; padding: 10px; border-radius: 12px; opacity: 0; transform: translateY(-10px); pointer-events: none; transition: all 0.3s ease; display: flex; flex-direction: column; gap: 8px; }
#profile-dropdown.open { opacity: 1; transform: translateY(0); pointer-events: auto; }

.dropdown-btn { background: rgba(255,255,255,0.05); border: 1px solid var(--glass-border); color: white; width: 100%; padding: 12px; border-radius: 8px; cursor: pointer; font-weight: 600; transition: 0.2s; margin: 0; font-size: 14px; }
.dropdown-btn:hover { background: rgba(255,255,255,0.15); }
.logout-btn { background: rgba(239, 68, 68, 0.1); border: 1px solid var(--danger); color: var(--danger); width: 100%; padding: 12px; border-radius: 8px; cursor: pointer; font-weight: bold; transition: 0.3s; margin: 0; font-size: 14px;}
.logout-btn:hover { background: var(--danger); color: white; box-shadow: 0 0 15px rgba(239, 68, 68, 0.5); }

.container { max-width: 1400px; margin: 0 auto 40px; padding: 20px; }

/* Die Minecraft Schriftart wurde hier entfernt, sodass nun Inter verwendet wird! */
h2 { font-weight: 600; letter-spacing: 1px; margin-bottom: 1rem; color: var(--text); }

input, button { padding: 15px; border-radius: 12px; border: 1px solid var(--glass-border); font-size: 16px; margin: 10px 0; transition: all 0.3s ease; font-family: 'Inter', sans-serif; }
input { width: 100%; background: rgba(0, 0, 0, 0.4); color: white; text-align: center;}
input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 15px var(--primary-glow); }
input[type=number] { -moz-appearance: textfield; }
input[type=number]::-webkit-outer-spin-button, input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

button.action-btn { background: rgba(59, 130, 246, 0.2); color: var(--primary); font-weight: 600; width: 100%; border: 1px solid var(--primary); cursor: pointer; }
button.action-btn:hover { background: var(--primary); color: white; box-shadow: 0 0 20px var(--primary-glow); }
button.action-btn:disabled { opacity: 0.5; cursor: not-allowed; box-shadow: none; background: rgba(255,255,255,0.1); color: var(--text-muted); border-color: var(--glass-border); }

.pin-box { background: rgba(0,0,0,0.5); padding: 15px 25px; border-radius: 12px; color: var(--success); text-align: center; border: 1px solid var(--glass-border); letter-spacing: 1px; margin-top: 10px; display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.pin-code-highlight { color: var(--text); font-family: 'Minecraft', monospace; font-size: 1.4em;}

.icon-btn { background: rgba(255,255,255,0.05); border: 1px solid var(--glass-border); color: white; padding: 10px; border-radius: 8px; cursor: pointer; transition: all 0.2s; display: flex; align-items: center; justify-content: center; margin: 0; width: 44px; height: 44px; }
.icon-btn:hover { background: rgba(255,255,255,0.15); transform: scale(1.05); }
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn.success-copy { background: rgba(34, 197, 94, 0.2) !important; color: var(--success) !important; border-color: var(--success) !important; transform: scale(1.1); }

/* Kleinerer Info Button neben den Überschriften */
.info-btn { width: 32px; height: 32px; padding: 6px; border-radius: 50%; background: transparent; border-color: transparent; }
.info-btn:hover { background: rgba(255,255,255,0.1); border-color: var(--glass-border); }
.info-btn svg { width: 18px; height: 18px; color: var(--text-muted); }

.tab-content { display: none; animation: fadeInTab 0.4s ease forwards; }
.tab-content.active { display: block; }
@keyframes fadeInTab { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.market-layout { display: grid; grid-template-columns: 2.2fr 1fr; gap: 30px; }
@media (max-width: 1200px) { .market-layout { grid-template-columns: 1fr; } }

.market-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }
.stock-card { padding: 20px; text-align: center; transition: transform 0.3s; position: relative; overflow: hidden; cursor: pointer; }
.stock-card:hover { transform: translateY(-5px); border-color: rgba(255,255,255,0.3); background: rgba(255,255,255,0.05); box-shadow: 0 10px 30px rgba(0,0,0,0.5); }

.stock-header { display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 10px; }
.stock-img { width: 32px; height: 32px; image-rendering: pixelated; filter: drop-shadow(0 0 5px rgba(255,255,255,0.3)); }
.stock-price { font-size: 24px; font-weight: 800; margin: 10px 0; color: var(--text); transition: color 0.3s; }
.chart-container-mini { width: 100%; height: 80px; margin-top: 10px; pointer-events: none;}

.list-container { background: rgba(0,0,0,0.2); border-radius: 12px; padding: 15px; margin-bottom: 30px;}
.list-item { display: flex; justify-content: space-between; align-items: center; padding: 15px; margin-bottom: 10px; border-radius: 8px; background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.05); flex-wrap: wrap; gap: 15px; transition: 0.2s;}
.list-item.clickable { cursor: pointer; }
.list-item.clickable:hover { background: rgba(255,255,255,0.06); transform: scale(1.01); }
.empty-message { text-align: center; color: var(--text-muted); padding: 20px; font-style: italic; }

@keyframes slideInDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}
.animate-slide-in { animation: slideInDown 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; opacity: 0; }

@keyframes insertTrade {
    0% { opacity: 0; transform: translateY(-20px) scale(0.95); max-height: 0; padding-top: 0; padding-bottom: 0; margin-bottom: 0; border-width: 0; }
    100% { opacity: 1; transform: translateY(0) scale(1); max-height: 150px; padding-top: 15px; padding-bottom: 15px; margin-bottom: 10px; border-width: 1px; }
}
.animate-insert { animation: insertTrade 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; overflow: hidden; }

@keyframes removeTrade {
    0% { opacity: 1; transform: translateX(0); max-height: 150px; margin-bottom: 10px; padding-top: 15px; padding-bottom: 15px; }
    100% { opacity: 0; transform: translateX(50px); max-height: 0; margin-bottom: 0; padding-top: 0; padding-bottom: 0; border-width: 0; }
}
.animate-remove { animation: removeTrade 0.4s ease-in forwards; overflow: hidden; pointer-events: none; }

.trade-badge { padding: 6px 12px; border-radius: 8px; font-weight: bold; font-size: 0.9em; display: inline-flex; align-items: center; gap: 8px; }
.badge-buy { background: rgba(34, 197, 94, 0.15); color: var(--success); border: 1px solid rgba(34, 197, 94, 0.3); }
.badge-sell { background: rgba(239, 68, 68, 0.15); color: var(--danger); border: 1px solid rgba(239, 68, 68, 0.3); }

.chart-filters { display: flex; justify-content: center; gap: 10px; margin: 15px 0; }
.filter-btn { background: transparent; border: 1px solid var(--glass-border); color: var(--text-muted); padding: 6px 16px; border-radius: 50px; cursor: pointer; transition: 0.3s; font-size: 13px; font-weight: 600; margin: 0; }
.filter-btn:hover { background: rgba(255,255,255,0.05); color: white; }
.filter-btn.active { background: var(--primary); color: white; border-color: var(--primary); }

.amount-control { display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,0.4); border-radius: 12px; border: 1px solid var(--glass-border); overflow: hidden; margin: 0 auto; max-width: 300px; }
.control-btn { background: transparent; border: none; color: white; padding: 12px 18px; cursor: pointer; font-size: 18px; font-weight: bold; transition: background 0.2s; margin: 0; border-radius: 0; }
.control-btn:hover { background: rgba(255,255,255,0.1); }
.control-btn:disabled { color: var(--text-muted); cursor: not-allowed; }
.control-val { padding: 0 20px; font-weight: bold; min-width: 60px; text-align: center; font-size: 18px; }

.btn-sell { background: rgba(239, 68, 68, 0.1); color: var(--danger); border: 1px solid var(--danger); padding: 15px; font-size: 16px; cursor: pointer; border-radius: 12px; width: 100%; flex: 1;}
.btn-sell:hover { background: var(--danger); color: white; box-shadow: 0 0 15px rgba(239, 68, 68, 0.4); }

.btn-sell-all { background: transparent; color: var(--text-muted); border: 1px solid var(--text-muted); padding: 15px; font-size: 16px; cursor: pointer; border-radius: 12px; width: 100%; flex: 1;}
.btn-sell-all:hover { background: rgba(255,255,255,0.1); color: white; }

.profit-badge { padding: 4px 8px; border-radius: 6px; font-size: 0.85em; font-weight: bold; }
.profit-pos { background: rgba(34, 197, 94, 0.2); color: var(--success); }
.profit-neg { background: rgba(239, 68, 68, 0.2); color: var(--danger); }
.profit-neu { background: rgba(255, 255, 255, 0.1); color: var(--text-muted); }

.stats-list { display: flex; flex-direction: column; gap: 15px; max-width: 650px; margin: 0 auto; }
.stat-row { display: flex; justify-content: space-between; align-items: center; padding: 20px 30px; border-radius: 15px; background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.05); transition: transform 0.2s; }
.stat-row:hover { transform: scale(1.02); background: rgba(255,255,255,0.05); }

.stat-label { color: var(--text-muted); font-size: 1.05em; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; display: flex; align-items: center; gap: 12px; }
.stat-label svg { width: 20px; height: 20px; opacity: 0.9; }
.stat-value { font-size: 1.8em; font-weight: 800; }

.cost-preview { display: flex; justify-content: space-between; align-items: center; background: rgba(0,0,0,0.3); padding: 12px 20px; border-radius: 12px; margin-bottom: 20px; border: 1px solid rgba(255,255,255,0.05); }

.order-badge { font-size: 0.8em; padding: 4px 8px; border-radius: 6px; font-weight: bold; }
.order-buy { background: rgba(34, 197, 94, 0.2); color: var(--success); }
.order-sell { background: rgba(239, 68, 68, 0.2); color: var(--danger); }
.cancel-btn { background: transparent; border: 1px solid var(--danger); color: var(--danger); padding: 6px 12px; border-radius: 6px; cursor: pointer; transition: 0.2s; font-size: 0.9em; font-weight: bold; }
.cancel-btn:hover { background: var(--danger); color: white; }

.bot-offline-box { background: rgba(239, 68, 68, 0.1); border: 1px solid var(--danger); color: var(--danger); padding: 20px; border-radius: 12px; text-align: center; font-weight: bold; line-height: 1.5; margin-top: 15px;}

.mobile-only { display: none !important; }

@media (max-width: 768px) {
    .mobile-only { display: block !important; }
    .header { padding-top: 90px; padding-bottom: 20px; }
    #user-profile-container { top: 15px; left: 5%; width: 90%; position: fixed; right: auto; transform: none;}
    #user-profile { width: 100%; justify-content: center; }
    #profile-dropdown { top: 100%; left: 0; right: auto; width: 100%; transform: translateY(-10px); margin-top: 10px; }
    #profile-dropdown.open { transform: translateY(0); }
    .stat-row { flex-direction: column; gap: 10px; text-align: center; }
    .dropdown-btn, .logout-btn { text-align: center; }
    #online-counter { position: static; margin: 0 auto 15px auto; width: fit-content; }
}