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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: #f6f1e4;
  -webkit-user-select: none;
  user-select: none;
}

#stage {
  position: fixed;
  inset: 0;
  display: block;
  touch-action: none;
  cursor: grab;
}
#stage.grabbing { cursor: grabbing; }

.hud {
  position: fixed;
  left: 0;
  right: 0;
  text-align: center;
  pointer-events: none;
  color: #4a5d43;
}

.hud-top {
  top: max(20px, env(safe-area-inset-top));
}
.hud-top h1 {
  font-family: "Kaiti SC", "STKaiti", "KaiTi", "Noto Serif SC", serif;
  font-size: clamp(30px, 6vw, 44px);
  letter-spacing: 0.35em;
  text-indent: 0.35em;
  color: #3d5238;
}
.tagline {
  margin-top: 6px;
  font-size: 14px;
  letter-spacing: 0.15em;
  color: #7d8b6f;
}

.hud-bottom {
  bottom: max(18px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}

.speed {
  font-variant-numeric: tabular-nums;
  font-size: 15px;
  color: #6b7a5e;
  background: rgba(255, 255, 252, 0.65);
  padding: 4px 14px;
  border-radius: 999px;
  backdrop-filter: blur(4px);
}
.speed span { font-weight: 700; color: #3d5238; }

.controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  pointer-events: auto;
  max-width: 92vw;
}
.controls button {
  font: inherit;
  font-size: 15px;
  padding: 9px 18px;
  border: 1.5px solid #9db38a;
  border-radius: 999px;
  background: rgba(255, 255, 252, 0.85);
  color: #3d5238;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}
.controls button:active { transform: scale(0.95); }
.controls button:disabled {
  opacity: 0.4;
  cursor: default;
}
.controls button.on {
  background: #5d7a4e;
  border-color: #5d7a4e;
  color: #fdfcf5;
}

.credit {
  font-size: 12px;
  color: #a3ac95;
  letter-spacing: 0.05em;
}
.credit a {
  color: #8a9a76;
  pointer-events: auto;
}
.credit .ver {
  font-size: 10px;
  opacity: 0.6;
}

.hint {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  padding: 10px 22px;
  border-radius: 999px;
  background: rgba(61, 82, 56, 0.82);
  color: #fdfcf5;
  font-size: 15px;
  letter-spacing: 0.1em;
  pointer-events: none;
  animation: breathe 2s ease-in-out infinite;
  transition: opacity 0.4s;
}
.hint.gone {
  /* 必须停掉动画：无限循环的 animation 会覆盖这里的 opacity */
  animation: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s, visibility 0s 0.4s;
}

@keyframes breathe {
  0%, 100% { opacity: 0.75; }
  50% { opacity: 1; }
}
