/* ===== 基础与全局 ===== */
:root {
  --c-bg-1: #ffe9f0;
  --c-bg-2: #e4f0ff;
  --c-bg-3: #fff8d6;
  --c-primary: #7c5cff;
  --c-primary-dark: #5b3fd1;
  --c-accent: #ff5fa2;
  --c-ok: #2ecc71;
  --c-err: #ff5c5c;
  --c-warn: #ffb74d;
  --c-text: #2b2740;
  --c-text-soft: #6b6889;
  --c-card: rgba(255, 255, 255, 0.85);
  --c-card-strong: #ffffff;
  --shadow-card: 0 8px 24px rgba(60, 40, 120, 0.12);
  --shadow-btn: 0 4px 14px rgba(124, 92, 255, 0.35);
  --r-lg: 24px;
  --r-md: 16px;
  --r-sm: 10px;
}
* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
}
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC",
               "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue",
               sans-serif;
  color: var(--c-text);
  background:
    radial-gradient(1200px 800px at 10% 0%, var(--c-bg-1), transparent 60%),
    radial-gradient(1000px 800px at 100% 30%, var(--c-bg-2), transparent 60%),
    radial-gradient(900px 700px at 50% 100%, var(--c-bg-3), transparent 60%),
    linear-gradient(180deg, #fff5ff 0%, #eef6ff 100%);
  /* iPad / 刘海屏安全区 */
  padding:
    env(safe-area-inset-top)
    env(safe-area-inset-right)
    env(safe-area-inset-bottom)
    env(safe-area-inset-left);
  /* 触摸优化 */
  overscroll-behavior: none;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  /* pan-x pan-y 允许单指滚动，但禁止双指捏合缩放；
     manipulation 只防双击缩放，拦不住 pinch-zoom */
  touch-action: pan-x pan-y;
  -webkit-tap-highlight-color: transparent;
  /* iOS Safari：阻止文字大小自动调整（会导致意外放大） */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
/* 文本输入框允许选中 */
input, textarea { -webkit-user-select: text; user-select: text; }

/* ===== 主容器 ===== */
#app {
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px clamp(12px, 3vw, 28px) 32px;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* ===== iPad 防缩放：所有游戏交互区域完全接管触摸 ===== */
.whack-grid,
.rain-stage,
.rhyme-conveyor,
.rhyme-rail,
.tower-stage,
.beat-pads,
.match-options,
.memory-grid,
.spell-letters,
.spell-slots,
.rain-slots,
.tower-bank,
.modes-grid,
.levels-grid {
  touch-action: none;
}

/* ===== 顶栏 ===== */
.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.topbar .title {
  font-size: clamp(20px, 2.6vw, 26px);
  font-weight: 800;
  color: var(--c-primary-dark);
  letter-spacing: 0.5px;
}
.topbar .spacer { flex: 1; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--c-card-strong);
  border-radius: 999px;
  font-weight: 700;
  font-size: 14px;
  box-shadow: var(--shadow-card);
  color: var(--c-text);
}
.chip .ic { font-size: 16px; }

/* ===== 通用按钮 ===== */
.btn {
  appearance: none;
  border: none;
  cursor: pointer;
  padding: 14px 22px;
  min-height: 56px;
  border-radius: var(--r-md);
  font-size: 18px;
  font-weight: 700;
  background: var(--c-card-strong);
  color: var(--c-text);
  box-shadow: var(--shadow-card);
  transition: transform 0.08s ease, box-shadow 0.2s ease, background 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
}
.btn:active { transform: scale(0.96); }
.btn.primary {
  background: linear-gradient(135deg, #8a6bff, #5b3fd1);
  color: #fff;
  box-shadow: var(--shadow-btn);
}
.btn.accent {
  background: linear-gradient(135deg, #ff8ab7, #ff5fa2);
  color: #fff;
  box-shadow: 0 4px 14px rgba(255, 95, 162, 0.35);
}
.btn.ghost {
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(8px);
}
.btn.small { min-height: 40px; padding: 8px 14px; font-size: 14px; border-radius: 12px; }
.btn.icon { width: 56px; height: 56px; padding: 0; font-size: 22px; }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; filter: grayscale(0.4); }

/* ===== 卡片 ===== */
.card {
  background: var(--c-card);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: var(--r-lg);
  padding: clamp(16px, 2.5vw, 24px);
  box-shadow: var(--shadow-card);
}

/* ===== 首页 ===== */
.home-hero {
  text-align: center;
  padding: clamp(20px, 5vw, 50px) 16px clamp(12px, 3vw, 30px);
}
.home-hero .emoji {
  font-size: clamp(56px, 10vw, 96px);
  line-height: 1;
  animation: bob 2.5s ease-in-out infinite;
}
.home-hero h1 {
  margin: 12px 0 6px;
  font-size: clamp(28px, 5vw, 44px);
  background: linear-gradient(135deg, #7c5cff, #ff5fa2 60%, #ffb74d);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-weight: 900;
}
.home-hero p {
  color: var(--c-text-soft);
  font-size: clamp(14px, 2vw, 18px);
  margin: 0 0 20px;
}
.home-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}
.home-actions .btn { min-width: 160px; }
.home-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 20px;
}
.home-stats .stat {
  text-align: center;
  padding: 14px 8px;
  background: var(--c-card-strong);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-card);
}
.home-stats .stat .num {
  font-size: clamp(20px, 3vw, 28px);
  font-weight: 800;
  color: var(--c-primary-dark);
}
.home-stats .stat .label {
  font-size: 12px;
  color: var(--c-text-soft);
}

