* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: #0b1020;
  color: #e8ecf8;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  display: flex;
  flex-direction: column;
  align-items: center;
  user-select: none;
}

.game-wrapper {
  width: 100%;
  max-width: 1000px;
  padding: 16px;
}

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

h1 {
  margin: 0 0 12px;
  font-weight: 700;
  letter-spacing: 1px;
}

.hud {
  display: flex;
  gap: 18px;
  justify-content: center;
  flex-wrap: wrap;
}

.hud-item {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  padding: 8px 16px;
  min-width: 90px;
}

.hud-label {
  display: block;
  font-size: 12px;
  color: #9fb1d0;
  margin-bottom: 4px;
}

.hud-value {
  font-size: 22px;
  font-weight: 700;
}

.canvas-wrap {
  position: relative;
  border: 2px solid #334066;
  border-radius: 10px;
  background: #0b1020;
  overflow: hidden;
}

canvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 900 / 600;
  touch-action: none;
}

.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(6, 9, 18, 0.65);
  padding: 24px;
  text-align: center;
}

.overlay-box {
  background: #131a33;
  border: 1px solid #374776;
  border-radius: 12px;
  padding: 28px 34px;
  max-width: 480px;
  width: 100%;
}

.overlay-box h2 {
  margin: 0 0 12px;
  font-size: 24px;
}

.overlay-box p {
  color: #c6d4ef;
  line-height: 1.6;
  margin: 8px 0;
}

.overlay-box button {
  margin-top: 16px;
  padding: 10px 22px;
  border: none;
  border-radius: 8px;
  background: #3b82f6;
  color: #fff;
  font-size: 16px;
  cursor: pointer;
}

.overlay-box button:hover {
  background: #5a9cff;
}

footer {
  margin-top: 12px;
  color: #9fb1d0;
  font-size: 13px;
}

.hint {
  display: block;
  text-align: center;
}
