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

body {
    font-family: 'Courier New', monospace;
    background: #000000;
    color: #ff0000;
    overflow: hidden;
    user-select: none;
}

#scene-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

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

.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: all;
}

.hidden {
    display: none !important;
}

.vb-title {
    font-size: 3em;
    font-weight: bold;
    text-align: center;
    margin: 20px 0;
    text-shadow: 
        0 0 10px #ff0000,
        0 0 20px #ff0000,
        0 0 30px #ff0000;
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from { text-shadow: 0 0 10px #ff0000, 0 0 20px #ff0000, 0 0 30px #ff0000; }
    to { text-shadow: 0 0 20px #ff0000, 0 0 30px #ff0000, 0 0 40px #ff0000; }
}

.nintendo-logo {
    font-size: 1em;
    font-weight: normal;
    opacity: 0.8;
    margin-top: -10px;
}

.vb-header {
    text-align: center;
    margin-bottom: 40px;
}

.game-grid {
    display: grid;
    grid-template-columns: repeat(2, 200px);
    gap: 20px;
    margin-bottom: 40px;
}

.game-cartridge {
    width: 200px;
    height: 120px;
    background: linear-gradient(45deg, #330000, #660000);
    border: 3px solid #ff0000;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 
        0 0 10px rgba(255, 0, 0, 0.3),
        inset 0 0 20px rgba(255, 0, 0, 0.1);
}

.game-cartridge:hover {
    background: linear-gradient(45deg, #660000, #990000);
    box-shadow: 
        0 0 20px rgba(255, 0, 0, 0.6),
        inset 0 0 30px rgba(255, 0, 0, 0.2);
    transform: scale(1.05);
}

.cart-label {
    font-size: 14px;
    font-weight: bold;
    text-align: center;
    padding: 10px;
}

.vb-controls {
    display: flex;
    gap: 20px;
}

.vb-button {
    background: linear-gradient(45deg, #330000, #660000);
    border: 2px solid #ff0000;
    color: #ff0000;
    padding: 12px 24px;
    font-family: inherit;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s ease;
    box-shadow: 0 0 10px rgba(255, 0, 0, 0.3);
}

.vb-button:hover {
    background: linear-gradient(45deg, #660000, #990000);
    box-shadow: 0 0 20px rgba(255, 0, 0, 0.6);
}

.vb-button:active {
    transform: scale(0.95);
}

/* Game Screen */
.dual-display {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    border: 4px solid #ff0000;
    border-radius: 8px;
    padding: 20px;
    background: rgba(51, 0, 0, 0.8);
    box-shadow: 
        0 0 30px rgba(255, 0, 0, 0.5),
        inset 0 0 20px rgba(0, 0, 0, 0.7);
}

.eye-display {
    position: relative;
}

.eye-display::before {
    content: 'L';
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 12px;
    font-weight: bold;
}

.eye-display:last-child::before {
    content: 'R';
}

#left-canvas, #right-canvas {
    border: 2px solid #ff0000;
    border-radius: 4px;
    background: #000000;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

.game-ui {
    display: flex;
    align-items: center;
    gap: 20px;
}

.score-display {
    display: flex;
    gap: 40px;
    font-size: 18px;
    font-weight: bold;
}

/* Settings Screen */
.settings-grid {
    display: grid;
    gap: 30px;
    margin-bottom: 40px;
    max-width: 400px;
}

.setting-item {
    display: flex;
    align-items: center;
    gap: 20px;
}

.setting-item label {
    width: 120px;
    font-weight: bold;
    font-size: 14px;
}

.setting-item input[type="range"] {
    flex: 1;
    height: 6px;
    background: #330000;
    border: 1px solid #ff0000;
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
}

.setting-item input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    background: #ff0000;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 6px rgba(255, 0, 0, 0.8);
}

.setting-item input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: #ff0000;
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 0 6px rgba(255, 0, 0, 0.8);
}

.setting-item span {
    width: 60px;
    text-align: center;
    font-weight: bold;
}

/* Info Screen */
.info-content {
    max-width: 600px;
    text-align: center;
    line-height: 1.6;
    margin-bottom: 40px;
}

.info-content p {
    margin-bottom: 15px;
    font-size: 16px;
}

.fun-fact {
    font-style: italic;
    opacity: 0.8;
    margin-top: 20px !important;
}

/* Virtual Controller */
#virtual-controller {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 100px;
    align-items: center;
    z-index: 20;
    pointer-events: all;
}

.d-pad {
    display: grid;
    grid-template-columns: repeat(3, 40px);
    grid-template-rows: repeat(3, 40px);
    gap: 2px;
}

.dpad-btn {
    background: linear-gradient(45deg, #330000, #660000);
    border: 2px solid #ff0000;
    color: #ff0000;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.1s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dpad-btn:nth-child(1) { grid-column: 2; grid-row: 1; }
.dpad-btn:nth-child(2) { grid-column: 1; grid-row: 2; }
.dpad-btn:nth-child(3) { grid-column: 2; grid-row: 2; background: #220000; cursor: default; }
.dpad-btn:nth-child(4) { grid-column: 3; grid-row: 2; }
.dpad-btn:nth-child(5) { grid-column: 2; grid-row: 3; }

.dpad-btn:hover:not(.center) {
    background: linear-gradient(45deg, #660000, #990000);
    box-shadow: 0 0 10px rgba(255, 0, 0, 0.6);
}

.dpad-btn:active:not(.center) {
    background: linear-gradient(45deg, #990000, #cc0000);
    transform: scale(0.9);
}

.action-buttons {
    display: flex;
    gap: 20px;
}

.action-btn {
    width: 50px;
    height: 50px;
    background: linear-gradient(45deg, #330000, #660000);
    border: 2px solid #ff0000;
    color: #ff0000;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.1s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.action-btn:hover {
    background: linear-gradient(45deg, #660000, #990000);
    box-shadow: 0 0 15px rgba(255, 0, 0, 0.6);
}

.action-btn:active {
    background: linear-gradient(45deg, #990000, #cc0000);
    transform: scale(0.9);
}

/* Footer */
.app-footer {
    position: fixed;
    bottom: 10px;
    right: 10px;
    font-size: 12px;
    opacity: 0.6;
    z-index: 30;
}

.app-footer a {
    color: #ff0000;
    text-decoration: none;
}

.app-footer a:hover {
    text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 768px) {
    .vb-title {
        font-size: 2em;
    }
    
    .game-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .game-cartridge {
        width: 250px;
        height: 100px;
    }
    
    .dual-display {
        flex-direction: column;
        gap: 10px;
        padding: 15px;
    }
    
    #left-canvas, #right-canvas {
        width: 300px;
        height: 175px;
    }
    
    #virtual-controller {
        gap: 60px;
        bottom: 10px;
    }
    
    .d-pad {
        grid-template-columns: repeat(3, 35px);
        grid-template-rows: repeat(3, 35px);
    }
    
    .action-btn {
        width: 45px;
        height: 45px;
        font-size: 18px;
    }
    
    .settings-grid {
        max-width: 300px;
    }
    
    .info-content {
        max-width: 90%;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .vb-title {
        font-size: 1.5em;
    }
    
    .game-cartridge {
        width: 200px;
        height: 80px;
    }
    
    .cart-label {
        font-size: 12px;
    }
    
    #left-canvas, #right-canvas {
        width: 250px;
        height: 145px;
    }
    
    #virtual-controller {
        gap: 40px;
    }
    
    .d-pad {
        grid-template-columns: repeat(3, 30px);
        grid-template-rows: repeat(3, 30px);
    }
    
    .action-btn {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
}

/* Pixel-perfect rendering */
canvas {
    image-rendering: -moz-crisp-edges;
    image-rendering: -webkit-crisp-edges;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

/* Custom scrollbar for webkit browsers */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #000000;
}

::-webkit-scrollbar-thumb {
    background: #ff0000;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #cc0000;
}