/* 成语打地鼠 · 全站样式
   竖屏优先，卡通质感：暖橙主色 + 草地棋盘 + 圆角卡片 */
:root {
  --brand: #FF8A3D;
  --brand-d: #E4681A;
  --brand-l: #FFC08A;
  --ink: #3A2416;
  --ink-2: #8A6647;
  --ink-3: #B08D6E;
  --cream: #FFF8EE;
  --card: #FFFDF8;
  --line: #F1DDC6;
  --danger: #E24B4B;
  --gold: #FFC53D;
  --radius: 22px;
  --shadow-card: 0 4px 0 rgba(170, 96, 36, .14), 0 12px 22px rgba(150, 78, 20, .12);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  color: var(--ink);
  background: #FFD9AE;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button, input { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
h1, h2, h3, p { margin: 0; }

/* ---------------- 游戏页 ---------------- */
body[data-page="game"] {
  position: fixed;
  inset: 0;
  overflow: hidden;
  overscroll-behavior: none;
  background:
    radial-gradient(120% 52% at 50% -10%, #FFF3DA 0%, #FFE2BB 42%, rgba(255, 226, 187, 0) 74%),
    radial-gradient(90% 45% at 105% 105%, #FFB478 0%, rgba(255, 180, 120, 0) 70%),
    linear-gradient(180deg, #FFDDB0 0%, #FFD09C 46%, #FFB97C 100%);
}
body[data-page="game"]::before,
body[data-page="game"]::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}
body[data-page="game"]::before {
  width: 200px; height: 200px;
  left: -70px; top: 12%;
  background: radial-gradient(circle, rgba(255, 255, 255, .5), rgba(255, 255, 255, 0) 68%);
}
body[data-page="game"]::after {
  width: 260px; height: 260px;
  right: -100px; bottom: 8%;
  background: radial-gradient(circle, rgba(255, 240, 210, .45), rgba(255, 240, 210, 0) 70%);
}

.shell {
  position: relative;
  z-index: 1;
  height: 100vh;
  height: 100dvh;
  max-width: 520px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: calc(env(safe-area-inset-top, 0px) + 8px) 14px calc(env(safe-area-inset-bottom, 0px) + 8px);
}

/* HUD */
.hud { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.lvl-chip {
  display: flex; align-items: baseline; gap: 3px;
  padding: 7px 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .78);
  border: 1px solid rgba(255, 255, 255, .95);
  box-shadow: 0 3px 0 rgba(178, 96, 26, .16), inset 0 1px 0 #fff;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.lvl-chip .lvl-tag { font-size: 11px; font-weight: 700; color: var(--ink-2); }
.lvl-chip b { font-size: 17px; font-weight: 900; color: var(--brand-d); line-height: 1; font-variant-numeric: tabular-nums; }
.lvl-chip .lvl-tier {
  margin-left: 5px; padding-left: 6px;
  border-left: 1px solid rgba(200, 150, 110, .4);
  font-size: 11px; font-weight: 800; color: #A0663A;
  max-width: 72px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}

.timer-pill {
  margin-left: auto;
  display: flex; align-items: center; gap: 3px;
  padding: 5px 10px 5px 8px;
  border-radius: 999px;
  background: linear-gradient(180deg, #FFFDF7, #FFEEDB);
  border: 1px solid #FFDDBB;
  box-shadow: 0 3px 0 rgba(178, 96, 26, .16), inset 0 1px 0 #fff;
}
.timer-pill .mp-icon { width: 15px; height: 15px; color: var(--brand-d); }
.timer-pill b {
  font-size: 17px; font-weight: 900; line-height: 1;
  color: #C25A14; font-variant-numeric: tabular-nums;
  min-width: 22px; text-align: center;
}
.timer-pill span { font-size: 10px; font-weight: 800; color: var(--ink-3); margin-left: 1px; }
.timer-pill.urgent { animation: urgent .7s ease-in-out infinite; }
.timer-pill.urgent b { color: var(--danger); }

.icon-btn {
  flex: 0 0 auto;
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid rgba(255, 255, 255, .95);
  border-radius: 13px;
  background: rgba(255, 255, 255, .8);
  color: #8A5222;
  box-shadow: 0 3px 0 rgba(178, 96, 26, .18), inset 0 1px 0 #fff;
  transition: transform .1s, box-shadow .1s;
}
.icon-btn .mp-icon { width: 21px; height: 21px; }
.icon-btn:active { transform: translateY(3px); box-shadow: 0 0 0 rgba(178, 96, 26, .18); }
.icon-fallback { font-size: 11px; font-weight: 800; line-height: 1; }

/* 题目卡 */
.timer-track {
  flex: 0 0 auto;
  height: 6px;
  margin: -2px 2px -2px;
  border-radius: 3px;
  background: rgba(255, 255, 255, .5);
  overflow: hidden;
}
.timer-fill {
  height: 100%;
  width: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, #FFD06A, #FF8A3D);
  transition: width .12s linear, background .2s;
}
.timer-fill.mid { background: linear-gradient(90deg, #FFC24D, #FF9C1A); }
.timer-fill.low { background: linear-gradient(90deg, #FF9B7A, #E24B4B); }
.quest {
  flex: 0 0 auto;
  position: relative;
  padding: 11px 14px 9px;
  border-radius: 20px;
  background: linear-gradient(180deg, #FFFDF8, #FFF6E8);
  border: 1px solid #FFE2C4;
  box-shadow: var(--shadow-card), inset 0 1px 0 #fff;
  transition: transform .12s;
}
.quest-slots { display: flex; justify-content: center; gap: 8px; }
.slot {
  width: 46px; height: 50px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 13px;
  background: linear-gradient(180deg, #FFF6EA, #FFEAD3);
  border: 2px solid #F2D6B8;
  font-size: 26px; font-weight: 900; line-height: 1;
  color: #4A2C16;
  box-shadow: inset 0 -3px 0 rgba(200, 150, 110, .18);
  font-feature-settings: "palt";
}
.slot.blank {
  background: #FFF;
  border: 2px dashed var(--brand);
  color: var(--brand);
  animation: breathe 1.5s ease-in-out infinite;
}
.slot.dim { color: #CBB49C; background: #FBF1E3; border-color: #F2E2CE; }
.slot.filled {
  background: linear-gradient(180deg, #FFD9AE, #FFB976);
  border-color: var(--brand-d);
  color: #7A3408;
  box-shadow: 0 0 0 3px rgba(255, 138, 61, .22), inset 0 -3px 0 rgba(180, 90, 20, .25);
  animation: pop .34s cubic-bezier(.2, 1.6, .5, 1);
}
.quest-foot { display: flex; align-items: center; gap: 6px; margin-top: 7px; }
.quest-tag {
  flex: 0 0 auto;
  padding: 2px 7px;
  border-radius: 7px;
  background: #FFE8D0;
  color: #B9611B;
  font-size: 10px; font-weight: 800; letter-spacing: .04em;
}
.quest-meaning {
  flex: 1; min-width: 0;
  font-size: 12.5px; line-height: 1.35; color: var(--ink-2);
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
.quest.done { animation: glow .5s ease-out; }
.quest.miss { animation: shake .4s; }

/* 棋盘 */
.field { flex: 1 1 auto; min-height: 0; display: flex; padding-top: 2px; }
.board {
  flex: 1;
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: repeat(3, minmax(0, 1fr));
  gap: clamp(3px, 1.4vw, 9px);
  padding: clamp(7px, 2.4vw, 13px);
  border-radius: 26px;
  background:
    radial-gradient(70% 40% at 20% 8%, rgba(255, 255, 255, .3), rgba(255, 255, 255, 0) 60%),
    radial-gradient(60% 40% at 88% 88%, rgba(40, 100, 30, .16), rgba(40, 100, 30, 0) 70%),
    repeating-linear-gradient(102deg, rgba(255, 255, 255, .07) 0 3px, rgba(255, 255, 255, 0) 3px 22px),
    linear-gradient(180deg, #A2E27C 0%, #78CA5C 46%, #5FB44A 100%);
  border: 2px solid rgba(255, 255, 255, .55);
  box-shadow:
    inset 0 3px 0 rgba(255, 255, 255, .55),
    inset 0 -16px 26px rgba(28, 82, 24, .26),
    0 7px 0 #4E9A3C,
    0 16px 26px rgba(120, 60, 12, .24);
}
.board.shake { animation: shake .34s; }

.cell {
  position: relative;
  padding: 0;
  border: 0;
  background: transparent;
  border-radius: 12px;
  overflow: visible;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
.cell:focus { outline: none; }
.cell:focus-visible { outline: 2px solid rgba(255, 255, 255, .8); outline-offset: 2px; }

.pit {
  position: absolute;
  left: 7%; right: 7%; bottom: 4%; height: 34%;
  border-radius: 50%;
  background: radial-gradient(ellipse at 50% 34%, #23140A 0%, #35200F 48%, #4B2F19 76%, #634125 100%);
  box-shadow:
    inset 0 -6px 9px rgba(0, 0, 0, .55),
    inset 0 4px 7px rgba(0, 0, 0, .45),
    0 2px 0 rgba(150, 210, 120, .45);
  z-index: 1;
}
.rim {
  position: absolute;
  left: 9%; right: 9%; bottom: 1.5%; height: 10%;
  border-radius: 50%;
  background: linear-gradient(180deg, #7E5533 0%, #623D20 100%);
  box-shadow: 0 -1px 0 rgba(255, 210, 160, .28), inset 0 2px 3px rgba(0, 0, 0, .35);
  z-index: 3;
}

.clip {
  position: absolute;
  left: 0; right: 0; top: 0; bottom: 11%;
  overflow: hidden;
  z-index: 2;
  pointer-events: none;
}
.mole {
  position: absolute;
  left: 50%; bottom: 0;
  width: 68%;
  aspect-ratio: 0.84;
  transform: translate(-50%, 118%) rotate(-1.5deg);
  transition: transform .17s cubic-bezier(.34, 1.5, .64, 1);
  will-change: transform;
}
.cell.up .mole { transform: translate(-50%, 0) rotate(0deg); }

.mole-body {
  position: absolute;
  inset: 0;
  border-radius: 47% 47% 42% 42% / 54% 54% 46% 46%;
  background:
    radial-gradient(75% 58% at 50% 14%, #C9936A 0%, #AD7649 44%, #8A5832 82%, #7A4B29 100%);
  border: 2px solid #6C3F20;
  box-shadow:
    inset 0 -7px 12px rgba(60, 26, 6, .42),
    inset 0 4px 7px rgba(255, 226, 190, .32),
    inset 0 0 0 4px rgba(255, 255, 255, .08),
    0 5px 10px rgba(0, 0, 0, .22);
  transform-origin: 50% 100%;
}
.mole-body.squash { animation: squash .22s ease-out; }

.ear {
  position: absolute;
  top: 1%;
  width: 30%; height: 28%;
  border-radius: 50%;
  background: linear-gradient(180deg, #A9714A, #80502B);
  border: 2px solid #6C3F20;
  z-index: -1;
}
.ear.el { left: -1%; }
.ear.er { right: -1%; }

.eye {
  position: absolute;
  top: 19%;
  width: 16%; height: 18%;
  border-radius: 50%;
  background: #2A1A0E;
  box-shadow: inset 0 0 0 1px rgba(255, 240, 220, .3);
}
.eye.el { left: 25%; }
.eye.er { right: 25%; }
.eye::after {
  content: "";
  position: absolute;
  left: 22%; top: 14%;
  width: 34%; height: 34%;
  border-radius: 50%;
  background: rgba(255, 255, 255, .92);
}
.nose {
  position: absolute;
  left: 50%; top: 36%;
  width: 21%; height: 14%;
  transform: translateX(-50%);
  border-radius: 50%;
  background: linear-gradient(180deg, #FF9E9E, #E77A7A);
  box-shadow: inset 0 -2px 0 rgba(150, 55, 55, .4), 0 1px 0 rgba(255, 255, 255, .25);
}

.sign {
  position: absolute;
  left: 50%; bottom: 4%;
  width: 88%;
  min-height: 42%;
  transform: translateX(-50%) rotate(-2deg);
  display: flex; align-items: center; justify-content: center;
  border-radius: 10px;
  background: linear-gradient(180deg, #FFFDF6 0%, #FFEDD2 100%);
  border: 2px solid #A85F26;
  box-shadow: 0 3px 0 rgba(92, 48, 16, .3), inset 0 1px 0 #fff;
}
.sign b {
  font-size: clamp(19px, 6.8vw, 30px);
  font-weight: 900;
  line-height: 1;
  color: #4A2A12;
  transform: translateY(-1px);
}
.cell.hit .mole { transform: translate(-50%, 16%) scaleX(1.12) scaleY(.82) rotate(0deg); }
.cell.hit .mole-body { filter: brightness(1.14) saturate(1.1); }
.cell.bad { animation: shake .32s; }
.cell.bad .mole-body { filter: brightness(.92) saturate(.7) hue-rotate(-12deg); }

.fx {
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
  display: flex; align-items: center; justify-content: center;
}
.cell.hit .fx::before {
  content: "";
  position: absolute;
  left: 50%; top: 46%;
  width: 130%; padding-bottom: 130%;
  margin: -65% 0 0 -65%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 240, 170, .95) 0%, rgba(255, 175, 70, .55) 42%, rgba(255, 170, 60, 0) 70%);
  animation: burst .5s ease-out forwards;
}
.gain {
  position: absolute;
  top: 10%;
  font-size: 21px;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 2px 0 #E0661A, 0 0 14px rgba(255, 190, 90, .9);
  animation: floatUp .76s ease-out forwards;
}

/* 底部信息条 */
.dock {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 12px;
  border-radius: 18px;
  background: rgba(255, 255, 255, .78);
  border: 1px solid rgba(255, 255, 255, .95);
  box-shadow: 0 3px 0 rgba(178, 96, 26, .16), inset 0 1px 0 #fff;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.score-box { display: flex; flex-direction: column; line-height: 1.05; min-width: 46px; }
.score-box span, .combo-box span {
  font-size: 9px; font-weight: 800; letter-spacing: .12em; color: var(--ink-3);
}
.score-box b {
  font-size: 20px; font-weight: 900; font-variant-numeric: tabular-nums;
  color: #C25A14; transition: transform .12s;
}
.score-box b.pop { animation: pop .28s; }
.progress { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.progress-dots { display: flex; gap: 3px; }
.pdot {
  flex: 1 1 0; min-width: 0; height: 6px;
  border-radius: 3px;
  background: #F0DAC2;
  transition: background .2s;
}
.pdot.on { background: linear-gradient(180deg, #FFA95C, #FF7F28); }
.pdot.now { background: #fff; box-shadow: inset 0 0 0 2px var(--brand); }
.progress-meta { display: flex; justify-content: flex-end; gap: 4px; font-size: 10px; font-weight: 700; color: var(--ink-3); }
.progress-meta b { color: var(--ink-2); font-variant-numeric: tabular-nums; }
.combo-box { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.05; min-width: 42px; }
.combo-box b {
  font-size: 20px; font-weight: 900; color: #B79C86;
  font-variant-numeric: tabular-nums; transition: color .15s;
}
.combo-box.hot b { color: #F0611B; text-shadow: 0 0 12px rgba(255, 140, 60, .55); }

/* ---------------- 弹层 ---------------- */
.veil {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
  align-items: center;
  justify-content: center;
  padding: calc(env(safe-area-inset-top, 0px) + 16px) 16px calc(env(safe-area-inset-bottom, 0px) + 16px);
  background: rgba(58, 30, 12, .46);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.veil.show { display: flex; }

.panel {
  width: 100%;
  max-width: 356px;
  margin: auto;
  padding: 20px 18px 16px;
  border-radius: 26px;
  background: linear-gradient(180deg, #FFFDF8 0%, #FFF5E6 100%);
  border: 2px solid #fff;
  box-shadow: 0 10px 0 rgba(148, 76, 20, .22), 0 26px 50px rgba(80, 36, 8, .34);
  transform: translateY(16px) scale(.96);
  opacity: 0;
  transition: transform .26s cubic-bezier(.2, 1.25, .5, 1), opacity .2s;
}
.veil.in .panel { transform: none; opacity: 1; }
.panel-start { padding-top: 56px; }

/* 吉祥物 */
.mascot {
  position: relative;
  width: 92px; height: 88px;
  margin: -46px auto 6px;
  filter: drop-shadow(0 8px 10px rgba(120, 60, 20, .3));
}
.m-face {
  position: absolute;
  inset: 6px 4px 0;
  border-radius: 47% 47% 42% 42% / 55% 55% 45% 45%;
  background: radial-gradient(75% 58% at 50% 14%, #C9936A 0%, #AD7649 44%, #8A5832 88%);
  border: 2px solid #6C3F20;
  box-shadow: inset 0 -7px 12px rgba(60, 26, 6, .4), inset 0 4px 7px rgba(255, 226, 190, .3);
}
.m-ear {
  position: absolute;
  top: 4px;
  width: 30px; height: 28px;
  border-radius: 50%;
  background: linear-gradient(180deg, #A9714A, #80502B);
  border: 2px solid #6C3F20;
}
.m-ear.l { left: -2px; }
.m-ear.r { right: -2px; }
.m-eye {
  position: absolute;
  top: 24%; width: 14px; height: 16px;
  border-radius: 50%;
  background: #2A1A0E;
}
.m-eye::after {
  content: ""; position: absolute; left: 3px; top: 2px;
  width: 5px; height: 5px; border-radius: 50%; background: #fff;
}
.m-eye.l { left: 27%; }
.m-eye.r { right: 27%; }
.m-nose {
  position: absolute;
  left: 50%; top: 44%;
  width: 18px; height: 12px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: linear-gradient(180deg, #FF9E9E, #E77A7A);
  box-shadow: inset 0 -2px 0 rgba(150, 55, 55, .4);
}
.m-sign {
  position: absolute;
  right: -16px; bottom: -4px;
  width: 46px; height: 34px;
  transform: rotate(7deg);
  display: flex; align-items: center; justify-content: center;
  border-radius: 9px;
  background: linear-gradient(180deg, #FFFDF6, #FFEDD2);
  border: 2px solid #A85F26;
  box-shadow: 0 3px 0 rgba(92, 48, 16, .3);
  font-size: 18px; font-weight: 900; color: #B9611B;
}

.game-title {
  margin-top: 12px;
  text-align: center;
  font-size: 26px;
  font-weight: 900;
  letter-spacing: .04em;
  color: #C0561A;
  text-shadow: 0 2px 0 #FFDDB8;
}
.game-sub {
  margin-top: 5px;
  text-align: center;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--ink-2);
}

.player-chip {
  margin-top: 12px;
  display: flex; align-items: center; gap: 9px;
  padding: 8px 10px;
  border-radius: 16px;
  background: #FFF3E1;
  border: 1px solid #F6E0C6;
}
.avatar {
  flex: 0 0 auto;
  width: 38px; height: 38px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(180deg, #FFCB92, #FF9A47);
  border: 2px solid #fff;
  box-shadow: 0 2px 0 rgba(170, 90, 20, .2);
  color: #fff;
  font-size: 16px; font-weight: 900;
  overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.pc-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pc-info b {
  font-size: 14px; font-weight: 800;
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
.pc-info span { font-size: 10.5px; color: var(--ink-3); }
.pc-tag {
  flex: 0 0 auto;
  padding: 3px 8px;
  border-radius: 999px;
  background: #FFE3C4;
  color: #B9611B;
  font-size: 10px; font-weight: 800;
}

.level-preview {
  margin-top: 10px;
  display: flex; align-items: center; gap: 8px;
  padding: 9px 12px;
  border-radius: 16px;
  background: linear-gradient(180deg, #FFF6E8, #FFEBD4);
  border: 1px dashed #F0C79C;
}
.lp-main { display: flex; align-items: baseline; gap: 2px; flex: 0 0 auto; }
.lp-main span { font-size: 11px; color: var(--ink-2); font-weight: 700; }
.lp-main b { font-size: 24px; font-weight: 900; color: var(--brand-d); line-height: 1; }
.lp-cell { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 1px; border-left: 1px solid rgba(200, 150, 110, .35); }
.lp-cell span { font-size: 9px; color: var(--ink-3); font-weight: 700; letter-spacing: .06em; }
.lp-cell b { font-size: 13px; font-weight: 900; color: #7A4A22; font-variant-numeric: tabular-nums; }

/* 按钮 */
.btn {
  width: 100%;
  min-height: 52px;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 0 14px;
  border-radius: 17px;
  border: 0;
  font-size: 17px;
  font-weight: 900;
  letter-spacing: .02em;
  cursor: pointer;
  transition: transform .08s, box-shadow .08s;
  -webkit-tap-highlight-color: transparent;
}
.btn .mp-icon { width: 21px; height: 21px; }
.btn.primary {
  margin-top: 12px;
  color: #fff;
  background: linear-gradient(180deg, #FFA65C 0%, #FF7A26 100%);
  box-shadow: 0 5px 0 #D65A0F, 0 12px 22px rgba(214, 90, 15, .34);
  text-shadow: 0 1px 0 rgba(150, 55, 0, .35);
}
.btn.primary:active { transform: translateY(4px); box-shadow: 0 1px 0 #D65A0F; }
.btn.primary:disabled { opacity: .65; }
.btn.ghost {
  min-height: 46px;
  font-size: 14.5px;
  color: #B0561A;
  background: #FFF4E4;
  border: 1px solid #F3DDC2;
  box-shadow: 0 3px 0 #EFD3B4;
}
.btn.ghost:active { transform: translateY(2px); box-shadow: 0 1px 0 #EFD3B4; }
.btn-start { margin-top: 14px; }
.btn.breathe { animation: breathe 1.8s ease-in-out infinite; }
.btn.loading { opacity: .7; }
.btn-row { display: flex; gap: 8px; margin-top: 8px; }
.btn-row .btn { margin-top: 0; }

.panel-tip {
  margin-top: 10px;
  text-align: center;
  font-size: 11px;
  line-height: 1.5;
  color: var(--ink-3);
}
.panel-link {
  display: block;
  margin-top: 10px;
  text-align: center;
  font-size: 12.5px;
  font-weight: 700;
  color: #B9611B;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.panel-title { text-align: center; font-size: 21px; font-weight: 900; color: #B4561B; }
.panel-sub { margin-top: 5px; text-align: center; font-size: 12px; color: var(--ink-2); }

/* 结果面板 */
.ribbon {
  width: fit-content;
  margin: 0 auto;
  padding: 5px 18px;
  border-radius: 999px;
  background: linear-gradient(180deg, #FFC258, #FF9425);
  color: #7A3200;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: .12em;
  box-shadow: 0 3px 0 #D9741A, inset 0 1px 0 rgba(255, 255, 255, .55);
  animation: ribbonIn .4s cubic-bezier(.2, 1.5, .5, 1);
}
.ribbon.over { background: linear-gradient(180deg, #FFB0A4, #F2715F); color: #6E1B10; box-shadow: 0 3px 0 #C95243; }
.stars { display: flex; justify-content: center; gap: 6px; }
.stars.big { margin-top: 12px; gap: 9px; }
.stars.mini { gap: 2px; justify-content: center; }
.star {
  width: 17px; height: 17px;
  background: #E6D3BF;
  clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
  -webkit-clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
}
.star.on { background: linear-gradient(180deg, #FFDE7A, #FFB01F); box-shadow: 0 0 10px rgba(255, 190, 60, .5); }
.stars.big .star { width: 38px; height: 38px; animation: starIn .45s cubic-bezier(.2, 1.6, .5, 1) backwards; }
.stars.big .star:nth-child(1) { animation-delay: .04s; }
.stars.big .star:nth-child(2) { animation-delay: .14s; }
.stars.big .star:nth-child(3) { animation-delay: .24s; }
.stars.mini .star { width: 9px; height: 9px; }

.score-big {
  margin-top: 14px;
  display: flex; flex-direction: column; align-items: center; gap: 1px;
}
.score-big span { font-size: 10px; font-weight: 800; letter-spacing: .14em; color: var(--ink-3); }
.score-big b {
  font-size: 40px; font-weight: 900; line-height: 1.05;
  color: #C25A14;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 2px 0 rgba(255, 220, 180, .9);
}
.rows {
  margin-top: 12px;
  border-radius: 15px;
  background: #FFF3E2;
  border: 1px solid #F6E0C6;
  overflow: hidden;
}
.row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 13px;
  font-size: 13px;
  border-bottom: 1px solid rgba(230, 200, 170, .5);
}
.row:last-child { border-bottom: 0; }
.row span { color: var(--ink-2); }
.row b { font-weight: 900; color: #6B4222; font-variant-numeric: tabular-nums; }
.row b.plus { color: #E4681A; }

.pause-stats {
  margin-top: 14px;
  display: flex;
  border-radius: 16px;
  background: #FFF3E2;
  border: 1px solid #F6E0C6;
  padding: 10px 0;
}
.pause-stats > div { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; }
.pause-stats > div + div { border-left: 1px solid rgba(220, 185, 150, .7); }
.pause-stats span { font-size: 10px; font-weight: 700; color: var(--ink-3); }
.pause-stats b { font-size: 17px; font-weight: 900; color: #7A4A22; font-variant-numeric: tabular-nums; }

/* 提示条 */
.toast {
  position: fixed;
  left: 50%;
  top: calc(env(safe-area-inset-top, 0px) + 84px);
  z-index: 90;
  transform: translate(-50%, -12px);
  max-width: 82vw;
  padding: 9px 16px;
  border-radius: 999px;
  background: rgba(58, 30, 12, .9);
  color: #FFF3E2;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s, transform .18s;
  backdrop-filter: blur(4px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.warn { background: rgba(160, 44, 30, .93); }

/* 昵称弹窗 */
.mini-veil {
  position: fixed;
  inset: 0;
  z-index: 95;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  background: rgba(48, 26, 10, .5);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity .2s;
}
.mini-veil.show { opacity: 1; }
.mini-panel {
  width: 100%; max-width: 310px;
  padding: 20px 18px 16px;
  border-radius: 22px;
  background: linear-gradient(180deg, #FFFDF8, #FFF4E4);
  border: 2px solid #fff;
  box-shadow: 0 14px 30px rgba(70, 30, 8, .3);
  transform: translateY(10px) scale(.97);
  transition: transform .22s cubic-bezier(.2, 1.3, .5, 1);
}
.mini-veil.show .mini-panel { transform: none; }
.mini-panel h3 { font-size: 18px; font-weight: 900; color: #B4561B; text-align: center; }
.mini-panel p { margin-top: 4px; font-size: 11.5px; color: var(--ink-3); text-align: center; }
.mini-input {
  width: 100%;
  margin-top: 14px;
  height: 46px;
  padding: 0 13px;
  border-radius: 13px;
  border: 2px solid #F0D6B8;
  background: #fff;
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  outline: none;
}
.mini-input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(255, 138, 61, .16); }
.mini-row { display: flex; gap: 8px; margin-top: 12px; }
.mini-row .btn { min-height: 46px; }

/* ---------------- 二级页面通用 ---------------- */
body[data-page="levels"], body[data-page="rank"] {
  min-height: 100vh;
  background:
    radial-gradient(110% 46% at 50% -8%, #FFF3DC 0%, #FFE4C0 46%, rgba(255, 228, 192, 0) 78%),
    linear-gradient(180deg, #FFDDB4 0%, #FFD0A2 38%, #FFC08A 100%);
  background-attachment: fixed;
}
.page-wrap {
  max-width: 520px;
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top, 0px) + 10px) 16px calc(env(safe-area-inset-bottom, 0px) + 28px);
}
.sub-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 4px 0 10px;
}
.sub-title { font-size: 16px; font-weight: 900; color: #8E4A18; letter-spacing: .04em; }
.sub-bar .icon-btn { width: 36px; height: 36px; border-radius: 12px; }
.sub-bar .icon-btn:last-child { margin-left: auto; }
.sub-bar .icon-btn:first-child { order: -1; }

/* 玩家卡 */
.player-card {
  display: flex; align-items: center; gap: 11px;
  padding: 12px 14px;
  border-radius: 20px;
  background: linear-gradient(180deg, #FFFDF8, #FFF4E5);
  border: 1px solid #FFE4C9;
  box-shadow: var(--shadow-card);
}
.player-card .avatar { width: 44px; height: 44px; font-size: 18px; }
.player-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.player-info b { font-size: 16px; font-weight: 900; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.player-info span { font-size: 11px; color: var(--ink-2); }
.player-info em { font-style: normal; font-weight: 900; color: var(--brand-d); }
.link-btn {
  flex: 0 0 auto;
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid #F3DCC1;
  background: #FFF3E3;
  color: #B0561A;
  font-size: 11.5px; font-weight: 800;
}
.link-btn:active { transform: translateY(1px); }

/* 继续闯关 */
.hero-card {
  margin-top: 12px;
  display: flex; align-items: center; gap: 12px;
  padding: 16px;
  border-radius: 22px;
  background:
    radial-gradient(120% 120% at 100% 0%, rgba(255, 255, 255, .45) 0%, rgba(255, 255, 255, 0) 55%),
    linear-gradient(135deg, #FF9A48 0%, #FF7A26 100%);
  box-shadow: 0 6px 0 #D65A0F, 0 16px 26px rgba(200, 85, 15, .28);
  color: #fff;
}
.hero-copy { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.hero-kicker { font-size: 10.5px; font-weight: 800; letter-spacing: .16em; opacity: .9; }
.hero-copy b { font-size: 23px; font-weight: 900; line-height: 1.15; text-shadow: 0 1px 0 rgba(150, 55, 0, .3); }
.hero-copy b em { font-style: normal; font-size: 30px; }
.hero-disc { font-size: 11.5px; opacity: .92; }
.hero-stars { margin-top: 2px; justify-content: flex-start; }
.hero-stars .star { background: rgba(255, 255, 255, .38); }
.hero-stars .star.on { background: linear-gradient(180deg, #FFEBA8, #FFC53D); }
.hero-btn {
  flex: 0 0 auto;
  width: auto;
  min-height: 46px;
  min-width: 92px;
  margin: 0;
  border-radius: 14px;
  font-size: 16px;
  color: #B4561B;
  background: linear-gradient(180deg, #FFFDF8, #FFEBD3);
  box-shadow: 0 4px 0 rgba(140, 60, 10, .35);
  text-shadow: none;
}
.hero-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(140, 60, 10, .35); }

.stat-strip {
  margin-top: 12px;
  display: flex;
  gap: 8px;
}
.stat-cell {
  flex: 1;
  padding: 10px 8px;
  border-radius: 16px;
  background: rgba(255, 255, 255, .74);
  border: 1px solid rgba(255, 255, 255, .9);
  box-shadow: 0 3px 0 rgba(178, 96, 26, .13);
  display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.stat-cell span { font-size: 9.5px; font-weight: 800; letter-spacing: .06em; color: var(--ink-3); }
.stat-cell b { font-size: 16px; font-weight: 900; color: #7A4A22; font-variant-numeric: tabular-nums; }

/* 关卡列表 */
.level-grid { margin-top: 14px; display: flex; flex-direction: column; gap: 14px; }
.level-band {
  padding: 12px 12px 13px;
  border-radius: 20px;
  background: rgba(255, 253, 247, .72);
  border: 1px solid rgba(255, 255, 255, .9);
  box-shadow: 0 3px 0 rgba(178, 96, 26, .1);
}
.band-head { display: flex; align-items: baseline; gap: 8px; padding: 0 2px 9px; }
.band-head b { font-size: 14px; font-weight: 900; color: #8E4A18; }
.band-head span { font-size: 10.5px; font-weight: 700; color: var(--ink-3); }
.level-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.level-tile {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  min-height: 66px;
  padding: 8px 4px;
  border-radius: 15px;
  border: 1px solid #F2DDC5;
  background: linear-gradient(180deg, #FFFDF8, #FFF1DE);
  box-shadow: 0 3px 0 rgba(178, 96, 26, .14);
  transition: transform .08s, box-shadow .08s;
  cursor: pointer;
  color: inherit;
}
.level-tile:active { transform: translateY(3px); box-shadow: 0 0 0 rgba(178, 96, 26, .14); }
.level-tile .lt-no {
  font-size: 21px; font-weight: 900; line-height: 1;
  color: #B4561B;
  font-variant-numeric: tabular-nums;
}
.level-tile.current {
  background: linear-gradient(180deg, #FFA85E, #FF7F28);
  border-color: #E4681A;
  box-shadow: 0 3px 0 #CB560F, 0 8px 16px rgba(200, 85, 15, .3);
}
.level-tile.current .lt-no { color: #fff; text-shadow: 0 1px 0 rgba(150, 55, 0, .35); }
.level-tile.current .star { background: rgba(255, 255, 255, .4); }
.level-tile.current .star.on { background: linear-gradient(180deg, #FFEBA8, #FFC53D); }
.level-tile.perfect { border-color: #F0BE6A; }
.level-tile.locked {
  background: linear-gradient(180deg, #F6EDE2, #EEE2D3);
  border-color: #E7D8C6;
  box-shadow: none;
  color: #B9A490;
}
.level-tile.locked .lt-no { color: #BDA893; }
.level-tile.locked .mp-icon { width: 17px; height: 17px; color: #B9A490; }

/* 排行榜 */
.my-card {
  display: flex; align-items: center; gap: 11px;
  padding: 14px;
  border-radius: 20px;
  background: linear-gradient(135deg, #FF9A48, #FF7A26);
  box-shadow: 0 6px 0 #D65A0F, 0 16px 26px rgba(200, 85, 15, .24);
  color: #fff;
}
.my-card .avatar { width: 46px; height: 46px; border-color: rgba(255, 255, 255, .8); background: rgba(255, 255, 255, .28); font-size: 19px; }
.my-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.my-info b { font-size: 16px; font-weight: 900; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.my-info span { font-size: 10.5px; opacity: .9; }
.my-score { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.05; }
.my-score b { font-size: 27px; font-weight: 900; font-variant-numeric: tabular-nums; text-shadow: 0 1px 0 rgba(150, 55, 0, .3); }
.my-score span { font-size: 10px; opacity: .85; }
.my-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 2px; }
.my-meta span { padding: 2px 7px; border-radius: 999px; background: rgba(255, 255, 255, .22); font-size: 10px; font-weight: 800; }
.my-meta .link-btn { padding: 2px 9px; font-size: 10px; font-weight: 800; background: rgba(255, 255, 255, .92); border-color: transparent; }

.rank-list {
  margin-top: 14px;
  border-radius: 20px;
  background: rgba(255, 253, 247, .8);
  border: 1px solid rgba(255, 255, 255, .9);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
.rank-row {
  display: flex; align-items: center; gap: 9px;
  padding: 11px 13px;
  border-bottom: 1px solid rgba(230, 205, 178, .55);
}
.rank-row:last-child { border-bottom: 0; }
.rank-row.mine { background: rgba(255, 226, 190, .6); }
.rr-badge {
  flex: 0 0 auto;
  width: 25px; height: 25px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 9px;
  background: #F3E4D3;
  color: #8B6A4D;
  font-size: 12px; font-weight: 900;
  font-variant-numeric: tabular-nums;
}
.rank-row.top1 .rr-badge { background: linear-gradient(180deg, #FFD75E, #FFB01F); color: #7A4300; box-shadow: 0 2px 0 #D98F0E; }
.rank-row.top2 .rr-badge { background: linear-gradient(180deg, #E6E9EE, #BFC6CF); color: #4E5866; box-shadow: 0 2px 0 #A6AEB9; }
.rank-row.top3 .rr-badge { background: linear-gradient(180deg, #F0C39A, #D79A66); color: #6B3B13; box-shadow: 0 2px 0 #BA7E4C; }
.rr-avatar {
  flex: 0 0 auto;
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: linear-gradient(180deg, #FFD0A0, #FFA85E);
  color: #fff;
  font-size: 13px; font-weight: 900;
}
.rr-name {
  flex: 1; min-width: 0;
  font-size: 14px; font-weight: 800;
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
.rr-lv {
  flex: 0 0 auto;
  font-size: 9.5px; font-weight: 800; color: #B9611B;
  padding: 2px 6px;
  border-radius: 6px;
  background: #FFEBD4;
}
.rr-score {
  flex: 0 0 auto;
  min-width: 52px;
  text-align: right;
  font-size: 16px; font-weight: 900;
  color: #C25A14;
  font-variant-numeric: tabular-nums;
}
.rank-empty, .rank-loading {
  padding: 34px 18px;
  text-align: center;
  display: flex; flex-direction: column; gap: 6px;
}
.rank-empty b { font-size: 15px; font-weight: 900; color: #8E4A18; }
.rank-empty span { font-size: 11.5px; color: var(--ink-2); }
.rank-tip { margin-top: 12px; text-align: center; font-size: 10.5px; color: rgba(120, 70, 30, .6); }
.rank-row.skeleton { pointer-events: none; }
.rank-row.skeleton .rr-badge { background: #F0E4D6; }
.rr-line {
  flex: 1; height: 12px; border-radius: 6px;
  background: linear-gradient(90deg, #F2E6D8 25%, #FAF1E6 50%, #F2E6D8 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite linear;
}
.spin { animation: spin .6s linear; }

/* ---------------- 动画 ---------------- */
@keyframes pop { 0% { transform: scale(.72); } 60% { transform: scale(1.1); } 100% { transform: scale(1); } }
@keyframes burst { 0% { opacity: .95; transform: scale(.25); } 100% { opacity: 0; transform: scale(1.15); } }
@keyframes floatUp {
  0% { opacity: 0; transform: translateY(8px) scale(.8); }
  25% { opacity: 1; transform: translateY(-2px) scale(1.1); }
  100% { opacity: 0; transform: translateY(-42px) scale(1); }
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-5px); }
  40% { transform: translateX(5px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(3px); }
}
@keyframes breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.04); } }
@keyframes urgent { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }
@keyframes glow {
  0% { box-shadow: 0 0 0 0 rgba(255, 170, 60, .6), var(--shadow-card); }
  100% { box-shadow: 0 0 0 16px rgba(255, 170, 60, 0), var(--shadow-card); }
}
@keyframes squash { 0% { transform: scaleY(1); } 45% { transform: scaleY(.82) scaleX(1.14); } 100% { transform: scaleY(1); } }
@keyframes starIn { 0% { opacity: 0; transform: scale(.3) rotate(-24deg); } 70% { opacity: 1; transform: scale(1.16) rotate(4deg); } 100% { transform: scale(1) rotate(0); } }
@keyframes ribbonIn { 0% { transform: scale(.7) translateY(-6px); opacity: 0; } 100% { transform: none; opacity: 1; } }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-height: 620px) {
  .slot { width: 40px; height: 44px; font-size: 22px; }
  .quest { padding: 8px 12px 7px; }
  .game-title { font-size: 23px; margin-top: 8px; }
  .mascot { width: 78px; height: 74px; margin-top: -40px; }
  .level-preview { padding: 7px 10px; }
  .btn { min-height: 46px; font-size: 16px; }
  .btn.ghost { min-height: 42px; }
  .panel { padding: 16px 15px 13px; }
  .panel-start { padding-top: 48px; }
}
@media (min-width: 560px) {
  .slot { width: 50px; height: 54px; font-size: 28px; }
}
