/* 农场收菜 · 竖屏 H5 游戏 */
:root {
  --orange: #FF8A3D;
  --orange-deep: #E86B20;
  --orange-dark: #C65312;
  --orange-light: #FFB05E;
  --cream: #FFF7E6;
  --cream-deep: #F5E4C3;
  --ink: #3D2B1A;
  --ink-soft: #6F5538;
  --muted: #9A7957;
  --green: #66B93F;
  --green-deep: #3E7F2A;
  --soil: #7A4A2B;
  --shadow-soft: 0 10px 24px rgba(73, 44, 20, .16);
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", sans-serif;
}

* { box-sizing: border-box; }

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

body {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background: #31552a;
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
  touch-action: manipulation;
}

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

.game {
  position: relative;
  width: 100%;
  max-width: 520px;
  height: 100vh;
  height: 100dvh;
  min-height: 540px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  isolation: isolate;
  background: #A8E3EF;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.game::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .2), transparent 15%),
    radial-gradient(130% 65% at 50% 42%, transparent 56%, rgba(43, 95, 29, .14) 100%);
}

.scene {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.scene-svg {
  display: block;
  width: 100%;
  height: 100%;
}

.scene-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .18) 0, transparent 22%),
    linear-gradient(0deg, rgba(43, 89, 27, .18) 0, transparent 14%);
}

.cloud-a { animation: cloudDrift 9s ease-in-out infinite alternate; }
.cloud-b { animation: cloudDrift 12s ease-in-out -4s infinite alternate-reverse; }
.cloud-c { animation: cloudDrift 8s ease-in-out -2s infinite alternate; }

.sun-rays {
  transform-box: fill-box;
  transform-origin: center;
  animation: slowSpin 52s linear infinite;
}

.windmill-blades {
  transform-box: fill-box;
  transform-origin: center;
  animation: slowSpin 24s linear infinite;
}

.butterfly-a .butterfly-anim { animation: butterflyFloat 5s ease-in-out infinite; }
.butterfly-b .butterfly-anim { animation: butterflyFloat 6.4s ease-in-out -2s infinite reverse; }

@keyframes cloudDrift {
  from { transform: translateX(-5px); }
  to { transform: translateX(13px); }
}

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

@keyframes butterflyFloat {
  0%, 100% { transform: translate(0, 0) rotate(-4deg); }
  50% { transform: translate(9px, -9px) rotate(5deg); }
}

/* 顶部 HUD */
.hud {
  position: relative;
  z-index: 30;
  flex: 0 0 auto;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: calc(12px + env(safe-area-inset-top)) 16px 0;
  pointer-events: none;
}

.hud-score {
  display: flex;
  align-items: center;
  gap: 9px;
  height: 54px;
  padding: 7px 14px 7px 8px;
  border-radius: 20px;
  background: rgba(255, 249, 233, .95);
  border: 1.5px solid rgba(255, 255, 255, .92);
  box-shadow: 0 5px 0 rgba(110, 72, 34, .13), 0 12px 24px rgba(39, 66, 26, .16);
  -webkit-backdrop-filter: blur(9px);
  backdrop-filter: blur(9px);
}

.hud-score-icon {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(145deg, #FFB24D 0%, #FF7B2D 100%);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .38), 0 3px 0 #D45A17;
}

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

.hud-score-copy {
  display: flex;
  flex-direction: column;
  gap: 1px;
  white-space: nowrap;
}

.hud-score-copy > span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .08em;
  line-height: 1.2;
}

.hud-score-copy b {
  color: var(--ink);
  font-size: 21px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}

