:root {
  --sky-1: #3fa9fb;
  --sky-2: #74cdfb;
  --sky-3: #b9ebff;
  --ink: #5a3216;
  --ink-soft: #8a5a32;
  --ink-faint: #a97c50;
  --cream: #fff6dd;
  --cream-deep: #ffe8b4;
  --wood: #d98f4a;
  --wood-dark: #8a4e20;
  --wood-deep: #5e2f10;
  --gold: #ffd23f;
  --gold-deep: #e39a00;
  --green: #4fbf63;
  --red: #d9534f;
  --shadow-wood: 0 6px 0 #6b3a12;
}

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

html {
  background: #4ab1fe;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--ink);
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC",
    system-ui, -apple-system, sans-serif;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  touch-action: manipulation;
}

body.modal-open {
  overflow: hidden;
}

button {
  font-family: inherit;
}

/* ---------- 卡通天空背景 ---------- */
.sky-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(90% 50% at 78% 8%, rgba(255, 255, 255, 0.42), transparent 62%),
    linear-gradient(180deg, var(--sky-1) 0%, var(--sky-2) 34%, var(--sky-3) 58%,
      #e9f7c8 72%, #9cdc63 100%);
}

.sky-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 80% at 50% 46%, transparent 58%, rgba(22, 82, 128, 0.1));
}

.sun {
  position: absolute;
  top: -62px;
  right: -52px;
  width: 210px;
  height: 210px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 250, 190, 0.95) 0 24%, rgba(255, 247, 170, 0.45) 46%, rgba(255, 247, 170, 0) 70%);
}

.cloud {
  position: absolute;
  height: 34px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 6px 18px rgba(50, 130, 190, 0.12);
}

.cloud::before,
.cloud::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  background: inherit;
}

.cloud-a {
  width: 118px;
  top: 12%;
  left: -34px;
  opacity: 0.92;
}

.cloud-a::before {
  width: 52px;
  height: 52px;
  left: 14px;
  top: -24px;
}

.cloud-a::after {
  width: 38px;
  height: 38px;
  left: 58px;
  top: -15px;
}

.cloud-b {
  width: 92px;
  top: 31%;
  right: -38px;
  opacity: 0.7;
  transform: scale(1.1);
}

.cloud-b::before {
  width: 44px;
  height: 44px;
  left: 12px;
  top: -21px;
}

.cloud-b::after {
  width: 30px;
  height: 30px;
  left: 48px;
  top: -11px;
}

.cloud-c {
  width: 66px;
  height: 22px;
  top: 47%;
  left: 4%;
  opacity: 0.45;
}

.cloud-c::before {
  width: 30px;
  height: 30px;
  left: 10px;
  top: -14px;
}

.cloud-c::after {
  width: 22px;
  height: 22px;
  left: 36px;
  top: -8px;
}

.hill {
  position: absolute;
  left: -18%;
  width: 136%;
  border-radius: 50% 50% 0 0;
  transform-origin: bottom center;
}

.hill-back {
  bottom: -128px;
  height: 320px;
  background:
    radial-gradient(50% 55% at 28% 30%, rgba(255, 255, 255, 0.22), transparent 70%),
    linear-gradient(180deg, #a9e069 0%, #6fbe3f 100%);
  box-shadow: inset 0 10px 0 rgba(255, 255, 255, 0.16);
}

.hill-front {
  bottom: -208px;
  left: -34%;
  width: 168%;
  height: 400px;
  background:
    radial-gradient(40% 40% at 62% 26%, rgba(255, 255, 255, 0.2), transparent 70%),
    linear-gradient(180deg, #8ad352 0%, #55ae33 100%);
}

/* 草地上的小花点 */
.hill-front::before {
  content: "";
  position: absolute;
  top: 34px;
  left: 22%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff5c2;
  box-shadow:
    46px 18px 0 1px #ffd7de,
    112px -6px 0 0 #fff5c2,
    178px 22px 0 1px #ffe9a3,
    246px 4px 0 0 #ffd7de,
    318px 26px 0 1px #fff5c2,
    386px -2px 0 0 #ffe9a3,
    452px 20px 0 1px #ffd7de;
  opacity: 0.9;
}

/* ---------- 游戏主列 ---------- */
.game {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 480px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top, 0px) + 10px) 16px
    calc(env(safe-area-inset-bottom, 0px) + 14px);
  display: flex;
  flex-direction: column;
}

