/* ==================== 空气打击乐：界面样式 ==================== */
* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  font-family: "ZCOOL KuaiLe", "Microsoft YaHei", "PingFang SC", sans-serif;
  background: #141034;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

#stage { position: fixed; inset: 0; display: block; }
#cam { position: fixed; width: 2px; height: 2px; opacity: 0; pointer-events: none; }
.hidden { display: none !important; }

/* ---------- 按钮 ---------- */
.btn {
  font-family: inherit;
  border: none;
  border-radius: 18px;
  padding: 12px 26px;
  font-size: 22px;
  color: #fff;
  background: linear-gradient(180deg, #7b5cff, #5a3df0);
  box-shadow: 0 5px 0 #3f2bb8, 0 10px 22px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  transition: transform 0.08s, box-shadow 0.08s, filter 0.15s;
}
.btn:hover { filter: brightness(1.12); }
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 #3f2bb8; }
.btn-big { display: block; width: 100%; font-size: 27px; padding: 15px 26px; margin: 12px 0; }
.c-free { background: linear-gradient(180deg, #ff8fab, #f4608a); box-shadow: 0 5px 0 #c23a63, 0 10px 22px rgba(0,0,0,.35); }
.c-song { background: linear-gradient(180deg, #ffb703, #f08c00); box-shadow: 0 5px 0 #b36500, 0 10px 22px rgba(0,0,0,.35); }
.c-dance { background: linear-gradient(180deg, #2ec4b6, #1795a8); box-shadow: 0 5px 0 #0e6b7a, 0 10px 22px rgba(0,0,0,.35); }
.c-how  { background: linear-gradient(180deg, #4d96ff, #2f6bdb); box-shadow: 0 5px 0 #1d4aa8, 0 10px 22px rgba(0,0,0,.35); }
.btn-small { font-size: 17px; padding: 8px 16px; border-radius: 14px; margin-top: 14px; }

/* ---------- 覆盖层 ---------- */
.overlay {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(10, 8, 30, 0.45);
  backdrop-filter: blur(6px);
  z-index: 20;
  padding: 16px;
}
.menu-card {
  width: min(520px, 94vw);
  max-height: 94vh;
  overflow-y: auto;
  background: linear-gradient(180deg, rgba(38, 30, 82, 0.96), rgba(26, 20, 58, 0.96));
  border: 2px solid rgba(255, 255, 255, 0.14);
  border-radius: 28px;
  padding: 30px 34px;
  text-align: center;
  color: #fff;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55);
}
.menu-card h1 {
  font-size: 46px;
  background: linear-gradient(90deg, #ffd93d, #ff8fab, #7ee8fa);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 8px;
  text-shadow: 0 0 30px rgba(255, 217, 61, 0.25);
}
.menu-card h2 { font-size: 32px; margin-bottom: 16px; color: #ffe27a; }
.sub { font-size: 20px; color: #cfc8ff; line-height: 1.5; margin-bottom: 18px; }
.menu-btns { margin-top: 6px; }

.settings {
  display: flex; align-items: center; justify-content: center; gap: 18px;
  margin-top: 18px; flex-wrap: wrap;
  font-size: 16px; color: #cfc8ff;
}
.settings select {
  font-family: inherit; font-size: 16px;
  margin-left: 8px; padding: 6px 10px;
  border-radius: 12px; border: none;
  background: #fff; color: #333;
}
.mute-lb input { transform: scale(1.25); margin-right: 6px; }

.tip { margin-top: 18px; font-size: 14px; line-height: 1.7; color: #9a92c9; }
.tip b { color: #ffd93d; }

/* ---------- 选歌卡片 ---------- */
#songCards { display: flex; flex-direction: column; gap: 14px; margin-bottom: 8px; }
.song-card {
  display: flex; align-items: center; gap: 16px;
  background: rgba(255, 255, 255, 0.08);
  border: 2px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  padding: 14px 18px;
  cursor: pointer;
  text-align: left;
  color: #fff;
  font-family: inherit;
  transition: transform 0.1s, background 0.15s, border-color 0.15s;
}
.song-card:hover { background: rgba(255, 255, 255, 0.15); border-color: #ffd93d; transform: scale(1.02); }
.song-emoji { font-size: 40px; }
.song-info { flex: 1; }
.song-name { font-size: 24px; }
.song-desc { font-size: 14px; color: #b7aede; margin-top: 2px; }
.song-meta { font-size: 14px; color: #ffd93d; white-space: nowrap; }

/* ---------- 玩法说明 ---------- */
.howto-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.howto-item {
  background: color-mix(in srgb, var(--c) 16%, transparent);
  border: 2px solid var(--c);
  border-radius: 16px;
  padding: 12px 8px;
  display: flex; flex-direction: column;
  font-size: 18px;
}
.hi { font-size: 20px; }
.hi2 { color: var(--c); font-size: 16px; margin-top: 4px; }
.howto-item .foot { font-size: 26px; }
.howto-tips { list-style: none; text-align: left; font-size: 16px; line-height: 1.9; color: #d8d2f5; margin-bottom: 8px; }
.c-perfect { color: #ffd93d; }
.c-good { color: #6bd968; }

/* ---------- 舞蹈课堂 ---------- */
.sec-title {
  font-size: 20px; color: #7ee8fa;
  text-align: left; margin: 14px 0 8px;
}
.dance-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 10px; }
.dance-card {
  display: flex; align-items: center; gap: 10px;
  background: rgba(255, 255, 255, 0.08);
  border: 2px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  padding: 10px 12px;
  cursor: pointer; text-align: left;
  color: #fff; font-family: inherit;
  transition: transform 0.1s, background 0.15s, border-color 0.15s;
}
.dance-card:hover { background: rgba(46, 196, 182, 0.22); border-color: #2ec4b6; transform: scale(1.03); }
.dance-emoji { font-size: 28px; }
.dance-name { font-size: 18px; }
.dance-desc { font-size: 12px; color: #b7aede; margin-top: 2px; }
.d-lit { font-size: 18px; color: #7ee8fa; margin-bottom: 12px; }
.d-rows { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; }
.d-row {
  display: flex; justify-content: space-between; align-items: center;
  background: rgba(255, 255, 255, 0.07);
  border-radius: 12px; padding: 8px 14px;
  font-size: 17px;
}
.d-row .d-ok { color: #ffd93d; letter-spacing: 2px; }
.d-row .d-no { color: #6b6f85; }

/* ---------- HUD ---------- */
#hud {
  position: fixed; top: 0; left: 0; right: 0;
  display: flex; align-items: center; gap: 14px;
  padding: 12px 16px;
  z-index: 10;
  pointer-events: none;
}
#hud .btn { pointer-events: auto; }
.hud-title {
  font-size: 22px; color: #fff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}
#hudProgWrap {
  flex: 1; max-width: 420px;
  height: 14px; border-radius: 8px;
  background: rgba(255, 255, 255, 0.18);
  overflow: hidden;
}
#hudProgFill {
  height: 100%; width: 0%;
  border-radius: 8px;
  background: linear-gradient(90deg, #ffd93d, #ff8fab);
  transition: width 0.1s linear;
}
.hud-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.hud-score {
  font-family: "Arial Rounded MT Bold", "Microsoft YaHei", sans-serif;
  font-size: 30px; color: #ffd93d;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.6);
  min-width: 70px; text-align: right;
}
.hud-combo {
  font-size: 18px; color: #7ee8fa;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}

/* ---------- 状态条 / 浮动提示 ---------- */
#chip {
  position: fixed; top: 66px; left: 50%; transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.65);
  color: #ffe27a; font-size: 16px;
  padding: 8px 20px; border-radius: 999px;
  z-index: 30; white-space: nowrap;
}
#toast {
  position: fixed; top: 26%; left: 50%; transform: translateX(-50%);
  background: linear-gradient(90deg, rgba(255, 151, 200, 0.95), rgba(255, 200, 87, 0.95));
  color: #3a1d5e; font-size: 24px;
  padding: 14px 30px; border-radius: 999px;
  z-index: 40; white-space: nowrap;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  animation: toastPop 0.25s ease-out;
}
@keyframes toastPop {
  0% { transform: translateX(-50%) scale(0.5); opacity: 0; }
  100% { transform: translateX(-50%) scale(1); opacity: 1; }
}

/* ---------- 结算 ---------- */
.results-card { width: min(460px, 94vw); }
.r-stars { font-size: 52px; letter-spacing: 8px; color: #ffd93d; text-shadow: 0 0 24px rgba(255, 217, 61, 0.6); }
.r-stars .off { color: rgba(255, 255, 255, 0.2); text-shadow: none; }
.r-stars .star { display: inline-block; animation: starPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both; }
.r-stars .star:nth-child(2) { animation-delay: 0.25s; }
.r-stars .star:nth-child(3) { animation-delay: 0.5s; }
@keyframes starPop {
  0% { transform: scale(0) rotate(-40deg); opacity: 0; }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}
.r-score {
  font-family: "Arial Rounded MT Bold", "Microsoft YaHei", sans-serif;
  font-size: 56px; color: #fff; margin: 6px 0 14px;
}
.r-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 20px; }
.r-grid div {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 14px; padding: 10px 4px;
  display: flex; flex-direction: column;
}
.r-grid span { font-family: "Arial Rounded MT Bold", "Microsoft YaHei", sans-serif; font-size: 24px; }
.r-grid div:nth-child(1) span { color: #ffd93d; }
.r-grid div:nth-child(2) span { color: #6bd968; }
.r-grid div:nth-child(3) span { color: #ff6b6b; }
.r-grid div:nth-child(4) span { color: #7ee8fa; }
.r-grid label { font-size: 13px; color: #b7aede; margin-top: 3px; }
.r-btns { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.r-btns .btn { font-size: 19px; padding: 10px 20px; }

@media (max-width: 640px) {
  .menu-card h1 { font-size: 34px; }
  .btn-big { font-size: 22px; }
  .howto-grid { grid-template-columns: 1fr; }
  .r-grid { grid-template-columns: repeat(2, 1fr); }
  .hud-title { display: none; }
}
