* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  background: #7fd4f7;
  color: #6b3a14;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
}

button {
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
}

/* ---------------- scenery ---------------- */
.scene {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(95% 55% at 50% -8%, #fff8cf 0%, rgba(255, 248, 207, 0) 48%),
    linear-gradient(180deg, #61cdfb 0%, #85dcff 22%, #c3f1ff 40%, #d9f5c9 52%, #a9dc7a 66%, #e9ca8a 80%, #f4bd7f 100%);
}

.sun {
  position: absolute;
  top: -90px;
  right: -70px;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 249, 190, 0.95) 0%, rgba(255, 241, 160, 0.55) 38%, rgba(255, 238, 150, 0) 70%);
}

.cloud {
  position: absolute;
  height: 30px;
  border-radius: 30px;
  background: #ffffff;
  opacity: 0.82;
  box-shadow: 0 8px 18px rgba(83, 167, 207, 0.12);
}

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

.cloud::before {
  width: 48px;
  height: 48px;
  left: 14px;
  top: -23px;
}

.cloud::after {
  width: 34px;
  height: 34px;
  right: 12px;
  top: -16px;
}

.cloud-a { width: 106px; top: 8%; left: -46px; }
.cloud-b { width: 88px; top: 4%; right: -38px; transform: scale(0.9); opacity: 0.7; }
.cloud-c { width: 72px; top: 19%; right: 18%; transform: scale(0.62); opacity: 0.5; }

