@import url('https://fonts.googleapis.com/css2?family=Courier+Prime:wght@400;700&display=swap');

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

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

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

.header {
    text-align: center;
    margin-bottom: 30px;
    background: rgba(0, 0, 0, 0.8);
    padding: 20px;
    border-radius: 10px;
    border: 2px solid #00FF41;
    box-shadow: 0 0 20px rgba(0, 255, 65, 0.3);
}

.title {
    font-size: 2.5em;
    font-weight: bold;
    color: #00FF41;
    text-shadow: 0 0 10px #00FF41;
    margin-bottom: 10px;
    letter-spacing: 2px;
}

.subtitle {
    font-size: 1.2em;
    color: #66FF66;
    opacity: 0.8;
}

.main-content {
    display: grid;
    grid-template-columns: 250px 1fr 250px;
    gap: 30px;
    margin-bottom: 30px;
    align-items: start;
}

.control-panel {
    background: rgba(0, 0, 0, 0.9);
    border: 2px solid #00FF41;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 0 15px rgba(0, 255, 65, 0.2);
}

.control-panel h3 {
    color: #00FF41;
    margin-bottom: 20px;
    text-align: center;
    font-size: 1.1em;
    text-shadow: 0 0 5px #00FF41;
}

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

.control-group label {
    display: block;
    margin-bottom: 5px;
    font-size: 0.9em;
    color: #66FF66;
}

.control-group input[type="range"] {
    width: 100%;
    margin-bottom: 5px;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    background: #333;
    border-radius: 3px;
    outline: none;
}

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

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

.control-group select {
    width: 100%;
    padding: 8px;
    background: #1a1a1a;
    border: 1px solid #00FF41;
    border-radius: 4px;
    color: #00FF41;
    font-family: inherit;
}

.control-group .value {
    float: right;
    font-size: 0.8em;
    color: #00FF41;
}

.crt-container {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.crt-bezel {
    position: relative;
    background: #2a2a2a;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 
        inset 0 0 50px rgba(0, 0, 0, 0.8),
        0 0 30px rgba(0, 0, 0, 0.5);
    border: 8px solid #1a1a1a;
}

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

#canvas {
    background: #000;
    border-radius: 8px;
    box-shadow: 
        inset 0 0 30px rgba(0, 255, 65, 0.1),
        0 0 20px rgba(0, 0, 0, 0.8);
    filter: brightness(1.1) contrast(1.2);
    transform: perspective(1000px) rotateX(1deg);
}

.scanlines {
    position: absolute;
    top: 40px;
    left: 40px;
    right: 40px;
    bottom: 40px;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 1px,
        rgba(0, 255, 65, 0.03) 2px,
        rgba(0, 255, 65, 0.03) 3px
    );
    pointer-events: none;
    border-radius: 8px;
    opacity: 0.4;
    animation: scanline-flicker 0.1s infinite linear;
}

@keyframes scanline-flicker {
    0% { opacity: 0.4; }
    50% { opacity: 0.3; }
    100% { opacity: 0.4; }
}

.status-panel {
    display: flex;
    gap: 20px;
    margin-top: 15px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid #00FF41;
    border-radius: 5px;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9em;
    color: #66FF66;
}

.led {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.led.green {
    background: #00FF00;
    box-shadow: 0 0 5px #00FF00;
}

.led.red {
    background: #FF0000;
    box-shadow: 0 0 5px #FF0000;
}

.action-panel {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
}

.action-btn {
    padding: 12px 24px;
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid #00FF41;
    border-radius: 6px;
    color: #00FF41;
    font-family: inherit;
    font-size: 0.9em;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.action-btn:hover {
    background: rgba(0, 255, 65, 0.1);
    box-shadow: 0 0 10px rgba(0, 255, 65, 0.3);
    transform: translateY(-2px);
}

.action-btn:active {
    transform: translateY(0);
}

.footer {
    text-align: center;
    padding: 20px;
    border-top: 1px solid #00FF41;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 10px;
}

.tech-specs {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 15px;
    font-size: 0.9em;
    color: #66FF66;
}

.footer p {
    font-size: 0.9em;
    color: #66FF66;
}

.footer a {
    color: #00FF41;
    text-decoration: none;
    text-shadow: 0 0 3px #00FF41;
}

.footer a:hover {
    text-shadow: 0 0 6px #00FF41;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .main-content {
        grid-template-columns: 200px 1fr 200px;
        gap: 20px;
    }
    
    .control-panel {
        padding: 15px;
    }
    
    #canvas {
        width: 480px;
        height: 300px;
    }
}

@media (max-width: 900px) {
    .main-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .left-controls {
        order: 2;
    }
    
    .crt-container {
        order: 1;
    }
    
    .right-controls {
        order: 3;
    }
    
    .control-panel {
        max-width: 600px;
        margin: 0 auto;
    }
    
    #canvas {
        width: 400px;
        height: 250px;
    }
    
    .action-panel {
        flex-wrap: wrap;
    }
    
    .tech-specs {
        flex-direction: column;
        gap: 10px;
    }
}

@media (max-width: 600px) {
    .container {
        padding: 10px;
    }
    
    .title {
        font-size: 1.8em;
    }
    
    #canvas {
        width: 320px;
        height: 200px;
    }
    
    .crt-bezel {
        padding: 20px;
    }
    
    .action-btn {
        padding: 10px 16px;
        font-size: 0.8em;
    }
}

/* Retro CRT glow effect */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, rgba(0, 255, 65, 0.05) 0%, transparent 70%);
    pointer-events: none;
    z-index: -1;
}

/* Screen flicker animation */
@keyframes screen-flicker {
    0% { opacity: 1; }
    98% { opacity: 1; }
    99% { opacity: 0.98; }
    100% { opacity: 1; }
}

#canvas {
    animation: screen-flicker 0.15s infinite linear;
}