*,
*::before,
*::after { box-sizing: border-box; }

:root {
  --orange: #FF8A3D;
  --orange-deep: #E96A16;
  --orange-dark: #C95508;
  --cream: #FFF7E9;
  --ink: #5A2E12;
  --muted: #A26A43;
  --white: #FFFFFF;
  --shadow-soft: 0 6px 0 rgba(177, 78, 12, 0.16), 0 12px 26px rgba(150, 64, 8, 0.16);
}

html {
  height: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100%;
  min-height: 100dvh;
  color: var(--ink);
  background: #FFD3A3;
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  user-select: none;
  -webkit-user-select: none;
}

[hidden] { display: none !important; }

/* ---------- 背景舞台 ---------- */
.scene {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background:
    linear-gradient(180deg, #FFDFB5 0%, #FFD0A0 38%, #FFB97B 72%, #FFA961 100%);
}

.scene-glow {
  position: absolute;
  top: -24vh;
  left: 50%;
  width: 150vw;
  height: 78vh;
  transform: translateX(-50%);
  background: radial-gradient(ellipse at 50% 45%, rgba(255, 250, 218, 0.95) 0%, rgba(255, 244, 206, 0.55) 38%, rgba(255, 244, 206, 0) 72%);
}

.cloud {
  position: absolute;
  height: 24px;
  width: 88px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.62);
  filter: blur(0.5px);
}

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

.cloud::before {
  width: 40px;
  height: 40px;
  left: 13px;
  top: -20px;
}

.cloud::after {
  width: 28px;
  height: 28px;
  right: 14px;
  top: -13px;
}

.cloud-a { top: 12%; left: -18px; opacity: 0.8; transform: scale(0.9); }
.cloud-b { top: 24%; right: -26px; opacity: 0.62; transform: scale(1.18); }
.cloud-c { top: 43%; left: -46px; opacity: 0.42; transform: scale(0.72); }

.hill {
  position: absolute;
  bottom: -20vh;
  border-radius: 50%;
  filter: blur(1px);
}

.hill-a {
  left: -30vw;
  width: 110vw;
  height: 46vh;
  background: linear-gradient(180deg, #FFB978 0%, #FF9F54 100%);
  opacity: 0.85;
}

.hill-b {
  right: -40vw;
  bottom: -26vh;
  width: 120vw;
  height: 50vh;
  background: linear-gradient(180deg, #FFA55D 0%, #F98D3F 100%);
  opacity: 0.9;
}

.sprinkle {
  position: absolute;
  width: 9px;
  height: 3px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.75);
  transform: rotate(-24deg);
}

.sprinkle-a { top: 17%; left: 12%; }
.sprinkle-b { top: 31%; right: 10%; transform: rotate(38deg); background: rgba(255, 238, 181, 0.9); }
.sprinkle-c { top: 55%; left: 6%; transform: rotate(62deg); opacity: 0.6; }
.sprinkle-d { top: 63%; right: 7%; transform: rotate(-48deg); opacity: 0.55; }

.deco {
  position: absolute;
  width: 58px;
  height: 58px;
  opacity: 0.6;
  filter: drop-shadow(0 8px 6px rgba(160, 66, 6, 0.16));
  animation: decoBob 7s ease-in-out infinite;
}

.deco-a { left: -14px; top: 35%; transform: rotate(-16deg); }
.deco-b { right: -16px; top: 27%; width: 66px; height: 66px; animation-delay: -2.2s; transform: rotate(12deg); }
.deco-c { right: -20px; top: 62%; width: 48px; height: 48px; animation-delay: -4.1s; transform: rotate(26deg); }
.deco-d { left: 5%; top: 20%; width: 42px; height: 42px; opacity: 0.4; animation-delay: -1.4s; transform: rotate(-18deg); }
.deco-e { right: 5%; top: 15%; width: 38px; height: 38px; opacity: 0.34; animation-delay: -3.2s; transform: rotate(14deg); }

@keyframes decoBob {
  0%, 100% { margin-top: 0; }
  50% { margin-top: -14px; }
}

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

/* ---------- 顶部数据 ---------- */
.hud {
  flex: 0 0 auto;
  display: flex;
  align-items: stretch;
  gap: 10px;
}

.hud-card {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 58px;
  padding: 8px 14px;
  border-radius: 20px;
  border: 2px solid rgba(255, 255, 255, 0.95);
  background: linear-gradient(180deg, #FFFEF8 0%, #FFF0D6 100%);
  box-shadow: var(--shadow-soft);
}

.score-card { flex: 1 1 auto; min-width: 0; }

.moves-card {
  flex: 0 0 auto;
  min-width: 128px;
  padding-right: 16px;
  border-color: #FFD8B4;
  background: linear-gradient(180deg, #FFB165 0%, #FF7C26 100%);
  color: #FFFFFF;
  box-shadow: 0 6px 0 #D96414, 0 12px 24px rgba(176, 72, 0, 0.28);
  transition: transform 0.2s ease;
}

.moves-card.low {
  animation: lowPulse 1.1s ease-in-out infinite;
}

@keyframes lowPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 6px 0 #D96414, 0 12px 24px rgba(176, 72, 0, 0.28); }
  50% { transform: scale(1.035); box-shadow: 0 6px 0 #D96414, 0 0 26px rgba(255, 211, 129, 0.85); }
}

.hud-icon {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(180deg, #FFEBCB, #FFD8A7);
  color: #F07A22;
  box-shadow: inset 0 -2px 0 rgba(168, 74, 8, 0.12);
}

.hud-icon .mp-icon { width: 21px; height: 21px; }

.moves-card .hud-icon {
  background: rgba(255, 255, 255, 0.24);
  color: #FFFFFF;
  box-shadow: inset 0 -2px 0 rgba(133, 51, 0, 0.1);
}

.hud-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1;
}

.hud-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--muted);
  white-space: nowrap;
}

.moves-card .hud-label { color: rgba(255, 255, 255, 0.9); }

.hud-value {
  margin-top: 5px;
  font-size: 25px;
  font-weight: 900;
  letter-spacing: 0.01em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.7);
}

