:root {
  --bg-deep: #0a0a1a;
  --bg-panel: #0d1b2e;
  --bg-card: #111a2e;
  --vic-cyan: #66d9ef;
  --vic-blue: #4040e0;
  --vic-green: #40c040;
  --vic-red: #e04040;
  --vic-yellow: #e0e040;
  --vic-white: #ffffff;
  --vic-beige: #d4c5a9;
  --vic-brown: #6b5c3e;
  --bezel-color: #2a2520;
  --text-dim: #6688aa;
}

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

body {
  background: var(--bg-deep);
  font-family: 'JetBrains Mono', monospace;
  color: #c0d0e0;
  overflow-x: hidden;
  min-height: 100vh;
}

body::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: 
    radial-gradient(ellipse at 50% 0%, rgba(102,217,239,0.03) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 100%, rgba(64,64,224,0.04) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

#root { position: relative; z-index: 1; }

.crt-screen {
  position: relative;
  background: #000;
  border-radius: 16px;
  overflow: hidden;
  box-shadow:
    0 0 30px rgba(102,217,239,0.15),
    0 0 60px rgba(102,217,239,0.05),
    inset 0 0 80px rgba(0,0,0,0.8);
}

.crt-screen canvas {
  display: block;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

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

.phosphor-glow {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  box-shadow: inset 0 0 60px rgba(102,217,239,0.08);
  pointer-events: none;
  z-index: 3;
  border-radius: 16px;
}

.monitor-bezel {
  background: linear-gradient(180deg, #3a3530 0%, #2a2520 40%, #1a1510 100%);
  padding: 20px;
  border-radius: 24px;
  box-shadow:
    0 8px 32px rgba(0,0,0,0.6),
    inset 0 1px 0 rgba(255,255,255,0.05);
}

.power-led {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  transition: all 0.3s;
}

.power-led.on {
  background: #40e040;
  box-shadow: 0 0 6px #40e040, 0 0 12px rgba(64,224,64,0.4);
}

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

.rom-slot {
  border: 2px dashed #334;
  border-radius: 8px;
  padding: 12px;
  transition: all 0.3s;
  cursor: pointer;
  position: relative;
}

.rom-slot:hover {
  border-color: var(--vic-cyan);
  background: rgba(102,217,239,0.03);
}

.rom-slot.loaded {
  border-color: var(--vic-green);
  border-style: solid;
  background: rgba(64,192,64,0.05);
}

.power-btn {
  background: linear-gradient(180deg, #c0392b 0%, #922b21 100%);
  color: white;
  border: none;
  padding: 12px 32px;
  border-radius: 6px;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 2px;
  box-shadow:
    0 4px 0 #6b1a12,
    0 6px 12px rgba(0,0,0,0.4);
  transition: all 0.1s;
  position: relative;
}

.power-btn:hover:not(:disabled) {
  transform: translateY(1px);
  box-shadow:
    0 3px 0 #6b1a12,
    0 4px 8px rgba(0,0,0,0.4);
}

.power-btn:active:not(:disabled) {
  transform: translateY(3px);
  box-shadow:
    0 1px 0 #6b1a12,
    0 2px 4px rgba(0,0,0,0.4);
}

.power-btn:disabled {
  background: linear-gradient(180deg, #555 0%, #333 100%);
  box-shadow: 0 4px 0 #222, 0 6px 12px rgba(0,0,0,0.4);
  cursor: not-allowed;
  opacity: 0.6;
}

.power-btn.running {
  background: linear-gradient(180deg, #27ae60 0%, #1e8449 100%);
  box-shadow: 0 4px 0 #145a2e, 0 6px 12px rgba(0,0,0,0.4);
}

.panel {
  background: var(--bg-card);
  border: 1px solid #1a2a40;
  border-radius: 8px;
  padding: 16px;
}

.vkey {
  background: linear-gradient(180deg, #d4c5a9 0%, #c4b599 100%);
  color: #222;
  border: 1px solid #a09070;
  border-radius: 4px;
  padding: 4px 6px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  min-width: 28px;
  text-align: center;
  box-shadow: 0 2px 0 #8a7a5a;
  transition: all 0.05s;
  user-select: none;
}

.vkey:active, .vkey.pressed {
  transform: translateY(2px);
  box-shadow: 0 0 0 #8a7a5a;
  background: linear-gradient(180deg, #b4a589 0%, #a49579 100%);
}

.vkey.special {
  background: linear-gradient(180deg, #8b7355 0%, #6b5335 100%);
  color: #e0d0c0;
  border-color: #5a4325;
  box-shadow: 0 2px 0 #4a3315;
}

.vkey.special:active, .vkey.special.pressed {
  background: linear-gradient(180deg, #6b5335 0%, #4b3315 100%);
  transform: translateY(2px);
  box-shadow: 0 0 0 #4a3315;
}

.debug-panel {
  font-size: 11px;
  line-height: 1.4;
}

.reg-val {
  color: var(--vic-cyan);
  font-weight: 700;
}

.flag-on { color: var(--vic-green); font-weight: 700; }
.flag-off { color: #445; }

.rainbow-stripe {
  height: 4px;
  background: linear-gradient(90deg, 
    #e04040 0%, #e04040 16.66%,
    #e0e040 16.66%, #e0e040 33.33%,
    #40e040 33.33%, #40e040 50%,
    #40e0e0 50%, #40e0e0 66.66%,
    #4040e0 66.66%, #4040e0 83.33%,
    #e040e0 83.33%, #e040e0 100%
  );
  border-radius: 2px;
}

.status-bar {
  background: #080810;
  border-top: 1px solid #1a2a40;
  padding: 6px 16px;
  font-size: 11px;
  color: var(--text-dim);
}

@keyframes blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

@keyframes crt-on {
  0% { transform: scaleY(0.005) scaleX(0.8); opacity: 0.5; }
  40% { transform: scaleY(0.005) scaleX(1); opacity: 1; }
  60% { transform: scaleY(1) scaleX(1); opacity: 1; }
  100% { transform: scaleY(1) scaleX(1); opacity: 1; }
}

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

@keyframes tape-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.tape-spinning {
  animation: tape-spin 0.5s linear infinite;
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #0a0a1a; }
::-webkit-scrollbar-thumb { background: #2a3a50; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #3a4a60; }