/* 消消乐5 —— 卡通花园消消乐
   主色 #FF8A3D，竖屏铺满，移动端优先 */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { background: #8fd9ff; }
body {
  min-height: 100vh;
  min-height: 100dvh;
  background: #8fd9ff;
  color: #6b3510;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
  overflow-x: hidden;
}

button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; padding: 0; }
img { display: block; }

.game {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  isolation: isolate;
}

/* ---------------- 场景 ---------------- */
.scene {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(120% 70% at 50% 108%, #f7f0bd 0%, rgba(247, 240, 189, 0) 55%),
    linear-gradient(180deg, #6dc8ff 0%, #97dcff 24%, #c3edff 43%, #e8f8ff 55%, #d7edaa 66%, #a4d463 82%, #78bd3d 100%);
}
.sky-glow {
  position: absolute;
  top: -16%;
  left: 50%;
  width: 92%;
  aspect-ratio: 1;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 252, 214, .95) 0%, rgba(255, 249, 188, .48) 34%, rgba(255, 249, 188, 0) 68%);
}
.cloud {
  position: absolute;
  width: 104px;
  height: 30px;
  border-radius: 999px;
  background: #fff;
  opacity: .92;
  box-shadow: 0 10px 22px rgba(106, 174, 220, .16);
  animation: drift 26s ease-in-out infinite alternate;
}
.cloud::before, .cloud::after {
  content: "";
  position: absolute;
  background: #fff;
  border-radius: 50%;
}
.cloud::before { width: 48px; height: 48px; left: 14px; bottom: 7px; }
.cloud::after { width: 34px; height: 34px; right: 13px; bottom: 5px; }
.cloud-a { top: 5.5%; left: -26px; transform: scale(.94); opacity: .88; }
.cloud-b { top: 15%; right: -34px; transform: scale(.72); animation-duration: 32s; animation-delay: -8s; }
.cloud-c { top: 27%; left: 32%; transform: scale(.5); opacity: .6; animation-duration: 38s; animation-delay: -14s; }
@keyframes drift {
  from { margin-left: -8px; }
  to { margin-left: 16px; }
}