.moves-card .hud-value {
  color: #FFFFFF;
  text-shadow: 0 2px 0 rgba(157, 60, 0, 0.25);
}

.hud-value.pop { animation: scorePop 0.34s cubic-bezier(0.2, 1.6, 0.4, 1); }

@keyframes scorePop {
  0% { transform: scale(1); }
  45% { transform: scale(1.22); }
  100% { transform: scale(1); }
}

/* ---------- 棋盘 ---------- */
.board-area {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px 0 8px;
}

.board-glow {
  position: absolute;
  width: 94%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.6) 0%, rgba(255, 246, 214, 0.25) 46%, rgba(255, 255, 255, 0) 70%);
  filter: blur(2px);
}

.board-shell {
  position: relative;
  width: min(100%, calc(100vh - 236px), 438px);
  width: min(100%, calc(100dvh - 236px), 438px);
  max-width: 100%;
  aspect-ratio: 1;
  padding: 9px;
  border-radius: 30px;
  border: 2px solid rgba(255, 255, 255, 0.95);
  background:
    linear-gradient(160deg, #FFE8C4 0%, #FFC47E 46%, #F29545 100%);
  box-shadow:
    0 10px 0 rgba(185, 78, 10, 0.22),
    0 22px 42px rgba(154, 61, 3, 0.26),
    inset 0 2px 0 rgba(255, 255, 255, 0.8);
}

.board-trim {
  position: absolute;
  inset: 4px;
  z-index: 5;
  border-radius: 26px;
  border: 1.5px dashed rgba(255, 255, 255, 0.55);
  pointer-events: none;
}

.board {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  grid-template-rows: repeat(8, 1fr);
  gap: 3px;
  padding: 6px;
  border-radius: 23px;
  background:
    linear-gradient(180deg, #F6AC67 0%, #EF9550 100%);
  box-shadow:
    inset 0 5px 12px rgba(146, 61, 6, 0.24),
    inset 0 -2px 0 rgba(255, 255, 255, 0.28);
  touch-action: none;
}

.tile {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 2px;
  border: 0;
  outline: none;
  border-radius: 11px;
  background: rgba(255, 248, 232, 0.3);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.4),
    inset 0 -2px 0 rgba(157, 68, 8, 0.1);
  cursor: pointer;
  touch-action: none;
  transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
}

.tile::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle at 30% 18%, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0) 58%);
  pointer-events: none;
}

