@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

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

body {
    background: linear-gradient(135deg, #2C2C2C, #1a1a1a);
    font-family: 'Press Start 2P', monospace;
    color: #F5F5DC;
    overflow-x: auto;
    min-height: 100vh;
}

.dashboard-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.main-screen-container {
    position: relative;
    margin-bottom: 20px;
}

.crt-frame {
    position: relative;
    background: linear-gradient(145deg, #B8B8B8, #6B6B6B);
    padding: 30px;
    border-radius: 20px;
    box-shadow: 
        inset -5px -5px 10px rgba(0,0,0,0.3),
        inset 5px 5px 10px rgba(255,255,255,0.1),
        0 10px 30px rgba(0,0,0,0.5);
}

#gameCanvas {
    display: block;
    background: #000;
    border-radius: 10px;
    border: 3px solid #333;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

.scanlines {
    position: absolute;
    top: 30px;
    left: 30px;
    right: 30px;
    bottom: 30px;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0,0,0,0.1) 2px,
        rgba(0,0,0,0.1) 4px
    );
    pointer-events: none;
    border-radius: 10px;
}

.screen-glow {
    position: absolute;
    top: 25px;
    left: 25px;
    right: 25px;
    bottom: 25px;
    box-shadow: inset 0 0 50px rgba(230, 243, 255, 0.1);
    border-radius: 15px;
    pointer-events: none;
}

.controls-section {
    display: flex;
    gap: 40px;
    align-items: flex-start;
    flex-wrap: wrap;
    justify-content: center;
}