.hill {
  position: absolute;
  border-radius: 50% 50% 0 0;
  background: linear-gradient(180deg, #b4e584 0%, #8ac95f 58%, #79b950 100%);
  filter: blur(0.5px);
}

.hill-left {
  width: 78%;
  height: 25%;
  left: -24%;
  bottom: 25%;
  transform: rotate(4deg);
}

.hill-right {
  width: 66%;
  height: 21%;
  right: -22%;
  bottom: 27%;
  background: linear-gradient(180deg, #a8dd79 0%, #7fc056 70%);
  transform: rotate(-5deg);
}

.ground {
  position: absolute;
  left: -14%;
  right: -14%;
  bottom: -5%;
  height: 35%;
  border-radius: 50% 50% 0 0 / 16% 16% 0 0;
  background: linear-gradient(180deg, #f7d69f 0%, #f4c286 34%, #edab68 72%, #e59b56 100%);
  box-shadow: inset 0 8px 24px rgba(255, 243, 203, 0.45);
}

.ground::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -16px;
  height: 40px;
  background:
    radial-gradient(26% 84% at 9% 100%, #8ecb5e 0 68%, rgba(142, 203, 94, 0) 70%),
    radial-gradient(22% 76% at 28% 100%, #9ad569 0 68%, rgba(154, 213, 105, 0) 70%),
    radial-gradient(30% 90% at 52% 100%, #8cc95c 0 68%, rgba(140, 201, 92, 0) 70%),
    radial-gradient(24% 80% at 76% 100%, #9bd76b 0 68%, rgba(155, 215, 107, 0) 70%),
    radial-gradient(28% 86% at 94% 100%, #88c457 0 68%, rgba(136, 196, 87, 0) 70%);
}

.scene::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(95% 68% at 50% 46%, rgba(255, 255, 255, 0) 52%, rgba(63, 109, 45, 0.14) 100%);
}

.deco {
  position: absolute;
  pointer-events: none;
  z-index: 1;
}

.deco-house {
  width: min(54vw, 225px);
  left: -26px;
  bottom: 38px;
  opacity: 0.93;
  filter: saturate(1.03) brightness(1.02);
}

.deco-fence {
  width: min(47vw, 198px);
  right: -34px;
  bottom: 30px;
  opacity: 0.92;
}

/* ---------------- page ---------------- */
.game {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 460px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  padding: max(13px, env(safe-area-inset-top, 0px)) 12px max(10px, env(safe-area-inset-bottom, 0px));
}

/* ---------------- HUD ---------------- */
.hud {
  display: grid;
  grid-template-columns: 1.24fr 0.86fr 1.24fr;
  gap: clamp(5px, 1.7vw, 9px);
  align-items: end;
  padding-top: 9px;
}

.hud-card {
  position: relative;
  min-height: 76px;
  padding: 17px 6px 7px;
  border: 2px solid #e7b274;
  border-radius: 17px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92) 0%, rgba(255, 255, 255, 0) 46%),
    linear-gradient(180deg, #fff9eb 0%, #ffedcd 55%, #f8d8a5 100%);
  box-shadow:
    0 4px 0 #c98a48,
    0 8px 15px rgba(116, 68, 16, 0.2),
    inset 0 2px 0 #ffffff,
    inset 0 -3px 5px rgba(194, 132, 69, 0.16);
  text-align: center;
}

.hud-label {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  min-width: 54px;
  padding: 3px 11px 4px;
  border: 2px solid #ffdba5;
  border-radius: 10px;
  background: linear-gradient(180deg, #ffb766 0%, #ff8a3d 58%, #f0731e 100%);
  box-shadow: 0 2px 0 #b95c16, inset 0 1px 0 rgba(255, 255, 255, 0.5);
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1.5px;
  line-height: 1.25;
  white-space: nowrap;
  text-shadow: 0 1px 2px rgba(146, 63, 5, 0.45);
}

.hud-value {
  display: block;
  color: #6b3a14;
  font-size: clamp(22px, 6vw, 27px);
  font-weight: 900;
  line-height: 1.08;
  letter-spacing: 0.3px;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 2px 0 rgba(255, 255, 255, 0.9), 0 3px 4px rgba(128, 68, 16, 0.18);
}

.moves-card,
.target-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-top: 18px;
}

.moves-card .hud-value {
  margin-top: 0;
  font-size: clamp(26px, 7.4vw, 33px);
  color: #7c4416;
}

.moves-card.low .hud-value {
  color: #d94b2b;
  animation: lowPulse 0.9s ease-in-out infinite;
}

@keyframes lowPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.score-progress {
  position: relative;
  height: 18px;
  margin-top: 3px;
}

.score-track {
  position: absolute;
  left: 2px;
  right: 2px;
  top: 8px;
  height: 7px;
  overflow: hidden;
  border-radius: 7px;
  background: #e4c297;
  box-shadow: inset 0 1px 3px rgba(120, 70, 20, 0.4), 0 1px 0 rgba(255, 255, 255, 0.65);
}

.score-track i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: 7px;
  background: linear-gradient(90deg, #ffe05a 0%, #ffc12e 55%, #ff9c27 100%);
  box-shadow: 0 0 8px rgba(255, 179, 48, 0.8);
  transition: width 0.4s cubic-bezier(0.2, 0.8, 0.3, 1);
}

.score-stars {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  height: 18px;
  margin: 0 -2px;
}

.score-stars svg {
  width: 17px;
  height: 17px;
  margin: 0 -0.5px;
  fill: #e8c9a2;
  stroke: #d0a575;
  stroke-width: 1;
  opacity: 0.9;
  transition: fill 0.25s ease, opacity 0.25s ease, transform 0.25s ease;
}

.score-stars svg.on {
  fill: #ffcb35;
  stroke: #c98411;
  opacity: 1;
  filter: drop-shadow(0 1px 1px rgba(158, 90, 12, 0.45));
  transform: translateY(-1px);
}

.target-value {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  margin-top: 1px;
}

.target-value strong {
  font-size: clamp(20px, 5.4vw, 25px);
}

.target-star {
  width: clamp(17px, 4.8vw, 21px);
  height: clamp(17px, 4.8vw, 21px);
  fill: #ffc83b;
  stroke: #b96e0a;
  stroke-width: 1.2;
  filter: drop-shadow(0 1px 0 #ffffff);
}

/* ---------------- board ---------------- */
.board-area {
  position: relative;
  margin-top: 13px;
}

.board-frame {
  position: relative;
  padding: 6px;
  border: 1px solid #d99b56;
  border-radius: 21px;
  background: linear-gradient(180deg, #ffe9bd 0%, #f9cd8b 34%, #e8ab5c 100%);
  box-shadow:
    0 6px 0 #bd7c39,
    0 13px 22px rgba(111, 63, 12, 0.29),
    inset 0 2px 0 #fff6dd,
    inset 0 -2px 0 rgba(145, 88, 30, 0.28);
}

.board-frame::before,
.board-frame::after {
  content: "";
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #fff3d3;
  box-shadow: inset 0 1px 2px rgba(135, 82, 24, 0.55), 0 0 0 1px rgba(178, 113, 42, 0.5);
}

.board-frame::before {
  left: 10px;
  bottom: 9px;
}

.board-frame::after {
  right: 10px;
  bottom: 9px;
}

.board {
  position: relative;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: clamp(2px, 0.7vw, 4px);
  padding: 5px;
  border-radius: 15px;
  background:
    radial-gradient(120% 90% at 50% 0%, #5b5b64 0%, #45454b 52%, #36363b 100%);
  box-shadow:
    inset 0 5px 11px rgba(0, 0, 0, 0.48),
    inset 0 -2px 0 rgba(255, 255, 255, 0.07);
}

.board.settling .tile img {
  animation: tileDrop 0.24s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}

.board.shuffling {
  animation: shuffleSpin 0.34s ease;
}

@keyframes shuffleSpin {
  0% { transform: scale(1); }
  45% { transform: scale(0.965) rotate(-1.2deg); filter: brightness(1.25); }
  100% { transform: scale(1); filter: brightness(1); }
}

@keyframes tileDrop {
  0% { transform: translateY(-9px) scale(0.94); opacity: 0.65; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}

.tile {
  position: relative;
  display: block;
  width: 100%;
  height: 0;
  padding: 0 0 100%;
  overflow: hidden;
  border: 0;
  border-radius: 9px;
  background: #505057;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    inset 0 -3px 4px rgba(0, 0, 0, 0.28),
    0 1px 0 rgba(0, 0, 0, 0.22);
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
  touch-action: none;
}

.tile img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  -webkit-user-drag: none;
}

.tile.pressed {
  filter: brightness(1.12);
}

.tile.selected {
  z-index: 6;
  transform: scale(1.09);
  box-shadow:
    0 0 0 2px #ffe07a,
    0 0 16px 5px rgba(255, 201, 72, 0.75),
    inset 0 0 12px rgba(255, 236, 160, 0.5);
  filter: brightness(1.12);
}

.tile.selected::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 9px;
  box-shadow: inset 0 0 14px rgba(255, 234, 150, 0.75);
}

.tile.clear {
  z-index: 7;
  animation: tileClear 0.3s cubic-bezier(0.3, 0.7, 0.4, 1) forwards;
}

@keyframes tileClear {
  0% { transform: scale(1); filter: brightness(1); }
  38% { transform: scale(1.18) rotate(4deg); filter: brightness(1.75); }
  100% { transform: scale(0.05) rotate(-9deg); opacity: 0; filter: brightness(2); }
}

.tile.shake {
  animation: tileShake 0.32s ease;
}

@keyframes tileShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-4px) rotate(-2deg); }
  40% { transform: translateX(4px) rotate(2deg); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(2px); }
}

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

@keyframes hintPulse {
  0%, 100% { box-shadow: inset 0 0 0 0 rgba(255, 228, 120, 0); filter: brightness(1); }
  50% { box-shadow: 0 0 0 2px #ffe07a, 0 0 14px 3px rgba(255, 201, 72, 0.6); filter: brightness(1.14); }
}

/* ---------------- effects ---------------- */
.fx-layer {
  position: absolute;
  inset: 0;
  z-index: 12;
  overflow: visible;
  pointer-events: none;
}

.spark {
  position: absolute;
  width: 7px;
  height: 7px;
  margin: -3px 0 0 -3px;
  border-radius: 50%;
  background: #ffe36a;
  box-shadow: 0 0 9px 2px rgba(255, 190, 50, 0.85);
  animation: sparkFly 0.55s cubic-bezier(0.2, 0.7, 0.3, 1) forwards;
}

.spark.blue {
  background: #a8ecff;
  box-shadow: 0 0 9px 2px rgba(96, 207, 255, 0.9);
}

.spark.pink {
  background: #ffb2d0;
  box-shadow: 0 0 9px 2px rgba(255, 105, 160, 0.75);
}

@keyframes sparkFly {
  0% { transform: translate(0, 0) scale(1.15); opacity: 1; }
  100% { transform: translate(var(--tx), var(--ty)) scale(0.1); opacity: 0; }
}

.float-score {
  position: absolute;
  transform: translate(-50%, -50%);
  color: #fff8cf;
  font-size: 19px;
  font-weight: 900;
  letter-spacing: 0.5px;
  white-space: nowrap;
  text-shadow:
    0 2px 0 #a14300,
    0 0 5px rgba(255, 133, 30, 0.9),
    0 4px 8px rgba(60, 20, 0, 0.35);
  animation: floatScore 0.82s cubic-bezier(0.2, 0.8, 0.3, 1) forwards;
}

.float-score.small {
  font-size: 14px;
  color: #fff;
}

@keyframes floatScore {
  0% { transform: translate(-50%, -40%) scale(0.55); opacity: 0; }
  22% { transform: translate(-50%, -72%) scale(1.16); opacity: 1; }
  60% { transform: translate(-50%, -105%) scale(1); opacity: 1; }
  100% { transform: translate(-50%, -160%) scale(0.9); opacity: 0; }
}

.combo-flash {
  position: absolute;
  left: 50%;
  top: 47%;
  z-index: 14;
  transform: translate(-50%, -50%) scale(0.55) rotate(-5deg);
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
}

.combo-flash span {
  display: inline-block;
  color: #ffe15c;
  font-size: clamp(34px, 10.4vw, 48px);
  font-weight: 900;
  letter-spacing: 2px;
  line-height: 1.1;
  -webkit-text-stroke: 2px #a83c00;
  paint-order: stroke fill;
  text-shadow:
    0 4px 0 #c25200,
    0 7px 0 #8e3000,
    0 12px 18px rgba(66, 24, 0, 0.45);
}

.combo-flash b {
  color: #ffffff;
  font-size: 1.12em;
  -webkit-text-stroke: 2px #b43600;
}

.combo-flash.show {
  animation: comboPop 0.9s cubic-bezier(0.2, 1.3, 0.4, 1) forwards;
}

@keyframes comboPop {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.35) rotate(-12deg); }
  22% { opacity: 1; transform: translate(-50%, -50%) scale(1.16) rotate(3deg); }
  48% { opacity: 1; transform: translate(-50%, -50%) scale(1) rotate(-2deg); }
  78% { opacity: 1; transform: translate(-50%, -56%) scale(1.02) rotate(0); }
  100% { opacity: 0; transform: translate(-50%, -78%) scale(0.92) rotate(0); }
}

/* ---------------- combo strip ---------------- */
.combo-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 13px;
  padding: 8px 11px;
  border: 1px solid rgba(224, 168, 98, 0.8);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0) 48%),
    linear-gradient(180deg, rgba(255, 248, 231, 0.97), rgba(255, 236, 202, 0.97));
  box-shadow:
    0 3px 0 rgba(193, 129, 58, 0.28),
    0 6px 14px rgba(112, 63, 10, 0.13);
}