.tile:active { transform: scale(0.93); }

.tile-inner {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 3px 2px rgba(133, 54, 0, 0.24));
  will-change: transform;
}

.tile-inner svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
}

.tile.intro .tile-inner {
  animation: introPop 0.34s cubic-bezier(0.2, 1.5, 0.4, 1) both;
  animation-delay: calc(var(--d, 0) * 7ms);
}

@keyframes introPop {
  0% { transform: scale(0.2) rotate(-14deg); opacity: 0; }
  70% { transform: scale(1.08) rotate(2deg); opacity: 1; }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}

.tile.selected {
  z-index: 4;
  background: rgba(255, 255, 255, 0.8);
  box-shadow:
    0 0 0 2px #FFFFFF,
    0 0 0 5px #FFE45C,
    0 0 22px 6px rgba(255, 255, 255, 0.8);
}

.tile.selected .tile-inner { animation: selectedBounce 0.62s ease-in-out infinite; }

@keyframes selectedBounce {
  0%, 100% { transform: scale(1.06) rotate(-2deg); }
  50% { transform: scale(1.14) rotate(2deg); }
}

.tile.hint .tile-inner { animation: hintPulse 0.95s ease-in-out infinite; }

@keyframes hintPulse {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 3px 2px rgba(133, 54, 0, 0.24)); }
  50% { transform: scale(1.16); filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.95)) drop-shadow(0 0 14px rgba(255, 232, 141, 0.95)); }
}

.tile.clear { z-index: 3; }

.tile.clear .tile-inner {
  animation: clearPop 0.24s ease-in forwards;
}

@keyframes clearPop {
  0% { transform: scale(1); opacity: 1; }
  40% { transform: scale(1.26) rotate(8deg); opacity: 1; }
  100% { transform: scale(0.05) rotate(-26deg); opacity: 0; }
}

.tile.drop .tile-inner {
  animation: dropIn 0.25s cubic-bezier(0.16, 0.86, 0.34, 1) both;
}

@keyframes dropIn {
  0% { transform: translateY(var(--fallY, -28px)); opacity: 0.15; }
  100% { transform: translateY(0); opacity: 1; }
}

.tile.shake .tile-inner { animation: tileShake 0.3s ease-in-out; }

@keyframes tileShake {
  0%, 100% { transform: translateX(0) rotate(0); }
  25% { transform: translateX(-4px) rotate(-4deg); }
  50% { transform: translateX(4px) rotate(4deg); }
  75% { transform: translateX(-2px) rotate(-2deg); }
}

.board-fx {
  position: absolute;
  inset: 9px;
  z-index: 6;
  overflow: hidden;
  border-radius: 23px;
  pointer-events: none;
}

.burst {
  position: absolute;
  width: 7px;
  height: 7px;
  margin: -3.5px 0 0 -3.5px;
  border-radius: 2px;
  background: var(--bc, #FFD66B);
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.6);
  animation: burstOut 0.55s ease-out forwards;
}

@keyframes burstOut {
  0% { transform: translate(0, 0) scale(1) rotate(0); opacity: 1; }
  100% { transform: translate(var(--dx, 0), var(--dy, -20px)) scale(0.15) rotate(190deg); opacity: 0; }
}

.board.reshuffling { animation: boardShuffle 0.48s ease-in-out; }

@keyframes boardShuffle {
  0% { transform: rotate(0) scale(1); }
  35% { transform: rotate(-4deg) scale(0.97); opacity: 0.75; }
  70% { transform: rotate(4deg) scale(0.97); opacity: 0.75; }
  100% { transform: rotate(0) scale(1); opacity: 1; }
}

/* ---------- 底部提示 ---------- */
.foot {
  flex: 0 0 auto;
  display: flex;
  justify-content: center;
  padding: 6px 0 2px;
}

