:root {
  --pink: #ff9ecb;
  --pink-deep: #e8609c;
  --purple: #8b7bd8;
  --ink: #efe6ff;
  --panel: rgba(24, 14, 48, 0.82);
  --line: rgba(255, 158, 203, 0.35);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  height: 100%;
  background: #0d0720;
  font-family: "PingFang SC", "Microsoft YaHei", -apple-system, sans-serif;
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
#stage {
  position: relative;
  width: min(96vw, calc(94vh * 16 / 9));
  aspect-ratio: 16 / 9;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 0 60px rgba(139, 123, 216, 0.25);
}
#game { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

/* HUD */
#hud {
  position: absolute; top: 14px; left: 16px;
  display: flex; gap: 10px; pointer-events: none;
}
.hud-block {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 6px 14px;
  display: flex; align-items: baseline; gap: 8px;
  backdrop-filter: blur(4px);
}
.hud-label { font-size: 12px; color: var(--purple); }
.hud-value { font-size: 20px; font-weight: 700; color: var(--pink); font-variant-numeric: tabular-nums; }

/* 摄像头小窗 */
#camBox {
  position: absolute; top: 14px; right: 16px;
  width: 200px; border-radius: 14px; overflow: hidden;
  border: 1px solid var(--line);
  background: #000;
  box-shadow: 0 4px 24px rgba(0,0,0,.5);
}
#cam, #skel {
  width: 100%; display: block;
}
#cam { transform: scaleX(-1); height: 150px; object-fit: cover; }
#skel { position: absolute; top: 0; left: 0; height: 150px; pointer-events: none; }
#poseState {
  font-size: 12px; text-align: center; padding: 4px 0;
  background: rgba(13,7,32,.85); color: var(--pink);
}

/* 中央提示 */
#msg {
  position: absolute; top: 18%; left: 50%; transform: translateX(-50%);
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 14px; padding: 12px 26px;
  font-size: 18px; color: var(--ink);
  pointer-events: none; backdrop-filter: blur(4px);
  white-space: nowrap;
}
#msg.error { color: #ff7b7b; border-color: rgba(255,123,123,.4); }

/* 倒计时 */
#countdown {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 120px; font-weight: 800; color: var(--pink);
  text-shadow: 0 0 40px rgba(232, 96, 156, .6);
  pointer-events: none;
}

/* 覆盖层 */
.overlay {
  position: absolute; inset: 0;
  background: rgba(10, 5, 26, 0.78);
  backdrop-filter: blur(6px);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 16px; text-align: center; padding: 24px;
}
.overlay h1 {
  font-size: 40px;
  background: linear-gradient(90deg, var(--pink), var(--purple));
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  letter-spacing: 2px;
}
.tagline { font-size: 16px; color: var(--purple); }
.how { display: flex; gap: 14px; margin: 8px 0; }
.how-item {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 14px; padding: 12px 18px;
  display: flex; flex-direction: column; gap: 4px; min-width: 150px;
}
.how-item b { color: var(--pink); font-size: 17px; }
.how-item span { font-size: 13px; color: #b9a8e8; }
.btns { display: flex; gap: 14px; }
.btn {
  font: inherit; font-size: 17px; font-weight: 600;
  padding: 12px 28px; border-radius: 14px; cursor: pointer;
  border: 1px solid var(--line);
  background: rgba(139, 123, 216, 0.15);
  color: var(--ink);
  transition: transform .1s, background .2s;
}
.btn:hover { background: rgba(139, 123, 216, 0.3); transform: translateY(-2px); }
.btn-primary {
  background: linear-gradient(90deg, var(--pink-deep), var(--purple));
  border: none; color: #fff;
}
.btn-primary:hover { filter: brightness(1.15); }
.btn-exit {
  position: absolute; bottom: 14px; right: 16px; z-index: 5;
  font-size: 14px; font-weight: 600; padding: 8px 16px;
  background: rgba(255, 123, 123, 0.15);
  border: 1px solid rgba(255, 123, 123, 0.4);
  color: #ffd0d0;
}
.btn-exit:hover { background: rgba(255, 123, 123, 0.3); transform: translateY(-2px); }
.tip { font-size: 13px; color: #8f7fbf; }
.final { font-size: 22px; }
.final b { color: var(--pink); font-size: 40px; }
.best { color: var(--purple); }
.best b { color: var(--ink); }
[hidden] { display: none !important; }
