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

:root {
    /* Ursprünglich: #1e2736, jetzt dark-theme */
    --primary-color: #375a9e; 
    --primary-color-rgb: 55, 90, 158;
    /* Ursprünglich: #2e3b4e, jetzt dark-theme */
    --secondary-color: #4a6fa5; 
    --secondary-color-rgb: 74, 111, 165;
    /* Ursprünglich: #ffcc00, jetzt dark-theme */
    --accent-color: #4d7cc9; 
    --accent-color-rgb: 77, 124, 201;
    /* Beibehalten von :root, da in dark-theme nicht definiert */
    --success-color: #48bb78; 
    --success-color-rgb: 72, 187, 120;
    --warning-color: #f6ad55;
    --warning-color-rgb: 246, 173, 85; /* dark-theme hat dies definiert */
    --error-color: #f56565;
    --error-color-rgb: 245, 101, 101;
    /* Ursprünglich: #e0e0e0, jetzt dark-theme */
    --text-color: #e6e6e6; 
    /* Beibehalten von :root, da in dark-theme nicht definiert */
    --secondary-text: #aaaaaa; 
    /* Ursprünglich: #e1ff00, jetzt dark-theme */
    --bg-color: #1a1a1a; 
    /* Ursprünglich: rgba(30, 40, 50, 0.7), jetzt dark-theme */
    --card-bg: #2c2c2c; 
    /* Ursprünglich: rgba(0, 0, 0, 0.1), jetzt dark-theme */
    --border-color: #444; 
    /* Ursprünglich: 0 2px 4px rgba(0, 0, 0, 0.1), jetzt dark-theme */
    --box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3); 
    /* Beibehalten von :root, da in dark-theme nicht definiert */
    --animation-speed: 0.3s; 
    --border-radius: 10px;
    /* Beibehalten von :root, da in dark-theme nicht definiert */
    --disabled-color: #cccccc; 
    /* Ursprünglich: #fff, jetzt dark-theme */
    --light-text: #fff; 
    /* Neu hinzugefügt von dark-theme */
    --hover-color: rgba(73, 97, 145, 0.2); 
}

.dark-theme {
    --primary-color: #375a9e;
    --primary-color-rgb: 55, 90, 158;
    --secondary-color: #4a6fa5;
    --secondary-color-rgb: 74, 111, 165;
    --accent-color: #4d7cc9;
    --accent-color-rgb: 77, 124, 201;
    --success-color: #48bb78; /* Fehlte, von :root übernommen */
    --success-color-rgb: 72, 187, 120; /* Fehlte, von :root übernommen */
    --warning-color: #f6ad55; /* Fehlte, von :root übernommen */
    --warning-color-rgb: 246, 173, 85; 
    --error-color: #f56565; /* Fehlte, von :root übernommen */
    --error-color-rgb: 245, 101, 101; /* Fehlte, von :root übernommen */
    --text-color: #e6e6e6;
    --secondary-text: #aaaaaa; /* Fehlte, von :root übernommen */
    --bg-color: #1a1a1a;
    --card-bg: #2c2c2c;
    --border-color: #444;
    --box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    --animation-speed: 0.3s; /* Fehlte, von :root übernommen */
    --border-radius: 10px; /* Fehlte, von :root übernommen */
    --disabled-color: #666; /* Dunklerer Grauton für dark theme */
    --light-text: #fff;
    --hover-color: rgba(73, 97, 145, 0.2);
}

.retro-theme {
    --primary-color: #8e44ad;
    --primary-color-rgb: 142, 68, 173;
    --secondary-color: #9b59b6;
    --secondary-color-rgb: 155, 89, 182;
    --accent-color: #f39c12;
    --accent-color-rgb: 243, 156, 18;
    --success-color: #2ecc71; /* Angepasste Farbe für Retro */
    --success-color-rgb: 46, 204, 113; /* Angepasste Farbe für Retro */
    --warning-color: #e67e22; /* Angepasste Farbe für Retro */
    --warning-color-rgb: 230, 126, 34; 
    --error-color: #e74c3c; /* Angepasste Farbe für Retro */
    --error-color-rgb: 231, 76, 60; /* Angepasste Farbe für Retro */
    --text-color: #ecf0f1;
    --secondary-text: #bdc3c7; /* Angepasste Farbe für Retro */
    --bg-color: #2c3e50;
    --card-bg: #34495e;
    --border-color: #7f8c8d;
    --box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    --animation-speed: 0.3s; /* Fehlte, von :root übernommen */
    --border-radius: 10px; /* Fehlte, von :root übernommen */
    --disabled-color: #95a5a6; /* Angepasste Farbe für Retro */
    --light-text: #fff;
    --hover-color: rgba(142, 68, 173, 0.2);
}

.military-theme {
    --primary-color: #445500;
    --primary-color-rgb: 68, 85, 0;
    --secondary-color: #6b7f18;
    --secondary-color-rgb: 107, 127, 24;
    --accent-color: #a4bd1a;
    --accent-color-rgb: 164, 189, 26;
    --success-color: #69ad1f;
    --success-color-rgb: 105, 173, 31; /* Fehlte, hinzugefügt */
    --warning-color: #d1a628;
    --warning-color-rgb: 209, 166, 40;
    --error-color: #c63927;
    --error-color-rgb: 198, 57, 39; /* Fehlte, hinzugefügt */
    --text-color: #ffffff;
    --secondary-text: #d8e0b5;
    --bg-color: #1f2611;
    --card-bg: rgba(40, 46, 27, 0.6);
    --border-color: rgba(107, 127, 24, 0.5);
    --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    --animation-speed: 0.3s; /* Fehlte, von :root übernommen */
    --border-radius: 5px; /* Etwas eckiger für Military */
    --disabled-color: #616a55;
    --light-text: #e0e0e0; /* Leicht gedämpftes Weiß */
    --hover-color: rgba(107, 127, 24, 0.2); /* Fehlte, hinzugefügt */
}

.light-theme {
    --primary-color: #2c5282;
    --primary-color-rgb: 44, 82, 130;
    --secondary-color: #4a6fa5;
    --secondary-color-rgb: 74, 111, 165;
    --accent-color: #3182ce;
    --accent-color-rgb: 49, 130, 206;
    --success-color: #48bb78;
    --success-color-rgb: 72, 187, 120; /* Fehlte, hinzugefügt */
    --warning-color: #f6ad55;
    --warning-color-rgb: 246, 173, 85;
    --error-color: #f56565;
    --error-color-rgb: 245, 101, 101; /* Fehlte, hinzugefügt */
    --text-color: #333333;
    --secondary-text: #666666;
    --bg-color: #f5f5f5;
    --card-bg: #ffffff;
    --border-color: rgba(0, 0, 0, 0.1);
    --box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    --animation-speed: 0.3s; /* Fehlte, von :root übernommen */
    --border-radius: 10px; /* Fehlte, von :root übernommen */
    --disabled-color: #bbbbbb;
    --light-text: #ffffff; /* Fehlte, hinzugefügt */
    --hover-color: rgba(74, 111, 165, 0.1); /* Fehlte, hinzugefügt */
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    transition: background-color var(--animation-speed), color var(--animation-speed);
    position: relative;
    /* === NEU: Textauswahl verhindern === */
    user-select: none; 
    -webkit-user-select: none; /* Safari */
    -moz-user-select: none;    /* Firefox */
    -ms-user-select: none;     /* Internet Explorer/Edge */
    /* === ENDE NEU === */
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM12 86c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm28-65c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm23-11c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-6 60c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm29 22c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zM32 63c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm57-13c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5z' fill='rgba(255,255,255,0.03)' fill-rule='evenodd'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: -1;
    animation: backgroundMove 180s linear infinite;
}

/* Neues after-Element für den pulsierenden Hintergrund */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 15% 15%, rgba(var(--primary-color-rgb), 0.08) 0%, transparent 25%),
        radial-gradient(circle at 85% 85%, rgba(var(--accent-color-rgb), 0.08) 0%, transparent 25%);
    pointer-events: none;
    z-index: -2;
    animation: backgroundPulse 15s ease-in-out infinite alternate;
}

/* Bewegende Lichtelemente für ein dynamisches Gefühl */
.bg-light {
    position: fixed;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.4;
    z-index: -3;
    pointer-events: none;
}

.bg-light-1 {
    top: 10%;
    left: 20%;
    width: 300px;
    height: 300px;
    background-color: rgba(var(--primary-color-rgb), 0.15);
    animation: float 25s infinite alternate ease-in-out;
}

.bg-light-2 {
    bottom: 15%;
    right: 10%;
    width: 250px;
    height: 250px;
    background-color: rgba(var(--accent-color-rgb), 0.15);
    animation: float 20s infinite alternate-reverse ease-in-out;
}

.bg-light-3 {
    top: 50%;
    left: 50%;
    width: 400px;
    height: 400px;
    background-color: rgba(var(--secondary-color-rgb), 0.1);
    animation: float 30s infinite alternate ease-in-out, pulse 15s infinite;
    transform: translate(-50%, -50%);
}

/* Animation für langsame Bewegung des Hintergrundmusters */
@keyframes backgroundMove {
    0% {
        background-position: 0% 0%;
    }
    50% {
        background-position: 100% 100%;
    }
    100% {
        background-position: 0% 0%;
    }
}

/* Animation für pulsierende Hintergrundeffekte */
@keyframes backgroundPulse {
    0% {
        opacity: 0.5;
        background-size: 100% 100%;
    }
    50% {
        opacity: 0.7;
        background-size: 120% 120%;
    }
    100% {
        opacity: 0.5;
        background-size: 100% 100%;
    }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px;
    position: relative;
}

.container::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        rgba(18, 16, 16, 0) 50%, 
        rgba(0, 0, 0, 0.02) 50%
    );
    background-size: 100% 4px;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.15;
    animation: scanlines 0.2s linear infinite;
}

@keyframes scanlines {
    0% {
        background-position: 0 0;
    }
    100% {
        background-position: 0 4px;
    }
}

header {
    text-align: center;
    margin-bottom: 20px;
    padding: 15px;
    border-radius: var(--border-radius);
    background-color: rgba(var(--primary-color-rgb), 0.1);
    border: 1px solid var(--accent-color);
    box-shadow: 0 0 20px rgba(var(--accent-color-rgb), 0.2);
    position: relative;
    overflow: hidden;
}

/* Neue Game-Title Klasse mit Glow-Effekt */
.game-title {
    font-size: 2.5rem;
    margin-bottom: 5px;
    color: var(--light-text);
    text-shadow: 0 0 10px rgba(var(--accent-color-rgb), 0.8), 0 0 20px rgba(var(--primary-color-rgb), 0.6);
    transition: color var(--animation-speed), text-shadow var(--animation-speed);
    letter-spacing: 1px;
    position: relative;
    animation: glitch 5s infinite;
}

.game-title::after {
    content: "";
    position: absolute;
    left: 25%;
    bottom: -5px;
    width: 50%;
    height: 2px;
    background: linear-gradient(to right, transparent, var(--accent-color), transparent);
}

.game-subtitle {
    font-size: 1.4rem;
    color: var(--accent-color);
    margin-bottom: 8px;
    font-weight: 500;
    letter-spacing: 0.5px;
    text-shadow: 0 0 5px rgba(var(--accent-color-rgb), 0.2);
}

.subtitle {
    font-size: 1.2rem;
    font-style: italic;
    color: var(--secondary-color);
    margin-bottom: 15px;
    position: relative;
    text-shadow: 0 0 5px rgba(var(--secondary-color-rgb), 0.3);
}

h2 {
    font-size: 1.8rem;
    margin-bottom: 15px;
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 5px;
    transition: color var(--animation-speed), border-color var(--animation-speed);
}

h3 {
    font-size: 1.4rem;
    margin-bottom: 10px;
    color: var(--primary-color);
    transition: color var(--animation-speed);
}

.resources {
    display: flex;
    justify-content: center;
    gap: 30px;
    font-size: 1.3rem;
    font-weight: bold;
    margin-top: 15px;
    position: relative;
    z-index: 2;
}

.resource {
    background-color: rgba(var(--primary-color-rgb), 0.9);
    padding: 12px 25px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow), 0 0 15px rgba(var(--accent-color-rgb), 0.4);
    transition: all var(--animation-speed);
    animation: pulse 2s infinite;
    border: 1px solid rgba(var(--accent-color-rgb), 0.5);
    position: relative;
    z-index: 2;
}

.resource::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, 
        var(--accent-color) 0%, 
        transparent 20%, 
        transparent 80%, 
        var(--accent-color) 100%);
    border-radius: var(--border-radius);
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s;
}

.resource:hover::after {
    opacity: 1;
}

.resource:hover {
    transform: translateY(-2px);
    box-shadow: var(--box-shadow), 0 0 20px rgba(var(--accent-color-rgb), 0.5);
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

/* News Ticker */
.news-ticker {
    background-color: var(--primary-color);
    color: var(--light-text);
    padding: 10px 0;
    margin-top: 5px;
    margin-bottom: 20px;
    overflow: hidden;
    position: relative;
    border-radius: var(--border-radius);
    white-space: nowrap;
    border-top: 1px solid rgba(var(--accent-color-rgb), 0.3);
}

.ticker-content {
    white-space: nowrap;
    animation: ticker 60s linear;
    display: inline-block;
    padding-left: 100%;
    will-change: transform;
}

@keyframes ticker {
    0% { transform: translateX(0); }
    100% { transform: translateX(-100%); }
}

/* Hauptlayout anpassen - Bereiche entkoppeln */
main {
    display: grid;
    grid-template-columns: 3fr 1.25fr; /* Seitenleiste um 25px breiter (von 1fr zu 1.25fr) */
    grid-template-areas: 
        "game sidebar"
        "center-blocks sidebar";
    gap: 20px;
    margin-bottom: 20px;
    align-items: start; /* Elemente beginnen oben */
}

.game-area {
    grid-area: game;
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 20px 20px 0;
    transition: background-color var(--animation-speed), box-shadow var(--animation-speed);
    border: 1px solid var(--accent-color);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: auto; /* Automatische Höhe basierend auf Inhalt */
    margin-bottom: 0; /* Kein Abstand nach unten */
}

.sidebar {
    grid-area: sidebar;
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: relative; /* Normale Positionierung */
    height: auto; /* Automatische Höhe */
}

/* Game-Actions Stil beibehalten */
.game-actions {
    display: flex;
    gap: 10px;
    justify-content: center; /* Zentrierte Buttons */
    padding-top: 10px;
    padding-bottom: 10px;
}

/* Für mobile Ansicht anpassen */
@media (max-width: 768px) {
    main {
        grid-template-columns: 1fr; /* Einspaltiges Layout */
        grid-template-areas: 
            "game"
            "sidebar"
            "center-blocks";
    }
    
    /* Bestehendes CSS beibehalten */
    .game-title {
        font-size: 2.2rem;
    }
    
    .game-subtitle {
        font-size: 1.1rem;
    }
    
    .subtitle {
        font-size: 0.8rem;
    }
    
    .resources {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .resource {
        font-size: 1.1rem;
    }
    
    .upgrade-items {
        grid-template-columns: 1fr;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    .click-button .emoji {
        font-size: 60px;
    }
    
    .tabs {
        margin-bottom: 10px;
        padding: 0;
    }
    
    button.tab-button {
        font-size: 0.9rem;
        padding: 8px 5px;
        margin: 0 2px;
        min-width: auto;
        white-space: nowrap;
    }
    
    button.tab-button::before {
        content: '';
        position: absolute;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 3px;
        background-color: transparent;
        transition: background-color var(--animation-speed);
    }
    
    button.tab-button.active {
        background-color: transparent;
        border-bottom: none;
    }
    
    button.tab-button.active::before {
        background-color: var(--primary-color);
    }
    
    button.tab-button:hover {
        background-color: transparent;
    }
    
    .category-achievements {
        margin-bottom: 10px;
    }
    
    .achievement {
        padding: 8px;
    }
    
    .achievement-icon {
        font-size: 1.3rem;
        width: 35px;
        height: 35px;
    }
    
    .upgrade-item {
        margin-bottom: 10px;
    }
}

/* Neues Layout für die verschobenen Elemente */
.center-blocks {
    grid-area: center-blocks;
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 5px; /* Reduziert von 15px, damit es näher am Spielbereich ist */
}

/* Anpassungen für die verschobenen Elemente */
.center-blocks .quick-stats,
.center-blocks .achievements {
    width: 100%;
    max-width: 100%;
}

.game-area::before {
    content: '';
    position: absolute;
    top: -100px;
    right: -100px;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(var(--primary-color-rgb), 0.1) 0%, transparent 70%);
    border-radius: 50%;
    animation: float 15s infinite alternate ease-in-out;
}

.game-area::after {
    content: '';
    position: absolute;
    bottom: -50px;
    left: -50px;
    width: 150px;
    height: 150px;
    background: radial-gradient(circle, rgba(var(--accent-color-rgb), 0.1) 0%, transparent 70%);
    border-radius: 50%;
    animation: float 12s infinite alternate-reverse ease-in-out;
}

.sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Klick-Bereich */
.click-area {
    text-align: center;
    margin-bottom: 20px; /* Reduziert von 30px */
    padding: 20px; /* Reduziert von 30px */
    border: 2px dashed var(--border-color);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: transform 0.1s, background-color var(--animation-speed), border-color var(--animation-speed);
    position: relative;
    overflow: hidden;
    background-image: radial-gradient(circle at center, rgba(var(--primary-color-rgb), 0.05) 0%, transparent 70%);
}

.click-area::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 50% 50%, transparent 0%, transparent 50%, rgba(var(--primary-color-rgb), 0.05) 100%);
    opacity: 0;
    transition: opacity 0.5s;
}

