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

body {
    font-family: 'Courier New', monospace;
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    color: #e0e0e0;
    min-height: 100vh;
    overflow-x: auto;
}

.container {
    padding: 20px;
    max-width: 1400px;
    margin: 0 auto;
}

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

.header h1 {
    font-size: 2.5rem;
    color: #00ff88;
    text-shadow: 0 0 10px #00ff88;
    margin-bottom: 10px;
}

.header p {
    color: #aaa;
    font-size: 1.1rem;
}

.main-area {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 30px;
    align-items: start;
}

.monitor-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.crt-monitor {
    position: relative;
    background: linear-gradient(145deg, #2d2d2d, #1a1a1a);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.5),
        inset 0 2px 5px rgba(255, 255, 255, 0.1);
}

.screen-bezel {
    position: relative;
    background: #111;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 
        inset 0 0 30px rgba(0, 0, 0, 0.8),
        0 0 50px rgba(0, 255, 136, 0.2);
}

#canvas {
    display: block;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.3);
}

.screen-glare {
    position: absolute;
    top: 30px;
    left: 50px;
    width: 200px;
    height: 150px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), transparent);
    border-radius: 50%;
    pointer-events: none;
}

.speaker-grille {
    width: 200px;
    height: 30px;
    background: linear-gradient(90deg, #333, #222);
    border-radius: 15px;
    margin-top: 20px;
    position: relative;
    overflow: hidden;
}

.speaker-holes {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    height: 50%;
    background-image: repeating-linear-gradient(
        90deg,
        transparent,
        transparent 3px,
        #444 3px,
        #444 5px
    );
}

.power-button {
    background: linear-gradient(145deg, #444, #222);
    border: none;
    border-radius: 50px;
    padding: 15px 30px;
    color: #ccc;
    font-family: inherit;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.2s;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.power-button:hover {
    background: linear-gradient(145deg, #555, #333);
    transform: translateY(-2px);
}

.power-button:active {
    transform: translateY(0);
}

.power-led {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #333;
    transition: all 0.3s;
}

.power-led.on {
    background: #00ff00;
    box-shadow: 0 0 10px #00ff00;
}

.control-panel {
    background: linear-gradient(145deg, #2a2a2a, #1e1e1e);
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    max-height: 80vh;
    overflow-y: auto;
}

.control-section {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #444;
}

.control-section:last-child {
    border-bottom: none;
}

.control-section h3 {
    color: #00ff88;
    font-size: 0.9rem;
    margin-bottom: 15px;
    letter-spacing: 1px;
}

.control-row {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    gap: 10px;
}

.control-row label {
    min-width: 100px;
    font-size: 0.85rem;
    color: #ccc;
}

.slider {
    flex: 1;
    height: 20px;
    background: #333;
    border-radius: 10px;
    outline: none;
    -webkit-appearance: none;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: linear-gradient(145deg, #00ff88, #00cc66);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: linear-gradient(145deg, #00ff88, #00cc66);
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

.slider.mini {
    max-width: 80px;
}

.tuning-knob {
    width: 50px;
    height: 50px;
    background: linear-gradient(145deg, #555, #333);
    border-radius: 50%;
    position: relative;
    cursor: pointer;
    border: 3px solid #666;
    box-shadow: 
        0 5px 15px rgba(0, 0, 0, 0.3),
        inset 0 2px 5px rgba(255, 255, 255, 0.1);
}

.tuning-knob.small {
    width: 40px;
    height: 40px;
}

.knob-indicator {
    position: absolute;
    top: 5px;
    left: 50%;
    transform: translateX(-50%);
    width: 3px;
    height: 15px;
    background: #00ff88;
    border-radius: 2px;
    box-shadow: 0 0 5px #00ff88;
}

.switch {
    width: 40px;
    height: 20px;
    -webkit-appearance: none;
    background: #333;
    border-radius: 10px;
    position: relative;
    cursor: pointer;
    outline: none;
}

.switch:checked {
    background: #00ff88;
}

.switch:before {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    background: #fff;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: all 0.3s;
}

.switch:checked:before {
    left: 22px;
}

.input-buttons, .pattern-buttons, .content-buttons, .preset-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.input-btn, .pattern-btn, .content-btn, .preset-btn {
    background: linear-gradient(145deg, #444, #222);
    border: none;
    border-radius: 8px;
    padding: 10px 8px;
    color: #ccc;
    font-family: inherit;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: bold;
}

.input-btn:hover, .pattern-btn:hover, .content-btn:hover, .preset-btn:hover {
    background: linear-gradient(145deg, #555, #333);
    transform: translateY(-1px);
}

.input-btn.active {
    background: linear-gradient(145deg, #00ff88, #00cc66);
    color: #000;
    box-shadow: 0 0 10px #00ff88;
}

.footer {
    text-align: center;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #444;
    color: #666;
}

.footer a {
    color: #00ff88;
    text-decoration: none;
}

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

/* Responsive design */
@media (max-width: 1200px) {
    .main-area {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .control-panel {
        max-height: none;
    }
}

@media (max-width: 768px) {
    .header h1 {
        font-size: 1.8rem;
    }
    
    .crt-monitor {
        padding: 20px;
    }
    
    #canvas {
        width: 100%;
        max-width: 480px;
        height: auto;
    }
    
    .control-panel {
        padding: 15px;
    }
    
    .input-buttons, .pattern-buttons, .content-buttons, .preset-buttons {
        grid-template-columns: 1fr;
    }
}

/* Custom scrollbar for control panel */
.control-panel::-webkit-scrollbar {
    width: 8px;
}

.control-panel::-webkit-scrollbar-track {
    background: #222;
    border-radius: 4px;
}

.control-panel::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 4px;
}

.control-panel::-webkit-scrollbar-thumb:hover {
    background: #666;
}