:root {
  --beige: #C8B88A;
  --beige-light: #D8CCA0;
  --beige-dark: #A89868;
  --charcoal: #2A2A2A;
  --cga-green: #00AA00;
  --cga-amber: #FFAA00;
  --ibm-blue: #4178BE;
  --off-white: #F5F0E0;
  --crt-bg: #0a0a0a;
}

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

body {
  background: #1a1a1a;
  font-family: 'IBM Plex Sans', sans-serif;
  color: #e0e0e0;
  overflow-x: hidden;
}

.font-mono { font-family: 'IBM Plex Mono', monospace !important; }
.font-sans { font-family: 'IBM Plex Sans', sans-serif !important; }

/* CRT Monitor Bezel */
.monitor-bezel {
  background: linear-gradient(145deg, #d4c494, #b8a878);
  border-radius: 20px;
  padding: 24px;
  box-shadow:
    inset 0 2px 4px rgba(255,255,255,0.3),
    inset 0 -2px 4px rgba(0,0,0,0.2),
    0 8px 32px rgba(0,0,0,0.5),
    0 2px 8px rgba(0,0,0,0.3);
  position: relative;
}

.monitor-inner {
  background: #111;
  border-radius: 12px;
  padding: 8px;
  box-shadow: inset 0 0 20px rgba(0,0,0,0.8);
  position: relative;
  overflow: hidden;
}

/* CRT Screen Effects */
.crt-screen {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
}

.crt-screen canvas {
  display: block;
  image-rendering: pixelated;
  width: 100%;
  height: auto;
}

.scanlines {
  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) 2px
  );
  pointer-events: none;
  z-index: 2;
}

.crt-glow-green {
  box-shadow: 0 0 40px rgba(0,170,0,0.15), inset 0 0 40px rgba(0,170,0,0.05);
}
.crt-glow-amber {
  box-shadow: 0 0 40px rgba(255,170,0,0.15), inset 0 0 40px rgba(255,170,0,0.05);
}
.crt-glow-white {
  box-shadow: 0 0 40px rgba(200,200,200,0.1), inset 0 0 40px rgba(200,200,200,0.03);
}

.crt-curvature {
  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;
}

/* Power On Animation */
@keyframes crt-poweron {
  0% { transform: scaleY(0.005) scaleX(0.3); filter: brightness(8); }
  20% { transform: scaleY(0.005) scaleX(1); filter: brightness(4); }
  40% { transform: scaleY(0.3) scaleX(1); filter: brightness(2); }
  100% { transform: scaleY(1) scaleX(1); filter: brightness(1); }
}

@keyframes crt-poweroff {
  0% { transform: scaleY(1) scaleX(1); filter: brightness(1); }
  30% { transform: scaleY(0.005) scaleX(1); filter: brightness(4); }
  60% { transform: scaleY(0.005) scaleX(0.3); filter: brightness(8); }
  80% { transform: scaleY(0.005) scaleX(0.01); filter: brightness(12); }
  100% { transform: scaleY(0) scaleX(0); filter: brightness(0); }
}

.powering-on {
  animation: crt-poweron 0.8s ease-out forwards;
}
.powering-off {
  animation: crt-poweroff 0.6s ease-in forwards;
}

/* Power Button */
.power-btn {
  background: linear-gradient(180deg, #cc3333, #991111);
  border: 2px solid #661111;
  border-radius: 4px;
  color: white;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 3px 0 #550000, 0 4px 8px rgba(0,0,0,0.3);
  transition: all 0.1s;
  position: relative;
}
.power-btn:active, .power-btn.on {
  box-shadow: 0 1px 0 #550000, 0 2px 4px rgba(0,0,0,0.3);
  transform: translateY(2px);
}
.power-btn.on {
  background: linear-gradient(180deg, #44aa44, #228822);
  border-color: #116611;
  box-shadow: 0 1px 0 #005500, 0 2px 4px rgba(0,0,0,0.3);
}

/* Floppy Drive */
.floppy-drive {
  background: linear-gradient(180deg, #d4c494, #c0b080);
  border: 2px solid #a89868;
  border-radius: 4px;
  position: relative;
}
.floppy-slot {
  background: #333;
  border: 1px solid #555;
  border-radius: 2px;
  height: 6px;
  margin: 4px 16px;
}

/* LED indicators */
.led {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.led-off { background: #333; box-shadow: none; }
.led-green {
  background: #00ff00;
  box-shadow: 0 0 6px #00ff00, 0 0 12px rgba(0,255,0,0.3);
}
.led-amber {
  background: #ffaa00;
  box-shadow: 0 0 6px #ffaa00, 0 0 12px rgba(255,170,0,0.3);
}
.led-red {
  background: #ff3333;
  box-shadow: 0 0 6px #ff3333, 0 0 12px rgba(255,50,50,0.3);
}

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

/* Register highlight */
@keyframes reg-flash {
  0% { background: rgba(255,255,0,0.4); }
  100% { background: transparent; }
}
.reg-changed { animation: reg-flash 0.5s ease-out; }

/* Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: #1a1a1a; }
::-webkit-scrollbar-thumb { background: #555; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #777; }

/* Debug panel */
.debug-section {
  border: 1px solid #333;
  border-radius: 4px;
  background: #111;
}

.flag-set { color: #00ff00; font-weight: 700; }
.flag-clear { color: #555; }

/* Drop zone */
.drop-zone {
  border: 2px dashed #666;
  border-radius: 4px;
  transition: all 0.2s;
  cursor: pointer;
}
.drop-zone:hover, .drop-zone.drag-over {
  border-color: var(--cga-green);
  background: rgba(0,170,0,0.05);
}

/* IBM Logo embossed */
.ibm-logo {
  font-family: 'IBM Plex Sans', sans-serif;
  font-weight: 700;
  font-size: 14px;
  color: rgba(0,0,0,0.15);
  text-shadow: 0 1px 0 rgba(255,255,255,0.3);
  letter-spacing: 4px;
}

/* Responsive */
@media (max-width: 768px) {
  .monitor-bezel { padding: 12px; border-radius: 12px; }
}