.click-area:hover::before {
    opacity: 1;
}

.click-area:hover {
    background-color: var(--hover-color);
}

.click-area:active {
    transform: scale(0.98);
}

.click-button {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.click-button .emoji {
    font-size: 70px; /* Reduziert von 80px */
    animation: pulse 2s infinite;
}

.click-button .label {
    font-size: 1.4rem;
    font-weight: bold;
    color: var(--primary-color);
    transition: color var(--animation-speed);
}

.click-feedback {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    /* overflow: hidden; wird entfernt, um fliegende Zahlen sichtbar zu machen */
}

.click-feedback .gain {
    position: absolute;
    animation: flyUp 1s forwards;
    font-weight: bold;
    color: var(--success-color);
    z-index: 10; /* Hohen z-index hinzufügen */
}

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

/* Tabs */
.tabs {
    display: flex;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 15px; /* Reduziert von 20px */
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    transition: border-color var(--animation-speed);
    justify-content: space-between;
    padding: 0 5px;
    flex-shrink: 0;
}

button.tab-button {
    flex: 1;
    padding: 10px 5px;
    background: none; /* Standard-Hintergrund */
    border: none; /* Standard-Border (wird unten überschrieben) */
    border-bottom: 3px solid transparent; /* Standard für Desktop */
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--text-color); /* Standardfarbe ohne !important */
    transition: color var(--animation-speed), background-color var(--animation-speed), border-color var(--animation-speed);
    text-align: center;
    margin: 0 5px;
    /* Standard-Layout (Inline für Desktop und Mobile) */
    display: inline-flex; /* Use inline-flex for better control */
    align-items: center;
    justify-content: center;
    gap: 8px; /* Add some gap */
}

/* Style for the images inside tab buttons */
button.tab-button img {
    width: 36px; /* Default size (increased again for mobile) */
    height: 36px;
    vertical-align: middle; /* Align image nicely with text */
    margin-bottom: 0; /* Reset margin */
}

/* Desktop-specific styles */
@media (min-width: 769px) {
    button.tab-button {
        flex-direction: column; /* Stack image and text vertically */
        gap: 4px; /* Adjust gap for vertical layout */
        padding-top: 8px; /* Add padding for vertical layout */
        padding-bottom: 8px;
    }

    button.tab-button img {
        width: 40px; /* Larger icon for desktop (increased again) */
        height: 40px;
        margin-bottom: 4px; /* Space between icon and text */
    }
}

button.tab-button:hover {
    background-color: var(--hover-color);
    color: var(--text-color); /* Sicherstellen, dass Hover die Textfarbe nicht ändert */
}

button.tab-button.active {
    color: var(--primary-color); /* Farbe für aktiv */
    border-bottom: 3px solid var(--primary-color); /* Border für aktiv */
    background-color: rgba(var(--primary-color-rgb), 0.1); /* Hintergrund für aktiv */
}

.tab-content {
    display: none;
    height: 100%; /* Füllt den verfügbaren Raum aus */
}

.tab-content.active {
    display: block;
    padding-bottom: 0;
    flex-grow: 0; /* Kein Ausdehnen */
    display: flex;
    flex-direction: column;
}

/* Upgrades */
.upgrades {
    margin-top: 15px;
    margin-bottom: 0;
    flex-grow: 0; /* Kein Ausdehnen */
    display: flex;
    flex-direction: column;
}

.upgrade-items {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    grid-gap: 15px;
    margin-bottom: 0;
    padding-bottom: 15px;
    flex-grow: 0; /* Kein Ausdehnen */
}

.upgrade-item {
    display: flex;
    flex-direction: column;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 12px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: background-color var(--animation-speed), transform 0.2s, box-shadow 0.2s, border-color var(--animation-speed);
    height: auto; /* Höhe automatisch anpassen */
    min-height: 140px; /* Noch kompakter */
    width: 100%;
}

.upgrade-item:hover {
    background-color: var(--hover-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    border-color: var(--accent-color);
}

.upgrade-item:hover .upgrade-icon {
    animation: bounce 0.5s infinite alternate;
}

@keyframes bounce {
    from { transform: translateY(0); }
    to { transform: translateY(-5px); }
}

.upgrade-item:hover .upgrade-progress-bar {
    box-shadow: 0 0 15px rgba(0, 255, 204, 0.5);
}

.upgrade-content {
    display: flex;
    gap: 10px;
    margin-bottom: 10px; /* Reduziert von 15px */
    flex: 0; /* Verhindert Ausdehnung */
    width: 100%;
}

.upgrade-icon {
    font-size: 2rem;
    width: 40px;
    text-align: center;
    flex-shrink: 0;
}

.upgrade-info {
    flex: 1;
    min-width: 0;
}

.upgrade-name {
    font-weight: bold;
    color: var(--primary-color);
    transition: color var(--animation-speed);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.upgrade-effect {
    font-weight: bold;
    margin-bottom: 0.2rem;
    color: #4caf50;
}

.upgrade-multiplier {
    font-size: 0.85rem;
    margin-bottom: 0.4rem;
    color: #ffa726;
    font-style: italic;
    background-color: rgba(255, 167, 38, 0.1);
    border-radius: 4px;
    padding: 3px 5px;
    margin-top: 2px;
    line-height: 1.3;
}

.upgrade-cost {
    margin-bottom: 0.2rem;
    color: #ff9800;
}

.upgrade-description {
    color: #777;
    font-size: 0.8rem;
    font-style: italic;
    margin-top: 3px;
    min-height: 3.2em; /* Erhöht von 1.6em auf 3.2em für einheitliche Höhe */
    overflow: hidden;
}

.upgrade-count {
    font-weight: bold;
    font-size: 1.2rem;
    margin-left: auto;
    min-width: 30px;
    text-align: center;
    flex-shrink: 0;
}

.upgrade-progress {
    background-color: #444;
    border-radius: 8px;
    overflow: hidden;
    margin: 5px auto; /* Reduziert von 10px */
    width: 100%;
    height: 18px; /* Etwas flacher */
    position: relative;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5);
}

.upgrade-progress-bar {
    height: 100%;
    background: linear-gradient(to right, #00ffcc, #00cc88);
    width: 0%;
    transition: width 0.05s linear;
    position: relative;
    box-shadow: 0 0 10px rgba(0, 255, 204, 0.3);
}

.progress-label {
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    font-size: 12px;
    color: white;
    font-weight: bold;
    text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.7);
    pointer-events: none;
    z-index: 5;
}

.production-complete .upgrade-progress-bar {
    background: linear-gradient(to right, #00ffcc, #00cc88);
}

.upgrade-button {
    flex: 1;
    padding: 6px 12px; /* Reduziert von 8px */
    background-color: var(--primary-color);
    border: none;
    border-radius: 4px;
    color: #fff;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s;
    font-size: 0.9rem; /* Kleiner machen */
}

.upgrade-button:hover {
    background-color: var(--accent-color);
}

.upgrade-button:disabled {
    background-color: var(--disabled-color);
    cursor: not-allowed;
    opacity: 0.7;
    color: var(--secondary-text);
}

.max-button {
    background-color: var(--secondary-color);
}

.max-button:hover {
    background-color: var(--accent-color);
}

.max-button:disabled {
    background-color: var(--disabled-color);
    opacity: 0.7;
    color: var(--secondary-text);
}

/* Neon-Effekt für Buttons */
.upgrade-button, #prestige-button, footer button {
    position: relative;
    overflow: hidden;
}

.upgrade-button::before, #prestige-button::before, footer button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    transition: left 0.7s;
}

.upgrade-button:hover::before, #prestige-button:hover::before, footer button:hover::before {
    left: 100%;
}

/* Verbesserte Animationen für die Upgrade-Items */
@keyframes upgradeGlow {
    0% {
        box-shadow: 0 0 5px rgba(var(--primary-color-rgb), 0.3);
    }
    50% {
        box-shadow: 0 0 15px rgba(var(--primary-color-rgb), 0.5);
    }
    100% {
        box-shadow: 0 0 5px rgba(var(--primary-color-rgb), 0.3);
    }
}

.upgrade-item:hover {
    animation: upgradeGlow 1.5s infinite;
}

/* Prestige-Bereich */
.prestige-area {
    background-color: var(--card-bg);
    padding: 15px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    margin-bottom: 20px;
    border: 1px solid var(--accent-color);
    position: relative;
    overflow: hidden;
    animation: glow 8s infinite;
}

.prestige-area h2 {
    margin-top: 0;
    font-size: 1.3rem;
    color: var(--primary-color);
    text-align: left;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.prestige-area h2::before {
    content: "⭐";
    font-size: 1.2rem;
}

.prestige-info {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.prestige-info ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.prestige-info li {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    border-bottom: 1px solid var(--border-color);
}

.prestige-label {
    color: var(--secondary-text);
}

.prestige-value {
    font-weight: bold;
    color: var(--accent-color);
}

.prestige-note {
    font-size: 0.9rem;
    color: var(--secondary-text);
    font-style: italic;
    margin-top: 5px;
}

#prestige-button {
    margin-top: 10px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 10px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.2s;
}

#prestige-button:hover:not(:disabled) {
    background-color: var(--accent-color);
}

#prestige-button:disabled {
    background-color: var(--disabled-color);
    cursor: not-allowed;
}

.prestige-area::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        to bottom right,
        transparent 0%,
        transparent 40%,
        rgba(var(--accent-color-rgb), 0.1) 50%,
        transparent 60%,
        transparent 100%
    );
    transform: rotate(45deg);
    /* animation: shimmer 10s infinite linear; - ENTFERNT */
    z-index: 1;
    pointer-events: none;
    /* Mache den Effekt statisch, wenn keine Animation läuft */
    opacity: 0.1; 
    display: none; /* Ganz ausblenden für Performance */
}

/* Game Actions */
.game-actions {
    display: flex;
    gap: 10px;
    margin-top: auto; /* Schiebt die Buttons ans Ende der Sidebar */
    padding-top: 20px;
    padding-bottom: 20px;
}

.game-actions button {
    padding: 10px 15px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.2s;
}

#save-button {
    background-color: var(--success-color);
    color: white;
}

#save-button:hover {
    filter: brightness(1.1);
}

#reset-button {
    background-color: var(--error-color);
    color: white;
}

#reset-button:hover {
    filter: brightness(1.1);
}

#settings-button {
    background-color: var(--secondary-color);
    color: white;
    font-size: 1.2rem;
    padding: 8px 12px;
}

#settings-button:hover {
    filter: brightness(1.1);
}

/* Quick Stats */
.quick-stats {
    background-color: var(--card-bg);
    padding: 15px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    margin-bottom: 20px;
    border: 1px solid var(--accent-color);
    position: relative;
    overflow: hidden;
    animation: glow 8s infinite;
}

.quick-stats h3 {
    margin-top: 0;
    font-size: 1.1rem;
    margin-bottom: 10px;
    color: var(--accent-color);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 5px;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 8px;
}

.quick-stats h3::before {
    content: "📊";
    font-size: 1rem;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.stat-item:last-child {
    margin-bottom: 0;
}

.stat-label {
    color: var(--secondary-text);
}

.quick-stats::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        to bottom right,
        transparent 0%,
        transparent 40%,
        rgba(var(--accent-color-rgb), 0.1) 50%,
        transparent 60%,
        transparent 100%
    );
    transform: rotate(45deg);
    /* animation: shimmer 10s infinite linear; - ENTFERNT */
    z-index: 1;
    pointer-events: none;
    /* Mache den Effekt statisch, wenn keine Animation läuft */
    opacity: 0.1; 
    display: none; /* Ganz ausblenden für Performance */
}

/* Situation Report (Militärischer Lagebericht) */
.situation-report {
    background-color: var(--card-bg);
    padding: 15px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    margin-bottom: 20px;
    border: 1px solid var(--accent-color);
    position: relative;
    overflow: hidden;
    animation: glow 8s infinite;
}

.situation-report h3 {
    margin-top: 0;
    font-size: 1.1rem;
    color: var(--accent-color);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 5px;
    margin-bottom: 10px;
    text-align: left;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 8px;
}

.situation-report h3::before {
    content: "🔒";
    font-size: 1rem;
}

.situation-report::before {
    content: "";
    display: none;
}

.situation-content {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.situation-text {
    font-style: italic;
    padding: 8px;
    background-color: rgba(0, 0, 0, 0.1);
    border-radius: 5px;
    border-left: 3px solid var(--accent-color);
    font-size: 0.95rem;
    line-height: 1.4;
}

.unit-statistics {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-top: 5px;
    font-size: 0.9rem;
}

.unit-statistics .stat-item {
    background-color: rgba(0, 0, 0, 0.05);
    padding: 5px 8px;
    border-radius: 4px;
    margin-bottom: 0;
    display: flex;
    justify-content: space-between;
}

.unit-statistics .stat-value {
    font-weight: bold;
    color: var(--accent-color);
}

/* Achievements */
.achievements {
    background-color: var(--card-bg);
    padding: 15px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    margin-bottom: 10px; /* Reduziert von 20px */
    border: 1px solid var(--accent-color);
    position: relative;
    overflow: hidden;
    animation: glow 8s infinite;
}

.achievements h2 {
    font-size: 1.1rem;
    margin-bottom: 15px;
    color: var(--accent-color);
    text-align: left;
    display: flex;
    align-items: center;
    gap: 8px;
}

.achievements h2::before {
    content: "🏆";
    font-size: 1rem;
}

.achievements h3 {
    font-size: 1.1rem;
    color: var(--accent-color);
    margin: 10px 0;
    font-weight: bold;
    text-align: left;
}

.achievement-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: relative; /* Sicherstellt, dass der Inhalt im normalen Fluss bleibt */
}

/* Verbesserte Struktur für Achievement-Kategorien mit korrektem Aufklappverhalten */
.category-achievements {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden; /* Versteckt alles, was außerhalb liegt */
    position: relative;
    margin-bottom: 8px; /* Leicht erhöhter Abstand für visuelle Trennung */
    transform-origin: top center;
}

.category-header {
    background-color: rgba(0, 0, 0, 0.1);
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s;
    position: relative; /* Zurück zu relative */
    z-index: 2;
    min-height: 50px;
    -webkit-tap-highlight-color: transparent;
}

.category-header:hover {
    background-color: rgba(0, 0, 0, 0.2);
}

.category-header:active {
    background-color: rgba(0, 0, 0, 0.25);
}

.category-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: bold;
    color: var(--accent-color);
}

.category-toggle {
    transition: transform 0.3s;
}

.category-toggle.open {
    transform: rotate(180deg);
}

.category-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease-out, opacity 0.3s;
    opacity: 0;
    position: relative; /* Zurück zu relative für normalen Dokumentfluss */
    width: 100%;
    background-color: var(--card-bg);
    border-bottom-left-radius: var(--border-radius);
    border-bottom-right-radius: var(--border-radius);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transform-origin: top;
}

.category-content.open {
    max-height: 2000px;
    opacity: 1;
    transition: max-height 0.5s ease-in, opacity 0.3s ease-in;
    transform-origin: top;
}

/* Zusätzlicher Abstand nach jeder Kategorie für den absolut positionierten Inhalt */
.category-achievements {
    margin-bottom: 5px; /* Reduzierter Abstand statt großem Platz für Dropdown */
}

.achievement {
    display: flex;
    padding: 10px;
    border-bottom: 1px solid var(--border-color);
    opacity: 0.7;
    transition: opacity 0.2s, background-color 0.2s;
    background-color: rgba(0, 0, 0, 0.05);
    min-height: 80px;
}

.achievement:last-child {
    border-bottom: none;
}

.achievement.unlocked {
    opacity: 1;
    background-color: rgba(0, 0, 0, 0);
}

.achievement-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-right: 10px;
    background-color: rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    flex-shrink: 0;
}