/* ---------- 顶部关卡 / 得分 ---------- */
.hud {
  position: relative;
  z-index: 6;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 46px;
  padding: 0 18px;
  border: 2.5px solid #6b3a12;
  border-radius: 16px;
  color: #51300f;
  font-weight: 900;
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.05) 0 2px, transparent 2px 7px),
    linear-gradient(180deg, #f4c07b 0%, #e3a05a 54%, #cd8141 100%);
  box-shadow:
    inset 0 2px 0 rgba(255, 238, 202, 0.9),
    inset 0 -3px 0 rgba(116, 57, 17, 0.18),
    0 5px 0 #5e2f10,
    0 10px 16px rgba(62, 32, 5, 0.22);
  text-shadow: 0 1px 0 rgba(255, 245, 214, 0.65);
}

.level-pill {
  min-width: 108px;
  font-size: 17px;
  gap: 6px;
}

.level-pill .pill-v {
  min-width: 22px;
  font-size: 23px;
  line-height: 1;
  text-align: center;
  color: #452507;
}

.score-pill {
  min-width: 90px;
  padding: 0 16px;
  gap: 7px;
  font-size: 23px;
  color: #452507;
}

.star-ico {
  width: 25px;
  height: 25px;
  color: #ffd83f;
  filter: drop-shadow(0 2px 0 #a96700) drop-shadow(0 0 1px #a96700);
}

.score-v {
  min-width: 20px;
  line-height: 1;
  text-align: left;
}

.score-float {
  position: absolute;
  right: 10px;
  top: 2px;
  color: #ffef8a;
  font-size: 17px;
  font-weight: 900;
  text-shadow: 0 2px 0 #b06a00, 0 0 8px rgba(255, 225, 92, 0.9);
  opacity: 0;
  pointer-events: none;
}

.score-pill.bump {
  animation: pill-bump 0.42s cubic-bezier(0.2, 1.5, 0.4, 1);
}

.score-pill.bump .score-float {
  animation: score-rise 0.9s ease-out forwards;
}

/* ---------- 柴犬 & 鸭鸭 ---------- */
.stage {
  position: relative;
  z-index: 2;
  flex: 0 0 auto;
  margin-top: 4px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.hero {
  display: block;
  width: 100%;
  height: auto;
  user-select: none;
  -webkit-user-drag: none;
  filter: drop-shadow(0 8px 8px rgba(20, 80, 120, 0.16));
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 7%, #000 100%);
  mask-image: linear-gradient(to bottom, transparent 0%, #000 7%, #000 100%);
  animation: hero-in 0.6s cubic-bezier(0.2, 0.9, 0.3, 1) both;
}

/* ---------- 木质谜面牌 ---------- */
.signboard {
  position: relative;
  z-index: 3;
  flex: 0 0 auto;
  margin-top: -11px;
  padding: 10px;
  border: 2px solid #6b3a12;
  border-radius: 25px;
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.055) 0 2px, transparent 2px 8px),
    repeating-linear-gradient(0deg, rgba(90, 40, 8, 0.055) 0 2px, transparent 2px 9px),
    linear-gradient(180deg, #eab06a 0%, #d18a48 48%, #b86d31 100%);
  box-shadow:
    inset 0 2px 0 rgba(255, 230, 190, 0.8),
    inset 0 -3px 0 rgba(90, 40, 8, 0.2),
    0 7px 0 #6b3a12,
    0 15px 24px rgba(62, 32, 5, 0.28);
}

.signboard::before,
.signboard::after {
  content: "";
  position: absolute;
  top: 5px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffe2b0, #b96f2f 60%, #7a4115 100%);
  box-shadow: 0 1px 2px rgba(70, 30, 0, 0.5);
  z-index: 2;
}

.signboard::before {
  left: 16px;
}

.signboard::after {
  right: 16px;
}

.sign-paper {
  position: relative;
  min-height: 140px;
  padding: 18px 26px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid rgba(122, 69, 24, 0.38);
  border-radius: 17px;
  background:
    radial-gradient(105% 80% at 20% 0%, rgba(255, 255, 255, 0.68), rgba(255, 255, 255, 0) 56%),
    radial-gradient(80% 100% at 100% 100%, rgba(219, 165, 84, 0.28), transparent 62%),
    repeating-linear-gradient(0deg, rgba(150, 95, 35, 0.045) 0 1px, transparent 1px 5px),
    linear-gradient(180deg, #fff7e2 0%, #ffedc3 55%, #ffe2a8 100%);
  box-shadow:
    inset 0 4px 12px rgba(139, 84, 30, 0.22),
    inset 0 -3px 0 rgba(255, 255, 255, 0.45);
}

.riddle {
  max-width: 254px;
  margin: 0 auto;
  color: #57300f;
  font-size: clamp(23px, 6.9vw, 28px);
  font-weight: 900;
  line-height: 1.48;
  letter-spacing: 0.02em;
  text-align: center;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
}

.spark {
  position: absolute;
  top: 50%;
  width: 9px;
  height: 34px;
  transform: translateY(-50%);
  pointer-events: none;
  opacity: 0.9;
}

.spark-l {
  left: 8px;
}

.spark-r {
  right: 8px;
  transform: translateY(-50%) scaleX(-1);
}

.spark i {
  position: absolute;
  left: 2px;
  width: 5px;
  height: 11px;
  border-radius: 3px;
  background: linear-gradient(180deg, #ffe36b, #ffb300);
  box-shadow: 0 1px 0 #c98200;
}

.spark i:nth-child(1) {
  top: 0;
  transform: rotate(-24deg) translateX(-1px);
}

.spark i:nth-child(2) {
  top: 11px;
}

.spark i:nth-child(3) {
  top: 22px;
  transform: rotate(24deg) translateX(-1px);
}

/* ---------- 三个选项 ---------- */
.options {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 13px;
}

.option {
  position: relative;
  width: 100%;
  min-height: 61px;
  padding: 10px 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 3px solid #8a5326;
  border-radius: 19px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9) 0 16%, rgba(255, 255, 255, 0) 40%),
    linear-gradient(180deg, #fffaf0 0%, #ffefc9 58%, #ffdfa3 100%);
  color: #57300f;
  font-size: 21px;
  font-weight: 900;
  letter-spacing: 0.03em;
  text-align: center;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-appearance: none;
  appearance: none;
  box-shadow:
    0 5px 0 #78431a,
    0 10px 14px rgba(90, 50, 10, 0.16),
    inset 0 2px 0 rgba(255, 255, 255, 0.95);
  transition: transform 0.08s ease, box-shadow 0.08s ease, background 0.2s ease,
    border-color 0.2s ease, opacity 0.2s ease;
  animation: option-in 0.42s cubic-bezier(0.2, 0.9, 0.3, 1) both;
}

.option:nth-child(2) {
  animation-delay: 0.04s;
}

.option:nth-child(3) {
  animation-delay: 0.08s;
}

.option:active:not(.correct):not(.wrong):not(.dim) {
  transform: translateY(4px);
  box-shadow:
    0 1px 0 #78431a,
    0 4px 8px rgba(90, 50, 10, 0.14),
    inset 0 2px 0 rgba(255, 255, 255, 0.95);
}

.option .badge {
  position: absolute;
  left: 13px;
  top: 50%;
  width: 31px;
  height: 31px;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #8a5326;
  border-radius: 50%;
  background: linear-gradient(180deg, #ffdc82, #ffb52e);
  color: #5a3216;
  font-size: 15px;
  font-weight: 900;
  line-height: 1;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.7);
}

.option .mark {
  position: absolute;
  right: 14px;
  top: 50%;
  width: 25px;
  height: 25px;
  transform: translateY(-50%);
  display: none;
  color: #ffffff;
  filter: drop-shadow(0 1px 0 rgba(0, 70, 0, 0.3));
}

.option.correct {
  border-color: #2f7d35;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.55) 0 16%, rgba(255, 255, 255, 0) 45%),
    linear-gradient(180deg, #bdf59b 0%, #70d46e 55%, #4bb955 100%);
  color: #143d17;
  box-shadow:
    0 5px 0 #2f7d35,
    0 12px 18px rgba(35, 110, 40, 0.24),
    inset 0 2px 0 rgba(255, 255, 255, 0.7);
  animation: correct-pop 0.45s cubic-bezier(0.2, 1.6, 0.4, 1) both;
}

.option.correct .badge {
  border-color: #2f7d35;
  background: #ffffff;
  color: #2f7d35;
}

.option.correct .mark {
  display: block;
}

.option.wrong {
  border-color: #b3433a;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.5) 0 16%, rgba(255, 255, 255, 0) 45%),
    linear-gradient(180deg, #ffd8d2 0%, #ffada2 58%, #ff9587 100%);
  color: #6e1a14;
  box-shadow:
    0 3px 0 #8d2f28,
    0 7px 10px rgba(120, 35, 25, 0.16),
    inset 0 2px 0 rgba(255, 255, 255, 0.65);
  animation: shake 0.42s ease both;
}

.option.wrong .badge {
  border-color: #b3433a;
  background: #ffffff;
  color: #b3433a;
}

.option:disabled {
  cursor: default;
  opacity: 1;
}

.option.hint {
  border-color: #d79a00;
  box-shadow:
    0 5px 0 #78431a,
    0 0 0 4px rgba(255, 210, 63, 0.5),
    0 10px 16px rgba(160, 100, 0, 0.22),
    inset 0 2px 0 rgba(255, 255, 255, 0.95);
}

.option.hint .badge {
  border-color: #b87800;
  background: linear-gradient(180deg, #ffe89a, #ffbf3a);
}

.option.dim {
  opacity: 0.5;
  filter: saturate(0.75);
}

/* ---------- 提示条 ---------- */
.feedback {
  flex: 0 0 auto;
  min-height: 82px;
  margin-top: 12px;
  padding: 10px 12px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border: 1.5px solid rgba(138, 83, 38, 0.3);
  border-radius: 17px;
  background: rgba(255, 250, 236, 0.84);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 6px 14px rgba(80, 45, 10, 0.1);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  transition: background 0.2s ease, border-color 0.2s ease;
}

.fb-avatar {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border: 2px solid #fffaf0;
  border-radius: 50%;
  object-fit: cover;
  background: #bfe8ff;
  box-shadow: 0 2px 6px rgba(80, 45, 10, 0.22);
  animation: avatar-bob 2.8s ease-in-out infinite;
}

.fb-body {
  min-width: 0;
}

.fb-title {
  margin: 0;
  color: #7a4318;
  font-size: 14px;
  font-weight: 900;
  line-height: 1.35;
}

.fb-text {
  margin: 3px 0 0;
  color: #8a5a32;
  font-size: 12.5px;
  line-height: 1.5;
}

.feedback.ok {
  border-color: rgba(58, 139, 63, 0.42);
  background: rgba(239, 255, 228, 0.92);
}

.feedback.ok .fb-title {
  color: #2f7a34;
}

.feedback.no {
  border-color: rgba(179, 75, 36, 0.4);
  background: rgba(255, 242, 226, 0.94);
}

.feedback.no .fb-title {
  color: #b34b24;
}

.feedback.no .fb-avatar {
  animation: none;
  transform: rotate(-4deg);
}

.feedback.pop {
  animation: feedback-pop 0.32s cubic-bezier(0.2, 1.2, 0.4, 1);
}

/* ---------- 底部下一题 ---------- */
.flex-gap {
  display: block;
  flex: 1 1 6px;
  min-height: 6px;
}

.next-btn {
  position: relative;
  flex: 0 0 auto;
  width: 100%;
  min-height: 63px;
  margin-top: 13px;
  padding: 10px 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 3px solid #a95f00;
  border-radius: 21px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.62) 0 17%, rgba(255, 255, 255, 0) 18%),
    linear-gradient(180deg, #ffe25c 0%, #ffc423 54%, #ffad05 100%);
  color: #6b3a00;
  font-size: 23px;
  font-weight: 900;
  letter-spacing: 0.08em;
  cursor: pointer;
  touch-action: manipulation;
  box-shadow:
    0 6px 0 #a95f00,
    0 13px 22px rgba(160, 90, 0, 0.26),
    inset 0 -3px 0 rgba(170, 90, 0, 0.22),
    inset 0 2px 0 rgba(255, 255, 255, 0.7);
  transition: transform 0.08s ease, box-shadow 0.08s ease, filter 0.2s ease;
}

.next-btn:active {
  transform: translateY(4px);
  box-shadow:
    0 2px 0 #a95f00,
    0 5px 10px rgba(160, 90, 0, 0.2),
    inset 0 -3px 0 rgba(170, 90, 0, 0.22),
    inset 0 2px 0 rgba(255, 255, 255, 0.7);
}

.next-btn .mp-icon {
  width: 25px;
  height: 25px;
}

.next-btn.ready {
  animation: next-pulse 1.5s ease-in-out infinite;
}

.next-btn.nudge {
  animation: nudge 0.42s ease;
}

.next-btn[data-locked="1"] .next-arrow {
  opacity: 0.55;
}

/* ---------- 通关弹层 ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  padding: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(31, 20, 8, 0.58);
  -webkit-backdrop-filter: blur(7px);
  backdrop-filter: blur(7px);
}

.modal[hidden] {
  display: none !important;
}

.modal-card {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 354px;
  padding: 12px 18px 20px;
  border: 3px solid #6b3a12;
  border-radius: 27px;
  background:
    radial-gradient(100% 80% at 50% 0%, rgba(255, 255, 255, 0.8), transparent 65%),
    repeating-linear-gradient(0deg, rgba(150, 95, 35, 0.04) 0 1px, transparent 1px 5px),
    linear-gradient(180deg, #fff8e6 0%, #ffedc4 60%, #ffe0a4 100%);
  box-shadow:
    0 11px 0 #6b3a12,
    0 34px 60px rgba(0, 0, 0, 0.38),
    inset 0 2px 0 rgba(255, 255, 255, 0.85);
  text-align: center;
  animation: modal-pop 0.42s cubic-bezier(0.2, 1.35, 0.4, 1) both;
}

.modal-hero {
  display: block;
  width: 100%;
  height: auto;
  margin: 0 auto 2px;
  border-radius: 15px;
  -webkit-mask-image: linear-gradient(to bottom, #000 68%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 68%, transparent 100%);
}

.modal-kicker {
  margin: 0 0 2px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border: 2px solid #b9751f;
  border-radius: 999px;
  background: linear-gradient(180deg, #fff2b8, #ffd457);
  color: #81500c;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.1em;
  box-shadow: 0 2px 0 #b9751f;
}

.modal-kicker .mp-icon {
  width: 15px;
  height: 15px;
  color: #a96900;
}

.modal-card h2 {
  margin: 8px 0 0;
  color: #57300f;
  font-size: 25px;
  font-weight: 900;
  letter-spacing: 0.03em;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
}

.modal-score {
  margin: 4px 0 0;
  color: #e2701f;
  font-size: 58px;
  font-weight: 900;
  line-height: 1.08;
  letter-spacing: -0.03em;
  text-shadow: 0 2px 0 #fff2c8, 0 4px 0 rgba(170, 92, 0, 0.18);
}

.modal-score small {
  margin-left: 4px;
  color: #a05d24;
  font-size: 17px;
  letter-spacing: 0;
}

.modal-sub {
  margin: 7px 0 0;
  color: #8a5a32;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
}

.modal-btn {
  margin-top: 16px;
  min-height: 58px;
  font-size: 21px;
  animation: none;
}

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

.confetti-piece {
  position: absolute;
  top: -24px;
  width: 9px;
  height: 14px;
  border-radius: 3px;
  opacity: 0;
  animation: confetti-fall 2.4s ease-in forwards;
}

/* ---------- 动效 ---------- */
@keyframes hero-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

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

@keyframes pill-bump {
  0% { transform: scale(1); }
  45% { transform: scale(1.08) rotate(-1deg); }
  100% { transform: scale(1); }
}

@keyframes score-rise {
  0% { opacity: 0; transform: translateY(4px) scale(0.8); }
  25% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-26px) scale(1.05); }
}

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

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  18% { transform: translateX(-7px) rotate(-0.5deg); }
  36% { transform: translateX(6px) rotate(0.5deg); }
  54% { transform: translateX(-4px); }
  72% { transform: translateX(3px); }
}

@keyframes feedback-pop {
  0% { transform: scale(0.985) translateY(3px); }
  55% { transform: scale(1.008) translateY(0); }
  100% { transform: scale(1); }
}

@keyframes avatar-bob {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  50% { transform: translateY(-2px) rotate(1.5deg); }
}

@keyframes next-pulse {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-2px); }
}