.combo-label {
  flex: none;
  color: #8a5527;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  white-space: nowrap;
}

.combo-track {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 3px;
}

.combo-chip {
  flex: 1;
  padding: 5px 0;
  border: 1px solid #e6c9a0;
  border-radius: 9px;
  background: #f3e2c6;
  color: #b78a5a;
  font-size: 12px;
  font-weight: 900;
  text-align: center;
  transition: transform 0.18s ease, background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.combo-chip.active {
  border-color: #ffdca7;
  background: linear-gradient(180deg, #ffb05d, #ff7a1f);
  box-shadow: 0 2px 0 #c45f12, 0 0 10px rgba(255, 145, 51, 0.45);
  color: #ffffff;
  transform: translateY(-1px);
}

.combo-arrow {
  flex: none;
  color: #c8a67e;
  font-size: 11px;
  font-weight: 900;
}

/* ---------------- footer ---------------- */
.footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding: 18px 4px 2px;
}

.ctrl {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 0;
  border: 0;
  background: none;
  color: #74441c;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1px;
}

.ctrl-bubble {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border: 2px solid #f0be7e;
  border-radius: 50%;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0) 55%),
    linear-gradient(180deg, #fff9ec, #ffe5ba);
  box-shadow:
    0 4px 0 #c98b48,
    0 7px 12px rgba(112, 63, 10, 0.22),
    inset 0 2px 0 #ffffff;
  color: #b4641f;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.ctrl-bubble .mp-icon {
  width: 26px;
  height: 26px;
}

