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

body {
  background: #0a0a12;
  background-image: 
    radial-gradient(ellipse at 50% 0%, rgba(26,26,46,0.8) 0%, transparent 70%),
    repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(255,255,255,0.008) 2px, rgba(255,255,255,0.008) 4px);
  font-family: 'Share Tech Mono', 'JetBrains Mono', monospace;
}

.crt-screen {
  position: relative;
  background: #001100;
  border-radius: 16px;
  overflow: hidden;
  box-shadow:
    0 0 60px rgba(51,255,51,0.15),
    0 0 120px rgba(51,255,51,0.05),
    inset 0 0 80px rgba(0,0,0,0.5);
}

.crt-screen::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: 2;
}

.crt-screen::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: 3;
}

.monitor-bezel {
  background: linear-gradient(180deg, #3a3a4a 0%, #2a2a3a 30%, #1e1e2e 100%);
  border-radius: 24px;
  padding: 20px;
  border: 2px solid #4a4a5a;
  box-shadow:
    0 8px 32px rgba(0,0,0,0.6),
    inset 0 1px 0 rgba(255,255,255,0.1);
  position: relative;
}

.monitor-bezel::before {
  content: '';
  position: absolute;
  top: 2px; left: 2px; right: 2px;
  height: 40%;
  background: linear-gradient(180deg, rgba(255,255,255,0.04) 0%, transparent 100%);
  border-radius: 22px 22px 0 0;
  pointer-events: none;
}

.power-led {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #33ff33;
  box-shadow: 0 0 6px #33ff33, 0 0 12px rgba(51,255,51,0.5);
  animation: led-pulse 2s ease-in-out infinite;
}

.power-led.off {
  background: #333;
  box-shadow: none;
  animation: none;
}

@keyframes led-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

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

.btn-pet {
  background: linear-gradient(180deg, #4a4a5a 0%, #2a2a3a 100%);
  border: 2px solid #5a5a6a;
  color: #cccccc;
  font-family: 'Share Tech Mono', monospace;
  font-size: 12px;
  padding: 8px 16px;
  cursor: pointer;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: all 0.1s;
  user-select: none;
}

.btn-pet:hover {
  background: linear-gradient(180deg, #5a5a6a 0%, #3a3a4a 100%);
  border-color: #6a6a7a;
}

.btn-pet:active {
  background: linear-gradient(180deg, #2a2a3a 0%, #4a4a5a 100%);
  transform: translateY(1px);
}

.btn-pet.run {
  border-color: #33ff33;
  color: #33ff33;
}

.btn-pet.reset {
  border-color: #ff4444;
  color: #ff4444;
}

.flag-indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px; height: 24px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 700;
  border: 1px solid #333;
  transition: all 0.15s;
}

.flag-indicator.set {
  background: #33ff33;
  color: #001100;
  border-color: #33ff33;
  box-shadow: 0 0 6px rgba(51,255,51,0.4);
}

.flag-indicator.clear {
  background: #111;
  color: #444;
  border-color: #333;
}

.virtual-key {
  background: linear-gradient(180deg, #555 0%, #333 100%);
  border: 1px solid #666;
  border-radius: 4px;
  color: #ddd;
  font-size: 10px;
  font-family: 'Share Tech Mono', monospace;
  padding: 6px 4px;
  cursor: pointer;
  min-width: 32px;
  text-align: center;
  user-select: none;
  transition: all 0.05s;
}

.virtual-key:active, .virtual-key.pressed {
  background: linear-gradient(180deg, #33ff33 0%, #22cc22 100%);
  color: #001100;
  border-color: #33ff33;
}

.virtual-key.wide { min-width: 64px; }
.virtual-key.xwide { min-width: 120px; }
.virtual-key.space { min-width: 200px; }

.hex-viewer {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  line-height: 1.4;
}

.hex-viewer .highlight {
  background: rgba(51,255,51,0.15);
}

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #111; }
::-webkit-scrollbar-thumb { background: #333; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #444; }

.collapsible-header {
  cursor: pointer;
  user-select: none;
}

.collapsible-header:hover {
  color: #33ff33;
}

canvas#pet-screen {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}