/* Main Menu Styles - Cyberpunk Theme */
#menu {
    display: none; /* Hidden by default, shown by Menu.js */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 50;
}

/* Universal Cyberpunk Scrollbar - used across all screens */
.cyberpunk-scroll::-webkit-scrollbar {
    width: calc(10px * var(--ui-scale));
}

.cyberpunk-scroll::-webkit-scrollbar-track {
    background: rgba(0, 255, 255, 0.1);
    border-radius: calc(5px * var(--ui-scale));
}

.cyberpunk-scroll::-webkit-scrollbar-thumb {
    background: #00ffff;
    border-radius: calc(5px * var(--ui-scale));
    box-shadow: 0 0 calc(10px * var(--ui-scale)) rgba(0, 255, 255, 0.5);
}

.cyberpunk-scroll::-webkit-scrollbar-thumb:hover {
    background: #ff00ff;
    box-shadow: 0 0 calc(15px * var(--ui-scale)) rgba(255, 0, 255, 0.8);
}

/* Animated background with cyberpunk grid */
.menu-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1a0030 0%, #0a0015 100%);
    overflow: hidden;
}

/* Grid lines overlay */
.menu-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 39px,
            rgba(0, 255, 255, 0.15) 39px,
            rgba(0, 255, 255, 0.15) 40px
        ),
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 39px,
            rgba(0, 255, 255, 0.15) 39px,
            rgba(0, 255, 255, 0.15) 40px
        );
    background-size: 100% 100%;
    pointer-events: none;
    animation: gridScroll 8s linear infinite;
}

@keyframes gridScroll {
    0% { background-position: 0 0; }
    100% { background-position: 40px 40px; }
}

/* Scanlines effect */
.menu-bg::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 255, 255, 0.02) 0px,
        rgba(0, 255, 255, 0.02) 2px,
        transparent 2px,
        transparent 4px
    );
    pointer-events: none;
}

/* Particles canvas */
#menu-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* Menu content container */
.menu-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: calc(30px * var(--ui-scale));
}

/* Animated logo image */
#menu-logo-img {
    display: none; /* Hidden until loaded */
    width: calc(350px * var(--ui-scale));
    height: auto;
    margin-bottom: calc(20px * var(--ui-scale));
    filter: drop-shadow(0 0 25px rgba(0, 255, 255, 0.7));
    animation: menuLogoFloat 3s ease-in-out infinite, menuLogoTilt 6s ease-in-out infinite;
}

@keyframes menuLogoFloat {
    0%, 100% { 
        transform: translateY(0px) scale(1);
    }
    50% { 
        transform: translateY(-20px) scale(1.08);
    }
}

@keyframes menuLogoTilt {
    0%, 100% { 
        transform: rotate(0deg);
        filter: drop-shadow(0 0 25px rgba(0, 255, 255, 0.7));
    }
    25% { 
        transform: rotate(5deg);
        filter: drop-shadow(0 0 30px rgba(255, 0, 255, 0.8));
    }
    50% { 
        transform: rotate(0deg);
        filter: drop-shadow(0 0 25px rgba(0, 255, 255, 0.7));
    }
    75% { 
        transform: rotate(-5deg);
        filter: drop-shadow(0 0 30px rgba(255, 0, 255, 0.8));
    }
}

/* Title with neon glow and glitch effect */
.menu-title {
    position: relative;
    margin: 0;
    margin-bottom: calc(20px * var(--ui-scale));
}

.title-main {
    display: block;
    font-family: monospace;
    font-size: calc(48px * var(--ui-scale));
    font-weight: bold;
    color: #00ffff;
    text-shadow: 
        0 0 10px #00ffff,
        0 0 20px #00ffff,
        0 0 30px #00ffff;
    animation: neonPulse 2s ease-in-out infinite;
}

/* Glitch overlay */
.title-glitch {
    position: absolute;
    top: -2px;
    left: 3px;
    font-family: monospace;
    font-size: calc(48px * var(--ui-scale));
    font-weight: bold;
    color: #ff0099;
    opacity: 0.3;
    pointer-events: none;
}

