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

body {
    min-height: 100vh;
    background: linear-gradient(180deg, #1a1a2e 0%, #16213e 50%, #0f0f23 100%);
    font-family: 'VT323', monospace;
    color: #ccc;
    display: flex;
    justify-content: center;
    padding: 20px;
}

.container {
    max-width: 800px;
    width: 100%;
}

.monitor {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.monitor-frame {
    background: linear-gradient(145deg, #4a4a4a, #2a2a2a);
    border-radius: 20px;
    padding: 20px;
    box-shadow: 
        0 10px 40px rgba(0,0,0,0.5),
        inset 0 2px 0 rgba(255,255,255,0.1),
        inset 0 -2px 0 rgba(0,0,0,0.3);
}

.screen-bezel {
    background: #1a1a1a;
    border-radius: 10px;
    padding: 15px;
    box-shadow: inset 0 5px 20px rgba(0,0,0,0.8);
}

.screen-container {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    background: #000;
}

.screen-container.curved {
    border-radius: 20px / 15px;
}

.screen-container.curved canvas {
    border-radius: 20px / 15px;
}

#canvas {
    display: block;
    width: 100%;
    max-width: 640px;
    height: auto;
    aspect-ratio: 640 / 400;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

#canvas.glow {
    filter: blur(0.5px) brightness(1.1);
    box-shadow: 0 0 30px rgba(100, 255, 100, 0.3);
}

.screen-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 0, 0, 0) 2px,
        rgba(0, 0, 0, 0) 4px
    );
    opacity: 0;
}

.screen-container.scanlines .screen-overlay {
    opacity: 1;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 0, 0, 0.3) 2px,
        rgba(0, 0, 0, 0.3) 4px
    );
}

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

.screen-container.degaussing {
    animation: degauss 0.5s ease-out;
}

@keyframes degauss {
    0% { filter: hue-rotate(0deg) saturate(1); transform: scale(1); }
    20% { filter: hue-rotate(180deg) saturate(3); transform: scale(1.02, 0.98); }
    40% { filter: hue-rotate(-90deg) saturate(2); transform: scale(0.98, 1.02); }
    60% { filter: hue-rotate(45deg) saturate(1.5); transform: scale(1.01, 0.99); }
    80% { filter: hue-rotate(-20deg) saturate(1.2); transform: scale(0.99, 1.01); }
    100% { filter: hue-rotate(0deg) saturate(1); transform: scale(1); }
}

.screen-container.tapped {
    animation: tap 0.2s ease-out;
}

@keyframes tap {
    0% { filter: brightness(1); }
    50% { filter: brightness(1.3) blur(1px); }
    100% { filter: brightness(1); }
}

.screen-container.power-off canvas {
    opacity: 0;
    transition: opacity 0.3s;
}

.monitor-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px 0;
}

.brand-label {
    font-family: 'Press Start 2P', cursive;
    font-size: 10px;
    color: #666;
    text-shadow: 0 1px 0 #000;
}

.power-led {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #00ff00;
    box-shadow: 0 0 10px #00ff00, 0 0 20px #00ff00;
    cursor: pointer;
}

.power-led.off {
    background: #333;
    box-shadow: none;
}

.control-panel {
    background: linear-gradient(145deg, #d4c4a8, #a89878);
    border-radius: 10px;
    padding: 15px;
    display: grid;
    gap: 15px;
    box-shadow: 
        0 5px 20px rgba(0,0,0,0.3),
        inset 0 1px 0 rgba(255,255,255,0.3);
}

@media (min-width: 600px) {
    .control-panel {
        grid-template-columns: 1fr 1fr 1fr;
    }
}

.panel-section {
    background: rgba(0,0,0,0.1);
    border-radius: 8px;
    padding: 12px;
}

.section-title {
    font-family: 'Press Start 2P', cursive;
    font-size: 8px;
    color: #333;
    margin-bottom: 10px;
    text-align: center;
}

.mode-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

.mode-btn {
    background: linear-gradient(180deg, #555 0%, #333 100%);
    border: none;
    border-radius: 4px;
    color: #aaa;
    font-family: 'VT323', monospace;
    font-size: 12px;
    padding: 8px 4px;
    cursor: pointer;
    box-shadow: 
        0 2px 4px rgba(0,0,0,0.3),
        inset 0 1px 0 rgba(255,255,255,0.1);
    transition: all 0.1s;
}

.mode-btn:hover {
    background: linear-gradient(180deg, #666 0%, #444 100%);
    color: #fff;
}

.mode-btn.active {
    background: linear-gradient(180deg, #333 0%, #222 100%);
    box-shadow: 
        inset 0 2px 4px rgba(0,0,0,0.5);
    color: #0f0;
}

.effect-toggles {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toggle-switch {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.toggle-switch input {
    appearance: none;
    width: 16px;
    height: 16px;
    background: linear-gradient(180deg, #333 0%, #222 100%);
    border-radius: 3px;
    cursor: pointer;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.5);
}

.toggle-switch input:checked {
    background: linear-gradient(180deg, #00aa00 0%, #006600 100%);
    box-shadow: 0 0 8px rgba(0, 255, 0, 0.5), inset 0 1px 0 rgba(255,255,255,0.2);
}

.toggle-label {
    font-size: 12px;
    color: #333;
}

.monitor-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 10px;
}

.slider-control {
    display: flex;
    align-items: center;
    gap: 8px;
}

.slider-control label {
    font-size: 10px;
    color: #333;
    width: 60px;
    font-family: 'Press Start 2P', cursive;
}

.slider-control input[type="range"] {
    flex: 1;
    appearance: none;
    height: 8px;
    background: linear-gradient(180deg, #333 0%, #222 100%);
    border-radius: 4px;
    cursor: pointer;
}

.slider-control input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 16px;
    height: 16px;
    background: linear-gradient(180deg, #888 0%, #555 100%);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

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

.action-btn {
    flex: 1;
    background: linear-gradient(180deg, #666 0%, #444 100%);
    border: none;
    border-radius: 4px;
    color: #ddd;
    font-family: 'Press Start 2P', cursive;
    font-size: 6px;
    padding: 10px 4px;
    cursor: pointer;
    box-shadow: 
        0 3px 0 #222,
        0 5px 8px rgba(0,0,0,0.3);
    transition: all 0.1s;
}

.action-btn:hover {
    background: linear-gradient(180deg, #777 0%, #555 100%);
}

.action-btn:active {
    transform: translateY(2px);
    box-shadow: 
        0 1px 0 #222,
        0 2px 4px rgba(0,0,0,0.3);
}

.power-btn {
    background: linear-gradient(180deg, #aa4444 0%, #662222 100%);
}

.power-btn:hover {
    background: linear-gradient(180deg, #cc5555 0%, #883333 100%);
}

.footer {
    text-align: center;
    padding: 20px;
    font-family: 'Press Start 2P', cursive;
    font-size: 8px;
    color: #444;
}

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

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

/* Mobile adjustments */
@media (max-width: 600px) {
    .monitor-frame {
        padding: 10px;
        border-radius: 15px;
    }
    
    .screen-bezel {
        padding: 8px;
    }
    
    .mode-buttons {
        grid-template-columns: 1fr 1fr 1fr;
    }
    
    .mode-btn {
        font-size: 10px;
        padding: 6px 2px;
    }
    
    .action-btn {
        font-size: 5px;
        padding: 8px 2px;
    }
}