.hill {
  position: absolute;
  left: -12%;
  width: 124%;
  border-radius: 50% 50% 0 0;
}
.hill-far {
  bottom: 19%;
  height: 27%;
  background: linear-gradient(180deg, #d3eda0 0%, #addd73 46%, #8dcb54 100%);
  opacity: .9;
}
.hill-mid {
  bottom: 12%;
  left: -28%;
  width: 156%;
  height: 27%;
  background: linear-gradient(180deg, #c2e880 0%, #95d157 48%, #6fb536 100%);
}
.tree {
  position: absolute;
  bottom: 25%;
  width: 136px;
  height: 136px;
  border-radius: 48% 52% 50% 50%;
  background:
    radial-gradient(circle at 36% 26%, #d6f3a0 0%, #a4dd67 34%, #6db53a 72%, #579d2b 100%);
  box-shadow: -26px 20px 0 -10px #63ab33, 30px 26px 0 -14px #79bd43;
  opacity: .72;
  filter: blur(.6px);
}
.tree-left { left: -64px; transform: rotate(-6deg); }
.tree-right { right: -70px; bottom: 27%; transform: rotate(7deg) scale(.9); }

.deco-cat {
  position: absolute;
  left: max(0px, calc(50% - 230px));
  bottom: -8px;
  width: min(clamp(146px, 46vw, 196px), 22vh);
  height: auto;
  z-index: 3;
  filter: drop-shadow(2px 12px 14px rgba(54, 82, 18, .26));
  animation: cat-bob 3.8s ease-in-out infinite;
}
@keyframes cat-bob {
  0%, 100% { transform: translateY(0) rotate(-.6deg); }
  50% { transform: translateY(-4px) rotate(.4deg); }
}
.cat-bubble {
  position: absolute;
  left: max(100px, calc(50% - 115px));
  bottom: clamp(210px, 28vh, 250px);
  z-index: 4;
  padding: 8px 14px;
  border-radius: 17px;
  border: 2px solid #fffdf6;
  background: linear-gradient(180deg, #fffef9 0%, #fff2d3 100%);
  box-shadow:
    0 4px 0 rgba(146, 85, 22, .18),
    0 9px 18px rgba(60, 90, 30, .18),
    inset 0 0 0 1.5px #efc48a;
  color: #8a4a18;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .03em;
  white-space: nowrap;
  transform: rotate(-2deg);
  animation: bubble-float 4.2s ease-in-out infinite;
}
.cat-bubble::after {
  content: "";
  position: absolute;
  left: 17px;
  bottom: -7px;
  width: 11px;
  height: 11px;
  border-radius: 0 0 3px 0;
  border-right: 2px solid #fffdf6;
  border-bottom: 2px solid #fffdf6;
  background: #fff2d3;
  transform: rotate(45deg);
}
@keyframes bubble-float {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-3px) rotate(-.5deg); }
}
.ground {
  position: absolute;
  left: -14%;
  right: -14%;
  bottom: -2%;
  height: 27%;
  border-radius: 50% 50% 0 0 / 22% 22% 0 0;
  background:
    radial-gradient(90% 120% at 50% 0%, rgba(255, 250, 189, .55) 0%, rgba(255, 250, 189, 0) 52%),
    linear-gradient(180deg, #b9e77c 0%, #93d256 32%, #74bb3d 68%, #5aa32c 100%);
  z-index: 0;
}
.flowers {
  position: absolute;
  right: 2%;
  bottom: 3%;
  width: 210px;
  height: 120px;
  z-index: 1;
  opacity: .9;
  background-image:
    radial-gradient(circle at 18% 62%, #ffe06a 0 4px, transparent 5px),
    radial-gradient(circle at 18% 62%, #fff 0 10px, transparent 11px),
    radial-gradient(circle at 52% 34%, #ffd4e2 0 3px, transparent 4px),
    radial-gradient(circle at 52% 34%, #fff 0 9px, transparent 10px),
    radial-gradient(circle at 82% 72%, #ffb45c 0 4px, transparent 5px),
    radial-gradient(circle at 82% 72%, #fff 0 11px, transparent 12px);
}

/* ---------------- 页面主体 ---------------- */
.stage {
  position: relative;
  z-index: 5;
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
  padding: calc(10px + env(safe-area-inset-top)) 14px 0;
}

/* HUD */
.hud {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr) 48px;
  gap: 9px;
  align-items: stretch;
}
.panel {
  position: relative;
  border-radius: 20px;
  border: 2px solid #fff3d6;
  box-shadow:
    0 4px 0 rgba(118, 56, 12, .26),
    0 8px 16px rgba(84, 104, 46, .18),
    inset 0 2px 0 rgba(255, 255, 255, .55);
}
.level-panel {
  padding: 6px;
  background: linear-gradient(180deg, #ffa65e 0%, #ff8a3d 46%, #ef6f22 100%);
  border-color: #ffd7a6;
}
.level-tag {
  text-align: center;
  color: #fff;
  font-size: 16px;
  font-weight: 900;
  letter-spacing: .04em;
  line-height: 1.15;
  padding: 3px 0 6px;
  text-shadow: 0 2px 0 rgba(163, 68, 8, .42), 0 0 8px rgba(255, 237, 190, .5);
}
.level-tag small {
  display: block;
  margin-top: 1px;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .18em;
  opacity: .86;
}
.moves-card {
  text-align: center;
  padding: 3px 4px 3px;
  border-radius: 14px;
  background: linear-gradient(180deg, #fffdf2 0%, #fff2d2 55%, #ffe5b0 100%);
  box-shadow: inset 0 2px 0 #fff, 0 2px 0 rgba(151, 76, 18, .22);
}
.moves-card span {
  display: block;
  font-size: 11px;
  font-weight: 800;
  color: #a35a25;
  letter-spacing: .08em;
}
.moves-card strong {
  display: block;
  margin-top: -1px;
  font-size: 30px;
  line-height: 1.05;
  font-weight: 900;
  color: #7a3a10;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 0 #fff;
}
.moves-card.low strong { color: #d93a1e; animation: low-pulse 1s ease-in-out infinite; }
@keyframes low-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.target-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px 8px 5px;
  background: linear-gradient(180deg, #fffdf3 0%, #fff3d8 56%, #ffe7b7 100%);
  border-color: #fff8e6;
}
.target-title {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  padding: 2px 13px 3px;
  border-radius: 999px;
  border: 1.5px solid #fff6db;
  background: linear-gradient(180deg, #ffcf75 0%, #ff9f38 100%);
  color: #79390f;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .08em;
  box-shadow: 0 2px 0 rgba(155, 82, 20, .28);
  white-space: nowrap;
}
.target-body {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  margin-top: 5px;
}
.target-icon {
  width: 34px;
  height: 34px;
  object-fit: contain;
  filter: drop-shadow(0 2px 0 rgba(166, 100, 10, .25));
  animation: target-wiggle 2.6s ease-in-out infinite;
}
@keyframes target-wiggle {
  0%, 82%, 100% { transform: rotate(0deg) scale(1); }
  88% { transform: rotate(-9deg) scale(1.07); }
  94% { transform: rotate(7deg) scale(1.04); }
}
.target-count {
  display: flex;
  align-items: baseline;
  color: #6f3a12;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}
.target-count b { font-size: 27px; line-height: 1; text-shadow: 0 1px 0 #fff; }
.target-count span { font-size: 16px; color: #b57a3f; }
.target-sub {
  margin-top: 1px;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: .14em;
  color: #bd8548;
}
.pause-btn {
  align-self: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: linear-gradient(180deg, #ffb564 0%, #ff8a3d 48%, #e9661c 100%);
  border: 2.5px solid #fff3d6;
  box-shadow:
    0 4px 0 rgba(130, 56, 10, .35),
    0 7px 14px rgba(94, 60, 20, .28),
    inset 0 2px 0 rgba(255, 255, 255, .6);
  transition: transform .1s ease, box-shadow .1s ease;
}
.pause-btn .mp-icon { width: 24px; height: 24px; filter: drop-shadow(0 1px 0 rgba(130, 60, 0, .45)); }
.pause-btn:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 rgba(130, 56, 10, .35), 0 3px 7px rgba(94, 60, 20, .24), inset 0 2px 0 rgba(255, 255, 255, .5);
}

/* 进度条 */
.progress {
  position: relative;
  height: 26px;
  margin: 11px 5px 0;
}
.progress-track {
  position: absolute;
  inset: 7px 0;
  border-radius: 999px;
  overflow: hidden;
  background: linear-gradient(180deg, #5c3d1d 0%, #7c5527 45%, #5a3a18 100%);
  border: 2px solid #ffdfa5;
  box-shadow:
    0 2px 0 rgba(110, 59, 14, .3),
    inset 0 3px 5px rgba(52, 28, 6, .55),
    inset 0 -1px 0 rgba(255, 255, 255, .28);
}
.progress-fill {
  width: 0%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(180deg, #d6ff95 0%, #8ee03f 38%, #5dbb24 72%, #469b16 100%);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .55), 0 0 9px rgba(150, 255, 76, .5);
  transition: width .38s cubic-bezier(.25, .9, .35, 1);
}
.progress-stars {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 13%;
  pointer-events: none;
}
.ms {
  width: 23px;
  height: 23px;
  color: #c8a166;
  filter: drop-shadow(0 1px 0 rgba(255, 255, 255, .65)) drop-shadow(0 2px 2px rgba(90, 54, 12, .35));
  transition: color .25s ease, transform .25s ease, filter .25s ease;
}
.ms.on {
  color: #ffd63f;
  transform: scale(1.06);
  filter: drop-shadow(0 0 5px rgba(255, 220, 60, .95)) drop-shadow(0 2px 0 rgba(166, 95, 0, .4));
}

/* 棋盘 */
.board-shell {
  position: relative;
  margin-top: 12px;
  padding: 7px;
  border-radius: 27px;
  background: linear-gradient(180deg, #f2f8ff 0%, #b9cfe8 13%, #7488ab 34%, #4b5c7f 62%, #303c5b 100%);
  box-shadow:
    0 6px 0 #2b1b0e,
    0 9px 0 rgba(255, 253, 240, .28),
    0 20px 34px rgba(53, 84, 25, .3);
}
.board-shell::before {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: 23px;
  background: linear-gradient(155deg, #34415f 0%, #27324f 44%, #1c253c 100%);
  box-shadow:
    inset 0 4px 12px rgba(0, 0, 0, .5),
    inset 0 -2px 0 rgba(255, 255, 255, .1);
}
.board {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  grid-template-rows: repeat(8, 1fr);
  gap: 3px;
  aspect-ratio: 1 / 1;
  padding: 1px;
  border-radius: 18px;
  overflow: hidden;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.cell {
  position: relative;
  border-radius: 9px;
  overflow: visible;
  background: linear-gradient(150deg, rgba(255, 255, 255, .085), rgba(0, 0, 0, .16));
  box-shadow:
    inset 0 2px 4px rgba(0, 0, 0, .32),
    inset 0 -1px 0 rgba(255, 255, 255, .08);
  transition: box-shadow .14s ease, background .14s ease;
}
.cell::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 1px solid rgba(255, 255, 255, .06);
  pointer-events: none;
}
.cell.sel {
  background: linear-gradient(150deg, rgba(255, 229, 128, .45), rgba(255, 151, 46, .26));
  box-shadow:
    inset 0 0 0 2px #ffe27d,
    inset 0 0 12px rgba(255, 221, 74, .55),
    0 0 12px rgba(255, 211, 58, .65);
  z-index: 2;
}
.cell.sel .tile { filter: brightness(1.16) drop-shadow(0 0 6px rgba(255, 233, 120, .8)); }
.tile {
  position: absolute;
  inset: -2%;
  opacity: 0;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 96% 96%;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .32));
  transition: opacity .12s ease;
  will-change: transform;
  pointer-events: none;
}
.cell.filled .tile { opacity: 1; }
.cell.pop .tile { animation: pop-out .26s ease-in forwards; }
@keyframes pop-out {
  0% { transform: scale(1); }
  38% { transform: scale(1.22) rotate(5deg); filter: brightness(1.6) drop-shadow(0 0 8px rgba(255, 245, 170, .95)); }
  100% { transform: scale(.08) rotate(-12deg); opacity: 0; }
}
.cell.pop::after {
  content: "";
  position: absolute;
  inset: -7px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 250, 190, .98) 0%, rgba(255, 208, 72, .55) 38%, rgba(255, 196, 52, 0) 70%);
  animation: burst .32s ease-out forwards;
  pointer-events: none;
  z-index: 3;
}
@keyframes burst {
  0% { transform: scale(.3); opacity: 1; }
  100% { transform: scale(1.5); opacity: 0; }
}
.cell.shake { animation: cell-shake .3s ease; }
@keyframes cell-shake {
  0%, 100% { transform: translateX(0); }
  22% { transform: translateX(-4px) rotate(-2deg); }
  55% { transform: translateX(4px) rotate(2deg); }
  80% { transform: translateX(-2px); }
}

.combo {
  position: absolute;
  left: 50%;
  top: 44%;
  z-index: 6;
  transform: translate(-50%, -50%) scale(.6);
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
  color: #fff;
  font-size: 28px;
  font-weight: 900;
  letter-spacing: .02em;
  text-shadow:
    0 3px 0 #c0521a,
    0 0 10px rgba(255, 210, 60, .9),
    0 0 22px rgba(255, 170, 40, .65);
}
.combo.show { animation: combo-pop .78s cubic-bezier(.22, 1.2, .4, 1) forwards; }
@keyframes combo-pop {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(.4) rotate(-8deg); }
  24% { opacity: 1; transform: translate(-50%, -50%) scale(1.14) rotate(3deg); }
  55% { opacity: 1; transform: translate(-50%, -50%) scale(1) rotate(0); }
  100% { opacity: 0; transform: translate(-50%, -105%) scale(.92); }
}

/* 底部提示（不挡猫） */
.hint {
  position: fixed;
  z-index: 6;
  right: max(14px, calc(50% - 220px));
  bottom: calc(14px + env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: min(210px, calc(100% - 170px));
  padding: 8px 12px;
  border-radius: 999px;
  border: 1.5px solid #e9b773;
  background: rgba(255, 251, 238, .93);
  box-shadow: 0 3px 0 rgba(118, 66, 16, .16), 0 7px 16px rgba(56, 89, 26, .2);
  color: #7a3f15;
  font-size: 11.5px;
  font-weight: 800;
  line-height: 1.28;
}
.hint .mp-icon { flex: 0 0 18px; width: 18px; height: 18px; color: #f08a2c; }
.hint span { display: block; }

/* ---------------- 弹窗 ---------------- */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(48, 29, 10, .52);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  animation: fade-in .2s ease;
}
.overlay[hidden] { display: none; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.dialog {
  position: relative;
  width: min(342px, 100%);
  padding: 24px 20px 20px;
  border-radius: 30px;
  border: 3px solid #fff9ec;
  background: linear-gradient(180deg, #fffdf7 0%, #fff4dc 55%, #ffe8bd 100%);
  box-shadow:
    0 9px 0 #c9762f,
    0 24px 54px rgba(43, 23, 2, .42),
    inset 0 0 0 2px #f3bb73;
  text-align: center;
  animation: dialog-in .34s cubic-bezier(.2, 1.25, .4, 1);
}
@keyframes dialog-in {
  from { opacity: 0; transform: translateY(16px) scale(.88); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.dialog-stars {
  display: flex;
  justify-content: center;
  gap: 2px;
  margin: -4px 0 6px;
  min-height: 38px;
}
.dialog-stars .mp-icon {
  width: 34px;
  height: 34px;
  color: #f5d9a0;
  filter: drop-shadow(0 2px 0 rgba(160, 100, 20, .22));
  transform: scale(.9);
}
.dialog-stars .mp-icon.on {
  color: #ffd23d;
  transform: scale(1.07);
  filter: drop-shadow(0 0 8px rgba(255, 220, 70, .85)) drop-shadow(0 2px 0 #cf8c05);
  animation: star-in .45s cubic-bezier(.2, 1.4, .4, 1) backwards;
}
.dialog-stars .mp-icon.on:nth-child(2) { animation-delay: .1s; }
.dialog-stars .mp-icon.on:nth-child(3) { animation-delay: .2s; }
@keyframes star-in {
  from { opacity: 0; transform: scale(.2) rotate(-30deg); }
  to { opacity: 1; transform: scale(1.07) rotate(0); }
}
.dialog.no-stars .dialog-stars { display: none; }
.dialog h2 {
  margin: 2px 0 6px;
  color: #74350d;
  font-size: 25px;
  font-weight: 900;
  letter-spacing: .02em;
  text-shadow: 0 1px 0 #fff;
}
.dialog p {
  margin: 0 auto 18px;
  max-width: 244px;
  color: #a5713e;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.55;
}
.btn[hidden] { display: none; }
.btn {
  display: block;
  width: 100%;
  min-height: 48px;
  margin-top: 9px;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 900;
  letter-spacing: .05em;
  transition: transform .1s ease, box-shadow .1s ease;
}
.btn-primary {
  color: #fff;
  background: linear-gradient(180deg, #ffb35f 0%, #ff8a3d 46%, #ed681d 100%);
  border: 2px solid #ffd9a8;
  box-shadow: 0 4px 0 #b4500f, 0 8px 16px rgba(166, 85, 15, .3), inset 0 2px 0 rgba(255, 255, 255, .55);
  text-shadow: 0 1px 0 rgba(140, 56, 6, .4);
}
.btn-ghost {
  color: #a0652c;
  background: rgba(255, 255, 255, .58);
  border: 2px solid #ebc38f;
  box-shadow: 0 3px 0 rgba(161, 108, 47, .18);
  font-size: 14px;
  min-height: 44px;
}
.btn:active { transform: translateY(2px); }
.btn-primary:active { box-shadow: 0 1px 0 #b4500f, 0 3px 8px rgba(166, 85, 15, .24), inset 0 2px 0 rgba(255, 255, 255, .5); }
.btn-ghost:active { box-shadow: 0 1px 0 rgba(161, 108, 47, .18); }

/* ---------------- 小屏适配 ---------------- */
@media (max-width: 354px) {
  .hud { grid-template-columns: 102px minmax(0, 1fr) 44px; gap: 7px; }
  .stage { padding-left: 11px; padding-right: 11px; }
  .level-tag { font-size: 14px; }
  .moves-card strong { font-size: 27px; }
  .target-icon { width: 30px; height: 30px; }
  .target-count b { font-size: 24px; }
  .pause-btn { width: 44px; height: 44px; }
  .pause-btn .mp-icon { width: 21px; height: 21px; }
  .hint { font-size: 10.5px; padding: 7px 10px; max-width: calc(100% - 158px); }
  .deco-cat { width: 140px; }
}
@media (max-height: 820px) {
  .cat-bubble { display: none; }
}
@media (max-height: 700px) {
  .stage { padding-top: calc(6px + env(safe-area-inset-top)); }
  .hud { grid-template-columns: 104px minmax(0, 1fr) 46px; }
  .level-tag { font-size: 15px; padding: 2px 0 4px; }
  .moves-card strong { font-size: 27px; }
  .target-icon { width: 31px; height: 31px; }
  .target-count b { font-size: 25px; }
  .progress { margin-top: 8px; }
  .board-shell { margin-top: 9px; }
  .deco-cat { width: clamp(116px, 32vw, 128px); }
  .hint { bottom: calc(10px + env(safe-area-inset-bottom)); }
}
@media (max-height: 610px) {
  .level-tag small, .target-sub { display: none; }
  .hud { grid-template-columns: 92px minmax(0, 1fr) 44px; }
  .level-panel { padding: 4px; }
  .moves-card { padding: 2px 3px; }
  .moves-card span { font-size: 10px; }
  .moves-card strong { font-size: 24px; }
  .target-panel { padding: 6px 6px 4px; }
  .progress { height: 22px; margin-top: 6px; }
  .board-shell { margin-top: 8px; }
  .hint { max-width: calc(100% - 152px); font-size: 10px; }
  .deco-cat { width: 112px; }
}

/* 横屏不挡板：仍可玩，收紧布局 */
@media (orientation: landscape) and (max-height: 580px) {
  .stage {
    display: grid;
    grid-template-columns: 1fr;
    max-width: min(94vw, 520px);
    padding-top: calc(6px + env(safe-area-inset-top));
  }
  .hud, .progress, .board-shell { width: min(60vh, 360px); margin-left: auto; margin-right: auto; }
  .hud { grid-template-columns: 92px minmax(0, 1fr) 42px; gap: 7px; }
  .level-tag { font-size: 14px; }
  .moves-card strong { font-size: 24px; }
  .target-icon { width: 28px; height: 28px; }
  .target-count b { font-size: 22px; }
  .pause-btn { width: 42px; height: 42px; }
  .pause-btn .mp-icon { width: 20px; height: 20px; }
  .board-shell { margin-top: 8px; }
  .hint { display: none; }
  .deco-cat { width: min(130px, 22vh); opacity: .8; }
}

/* 减少动态偏好 */
@media (prefers-reduced-motion: reduce) {
  .cloud, .deco-cat, .target-icon { animation: none; }
  * { transition-duration: .01ms !important; }
}