.achievement-details {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.achievement-name {
    font-weight: bold;
    margin-bottom: 2px;
    color: var(--text-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.achievement-desc {
    font-size: 0.9rem;
    color: var(--secondary-text);
    margin-bottom: 4px;
    min-height: 1.8em;
    overflow: hidden;
}

.achievement-flavor {
    font-size: 0.85rem;
    font-style: italic;
    color: var(--accent-color);
    min-height: 1.7em;
    overflow: hidden;
}

.achievement-condition {
    margin-top: 5px;
    font-size: 0.8rem;
    color: var(--secondary-text);
    border-top: 1px dashed var(--border-color);
    padding-top: 4px;
}

.achievement-status {
    font-size: 0.8rem;
    color: var(--warning-color);
    font-weight: bold;
}

.achievement.unlocked .achievement-status {
    color: var(--success-color);
}

.achievements-help {
    display: none; /* Nicht mehr benötigt, da Hilfe direkt angezeigt wird */
}

/* Footer */
footer {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 20px;
}

footer button {
    background-color: #6c757d;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color var(--animation-speed);
}

footer button:hover {
    background-color: #5a6268;
}

.settings-icon {
    font-size: 1.5rem;
    cursor: pointer;
    transition: transform 0.2s;
}

.settings-icon:hover {
    transform: rotate(30deg);
}

/* Settings Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 100;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    position: relative;
    background-color: var(--bg-color);
    margin: 10% auto;
    padding: 20px;
    width: 80%;
    max-width: 500px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    box-shadow: var(--box-shadow);
    color: var(--text-color);
}

.close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-color);
}

.close:hover {
    color: var(--accent-color);
}

.settings-group {
    margin-bottom: 20px;
}

.settings-title {
    font-size: 1.2em;
    font-weight: bold;
    margin-bottom: 10px;
    color: var(--accent-color);
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding: 10px;
    background-color: var(--card-bg);
    border-radius: 5px;
    border: 1px solid var(--border-color);
}

/* Notification Styles */
.notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: var(--primary-color);
    color: white;
    padding: 15px 20px;
    border-radius: 5px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    transform: translateY(100px);
    opacity: 0;
    transition: transform var(--animation-speed), opacity var(--animation-speed), background-color var(--animation-speed);
}

.notification.show {
    transform: translateY(0);
    opacity: 1;
}

.notification.achievement {
    background-color: var(--success-color);
}

/* Mobile Optimierungen */
@media (max-width: 768px) {
    main {
        grid-template-columns: 1fr;
    }
    
    /* Center-blocks Anpassung für mobile Geräte */
    .center-blocks {
        grid-column: 1;
        margin-top: 15px;
    }
    
    /* Verbesserte Darstellung des Titels */
    .game-title {
        font-size: 1.8rem;
        color: var(--light-text);
        text-shadow: 0 0 10px rgba(var(--accent-color-rgb), 0.8), 0 0 20px rgba(var(--primary-color-rgb), 0.6);
        letter-spacing: 0px;
    }
    
    .game-subtitle {
        font-size: 1.1rem;
    }
    
    .subtitle {
        font-size: 0.95rem;
    }
    
    .resources {
        flex-direction: column;
        gap: 10px;
        align-items: center;
    }
    
    .resource {
        width: 80%;
    }
    
    .upgrade-items {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
    
    h1 {
        font-size: 2rem;
    }
    
    .click-button .emoji {
        font-size: 60px;
    }
    
    /* Verbesserte mobile Tab-Darstellung */
    .tabs {
        flex-direction: column;
        border-bottom: none;
        padding: 0;
        overflow-x: visible;
        white-space: normal;
        gap: 5px;
    }
    
    button.tab-button {
        width: 100%;
        text-align: center;
        padding: 12px 20px;
        margin: 2px 0;
        border: none;
        border-radius: 5px;
        font-size: 1rem;
        display: flex; /* Ensures flex layout for mobile */
        align-items: center; /* Vertically center items */
        justify-content: center; /* Align items to the center */
        gap: 10px;
        background-color: rgba(var(--primary-color-rgb), 0.05);
        color: var(--text-color);
        flex-direction: row; /* Explicitly set row direction for mobile */
    }
    
    /* Mobile image size */
    button.tab-button img {
        width: 36px; /* Keep mobile size (increased again) */
        height: 36px;
        margin-bottom: 0; /* No bottom margin for mobile */
    }
    
    /* Remove the :before emoji rule if images are used */
    /* button.tab-button::before { */
    /*    content: attr(data-emoji); */
    /*    font-size: 1.2rem; */
    /*    display: inline; */
    /*    text-align: center; */
    /*    margin-right: 5px; */
    /*    width: auto; */
    /* } */
    
    button.tab-button.active {
        background-color: rgba(var(--primary-color-rgb), 0.15);
        border: none;
        position: relative;
    }
    
    button.tab-button.active::after {
        content: "";
        position: absolute;
        bottom: -2px;
        left: 50%;
        transform: translateX(-50%);
        width: 60%;
        height: 2px;
        background-color: var(--primary-color);
    }
    
    button.tab-button:hover {
        background-color: rgba(var(--primary-color-rgb), 0.2);
        color: var(--text-color);
        border-color: transparent;
    }
    
    /* Kategorie-Header in der mobilen Ansicht */
    .category-header {
        display: flex;
        justify-content: center; /* Zentriert den Inhalt */
        align-items: center;
        padding: 12px 16px;
        min-height: 50px;
    }
    
    .category-title {
        justify-content: center; /* Zentriert den Text und das Emoji */
        flex: 1; /* Nimmt den verfügbaren Platz ein */
        text-align: center; /* Zentriert den Text */
    }
    
    .category-toggle {
        position: absolute;
        right: 15px; /* Realistischer Abstand vom Rand */
    }
    
    button.tab-button:hover {
        background-color: rgba(var(--primary-color-rgb), 0.2); /* Hover-Hintergrund für Mobile */
        color: var(--text-color); /* Sicherstellen, dass Hover die Textfarbe nicht ändert */
        border-left-color: transparent; /* Sicherstellen, dass Hover die Border nicht ändert */
    }
    
    .category-achievements {
        grid-template-columns: 1fr;
    }
    
    .achievement {
        padding: 8px;
    }
    
    .achievement-icon {
        font-size: 20px;
        width: 30px;
        height: 30px;
    }
    
    .upgrade-item {
        padding: 12px;
        min-height: 160px;
    }
}

/* Touch-Optimierungen */
@media (pointer: coarse) {
    .click-area {
        padding: 40px 20px;
    }
    
    button, button.tab-button, .upgrade-button {
        min-height: 44px;
        /* Touch-Target-Größe verbessern */
        touch-action: manipulation;
    }
    
    .upgrade-item {
        padding: 12px;
        contain: layout style;
    }
    
    /* Scrolling-Performance verbessern */
    .tab-content, .category-achievements, .upgrade-items {
        -webkit-overflow-scrolling: touch;
        contain: content;
    }
    
    /* Rendering-Layer für unsichtbare Elemente deaktivieren */
    .tab-content:not(.active), .category-content:not(.open) {
        visibility: hidden;
        contain: strict;
        will-change: auto;
    }
    
    /* Rendering-Layer für sichtbare Elemente aktivieren */
    .tab-content.active, .category-content.open {
        visibility: visible;
        contain: content;
        will-change: transform, opacity;
    }
    
    /* Reduzieren von Style-Recalculation und Layout-Thrashing */
    .tabs, .upgrade-items, .category-achievements {
        contain: layout style;
    }
}

/* Animations und Übergänge */
.animated {
    transition-property: transform, opacity, background-color;
    transition-duration: var(--animation-speed);
}

.fadeIn {
    animation: fadeIn 0.5s forwards;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.shake {
    animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) both;
}

@keyframes shake {
    10%, 90% { transform: translate3d(-1px, 0, 0); }
    20%, 80% { transform: translate3d(2px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
    40%, 60% { transform: translate3d(4px, 0, 0); }
}

/* Zusätzliche Stilanpassungen für Accessibility */
button:focus, input:focus, select:focus {
    outline: 2px solid var(--secondary-color);
    outline-offset: 2px;
}

/* Spielspezifische Animationen */
.click-ripple {
    position: absolute;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.7);
    transform: scale(0);
    animation: ripple 0.6s linear;
    pointer-events: none;
}

@keyframes ripple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

@keyframes progress-pulse {
    0% { box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(40, 167, 69, 0); }
    100% { box-shadow: 0 0 0 0 rgba(40, 167, 69, 0); }
}

.production-complete {
    animation: item-produced 0.3s ease-out;
    isolation: isolate;
}

@keyframes item-produced {
    0% { background-color: var(--card-bg); }
    50% { background-color: rgba(40, 167, 69, 0.1); }
    100% { background-color: var(--card-bg); }
}

/* Achievement-Popup (mittig im Bildschirm) */
.achievement-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    background: linear-gradient(to bottom, #1e2a3a, #12171f);
    border: 2px solid #ffcc00;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(255, 204, 0, 0.5);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    max-width: 400px;
    z-index: 1000;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
}

.achievement-popup.show {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

.achievement-popup-icon {
    font-size: 40px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 0 10px rgba(255, 204, 0, 0.3);
}

.achievement-popup-content {
    flex: 1;
}

.achievement-popup-title {
    font-size: 18px;
    font-weight: bold;
    color: #ffcc00;
    margin-bottom: 5px;
}

.achievement-popup-name {
    font-size: 16px;
    font-weight: bold;
    color: #fff;
    margin-bottom: 5px;
}

.achievement-popup-desc {
    font-size: 14px;
    color: #ddd;
    font-style: italic;
}

.button-group {
    display: flex;
    gap: 5px;
    margin-top: 3px; /* Reduziert von 5px */
}

/* Responsive Anpassungen */
@media (max-width: 768px) {
    .button-group {
        flex-direction: column;
    }
}

/* Helles Theme hinzufügen */
.light-theme {
    --primary-color: #2a4b8d;
    --secondary-color: #3498db;
    --accent-color: #ff9500;
    --success-color: #27ae60;
    --warning-color: #e67e22;
    --error-color: #e74c3c;
    --text-color: #333333;
    --secondary-text: #666666;
    --bg-color: #f5f5f5;
    --card-bg: rgba(255, 255, 255, 0.9);
    --border-color: rgba(0, 0, 0, 0.1);
    --box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    --disabled-color: #bbbbbb;
}

@keyframes float {
    0% { transform: translate(0, 0); }
    50% { transform: translate(15px, -15px); }
    100% { transform: translate(0, 0); }
}

/* @keyframes glow - ENTFERNT
    0% { box-shadow: 0 0 5px rgba(var(--accent-color-rgb), 0.3); }
    50% { box-shadow: 0 0 20px rgba(var(--accent-color-rgb), 0.5); }
    100% { box-shadow: 0 0 5px rgba(var(--accent-color-rgb), 0.3); }
*/

/* @keyframes shimmer - ENTFERNT
    0% { transform: translateX(-100%) rotate(45deg); }
    100% { transform: translateX(100%) rotate(45deg); }
*/

.prestige-area, .quick-stats, .situation-report, .achievements {
    /* animation: glow 8s infinite; - ENTFERNT */
    position: relative;
    overflow: hidden;
}

.prestige-area::after, .quick-stats::after, .situation-report::after, .achievements::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        to bottom right,
        transparent 0%,
        transparent 40%,
        rgba(var(--accent-color-rgb), 0.1) 50%,
        transparent 60%,
        transparent 100%
    );
    transform: rotate(45deg);
    /* animation: shimmer 10s infinite linear; - ENTFERNT */
    z-index: 1;
    pointer-events: none;
    /* Mache den Effekt statisch, wenn keine Animation läuft */
    opacity: 0.1; 
    display: none; /* Ganz ausblenden für Performance */
}

/* Hintergrundpartikel */
.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background-color: rgba(var(--accent-color-rgb), 0.2);
    border-radius: 50%;
    animation: particle-float 60s infinite linear;
}

@keyframes particle-float {
    0% {
        transform: translate(0, 0) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 0.8;
    }
    90% {
        opacity: 0.8;
    }
    100% {
        transform: translate(var(--x, 100px), var(--y, 100px)) rotate(360deg);
        opacity: 0;
    }
}

/* Glitch-Effekt für Titel */
@keyframes glitch {
    0% {
        text-shadow: 0 0 10px rgba(var(--primary-color-rgb), 0.5), 0 0 20px rgba(var(--primary-color-rgb), 0.3);
        transform: skewX(0);
    }
    2% {
        text-shadow: -3px 0 rgba(255, 0, 0, 0.7), 3px 0 rgba(0, 255, 255, 0.7);
        transform: skewX(3deg);
    }
    4% {
        text-shadow: 3px 0 rgba(255, 0, 0, 0.7), -3px 0 rgba(0, 255, 255, 0.7);
        transform: skewX(-3deg);
    }
    5% {
        text-shadow: 0 0 10px rgba(var(--primary-color-rgb), 0.5), 0 0 20px rgba(var(--primary-color-rgb), 0.3);
        transform: skewX(0);
    }
    80% {
        text-shadow: 0 0 10px rgba(var(--primary-color-rgb), 0.5), 0 0 20px rgba(var(--primary-color-rgb), 0.3);
        transform: skewX(0);
    }
    82% {
        text-shadow: -3px 0 rgba(255, 0, 0, 0.7), 3px 0 rgba(0, 255, 255, 0.7);
        transform: skewX(3deg);
    }
    84% {
        text-shadow: 3px 0 rgba(255, 0, 0, 0.7), -3px 0 rgba(0, 255, 255, 0.7);
        transform: skewX(-3deg);
    }
    86% {
        text-shadow: 0 0 10px rgba(var(--primary-color-rgb), 0.5), 0 0 20px rgba(var(--primary-color-rgb), 0.3);
        transform: skewX(0);
    }
    100% {
        text-shadow: 0 0 10px rgba(var(--primary-color-rgb), 0.5), 0 0 20px rgba(var(--primary-color-rgb), 0.3);
        transform: skewX(0);
    }
}

/* Verbesserte Click-Area */
.click-area:active::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: rgba(var(--accent-color-rgb), 0.5);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: explosion 0.5s ease-out forwards;
}

@keyframes explosion {
    0% {
        width: 5px;
        height: 5px;
        opacity: 1;
    }
    100% {
        width: 300px;
        height: 300px;
        opacity: 0;
    }
}

.click-explosion {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    z-index: 100;
    mix-blend-mode: screen;
    transform: translate(-50%, -50%);
    animation: explosion-anim 0.6s ease-out forwards;
    box-shadow: 0 0 20px currentColor;
}

@keyframes explosion-anim {
    0% {
        width: 5px;
        height: 5px;
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    100% {
        width: 5px;
        height: 5px;
        opacity: 0;
        transform: translate(-50%, -50%) scale(60);
    }
}

button {
    position: relative;
    overflow: hidden;
}

/* Sticky Resources Bar */
.sticky-resources {
    position: sticky;
    top: 0;
    width: 100%;
    background-color: var(--primary-color);
    padding: 10px 0;
    z-index: 100;
    border-bottom: 2px solid var(--accent-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    display: flex;
    justify-content: center;
    gap: 20px;
    transition: background-color var(--animation-speed), transform 0.3s;
    margin-bottom: 25px;
}

.sticky-resources .resource {
    margin: 0;
    padding: 8px 15px;
    font-size: 1rem;
    opacity: 0.95;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    color: var(--light-text);
}

.sticky-resources .resource:hover {
    transform: none;
    opacity: 1;
}

@media (max-width: 768px) {
    .sticky-resources {
        flex-direction: column;
        gap: 5px;
        padding: 5px 0;
        align-items: center;
    }
    
    .sticky-resources .resource {
        width: 90%;
        padding: 5px 10px;
        font-size: 0.9rem;
        text-align: center;
    }
}

/* Defence Lottery Styles */
.defence-lottery {
    background-color: var(--card-bg);
    padding: 15px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    margin-bottom: 20px;
    border: 1px solid var(--accent-color);
    position: relative;
    overflow: hidden;
    animation: glow 8s infinite;
}

.defence-lottery h2 {
    margin-top: 0;
    font-size: 1.1rem;
    color: var(--accent-color);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 5px;
    margin-bottom: 10px;
    text-align: left;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 8px;
}

.defence-lottery h2::before {
    content: "🎮";
    font-size: 1rem;
}

.lottery-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    position: relative;
}

.lottery-display {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 10px;
}

.lottery-slot {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #1a2634 0%, #2a3a4a 100%);
    border: 2px solid #4a5a6a;
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 28px;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    position: relative;
    transition: all 0.3s ease;
}

.lottery-slot::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.1) 0%,
        rgba(255, 255, 255, 0) 50%,
        rgba(255, 255, 255, 0.1) 100%);
    pointer-events: none;
    z-index: 1;
}

