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

body {
    background: #1a1a1a;
    font-family: 'IBM Plex Mono', monospace;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    color: #c0c0c0;
    overflow-x: hidden;
}

#monitor-frame {
    max-width: 1020px;
    width: 95vw;
    margin: 20px auto 10px;
}

#monitor-bezel {
    background: linear-gradient(180deg, #d4c9a0 0%, #c8b88a 30%, #b8a87a 100%);
    border-radius: 18px 18px 8px 8px;
    padding: 22px 28px 14px;
    position: relative;
    box-shadow:
        0 0 0 3px #a09070,
        0 8px 32px rgba(0,0,0,0.6),
        inset 0 1px 0 rgba(255,255,255,0.3);
}

#brand-label {
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    color: #555;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin-bottom: 8px;
    padding-left: 4px;
}

#crt-container {
    position: relative;
    background: #0a0a0a;
    border-radius: 12px;
    overflow: hidden;
    border: 3px solid #222;
    box-shadow:
        inset 0 0 60px rgba(0,0,0,0.8),
        0 0 2px #000;
    aspect-ratio: 960 / 600;
}

#canvas {
    width: 100%;
    height: 100%;
    display: block;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    border-radius: 8px;
}

.crt-curved #crt-container {
    border-radius: 20px;
}
.crt-curved #canvas {
    border-radius: 16px;
}

#scanlines-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    pointer-events: none;
    background: repeating-linear-gradient(
        to bottom,
        transparent 0px,
        transparent 2px,
        rgba(0,0,0,0.12) 2px,
        rgba(0,0,0,0.12) 4px
    );
    z-index: 2;
}
#scanlines-overlay.hidden { display: none; }

#crt-vignette {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    pointer-events: none;
    background: radial-gradient(ellipse at center, transparent 60%, rgba(0,0,0,0.4) 100%);
    z-index: 3;
}

#capture-hint {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #33ff33;
    font-size: 14px;
    font-family: 'IBM Plex Mono', monospace;
    text-shadow: 0 0 8px #33ff33;
    z-index: 5;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
}
#capture-hint.visible {
    opacity: 1;
}

#power-led {
    position: absolute;
    bottom: 10px;
    right: 36px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: 1px solid #666;
}
#power-led.led-off {
    background: #2a3a2a;
    box-shadow: none;
}
#power-led.led-on {
    background: #33ff33;
    box-shadow: 0 0 6px #33ff33, 0 0 12px rgba(51,255,51,0.4);
}

#control-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    background: linear-gradient(180deg, #d0c490 0%, #c8b88a 50%, #baa87a 100%);
    border-radius: 0 0 12px 12px;
    padding: 10px 16px;
    border-top: 2px solid #a09070;
    box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}

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

.retro-btn {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    font-weight: 700;
    padding: 6px 14px;
    border: 2px outset #ddd;
    border-radius: 3px;
    background: linear-gradient(180deg, #e8e0d0, #c8c0b0);
    color: #333;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    user-select: none;
}
.retro-btn:active {
    border-style: inset;
    background: linear-gradient(180deg, #b8b0a0, #c8c0b0);
}
.retro-btn.btn-small {
    padding: 4px 10px;
    font-size: 10px;
}

#btn-power.power-off {
    color: #900;
    border-color: #a88;
}
#btn-power.power-on {
    color: #090;
    border-color: #8a8;
    background: linear-gradient(180deg, #d0e8d0, #a0c8a0);
}

.floppy-group {
    flex: 1;
    justify-content: center;
}

#floppy-drive {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #b0a880;
    padding: 4px 10px;
    border-radius: 4px;
    border: 1px inset #999;
}

#floppy-slot {
    width: 60px;
    height: 4px;
    background: #333;
    border-radius: 2px;
    border: 1px solid #555;
}

#floppy-led {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    border: 1px solid #666;
}
#floppy-led.led-off { background: #3a2a2a; }
#floppy-led.led-on {
    background: #ff3333;
    box-shadow: 0 0 4px #ff3333;
}

.floppy-btn {
    cursor: pointer;
    display: inline-block;
}

.speed-label {
    font-size: 11px;
    color: #555;
    font-weight: 700;
}
#speed-display {
    color: #33ff33;
    text-shadow: 0 0 4px rgba(51,255,51,0.3);
}

.vol-label {
    font-size: 10px;
    color: #555;
    display: flex;
    align-items: center;
    gap: 4px;
}

.retro-slider {
    width: 60px;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: #888;
    border-radius: 2px;
    outline: none;
}
.retro-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    background: #ddd;
    border: 1px solid #888;
    border-radius: 2px;
    cursor: pointer;
}

#status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    background: #111;
    color: #33ff33;
    font-size: 10px;
    padding: 4px 12px;
    border-radius: 0 0 8px 8px;
    text-shadow: 0 0 4px rgba(51,255,51,0.3);
}

.key-ind {
    padding: 1px 4px;
    border: 1px solid #333;
    border-radius: 2px;
    color: #555;
    font-size: 9px;
}
.key-ind.active {
    color: #33ff33;
    border-color: #33ff33;
    text-shadow: 0 0 4px #33ff33;
}

#settings-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.8);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
}
#settings-modal.hidden { display: none; }

#settings-content {
    background: linear-gradient(180deg, #d4c9a0, #c0b088);
    color: #333;
    padding: 24px 30px;
    border-radius: 8px;
    border: 2px outset #ddd;
    min-width: 300px;
    max-width: 400px;
    font-size: 13px;
}
#settings-content h2 {
    margin-bottom: 16px;
    font-size: 16px;
    letter-spacing: 1px;
}
.setting-row {
    margin-bottom: 10px;
}
.setting-row label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}
#btn-close-settings {
    margin-top: 16px;
    width: 100%;
}
.about-info {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid #a09070;
    font-size: 10px;
    color: #666;
    line-height: 1.6;
}

#app-footer {
    margin: 10px 0 20px;
    font-size: 11px;
    color: #33ff33;
    text-shadow: 0 0 6px rgba(51,255,51,0.3);
}
#app-footer a {
    color: #33ff33;
    text-decoration: none;
    border-bottom: 1px solid rgba(51,255,51,0.4);
}
#app-footer a:hover {
    color: #66ff66;
}

@media (max-width: 700px) {
    #monitor-bezel {
        padding: 12px 10px 8px;
        border-radius: 10px 10px 4px 4px;
    }
    #control-panel {
        flex-direction: column;
        padding: 8px;
    }
    .control-group { justify-content: center; }
    #status-bar {
        flex-direction: column;
        text-align: center;
    }
    #brand-label { font-size: 9px; }
}

@keyframes powerOn {
    0% { filter: brightness(0); }
    10% { filter: brightness(2); }
    30% { filter: brightness(0.8); }
    100% { filter: brightness(1); }
}

@keyframes powerOff {
    0% { filter: brightness(1); }
    50% { filter: brightness(2) contrast(2); }
    100% { filter: brightness(0); }
}

.power-on-anim {
    animation: powerOn 0.6s ease-out;
}
.power-off-anim {
    animation: powerOff 0.4s ease-in forwards;
}