/* 用弹弓打水果 — 卡通竖屏游戏 UI */
:root {
  --orange: #FF8A3D;
  --orange-deep: #E8641A;
  --orange-dark: #B94D0E;
  --cream: #FFF6E8;
  --cream-deep: #FFE6BE;
  --wood: #A9622A;
  --wood-dark: #7D4418;
  --ink: #4A2A15;
  --gold: #FFC53D;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

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

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  background: #5FC8F2;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
  -webkit-user-select: none;
  user-select: none;
  touch-action: none;
}

button { font-family: inherit; border: 0; cursor: pointer; }

.stage { position: fixed; inset: 0; overflow: hidden; }

#game {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

/* ---------- 顶部悬浮信息 ---------- */
.hud {
  position: absolute;
  z-index: 40;
  top: calc(var(--safe-top) + 10px);
  left: 0;
  right: 0;
  padding: 0 14px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  pointer-events: none;
  transition: opacity .2s ease;
}

.hud-btn {
  pointer-events: auto;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #9A4A12;
  background: linear-gradient(180deg, #FFF9EC 0%, #FFE1AE 62%, #FFC777 100%);
  border: 2px solid rgba(255, 255, 255, .82);
  box-shadow: 0 4px 0 #C77A2E, 0 7px 14px rgba(83, 42, 0, .22), inset 0 2px 0 rgba(255, 255, 255, .85);
  transition: transform .08s ease, box-shadow .08s ease;
}
.hud-btn .mp-icon { width: 24px; height: 24px; }
.hud-btn:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 #C77A2E, 0 3px 8px rgba(83, 42, 0, .2), inset 0 2px 0 rgba(255, 255, 255, .85);
}
.hud-btn.muted { color: #9C9184; }

.score-pill {
  position: absolute;
  left: 50%;
  top: 0;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 7px;
  height: 42px;
  padding: 0 16px 0 6px;
  border-radius: 999px;
  color: #FFF3D2;
  font-size: 21px;
  font-weight: 900;
  letter-spacing: .5px;
  background: linear-gradient(180deg, #513823 0%, #342114 58%, #27170E 100%);
  border: 2px solid rgba(255, 217, 150, .38);
  box-shadow: 0 4px 0 rgba(46, 24, 8, .45), 0 8px 18px rgba(30, 18, 5, .28), inset 0 1px 0 rgba(255, 255, 255, .16);
  opacity: 0;
  visibility: hidden;
  transition: opacity .22s ease;
}
.score-pill b { font-variant-numeric: tabular-nums; text-shadow: 0 2px 0 rgba(0, 0, 0, .28); }

.coin {
  width: 31px;
  height: 31px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #FFF7D6;
  background: radial-gradient(circle at 34% 28%, #FFF3A0 0%, #FFCF3E 36%, #FFA800 70%, #D97B00 100%);
  border: 2px solid #FFE58A;
  box-shadow: inset 0 -3px 0 rgba(154, 75, 0, .4), 0 2px 4px rgba(0, 0, 0, .25);
}
.coin .mp-icon { width: 19px; height: 19px; color: #B86200; }

.ammo-pill {
  pointer-events: none;
  display: flex;
  align-items: center;
  gap: 7px;
  height: 42px;
  min-width: 78px;
  padding: 0 14px;
  border-radius: 999px;
  color: #5B3A20;
  font-size: 19px;
  font-weight: 900;
  background: linear-gradient(180deg, #FFFBF1 0%, #FFE7BE 100%);
  border: 2px solid rgba(255, 255, 255, .82);
  box-shadow: 0 4px 0 #D08A44, 0 7px 14px rgba(83, 42, 0, .18), inset 0 2px 0 rgba(255, 255, 255, .9);
  opacity: 0;
  visibility: hidden;
  transition: opacity .22s ease;
}
.ammo-pill.low { color: #B3261E; animation: ammoLow 1.1s ease-in-out infinite; }
.ammo-stone {
  width: 20px;
  height: 20px;
  border-radius: 48% 52% 55% 45%;
  background: radial-gradient(circle at 34% 28%, #B9C0C6 0%, #848D95 42%, #5A6269 100%);
  box-shadow: inset -2px -2px 0 rgba(0, 0, 0, .18), 0 1px 2px rgba(0, 0, 0, .2);
  transform: rotate(-12deg);
}

body.screen-playing .score-pill,
body.screen-playing .ammo-pill { opacity: 1; visibility: visible; }

@keyframes ammoLow { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.07); } }
@keyframes bump { 0% { transform: translateX(-50%) scale(1); } 35% { transform: translateX(-50%) scale(1.16); } 100% { transform: translateX(-50%) scale(1); } }
.score-pill.bump { animation: bump .3s cubic-bezier(.2, 1.6, .4, 1); }

/* ---------- 关卡木牌 ---------- */
.level-plaque {
  pointer-events: none;
  position: absolute;
  z-index: 19;
  top: calc(var(--safe-top) + 62px);
  left: 50%;
  height: 40px;
  padding: 0 18px;
  display: flex;
  align-items: center;
  gap: 7px;
  border-radius: 11px;
  color: #FFF3D2;
  font-size: 17px;
  font-weight: 900;
  letter-spacing: 1px;
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .05) 0 2px, transparent 2px 13px),
    linear-gradient(180deg, #E2A363 0%, #C17B3C 52%, #9B5A25 100%);
  border: 3px solid #7E451A;
  box-shadow: 0 5px 0 rgba(89, 47, 13, .55), 0 9px 18px rgba(60, 30, 0, .25), inset 0 2px 0 rgba(255, 232, 189, .55);
  text-shadow: 0 2px 0 rgba(94, 48, 12, .5);
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, -16px) rotate(-1.5deg);
  transition: opacity .22s ease, transform .3s cubic-bezier(.2, 1.4, .4, 1);
}
.level-plaque.show { opacity: 1; visibility: visible; transform: translate(-50%, 0) rotate(-1.5deg); }
.plaque-count {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: 3px;
  padding-left: 9px;
  border-left: 1px solid rgba(92, 46, 10, .32);
  font-size: 15px;
  color: #FFE8B8;
}
.plaque-count b { font-variant-numeric: tabular-nums; }
.fruit-dot {
  position: relative;
  display: inline-block;
  width: 13px;
  height: 13px;
  flex: 0 0 13px;
  border-radius: 50% 50% 47% 53%;
  background: radial-gradient(circle at 34% 28%, #FFAF93 0%, #F04A45 42%, #C61F31 100%);
  box-shadow: inset -1.5px -1.5px 0 rgba(110, 10, 20, .22), 0 1px 0 rgba(86, 42, 5, .25);
}
.fruit-leaf {
  position: absolute;
  top: -4px;
  left: 7px;
  width: 7px;
  height: 4px;
  border-radius: 100% 0 100% 0;
  background: linear-gradient(180deg, #9BE067, #3E9C37);
  transform: rotate(-18deg);
}
.plaque-leaf { position: absolute; width: 19px; height: 19px; color: #70B94A; top: -11px; filter: drop-shadow(0 1px 0 rgba(60, 40, 0, .25)); }
.plaque-leaf.left { left: -7px; transform: rotate(-26deg); }
.plaque-leaf.right { right: -7px; transform: rotate(26deg) scaleX(-1); }

/* ---------- 操作提示 ---------- */
.hint-pill {
  pointer-events: none;
  position: absolute;
  z-index: 18;
  top: 60%;
  left: 50%;
  transform: translate(-50%, -8px);
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 15px;
  border-radius: 999px;
  color: #FFF9EA;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  background: rgba(51, 30, 12, .62);
  border: 1px solid rgba(255, 231, 186, .38);
  box-shadow: 0 5px 14px rgba(30, 15, 0, .2);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  transition: opacity .28s ease, transform .28s ease;
}
.hint-pill .mp-icon { width: 19px; height: 19px; color: #FFC65A; }
.hint-pill.show { opacity: 1; visibility: visible; transform: translate(-50%, 0); }

/* ---------- 连击提示 ---------- */
.combo-toast {
  pointer-events: none;
  position: absolute;
  z-index: 18;
  left: 50%;
  top: 39%;
  padding: 7px 20px;
  border-radius: 999px;
  color: #FFF8E2;
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 1px;
  white-space: nowrap;
  background: linear-gradient(180deg, #FF9B42, #ED6A15);
  border: 2px solid #FFE0A6;
  box-shadow: 0 5px 0 #A8450A, 0 10px 22px rgba(90, 35, 0, .3);
  opacity: 0;
  transform: translate(-50%, 8px) scale(.7) rotate(-3deg);
  pointer-events: none;
}
.combo-toast.pop { animation: comboPop .85s cubic-bezier(.2, 1.5, .4, 1) forwards; }
@keyframes comboPop {
  0% { opacity: 0; transform: translate(-50%, 14px) scale(.6) rotate(-5deg); }
  22% { opacity: 1; transform: translate(-50%, 0) scale(1.1) rotate(-2deg); }
  40% { transform: translate(-50%, 0) scale(1) rotate(-2deg); }
  78% { opacity: 1; transform: translate(-50%, -16px) scale(1) rotate(-2deg); }
  100% { opacity: 0; transform: translate(-50%, -34px) scale(.94) rotate(-2deg); }
}

/* ---------- 通用遮罩 ---------- */
.screen {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: calc(var(--safe-top) + 18px) 16px calc(var(--safe-bottom) + 18px);
  transition: opacity .25s ease;
}
.screen.hidden { display: none; }

/* ---------- 开始页 ---------- */
.start-screen {
  background:
    radial-gradient(ellipse at 50% 18%, rgba(255, 255, 255, .18) 0%, rgba(255, 255, 255, 0) 58%),
    linear-gradient(180deg, rgba(18, 90, 128, .12) 0%, rgba(18, 90, 128, 0) 26%, rgba(18, 90, 128, 0) 62%, rgba(32, 20, 4, .2) 100%);
  padding-top: max(58px, calc(var(--safe-top) + 10px));
}

.title-sign {
  position: relative;
  margin-top: 0;
  animation: signFloat 4.2s ease-in-out infinite;
  filter: drop-shadow(0 16px 18px rgba(54, 30, 4, .24));
}
@keyframes signFloat {
  0%, 100% { transform: translateY(0) rotate(-1.2deg); }
  50% { transform: translateY(-7px) rotate(-.4deg); }
}

.sign-rope {
  position: absolute;
  top: -34vh;
  width: 5px;
  height: calc(34vh + 44px);
  border-radius: 4px;
  background: linear-gradient(90deg, #8B5B2B 0%, #D7AB6D 48%, #7D4C20 100%);
  box-shadow: 1px 0 0 rgba(255, 255, 255, .18);
}
.sign-rope::after {
  content: "";
  position: absolute;
  bottom: 22px;
  left: -4px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 32%, #E8C38A, #A46C31 70%);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .25);
}
.sign-rope.left { left: 34px; transform: rotate(4deg); }
.sign-rope.right { right: 34px; transform: rotate(-4deg); }

.sign-board {
  position: relative;
  width: min(312px, 81vw);
  padding: 18px 20px 17px;
  text-align: center;
  border-radius: 20px;
  background:
    repeating-linear-gradient(0deg, rgba(106, 56, 14, .1) 0 3px, rgba(255, 255, 255, 0) 3px 17px),
    linear-gradient(180deg, #E9AE6B 0%, #CF8B46 48%, #AE682C 100%);
  border: 4px solid #7D4519;
  box-shadow:
    0 8px 0 #6C3810,
    0 16px 24px rgba(50, 24, 0, .28),
    inset 0 3px 0 rgba(255, 235, 195, .6),
    inset 0 -5px 0 rgba(104, 52, 12, .22);
}
.sign-board::before,
.sign-board::after {
  content: "";
  position: absolute;
  top: 14px;
  bottom: 14px;
  width: 4px;
  border-radius: 4px;
  background: rgba(108, 56, 17, .32);
  box-shadow: 70px 0 0 rgba(108, 56, 17, .32);
}
.sign-board::before { left: 14px; }
.sign-board::after { right: 14px; box-shadow: none; }

.sign-kicker {
  display: block;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 3px;
  color: #FFEBC7;
  opacity: .85;
  text-shadow: 0 1px 0 rgba(103, 51, 9, .5);
}
.sign-board h1 {
  margin: 4px 0 2px;
  font-size: clamp(31px, 9vw, 40px);
  line-height: 1.16;
  font-weight: 900;
  letter-spacing: 2px;
  color: #FFF9EA;
  -webkit-text-stroke: 1px rgba(104, 48, 9, .25);
  text-shadow:
    0 2px 0 #A95A1D,
    0 4px 0 rgba(91, 42, 8, .5),
    0 8px 12px rgba(65, 30, 2, .32);
}
.sign-sub {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  letter-spacing: 2px;
  font-weight: 700;
  color: #FFF1D4;
  text-shadow: 0 1px 0 rgba(103, 51, 9, .55);
}
.sign-leaf {
  position: absolute;
  width: 40px;
  height: 40px;
  color: #71C34A;
  filter: drop-shadow(0 2px 1px rgba(44, 69, 9, .3));
}
.sign-leaf.left { left: -21px; top: -19px; transform: rotate(-32deg); }
.sign-leaf.right { right: -21px; top: -19px; transform: rotate(32deg) scaleX(-1); }

.start-bottom {
  width: min(330px, 88vw);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 13px;
  padding-bottom: 3vh;
}

body.screen-start .hud {
  opacity: 0;
  visibility: hidden;
}

.best-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 15px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
  color: #FFF2D6;
  background: rgba(52, 30, 12, .6);
  border: 1px solid rgba(255, 227, 176, .42);
  box-shadow: 0 4px 12px rgba(30, 15, 0, .18), inset 0 1px 0 rgba(255, 255, 255, .16);
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
}
.best-chip .mp-icon { width: 19px; height: 19px; color: #FFC53D; }
.best-chip b { color: #FFD874; font-size: 16px; font-variant-numeric: tabular-nums; }

.play-btn {
  position: relative;
  width: 100%;
  height: 74px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: 999px;
  color: #FFFDF6;
  font-size: 24px;
  font-weight: 900;
  letter-spacing: 4px;
  background:
    linear-gradient(180deg, #FFB562 0%, #FF8A3D 42%, #F27016 100%);
  border: 3px solid #FFE0AE;
  box-shadow:
    0 9px 0 #B94D0E,
    0 16px 26px rgba(94, 41, 3, .34),
    inset 0 3px 0 rgba(255, 255, 255, .48),
    inset 0 -6px 0 rgba(173, 70, 8, .2);
  text-shadow: 0 2px 0 rgba(157, 63, 8, .45);
  animation: playGlow 2.6s ease-in-out infinite;
  transition: transform .1s ease, box-shadow .1s ease;
}
.play-btn .mp-icon {
  width: 36px;
  height: 36px;
  color: #FFFDF6;
  filter: drop-shadow(0 2px 0 rgba(157, 63, 8, .4));
}
.play-btn:active {
  transform: translateY(7px) scale(.99);
  box-shadow:
    0 2px 0 #B94D0E,
    0 6px 12px rgba(94, 41, 3, .3),
    inset 0 3px 0 rgba(255, 255, 255, .4),
    inset 0 -4px 0 rgba(173, 70, 8, .18);
}
@keyframes playGlow {
  0%, 100% { box-shadow: 0 9px 0 #B94D0E, 0 16px 26px rgba(94, 41, 3, .34), 0 0 0 0 rgba(255, 205, 120, .45), inset 0 3px 0 rgba(255, 255, 255, .48), inset 0 -6px 0 rgba(173, 70, 8, .2); }
  50% { box-shadow: 0 9px 0 #B94D0E, 0 16px 26px rgba(94, 41, 3, .34), 0 0 0 12px rgba(255, 205, 120, 0), inset 0 3px 0 rgba(255, 255, 255, .48), inset 0 -6px 0 rgba(173, 70, 8, .2); }
}

.start-tip {
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .3px;
  white-space: nowrap;
  color: rgba(255, 250, 236, .94);
  text-shadow: 0 2px 4px rgba(30, 18, 2, .4);
}
.tip-best { display: inline-flex; align-items: center; gap: 4px; color: #FFE08B; }
.tip-best .mp-icon { width: 16px; height: 16px; color: #FFC53D; filter: drop-shadow(0 1px 0 rgba(80, 40, 0, .4)); }
.tip-best b { font-size: 14px; font-variant-numeric: tabular-nums; }
.tip-sep { opacity: .55; }

/* ---------- 结算页 ---------- */
.end-screen {
  z-index: 45;
  justify-content: center;
  background: rgba(33, 19, 5, .46);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  padding-left: 16px;
  padding-right: 16px;
}

.end-card {
  position: relative;
  width: min(338px, 88vw);
  padding: 26px 20px 18px;
  border-radius: 28px;
  text-align: center;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(255, 255, 255, .9), rgba(255, 255, 255, 0) 52%),
    linear-gradient(180deg, #FFFAED 0%, #FFEFD1 58%, #FFE1B0 100%);
  border: 3px solid #EDB56E;
  box-shadow:
    0 12px 0 rgba(139, 75, 17, .28),
    0 26px 50px rgba(24, 12, 0, .38),
    inset 0 3px 0 #FFFDF8;
  animation: cardIn .42s cubic-bezier(.2, 1.35, .4, 1) both;
}
@keyframes cardIn {
  0% { opacity: 0; transform: translateY(18px) scale(.92); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

.end-kicker {
  display: inline-block;
  padding: 4px 14px;
  margin-bottom: 4px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1px;
  color: #A35416;
  background: #FFE7BB;
  border: 1px solid #F0C98A;
}

.end-card h2 {
  margin: 4px 0 2px;
  font-size: 31px;
  font-weight: 900;
  letter-spacing: 2px;
  color: #73390F;
  text-shadow: 0 2px 0 #FFF8E8, 0 4px 0 rgba(177, 107, 41, .18);
}

.stars { display: flex; justify-content: center; gap: 5px; height: 42px; align-items: center; }
.stars .mp-icon { width: 33px; height: 33px; color: #FFC531; filter: drop-shadow(0 2px 0 rgba(150, 86, 6, .3)); animation: starIn .42s cubic-bezier(.2, 1.6, .4, 1) both; }
.stars .mp-icon:nth-child(2) { width: 41px; height: 41px; animation-delay: .08s; }
.stars .mp-icon:nth-child(3) { animation-delay: .16s; }
.stars .mp-icon.dim { color: #E0CFB5; filter: none; }
@keyframes starIn { 0% { transform: scale(.2) rotate(-25deg); opacity: 0; } 100% { transform: scale(1) rotate(0); opacity: 1; } }
.stars.hide { display: none; }

.end-sub {
  margin: 2px 0 14px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
  color: #9A6A3B;
}

.score-box {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 12px;
  padding: 10px 18px;
  border-radius: 18px;
  background: linear-gradient(180deg, #513823, #2C1B0E);
  border: 2px solid #7B5430;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .12), 0 5px 0 rgba(110, 65, 23, .2);
}
.score-box span { font-size: 12px; font-weight: 700; color: #E7C79C; letter-spacing: 1px; }
.score-box strong {
  font-size: 34px;
  line-height: 1.1;
  font-weight: 900;
  color: #FFD35C;
  letter-spacing: 1px;
  text-shadow: 0 2px 0 rgba(0, 0, 0, .35);
  font-variant-numeric: tabular-nums;
}

.end-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 14px 0 16px;
}
.end-stats > div { padding: 2px 4px; border-right: 1px solid #E9CFA9; }
.end-stats > div:last-child { border-right: 0; }
.end-stats span { display: block; font-size: 11px; font-weight: 700; color: #A5794F; }
.end-stats b { display: block; margin-top: 2px; font-size: 19px; font-weight: 900; color: #66350F; font-variant-numeric: tabular-nums; }

.btn-primary {
  width: 100%;
  height: 58px;
  border-radius: 999px;
  color: #FFFDF5;
  font-size: 19px;
  font-weight: 900;
  letter-spacing: 2px;
  background: linear-gradient(180deg, #FFB562, #FF8A3D 46%, #F27016);
  border: 2px solid #FFE0AE;
  box-shadow: 0 6px 0 #B94D0E, 0 10px 18px rgba(120, 54, 4, .22), inset 0 2px 0 rgba(255, 255, 255, .45);
  text-shadow: 0 2px 0 rgba(157, 63, 8, .4);
  transition: transform .1s ease, box-shadow .1s ease;
}
.btn-primary:active { transform: translateY(5px); box-shadow: 0 1px 0 #B94D0E, 0 4px 9px rgba(120, 54, 4, .2), inset 0 2px 0 rgba(255, 255, 255, .4); }

.btn-ghost {
  width: 100%;
  height: 46px;
  margin-top: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 999px;
  color: #A16A38;
  font-size: 14px;
  font-weight: 800;
  background: transparent;
  transition: background .15s ease, transform .1s ease;
}
.btn-ghost .mp-icon { width: 19px; height: 19px; }
.btn-ghost:active { background: rgba(184, 128, 67, .13); transform: scale(.985); }

/* 彩纸 */
.confetti { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.confetti span {
  position: absolute;
  top: -8vh;
  width: 9px;
  height: 14px;
  border-radius: 2px;
  opacity: 0;
  animation: confettiFall 2.4s ease-in forwards;
}
@keyframes confettiFall {
  0% { opacity: 1; transform: translateY(0) rotate(0); }
  100% { opacity: 0; transform: translateY(112vh) rotate(620deg); }
}

/* ---------- 小屏适配 ---------- */
@media (max-height: 760px) {
  .title-sign { transform-origin: 50% 0; }
  .sign-board { padding: 12px 16px 11px; }
  .sign-board h1 { font-size: 28px; margin: 2px 0 0; }
  .sign-sub { font-size: 11px; margin-top: 2px; }
  .sign-kicker { display: none; }
  .play-btn { height: 64px; font-size: 21px; }
  .start-bottom { gap: 10px; padding-bottom: 1vh; }
  .end-card { padding: 20px 18px 14px; }
  .end-card h2 { font-size: 27px; }
  .stars { height: 36px; }
  .score-box strong { font-size: 30px; }
  .end-stats { margin: 10px 0 12px; }
}
@media (max-width: 340px) {
  .hint-pill { font-size: 12px; padding: 7px 12px; }
  .score-pill { font-size: 19px; }
  .ammo-pill { min-width: 68px; font-size: 17px; }
  .start-tip { font-size: 11.5px; }
}

/* 尊重系统减弱动态效果设置 */
@media (prefers-reduced-motion: reduce) {
  .title-sign,
  .play-btn { animation: none; }
  .combo-toast.pop { animation-duration: .01s; }
  .confetti { display: none; }
}

/* 40 关扩展：关卡面板与反弹信息，保持原有游戏画面。 */
.level-picker { position:fixed; inset:0; z-index:80; background:rgba(45,32,23,.94); color:#fff6e8; padding:24px 16px; overflow-y:auto; touch-action:pan-y; }
.level-picker h2 { margin:0 0 12px; font-size:24px; }
.level-picker p { color:#e5c9af; font-size:13px; }
.level-picker .level-grid { display:grid; grid-template-columns:repeat(5,1fr); gap:9px; margin:16px 0; }
.level-picker button { min-height:48px; border-radius:12px; background:#FF8A3D; color:#482711; font-weight:800; }
.level-picker button:disabled { background:#65564c; color:#ae9e91; cursor:default; }
.level-picker small { display:block; font-size:10px; margin-top:4px; }
.level-picker .picker-close { padding:12px 24px; }
.bounce-info { position:fixed; top:calc(env(safe-area-inset-top,0px) + 110px); left:12px; z-index:21; color:#fff8e9; background:#654026d9; padding:7px 11px; border-radius:12px; font-size:12px; pointer-events:none; }
.level-open { position:fixed; bottom:calc(env(safe-area-inset-bottom,0px) + 12px); right:12px; z-index:41; min-height:44px; padding:0 16px; border-radius:14px; background:#FF8A3D; color:#482711; font-weight:800; }

/* 原关卡弹层内增加章节分页，不改变游戏HUD布局。 */
.level-picker { touch-action: pan-y; overflow-y: auto; max-height: calc(100dvh - 32px); }
.level-picker progress { display:block; width:100%; height:10px; margin:12px 0 18px; accent-color:var(--orange); }
.difficulty-tabs { display:flex; gap:5px; margin-bottom:14px; }
.difficulty-tabs button { flex:1; min-height:44px; border-radius:10px; color:var(--ink); background:#ffe6be; font-weight:700; }
.difficulty-tabs button[aria-pressed="true"] { background:var(--orange); color:#fff; }
.chapter-pager { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-top:16px; font-size:13px; }
.chapter-pager button { min-height:44px; padding:8px 14px; border-radius:10px; background:#ffdec0; color:var(--ink); font-weight:700; }
.chapter-pager button:disabled { opacity:.4; }
.level-grid button { min-height:54px; }
.level-grid small { display:block; font-size:10px; margin-top:5px; }
@keyframes comboPop {
 0% { opacity:0; transform:translate(-50%,8px) scale(.8); }
 12% { opacity:1; transform:translate(-50%,0) scale(1.3); }
 24% { opacity:1; transform:translate(-50%,0) scale(1); }
 75% { opacity:1; transform:translate(-50%,-10px) scale(1); }
 100% { opacity:0; transform:translate(-50%,-28px) scale(1); }
}
