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

html, body {
  height: 100%;
  overflow: hidden;
  background: #C3C8C9;
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 舞台铺满整个视口（自适应布局：逻辑宽度随窗口宽高比变化） */
#stage {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background: #C3C8C9;
}

#game {
  display: block;
  width: 100%;
  height: 100%;
  cursor: none;
  touch-action: none;
}

/* ---------- 右上角悬浮按钮（原版为 Lv 显示下方的暂停键） ---------- */
.hud-btns {
  position: absolute;
  top: 44px;
  right: 12px;
  display: flex;
  gap: 8px;
  z-index: 6;
}

.round-btn {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1.5px solid rgba(42, 47, 49, .75);
  background: rgba(246, 248, 248, .88);
  color: #2A2F31;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .15s, transform .1s;
}

.round-btn:hover { background: #FFFFFF; }
.round-btn:active { transform: scale(.92); }

/* ---------- 全屏遮罩（浅色线稿风，随窗口自适应） ---------- */
.overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  text-align: center;
  color: #2E3335;
  background: rgba(230, 234, 235, .84);
  backdrop-filter: blur(3px);
  padding: max(20px, 4vh) max(20px, 4vw);
}

.overlay.hidden { display: none; }

.title {
  font-size: clamp(34px, 6.5vw, 64px);
  font-weight: 800;
  letter-spacing: 0.3em;
  color: #F7F9F9;
  -webkit-text-stroke: 2px #2A2F31;
  text-shadow: 0 2px 0 rgba(42, 47, 49, .28);
}

.hi-score {
  font-size: clamp(14px, 2vw, 18px);
  color: #4A5254;
  font-weight: 700;
}

.panel-title {
  font-size: clamp(28px, 5vw, 48px);
  font-weight: 800;
  letter-spacing: 0.3em;
  color: #2E3335;
}

.panel-title.over { color: #A63F36; }

/* ---------- 按钮（白色扁平 + 黑描边） ---------- */
.btn {
  min-width: min(220px, 62vw);
  padding: clamp(11px, 1.6vh, 15px) clamp(26px, 5vw, 40px);
  border: 1px solid rgba(74, 82, 84, .45);
  border-radius: 12px;
  background: rgba(247, 249, 249, .85);
  color: #33393B;
  font-size: clamp(15px, 2.2vw, 18px);
  font-weight: 600;
  letter-spacing: 2px;
  cursor: pointer;
  transition: transform .12s, filter .15s;
}

.btn:hover { filter: brightness(.96); transform: translateY(-1px); }
.btn:active { transform: scale(.96); }

.btn.primary {
  background: #FBFCFC;
  border: 2px solid #2A2F31;
  color: #23282A;
  font-weight: 800;
}
.btn.primary:hover { filter: brightness(.97); }


/* ---------- Lv 徽章（右上角按钮行内，与按钮同款） ---------- */
.hud-lv {
  height: 34px;
  padding: 0 11px;
  display: flex;
  align-items: center;
  border: 1.5px solid rgba(42, 47, 49, .75);
  border-radius: 8px;
  background: rgba(246, 248, 248, .88);
  color: #2A2F31;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: .5px;
}

.hud-btns { align-items: center; }

/* ---------- 语言切换按钮（菜单内） ---------- */
.menu-topline {
  display: flex;
  align-items: center;
  gap: 10px;
}

.lang-btn {
  padding: 3px 10px;
  border: 1px solid rgba(74, 82, 84, .45);
  border-radius: 8px;
  background: rgba(247, 249, 249, .8);
  color: #555C5E;
  font-size: 12px;
  cursor: pointer;
  transition: background .15s;
}
.lang-btn:hover { background: #FFFFFF; color: #2E3335; }

/* ---------- 提示 & 统计 ---------- */
.tips {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 8px 26px;
  margin-top: 4px;
  font-size: clamp(12px, 1.6vw, 14px);
  color: #6A7173;
  width: min(92vw, 640px);
}

.tip { display: flex; align-items: center; gap: 8px; justify-content: flex-start; }

.key {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(229, 233, 234, .8);
  border: 1px solid rgba(124, 132, 134, .55);
  color: #33393B;
  font-size: 12px;
  white-space: nowrap;
}

.footnote {
  font-size: clamp(11px, 1.5vw, 13px);
  color: #7C8486;
  max-width: min(92vw, 460px);
  line-height: 1.7;
  margin-top: 6px;
}

.stats {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: min(280px, 80vw);
}

.stat {
  display: flex;
  justify-content: space-between;
  gap: 30px;
  font-size: clamp(14px, 1.8vw, 16px);
  color: #6A7173;
  padding-bottom: 8px;
  border-bottom: 1px dashed rgba(70, 80, 82, .3);
}

.stat b { color: #2E3335; font-size: clamp(16px, 2vw, 19px); }

.newrecord {
  font-size: clamp(15px, 2vw, 18px);
  font-weight: 700;
  color: #2E8B57;
  animation: pop .5s ease;
}

.newrecord.hidden { display: none; }

@keyframes pop {
  0% { transform: scale(.4); opacity: 0; }
  70% { transform: scale(1.15); }
  100% { transform: scale(1); opacity: 1; }
}
