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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
  cursor: crosshair;
}

#viewport {
  display: block;
  width: 100vw;
  height: 100vh;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

#lock-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 8, 4, 0.85);
  color: #d8c98a;
  font-family: 'Courier New', monospace;
  font-size: 28px;
  text-align: center;
  letter-spacing: 2px;
  z-index: 10;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

#lock-overlay span {
  display: block;
  margin-top: 14px;
  font-size: 14px;
  letter-spacing: 1px;
  color: #8a7c52;
}

#lock-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.hidden-el {
  display: none !important;
}

.screen {
  display: none;
  position: fixed;
  inset: 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  background: radial-gradient(ellipse at center, #1a1610 0%, #0a0805 100%);
  color: #d8c98a;
  font-family: 'Courier New', monospace;
  z-index: 20;
  padding: 20px;
  text-align: center;
}

.screen.active {
  display: flex;
}

.title {
  font-size: 64px;
  letter-spacing: 12px;
  color: #d8c98a;
  text-shadow: 0 0 18px rgba(216, 201, 138, 0.4);
}

.subtitle {
  font-size: 28px;
  letter-spacing: 4px;
}

.hint {
  color: #8a7c52;
  font-size: 13px;
  max-width: 520px;
}

.about-text {
  max-width: 560px;
  line-height: 1.6;
  color: #c9bd94;
}

.menu-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 260px;
}

.menu-btn {
  font-family: 'Courier New', monospace;
  font-size: 16px;
  letter-spacing: 3px;
  padding: 12px 20px;
  background: transparent;
  border: 1px solid #6b5a3a;
  color: #d8c98a;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.menu-btn:hover {
  background: #6b5a3a;
  color: #0a0805;
}

.menu-btn.primary {
  border-color: #d8c98a;
  color: #0a0805;
  background: #d8c98a;
}

.menu-btn.primary:hover {
  background: #f0e4b0;
}

.menu-btn.small {
  font-size: 12px;
  padding: 8px 14px;
  letter-spacing: 1px;
}

.keybind-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 420px;
  max-width: 90vw;
}

.keybind-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid #4a3d28;
  padding: 8px 12px;
  font-size: 13px;
}

.keybind-row .keybind-label {
  text-align: left;
  letter-spacing: 1px;
}

.keybind-row .keybind-btn {
  font-family: 'Courier New', monospace;
  font-size: 12px;
  letter-spacing: 1px;
  padding: 6px 12px;
  min-width: 130px;
  background: #201a10;
  border: 1px solid #6b5a3a;
  color: #d8c98a;
  cursor: pointer;
}

.keybind-row .keybind-btn:hover {
  background: #3a2f1c;
}

.keybind-row .keybind-btn.listening {
  border-color: #d8534a;
  color: #d8534a;
  animation: pulse 0.8s infinite ease-in-out;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.warning {
  color: #d8534a;
  font-size: 12px;
  max-width: 420px;
}

.settings-actions,
.bottom-bar {
  display: flex;
  gap: 10px;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #c9bd94;
  cursor: pointer;
}

.win-title {
  color: #d8c98a;
  text-shadow: 0 0 24px rgba(216, 201, 138, 0.7);
}

.gameover-title {
  color: #d8534a;
  text-shadow: 0 0 24px rgba(216, 83, 74, 0.7);
}
