:root {
    --beige: #C8C0B0;
    --beige-dark: #A89880;
    --beige-light: #D8D0C4;
    --charcoal: #2C2C2C;
    --ibm-blue: #0530AD;
    --green-phosphor: #33FF33;
    --amber-phosphor: #FFB000;
    --white-phosphor: #FFFFFF;
    --cga-black: #000000;
    --cga-blue: #0000AA;
    --cga-green: #00AA00;
    --cga-cyan: #00AAAA;
    --cga-red: #AA0000;
    --cga-magenta: #AA00AA;
    --cga-brown: #AA5500;
    --cga-lightgray: #AAAAAA;
    --cga-darkgray: #555555;
    --cga-lightblue: #5555FF;
    --cga-lightgreen: #55FF55;
    --cga-lightcyan: #55FFFF;
    --cga-lightred: #FF5555;
    --cga-lightmagenta: #FF55FF;
    --cga-yellow: #FFFF55;
    --cga-white: #FFFFFF;
}

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

body {
    background: #111;
    font-family: 'IBM Plex Sans', sans-serif;
    color: #ccc;
    overflow-x: hidden;
    min-height: 100vh;
}

/* Scanline overlay */
.scanlines {
    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.15) 2px,
        rgba(0, 0, 0, 0.15) 4px
    );
    z-index: 2;
}

/* CRT curvature effect */
.crt-screen {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
}

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

.crt-screen::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: radial-gradient(
        ellipse at 30% 20%,
        rgba(255,255,255,0.03) 0%,
        transparent 60%
    );
    pointer-events: none;
    z-index: 4;
}

