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

body {
  background: #0c0c0c;
  color: #33ff33;
  font-family: 'Courier New', monospace;
  display: flex;
  justify-content: center;
  min-height: 100vh;
  overflow-x: hidden;
}

#app {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 800px;
  padding: 10px;
}

#title {
  font-family: 'Courier New', monospace;
  font-size: 20px;
  color: #33ff33;
  letter-spacing: 8px;
  margin: 12px 0 8px;
  text-shadow: 0 0 8px #33ff3366, 0 0 20px #33ff3322;
  user-select: none;
}

#monitor-bezel {
  background: linear-gradient(145deg, #2a2a2a 0%, #1a1a1a 50%, #111 100%);
  border: 3px solid #333;
  border-radius: 22px;
  padding: 22px;
  box-shadow: 
    0 0 30px rgba(0,0,0,0.9),
    inset 0 0 40px rgba(0,0,0,0.6),
    0 2px 0 #444;
  margin-bottom: 10px;
}

#crt-container {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  background: #050805;
  box-shadow: 
    inset 0 0 60px rgba(0,0,0,0.9),
    inset 0 0 10px rgba(51,255,51,0.05);
}

#canvas {
  display: block;
  width: 640px;
  height: 440px;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  border-radius: 10px;
}

#scanlines {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 1px,
    rgba(0,0,0,0.12) 1px,
    rgba(0,0,0,0.12) 2px
  );
  pointer-events: none;
  border-radius: 10px;
}

#glow-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 10px;
  pointer-events: none;
  box-shadow: inset 0 0 80px rgba(51,255,51,0.03);
  background: radial-gradient(ellipse at center, transparent 60%, rgba(0,0,0,0.3) 100%);
}

#controls-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 8px 0;
  flex-wrap: wrap;
  justify-content: center;
}

#reset-btn {
  background: linear-gradient(180deg, #dd3333, #aa1111);
  color: white;
  border: 2px solid #881111;
  border-bottom: 3px solid #661111;
  border-radius: 6px;
  padding: 6px 18px;
  font-family: 'Courier New', monospace;
  font-size: 13px;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.5);
  transition: all 0.1s;
  letter-spacing: 1px;
}
#reset-btn:active {
  transform: translateY(2px);
  border-bottom-width: 1px;
  box-shadow: 0 0px 2px rgba(0,0,0,0.5);
}

#paste-btn {
  background: linear-gradient(180deg, #555, #333);
  color: #ccc;
  border: 2px solid #555;
  border-bottom: 3px solid #222;
  border-radius: 6px;
  padding: 6px 18px;
  font-family: 'Courier New', monospace;
  font-size: 13px;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0,0,0,0.5);
  letter-spacing: 1px;
}
#paste-btn:active {
  transform: translateY(2px);
  border-bottom-width: 1px;
}

#paste-input {
  background: #111;
  border: 1px solid #33ff33;
  color: #33ff33;
  font-family: 'Courier New', monospace;
  font-size: 13px;
  padding: 5px 10px;
  border-radius: 4px;
  width: 250px;
  outline: none;
}
#paste-input:focus {
  box-shadow: 0 0 6px #33ff3344;
}

#speed-indicator {
  color: #33ff3366;
  font-size: 12px;
  font-family: 'Courier New', monospace;
}

#keyboard-housing {
  width: 100%;
  max-width: 760px;
  background: linear-gradient(180deg, #2e2e2e, #1e1e1e);
  border-radius: 12px;
  padding: 10px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.7);
  margin-bottom: 8px;
  border: 1px solid #3a3a3a;
}

#keyboard-surface {
  background: 
    repeating-linear-gradient(90deg, transparent, transparent 4px, rgba(0,0,0,0.04) 4px, rgba(0,0,0,0.04) 8px),
    linear-gradient(180deg, #8B7355 0%, #7a6345 40%, #6a5335 70%, #5a4325 100%);
  border-radius: 8px;
  padding: 10px 8px;
}

#keyboard {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
}

.key-row {
  display: flex;
  gap: 3px;
  justify-content: center;
}

.key {
  background: linear-gradient(180deg, #c0b8a0 0%, #a8a090 30%, #98907e 70%, #888070 100%);
  border: 1px solid #706860;
  border-radius: 5px;
  min-width: 44px;
  height: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  position: relative;
  box-shadow: 
    0 3px 0 #504840,
    0 4px 4px rgba(0,0,0,0.35),
    inset 0 1px 0 rgba(255,255,255,0.25);
  transition: all 0.05s;
  padding: 2px 3px;
}

.key:hover {
  background: linear-gradient(180deg, #ccc4ac 0%, #b4ac98 30%, #a49c8a 70%, #948c7c 100%);
}

.key:active, .key.pressed {
  transform: translateY(3px);
  box-shadow: 
    0 0px 0 #504840,
    0 0px 1px rgba(0,0,0,0.3),
    inset 0 2px 2px rgba(0,0,0,0.15);
  background: linear-gradient(180deg, #9a9280 0%, #8a8478 40%, #7a7468 100%);
}

.key .main-label {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 13px;
  font-weight: bold;
  color: #fff;
  text-shadow: 0 1px 1px rgba(0,0,0,0.4);
  line-height: 1;
}

.key .shift-label {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 8px;
  color: #e0e0e0;
  line-height: 1;
  margin-bottom: 1px;
}

.key-space {
  min-width: 300px !important;
}

.key-shift-active,
.key-ctrl-active {
  background: linear-gradient(180deg, #d8d0b8 0%, #c0b8a8 40%, #b0a898 100%) !important;
  border-color: #999;
  box-shadow: 
    0 1px 0 #504840,
    0 2px 2px rgba(0,0,0,0.25),
    inset 0 2px 3px rgba(0,0,0,0.1);
  transform: translateY(1px);
}

#status-bar {
  display: flex;
  gap: 20px;
  font-family: 'Courier New', monospace;
  font-size: 11px;
  color: #33ff3366;
  margin: 6px 0;
  flex-wrap: wrap;
  justify-content: center;
}

footer {
  margin-top: 10px;
  padding: 10px;
}
footer a {
  color: #333;
  text-decoration: none;
  font-size: 12px;
  font-family: 'Courier New', monospace;
}
footer a:hover {
  color: #555;
}

@media (max-width: 700px) {
  #canvas {
    width: 100%;
    height: auto;
    aspect-ratio: 280/192;
  }
  #monitor-bezel {
    padding: 12px;
    width: 100%;
  }
  #keyboard-housing {
    width: 100%;
  }
  .key {
    min-width: 28px;
    height: 34px;
  }
  .key .main-label { font-size: 10px; }
  .key .shift-label { font-size: 6px; }
  .key-space { min-width: 160px !important; }
  #title { font-size: 15px; letter-spacing: 4px; }
  #controls-bar { gap: 6px; }
  #paste-input { width: 160px; }
}