:root {
  --bg-dark: #0a0a14;
  --bg-panel: #12121f;
  --bg-panel2: #1a1a2e;
  --green-glow: #33ff33;
  --amber: #ffb000;
  --red-btn: #cc2233;
  --border-color: #2a2a44;
  --text-dim: #667788;
  --text-bright: #ccddee;
}

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

body {
  background: var(--bg-dark);
  color: var(--text-bright);
  font-family: 'IBM Plex Mono', monospace;
  min-height: 100vh;
  overflow-x: hidden;
}

/* CRT Screen Effects */
.crt-container {
  position: relative;
  border-radius: 20px;
  background: #0a0a0a;
  padding: 16px;
  box-shadow: 
    0 0 30px rgba(51, 255, 51, 0.1),
    inset 0 0 60px rgba(0,0,0,0.8),
    0 4px 20px rgba(0,0,0,0.6);
  border: 3px solid #2a2a3a;
}

.crt-container::before {
  content: '';
  position: absolute;
  top: 16px; left: 16px; right: 16px; bottom: 16px;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.08) 2px,
    rgba(0, 0, 0, 0.08) 4px
  );
  pointer-events: none;
  z-index: 10;
  border-radius: 4px;
}

.crt-container::after {
  content: '';
  position: absolute;
  top: 16px; left: 16px; right: 16px; bottom: 16px;
  background: radial-gradient(ellipse at center, transparent 60%, rgba(0,0,0,0.4) 100%);
  pointer-events: none;
  z-index: 11;
  border-radius: 4px;
}

#oric-screen {
  display: block;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  border-radius: 4px;
  width: 100%;
  height: auto;
}

/* Keyboard styling */
.oric-key {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  min-width: 36px;
  height: 36px;
  padding: 2px 6px;
  border-radius: 5px;
  border: 1px solid #444;
  background: linear-gradient(180deg, #3a3a4a 0%, #2a2a3a 100%);
  color: #ddd;
  cursor: pointer;
  user-select: none;
  transition: all 0.06s ease;
  box-shadow: 0 3px 0 #111, 0 4px 6px rgba(0,0,0,0.4);
  position: relative;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  white-space: nowrap;
}

.oric-key:active, .oric-key.pressed {
  background: linear-gradient(180deg, #555 0%, #444 100%);
  box-shadow: 0 1px 0 #111, 0 1px 3px rgba(0,0,0,0.3);
  top: 2px;
  color: var(--green-glow);
}

.oric-key.special {
  background: linear-gradient(180deg, #2a2244 0%, #1a1834 100%);
  border-color: #554477;
}

.oric-key.special:active, .oric-key.special.pressed {
  background: linear-gradient(180deg, #443366 0%, #332255 100%);
  color: var(--amber);
}

.oric-key.shift-key {
  min-width: 60px;
  background: linear-gradient(180deg, #442222 0%, #331818 100%);
  border-color: #664444;
}

.oric-key.return-key {
  min-width: 72px;
}

.oric-key.space-key {
  min-width: 200px;
}

/* Glow text effects */
.glow-green {
  text-shadow: 0 0 10px rgba(51, 255, 51, 0.6), 0 0 20px rgba(51, 255, 51, 0.3);
}

.glow-amber {
  text-shadow: 0 0 10px rgba(255, 176, 0, 0.6), 0 0 20px rgba(255, 176, 0, 0.3);
}

/* LED indicators */
.led {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  border: 1px solid rgba(255,255,255,0.2);
}

.led-green { background: #33ff33; box-shadow: 0 0 6px #33ff33; }
.led-red { background: #ff3333; box-shadow: 0 0 6px #ff3333; }
.led-off { background: #333; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-dark); }
::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 3px; }

/* Dropzone */
.dropzone {
  border: 2px dashed var(--border-color);
  border-radius: 8px;
  padding: 16px;
  text-align: center;
  transition: all 0.2s;
  cursor: pointer;
}

.dropzone:hover, .dropzone.dragover {
  border-color: var(--green-glow);
  background: rgba(51, 255, 51, 0.05);
}

/* Panel styling */
.panel {
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 12px;
}

/* Physical button style */
.phys-btn {
  border-radius: 6px;
  padding: 8px 16px;
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 600;
  font-size: 12px;
  cursor: pointer;
  border: none;
  transition: all 0.1s;
  text-transform: uppercase;
  letter-spacing: 1px;
}

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

.phys-btn-red {
  background: linear-gradient(180deg, #dd3344 0%, #aa2233 100%);
  color: white;
  box-shadow: 0 3px 0 #771122, 0 4px 8px rgba(0,0,0,0.3);
}

.phys-btn-red:active { box-shadow: 0 1px 0 #771122; }

.phys-btn-green {
  background: linear-gradient(180deg, #33bb44 0%, #228833 100%);
  color: white;
  box-shadow: 0 3px 0 #116622, 0 4px 8px rgba(0,0,0,0.3);
}

.phys-btn-blue {
  background: linear-gradient(180deg, #3366cc 0%, #2244aa 100%);
  color: white;
  box-shadow: 0 3px 0 #112266, 0 4px 8px rgba(0,0,0,0.3);
}

.phys-btn-amber {
  background: linear-gradient(180deg, #cc8800 0%, #aa6600 100%);
  color: white;
  box-shadow: 0 3px 0 #664400, 0 4px 8px rgba(0,0,0,0.3);
}

/* Memory map */
.mem-region {
  position: relative;
  border-radius: 2px;
  padding: 2px 4px;
  font-size: 8px;
  overflow: hidden;
  white-space: nowrap;
}

/* Flag indicators */
.flag-on {
  color: var(--green-glow);
  text-shadow: 0 0 4px var(--green-glow);
}

.flag-off {
  color: #444;
}

/* Responsive */
@media (max-width: 1024px) {
  .main-layout {
    flex-direction: column !important;
  }
}

/* Press Start 2P for title */
.retro-title {
  font-family: 'Press Start 2P', cursive;
}