@font-face {
    font-family: 'Star Jedi';
    src: url('fonts/Starjedi.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

/* ==================================================
   GLOBAL LAYOUT & TYPOGRAPHY
   ================================================== */
body {
    background-color: var(--bg-main, #0b0f13);
    color: var(--text-main, #ffffff);
    font-family: 'Segoe UI', Arial, sans-serif;
    background-image: url('background/background_stars-2.png');
    background-size: cover;
    background-repeat: repeat;
    background-attachment: fixed;
    margin: 0;
}

a { color: var(--accent-primary, #f39c12); }

.theme-font-title {
    font-family: 'Star Jedi', sans-serif !important;
    text-transform: lowercase !important; /* Zwingt Star Jedi immer in Kleinbuchstaben */
}

.module-header { 
    border-bottom: 2px solid var(--accent-primary, #f39c12); 
    padding-bottom: 10px; 
    margin-bottom: 25px; 
    font-size: 1.8em; 
    color: var(--accent-primary, #f39c12); 
    letter-spacing: normal; 
    font-family: 'Star Jedi', sans-serif;
    text-transform: lowercase;
}

/* ==================================================
   CUSTOM CURSORS (Theme-Driven)
   ================================================== */
html, body {
    /* Nutzt den im Theme definierten Default-Cursor. 
       Gibt es keinen (Fallback), nutzt der Browser den normalen Pfeil (auto). */
    cursor: var(--cursor-default, auto);
}

/* Alle klickbaren Elemente nutzen den Hover-Cursor */
a, 
button, 
input[type="button"], 
input[type="submit"], 
input[type="range"],
select,
option,
.btn,
.custom-file-btn,
.btn-step,
.loc-dropdown-selected,
.loc-dropdown-item,
.btn-action-small,
.floating-save-btn,
.modal-close,
[onclick] {
    cursor: var(--cursor-hover, pointer);
}

/* Elemente, die Erklärungen aufrufen, nutzen das Hilfe-Icon */
.res-tooltip-container,
.hover-underline,
.energy-underline,
.pop-underline,
.hover-underline-modal {
    cursor: var(--cursor-help, help);
}

/* ==================================================
   MODULAR ICON CLASSES (DRY)
   Aktuell leer. Nimmt keinen Platz weg, bis ein Theme
   hier z.B. background-image: url(...) definiert.
   ================================================== */
.icon-notification::before { }
.icon-location::before     { }
.icon-delete::before       { }
.icon-edit::before         { }
.icon-energy::before       { }
.icon-success::before      { }
.icon-warning::before      { }
.icon-lock::before         { }
.icon-hourglass::before    { }
.icon-score::before        { }
/* Ausnahme: Das Info-Icon als rein typografischer Text */
.icon-info::before         { content: "i"; font-family: Georgia, serif; font-style: italic; }

/* ==================================================
   DASHBOARDS & CARDS
   ================================================== */
.dashboard-grid, .settings-grid, .market-grid { display: grid; gap: 25px; }
.dashboard-grid { grid-template-columns: repeat(auto-fit, minmax(350px, 1fr)); }
.settings-grid { grid-template-columns: repeat(auto-fit, minmax(400px, 1fr)); }
.market-grid { grid-template-columns: repeat(auto-fill, minmax(600px, 1fr)); }
.buildings-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(480px, 1fr)); gap: 25px; }

.dash-card, .settings-card, .market-card, .bld-card, .ranking-container { 
    background: var(--panel-bg, linear-gradient(145deg, rgba(20, 30, 40, 0.95), rgba(10, 15, 20, 0.95))); 
    border: 1px solid var(--border-color, #34495e); 
    border-radius: 12px; 
    overflow: hidden; 
    box-shadow: 0 8px 20px rgba(0,0,0,0.6); 
}

.dash-header, .settings-header, .market-header, .bld-header, .ranking-header { 
    background: rgba(0, 0, 0, 0.5); 
    padding: 15px; 
    border-bottom: 1px solid rgba(255, 255, 255, 0.05); 
    font-size: 1.2em; 
    font-weight: bold; 
    color: var(--text-main, #ecf0f1); 
}

/* ==================================================
   MAIN DASHBOARD HEADERS (DRY & THEMED)
   ================================================== */
.dash-header-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 0, 0, 0.4);
    padding: 15px 20px;
    border-bottom: 1px solid var(--accent-primary, #f39c12);
    color: var(--accent-primary, #f39c12);
}
.dash-header-main .spacer { flex: 1; }
.dash-header-main .title { 
    flex: 2; 
    text-align: center; 
    font-size: 1.1em; 
    font-weight: bold; 
    text-transform: uppercase; 
    letter-spacing: 2px; 
    margin: 0; 
}
.dash-header-main .actions { 
    flex: 1; 
    display: flex; 
    justify-content: flex-end; 
}

.dash-body, .settings-body, .bld-body { padding: 20px; }

/* ==================================================
   PLANET HERO & COMMANDER PROFILE (Overview)
   ================================================== */
@keyframes holoPulse {
    0% { filter: drop-shadow(0 0 5px var(--accent-primary)); }
    50% { filter: drop-shadow(0 0 15px var(--accent-primary)); }
    100% { filter: drop-shadow(0 0 5px var(--accent-primary)); }
}
@keyframes scanline {
    0% { transform: translateY(-100%); opacity: 0; }
    10% { opacity: 0.4; }
    90% { opacity: 0.4; }
    100% { transform: translateY(150px); opacity: 0; }
}

.planet-hero-container {
    background: var(--panel-bg, linear-gradient(135deg, rgba(10, 20, 30, 0.95), rgba(0, 0, 0, 0.95)));
    border: 1px solid var(--accent-primary);
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.6);
}
.planet-hero-container::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    background: repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(255,255,255, 0.03) 2px, rgba(255,255,255, 0.03) 4px);
    pointer-events: none; z-index: 1;
}

/* Linke Seite: Planet Info gespiegelt zur Commander Info */
.planet-section {
    display: flex; align-items: center; gap: 30px; z-index: 2; flex: 1; min-width: 200px;
}
.planet-hero-img-wrapper {
    width: 140px; height: 140px; border-radius: 50%; border: 2px solid var(--accent-primary);
    animation: holoPulse 3s infinite ease-in-out; display: flex; justify-content: center; align-items: center;
    background: rgba(0,0,0,0.8); flex-shrink: 0; position: relative; overflow: hidden;
    box-shadow: inset 0 0 20px var(--accent-primary); z-index: 2;
}
.planet-hero-img-wrapper::after {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 15px;
    background: var(--accent-primary); filter: blur(8px); animation: scanline 4s infinite linear; z-index: 3;
}
.planet-hero-img-wrapper img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; opacity: 0.85; z-index: 2; }
.planet-info { display: flex; flex-direction: column; gap: 15px; text-align: left; align-items: flex-start; }
.planet-type-text { font-size: 1.1em; color: var(--accent-primary); margin: 0; text-transform: uppercase; letter-spacing: 1px; line-height: 1.1; font-weight: bold; }
.planet-coords-box { font-family: monospace; font-size: 1.1em; color: var(--text-main, white); line-height: 1.5; background: rgba(0,0,0,0.5); padding: 10px 20px; border-radius: 4px; border-left: 3px solid var(--accent-primary); display: inline-block; box-shadow: 0 4px 10px rgba(0,0,0,0.3); text-align: left; }

/* Zentriert den Namen zwingend und absolut in der Mitte des gesamten Containers */
.planet-hero-title { 
    position: absolute; 
    left: 50%; 
    top: 50%;
    transform: translate(-50%, -50%); 
    font-size: 2.5em; 
    font-weight: bold; 
    color: var(--text-main, white); 
    text-transform: uppercase; 
    letter-spacing: 2px; 
    text-shadow: 0 0 10px var(--accent-primary); 
    line-height: 1.1; 
    text-align: center;
    z-index: 2; 
    width: max-content;
    pointer-events: none; /* Klicks gehen durch, falls es überlappt */
}

/* Commander Box (Offen, gespiegelt) */
.commander-section {
    display: flex; align-items: center; gap: 30px; z-index: 2;
    margin-left: auto; min-width: 200px;
}

.commander-avatar { width: 140px; height: 140px; border-radius: 50%; background: #2c3e50; border: 2px solid var(--accent-primary); display: flex; align-items: center; justify-content: center; font-size: 3.5em; color: var(--accent-primary); overflow: hidden; flex-shrink: 0; box-shadow: inset 0 0 20px color-mix(in srgb, var(--accent-primary) 50%, transparent); }
.commander-avatar img { width: 100%; height: 100%; object-fit: cover; opacity: 0.85;}
.commander-details { display: flex; flex-direction: column; gap: 15px; text-align: right; align-items: flex-end; }
.commander-name { font-size: 1.1em; color: var(--accent-primary); margin: 0; text-transform: uppercase; letter-spacing: 1px; line-height: 1.1; font-weight: bold;}
.commander-stats { font-family: monospace; font-size: 1.1em; color: var(--text-main, white); line-height: 1.5; background: rgba(0,0,0,0.5); padding: 10px 20px; border-radius: 4px; border-right: 3px solid var(--accent-primary); display: inline-block; box-shadow: 0 4px 10px rgba(0,0,0,0.3); text-align: right;}
.commander-stat-highlight { color: var(--text-main); font-weight: bold; font-family: monospace; }

/* ==================================================
   OVERVIEW & ECONOMY SPECIFICS
   ================================================== */
.profile-info { display: flex; align-items: center; gap: 20px; }
.avatar-circle { width: 80px; height: 80px; border-radius: 50%; background: #2c3e50; border: 3px solid var(--accent-primary, #f39c12); display: flex; align-items: center; justify-content: center; font-size: 2.5em; color: var(--accent-primary, #f39c12); box-shadow: 0 0 15px rgba(243, 156, 18, 0.3); overflow: hidden; }
.profile-details h3 { margin: 0 0 5px 0; color: var(--text-main, white); font-size: 1.5em; }
.profile-details p { margin: 0; color: var(--accent-info, #3498db); font-weight: bold; }

.eco-item { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,0.05); }
.eco-item:last-child { border-bottom: none; }
.eco-name { color: var(--text-muted, #bdc3c7); }
.eco-val.positive { color: var(--accent-success, #2ecc71); font-family: monospace; font-size: 1.1em; font-weight: bold; }
.eco-val.negative { color: var(--accent-danger, #e74c3c); font-family: monospace; font-size: 1.1em; font-weight: bold; }
.eco-val.neutral { color: var(--text-muted, #95a5a6); font-family: monospace; font-size: 1.1em; font-weight: bold; }

.storage-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 15px; }
.storage-item { background: rgba(0,0,0,0.4); border: 1px solid rgba(255,255,255,0.1); padding: 12px; border-radius: 6px; }
.eco-section-title { color: var(--accent-primary, #f39c12); border-bottom: 1px solid rgba(255,255,255,0.1); padding-bottom: 5px; margin-bottom: 15px; text-transform: uppercase; font-size: 0.9em; letter-spacing: 1px; font-weight: bold; }
.live-preview-box { background: rgba(0,0,0,0.5); border-top: 1px solid rgba(255,255,255,0.1); padding: 12px; margin-top: 15px; border-radius: 0 0 6px 6px; }

/* ==================================================
   QUEUE ITEMS (DRY)
   ================================================== */
.queue-item { 
    padding: 12px; 
    margin-bottom: 10px; 
    border-radius: 4px; 
    display: flex;
    flex-direction: column;
    /* Dynamischer Hintergrund & Rand basierend auf der Modifikator-Variablen */
    background: color-mix(in srgb, var(--queue-color, var(--accent-success)) 10%, transparent); 
    border-left: 4px solid var(--queue-color, var(--accent-success)); 
}

.queue-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.queue-title { color: var(--accent-primary); font-weight: bold; }
.queue-title-muted { color: var(--text-muted); font-size: 0.85em; font-weight: normal; }
.queue-countdown { color: var(--queue-text, var(--accent-success)); font-family: monospace; font-weight: bold; }
.queue-subtitle { font-size: 0.8em; color: var(--text-muted); margin-bottom: 5px; text-transform: var(--queue-transform, uppercase); }

/* Progress-Bar Anpassungen speziell für Queues */
.queue-item .progress-container { margin-top: 0; }
.queue-item .progress-bar { background: var(--queue-bar-bg, var(--accent-success)); }
.queue-item .progress-text { 
    color: var(--queue-bar-text, var(--text-main)); 
    text-shadow: var(--queue-bar-shadow, 1px 1px 2px #000); 
}

/* Modifikatoren für verschiedene Warteschlangen-Typen */
.queue-construction {
    --queue-color: var(--accent-primary);
    --queue-text: var(--text-main);
    --queue-transform: none;
    --queue-bar-bg: var(--text-main);
    --queue-bar-text: var(--text-main);
    --queue-bar-shadow: 1px 1px 2px rgba(0,0,0,0.8);
}

.queue-education {
    --queue-color: var(--accent-primary);
    --queue-text: var(--text-main);
    --queue-transform: none;
    --queue-bar-bg: var(--text-main);
    --queue-bar-text: var(--text-main);
    --queue-bar-shadow: 1px 1px 2px rgba(0,0,0,0.8);
}

/* ==================================================
   PROGRESS BARS
   ================================================== */
.progress-container { 
    width: 100%; background: rgba(0,0,0,0.5); height: 24px !important; 
    border-radius: 4px; margin-top: 8px; overflow: hidden; 
    border: 1px solid rgba(255,255,255,0.1); position: relative;
}
.progress-bar { height: 100%; background: var(--accent-info, #3498db); width: 0%; transition: width 0.3s ease, background-color 0.3s ease; }
.progress-text { 
    position: absolute; top: 0; left: 0; width: 100%; height: 100%; 
    display: flex; align-items: center; justify-content: center;
    font-size: 0.85em; font-weight: bold; color: white; 
    text-shadow: 1px 1px 2px black; pointer-events: none; margin: 0;
}

/* ==================================================
   BUILDINGS SPECIFICS
   ================================================== */
.bld-card { display: flex; flex-direction: column; transition: transform 0.2s, border-color 0.2s; }
.bld-card:hover { border-color: var(--accent-primary, #f39c12); transform: translateY(-3px); }
.bld-card.locked { opacity: 0.7; filter: grayscale(40%); } 

.bld-header { display: flex; gap: 15px; align-items: center; }
.bld-image-placeholder { width: 70px; height: 70px; background: linear-gradient(135deg, #2c3e50, #1a252f); border: 2px solid var(--border-color); border-radius: 8px; display: flex; justify-content: center; align-items: center; font-size: 2em; color: rgba(255,255,255,0.2); flex-shrink: 0; box-shadow: inset 0 0 10px rgba(0,0,0,0.5); overflow: hidden; }
.bld-info { flex: 1; }
.bld-title { font-size: 1.3em; font-weight: bold; color: var(--accent-primary, #f39c12); margin-bottom: 4px; display: flex; justify-content: space-between; align-items: center; }
.bld-desc { font-size: 0.85em; color: var(--text-muted, #95a5a6); line-height: 1.4; }

.level-badge { 
    background: rgba(0, 0, 0, 0.6); 
    color: var(--text-main); 
    border: 1px solid var(--accent-primary); 
    padding: 0.25em 0.6em; 
    border-radius: 4px; 
    font-size: 0.75em; 
    font-weight: bold; 
    letter-spacing: 1px; 
    text-transform: uppercase; 
    display: inline-block; 
    vertical-align: middle; 
    line-height: 1.2; 
    box-sizing: border-box;
}

.bld-body { display: flex; gap: 15px; flex: 1; }
.info-box { flex: 1; background: rgba(0, 0, 0, 0.3); border: 1px solid rgba(255, 255, 255, 0.05); border-radius: 6px; padding: 12px; }
.info-box-title { font-size: 0.75em; color: var(--text-muted, #7f8c8d); text-transform: uppercase; border-bottom: 1px solid rgba(255, 255, 255, 0.1); padding-bottom: 5px; margin-bottom: 8px; font-weight: bold; }

.bld-footer { background: rgba(0, 0, 0, 0.6); padding: 15px; border-top: 1px solid rgba(255, 255, 255, 0.05); display: flex; justify-content: space-between; align-items: center; }
.build-time { color: var(--accent-info, #3498db); font-size: 0.9em; font-weight: bold; display: flex; align-items: center; gap: 5px; }

.prod-positive { color: var(--accent-success, #2ecc71); font-family: monospace; font-size: 0.95em; margin-bottom: 3px; }
.prod-negative { color: var(--accent-danger, #e74c3c); font-family: monospace; font-size: 0.95em; margin-bottom: 3px; }
.req-locked { color: var(--accent-danger, #e74c3c); font-size: 0.85em; margin-bottom: 3px; font-weight: bold; }
.req-ok { color: var(--accent-success, #2ecc71); font-size: 0.85em; margin-bottom: 3px; text-decoration: line-through; opacity: 0.5; }

/* ==================================================
FORMS & UNIFIED BUTTONS (DRY & THEMED GRADIENTS)
   ================================================== */
.form-group { margin-bottom: 20px; }
/* DRY: Ignoriert Labels, die als Button gestylt sind, damit deren eigene Schriftfarbe greift */
.form-group label:not(.btn) { display: block; color: var(--text-muted, #bdc3c7); font-size: 0.9em; margin-bottom: 8px; text-transform: uppercase; letter-spacing: 1px; }
.form-control, .trade-input { width: 100%; box-sizing: border-box; background: rgba(0,0,0,0.4); border: 1px solid var(--border-color, #34495e); color: white; padding: 12px 15px; border-radius: 6px; font-family: 'Segoe UI', sans-serif; font-size: 1em; outline: none; transition: 0.2s; }
.form-control:focus, .trade-input:focus { border-color: var(--accent-info, #3498db); box-shadow: 0 0 8px rgba(52, 152, 219, 0.3); }

/* --- BASE BUTTON STYLE (Glossy Top Edge, Unified Drop Shadow) --- */
.btn { 
    padding: 12px 20px; 
    font-size: 0.9em; 
    border-radius: 6px; 
    color: var(--text-main, white); 
    font-weight: bold; 
    text-transform: uppercase; 
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
    box-shadow: 0 4px 10px rgba(0,0,0,0.4), inset 0 1px 1px rgba(255,255,255,0.3); 
    transition: all 0.2s ease-in-out; 
    border: 1px solid rgba(0,0,0,0.6);
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: var(--cursor-hover, pointer);
    box-sizing: border-box;
}

/* --- HOVER & ACTIVE (Klick) STATES --- */
.btn:hover:not(:disabled) { 
    filter: brightness(1.2); 
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0,0,0,0.6), inset 0 1px 1px rgba(255,255,255,0.4);
}
.btn:active:not(:disabled) {
    transform: translateY(1px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.5), inset 0 2px 5px rgba(0,0,0,0.4);
    filter: brightness(0.9);
}

/* --- DISABLED STATE --- */
.btn:disabled, .btn.disabled { 
    filter: grayscale(100%); 
    opacity: 0.4; 
    cursor: not-allowed !important; 
    transform: none !important;
    box-shadow: none !important;
}

/* --- THEMED MODIFIERS (DRY) --- */
/* Setzt die Basisfarbe über eine lokale Variable */
.btn-primary { --btn-color: var(--accent-primary, #f39c12); color: var(--bg-main, black); text-shadow: none; }
.btn-info    { --btn-color: var(--accent-info, #3498db); }
.btn-success { --btn-color: var(--accent-success, #2ecc71); color: var(--bg-main, black); text-shadow: none; }
.btn-danger  { --btn-color: var(--accent-danger, #e74c3c); }

/* Wendet die dynamische Farbe auf Hintergrund und Kante an */
.btn-primary, .btn-info, .btn-success, .btn-danger {
    background: linear-gradient(to bottom, var(--btn-color), color-mix(in srgb, var(--btn-color) 30%, black));
    border-top-color: var(--btn-color);
}

/* --- LAYOUT UTILITIES --- */
.btn-block { display: flex; width: 100%; }
.btn-wide  { min-width: 150px; }
.btn-pill  { border-radius: 30px; }
.btn-small { padding: 8px 15px; font-size: 0.8em; }

/* --- ICON BUTTONS (Strukturell für alle kleinen Icon-Buttons) --- */
.btn-icon { 
    width: 28px; 
    height: 28px; 
    padding: 0 !important; 
    border-radius: var(--icon-radius); 
    display: inline-flex; 
    align-items: center; 
    justify-content: center; 
    /* Überschreibt die eckigen Schatten & Ränder vom Standard-Button */
    border: 2px solid var(--btn-color) !important;
    box-shadow: 0 2px 5px rgba(0,0,0,0.4) !important;
    /* Typografie-Reset für saubere Zentrierung */
    font-size: 1.1em;
    line-height: 1;
    text-shadow: none;
    /* Temporär für das "i", bis wir auf SVG/Font-Icons wechseln */
    font-family: Georgia, serif;  /* "Georgia," später löschen, wenn via Themes oder Grafiken geregelt!! */
    font-style: italic;
    font-weight: bold;
}

/* --- OUTLINE MODIFIER --- */
.btn-outline {
    background: transparent !important;
    border: 1px solid var(--btn-color);
    color: var(--btn-color);
    box-shadow: none;
    text-shadow: none;
}
.btn-outline:hover:not(:disabled) {
    background: var(--btn-color) !important;
    color: var(--bg-main);
    box-shadow: 0 0 10px var(--btn-color);
}

/* ==================================================
   CORE LAYOUT
   ================================================== */
.game-layout { display: flex; min-height: 100vh; }
.sidebar { width: 220px; background: var(--panel-bg, rgba(10, 15, 20, 0.95)); border-right: 2px solid var(--accent-primary, #f39c12); padding: 20px 10px; position: sticky; top: 70px; height: calc(100vh - 70px); overflow-y: auto; }
.main-content { flex: 1; padding: 20px; }
.nav-list { list-style: none; padding: 0; margin: 0; }
.nav-item { margin-bottom: 10px; }
.nav-link { display: block; padding: 12px 15px; color: var(--text-muted, #bdc3c7); text-decoration: none; border-radius: 5px; background: rgba(255,255,255,0.03); transition: 0.3s; font-weight: bold; text-transform: uppercase; font-size: 0.85em; box-sizing: border-box; }
.nav-link:hover { background: rgba(255,255,255,0.1); color: var(--accent-primary, #f39c12); }
.nav-link.active { background: var(--accent-primary, #f39c12); color: var(--bg-main, black); }

/* ==================================================
   ALERTS
   ================================================== */
#alert-container { 
    position: fixed !important; 
    top: 80px !important; 
    left: 50% !important; 
    transform: translateX(-50%) !important; 
    z-index: 10000 !important; 
    display: flex; 
    flex-direction: column; 
    gap: 15px; 
    align-items: center; 
    pointer-events: none; 
    width: 100%;
}

.alert { 
    padding: 15px 30px; 
    border-radius: 8px; 
    font-weight: bold; 
    text-align: center; 
    transition: opacity 0.5s ease-out, transform 0.5s ease-out; 
    box-shadow: 0 10px 30px rgba(0,0,0,0.5); 
    backdrop-filter: blur(8px); 
    -webkit-backdrop-filter: blur(8px); 
    min-width: 320px; 
    letter-spacing: 1px; 
    pointer-events: auto; 
    animation: alertSlideIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; 
    /* DRY: Farben werden dynamisch vom Modifikator geerbt */
    border: 1px solid var(--alert-color, var(--text-main));
    color: var(--alert-color, var(--text-main));
    background: color-mix(in srgb, var(--alert-color) 15%, transparent) !important;
}

@keyframes alertSlideIn { from { opacity: 0; transform: translateY(-20px) scale(0.9); } to { opacity: 1; transform: translateY(0) scale(1); } }

/* Modifikatoren definieren nur noch ihre Kernfarbe */
.alert-success { --alert-color: var(--accent-success, #2ecc71); }
.alert-error   { --alert-color: var(--accent-danger, #e74c3c); }
.alert-info    { --alert-color: var(--accent-info, #3498db); }
.alert-warning { --alert-color: var(--accent-warning, #f1c40f); }

/* Sonderfall: Das Theme-Alert (mit dickerem Rand und anderem Kontrast) */
.alert-theme { 
    --alert-color: var(--accent-primary); 
    background: color-mix(in srgb, var(--accent-primary) 15%, rgba(0,0,0,0.9)) !important; 
    border-left: 4px solid var(--accent-primary) !important; 
    color: var(--text-main, white) !important; 
    box-shadow: 0 10px 25px rgba(0,0,0,0.8); 
}
.alert-theme strong { color: var(--accent-primary); }

/* ==================================================
   LOGBOOK ENTRIES (DRY)
   ================================================== */
.log-item {
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-left-width: 4px;
    border-left-style: solid;
    padding: 15px;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    /* Default Fallbacks */
    border-left-color: var(--text-main);
    --log-title-color: var(--text-main);
}

.log-item-title {
    color: var(--log-title-color);
    font-size: 1.2em;
    font-weight: bold;
}

/* Modifikatoren für die verschiedenen Log-Typen */
.log-item-success { border-left-color: var(--accent-success); --log-title-color: var(--accent-success); }
.log-item-error   { border-left-color: var(--accent-danger);  --log-title-color: var(--accent-danger); }
.log-item-warning { border-left-color: var(--accent-warning); --log-title-color: var(--accent-warning); }
.log-item-info    { border-left-color: var(--accent-info);    --log-title-color: var(--accent-info); }

/* ==================================================
   RESOURCE BAR
   ================================================== */
.resource-bar { background: var(--panel-bg, rgba(0,0,0,0.9)); padding: 15px 12px; display: flex; justify-content: center; gap: 30px; border-bottom: 2px solid var(--accent-primary, #f39c12); position: sticky; top: 0; z-index: 100; box-shadow: 0 4px 10px rgba(0,0,0,0.5); flex-wrap: wrap; }
.resource-item { display: flex; flex-direction: column; align-items: center; min-width: 120px; }
.resource-top { color: var(--accent-primary, #f39c12); font-weight: bold; font-size: 1.1em; display: flex; align-items: center; }
.resource-val { margin-left: 8px; font-family: monospace; font-size: 1.3em; }

.resource-net { font-size: 0.9em; font-family: monospace; margin-top: 4px; font-weight: bold; }
.resource-net.net-positive { color: var(--accent-success, #2ecc71) !important; }
.resource-net.net-negative { color: var(--accent-danger, #e74c3c) !important; }
.resource-net.net-neutral { color: var(--text-muted, #95a5a6) !important; }

.resource-max { color: var(--text-muted, #7f8c8d); font-size: 0.85em; }
.is-capped { color: var(--accent-danger, #e74c3c) !important; }
.res-colon { color: var(--accent-primary, #f39c12); font-weight: bold; }
.energy-top { color: var(--accent-primary, #f39c12); }
.energy-underline { border-bottom-color: var(--accent-primary, #f39c12); }
.pop-top { color: var(--accent-primary, #f39c12); }
.pop-underline { border-bottom-color: var(--accent-primary, #f39c12); }

.val-danger { color: var(--accent-danger, #e74c3c) !important; }
.val-success { color: var(--accent-success, #2ecc71) !important; }
.val-white { color: var(--text-main, white) !important; }

/* ==================================================
   MODAL / POPUP
   ================================================== */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.8); z-index: 10000; display: none; justify-content: center; align-items: center; backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); }
.modal-content { background: var(--panel-bg); border: 1px solid var(--accent-primary); border-radius: 12px; width: 90%; max-width: 800px; padding: 30px; position: relative; box-shadow: 0 10px 40px rgba(0,0,0,0.8); max-height: 85vh; overflow-y: auto; }
.modal-close { position: absolute; top: 15px; right: 20px; font-size: 1.5em; color: var(--text-muted, #7f8c8d); transition: 0.2s; }
.modal-close:hover { color: var(--accent-danger, #e74c3c); }

/* ==================================================
   TOOLTIPS
   ================================================== */
.res-tooltip-container { position: relative; display: flex; flex-direction: column; align-items: center; }
.res-tooltip { visibility: hidden; opacity: 0; position: absolute; top: 100%; left: 50%; transform: translateX(-50%); background: var(--panel-bg, rgba(10, 15, 20, 0.98)); border: 1px solid var(--accent-primary, #f39c12); padding: 15px; border-radius: 8px; z-index: 1000; width: max-content; min-width: 250px; transition: 0.2s ease-in-out; box-shadow: 0 10px 25px rgba(0,0,0,0.8); font-size: 0.9em; pointer-events: none; text-transform: none; text-align: left; font-weight: normal; }
.res-tooltip-container:hover .res-tooltip { visibility: visible; opacity: 1; margin-top: 10px; }
.res-tooltip-container::after { content: ''; position: absolute; top: 100%; left: 0; width: 100%; height: 10px; }
.tt-section { background: rgba(0, 0, 0, 0.25); border: 1px solid rgba(255, 255, 255, 0.05); border-radius: 8px; padding: 12px; margin-bottom: 12px; }
.tt-section:last-child { margin-bottom: 0; }
.tt-section.income { border-left: 3px solid var(--accent-success, #2ecc71); }
.tt-section.expense { border-left: 3px solid var(--accent-danger, #e74c3c); }
.tt-section.neutral { border-left: 3px solid var(--accent-primary); }
.tt-title { font-weight: bold; font-size: 0.85em; margin-bottom: 8px; border-bottom: 1px solid rgba(255,255,255,0.1); padding-bottom: 5px; display: flex; justify-content: space-between; }
.tt-title.income { color: var(--accent-success, #2ecc71); }
.tt-title.expense { color: var(--accent-danger, #e74c3c); }
.tt-title.neutral { color: var(--accent-primary); }
.tt-uppercase { text-transform: uppercase; }
.tt-normal { text-transform: none; }
.tt-row { display: flex; justify-content: space-between; margin-bottom: 4px; color: var(--text-main, white); }
.tt-row-name { color: var(--text-muted, #bdc3c7); padding-left: 5px; }
.tt-row-val { font-family: monospace; font-weight: bold; padding-left: 15px; }
.hover-underline, .energy-underline, .pop-underline, .hover-underline-modal { border-bottom: 1px dotted var(--accent-primary, #f39c12); padding-bottom: 1px; }

/* =========================================
   CUSTOM NUMBER INPUTS (DRY)                
   ========================================= */
.no-spinners::-webkit-inner-spin-button, .no-spinners::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.no-spinners { -moz-appearance: textfield; }
.custom-number-wrapper { display: flex; align-items: stretch; gap: 4px; }
.custom-number-wrapper input { flex: 1; min-width: 40px; text-align: center; font-family: monospace; font-size: 1.1em; background: rgba(0,0,0,0.5); border: 1px solid var(--border-color, #34495e); color: white; border-radius: 4px; padding: 6px; margin: 0; }
.btn-step { flex-shrink: 0; width: 32px; background: rgba(0,0,0,0.5); border: 1px solid var(--border-color, #34495e); color: white; border-radius: 4px; transition: 0.2s; font-size: 1.2em; font-weight: bold; display: flex; justify-content: center; align-items: center; }
.btn-step:hover { background: rgba(255,255,255,0.1); border-color: var(--accent-primary, #f39c12); color: var(--accent-primary, #f39c12); }

/* ==================================================
   CUSTOM LOCATION DROPDOWN
   ================================================== */
.loc-dropdown { position: relative; width: 100%; user-select: none; z-index: 2000; font-family: sans-serif; }
.loc-dropdown-selected { background: rgba(0,0,0,0.6); border: 1px solid var(--accent-primary, #f39c12); padding: 8px 12px; border-radius: 4px; display: flex; align-items: center; gap: 10px; color: var(--accent-primary, #f39c12); font-weight: bold; transition: 0.2s; font-size: 1.0em; }
.loc-dropdown-selected:hover { background: rgba(255,255,255,0.05); }
.loc-dropdown-selected img { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; border: 1px solid var(--accent-primary, #f39c12); flex-shrink: 0; }
.loc-dropdown-selected::after { content: '▼'; margin-left: auto; font-size: 0.8em; transition: 0.2s; color: rgba(255,255,255,0.5); }
.loc-dropdown.open .loc-dropdown-selected::after { transform: rotate(180deg); color: var(--accent-primary, #f39c12); }
.loc-dropdown-list { position: absolute; top: calc(100% + 5px); left: 0; right: 0; background: var(--panel-bg, #1a252f); border: 1px solid var(--accent-primary, #f39c12); border-radius: 6px; box-shadow: 0 10px 25px rgba(0,0,0,0.8); max-height: 300px; overflow-y: auto; display: none; flex-direction: column; z-index: 2001; }
.loc-dropdown.open .loc-dropdown-list { display: flex; animation: fadeInDown 0.2s ease; }
.loc-dropdown-item { padding: 10px 12px; display: flex; align-items: center; gap: 10px; color: var(--text-main, white); transition: 0.2s; border-bottom: 1px solid rgba(255,255,255,0.05); font-size: 0.95em; }
.loc-dropdown-item:last-child { border-bottom: none; }
.loc-dropdown-item:hover { background: rgba(255,255,255,0.1); color: var(--accent-primary, #f39c12); }
.loc-dropdown-item img { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; border: 1px solid rgba(255,255,255,0.2); flex-shrink: 0; }

/* ==================================================
   CUSTOM FILE UPLOAD (Zwei Fenster nebeneinander)
   ================================================== */
.custom-file-upload { 
    display: flex; 
    flex-direction: row; 
    align-items: stretch; 
    gap: 15px; 
}
.custom-file-btn { 
    flex: 0 0 auto; 
    white-space: nowrap; 
    margin: 0;
}
.custom-file-text { 
    flex: 1; 
    background: rgba(0,0,0,0.3); 
    border: 1px dashed var(--border-color, #34495e); 
    border-radius: 6px; 
    color: var(--text-muted, #7f8c8d); 
    font-size: 0.85em; 
    white-space: nowrap; 
    overflow: hidden; 
    text-overflow: ellipsis; 
    margin: 0; 
    padding: 8px 15px; 
    display: flex;
    align-items: center;
    box-sizing: border-box;
}

/* ==================================================
   SCORE DISTRIBUTION CARDS (DRY)
   ================================================== */
.score-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.score-card { background: rgba(0,0,0,0.3); border: 1px solid rgba(255,255,255,0.05); border-radius: 8px; display: flex; flex-direction: column; }
.score-card-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid rgba(255,255,255,0.15); padding: 12px 15px; background: rgba(255,255,255,0.02); }
.score-category-title { color: var(--accent-primary); font-weight: bold; text-transform: uppercase; font-size: 1.2em; letter-spacing: 1px; }
.score-category-total { font-family: monospace; font-size: 1.5em; color: var(--text-main); font-weight: bold; }
.score-card-body { max-height: 250px; overflow-y: auto; padding: 5px 0; }
.score-empty { color: var(--text-muted); font-size: 1.0em; font-style: italic; text-align: center; padding: 20px; }
.score-type-header { display: flex; justify-content: space-between; padding: 8px 15px 4px 15px; margin-top: 5px; }
.score-type-title { color: var(--accent-primary); font-size: 1.0em; text-transform: uppercase; font-weight: bold; letter-spacing: 0.5px; }
.score-type-sum { color: var(--text-main); font-family: monospace; font-size: 1.2em; font-weight: bold; }
.score-items-wrapper { padding: 0 15px 10px 15px; }
.score-item-row { display: flex; justify-content: space-between; align-items: center; font-size: 0.95em; margin-bottom: 6px; border-bottom: 1px solid rgba(255,255,255,0.05); padding-bottom: 4px; padding-left: 5px; }
.score-item-name { color: color-mix(in srgb, var(--text-main) 85%, transparent); }
.score-item-points { font-family: monospace; color: var(--accent-primary); font-weight: bold; font-size: 1.05em; }

/* ==================================================
   HIGHSCORE TABELLE
   ================================================== */
.ranking-container { overflow: visible !important; }
.ranking-table { width: 100%; border-collapse: collapse; text-align: left; }
.ranking-table th { background: rgba(0, 0, 0, 0.3); padding: 15px 20px; color: var(--text-muted, #7f8c8d); text-transform: uppercase; font-size: 0.85em; letter-spacing: 1px; border-bottom: 1px solid rgba(243, 156, 18, 0.3); }
.ranking-table td { padding: 12px 20px; border-bottom: 1px solid rgba(255, 255, 255, 0.05); vertical-align: middle; }
.ranking-table tr:hover { background: rgba(243, 156, 18, 0.05); }
.ranking-table tr.is-me { background: rgba(46, 204, 113, 0.1); border-left: 4px solid var(--accent-success, #2ecc71); }
.ranking-table tr.is-me:hover { background: rgba(46, 204, 113, 0.15); }

.pagination-bar { display: flex; justify-content: space-between; align-items: center; padding: 10px 20px; background: rgba(0, 0, 0, 0.3); border-bottom: 1px solid rgba(255, 255, 255, 0.05); }
.limit-select { background: rgba(0,0,0,0.5); border: 1px solid var(--border-color, #34495e); color: white; padding: 5px; border-radius: 4px; outline: none; }

.col-rank { width: 80px; text-align: center; }
.col-score { text-align: right; }
.rank-number { font-family: monospace; font-size: 1.3em; color: var(--text-muted, #bdc3c7); font-weight: bold; width: 50px; }
.rank-1 .rank-number { color: #f1c40f; text-shadow: 0 0 10px rgba(241, 196, 15, 0.5); font-size: 1.6em; }
.rank-2 .rank-number { color: #e0e0e0; text-shadow: 0 0 10px rgba(224, 224, 224, 0.5); font-size: 1.4em; }
.rank-3 .rank-number { color: #cd7f32; text-shadow: 0 0 10px rgba(205, 127, 50, 0.5); font-size: 1.4em; }

.player-info { display: flex; align-items: center; gap: 15px; }
.mini-avatar { width: 40px; height: 40px; border-radius: 50%; background: #2c3e50; border: 2px solid #34495e; display: flex; align-items: center; justify-content: center; font-weight: bold; color: var(--accent-primary, #f39c12); overflow: hidden; flex-shrink: 0; }
.mini-avatar img { width: 100%; height: 100%; object-fit: cover; }
.player-name { font-size: 1.1em; color: var(--text-main, #ecf0f1); font-weight: bold; }
.rank-score { font-family: monospace; font-size: 1.2em; color: var(--accent-warning, #f1c40f); text-align: right; }

.tooltip-left { left: auto !important; right: 100%; top: -10px; transform: translateX(-15px); min-width: 200px; z-index: 1000; }

/* =========================
   SCROLLBAR FIX
   ========================= */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.2); border-radius: 4px; }
::-webkit-scrollbar-thumb { background: var(--accent-primary, #f39c12); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent-info, #3498db); }
html { scrollbar-width: thin; scrollbar-color: var(--accent-primary, #f39c12) rgba(0, 0, 0, 0.2); }

/* Schmale Scrollbars explizit NUR für innere Container */
.custom-scroll { scrollbar-width: thin; }
.custom-scroll::-webkit-scrollbar { width: 4px; height: 4px; }
.custom-scroll::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.1); border-radius: 3px; }
.custom-scroll::-webkit-scrollbar-thumb { background: var(--accent-primary, #f39c12); border-radius: 3px; }

/* ==================================================
   ECONOMY MODULE & SMART FLOATING BUTTON (DRY & THEMED)
   ================================================== */
.job-sliders-container { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 15px; padding: 15px 20px; background: rgba(0,0,0,0.15); border-top: 1px solid rgba(255,255,255,0.05); }
.job-sliders-container .form-group { margin-bottom: 0; width: 100%; box-sizing: border-box; }
.input-group { display: flex; align-items: center; gap: 8px; margin-top: 6px; flex-wrap: nowrap; width: 100%; }

/* PURE CSS THEMED SLIDER */
.job-slider { 
    -webkit-appearance: none !important; 
    appearance: none !important;
    width: 100%; 
    height: 6px; /* Zurück zu einer schlankeren Linie */
    background: rgba(255,255,255,0.1); 
    background-image: linear-gradient(to right, var(--slider-color, var(--accent-primary)) var(--slider-perc, 0%), transparent var(--slider-perc, 0%));
    outline: none; 
    border-radius: 3px; 
    margin: 0; 
}
.job-slider[data-type="energy"] {
    --slider-color: var(--accent-warning);
}

/* ==================================================
   GENERIC RANGE SLIDERS & INPUTS
   ================================================== */
.sliders-container { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 15px; padding: 15px 20px; background: rgba(0,0,0,0.15); border-top: 1px solid rgba(255,255,255,0.05); }
.sliders-container .form-group { margin-bottom: 0; width: 100%; box-sizing: border-box; }

/* CLEAN NATIVE SLIDER (Wie bei Education) */
.range-slider { 
    flex: 1 1 0%; 
    width: 100%; 
    min-width: 0; 
    accent-color: var(--slider-color, var(--accent-primary)); 
    margin: 0; 
}
.range-slider[data-type="energy"] {
    --slider-color: var(--accent-warning, #f1c40f);
}

.range-number { 
    width: 75px; 
    flex-shrink: 0; 
    text-align: center; 
    font-family: monospace; 
    font-size: 1.05em; 
    background: rgba(0,0,0,0.5); 
    border: 1px solid var(--border-color); 
    color: var(--text-main); 
    border-radius: 4px; 
    padding: 6px 4px; 
    box-sizing: border-box; 
}

.storage-item strong { font-size: 1.1em; }
.storage-item span { font-size: 1.05em; }
.bld-card { overflow: visible !important; }

/* SMART FLOATING SAVE BUTTON */
.floating-save-container {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translate(-50%, 150px);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 9000;
    pointer-events: none;
}
.floating-save-container.show {
    transform: translate(-50%, 0);
    opacity: 1;
    pointer-events: auto;
}
/* .floating-save-btn erbt visuell von .btn .btn-success .btn-pill */
.floating-save-btn {
    font-size: 1.1em; /* Überschreibt die Standard-Größe von .btn */
    padding: 12px 30px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.6), 0 0 15px color-mix(in srgb, var(--accent-success) 40%, transparent);
    display: flex;
    align-items: center;
    gap: 10px;
}
.floating-save-btn:hover {
    filter: brightness(1.2);
    transform: scale(1.05);
}

/* TYPOGRAPHY FIXES */
.job-indicator-text {
    font-size: 1.0em;
    color: var(--text-muted);
    font-family: monospace;
    text-transform: uppercase;
    display: block;
    text-align: left;
    padding-left: 5px;
}
.live-preview-header {
    margin-bottom: 8px;
    color: var(--text-muted);
    font-size: 0.95em;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.live-preview-row {
    font-family: monospace;
    font-size: 1.05em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

/* ==================================================
   OVERVIEW TASK CARDS (DRY)
   ================================================== */
.task-card { box-shadow: none; background: rgba(0,0,0,0.3); margin: 0; border-top: 4px solid transparent; }
.task-card .dash-header { text-align:center; font-size:0.95em; background:transparent; border-bottom:1px solid rgba(255,255,255,0.05); text-transform: uppercase; }

.task-card-success { border-top-color: var(--accent-success); }
.task-card-success .dash-header { color: var(--accent-success); }

.task-card-info { border-top-color: var(--accent-info); }
.task-card-info .dash-header { color: var(--accent-info); }

.task-card-primary { border-top-color: var(--accent-primary); opacity: 0.8; }
.task-card-primary .dash-header { color: var(--accent-primary); }

/* Erzwungene Linksbündigkeit für Modals */
.tt-section { text-align: left; }

/* ==================================================
   UTILITY CLASSES (DRY LAYOUT, SPACING & TYPOGRAPHY)
   ================================================== */

/* Display & Core Utilities */
.d-none { display: none !important; }
.d-block { display: block; }
.d-inline-block { display: inline-block; }
.flex-1 { flex: 1; }

/* Flexbox Layouts */
.d-flex { display: flex; }
.flex-column { display: flex; flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.flex-center { display: flex; justify-content: center; align-items: center; }
.align-center { align-items: center; }
.align-start { align-items: flex-start; }
.align-end { align-items: flex-end; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }

/* Layout Extras */
.d-grid { display: grid; }
.col-span-full { grid-column: 1 / -1; }
.overflow-y-auto { overflow-y: auto; }
.max-h-800 { max-height: 800px; }

/* Grids */
.grid-tasks { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid-large { grid-template-columns: repeat(auto-fit, minmax(450px, 1fr)); }

/* Gaps (Flex & Grid) */
.gap-5 { gap: 5px; }
.gap-10 { gap: 10px; }
.gap-15 { gap: 15px; }
.gap-20 { gap: 20px; }
.gap-30 { gap: 30px; }

/* Margins */
.m-0 { margin: 0 !important; }
.mt-5 { margin-top: 5px; }
.mt-10 { margin-top: 10px; }
.mt-15 { margin-top: 15px; }
.mt-20 { margin-top: 20px; }
.mt-30 { margin-top: 30px; }
.mb-5 { margin-bottom: 5px; }
.mb-10 { margin-bottom: 10px; }
.mb-15 { margin-bottom: 15px; }
.mb-20 { margin-bottom: 20px; }
.mb-30 { margin-bottom: 30px; }
.mb-40 { margin-bottom: 40px; }
.mx-10 { margin-left: 10px; margin-right: 10px; }
.ml-auto { margin-left: auto; }
.mr-auto { margin-right: auto; }

/* Paddings */
.p-0 { padding: 0 !important; }
.p-5 { padding: 5px; }
.p-10 { padding: 10px; }
.p-15 { padding: 15px; }
.p-20 { padding: 20px; }
.p-30 { padding: 30px; }
.p-40 { padding: 40px; }
.py-5 { padding-top: 5px; padding-bottom: 5px; }
.py-10 { padding-top: 10px; padding-bottom: 10px; }
.py-20 { padding-top: 20px; padding-bottom: 20px; }

/* Typography */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.font-bold { font-weight: bold; }
.font-italic { font-style: italic; }
.uppercase { text-transform: uppercase; }
.text-sm { font-size: 0.9em; }
.text-xs { font-size: 0.8em; }
.text-lg { font-size: 1.1em; }
.text-xl { font-size: 2.5em; }
.hero-char { font-size: 3.5em; font-weight: bold; color: rgba(255,255,255,0.2); }
.line-height-15 { line-height: 1.5; }
.tracking-wide { letter-spacing: 2px; }

/* Theme-Driven Typography & Effects */
.font-numeric { font-family: var(--font-numeric, monospace); }
.text-theme-caps { text-transform: var(--text-caps, uppercase); }
.shadow-primary { text-shadow: 0 0 15px color-mix(in srgb, var(--accent-primary) 50%, transparent); }

/* Themed Text Colors */
.text-primary { color: var(--accent-primary, #f39c12); }
.text-success { color: var(--accent-success, #2ecc71); }
.text-danger { color: var(--accent-danger, #e74c3c); }
.text-warning { color: var(--accent-warning, #f1c40f); }
.text-info { color: var(--accent-info, #3498db); }
.text-muted { color: var(--text-muted, #bdc3c7); }
.text-main { color: var(--text-main, #ffffff); }

/* Width & Height */
.w-100 { width: 100%; }
.h-100 { height: 100%; }

/* Backgrounds & Panels */
.bg-panel { background: var(--panel-bg, rgba(10, 15, 20, 0.95)); }
.bg-dark-overlay { background: rgba(0, 0, 0, 0.5); }
.bg-dark-dim { background: rgba(0,0,0,0.1); }
.border-radius-6 { border-radius: 6px; }
.border-radius-8 { border-radius: 8px; }
.border-radius-12 { border-radius: 12px; }
.shadow-lg { box-shadow: 0 0 20px rgba(0,0,0,0.4); }
.border-bottom-dim { border-bottom: 1px solid rgba(255,255,255,0.05); }

/* ==================================================
   GALACTIC MAP & CONTEXT MENUS
   ================================================== */

/* Zentrale Typografie für dynamische Map-Elemente (Star Jedi Fix) */
.map-jedi-title {
    font-family: 'Star Jedi', sans-serif;
    font-weight: normal !important; /* Verhindert das Faux-Bold bei Custom Fonts */
    text-transform: lowercase;
    color: white;
    margin: 0 0 5px 0;
}

.map-system-header {
    font-size: 1.6em;
    letter-spacing: 2px;
    text-shadow: 0 0 10px #000, 0 0 15px var(--accent-primary);
    margin-bottom: 2px;
}

.map-tooltip-title {
    font-size: 1.2em;
}

.map-ctx-title {
    font-size: 1.1em;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 8px;
    margin-bottom: 10px;
}

.map-tt-type {
    margin: 0 0 10px 0;
    font-size: 0.85em;
    color: var(--text-muted);
    text-transform: uppercase;
}

/* Map Context Menu Buttons */
.ctx-btn {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.2);
    color: #ccc;
    padding: 8px;
    cursor: pointer;
    transition: 0.2s;
    border-radius: 4px;
    text-transform: uppercase;
    font-size: 0.85em;
    font-weight: bold;
    width: 100%;
    margin-bottom: 8px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.ctx-btn:hover { background: rgba(255,255,255,0.15); color: white; border-color: white; }
.ctx-btn-primary { background: var(--accent-primary); border-color: var(--accent-primary); color: black; }
.ctx-btn-primary:hover { background: white; color: black; }
.ctx-btn-danger { background: var(--accent-danger); border-color: var(--accent-danger); color: white; }
.ctx-btn-danger:hover { background: #c0392b; color: white; }
.ctx-btn-cancel { margin-top: 5px; border-color: var(--text-muted); color: var(--text-muted); margin-bottom: 0; }

/* ==================================================
   ADMIN PANEL (INSPECTOR & MODULES)
   ================================================== */
.inspector-panel { 
    display: none; 
    margin-top: 20px; 
    background: rgba(0,0,0,0.4); 
    border: 1px solid var(--accent-info, #3498db); 
    border-radius: 8px; 
    padding: 15px; 
}

.inspector-tabs { 
    display: flex; 
    gap: 10px; 
    margin-bottom: 15px; 
    border-bottom: 2px solid var(--border-color, #34495e); 
    padding-bottom: 10px; 
    overflow-x: auto; 
}

.inspector-tab { 
    background: rgba(0,0,0,0.5); 
    border: 1px solid var(--border-color, #34495e); 
    color: var(--text-muted, #bdc3c7); 
    padding: 6px 12px; 
    border-radius: 4px; 
    cursor: var(--cursor-hover, pointer); 
    white-space: nowrap; 
    transition: 0.2s; 
    font-family: inherit; 
    font-size: 0.9em; 
}
.inspector-tab.active { 
    background: var(--accent-info, #3498db); 
    color: white; 
    border-color: var(--accent-info, #3498db); 
    font-weight: bold; 
}

.inspector-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); 
    gap: 10px; 
}

.inspector-card { 
    background: rgba(0,0,0,0.3); 
    padding: 10px; 
    border: 1px solid rgba(255,255,255,0.05); 
    border-radius: 6px; 
}
.inspector-card-title { 
    font-size: 0.85em; 
    color: var(--text-muted, #7f8c8d); 
    margin-bottom: 5px; 
    text-transform: uppercase; 
}
.inspector-card-val { 
    font-family: monospace; 
    font-size: 1.2em; 
    color: white; 
}

/* ==================================================
   UNIVERSAL BOARD MODULE
   ================================================== */
.board-wrapper { max-width: 1000px; margin: 0 auto; padding-bottom: 40px; }
details.b-group { margin-bottom: 15px; transition: all 0.3s ease; text-align: left; }
summary.b-header { display: flex; justify-content: space-between; align-items: center; cursor: var(--cursor-hover, pointer); user-select: none; list-style: none; }
summary.b-header::-webkit-details-marker { display: none; } 
.b-header-title { display: flex; align-items: center; gap: 10px; font-size: 1.1em; color: var(--accent-primary, #f39c12); font-weight: bold; }
.b-arrow { transition: transform 0.3s ease; color: var(--text-muted); font-size: 0.9em; }
details[open] .b-arrow { transform: rotate(90deg); color: var(--accent-primary, #f39c12); }
.b-body { padding: 15px 20px; text-align: left; word-break: break-word; }
.b-list { list-style: none; padding: 0; margin: 0; text-align: left; min-height: 20px; }
.b-item { display: flex; align-items: flex-start; gap: 10px; padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,0.05); color: var(--text-main, #ecf0f1); line-height: 1.5; text-align: left; background: transparent; }
.b-item:last-child { border-bottom: none; }
.b-bullet { color: var(--accent-info, #3498db); font-weight: bold; margin-top: -1px; font-size: 1.2em; }
.b-text { flex: 1; word-break: break-word; text-align: left; transition: color 0.3s; }
.b-checkbox { width: 18px; height: 18px; cursor: var(--cursor-hover, pointer); margin-top: 3px; accent-color: var(--accent-primary, #f39c12); flex-shrink: 0; }
.b-item.done .b-text { text-decoration: line-through; color: var(--text-muted, #7f8c8d); }
.b-item.done { opacity: 0.7; }

/* Forum Karten */
.f-card { margin-bottom: 20px; text-align: left; position: relative; display: flex; flex-direction: column; overflow: hidden; }
.f-content { padding: 15px; border-bottom: 1px solid rgba(255,255,255,0.02); }
.f-header { display: flex; justify-content: space-between; align-items: center; padding-bottom: 8px; margin-bottom: 10px; font-size: 0.9em; color: var(--text-muted); border-bottom: 1px dashed rgba(255,255,255,0.05); }
.f-author { color: var(--accent-primary, #f39c12); font-weight: bold; }
.f-text { font-size: 1.05em; line-height: 1.5; color: var(--text-main); white-space: pre-wrap; word-break: break-word; text-align: left; }

/* Avatare */
.f-avatar { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; display: inline-block; vertical-align: middle; margin-right: 8px; border: 1px solid rgba(255,255,255,0.1); background: rgba(0,0,0,0.5); text-align: center; line-height: 22px; font-size: 0.8em; font-weight: bold; color: var(--accent-primary); }
.f-toolbar { display: flex; justify-content: space-between; align-items: center; background: rgba(0,0,0,0.2); padding: 8px 15px; font-size: 0.9em; }

/* Kommentare */
.f-comments-section { background: rgba(0,0,0,0.6); padding: 15px; display: none; border-top: 1px solid var(--border-color); }
.f-comments-section.show { display: block; }
.c-item { margin-bottom: 10px; padding-bottom: 10px; border-bottom: 1px dotted rgba(255,255,255,0.05); font-size: 0.95em; position: relative; }
.c-item:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.c-author { font-weight: bold; color: var(--accent-info); font-size: 0.9em; margin-bottom: 5px; display: flex; align-items: center; }

/* CHAT STYLES */
.chat-container { display: flex; flex-direction: column; height: 60vh; max-height: 800px; min-height: 400px; overflow: hidden; }
.chat-messages { flex: 1; overflow-y: auto; padding: 10px 15px; display: flex; flex-direction: column; gap: 4px; }
.chat-msg { display: flex; align-items: flex-start; gap: 10px; padding: 6px 10px; border-radius: 4px; transition: 0.2s; position: relative; }
.chat-msg:hover { background: rgba(255,255,255,0.03); }
.chat-meta-time { color: var(--text-muted); font-size: 0.8em; font-family: monospace; white-space: nowrap; margin-right: 5px; cursor: var(--cursor-help, help); border-bottom: 1px dotted rgba(255,255,255,0.2); }
.chat-author { color: var(--accent-primary); font-weight: bold; }
.chat-text { color: var(--text-main); word-break: break-word; line-height: 1.4; text-align: left; white-space: pre-wrap; }
.chat-input-area { background: rgba(0,0,0,0.6); padding: 15px; border-top: 1px solid var(--border-color); display: flex; gap: 10px; }
.chat-input { flex: 1; background: rgba(0,0,0,0.5); border: 1px solid var(--accent-primary); border-radius: 20px; padding: 12px 20px; color: white; font-family: inherit; font-size: 1em; outline: none; }

.lbl-badge { padding: 3px 8px; border-radius: 4px; font-size: 0.85em; font-weight: bold; text-transform: uppercase; border: 1px solid; }
.lbl-info { background: rgba(52, 152, 219, 0.1); border-color: #3498db; color: #3498db; }
.lbl-warning { background: rgba(241, 196, 15, 0.1); border-color: #f1c40f; color: #f1c40f; }
.lbl-success { background: rgba(46, 204, 113, 0.1); border-color: #2ecc71; color: #2ecc71; }
.lbl-danger { background: rgba(231, 76, 60, 0.1); border-color: #e74c3c; color: #e74c3c; }

.admin-controls { display: flex; gap: 8px; opacity: 0.6; transition: 0.2s; }
.b-header:hover .admin-controls, .b-item:hover .admin-controls, .f-content:hover .admin-controls, .chat-msg:hover .admin-controls { opacity: 1; }
.drag-handle { color: #7f8c8d; font-size: 1.2em; cursor: var(--cursor-hover, pointer); user-select: none; margin-right: 5px; flex-shrink: 0; padding-top: 2px;}
.drag-handle:active { cursor: var(--cursor-hover, pointer); }
.dragging { opacity: 0.5; background: rgba(243, 156, 18, 0.1) !important; border: 2px dashed var(--accent-primary, #f39c12) !important; border-radius: 6px; }

.user-post-area { padding: 15px; margin-bottom: 25px; }
.textarea-input { width: 100%; background: rgba(0,0,0,0.5); border: 1px solid #34495e; color: white; padding: 10px; border-radius: 4px; font-family: inherit; font-size: 1em; resize: vertical; min-height: 80px; margin-bottom: 10px; box-sizing: border-box; }
.textarea-input:focus { border-color: var(--accent-primary, #f39c12); outline: none; }

.admin-input { flex: 1; background: rgba(0,0,0,0.5); border: 1px solid var(--accent-primary, #f39c12); color: white; padding: 12px 15px; border-radius: 5px; font-size: 1.05em; font-family: inherit; outline: none; }
.edit-input { width: 100%; background: #1a252f; color: #f39c12; border: 1px solid #f39c12; padding: 6px; font-family: inherit; font-size: 1em; border-radius: 3px; }