/* ===== RESET & BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    /* Dynamischer Gradient (wird von DynamicBackgroundRenderer gesetzt) */
    background: linear-gradient(
        to bottom,
        var(--sky-color-top, #1a1a1a) 0%,
        var(--sky-color-middle, #1a1a1a) 25vh,
        #0a0a0a 50vh,
        #000000 100%
    );
    background-attachment: fixed; /* Gradient bleibt beim Scrollen fixiert */
    transition: background 2s ease; /* Smooth Übergang zwischen Farben */
    color: #e0e0e0;
    line-height: 1.6;
}

#game-container {
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

/* ===== SKILL BUFF NOTIFICATIONS ===== */
.skill-buff-notifications-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 900;
    pointer-events: none;
}

.skill-buff-notification {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    margin-bottom: 10px;
    background: rgba(30, 30, 30, 0.95);
    border: 1px solid #7b68ee;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(123, 104, 238, 0.3);
    min-width: 280px;
    max-width: 350px;
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.3s ease;
    pointer-events: auto;
}

.skill-buff-notification.show {
    opacity: 1;
    transform: translateX(0);
}

.skill-buff-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.skill-buff-content {
    flex: 1;
}

.skill-buff-header {
    font-size: 14px;
    color: #7b68ee;
    margin-bottom: 4px;
}

.skill-buff-detail {
    font-size: 13px;
    color: #e0e0e0;
    margin-bottom: 3px;
}

.skill-buff-amount {
    color: #4ade80;
    font-weight: bold;
}

.skill-buff-reason {
    font-size: 11px;
    color: #a0a0a0;
    font-style: italic;
}

/* ===== STORY OVERLAY (Spielstart) ===== */
/* ===== STORY OVERLAY (Basis) ===== */
.story-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
}

/* ===== MAIN UI (Grid-basiert für direkte Höhen-Kontrolle) ===== */
#main-ui {
    width: 100%;
    height: 100vh;
    display: none; /* Hidden by default - set to 'grid' by TabManager */
    grid-template-rows: 42px 1fr; /* Tabs (42px) + Content (Rest) */
    grid-template-columns: 1fr 168px; /* Main-Content + Character-Panel (168px = 160px innen + 8px padding) */
    overflow: hidden;
}

/* ===== TABS (Grid Row 1, spans both columns) ===== */
.tabs-container {
    grid-row: 1;
    grid-column: 1 / 3; /* Spans Main-Content + Character-Panel */
    background: rgba(34, 34, 34, 0.85);
    backdrop-filter: blur(8px);
    border-bottom: 2px solid rgba(68, 68, 68, 0.6);
    display: flex;
    gap: 0.4rem;
    padding: 0.4rem 0.5rem;
    z-index: 85;
    align-items: center;
    justify-content: flex-start;
    height: 42px;
    overflow: hidden;
}

.tabs-container > * {
    pointer-events: auto;
}

.tab {
    padding: 0.5rem 1.2rem;
    background: #2a2a2a;
    border: 1px solid #444;
    color: #aaa;
    cursor: pointer;
    font-size: 1.05rem;
    line-height: 1.2;
    transition: all 0.3s;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.tab .tab-label {
    white-space: nowrap;
}

.tab.active {
    background: #3a3a3a;
    border-color: #666;
    color: #fff;
}

.tab:hover:not(.active) {
    background: #333;
}

/* Tab Progress Bar (for werkbank tab during research) */
.tab-progress-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: rgba(255, 255, 255, 0.1);
    overflow: hidden;
}

.tab-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #FFC107, #FFD54F);
    transition: width 0.3s ease-out;
}

.tab-progress-time {
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.7rem;
    color: #FFC107;
    white-space: nowrap;
    pointer-events: none;
}

/* ===== LOADING SCREEN (Initialization) ===== */
.loading-screen {
    position: fixed;
    inset: 0;
    z-index: 2000; /* Above story-overlay (1000) */
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: opacity 0.5s ease-out;
}