.lottery-slot.spinning {
    animation: slot-spin 0.1s linear infinite;
    background: linear-gradient(135deg, #243752 0%, #3a4a5a 100%);
    box-shadow: 
        inset 0 0 15px rgba(0, 0, 0, 0.7),
        0 0 10px rgba(255, 215, 0, 0.3);
    border-color: #5a6a7a;
}

@keyframes slot-spin {
    0% { transform: translateY(-5px); }
    50% { transform: translateY(0); }
    100% { transform: translateY(5px); }
}

.lottery-info {
    width: 100%;
    text-align: center;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.lottery-text {
    color: #ddd;
    font-size: 0.9rem;
}

.lottery-bet-options {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 10px 0;
}

.bet-option {
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 4px;
    background-color: rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
}

.bet-option:hover {
    background-color: rgba(60, 100, 150, 0.3);
}

.bet-option input[type="radio"] {
    margin: 0;
    cursor: pointer;
}

.bet-option input[type="radio"]:checked + .bet-label {
    color: var(--accent-color);
    font-weight: bold;
}

.bet-label {
    color: #ddd;
    font-size: 0.85rem;
    user-select: none;
}

.lottery-funds {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
}

.lottery-result {
    color: #ddd;
    font-weight: bold;
    min-height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s ease;
    padding: 0 8px;
    background-color: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    margin: 5px 0;
}

.lottery-result.win {
    color: #00ff00;
    text-shadow: 0 0 5px rgba(0, 255, 0, 0.5);
}

.lottery-result.lose {
    color: #ff5555;
    text-shadow: 0 0 5px rgba(255, 85, 85, 0.5);
}

.lottery-cooldown {
    color: var(--secondary-text);
    font-size: 0.85rem;
    margin-top: 5px;
    padding: 4px 8px;
    background-color: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    display: none;
    font-weight: bold;
    text-align: center;
}

.lottery-paytable {
    margin: 8px 0;
    margin-top: -10px;
    background-color: rgba(0, 0, 0, 0.15);
    border-radius: 4px;
    padding: 6px;
    border: 1px solid rgba(var(--accent-color-rgb), 0.2);
}

.lottery-paytable h4 {
    color: var(--accent-color);
    font-size: 0.85rem;
    margin: 0 0 4px 0;
    text-align: center;
    font-weight: bold;
    border-bottom: 1px solid rgba(var(--accent-color-rgb), 0.2);
    padding-bottom: 4px;
}

.paytable-entries {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
}

.paytable-entry {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: rgba(0, 0, 0, 0.1);
    border-radius: 3px;
    padding: 2px 4px;
    font-size: 0.75rem;
}

.paytable-icon {
    color: #ddd;
    white-space: nowrap;
}

.paytable-win {
    font-weight: bold;
    color: var(--accent-color);
    margin-left: 4px;
}

@media (max-width: 340px) {
    .paytable-entries {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .paytable-entry {
        font-size: 0.7rem;
    }
}

.lottery-button {
    background: linear-gradient(to bottom, #3a546a 0%, #2a3a4a 100%);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 8px 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
}

.lottery-button:hover {
    background: linear-gradient(to bottom, #4a6480 0%, #3a546a 100%);
}

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

.defence-lottery::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        to bottom right,
        transparent 0%,
        transparent 40%,
        rgba(var(--accent-color-rgb), 0.1) 50%,
        transparent 60%,
        transparent 100%
    );
    transform: rotate(45deg);
    animation: shimmer 10s infinite linear;
    z-index: 1;
    pointer-events: none;
}

.lottery-label {
    color: #aaa;
}

.lottery-value {
    color: #ffcc00;
}

/* Versorgungszentrum Styles */
.supply-center {
    background-color: var(--card-bg);
    padding: 15px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    margin-bottom: 20px;
    border: 1px solid var(--accent-color);
    position: relative;
    overflow: hidden;
    animation: glow 8s infinite;
}

.supply-center h2 {
    font-size: 1.1rem;
    margin-bottom: 15px;
    color: var(--accent-color);
    text-align: left;
    display: flex;
    align-items: center;
    gap: 8px;
}

.supply-center h2::before {
    content: "🛠️";
    font-size: 1rem;
}

.supply-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.supply-item {
    background-color: rgba(0, 0, 0, 0.1);
    border-radius: var(--border-radius);
    padding: 12px;
    display: grid;
    grid-template-areas:
        "icon info info"
        "icon info info"
        "cooldown cooldown button";
    grid-template-columns: auto 1fr auto;
    grid-template-rows: auto 1fr auto;
    gap: 10px;
    transition: background-color 0.2s, transform 0.2s;
    position: relative;
    overflow: hidden;
    min-height: 120px;
}

.supply-icon {
    grid-area: icon;
    font-size: 1.8rem;
    padding: 10px;
    background-color: rgba(var(--accent-color-rgb), 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s;
    align-self: start;
}

.supply-info {
    grid-area: info;
    padding: 0 10px;
}

.supply-cooldown {
    grid-area: cooldown;
    padding: 5px 10px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: bold;
    background-color: rgba(0, 255, 0, 0.1);
    color: #2ecc71;
    align-self: end;
    justify-self: start;
}

.supply-button {
    grid-area: button;
    padding: 8px 15px;
    background-color: var(--accent-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.2s, transform 0.1s;
    align-self: end;
    justify-self: end;
}

@media (max-width: 768px) {
    .supply-item {
        grid-template-areas:
            "icon"
            "info"
            "cooldown"
            "button";
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto auto;
        text-align: center;
    }
    
    .supply-icon {
        justify-self: center;
    }
    
    .supply-info {
        width: 100%;
        text-align: center;
        padding: 5px 0;
    }
    
    .supply-cooldown {
        width: 100%;
        text-align: center;
        justify-self: center;
    }
    
    .supply-button {
        width: 100%;
        text-align: center;
        justify-self: center;
    }
}

.supply-item:hover {
    background-color: rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.supply-item:hover .supply-icon {
    transform: scale(1.1);
}

.supply-name {
    font-weight: bold;
    color: var(--accent-color);
    margin-bottom: 5px;
}

.supply-effect {
    font-size: 0.9rem;
    margin-bottom: 4px;
    color: var(--primary-text);
}

.supply-description {
    font-size: 0.85rem;
    font-style: italic;
    color: var(--secondary-text);
}

.supply-cooldown.active {
    background-color: rgba(255, 0, 0, 0.1);
    color: #e74c3c;
}

.supply-button:hover:not(:disabled) {
    background-color: var(--accent-hover);
    transform: translateY(-2px);
}

.supply-button:active:not(:disabled) {
    transform: translateY(0px);
}

.supply-button:disabled {
    background-color: #888;
    cursor: not-allowed;
    opacity: 0.7;
}

.supply-center::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        to bottom right,
        transparent 0%,
        transparent 40%,
        rgba(var(--accent-color-rgb), 0.1) 50%,
        transparent 60%,
        transparent 100%
    );
    transform: rotate(45deg);
    animation: shimmer 10s infinite linear;
    z-index: 1;
    pointer-events: none;
}

@keyframes boost-active {
    0% { box-shadow: 0 0 0 0 rgba(var(--accent-color-rgb), 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(var(--accent-color-rgb), 0); }
    100% { box-shadow: 0 0 0 0 rgba(var(--accent-color-rgb), 0); }
}

.boost-active {
    animation: boost-active 2s infinite;
}

@media (max-width: 768px) {
    .supply-item {
        flex-direction: column;
        text-align: center;
    }
    
    .supply-info {
        width: 100%;
        text-align: center;
        padding: 5px 0;
    }
    
    .supply-button, .supply-cooldown {
        width: 100%;
        text-align: center;
    }
}

/* Styling für Multiplikatoren zur besseren Lesbarkeit */
[id$="-multiplier"] {
    font-size: 0.85rem;
    color: #ffa726;
    background-color: rgba(255, 167, 38, 0.1);
    border-radius: 4px;
    padding: 3px 5px;
    margin-top: 2px;
    margin-bottom: 5px;
    line-height: 1.3;
}

/* Styling für Zeilenumbrüche innerhalb der Multiplikatoren */
[id$="-multiplier"] br {
    line-height: 1.6;
}

/* Tab-Inhalte */
.tab-content h2 {
    margin-top: 0;
    flex-shrink: 0; /* Verhindert das Schrumpfen des Titels */
}

/* Offline Progression Popup */
.offline-progress-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    /* Überarbeiteter Hintergrund, der auf --bg-color basiert statt auf den primären Farben */
    background: var(--card-bg);
    border: 2px solid var(--accent-color);
    border-radius: 10px;
    box-shadow: 0 0 30px rgba(var(--accent-color-rgb), 0.6);
    padding: 20px;
    width: 90%;
    max-width: 450px;
    z-index: 1000;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
    /* Zusätzlicher Schatteneffekt für bessere Lesbarkeit */
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.4);
}

.offline-progress-popup.show {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    pointer-events: auto;
}

.offline-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    border-bottom: 1px solid rgba(var(--accent-color-rgb), 0.3);
    padding-bottom: 10px;
}

.offline-popup-header h3 {
    margin: 0;
    color: var(--accent-color);
    font-size: 1.4rem;
    /* Textschatten für bessere Lesbarkeit in allen Themes */
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.close-offline-popup {
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-color);
    transition: color 0.2s;
}

.close-offline-popup:hover {
    color: var(--accent-color);
}

.offline-popup-content {
    margin-bottom: 20px;
    /* Verbesserte Textlesbarkeit */
    color: var(--text-color);
}

.offline-popup-content p {
    margin: 10px 0;
    line-height: 1.4;
}

.offline-earnings {
    font-size: 1.2rem;
    font-weight: bold;
    text-align: center;
    margin: 15px 0;
    color: var(--text-color);
}

.offline-earnings span {
    color: var(--accent-color);
    font-size: 1.4rem;
    /* Textschatten für bessere Hervorhebung */
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.offline-note {
    font-size: 0.9rem;
    /* Verbesserte Lesbarkeit für sekundären Text */
    color: var(--secondary-text);
    font-style: italic;
    text-align: center;
}

/* Neue Stile für die Zeitbegrenzungshinweise */
.offline-cap-note {
    margin-top: 15px;
    padding: 8px 12px;
    /* Angepasste Hintergrundfarbe für Warnhinweis */
    background-color: rgba(var(--warning-color-rgb), 0.2);
    border-left: 3px solid var(--warning-color);
    font-size: 0.9rem;
    border-radius: 3px;
    text-align: left;
    /* Verbesserte Lesbarkeit für Warnungstext */
    color: var(--text-color);
}

.offline-actual-time {
    font-size: 0.85rem;
    /* Verbesserte Lesbarkeit für sekundären Text */
    color: var(--secondary-text);
    margin-top: 5px;
    text-align: left;
    padding-left: 12px;
}

.offline-popup-button {
    display: block;
    width: 100%;
    padding: 12px;
    background-color: var(--accent-color);
    /* Verbesserte Lesbarkeit für Button-Text */
    color: #000; /* Schwarzer Text für alle Accent-Farben für besseren Kontrast */
    border: none;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    font-size: 1.1rem;
}

.offline-popup-button:hover {
    background-color: rgba(var(--accent-color-rgb), 0.8);
    transform: translateY(-2px);
}

.offline-popup-button:active {
    transform: translateY(0);
}

/* Flugabwehrsystem */
.air-defence-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    overflow: hidden;
}

.enemy-aircraft {
    position: absolute;
    width: 60px;
    height: 60px;
    background-image: url('graphics/spyjet.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    pointer-events: auto;
    cursor: crosshair;
    filter: drop-shadow(2px 2px 2px rgba(0, 0, 0, 0.5));
    user-select: none;
    transform-origin: center;
    z-index: 10000;
    /* position: relative; <-- Nicht unbedingt nötig, da absolute bereits Kontext schafft */
}

/* NEU: Schweif-Effekt */
.enemy-aircraft::after {
    content: '';
    position: absolute;
    bottom: -25px; /* Positioniert den Start des Schweifs unterhalb des Flugzeugs */
    left: 50%;
    transform: translateX(-50%);
    width: 15px; /* Breite des Schweifs */
    height: 40px; /* Länge des Schweifs */
    background: radial-gradient(ellipse at top, 
        rgba(255, 220, 150, 0.9) 0%, /* Helles Orange/Gelb oben */
        rgba(255, 165, 0, 0.5) 50%,  /* Orange in der Mitte */
        transparent 75%             /* Transparent am Ende */
    );
    border-radius: 50% / 40%; /* Elliptische Form */
    opacity: 0.8;
    filter: blur(4px); /* Weicher Rand */
    animation: trail-flicker 0.15s infinite alternate;
    pointer-events: none; /* Verhindert Klicks auf den Schweif */
}

@keyframes trail-flicker {
    from {
        opacity: 0.7;
        transform: translateX(-50%) scaleY(0.95);
    }
    to {
        opacity: 0.9;
        transform: translateX(-50%) scaleY(1.05);
    }
}

/* Entfernte Regel für ::before */

.enemy-aircraft.right-to-left::before {
    transform: scaleX(-1);
}

.enemy-aircraft.shot-down {
    animation: explode 0.5s forwards;
    pointer-events: none;
    /* Hintergrundbild schnell ausblenden, damit Partikel dominieren */
    background-image: none !important; 
    /* Optional: Rand hinzufügen, der explodiert */
    /* border: 2px solid rgba(255, 165, 0, 0.8); */
    border-radius: 50%; /* Macht es rund während der Explosion */
}

/* Versteckt den Schweif, wenn das Flugzeug abgeschossen wird */
.enemy-aircraft.shot-down::after {
    display: none;
}

.reward-popup {
    position: absolute;
    color: var(--success-color);
    font-weight: bold;
    font-size: 1.2rem;
    animation: flyUp 1.5s forwards;
    z-index: 10001;
    text-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
    pointer-events: none;
}

@keyframes explode {
    0% {
        transform: scale(1) rotate(var(--current-rotation, 0deg));
        opacity: 1;
        filter: blur(0px);
        box-shadow: 
            0 0 0px rgba(255, 220, 150, 0.8), /* Initial no shadow */
            0 0 0px rgba(255, 165, 0, 0.6);
    }
    50% {
        transform: scale(1.2) rotate(var(--current-rotation, 0deg));
        opacity: 0.8;
        filter: blur(1px);
        box-shadow: 
            0 0 15px 5px rgba(255, 220, 150, 0.7), /* Start spreading yellow */
            0 0 25px 10px rgba(255, 165, 0, 0.5); /* Start spreading orange */
    }
    100% {
        transform: scale(0.8) rotate(var(--current-rotation, 0deg)); /* Shrink the core */
        opacity: 0;
        filter: blur(5px); /* More blur at the end */
        box-shadow: 
            0 0 30px 20px rgba(255, 220, 150, 0), /* Yellow faded out */
            0 0 50px 35px rgba(255, 165, 0, 0); /* Orange faded out */
    }
}

.crosshair-cursor {
    cursor: crosshair !important;
}

/* Mobile Tab-Button-Fix */
@media (max-width: 768px) {
    button.tab-button::before {
        display: none !important;
    }
    
    button.tab-button {
        border: none !important;
    }
    
    button.tab-button.active {
        border: none !important;
        position: relative;
    }
    
    button.tab-button.active::after {
        content: "";
        position: absolute;
        bottom: -2px;
        left: 50%;
        transform: translateX(-50%);
        width: 60%;
        height: 2px;
        background-color: var(--primary-color);
    }
}

.settings-title {
    font-weight: bold;
    font-size: 1.2rem;
    margin-bottom: 10px;
    color: var(--primary-color);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 5px;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding: 5px 0;
}

/* Credits Modal Styles */
.credits-section {
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 15px;
}

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

.credits-section h3 {
    color: var(--primary-color);
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.credits-section p {
    margin-bottom: 10px;
    line-height: 1.6;
    text-align: justify;
}

.credits-name {
    font-size: 1.4rem;
    font-weight: bold;
    color: var(--accent-color);
    text-align: center !important;
    margin: 15px 0;
}

#credits-button {
    font-size: 1.2rem;
    background-color: transparent;
    padding: 5px 10px;
}

#credits-button:hover {
    background-color: var(--hover-color);
}

/* Rendering-Optimierungen */
button, .tab-button, .upgrade-button, .category-header, .achievement, .game-actions, .click-button, .resource, .category-toggle {
    /* Hardware-Beschleunigung erzwingen */
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
    will-change: transform, opacity;
}

/* Aggressive Mobile-Optimierungen */
@media (max-width: 768px), (pointer: coarse) {
    /* Radikal vereinfachte Animationen/Effekte für mobil */
    body::before, body::after, .bg-light, .container::before,
    .resource::after, .game-area::before, .game-area::after,
    .click-area::before, .upgrade-button::before, #prestige-button::before,
    footer button::before, .prestige-area::after, .quick-stats::after,
    .situation-report::after, .achievements::after, .click-ripple {
        display: none !important;
    }
    
    /* Elementare Animationen deaktivieren */
    .click-button .emoji, .upgrade-item:hover, .upgrade-item:hover .upgrade-icon,
    .upgrade-item:hover .upgrade-progress-bar, .achievement-popup {
        animation: none !important;
    }
    
    /* Kritische Buttons und interaktive Elemente optimal darstellen */
    button, .tab-button, .upgrade-button, .category-header,
    .achievement, .click-button, .resource {
        transform: translate3d(0, 0, 0);
        -webkit-transform: translate3d(0, 0, 0);
        backface-visibility: hidden;
        -webkit-backface-visibility: hidden;
        transform-style: flat;
        -webkit-transform-style: flat;
        will-change: transform;
        transition: none !important;
    }
    
    /* Tatsächliche Klick-Interaktionen vereinfachen */
    button:active, .tab-button:active, .upgrade-button:active {
        transform: none !important;
    }
    
    /* Scrolling optimieren */
    /* .tab-content, main, .upgrade-items, .category-achievements { -- Entfernt contain, da es Höhenprobleme verursachen könnte */
    main, .upgrade-items, .category-achievements {
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: none; /* Verhindert Overscroll-Effekte */
        scroll-behavior: auto;
        contain: layout style; /* Behält contain für Performance, aber nicht 'content' */
    }
    
    /* Inaktive Elemente vollständig aus dem Rendering-Prozess entfernen (Tabs) */
    .tab-content:not(.active) {
        display: none !important; /* Einfacheres Verstecken statt komplexer Regeln */
        /* position: absolute; */ /* Entfernt, könnte Probleme verursachen */
        /* visibility: hidden; */
        /* pointer-events: none; */
        /* height: 0; */
        /* width: 0; */
        /* overflow: hidden; */
        /* contain: strict; */
        /* opacity: 0; */
    }
    
    /* Korrektur für Achievement-Dropdowns: Einfacheres Ausblenden */
    .category-content:not(.open) {
        max-height: 0 !important;
        opacity: 0 !important;
        overflow: hidden !important;
        /* Entferne andere potentiell problematische Stile */
        /* visibility: hidden; */
        /* contain: strict; */
        transition: max-height 0.3s ease-out, opacity 0.2s ease-out !important;
    }

    /* Korrektur für Achievement-Dropdowns: Korrektes Anzeigen */
    .category-content.open {
        max-height: 2000px !important; /* Genug Höhe */
        opacity: 1 !important;
        overflow: visible !important;
        transition: max-height 0.4s ease-in, opacity 0.3s ease-in !important;
        /* Stelle sicher, dass keine hinderlichen 'contain' Regeln angewendet werden */
        contain: none !important; 
    }
    
    /* Alle text-shadow und box-shadow reduzieren/entfernen */
    * {
        text-shadow: none !important;
    }
    
    .resource, .category-header, .upgrade-item, .achievement, button {
        box-shadow: none !important;
    }
    
    /* Statische Hintergründe für Container */
    .container, .game-area, .tab-content, main {
        background-attachment: initial !important;
    }
    
    /* Force-Rasterize für wichtige Container */
    .container, main, .game-area, .tab-content.active {
        transform: translateZ(0);
        backface-visibility: hidden;
    }
    
    /* Korrektur für Game-Area Höhe */
    .game-area {
        height: auto !important;
        min-height: fit-content !important; /* Passt sich dem Inhalt an */
        contain: none !important; /* Entfernt contain von game-area */
    }
    
    .tab-content.active {
         contain: layout style !important; /* Erlaubt Größenanpassung durch Inhalt */
         overflow: visible !important; /* Verhindert Abschneiden */
         height: auto !important;
    }
    
    .upgrade-items {
        transform: translateZ(0);
        contain: layout style !important; /* Behält contain für Performance, aber nicht 'size' oder 'content' */
        height: auto !important; /* Stellt sicher, dass die Höhe nicht beschränkt wird */
    }
}

/* Touch-Optimierungen erweitern */
@media (pointer: coarse) {
    .click-area {
        padding: 40px 20px;
    }
    
    button, button.tab-button, .upgrade-button {
        min-height: 44px;
        /* Touch-Target-Größe verbessern */
        touch-action: manipulation;
    }
    
    .upgrade-item {
        padding: 12px;
        /* contain: layout style; -- Wird jetzt im aggressiven Block gehandhabt */
    }
    
    /* Scrolling-Performance verbessern */
    /* .tab-content, .category-achievements, .upgrade-items { -- Wird jetzt im aggressiven Block gehandhabt */
        /* -webkit-overflow-scrolling: touch; */
        /* contain: content; */
    /* } */
    
    /* Rendering-Layer für unsichtbare Elemente deaktivieren */
    /* .tab-content:not(.active), .category-content:not(.open) { -- Wird jetzt im aggressiven Block gehandhabt */
        /* visibility: hidden; */
        /* contain: strict; */
        /* will-change: auto; */
    /* } */
    
    /* Rendering-Layer für sichtbare Elemente aktivieren */
    /* .tab-content.active, .category-content.open { -- Wird jetzt im aggressiven Block gehandhabt */
        /* visibility: visible; */
        /* contain: content; */
        /* will-change: transform, opacity; */
    /* } */
    
    /* Reduzieren von Style-Recalculation und Layout-Thrashing */
    /* .tabs, .upgrade-items, .category-achievements { -- Wird jetzt im aggressiven Block gehandhabt */
        /* contain: layout style; */
    /* } */
}

/* Animations und Übergänge */
.animated {
    transition-property: transform, opacity, background-color;
    transition-duration: var(--animation-speed);
}

.fadeIn {
    animation: fadeIn 0.5s forwards;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.shake {
    animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) both;
}

@keyframes shake {
    10%, 90% { transform: translate3d(-1px, 0, 0); }
    20%, 80% { transform: translate3d(2px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
    40%, 60% { transform: translate3d(4px, 0, 0); }
}

/* Zusätzliche Stilanpassungen für Accessibility */
button:focus, input:focus, select:focus {
    outline: 2px solid var(--secondary-color);
    outline-offset: 2px;
}

/* Spielspezifische Animationen */
.click-ripple {
    position: absolute;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.7);
    transform: scale(0);
    animation: ripple 0.6s linear;
    pointer-events: none;
}

@keyframes ripple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

@keyframes progress-pulse {
    0% { box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(40, 167, 69, 0); }
    100% { box-shadow: 0 0 0 0 rgba(40, 167, 69, 0); }
}

.production-complete {
    animation: item-produced 0.3s ease-out;
    isolation: isolate;
}

@keyframes item-produced {
    0% { background-color: var(--card-bg); }
    50% { background-color: rgba(40, 167, 69, 0.1); }
    100% { background-color: var(--card-bg); }
}

/* Achievement-Popup (mittig im Bildschirm) */
.achievement-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    background: linear-gradient(to bottom, #1e2a3a, #12171f);
    border: 2px solid #ffcc00;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(255, 204, 0, 0.5);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    max-width: 400px;
    z-index: 1000;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
}

.achievement-popup.show {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

.achievement-popup-icon {
    font-size: 40px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 0 10px rgba(255, 204, 0, 0.3);
}

.achievement-popup-content {
    flex: 1;
}

.achievement-popup-title {
    font-size: 18px;
    font-weight: bold;
    color: #ffcc00;
    margin-bottom: 5px;
}

.achievement-popup-name {
    font-size: 16px;
    font-weight: bold;
    color: #fff;
    margin-bottom: 5px;
}

.achievement-popup-desc {
    font-size: 14px;
    color: #ddd;
    font-style: italic;
}

.button-group {
    display: flex;
    gap: 5px;
    margin-top: 3px; /* Reduziert von 5px */
}

/* Responsive Anpassungen */
@media (max-width: 768px) {
    .button-group {
        flex-direction: column;
    }
}

/* Helles Theme hinzufügen */
.light-theme {
    --primary-color: #2a4b8d;
    --secondary-color: #3498db;
    --accent-color: #ff9500;
    --success-color: #27ae60;
    --warning-color: #e67e22;
    --error-color: #e74c3c;
    --text-color: #333333;
    --secondary-text: #666666;
    --bg-color: #f5f5f5;
    --card-bg: rgba(255, 255, 255, 0.9);
    --border-color: rgba(0, 0, 0, 0.1);
    --box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    --disabled-color: #bbbbbb;
}

@keyframes float {
    0% { transform: translate(0, 0); }
    50% { transform: translate(15px, -15px); }
    100% { transform: translate(0, 0); }
}

/* @keyframes glow - ENTFERNT
    0% { box-shadow: 0 0 5px rgba(var(--accent-color-rgb), 0.3); }
    50% { box-shadow: 0 0 20px rgba(var(--accent-color-rgb), 0.5); }
    100% { box-shadow: 0 0 5px rgba(var(--accent-color-rgb), 0.3); }
*/

/* @keyframes shimmer - ENTFERNT
    0% { transform: translateX(-100%) rotate(45deg); }
    100% { transform: translateX(100%) rotate(45deg); }
*/

.prestige-area, .quick-stats, .situation-report, .achievements {
    /* animation: glow 8s infinite; - ENTFERNT */
    position: relative;
    overflow: hidden;
}

.prestige-area::after, .quick-stats::after, .situation-report::after, .achievements::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        to bottom right,
        transparent 0%,
        transparent 40%,
        rgba(var(--accent-color-rgb), 0.1) 50%,
        transparent 60%,
        transparent 100%
    );
    transform: rotate(45deg);
    /* animation: shimmer 10s infinite linear; - ENTFERNT */
    z-index: 1;
    pointer-events: none;
    /* Mache den Effekt statisch, wenn keine Animation läuft */
    opacity: 0.1; 
    display: none; /* Ganz ausblenden für Performance */
}

/* Hintergrundpartikel */
.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background-color: rgba(var(--accent-color-rgb), 0.2);
    border-radius: 50%;
    animation: particle-float 60s infinite linear;
}

@keyframes particle-float {
    0% {
        transform: translate(0, 0) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 0.8;
    }
    90% {
        opacity: 0.8;
    }
    100% {
        transform: translate(var(--x, 100px), var(--y, 100px)) rotate(360deg);
        opacity: 0;
    }
}

/* Glitch-Effekt für Titel */
@keyframes glitch {
    0% {
        text-shadow: 0 0 10px rgba(var(--primary-color-rgb), 0.5), 0 0 20px rgba(var(--primary-color-rgb), 0.3);
        transform: skewX(0);
    }
    2% {
        text-shadow: -3px 0 rgba(255, 0, 0, 0.7), 3px 0 rgba(0, 255, 255, 0.7);
        transform: skewX(3deg);
    }
    4% {
        text-shadow: 3px 0 rgba(255, 0, 0, 0.7), -3px 0 rgba(0, 255, 255, 0.7);
        transform: skewX(-3deg);
    }
    5% {
        text-shadow: 0 0 10px rgba(var(--primary-color-rgb), 0.5), 0 0 20px rgba(var(--primary-color-rgb), 0.3);
        transform: skewX(0);
    }
    80% {
        text-shadow: 0 0 10px rgba(var(--primary-color-rgb), 0.5), 0 0 20px rgba(var(--primary-color-rgb), 0.3);
        transform: skewX(0);
    }
    82% {
        text-shadow: -3px 0 rgba(255, 0, 0, 0.7), 3px 0 rgba(0, 255, 255, 0.7);
        transform: skewX(3deg);
    }
    84% {
        text-shadow: 3px 0 rgba(255, 0, 0, 0.7), -3px 0 rgba(0, 255, 255, 0.7);
        transform: skewX(-3deg);
    }
    86% {
        text-shadow: 0 0 10px rgba(var(--primary-color-rgb), 0.5), 0 0 20px rgba(var(--primary-color-rgb), 0.3);
        transform: skewX(0);
    }
    100% {
        text-shadow: 0 0 10px rgba(var(--primary-color-rgb), 0.5), 0 0 20px rgba(var(--primary-color-rgb), 0.3);
        transform: skewX(0);
    }
}

/* Verbesserte Click-Area */
.click-area:active::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: rgba(var(--accent-color-rgb), 0.5);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: explosion 0.5s ease-out forwards;
}