.main-controller {
    background: linear-gradient(145deg, #A8A8A8, #6B6B6B);
    padding: 30px;
    border-radius: 15px;
    box-shadow: 
        inset -3px -3px 8px rgba(0,0,0,0.3),
        inset 3px 3px 8px rgba(255,255,255,0.1),
        0 8px 25px rgba(0,0,0,0.4);
}

.controller-body {
    display: grid;
    grid-template-columns: 120px 1fr 120px;
    grid-template-rows: 80px 40px;
    gap: 20px;
    align-items: center;
}

.dpad {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 0 auto;
}

.dpad-btn {
    position: absolute;
    width: 24px;
    height: 24px;
    background: linear-gradient(145deg, #2C2C2C, #1a1a1a);
    border: none;
    color: #8B8B8B;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.1s;
    border-radius: 3px;
    box-shadow: 2px 2px 5px rgba(0,0,0,0.3);
}

.dpad-btn:hover {
    background: linear-gradient(145deg, #3a3a3a, #2a2a2a);
}

.dpad-btn.pressed {
    transform: translateY(1px);
    box-shadow: 1px 1px 3px rgba(0,0,0,0.5);
}

.dpad-btn.up { top: 0; left: 28px; }
.dpad-btn.down { bottom: 0; left: 28px; }
.dpad-btn.left { left: 0; top: 28px; }
.dpad-btn.right { right: 0; top: 28px; }

.dpad-center {
    position: absolute;
    top: 28px;
    left: 28px;
    width: 24px;
    height: 24px;
    background: #1a1a1a;
    border-radius: 50%;
}

.action-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.action-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.1s;
    box-shadow: 3px 3px 8px rgba(0,0,0,0.3);
}

.b-btn {
    background: linear-gradient(145deg, #CC3333, #992222);
    color: white;
}

.a-btn {
    background: linear-gradient(145deg, #CC3333, #992222);
    color: white;
}

.action-btn:hover {
    transform: translateY(-1px);
}

.action-btn.pressed {
    transform: translateY(2px);
    box-shadow: 1px 1px 4px rgba(0,0,0,0.5);
}

.system-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    grid-column: 2;
}

.sys-btn {
    padding: 8px 16px;
    background: linear-gradient(145deg, #3a3a3a, #2a2a2a);
    border: none;
    color: #8B8B8B;
    font-size: 8px;
    font-family: inherit;
    cursor: pointer;
    border-radius: 5px;
    transition: all 0.1s;
    box-shadow: 2px 2px 5px rgba(0,0,0,0.3);
}

.sys-btn:hover {
    background: linear-gradient(145deg, #4a4a4a, #3a3a3a);
}

.sys-btn.pressed {
    transform: translateY(1px);
    box-shadow: 1px 1px 3px rgba(0,0,0,0.5);
}

.side-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
    background: linear-gradient(145deg, #A8A8A8, #6B6B6B);
    padding: 20px;
    border-radius: 15px;
    box-shadow: 
        inset -3px -3px 8px rgba(0,0,0,0.3),
        inset 3px 3px 8px rgba(255,255,255,0.1),
        0 8px 25px rgba(0,0,0,0.4);
    min-width: 200px;
}

.side-panel h3 {
    font-size: 10px;
    color: #2C2C2C;
    margin-bottom: 15px;
    text-align: center;
}

.game-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.game-btn {
    padding: 10px 5px;
    background: linear-gradient(145deg, #3a3a3a, #2a2a2a);
    border: none;
    color: #F5F5DC;
    font-size: 8px;
    font-family: inherit;
    cursor: pointer;
    border-radius: 5px;
    transition: all 0.2s;
    box-shadow: 2px 2px 5px rgba(0,0,0,0.3);
}

.game-btn:hover {
    background: linear-gradient(145deg, #4a4a4a, #3a3a3a);
    transform: translateY(-1px);
}

.game-btn.active {
    background: linear-gradient(145deg, #CC3333, #992222);
    color: white;
    box-shadow: 0 0 10px rgba(204, 51, 51, 0.5);
}

.system-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.power-btn, .reset-btn {
    padding: 12px;
    border: none;
    font-size: 8px;
    font-family: inherit;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.1s;
    box-shadow: 3px 3px 8px rgba(0,0,0,0.3);
}

.power-btn {
    background: linear-gradient(145deg, #22c55e, #16a34a);
    color: white;
}

.reset-btn {
    background: linear-gradient(145deg, #ef4444, #dc2626);
    color: white;
}

.power-btn:hover, .reset-btn:hover {
    transform: translateY(-1px);
}

.status-lights {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 15px;
}

.led {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #2a2a2a;
    border: 2px solid #1a1a1a;
    transition: all 0.3s;
}

.led.active {
    background: #22c55e;
    box-shadow: 0 0 10px rgba(34, 197, 94, 0.7);
}

.power-led.active {
    background: #3b82f6;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.7);
}

.score-display {
    text-align: center;
}

.score-value {
    font-size: 16px;
    color: #CC3333;
    margin: 10px 0;
    text-shadow: 0 0 5px rgba(204, 51, 51, 0.5);
}

.high-score {
    font-size: 8px;
    color: #fbbf24;
}

.audio-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    background: linear-gradient(145deg, #A8A8A8, #6B6B6B);
    padding: 15px 25px;
    border-radius: 10px;
    box-shadow: 
        inset -3px -3px 8px rgba(0,0,0,0.3),
        inset 3px 3px 8px rgba(255,255,255,0.1);
}

.audio-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: linear-gradient(145deg, #3a3a3a, #2a2a2a);
    color: #F5F5DC;
    font-size: 18px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.1s;
    box-shadow: 2px 2px 5px rgba(0,0,0,0.3);
}

.audio-btn:hover {
    transform: translateY(-1px);
}

.volume-slider input[type="range"] {
    width: 100px;
    height: 5px;
    background: #2a2a2a;
    border-radius: 3px;
    outline: none;
}

.volume-slider input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 15px;
    height: 15px;
    background: #CC3333;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 5px rgba(204, 51, 51, 0.5);
}

/* Responsive Design */
@media (max-width: 768px) {
    .dashboard-container {
        padding: 10px;
    }
    
    .controls-section {
        flex-direction: column;
        align-items: center;
        gap: 20px;
    }
    
    .crt-frame {
        padding: 20px;
    }
    
    #gameCanvas {
        width: 100%;
        max-width: 480px;
        height: auto;
    }
    
    .controller-body {
        grid-template-columns: 100px 1fr 100px;
        gap: 15px;
    }
    
    .action-btn {
        width: 40px;
        height: 40px;
        font-size: 14px;
    }
    
    .side-panel {
        min-width: auto;
        width: 100%;
        max-width: 300px;
    }
}

@media (max-width: 480px) {
    .game-grid {
        grid-template-columns: 1fr;
    }
    
    .controller-body {
        grid-template-columns: 80px 1fr 80px;
        gap: 10px;
    }
    
    .dpad {
        width: 60px;
        height: 60px;
    }
    
    .dpad-btn {
        width: 18px;
        height: 18px;
        font-size: 10px;
    }
    
    .dpad-btn.up, .dpad-btn.down { left: 21px; }
    .dpad-btn.left, .dpad-btn.right { top: 21px; }
    .dpad-center {
        top: 21px;
        left: 21px;
        width: 18px;
        height: 18px;
    }
}

/* Animation for button press feedback */
@keyframes buttonPress {
    0% { transform: scale(1); }
    50% { transform: scale(0.95); }
    100% { transform: scale(1); }
}

.pressed {
    animation: buttonPress 0.1s ease-in-out;
}

/* Glow effect for active elements */
@keyframes glow {
    0%, 100% { box-shadow: 0 0 5px rgba(204, 51, 51, 0.5); }
    50% { box-shadow: 0 0 20px rgba(204, 51, 51, 0.8); }
}

.active {
    animation: glow 2s infinite;
}