.ctrl:active .ctrl-bubble {
  transform: translateY(3px);
  box-shadow:
    0 1px 0 #c98b48,
    0 3px 6px rgba(112, 63, 10, 0.18),
    inset 0 2px 0 #ffffff;
}

.ctrl-text {
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.9), 0 2px 4px rgba(106, 58, 8, 0.18);
}

.best-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  min-width: 108px;
  padding: 7px 14px 8px;
  border: 1px solid rgba(228, 176, 108, 0.75);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255, 250, 238, 0.96), rgba(255, 233, 199, 0.96));
  box-shadow: 0 3px 0 rgba(190, 126, 54, 0.3), 0 7px 14px rgba(112, 63, 10, 0.15);
}

.best-cap {
  display: flex;
  align-items: center;
  gap: 3px;
  color: #956035;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.5px;
  white-space: nowrap;
}

.best-cap .mp-icon {
  width: 14px;
  height: 14px;
  color: #f2a327;
}

.best-value {
  color: #6b3a14;
  font-size: 21px;
  font-weight: 900;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 2px 0 rgba(255, 255, 255, 0.9);
}

/* ---------------- toast ---------------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(108px + env(safe-area-inset-bottom, 0px));
  z-index: 60;
  max-width: 84vw;
  padding: 9px 17px;
  border: 1px solid rgba(255, 220, 174, 0.35);
  border-radius: 20px;
  background: rgba(75, 42, 16, 0.9);
  box-shadow: 0 6px 18px rgba(50, 24, 4, 0.28);
  color: #fff6e6;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.3px;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 10px);
  transition: opacity 0.22s ease, transform 0.22s ease;
}

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

/* ---------------- result ---------------- */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 20px;
  background: rgba(47, 26, 8, 0.5);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.overlay[hidden] {
  display: none;
}

