*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
html,body{margin:0;min-height:100%;background:#81171a;color:#ffe5a5;font-family:-apple-system,BlinkMacSystemFont,"PingFang SC","Microsoft YaHei",sans-serif;touch-action:manipulation;user-select:none}
button{font:inherit;touch-action:manipulation;cursor:pointer}
button:disabled{cursor:default;opacity:.6}
.game{position:relative;isolation:isolate;overflow:hidden;width:100%;max-width:520px;min-height:100svh;margin:auto;padding:max(16px,env(safe-area-inset-top)) 16px max(16px,env(safe-area-inset-bottom));display:flex;flex-direction:column;background:#b82c24;touch-action:manipulation}
.scene{position:absolute;inset:0;z-index:-3;background:
  radial-gradient(circle at 12% 8%, #ffd56a 0 18px, transparent 19px),
  radial-gradient(circle at 88% 14%, #ffd56a 0 14px, transparent 15px),
  linear-gradient(180deg,#9d1d22,#c43724 46%,#7d1418)}
.wash{position:absolute;inset:0;z-index:-2;background:linear-gradient(180deg,rgba(110,16,20,.35),rgba(116,18,24,.2) 40%,rgba(116,18,24,.55));pointer-events:none}
.game[data-scene="0"] .scene{background:
  radial-gradient(circle at 18% 12%, #ffefb0 0 10px, transparent 12px),
  linear-gradient(#d23a2c,#9b1c1c 70%)}
.game[data-scene="1"] .scene{background:
  radial-gradient(circle at 20% 18%, #ffe27a 0 8px, transparent 10px),
  radial-gradient(circle at 70% 10%, #fff1b8 0 6px, transparent 8px),
  radial-gradient(circle at 50% 30%, #ffb347 0 16px, transparent 18px),
  linear-gradient(#1d3f78,#7a1d28 72%)}
.game[data-scene="2"] .scene{background:
  linear-gradient(#e07a32,#8d2418 40%,#5c3a22)}
.scores{display:flex;gap:8px;position:relative;z-index:2}
.panel{flex:1;min-width:0;padding:8px 6px;text-align:center;border:2px solid #edbb66;border-radius:16px;background:linear-gradient(150deg,#b72a23,#81181b);box-shadow:0 4px 0 #68171a, inset 0 1px 0 #ffdf90}
.panel.slim{flex:0.8}
.panel span{display:block;color:#f4cb87;font-size:12px}
.panel strong{display:block;font-size:28px;line-height:1.15;color:#ffe7a0;font-variant-numeric:tabular-nums;text-shadow:0 2px #8f371a}
.panel b{font-weight:800}
.panel small{font-size:13px;margin-left:2px}
.combo{display:block;min-height:16px;color:#fff4c4;font-size:12px}
progress{display:block;width:100%;height:6px;margin-top:4px;border:0;border-radius:6px;background:#5c1216;appearance:none}
progress::-webkit-progress-bar{background:#5c1216;border-radius:6px}
progress::-webkit-progress-value{background:#ffd36a;border-radius:6px}
.board{position:relative;z-index:1;display:grid;grid-template-columns:repeat(3,1fr);grid-template-rows:repeat(3,1fr);gap:8px 6px;margin:12px 0;padding:8px 0 4px;min-height:340px;flex:1;touch-action:none}
.hole{position:relative;align-self:end;width:100%;height:96px;padding:0;border:0;background:transparent;overflow:visible;user-select:none;touch-action:none}
.hole:before{content:"";position:absolute;left:6%;right:6%;height:30px;bottom:0;border:4px solid #e9a248;border-bottom:7px solid #ffbd66;border-radius:50%;background:radial-gradient(ellipse,#381b17,#68301c);box-shadow:0 5px 0 #87251b;z-index:2}
.mole{position:absolute;left:18%;bottom:14px;width:64%;height:72px;transform:translateY(110px);transition:transform .12s ease-out;background:radial-gradient(ellipse at 38% 25%,#d19a63,#ad703c 65%,#84502e);border:2px solid #663c28;border-radius:48% 48% 35% 35%;box-shadow:inset 3px 3px 0 #e8b37a;pointer-events:none;z-index:1}
.up .mole{transform:translateY(0)}
.ear{position:absolute;width:22px;height:24px;top:-7px;background:#c48753;border:3px solid #75452e;border-radius:50%;z-index:-1}
.ear.left{left:-8px}.ear.right{right:-8px}
.eye{position:absolute;top:22px;width:8px;height:12px;background:#291d1a;border-radius:50%;box-shadow:inset 2px 2px 0 #fff}
.eye.left{left:22%}.eye.right{right:22%}
.muzzle{position:absolute;bottom:8px;left:16%;width:68%;height:26px;border-radius:50%;background:#ffe0ae}
.nose{position:absolute;left:calc(50% - 6px);top:34px;width:12px;height:9px;background:#6b382a;border-radius:50%}
.tooth{position:absolute;bottom:9px;left:calc(50% - 7px);width:14px;height:9px;background:#fff4df;border-radius:2px 2px 4px 4px;border:1px solid #98633a}
.cheek{position:absolute;top:38px;width:12px;height:7px;border-radius:50%;background:#ef977b}
.cheek.left{left:6%}.cheek.right{right:6%}
.type-badge{position:absolute;left:50%;top:-16px;transform:translateX(-50%);font-size:11px;font-weight:800;color:#7a2414;background:#ffe7a4;border-radius:8px;padding:0 5px;line-height:16px;white-space:nowrap}
.fuse{display:none}
.hole[data-type="gold"] .mole{background:radial-gradient(ellipse at 38% 25%,#ffe9a2,#e2b23a 60%,#a87412);border-color:#8a5a10;box-shadow:0 0 12px #ffd56a, inset 3px 3px 0 #fff4c8;animation:goldflash .3s linear infinite}
.hole[data-type="bomb"] .mole{background:radial-gradient(ellipse at 40% 30%,#4a4a4a,#1c1c1c 70%);border-color:#111}
.hole[data-type="bomb"] .fuse{display:block;position:absolute;right:8px;top:-8px;width:8px;height:16px;background:#f3d27a;border-radius:4px;box-shadow:0 -6px 0 #ff6a3d}
.hole[data-type="speed"] .mole{background:radial-gradient(ellipse at 38% 25%,#b9dcff,#3d7ed6 62%,#1d4e96);border-color:#163e78;box-shadow:inset 3px 3px 0 #e7f4ff,-8px 8px 0 rgba(120,190,255,.35)}
.hole[data-type="time"] .mole{background:radial-gradient(ellipse at 40% 30%,#f7e7c4,#c9853a 70%);border-color:#8a5520}
.hole[data-type="time"] .type-badge{background:#fff;color:#8a4b16}
.hole[data-type="coin"] .mole{background:radial-gradient(ellipse at 38% 25%,#ffe08a,#e0a020 65%);border-color:#8a6210}
.hole[data-type="coin"] .muzzle{background:#ffd15a}
.stars{position:absolute;left:0;right:0;top:6px;text-align:center;color:#fff6c8;font-size:14px;opacity:0;z-index:3;pointer-events:none}
.hole.hit .mole{filter:brightness(1.25);transform:translateY(22px) rotate(-8deg)}
.hole.hit .stars{opacity:1}
.points{position:absolute;left:0;right:0;top:-6px;text-align:center;color:#fff0ab;font-size:20px;font-weight:900;text-shadow:0 2px 2px #85200e;pointer-events:none;opacity:0;z-index:4}
.hit .points{opacity:1}
.actions{position:relative;z-index:4;text-align:center}
.actions p{font-size:14px;min-height:20px;margin:6px 0 10px}
.start,.reward,.ghost{width:100%;min-height:48px;border-radius:14px;font-weight:800;pointer-events:auto}
.start,.reward{border:2px solid #f5c370;box-shadow:0 4px 0 #68151a}
.start{background:linear-gradient(#ffac57,#ff8a3d);color:#70251b;font-size:18px;margin-bottom:8px}
.reward{display:flex;align-items:center;justify-content:center;gap:8px;color:#ffda85;background:linear-gradient(#9d2426,#72151b);font-size:16px;margin-bottom:8px}
.reward.mini{min-height:40px;font-size:13px;margin-top:6px}
.reward small{font-size:12px;font-weight:400;color:#e5b579}
.reward .mp-icon{color:#ffda85;font-size:18px}
.side-links{display:flex;gap:8px}
.ghost{background:transparent;color:#ffe7b0;border:2px solid #e7b56a}
.actions .hint,.hint{color:#e7b88a;font-size:12px;margin:8px 0 0}
.urgent{color:#ffad73!important}
.hammer{position:fixed;left:0;top:0;width:92px;height:92px;z-index:8;pointer-events:none;opacity:0;visibility:hidden;transform:translate(-80px,-160px) rotate(-28deg);transform-origin:22% 28%;filter:drop-shadow(0 6px 2px rgba(80,16,12,.45))}
.hammer.on{opacity:1;visibility:visible}
.hammer-art{position:absolute;inset:0}
.hammer-head{position:absolute;left:0;top:8px;width:58px;height:34px;border-radius:10px;background:linear-gradient(#ff6a4a,#d12a22 55%,#9a1618);border:3px solid #ffe08a;box-shadow:inset 0 3px 0 #ffb08a,0 3px 0 #6a1014;display:flex;align-items:center;justify-content:space-evenly}
.hammer-head i{display:block;width:4px;height:22px;border-radius:2px;background:#f5c56a}
.hammer-handle{position:absolute;left:46px;top:28px;width:16px;height:58px;border-radius:8px;background:linear-gradient(90deg,#e8b06a,#a86a32 45%,#6d3e1c);border:2px solid #ffe0a0;transform:rotate(28deg);transform-origin:top center}
.hammer[data-style="1"] .hammer-head{background:linear-gradient(#ffe08a,#e0a020)}
.hammer[data-style="2"] .hammer-head{background:linear-gradient(#ffb0c8,#d23a4a)}
.hammer.boost .hammer-head{box-shadow:0 0 0 4px rgba(120,190,255,.55), inset 0 3px 0 #ffb08a}
.overlay{position:absolute;inset:0;z-index:9;background:rgba(60,8,10,.72);display:flex;align-items:flex-end;padding:12px}
.sheet{width:100%;max-height:86%;overflow:auto;background:#8e1c1e;border:2px solid #f0c56d;border-radius:16px;padding:14px;color:#ffe7b0}
.sheet h2{margin:0 0 8px;font-size:20px;color:#ffe7a0}
.result-list{list-style:none;margin:0;padding:0}
.result-list li{display:flex;justify-content:space-between;padding:8px 0;border-bottom:1px solid rgba(255,220,150,.25);font-size:16px}
.sheet-actions{display:flex;flex-direction:column;gap:8px;margin-top:12px}
.atlas{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.atlas-card{background:rgba(90,12,16,.45);border:1px solid #e7b56a;border-radius:12px;padding:8px;min-height:92px}
.atlas-card b{display:block;font-size:14px;color:#ffe7a0}
.atlas-card span{display:block;font-size:12px;margin:4px 0}
.atlas-card.owned{background:rgba(255,196,90,.16)}
.scene-1{background:linear-gradient(#274e86,#8e1c1e)}
.scene-2{background:linear-gradient(#e07a32,#6a2414)}
@keyframes goldflash{50%{filter:brightness(1.35)}}
[hidden]{display:none!important}
.game[data-state="playing"] .board,.game[data-state="playing"] .hole{cursor:none}
@media(max-height:640px){.panel strong{font-size:22px}.board{min-height:260px}.hole{height:82px}.mole{height:64px}}

/* Keep the nine hit areas inside the board, separate from the controls. */
.game{min-height:100svh;min-height:100dvh;overflow-x:clip;overflow-y:visible;gap:12px;padding-bottom:max(16px,env(safe-area-inset-bottom))}
.scores{flex-shrink:0}
.board{flex:1 0 348px;min-height:348px;margin:0;padding:12px 0 6px;grid-template-rows:repeat(3,minmax(104px,1fr));gap:8px 6px;isolation:isolate}
.hole{align-self:end;height:104px;min-width:0;margin:0!important;overflow:visible}
/* A retracted mole must not be painted over the following row or buttons. */
.hole .mole{visibility:hidden;opacity:0;transform:translateY(20px);transition:transform .12s ease-out,opacity .12s ease-out}
.hole.up .mole{visibility:visible;opacity:1;transform:translateY(0)}
.hole.up.hit .mole{transform:translateY(12px) rotate(-8deg)}
.hole:focus-visible{outline:3px solid #FF8A3D;outline-offset:1px;border-radius:16px}
.actions{flex-shrink:0;z-index:2;padding-top:4px}
.actions p{line-height:1.5;min-height:21px;margin:0 0 10px;overflow-wrap:anywhere}
.actions .hint{margin:8px 0 0}
.start,.reward,.ghost{min-height:48px}
/* Keep the board still when the start button disappears during play. */
.game[data-state="playing"] .start[hidden]{display:block!important;visibility:hidden;pointer-events:none}
/* The hammer is feedback, not a cover over the next target. */
.hammer{width:72px;height:72px}
.hammer-art{transform:scale(.72);transform-origin:top left}
@media(max-height:640px){
  .game{gap:8px;padding-top:max(10px,env(safe-area-inset-top))}
  .board{min-height:324px;flex-basis:324px;grid-template-rows:repeat(3,minmax(96px,1fr));padding-top:10px}
  .hole{height:96px}
  .hole .mole{height:64px}
  .panel{padding:6px}
}

/* 敲中反馈：锤子下压、地鼠晕眩缩回、飘分、轻微震动 */
.hammer.down .hammer-art{transform:scale(.72) translateY(6px)}
.hole.fx .points{animation:floatup .6s ease-out forwards}
.hole.fx .stars{animation:spin .5s linear}
.hole.up.hit .mole{animation:dizzy .32s ease-in forwards}
.game.shake .board{animation:shake .16s linear}
@keyframes floatup{0%{opacity:1;transform:translateY(0) scale(.9)}30%{transform:translateY(-10px) scale(1.15)}100%{opacity:0;transform:translateY(-40px) scale(1)}}
@keyframes spin{from{transform:rotate(0)}to{transform:rotate(360deg)}}
@keyframes dizzy{0%{transform:translateY(4px) rotate(-10deg)}50%{transform:translateY(14px) rotate(10deg)}100%{transform:translateY(40px) rotate(0);opacity:.2}}
@keyframes shake{25%{transform:translate(-3px,1px)}50%{transform:translate(3px,-1px)}75%{transform:translate(-2px,0)}}
/* 角落小喇叭开关 */
.scores{padding-right:44px}
.sound-toggle{position:absolute;top:max(16px,env(safe-area-inset-top));right:12px;z-index:6;width:40px;height:40px;padding:0;border-radius:50%;border:2px solid #f5c370;background:linear-gradient(#9d2426,#72151b);color:#ffda85;display:flex;align-items:center;justify-content:center;box-shadow:0 3px 0 #5a1216}
.sound-toggle .mp-icon{font-size:22px;color:currentColor}
.sound-toggle.off{color:#c99a6a;opacity:.85}
@media(max-height:640px){.sound-toggle{top:max(10px,env(safe-area-inset-top))}}

/* Keep the start control and all three rows reachable on short screens. */
.game > .start{flex-shrink:0;margin:0}
@media(max-height:640px){
  .board{min-height:264px;flex-basis:264px;grid-template-rows:repeat(3,minmax(76px,1fr))}
  .hole{height:76px}
  .hole .mole{height:58px}
}
@media(max-height:500px){
  .board{min-height:224px;flex-basis:224px;grid-template-rows:repeat(3,minmax(64px,1fr))}
  .hole{height:64px}
  .hole .mole{height:52px}
  .hole .eye{top:16px}
  .hole .nose{top:27px}
  .hole .cheek{top:30px}
}
