@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', monospace;
    background: #1a1a1a;
    color: #33ff33;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    background-image: 
        radial-gradient(circle at 1px 1px, #33ff33 1px, transparent 0);
    background-size: 20px 20px;
    background-attachment: fixed;
    opacity: 0.98;
}

.container {
    background: #2a2a2a;
    border: 2px solid #33ff33;
    border-radius: 15px;
    padding: 40px;
    max-width: 900px;
    width: 100%;
    box-shadow: 
        0 0 20px #33ff33,
        inset 0 0 20px rgba(51, 255, 51, 0.1);
}

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

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

.subtitle {
    color: #33ff33;
    opacity: 0.7;
    font-size: 0.9em;
    border-top: 1px dotted #33ff33;
    border-bottom: 1px dotted #33ff33;
    padding: 5px 0;
    margin: 10px 0;
}

.display-container {
    position: relative;
    width: 100%;
    max-width: 800px;
    height: 600px;
    margin: 0 auto 30px;
    border: 2px solid #33ff33;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 
        0 0 15px #33ff33,
        inset 0 0 15px rgba(51, 255, 51, 0.1);
    background: #000;
}

#video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

#canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
}

#previewCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    background: transparent;
}

.scan-line {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, #33ff33, #33ff33, transparent);
    box-shadow: 
        0 0 10px #33ff33, 
        0 0 20px #33ff33,
        0 0 30px #33ff33;
    z-index: 100;
    opacity: 0;
    transition: none;
}

.scan-line.active {
    opacity: 1;
}

.controls-section {
    margin: 20px 0;
}

.section-header {
    color: #33ff33;
    font-weight: bold;
    text-align: center;
    margin: 15px 0 10px 0;
    border-top: 1px dotted #33ff33;
    border-bottom: 1px dotted #33ff33;
    padding: 5px 0;
    font-size: 0.9em;
    letter-spacing: 1px;
}

.speed-control {
    display: flex;
    align-items: center;
    gap: 20px;
    margin: 25px 0;
    background: rgba(51, 255, 51, 0.05);
    padding: 20px;
    border: 1px solid #33ff33;
    border-radius: 8px;
}

.speed-control label {
    font-weight: bold;
    color: #33ff33;
    min-width: 100px;
}

.speed-control input[type="range"] {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: #1a1a1a;
    outline: none;
    -webkit-appearance: none;
    border: 1px solid #33ff33;
}

.speed-control input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #33ff33;
    cursor: pointer;
    box-shadow: 0 0 10px #33ff33;
}

.speed-control input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #33ff33;
    cursor: pointer;
    border: none;
    box-shadow: 0 0 10px #33ff33;
}

.speed-value {
    color: #33ff33;
    font-weight: bold;
    min-width: 40px;
    text-align: right;
}

.controls {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
    margin: 25px 0;
    flex-flow: column;
}

button {
    background: #1a1a1a;
    color: #33ff33;
    border: 2px solid #33ff33;
    padding: 15px 30px;
    border-radius: 8px;
    font-family: 'Courier Prime', monospace;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
}

button:hover:not(:disabled) {
    background: rgba(51, 255, 51, 0.1);
    box-shadow: 
        0 0 15px #33ff33,
        inset 0 0 15px rgba(51, 255, 51, 0.1);
    transform: translateY(-1px);
}

button:active:not(:disabled) {
    transform: translateY(1px);
}

button:disabled {
    background: #333;
    color: #666;
    border-color: #666;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.status {
    text-align: center;
    margin: 25px 0;
    font-weight: bold;
    color: #33ff33;
    background: rgba(51, 255, 51, 0.05);
    padding: 15px;
    border: 1px solid #33ff33;
    border-radius: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 1em;
}

.glow-text {
    text-shadow: 0 0 10px #33ff33;
}

.blinking-cursor::after {
    content: '_';
    animation: blink 1s infinite;
    color: #33ff33;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

.container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        transparent 50%, 
        rgba(51, 255, 51, 0.03) 50%
    );
    background-size: 100% 4px;
    pointer-events: none;
    border-radius: 15px;
}