@keyframes nudge {
  0%, 100% { transform: translateX(0); }
  22% { transform: translateX(-5px); }
  44% { transform: translateX(5px); }
  66% { transform: translateX(-3px); }
  88% { transform: translateX(2px); }
}

@keyframes modal-pop {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.92);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes confetti-fall {
  0% {
    opacity: 0;
    transform: translate3d(0, -10px, 0) rotate(0deg);
  }
  10% { opacity: 1; }
  100% {
    opacity: 0;
    transform: translate3d(var(--dx, 0px), 108vh, 0) rotate(var(--rot, 360deg));
  }
}

@keyframes riddle-in {
  from {
    opacity: 0;
    transform: translateY(7px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.riddle.animate {
  animation: riddle-in 0.34s ease-out both;
}

/* ---------- 矮屏 & 无障碍 ---------- */
@media (max-height: 710px) {
  .game {
    padding-top: calc(env(safe-area-inset-top, 0px) + 7px);
  }

  .pill {
    height: 42px;
  }

  .level-pill {
    min-width: 100px;
    font-size: 15px;
  }

  .level-pill .pill-v {
    font-size: 21px;
  }

  .score-pill {
    min-width: 82px;
    height: 42px;
    font-size: 21px;
  }

  .star-ico {
    width: 22px;
    height: 22px;
  }

  .stage {
    width: 94%;
    margin-left: auto;
    margin-right: auto;
  }

  .sign-paper {
    min-height: 114px;
    padding: 13px 22px 15px;
  }

  .riddle {
    font-size: clamp(21px, 6.4vw, 25px);
    max-width: 240px;
  }

  .options {
    gap: 8px;
    margin-top: 10px;
  }

  .option {
    min-height: 54px;
    font-size: 19px;
  }

  .feedback {
    min-height: 70px;
    margin-top: 10px;
    padding: 8px 11px;
  }

  .fb-avatar {
    width: 37px;
    height: 37px;
  }

  .next-btn {
    min-height: 56px;
    margin-top: 10px;
    font-size: 21px;
  }
}

@media (max-height: 660px) {
  .game {
    padding-top: calc(env(safe-area-inset-top, 0px) + 5px);
    padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 8px);
  }

  .pill {
    height: 38px;
    border-radius: 13px;
  }

  .level-pill {
    min-width: 94px;
    font-size: 14px;
  }

  .level-pill .pill-v {
    font-size: 19px;
  }

  .score-pill {
    min-width: 76px;
    height: 38px;
    font-size: 19px;
  }

  .star-ico {
    width: 20px;
    height: 20px;
  }

  .stage {
    width: 86%;
    margin-left: auto;
    margin-right: auto;
  }

  .signboard {
    margin-top: -8px;
    padding: 7px;
    border-radius: 21px;
  }

  .sign-paper {
    min-height: 96px;
    padding: 10px 18px 12px;
    border-radius: 14px;
  }

  .riddle {
    max-width: 236px;
    font-size: clamp(19px, 5.9vw, 22px);
    line-height: 1.42;
  }

  .spark {
    height: 28px;
    transform: translateY(-50%) scale(0.85);
  }

  .options {
    gap: 6px;
    margin-top: 8px;
  }

  .option {
    min-height: 48px;
    border-width: 2.5px;
    border-radius: 16px;
    padding-left: 44px;
    padding-right: 44px;
    font-size: 18px;
    box-shadow:
      0 4px 0 #78431a,
      0 7px 10px rgba(90, 50, 10, 0.14),
      inset 0 2px 0 rgba(255, 255, 255, 0.95);
  }

  .option .badge {
    left: 11px;
    width: 27px;
    height: 27px;
    font-size: 13px;
  }

  .option .mark {
    right: 11px;
    width: 22px;
    height: 22px;
  }

  .feedback {
    min-height: 60px;
    margin-top: 8px;
    padding: 7px 10px;
    border-radius: 14px;
  }

  .fb-avatar {
    width: 32px;
    height: 32px;
  }

  .fb-title {
    font-size: 13px;
  }

  .fb-text {
    font-size: 11.5px;
    line-height: 1.42;
  }

  .flex-gap {
    min-height: 4px;
  }

  .next-btn {
    min-height: 50px;
    margin-top: 8px;
    border-radius: 18px;
    font-size: 19px;
  }

  .next-btn .mp-icon {
    width: 22px;
    height: 22px;
  }
}

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

  .option {
    padding-left: 42px;
    padding-right: 42px;
    font-size: 19px;
  }

  .option .badge {
    left: 10px;
    width: 28px;
    height: 28px;
    font-size: 13px;
  }

  .riddle {
    font-size: 22px;
  }
}

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

:focus-visible {
  outline: 3px solid #17699e;
  outline-offset: 3px;
}
