@font-face{
  font-family:'FarmNum';
  src:url('../fonts/Fredoka-latin.woff2') format('woff2');
  font-weight:300 700;
  font-style:normal;
  font-display:swap;
}
@font-face{
  font-family:'FarmCN';
  src:url('../fonts/ZCOOLKuaiLe-Regular.ttf') format('truetype');
  font-weight:400 900;
  font-style:normal;
  font-display:swap;
}
/* ============ 基础 ============ */
:root{
  --sat: max(env(safe-area-inset-top, 0px), 16px);
  --sab: max(env(safe-area-inset-bottom, 0px), 8px);
  --cream: #fff9e8;
  --cream-2: #fff1c9;
  --brown: #6b3d1b;
  --brown-2: #99602d;
  --green: #4f9e35;
  --green-dark: #2f7723;
  --gold: #ffc12e;
  --gold-deep: #e18d10;
}
*{box-sizing:border-box; -webkit-tap-highlight-color:transparent;}
html,body{height:100%;margin:0;padding:0;overflow:hidden;}
body{
  background:
    radial-gradient(circle at 50% 10%, #4f7d3b 0%, #2b4b23 55%, #1c3218 100%);
  font-family:"FarmNum","FarmCN","PingFang SC","Hiragino Sans GB","Noto Sans CJK SC","Source Han Sans SC","Microsoft YaHei",system-ui,-apple-system,sans-serif;
  color:var(--brown);
  display:flex;align-items:center;justify-content:center;
  user-select:none;-webkit-user-select:none;
  touch-action:none;
}
body::before{
  content:"";position:fixed;inset:0;pointer-events:none;opacity:.18;
  background-image:radial-gradient(rgba(255,255,255,.8) 1px, transparent 1px);
  background-size:26px 26px;
}
button{font-family:inherit;border:0;background:none;padding:0;cursor:pointer;color:inherit;touch-action:manipulation;}
.hidden{display:none !important;}

#app{
  position:relative;
  width:min(100vw, 680px, 62dvh);
  height:100vh;
  height:100dvh;
  max-height:100dvh;
  overflow:hidden;
  background:#8ed4ff;
  isolation:isolate;
  box-shadow:0 30px 80px rgba(0,0,0,.45);
}
@media (min-width:601px) and (min-height:760px){
  #app{border-radius:26px;}
}
#scene{position:absolute;inset:0;width:100%;height:100%;display:block;}

.screen{position:absolute;inset:0;z-index:5;pointer-events:none;}
.screen > *{pointer-events:auto;}

