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

canvas {
  display: block;
  width: 100vw;
  height: 100vh;
  image-rendering: pixelated;
}

#start-screen {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  background: #111820;
  color: #f7f9fa;
  font-family: monospace;
}

.start-panel {
  display: grid;
  gap: 24px;
  justify-items: center;
  padding: 32px;
}

.game-title {
  max-width: min(760px, 86vw);
  color: #f7f9fa;
  font-size: 40px;
  line-height: 1.1;
  text-align: center;
  overflow-wrap: anywhere;
}

.start-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
}

#start-game,
#continue-game,
#reset-game,
#config-game {
  min-width: 180px;
  border: 0;
  border-radius: 8px;
  padding: 14px 28px;
  color: #ffffff;
  font: 28px monospace;
  cursor: pointer;
}

#start-game {
  background: #2f80ed;
}

#continue-game {
  background: #2ead6b;
}

#reset-game {
  background: #f2b84b;
  color: #263238;
}

#config-game {
  background: #5865df;
}

#start-game:hover,
#start-game:focus-visible,
#continue-game:hover,
#continue-game:focus-visible,
#reset-game:hover,
#reset-game:focus-visible,
#config-game:hover,
#config-game:focus-visible {
  outline: 3px solid #ffd166;
  outline-offset: 3px;
}

#start-game:disabled,
#continue-game:disabled,
#reset-game:disabled {
  opacity: 0.7;
  cursor: default;
}

.config-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.58);
  font-family: monospace;
}

.config-panel {
  width: min(520px, calc(100vw - 32px));
  box-sizing: border-box;
  display: grid;
  gap: 18px;
  border-radius: 8px;
  padding: 28px;
  background: #f7f9fa;
  color: #263238;
}

.config-title {
  font-size: 30px;
}

.config-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.config-field {
  display: grid;
  gap: 6px;
  color: #5f6f79;
  font-size: 18px;
}

.config-key {
  border: 2px solid #d4e0e6;
  border-radius: 8px;
  padding: 10px 12px;
  background: #eaf1f4;
  color: #2f80ed;
  font: 22px monospace;
  text-align: left;
  cursor: pointer;
}

.config-key.listening {
  border-color: #2f80ed;
  background: #ffffff;
  color: #263238;
}

.config-actions {
  display: flex;
  gap: 16px;
  justify-content: end;
}

.config-actions button {
  min-width: 130px;
  border: 0;
  border-radius: 8px;
  padding: 12px 18px;
  font: 22px monospace;
  cursor: pointer;
}

.config-cancel {
  background: #dce6ec;
  color: #263238;
}

.config-save {
  background: #2ead6b;
  color: #ffffff;
}