.hud-score-copy small {
  margin-left: 2px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.hud-score.is-bump {
  animation: scoreBump .32s cubic-bezier(.2, 1.7, .4, 1);
}

@keyframes scoreBump {
  0% { transform: scale(1); }
  45% { transform: scale(1.06); }
  100% { transform: scale(1); }
}

.hud-timer {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-width: 106px;
  height: 54px;
  padding: 0 13px 7px 12px;
  overflow: hidden;
  border-radius: 20px;
  color: #fff;
  background: linear-gradient(145deg, #FFA447 0%, #FF762A 100%);
  border: 1.5px solid rgba(255, 255, 255, .5);
  box-shadow: 0 5px 0 #C85313, 0 12px 22px rgba(105, 51, 13, .21), inset 0 2px 0 rgba(255, 255, 255, .3);
}

.hud-timer::after {
  content: "";
  position: absolute;
  left: -20px;
  top: -26px;
  width: 88px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .18);
  transform: rotate(-18deg);
  pointer-events: none;
}

.hud-timer .mp-icon {
  width: 18px;
  height: 18px;
  opacity: .92;
}

.hud-timer b {
  position: relative;
  z-index: 1;
  min-width: 32px;
  color: #fff;
  font-size: 24px;
  font-weight: 900;
  line-height: 1.05;
  text-align: center;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 2px 0 rgba(146, 58, 8, .3);
}

.hud-timer > span:not(.timer-track) {
  position: relative;
  z-index: 1;
  font-size: 10px;
  font-weight: 800;
  opacity: .9;
}

.timer-track {
  position: absolute;
  z-index: 2;
  left: 12px;
  right: 12px;
  bottom: 6px;
  height: 4px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(112, 43, 6, .32);
}

.timer-track i {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #FFF4B0, #FFFFFF);
  transform: scaleX(1);
  transform-origin: 0 50%;
  transition: transform .12s linear;
}

.hud-timer.is-low {
  background: linear-gradient(145deg, #FF7358, #E93B2C);
  box-shadow: 0 5px 0 #A9291D, 0 12px 22px rgba(110, 25, 16, .25), inset 0 2px 0 rgba(255, 255, 255, .25);
  animation: timerAlarm 1s ease-in-out infinite;
}

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

/* 主菜地 */
.play {
  position: relative;
  z-index: 10;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px 2px;
}

.field-board {
  position: relative;
  width: 100%;
  max-width: 430px;
  padding: 14px 12px;
  border-radius: 30px;
  border: 4px solid #D89A5E;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, .16), transparent 35%),
    repeating-linear-gradient(99deg, #A86B3B 0 13px, #9B5F34 13px 17px, #A36739 17px 31px);
  box-shadow:
    inset 0 0 0 3px #7C4927,
    inset 0 3px 0 rgba(255, 255, 255, .26),
    0 13px 0 rgba(76, 43, 20, .3),
    0 25px 38px rgba(37, 51, 19, .26);
}

.field-board::before {
  content: "";
  position: absolute;
  inset: 7px;
  z-index: 1;
  border: 1.5px dashed rgba(255, 229, 181, .28);
  border-radius: 23px;
  pointer-events: none;
}

.field-board::after {
  content: "";
  position: absolute;
  inset: 8px;
  z-index: 0;
  border-radius: 22px;
  pointer-events: none;
  background:
    radial-gradient(circle at 12% 18%, rgba(60, 31, 13, .17) 0 2px, transparent 2.5px),
    radial-gradient(circle at 76% 72%, rgba(255, 224, 177, .11) 0 1.6px, transparent 2px);
  background-size: 44px 40px, 61px 57px;
  opacity: .85;
}

.field {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.bolt {
  position: absolute;
  z-index: 5;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 28%, #FFE0AA 0 22%, #B87A43 50%, #643A1D 100%);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .32), inset 0 1px 1px rgba(0, 0, 0, .42);
}

.bolt-a { left: 9px; top: 9px; }
.bolt-b { right: 9px; top: 9px; }
.bolt-c { left: 9px; bottom: 9px; }
.bolt-d { right: 9px; bottom: 9px; }

.board-tuft {
  position: absolute;
  z-index: 3;
  bottom: -12px;
  width: 54px;
  height: 25px;
  pointer-events: none;
  background:
    radial-gradient(ellipse 6px 15px at 12% 80%, #5BA83A 0 70%, transparent 72%),
    radial-gradient(ellipse 7px 21px at 33% 78%, #72C34B 0 70%, transparent 72%),
    radial-gradient(ellipse 6px 16px at 55% 84%, #509C32 0 70%, transparent 72%),
    radial-gradient(ellipse 7px 22px at 76% 80%, #68B845 0 70%, transparent 72%),
    radial-gradient(ellipse 5px 13px at 92% 86%, #7AC951 0 70%, transparent 72%);
}

.tuft-a { left: 24px; }
.tuft-b { right: 24px; transform: scaleX(-1); }

/* 地块按钮 */
.plot {
  position: relative;
  display: block;
  width: 100%;
  height: clamp(88px, 12.4vh, 112px);
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  overflow: visible;
  touch-action: manipulation;
  transition: transform .08s ease;
}

.plot:active {
  transform: translateY(2px) scale(.988);
}

.plot:focus-visible {
  outline: 3px solid #FFF3A8;
  outline-offset: 3px;
  border-radius: 22px;
}

.plot-surface {
  position: absolute;
  left: 2%;
  right: 2%;
  bottom: 5%;
  height: 58%;
  border-radius: 50% 50% 24px 24px / 35% 35% 24px 24px;
  background: linear-gradient(180deg, #B47848 0%, #915A34 52%, #6F4125 100%);
  border: 2.5px solid #C98D55;
  box-shadow:
    inset 0 4px 0 rgba(255, 222, 173, .2),
    inset 0 -9px 12px rgba(57, 30, 14, .26),
    0 5px 0 #53301B,
    0 9px 12px rgba(51, 29, 14, .24);
  transition: border-color .2s, box-shadow .2s;
}

.plot-surface::before {
  content: "";
  position: absolute;
  left: 8%;
  right: 8%;
  top: 9%;
  bottom: 18%;
  border-radius: 50%;
  background: repeating-linear-gradient(180deg, transparent 0 10px, rgba(61, 32, 16, .29) 10px 12px);
  opacity: .55;
  transform: scaleY(.92);
}

.soil-face {
  position: absolute;
  left: 9%;
  right: 9%;
  top: 5%;
  height: 28%;
  border-radius: 50%;
  background: linear-gradient(180deg, #C18450 0%, #A4673A 100%);
  box-shadow: inset 0 3px 4px rgba(255, 225, 180, .16), 0 2px 2px rgba(65, 34, 16, .22);
}

.soil-shine {
  position: absolute;
  left: 13%;
  top: 11%;
  width: 26%;
  height: 13%;
  border-radius: 50%;
  background: rgba(255, 226, 178, .18);
  filter: blur(2px);
}

.plot.is-empty .plot-surface {
  background: linear-gradient(180deg, #A66E43 0%, #83502E 55%, #663B21 100%);
  border-color: #BC7E49;
}

.plot.is-growing .plot-surface {
  border-color: #C48B52;
}

.plot.is-ripe .plot-surface {
  border-color: #FFD16B;
  box-shadow:
    inset 0 4px 0 rgba(255, 234, 184, .28),
    inset 0 -9px 12px rgba(57, 30, 14, .23),
    0 5px 0 #6D451F,
    0 0 0 4px rgba(255, 214, 101, .16),
    0 0 24px rgba(255, 211, 89, .5);
}

.plot.is-ripe::before {
  content: "";
  position: absolute;
  z-index: 2;
  left: 50%;
  top: 39%;
  width: 88%;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  background: radial-gradient(circle, rgba(255, 242, 152, .58) 0%, rgba(255, 217, 89, .22) 43%, transparent 69%);
  animation: readyGlow 1.9s ease-in-out infinite;
}

@keyframes readyGlow {
  0%, 100% { opacity: .55; transform: translate(-50%, -50%) scale(.9); }
  50% { opacity: 1; transform: translate(-50%, -50%) scale(1.08); }
}

/* 作物 */
.crop-stage {
  position: absolute;
  z-index: 3;
  left: 50%;
  bottom: 33%;
  width: 67%;
  height: 73%;
  transform: translateX(-50%) translateY(var(--y, 0px)) scale(var(--s, 1));
  transform-origin: 50% 100%;
  opacity: var(--o, 1);
  pointer-events: none;
  will-change: transform;
}

.crop-svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
  filter: drop-shadow(0 5px 3px rgba(62, 32, 14, .24));
}

.plot.is-empty .crop-stage { display: none; }

.plot.is-ripe .crop-svg {
  animation: veggieBreath 2.3s ease-in-out infinite;
  transform-origin: 50% 100%;
  filter: drop-shadow(0 6px 4px rgba(62, 32, 14, .25)) drop-shadow(0 0 10px rgba(255, 226, 117, .75));
}

@keyframes veggieBreath {
  0%, 100% { transform: translateY(0) rotate(-1.2deg); }
  50% { transform: translateY(-4px) rotate(1.2deg); }
}

.plot.is-popping .crop-svg {
  opacity: 0;
  transform: translateY(-7px) scale(1.2) rotate(5deg);
  transition: opacity .16s ease, transform .2s ease;
}

.plot.is-wiggle .crop-svg {
  animation: cropWiggle .34s ease;
}

.plot.is-planted .crop-svg {
  animation: plantPop .35s cubic-bezier(.2, 1.5, .4, 1);
}

@keyframes cropWiggle {
  0%, 100% { transform: rotate(0); }
  25% { transform: rotate(-5deg); }
  70% { transform: rotate(4deg); }
}

@keyframes plantPop {
  0% { transform: translateY(10px) scale(.72); opacity: .3; }
  65% { transform: translateY(-2px) scale(1.06); opacity: 1; }
  100% { transform: none; }
}

/* 空地提示 */
.empty-mark {
  position: absolute;
  z-index: 5;
  left: 50%;
  bottom: 35%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  opacity: 0;
  transform: translateX(-50%) scale(.85);
  transition: opacity .18s, transform .18s;
  pointer-events: none;
}

.plot.is-empty .empty-mark {
  opacity: 1;
  transform: translateX(-50%) scale(1);
}

.empty-mark .mp-icon {
  width: 28px;
  height: 28px;
  padding: 5px;
  color: #FFE4B2;
  border: 1.5px dashed rgba(255, 228, 178, .65);
  border-radius: 50%;
  background: rgba(70, 40, 20, .18);
}

.empty-mark em {
  padding: 2px 7px;
  border-radius: 99px;
  color: #FFE8BC;
  background: rgba(50, 28, 14, .34);
  border: 1px solid rgba(255, 228, 178, .18);
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
  letter-spacing: .1em;
  line-height: 1.25;
  text-shadow: 0 1px 2px rgba(59, 29, 10, .55);
}

/* 生长进度 */
.growth-badge {
  position: absolute;
  z-index: 6;
  top: 7%;
  right: 8%;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: conic-gradient(#8DDD60 var(--a, 0deg), rgba(47, 75, 30, .46) 0);
  box-shadow: 0 2px 0 rgba(48, 29, 14, .28), 0 0 0 2px rgba(255, 244, 214, .38);
  opacity: 0;
  transform: scale(.7);
  transition: opacity .18s, transform .18s;
  pointer-events: none;
}

.growth-badge::before {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: #5B3A22;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, .35);
}

.growth-badge b {
  position: relative;
  z-index: 1;
  color: #FFF3D2;
  font-size: 9px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}

.plot.is-growing .growth-badge {
  opacity: 1;
  transform: scale(1);
}

/* 成熟角标 */
.ready-badge {
  position: absolute;
  z-index: 7;
  top: 2%;
  right: 7%;
  display: grid;
  place-items: center;
  width: 29px;
  height: 29px;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(145deg, #FFB63C 0%, #FF7428 100%);
  box-shadow: 0 3px 0 #C65314, 0 0 0 3px rgba(255, 248, 224, .78);
  font-size: 14px;
  font-weight: 900;
  line-height: 1;
  opacity: 0;
  transform: scale(.4) rotate(-12deg);
  transition: opacity .18s, transform .2s cubic-bezier(.2, 1.6, .4, 1);
  pointer-events: none;
}

.plot.is-ripe .ready-badge {
  opacity: 1;
  transform: scale(1) rotate(0);
  animation: badgePulse 1.7s ease-in-out infinite;
}

@keyframes badgePulse {
  0%, 100% { transform: scale(1) rotate(0); }
  50% { transform: scale(1.08) rotate(3deg); }
}

.ready-sparks {
  position: absolute;
  z-index: 4;
  left: 50%;
  top: 45%;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.plot.is-ripe .ready-sparks {
  opacity: 1;
}

.ready-sparks::before,
.ready-sparks::after {
  content: "";
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #FFF9C9;
  box-shadow:
    23px -27px 0 0 #FFF8C9,
    -28px -9px 0 0 #FFE47A,
    32px 14px 0 0 #FFF6BC,
    -20px 30px 0 0 #FFE47A;
  animation: sparkle 1.8s ease-in-out infinite;
}

.ready-sparks::after {
  width: 3px;
  height: 3px;
  animation-delay: -1s;
  opacity: .7;
  box-shadow:
    17px 26px 0 0 #FFF8C9,
    -31px 18px 0 0 #FFE47A,
    39px -16px 0 0 #FFF6BC,
    -10px -30px 0 0 #FFE47A;
}

@keyframes sparkle {
  0%, 100% { opacity: .25; transform: scale(.7) rotate(0); }
  50% { opacity: 1; transform: scale(1.18) rotate(18deg); }
}

/* 连收 */
.combo-pill {
  position: absolute;
  z-index: 20;
  left: 50%;
  top: -17px;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 13px 7px;
  border-radius: 999px;
  border: 2px solid #fff;
  color: #C54812;
  background: linear-gradient(145deg, #FFF7D9, #FFD46A);
  box-shadow: 0 5px 0 #C66A22, 0 10px 19px rgba(95, 45, 10, .2);
  opacity: 0;
  transform: translate(-50%, 8px) scale(.78);
  transition: opacity .18s, transform .2s cubic-bezier(.2, 1.5, .4, 1);
  pointer-events: none;
}

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

.combo-pill span {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
}

.combo-pill b {
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
}

/* 开始提示 */
.start-tip {
  position: absolute;
  z-index: 28;
  left: 50%;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .18);
  color: #FFF4D8;
  background: rgba(58, 40, 22, .83);
  box-shadow: 0 8px 20px rgba(40, 35, 15, .25);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .02em;
  white-space: nowrap;
  transform: translateX(-50%);
  transition: opacity .25s, transform .25s, visibility .25s;
  pointer-events: none;
  animation: tipFloat 2s ease-in-out infinite;
}

.start-tip .mp-icon {
  width: 18px;
  height: 18px;
  color: #FFCF66;
}

.start-tip.is-hidden {
  visibility: hidden;
  opacity: 0;
  transform: translate(-50%, 10px);
}

@keyframes tipFloat {
  0%, 100% { margin-bottom: 0; }
  50% { margin-bottom: 4px; }
}

/* 底部菜筐 */
.dock {
  position: relative;
  z-index: 20;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 16px calc(10px + env(safe-area-inset-bottom));
  padding: 10px 14px 10px 10px;
  border-radius: 22px;
  border: 1.5px solid rgba(255, 255, 255, .86);
  background: linear-gradient(145deg, rgba(255, 251, 240, .97), rgba(255, 241, 216, .94));
  box-shadow: 0 7px 0 rgba(112, 72, 34, .17), 0 16px 28px rgba(45, 58, 22, .2);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.basket-figure {
  width: 58px;
  height: 50px;
  flex: 0 0 auto;
  filter: drop-shadow(0 3px 2px rgba(88, 51, 21, .18));
}

.basket-figure svg {
  display: block;
  width: 100%;
  height: 100%;
}

.dock-copy {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
}

.dock-copy > span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .06em;
  line-height: 1.2;
}

.dock-copy b {
  color: var(--ink);
  font-size: 22px;
  font-weight: 900;
  line-height: 1.08;
  font-variant-numeric: tabular-nums;
}

.dock-copy small {
  margin-left: 2px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.dock-best {
  display: flex;
  align-items: baseline;
  gap: 1px;
  margin-left: auto;
  padding-left: 12px;
  border-left: 1px dashed rgba(154, 121, 87, .31);
  color: var(--muted);
}

.dock-best span {
  margin-right: 2px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .08em;
}

.dock-best b {
  color: #5B4129;
  font-size: 16px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.dock-best small {
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
}

/* 粒子层 */
.fx-layer {
  position: absolute;
  inset: 0;
  z-index: 55;
  overflow: hidden;
  pointer-events: none;
}

.float-score {
  position: absolute;
  z-index: 2;
  color: #FFF8D6;
  font-size: 19px;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
  transform: translate(-50%, -50%);
  text-shadow: 0 2px 0 #D9641C, 0 0 12px rgba(255, 211, 95, .62);
  animation: floatScore .95s ease-out forwards;
}

.float-score small {
  margin-left: 1px;
  color: #FFE9A7;
  font-size: 9px;
}

@keyframes floatScore {
  0% { opacity: 0; transform: translate(-50%, -30%) scale(.65); }
  18% { opacity: 1; transform: translate(-50%, -55%) scale(1.1); }
  100% { opacity: 0; transform: translate(-50%, -155%) scale(.92); }
}

.fx-leaf {
  position: absolute;
  z-index: 1;
  width: 7px;
  height: 11px;
  border-radius: 100% 0 100% 0;
  background: #7CCB4A;
  transform: translate(-50%, -50%) rotate(var(--r, 0deg));
  animation: leafBurst .8s ease-out forwards;
}

.fx-leaf.alt { background: #FFB254; }

.fx-spark {
  position: absolute;
  z-index: 1;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #FFE071;
  box-shadow: 0 0 8px rgba(255, 215, 90, .9);
  transform: translate(-50%, -50%);
  animation: sparkBurst .72s ease-out forwards;
}

.fx-ring {
  position: absolute;
  width: 70px;
  height: 70px;
  border: 3px solid rgba(255, 236, 142, .9);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  animation: ringOut .6s ease-out forwards;
}

@keyframes leafBurst {
  0% { opacity: 1; transform: translate(-50%, -50%) rotate(var(--r, 0deg)) scale(.6); }
  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--dx, 0px)), calc(-50% + var(--dy, -40px))) rotate(calc(var(--r, 0deg) + 190deg)) scale(1);
  }
}

@keyframes sparkBurst {
  0% { opacity: 1; transform: translate(-50%, -50%) scale(.45); }
  100% { opacity: 0; transform: translate(calc(-50% + var(--dx, 0px)), calc(-50% + var(--dy, -35px))) scale(.1); }
}

@keyframes ringOut {
  0% { opacity: .9; transform: translate(-50%, -50%) scale(.4); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.45); }
}

/* 结算 */
.result {
  position: absolute;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow-y: auto;
  background: rgba(31, 45, 20, .56);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity .26s ease;
}

.result[hidden] { display: none; }

.result.is-open { opacity: 1; }

.result-card {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 336px;
  padding: 26px 22px calc(20px + env(safe-area-inset-bottom) * .4);
  border-radius: 30px;
  border: 2px solid #FFF;
  background:
    radial-gradient(circle at 16% 8%, rgba(255, 229, 163, .42), transparent 30%),
    linear-gradient(180deg, #FFFDF6 0%, #FFF4DC 100%);
  box-shadow: 0 22px 54px rgba(22, 33, 12, .38), 0 0 0 6px rgba(255, 255, 255, .12);
  text-align: center;
  transform: translateY(26px) scale(.94);
  transition: transform .36s cubic-bezier(.22, 1.35, .36, 1);
}

.result.is-open .result-card { transform: none; }

.result-card::before {
  content: "";
  position: absolute;
  inset: 9px;
  z-index: -1;
  border-radius: 23px;
  border: 1px solid rgba(225, 200, 157, .45);
  pointer-events: none;
}

.result-medal {
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  margin: -60px auto 8px;
  border-radius: 50%;
  border: 5px solid #FFF8E8;
  color: #fff;
  background: linear-gradient(145deg, #FFDD68 0%, #FF9A2F 100%);
  box-shadow: 0 8px 0 #D66A20, 0 14px 24px rgba(101, 56, 13, .24);
}

.result-medal .mp-icon {
  width: 38px;
  height: 38px;
  filter: drop-shadow(0 2px 0 rgba(149, 58, 8, .25));
}

.result-stars {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  height: 28px;
  margin-top: 1px;
}

.result-stars .mp-icon {
  width: 28px;
  height: 28px;
  color: #FFC83C;
  filter: drop-shadow(0 2px 0 rgba(196, 118, 23, .18));
}

.result-stars .is-off {
  color: #E5D5B8;
  filter: none;
}

.result-kicker {
  margin: 5px 0 4px;
  color: #E4782A;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .18em;
}

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

.result-score {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 3px;
  margin: 5px 0 15px;
  color: #E4661C;
}

.result-score b {
  font-size: 48px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -.04em;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 3px 0 #FFD896;
}

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

.result-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
}

.result-stats > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 9px 8px;
  border-radius: 14px;
  border: 1px solid #F0DFC0;
  background: #F9EDD5;
}

.result-stats span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.result-stats b {
  color: #493521;
  font-size: 16px;
  font-weight: 900;
}

.result-stats strong {
  font-size: 20px;
  font-variant-numeric: tabular-nums;
}

.result-best {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.result-best b {
  color: #5B4129;
  font-weight: 900;
}

.result-best em {
  display: none;
  margin-left: 4px;
  padding: 2px 6px;
  border-radius: 99px;
  color: #fff;
  background: var(--orange);
  font-size: 9px;
  font-style: normal;
  font-weight: 800;
}

.result-best em.show { display: inline-block; }

.replay-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 100%;
  height: 52px;
  border: 0;
  border-radius: 18px;
  color: #fff;
  background: linear-gradient(145deg, #FFA146 0%, #FF7428 100%);
  box-shadow: 0 5px 0 #C75514, 0 10px 20px rgba(150, 66, 17, .25), inset 0 2px 0 rgba(255, 255, 255, .3);
  font-size: 16px;
  font-weight: 900;
  letter-spacing: .04em;
  cursor: pointer;
  transition: transform .08s ease, box-shadow .08s ease;
}

.replay-btn:focus {
  outline: none;
}

.replay-btn:focus-visible {
  outline: 3px solid #FFE196;
  outline-offset: 3px;
}

.replay-btn:active {
  transform: translateY(4px);
  box-shadow: 0 1px 0 #C75514, 0 4px 10px rgba(150, 66, 17, .2);
}

.replay-btn .mp-icon {
  width: 20px;
  height: 20px;
}

.confetti {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.confetti i {
  position: absolute;
  top: -20px;
  left: var(--x);
  width: 7px;
  height: 12px;
  border-radius: 2px;
  background: var(--c);
  transform: rotate(var(--r));
  animation: confettiFall var(--d) linear forwards;
  animation-delay: var(--delay, 0s);
}

@keyframes confettiFall {
  to {
    transform: translateY(110vh) rotate(560deg);
    opacity: .25;
  }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.svg-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

/* 较矮屏幕 */
@media (max-height: 740px) {
  .hud { padding-top: calc(9px + env(safe-area-inset-top)); }
  .hud-score, .hud-timer { height: 48px; }
  .hud-score-icon { width: 34px; height: 34px; border-radius: 12px; }
  .hud-score-copy b { font-size: 19px; }
  .hud-timer b { font-size: 22px; }
  .play { padding-top: 5px; }
  .field-board { padding: 11px 10px; border-radius: 26px; }
  .plot { height: clamp(84px, 12.2vh, 100px); }
  .field { gap: 8px; }
  .dock { padding: 8px 12px 8px 8px; margin-bottom: calc(7px + env(safe-area-inset-bottom)); }
  .basket-figure { width: 50px; height: 44px; }
  .dock-copy b { font-size: 20px; }
  .start-tip { padding: 7px 12px; font-size: 11px; }
}

@media (max-height: 640px) {
  .game { min-height: 500px; }
  .hud-score-copy > span { display: none; }
  .hud-score { height: 44px; padding-right: 11px; }
  .hud-timer { height: 44px; min-width: 96px; }
  .plot { height: 78px; }
  .field-board { border-radius: 24px; }
  .field { gap: 7px; }
  .dock { margin-bottom: calc(5px + env(safe-area-inset-bottom)); }
  .basket-figure { width: 44px; height: 40px; }
  .dock-best { display: none; }
  .start-tip { font-size: 10px; }
}

@media (min-width: 540px) {
  .game {
    border-left: 1px solid rgba(255, 255, 255, .16);
    border-right: 1px solid rgba(255, 255, 255, .16);
    box-shadow: 0 0 70px rgba(0, 0, 0, .35);
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
  .crop-stage, .result-card, .start-tip, .combo-pill { transition-duration: .01ms; }
}
