/* 一箭好运来 · 卡通消除箭头 */
:root {
  --orange: #FF8A3D;
  --orange-deep: #E9681C;
  --orange-light: #FFB47C;
  --cream: #FFF9EE;
  --cream-2: #FFF3DE;
  --cream-3: #F4E3C7;
  --ink: #3C2F25;
  --ink-2: #7E6A56;
  --ink-3: #A38D77;
  --mint: #A9E9D9;
  --mint-2: #D6F5E7;
  --mint-ink: #4D8C77;
  --red: #FF6363;
  --gold: #FFC43D;
  --blue: #4FA8EF;
  --green: #49C08C;
  --violet: #9A7CF0;
}

* { box-sizing: border-box; }
*::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
  color: var(--ink);
  background: #BFEEDF;
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button { font: inherit; color: inherit; touch-action: manipulation; }
[hidden] { display: none !important; }

/* ---------- 背景 ---------- */
.scene {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background:
    radial-gradient(120% 70% at 50% -8%, #EFFFF9 0%, rgba(239, 255, 249, 0) 58%),
    linear-gradient(180deg, #A9E9D9 0%, #CFF4E5 44%, #FFF4D9 100%);
}
.sun {
  position: absolute;
  top: -110px;
  right: -80px;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, #FFFBDA 0%, #FFE79B 40%, rgba(255, 231, 155, 0) 70%);
  opacity: .95;
}
.cloud {
  position: absolute;
  height: 30px;
  border-radius: 999px;
  background: #FFFDF7;
  opacity: .76;
  box-shadow: 0 8px 18px rgba(75, 130, 108, .06);
}
.cloud::before, .cloud::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  background: inherit;
}
.cloud::before { width: 46px; height: 46px; left: 16px; top: -22px; }
.cloud::after { width: 30px; height: 30px; right: 18px; top: -14px; }
.cloud-a { width: 128px; top: 14%; left: -34px; animation: drift 13s ease-in-out infinite; }
.cloud-b { width: 92px; top: 26%; right: -26px; opacity: .55; transform: scale(.8); animation: drift 17s ease-in-out infinite reverse; }
.cloud-c { width: 72px; top: 40%; left: 5%; opacity: .45; transform: scale(.64); animation: drift 21s ease-in-out infinite; }
@keyframes drift {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(14px); }
}

