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

body {
    font-family: 'Courier New', monospace;
    background: #0a0a0a;
    color: #ffffff;
    overflow: hidden;
}

#scene-container {
    width: 100vw;
    height: 100vh;
}

#ui-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 100;
}

#hud {
    position: absolute;
    top: 20px;
    left: 20px;
    background: rgba(0, 0, 0, 0.8);
    padding: 15px;
    border-radius: 10px;
    border: 2px solid #ff6600;
    pointer-events: auto;
    min-width: 250px;
}

#power-status {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

#power-status:hover {
    transform: scale(1.05);
}

.led {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 10px;
    transition: all 0.3s ease;
}

.led.off {
    background: #333;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.5);
}

.led.on {
    background: #00ff00;
    box-shadow: 0 0 10px #00ff00, inset 0 2px 4px rgba(255,255,255,0.3);
    animation: pulse 2s infinite;
}

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

#credits-display, #game-info {
    margin: 5px 0;
    font-weight: bold;
    transition: transform 0.2s ease;
}

#credit-count {
    color: #ffff00;
    font-size: 1.2em;
}

#current-game {
    color: #00ffff;
}

#game-menu {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.95);
    padding: 30px;
    border-radius: 15px;
    border: 3px solid #ff6600;
    max-width: 600px;
    max-height: 70vh;
    overflow-y: auto;
    pointer-events: auto;
    transition: all 0.3s ease;
}

#game-menu.hidden {
    display: none;
}

#game-menu h3 {
    color: #ff6600;
    text-align: center;
    margin-bottom: 20px;
    font-size: 1.5em;
}

#cartridge-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.cartridge {
    background: #333;
    border: 2px solid #666;
    border-radius: 8px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cartridge:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(255, 102, 0, 0.3);
    border-color: #ff6600;
}

.cartridge-label {
    color: #fff;
}

.game-name {
    font-weight: bold;
    font-size: 0.9em;
    margin-bottom: 5px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
}

.game-year {
    font-size: 0.7em;
    opacity: 0.8;
}

#close-menu {
    display: block;
    margin: 0 auto;
    padding: 10px 20px;
    background: #ff6600;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-family: inherit;
    font-weight: bold;
    transition: all 0.3s ease;
}

#close-menu:hover {
    background: #ff8833;
    transform: scale(1.05);
}

#controls-help {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    padding: 10px 20px;
    border-radius: 20px;
    border: 1px solid #555;
    pointer-events: auto;
    text-align: center;
    font-size: 0.9em;
    color: #ccc;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    #hud {
        top: 10px;
        left: 10px;
        right: 10px;
        font-size: 0.9em;
        padding: 10px;
    }
    
    #game-menu {
        margin: 20px;
        padding: 20px;
        max-height: 80vh;
    }
    
    #cartridge-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 10px;
    }
    
    .cartridge {
        padding: 10px;
        min-height: 60px;
    }
    
    .game-name {
        font-size: 0.8em;
    }
    
    #controls-help {
        bottom: 10px;
        left: 10px;
        right: 10px;
        transform: none;
        font-size: 0.8em;
    }
}

/* Scrollbar styling for game menu */
#game-menu::-webkit-scrollbar {
    width: 8px;
}

#game-menu::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

#game-menu::-webkit-scrollbar-thumb {
    background: #ff6600;
    border-radius: 4px;
}

#game-menu::-webkit-scrollbar-thumb:hover {
    background: #ff8833;
}