
html, body {
    width: 100%;
    height: 100%;
    margin: 0;
    overflow: hidden;
    background: #0b1220;
    font-family: monospace;
    user-select: none;
    touch-action: none;
}

#gameCanvas {
    position: absolute;
    left: 0;
    top: 0;
    image-rendering: auto;
    background: transparent;
    border: none;
    outline: none;
/* Canvas immer unter Menüs + blockiert keine Mausklicks, solange ein Menü offen ist */
#gameCanvas { z-index: 1; }

#mainMenu,
#mainMenuSettings,
#mainMenuShop,
#settingsMenu {
  position: fixed;
  z-index: 1000;
}

/* Wenn ein Menü sichtbar ist, soll der Canvas keine Klicks fressen */
.menu-open #gameCanvas { pointer-events: none; }

}

/* Main Menu Styles */
#mainMenu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0b1220, #1e293b);
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-family: monospace;
}

.menu-title {
    font-size: 72px;
    font-weight: bold;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #22c55e, #60a5fa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-align: center;
    text-shadow: 0 0 30px rgba(34, 197, 94, 0.5);
}

.menu-subtitle {
    font-size: 24px;
    color: #cbd5e1;
    margin-bottom: 50px;
    text-align: center;
}

.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
}

.menu-button {
    background: linear-gradient(135deg, #2563eb, #1e40af);
    color: #fff;
    border: 2px solid #3b82f6;
    border-radius: 15px;
    padding: 15px 40px;
    font-size: 24px;
    font-family: monospace;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 250px;
    text-align: center;
    box-shadow: 0 8px 25px rgba(37, 99, 235, 0.3);
}

.menu-button:hover {
    background: linear-gradient(135deg, #1d4ed8, #1e3a8a);
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(37, 99, 235, 0.4);
}

.menu-button.secondary {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    border-color: #fbbf24;
    box-shadow: 0 8px 25px rgba(251, 191, 36, 0.3);
}

.menu-button.secondary:hover {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    box-shadow: 0 12px 35px rgba(251, 191, 36, 0.4);
}

.menu-button.tertiary {
    background: linear-gradient(135deg, #7c3aed, #5b21b6);
    border-color: #8b5cf6;
    box-shadow: 0 8px 25px rgba(124, 58, 237, 0.3);
}

.menu-button.tertiary:hover {
    background: linear-gradient(135deg, #6d28d9, #4c1d95);
    box-shadow: 0 12px 35px rgba(124, 58, 237, 0.4);
}

.stats-display {
    position: absolute;
    top: 30px;
    right: 30px;
    text-align: right;
    font-size: 18px;
    color: #ffd700;
}

.coins-display-menu {
    position: absolute;
    top: 30px;
    left: 30px;
    font-size: 24px;
    color: #fbbf24;
    font-weight: bold;
}

/* In-Game Settings Menu (nur ESC) */
#settingsMenu {
    display: none;
    position: fixed;
    z-index: 103;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(30, 41, 59, 0.95));
    backdrop-filter: blur(10px);
    color: #fff;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.1);
    font-family: monospace;
    min-width: 400px;
    padding: 30px;
    text-align: left;
    border: 2px solid rgba(59, 130, 246, 0.3);
}

/* Main Menu Settings/Shop Styles */
#mainMenuSettings, #mainMenuShop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0b1220, #1e293b);
    z-index: 101;
    color: #fff;
    font-family: monospace;
    overflow-y: auto;
}

.menu-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 50px 20px;
}

