* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: #14161c;
  color: #e8edf4;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 22px 20px 40px;
}

header h1 {
  margin: 0 0 4px;
  font-size: 22px;
  letter-spacing: 0.2px;
}
header .sub {
  margin: 0 0 18px;
  color: #97a3b4;
  font-size: 13.5px;
  line-height: 1.5;
  max-width: 760px;
}
header code {
  background: #232733;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 12px;
  color: #c9d4e3;
}

.stage {
  display: flex;
  gap: 18px;
  align-items: flex-start;
}

#game {
  display: block;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  cursor: default;
}

.canvas-box {
  position: relative;
  flex: 0 0 760px;
}

.overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 40px;
  background: rgba(12, 14, 19, 0.72);
  border-radius: 12px;
  font-size: 17px;
  font-weight: 600;
  color: #f2f5fa;
  backdrop-filter: blur(2px);
  cursor: pointer;
  user-select: none;
}

/* HUD ---------------------------------------------------------- */
.hud {
  flex: 1;
  min-width: 240px;
  background: #1b1e26;
  border: 1px solid #2a2f3b;
  border-radius: 12px;
  padding: 16px;
}

.row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 7px 0;
  border-bottom: 1px solid #262b36;
}
.row .k { color: #8b97a8; font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.4px; }
.row .v { font-size: 17px; font-weight: 700; }
.mode-walk { color: #8ff58f; }
.mode-run  { color: #f5c88f; }

.hint {
  margin-top: 14px;
  font-size: 13px;
  color: #aeb8c6;
  line-height: 1.6;
}
.hint b { color: #e8edf4; }

.legend {
  margin-top: 12px;
  padding: 10px 12px;
  background: #20303f;
  border: 1px solid #2f4a5f;
  border-radius: 8px;
  font-size: 12.5px;
  line-height: 1.55;
  color: #bcd2e4;
}
.legend b { color: #ffe6b0; }

.log-title {
  margin: 16px 0 6px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #6f7b8c;
}
.log {
  height: 230px;
  overflow: hidden;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 12px;
  line-height: 1.7;
}
.log .ts { color: #5c6675; margin-right: 8px; }