.tip-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1.5px solid rgba(255, 255, 255, 0.9);
  background: rgba(255, 247, 232, 0.8);
  box-shadow: 0 3px 12px rgba(153, 63, 4, 0.13);
  color: #955527;
  font-size: 12px;
  line-height: 1.3;
  text-align: center;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.tip-pill .mp-icon {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  color: #E9792B;
}

/* ---------- 连击与得分飘字 ---------- */
.combo-layer {
  position: fixed;
  inset: 0;
  z-index: 30;
  pointer-events: none;
}

.combo-pop {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  padding: 8px 18px;
  border-radius: 999px;
  border: 2px solid #FFF1DA;
  background: linear-gradient(180deg, #FFB15F 0%, #FF7A20 100%);
  box-shadow: 0 5px 0 rgba(176, 66, 0, 0.3), 0 12px 26px rgba(150, 55, 0, 0.28);
  color: #FFFFFF;
  font-size: 17px;
  font-weight: 900;
  letter-spacing: 0.02em;
  white-space: nowrap;
  animation: comboRise 0.9s cubic-bezier(0.18, 0.9, 0.3, 1) forwards;
}

.combo-pop small {
  margin-left: 6px;
  font-size: 13px;
  color: #FFE7B0;
}

@keyframes comboRise {
  0% { transform: translate(-50%, -30%) scale(0.55); opacity: 0; }
  28% { transform: translate(-50%, -56%) scale(1.08); opacity: 1; }
  70% { transform: translate(-50%, -68%) scale(1); opacity: 1; }
  100% { transform: translate(-50%, -104%) scale(0.94); opacity: 0; }
}

.score-float {
  position: fixed;
  left: 0;
  top: 0;
  transform: translate(-50%, -50%);
  color: #FFFFFF;
  font-size: 17px;
  font-weight: 900;
  text-shadow: 0 2px 0 #E36C16, 0 0 10px rgba(255, 191, 87, 0.9);
  animation: floatUp 0.8s ease-out forwards;
  pointer-events: none;
  white-space: nowrap;
}

@keyframes floatUp {
  0% { opacity: 0; transform: translate(-50%, -30%) scale(0.7); }
  25% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -150%) scale(1.08); }
}

/* ---------- 结束弹层 ---------- */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 20px calc(env(safe-area-inset-bottom, 0px) + 24px);
  overflow-y: auto;
}

.overlay-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(73, 32, 7, 0.58);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  opacity: 0;
  transition: opacity 0.26s ease;
}

.overlay.show .overlay-backdrop { opacity: 1; }

.result-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 356px;
  margin: auto;
  padding: 20px 22px 16px;
  border-radius: 30px;
  border: 3px solid #FFFFFF;
  background: linear-gradient(180deg, #FFFEF9 0%, #FFF1D6 100%);
  box-shadow:
    0 16px 0 rgba(122, 47, 0, 0.16),
    0 30px 64px rgba(52, 18, 0, 0.42),
    inset 0 -4px 0 rgba(227, 158, 95, 0.18);
  text-align: center;
  opacity: 0;
  transform: translateY(20px) scale(0.94);
  transition: transform 0.32s cubic-bezier(0.2, 1.25, 0.4, 1), opacity 0.24s ease;
}

.overlay.show .result-card { opacity: 1; transform: translateY(0) scale(1); }

.result-art {
  position: relative;
  width: 92px;
  height: 92px;
  margin: -52px auto 4px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, #FFF9E8, #FFE3B8);
  border: 3px solid #FFFFFF;
  box-shadow: 0 7px 0 rgba(181, 84, 12, 0.16), 0 12px 24px rgba(154, 61, 3, 0.2);
}

.result-candy {
  width: 64px;
  height: 64px;
  filter: drop-shadow(0 4px 3px rgba(137, 55, 0, 0.2));
  animation: sadWobble 2.8s ease-in-out infinite;
}

@keyframes sadWobble {
  0%, 100% { transform: rotate(-5deg); }
  50% { transform: rotate(5deg); }
}

