/* =========================================================
   猜动物 · 卡通游戏 H5
   主色 #FF8A3D，竖屏铺满，移动端优先
   ========================================================= */

:root {
  --orange: #FF8A3D;
  --orange-deep: #E86A1F;
  --orange-soft: #FFE7D0;
  --cream: #FFF7EC;
  --paper: #FFFDF8;
  --ink: #3B2A22;
  --ink-2: #6F5748;
  --muted: #A28A78;
  --line: #F1DDC5;
  --line-strong: #E8CDB0;
  --green: #4FAE72;
  --green-soft: #EAF8EE;
  --red: #EF5F4C;
  --red-soft: #FFF0ED;
  --yellow: #FFC94A;
  --blue: #5BB9D6;
  --shadow-card: 0 10px 24px rgba(178, 109, 52, 0.12);
  --font: "PingFang SC", "HarmonyOS Sans SC", "MiSans", "Noto Sans CJK SC",
    "Microsoft YaHei", system-ui, -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--cream);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overscroll-behavior: none;
  touch-action: manipulation;
}

button {
  border: 0;
  margin: 0;
  padding: 0;
  background: none;
  color: inherit;
  font-family: inherit;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
}

[hidden] {
  display: none !important;
}

/* ------------------------- 背景 ------------------------- */

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(420px 330px at 108% -6%, #FFD9B5 0%, rgba(255, 217, 181, 0) 66%),
    radial-gradient(390px 310px at -18% 24%, #E4F4E4 0%, rgba(228, 244, 228, 0) 62%),
    radial-gradient(360px 330px at 108% 84%, #DEF1F5 0%, rgba(222, 241, 245, 0) 62%),
    linear-gradient(180deg, #FFF8EE 0%, #FFF2E1 54%, #FFEBD3 100%);
  pointer-events: none;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  background-image: radial-gradient(rgba(201, 143, 94, 0.22) 1.3px, transparent 1.4px);
  background-size: 20px 20px;
  opacity: 0.5;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, transparent 72%);
  mask-image: linear-gradient(180deg, #000 0%, transparent 72%);
  pointer-events: none;
}

.app {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100dvh;
}

.bg-decor {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

body[data-screen="game"] .bg-decor {
  opacity: 0.4;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(26px);
}

.blob-a {
  width: 230px;
  height: 230px;
  right: -70px;
  top: -70px;
  background: #FFD6AE;
  opacity: 0.62;
}

.blob-b {
  width: 200px;
  height: 200px;
  left: -90px;
  top: 40%;
  background: #DDF2DC;
  opacity: 0.7;
}

.blob-c {
  width: 220px;
  height: 220px;
  right: -80px;
  bottom: -80px;
  background: #D8EFF5;
  opacity: 0.62;
}

.dot-cluster {
  position: absolute;
  width: 88px;
  height: 88px;
  background-image: radial-gradient(#D9A97C 2px, transparent 2.6px);
  background-size: 14px 14px;
  opacity: 0.24;
}

.dot-a {
  left: 10px;
  top: 120px;
  transform: rotate(8deg);
}

.dot-b {
  right: 12px;
  bottom: 150px;
  transform: rotate(-6deg);
}

.paw {
  position: absolute;
  width: 34px;
  height: 34px;
  color: #E8A468;
  opacity: 0.14;
}

.paw-a {
  left: 20px;
  top: 32%;
  transform: rotate(-20deg);
}

.paw-b {
  right: 16px;
  top: 62%;
  transform: rotate(18deg) scale(1.2);
}

.paw-c {
  left: 34px;
  bottom: 10%;
  transform: rotate(8deg) scale(0.8);
}

/* ------------------------- 屏幕 ------------------------- */

.screen {
  display: none;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  padding: calc(env(safe-area-inset-top, 0px) + 14px) 16px
    calc(env(safe-area-inset-bottom, 0px) + 18px);
}

.screen.is-active {
  display: flex;
  flex-direction: column;
  animation: screen-in 0.34s ease both;
}

/* ------------------------- 通用按钮 ------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 18px;
  font-weight: 800;
  font-size: 16px;
  line-height: 1;
  transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
}

.btn-primary {
  color: #fff;
  background: linear-gradient(180deg, #ff9c51 0%, #ff7c27 100%);
  border: 2px solid #ffb077;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.35), 0 5px 0 #d45e17,
    0 14px 24px rgba(232, 106, 31, 0.24);
  text-shadow: 0 1px 0 rgba(180, 70, 10, 0.24);
}

.btn-primary .mp-icon {
  width: 20px;
  height: 20px;
  color: #fff;
}

.btn-primary:active {
  transform: translateY(4px);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.35), 0 1px 0 #d45e17,
    0 4px 10px rgba(232, 106, 31, 0.18);
}

.btn-ghost {
  color: #8a6a50;
  background: rgba(255, 253, 248, 0.92);
  border: 2px solid var(--line);
  box-shadow: 0 4px 0 #ebd4ba;
}

.btn-ghost:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 #ebd4ba;
}

/* ------------------------- 首页 ------------------------- */

.home {
  align-items: center;
  justify-content: flex-start;
  position: relative;
}

.home-wrap {
  width: 100%;
  max-width: 440px;
  margin: auto 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.brand-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 999px;
  color: #b47840;
  background: rgba(255, 253, 248, 0.9);
  border: 2px solid #f6e3cd;
  box-shadow: 0 4px 12px rgba(178, 109, 52, 0.08);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.brand-pill .mp-icon {
  width: 15px;
  height: 15px;
  color: var(--orange);
}

.game-title {
  margin: 10px 0 0;
  font-size: clamp(44px, 14vw, 60px);
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0.08em;
  color: #f47a22;
  text-shadow: 0 3px 0 #fff3e2, 0 6px 0 rgba(232, 106, 31, 0.18),
    0 14px 26px rgba(232, 106, 31, 0.18);
}

.tagline {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: 0.2em;
}

.hero {
  position: relative;
  width: 100%;
  max-width: 360px;
  height: clamp(232px, 31vh, 282px);
  margin: 14px 0 4px;
}

.hero-card {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 26px;
  border: 2px solid var(--line);
  background: var(--paper);
  box-shadow: 0 14px 30px rgba(178, 109, 52, 0.16);
  overflow: hidden;
}

.hero-card::before {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 20px;
  border: 2px dashed rgba(255, 138, 61, 0.18);
  pointer-events: none;
}

.hero-card svg {
  width: 82%;
  height: 82%;
  display: block;
}

.hc-front {
  width: 176px;
  height: 206px;
  left: 50%;
  top: 12px;
  transform: translateX(-50%);
  z-index: 3;
  animation: hero-float 4.4s ease-in-out infinite;
}

.hc-left {
  width: 128px;
  height: 160px;
  left: 0;
  top: 40px;
  transform: rotate(-11deg);
  z-index: 1;
  background: #fff9f0;
}

.hc-right {
  width: 128px;
  height: 160px;
  right: 0;
  top: 40px;
  transform: rotate(11deg);
  z-index: 1;
  background: #fff9f0;
}

.hero-card.is-silhouette svg {
  filter: brightness(0) saturate(100%);
  opacity: 0.82;
}

.hero-card.is-silhouette::after {
  content: "?";
  position: absolute;
  right: 12px;
  bottom: 10px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #c79a6b;
  background: #fff3e2;
  border: 2px solid #f0d9bf;
  font-size: 14px;
  font-weight: 900;
  line-height: 1;
}

.hero-sticker {
  position: absolute;
  top: 2px;
  right: 4px;
  z-index: 5;
  padding: 7px 12px;
  border-radius: 12px;
  background: linear-gradient(180deg, #ffc94a, #ffb020);
  color: #7c4a08;
  border: 3px solid #fffdf8;
  box-shadow: 0 8px 16px rgba(201, 137, 32, 0.24);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  transform: rotate(8deg);
}

.btn-start {
  width: 100%;
  max-width: 340px;
  height: 60px;
  margin-top: 4px;
  font-size: 19px;
  letter-spacing: 0.08em;
}

.btn-start .mp-icon {
  width: 24px;
  height: 24px;
}

.best-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  padding: 7px 14px;
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.9);
  border: 2px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.best-chip .mp-icon {
  width: 15px;
  height: 15px;
  color: #e8a21b;
}

.best-chip b {
  color: var(--orange-deep);
  font-size: 15px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.rules {
  width: 100%;
  max-width: 340px;
  margin: 16px 0 0;
  padding: 8px 14px;
  list-style: none;
  text-align: left;
  background: rgba(255, 253, 248, 0.7);
  border: 2px dashed #f0d9bf;
  border-radius: 20px;
}

.rules li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
}

.rules li + li {
  border-top: 1px dashed rgba(232, 205, 176, 0.6);
}

.rule-ico {
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: #eef7ee;
  color: #55a86c;
}

.rule-ico.is-orange {
  background: #fff1e0;
  color: var(--orange-deep);
}

.rule-ico.is-red {
  background: #ffecea;
  color: var(--red);
}

.rule-ico .mp-icon {
  width: 17px;
  height: 17px;
}

.rules p {
  margin: 0;
  color: var(--ink-2);
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.42;
}

.sound-btn {
  position: absolute;
  top: calc(env(safe-area-inset-top, 0px) + 14px);
  right: 16px;
  z-index: 10;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #b47840;
  background: rgba(255, 253, 248, 0.92);
  border: 2px solid var(--line);
  box-shadow: 0 4px 10px rgba(178, 109, 52, 0.1);
}

.sound-btn .mp-icon {
  width: 20px;
  height: 20px;
}

.sound-btn:active {
  transform: scale(0.94);
}

.sound-btn.is-off {
  color: #bcaa98;
}

/* ------------------------- 游戏 ------------------------- */

.game {
  align-items: center;
  justify-content: flex-start;
}

.game-top,
.stage,
.clue-card,
.options,
.answer-sheet {
  width: 100%;
  max-width: 460px;
}

.hud {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
}

.q-pill {
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.92);
  border: 2px solid var(--line);
  box-shadow: 0 4px 10px rgba(178, 109, 52, 0.08);
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink-2);
  white-space: nowrap;
}

.q-pill b {
  color: var(--orange-deep);
  font-size: 14px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.hearts {
  display: flex;
  align-items: center;
  gap: 3px;
}

.heart {
  width: 19px;
  height: 19px;
  color: #f0614f;
  filter: drop-shadow(0 2px 2px rgba(240, 97, 79, 0.22));
  transition: transform 0.25s ease, color 0.25s ease, filter 0.25s ease;
}

.heart.lost {
  color: #dcc9b6;
  filter: none;
  transform: scale(0.86);
}

.score-pill {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border-radius: 999px;
  color: #ffe9cf;
  background: #3b2a22;
  box-shadow: 0 4px 0 rgba(59, 42, 34, 0.16);
  font-size: 12px;
  font-weight: 800;
}

.score-pill .mp-icon {
  width: 15px;
  height: 15px;
  color: var(--yellow);
}

.score-pill b {
  color: #fff3e2;
  font-size: 15px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.score-pill.bump {
  animation: score-bump 0.36s ease;
}

.timer-track {
  width: 100%;
  height: 9px;
  margin-top: 10px;
  border-radius: 999px;
  border: 1px solid #ead3b8;
  background: #f2dcc4;
  overflow: hidden;
}

.timer-fill {
  display: block;
  height: 100%;
  width: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #ffc24a, #ff8a3d);
  transition: width 0.1s linear, background 0.3s ease;
}

.timer-fill.low {
  background: linear-gradient(90deg, #ff9a50, #f0614f);
  animation: low-pulse 0.7s ease-in-out infinite;
}

/* 剪影舞台 */

.stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 214px;
  max-height: 520px;
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-bottom: 24px;
  border-radius: 28px;
  border: 2px solid #f2dcc2;
  background: radial-gradient(circle at 50% 44%, #fffbf4 0%, #fff2de 58%, #ffe4c6 100%);
  box-shadow: inset 0 -8px 0 rgba(232, 174, 120, 0.12),
    0 12px 26px rgba(178, 109, 52, 0.12);
  overflow: hidden;
}

.stage::before {
  content: "";
  position: absolute;
  width: 250px;
  height: 250px;
  width: min(76vw, 296px);
  height: min(76vw, 296px);
  border-radius: 50%;
  border: 3px dashed rgba(255, 138, 61, 0.24);
  animation: spin 28s linear infinite;
}

.stage::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image: radial-gradient(rgba(255, 180, 120, 0.18) 1.2px, transparent 1.3px);
  background-size: 16px 16px;
  opacity: 0.7;
  pointer-events: none;
}

.stage.shake {
  animation: shake 0.42s ease;
}

.animal {
  position: relative;
  z-index: 2;
  width: 240px;
  height: 240px;
  width: clamp(184px, min(70vw, 34vh), 300px);
  height: clamp(184px, min(70vw, 34vh), 300px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.animal svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
}

.animal.is-silhouette svg {
  filter: brightness(0) saturate(100%)
    drop-shadow(0 12px 10px rgba(59, 42, 34, 0.16));
  opacity: 0.9;
}

.animal.is-silhouette {
  animation: bob 3.4s ease-in-out infinite;
}

.animal.is-revealed {
  animation: reveal-pop 0.55s cubic-bezier(0.2, 1.5, 0.4, 1) both;
}

.animal.is-revealed svg {
  filter: drop-shadow(0 10px 12px rgba(59, 42, 34, 0.14));
}

.stage-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 3;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #c79a6b;
  background: #fffdf8;
  border: 2px solid var(--line);
  box-shadow: 0 4px 10px rgba(178, 109, 52, 0.1);
}

.stage-badge .mp-icon {
  width: 18px;
  height: 18px;
}

.stage.revealed .stage-badge {
  color: #3fae6a;
  background: var(--green-soft);
  border-color: #bfe6cb;
}

.streak-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  color: #b87412;
  background: #fff3d6;
  border: 2px solid #ffd98a;
  font-size: 11px;
  font-weight: 800;
  box-shadow: 0 4px 10px rgba(201, 137, 32, 0.12);
  animation: stamp 0.34s cubic-bezier(0.2, 1.4, 0.4, 1);
}

.streak-badge .mp-icon {
  width: 14px;
  height: 14px;
  color: #f08a2e;
}

.streak-badge b {
  font-size: 13px;
  font-weight: 900;
}

.stage-caption {
  position: absolute;
  bottom: 10px;
  left: 50%;
  z-index: 3;
  transform: translateX(-50%);
  padding: 5px 14px;
  border-radius: 999px;
  color: #fff3e2;
  background: rgba(59, 42, 34, 0.82);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.stage.revealed .stage-caption {
  background: var(--orange);
  box-shadow: 0 4px 12px rgba(232, 106, 31, 0.3);
}

/* 线索 */

.clue-card {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 22px;
  background: var(--paper);
  border: 2px solid var(--line);
  box-shadow: 0 8px 18px rgba(178, 109, 52, 0.08);
}

.clue-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.clue-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #b47840;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.clue-label .mp-icon {
  width: 15px;
  height: 15px;
  color: #e8a21b;
}

.hint-btn {
  flex: none;
  padding: 8px 12px;
  border-radius: 999px;
  color: #d96a1e;
  background: #fff1df;
  font-size: 11.5px;
  font-weight: 800;
  transition: transform 0.12s ease, opacity 0.2s ease;
}

.hint-btn:active {
  transform: scale(0.95);
}

.hint-btn:disabled {
  color: #b8a694;
  background: #f6eee3;
  cursor: default;
}

.clue-list {
  margin: 7px 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.clue-list li {
  display: flex;
  gap: 8px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.45;
  animation: clue-in 0.28s ease both;
}

.clue-list li::before {
  content: "";
  flex: none;
  width: 6px;
  height: 6px;
  margin-top: 8px;
  border-radius: 50%;
  background: var(--orange);
}

/* 选项 */

.options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}

.option {
  position: relative;
  min-height: 58px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  text-align: left;
  border-radius: 18px;
  border: 2px solid var(--line);
  background: var(--paper);
  box-shadow: 0 4px 0 #ebd4ba;
  color: var(--ink);
  font-size: 16px;
  font-weight: 800;
  transition: transform 0.12s ease, box-shadow 0.12s ease,
    background 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}

.option:active:not(:disabled) {
  transform: translateY(3px);
  box-shadow: 0 1px 0 #ebd4ba;
}

.option:disabled {
  cursor: default;
}

.option.correct:disabled,
.option.wrong:disabled {
  opacity: 1;
}

.option .letter {
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  color: #d96a1e;
  background: #fff0dc;
  font-size: 12px;
  font-weight: 900;
}

.option .name {
  flex: 1 1 auto;
  min-width: 0;
  white-space: nowrap;
}

.option .mark {
  flex: none;
  width: 18px;
  height: 18px;
  display: none;
}

.option.correct {
  color: #237a46;
  background: var(--green-soft);
  border-color: #59b97e;
  box-shadow: 0 4px 0 #b9e3c7;
  animation: correct-pop 0.32s ease;
}

.option.correct .letter {
  color: #fff;
  background: #59b97e;
}

.option.correct .mark {
  display: block;
  color: #3fae6a;
}

.option.wrong {
  color: #b73b2c;
  background: var(--red-soft);
  border-color: #f08a7a;
  box-shadow: 0 4px 0 #f3c3bb;
  animation: wobble 0.4s ease;
}

.option.wrong .letter {
  color: #fff;
  background: #f0614f;
}

.option.wrong .mark {
  display: block;
  color: #e85a47;
}

.option.dim:not(.correct):not(.wrong) {
  opacity: 0.55;
}

/* 答题结果 */

.answer-sheet {
  margin-top: 12px;
  padding: 14px;
  border-radius: 22px;
  background: var(--paper);
  border: 2px solid var(--line);
  box-shadow: 0 10px 24px rgba(178, 109, 52, 0.12);
  animation: sheet-in 0.32s cubic-bezier(0.2, 1.1, 0.4, 1) both;
}

.answer-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.answer-ico {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  color: #3fae6a;
  background: var(--green-soft);
}

.answer-ico.bad {
  color: #e85a47;
  background: var(--red-soft);
}

.answer-ico .mp-icon {
  width: 22px;
  height: 22px;
}

.answer-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.answer-copy b {
  font-size: 16px;
  font-weight: 900;
  line-height: 1.25;
}

.answer-copy span {
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 700;
}

.answer-score {
  margin-left: auto;
  color: var(--orange-deep);
  font-size: 22px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.fact {
  margin: 10px 0 12px;
  padding: 10px 12px;
  border-radius: 14px;
  background: #fff8ee;
  color: #7a6455;
  font-size: 12.5px;
  line-height: 1.55;
}

.btn-next {
  width: 100%;
  height: 52px;
}

/* ------------------------- 结算 ------------------------- */

.result {
  position: relative;
  align-items: center;
  justify-content: flex-start;
  overflow: hidden;
}

.result-wrap {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 400px;
  margin: auto 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.rank-badge {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #e8842c;
  background: radial-gradient(circle at 35% 30%, #fff4d8, #ffd98a);
  border: 4px solid #fffdf8;
  box-shadow: 0 0 0 4px #ffe0b2, 0 16px 30px rgba(226, 150, 60, 0.28);
  animation: badge-in 0.6s cubic-bezier(0.2, 1.5, 0.4, 1) both;
}

.rank-badge .mp-icon {
  width: 48px;
  height: 48px;
}

.record-chip {
  position: relative;
  z-index: 3;
  margin-top: -12px;
  padding: 4px 12px;
  border-radius: 999px;
  color: #8a4a0c;
  background: linear-gradient(180deg, #ffd45e, #ffb02e);
  border: 3px solid #fffdf8;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.12em;
  box-shadow: 0 6px 14px rgba(201, 137, 32, 0.28);
  transform: rotate(-3deg);
  animation: stamp 0.5s 0.25s cubic-bezier(0.2, 1.4, 0.4, 1) both;
}

.result-title {
  margin: 14px 0 0;
  font-size: 28px;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.result-sub {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.final-score {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 4px;
  margin: 8px 0 0;
}

.final-score span {
  color: #f07a22;
  font-size: 62px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 4px 0 rgba(255, 214, 170, 0.7);
}

.final-score small {
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.stats {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 16px;
}

.stat {
  padding: 10px 4px;
  border-radius: 18px;
  background: var(--paper);
  border: 2px solid var(--line);
  box-shadow: 0 5px 12px rgba(178, 109, 52, 0.08);
}

.stat b {
  display: block;
  color: var(--ink);
  font-size: 21px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.stat span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 700;
}

.result-actions {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 20px;
}

.result-actions .btn {
  width: 100%;
  height: 56px;
}

.confetti {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
}

.confetti i {
  position: absolute;
  top: -24px;
  width: 9px;
  height: 15px;
  border-radius: 3px;
  animation-name: confetti-fall;
  animation-timing-function: linear;
  animation-fill-mode: forwards;
}

/* ------------------------- 浮层与动效 ------------------------- */

.toast {
  position: fixed;
  left: 50%;
  top: calc(env(safe-area-inset-top, 0px) + 74px);
  z-index: 90;
  max-width: calc(100vw - 48px);
  padding: 10px 16px;
  border-radius: 16px;
  color: #fff6e8;
  background: rgba(59, 42, 34, 0.94);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -12px);
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.spark {
  position: absolute;
  z-index: 4;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  pointer-events: none;
  animation: spark-burst 0.7s ease-out forwards;
}

@keyframes screen-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes hero-float {
  0%,
  100% {
    transform: translateX(-50%) translateY(0) rotate(-1deg);
  }
  50% {
    transform: translateX(-50%) translateY(-7px) rotate(1deg);
  }
}

@keyframes bob {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes reveal-pop {
  0% {
    transform: scale(0.86);
    opacity: 0.5;
  }
  60% {
    transform: scale(1.06);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes stamp {
  from {
    opacity: 0;
    transform: scale(0.5) rotate(-8deg);
  }
  to {
    opacity: 1;
    transform: scale(1) rotate(0deg);
  }
}

@keyframes score-bump {
  0% {
    transform: scale(1);
  }
  45% {
    transform: scale(1.12);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes clue-in {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes sheet-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes wobble {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-5px);
  }
  50% {
    transform: translateX(5px);
  }
  75% {
    transform: translateX(-3px);
  }
}

@keyframes correct-pop {
  0% {
    transform: scale(1);
  }
  55% {
    transform: scale(1.035);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  20% {
    transform: translateX(-7px);
  }
  40% {
    transform: translateX(7px);
  }
  60% {
    transform: translateX(-5px);
  }
  80% {
    transform: translateX(4px);
  }
}

@keyframes low-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.55;
  }
}

@keyframes badge-in {
  0% {
    opacity: 0;
    transform: scale(0.5) rotate(-10deg);
  }
  70% {
    opacity: 1;
    transform: scale(1.06) rotate(2deg);
  }
  100% {
    transform: scale(1) rotate(0);
  }
}

@keyframes confetti-fall {
  0% {
    opacity: 1;
    transform: translate3d(0, 0, 0) rotate(0deg);
  }
  100% {
    opacity: 0.9;
    transform: translate3d(var(--drift, 0px), 110vh, 0) rotate(620deg);
  }
}

@keyframes spark-burst {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--x, 0px)), calc(-50% + var(--y, 0px)))
      scale(0.2);
  }
}

/* ------------------------- 适配 ------------------------- */

@media (max-width: 350px) {
  .screen {
    padding-left: 12px;
    padding-right: 12px;
  }

  .game-title {
    font-size: 42px;
  }

  .option {
    font-size: 15px;
    gap: 7px;
    padding: 8px;
  }

  .option .letter {
    width: 24px;
    height: 24px;
  }

  .hc-front {
    width: 158px;
    height: 190px;
  }

  .hc-left,
  .hc-right {
    width: 112px;
    height: 148px;
  }
}

@media (max-height: 720px) {
  .hero {
    height: 218px;
    margin-top: 10px;
  }

  .hc-front {
    width: 158px;
    height: 188px;
    top: 8px;
  }

  .hc-left,
  .hc-right {
    width: 114px;
    height: 146px;
    top: 34px;
  }

  .rules {
    margin-top: 12px;
  }

  .rules li {
    padding: 5px 0;
  }

  .stage {
    min-height: 200px;
  }
}

@media (max-height: 660px) {
  .rules {
    display: none;
  }

  .hero {
    height: 188px;
  }

  .hc-front {
    width: 142px;
    height: 168px;
  }

  .hc-left,
  .hc-right {
    width: 102px;
    height: 132px;
    top: 30px;
  }

  .game-title {
    font-size: 40px;
  }

  .tagline {
    margin-top: 8px;
  }

  .stage {
    min-height: 178px;
  }

  .stage::before {
    width: 150px;
    height: 150px;
  }

  .animal {
    width: 150px;
    height: 150px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