.loading-screen.hidden {
    opacity: 0;
    pointer-events: none;
}

.loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(123, 104, 238, 0.2);
    border-top-color: #7b68ee;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-text {
    font-size: 1.2rem;
    color: #e0e0e0;
    font-weight: 300;
    letter-spacing: 0.05em;
    transition: opacity 0.2s ease-out; /* Smooth fade for message changes */
}

/* Fade-out state during message change */
.loading-text-fade {
    opacity: 0;
}

/* Zahnrad in Tab-Leiste */
.options-button-tabs {
    background: #2a2a2a;
    border: 2px solid #444;
    color: #e0e0e0;
    font-size: 1rem;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
}

.options-button-tabs:hover {
    background: #3a3a3a;
    border-color: #666;
    transform: rotate(90deg);
}

/* ===== CONTENT CONTAINER (replaced by Grid, kept for compatibility) ===== */
.content-container {
    grid-row: 2;
    grid-column: 1 / 3;
    display: contents; /* Children become grid items of parent */
    overflow: hidden;
}

/* ===== TAB PANELS (Grid Row 2, Column 1) ===== */
.tab-panel {
    grid-row: 2;
    grid-column: 1;
    display: none; /* Hidden by default */
    overflow: auto;
    padding: 4px;
    gap: 1rem;
    min-height: 0;
}

.tab-panel.active {
    display: flex; /* Active tab visible */
    flex-direction: row;
}

/* ===== CHARACTER PANEL (Grid Row 2, Column 2) ===== */
.character-panel-container {
    grid-row: 2;
    grid-column: 2;
    display: flex;
    flex-direction: column;
    background: transparent;
    border: none;
    padding: 4px;
    margin: 0;
    overflow: hidden;
    min-height: 0;
}

.character-panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 0;
    display: flex;
    flex-direction: column;
}

/* Button-Wrapper: Zwei schmale Spalten links */
.buttons-wrapper {
    display: flex;
    gap: 1rem;
    flex: 0 0 auto;
}

/* ===== AKTIVITÄTEN-SPALTEN (Links und Rechts) ===== */
.activities-column {
    flex: 0 0 200px; /* Fixe Breite */
    overflow-y: auto;
    overflow-x: hidden;
    max-height: calc(100vh - 120px - 2rem); /* Story-Log + Padding */
}

.activities-column-left {
    padding-right: 0.5rem;
}

.activities-column-right {
    padding-left: 0.5rem;
}

.activities-column.with-tabs {
    max-height: calc(100vh - 162px - 2rem); /* Tabs + Story-Log + Padding */
}

