:root {
    --panel-bg: #2d2520;
    --panel-border: #4a3f35;
    --amber: #ff8c00;
    --amber-glow: #ffa500;
    --amber-dim: #553300;
    --led-off: #331a00;
    --terminal-green: #33ff33;
    --dark-bg: #1a1a1a;
    --label-cream: #d4c5a0;
    --button-face: #5a5048;
    --button-highlight: #7a6e64;
    --button-shadow: #2a2420;
}

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

body {
    background: var(--dark-bg);
    color: #ccc;
    font-family: 'Share Tech Mono', monospace;
    overflow-x: hidden;
}

.vt323 {
    font-family: 'VT323', monospace;
}

.share-tech {
    font-family: 'Share Tech Mono', monospace;
}

/* Front Panel */
.front-panel {
    background: linear-gradient(180deg, #3a332c 0%, #2d2520 30%, #251f1a 100%);
    border: 2px solid #4a3f35;
    border-radius: 4px;
    box-shadow: 
        inset 0 1px 0 rgba(255,255,255,0.05),
        0 4px 20px rgba(0,0,0,0.5),
        0 0 60px rgba(0,0,0,0.3);
    position: relative;
}

.front-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0,0,0,0.03) 2px,
        rgba(0,0,0,0.03) 4px
    );
    pointer-events: none;
    border-radius: 4px;
}

/* LED lights */
.led {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--led-off);
    border: 1px solid rgba(0,0,0,0.5);
    transition: all 0.05s ease;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.5);
}