@keyframes explosion {
    0% {
        width: 5px;
        height: 5px;
        opacity: 1;
    }
    100% {
        width: 300px;
        height: 300px;
        opacity: 0;
    }
}

.click-explosion {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    z-index: 100;
    mix-blend-mode: screen;
    transform: translate(-50%, -50%);
    animation: explosion-anim 0.6s ease-out forwards;
    box-shadow: 0 0 20px currentColor;
}

@keyframes explosion-anim {
    0% {
        width: 5px;
        height: 5px;
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    100% {
        width: 5px;
        height: 5px;
        opacity: 0;
        transform: translate(-50%, -50%) scale(60);
    }
}

button {
    position: relative;
    overflow: hidden;
}

/* Sticky Resources Bar */
.sticky-resources {
    position: sticky;
    top: 0;
    width: 100%;
    background-color: var(--primary-color);
    padding: 10px 0;
    z-index: 100;
    border-bottom: 2px solid var(--accent-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    display: flex;
    justify-content: center;
    gap: 20px;
    transition: background-color var(--animation-speed), transform 0.3s;
    margin-bottom: 25px;
}

.sticky-resources .resource {
    margin: 0;
    padding: 8px 15px;
    font-size: 1rem;
    opacity: 0.95;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    color: var(--light-text);
}

.sticky-resources .resource:hover {
    transform: none;
    opacity: 1;
}

@media (max-width: 768px) {
    .sticky-resources {
        flex-direction: column;
        gap: 5px;
        padding: 5px 0;
        align-items: center;
    }
    
    .sticky-resources .resource {
        width: 90%;
        padding: 5px 10px;
        font-size: 0.9rem;
        text-align: center;
    }
}

/* Defence Lottery Styles */
.defence-lottery {
    background-color: var(--card-bg);
    padding: 15px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    margin-bottom: 20px;
    border: 1px solid var(--accent-color);
    position: relative;
    overflow: hidden;
    animation: glow 8s infinite;
}

.defence-lottery h2 {
    margin-top: 0;
    font-size: 1.1rem;
    color: var(--accent-color);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 5px;
    margin-bottom: 10px;
    text-align: left;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 8px;
}

.defence-lottery h2::before {
    content: "🎮";
    font-size: 1rem;
}

.lottery-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    position: relative;
}

.lottery-display {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 10px;
}

.lottery-slot {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #1a2634 0%, #2a3a4a 100%);
    border: 2px solid #4a5a6a;
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 28px;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    position: relative;
    transition: all 0.3s ease;
}

.lottery-slot::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.1) 0%,
        rgba(255, 255, 255, 0) 50%,
        rgba(255, 255, 255, 0.1) 100%);
    pointer-events: none;
    z-index: 1;
}

