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

body {
    background: linear-gradient(135deg, #1a1a1a, #2d2d2d);
    font-family: 'Courier New', monospace;
    color: #00ff00;
    min-height: 100vh;
    overflow-x: auto;
}

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

.status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #333;
    padding: 10px 20px;
    border-radius: 5px 5px 0 0;
    border: 2px solid #555;
    font-size: 14px;
}

.mode-indicator {
    color: #ffff55;
    font-weight: bold;
}

.memory-usage {
    display: flex;
    align-items: center;
    gap: 10px;
}

.memory-bar {
    width: 100px;
    height: 10px;
    background: #222;
    border: 1px solid #555;
    position: relative;
}

.memory-fill {
    width: 75%;
    height: 100%;
    background: linear-gradient(90deg, #00ff00, #ffff00, #ff0000);
}

.sync-status {
    display: flex;
    align-items: center;
    gap: 5px;
}

.sync-light {
    width: 12px;
    height: 12px;
    background: #00ff00;
    border-radius: 50%;
    box-shadow: 0 0 10px #00ff00;
    animation: pulse 2s infinite;
}

.main-display {
    display: flex;
    gap: 20px;
    background: #222;
    border: 2px solid #555;
    border-top: none;
}

.crt-monitor {
    flex: 1;
    padding: 30px;
    background: radial-gradient(ellipse at center, #333 0%, #111 100%);
}

.monitor-bezel {
    position: relative;
    background: linear-gradient(145deg, #444, #222);
    padding: 30px;
    border-radius: 20px;
    box-shadow: 
        inset 0 0 30px rgba(0,0,0,0.8),
        0 0 50px rgba(0,255,0,0.1);
}

#vga-canvas {
    display: block;
    width: 100%;
    max-width: 640px;
    height: auto;
    background: #000;
    border: 3px solid #111;
    border-radius: 8px;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    position: relative;
    z-index: 1;
}

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

.phosphor-glow {
    position: absolute;
    top: 27px;
    left: 27px;
    right: 27px;
    bottom: 27px;
    pointer-events: none;
    box-shadow: inset 0 0 100px rgba(0,255,0,0.1);
    border-radius: 8px;
}

.control-panel {
    width: 280px;
    padding: 20px;
    background: #2a2a2a;
    border-left: 2px solid #555;
}

.control-panel h3 {
    color: #ffff55;
    margin-bottom: 20px;
    text-align: center;
    border-bottom: 1px solid #555;
    padding-bottom: 10px;
}

.control-group {
    margin-bottom: 20px;
}

.control-group label {
    display: block;
    margin-bottom: 8px;
    color: #aaa;
    font-size: 12px;
    text-transform: uppercase;
}

.control-group select,
.control-group button {
    width: 100%;
    padding: 8px;
    background: #333;
    color: #00ff00;
    border: 1px solid #555;
    border-radius: 3px;
    font-family: inherit;
    font-size: 12px;
    margin-bottom: 5px;
    cursor: pointer;
    transition: all 0.2s;
}

.control-group button:hover {
    background: #444;
    border-color: #00ff00;
}

.palette-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 2px;
    max-height: 120px;
    overflow-y: auto;
}

.palette-color {
    width: 20px;
    height: 20px;
    border: 1px solid #333;
    cursor: pointer;
    transition: all 0.2s;
}

.palette-color:hover {
    border-color: #fff;
    transform: scale(1.1);
}

.palette-color.selected {
    border: 2px solid #ffff00;
    box-shadow: 0 0 10px #ffff00;
}

.bottom-controls {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px;
    background: #333;
    border: 2px solid #555;
    border-top: none;
    border-radius: 0 0 5px 5px;
    flex-wrap: wrap;
}

.power-button {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    background: #444;
    border: 2px solid #666;
    border-radius: 50px;
    padding: 15px 20px;
    color: #aaa;
    font-family: inherit;
    font-size: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.power-button:hover {
    background: #555;
}

.power-led {
    width: 15px;
    height: 15px;
    background: #00ff00;
    border-radius: 50%;
    box-shadow: 0 0 15px #00ff00;
}

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

.slider-group label {
    font-size: 10px;
    color: #aaa;
    text-transform: uppercase;
}

.slider-group input[type="range"] {
    width: 80px;
    height: 20px;
    background: #222;
    border-radius: 10px;
    outline: none;
    cursor: pointer;
}

.slider-group input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 15px;
    height: 15px;
    background: #00ff00;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 10px #00ff00;
}

.slider-group input[type="range"]::-moz-range-thumb {
    width: 15px;
    height: 15px;
    background: #00ff00;
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 0 10px #00ff00;
}

#refresh-display {
    font-size: 10px;
    color: #ffff55;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

@keyframes scanlines {
    0% { transform: translateY(-100%); }
    100% { transform: translateY(100vh); }
}

@keyframes flicker {
    0% { opacity: 1; }
    100% { opacity: 0.98; }
}

/* Responsive design */
@media (max-width: 1200px) {
    .main-display {
        flex-direction: column;
    }
    
    .control-panel {
        width: 100%;
        border-left: none;
        border-top: 2px solid #555;
    }
    
    .bottom-controls {
        flex-wrap: wrap;
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .status-bar {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .monitor-bezel {
        padding: 15px;
    }
    
    .control-panel {
        padding: 15px;
    }
    
    .palette-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}