.result-card {
  position: relative;
  width: 100%;
  max-width: 330px;
  padding: 24px 20px 20px;
  border: 3px solid #ffd9a1;
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0) 30%),
    linear-gradient(180deg, #fffdf6 0%, #ffedcb 66%, #fbd49b 100%);
  box-shadow:
    0 13px 0 #b9762f,
    0 28px 55px rgba(46, 20, 0, 0.5),
    inset 0 2px 0 #ffffff;
  text-align: center;
  opacity: 0;
  transform: translateY(14px) scale(0.95);
  transition: opacity 0.24s ease, transform 0.24s cubic-bezier(0.2, 0.9, 0.3, 1.1);
}

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

.result-badge {
  display: grid;
  width: 84px;
  height: 84px;
  margin: -58px auto 8px;
  place-items: center;
  border: 4px solid #fff4d4;
  border-radius: 50%;
  background: linear-gradient(180deg, #ffe27a 0%, #ffb13d 52%, #ff8a2a 100%);
  box-shadow:
    0 6px 0 #c05f14,
    0 10px 18px rgba(118, 50, 0, 0.3),
    inset 0 3px 0 rgba(255, 255, 255, 0.55);
  color: #ffffff;
}

.result-badge.lose {
  background: linear-gradient(180deg, #c7d9e6 0%, #93b1c7 52%, #7192ab 100%);
  box-shadow:
    0 6px 0 #4f7089,
    0 10px 18px rgba(27, 60, 84, 0.3),
    inset 0 3px 0 rgba(255, 255, 255, 0.55);
}

.result-badge .mp-icon {
  width: 43px;
  height: 43px;
  filter: drop-shadow(0 2px 0 rgba(137, 58, 0, 0.35));
}

.result-title {
  margin: 0 0 4px;
  color: #7a3e12;
  font-size: 26px;
  font-weight: 900;
  letter-spacing: 1px;
  text-shadow: 0 2px 0 #ffffff;
}

.result-sub {
  margin: 0 0 15px;
  color: #a3764b;
  font-size: 12px;
  font-weight: 600;
}

.result-stats {
  display: flex;
  gap: 7px;
  margin-bottom: 17px;
}

.stat {
  flex: 1;
  min-width: 0;
  padding: 8px 3px 7px;
  border: 1px solid #efd2a5;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.62);
  box-shadow: inset 0 1px 0 #ffffff;
}

.stat b {
  display: block;
  overflow: hidden;
  color: #6b3a14;
  font-size: 20px;
  font-weight: 900;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
  text-overflow: ellipsis;
}

.stat span {
  display: block;
  margin-top: 2px;
  color: #a5774e;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.result-btn {
  width: 100%;
  padding: 13px 16px;
  border: 0;
  border-radius: 16px;
  background: linear-gradient(180deg, #ffb35d 0%, #ff8a3d 52%, #ff721a 100%);
  box-shadow:
    0 5px 0 #c45f12,
    0 9px 16px rgba(143, 63, 8, 0.3),
    inset 0 2px 0 rgba(255, 255, 255, 0.42);
  color: #ffffff;
  font-size: 17px;
  font-weight: 900;
  letter-spacing: 2px;
  text-shadow: 0 1px 2px rgba(145, 60, 3, 0.35);
}

.result-btn:active {
  transform: translateY(3px);
  box-shadow:
    0 2px 0 #c45f12,
    0 5px 10px rgba(143, 63, 8, 0.24),
    inset 0 2px 0 rgba(255, 255, 255, 0.42);
}

.confetti {
  position: absolute;
  top: -12px;
  width: 8px;
  height: 12px;
  border-radius: 2px;
  animation: confettiFall var(--dur) linear var(--delay) forwards;
}

@keyframes confettiFall {
  0% { transform: translateY(0) rotate(0); opacity: 1; }
  100% { transform: translateY(105vh) rotate(720deg); opacity: 0.85; }
}

/* ---------------- small screens ---------------- */
@media (max-height: 720px) {
  .game { padding-top: max(10px, env(safe-area-inset-top, 0px)); }
  .hud { padding-top: 8px; }
  .hud-card { min-height: 70px; padding-top: 15px; }
  .board-area { margin-top: 10px; }
  .combo-strip { margin-top: 10px; padding: 7px 10px; }
  .footer { padding-top: 13px; }
  .ctrl-bubble { width: 48px; height: 48px; }
  .best-box { padding: 6px 12px; }
}

@media (max-width: 350px) {
  .combo-label { display: none; }
  .best-box { min-width: 92px; }
  .ctrl-bubble { width: 46px; height: 46px; }
}

@media (prefers-reduced-motion: reduce) {
  .tile,
  .score-track i,
  .combo-chip,
  .result-card {
    transition: none;
  }
  .cloud,
  .combo-flash.show,
  .tile.clear,
  .spark,
  .float-score,
  .confetti {
    animation-duration: 0.01ms;
  }
}