@keyframes neonPulse {
    0%, 100% { 
        text-shadow: 
            0 0 10px #00ffff,
            0 0 20px #00ffff,
            0 0 30px #00ffff;
    }
    50% { 
        text-shadow: 
            0 0 20px #00ffff,
            0 0 30px #00ffff,
            0 0 40px #00ffff,
            0 0 50px #00ffff;
    }
}

/* Subtitle */
.menu-subtitle {
    font-family: monospace;
    font-size: calc(20px * var(--ui-scale));
    color: #ff00ff;
    text-shadow: 
        0 0 10px #ff00ff,
        0 0 15px #ff00ff;
    margin: 0;
    margin-bottom: calc(40px * var(--ui-scale));
}

/* Buttons container */
.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: calc(20px * var(--ui-scale));
}

/* Menu buttons */
.menu-btn {
    width: calc(200px * var(--ui-scale));
    height: calc(60px * var(--ui-scale));
    font-family: monospace;
    font-size: calc(18px * var(--ui-scale));
    font-weight: bold;
    color: #00ffff;
    background: rgba(10, 0, 32, 0.8);
    border: calc(3px * var(--ui-scale)) solid #00ffff;
    border-radius: calc(8px * var(--ui-scale));
    cursor: pointer;
    transition: all 0.3s ease;
    text-shadow: 0 0 calc(5px * var(--ui-scale)) #00ffff;
    box-shadow: 
        0 0 calc(10px * var(--ui-scale)) rgba(0, 255, 255, 0.3),
        inset 0 0 calc(20px * var(--ui-scale)) rgba(0, 255, 255, 0.1);
}

.menu-btn:hover {
    background: rgba(0, 255, 255, 0.2);
    border-color: #ff00ff;
    color: #ff00ff;
    text-shadow: 0 0 calc(10px * var(--ui-scale)) #ff00ff;
    box-shadow: 
        0 0 calc(20px * var(--ui-scale)) rgba(255, 0, 255, 0.5),
        inset 0 0 calc(30px * var(--ui-scale)) rgba(255, 0, 255, 0.2);
    transform: scale(1.05);
}

.menu-btn:active {
    transform: scale(0.98);
}

/* Credits, Settings, Exit buttons - smaller style */
#btn-credits,
#btn-settings,
#btn-exit {
    height: calc(50px * var(--ui-scale));
    font-size: calc(16px * var(--ui-scale));
}

/* Exit button - red/danger style */
.menu-btn-exit {
    border-color: #ff0066;
    color: #ff0066;
    text-shadow: 0 0 calc(5px * var(--ui-scale)) #ff0066;
    box-shadow: 
        0 0 calc(10px * var(--ui-scale)) rgba(255, 0, 102, 0.3),
        inset 0 0 calc(20px * var(--ui-scale)) rgba(255, 0, 102, 0.1);
}

.menu-btn-exit:hover {
    background: rgba(255, 0, 102, 0.2);
    border-color: #ff0099;
    color: #ff0099;
    text-shadow: 0 0 calc(10px * var(--ui-scale)) #ff0099;
    box-shadow: 
        0 0 calc(20px * var(--ui-scale)) rgba(255, 0, 102, 0.5),
        inset 0 0 calc(30px * var(--ui-scale)) rgba(255, 0, 102, 0.2);
}

/* Footer */
.menu-footer {
    position: absolute;
    bottom: calc(50px * var(--ui-scale));
    font-family: monospace;
    font-size: calc(14px * var(--ui-scale));
    color: rgba(255, 255, 255, 0.5);
}

/* Version info */
.menu-version {
    font-family: monospace;
    font-size: calc(12px * var(--ui-scale));
    color: rgba(0, 255, 255, 0.6);
    text-shadow: 0 0 calc(5px * var(--ui-scale)) rgba(0, 255, 255, 0.4);
    margin-top: calc(10px * var(--ui-scale));
    letter-spacing: calc(1px * var(--ui-scale));
}