.led.on {
    background: radial-gradient(circle at 40% 35%, #ffcc44, var(--amber) 40%, #cc6600 100%);
    box-shadow: 
        0 0 6px var(--amber),
        0 0 12px rgba(255,140,0,0.4),
        inset 0 0 3px rgba(255,255,255,0.3);
}

.led.on-green {
    background: radial-gradient(circle at 40% 35%, #88ff88, #33cc33 40%, #228822 100%);
    box-shadow: 
        0 0 6px #33ff33,
        0 0 12px rgba(51,255,51,0.4),
        inset 0 0 3px rgba(255,255,255,0.3);
}

.led.on-red {
    background: radial-gradient(circle at 40% 35%, #ff8888, #cc3333 40%, #882222 100%);
    box-shadow: 
        0 0 6px #ff3333,
        0 0 12px rgba(255,51,51,0.4),
        inset 0 0 3px rgba(255,255,255,0.3);
}

/* Toggle switches */
.switch-container {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.switch-body {
    width: 18px;
    height: 32px;
    background: linear-gradient(180deg, #555 0%, #333 100%);
    border-radius: 3px;
    border: 1px solid #222;
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.1);
}

.switch-toggle {
    width: 16px;
    height: 16px;
    background: linear-gradient(180deg, #eee 0%, #aaa 100%);
    border-radius: 2px;
    position: absolute;
    left: 0;
    transition: top 0.1s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

.switch-toggle.up {
    top: 0;
}

.switch-toggle.down {
    top: 15px;
}

/* Control buttons */
.panel-btn {
    background: linear-gradient(180deg, var(--button-highlight) 0%, var(--button-face) 40%, var(--button-shadow) 100%);
    color: var(--label-cream);
    border: 1px solid #1a1614;
    border-radius: 3px;
    padding: 6px 12px;
    font-family: 'Share Tech Mono', monospace;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    box-shadow: 
        0 2px 4px rgba(0,0,0,0.4),
        inset 0 1px 0 rgba(255,255,255,0.1);
    transition: all 0.1s ease;
    white-space: nowrap;
}

.panel-btn:hover {
    background: linear-gradient(180deg, #8a7e74 0%, #6a5e54 40%, #3a3430 100%);
}

.panel-btn:active {
    background: linear-gradient(180deg, #3a3430 0%, #5a5048 100%);
    box-shadow: 
        inset 0 2px 4px rgba(0,0,0,0.4);
    transform: translateY(1px);
}

.panel-btn.run-btn {
    background: linear-gradient(180deg, #4a6a3a 0%, #3a5a2a 40%, #2a4a1a 100%);
}

.panel-btn.run-btn:hover {
    background: linear-gradient(180deg, #5a7a4a 0%, #4a6a3a 40%, #3a5a2a 100%);
}

.panel-btn.halt-btn {
    background: linear-gradient(180deg, #8a3a2a 0%, #6a2a1a 40%, #4a1a0a 100%);
}

.panel-btn.halt-btn:hover {
    background: linear-gradient(180deg, #9a4a3a 0%, #7a3a2a 40%, #5a2a1a 100%);
}

/* Terminal */
.terminal {
    background: #0a0a0a;
    border: 2px solid #333;
    border-radius: 4px;
    font-family: 'VT323', monospace;
    color: var(--terminal-green);
    position: relative;
    overflow: hidden;
}

.terminal::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 1px,
        rgba(0,0,0,0.15) 1px,
        rgba(0,0,0,0.15) 3px
    );
    pointer-events: none;
    z-index: 1;
}

.terminal::after {
    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: 2;
}

.terminal-content {
    position: relative;
    z-index: 3;
    padding: 12px;
    min-height: 200px;
    max-height: 300px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-all;
    font-size: 18px;
    line-height: 1.3;
    text-shadow: 0 0 5px rgba(51,255,51,0.5);
}

/* Memory inspector */
.memory-cell {
    padding: 2px 6px;
    cursor: pointer;
    transition: background 0.1s;
    font-size: 13px;
}

.memory-cell:hover {
    background: rgba(255,140,0,0.15);
}

.memory-cell.current-pc {
    background: rgba(255,140,0,0.3);
    border-left: 2px solid var(--amber);
}

.memory-cell.modified {
    color: var(--amber);
}

.memory-cell.breakpoint {
    border-left: 2px solid #ff3333;
    background: rgba(255,0,0,0.1);
}

/* Disassembly */
.disasm-line {
    padding: 1px 6px;
    font-size: 13px;
    white-space: nowrap;
}

.disasm-line.current {
    background: rgba(255,140,0,0.25);
    border-left: 3px solid var(--amber);
}

.disasm-line.breakpoint-marker::before {
    content: '●';
    color: #ff3333;
    margin-right: 4px;
}

/* Editor */
.asm-editor {
    background: #1e1e1e;
    color: #d4d4d4;
    border: 1px solid #333;
    font-family: 'Share Tech Mono', monospace;
    font-size: 13px;
    padding: 8px;
    resize: vertical;
    width: 100%;
    min-height: 150px;
    border-radius: 3px;
    outline: none;
    tab-size: 8;
}

.asm-editor:focus {
    border-color: var(--amber);
}

/* Scrollbar styling */
::-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;
}

/* Blink animation */
@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.blink {
    animation: blink 1s infinite;
}

/* Pulse animation for status */
@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 4px currentColor; }
    50% { box-shadow: 0 0 12px currentColor, 0 0 20px currentColor; }
}

.pulse-glow {
    animation: pulse-glow 1.5s infinite;
}

/* Panel label engraved effect */
.engraved {
    color: var(--label-cream);
    text-shadow: 
        0 -1px 0 rgba(0,0,0,0.7),
        0 1px 0 rgba(255,255,255,0.05);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    font-size: 10px;
}

/* Tabs */
.tab-btn {
    padding: 4px 12px;
    font-size: 12px;
    font-family: 'Share Tech Mono', monospace;
    background: transparent;
    color: #888;
    border: 1px solid transparent;
    border-bottom: none;
    cursor: pointer;
    transition: all 0.15s;
}

.tab-btn.active {
    color: var(--amber);
    background: #1e1e1e;
    border-color: #333;
    border-bottom-color: #1e1e1e;
}

.tab-btn:hover:not(.active) {
    color: #bbb;
}

/* Responsive */
@media (max-width: 1024px) {
    .led {
        width: 10px;
        height: 10px;
    }
    .switch-body {
        width: 14px;
        height: 26px;
    }
    .switch-toggle {
        width: 12px;
        height: 13px;
    }
    .switch-toggle.down {
        top: 12px;
    }
}

@media (max-width: 768px) {
    .desktop-only {
        display: none !important;
    }
}