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

body {
    font-family: 'Courier New', monospace;
    background: linear-gradient(135deg, #2c2c2c, #1a1a1a);
    color: #e0e0e0;
    min-height: 100vh;
}

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

header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: linear-gradient(135deg, #3a3a3a, #2a2a2a);
    border-radius: 10px;
    border: 2px solid #555;
}

header h1 {
    font-size: 2.5em;
    color: #ffaa00;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    margin-bottom: 10px;
}

header p {
    color: #cccccc;
    font-size: 1.1em;
}

.main-area {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

.display-section {
    flex: 2;
}

.controls-section {
    flex: 1;
    min-width: 300px;
}

.crt-bezel {
    position: relative;
    background: linear-gradient(135deg, #4a4a4a, #2a2a2a);
    padding: 40px;
    border-radius: 20px;
    border: 8px solid #333;
    box-shadow: 
        inset 0 0 20px rgba(0,0,0,0.8),
        0 10px 30px rgba(0,0,0,0.5);
}

.crt-bezel::before {
    content: '';
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    bottom: 10px;
    border: 3px solid #666;
    border-radius: 15px;
    pointer-events: none;
}

/* Corner bolts */
.crt-bezel::after {
    content: '⚫ ⚫';
    position: absolute;
    top: 15px;
    left: 15px;
    right: 15px;
    color: #777;
    font-size: 8px;
    display: flex;
    justify-content: space-between;
    pointer-events: none;
}

#canvas {
    display: block;
    background: #000;
    border: 2px solid #333;
    border-radius: 5px;
    position: relative;
    z-index: 1;
}

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

.status-panel {
    display: flex;
    justify-content: space-around;
    margin-top: 20px;
    padding: 15px;
    background: linear-gradient(135deg, #3a3a3a, #2a2a2a);
    border-radius: 10px;
    border: 2px solid #555;
}

.status-item {
    text-align: center;
}

.status-item label {
    display: block;
    margin-top: 8px;
    font-size: 0.8em;
    color: #aaa;
}

.led {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #333;
    border: 2px solid #555;
    transition: all 0.3s ease;
}

.led.active {
    box-shadow: 0 0 10px currentColor;
}

.power-led.active {
    background: #00ff00;
    color: #00ff00;
}

.oil-led.active {
    background: #ffaa00;
    color: #ffaa00;
}

.analog-meter {
    width: 40px;
    height: 40px;
    border: 2px solid #555;
    border-radius: 50%;
    position: relative;
    background: radial-gradient(circle, #222, #111);
}

.meter-needle {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 2px;
    height: 15px;
    background: #ff6600;
    transform-origin: bottom center;
    transform: translate(-50%, -100%) rotate(-90deg);
    transition: transform 0.5s ease;
}

.control-panel, .pattern-panel, .info-panel {
    background: linear-gradient(135deg, #3a3a3a, #2a2a2a);
    border: 2px solid #555;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
}

.control-panel h3, .pattern-panel h3, .info-panel h3 {
    color: #ffaa00;
    margin-bottom: 15px;
    text-align: center;
    font-size: 1.1em;
    border-bottom: 1px solid #555;
    padding-bottom: 8px;
}

.knob-row {
    display: flex;
    justify-content: space-around;
    margin-bottom: 20px;
}

.knob-control {
    text-align: center;
}

.knob {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #666, #333, #111);
    border: 4px solid #444;
    position: relative;
    cursor: pointer;
    margin: 0 auto 10px;
    transition: all 0.1s ease;
}

.knob:hover {
    border-color: #555;
}

.knob-indicator {
    position: absolute;
    top: 5px;
    left: 50%;
    width: 4px;
    height: 20px;
    background: #ffaa00;
    transform: translateX(-50%);
    border-radius: 2px;
}

.knob-control label {
    font-size: 0.7em;
    color: #aaa;
    text-transform: uppercase;
}

.switches-row {
    display: flex;
    justify-content: space-around;
    align-items: center;
}

.switch-control {
    text-align: center;
}

.toggle-switch {
    width: 50px;
    height: 25px;
    background: #222;
    border: 2px solid #444;
    border-radius: 15px;
    position: relative;
    cursor: pointer;
    margin: 0 auto 10px;
}

.switch-lever {
    position: absolute;
    top: 3px;
    left: 5px;
    width: 15px;
    height: 15px;
    background: #666;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.toggle-switch.active .switch-lever {
    background: #00ff00;
    left: 25px;
}

.vintage-button {
    background: linear-gradient(135deg, #555, #333);
    border: 2px solid #666;
    color: #fff;
    padding: 8px 12px;
    border-radius: 5px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.8em;
    transition: all 0.2s ease;
}

.vintage-button:hover {
    background: linear-gradient(135deg, #666, #444);
    transform: translateY(-1px);
}

.vintage-button:active {
    transform: translateY(1px);
}

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

.pattern-btn {
    background: linear-gradient(135deg, #444, #222);
    border: 2px solid #555;
    color: #ccc;
    padding: 10px;
    border-radius: 5px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.8em;
    transition: all 0.2s ease;
}

.pattern-btn:hover {
    border-color: #777;
    background: linear-gradient(135deg, #555, #333);
}

.pattern-btn.active {
    background: linear-gradient(135deg, #ffaa00, #ff8800);
    color: #000;
    border-color: #ffcc00;
}

.readout {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    padding: 5px 0;
    border-bottom: 1px solid #333;
}

.readout .label {
    font-size: 0.8em;
    color: #aaa;
}

.readout .value {
    font-size: 0.8em;
    color: #00ff00;
    font-weight: bold;
}

footer {
    text-align: center;
    margin-top: 30px;
    padding: 20px;
    color: #888;
    font-size: 0.9em;
}

footer a {
    color: #ffaa00;
    text-decoration: none;
}

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

/* Responsive design */
@media (max-width: 1200px) {
    .main-area {
        flex-direction: column;
    }
    
    .controls-section {
        min-width: auto;
    }
    
    #canvas {
        width: 100%;
        height: auto;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    header h1 {
        font-size: 1.8em;
    }
    
    .knob-row {
        flex-wrap: wrap;
        gap: 15px;
    }
    
    .switches-row {
        flex-wrap: wrap;
        gap: 15px;
    }
    
    .status-panel {
        flex-wrap: wrap;
        gap: 15px;
    }
    
    .crt-bezel {
        padding: 20px;
    }
}