* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #0a0d16;
  color: #eef2ff;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: none;
}

#game {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

/* ---------- HUD ---------- */
.hud {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 6;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.85);
}

.topbar {
  position: absolute;
  top: 14px; left: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
}

.tag {
  border: 1px solid rgba(238, 242, 255, 0.3);
  border-radius: 4px;
  padding: 3px 8px;
  letter-spacing: 2px;
  background: rgba(6, 8, 15, 0.4);
}

.coin {
  background: rgba(6, 8, 15, 0.42);
  padding: 3px 10px;
  border-radius: 999px;
  color: #ffd166;
  font-variant-numeric: tabular-nums;
}

.dist {
  background: rgba(6, 8, 15, 0.42);
  padding: 3px 10px;
  border-radius: 999px;
  font-variant-numeric: tabular-nums;
  color: #cfd8f5;
}

.best {
  position: absolute;
  top: 52px; left: 16px;
  font-size: 11px;
  color: rgba(238, 242, 255, 0.78);
  letter-spacing: 1px;
  background: rgba(6, 8, 15, 0.38);
  padding: 2px 8px;
  border-radius: 999px;
  display: inline-block;
}

.sound {
  position: fixed;
  top: 12px; right: 14px;
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(238, 242, 255, 0.25);
  background: rgba(6, 8, 15, 0.55);
  color: #eef2ff;
  font-size: 14px;
  cursor: pointer;
  z-index: 9;
}

.sound[aria-pressed="false"] { opacity: .4; }

/* ---------- 浮层 ---------- */
.overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(4, 6, 12, 0.86);
  backdrop-filter: blur(8px);
  z-index: 20;
}

.overlay.hidden { display: none; }

.card {
  width: min(92vw, 460px);
  padding: 30px 26px 24px;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(24, 32, 58, 0.98), rgba(10, 14, 26, 0.98));
  border: 1px solid rgba(110, 231, 255, 0.22);
  box-shadow: 0 26px 80px rgba(0, 0, 0, 0.65);
  text-align: center;
}

.card .icon { font-size: 36px; margin-bottom: 6px; }

.card h2 {
  margin: 0 0 10px;
  font-size: 22px;
  letter-spacing: 1px;
}

.card .line {
  margin: 0 0 22px;
  font-size: 13px;
  line-height: 2;
  color: rgba(238, 242, 255, 0.68);
}

button.primary {
  padding: 13px 44px;
  border-radius: 999px;
  border: 1px solid rgba(110, 231, 255, 0.5);
  background: linear-gradient(180deg, #6ee7ff, #3fa9d8);
  color: #06202c;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 3px;
  cursor: pointer;
}

button.primary:active { transform: scale(0.98); }

.keys {
  margin: 16px 0 0;
  font-size: 11px;
  line-height: 1.9;
  color: rgba(238, 242, 255, 0.4);
}

/* ---------- 手机提示 ---------- */
.swipe-tip {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  font-size: 12px;
  color: rgba(238, 242, 255, 0.45);
  pointer-events: none;
  z-index: 6;
  transition: opacity .8s;
}

.swipe-tip.hide { opacity: 0; }