.lottery-slot.spinning {
    animation: slot-spin 0.1s linear infinite;
    background: linear-gradient(135deg, #243752 0%, #3a4a5a 100%);
    box-shadow: 
        inset 0 0 15px rgba(0, 0, 0, 0.7),
        0 0 10px rgba(255, 215, 0, 0.3);
    border-color: #5a6a7a;
}

@keyframes slot-spin {
    0% { transform: translateY(-5px); }
    50% { transform: translateY(0); }
    100% { transform: translateY(5px); }
}

.lottery-info {
    width: 100%;
    text-align: center;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.lottery-text {
    color: #ddd;
    font-size: 0.9rem;
}

.lottery-bet-options {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 10px 0;
}

.bet-option {
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 4px;
    background-color: rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
}

.bet-option:hover {
    background-color: rgba(60, 100, 150, 0.3);
}

.bet-option input[type="radio"] {
    margin: 0;
    cursor: pointer;
}

.bet-option input[type="radio"]:checked + .bet-label {
    color: var(--accent-color);
    font-weight: bold;
}

.bet-label {
    color: #ddd;
    font-size: 0.85rem;
    user-select: none;
}

.lottery-funds {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
}

.lottery-result {
    color: #ddd;
    font-weight: bold;
    min-height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s ease;
    padding: 0 8px;
    background-color: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    margin: 5px 0;
}

.lottery-result.win {
    color: #00ff00;
    text-shadow: 0 0 5px rgba(0, 255, 0, 0.5);
}

.lottery-result.lose {
    color: #ff5555;
    text-shadow: 0 0 5px rgba(255, 85, 85, 0.5);
}

.lottery-cooldown {
    color: var(--secondary-text);
    font-size: 0.85rem;
    margin-top: 5px;
    padding: 4px 8px;
    background-color: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    display: none;
    font-weight: bold;
    text-align: center;
}

.lottery-paytable {
    margin: 8px 0;
    margin-top: -10px;
    background-color: rgba(0, 0, 0, 0.15);
    border-radius: 4px;
    padding: 6px;
    border: 1px solid rgba(var(--accent-color-rgb), 0.2);
}

.lottery-paytable h4 {
    color: var(--accent-color);
    font-size: 0.85rem;
    margin: 0 0 4px 0;
    text-align: center;
    font-weight: bold;
    border-bottom: 1px solid rgba(var(--accent-color-rgb), 0.2);
    padding-bottom: 4px;
}

.paytable-entries {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
}

.paytable-entry {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: rgba(0, 0, 0, 0.1);
    border-radius: 3px;
    padding: 2px 4px;
    font-size: 0.75rem;
}

.paytable-icon {
    color: #ddd;
    white-space: nowrap;
}

.paytable-win {
    font-weight: bold;
    color: var(--accent-color);
    margin-left: 4px;
}

@media (max-width: 340px) {
    .paytable-entries {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .paytable-entry {
        font-size: 0.7rem;
    }
}

.lottery-button {
    background: linear-gradient(to bottom, #3a546a 0%, #2a3a4a 100%);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 8px 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
}

.lottery-button:hover {
    background: linear-gradient(to bottom, #4a6480 0%, #3a546a 100%);
}

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

.defence-lottery::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        to bottom right,
        transparent 0%,
        transparent 40%,
        rgba(var(--accent-color-rgb), 0.1) 50%,
        transparent 60%,
        transparent 100%
    );
    transform: rotate(45deg);
    animation: shimmer 10s infinite linear;
    z-index: 1;
    pointer-events: none;
}

.lottery-label {
    color: #aaa;
}

.lottery-value {
    color: #ffcc00;
}

/* Versorgungszentrum Styles */
.supply-center {
    background-color: var(--card-bg);
    padding: 15px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    margin-bottom: 20px;
    border: 1px solid var(--accent-color);
    position: relative;
    overflow: hidden;
    animation: glow 8s infinite;
}

.supply-center h2 {
    font-size: 1.1rem;
    margin-bottom: 15px;
    color: var(--accent-color);
    text-align: left;
    display: flex;
    align-items: center;
    gap: 8px;
}

.supply-center h2::before {
    content: "🛠️";
    font-size: 1rem;
}

.supply-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.supply-item {
    background-color: rgba(0, 0, 0, 0.1);
    border-radius: var(--border-radius);
    padding: 12px;
    display: grid;
    grid-template-areas:
        "icon info info"
        "icon info info"
        "cooldown cooldown button";
    grid-template-columns: auto 1fr auto;
    grid-template-rows: auto 1fr auto;
    gap: 10px;
    transition: background-color 0.2s, transform 0.2s;
    position: relative;
    overflow: hidden;
    min-height: 120px;
}

.supply-icon {
    grid-area: icon;
    font-size: 1.8rem;
    padding: 10px;
    background-color: rgba(var(--accent-color-rgb), 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s;
    align-self: start;
}

.supply-info {
    grid-area: info;
    padding: 0 10px;
}

.supply-cooldown {
    grid-area: cooldown;
    padding: 5px 10px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: bold;
    background-color: rgba(0, 255, 0, 0.1);
    color: #2ecc71;
    align-self: end;
    justify-self: start;
}

.supply-button {
    grid-area: button;
    padding: 8px 15px;
    background-color: var(--accent-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.2s, transform 0.1s;
    align-self: end;
    justify-self: end;
}

@media (max-width: 768px) {
    .supply-item {
        grid-template-areas:
            "icon"
            "info"
            "cooldown"
            "button";
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto auto;
        text-align: center;
    }
    
    .supply-icon {
        justify-self: center;
    }
    
    .supply-info {
        width: 100%;
        text-align: center;
        padding: 5px 0;
    }
    
    .supply-cooldown {
        width: 100%;
        text-align: center;
        justify-self: center;
    }
    
    .supply-button {
        width: 100%;
        text-align: center;
        justify-self: center;
    }
}

.supply-item:hover {
    background-color: rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.supply-item:hover .supply-icon {
    transform: scale(1.1);
}

.supply-name {
    font-weight: bold;
    color: var(--accent-color);
    margin-bottom: 5px;
}

.supply-effect {
    font-size: 0.9rem;
    margin-bottom: 4px;
    color: var(--primary-text);
}

.supply-description {
    font-size: 0.85rem;
    font-style: italic;
    color: var(--secondary-text);
}

.supply-cooldown.active {
    background-color: rgba(255, 0, 0, 0.1);
    color: #e74c3c;
}

.supply-button:hover:not(:disabled) {
    background-color: var(--accent-hover);
    transform: translateY(-2px);
}

.supply-button:active:not(:disabled) {
    transform: translateY(0px);
}

.supply-button:disabled {
    background-color: #888;
    cursor: not-allowed;
    opacity: 0.7;
}

.supply-center::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        to bottom right,
        transparent 0%,
        transparent 40%,
        rgba(var(--accent-color-rgb), 0.1) 50%,
        transparent 60%,
        transparent 100%
    );
    transform: rotate(45deg);
    animation: shimmer 10s infinite linear;
    z-index: 1;
    pointer-events: none;
}

@keyframes boost-active {
    0% { box-shadow: 0 0 0 0 rgba(var(--accent-color-rgb), 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(var(--accent-color-rgb), 0); }
    100% { box-shadow: 0 0 0 0 rgba(var(--accent-color-rgb), 0); }
}

.boost-active {
    animation: boost-active 2s infinite;
}

@media (max-width: 768px) {
    .supply-item {
        flex-direction: column;
        text-align: center;
    }
    
    .supply-info {
        width: 100%;
        text-align: center;
        padding: 5px 0;
    }
    
    .supply-button, .supply-cooldown {
        width: 100%;
        text-align: center;
    }
}

/* Styling für Multiplikatoren zur besseren Lesbarkeit */
[id$="-multiplier"] {
    font-size: 0.85rem;
    color: #ffa726;
    background-color: rgba(255, 167, 38, 0.1);
    border-radius: 4px;
    padding: 3px 5px;
    margin-top: 2px;
    margin-bottom: 5px;
    line-height: 1.3;
}

/* Styling für Zeilenumbrüche innerhalb der Multiplikatoren */
[id$="-multiplier"] br {
    line-height: 1.6;
}

/* Tab-Inhalte */
.tab-content h2 {
    margin-top: 0;
    flex-shrink: 0; /* Verhindert das Schrumpfen des Titels */
}

/* Offline Progression Popup */
.offline-progress-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    /* Überarbeiteter Hintergrund, der auf --bg-color basiert statt auf den primären Farben */
    background: var(--card-bg);
    border: 2px solid var(--accent-color);
    border-radius: 10px;
    box-shadow: 0 0 30px rgba(var(--accent-color-rgb), 0.6);
    padding: 20px;
    width: 90%;
    max-width: 450px;
    z-index: 1000;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
    /* Zusätzlicher Schatteneffekt für bessere Lesbarkeit */
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.4);
}

.offline-progress-popup.show {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    pointer-events: auto;
}

.offline-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    border-bottom: 1px solid rgba(var(--accent-color-rgb), 0.3);
    padding-bottom: 10px;
}

.offline-popup-header h3 {
    margin: 0;
    color: var(--accent-color);
    font-size: 1.4rem;
    /* Textschatten für bessere Lesbarkeit in allen Themes */
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.close-offline-popup {
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-color);
    transition: color 0.2s;
}

.close-offline-popup:hover {
    color: var(--accent-color);
}

.offline-popup-content {
    margin-bottom: 20px;
    /* Verbesserte Textlesbarkeit */
    color: var(--text-color);
}

.offline-popup-content p {
    margin: 10px 0;
    line-height: 1.4;
}

.offline-earnings {
    font-size: 1.2rem;
    font-weight: bold;
    text-align: center;
    margin: 15px 0;
    color: var(--text-color);
}

.offline-earnings span {
    color: var(--accent-color);
    font-size: 1.4rem;
    /* Textschatten für bessere Hervorhebung */
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.offline-note {
    font-size: 0.9rem;
    /* Verbesserte Lesbarkeit für sekundären Text */
    color: var(--secondary-text);
    font-style: italic;
    text-align: center;
}

/* Neue Stile für die Zeitbegrenzungshinweise */
.offline-cap-note {
    margin-top: 15px;
    padding: 8px 12px;
    /* Angepasste Hintergrundfarbe für Warnhinweis */
    background-color: rgba(var(--warning-color-rgb), 0.2);
    border-left: 3px solid var(--warning-color);
    font-size: 0.9rem;
    border-radius: 3px;
    text-align: left;
    /* Verbesserte Lesbarkeit für Warnungstext */
    color: var(--text-color);
}

.offline-actual-time {
    font-size: 0.85rem;
    /* Verbesserte Lesbarkeit für sekundären Text */
    color: var(--secondary-text);
    margin-top: 5px;
    text-align: left;
    padding-left: 12px;
}

.offline-popup-button {
    display: block;
    width: 100%;
    padding: 12px;
    background-color: var(--accent-color);
    /* Verbesserte Lesbarkeit für Button-Text */
    color: #000; /* Schwarzer Text für alle Accent-Farben für besseren Kontrast */
    border: none;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    font-size: 1.1rem;
}

.offline-popup-button:hover {
    background-color: rgba(var(--accent-color-rgb), 0.8);
    transform: translateY(-2px);
}

.offline-popup-button:active {
    transform: translateY(0);
}

/* Flugabwehrsystem */
.air-defence-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    overflow: hidden;
}

.enemy-aircraft {
    position: absolute;
    width: 60px;
    height: 60px;
    background-image: url('graphics/spyjet.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    pointer-events: auto;
    cursor: crosshair;
    filter: drop-shadow(2px 2px 2px rgba(0, 0, 0, 0.5));
    user-select: none;
    transform-origin: center;
    z-index: 10000;
    /* position: relative; <-- Nicht unbedingt nötig, da absolute bereits Kontext schafft */
}

/* NEU: Schweif-Effekt */
.enemy-aircraft::after {
    content: '';
    position: absolute;
    bottom: -25px; /* Positioniert den Start des Schweifs unterhalb des Flugzeugs */
    left: 50%;
    transform: translateX(-50%);
    width: 15px; /* Breite des Schweifs */
    height: 40px; /* Länge des Schweifs */
    background: radial-gradient(ellipse at top, 
        rgba(255, 220, 150, 0.9) 0%, /* Helles Orange/Gelb oben */
        rgba(255, 165, 0, 0.5) 50%,  /* Orange in der Mitte */
        transparent 75%             /* Transparent am Ende */
    );
    border-radius: 50% / 40%; /* Elliptische Form */
    opacity: 0.8;
    filter: blur(4px); /* Weicher Rand */
    animation: trail-flicker 0.15s infinite alternate;
    pointer-events: none; /* Verhindert Klicks auf den Schweif */
}

@keyframes trail-flicker {
    from {
        opacity: 0.7;
        transform: translateX(-50%) scaleY(0.95);
    }
    to {
        opacity: 0.9;
        transform: translateX(-50%) scaleY(1.05);
    }
}

/* Entfernte Regel für ::before */

.enemy-aircraft.right-to-left::before {
    transform: scaleX(-1);
}

.enemy-aircraft.shot-down {
    animation: explode 0.5s forwards;
    pointer-events: none;
    /* Hintergrundbild schnell ausblenden, damit Partikel dominieren */
    background-image: none !important; 
    /* Optional: Rand hinzufügen, der explodiert */
    /* border: 2px solid rgba(255, 165, 0, 0.8); */
    border-radius: 50%; /* Macht es rund während der Explosion */
}

/* Versteckt den Schweif, wenn das Flugzeug abgeschossen wird */
.enemy-aircraft.shot-down::after {
    display: none;
}

.reward-popup {
    position: absolute;
    color: var(--success-color);
    font-weight: bold;
    font-size: 1.2rem;
    animation: flyUp 1.5s forwards;
    z-index: 10001;
    text-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
    pointer-events: none;
}

@keyframes explode {
    0% {
        transform: scale(1) rotate(var(--current-rotation, 0deg));
        opacity: 1;
        filter: blur(0px);
        box-shadow: 
            0 0 0px rgba(255, 220, 150, 0.8), /* Initial no shadow */
            0 0 0px rgba(255, 165, 0, 0.6);
    }
    50% {
        transform: scale(1.2) rotate(var(--current-rotation, 0deg));
        opacity: 0.8;
        filter: blur(1px);
        box-shadow: 
            0 0 15px 5px rgba(255, 220, 150, 0.7), /* Start spreading yellow */
            0 0 25px 10px rgba(255, 165, 0, 0.5); /* Start spreading orange */
    }
    100% {
        transform: scale(0.8) rotate(var(--current-rotation, 0deg)); /* Shrink the core */
        opacity: 0;
        filter: blur(5px); /* More blur at the end */
        box-shadow: 
            0 0 30px 20px rgba(255, 220, 150, 0), /* Yellow faded out */
            0 0 50px 35px rgba(255, 165, 0, 0); /* Orange faded out */
    }
}

.crosshair-cursor {
    cursor: crosshair !important;
}

/* Mobile Tab-Button-Fix */
@media (max-width: 768px) {
    button.tab-button::before {
        display: none !important;
    }
    
    button.tab-button {
        border: none !important;
    }
    
    button.tab-button.active {
        border: none !important;
        position: relative;
    }
    
    button.tab-button.active::after {
        content: "";
        position: absolute;
        bottom: -2px;
        left: 50%;
        transform: translateX(-50%);
        width: 60%;
        height: 2px;
        background-color: var(--primary-color);
    }
}

.settings-title {
    font-weight: bold;
    font-size: 1.2rem;
    margin-bottom: 10px;
    color: var(--primary-color);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 5px;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding: 5px 0;
}

/* Credits Modal Styles */
.credits-section {
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 15px;
}

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

.credits-section h3 {
    color: var(--primary-color);
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.credits-section p {
    margin-bottom: 10px;
    line-height: 1.6;
    text-align: justify;
}

.credits-name {
    font-size: 1.4rem;
    font-weight: bold;
    color: var(--accent-color);
    text-align: center !important;
    margin: 15px 0;
}

#credits-button {
    font-size: 1.2rem;
    background-color: transparent;
    padding: 5px 10px;
}

#credits-button:hover {
    background-color: var(--hover-color);
}

/* Rendering-Optimierungen */
button, .tab-button, .upgrade-button, .category-header, .achievement, .game-actions, .click-button, .resource, .category-toggle {
    /* Hardware-Beschleunigung erzwingen */
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
    will-change: transform, opacity;
}

/* Aggressive Mobile-Optimierungen */
@media (max-width: 768px), (pointer: coarse) {
    /* Radikal vereinfachte Animationen/Effekte für mobil */
    body::before, body::after, .bg-light, .container::before,
    .resource::after, .game-area::before, .game-area::after,
    .click-area::before, .upgrade-button::before, #prestige-button::before,
    footer button::before, .prestige-area::after, .quick-stats::after,
    .situation-report::after, .achievements::after, .click-ripple {
        display: none !important;
    }
    
    /* Elementare Animationen deaktivieren */
    .click-button .emoji, .upgrade-item:hover, .upgrade-item:hover .upgrade-icon,
    .upgrade-item:hover .upgrade-progress-bar, .achievement-popup {
        animation: none !important;
    }
    
    /* Kritische Buttons und interaktive Elemente optimal darstellen */
    button, .tab-button, .upgrade-button, .category-header,
    .achievement, .click-button, .resource {
        transform: translate3d(0, 0, 0);
        -webkit-transform: translate3d(0, 0, 0);
        backface-visibility: hidden;
        -webkit-backface-visibility: hidden;
        transform-style: flat;
        -webkit-transform-style: flat;
        will-change: transform;
        transition: none !important;
    }
    
    /* Tatsächliche Klick-Interaktionen vereinfachen */
    button:active, .tab-button:active, .upgrade-button:active {
        transform: none !important;
    }
    
    /* Scrolling optimieren */
    /* .tab-content, main, .upgrade-items, .category-achievements { -- Entfernt contain, da es Höhenprobleme verursachen könnte */
    main, .upgrade-items, .category-achievements {
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: none; /* Verhindert Overscroll-Effekte */
        scroll-behavior: auto;
        contain: layout style; /* Behält contain für Performance, aber nicht 'content' */
    }
    
    /* Inaktive Elemente vollständig aus dem Rendering-Prozess entfernen (Tabs) */
    .tab-content:not(.active) {
        display: none !important; /* Einfacheres Verstecken statt komplexer Regeln */
        /* position: absolute; */ /* Entfernt, könnte Probleme verursachen */
        /* visibility: hidden; */
        /* pointer-events: none; */
        /* height: 0; */
        /* width: 0; */
        /* overflow: hidden; */
        /* contain: strict; */
        /* opacity: 0; */
    }
    
    /* Korrektur für Achievement-Dropdowns: Einfacheres Ausblenden */
    .category-content:not(.open) {
        max-height: 0 !important;
        opacity: 0 !important;
        overflow: hidden !important;
        /* Entferne andere potentiell problematische Stile */
        /* visibility: hidden; */
        /* contain: strict; */
        transition: max-height 0.3s ease-out, opacity 0.2s ease-out !important;
    }

    /* Korrektur für Achievement-Dropdowns: Korrektes Anzeigen */
    .category-content.open {
        max-height: 2000px !important; /* Genug Höhe */
        opacity: 1 !important;
        overflow: visible !important;
        transition: max-height 0.4s ease-in, opacity 0.3s ease-in !important;
        /* Stelle sicher, dass keine hinderlichen 'contain' Regeln angewendet werden */
        contain: none !important; 
    }
    
    /* Alle text-shadow und box-shadow reduzieren/entfernen */
    * {
        text-shadow: none !important;
    }
    
    .resource, .category-header, .upgrade-item, .achievement, button {
        box-shadow: none !important;
    }
    
    /* Statische Hintergründe für Container */
    .container, .game-area, .tab-content, main {
        background-attachment: initial !important;
    }
    
    /* Force-Rasterize für wichtige Container */
    .container, main, .game-area, .tab-content.active {
        transform: translateZ(0);
        backface-visibility: hidden;
    }
    
    /* Korrektur für Game-Area Höhe */
    .game-area {
        height: auto !important;
        min-height: fit-content !important; /* Passt sich dem Inhalt an */
        contain: none !important; /* Entfernt contain von game-area */
    }
    
    .tab-content.active {
         contain: layout style !important; /* Erlaubt Größenanpassung durch Inhalt */
         overflow: visible !important; /* Verhindert Abschneiden */
         height: auto !important;
    }
    
    .upgrade-items {
        transform: translateZ(0);
        contain: layout style !important; /* Behält contain für Performance, aber nicht 'size' oder 'content' */
        height: auto !important; /* Stellt sicher, dass die Höhe nicht beschränkt wird */
    }
}

/* Touch-Optimierungen erweitern */
@media (pointer: coarse) {
    .click-area {
        padding: 40px 20px;
    }
    
    button, button.tab-button, .upgrade-button {
        min-height: 44px;
        /* Touch-Target-Größe verbessern */
        touch-action: manipulation;
    }
    
    .upgrade-item {
        padding: 12px;
        /* contain: layout style; -- Wird jetzt im aggressiven Block gehandhabt */
    }
    
    /* Scrolling-Performance verbessern */
    /* .tab-content, .category-achievements, .upgrade-items { -- Wird jetzt im aggressiven Block gehandhabt */
        /* -webkit-overflow-scrolling: touch; */
        /* contain: content; */
    /* } */
    
    /* Rendering-Layer für unsichtbare Elemente deaktivieren */
    /* .tab-content:not(.active), .category-content:not(.open) { -- Wird jetzt im aggressiven Block gehandhabt */
        /* visibility: hidden; */
        /* contain: strict; */
        /* will-change: auto; */
    /* } */
    
    /* Rendering-Layer für sichtbare Elemente aktivieren */
    /* .tab-content.active, .category-content.open { -- Wird jetzt im aggressiven Block gehandhabt */
        /* visibility: visible; */
        /* contain: content; */
        /* will-change: transform, opacity; */
    /* } */
    
    /* Reduzieren von Style-Recalculation und Layout-Thrashing */
    /* .tabs, .upgrade-items, .category-achievements { -- Wird jetzt im aggressiven Block gehandhabt */
        /* contain: layout style; */
    /* } */
}

/* Animations und Übergänge */
.animated {
    transition-property: transform, opacity, background-color;
    transition-duration: var(--animation-speed);
}

.fadeIn {
    animation: fadeIn 0.5s forwards;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.shake {
    animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) both;
}

@keyframes shake {
    10%, 90% { transform: translate3d(-1px, 0, 0); }
    20%, 80% { transform: translate3d(2px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
    40%, 60% { transform: translate3d(4px, 0, 0); }
}

/* Zusätzliche Stilanpassungen für Accessibility */
button:focus, input:focus, select:focus {
    outline: 2px solid var(--secondary-color);
    outline-offset: 2px;
}

/* Spielspezifische Animationen */
.click-ripple {
    position: absolute;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.7);
    transform: scale(0);
    animation: ripple 0.6s linear;
    pointer-events: none;
}

@keyframes ripple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

@keyframes progress-pulse {
    0% { box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(40, 167, 69, 0); }
    100% { box-shadow: 0 0 0 0 rgba(40, 167, 69, 0); }
}

.production-complete {
    animation: item-produced 0.3s ease-out;
    isolation: isolate;
}

@keyframes item-produced {
    0% { background-color: var(--card-bg); }
    50% { background-color: rgba(40, 167, 69, 0.1); }
    100% { background-color: var(--card-bg); }
}

/* Achievement-Popup (mittig im Bildschirm) */
.achievement-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    background: linear-gradient(to bottom, #1e2a3a, #12171f);
    border: 2px solid #ffcc00;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(255, 204, 0, 0.5);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    max-width: 400px;
    z-index: 1000;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
}

.achievement-popup.show {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

.achievement-popup-icon {
    font-size: 40px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 0 10px rgba(255, 204, 0, 0.3);
}

.achievement-popup-content {
    flex: 1;
}

.achievement-popup-title {
    font-size: 18px;
    font-weight: bold;
    color: #ffcc00;
    margin-bottom: 5px;
}

.achievement-popup-name {
    font-size: 16px;
    font-weight: bold;
    color: #fff;
    margin-bottom: 5px;
}

.achievement-popup-desc {
    font-size: 14px;
    color: #ddd;
    font-style: italic;
}

.button-group {
    display: flex;
    gap: 5px;
    margin-top: 3px; /* Reduziert von 5px */
}

/* Responsive Anpassungen */
@media (max-width: 768px) {
    .button-group {
        flex-direction: column;
    }
}

/* Helles Theme hinzufügen */
.light-theme {
    --primary-color: #2a4b8d;
    --secondary-color: #3498db;
    --accent-color: #ff9500;
    --success-color: #27ae60;
    --warning-color: #e67e22;
    --error-color: #e74c3c;
    --text-color: #333333;
    --secondary-text: #666666;
    --bg-color: #f5f5f5;
    --card-bg: rgba(255, 255, 255, 0.9);
    --border-color: rgba(0, 0, 0, 0.1);
    --box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    --disabled-color: #bbbbbb;
}

@keyframes float {
    0% { transform: translate(0, 0); }
    50% { transform: translate(15px, -15px); }
    100% { transform: translate(0, 0); }
}

/* @keyframes glow - ENTFERNT
    0% { box-shadow: 0 0 5px rgba(var(--accent-color-rgb), 0.3); }
    50% { box-shadow: 0 0 20px rgba(var(--accent-color-rgb), 0.5); }
    100% { box-shadow: 0 0 5px rgba(var(--accent-color-rgb), 0.3); }
*/

/* @keyframes shimmer - ENTFERNT
    0% { transform: translateX(-100%) rotate(45deg); }
    100% { transform: translateX(100%) rotate(45deg); }
*/

.prestige-area, .quick-stats, .situation-report, .achievements {
    /* animation: glow 8s infinite; - ENTFERNT */
    position: relative;
    overflow: hidden;
}

.prestige-area::after, .quick-stats::after, .situation-report::after, .achievements::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        to bottom right,
        transparent 0%,
        transparent 40%,
        rgba(var(--accent-color-rgb), 0.1) 50%,
        transparent 60%,
        transparent 100%
    );
    transform: rotate(45deg);
    /* animation: shimmer 10s infinite linear; - ENTFERNT */
    z-index: 1;
    pointer-events: none;
    /* Mache den Effekt statisch, wenn keine Animation läuft */
    opacity: 0.1; 
    display: none; /* Ganz ausblenden für Performance */
}

/* Hintergrundpartikel */
.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background-color: rgba(var(--accent-color-rgb), 0.2);
    border-radius: 50%;
    animation: particle-float 60s infinite linear;
}

@keyframes particle-float {
    0% {
        transform: translate(0, 0) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 0.8;
    }
    90% {
        opacity: 0.8;
    }
    100% {
        transform: translate(var(--x, 100px), var(--y, 100px)) rotate(360deg);
        opacity: 0;
    }
}

/* Glitch-Effekt für Titel */
@keyframes glitch {
    0% {
        text-shadow: 0 0 10px rgba(var(--primary-color-rgb), 0.5), 0 0 20px rgba(var(--primary-color-rgb), 0.3);
        transform: skewX(0);
    }
    2% {
        text-shadow: -3px 0 rgba(255, 0, 0, 0.7), 3px 0 rgba(0, 255, 255, 0.7);
        transform: skewX(3deg);
    }
    4% {
        text-shadow: 3px 0 rgba(255, 0, 0, 0.7), -3px 0 rgba(0, 255, 255, 0.7);
        transform: skewX(-3deg);
    }
    5% {
        text-shadow: 0 0 10px rgba(var(--primary-color-rgb), 0.5), 0 0 20px rgba(var(--primary-color-rgb), 0.3);
        transform: skewX(0);
    }
    80% {
        text-shadow: 0 0 10px rgba(var(--primary-color-rgb), 0.5), 0 0 20px rgba(var(--primary-color-rgb), 0.3);
        transform: skewX(0);
    }
    82% {
        text-shadow: -3px 0 rgba(255, 0, 0, 0.7), 3px 0 rgba(0, 255, 255, 0.7);
        transform: skewX(3deg);
    }
    84% {
        text-shadow: 3px 0 rgba(255, 0, 0, 0.7), -3px 0 rgba(0, 255, 255, 0.7);
        transform: skewX(-3deg);
    }
    86% {
        text-shadow: 0 0 10px rgba(var(--primary-color-rgb), 0.5), 0 0 20px rgba(var(--primary-color-rgb), 0.3);
        transform: skewX(0);
    }
    100% {
        text-shadow: 0 0 10px rgba(var(--primary-color-rgb), 0.5), 0 0 20px rgba(var(--primary-color-rgb), 0.3);
        transform: skewX(0);
    }
}

/* Verbesserte Click-Area */
.click-area:active::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: rgba(var(--accent-color-rgb), 0.5);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: explosion 0.5s ease-out forwards;
}

