body.game-page {
  max-width: 940px;
  padding-top: 18px;
}

.game-top {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.back {
  display: inline-flex;
  align-items: center;
  padding: 7px 14px;
  font-size: 0.84rem;
  color: var(--text);
  text-decoration: none;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  transition: border-color 0.15s, color 0.15s, transform 0.15s;
}

.back:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
}

.game-title {
  flex: 1 1 200px;
  min-width: 0;
}

.game-title h1 {
  margin: 0;
  font-size: clamp(1.35rem, 4vw, 1.8rem);
  font-weight: 900;
  letter-spacing: 0.04em;
}

.game-title p {
  margin: 2px 0 0;
  font-size: 0.82rem;
  color: var(--sub);
}

.pill-btn {
  padding: 8px 15px;
  font: inherit;
  font-size: 0.84rem;
  color: var(--text);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.15s, color 0.15s, transform 0.15s;
}

.pill-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
}

.pill-btn:active { transform: translateY(0) scale(0.98); }

/* ---------- 状态栏 ---------- */

.hud {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  padding: 10px 18px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
}

.stat {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.stat span {
  font-size: 1.25rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.stat small {
  font-size: 0.66rem;
  color: var(--sub);
  letter-spacing: 0.06em;
}

.progress {
  flex: 1 1 120px;
  min-width: 100px;
  height: 8px;
  overflow: hidden;
  background: var(--line);
  border-radius: 999px;
}

#bar {
  width: 0;
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
  transition: width 0.16s ease;
}

/* ---------- 游戏舞台 ---------- */

.stage {
  position: relative;
  height: clamp(380px, 64vh, 660px);
  overflow: hidden;
  border-radius: 26px;
  background: radial-gradient(120% 100% at 50% 0%, #eaf7fe 0%, #d9ecf6 52%, #c9e0ed 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.7), var(--shadow);
  -webkit-user-select: none;
  user-select: none;
}

@media (prefers-color-scheme: dark) {
  .stage {
    background: radial-gradient(120% 100% at 50% 0%, #212d34 0%, #1a2227 55%, #151b1f 100%);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06), var(--shadow);
  }
}

#canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: crosshair;
  -webkit-tap-highlight-color: transparent;
}

.hint {
  margin: 14px 2px 0;
  font-size: 0.82rem;
  line-height: 1.6;
  color: var(--sub);
}

/* ---------- 捏完后的弹层 ---------- */

.done {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(18, 24, 28, 0.38);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.done[hidden] { display: none; }

.done-card {
  width: 100%;
  max-width: 320px;
  padding: 30px 32px 28px;
  text-align: center;
  background: var(--card);
  border-radius: 24px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
  animation: done-pop 0.4s cubic-bezier(0.2, 1.4, 0.4, 1);
}

.done-card .emoji {
  margin: 0;
  font-size: 2.4rem;
  line-height: 1;
}

.done-card h2 {
  justify-content: center;
  margin: 10px 0 6px;
  font-size: 1.2rem;
}

.done-card h2::before { display: none; }

.done-card p {
  margin: 0 0 18px;
  font-size: 0.88rem;
  color: var(--sub);
}

.done-card b {
  color: var(--accent);
  font-size: 1.05em;
}

#again {
  width: 100%;
  padding: 11px 20px;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  color: #fff;
  background: var(--accent);
  border: none;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(255, 106, 61, 0.35);
  transition: transform 0.15s, box-shadow 0.15s;
}

#again:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 26px rgba(255, 106, 61, 0.42);
}

#again:active { transform: translateY(0) scale(0.98); }

@keyframes done-pop {
  from { transform: scale(0.86); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

@media (max-width: 560px) {
  .game-top { gap: 10px; }
  .game-title { flex-basis: 100%; order: 3; }
  .game-title p { display: none; }
  .hud { gap: 14px; padding: 10px 14px; }
  .stat span { font-size: 1.1rem; }
  .stage { border-radius: 20px; height: clamp(360px, 58vh, 560px); }
  .hint { font-size: 0.78rem; }
}
