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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #0a0a0a;
    color: #00ff00;
    overflow: hidden;
}

#canvas-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    cursor: grab;
}

#canvas-container:active {
    cursor: grabbing;
}

#controls {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.9);
    border: 1px solid #00ff00;
    border-radius: 8px;
    padding: 15px;
    width: 340px;
    backdrop-filter: blur(10px);
    pointer-events: all;
}

h2 {
    margin-bottom: 12px;
    font-size: 16px;
    color: #00ff00;
    text-shadow: 0 0 10px #00ff00;
}

.function-group {
    margin-bottom: 12px;
    padding: 8px;
    border: 1px solid #00ff0050;
    border-radius: 4px;
}

.function-group h3 {
    color: #00ffff;
    margin-bottom: 6px;
    font-size: 12px;
}

.function-input {
    width: 100%;
    padding: 6px;
    margin: 3px 0;
    background: #001100;
    border: 1px solid #00ff00;
    color: #00ff00;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 11px;
}

.control-group {
    margin: 10px 0;
}

.control-group-compact {
    margin: 8px 0;
}

label {
    display: block;
    margin-bottom: 3px;
    font-size: 11px;
    color: #00ffff;
}

input[type="range"] {
    width: 100%;
    margin: 3px 0;
    height: 20px;
}

input[type="checkbox"] {
    margin-right: 6px;
}

select {
    width: 100%;
    padding: 5px;
    background: #001100;
    border: 1px solid #00ff00;
    color: #00ff00;
    border-radius: 4px;
    font-size: 11px;
}

.checkbox-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5px;
    margin: 8px 0;
}

.checkbox-item {
    font-size: 11px;
    display: flex;
    align-items: center;
}

.button-group {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

button {
    flex: 1;
    padding: 6px;
    background: #002200;
    border: 1px solid #00ff00;
    color: #00ff00;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 11px;
}

button:hover {
    background: #00ff00;
    color: #000;
    box-shadow: 0 0 15px #00ff00;
}

.value-display {
    color: #ffff00;
    font-weight: bold;
}

#info {
    position: absolute;
    bottom: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.9);
    border: 1px solid #00ff00;
    border-radius: 4px;
    padding: 10px;
    font-size: 12px;
    font-family: 'Courier New', monospace;
    pointer-events: none;
}

#info.hidden {
    display: none;
}

.camera-info {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid #00ff0050;
    border-radius: 4px;
    padding: 6px;
    font-size: 10px;
    font-family: 'Courier New', monospace;
    color: #00ffff;
    pointer-events: none;
}

.camera-info.hidden {
    display: none;
}

#helpModal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

#helpContent {
    background: rgba(0, 20, 0, 0.95);
    border: 2px solid #00ff00;
    border-radius: 10px;
    padding: 30px;
    max-width: 700px;
    max-height: 80vh;
    overflow-y: auto;
    color: #00ff00;
    font-family: 'Courier New', monospace;
    box-shadow: 0 0 30px rgba(0, 255, 0, 0.3);
}

#helpContent h3 {
    color: #00ffff;
    margin-top: 20px;
    margin-bottom: 10px;
    font-size: 16px;
    border-bottom: 1px solid #00ff00;
    padding-bottom: 5px;
}

#helpContent h3:first-child {
    margin-top: 0;
}

.close-help {
    float: right;
    font-size: 28px;
    cursor: pointer;
    color: #ff4444;
    margin: -10px -10px 0 0;
    transition: color 0.3s;
}

.close-help:hover {
    color: #ff8888;
}

.help-section {
    margin: 15px 0;
    line-height: 1.6;
}

.help-example {
    background: rgba(0, 0, 0, 0.5);
    padding: 10px;
    margin: 10px 0;
    border-left: 3px solid #00ffff;
    font-size: 12px;
}

.help-key {
    color: #ffff00;
    font-weight: bold;
}

/* CRT Effect Overlay */
#crt-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 9999;
    display: none;
    background: 
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 2px,
            rgba(0, 255, 0, 0.03) 2px,
            rgba(0, 255, 0, 0.03) 4px
        ),
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(0, 0, 0, 0.1) 2px,
            rgba(0, 0, 0, 0.1) 4px
        );
    background-size: 4px 4px;
    animation: crt-flicker 0.15s infinite linear alternate;
}

#crt-overlay.active {
    display: block;
}

#crt-overlay::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(
        ellipse at center,
        transparent 0%,
        transparent 60%,
        rgba(0, 0, 0, 0.4) 100%
    );
    animation: crt-vignette 2s ease-in-out infinite alternate;
}

#crt-overlay::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        0deg,
        transparent 50%,
        rgba(0, 255, 0, 0.02) 50%
    );
    background-size: 100% 4px;
    animation: crt-scanlines 0.033s linear infinite;
}

@keyframes crt-flicker {
    0% {
        opacity: 1;
    }
    98% {
        opacity: 1;
    }
    99% {
        opacity: 0.98;
    }
    100% {
        opacity: 0.99;
    }
}

@keyframes crt-vignette {
    0% {
        opacity: 0.8;
    }
    100% {
        opacity: 1;
    }
}

@keyframes crt-scanlines {
    0% {
        transform: translateY(0);
    }
    100% {
        transform: translateY(4px);
    }
}