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

body {
  background: #0a0a0a;
  color: #aaaaaa;
  font-family: 'IBM Plex Mono', monospace;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  padding: 20px 10px;
  overflow-x: hidden;
}

#monitor-housing {
  margin-top: 10px;
  perspective: 800px;
}

#bezel {
  background: linear-gradient(145deg, #3a3a3a 0%, #2a2a2a 50%, #1e1e1e 100%);
  border-radius: 20px;
  padding: 24px 28px 14px 28px;
  box-shadow:
    0 0 0 2px #444,
    0 8px 32px rgba(0,0,0,0.8),
    inset 0 1px 0 rgba(255,255,255,0.05);
  display: inline-block;
}

#screen-container {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  box-shadow:
    inset 0 0 40px rgba(0,0,0,0.6),
    inset 0 0 8px rgba(0,255,0,0.05);
  background: #001100;
  line-height: 0;
}

#canvas {
  display: block;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  width: 560px;
  height: 384px;
}

#scanline-overlay {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  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;
}

#screen-curve {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(
    ellipse at center,
    transparent 60%,
    rgba(0, 0, 0, 0.35) 100%
  );
  pointer-events: none;
  z-index: 3;
}

#bezel-label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 10px;
  padding: 4px 0;
}

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

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

.label-text {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  letter-spacing: 3px;
  color: #888;
  text-transform: uppercase;
}

#controls {
  margin-top: 16px;
  background: linear-gradient(180deg, #1c1c1c 0%, #151515 100%);
  border: 1px solid #333;
  border-radius: 10px;
  padding: 14px 20px;
  max-width: 600px;
  width: 100%;
  box-shadow: 0 4px 16px rgba(0,0,0,0.5);
}

.control-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.control-group label {
  font-size: 10px;
  color: #33ff33;
  letter-spacing: 1px;
  text-transform: uppercase;
  white-space: nowrap;
}

.hex-input {
  background: #0a0a0a;
  border: 1px solid #33ff33;
  color: #33ff33;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 14px;
  padding: 6px 8px;
  width: 60px;
  text-transform: uppercase;
  border-radius: 4px;
  outline: none;
}

.hex-input:focus {
  box-shadow: 0 0 6px rgba(51,255,51,0.3);
}

input[type="file"] {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  color: #aaa;
  max-width: 140px;
}

input[type="file"]::file-selector-button {
  background: #1a1a1a;
  border: 1px solid #33ff33;
  color: #33ff33;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  padding: 5px 10px;
  border-radius: 4px;
  cursor: pointer;
  margin-right: 6px;
}

input[type="file"]::file-selector-button:hover {
  background: #0f2f0f;
}

button {
  background: #1a1a1a;
  border: 1px solid #33ff33;
  color: #33ff33;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 13px;
  font-weight: 700;
  padding: 7px 18px;
  border-radius: 4px;
  cursor: pointer;
  letter-spacing: 1px;
  transition: all 0.1s;
}

button:hover {
  background: #0f2f0f;
  box-shadow: 0 0 10px rgba(51,255,51,0.2);
}

button:active {
  background: #33ff33;
  color: #000;
}

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

#reset-btn:hover {
  background: #2f0f0f;
  box-shadow: 0 0 10px rgba(255,68,68,0.2);
}

#reset-btn:active {
  background: #ff4444;
  color: #000;
}

#sound-btn {
  font-size: 16px;
  padding: 5px 10px;
}

#status-line {
  margin-top: 10px;
  font-size: 11px;
  color: #00aa00;
  letter-spacing: 1px;
  min-height: 1.4em;
}

#footer {
  margin-top: 20px;
  padding: 10px;
}

#footer a {
  color: #555;
  font-size: 11px;
  text-decoration: none;
  font-family: 'IBM Plex Mono', monospace;
}

#footer a:hover {
  color: #33ff33;
}

@media (max-width: 620px) {
  #canvas {
    width: 100%;
    height: auto;
  }
  #bezel {
    padding: 12px 14px 10px 14px;
    border-radius: 14px;
    max-width: calc(100vw - 20px);
  }
  .control-row {
    flex-direction: column;
    align-items: stretch;
  }
  .control-group {
    width: 100%;
  }
  .hex-input {
    width: 100%;
  }
  #controls {
    max-width: calc(100vw - 20px);
  }
}