@keyframes explosion {
    0% {
        width: 5px;
        height: 5px;
        opacity: 1;
    }
    100% {
        width: 300px;
        height: 300px;
        opacity: 0;
    }
}

.click-explosion {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    z-index: 100;
    mix-blend-mode: screen;
    transform: translate(-50%, -50%);
    animation: explosion-anim 0.6s ease-out forwards;
    box-shadow: 0 0 20px currentColor;
}

@keyframes explosion-anim {
    0% {
        width: 5px;
        height: 5px;
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    100% {
        width: 5px;
        height: 5px;
        opacity: 0;
        transform: translate(-50%, -50%) scale(60);
    }
}

button {
    position: relative;
    overflow: hidden;
}

/* Sticky Resources Bar */
.sticky-resources {
    position: sticky;
    top: 0;
    width: 100%;
    background-color: var(--primary-color);
    padding: 10px 0;
    z-index: 100;
    border-bottom: 2px solid var(--accent-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    display: flex;
    justify-content: center;
    gap: 20px;
    transition: background-color var(--animation-speed), transform 0.3s;
    margin-bottom: 25px;
}

.sticky-resources .resource {
    margin: 0;
    padding: 8px 15px;
    font-size: 1rem;
    opacity: 0.95;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    color: var(--light-text);
}

.sticky-resources .resource:hover {
    transform: none;
    opacity: 1;
}

@media (max-width: 768px) {
    .sticky-resources {
        flex-direction: column;
        gap: 5px;
        padding: 5px 0;
        align-items: center;
    }
    
    .sticky-resources .resource {
        width: 90%;
        padding: 5px 10px;
        font-size: 0.9rem;
        text-align: center;
    }
}

/* Defence Lottery Styles */
.defence-lottery {
    background-color: var(--card-bg);
    padding: 15px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    margin-bottom: 20px;
    border: 1px solid var(--accent-color);
    position: relative;
    overflow: hidden;
    animation: glow 8s infinite;
}

.defence-lottery h2 {
    margin-top: 0;
    font-size: 1.1rem;
    color: var(--accent-color);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 5px;
    margin-bottom: 10px;
    text-align: left;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 8px;
}

.defence-lottery h2::before {
    content: "🎮";
    font-size: 1rem;
}

.lottery-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    position: relative;
}

.lottery-display {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 10px;
}

.lottery-slot {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #1a2634 0%, #2a3a4a 100%);
    border: 2px solid #4a5a6a;
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 28px;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    position: relative;
    transition: all 0.3s ease;
}

.lottery-slot::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.1) 0%,
        rgba(255, 255, 255, 0) 50%,
        rgba(255, 255, 255, 0.1) 100%);
    pointer-events: none;
    z-index: 1;
}