/* ===== 选关地图 ===== */
.levels-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(10px, 1.5vw, 16px);
  margin-top: 8px;
}
.level-card {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: var(--r-lg);
  background: linear-gradient(135deg, #ffffff, #f3eeff);
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.2s ease;
  padding: 10px;
  border: 3px solid transparent;
}
.level-card:active { transform: scale(0.97); }
.level-card.locked {
  background: linear-gradient(135deg, #ececec, #f7f7f7);
  color: #b6b6c2;
  cursor: not-allowed;
}
.level-card .lvl-num {
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 900;
  color: var(--c-primary-dark);
}
.level-card.locked .lvl-num { color: #b6b6c2; }
.level-card .lvl-range {
  font-size: 12px;
  color: var(--c-text-soft);
}
.level-card .lvl-stars {
  font-size: clamp(14px, 2vw, 18px);
  letter-spacing: 2px;
}
.level-card .lvl-lock {
  position: absolute;
  top: 8px;
  right: 10px;
  font-size: 20px;
}
.level-card.completed {
  border-color: var(--c-warn);
}

/* ===== 模式选择 ===== */
.modes-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(12px, 2vw, 18px);
}
/* 5 张卡时，避免单卡孤零零吊在底部 */
.modes-grid > .mode-card:last-child:nth-child(odd) {
  grid-column: span 2;
}
@media (min-width: 760px) {
  .modes-grid { grid-template-columns: repeat(3, 1fr); }
  .modes-grid > .mode-card:last-child:nth-child(odd) { grid-column: span 1; }
}
.mode-card {
  border-radius: var(--r-lg);
  padding: clamp(16px, 2.5vw, 22px);
  color: #fff;
  cursor: pointer;
  box-shadow: var(--shadow-card);
  transition: transform 0.08s ease;
  min-height: 140px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.mode-card:active { transform: scale(0.97); }
.mode-card .emoji { font-size: clamp(38px, 6vw, 56px); line-height: 1; }
.mode-card h3 { margin: 8px 0 4px; font-size: clamp(18px, 2.4vw, 22px); }
.mode-card p { margin: 0; opacity: 0.9; font-size: 13px; }
.mode-card .star-line { margin-top: 10px; font-size: 14px; }
.mode-card.rhyme    { background: linear-gradient(135deg, #ff8ab7, #ff5fa2); }
.mode-card.tower    { background: linear-gradient(135deg, #ffd778, #ff9a52); }
.mode-card.whack    { background: linear-gradient(135deg, #7ee0a8, #2ecc71); }
.mode-card.rain     { background: linear-gradient(135deg, #6ad1ff, #3b82f6); }
.mode-card.beat     { background: linear-gradient(135deg, #c08aff, #7c5cff); }

/* ===== 游戏通用 ===== */
.game-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.game-progress {
  flex: 1;
  min-width: 120px;
  height: 12px;
  background: rgba(0, 0, 0, 0.08);
  border-radius: 999px;
  overflow: hidden;
}
.game-progress > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #ffb74d, #ff5fa2, #7c5cff);
  transition: width 0.3s ease;
  width: 0%;
}
.hud {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ===== 单词配对 ===== */
.match-question {
  text-align: center;
  padding: clamp(20px, 4vw, 36px) 12px;
  background: var(--c-card-strong);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
  margin-bottom: 16px;
}
.match-question .q-emoji { font-size: clamp(40px, 6vw, 60px); }
.match-question .q-text {
  margin-top: 8px;
  font-size: clamp(28px, 5vw, 42px);
  font-weight: 800;
  color: var(--c-primary-dark);
  word-break: break-word;
}
.match-question .q-ipa {
  color: var(--c-text-soft);
  font-size: 16px;
  margin-top: 4px;
}
.match-question .q-tip {
  color: var(--c-text-soft);
  font-size: 14px;
  margin-top: 6px;
}
.match-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(10px, 1.5vw, 14px);
}
.opt {
  padding: clamp(14px, 2.5vw, 20px);
  min-height: 72px;
  background: #fff;
  border-radius: var(--r-md);
  box-shadow: var(--shadow-card);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-weight: 700;
  font-size: clamp(16px, 2.4vw, 20px);
  transition: transform 0.08s ease, background 0.2s ease;
  border: 3px solid transparent;
  line-height: 1.3;
}
.opt:active { transform: scale(0.97); }
.opt.correct {
  background: #d6f7e2;
  border-color: var(--c-ok);
  animation: pop 0.5s ease;
}
.opt.wrong {
  background: #ffe1e1;
  border-color: var(--c-err);
  animation: shake 0.4s ease;
}

/* ===== 翻牌记忆 ===== */
.memory-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: clamp(8px, 1.5vw, 14px);
}
@media (max-width: 600px) {
  .memory-grid { grid-template-columns: repeat(4, 1fr); }
}
.mem-card {
  aspect-ratio: 3 / 4;
  perspective: 800px;
  cursor: pointer;
}
.mem-card .inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.5s ease;
  transform-style: preserve-3d;
}
.mem-card.flipped .inner, .mem-card.matched .inner {
  transform: rotateY(180deg);
}
.mem-card .face {
  position: absolute;
  inset: 0;
  border-radius: var(--r-md);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 6px;
  font-weight: 800;
  box-shadow: var(--shadow-card);
  font-size: clamp(13px, 2vw, 18px);
  line-height: 1.2;
  word-break: break-word;
}
.mem-card .front {
  background: linear-gradient(135deg, #7c5cff, #ff5fa2);
  color: #fff;
  font-size: clamp(28px, 4vw, 40px);
}
.mem-card .back {
  transform: rotateY(180deg);
  background: #fff;
  color: var(--c-text);
}
.mem-card.matched .back {
  background: #d6f7e2;
  animation: pop 0.4s ease;
}

/* ===== 打地鼠 =====
   关键设计：把整网格宽度绑到可用视高 100dvh，使 iPad Pro / iPhone / 桌面 /
   横屏 / 竖屏 都能在不滚动的前提下完整露出 9 个洞。
   --whack-reserve 是顶栏 + 进度条 + 题目卡的总占位（粗估），
   横屏时由于浏览器 chrome 更显眼，整体再让一点点。 */
.whack-question {
  text-align: center;
  padding: clamp(8px, 1.6vh, 18px) 12px;
  background: var(--c-card-strong);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
  margin-bottom: clamp(8px, 1.4vh, 16px);
}
.whack-question .q-zh {
  font-size: clamp(20px, 4vh, 32px);
  font-weight: 800;
  color: var(--c-accent);
  line-height: 1.15;
}
.whack-question .q-tip {
  color: var(--c-text-soft);
  font-size: 13px;
  margin-top: 2px;
}
.whack-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(8px, 1.8vh, 18px);
  width: 100%;
  /* 把 max-width 绑到「视高 - 预留」上，让 3 列 1:1 自然撑出来的高度
     不会超过屏幕；280px 是绝对下限，避免极端矮屏算出负数 */
  max-width: min(700px, max(280px, calc(100dvh - 260px)));
  margin: 0 auto;
  padding: clamp(10px, 2vh, 22px);
  background:
    radial-gradient(ellipse at 20% 20%, rgba(255,255,255,0.4), transparent 50%),
    linear-gradient(180deg, #b9e58f 0%, #88c958 100%);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
}
/* 横屏 / iPad Pro 横屏：再让 40px，给浏览器 chrome 留位置 */
@media (orientation: landscape) and (min-height: 500px) {
  .whack-grid {
    max-width: min(640px, max(280px, calc(100dvh - 220px)));
  }
}
/* 极矮屏（如手机横屏）：把题目卡再压扁 */
@media (max-height: 600px) {
  .whack-question { padding: 6px 12px; }
  .whack-question .q-zh { font-size: clamp(18px, 5vh, 26px); }
  .whack-question .q-tip { display: none; }
}
.whack-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  background: var(--c-card-strong);
  border: none;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  color: var(--c-text);
  cursor: pointer;
  box-shadow: var(--shadow-card);
  font-family: inherit;
}
.whack-toggle.on { background: linear-gradient(135deg, #84fab0, #2ecc71); color: #fff; }
.whack-hole {
  aspect-ratio: 1 / 1;
  background: radial-gradient(ellipse at center bottom,
                              #6e4a2b 0%, #4a2e16 70%, #2c1a08 100%);
  border-radius: 50%;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 -10px 20px rgba(0, 0, 0, 0.3);
  transition: box-shadow 0.2s ease;
}
/* 错敲洞口闪红 */
.whack-hole.flash-wrong {
  animation: hole-wrong 0.55s ease;
}
@keyframes hole-wrong {
  0%, 100% { box-shadow: inset 0 -10px 20px rgba(0,0,0,0.3); }
  50% {
    box-shadow:
      inset 0 -10px 20px rgba(0,0,0,0.3),
      0 0 0 4px rgba(255, 90, 90, 0.8),
      0 0 24px rgba(255, 90, 90, 0.6);
  }
}
.mole {
  position: absolute;
  /* 用 transform 控制升降，比 bottom 流畅且 GPU 加速 */
  left: 50%;
  bottom: 6%;
  width: 86%;
  height: 86%;
  background: linear-gradient(180deg, #d4d4d4 0%, #9a9a9a 100%);
  border-radius: 50% 50% 45% 45% / 60% 60% 40% 40%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transform: translate(-50%, 115%);
  transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
  will-change: transform;
  font-weight: 800;
  color: #2a2a2a;
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.25);
  padding: 6px;
  text-align: center;
}
.mole.up { transform: translate(-50%, 0); }
.mole .mole-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1.1;
}
/* 升起后地鼠左右轻摇——内层做，免得跟外层 translateY 打架 */
.mole.up .mole-body {
  animation: mole-bob 1.4s ease-in-out infinite;
}
@keyframes mole-bob {
  0%, 100% { transform: rotate(-2.5deg); }
  50%      { transform: rotate(2.5deg); }
}
.mole .face-emoji { font-size: clamp(22px, 5vh, 32px); line-height: 1; }
.mole .word {
  font-size: clamp(13px, 2.4vh, 18px);
  margin-top: 2px;
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: 0.3px;
}
/* 命中动画——保留 -50% X 偏移避免横向跳动 */
.mole.hit {
  animation: hit 0.36s ease forwards;
}
@keyframes hit {
  0%   { transform: translate(-50%, 0) scale(1); }
  35%  { transform: translate(-50%, 0) scale(1.25); filter: brightness(1.4); }
  100% { transform: translate(-50%, 35%) scale(0.35); opacity: 0; }
}
/* 锤子从天而降：命中时一闪即逝 */
.whack-hammer {
  position: absolute;
  top: 0;
  left: 50%;
  font-size: clamp(28px, 4vh, 40px);
  pointer-events: none;
  z-index: 3;
  animation: hammer-strike 0.42s ease forwards;
  filter: drop-shadow(0 2px 2px rgba(0,0,0,0.3));
}
@keyframes hammer-strike {
  0%   { transform: translate(-50%, -110%) rotate(-50deg) scale(0.7); opacity: 0; }
  35%  { transform: translate(-50%, -50%)  rotate(-15deg) scale(1.05); opacity: 1; }
  60%  { transform: translate(-50%, 20%)   rotate( 18deg) scale(1.1);  opacity: 1; }
  100% { transform: translate(-50%, 40%)   rotate( 28deg) scale(0.85); opacity: 0; }
}

/* ===== 听音拼写 ===== */
.spell-card {
  background: var(--c-card-strong);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
  padding: clamp(16px, 2.5vw, 24px);
  text-align: center;
  margin-bottom: 16px;
}
.spell-card .zh {
  font-size: clamp(20px, 3.5vw, 28px);
  font-weight: 800;
  color: var(--c-accent);
  margin-bottom: 6px;
}
.spell-card .ipa {
  color: var(--c-text-soft);
  font-size: 16px;
  margin-bottom: 14px;
}
.spell-speak {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7c5cff, #5b3fd1);
  color: #fff;
  font-size: 40px;
  border: none;
  box-shadow: var(--shadow-btn);
  cursor: pointer;
  margin-bottom: 14px;
  transition: transform 0.1s ease;
}
.spell-speak:active { transform: scale(0.93); }
.spell-slots {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  min-height: 64px;
  margin: 8px 0 18px;
}
.spell-slot {
  width: clamp(40px, 6vw, 56px);
  height: clamp(48px, 7vw, 64px);
  background: #f4f0ff;
  border: 3px dashed #c8bcff;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(20px, 3vw, 28px);
  font-weight: 800;
  color: var(--c-primary-dark);
  text-transform: lowercase;
}
.spell-slot.filled {
  background: #fff;
  border-style: solid;
  border-color: var(--c-primary);
}
.spell-letters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-bottom: 14px;
}
.spell-letter {
  width: clamp(44px, 7vw, 60px);
  height: clamp(44px, 7vw, 60px);
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, #fff, #f0eaff);
  color: var(--c-primary-dark);
  font-size: clamp(18px, 3vw, 26px);
  font-weight: 800;
  cursor: pointer;
  box-shadow: var(--shadow-card);
  text-transform: lowercase;
  transition: transform 0.08s ease, opacity 0.2s ease;
}
.spell-letter:active { transform: scale(0.9); }
.spell-letter.used { opacity: 0; pointer-events: none; }
.spell-actions { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }

/* ===== 结算页 ===== */
.result-wrap {
  text-align: center;
  padding: 30px 12px;
}
.result-emoji {
  font-size: clamp(60px, 10vw, 96px);
  animation: bob 1.5s ease-in-out infinite;
}
.result-title {
  font-size: clamp(28px, 5vw, 40px);
  font-weight: 900;
  margin: 12px 0 6px;
  background: linear-gradient(135deg, #ffb74d, #ff5fa2);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.result-stars {
  font-size: clamp(40px, 6vw, 60px);
  margin: 12px 0;
  letter-spacing: 8px;
}
.result-info {
  color: var(--c-text-soft);
  font-size: 16px;
  margin-bottom: 18px;
}

/* ===== 错题本 / 徽章 ===== */
.word-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}
.word-item {
  background: #fff;
  border-radius: var(--r-md);
  padding: 12px 14px;
  box-shadow: var(--shadow-card);
  display: flex;
  align-items: center;
  gap: 10px;
}
.word-item .en {
  font-weight: 800;
  color: var(--c-primary-dark);
  font-size: 18px;
}
.word-item .zh {
  color: var(--c-text-soft);
  font-size: 14px;
  margin-top: 2px;
}
.word-item .grow { flex: 1; min-width: 0; }
.word-item .ipa { color: var(--c-text-soft); font-size: 12px; }

.badges-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}
.badge {
  background: #fff;
  border-radius: var(--r-md);
  padding: 16px 8px;
  text-align: center;
  box-shadow: var(--shadow-card);
  opacity: 0.45;
  filter: grayscale(0.6);
  transition: all 0.3s ease;
}
.badge.earned {
  opacity: 1;
  filter: none;
  background: linear-gradient(135deg, #fff7d6, #ffd778);
}
.badge .ic { font-size: 38px; line-height: 1; }
.badge .name { font-weight: 800; font-size: 14px; margin-top: 6px; }
.badge .req { color: var(--c-text-soft); font-size: 12px; margin-top: 2px; }

/* ===== 空状态 ===== */
.empty {
  text-align: center;
  padding: 30px 12px;
  color: var(--c-text-soft);
}
.empty .emoji { font-size: 60px; }

/* ===== 飘星动画粒子 ===== */
.fx-layer {
  position: fixed;
  pointer-events: none;
  inset: 0;
  overflow: hidden;
  z-index: 9999;
}
.fx-particle {
  position: absolute;
  font-size: 24px;
  animation: rise 1s ease-out forwards;
}

/* ===== Toast 提示 ===== */
.toast {
  position: fixed;
  left: 50%;
  top: 30%;
  transform: translateX(-50%) scale(0.8);
  background: rgba(43, 39, 64, 0.92);
  color: #fff;
  padding: 14px 22px;
  border-radius: 16px;
  font-size: 18px;
  font-weight: 800;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 10000;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) scale(1);
}
.toast.ok { background: rgba(46, 204, 113, 0.95); }
.toast.err { background: rgba(255, 92, 92, 0.95); }

/* ===== 动画 ===== */
@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
@keyframes pop {
  0% { transform: scale(0.9); }
  50% { transform: scale(1.08); }
  100% { transform: scale(1); }
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}
@keyframes rise {
  0% { transform: translate(0, 0) scale(1); opacity: 1; }
  100% { transform: translate(var(--dx, 0), -200px) scale(0.6); opacity: 0; }
}

/* ===== 押韵小火车（传送带版） ===== */

/* 主题卡 */
.rhyme-target {
  text-align: center;
  padding: 10px 12px;
  background: linear-gradient(135deg, #fff1f5, #ffe9e9);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
  margin-bottom: 10px;
}
.rhyme-target-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}
.rhyme-target .ic { font-size: clamp(28px, 4vw, 36px); line-height: 1; }
.rhyme-target .lbl {
  font-size: clamp(18px, 2.6vw, 22px);
  font-weight: 800;
  color: var(--c-accent);
}
.rhyme-target .sub {
  color: var(--c-text-soft);
  font-size: 13px;
  width: 100%;
}

/* 铁轨 + 火车 */
.rhyme-rail {
  position: relative;
  background: linear-gradient(180deg, #cdeeff 0%, #cdeeff 60%, #8bcc6e 60%, #8bcc6e 100%);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
  padding: 10px 12px;
  margin-bottom: 8px;
  overflow: hidden;
  min-height: 70px;
}
.rhyme-rail-tracks {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 40%;
  background:
    repeating-linear-gradient(
      90deg,
      transparent 0px,
      transparent 18px,
      rgba(90, 60, 30, 0.35) 18px,
      rgba(90, 60, 30, 0.35) 22px
    );
  animation: tracks-scroll 2s linear infinite;
}
@keyframes tracks-scroll {
  0%   { background-position-x: 0; }
  100% { background-position-x: -40px; }
}
.rhyme-train {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  min-height: 46px;
  position: relative;
  z-index: 2;
}
.rhyme-train .loco {
  font-size: clamp(32px, 4.5vw, 44px);
  animation: bob 1.2s ease-in-out infinite;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}
.rhyme-car {
  background: linear-gradient(180deg, #fff7d6, #ffd778);
  border-radius: 8px;
  padding: 3px 10px;
  font-weight: 800;
  font-size: 13px;
  color: #5b3a00;
  box-shadow: 0 2px 6px rgba(0,0,0,0.18);
  animation: carPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  border-bottom: 3px solid rgba(0,0,0,0.12);
}
@keyframes carPop {
  0%   { transform: scale(0) translateX(-30px); opacity: 0; }
  60%  { transform: scale(1.15) translateX(0); }
  100% { transform: scale(1) translateX(0); opacity: 1; }
}

/* 倒计时条 */
.rhyme-timer {
  height: 8px;
  background: rgba(0,0,0,0.08);
  border-radius: 99px;
  margin-bottom: 8px;
  overflow: hidden;
}
.rhyme-timer-fill {
  height: 100%;
  width: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, #56d87a, #2ecc71);
  transition: width 0.15s linear;
}

/* 传送带 */
.rhyme-conveyor {
  position: relative;
  height: clamp(110px, 18vh, 160px);
  background:
    linear-gradient(180deg,
      rgba(200, 220, 255, 0.3) 0%,
      rgba(180, 200, 240, 0.15) 60%,
      rgba(120, 140, 180, 0.1) 100%);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  margin-bottom: 10px;
  border: 2px solid rgba(120, 100, 200, 0.1);
}
/* 传送带底部滚动条纹 */
.rhyme-conveyor::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 10px;
  background:
    repeating-linear-gradient(
      90deg,
      rgba(100, 80, 160, 0.15) 0px,
      rgba(100, 80, 160, 0.15) 12px,
      transparent 12px,
      transparent 24px
    );
  animation: conveyor-roll 0.8s linear infinite;
}
@keyframes conveyor-roll {
  0%   { background-position-x: 0; }
  100% { background-position-x: -24px; }
}

/* 词卡（传送带上） */
.rhyme-wagon {
  position: absolute;
  top: 50%;
  left: 0;
  transform: translateY(-50%);
  will-change: transform;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  z-index: 2;
}
.wagon-body {
  background: linear-gradient(180deg, #fff, #f4f0ff);
  border-radius: 14px;
  padding: 10px 16px;
  text-align: center;
  box-shadow:
    0 4px 12px rgba(0,0,0,0.15),
    inset 0 1px 0 rgba(255,255,255,0.8);
  border: 2px solid rgba(120, 100, 200, 0.15);
  min-width: 90px;
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}
.rhyme-wagon:active .wagon-body {
  transform: scale(0.93);
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}
.wagon-word {
  font-weight: 800;
  font-size: clamp(16px, 2.4vw, 20px);
  color: var(--c-primary-dark);
  line-height: 1.2;
}
.wagon-ipa {
  font-size: 11px;
  color: var(--c-text-soft);
  margin-top: 2px;
}

/* 答对：飞向火车 */
.rhyme-wagon.fly-to-train {
  pointer-events: none;
  z-index: 10;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.4s ease;
}
.rhyme-wagon.fly-to-train .wagon-body {
  background: linear-gradient(180deg, #d6f7e2, #a8efc0);
  border-color: var(--c-ok);
  transform: scale(0.6) translateY(-60px);
  opacity: 0;
}

/* 答错：震动 + 碎裂 */
.rhyme-wagon.wrong-shake {
  pointer-events: none;
  animation: wagonShake 0.35s ease;
}
.rhyme-wagon.wrong-shake .wagon-body {
  background: linear-gradient(180deg, #ffe1e1, #ffb5b5);
  border-color: var(--c-err);
}
@keyframes wagonShake {
  0%, 100% { transform: translateY(-50%); }
  20% { transform: translateY(-50%) translateX(-8px) rotate(-3deg); }
  40% { transform: translateY(-50%) translateX(8px) rotate(3deg); }
  60% { transform: translateY(-50%) translateX(-5px) rotate(-2deg); }
  80% { transform: translateY(-50%) translateX(5px) rotate(1deg); }
}
.rhyme-wagon.explode {
  pointer-events: none;
  transition: transform 0.35s ease, opacity 0.35s ease;
}
.rhyme-wagon.explode .wagon-body {
  transform: scale(0.3) rotate(15deg);
  opacity: 0;
}

/* 淡出（轮结束清理） */
.rhyme-wagon.fade-out {
  pointer-events: none;
  transition: opacity 0.4s ease;
  opacity: 0;
}

/* 计分弹出 */
.rhyme-score-pop {
  position: absolute;
  font-size: 20px;
  font-weight: 900;
  color: var(--c-ok);
  pointer-events: none;
  z-index: 20;
  animation: scorePop 0.8s ease forwards;
  text-shadow: 0 1px 4px rgba(0,0,0,0.15);
  transform: translate(-50%, 0);
}
.rhyme-score-pop.big {
  font-size: 28px;
  color: #ff8800;
}
@keyframes scorePop {
  0%   { opacity: 1; transform: translate(-50%, 0) scale(0.6); }
  30%  { transform: translate(-50%, -20px) scale(1.2); }
  100% { opacity: 0; transform: translate(-50%, -60px) scale(0.8); }
}

/* 连击弹出 */
.rhyme-combo-pop {
  position: fixed;
  top: 38%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.5);
  font-size: clamp(22px, 4vw, 32px);
  font-weight: 900;
  color: #ff6600;
  text-shadow: 0 2px 8px rgba(255, 100, 0, 0.4);
  pointer-events: none;
  opacity: 0;
  z-index: 100;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
  white-space: nowrap;
}
.rhyme-combo-pop.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
  animation: comboFlash 0.8s ease forwards;
}
@keyframes comboFlash {
  0%   { opacity: 0; transform: translate(-50%, -50%) scale(0.5); }
  25%  { opacity: 1; transform: translate(-50%, -50%) scale(1.3); }
  50%  { transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -60%) scale(0.8); }
}

/* 轮间过渡覆盖层 */
.rhyme-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 15, 40, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.rhyme-overlay.show {
  opacity: 1;
  pointer-events: auto;
}
.rhyme-overlay-text {
  text-align: center;
  color: #fff;
}
.rhyme-overlay-text .round-num {
  font-size: clamp(36px, 7vw, 56px);
  font-weight: 900;
  animation: pop 0.5s ease;
  text-shadow: 0 4px 16px rgba(0,0,0,0.3);
}
.rhyme-overlay-text .round-theme {
  font-size: clamp(22px, 4vw, 34px);
  font-weight: 800;
  margin-top: 10px;
  color: #ffd778;
  text-shadow: 0 2px 8px rgba(0,0,0,0.3);
  animation: pop 0.5s ease 0.15s both;
}
.rhyme-overlay-text .round-sub {
  font-size: clamp(16px, 3vw, 22px);
  margin-top: 8px;
  opacity: 0.8;
  font-weight: 700;
}

/* ===== 句子盖楼 ===== */
.tower-stage {
  position: relative;
  background: linear-gradient(180deg, #cfe8ff 0%, #cfe8ff 80%, #c2e3a0 80%, #c2e3a0 100%);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
  padding: 14px;
  margin-bottom: 14px;
  min-height: 240px;
  overflow: hidden;
}
.tower-cloud {
  position: absolute;
  top: 8px;
  font-size: 28px;
  opacity: 0.85;
  animation: drift 16s linear infinite;
}
@keyframes drift {
  0%   { transform: translateX(-40px); }
  100% { transform: translateX(calc(100vw + 40px)); }
}
.tower-listen {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255,255,255,0.8);
  border-radius: 12px;
  padding: 10px 14px;
  margin-bottom: 10px;
  position: relative;
  z-index: 2;
}
.tower-listen .speaker {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ffb86b, #ff8b3d);
  color: #fff; font-size: 26px;
  border: none; cursor: pointer;
  box-shadow: var(--shadow-btn);
  flex-shrink: 0;
}
.tower-listen .hint {
  flex: 1;
  color: var(--c-text-soft);
  font-size: 14px;
}
/* 偷看原句的眼睛按钮：默认半透明，按下后高亮 */
.tower-listen .peek {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,0.9);
  color: #333; font-size: 20px;
  border: 2px solid rgba(0,0,0,0.08);
  cursor: pointer;
  box-shadow: var(--shadow-btn);
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.1s ease, background 0.2s ease;
}
.tower-listen .peek:active { transform: scale(0.92); }
.tower-listen .peek.on {
  background: linear-gradient(135deg, #ffe27a, #ffb84d);
  color: #5b3a00;
  border-color: transparent;
}
/* 揭示原句时，hint 用大一点、深一点的字 */
.tower-listen .hint.revealed {
  color: var(--c-text);
  font-weight: 700;
  font-size: 15px;
  font-style: italic;
}
.tower-built {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  min-height: 50px;
  padding: 8px 10px;
  background: rgba(255,255,255,0.6);
  border-radius: 12px;
  margin-bottom: 10px;
  position: relative;
  z-index: 2;
}
.tower-built .placeholder {
  color: var(--c-text-soft);
  font-size: 14px;
}
.tower-brick {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  min-height: 44px;
  background: linear-gradient(180deg, #ffd778, #ffae3d);
  color: #5b3a00;
  font-weight: 800;
  font-size: clamp(15px, 2vw, 18px);
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2),
              inset 0 -2px 0 rgba(0,0,0,0.15);
  animation: pop 0.4s ease;
  cursor: default;
}
.tower-bank {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  min-height: 60px;
  padding: 6px;
  position: relative;
  z-index: 2;
}
.tower-tile {
  padding: 10px 16px;
  min-height: 48px;
  background: linear-gradient(180deg, #fff7d6, #ffd778);
  color: #5b3a00;
  font-weight: 800;
  font-size: clamp(15px, 2.2vw, 19px);
  border: none;
  border-radius: 10px;
  box-shadow: var(--shadow-card),
              inset 0 -3px 0 rgba(0,0,0,0.12);
  cursor: pointer;
  transition: transform 0.08s ease;
  font-family: inherit;
}
.tower-tile:active { transform: translateY(2px); box-shadow: var(--shadow-card); }
.tower-tile.used {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.5) translateY(-30px);
  transition: all 0.4s ease;
}
.tower-tile.shake { animation: shake 0.4s ease; background: linear-gradient(180deg, #ffe1e1, #ffb1b1); }
.tower-worker {
  position: absolute;
  bottom: 6px;
  left: 12px;
  font-size: 32px;
  z-index: 1;
}

/* ===== 字母雨 ===== */
.rain-card {
  background: var(--c-card-strong);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
  padding: clamp(14px, 2.2vw, 22px);
  margin-bottom: 12px;
  text-align: center;
}
.rain-card .zh {
  font-size: clamp(20px, 3vw, 26px);
  font-weight: 800;
  color: var(--c-accent);
  margin-bottom: 4px;
}
.rain-card .ipa {
  color: var(--c-text-soft);
  font-size: 14px;
  margin-bottom: 10px;
}
.rain-speaker {
  width: 70px; height: 70px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6ad1ff, #3b82f6);
  color: #fff; font-size: 30px;
  border: none; cursor: pointer;
  box-shadow: var(--shadow-btn);
  margin-bottom: 10px;
}
.rain-speaker:active { transform: scale(0.92); }
.rain-slots {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: 6px; margin-bottom: 4px;
}
.rain-slot {
  width: clamp(34px, 5vw, 48px);
  height: clamp(42px, 6vw, 56px);
  background: #f0f6ff;
  border: 3px dashed #b6c8ff;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: clamp(18px, 2.6vw, 24px);
  font-weight: 800;
  color: var(--c-primary-dark);
  text-transform: lowercase;
}
.rain-slot.filled {
  background: #fff;
  border-style: solid;
  border-color: #3b82f6;
  animation: pop 0.4s ease;
}
.rain-slot.done { background: #d6f7e2; border-color: var(--c-ok); }
.rain-stage {
  position: relative;
  background-color: #1e3c72;
  background-image: 
    linear-gradient(180deg, rgba(30,60,114,0.95) 0%, rgba(42,82,152,0.85) 50%, rgba(91,134,229,0.7) 100%),
    repeating-linear-gradient(172deg, transparent, transparent 60px, rgba(255,255,255,0.15) 60px, rgba(255,255,255,0.15) 62px),
    repeating-linear-gradient(175deg, transparent, transparent 40px, rgba(255,255,255,0.08) 40px, rgba(255,255,255,0.08) 41px);
  background-size: 100% 100%, 150px 200px, 80px 120px;
  animation: rainDrop 0.8s linear infinite;
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
  height: clamp(260px, 50vh, 400px);
  overflow: hidden;
  margin-bottom: 12px;
}
@keyframes rainDrop {
  0% { background-position: 0 0, 0 0, 0 0; }
  100% { background-position: 0 0, 28px 200px, 10px 120px; }
}

.rain-stage::before {
  content: "☁️ ☁️ ☁️ ☁️ ☁️";
  position: absolute;
  top: 15px; left: -150px; right: -150px;
  text-align: center;
  font-size: 38px;
  letter-spacing: 40px;
  opacity: 0.35;
  pointer-events: none;
  filter: blur(3px) brightness(0.8);
  animation: driftCloudsBg 20s linear infinite alternate;
  z-index: 1;
}
.rain-stage::after {
  content: "⛈️ ☁️ 🌧️ ☁️ ⛈️";
  position: absolute;
  top: -10px; left: -100px; right: -100px;
  text-align: center;
  font-size: 46px;
  letter-spacing: 25px;
  opacity: 0.85;
  pointer-events: none;
  animation: driftCloudsFg 14s ease-in-out infinite alternate;
  z-index: 4;
  filter: drop-shadow(0 8px 6px rgba(0,0,0,0.4));
}
@keyframes driftCloudsBg {
  0% { transform: translateX(-40px); }
  100% { transform: translateX(40px); }
}
@keyframes driftCloudsFg {
  0% { transform: translateX(-20px); }
  100% { transform: translateX(20px); }
}
.rain-letter {
  position: absolute;
  top: 0; left: 0;
  width: 80px; height: 80px;
  border-radius: 50%;
  background: radial-gradient(100% 100% at 30% 30%, rgba(255,255,255,0.95) 0%, rgba(200,230,255,0.85) 50%, rgba(130,180,255,0.7) 100%);
  color: #0b3d91;
  font-size: 44px;
  font-weight: 900;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 
    0 8px 16px rgba(0,0,0,0.15),
    inset 4px 4px 10px rgba(255,255,255,0.9),
    inset -4px -4px 10px rgba(0,50,150,0.15);
  cursor: pointer;
  will-change: transform;
  text-transform: lowercase;
  user-select: none;
  border: 1px solid rgba(255,255,255,0.6);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 3;
}
.rain-inner {
  display: inline-block;
  animation: wobble 2.5s ease-in-out infinite;
}
@keyframes wobble {
  0%, 100% { transform: rotate(-8deg) translateX(-2px); }
  50% { transform: rotate(8deg) translateX(2px); }
}
.rain-letter.shake { 
  animation: shake 0.35s ease; 
  background: radial-gradient(100% 100% at 30% 30%, #fff 0%, #ffbaba 50%, #ff5c5c 100%); 
}
.rain-letter.caught { 
  opacity: 0; 
  transform: translate(var(--tx), var(--ty)) scale(0.1) !important; 
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease; 
}

/* ===== 音节拍拍乐 ===== */
.beat-card {
  background: var(--c-card-strong);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
  padding: clamp(16px, 2.5vw, 24px);
  margin-bottom: 14px;
  text-align: center;
}
.beat-word {
  font-size: clamp(28px, 5vw, 44px);
  font-weight: 900;
  color: var(--c-primary-dark);
  letter-spacing: 1px;
  margin-bottom: 4px;
  word-break: break-word;
}
.beat-slot {
  display: inline-block;
  min-width: clamp(20px, 4vw, 40px);
  border-bottom: 4px solid rgba(0,0,0,0.1);
  margin: 0 4px;
  height: 1.1em;
  vertical-align: bottom;
  color: var(--c-primary);
  transition: border-color 0.2s ease;
}
.beat-slot.filled {
  border-bottom-color: transparent;
  animation: pop 0.3s ease;
}
.beat-zh {
  color: var(--c-accent);
  font-size: clamp(15px, 2.2vw, 18px);
  font-weight: 700;
}
.beat-ipa {
  color: var(--c-text-soft);
  font-size: 13px;
  margin-top: 4px;
}
.beat-status {
  margin-top: 10px;
  font-size: 14px;
  color: var(--c-text-soft);
  min-height: 20px;
  font-weight: 700;
}
.beat-status.live { color: #7c5cff; }
.beat-pads {
  display: flex; justify-content: center; gap: clamp(10px, 2vw, 18px);
  flex-wrap: wrap;
  margin: 18px 0;
}
.beat-pad {
  width: clamp(70px, 12vw, 110px);
  height: clamp(70px, 12vw, 110px);
  border-radius: 50%;
  background: linear-gradient(180deg, #f7e7ff, #d2b3ff);
  box-shadow: 0 6px 0 rgba(0,0,0,0.15), inset 0 4px 8px rgba(255,255,255,0.4);
  cursor: pointer;
  border: none;
  font-size: clamp(28px, 5vw, 38px);
  color: #5b3fd1;
  font-weight: 900;
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.06s ease, box-shadow 0.1s ease, background 0.15s ease;
  position: relative;
  font-family: inherit;
}
.beat-pad:active { transform: translateY(4px); box-shadow: 0 2px 0 rgba(0,0,0,0.15); }
.beat-pad.cue {
  background: linear-gradient(180deg, #fff7d6, #ffd778);
  color: #5b3a00;
  animation: padCue 0.45s ease;
}
.beat-pad.hit {
  background: linear-gradient(180deg, #d6f7e2, #7ee0a8);
  color: #1f6f3a;
  animation: pop 0.4s ease;
}
.beat-pad.miss {
  background: linear-gradient(180deg, #ffe1e1, #ff9a9a);
  color: #8a1f1f;
  animation: shake 0.4s ease;
}
.beat-pad.locked { pointer-events: none; opacity: 0.7; }
@keyframes padCue {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.18); box-shadow: 0 0 30px rgba(255, 215, 120, 0.8); }
  100% { transform: scale(1); }
}
.beat-actions {
  display: flex; gap: 10px; justify-content: center; flex-wrap: wrap;
}

/* ===== 响应式 ===== */
@media (max-width: 600px) {
  .levels-grid { grid-template-columns: repeat(2, 1fr); }
  .modes-grid { grid-template-columns: 1fr; }
  .home-stats { grid-template-columns: repeat(3, 1fr); }
  .match-options { grid-template-columns: 1fr; }
  .rhyme-conveyor { height: clamp(100px, 20vh, 140px); }
}
@media (min-width: 900px) {
  .home-actions .btn { min-width: 200px; }
}