/* ============ 通用图标/按钮 ============ */
.icon{width:22px;height:22px;display:block;flex:none;}
.icon.coin{width:27px;height:27px;filter:drop-shadow(0 2px 1px rgba(140,80,0,.2));}
.icon.tiny{width:16px;height:16px;}
.round-btn{
  width:42px;height:42px;border-radius:50%;
  display:flex;align-items:center;justify-content:center;
  color:#8a5b2c;
  background:linear-gradient(180deg,#fffdf2,#ffedc4);
  border:2px solid #fff;
  box-shadow:0 4px 0 rgba(128,84,37,.22), 0 8px 14px rgba(60,45,10,.14), inset 0 2px 0 #fff;
  transition:transform .09s ease, box-shadow .09s ease;
}
.round-btn:active{transform:translateY(3px);box-shadow:0 1px 0 rgba(128,84,37,.22), inset 0 2px 0 #fff;}
.round-btn svg{width:21px;height:21px;}
.mute-btn .sound-off{display:none;}
.mute-btn.muted .sound-on{display:none;}
.mute-btn.muted .sound-off{display:block;}

.btn{
  position:relative;display:flex;align-items:center;justify-content:center;gap:10px;
  border-radius:999px;font-weight:900;letter-spacing:.5px;
  transition:transform .09s ease, box-shadow .09s ease, filter .15s ease;
  width:100%;
}
.btn-primary{
  color:#7a3c08;
  background:
    linear-gradient(180deg, rgba(255,255,255,.55) 0%, rgba(255,255,255,0) 38%),
    linear-gradient(180deg,#ffe467 0%, #ffc42f 48%, #ffa314 100%);
  border:3px solid #fff4bd;
  box-shadow:
    0 7px 0 #c97610,
    0 14px 24px rgba(112,64,4,.32),
    inset 0 2px 0 rgba(255,255,255,.85),
    inset 0 -6px 10px rgba(212,124,8,.28);
  text-shadow:0 1px 0 rgba(255,248,190,.9);
}
.btn-primary::after{
  content:"";position:absolute;inset:4px;border-radius:999px;
  border:1.5px solid rgba(255,255,255,.38);pointer-events:none;
}
.btn-primary:active{transform:translateY(5px);box-shadow:0 2px 0 #c97610, 0 6px 12px rgba(112,64,4,.3), inset 0 2px 0 rgba(255,255,255,.8);}
.btn-ghost{
  height:48px;color:#8a5a2b;font-size:15px;font-weight:800;
  background:rgba(255,255,255,.42);border:2px solid rgba(153,96,45,.25);
}
.btn-ghost:active{transform:translateY(2px);background:rgba(255,255,255,.62);}

/* ============ 开始界面 ============ */
.start-screen{padding:0 14px;}
.start-top{
  position:absolute;top:calc(var(--sat) + 10px);left:14px;right:14px;
  display:flex;align-items:center;gap:8px;
}
.profile-pill{
  flex:1 1 auto;max-width:186px;min-width:132px;
  height:52px;padding:5px 10px 5px 5px;border-radius:999px;
  display:flex;align-items:center;gap:7px;
  background:linear-gradient(180deg,rgba(255,253,243,.97),rgba(255,239,201,.96));
  border:2px solid #fff;
  box-shadow:0 4px 0 rgba(132,86,36,.18), 0 9px 18px rgba(64,84,26,.16), inset 0 2px 0 #fff;
}
.avatar{
  width:41px;height:41px;border-radius:50%;flex:none;overflow:hidden;
  background:linear-gradient(180deg,#bfe8ff,#7fc8ee);
  border:2px solid #fff;
  box-shadow:inset 0 -3px 6px rgba(30,90,140,.18);
  display:flex;align-items:center;justify-content:center;
}
.avatar svg{width:34px;height:34px;}
.profile-meta{flex:1;min-width:0;display:flex;flex-direction:column;gap:3px;}
.profile-line{display:flex;align-items:center;gap:4px;}
.profile-line b{font-size:14px;line-height:1;color:#7a4518;font-weight:900;white-space:nowrap;}
.tiny-leaf{width:9px;height:9px;background:#7cc242;border-radius:0 70% 0 70%;transform:rotate(-18deg);box-shadow:inset -1px -1px 0 rgba(0,0,0,.12);}
.exp-bar{height:7px;border-radius:99px;background:#e6d3a8;overflow:hidden;box-shadow:inset 0 1px 2px rgba(110,70,20,.25);}
.exp-bar i{display:block;height:100%;width:0%;border-radius:99px;background:linear-gradient(90deg,#9fdc4f,#65b52c);box-shadow:inset 0 1px 0 rgba(255,255,255,.6);transition:width .35s ease;}
.coin-pill{
  flex:none;height:46px;padding:0 12px 0 6px;border-radius:999px;
  display:flex;align-items:center;gap:3px;
  background:linear-gradient(180deg,rgba(255,253,243,.97),rgba(255,239,201,.96));
  border:2px solid #fff;
  box-shadow:0 4px 0 rgba(132,86,36,.18), 0 9px 18px rgba(64,84,26,.16), inset 0 2px 0 #fff;
}
.coin-pill span{font-size:16px;font-weight:900;color:#7a4518;font-variant-numeric:tabular-nums;letter-spacing:.2px;max-width:78px;overflow:hidden;text-overflow:ellipsis;}
.mute-btn{width:44px;height:44px;flex:none;}

/* 标题 */
.start-hero{
  position:absolute;top:calc(var(--sat) + 70px);left:0;right:0;
  display:flex;flex-direction:column;align-items:center;pointer-events:none;
}
.hero-kicker{
  display:inline-flex;align-items:center;height:24px;padding:0 12px;margin-bottom:6px;
  border-radius:999px;background:rgba(255,250,228,.92);border:1.5px solid #fff;
  color:#7c8f35;font-size:11px;font-weight:800;letter-spacing:1.4px;
  box-shadow:0 3px 0 rgba(110,80,20,.14);
}
.wood-sign{
  position:relative;width:min(84%, 352px);padding:9px 16px 11px;
  border-radius:20px;
  background:
    repeating-linear-gradient(90deg, rgba(255,255,255,.045) 0 2px, transparent 2px 32px),
    linear-gradient(180deg,#cf9255 0%, #b8763c 55%, #a46330 100%);
  border:4px solid #7f4a1e;
  box-shadow:
    inset 0 2px 0 rgba(255,238,194,.45),
    inset 0 -6px 12px rgba(92,48,12,.32),
    0 7px 0 rgba(87,48,16,.42),
    0 14px 26px rgba(40,78,20,.28);
  transform:rotate(-.6deg);
}
.wood-sign::before{
  content:"";position:absolute;inset:5px;border-radius:13px;
  border:2px dashed rgba(255,233,178,.32);pointer-events:none;
}
.wood-sign::after{
  content:"";position:absolute;left:8%;right:8%;bottom:-11px;height:14px;
  background:linear-gradient(180deg,rgba(86,48,16,.26),transparent);filter:blur(3px);border-radius:50%;
  z-index:-1;
}
.sign-nail{position:absolute;top:9px;width:8px;height:8px;border-radius:50%;background:radial-gradient(circle at 35% 30%,#f4cf8d,#8a5626 70%);box-shadow:0 1px 1px rgba(60,30,0,.4);}
.sign-nail.left{left:9px}.sign-nail.right{right:9px}
.wood-sign h1{
  margin:0;text-align:center;
  font-size:clamp(31px,8.4vw,43px);line-height:1.06;letter-spacing:3px;font-weight:900;
  color:#fffbdc;
  text-shadow:0 2px 0 #8c4d1b, 0 5px 0 rgba(76,38,8,.32), 0 0 14px rgba(255,224,140,.28);
}
.wood-sign p{
  margin:4px 0 0;text-align:center;font-size:13px;font-weight:900;letter-spacing:5px;
  color:#ffe8a8;text-shadow:0 2px 0 rgba(104,54,14,.55);
}
.hero-stars{position:relative;height:0;width:100%;}
.hero-stars i{position:absolute;top:-4px;width:5px;height:5px;border-radius:50%;background:#fff7c7;box-shadow:0 0 8px 2px rgba(255,244,170,.85);animation:twinkle 2.4s ease-in-out infinite;}
.hero-stars i:nth-child(1){left:10%;animation-delay:.2s}
.hero-stars i:nth-child(2){right:8%;top:24px;animation-delay:1.1s}
.hero-stars i:nth-child(3){left:20%;top:56px;animation-delay:1.8s;width:3px;height:3px}

/* 今日目标 */
.start-goal{
  position:absolute;top:46.5%;left:14px;width:min(68%, 258px);max-width:300px;
  padding:9px 12px 10px;border-radius:17px;
  background:linear-gradient(180deg,rgba(255,252,238,.97),rgba(255,240,205,.95));
  border:2px solid #fff;
  box-shadow:0 5px 0 rgba(122,78,30,.18), 0 12px 22px rgba(50,80,20,.18), inset 0 2px 0 #fff;
}
.goal-head{display:flex;align-items:center;gap:7px;}
.goal-icon{
  width:32px;height:32px;border-radius:50%;flex:none;display:flex;align-items:center;justify-content:center;
  background:linear-gradient(180deg,#e9f8cc,#c8ea93);border:1.5px solid #fff;
  box-shadow:inset 0 -2px 4px rgba(70,120,30,.16);
}
.goal-icon svg{width:25px;height:25px;}
.goal-copy{flex:1;min-width:0;display:flex;flex-direction:column;line-height:1.2;}
.goal-copy span{font-size:9.5px;font-weight:800;color:#9c7a4b;letter-spacing:.4px;}
.goal-copy strong{font-size:14px;font-weight:900;color:#70421b;margin-top:1px;white-space:nowrap;}
.goal-copy strong b{color:#e55b2a;font-size:16px;}
.goal-badge{
  flex:none;font-size:9px;font-weight:900;color:#6a8f27;background:#e9f6c8;
  padding:3px 7px;border-radius:99px;border:1px solid #d3eaa6;
}
.goal-track{
  margin-top:7px;height:8px;border-radius:99px;overflow:hidden;
  background:#ead8b2;box-shadow:inset 0 1px 2px rgba(110,70,20,.22);
}
.goal-track i{display:block;height:100%;width:0%;border-radius:99px;background:linear-gradient(90deg,#b5e35e,#6fb92e);box-shadow:inset 0 1px 0 rgba(255,255,255,.55);transition:width .4s ease;}
.goal-track.small{height:7px;margin-top:5px;}

/* 开始按钮区 */
.start-bottom{
  position:absolute;left:20px;right:20px;bottom:calc(var(--sab) + 18px);
  display:flex;flex-direction:column;align-items:center;gap:7px;pointer-events:none;
}
.start-bottom > *{pointer-events:auto;}
.best-chip{
  display:inline-flex;align-items:center;gap:5px;height:25px;padding:0 10px;border-radius:99px;
  background:rgba(255,250,232,.88);border:1.5px solid rgba(255,255,255,.95);
  box-shadow:0 3px 0 rgba(110,70,25,.14);
  font-size:10.5px;font-weight:800;color:#8f6836;
}
.best-chip b{color:#c07716;font-size:12px;}
.btn-start{
  height:68px;padding:0 24px 0 14px;max-width:340px;
  overflow:visible;
  animation:startBreath 2.6s ease-in-out infinite;
}
.btn-basket{
  width:42px;height:42px;flex:none;border-radius:50%;
  background:rgba(255,255,255,.38);border:2px solid rgba(255,255,255,.75);
  display:flex;align-items:center;justify-content:center;
  box-shadow:inset 0 2px 3px rgba(255,255,255,.6);
}
.btn-basket svg{width:34px;height:34px;}
.btn-label{font-size:25px;letter-spacing:2px;color:#7a3c08;}
.btn-play{width:28px;height:28px;flex:none;color:#e07a08;opacity:.85;}
.btn-play svg{width:26px;height:26px;}
.start-tip{margin:1px 0 0;font-size:10.5px;font-weight:700;color:#fffbe4;text-shadow:0 1px 3px rgba(54,74,20,.55);letter-spacing:.5px;}

/* ============ 游戏界面 ============ */
.game-top{
  position:absolute;top:calc(var(--sat) + 10px);left:14px;right:14px;
  display:flex;align-items:center;gap:9px;
}
.timer-pill{
  display:flex;align-items:center;gap:4px;height:44px;padding:0 12px 0 9px;
  border-radius:999px;
  background:linear-gradient(180deg,rgba(255,253,243,.98),rgba(255,238,198,.96));
  border:2px solid #fff;
  box-shadow:0 4px 0 rgba(132,86,36,.2), 0 9px 18px rgba(40,70,20,.18), inset 0 2px 0 #fff;
  color:#8a5322;
  transition:background .2s, color .2s;
}
.timer-pill .clock{width:21px;height:21px;color:#a56c2d;}
.timer-pill span{font-size:23px;font-weight:900;line-height:1;font-variant-numeric:tabular-nums;color:#6d3f16;min-width:30px;text-align:center;}
.timer-pill small{font-size:10px;font-weight:900;color:#a98551;margin-left:-2px;}
.timer-pill.low{background:linear-gradient(180deg,#fff2ef,#ffd3c9);border-color:#fff;animation:timerPulse .7s ease-in-out infinite;}
.timer-pill.low span,.timer-pill.low .clock{color:#d63c2a;}
.game-score{
  margin-left:auto;display:flex;align-items:center;gap:5px;height:44px;padding:0 13px 0 8px;border-radius:999px;
  background:linear-gradient(180deg,rgba(255,253,243,.98),rgba(255,238,198,.96));
  border:2px solid #fff;
  box-shadow:0 4px 0 rgba(132,86,36,.2), 0 9px 18px rgba(40,70,20,.18), inset 0 2px 0 #fff;
}
.game-score span{font-size:19px;font-weight:900;color:#6d3f16;font-variant-numeric:tabular-nums;max-width:110px;overflow:hidden;text-overflow:ellipsis;}
.pause-btn{width:44px;height:44px;}
.pause-btn svg{width:22px;height:22px;color:#8a5b2c;}
.game-goal{
  position:absolute;top:calc(var(--sat) + 62px);left:14px;right:14px;
  padding:7px 12px 8px;border-radius:14px;
  background:rgba(255,250,232,.88);
  border:1.5px solid rgba(255,255,255,.95);
  box-shadow:0 3px 0 rgba(110,70,25,.14), 0 8px 16px rgba(40,70,20,.12);
}
.game-goal-head{display:flex;align-items:center;justify-content:space-between;font-size:10.5px;font-weight:800;color:#94724a;}
.game-goal-head b{font-size:11.5px;color:#70421b;font-variant-numeric:tabular-nums;}
.game-goal-head b i{font-style:normal;color:#e55b2a;font-size:15px;}
.combo-badge{
  position:absolute;top:25.5%;left:50%;transform:translateX(-50%) rotate(-2deg);
  min-width:92px;padding:6px 15px 7px;border-radius:14px;
  background:linear-gradient(180deg,#ff9d3f,#f0562c);
  border:2.5px solid #ffe8a8;
  box-shadow:0 5px 0 #b43716, 0 10px 20px rgba(100,30,0,.25), inset 0 2px 0 rgba(255,255,255,.4);
  color:#fff;text-align:center;
  animation:comboPop .28s cubic-bezier(.2,1.8,.4,1);
  z-index:4;
}
.combo-word{display:block;font-size:10px;font-weight:900;letter-spacing:3px;color:#ffe9b8;line-height:1;}
.combo-badge strong{display:block;font-size:28px;line-height:1.04;font-weight:900;text-shadow:0 2px 0 #9e2c11;letter-spacing:-.5px;}
.combo-track{margin-top:3px;height:4px;border-radius:99px;background:rgba(110,25,0,.35);overflow:hidden;}
.combo-track i{display:block;height:100%;width:100%;background:#ffe76f;border-radius:99px;transform-origin:left center;}
.game-bottom{
  position:absolute;left:14px;right:14px;bottom:calc(var(--sab) + 18px);
  display:flex;align-items:center;justify-content:space-between;gap:10px;pointer-events:none;
}
.game-tip{
  font-size:11px;font-weight:800;color:#fffce9;letter-spacing:.3px;
  background:rgba(73,104,32,.42);border:1px solid rgba(255,255,255,.28);
  padding:7px 11px;border-radius:99px;backdrop-filter:blur(4px);
  text-shadow:0 1px 2px rgba(40,60,10,.35);
}
.field-count{
  display:flex;align-items:center;gap:4px;height:38px;padding:0 11px 0 7px;border-radius:99px;
  background:linear-gradient(180deg,rgba(255,253,243,.97),rgba(255,238,198,.95));
  border:2px solid #fff;box-shadow:0 4px 0 rgba(132,86,36,.2), 0 8px 14px rgba(40,70,20,.16);
  color:#8a5a2b;font-size:11px;font-weight:800;flex:none;
}
.field-count svg{width:25px;height:25px;}
.field-count b{font-size:17px;color:#e55b2a;font-variant-numeric:tabular-nums;}

/* ============ 结束界面 ============ */
.end-screen{
  display:flex;align-items:center;justify-content:center;padding:18px;
  background:rgba(37,54,18,.48);
  backdrop-filter:blur(3px);
  pointer-events:auto;
  animation:fadeIn .25s ease;
}
.end-card{
  position:relative;z-index:2;width:min(100%, 358px);padding:30px 20px 18px;border-radius:28px;
  background:
    radial-gradient(120% 60% at 50% 0%, rgba(255,255,255,.95), rgba(255,255,255,0) 60%),
    linear-gradient(180deg,#fffdf4 0%,#fff6dc 55%,#ffedc2 100%);
  border:3px solid #fff;
  box-shadow:0 10px 0 rgba(116,72,24,.28), 0 26px 50px rgba(20,35,10,.4), inset 0 3px 0 #fff;
  text-align:center;
  animation:cardIn .45s cubic-bezier(.18,1.5,.4,1);
  pointer-events:auto;
}
.end-ribbon{
  position:absolute;top:-15px;left:50%;transform:translateX(-50%) rotate(-1.5deg);
  height:31px;padding:0 22px;border-radius:9px;line-height:31px;
  background:linear-gradient(180deg,#ff9a45,#ef5b2b);
  border:2px solid #ffe6a3;
  box-shadow:0 4px 0 #b13814, 0 8px 14px rgba(90,30,0,.25);
  color:#fff8dd;font-size:14px;font-weight:900;letter-spacing:2px;white-space:nowrap;
}
.star-row{display:flex;align-items:flex-end;justify-content:center;gap:4px;height:56px;margin:2px 0 2px;}
.star-row .star{width:46px;height:46px;color:#e3d5b4;display:block;transform:scale(.8);filter:drop-shadow(0 3px 2px rgba(110,70,20,.18));}
.star-row .star:nth-child(2){width:56px;height:56px;margin-bottom:3px;}
.star-row .star:not(.on){opacity:.72;filter:grayscale(.35);}
.star-row .star:not(.on) svg path:first-child{fill:#e4d9c2;stroke:#c8b99b;}
.star-row .star:not(.on) svg path:last-child{fill:#f1e8d5;}
.star-row .star.on{color:#ffc42f;filter:drop-shadow(0 4px 3px rgba(150,90,0,.28)) drop-shadow(0 0 10px rgba(255,210,70,.55));animation:starPop .45s cubic-bezier(.2,1.8,.4,1) both;}
.star-row .star.on:nth-child(1){animation-delay:.08s}
.star-row .star.on:nth-child(2){animation-delay:.18s}
.star-row .star.on:nth-child(3){animation-delay:.28s}
.end-card h2{margin:2px 0 2px;font-size:30px;line-height:1.1;color:#7a4218;letter-spacing:2px;font-weight:900;text-shadow:0 2px 0 #fff;}
.end-sub{margin:0 0 12px;font-size:11.5px;font-weight:700;color:#a17a4b;letter-spacing:.5px;}
.end-score{
  position:relative;margin:0 auto 12px;width:100%;padding:8px 0 9px;border-radius:16px;
  background:linear-gradient(180deg,#fff8dc,#ffe9a9);
  border:2px solid #fff;box-shadow:inset 0 2px 2px rgba(255,255,255,.8), inset 0 -3px 6px rgba(208,150,40,.14);
}
.end-score-label{display:block;font-size:10px;font-weight:900;color:#a37c49;letter-spacing:2px;}
.end-score strong{display:block;font-size:42px;line-height:1.05;color:#e08413;font-weight:900;letter-spacing:.5px;font-variant-numeric:tabular-nums;text-shadow:0 2px 0 #fff, 0 4px 0 rgba(210,150,50,.22);}
.new-best{
  position:absolute;right:8px;top:8px;font-size:9px;font-weight:900;color:#fff;background:linear-gradient(180deg,#ff8d4a,#ed4f24);
  padding:3px 7px;border-radius:99px;transform:rotate(4deg);box-shadow:0 2px 0 #b32f0d;
  animation:newBest 1.2s ease-in-out infinite;
}
.end-stats{display:flex;align-items:stretch;margin:0 0 14px;padding:8px 0;border-radius:14px;background:rgba(255,255,255,.45);border:1px solid rgba(210,180,120,.25);}
.end-stat{flex:1;display:flex;flex-direction:column;align-items:center;gap:2px;position:relative;}
.end-stat + .end-stat::before{content:"";position:absolute;left:0;top:8%;bottom:8%;width:1px;background:rgba(160,120,60,.18);}
.end-stat span{font-size:9.5px;font-weight:800;color:#a58456;letter-spacing:.4px;}
.end-stat b{font-size:21px;line-height:1.1;color:#70421b;font-weight:900;font-variant-numeric:tabular-nums;}
.end-stat small{font-size:8.5px;color:#ae8d60;margin-top:-2px;}
.btn-again{height:54px;font-size:20px;letter-spacing:2px;margin-bottom:9px;}
.btn-again .icon{width:22px;height:22px;color:#a5620c;}

/* ============ 倒计时 / 暂停 / 提示 ============ */
.countdown{
  position:absolute;inset:0;z-index:30;display:flex;align-items:center;justify-content:center;
  background:rgba(30,46,16,.18);backdrop-filter:blur(1px);pointer-events:none;
}
.countdown span{
  font-size:104px;font-weight:900;color:#fff7d0;line-height:1;
  text-shadow:0 6px 0 #bf7511, 0 12px 22px rgba(90,50,0,.4), 0 0 40px rgba(255,220,100,.5);
  animation:countIn .58s cubic-bezier(.2,1.4,.4,1) both;
}
.modal{
  position:absolute;inset:0;z-index:40;display:flex;align-items:center;justify-content:center;padding:20px;
  background:rgba(34,50,18,.5);backdrop-filter:blur(3px);animation:fadeIn .2s ease;
}
.modal-card{
  width:min(100%,320px);padding:20px 20px 16px;border-radius:24px;text-align:center;
  background:linear-gradient(180deg,#fffdf4,#fff1cf);border:3px solid #fff;
  box-shadow:0 9px 0 rgba(116,72,24,.26), 0 24px 44px rgba(20,35,10,.38), inset 0 3px 0 #fff;
  animation:cardIn .35s cubic-bezier(.18,1.5,.4,1);
}
.modal-icon{width:60px;height:60px;margin:0 auto 6px;}
.modal-icon svg{width:60px;height:60px;}
.modal-card h3{margin:0 0 3px;font-size:25px;color:#7a4218;letter-spacing:2px;}
.modal-card p{margin:0 0 16px;font-size:12px;color:#a17a4b;font-weight:600;}
.modal-card .btn-primary{height:50px;font-size:18px;margin-bottom:9px;}
.toast-layer{position:absolute;left:0;right:0;top:34%;z-index:50;pointer-events:none;display:flex;flex-direction:column;align-items:center;gap:6px;}
.toast{
  padding:8px 15px;border-radius:99px;background:rgba(64,42,18,.82);color:#fff8dc;
  font-size:12px;font-weight:800;letter-spacing:.5px;box-shadow:0 4px 12px rgba(0,0,0,.25);
  animation:toastIn .22s ease both, toastOut .3s ease 1.1s both;
}
.end-screen .confetti{position:absolute;z-index:1;top:-24px;width:9px;height:14px;border-radius:3px;pointer-events:none;animation:confettiFall linear forwards;}

/* ============ 动效 ============ */
@keyframes twinkle{0%,100%{opacity:.25;transform:scale(.7)}50%{opacity:1;transform:scale(1.3)}}
@keyframes startBreath{0%,100%{transform:translateY(0) scale(1)}50%{transform:translateY(-3px) scale(1.015)}}
@keyframes timerPulse{0%,100%{transform:scale(1)}50%{transform:scale(1.035)}}
@keyframes comboPop{0%{transform:translateX(-50%) rotate(-2deg) scale(.55);opacity:0}100%{transform:translateX(-50%) rotate(-2deg) scale(1);opacity:1}}
@keyframes fadeIn{from{opacity:0}to{opacity:1}}
@keyframes cardIn{from{opacity:0;transform:translateY(26px) scale(.92)}to{opacity:1;transform:translateY(0) scale(1)}}
@keyframes starPop{0%{transform:scale(0) rotate(-25deg);opacity:0}70%{transform:scale(1.14) rotate(4deg);opacity:1}100%{transform:scale(1) rotate(0)}}
@keyframes countIn{0%{transform:scale(.4);opacity:0}55%{transform:scale(1.12);opacity:1}100%{transform:scale(1);opacity:1}}
@keyframes newBest{0%,100%{transform:rotate(4deg) scale(1)}50%{transform:rotate(4deg) scale(1.08)}}
@keyframes toastIn{from{opacity:0;transform:translateY(8px) scale(.94)}to{opacity:1;transform:none}}
@keyframes toastOut{to{opacity:0;transform:translateY(-6px)}}
@keyframes confettiFall{to{transform:translate3d(var(--dx), 120dvh, 0) rotate(var(--rot));opacity:.2}}

/* 小屏适配 */
@media (max-height: 720px){
  .start-hero{top:calc(var(--sat) + 70px);}
  .wood-sign{padding:7px 14px 8px;}
  .wood-sign h1{font-size:31px;}
  .wood-sign p{font-size:11px;letter-spacing:4px;}
  .start-goal{top:44%;}
  .start-bottom{bottom:calc(var(--sab) + 10px);gap:4px;}
  .btn-start{height:58px;max-width:310px;}
  .btn-basket{width:36px;height:36px;}
  .btn-basket svg{width:29px;height:29px;}
  .btn-label{font-size:22px;}
  .start-tip{font-size:9.5px;}
  .best-chip{height:22px;font-size:9.5px;}
  .end-card{padding:24px 16px 14px;}
  .star-row{height:46px;}
  .star-row .star{width:38px;height:38px;}
  .star-row .star:nth-child(2){width:46px;height:46px;}
  .end-card h2{font-size:25px;}
  .end-score strong{font-size:34px;}
  .end-stats{margin-bottom:10px;}
  .btn-again{height:48px;font-size:18px;}
  .btn-ghost{height:42px;font-size:14px;}
}
@media (max-height: 640px){
  .hero-kicker{display:none;}
  .start-goal{display:none;}
  .start-hero{top:calc(var(--sat) + 62px);}
  .game-tip{font-size:10px;padding:6px 9px;}
}