.hill {
  position: absolute;
  left: -18%;
  width: 136%;
  border-radius: 50% 50% 0 0;
  pointer-events: none;
}
.hill-back {
  bottom: -174px;
  height: 300px;
  background: linear-gradient(180deg, #B9EDD5, #96DFC0);
  transform: rotate(-2deg);
  opacity: .7;
}
.hill-front {
  bottom: -218px;
  height: 310px;
  background: linear-gradient(180deg, #8ED9B7, #6FC99E);
  transform: rotate(2deg);
  opacity: .52;
}
.sparkle {
  position: absolute;
  width: 16px;
  height: 16px;
  background: rgba(255, 255, 255, .9);
  clip-path: polygon(50% 0, 59% 41%, 100% 50%, 59% 59%, 50% 100%, 41% 59%, 0 50%, 41% 41%);
  animation: twinkle 2.8s ease-in-out infinite;
}
.sparkle-a { top: 17%; right: 14%; width: 12px; height: 12px; }
.sparkle-b { top: 45%; left: 7%; width: 9px; height: 9px; animation-delay: .8s; opacity: .7; }
.sparkle-c { top: 34%; right: 6%; width: 8px; height: 8px; animation-delay: 1.5s; opacity: .6; }
@keyframes twinkle {
  0%, 100% { transform: scale(.7) rotate(0deg); opacity: .35; }
  50% { transform: scale(1.25) rotate(18deg); opacity: 1; }
}

/* ---------- 页面骨架 ---------- */
.viewport {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 440px;
  height: 100vh;
  height: 100dvh;
  margin: 0 auto;
  padding: calc(10px + env(safe-area-inset-top)) 16px calc(10px + env(safe-area-inset-bottom));
}

.hud {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.coin-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 15px 0 6px;
  border-radius: 999px;
  border: 1.5px solid #F0D9AE;
  background: rgba(255, 251, 241, .94);
  box-shadow: 0 3px 0 rgba(206, 173, 121, .55), 0 8px 18px rgba(65, 113, 92, .12);
}
.coin-pill.bump { animation: coinBump .42s cubic-bezier(.3, 1.7, .4, 1); }
@keyframes coinBump {
  0% { transform: scale(1); }
  45% { transform: scale(1.1) rotate(-2deg); }
  100% { transform: scale(1); }
}
.coin-disc {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: #B97500;
  background: linear-gradient(180deg, #FFE888, #FFB823);
  box-shadow: inset 0 1px 0 #FFF5C2, 0 2px 0 #D98C0F;
}
.coin-disc .mp-icon { width: 20px; height: 20px; }
.coin-label {
  color: #A68A64;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .02em;
}
#coinValue {
  font-size: 17px;
  font-weight: 900;
  letter-spacing: .01em;
  font-variant-numeric: tabular-nums;
}
.hud-actions { display: flex; gap: 8px; }
.icon-btn {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1.5px solid #EFD9B9;
  border-radius: 14px;
  color: #7A6049;
  background: linear-gradient(180deg, #FFFDF6, #FFF3DF);
  box-shadow: 0 3px 0 #E5CEAC, 0 7px 14px rgba(65, 113, 92, .1);
  cursor: pointer;
  transition: transform .12s, box-shadow .12s;
}
.icon-btn .mp-icon { width: 22px; height: 22px; }
.icon-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 #E5CEAC; }
.icon-btn:focus-visible, .btn:focus-visible, .cell:focus-visible, .modal-close:focus-visible {
  outline: 3px solid rgba(60, 47, 37, .75);
  outline-offset: 2px;
}

.play {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 11px;
  padding: 10px 0 2px;
}

/* ---------- 棋盘卡片 ---------- */
.board-card {
  position: relative;
  flex: none;
  width: 100%;
  padding: 12px 12px 10px;
  border: 2px solid #F1D9B5;
  border-radius: 28px;
  overflow: hidden;
  background:
    radial-gradient(circle at 12% 0%, rgba(255, 255, 255, .95), rgba(255, 255, 255, 0) 32%),
    repeating-linear-gradient(0deg, rgba(221, 188, 141, .11) 0 1px, transparent 1px 10px),
    linear-gradient(180deg, #FFFDF7, #FFF4DF);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, .95),
    0 5px 0 #E8CDA4,
    0 20px 34px rgba(64, 103, 84, .18);
}
.board-card::after {
  content: "";
  position: absolute;
  top: 9px;
  left: 50%;
  width: 38px;
  height: 5px;
  border-radius: 999px;
  background: #F1DFC4;
  transform: translateX(-50%);
  pointer-events: none;
}

.board-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 2px 5px 8px;
}
.score-label {
  display: block;
  margin-bottom: 2px;
  color: #A38B72;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .2em;
}
.score-line { display: flex; align-items: center; gap: 7px; }
#scoreValue {
  color: #3A2C21;
  font-size: 31px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 0 #FFF;
}
#scoreValue.pop { animation: scorePop .26s cubic-bezier(.3, 1.8, .4, 1); }
@keyframes scorePop {
  0% { transform: scale(1); }
  45% { transform: scale(1.14); color: #E9681C; }
  100% { transform: scale(1); }
}
.combo-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 4px 8px;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(180deg, #FF9A50, #F26A1B);
  box-shadow: 0 2px 0 #C9530F;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .02em;
  transform: rotate(-3deg);
  animation: comboPop .32s cubic-bezier(.3, 1.8, .4, 1);
}
.combo-chip b { font-size: 12px; }
@keyframes comboPop {
  0% { transform: rotate(-3deg) scale(.55); }
  70% { transform: rotate(-3deg) scale(1.14); }
  100% { transform: rotate(-3deg) scale(1); }
}
.head-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  padding-top: 2px;
}
.level-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border: 1px solid #FFD2AF;
  border-radius: 999px;
  color: #C05A1B;
  background: linear-gradient(180deg, #FFE9D7, #FFDDC0);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .8);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .02em;
}
.level-chip .mp-icon { width: 13px; height: 13px; }
.hearts { display: flex; gap: 3px; padding-right: 2px; }
.heart {
  width: 18px;
  height: 18px;
  color: #FF6868;
  filter: drop-shadow(0 2px 0 rgba(190, 62, 62, .2));
  transition: color .2s, transform .2s;
}
.heart.is-empty { color: #E2D2BC; filter: none; }
.heart.is-lost { animation: heartLost .45s ease; }
@keyframes heartLost {
  0% { transform: scale(1); }
  35% { transform: scale(1.35) rotate(-8deg); }
  100% { transform: scale(1); }
}

.progress-track {
  height: 7px;
  margin: 0 4px 9px;
  border-radius: 999px;
  overflow: hidden;
  background: #F0DFC4;
  box-shadow: inset 0 1px 2px rgba(140, 100, 55, .2);
}
.progress-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #FFC07A, #FF7A2E);
  box-shadow: 0 0 9px rgba(255, 138, 61, .55);
  transition: width .34s cubic-bezier(.2, .8, .3, 1);
}

.board-shell {
  position: relative;
  width: min(100%, calc(100dvh - 374px));
  min-width: 174px;
  max-width: 100%;
  margin: 0 auto;
  padding: 8px;
  border: 1.5px solid #EDD3AC;
  border-radius: 21px;
  background: linear-gradient(180deg, #F8EAD4, #F1DDC0);
  box-shadow: inset 0 2px 6px rgba(150, 108, 58, .16), inset 0 -1px 0 rgba(255, 255, 255, .7);
}
.board {
  position: relative;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: clamp(4px, 1.5vw, 7px);
  width: 100%;
  aspect-ratio: 1 / 1;
}

.cell {
  position: relative;
  display: block;
  aspect-ratio: 1 / 1;
  padding: 0;
  border: 0;
  border-radius: 14px;
  background: transparent;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform .1s;
  -webkit-appearance: none;
  appearance: none;
}
.cell::before {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: 13px;
  background: linear-gradient(180deg, #EFDDBF, #F7E9D1);
  box-shadow: inset 0 2px 4px rgba(135, 96, 52, .18), inset 0 -1px 0 rgba(255, 255, 255, .55);
}
.cell.has-arrow::before { background: linear-gradient(180deg, #E7D0AB, #EFDCBE); }
.cell.is-empty { cursor: default; }
.cell.is-dealing { animation: dealIn .34s cubic-bezier(.2, 1.15, .4, 1) both; animation-delay: var(--deal, 0ms); }
@keyframes dealIn {
  0% { opacity: 0; transform: scale(.62); }
  100% { opacity: 1; transform: scale(1); }
}

.tile {
  position: absolute;
  inset: 1px;
  z-index: 2;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .3);
  border-radius: 13px;
  color: #fff;
  background: var(--grad);
  box-shadow:
    0 3px 0 var(--shade),
    0 5px 9px rgba(72, 55, 38, .2),
    inset 0 1px 0 rgba(255, 255, 255, .55),
    inset 0 -2px 0 rgba(0, 0, 0, .08);
  will-change: transform;
}
.tile::after {
  content: "";
  position: absolute;
  top: 5%;
  left: 9%;
  right: 9%;
  height: 32%;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .5), rgba(255, 255, 255, 0));
  pointer-events: none;
}
.tile.dir-0 { --grad: linear-gradient(180deg, #FFB06B, #FF7D31); --shade: #D75C13; }
.tile.dir-1 { --grad: linear-gradient(180deg, #7DC9FF, #4098E8); --shade: #2C77BE; }
.tile.dir-2 { --grad: linear-gradient(180deg, #75DEB6, #3FBB87); --shade: #2C956A; }
.tile.dir-3 { --grad: linear-gradient(180deg, #C3A4FF, #8D67E6); --shade: #6E4CC4; }
.tile.is-lucky {
  --grad: linear-gradient(180deg, #FFE688, #FFB51F);
  --shade: #D58A00;
  box-shadow:
    0 3px 0 #D58A00,
    0 0 0 2px rgba(255, 238, 158, .55),
    0 6px 13px rgba(217, 140, 0, .3),
    inset 0 1px 0 rgba(255, 255, 255, .8);
}
.tile.is-lucky .arrow-svg { filter: drop-shadow(0 2px 0 rgba(160, 95, 0, .24)); }
.arrow-svg {
  position: relative;
  z-index: 1;
  width: 62%;
  height: 62%;
  transform: rotate(var(--rot, 0deg));
  filter: drop-shadow(0 2px 0 rgba(0, 0, 0, .13));
}
.lucky-star {
  position: absolute;
  z-index: 2;
  width: 8px;
  height: 8px;
  background: #fff;
  clip-path: polygon(50% 0, 59% 41%, 100% 50%, 59% 59%, 50% 100%, 41% 59%, 0 50%, 41% 41%);
  animation: twinkle 1.7s ease-in-out infinite;
}
.lucky-star.s1 { top: 9%; right: 11%; }
.lucky-star.s2 { bottom: 12%; left: 12%; width: 5px; height: 5px; animation-delay: .7s; opacity: .8; }

.cell:active .tile { transform: scale(.93); }
.cell.is-launching { z-index: 8; pointer-events: none; }
.cell.is-launching .tile {
  animation: tileLaunch .38s cubic-bezier(.25, .75, .35, 1) forwards;
}
@keyframes tileLaunch {
  0% { transform: translate(0, 0) scale(1); opacity: 1; }
  32% { transform: translate(calc(var(--tx) * .3), calc(var(--ty) * .3)) scale(1.1); opacity: 1; }
  100% { transform: translate(var(--tx), var(--ty)) scale(.35); opacity: 0; }
}
.cell.is-blocked { z-index: 6; }
.cell.is-blocked .tile {
  animation: tileShake .42s ease;
  box-shadow: 0 0 0 3px rgba(255, 96, 80, .55), 0 3px 0 var(--shade), 0 6px 14px rgba(190, 60, 45, .3);
}
@keyframes tileShake {
  0%, 100% { transform: translateX(0) rotate(0); }
  15% { transform: translateX(-4px) rotate(-3deg); }
  35% { transform: translateX(4px) rotate(3deg); }
  55% { transform: translateX(-3px) rotate(-2deg); }
  75% { transform: translateX(3px) rotate(2deg); }
}
.cell.is-hinted { z-index: 7; }
.cell.is-hinted .tile {
  animation: hintPulse 1.05s ease-in-out infinite;
  box-shadow: 0 0 0 3px #FFF, 0 0 0 7px rgba(255, 255, 255, .55), 0 6px 15px rgba(255, 138, 61, .45), 0 3px 0 var(--shade);
}
.cell.is-hinted::after {
  content: "";
  position: absolute;
  z-index: 9;
  inset: -5px;
  border: 3px solid rgba(255, 255, 255, .92);
  border-radius: 18px;
  animation: hintRing 1.25s ease-out infinite;
  pointer-events: none;
}
@keyframes hintPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.055); }
}
@keyframes hintRing {
  0% { transform: scale(.96); opacity: .95; }
  100% { transform: scale(1.2); opacity: 0; }
}

/* 飘分与粒子 */
.fx { position: absolute; inset: 8px; z-index: 20; pointer-events: none; overflow: visible; }
.float-score {
  position: absolute;
  transform: translate(-50%, -50%);
  color: #fff;
  font-size: 16px;
  font-weight: 900;
  letter-spacing: -.02em;
  text-shadow: 0 2px 0 #E9681C, 0 0 10px rgba(255, 138, 61, .6);
  animation: floatUp .85s cubic-bezier(.2, .8, .3, 1) forwards;
  white-space: nowrap;
}
.float-score.is-coin { color: #FFF3B0; font-size: 14px; text-shadow: 0 2px 0 #B97500, 0 0 10px rgba(255, 200, 60, .7); }
.float-score.is-block { color: #FF6A5F; font-size: 13px; text-shadow: 0 2px 0 #FFF; }
.float-score.is-combo { font-size: 18px; text-shadow: 0 2px 0 #C9530F, 0 0 14px rgba(255, 138, 61, .8); }
@keyframes floatUp {
  0% { opacity: 0; transform: translate(-50%, -30%) scale(.6); }
  25% { opacity: 1; transform: translate(-50%, -58%) scale(1.08); }
  100% { opacity: 0; transform: translate(-50%, -145%) scale(.94); }
}
.spark-dot {
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #FFE9B0;
  box-shadow: 0 0 7px rgba(255, 220, 130, .9);
  animation: sparkFly .55s ease-out forwards;
}
@keyframes sparkFly {
  0% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(.2); }
}

/* 提示条 */
.tip-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 32px;
  margin: 9px 2px 1px;
  padding: 7px 8px;
  border-radius: 12px;
  color: #588774;
  background: #F1FBF5;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
  transition: background .18s, color .18s;
}
.tip-bar .mp-icon { flex: none; width: 15px; height: 15px; }
.tip-bar.is-warn { color: #D4553C; background: #FFF0EC; }
.tip-bar.is-good { color: #B97417; background: #FFF4DE; }

/* ---------- 操作区 ---------- */
.controls { display: flex; gap: 10px; flex: none; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 54px;
  padding: 0 18px;
  border: 0;
  border-radius: 17px;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: .01em;
  cursor: pointer;
  user-select: none;
  transition: transform .12s, box-shadow .12s, filter .12s;
}
.btn .mp-icon { width: 21px; height: 21px; }
.btn:active { transform: translateY(2px); }
.btn-ghost {
  flex: 0 0 112px;
  color: #8A6A4D;
  background: linear-gradient(180deg, #FFFDF7, #FFF2DD);
  border: 1.5px solid #EDD6B5;
  box-shadow: 0 3px 0 #E3CBA9, 0 8px 16px rgba(64, 103, 84, .1);
}
.btn-ghost:active { box-shadow: 0 1px 0 #E3CBA9; }
.btn-primary {
  flex: 1;
  color: #fff;
  background: linear-gradient(180deg, #FFA65F, #FF7A2E);
  box-shadow: 0 4px 0 #D45A12, 0 10px 20px rgba(217, 95, 23, .28), inset 0 1px 0 rgba(255, 255, 255, .5);
  text-shadow: 0 1px 0 rgba(176, 74, 16, .35);
}
.btn-primary:active { box-shadow: 0 2px 0 #D45A12, 0 5px 10px rgba(217, 95, 23, .24); }
.hint-count {
  display: grid;
  place-items: center;
  min-width: 21px;
  height: 21px;
  padding: 0 5px;
  border-radius: 999px;
  color: #D45A12;
  background: rgba(255, 255, 255, .88);
  font-size: 11px;
  font-weight: 900;
  text-shadow: none;
}
.btn.is-disabled { filter: grayscale(.35); opacity: .72; }
.btn-lg { width: 100%; height: 55px; margin-top: 2px; font-size: 16px; }
.best-line {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  margin: 1px 0 0;
  color: rgba(64, 91, 80, .62);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .02em;
}
.best-line .mp-icon { width: 14px; height: 14px; color: #E5A727; }
.best-line b { color: #7A5A3A; font-size: 12.5px; font-weight: 900; font-variant-numeric: tabular-nums; }

/* ---------- 弹层 ---------- */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
  background: rgba(37, 56, 48, .46);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity .18s ease;
}
.overlay.is-open { opacity: 1; }
.modal {
  position: relative;
  width: min(100%, 350px);
  max-height: calc(100dvh - 44px);
  padding: 30px 20px 20px;
  overflow: auto;
  border: 2px solid #F2DBB7;
  border-radius: 30px;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 255, 255, .95), rgba(255, 255, 255, 0) 36%),
    linear-gradient(180deg, #FFFDF7, #FFF5E3);
  box-shadow: 0 8px 0 #DFBF93, 0 30px 60px rgba(28, 53, 43, .32);
  text-align: center;
  opacity: 0;
  transform: translateY(16px) scale(.95);
  transition: transform .24s cubic-bezier(.2, .9, .3, 1.25), opacity .18s;
}
.overlay.is-open .modal { opacity: 1; transform: translateY(0) scale(1); }
.burst {
  position: absolute;
  top: -12px;
  left: 50%;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: repeating-conic-gradient(from 0deg, rgba(255, 172, 84, .34) 0deg 7deg, transparent 7deg 20deg);
  -webkit-mask: radial-gradient(circle, #000 0 28%, transparent 66%);
  mask: radial-gradient(circle, #000 0 28%, transparent 66%);
  transform: translateX(-50%);
  opacity: .9;
  pointer-events: none;
  animation: burstSpin 26s linear infinite;
}
@keyframes burstSpin { to { transform: translateX(-50%) rotate(360deg); } }
.modal-badge {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 78px;
  height: 78px;
  margin: 0 auto 12px;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(180deg, #FFB463, #FF7A2E);
  box-shadow: 0 5px 0 #D45A12, 0 11px 22px rgba(217, 95, 23, .3), inset 0 2px 0 rgba(255, 255, 255, .55);
}
.modal-badge .mp-icon { width: 41px; height: 41px; }
.lose-badge {
  background: linear-gradient(180deg, #FFB1A2, #FF6F61);
  box-shadow: 0 5px 0 #C7483B, 0 11px 22px rgba(199, 72, 59, .28), inset 0 2px 0 rgba(255, 255, 255, .5);
}
.modal-kicker {
  margin: 0 0 3px;
  color: #D77A33;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .24em;
}
.modal-title {
  margin: 0;
  color: #3A2C21;
  font-size: 27px;
  font-weight: 900;
  letter-spacing: -.02em;
  line-height: 1.2;
}
.modal-sub {
  margin: 7px 0 0;
  color: #8B745C;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.45;
}
.modal-sub b { color: #D4671F; }
.win-score {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 12px 0 0;
  padding: 5px 12px;
  border-radius: 999px;
  color: #8B745C;
  background: #FFF1DC;
  font-size: 11px;
  font-weight: 700;
}
.win-score b { color: #E9681C; font-size: 15px; font-weight: 900; }
.reward-panel {
  margin: 14px 0 16px;
  padding: 4px 12px;
  border: 1.5px solid #F3DEBB;
  border-radius: 18px;
  background: #FFF3DC;
  box-shadow: inset 0 1px 0 #FFF;
}
.reward-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 2px;
  border-bottom: 1px dashed #EAD2AC;
  color: #7A6450;
  font-size: 12.5px;
  font-weight: 700;
}
.reward-row span { display: flex; align-items: center; gap: 6px; }
.reward-row .mp-icon { width: 17px; height: 17px; color: #C28735; }
.reward-row b { color: #4A3624; font-size: 13.5px; font-weight: 900; font-variant-numeric: tabular-nums; }
.reward-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 2px 7px;
  color: #8A6A44;
  font-size: 12.5px;
  font-weight: 800;
}
.reward-total strong {
  display: flex;
  align-items: center;
  gap: 4px;
  color: #E9681C;
  font-size: 26px;
  font-weight: 900;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}
.reward-total strong .mp-icon { width: 22px; height: 22px; color: #E9A21B; }
.lose-stats {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 14px 0 16px;
  padding: 11px 14px;
  border-radius: 16px;
  background: #FFF3DC;
  border: 1.5px solid #F3DEBB;
  color: #8A6A44;
  font-size: 12.5px;
  font-weight: 700;
}
.lose-stats b { color: #E9681C; font-size: 20px; font-weight: 900; }

/* 玩法弹窗 */
.help-modal { padding-top: 28px; }
.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: #8A6E50;
  background: #F5E6CE;
  cursor: pointer;
}
.modal-close .mp-icon { width: 18px; height: 18px; }
.help-modal .modal-title { font-size: 25px; }
.how-list { display: flex; flex-direction: column; gap: 9px; margin: 15px 0 12px; text-align: left; }
.how-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border: 1.5px solid #F2DFC0;
  border-radius: 16px;
  background: #FFF8EA;
}
.how-num {
  display: grid;
  place-items: center;
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(180deg, #FFA45B, #FF7A2E);
  box-shadow: 0 2px 0 #D45A12;
  font-size: 13px;
  font-weight: 900;
}
.how-item b { display: block; color: #453225; font-size: 13.5px; font-weight: 900; }
.how-item p { margin: 2px 0 0; color: #8A725A; font-size: 11.5px; font-weight: 500; line-height: 1.5; }
.help-note {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin-bottom: 15px;
  padding: 10px 12px;
  border-radius: 14px;
  color: #5A846F;
  background: #EFFAF4;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.55;
  text-align: left;
}
.help-note .mp-icon { flex: none; width: 16px; height: 16px; margin-top: 1px; }

/* 彩带 */
.confetti-layer {
  position: fixed;
  inset: 0;
  z-index: 90;
  overflow: hidden;
  pointer-events: none;
}
.confetti-piece {
  position: absolute;
  top: -24px;
  border-radius: 3px;
  animation: confettiFall linear forwards;
}
@keyframes confettiFall {
  0% { opacity: 1; transform: translate3d(0, -20px, 0) rotate(0deg); }
  100% { opacity: .9; transform: translate3d(var(--drift, 20px), 108vh, 0) rotate(var(--spin, 540deg)); }
}

/* ---------- 小屏适配 ---------- */
@media (max-height: 710px) {
  .viewport { padding-top: calc(6px + env(safe-area-inset-top)); padding-bottom: calc(6px + env(safe-area-inset-bottom)); }
  .coin-pill { height: 40px; }
  .coin-disc { width: 29px; height: 29px; }
  .icon-btn { width: 40px; height: 40px; border-radius: 13px; }
  .play { gap: 8px; padding-top: 5px; }
  .board-card { padding: 10px 10px 8px; border-radius: 24px; }
  .board-head { padding-bottom: 6px; }
  #scoreValue { font-size: 27px; }
  .board-shell { width: min(100%, calc(100dvh - 328px)); padding: 7px; }
  .tip-bar { min-height: 29px; margin-top: 7px; padding: 6px; font-size: 11.5px; }
  .controls .btn { height: 48px; border-radius: 15px; font-size: 14px; }
  .best-line { font-size: 11px; }
  .modal { padding-top: 26px; }
  .modal-badge { width: 68px; height: 68px; }
  .modal-badge .mp-icon { width: 36px; height: 36px; }
  .modal-title { font-size: 24px; }
}

@media (max-height: 620px) {
  .viewport {
    padding-top: calc(4px + env(safe-area-inset-top));
    padding-bottom: calc(4px + env(safe-area-inset-bottom));
  }
  .coin-pill { height: 38px; padding-right: 12px; }
  .coin-disc { width: 28px; height: 28px; }
  .coin-label { font-size: 9px; }
  #coinValue { font-size: 15px; }
  .icon-btn { width: 38px; height: 38px; border-radius: 12px; }
  .icon-btn .mp-icon { width: 20px; height: 20px; }
  .play { gap: 6px; padding-top: 3px; }
  .board-card { padding: 8px 8px 6px; border-radius: 20px; }
  .board-card::after { display: none; }
  .board-head { padding: 0 3px 5px; }
  .score-label { margin-bottom: 1px; font-size: 9px; }
  #scoreValue { font-size: 24px; }
  .level-chip { padding: 4px 8px; font-size: 10px; }
  .heart { width: 16px; height: 16px; }
  .progress-track { height: 6px; margin-bottom: 6px; }
  .board-shell {
    width: min(100%, calc(100dvh - 286px));
    padding: 6px;
    border-radius: 18px;
  }
  .tip-bar { min-height: 27px; margin-top: 5px; padding: 5px; font-size: 11px; }
  .controls .btn { height: 44px; border-radius: 14px; font-size: 14px; }
  .btn .mp-icon { width: 19px; height: 19px; }
  .best-line { margin-top: 0; font-size: 10px; }
  .best-line b { font-size: 11px; }
  .best-line .mp-icon { width: 12px; height: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .cloud, .sparkle, .burst, .lucky-star, .cell.is-dealing { animation: none !important; }
  .cell.is-hinted .tile, .cell.is-hinted::after { animation-duration: 2.4s; }
  .confetti-piece { display: none; }
}