.result-zzz {
  position: absolute;
  right: -7px;
  top: -4px;
  color: #E9792B;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0.1em;
  transform: rotate(12deg);
}

.result-spark {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #FFD166;
}

.result-spark-a { left: -12px; top: 24px; }
.result-spark-b { right: -16px; bottom: 20px; width: 6px; height: 6px; background: #FFB15F; }
.result-spark-c { left: 6px; bottom: -10px; width: 5px; height: 5px; background: #FF9E8A; }

.result-kicker {
  margin: 6px 0 2px;
  color: #E9792B;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.22em;
}

.result-title {
  margin: 0;
  color: var(--ink);
  font-size: 25px;
  font-weight: 900;
  letter-spacing: 0.01em;
}

.result-sub {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.5;
}

.result-score {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin: 15px 0 14px;
  padding: 9px 16px;
  border-radius: 16px;
  border: 2px dashed #F3C086;
  background: #FFFBF2;
  text-align: left;
}

.result-score span {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.result-score strong {
  color: #F27A20;
  font-size: 27px;
  font-weight: 900;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.btn {
  width: 100%;
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  border: 0;
  border-radius: 18px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.16s ease;
  -webkit-appearance: none;
  appearance: none;
}

.btn .mp-icon { width: 22px; height: 22px; flex: 0 0 auto; }

.btn:active { transform: translateY(2px) scale(0.995); }

.btn:focus { outline: none; }

.btn:focus-visible {
  outline: 3px solid rgba(255, 255, 255, 0.9);
  outline-offset: 3px;
}

.btn-primary {
  border: 2px solid #FFD9B8;
  background: linear-gradient(180deg, #FFAD61 0%, #FF7A1F 100%);
  box-shadow: 0 5px 0 #C95508, 0 12px 22px rgba(190, 75, 0, 0.3);
  color: #FFFFFF;
  text-shadow: 0 1px 0 rgba(140, 55, 0, 0.28);
}

.btn-primary:active { box-shadow: 0 3px 0 #C95508, 0 8px 16px rgba(190, 75, 0, 0.26); }

.btn-primary:disabled {
  cursor: default;
  filter: saturate(0.6) brightness(0.97);
  opacity: 0.88;
  transform: none;
}

.btn-primary.working .mp-icon { animation: spin 1s linear infinite; }

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

.btn-ghost {
  min-height: 42px;
  margin-top: 4px;
  background: transparent;
  color: #A2602F;
  font-size: 14px;
  box-shadow: none;
}

.btn-ghost:active { background: rgba(233, 121, 43, 0.08); }

.revive-hint {
  margin: 8px 0 0;
  color: #B07C55;
  font-size: 11.5px;
  line-height: 1.45;
}

/* ---------- 模拟广告 ---------- */
.ad-shade {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
  background: rgba(42, 19, 7, 0.76);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.ad-card {
  width: 100%;
  max-width: 322px;
  padding: 10px;
  border-radius: 26px;
  border: 2px solid rgba(255, 255, 255, 0.22);
  background: linear-gradient(180deg, #3A2010 0%, #2A160A 100%);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.55);
  animation: adPop 0.28s cubic-bezier(0.2, 1.3, 0.4, 1);
}

@keyframes adPop {
  from { transform: scale(0.9) translateY(14px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}

.ad-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 6px 9px;
  color: #FFE3C2;
}

.ad-tag {
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.14);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.ad-count {
  min-width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  font-size: 13px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.ad-poster {
  position: relative;
  height: 232px;
  overflow: hidden;
  border-radius: 18px;
  background: linear-gradient(180deg, #8FD9FF 0%, #C7ECFF 48%, #FFD9A2 100%);
}

.ad-sun {
  position: absolute;
  top: 22px;
  left: 26px;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 34%, #FFF8C9, #FFC94D 68%, #FFB229);
  box-shadow: 0 0 28px rgba(255, 218, 112, 0.85);
}

.ad-cloud {
  position: absolute;
  height: 15px;
  width: 58px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.9);
}

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

.ad-cloud::before { width: 25px; height: 25px; left: 9px; top: -12px; }
.ad-cloud::after { width: 18px; height: 18px; right: 9px; top: -8px; }
.ad-cloud-a { top: 36px; right: 32px; }
.ad-cloud-b { top: 78px; left: 30px; transform: scale(0.72); opacity: 0.8; }

.ad-hill {
  position: absolute;
  left: -20%;
  bottom: -46px;
  width: 140%;
  height: 130px;
  border-radius: 50% 50% 0 0;
  background: linear-gradient(180deg, #9ADB6B 0%, #63BE45 100%);
}

.ad-candy {
  position: absolute;
  filter: drop-shadow(0 6px 4px rgba(92, 41, 0, 0.22));
}

.ad-candy-a { width: 62px; height: 62px; left: 30px; bottom: 38px; animation: adFloat 3s ease-in-out infinite; }
.ad-candy-b { width: 52px; height: 52px; right: 34px; bottom: 54px; animation: adFloat 3.4s ease-in-out -1.1s infinite; }
.ad-candy-c { width: 44px; height: 44px; left: 50%; margin-left: -22px; bottom: 20px; animation: adFloat 2.6s ease-in-out -0.6s infinite; }

@keyframes adFloat {
  0%, 100% { transform: translateY(0) rotate(-3deg); }
  50% { transform: translateY(-9px) rotate(3deg); }
}

.ad-wording {
  position: absolute;
  left: 0;
  right: 0;
  top: 118px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  color: #6A3513;
}

.ad-wording strong {
  font-size: 24px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-shadow:
    0 2px 0 rgba(255, 255, 255, 0.85),
    0 -1px 0 rgba(255, 255, 255, 0.85),
    2px 0 0 rgba(255, 255, 255, 0.85),
    -2px 0 0 rgba(255, 255, 255, 0.85);
}

.ad-wording span {
  margin-top: 4px;
  font-size: 11px;
  font-weight: 600;
  color: #885026;
}

.ad-progress {
  height: 6px;
  margin: 11px 4px 0;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.16);
}

.ad-progress span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #FFD08A 0%, #FF8A3D 100%);
  transition: width 0.24s linear;
}

.ad-copy {
  margin: 8px 0 2px;
  color: #FFD9B4;
  font-size: 12px;
  text-align: center;
}

/* ---------- 轻提示 ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 88px);
  z-index: 80;
  max-width: 86vw;
  padding: 9px 17px;
  border-radius: 999px;
  background: rgba(74, 34, 10, 0.92);
  box-shadow: 0 8px 22px rgba(49, 18, 0, 0.28);
  color: #FFF6E5;
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
  opacity: 0;
  transform: translateX(-50%) translateY(12px);
  transition: opacity 0.22s ease, transform 0.22s ease;
}

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

/* ---------- 短屏适配 ---------- */
@media (max-height: 680px) {
  .game { padding-top: calc(env(safe-area-inset-top, 0px) + 9px); padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 7px); }
  .hud-card { min-height: 50px; padding: 6px 11px; border-radius: 17px; }
  .hud-icon { width: 29px; height: 29px; border-radius: 10px; }
  .hud-icon .mp-icon { width: 18px; height: 18px; }
  .hud-value { font-size: 21px; margin-top: 4px; }
  .moves-card { min-width: 112px; }
  .board-area { padding: 9px 0 5px; }
  .board-shell { width: min(100%, calc(100vh - 198px), 438px); width: min(100%, calc(100dvh - 198px), 438px); padding: 7px; border-radius: 25px; }
  .board { gap: 2px; padding: 5px; border-radius: 19px; }
  .board-fx { inset: 7px; border-radius: 19px; }
  .foot { padding: 3px 0 0; }
  .tip-pill { padding: 6px 11px; font-size: 11px; }
}

@media (max-width: 350px) {
  .game { padding-left: 12px; padding-right: 12px; }
  .hud-card { gap: 7px; padding: 7px 10px; }
  .moves-card { min-width: 106px; padding-right: 11px; }
  .hud-value { font-size: 21px; }
  .tip-pill { font-size: 10.5px; }
}

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