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

body {
    font-family: 'Courier New', monospace;
    background: linear-gradient(45deg, #2c1810, #1a0f08);
    min-height: 100vh;
    color: #d4af37;
    overflow-x: auto;
}

.room-background {
    background: 
        radial-gradient(circle at 30% 20%, rgba(255, 200, 100, 0.1) 0%, transparent 50%),
        linear-gradient(135deg, #3c2415 0%, #2c1810 50%, #1a0f08 100%);
    min-height: 100vh;
    padding: 20px;
    position: relative;
}

.tv-container {
    max-width: 900px;
    margin: 0 auto;
    perspective: 1000px;
    filter: drop-shadow(0 20px 40px rgba(0,0,0,0.8));
}

.tv-bezel {
    background: linear-gradient(145deg, #4a3428, #2c1e16, #1a110a);
    border-radius: 20px;
    padding: 40px 30px 20px 30px;
    position: relative;
    border: 3px solid #6b4423;
    box-shadow: 
        inset 0 0 20px rgba(0,0,0,0.5),
        0 10px 30px rgba(0,0,0,0.7);
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

.brand-label {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 14px;
    font-weight: bold;
    color: #c9a96e;
    text-shadow: 0 1px 2px rgba(0,0,0,0.8);
    letter-spacing: 2px;
}

.screen-container {
    position: relative;
    flex: 1;
}

#canvas {
    width: 100%;
    height: auto;
    max-width: 640px;
    border-radius: 15px;
    border: 4px solid #2a1810;
    box-shadow: 
        inset 0 0 30px rgba(0,0,0,0.8),
        0 0 20px rgba(0,200,255,0.1);
    background: #000;
    display: block;
    margin: 0 auto;
}

.screen-reflection {
    position: absolute;
    top: 4px;
    left: 4px;
    right: 4px;
    height: 30%;
    background: linear-gradient(135deg, 
        rgba(255,255,255,0.1) 0%, 
        rgba(255,255,255,0.05) 50%, 
        transparent 100%);
    border-radius: 15px 15px 0 0;
    pointer-events: none;
}

.control-panel {
    display: flex;
    flex-direction: column;
    gap: 25px;
    min-width: 120px;
    align-items: center;
}

.power-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.power-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 3px solid #3c2b1f;
    background: linear-gradient(145deg, #5d4332, #3c2b1f);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    position: relative;
}

.power-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.4);
}

.power-led {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #ff0000;
    box-shadow: 0 0 10px rgba(255,0,0,0.5);
    transition: all 0.3s ease;
}

.power-led.on {
    background: #00ff00;
    box-shadow: 0 0 15px rgba(0,255,0,0.8);
}

.knob-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

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

.knob {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(145deg, #6b4423, #4a3428);
    border: 2px solid #3c2b1f;
    cursor: pointer;
    position: relative;
    transition: all 0.1s ease;
}

.knob:hover {
    transform: scale(1.05);
}

.knob-indicator {
    position: absolute;
    top: 5px;
    left: 50%;
    transform: translateX(-50%);
    width: 3px;
    height: 15px;
    background: #d4af37;
    border-radius: 2px;
    box-shadow: 0 0 5px rgba(212, 175, 55, 0.6);
}

.control-panel label {
    font-size: 10px;
    font-weight: bold;
    color: #c9a96e;
    text-align: center;
    letter-spacing: 1px;
}

.bottom-controls {
    margin-top: 30px;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
    align-items: center;
    padding: 20px;
    background: linear-gradient(145deg, #3c2b1f, #2a1e16);
    border-radius: 15px;
    border: 2px solid #4a3428;
}

.input-selector {
    display: flex;
    gap: 10px;
}

.input-btn {
    padding: 8px 16px;
    background: linear-gradient(145deg, #4a3428, #3c2b1f);
    color: #d4af37;
    border: 2px solid #6b4423;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    font-size: 12px;
    font-weight: bold;
    transition: all 0.2s ease;
}

.input-btn:hover {
    background: linear-gradient(145deg, #6b4423, #4a3428);
    transform: translateY(-1px);
}

.input-btn.active {
    background: linear-gradient(145deg, #d4af37, #c9a96e);
    color: #1a0f08;
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.4);
}

.effect-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    cursor: pointer;
}

.toggle-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #d4af37;
}

.slider-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
}

.slider-label input[type="range"] {
    width: 80px;
    accent-color: #d4af37;
}

.action-buttons {
    display: flex;
    gap: 10px;
}

.action-buttons button {
    padding: 10px 16px;
    background: linear-gradient(145deg, #4a3428, #3c2b1f);
    color: #d4af37;
    border: 2px solid #6b4423;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    font-size: 12px;
    font-weight: bold;
    transition: all 0.2s ease;
}

.action-buttons button:hover {
    background: linear-gradient(145deg, #6b4423, #4a3428);
    transform: translateY(-1px);
}

.warning-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.warning-content {
    background: linear-gradient(145deg, #4a3428, #3c2b1f);
    border: 3px solid #d4af37;
    border-radius: 15px;
    padding: 30px;
    max-width: 400px;
    text-align: center;
    color: #d4af37;
}

.warning-content h3 {
    margin-bottom: 15px;
    color: #ff6b6b;
}

.warning-content p {
    margin-bottom: 20px;
    line-height: 1.5;
}

.warning-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.warning-buttons button {
    padding: 10px 20px;
    background: linear-gradient(145deg, #d4af37, #c9a96e);
    color: #1a0f08;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    font-weight: bold;
    transition: all 0.2s ease;
}

.warning-buttons button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.4);
}

.app-footer {
    text-align: center;
    padding: 20px;
    color: #c9a96e;
    font-size: 14px;
    margin-top: 30px;
}

.app-footer a {
    color: #d4af37;
    text-decoration: none;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .tv-bezel {
        flex-direction: column;
        padding: 20px;
        gap: 20px;
    }
    
    .control-panel {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        min-width: auto;
    }
    
    .knob-section {
        flex-direction: row;
        gap: 15px;
    }
    
    .bottom-controls {
        flex-direction: column;
        gap: 15px;
    }
    
    .effect-controls {
        justify-content: center;
    }
    
    .warning-content {
        margin: 20px;
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .tv-container {
        margin: 0 10px;
    }
    
    .input-selector {
        flex-direction: column;
        gap: 8px;
    }
    
    .effect-controls {
        flex-direction: column;
        gap: 10px;
    }
    
    .knob, .power-button {
        width: 40px;
        height: 40px;
    }
    
    .control-panel label {
        font-size: 9px;
    }
}

/* CRT Screen Effects */
@keyframes scanline {
    0% { transform: translateY(-100%); }
    100% { transform: translateY(100vh); }
}

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

#canvas:not(.off) {
    animation: subtle-flicker 0.15s linear infinite alternate;
}

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