.activities-section {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.activity-category {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Kategorie-Header entfernen (keine Titel) */
.activity-category h3 {
    display: none;
}

.activity-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.activity-button {
    padding: 1rem 2rem;
    background: #2a2a2a;
    border: 2px solid #444;
    color: #e0e0e0;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s;
    width: 100%; 
    min-width: unset; 
    position: relative;
    overflow: hidden;
}

.activity-button:hover:not(:disabled) {
    background: #3a3a3a;
    border-color: #666;
}

.activity-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.activity-button.insufficient {
    border-color: #ff6666;
    opacity: 0.7;
}

.activity-button.active {
    border-color: #666;
    cursor: default;
}

.activity-button.active:hover {
    transform: none;
}

.activity-name {
    display: block;
}

/* ===== MAP BUTTON (Karten-Ziel-Auswahl) ===== */
.map-button {
    background: #2a3a2a !important;
    border-color: #4a6741 !important;
    margin-bottom: 4px;
}

.map-button-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.map-button-icon {
    font-size: 1.1rem;
}

.map-button-target {
    font-size: 0.8rem;
    color: #8bc34a;
    white-space: nowrap;
}

.map-button:hover:not(:disabled) {
    background: #3a4a3a !important;
}

.activity-costs {
    display: block;
    font-size: 0.85rem;
    color: #999;
    margin-top: 0.35rem;
    display: flex;
    justify-content: center;
    gap: 0.5rem;
}

.cost-item {
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
}

.cost-sufficient {
    color: #6fbf73;
}

.cost-insufficient {
    color: #ff6666;
}

.activity-button.insufficient .activity-costs {
    /* Border/Highlight nur am Button, nicht an einzelnen Items */
}

/* Fortschrittsbalken im Hintergrund */
.activity-progress {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: rgba(106, 159, 181, 0.15);
    transition: width 0.1s linear;
    z-index: 0;
}

.activity-button > span {
    position: relative;
    z-index: 1;
}

/* ===== INVENTAR-SPALTE (Mitte, separates Div) ===== */
.inventory-column {
    flex: 0 0 250px; /* Fixe Breite */
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* ===== CHARAKTER-SPALTE (Rechts, separates Div) ===== */
.character-column {
    flex: 0 0 250px; /* Fixe Breite */
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* ===== LEGACY: info-column (falls noch verwendet) ===== */
.info-column {
    flex: 0 0 300px; /* Fixe Breite */
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    position: sticky;
    top: calc(120px + 1rem); /* Story-Log + Spacing */
    max-height: calc(100vh - 120px - 2rem);
    overflow-y: auto;
}

.info-column.with-tabs {
    top: calc(162px + 1rem); /* Tabs + Story-Log + Spacing */
    max-height: calc(100vh - 162px - 2rem);
}

.inventory-section {
    background: #2a2a2a;
    border: 2px solid #444;
    border-radius: 8px;
    padding: 0.75rem;
}

.inventory-label {
    color: #888;
    margin-bottom: 0.4rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.inventory-items {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.inventory-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: #333;
    border: 1px solid #444;
    border-radius: 4px;
}

.inventory-item-icon {
    font-size: 1.3rem;
    width: 1.5rem;
    text-align: center;
}

/* SVG-Icon für Inventar-Items */
.inventory-item-icon-img {
    width: 1.5rem;
    height: 1.5rem;
    object-fit: contain;
    display: inline-block;
    vertical-align: middle;
}

.inventory-item-name {
    color: #bbb;
    flex: 1;
    font-size: 0.85rem;
}

.inventory-item-amount {
    color: #6a9fb5;
    font-weight: bold;
}

.inventory-empty {
    color: #777;
    text-align: center;
    padding: 1rem;
    font-style: italic;
    font-size: 0.9rem;
}

/* ===== PEOPLE-SECTION (Legacy) ===== */
.people-section {
    background: #2a2a2a;
    border: 2px solid #444;
    border-radius: 8px;
    padding: 1rem;
}

/* ===== CHARACTERS-SECTION ===== */
.characters-section {
    background: #2a2a2a;
    border: 2px solid #444;
    border-radius: 8px;
    padding: 1rem;
}

.characters-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #444;
}

.characters-label {
    color: #888;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.characters-count {
    color: #6a9fb5;
    font-weight: bold;
    font-size: 1rem;
}

.characters-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.character-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: #333;
    border: 1px solid #444;
    border-radius: 4px;
    cursor: help;
}

.character-icon {
    font-size: 1.3rem;
    width: 1.5rem;
    text-align: center;
}

.character-info {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    flex: 1;
}

.character-name {
    color: #bbb;
    font-size: 0.85rem;
    font-weight: bold;
}

.character-title {
    color: #888;
    font-size: 0.7rem;
    font-style: italic;
}

.people-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #444;
}

.people-label {
    color: #888;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.people-capacity {
    color: #6a9fb5;
    font-weight: bold;
    font-size: 1rem; /* GEÄNDERT */
}

.people-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.person-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: #333;
    border: 1px solid #444;
    border-radius: 4px;
}

.person-icon {
    font-size: 1.3rem;
    width: 1.5rem;
    text-align: center;
}

.person-name {
    color: #bbb;
    font-size: 0.85rem;
    flex: 1;
}

.people-empty {
    color: #777;
    font-style: italic;
    padding: 1rem;
}

/* ===== UTILITY CLASSES ===== */
.hidden {
    display: none !important;
}

.fade-in {
    animation: fadeIn 0.5s forwards;
}

.fade-out {
    animation: fadeOut 0.5s forwards;
}

@keyframes fadeOut {
    to {
        opacity: 0;
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ===== HEADER (versteckt, wird nicht mehr benötigt) ===== */
.game-header {
    display: none !important;
}

/* ===== MODAL ===== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: fadeIn 0.3s;
}

.modal-content {
    background: #1a1a1a;
    border: 2px solid #444;
    border-radius: 8px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    animation: slideIn 0.3s;
}

.modal-small {
    max-width: 400px;
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #333;
}

.modal-header h2 {
    margin: 0;
    color: #e0e0e0;
    font-size: 1.5rem;
}

.close-button {
    background: none;
    border: none;
    color: #888;
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.3s;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-button:hover {
    color: #e0e0e0;
}

.modal-body {
    padding: 1.5rem;
}

.modal-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1.5rem;
}

/* ===== OPTION SECTIONS ===== */
.option-section {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid #333;
}

.option-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.option-section h3 {
    color: #ccc;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.option-item {
    margin-bottom: 1rem;
}

.option-item label {
    color: #aaa;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.option-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.option-item span {
    color: #6a9fb5;
    font-weight: bold;
}

.option-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.option-button {
    padding: 0.75rem 1.5rem;
    background: #2a2a2a;
    border: 2px solid #444;
    color: #e0e0e0;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 1rem;
}

.option-button:hover {
    background: #3a3a3a;
    border-color: #666;
}

.save-button {
    background: #2a4a2a;
    border-color: #4a7a4a;
}

.save-button:hover {
    background: #3a5a3a;
    border-color: #5a8a5a;
}

.debug-button {
    background: #4a4a2a;
    border-color: #7a7a4a;
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
}

.debug-button:hover {
    background: #5a5a3a;
    border-color: #8a8a5a;
}

/* ===== DANGER ZONE ===== */
.danger-zone {
    background: rgba(139, 0, 0, 0.1);
    padding: 1rem;
    border-radius: 4px;
    border: 1px solid #4a0000;
}

.danger-zone h3 {
    color: #ff6666;
}

.warning-text {
    color: #ff8888;
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.danger-button {
    background: #4a0000;
    border-color: #8a0000;
}

.danger-button:hover {
    background: #6a0000;
    border-color: #aa0000;
}

/* ===== MAIN UI ANPASSUNG (ohne Header, mit Tab-Leiste) ===== */
#main-ui {
    margin-top: 0;
}

/* Tabs-Kompensation: content-container startet unterhalb der absolute tabs */
.content-container {
    padding-top: 0; /* ⭐ padding statt margin → verhindert Margin-Collapsing */
}

.content-container.with-tabs {
    padding-top: 42px; /* ⭐ Padding collapsed nicht durch parent! */
}

/* ===== STORY OVERLAY (unified: fullscreen + lower-third) ===== */

/* Fullscreen-Modus (Intro, Story-Passagen) */
.story-overlay--fullscreen {
    position: fixed;
    inset: 0;
    background: #000;
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

.story-overlay--fullscreen .story-background {
    flex: 2;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transition: opacity 0.25s ease;
}

.story-overlay--fullscreen .story-content {
    flex: 1;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* Lower-Third-Modus (Notifications, Dialoge) */
.story-overlay--overlay {
    position: fixed;
    bottom: 50px;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    z-index: 1000;
    display: flex;
    justify-content: center;
    pointer-events: none;
    top: auto;
    right: auto;
    height: auto;
}

.story-overlay--overlay .story-content {
    background: rgba(35, 35, 35, 0.92);
    border: 1px solid #888;
    border-radius: 12px;
    padding: 1.2rem 1.5rem;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.5);
    pointer-events: auto;
    width: 100%;
    animation: storySlideUp 0.35s ease-out;
}

/* Click-Blocker für story-Typ mit pauseGame */
.story-overlay--fullscreen.pause-game::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
}

/* ===== STORY CONTENT ===== */
.story-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 700px;
    gap: 0.8rem;
}

/* ===== SPEAKER PORTRAIT ===== */
.story-speaker {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    align-self: flex-start;
    margin-bottom: 0.2rem;
}

.story-speaker-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.story-speaker-initial {
    font-size: 1.1rem;
    font-weight: bold;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.story-speaker-info {
    display: flex;
    flex-direction: column;
}

.story-speaker-name {
    font-size: 1rem;
    font-weight: 600;
    color: #e0e0e0;
}

.story-speaker-title {
    font-size: 0.75rem;
    color: #999;
}

/* ===== STORY TEXT ===== */
.story-text-container {
    width: 100%;
}

.story-text {
    font-size: 1.15rem;
    line-height: 1.6;
    color: #f0f0f0;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
    min-height: 1.6em;
}

/* ===== CHARACTER DIALOG (mit Bild) ===== */
.story-content--character-dialog {
    align-items: flex-start;
    gap: 0;
}

.story-character-dialog {
    display: flex;
    gap: 1rem;
    width: 100%;
    align-items: flex-start;
}

.story-character-portrait {
    width: 100px;
    height: 100px;
    flex-shrink: 0;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    background: #333;
}

.story-character-portrait-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.story-character-portrait-fallback {
    font-size: 2.5rem;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.story-character-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.story-character-header {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.story-character-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: #e0e0e0;
}

.story-character-title {
    font-size: 0.8rem;
    color: #999;
    font-style: italic;
}

.story-character-text-container {
    flex: 1;
}

.story-character-text {
    font-size: 1rem;
    line-height: 1.5;
    color: #e0e0e0;
    min-height: 1.5em;
}

.story-character-ok-container {
    display: flex;
    justify-content: flex-end;
    margin-top: 0.4rem;
}

.story-character-ok-btn {
    padding: 0.5rem 1.5rem;
    background: rgba(106, 159, 181, 0.2);
    border: 1px solid rgba(106, 159, 181, 0.4);
    border-radius: 6px;
    color: #e0e0e0;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.story-character-ok-btn--hidden {
    visibility: hidden;
}

.story-character-ok-btn--visible {
    visibility: visible;
    animation: storyBtnPulse 1.5s ease-in-out infinite;
}

.story-character-ok-btn:hover {
    background: rgba(106, 159, 181, 0.3);
    border-color: rgba(106, 159, 181, 0.6);
    transform: translateX(4px);
}

/* ===== STORY OPTIONS (story type) ===== */
.story-options {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    width: 100%;
    margin-top: 0.5rem;
}

.story-options--hidden {
    visibility: hidden;
}

.story-options--visible {
    visibility: visible;
    animation: storyOptionsFadeIn 0.3s ease-out;
}

.story-button {
    padding: 0.8rem 1.5rem;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    color: #e0e0e0;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
    font-family: inherit;
}

.story-button:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateX(4px);
}

/* ===== CONTINUE BUTTON (dialog type) ===== */
.story-continue {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-top: 0.5rem;
}

.story-continue-btn {
    padding: 0.7rem 2.5rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 20px;
    color: #ccc;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.story-continue-btn--hidden {
    visibility: hidden;
}

.story-continue-btn--visible {
    visibility: visible;
    animation: storyBtnPulse 1.5s ease-in-out infinite;
}

.story-continue-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
}

/* ===== ANIMATIONS ===== */
@keyframes storySlideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes storyOptionsFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes storyBtnPulse {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

/* ===== PRODUKTIONS-PANEL ===== */
.production-panel {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem;
}

.production-header {
    text-align: center;
    margin-bottom: 2rem;
}

.production-header h2 {
    color: #e0e0e0;
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.production-header p {
    color: #aaa;
}

.production-content {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.built-buildings-section,
.available-buildings-section {
    background: #2a2a2a;
    border: 1px solid #444;
    padding: 1.5rem;
    border-radius: 4px;
}

.built-buildings-section h3,
.available-buildings-section h3 {
    color: #ccc;
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.empty-message {
    color: #777;
    font-style: italic;
}

.built-building {
    background: #333;
    border: 1px solid #555;
    padding: 1rem;
    margin-bottom: 0.5rem;
    border-radius: 4px;
}

.building-name {
    color: #e0e0e0;
    font-size: 1.1rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.building-production {
    color: #6a9fb5;
    font-size: 0.9rem;
}

.available-building {
    background: #333;
    border: 1px solid #555;
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 4px;
}

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

.building-description {
    color: #aaa;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.building-costs {
    color: #ccc;
    font-size: 0.85rem;
}

.building-costs .affordable {
    color: #6a9fb5;
}

.building-costs .not-affordable {
    color: #ff6666;
}

.build-button {
    padding: 0.5rem 1rem;
    background: #2a4a2a;
    border: 2px solid #4a7a4a;
    color: #e0e0e0;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.9rem;
}

.build-button:hover:not(:disabled) {
    background: #3a5a3a;
    border-color: #5a8a5a;
}

.build-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ===== PRODUCTION PANEL: 3-Spalten-Layout ===== */
.production-panel {
    width: 100%;
    max-width: 1400px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.production-layout {
    display: flex;
    gap: 1rem;
    width: 100%;
}

/* ===== PRODUCTION RESOURCES PANEL (Links, 30%) ===== */
.production-resources-panel {
    flex: 0 0 30%;
    background: #2a2a2a;
    border: 2px solid #444;
    border-radius: 8px;
    padding: 0.75rem;
    max-height: 70vh;
    overflow-y: auto;
}

.resources-header h3 {
    font-size: 0.75rem;
    color: #888;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.resources-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.resource-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: #333;
    border-radius: 4px;
    transition: background 0.2s;
}

.resource-item:hover {
    background: #3a3a3a;
}

.resource-icon {
    font-size: 1.3rem;
    width: 1.5rem;
    text-align: center;
}

.resource-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.resource-name {
    font-size: 0.8rem;
    color: #999;
}

.resource-amount {
    font-size: 1.1rem;
    color: #6a9fb5;
    font-weight: 500;
}

.resource-rate {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    font-size: 0.85rem;
    min-width: 4.5rem;
}

.rate-value {
    font-weight: 500;
}

.trend-icon {
    font-size: 1.2rem;
    line-height: 1;
}

.resource-rate.trend-increasing {
    color: #6fbf73;
}

.resource-rate.trend-increasing .trend-icon {
    color: #6fbf73;
}

.resource-rate.trend-decreasing {
    color: #ff6666;
}

.resource-rate.trend-decreasing .trend-icon {
    color: #ff6666;
}

.resource-rate.trend-neutral {
    color: #ffd966;
}

.resource-rate.trend-neutral .trend-icon {
    color: #ffd966;
}

.resources-empty {
    color: #777;
    text-align: center;
    padding: 2rem;
}

/* ===== PRODUCTION FLOW PANEL (Mitte, 50%) ===== */
.production-flow-panel {
    flex: 1;
    background: #2a2a2a;
    border: 2px solid #444;
    border-radius: 8px;
    padding: 0.75rem;
    max-height: 70vh;
    overflow-y: auto;
}

.flow-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #444;
}

.flow-header h3 {
    font-size: 0.75rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.view-toggle {
    display: flex;
    gap: 0.5rem;
}

.view-btn {
    padding: 0.4rem 0.8rem;
    background: #333;
    border: 1px solid #555;
    color: #ccc;
    font-size: 0.8rem;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s;
}

.view-btn:hover {
    background: #3a3a3a;
    border-color: #666;
}

.view-btn.active {
    background: #4a4a4a;
    border-color: #6a9fb5;
    color: #6a9fb5;
}

.flow-content {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.flow-empty {
    color: #777;
    text-align: center;
    padding: 2rem;
}

/* Simple View */
.flow-simple {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.building-card {
    padding: 0.75rem;
    background: #333;
    border: 1px solid #555;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.building-card:hover {
    background: #3a3a3a;
    border-color: #6a9fb5;
}

.building-card.simple .building-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.4rem;
}

.building-name {
    font-weight: 500;
    color: #e0e0e0;
    font-size: 0.95rem;
}

.building-level {
    font-size: 0.8rem;
    color: #aaa;
    background: #444;
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
}

.building-production {
    font-size: 0.85rem;
    color: #6a9fb5;
    margin-bottom: 0.3rem;
}

.building-workers {
    font-size: 0.8rem;
    color: #999;
}

/* Detailed View */
.flow-detailed {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.building-group {
    background: #333;
    border: 1px solid #555;
    border-radius: 6px;
    padding: 1rem;
}

.group-header {
    font-weight: 500;
    color: #ccc;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #444;
}

.building-card.detailed {
    display: inline-flex;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: #2a2a2a;
    border: 1px solid #444;
    border-radius: 4px;
    margin: 0.25rem;
    font-size: 0.85rem;
}

.building-number {
    color: #999;
}

/* Grouped View */
.flow-grouped {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.production-stage {
    background: #333;
    border: 1px solid #555;
    border-radius: 6px;
    padding: 1rem;
}

.stage-header {
    font-weight: 500;
    color: #ccc;
    font-size: 0.95rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #444;
}

.stage-buildings {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.stage-building-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: #2a2a2a;
    border: 1px solid #444;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.stage-building-row:hover {
    background: #3a3a3a;
    border-color: #6a9fb5;
}

.row-info {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.building-count {
    color: #e0e0e0;
    font-weight: 500;
}

.avg-level {
    color: #aaa;
    font-size: 0.85rem;
}

.row-production {
    color: #6a9fb5;
    font-size: 0.9rem;
}

/* ===== BUILDING DETAILS PANEL (Rechts, 20%) ===== */
.building-details-panel {
    flex: 0 0 20%;
    background: #2a2a2a;
    border: 2px solid #444;
    border-radius: 8px;
    padding: 0.75rem;
    max-height: 70vh;
    overflow-y: auto;
}

.details-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #444;
}

.details-header h3 {
    font-size: 0.9rem;
    color: #e0e0e0;
}

.close-details-btn {
    background: none;
    border: none;
    color: #6a9fb5;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    transition: color 0.2s;
}

.close-details-btn:hover {
    color: #8abfd5;
}

.building-details {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.detail-section {
    background: #333;
    border: 1px solid #444;
    border-radius: 4px;
    padding: 0.5rem;
}

.section-title {
    font-size: 0.75rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.4rem;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 0.4rem 0;
    border-bottom: 1px solid #3a3a3a;
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-row span:first-child {
    color: #999;
    font-size: 0.85rem;
}

.detail-row span:last-child {
    color: #e0e0e0;
    font-weight: 500;
}

.upgrade-btn, .mass-action-btn {
    width: 100%;
    padding: 0.75rem;
    margin-top: 0.5rem;
    background: #2a4a2a;
    border: 2px solid #4a7a4a;
    color: #e0e0e0;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.3s;
    font-size: 0.9rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.upgrade-btn:hover:not(:disabled),
.mass-action-btn:hover:not(:disabled) {
    background: #3a5a3a;
    border-color: #5a8a5a;
}

.upgrade-btn:disabled,
.mass-action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.action-cost {
    font-size: 0.75rem;
    color: #aaa;
}

.max-level {
    text-align: center;
    color: #6fbf73;
    padding: 1rem;
    font-style: italic;
}

/* Build List (Default View) */
.build-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.build-option {
    padding: 0.5rem;
    background: #333;
    border: 1px solid #555;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.build-option.affordable {
    border-color: #4a7a4a;
}

.build-option.unaffordable {
    opacity: 0.6;
}

.build-name {
    font-weight: 500;
    color: #e0e0e0;
    font-size: 0.9rem;
}

.build-costs {
    font-size: 0.75rem;
    color: #999;
}

.build-output {
    font-size: 0.8rem;
    color: #6a9fb5;
}

.build-btn {
    padding: 0.5rem;
    margin-top: 0.25rem;
    background: #2a4a2a;
    border: 2px solid #4a7a4a;
    color: #e0e0e0;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.3s;
    font-size: 0.85rem;
}

.build-btn:hover:not(:disabled) {
    background: #3a5a3a;
    border-color: #5a8a5a;
}

.build-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.cost-item {
    margin-right: 0.5rem;
}

.cost-item.insufficient {
    color: #ff6666;
}

.build-empty {
    text-align: center;
    color: #777;
    padding: 1rem;
}

.building-list-compact {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.compact-building {
    padding: 0.5rem 0.75rem;
    background: #2a2a2a;
    border: 1px solid #444;
    border-radius: 4px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.compact-building:hover {
    background: #3a3a3a;
    border-color: #6a9fb5;
}

/* Production Rate Styling */
.production-output {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.production-rate {
    font-size: 0.8rem;
    color: #999;
}

.no-production {
    color: #666;
}

/* ===== DEV-MODE: Rosa Hintergrund für nicht-freigeschaltete Elemente ===== */

/* Basis-Style für alle dev-sichtbaren Elemente */
.dev-visible {
    background: linear-gradient(135deg, #2a2a2a 0%, #4a2a4a 100%) !important;
    border: 2px dashed #ff69b4 !important;
    opacity: 0.7;
    cursor: not-allowed !important;
}

.dev-visible:hover {
    opacity: 0.85;
    transform: none !important; /* Kein Hover-Effekt */
}

.dev-visible::after {
    content: " 🔒";
    font-size: 0.9em;
    opacity: 0.6;
}

/* Dev-sichtbare Tabs */
.tab.dev-visible {
    opacity: 0.6;
    pointer-events: none; /* Komplett nicht klickbar */
}

/* Dev-sichtbare Gebäude */
.building-card.dev-visible {
    opacity: 0.7;
}

.building-card.dev-visible .build-button {
    cursor: not-allowed !important;
    opacity: 0.5;
    pointer-events: none; /* Komplett nicht klickbar */
}

/* ===== RESPONSIVE (kleine Bildschirme) ===== */

/* ===== ENLIGHTENMENT PANEL ===== */
.enlightenment-panel {
    width: 100%;
    max-width: 800px;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding: 2rem;
}

.enlightenment-header {
    text-align: center;
}

.enlightenment-header h2 {
    font-size: 1.5rem;
    color: #d4af37; /* Gold */
    margin-bottom: 0.5rem;
}

.enlightenment-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Kategorie */
.enlightenment-category {
    background: #2a2a2a;
    border: 2px solid #444;
    border-radius: 8px;
    padding: 1.5rem;
    transition: all 0.3s;
}

.enlightenment-category.expanded {
    border-color: #6a9fb5;
}

.category-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.category-icon {
    font-size: 1.5rem;
}

.category-name {
    font-size: 1.1rem;
    font-weight: 500;
    color: #e0e0e0;
    flex: 1;
}

.category-symbol-container {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.attribute-symbol-canvas {
    display: block;
}

/* Attribute (Details) */
.category-attributes {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding-left: 2.5rem;
    border-left: 2px solid #444;
    margin-left: 2rem;
}

.attribute-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    background: #333;
    border-radius: 4px;
}

.attribute-icon {
    font-size: 1.2rem;
    width: 1.5rem;
    text-align: center;
}

.attribute-name {
    flex: 1;
    color: #ccc;
    font-size: 0.9rem;
}

.attribute-symbol {
    font-size: 1.5rem;
    color: #6a9fb5;
    width: 2rem;
    text-align: center;
}
}
