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

body {
    font-family: 'Courier New', monospace;
    background: linear-gradient(135deg, #2c1810 0%, #5a3825 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    background-image: 
        repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0,0,0,.1) 2px, rgba(0,0,0,.1) 4px);
}

#container {
    max-width: 1200px;
    width: 100%;
}

#tv-set {
    background: linear-gradient(145deg, #1a1a1a, #2a2a2a);
    padding: 40px;
    border-radius: 20px;
    box-shadow: 
        0 20px 60px rgba(0,0,0,0.8),
        inset 0 2px 4px rgba(255,255,255,0.1);
    margin-bottom: 30px;
}

#screen-bezel {
    position: relative;
    background: #000;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 
        inset 0 0 30px rgba(0,0,0,0.8),
        0 0 20px rgba(100,150,255,0.3);
}

#canvas {
    display: block;
    width: 100%;
    border-radius: 10px;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    filter: contrast(1.1) brightness(0.95);
}

#scanlines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0,0,0,0.15) 2px,
        rgba(0,0,0,0.15) 4px
    );
    pointer-events: none;
    border-radius: 10px;
}

#screen-glow {
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    background: radial-gradient(ellipse at center, rgba(100,150,255,0.3) 0%, transparent 70%);
    pointer-events: none;
    opacity: 0.3;
    transition: opacity 1s;
}

#console {
    background: linear-gradient(180deg, #8B4513 0%, #654321 100%);
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    margin-bottom: 20px;
    background-image: 
        repeating-linear-gradient(90deg, transparent, transparent 2px, rgba(0,0,0,.05) 2px, rgba(0,0,0,.05) 4px);
}

#console-body {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

#atari-logo {
    font-size: 32px;
    font-weight: bold;
    color: #FF6B35;
    text-shadow: 
        2px 2px 0 #C84A1C,
        4px 4px 10px rgba(0,0,0,0.5);
    font-family: Arial, sans-serif;
    letter-spacing: 8px;
}

#cartridge-slot {
    background: #1a1a1a;
    padding: 10px 20px;
    border-radius: 5px;
    box-shadow: inset 0 2px 8px rgba(0,0,0,0.8);
}

#cartridge {
    background: linear-gradient(180deg, #333 0%, #1a1a1a 100%);
    padding: 10px 20px;
    border-radius: 3px;
    border: 2px solid #555;
}

#cartridge-label {
    color: #FFD700;
    font-size: 14px;
    font-weight: bold;
    text-align: center;
    letter-spacing: 2px;
}

#switches {
    display: flex;
    gap: 20px;
}

.switch-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.switch-group label {
    color: #fff;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.toggle-switch {
    width: 40px;
    height: 20px;
    background: #333;
    border-radius: 10px;
    position: relative;
    cursor: pointer;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.5);
    transition: background 0.3s;
}

.toggle-switch::before {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    background: #666;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: all 0.3s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.toggle-switch.active {
    background: #FF6B35;
}

.toggle-switch.active::before {
    left: 22px;
    background: #FFD700;
}

#controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 40px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

#joystick {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

#stick-base {
    position: relative;
    width: 120px;
    height: 120px;
    background: #2a2a2a;
    border-radius: 10px;
    box-shadow: 
        0 5px 15px rgba(0,0,0,0.5),
        inset 0 2px 4px rgba(255,255,255,0.1);
}

.direction-btn {
    position: absolute;
    width: 35px;
    height: 35px;
    background: #444;
    border: 2px solid #555;
    border-radius: 5px;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.1s;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

.direction-btn:active {
    background: #666;
    transform: translateY(2px);
    box-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

#btn-up { top: 5px; left: 42.5px; }
#btn-down { bottom: 5px; left: 42.5px; }
#btn-left { top: 42.5px; left: 5px; }
#btn-right { top: 42.5px; right: 5px; }

#stick-center {
    position: absolute;
    width: 30px;
    height: 30px;
    background: radial-gradient(circle, #666, #333);
    border-radius: 50%;
    top: 45px;
    left: 45px;
    border: 2px solid #777;
    box-shadow: 0 3px 8px rgba(0,0,0,0.5);
}

#fire-btn {
    width: 80px;
    height: 80px;
    background: radial-gradient(circle, #ff3333, #cc0000);
    border: 4px solid #990000;
    border-radius: 50%;
    color: #fff;
    font-weight: bold;
    font-size: 14px;
    cursor: pointer;
    box-shadow: 
        0 5px 15px rgba(255,0,0,0.5),
        inset 0 2px 4px rgba(255,255,255,0.2);
    transition: all 0.1s;
}

#fire-btn:active, #fire-btn.active {
    background: radial-gradient(circle, #cc0000, #990000);
    transform: translateY(3px);
    box-shadow: 
        0 2px 8px rgba(255,0,0,0.5),
        inset 0 2px 4px rgba(0,0,0,0.3);
}

#instructions {
    color: #FFD700;
    text-align: center;
}

#instructions p {
    margin: 5px 0;
    font-size: 14px;
}

#game-info {
    display: flex;
    justify-content: space-around;
    background: #1a1a1a;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
}

#score-display, #high-score-display, #lives-display {
    color: #00ff00;
    font-size: 18px;
    font-weight: bold;
    text-shadow: 0 0 10px #00ff00;
}

#menu {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.95);
    padding: 40px;
    border-radius: 15px;
    border: 4px solid #FF6B35;
    z-index: 1000;
    box-shadow: 0 0 50px rgba(255,107,53,0.5);
}

#menu h2 {
    color: #FFD700;
    text-align: center;
    margin-bottom: 20px;
    font-size: 24px;
    text-shadow: 0 0 10px #FFD700;
}

#game-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.game-option {
    background: #333;
    color: #fff;
    padding: 15px 30px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    border: 2px solid #555;
}

.game-option:hover {
    background: #FF6B35;
    border-color: #FFD700;
    transform: scale(1.05);
}

#message-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

#message-text {
    color: #FFD700;
    font-size: 32px;
    text-align: center;
    text-shadow: 0 0 20px #FFD700;
    white-space: pre-line;
    padding: 40px;
    background: rgba(0,0,0,0.8);
    border: 4px solid #FFD700;
    border-radius: 15px;
}

.hidden {
    display: none !important;
}

footer {
    text-align: center;
    color: #FFD700;
    margin-top: 20px;
    padding: 20px;
}

footer a {
    color: #FF6B35;
    text-decoration: none;
    font-weight: bold;
}

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

.easter-egg {
    font-size: 12px;
    opacity: 0.6;
    margin-top: 10px;
}

@media (max-width: 768px) {
    #tv-set {
        padding: 20px;
    }
    
    #console-body {
        flex-direction: column;
    }
    
    #controls {
        flex-direction: column;
    }
    
    #message-text {
        font-size: 20px;
        padding: 20px;
    }
}