.menu-header {
    text-align: center;
    margin-bottom: 40px;
    font-size: 48px;
    font-weight: bold;
    background: linear-gradient(135deg, #60a5fa, #3b82f6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.shop-header {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.back-button {
    position: absolute;
    top: 30px;
    left: 30px;
    background: linear-gradient(135deg, #6b7280, #4b5563);
    color: #fff;
    border: 2px solid #6b7280;
    border-radius: 12px;
    padding: 12px 24px;
    font-size: 18px;
    font-family: monospace;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.back-button:hover {
    background: linear-gradient(135deg, #4b5563, #374151);
    transform: translateY(-2px);
}

.settings-section {
    margin-bottom: 30px;
    padding: 25px;
    background: rgba(30, 41, 59, 0.3);
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.settings-section h3 {
    margin: 0 0 20px 0;
    font-size: 24px;
    color: #f1f5f9;
    font-weight: bold;
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
    padding-bottom: 10px;
}

.settings-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 12px 0;
}

.settings-label {
    font-size: 18px;
    color: #cbd5e1;
    font-weight: bold;
}

.toggle-btn {
    background: linear-gradient(135deg, #dc2626, #991b1b);
    color: #fff;
    border: 2px solid #ef4444;
    border-radius: 10px;
    padding: 10px 20px;
    font-size: 16px;
    font-family: monospace;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 80px;
}

.toggle-btn.active {
    background: linear-gradient(135deg, #059669, #047857);
    border-color: #10b981;
}

.settings-select {
    background: linear-gradient(135deg, #374151, #1f2937);
    color: #fff;
    border: 2px solid #4b5563;
    border-radius: 10px;
    padding: 10px 15px;
    font-size: 16px;
    font-family: monospace;
    cursor: pointer;
    min-width: 120px;
}

.coins-display-shop {
    text-align: center;
    margin-bottom: 30px;
    font-size: 28px;
    color: #fbbf24;
    background: rgba(251, 191, 36, 0.1);
    padding: 20px;
    border-radius: 15px;
    border: 2px solid rgba(251, 191, 36, 0.3);
    font-weight: bold;
}

.skin-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 20px;
    background: rgba(30, 41, 59, 0.3);
    border-radius: 15px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.skin-item.selected {
    background: rgba(34, 197, 94, 0.2);
    border-color: #22c55e;
}

.skin-preview {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    margin-right: 20px;
    box-shadow: 0 0 30px;
}

.skin-info {
    flex-grow: 1;
}

.skin-name {
    font-weight: bold;
    font-size: 24px;
    color: #fff;
    margin-bottom: 5px;
}

.skin-price {
    font-size: 18px;
    color: #cbd5e1;
}

.skin-button {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 10px;
    font-family: monospace;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 16px;
}

.skin-button:hover {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    transform: translateY(-2px);
}

.skin-button.buy {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
}

.skin-button.buy:hover {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.skin-button.active {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    cursor: default;
}

.skin-button:disabled {
    background: #6b7280;
    cursor: not-allowed;
}

#debugInfo {
    position: fixed;
    top: 10px;
    left: 10px;
    color: white;
    font-family: monospace;
    font-size: 12px;
    z-index: 100;
    display: none;
    background: rgba(0, 0, 0, 0.7);
    padding: 10px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.mobile-controls {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: none;
    z-index: 101;
}

.joystick {
    width: 100px;
    height: 100px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    position: relative;
    touch-action: none;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.joystick-handle {
    width: 30px;
    height: 30px;
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.8), rgba(59, 130, 246, 0.8));
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: none;
    border: 2px solid rgba(255, 255, 255, 0.5);
}

@media (max-width: 768px) {
    .mobile-controls {
        display: block;
    }
    
    .menu-title {
        font-size: 48px;
    }
    
    .menu-container {
        padding: 30px 15px;
    }
    
    .skin-item {
        flex-direction: column;
        text-align: center;
        gap: 15px;
/* Canvas unter UI halten */
#gameCanvas { z-index: 1 !important; }

/* Alle Menüs immer VOR dem Canvas und klickbar */
#mainMenu,
#mainMenuSettings,
#mainMenuShop,
#settingsMenu {
  position: fixed;      /* falls noch nicht */
  z-index: 999999 !important;
  pointer-events: auto !important;
}

/* Wenn irgendein Menü sichtbar ist, Canvas darf keine Klicks fressen */
.menu-open #gameCanvas { pointer-events: none !important; }

    }
}
