:root {
  color: #fff4d6;
  background: #2f2627;
  font-family: "Courier New", "PingFang SC", "Microsoft YaHei", monospace;
  font-synthesis: none;
}

* { box-sizing: border-box; }

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

canvas {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.name-form {
  width: 210px;
  padding: 12px;
  color: #3d2925;
  background: #fff0bc;
  border: 3px solid #5b362b;
  box-shadow: 0 4px 0 #3b2725;
  text-align: center;
}

.name-form label {
  display: block;
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 700;
}

.name-form input {
  width: 100%;
  height: 30px;
  padding: 5px 8px;
  color: #3d2925;
  background: #fffaf0;
  border: 2px solid #9b5b30;
  border-radius: 0;
  font: 700 14px "Courier New", "PingFang SC", monospace;
  outline: none;
}

.name-form input:focus { border-color: #e06f46; }

.name-form button {
  width: 100%;
  margin-top: 8px;
  padding: 7px 10px;
  color: #fff7d5;
  background: #c75f38;
  border: 2px solid #5b362b;
  border-radius: 0;
  font: 700 12px "Courier New", "PingFang SC", monospace;
  cursor: pointer;
}

.debug-panel {
  width: 250px;
  padding: 10px;
  color: #f4f4f4;
  background: rgba(24, 22, 26, 0.97);
  border: 1px solid #f0b64a;
  font: 11px/1.4 "Courier New", "PingFang SC", monospace;
}

.debug-panel h2 { margin: 0 0 8px; color: #f0b64a; font-size: 13px; }
.debug-row { display: flex; gap: 5px; margin: 5px 0; }
.debug-panel label { width: 70px; padding-top: 3px; }
.debug-panel input, .debug-panel select, .debug-panel button {
  min-width: 0;
  flex: 1;
  color: #fff;
  background: #38333c;
  border: 1px solid #716a78;
  font: inherit;
}
.debug-panel button { padding: 4px; cursor: pointer; }
.debug-panel .ending-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
