/* ═══════════════════════════════════════════════════════════
   Mole Farm · Game Lab — base, worlds, game layout, board
   ═══════════════════════════════════════════════════════════ */
:root {
  --ink: #3a2312;
  --ink-soft: #7a5a3c;
  --cream: #fff8e6;
  --orange: #ff8a2b;
  --orange-deep: #e5601a;
  --gold: #ffc93c;
  --green: #3fae4f;
  --green-deep: #1f6b33;
  --outline: #5a3216;
  --font: "Microsoft YaHei UI", "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", system-ui, sans-serif;
  --round: "Arial Rounded MT Bold", "Trebuchet MS", "Microsoft YaHei UI", "PingFang SC", sans-serif;

  /* world palette (overridden by body[data-world]) */
  --sky-1: #7fd0ff; --sky-2: #c9efff; --sky-3: #fff4cf;
  --hill-1: #a5dd7b; --hill-2: #7cc866; --hill-3: #4fae58;
  --board-1: #7dd16a; --board-2: #52b058; --board-3: #3a924c;
  --frame-1: #ffd982; --frame-2: #f0ad4a; --frame-3: #c97a2c; --frame-edge: #8f5320;
  --dirt-1: #2a1a0e; --dirt-2: #5a3a20; --dirt-3: #9a6a3c; --dirt-4: #c28c52;
  --panel-1: #fffdf2; --panel-2: #ffeec2; --panel-edge: #e8b765;
  --accent: #ff8a2b;
  --deco: #fff;
}
body[data-world="candy"] {
  --sky-1: #ff9fd0; --sky-2: #ffd3ea; --sky-3: #fff0c9;
  --hill-1: #ffc4de; --hill-2: #ffa5cb; --hill-3: #ff86b9;
  --board-1: #ffa8d3; --board-2: #ff86bd; --board-3: #f06aa8;
  --frame-1: #ffffff; --frame-2: #ff7aa8; --frame-3: #d9467f; --frame-edge: #a52a5e;
  --dirt-1: #3a1a1a; --dirt-2: #6a3425; --dirt-3: #a05a3a; --dirt-4: #cf8a5c;
  --panel-1: #fffafc; --panel-2: #ffe0ee; --panel-edge: #ff9cc4;
  --accent: #ff5f9d;
}
body[data-world="night"] {
  --sky-1: #141844; --sky-2: #2e2a66; --sky-3: #6a4a92;
  --hill-1: #4a3c82; --hill-2: #34296a; --hill-3: #231c54;
  --board-1: #3e8f9a; --board-2: #2d6f86; --board-3: #234f72;
  --frame-1: #c9d1ea; --frame-2: #8e98c4; --frame-3: #5b6592; --frame-edge: #343c66;
  --dirt-1: #0c0a1c; --dirt-2: #2a2442; --dirt-3: #4c4470; --dirt-4: #716a9c;
  --panel-1: #f7f5ff; --panel-2: #dfdcff; --panel-edge: #9b94e0;
  --accent: #8f7bff; --deco: #fff6c8;
}
body[data-world="snow"] {
  --sky-1: #8ec9f2; --sky-2: #cfeaff; --sky-3: #f4fbff;
  --hill-1: #ffffff; --hill-2: #e1f0fb; --hill-3: #c4defa;
  --board-1: #eaf7ff; --board-2: #c6e6fa; --board-3: #a2d0f0;
  --frame-1: #e6f6ff; --frame-2: #7fc4ee; --frame-3: #4a93c9; --frame-edge: #2c6694;
  --dirt-1: #1d2a38; --dirt-2: #44566a; --dirt-3: #7d93aa; --dirt-4: #aec3d6;
  --panel-1: #fbfeff; --panel-2: #dcf0ff; --panel-edge: #8bc6ee;
  --accent: #3fa0e6;
}
body[data-world="space"] {
  --sky-1: #050520; --sky-2: #1b0f4a; --sky-3: #4a1f78;
  --hill-1: #5a2d8f; --hill-2: #3d1d6e; --hill-3: #26104d;
  --board-1: #3a2f8f; --board-2: #28206b; --board-3: #1a1450;
  --frame-1: #ffd6ff; --frame-2: #c36bff; --frame-3: #7a2fd1; --frame-edge: #471a8a;
  --dirt-1: #05031a; --dirt-2: #22124a; --dirt-3: #4a2d8c; --dirt-4: #7c5ad0;
  --panel-1: #fbf6ff; --panel-2: #e6d8ff; --panel-edge: #b58cff;
  --accent: #c36bff; --deco: #fff;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-height: 100%; }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--ink);
  font-family: var(--font);
  background: var(--sky-2);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
body.modal-open { overflow: hidden; }
button { font: inherit; color: inherit; }
button:focus-visible { outline: 3px solid #fff5b0; outline-offset: 3px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* ── Scenery ─────────────────────────────────────────────── */
.scenery {
  position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none;
  background: linear-gradient(180deg, var(--sky-1) 0%, var(--sky-2) 48%, var(--sky-3) 78%);
  transition: background .8s ease;
}
.scenery .orb {
  position: absolute; top: clamp(50px, 9vh, 110px); right: clamp(40px, 12vw, 200px);
  width: clamp(80px, 11vw, 150px); aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle at 36% 34%, #fffbe0 0 22%, #ffe27a 56%, #ffb93a 100%);
  box-shadow: 0 0 0 14px rgba(255, 233, 140, .25), 0 0 0 34px rgba(255, 233, 140, .14), 0 0 70px rgba(255, 207, 90, .7);
  animation: orb-breathe 6s ease-in-out infinite;
}
body[data-world="night"] .scenery .orb, body[data-world="space"] .scenery .orb {
  background: radial-gradient(circle at 36% 34%, #ffffff 0 20%, #e9ecff 55%, #b5bbe8 100%);
  box-shadow: 0 0 0 12px rgba(220, 225, 255, .12), 0 0 60px rgba(190, 200, 255, .55);
}
body[data-world="space"] .scenery .orb {
  background: radial-gradient(circle at 34% 30%, #ffd9a0 0 14%, #ff8a5c 46%, #a8346a 100%);
  box-shadow: 0 0 0 10px rgba(255, 140, 120, .12), 0 0 70px rgba(255, 120, 150, .5);
}
body[data-world="space"] .scenery .orb::after {
  content: ""; position: absolute; left: -28%; right: -28%; top: 42%; height: 18%;
  border: 4px solid rgba(255, 220, 190, .7); border-radius: 50%; transform: rotate(-16deg);
}
body[data-world="snow"] .scenery .orb { background: radial-gradient(circle at 36% 34%, #fff 0 24%, #fff6c9 60%, #ffe69a 100%); box-shadow: 0 0 0 14px rgba(255,255,255,.35), 0 0 60px rgba(255,255,255,.8); }
.scenery .hill { position: absolute; left: -10%; right: -10%; border-radius: 50% 50% 0 0 / 100% 100% 0 0; transition: background .8s ease; }
.scenery .hill--a { bottom: 20%; height: 34%; background: var(--hill-1); opacity: .85; transform: translateX(-10%); }
.scenery .hill--b { bottom: 8%; height: 34%; background: var(--hill-2); transform: translateX(14%); }
.scenery .hill--c { bottom: -6%; height: 40%; background: linear-gradient(180deg, var(--hill-3), var(--hill-2)); }
.scenery .deco { position: absolute; inset: 0; }
.deco i { position: absolute; display: block; }
.deco .cloud {
  height: 46px; border-radius: 40px; background: #fff; opacity: .92;
  box-shadow: 0 8px 0 rgba(255,255,255,.35);
  animation: cloud-drift var(--d, 24s) ease-in-out infinite alternate;
}
.deco .cloud::before, .deco .cloud::after { content: ""; position: absolute; background: inherit; border-radius: 50%; }
.deco .cloud::before { width: 54%; aspect-ratio: 1; left: 14%; bottom: 40%; }
.deco .cloud::after { width: 38%; aspect-ratio: 1; right: 14%; bottom: 36%; }
body[data-world="night"] .deco .cloud, body[data-world="space"] .deco .cloud { background: #5a4f9c; opacity: .6; box-shadow: none; }
.deco .star {
  width: var(--s, 3px); height: var(--s, 3px); border-radius: 50%; background: var(--deco);
  box-shadow: 0 0 6px 1px var(--deco);
  animation: twinkle var(--d, 3s) ease-in-out infinite alternate;
}
.deco .flake {
  width: var(--s, 8px); height: var(--s, 8px); border-radius: 50%; background: #fff; opacity: .9;
  animation: snowfall var(--d, 9s) linear infinite;
}
.deco .candy {
  width: var(--s, 22px); height: var(--s, 22px); border-radius: 50%;
  background: repeating-conic-gradient(var(--c1, #ff5f9d) 0 25%, #fff 0 50%);
  border: 3px solid rgba(255,255,255,.75); opacity: .75;
  animation: floaty var(--d, 7s) ease-in-out infinite alternate;
}
.deco .flower { font-size: var(--s, 26px); animation: sway var(--d, 4s) ease-in-out infinite alternate; transform-origin: bottom center; }

/* ── App layout (game screen) ────────────────────────────── */
.app {
  position: relative; z-index: 2;
  width: min(1060px, 100%); min-height: 100svh; margin: 0 auto;
  padding: clamp(8px, 1.6vh, 18px) clamp(10px, 3vw, 26px) 20px;
  display: flex; flex-direction: column;
}
.topbar {
  width: min(700px, 100%); margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.stage-title { flex: 1; min-width: 0; text-align: center; line-height: 1.1; }
.stage-title b {
  display: block; font-family: var(--round); font-size: clamp(15px, 3.6vw, 20px); font-weight: 900;
  color: #fff; text-shadow: 0 2px 0 var(--outline), 0 0 8px rgba(0,0,0,.25); -webkit-text-stroke: 1px var(--outline); paint-order: stroke fill;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.stage-title span { font-size: 11px; font-weight: 800; color: rgba(255,255,255,.92); text-shadow: 0 1px 2px rgba(0,0,0,.4); letter-spacing: .08em; }
.icon-btn {
  position: relative; display: grid; place-items: center; flex: none;
  width: 46px; height: 46px; padding: 0; cursor: pointer;
  border: 3px solid var(--outline); border-radius: 15px;
  background: linear-gradient(180deg, #fff6d6, #ffd985);
  box-shadow: 0 4px 0 var(--frame-edge), inset 0 2px 0 rgba(255,255,255,.8);
  transition: transform .12s ease;
}
.icon-btn:hover { transform: translateY(-1px); }
.icon-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--frame-edge); }
.icon-btn svg { width: 22px; height: 22px; fill: none; stroke: var(--outline); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn .icon-sound-off { display: none; }
.icon-btn.is-muted .icon-sound-on { display: none; }
.icon-btn.is-muted .icon-sound-off { display: block; }

.game-shell { width: min(700px, 100%); margin: 0 auto; flex: 1; display: flex; flex-direction: column; justify-content: center; }
.hud { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; margin: 8px 0 12px; }
.hud-card {
  position: relative; padding: 8px 14px 9px; min-width: 0;
  border: 3px solid var(--outline); border-radius: 20px;
  background: linear-gradient(180deg, var(--panel-1), var(--panel-2));
  box-shadow: 0 5px 0 var(--frame-edge), 0 14px 22px rgba(0,0,0,.14), inset 0 2px 0 #fff;
  overflow: hidden;
}
.hud-card::after { content: ""; position: absolute; left: 8px; right: 8px; top: 3px; height: 38%; border-radius: 14px; background: linear-gradient(180deg, rgba(255,255,255,.7), transparent); pointer-events: none; }
.hud-label { display: block; font-family: var(--round); font-size: 10px; font-weight: 900; letter-spacing: .14em; color: var(--ink-soft); }
.hud-value { display: block; font-family: var(--round); font-size: clamp(26px, 6vw, 36px); font-weight: 900; line-height: 1.05; color: var(--orange-deep); text-shadow: 0 2px 0 rgba(255,255,255,.8); }
.hud-sub { display: block; margin-top: 1px; font-size: 10.5px; font-weight: 800; color: var(--ink-soft); }
.hud-sub b { color: var(--ink); }
.combo-card { text-align: right; }
.combo-card .hud-value { color: #d63a1a; }
.combo-meter { display: block; height: 7px; margin-top: 5px; border-radius: 5px; background: rgba(120,80,30,.18); overflow: hidden; }
.combo-meter i { display: block; height: 100%; width: 0; border-radius: 5px; background: linear-gradient(90deg, #ffd23c, #ff6a2b); transition: width .2s ease; }
.hud-card.is-bumping .hud-value { animation: number-bump .28s ease-out; }
.combo-card.is-hot { background: linear-gradient(180deg, #fff3d2, #ffcf8a); }
.combo-card.is-hot .hud-value { animation: combo-throb .9s ease-in-out infinite; }

.timer-wrap { position: relative; width: clamp(78px, 17vw, 100px); aspect-ratio: 1; }
.timer-ring { width: 100%; height: 100%; transform: rotate(-90deg); filter: drop-shadow(0 4px 0 var(--frame-edge)); }
.timer-ring .timer-track { fill: #fff8e4; stroke: var(--outline); stroke-width: 11; }
.timer-ring .timer-arc { fill: none; stroke: #ffb02e; stroke-width: 8; stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: 0; transition: stroke-dashoffset .12s linear; }
.timer-wrap.is-danger .timer-arc { stroke: #ff4a3a; }
.timer-wrap.is-danger { animation: danger-pulse .5s ease-in-out infinite; }
.timer-content { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; font-family: var(--round); font-weight: 900; color: var(--ink); line-height: 1; }
.timer-content span { font-size: clamp(26px, 6vw, 34px); }
.timer-content small { font-size: 10px; color: var(--ink-soft); }
.level-badge {
  position: absolute; left: 50%; bottom: -9px; transform: translateX(-50%); padding: 2px 10px; white-space: nowrap;
  border: 2px solid var(--outline); border-radius: 999px; background: var(--accent); color: #fff;
  font-size: 10px; font-weight: 900; letter-spacing: .08em; text-shadow: 0 1px 0 rgba(0,0,0,.3);
}

/* prompt sign */
.prompt {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  min-height: 66px; margin: 0 0 12px; padding: 9px 18px 10px;
  border: 3px solid var(--outline); border-radius: 22px;
  background: linear-gradient(180deg, var(--panel-1), var(--panel-2));
  box-shadow: 0 5px 0 var(--frame-edge), 0 16px 24px rgba(0,0,0,.16), inset 0 2px 0 #fff;
  text-align: center;
}
.prompt::before, .prompt::after {
  content: ""; position: absolute; top: 50%; width: 9px; height: 9px; margin-top: -4.5px; border-radius: 50%;
  background: var(--panel-edge); box-shadow: inset 0 -2px 0 rgba(0,0,0,.18);
}
.prompt::before { left: 9px; } .prompt::after { right: 9px; }
.prompt.is-new { animation: prompt-drop .5s cubic-bezier(.2, 1.4, .4, 1); }
.prompt-main { font-family: var(--round); font-size: clamp(20px, 4.8vw, 30px); font-weight: 900; line-height: 1.2; color: var(--ink); display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; }
.prompt-main .chip { display: inline-block; padding: 0 .45em; border: 2px solid rgba(0,0,0,.35); border-radius: 10px; background: var(--c, #e0463a); color: #fff; text-shadow: 0 1px 0 rgba(0,0,0,.35); }
.prompt-main .dot { display: inline-block; width: .75em; height: .75em; margin: 0 .15em; border-radius: 50%; background: var(--c); border: 2px solid rgba(0,0,0,.3); }
.prompt-main .sample { display: inline-block; position: relative; width: var(--sz, 76px); height: var(--sz, 76px); margin: -8px 2px -10px; flex: none; border: 3px solid var(--outline); border-radius: 50%; background: radial-gradient(circle at 50% 30%, #fff, #ffe9ae); overflow: hidden; box-shadow: inset 0 -4px 0 rgba(0,0,0,.08); }
.prompt-main .sample .mole-lite { position: absolute; }
.prompt-main .sample svg { width: 100%; height: auto; }
.prompt-sub { font-size: 12px; font-weight: 800; color: var(--ink-soft); }
.prompt-time { width: min(340px, 92%); height: 7px; margin-top: 3px; border: 2px solid var(--outline); border-radius: 5px; background: rgba(120,80,30,.15); overflow: hidden; }
.prompt-time i { display: block; height: 100%; width: 100%; transform-origin: left center; background: linear-gradient(90deg, #ff6a3a, #ffc93c 45%, #7bd45d); background-size: 340px 100%; }

.hint { margin: 12px auto 0; text-align: center; font-size: 11px; font-weight: 800; color: rgba(255,255,255,.95); text-shadow: 0 1px 3px rgba(0,0,0,.45); }
.hint kbd { display: inline-block; min-width: 15px; padding: 0 4px; margin: 0 1px; border: 1px solid rgba(255,255,255,.5); border-bottom-width: 2px; border-radius: 4px; background: rgba(0,0,0,.2); font-family: var(--round); font-size: 9px; line-height: 14px; }

/* ── Board ───────────────────────────────────────────────── */
.board-shell { position: relative; width: min(100%, max(300px, calc((100svh - var(--chrome, 360px)) * var(--ar, 1.08)))); margin: 0 auto; }
.board-frame {
  position: relative; width: 100%; padding: clamp(9px, 1.7vw, 14px);
  border: 4px solid var(--outline); border-radius: clamp(26px, 4vw, 38px);
  background: linear-gradient(150deg, var(--frame-1) 0%, var(--frame-2) 50%, var(--frame-3) 100%);
  box-shadow: 0 8px 0 var(--frame-edge), 0 28px 40px rgba(0,0,0,.28), inset 0 3px 0 rgba(255,255,255,.55);
  transition: transform .2s ease;
}
body[data-world="candy"] .board-frame { background: repeating-linear-gradient(45deg, #fff 0 14px, #ff7aa8 14px 28px); }
body[data-world="candy"] .board-frame::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 5px rgba(255,255,255,.35); pointer-events: none; }
.board-frame.is-shaking { animation: board-shake .36s cubic-bezier(.36,.07,.19,.97); }
.board {
  position: relative; display: grid; grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr));
  gap: var(--gap, clamp(3px, .9vw, 9px)); padding: clamp(6px, 1.6vw, 14px);
  overflow: hidden; border: 3px solid rgba(0,0,0,.28); border-radius: clamp(18px, 3vw, 28px);
  background:
    radial-gradient(circle at 28% 6%, rgba(255,255,255,.28), transparent 34%),
    radial-gradient(circle at 82% 92%, rgba(0,0,0,.2), transparent 42%),
    repeating-linear-gradient(114deg, rgba(255,255,255,.05) 0 2px, transparent 2px 13px),
    linear-gradient(150deg, var(--board-1) 0%, var(--board-2) 50%, var(--board-3) 100%);
  box-shadow: inset 0 8px 20px rgba(0,0,0,.2), inset 0 -6px 14px rgba(0,0,0,.2);
  isolation: isolate;
}
.board::after { content: ""; position: absolute; inset: 0; z-index: 7; pointer-events: none; opacity: .2;
  background-image: radial-gradient(circle, rgba(0,0,0,.6) 0 1px, transparent 1.5px), radial-gradient(circle, rgba(255,255,255,.9) 0 1px, transparent 1.5px);
  background-size: 37px 41px, 61px 53px; background-position: 7px 9px, 25px 31px; mix-blend-mode: soft-light; }
.board-flower { position: absolute; z-index: 9; width: clamp(32px, 5vw, 50px); height: auto; pointer-events: none; filter: drop-shadow(0 4px 4px rgba(0,0,0,.2)); }
.board-flower--tl { left: -14px; top: -16px; transform: rotate(-16deg); }
.board-flower--br { right: -12px; bottom: -14px; transform: rotate(151deg); width: clamp(26px, 4vw, 42px); }

.hole {
  position: relative; display: block; width: 100%; aspect-ratio: 1.08; padding: 0; border: 0; background: transparent;
  border-radius: clamp(10px, 2vw, 22px); overflow: hidden; cursor: pointer; touch-action: none; isolation: isolate;
  -webkit-user-select: none; user-select: none; container-type: inline-size;
}
.hole:focus-visible { outline: 3px solid #fff1a0; outline-offset: -4px; }
.hole::before { content: ""; position: absolute; left: 7%; bottom: 18%; width: 86%; height: 16%; border-radius: 50%; background: rgba(0,0,0,.22); filter: blur(6px); z-index: 0; pointer-events: none; }
.hole__aura {
  position: absolute; left: 6%; right: 6%; bottom: 4%; height: 72%; border-radius: 50%; z-index: 0; opacity: 0; transform: scale(.75);
  transition: opacity .2s ease, transform .25s ease; pointer-events: none;
  background: radial-gradient(ellipse at 50% 66%, rgba(255,216,92,.55), rgba(255,207,86,.14) 48%, transparent 72%);
}
.hole.type-gold .hole__aura { opacity: 1; transform: scale(1); }
.hole.type-bomb .hole__aura, .hole.is-boss .hole__aura { opacity: 1; transform: scale(1); background: radial-gradient(ellipse at 50% 66%, rgba(255,92,67,.5), rgba(255,87,61,.12) 48%, transparent 72%); }
.hole.is-sync .hole__aura { opacity: 1; transform: scale(1); background: radial-gradient(ellipse at 50% 66%, color-mix(in srgb, var(--sync) 70%, transparent), color-mix(in srgb, var(--sync) 18%, transparent) 50%, transparent 72%); }
.hole__rim {
  position: absolute; left: 6%; bottom: 8%; width: 88%; height: 40%; z-index: 1; border-radius: 50%;
  border: 2px solid rgba(0,0,0,.35);
  background: radial-gradient(ellipse at 50% 28%, var(--dirt-1) 0 34%, var(--dirt-2) 46%, var(--dirt-3) 58%, var(--dirt-4) 66%, var(--dirt-3) 80%, var(--dirt-2) 100%);
  box-shadow: inset 0 8px 13px rgba(0,0,0,.6), 0 4px 0 rgba(255,255,255,.12), 0 8px 12px rgba(0,0,0,.2);
  pointer-events: none;
}
.hole__pit { position: absolute; left: 12%; bottom: 14%; width: 76%; height: 27%; z-index: 2; border-radius: 50%; background: radial-gradient(ellipse at 50% 26%, #0c0703 0 42%, #1c1008 72%, var(--dirt-2) 100%); box-shadow: inset 0 6px 10px #050301; pointer-events: none; }
.hole__shadow { position: absolute; left: 23%; bottom: 21%; width: 54%; height: 10%; z-index: 3; border-radius: 50%; background: rgba(0,0,0,.4); filter: blur(3px); opacity: 0; transform: scale(.6); transition: opacity .25s ease, transform .25s ease; pointer-events: none; }
.hole.is-active .hole__shadow { opacity: 1; transform: scale(1); }
.hole__mole-clip { position: absolute; inset: 0; z-index: 4; overflow: hidden; border-radius: inherit; pointer-events: none; }
.mole {
  --c1: #a66f4f; --c2: #7e4f34; --c3: #e6bf9a; --c4: #f0a592; --c5: #e57a88; --ol: #4a2814;
  position: absolute; left: 15%; bottom: 10%; width: 70%; height: auto;
  transform: translateY(113%) scale(.9) rotate(4deg); transform-origin: 50% 100%;
  transition: transform .34s cubic-bezier(.16, 1.2, .34, 1); will-change: transform;
  filter: drop-shadow(0 5px 4px rgba(0,0,0,.28));
}
.mole-art { display: block; }
.hole.type-gold .mole { --c1: #f6c23c; --c2: #cf8f22; --c3: #fff0b8; --c4: #ffd9a0; --c5: #a35d12; --ol: #6a3d08; filter: drop-shadow(0 0 9px rgba(255,200,61,.65)) drop-shadow(0 5px 4px rgba(0,0,0,.25)); }
.hole.type-bomb .mole { --c1: #75607f; --c2: #4b3b55; --c3: #a58ab3; --c4: #c19cc4; --c5: #2d1c35; --ol: #2a1830; filter: drop-shadow(0 0 8px rgba(255,78,57,.4)) drop-shadow(0 5px 4px rgba(0,0,0,.28)); }
.mole.is-up { transform: translateY(2%) scale(1) rotate(0deg); }
.mole.is-up .mole-svg { animation: mole-bob 2.4s ease-in-out .35s infinite; transform-origin: 50% 94%; }
.hole.is-boss .mole { transform-origin: 50% 100%; }
.hole.is-boss .mole.is-up { transform: translateY(0%) scale(1.1); }
.mole.is-hit { animation: mole-squash .28s cubic-bezier(.2,.7,.3,1) both; }
.mole.is-hit .mole-eyes { opacity: 0; }
.mole.is-hit .mole-eyes-x { opacity: 1; }
.mole.is-hit .mole-mouth { opacity: 0; }
.mole.is-hit .mole-mouth-o { opacity: 1; }
.hole__lip {
  position: absolute; left: 5%; bottom: 6%; width: 90%; height: 17%; z-index: 5; border-radius: 50%;
  border: 2px solid rgba(0,0,0,.35);
  background: linear-gradient(180deg, var(--dirt-4) 0%, var(--dirt-3) 30%, var(--dirt-2) 70%, var(--dirt-1) 100%);
  box-shadow: inset 0 2px 0 rgba(255,255,255,.3), inset 0 -5px 8px rgba(0,0,0,.34), 0 5px 9px rgba(0,0,0,.2);
  pointer-events: none;
}
.hole.type-gold .hole__lip { box-shadow: inset 0 2px 0 #ffe49c, inset 0 -5px 8px rgba(94,61,7,.27), 0 0 15px rgba(255,204,73,.6), 0 5px 9px rgba(0,0,0,.2); }
.hole.type-bomb .hole__lip { box-shadow: inset 0 2px 0 #e89b8f, inset 0 -5px 8px rgba(78,30,20,.34), 0 0 15px rgba(255,91,70,.45), 0 5px 9px rgba(0,0,0,.2); }
.hole__tuft { position: absolute; bottom: 17%; z-index: 6; width: 16%; height: 17%; background: linear-gradient(90deg, #2f713e 0%, #65ad52 48%, #387d43 100%); clip-path: polygon(0 100%, 8% 50%, 16% 83%, 31% 8%, 39% 71%, 55% 37%, 63% 100%); pointer-events: none; transform-origin: bottom center; }
body[data-world="candy"] .hole__tuft { background: linear-gradient(90deg, #ff8bd2, #fff, #ff8bd2); }
body[data-world="night"] .hole__tuft { background: linear-gradient(90deg, #6a8cff, #bfe0ff, #6a8cff); }
body[data-world="snow"] .hole__tuft { background: linear-gradient(90deg, #fff, #cfe9ff, #fff); }
body[data-world="space"] .hole__tuft { background: linear-gradient(90deg, #c36bff, #ffd6ff, #c36bff); }
.hole__tuft--l { left: 5%; transform: rotate(-9deg); }
.hole__tuft--r { right: 5%; transform: scaleX(-1) rotate(-8deg); }
.type-tag {
  position: absolute; top: 9%; right: 11%; z-index: 7; display: grid; place-items: center; width: clamp(18px, 24cqw, 28px); aspect-ratio: 1; border-radius: 50%;
  border: 2px solid var(--outline); font-family: var(--round); font-size: clamp(11px, 13cqw, 16px); font-weight: 900; line-height: 1; opacity: 0;
  transform: scale(.4) rotate(-12deg); transition: opacity .18s ease, transform .24s cubic-bezier(.2,1.5,.4,1); pointer-events: none;
}
.hole.type-gold .type-tag { opacity: 1; transform: scale(1) rotate(8deg); color: #7a4a00; background: linear-gradient(145deg, #fff5b8, #ffc73e); animation: tag-twinkle 1.3s ease-in-out infinite; }
.hole.type-bomb .type-tag { opacity: 1; transform: scale(1) rotate(8deg); color: #fff8ef; background: linear-gradient(145deg, #ff8b70, #e5432e); animation: tag-danger .7s ease-in-out infinite; }
.hole.is-sync .type-tag { opacity: 1; transform: scale(1) rotate(8deg); color: #fff; background: var(--sync); text-shadow: 0 1px 0 rgba(0,0,0,.4); }
.hole.is-picked .type-tag { opacity: 1; transform: scale(1) rotate(8deg); color: #fff; background: var(--grp, #34b24f); text-shadow: 0 1px 0 rgba(0,0,0,.35); }
.hole.is-picked .hole__aura { opacity: 1; transform: scale(1); background: radial-gradient(ellipse at 50% 66%, color-mix(in srgb, var(--grp, #34b24f) 70%, transparent), color-mix(in srgb, var(--grp, #34b24f) 20%, transparent) 50%, transparent 72%); }
.hole.is-hint::after { content: ""; position: absolute; inset: 4%; z-index: 10; border: 3px dashed #ff2f92; border-radius: 18px; pointer-events: none; animation: hint-pulse .7s ease-in-out infinite alternate; }
.hole.is-linkflash .mole { filter: drop-shadow(0 0 12px #fff) brightness(1.25); }

.mole-svg { display: block; width: 100%; height: auto; overflow: visible; }
.mole-crown, .mole-fuse, .mole-sparkles, .mole-brows, .mole-eyes-x, .mole-mouth-o, .mole-bosscrown { opacity: 0; transition: opacity .18s ease; }
.hole.type-gold .mole-crown, .hole.type-gold .mole-sparkles { opacity: 1; }
.hole.type-gold .mole-crown { animation: crown-glow 1.5s ease-in-out infinite; }
.hole.is-boss .mole-bosscrown { opacity: 1; animation: crown-glow 1.2s ease-in-out infinite; }
.hole.type-bomb .mole-fuse, .hole.type-bomb .mole-brows { opacity: 1; }
.hole.type-bomb .spark { animation: spark-flicker .45s ease-in-out infinite alternate; transform-origin: 73px 9px; }
.hole.type-gold .sparkle { animation: sparkle-twinkle 1.2s ease-in-out infinite alternate; }
.mole-eyes { animation: mole-blink 5.4s infinite; transform-box: fill-box; transform-origin: center; }
.mole-svg .whisker { stroke: var(--ol); opacity: .5; }

/* sign hanging on the belly (numbers, words, emoji) */
.mole-sign {
  position: absolute; left: 50%; top: 71%; z-index: 3; transform: translate(-50%, -50%); min-width: 46%; max-width: 92%;
  padding: .12em .45em .08em; border: 2.5px solid var(--outline); border-radius: 10px;
  background: linear-gradient(180deg, #fffdf0, #f8e2a8); box-shadow: 0 2.5px 0 #7a4a1f, 0 5px 6px rgba(0,0,0,.25);
  color: var(--sign-ink, #4a2c14); font-family: var(--round); font-size: 13.5cqw; font-weight: 900; line-height: 1.15; text-align: center; white-space: nowrap; pointer-events: none;
}
.mole-sign:empty { display: none; }
.mole-sign.is-long { font-size: 9.5cqw; }
.mole-sign.is-xlong { font-size: 7.6cqw; }

.beat-ring { position: absolute; left: 50%; top: 46%; z-index: 9; width: 52%; aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%; border: 3px solid rgba(255,255,255,.6); opacity: 0; pointer-events: none; }
.beat-ring i { position: absolute; inset: -3px; border-radius: 50%; border: 5px solid #ffe27a; box-shadow: 0 0 12px rgba(255,215,90,.9), inset 0 0 8px rgba(255,215,90,.6); transform: scale(1.85); opacity: 0; }
.hole.is-beat .beat-ring { opacity: 1; }
.hole.is-beat .beat-ring i { animation: beat-shrink var(--approach, .6s) linear forwards; }

/* ── Traits (hats, glasses, bows…) shown by data-* on .mole ── */
.tr { display: none; }
[data-hat="cap"] .tr-cap, [data-hat="top"] .tr-top, [data-hat="party"] .tr-party, [data-hat="band"] .tr-band,
[data-hat="chef"] .tr-chef, [data-hat="pirate"] .tr-pirate, [data-hat="cowboy"] .tr-cowboy, [data-hat="wizard"] .tr-wizard, [data-hat="helmet"] .tr-helmet,
[data-glasses="round"] .tr-round, [data-glasses="sun"] .tr-sun, [data-glasses="patch"] .tr-patch, [data-glasses="mask"] .tr-mask,
[data-bow="1"] .tr-bow, [data-spot="1"] .tr-spot, [data-angry="1"] .tr-angry, [data-girl="1"] .tr-girl, [data-stache="1"] .tr-stache { display: inline; }
[data-angry="1"] .mole-mouth { opacity: 0; }

/* ── Tester panel ────────────────────────────────────────── */
.lab { position: fixed; left: 12px; bottom: 12px; z-index: 96; width: 186px; padding: 9px 10px 10px; border: 3px solid var(--outline); border-radius: 16px; background: rgba(255,250,232,.96); box-shadow: 0 5px 0 var(--frame-edge), 0 10px 28px rgba(0,0,0,.3); font-size: 11px; }
.lab-head { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 0; border: 0; background: none; cursor: pointer; font-weight: 900; font-size: 12px; color: #a24d12; }
.lab-body { display: grid; gap: 6px; margin-top: 8px; }
.lab.is-collapsed .lab-body { display: none; }
.lab-btn { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 6px 9px; border: 2px solid rgba(160,120,60,.45); border-radius: 10px; background: #fffdf5; cursor: pointer; font-size: 11px; font-weight: 800; color: #5b4a2a; text-align: left; }
.lab-btn:hover { background: #fff3cf; }
.lab-btn[aria-pressed="true"] { background: #ffe3a0; border-color: #e59a2b; color: #8a3f08; }
.lab-btn kbd { font-family: var(--round); font-size: 9px; padding: 0 4px; border-radius: 4px; background: rgba(0,0,0,.07); }
body:not(.is-playing) .lab { display: none; }

.hammer { position: fixed; left: 0; top: 0; z-index: 85; width: 84px; height: 84px; margin-left: -18px; margin-top: -16px; pointer-events: none; opacity: 0; transform: translate3d(-999px,-999px,0); will-change: transform, opacity; transition: opacity .12s ease; filter: drop-shadow(0 10px 7px rgba(0,0,0,.28)); }
.hammer.is-visible { opacity: 1; }
.hammer__inner { width: 100%; height: 100%; transform-origin: 27px 25px; }
.hammer.is-striking .hammer__inner { animation: hammer-strike .18s cubic-bezier(.2,.8,.3,1); }
.hammer svg { display: block; width: 100%; height: 100%; }
@media (hover: hover) and (pointer: fine) { .board.is-live, .board.is-live * { cursor: none; } }

/* standalone previews (title, codex, prompt sample) */
.mole-lite { display: block; --c1: #a66f4f; --c2: #7e4f34; --c3: #e6bf9a; --c4: #f0a592; --c5: #e57a88; --ol: #4a2814; }
.mole-lite .mole-svg { animation: none; }

.fx-flyer { position: fixed !important; margin: 0 !important; transition: none !important; pointer-events: none; z-index: 91; will-change: transform, opacity; }
.fx-flyer .mole-svg { animation: none !important; }
.fx-flyer .mole-eyes, .fx-flyer .mole-mouth { opacity: 0; }
.fx-flyer .mole-eyes-x, .fx-flyer .mole-mouth-o { opacity: 1; }

/* fine details: belly buttons, freckles, earring (data-btn / data-fr / data-ear) */
.bt, .fk, .ea { display: none; }
[data-btn~="1"] .bt1, [data-btn~="2"] .bt2, [data-btn~="3"] .bt3, [data-btn~="4"] .bt4, [data-btn~="5"] .bt5 { display: inline; }
[data-fr~="1"] .fk1, [data-fr~="2"] .fk2, [data-fr~="3"] .fk3, [data-fr~="4"] .fk4, [data-fr~="5"] .fk5, [data-fr~="6"] .fk6 { display: inline; }
[data-ear="l"] .ea-l, [data-ear="r"] .ea-r { display: inline; }

/* shuffle: whole-body clue */
.prompt-main .sample.is-full { width: 82px; height: 100px; border-radius: 20px; margin: -10px 4px -12px; }
.prompt-main .sample.is-full .mole-lite { left: 0; top: 0; width: 100%; }
@media (max-width: 520px) { .prompt-main .sample.is-full { width: 64px; height: 78px; margin: -6px 2px -8px; } }


/* rhythm timing: the target ring itself changes — WHITE disc + "GOOD" label, ORANGE disc + "PERFECT" label */
.beat-ring::after { content: ""; position: absolute; left: 50%; top: -38%; transform: translateX(-50%); padding: 3px 8px; border-radius: 9px; font: 900 clamp(10px, 12cqw, 15px)/1 var(--round); letter-spacing: .04em; white-space: nowrap; color: #fff; text-shadow: 0 1px 0 rgba(0,0,0,.5); opacity: 0; }
.hole.win-good .beat-ring { border: 5px solid #fff; background: rgba(255, 255, 255, .45); box-shadow: 0 0 0 4px rgba(255, 255, 255, .6), 0 0 22px 8px rgba(255, 255, 255, .95); }
.hole.win-good .beat-ring::after { content: "GOOD"; opacity: 1; background: rgba(70, 80, 110, .85); }
.hole.win-perfect .beat-ring { border: 6px solid #ff7a00; background: rgba(255, 128, 0, .55); box-shadow: 0 0 0 5px rgba(255, 196, 120, .85), 0 0 32px 14px rgba(255, 122, 0, 1); animation: perfect-pulse .18s ease-in-out infinite alternate; }
.hole.win-perfect .beat-ring::after { content: "PERFECT"; opacity: 1; background: #ff7a00; }
@keyframes perfect-pulse { from { transform: translate(-50%, -50%) scale(1); } to { transform: translate(-50%, -50%) scale(1.14); } }
.hole.is-dormant .mole { opacity: .55; filter: grayscale(.7) drop-shadow(0 5px 4px rgba(0,0,0,.28)); }
.hole.is-dormant .beat-ring { opacity: 0; }
