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

body {
  background: #0a0a0a;
  color: #d7d7d7;
  font-family: 'JetBrains Mono', monospace;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow-x: hidden;
}

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

header {
  text-align: center;
  margin-bottom: 12px;
  width: 100%;
}

.rainbow-bar {
  height: 4px;
  background: linear-gradient(90deg, #D70000, #D77000, #D7D700, #00D700, #00D7D7, #0000D7);
  margin-bottom: 10px;
  border-radius: 2px;
}

header h1 {
  font-family: 'Press Start 2P', monospace;
  font-size: 22px;
  color: #fff;
  text-shadow: 0 0 10px rgba(0,215,215,0.5);
  letter-spacing: 2px;
}

.subtitle {
  font-size: 11px;
  color: #888;
  margin-top: 4px;
}

#screen-wrapper {
  position: relative;
  border: 3px solid #333;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 0 30px rgba(0,215,215,0.15), inset 0 0 60px rgba(0,0,0,0.5);
  background: #000;
  line-height: 0;
}

#canvas {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  width: 704px;
  height: 592px;
}

#drop-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,215,0.8);
  color: #fff;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-family: 'Press Start 2P', monospace;
  pointer-events: none;
  z-index: 10;
}

#stats-overlay {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0,0,0,0.75);
  color: #0f0;
  font-size: 10px;
  padding: 4px 8px;
  border-radius: 4px;
  display: none;
  pointer-events: none;
  white-space: pre;
  z-index: 5;
}

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

#controls button, #controls select {
  background: #222;
  color: #d7d7d7;
  border: 1px solid #444;
  padding: 8px 14px;
  border-radius: 6px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
  min-height: 38px;
}

#controls button:hover {
  background: #333;
  border-color: #00d7d7;
  color: #00d7d7;
}

#controls select {
  appearance: auto;
}

.vol-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
}

.vol-wrap input[type=range] {
  width: 80px;
  accent-color: #00d7d7;
}

#keyboard {
  display: grid;
  gap: 4px;
  margin: 8px 0;
  width: 100%;
  max-width: 704px;
}

.kb-row {
  display: flex;
  gap: 4px;
  justify-content: center;
}

.kb-key {
  background: #1e1e1e;
  border: 1px solid #444;
  border-radius: 4px;
  padding: 6px 2px;
  min-width: 58px;
  text-align: center;
  cursor: pointer;
  user-select: none;
  transition: all 0.1s;
  flex: 1;
  max-width: 72px;
}

.kb-key:hover {
  background: #333;
  border-color: #888;
}

.kb-key.active {
  background: #00d700;
  color: #000;
  border-color: #00ff00;
}

.kb-key .main {
  font-size: 13px;
  font-weight: bold;
  color: #fff;
  font-family: 'JetBrains Mono', monospace;
}

.kb-key .kw {
  font-size: 7px;
  color: #d70000;
  margin-top: 2px;
  font-family: 'JetBrains Mono', monospace;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
}

.kb-key.shift-key {
  background: #2a1a1a;
  border-color: #d70000;
}

.kb-key.shift-key .main { color: #ff6666; }

footer {
  margin-top: 16px;
  padding: 12px;
  text-align: center;
  font-size: 10px;
  color: #555;
  width: 100%;
  border-top: 1px solid #222;
}

footer a {
  color: #00d7d7;
  text-decoration: none;
  margin-left: 12px;
}

footer a:hover { text-decoration: underline; }

@media (max-width: 750px) {
  #canvas {
    width: 352px;
    height: 296px;
  }
  .kb-key {
    min-width: 28px;
    padding: 4px 1px;
  }
  .kb-key .main { font-size: 10px; }
  .kb-key .kw { font-size: 5px; }
  header h1 { font-size: 14px; }
  #controls button, #controls select { padding: 6px 8px; font-size: 10px; }
}