.lottery-slot.spinning {
    animation: slot-spin 0.1s linear infinite;
    background: linear-gradient(135deg, #243752 0%, #3a4a5a 100%);
    box-shadow: 
        inset 0 0 15px rgba(0, 0, 0, 0.7),
        0 0 10px rgba(255, 215, 0, 0.3);
    border-color: #5a6a7a;
}

@keyframes slot-spin {
    0% { transform: translateY(-5px); }
    50% { transform: translateY(0); }
    100% { transform: translateY(5px); }
}

.lottery-info {
    width: 100%;
    text-align: center;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.lottery-text {
    color: #ddd;
    font-size: 0.9rem;
}

.lottery-bet-options {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 10px 0;
}

.bet-option {
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 4px;
    background-color: rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
}

.bet-option:hover {
    background-color: rgba(60, 100, 150, 0.3);
}

.bet-option input[type="radio"] {
    margin: 0;
    cursor: pointer;
}

.bet-option input[type="radio"]:checked + .bet-label {
    color: var(--accent-color);
    font-weight: bold;
}

.bet-label {
    color: #ddd;
    font-size: 0.85rem;
    user-select: none;
}

.lottery-funds {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
}

.lottery-result {
    color: #ddd;
    font-weight: bold;
    min-height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s ease;
    padding: 0 8px;
    background-color: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    margin: 5px 0;
}

.lottery-result.win {
    color: #00ff00;
    text-shadow: 0 0 5px rgba(0, 255, 0, 0.5);
}

.lottery-result.lose {
    color: #ff5555;
    text-shadow: 0 0 5px rgba(255, 85, 85, 0.5);
}

.lottery-cooldown {
    color: var(--secondary-text);
    font-size: 0.85rem;
    margin-top: 5px;
    padding: 4px 8px;
    background-color: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    display: none;
    font-weight: bold;
    text-align: center;
}

.lottery-paytable {
    margin: 8px 0;
    margin-top: -10px;
    background-color: rgba(0, 0, 0, 0.15);
    border-radius: 4px;
    padding: 6px;
    border: 1px solid rgba(var(--accent-color-rgb), 0.2);
}

.lottery-paytable h4 {
    color: var(--accent-color);
    font-size: 0.85rem;
    margin: 0 0 4px 0;
    text-align: center;
    font-weight: bold;
    border-bottom: 1px solid rgba(var(--accent-color-rgb), 0.2);
    padding-bottom: 4px;
}

.paytable-entries {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
}

.paytable-entry {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: rgba(0, 0, 0, 0.1);
    border-radius: 3px;
    padding: 2px 4px;
    font-size: 0.75rem;
}

.paytable-icon {
    color: #ddd;
    white-space: nowrap;
}

.paytable-win {
    font-weight: bold;
    color: var(--accent-color);
    margin-left: 4px;
}

@media (max-width: 340px) {
    .paytable-entries {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .paytable-entry {
        font-size: 0.7rem;
    }
}

.lottery-button {
    background: linear-gradient(to bottom, #3a546a 0%, #2a3a4a 100%);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 8px 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
}

.lottery-button:hover {
    background: linear-gradient(to bottom, #4a6480 0%, #3a546a 100%);
}

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

.defence-lottery::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        to bottom right,
        transparent 0%,
        transparent 40%,
        rgba(var(--accent-color-rgb), 0.1) 50%,
        transparent 60%,
        transparent 100%
    );
    transform: rotate(45deg);
    animation: shimmer 10s infinite linear;
    z-index: 1;
    pointer-events: none;
}

.lottery-label {
    color: #aaa;
}

.lottery-value {
    color: #ffcc00;
}

/* Versorgungszentrum Styles */
.supply-center {
    background-color: var(--card-bg);
    padding: 15px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    margin-bottom: 20px;
    border: 1px solid var(--accent-color);
    position: relative;
    overflow: hidden;
    animation: glow 8s infinite;
}

.supply-center h2 {
    font-size: 1.1rem;
    margin-bottom: 15px;
    color: var(--accent-color);
    text-align: left;
    display: flex;
    align-items: center;
    gap: 8px;
}

.supply-center h2::before {
    content: "🛠️";
    font-size: 1rem;
}

.supply-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.supply-item {
    background-color: rgba(0, 0, 0, 0.1);
    border-radius: var(--border-radius);
    padding: 12px;
    display: grid;
    grid-template-areas:
        "icon info info"
        "icon info info"
        "cooldown cooldown button";
    grid-template-columns: auto 1fr auto;
    grid-template-rows: auto 1fr auto;
    gap: 10px;
    transition: background-color 0.2s, transform 0.2s;
    position: relative;
    overflow: hidden;
    min-height: 120px;
}

.supply-icon {
    grid-area: icon;
    font-size: 1.8rem;
    padding: 10px;
    background-color: rgba(var(--accent-color-rgb), 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s;
    align-self: start;
}

.supply-info {
    grid-area: info;
    padding: 0 10px;
}

.supply-cooldown {
    grid-area: cooldown;
    padding: 5px 10px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: bold;
    background-color: rgba(0, 255, 0, 0.1);
    color: #2ecc71;
    align-self: end;
    justify-self: start;
}

.supply-button {
    grid-area: button;
    padding: 8px 15px;
    background-color: var(--accent-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.2s, transform 0.1s;
    align-self: end;
    justify-self: end;
}

@media (max-width: 768px) {
    .supply-item {
        grid-template-areas:
            "icon"
            "info"
            "cooldown"
            "button";
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto auto;
        text-align: center;
    }
    
    .supply-icon {
        justify-self: center;
    }
    
    .supply-info {
        width: 100%;
        text-align: center;
        padding: 5px 0;
    }
    
    .supply-cooldown {
        width: 100%;
        text-align: center;
        justify-self: center;
    }
    
    .supply-button {
        width: 100%;
        text-align: center;
        justify-self: center;
    }
}

.supply-item:hover {
    background-color: rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.supply-item:hover .supply-icon {
    transform: scale(1.1);
}

.supply-name {
    font-weight: bold;
    color: var(--accent-color);
    margin-bottom: 5px;
}

.supply-effect {
    font-size: 0.9rem;
    margin-bottom: 4px;
    color: var(--primary-text);
}

.supply-description {
    font-size: 0.85rem;
    font-style: italic;
    color: var(--secondary-text);
}

.supply-cooldown.active {
    background-color: rgba(255, 0, 0, 0.1);
    color: #e74c3c;
}

.supply-button:hover:not(:disabled) {
    background-color: var(--accent-hover);
    transform: translateY(-2px);
}

.supply-button:active:not(:disabled) {
    transform: translateY(0px);
}

.supply-button:disabled {
    background-color: #888;
    cursor: not-allowed;
    opacity: 0.7;
}

.supply-center::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        to bottom right,
        transparent 0%,
        transparent 40%,
        rgba(var(--accent-color-rgb), 0.1) 50%,
        transparent 60%,
        transparent 100%
    );
    transform: rotate(45deg);
    animation: shimmer 10s infinite linear;
    z-index: 1;
    pointer-events: none;
}

@keyframes boost-active {
    0% { box-shadow: 0 0 0 0 rgba(var(--accent-color-rgb), 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(var(--accent-color-rgb), 0); }
    100% { box-shadow: 0 0 0 0 rgba(var(--accent-color-rgb), 0); }
}

.boost-active {
    animation: boost-active 2s infinite;
}

@media (max-width: 768px) {
    .supply-item {
        flex-direction: column;
        text-align: center;
    }
    
    .supply-info {
        width: 100%;
        text-align: center;
        padding: 5px 0;
    }
    
    .supply-button, .supply-cooldown {
        width: 100%;
        text-align: center;
    }
}

/* Styling für Multiplikatoren zur besseren Lesbarkeit */
[id$="-multiplier"] {
    font-size: 0.85rem;
    color: #ffa726;
    background-color: rgba(255, 167, 38, 0.1);
    border-radius: 4px;
    padding: 3px 5px;
    margin-top: 2px;
    margin-bottom: 5px;
    line-height: 1.3;
}

/* Styling für Zeilenumbrüche innerhalb der Multiplikatoren */
[id$="-multiplier"] br {
    line-height: 1.6;
}

/* Tab-Inhalte */
.tab-content h2 {
    margin-top: 0;
    flex-shrink: 0; /* Verhindert das Schrumpfen des Titels */
}

/* Offline Progression Popup */
.offline-progress-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    /* Überarbeiteter Hintergrund, der auf --bg-color basiert statt auf den primären Farben */
    background: var(--card-bg);
    border: 2px solid var(--accent-color);
    border-radius: 10px;
    box-shadow: 0 0 30px rgba(var(--accent-color-rgb), 0.6);
    padding: 20px;
    width: 90%;
    max-width: 450px;
    z-index: 1000;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
    /* Zusätzlicher Schatteneffekt für bessere Lesbarkeit */
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.4);
}

.offline-progress-popup.show {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    pointer-events: auto;
}

.offline-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    border-bottom: 1px solid rgba(var(--accent-color-rgb), 0.3);
    padding-bottom: 10px;
}

.offline-popup-header h3 {
    margin: 0;
    color: var(--accent-color);
    font-size: 1.4rem;
    /* Textschatten für bessere Lesbarkeit in allen Themes */
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.close-offline-popup {
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-color);
    transition: color 0.2s;
}

.close-offline-popup:hover {
    color: var(--accent-color);
}

.offline-popup-content {
    margin-bottom: 20px;
    /* Verbesserte Textlesbarkeit */
    color: var(--text-color);
}

.offline-popup-content p {
    margin: 10px 0;
    line-height: 1.4;
}

.offline-earnings {
    font-size: 1.2rem;
    font-weight: bold;
    text-align: center;
    margin: 15px 0;
    color: var(--text-color);
}

.offline-earnings span {
    color: var(--accent-color);
    font-size: 1.4rem;
    /* Textschatten für bessere Hervorhebung */
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.offline-note {
    font-size: 0.9rem;
    /* Verbesserte Lesbarkeit für sekundären Text */
    color: var(--secondary-text);
    font-style: italic;
    text-align: center;
}

/* Neue Stile für die Zeitbegrenzungshinweise */
.offline-cap-note {
    margin-top: 15px;
    padding: 8px 12px;
    /* Angepasste Hintergrundfarbe für Warnhinweis */
    background-color: rgba(var(--warning-color-rgb), 0.2);
    border-left: 3px solid var(--warning-color);
    font-size: 0.9rem;
    border-radius: 3px;
    text-align: left;
    /* Verbesserte Lesbarkeit für Warnungstext */
    color: var(--text-color);
}

.offline-actual-time {
    font-size: 0.85rem;
    /* Verbesserte Lesbarkeit für sekundären Text */
    color: var(--secondary-text);
    margin-top: 5px;
    text-align: left;
    padding-left: 12px;
}

.offline-popup-button {
    display: block;
    width: 100%;
    padding: 12px;
    background-color: var(--accent-color);
    /* Verbesserte Lesbarkeit für Button-Text */
    color: #000; /* Schwarzer Text für alle Accent-Farben für besseren Kontrast */
    border: none;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    font-size: 1.1rem;
}

.offline-popup-button:hover {
    background-color: rgba(var(--accent-color-rgb), 0.8);
    transform: translateY(-2px);
}

.offline-popup-button:active {
    transform: translateY(0);
}

/* Flugabwehrsystem */
.air-defence-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    overflow: hidden;
}

.enemy-aircraft {
    position: absolute;
    width: 60px;
    height: 60px;
    background-image: url('graphics/spyjet.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    pointer-events: auto;
    cursor: crosshair;
    filter: drop-shadow(2px 2px 2px rgba(0, 0, 0, 0.5));
    user-select: none;
    transform-origin: center;
    z-index: 10000;
    /* position: relative; <-- Nicht unbedingt nötig, da absolute bereits Kontext schafft */
}

/* NEU: Schweif-Effekt */
.enemy-aircraft::after {
    content: '';
    position: absolute;
    bottom: -25px; /* Positioniert den Start des Schweifs unterhalb des Flugzeugs */
    left: 50%;
    transform: translateX(-50%);
    width: 15px; /* Breite des Schweifs */
    height: 40px; /* Länge des Schweifs */
    background: radial-gradient(ellipse at top, 
        rgba(255, 220, 150, 0.9) 0%, /* Helles Orange/Gelb oben */
        rgba(255, 165, 0, 0.5) 50%,  /* Orange in der Mitte */
        transparent 75%             /* Transparent am Ende */
    );
    border-radius: 50% / 40%; /* Elliptische Form */
    opacity: 0.8;
    filter: blur(4px); /* Weicher Rand */
    animation: trail-flicker 0.15s infinite alternate;
    pointer-events: none; /* Verhindert Klicks auf den Schweif */
}

@keyframes trail-flicker {
    from {
        opacity: 0.7;
        transform: translateX(-50%) scaleY(0.95);
    }
    to {
        opacity: 0.9;
        transform: translateX(-50%) scaleY(1.05);
    }
}

/* Entfernte Regel für ::before */

.enemy-aircraft.right-to-left::before {
    transform: scaleX(-1);
}

.enemy-aircraft.shot-down {
    animation: explode 0.5s forwards;
    pointer-events: none;
    /* Hintergrundbild schnell ausblenden, damit Partikel dominieren */
    background-image: none !important; 
    /* Optional: Rand hinzufügen, der explodiert */
    /* border: 2px solid rgba(255, 165, 0, 0.8); */
    border-radius: 50%; /* Macht es rund während der Explosion */
}

/* Versteckt den Schweif, wenn das Flugzeug abgeschossen wird */
.enemy-aircraft.shot-down::after {
    display: none;
}

.reward-popup {
    position: absolute;
    color: var(--success-color);
    font-weight: bold;
    font-size: 1.2rem;
    animation: flyUp 1.5s forwards;
    z-index: 10001;
    text-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
    pointer-events: none;
}

@keyframes explode {
    0% {
        transform: scale(1) rotate(var(--current-rotation, 0deg));
        opacity: 1;
        filter: blur(0px);
        box-shadow: 
            0 0 0px rgba(255, 220, 150, 0.8), /* Initial no shadow */
            0 0 0px rgba(255, 165, 0, 0.6);
    }
    50% {
        transform: scale(1.2) rotate(var(--current-rotation, 0deg));
        opacity: 0.8;
        filter: blur(1px);
        box-shadow: 
            0 0 15px 5px rgba(255, 220, 150, 0.7), /* Start spreading yellow */
            0 0 25px 10px rgba(255, 165, 0, 0.5); /* Start spreading orange */
    }
    100% {
        transform: scale(0.8) rotate(var(--current-rotation, 0deg)); /* Shrink the core */
        opacity: 0;
        filter: blur(5px); /* More blur at the end */
        box-shadow: 
            0 0 30px 20px rgba(255, 220, 150, 0), /* Yellow faded out */
            0 0 50px 35px rgba(255, 165, 0, 0); /* Orange faded out */
    }
}

.crosshair-cursor {
    cursor: crosshair !important;
}

/* Mobile Tab-Button-Fix */
@media (max-width: 768px) {
    button.tab-button::before {
        display: none !important;
    }
    
    button.tab-button {
        border: none !important;
    }
    
    button.tab-button.active {
        border: none !important;
        position: relative;
    }
    
    button.tab-button.active::after {
        content: "";
        position: absolute;
        bottom: -2px;
        left: 50%;
        transform: translateX(-50%);
        width: 60%;
        height: 2px;
        background-color: var(--primary-color);
    }
}

.settings-title {
    font-weight: bold;
    font-size: 1.2rem;
    margin-bottom: 10px;
    color: var(--primary-color);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 5px;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding: 5px 0;
}

/* Credits Modal Styles */
.credits-section {
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 15px;
}

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

.credits-section h3 {
    color: var(--primary-color);
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.credits-section p {
    margin-bottom: 10px;
    line-height: 1.6;
    text-align: justify;
}

.credits-name {
    font-size: 1.4rem;
    font-weight: bold;
    color: var(--accent-color);
    text-align: center !important;
    margin: 15px 0;
}

#credits-button {
    font-size: 1.2rem;
    background-color: transparent;
    padding: 5px 10px;
}

#credits-button:hover {
    background-color: var(--hover-color);
}

/* Rendering-Optimierungen */
button, .tab-button, .upgrade-button, .category-header, .achievement, .game-actions, .click-button, .resource, .category-toggle {
    /* Hardware-Beschleunigung erzwingen */
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
    will-change: transform, opacity;
}

/* Aggressive Mobile-Optimierungen */
@media (max-width: 768px), (pointer: coarse) {
    /* Radikal vereinfachte Animationen/Effekte für mobil */
    body::before, body::after, .bg-light, .container::before,
    .resource::after, .game-area::before, .game-area::after,
    .click-area::before, .upgrade-button::before, #prestige-button::before,
    footer button::before, .prestige-area::after, .quick-stats::after,
    .situation-report::after, .achievements::after, .click-ripple {
        display: none !important;
    }
    
    /* Elementare Animationen deaktivieren */
    .click-button .emoji, .upgrade-item:hover, .upgrade-item:hover .upgrade-icon,
    .upgrade-item:hover .upgrade-progress-bar, .achievement-popup {
        animation: none !important;
    }
    
    /* Kritische Buttons und interaktive Elemente optimal darstellen */
    button, .tab-button, .upgrade-button, .category-header,
    .achievement, .click-button, .resource {
        transform: translate3d(0, 0, 0);
        -webkit-transform: translate3d(0, 0, 0);
        backface-visibility: hidden;
        -webkit-backface-visibility: hidden;
        transform-style: flat;
        -webkit-transform-style: flat;
        will-change: transform;
        transition: none !important;
    }
    
    /* Tatsächliche Klick-Interaktionen vereinfachen */
    button:active, .tab-button:active, .upgrade-button:active {
        transform: none !important;
    }
    
    /* Scrolling optimieren */
    /* .tab-content, main, .upgrade-items, .category-achievements { -- Entfernt contain, da es Höhenprobleme verursachen könnte */
    main, .upgrade-items, .category-achievements {
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: none; /* Verhindert Overscroll-Effekte */
        scroll-behavior: auto;
        contain: layout style; /* Behält contain für Performance, aber nicht 'content' */
    }
    
    /* Inaktive Elemente vollständig aus dem Rendering-Prozess entfernen (Tabs) */
    .tab-content:not(.active) {
        display: none !important; /* Einfacheres Verstecken statt komplexer Regeln */
        /* position: absolute; */ /* Entfernt, könnte Probleme verursachen */
        /* visibility: hidden; */
        /* pointer-events: none; */
        /* height: 0; */
        /* width: 0; */
        /* overflow: hidden; */
        /* contain: strict; */
        /* opacity: 0; */
    }
    
    /* Korrektur für Achievement-Dropdowns: Einfacheres Ausblenden */
    .category-content:not(.open) {
        max-height: 0 !important;
        opacity: 0 !important;
        overflow: hidden !important;
        /* Entferne andere potentiell problematische Stile */
        /* visibility: hidden; */
        /* contain: strict; */
        transition: max-height 0.3s ease-out, opacity 0.2s ease-out !important;
    }

    /* Korrektur für Achievement-Dropdowns: Korrektes Anzeigen */
    .category-content.open {
        max-height: 2000px !important; /* Genug Höhe */
        opacity: 1 !important;
        overflow: visible !important;
        transition: max-height 0.4s ease-in, opacity 0.3s ease-in !important;
        /* Stelle sicher, dass keine hinderlichen 'contain' Regeln angewendet werden */
        contain: none !important; 
    }
    
    /* Alle text-shadow und box-shadow reduzieren/entfernen */
    * {
        text-shadow: none !important;
    }
    
    .resource, .category-header, .upgrade-item, .achievement, button {
        box-shadow: none !important;
    }
    
    /* Statische Hintergründe für Container */
    .container, .game-area, .tab-content, main {
        background-attachment: initial !important;
    }
    
    /* Force-Rasterize für wichtige Container */
    .container, main, .game-area, .tab-content.active {
        transform: translateZ(0);
        backface-visibility: hidden;
    }
    
    /* Korrektur für Game-Area Höhe */
    .game-area {
        height: auto !important;
        min-height: fit-content !important; /* Passt sich dem Inhalt an */
        contain: none !important; /* Entfernt contain von game-area */
    }
    
    .tab-content.active {
         contain: layout style !important; /* Erlaubt Größenanpassung durch Inhalt */
         overflow: visible !important; /* Verhindert Abschneiden */
         height: auto !important;
    }
    
    .upgrade-items {
        transform: translateZ(0);
        contain: layout style !important; /* Behält contain für Performance, aber nicht 'size' oder 'content' */
        height: auto !important; /* Stellt sicher, dass die Höhe nicht beschränkt wird */
    }
}

/* Touch-Optimierungen erweitern */
@media (pointer: coarse) {
    .click-area {
        padding: 40px 20px;
    }
    
    button, button.tab-button, .upgrade-button {
        min-height: 44px;
        /* Touch-Target-Größe verbessern */
        touch-action: manipulation;
    }
    
    .upgrade-item {
        padding: 12px;
        /* contain: layout style; -- Wird jetzt im aggressiven Block gehandhabt */
    }
    
    /* Scrolling-Performance verbessern */
    /* .tab-content, .category-achievements, .upgrade-items { -- Wird jetzt im aggressiven Block gehandhabt */
        /* -webkit-overflow-scrolling: touch; */
        /* contain: content; */
    /* } */
    
    /* Rendering-Layer für unsichtbare Elemente deaktivieren */
    /* .tab-content:not(.active), .category-content:not(.open) { -- Wird jetzt im aggressiven Block gehandhabt */
        /* visibility: hidden; */
        /* contain: strict; */
        /* will-change: auto; */
    /* } */
    
    /* Rendering-Layer für sichtbare Elemente aktivieren */
    /* .tab-content.active, .category-content.open { -- Wird jetzt im aggressiven Block gehandhabt */
        /* visibility: visible; */
        /* contain: content; */
        /* will-change: transform, opacity; */
    /* } */
    
    /* Reduzieren von Style-Recalculation und Layout-Thrashing */
    /* .tabs, .upgrade-items, .category-achievements { -- Wird jetzt im aggressiven Block gehandhabt */
        /* contain: layout style; */
    /* } */
}

/* Zusätzliche Optimierungen für mobile Geräte */
@media (max-width: 768px), (pointer: coarse) {
    /* DOM-Updates reduzieren */
    .click-feedback, .achievement-popup, .reward-popup {
        contain: layout style;
        will-change: auto !important;
    }
    
    /* GPU-Beschleunigung für Scrollcontainer */
    .tab-content.active {
        z-index: 1;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        visibility: visible !important;
        display: block !important; /* Sicherstellen, dass es Block ist */
        /* Höhe und Position werden jetzt im aggressiven Block korrekt gesetzt */
    }
    
    /* Alle Hover-Effekte deaktivieren */
    *:hover {
        /* Entfernt, da es Interaktionen auf Touch-Geräten beeinträchtigen kann */
        /* box-shadow: none !important; */
        /* transform: none !important; */
    }
    
    /* Vereinfachter Rendering-Pfad für Buttons */
    button, .tab-button, .upgrade-button {
        -webkit-tap-highlight-color: rgba(0,0,0,0);
        touch-action: manipulation;
    }
    
    /* Layout-Thrashing vermeiden */
    .upgrade-items > *, .category-achievements > * {
        contain: layout style;
    }
    
    /* Performance-kritische Elemente */
    .upgrade-progress-bar, .achievement-icon, .upgrade-icon {
        will-change: auto !important;
    }
    
    /* Unbedingt sicherstellen, dass aktive Tabs immer sichtbar sind */
    /* .tab-content.active { -- Wird jetzt im aggressiven Block gehandhabt */
        /* position: static !important; */
        /* height: auto !important; */
        /* width: auto !important; */
        /* overflow: visible !important; */
        /* opacity: 1 !important; */
    /* } */
    
    /* Alle aktiven Elemente müssen zuverlässig dargestellt werden */
    .upgrade-button, .category-header, .tab-button, 
    .achievement, .resource, .click-button {
        opacity: 1 !important; /* Sorgt für Sichtbarkeit */
        visibility: visible !important;
    }
}

/* Mobile Game Actions - standardmäßig versteckt */
.mobile-game-actions {
    display: none;
    justify-content: center;
    gap: 10px;
    margin: 15px 0 5px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(var(--accent-color-rgb), 0.3);
    flex-wrap: wrap;
    width: 100%;
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.mobile-game-actions button {
    padding: 10px 15px;
    border-radius: var(--border-radius);
    background-color: var(--primary-color);
    color: var(--light-text);
    border: none;
    font-weight: bold;
    cursor: pointer;
    transition: background-color var(--animation-speed);
    flex: 1;
    min-width: 65px;
    max-width: 120px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.mobile-game-actions button:hover {
    background-color: var(--accent-color);
}

/* Hover-Effekte für mobile Buttons deaktivieren */
.mobile-game-actions button::before {
    display: none !important; /* Entfernt leuchtenden Hover-Effekt */
}

.mobile-game-actions button:hover,
.mobile-game-actions button:active {
    transform: none !important; /* Verhindert Drehungen und andere Transformationen */
    box-shadow: none !important;
}

#mobile-settings-button, #mobile-credits-button {
    font-size: 1.2rem;
}

/* Mobile Ansicht Anpassungen */
@media (max-width: 768px) {
    /* Original Game Actions ausblenden */
    .game-actions {
        display: none !important;
    }
    
    /* Mobile Game Actions einblenden */
    .mobile-game-actions {
        display: flex;
    }
    
    /* Anpassung für den Abstand zwischen Header und Sticky Resources */
    header {
        margin-bottom: 0;
    }
    
    /* Sticky Resources mit etwas Abstand */
    .sticky-resources {
        margin-top: 10px;
    }
}

/* Reset-Bestätigungsmodal */
.reset-warning {
    color: #e74c3c;
    font-weight: bold;
    font-size: 1.1rem;
    margin-bottom: 15px;
    padding: 10px;
    background-color: rgba(231, 76, 60, 0.1);
    border-radius: 4px;
    border-left: 4px solid #e74c3c;
}

.reset-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 25px;
    gap: 15px;
}

.reset-button {
    padding: 10px 20px;
    border-radius: var(--border-radius);
    font-weight: bold;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    flex: 1;
}

.reset-button.cancel {
    background-color: #7f8c8d;
    color: white;
}

.reset-button.cancel:hover {
    background-color: #95a5a6;
}

.reset-button.confirm {
    background-color: #e74c3c;
    color: white;
}

.reset-button.confirm:hover {
    background-color: #c0392b;
}
  