/* Monitor bezel */
.monitor-bezel {
    background: linear-gradient(170deg, #D0C8B8 0%, #B8B0A0 30%, #A89888 70%, #988878 100%);
    border-radius: 24px;
    padding: 28px 32px 36px;
    box-shadow:
        0 8px 32px rgba(0,0,0,0.6),
        inset 0 1px 0 rgba(255,255,255,0.3),
        inset 0 -2px 4px rgba(0,0,0,0.2);
    position: relative;
}

.monitor-bezel::before {
    content: '';
    position: absolute;
    top: 4px; left: 4px; right: 4px; bottom: 4px;
    border-radius: 22px;
    border: 1px solid rgba(255,255,255,0.15);
    pointer-events: none;
}

/* Screen glow */
.screen-glow-green {
    box-shadow: 0 0 60px rgba(51, 255, 51, 0.15), 0 0 120px rgba(51, 255, 51, 0.05);
}

.screen-glow-amber {
    box-shadow: 0 0 60px rgba(255, 176, 0, 0.15), 0 0 120px rgba(255, 176, 0, 0.05);
}

.screen-glow-color {
    box-shadow: 0 0 60px rgba(100, 100, 255, 0.1), 0 0 120px rgba(100, 100, 255, 0.05);
}

/* Title bar pinstripe */
.pinstripe {
    background: repeating-linear-gradient(
        0deg,
        #2C2C2C,
        #2C2C2C 2px,
        #333333 2px,
        #333333 4px
    );
}

/* Chunky button styles */
.chunky-btn {
    position: relative;
    border: none;
    border-radius: 4px;
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 600;
    font-size: 11px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.1s ease;
    padding: 8px 16px;
}

.chunky-btn:active {
    transform: translateY(2px);
}

.chunky-btn-red {
    background: linear-gradient(180deg, #e83030 0%, #b01010 100%);
    color: white;
    box-shadow: 0 3px 0 #800000, 0 4px 8px rgba(0,0,0,0.3);
    text-shadow: 0 1px 1px rgba(0,0,0,0.3);
}
.chunky-btn-red:active {
    box-shadow: 0 1px 0 #800000, 0 2px 4px rgba(0,0,0,0.3);
}

.chunky-btn-yellow {
    background: linear-gradient(180deg, #f0c020 0%, #c09010 100%);
    color: #333;
    box-shadow: 0 3px 0 #906800, 0 4px 8px rgba(0,0,0,0.3);
}
.chunky-btn-yellow:active {
    box-shadow: 0 1px 0 #906800, 0 2px 4px rgba(0,0,0,0.3);
}

.chunky-btn-gray {
    background: linear-gradient(180deg, #888 0%, #666 100%);
    color: white;
    box-shadow: 0 3px 0 #444, 0 4px 8px rgba(0,0,0,0.3);
}
.chunky-btn-gray:active {
    box-shadow: 0 1px 0 #444, 0 2px 4px rgba(0,0,0,0.3);
}

.chunky-btn-blue {
    background: linear-gradient(180deg, #2060d0 0%, #0530AD 100%);
    color: white;
    box-shadow: 0 3px 0 #021878, 0 4px 8px rgba(0,0,0,0.3);
    text-shadow: 0 1px 1px rgba(0,0,0,0.3);
}

/* LED indicators */
.led {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    transition: all 0.15s;
}

.led-off {
    background: #333;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.5);
}

.led-red {
    background: #ff2020;
    box-shadow: 0 0 6px #ff2020, 0 0 12px rgba(255,32,32,0.4);
}

.led-green {
    background: #20ff20;
    box-shadow: 0 0 6px #20ff20, 0 0 12px rgba(32,255,32,0.4);
}

.led-amber {
    background: #ffaa00;
    box-shadow: 0 0 6px #ffaa00, 0 0 12px rgba(255,170,0,0.4);
}

@keyframes blink-led {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.led-blink {
    animation: blink-led 0.3s ease-in-out infinite;
}

/* Drive bay styling */
.drive-slot {
    background: linear-gradient(180deg, #444 0%, #333 100%);
    border: 2px solid #222;
    border-radius: 4px;
    position: relative;
    overflow: hidden;
}

.drive-slot::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 10%;
    right: 10%;
    height: 3px;
    background: #222;
    border-radius: 2px;
    transform: translateY(-50%);
}

.drive-slot.has-disk::before {
    display: none;
}

/* Floppy disk icon */
.floppy-icon {
    width: 48px;
    height: 52px;
    background: linear-gradient(180deg, #2255cc 0%, #1a44aa 100%);
    border-radius: 3px;
    position: relative;
    display: inline-block;
}

.floppy-icon::before {
    content: '';
    position: absolute;
    top: 4px;
    left: 12px;
    right: 12px;
    height: 16px;
    background: #ddd;
    border-radius: 2px;
}

.floppy-icon::after {
    content: '';
    position: absolute;
    bottom: 6px;
    left: 8px;
    right: 8px;
    height: 18px;
    background: rgba(255,255,255,0.1);
    border-radius: 2px;
}

/* Register display */
.reg-grid {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12px;
    line-height: 1.6;
}

.reg-changed {
    color: #FFFF55 !important;
    transition: color 0.3s;
}

/* Memory viewer */
.hex-dump {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    line-height: 1.5;
    color: #88cc88;
}

/* Knob control */
.knob-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.knob {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #888 0%, #555 50%, #777 100%);
    box-shadow: 0 2px 6px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.2);
    cursor: pointer;
    position: relative;
    transition: transform 0.1s;
}

.knob::after {
    content: '';
    position: absolute;
    top: 6px;
    left: 50%;
    width: 2px;
    height: 10px;
    background: white;
    transform: translateX(-50%);
    border-radius: 1px;
}

/* Power on CRT animation */
@keyframes crt-on {
    0% {
        transform: scaleY(0.005) scaleX(0.8);
        filter: brightness(10);
    }
    20% {
        transform: scaleY(0.005) scaleX(0.8);
        filter: brightness(5);
    }
    40% {
        transform: scaleY(1) scaleX(1);
        filter: brightness(2);
    }
    100% {
        transform: scaleY(1) scaleX(1);
        filter: brightness(1);
    }
}

.crt-poweron {
    animation: crt-on 0.6s ease-out forwards;
}

@keyframes crt-off {
    0% {
        transform: scaleY(1) scaleX(1);
        filter: brightness(1);
    }
    40% {
        transform: scaleY(0.005) scaleX(0.8);
        filter: brightness(10);
    }
    100% {
        transform: scaleY(0) scaleX(0);
        filter: brightness(0);
    }
}

.crt-poweroff {
    animation: crt-off 0.4s ease-in forwards;
}

/* Toggle switch */
.toggle-switch {
    width: 48px;
    height: 24px;
    border-radius: 12px;
    background: #333;
    border: 2px solid #555;
    cursor: pointer;
    position: relative;
    transition: background 0.2s;
}

.toggle-switch.on {
    background: #0530AD;
    border-color: #0740CC;
}

.toggle-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: linear-gradient(180deg, #eee, #bbb);
    transition: left 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.toggle-switch.on::after {
    left: 26px;
}

/* Tooltip */
.tooltip {
    position: relative;
}

.tooltip .tooltip-text {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    bottom: 120%;
    left: 50%;
    transform: translateX(-50%);
    background: #222;
    color: #ffd;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    transition: opacity 0.2s;
    z-index: 100;
    border: 1px solid #444;
}

.tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #1a1a1a;
}

::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Drop zone */
.drop-zone {
    border: 2px dashed #555;
    border-radius: 6px;
    transition: all 0.2s;
    cursor: pointer;
}

.drop-zone:hover, .drop-zone.drag-over {
    border-color: #0530AD;
    background: rgba(5, 48, 173, 0.1);
}

/* Section panel */
.panel {
    background: linear-gradient(180deg, #222 0%, #1a1a1a 100%);
    border: 1px solid #333;
    border-radius: 8px;
}