/* Mole Mash Meadow — bright, cheerful, kid-friendly whack-a-mole */

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --grass: #7ec850;
  --grass-dark: #5da83a;
  --sky-top: #63c8f2;
  --sky-bottom: #c8eeff;
  --dirt: #8a5a32;
  --dirt-dark: #6d4525;
  --mole-fur: #a06b3f;
  --sun-yellow: #ffd93b;
  --round-font: 'Comic Sans MS', 'Comic Neue', 'Chalkboard SE', 'Segoe UI Rounded', 'Baloo 2', ui-rounded, sans-serif;
}

html, body {
  height: 100%;
  overflow: hidden;
  font-family: var(--round-font);
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
}

#app {
  position: fixed;
  inset: 0;
  background: linear-gradient(var(--sky-top) 0%, var(--sky-bottom) 55%, var(--grass) 55%, var(--grass-dark) 100%);
  overflow: hidden;
}

/* ---------- Sky & ambient world ---------- */

.sky { position: absolute; inset: 0 0 45% 0; pointer-events: none; }

.sun {
  position: absolute;
  top: 4%;
  right: 6%;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #fff3a8, var(--sun-yellow) 60%, #ffb72e);
  box-shadow: 0 0 60px 20px rgba(255, 217, 59, 0.55);
  animation: sunPulse 5s ease-in-out infinite;
}
.sun::before, .sun::after {
  content: "";
  position: absolute;
  inset: -18px;
  border-radius: 50%;
  background:
    repeating-conic-gradient(from 0deg, rgba(255,200,50,.85) 0deg 10deg, transparent 10deg 30deg);
  z-index: -1;
  animation: raysSpin 40s linear infinite;
}
.sun-face {
  position: absolute; inset: 0;
}
.sun-face::before { /* eyes */
  content: "";
  position: absolute;
  top: 38px; left: 28px;
  width: 10px; height: 14px;
  border-radius: 50%;
  background: #7a4a12;
  box-shadow: 44px 0 #7a4a12;
  animation: sunBlink 6s infinite;
}
.sun-face::after { /* smile */
  content: "";
  position: absolute;
  top: 58px; left: 38px;
  width: 34px; height: 18px;
  border: 4px solid transparent;
  border-bottom-color: #7a4a12;
  border-radius: 50%;
}
@keyframes sunPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}
@keyframes raysSpin { to { transform: rotate(360deg); } }
@keyframes sunBlink {
  0%, 92%, 100% { transform: scaleY(1); }
  95% { transform: scaleY(0.12); }
}

.cloud {
  position: absolute;
  width: 110px;
  height: 38px;
  background: #fff;
  border-radius: 40px;
  opacity: 0.92;
  animation: cloudDrift linear infinite;
}
.cloud::before, .cloud::after {
  content: "";
  position: absolute;
  background: #fff;
  border-radius: 50%;
}
.cloud::before { width: 46px; height: 46px; top: -22px; left: 18px; }
.cloud::after { width: 32px; height: 32px; top: -14px; right: 20px; }
.cloud-1 { top: 8%; animation-duration: 55s; animation-delay: -10s; transform: scale(1); }
.cloud-2 { top: 22%; animation-duration: 75s; animation-delay: -40s; transform: scale(0.7); opacity: 0.8; }
.cloud-3 { top: 2%; animation-duration: 95s; animation-delay: -65s; transform: scale(1.3); opacity: 0.7; }
.cloud-4 { top: 34%; animation-duration: 62s; animation-delay: -25s; transform: scale(0.55); opacity: 0.75; }
@keyframes cloudDrift {
  from { left: -140px; }
  to { left: 110%; }
}

/* ---------- Scene / hills / flowers ---------- */

#scene { position: absolute; inset: 0; }

.hills { position: absolute; inset: 0; pointer-events: none; }
.hill {
  position: absolute;
  border-radius: 50% 50% 0 0;
}
.hill-back {
  width: 130%; height: 42%;
  left: -15%; top: 40%;
  background: #94d45e;
}
.hill-front {
  width: 160%; height: 48%;
  left: -30%; top: 50%;
  background: var(--grass);
}

.flower {
  position: absolute;
  width: 10px;
  height: 34px;
  transform-origin: bottom center;
  animation: sway 3.2s ease-in-out infinite alternate;
  pointer-events: none;
  z-index: 1;
}
.flower .stem {
  position: absolute;
  bottom: 0; left: 3px;
  width: 4px; height: 26px;
  background: #3f8f2f;
  border-radius: 2px;
}
.flower .leaf {
  position: absolute;
  bottom: 6px; left: 5px;
  width: 9px; height: 5px;
  background: #3f8f2f;
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  transform: rotate(-30deg);
}
.flower .head {
  position: absolute;
  top: -2px; left: -4px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, #ffd93b 0 26%, transparent 27%),
    repeating-conic-gradient(var(--petal, #ff7bac) 0deg 40deg, transparent 40deg 72deg);
  -webkit-mask: radial-gradient(circle, black 99%, transparent 100%);
  mask: radial-gradient(circle, black 99%, transparent 100%);
}
@keyframes sway {
  from { transform: rotate(-6deg); }
  to { transform: rotate(6deg); }
}

.butterfly {
  position: absolute;
  width: 22px; height: 18px;
  pointer-events: none;
  z-index: 2;
  filter: drop-shadow(0 2px 2px rgba(0,0,0,0.15));
}
.butterfly .wing {
  position: absolute;
  width: 10px; height: 16px;
  border-radius: 50% 50% 40% 40%;
  background: var(--bwing, #ff9de2);
  top: 0;
}
.butterfly .wing.left { left: 0; transform-origin: right center; animation: flapL 0.45s ease-in-out infinite alternate; }
.butterfly .wing.right { right: 0; transform-origin: left center; animation: flapR 0.45s ease-in-out infinite alternate; }
.butterfly .bfly-body {
  position: absolute;
  left: 9px; top: 2px;
  width: 4px; height: 13px;
  background: #4a3320;
  border-radius: 2px;
}
@keyframes flapL { from { transform: rotateY(10deg); } to { transform: rotateY(70deg); } }
@keyframes flapR { from { transform: rotateY(-10deg); } to { transform: rotateY(-70deg); } }

/* ---------- HUD ---------- */

#hud {
  position: absolute;
  top: 8px; left: 8px; right: 8px;
  display: flex;
  gap: 8px;
  align-items: center;
  z-index: 40;
}
.hidden { display: none !important; }

.hud-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.92);
  border: 3px solid #f2b91c;
  border-radius: 999px;
  padding: 4px 14px;
  font-size: clamp(16px, 2.6vmin, 22px);
  font-weight: 700;
  color: #5a3a12;
  box-shadow: 0 3px 0 rgba(120, 80, 10, 0.25);
}
.hud-star { font-size: 1.15em; }
#score { min-width: 2ch; text-align: right; }
#score.bump { animation: scoreBump 0.35s ease; display: inline-block; }
@keyframes scoreBump {
  0% { transform: scale(1); }
  40% { transform: scale(1.5) rotate(-4deg); color: #f08c00; }
  100% { transform: scale(1); }
}
.hud-label { font-size: 0.75em; color: #a07c3c; }

#timer-pill { position: relative; padding: 4px 12px 4px 6px; }
.timer-ring { width: 30px; height: 30px; transform: rotate(-90deg); }
.timer-ring-bg {
  fill: none;
  stroke: #eadfc8;
  stroke-width: 5;
}
.timer-ring-fill {
  fill: none;
  stroke: #66bb44;
  stroke-width: 5;
  stroke-linecap: round;
  stroke-dasharray: 97.4;
  stroke-dashoffset: 0;
  transition: stroke 0.4s;
}
#time-left { min-width: 2ch; text-align: center; }

.hud-buttons { margin-left: auto; display: flex; gap: 8px; }
.icon-btn {
  width: 46px; height: 46px;
  border-radius: 50%;
  border: 3px solid #f2b91c;
  background: rgba(255, 255, 255, 0.92);
  font-size: 20px;
  cursor: pointer;
  box-shadow: 0 3px 0 rgba(120, 80, 10, 0.25);
  transition: transform 0.12s;
}
.icon-btn:active { transform: scale(0.88); }

/* ---------- Board of holes ---------- */

#board {
  position: absolute;
  left: 50%;
  bottom: 2.5%;
  transform: translateX(-50%);
  width: min(94vw, 640px);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(6px, 1.6vmin, 16px);
  padding: 10px;
  z-index: 10;
}

.hole {
  position: relative;
  aspect-ratio: 1 / 1.05;
  cursor: pointer;
}
.hole-inner {
  position: absolute;
  inset: 0;
}

/* dirt mound */
.mound {
  position: absolute;
  left: 6%; right: 6%;
  bottom: 4%;
  height: 46%;
  background: radial-gradient(ellipse at 50% 30%, var(--dirt) 0%, var(--dirt-dark) 85%);
  border-radius: 50% 50% 46% 46% / 62% 62% 38% 38%;
  box-shadow: inset 0 -8px 14px rgba(0,0,0,0.28), 0 6px 8px rgba(60, 90, 20, 0.35);
  z-index: 3;
}
/* the dark opening the mole pops out of */
.hole-opening {
  position: absolute;
  left: 23%; right: 23%;
  bottom: 30%;
  height: 20%;
  background: radial-gradient(ellipse at 50% 68%, #170a02 42%, #42250c 82%, transparent 84%);
  border-radius: 50%;
  z-index: 4;
  overflow: hidden;
  box-shadow: inset 0 4px 8px rgba(0,0,0,0.6);
}
/* grass lip over the front of the hole */
.mound-front {
  position: absolute;
  left: 4%; right: 4%;
  bottom: 1%;
  height: 24%;
  background: radial-gradient(ellipse at 50% 0%, var(--grass) 55%, var(--grass-dark) 100%);
  border-radius: 50% 50% 46% 46% / 60% 60% 40% 40%;
  z-index: 6;
}
.mound-front::before, .mound-front::after {
  content: "";
  position: absolute;
  bottom: 60%;
  width: 5px; height: 14px;
  background: #4c9c33;
  border-radius: 4px 4px 0 0;
}
.mound-front::before { left: 22%; transform: rotate(-14deg); }
.mound-front::after { right: 26%; transform: rotate(12deg); height: 11px; }

/* rustle telegraph: shaking dirt crumbs */
.crumb {
  position: absolute;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #6d4525;
  z-index: 7;
  opacity: 0;
  pointer-events: none;
}
.hole.rustling .crumb { animation: crumbHop 0.32s ease-in-out infinite; }
.hole.rustling .crumb.c1 { left: 30%; bottom: 52%; animation-delay: 0s; }
.hole.rustling .crumb.c2 { left: 55%; bottom: 55%; animation-delay: 0.1s; }
.hole.rustling .crumb.c3 { left: 44%; bottom: 48%; animation-delay: 0.2s; }
@keyframes crumbHop {
  0%, 100% { transform: translateY(0) rotate(0deg); opacity: 1; }
  50% { transform: translateY(-9px) rotate(40deg); opacity: 1; }
}
.hole.rustling .mound { animation: moundWiggle 0.32s ease-in-out infinite; }
@keyframes moundWiggle {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-1.4deg); }
  75% { transform: rotate(1.4deg); }
}

/* ---------- Moles ---------- */

.mole-wrap {
  position: absolute;
  left: 17%; right: 17%;
  bottom: 24%;
  height: 105%;
  z-index: 5;
  transform: translateY(102%);
  pointer-events: none;
}
.mole-wrap.up {
  animation: molePop 0.28s cubic-bezier(0.2, 1.6, 0.4, 1) forwards;
}
.mole-wrap.peek {
  animation: molePeek 0.22s ease-out forwards;
}
.mole-wrap.down {
  animation: moleDown 0.26s ease-in forwards;
}
.mole-wrap.bopped {
  animation: moleBopped 0.55s cubic-bezier(0.3, 0.8, 0.5, 1) forwards;
}
@keyframes molePop {
  0% { transform: translateY(102%) scaleY(0.9); }
  60% { transform: translateY(-4%) scaleY(1.06); }
  100% { transform: translateY(0) scaleY(1); }
}
@keyframes molePeek {
  from { transform: translateY(102%); }
  to { transform: translateY(72%); }
}
@keyframes moleDown {
  0% { transform: translateY(0) scaleY(1); }
  30% { transform: translateY(-3%) scaleY(1.05); }
  100% { transform: translateY(102%) scaleY(0.92); }
}
@keyframes moleBopped {
  0% { transform: translateY(0) scale(1, 1); }
  18% { transform: translateY(6%) scale(1.35, 0.55) rotate(-3deg); }
  36% { transform: translateY(-2%) scale(0.85, 1.2) rotate(3deg); }
  55% { transform: translateY(3%) scale(1.15, 0.8); }
  100% { transform: translateY(102%) scale(1, 0.9); }
}

/* idle bob while up */
.mole-wrap.up .mole {
  animation: moleIdleBob 1.6s ease-in-out infinite;
}
@keyframes moleIdleBob {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  50% { transform: translateY(-4%) rotate(1.5deg); }
}

.mole {
  position: absolute;
  inset: 0;
  transform-origin: bottom center;
}
.mole svg { width: 100%; height: 100%; display: block; overflow: visible; }

/* dizzy stars ring after a hit */
.dizzy {
  position: absolute;
  left: 50%; top: 2%;
  width: 90px; height: 34px;
  transform: translateX(-50%);
  z-index: 8;
  pointer-events: none;
}
.dizzy span {
  position: absolute;
  font-size: 18px;
  animation: dizzySpin 0.8s linear infinite;
}
.dizzy span:nth-child(1) { left: 0; top: 8px; animation-delay: 0s; }
.dizzy span:nth-child(2) { left: 34px; top: -6px; animation-delay: -0.26s; }
.dizzy span:nth-child(3) { right: 0; top: 8px; animation-delay: -0.53s; }
@keyframes dizzySpin {
  0% { transform: rotate(0deg) translateX(4px) rotate(0deg) scale(0.8); opacity: 0.6; }
  50% { transform: rotate(180deg) translateX(4px) rotate(-180deg) scale(1.15); opacity: 1; }
  100% { transform: rotate(360deg) translateX(4px) rotate(-360deg) scale(0.8); opacity: 0.6; }
}

/* score popup */
.pop-score {
  position: fixed;
  z-index: 90;
  font-weight: 800;
  font-size: clamp(20px, 4vmin, 32px);
  color: #fff;
  text-shadow: 0 2px 0 #c96a00, 0 0 12px rgba(255, 190, 60, 0.8);
  pointer-events: none;
  animation: popScore 0.85s ease-out forwards;
}
.pop-score.golden { color: #ffe14d; text-shadow: 0 2px 0 #b8860b, 0 0 18px rgba(255, 225, 77, 0.95); font-size: clamp(26px, 5vmin, 40px); }
.pop-score.oops { color: #bcd8ff; text-shadow: 0 2px 0 #4a6a9c; font-size: clamp(16px, 3vmin, 24px); }
@keyframes popScore {
  0% { transform: translate(-50%, 0) scale(0.4); opacity: 0; }
  20% { transform: translate(-50%, -18px) scale(1.25); opacity: 1; }
  70% { transform: translate(-50%, -52px) scale(1); opacity: 1; }
  100% { transform: translate(-50%, -78px) scale(0.9); opacity: 0; }
}

/* confetti & star particles */
.particle {
  position: fixed;
  z-index: 85;
  pointer-events: none;
  will-change: transform, opacity;
}
.confetto {
  width: 10px; height: 10px;
  border-radius: 2px;
}
.starbit {
  font-size: 16px;
  line-height: 1;
}

/* hammer swing */
.hammer {
  position: fixed;
  z-index: 95;
  font-size: 46px;
  pointer-events: none;
  transform-origin: 85% 85%;
  filter: drop-shadow(0 4px 4px rgba(0,0,0,0.3));
}
.hammer.swing {
  animation: hammerSwing 0.32s ease-out forwards;
}
@keyframes hammerSwing {
  0% { transform: translate(-70%, -95%) rotate(-55deg) scale(0.9); opacity: 0.9; }
  35% { transform: translate(-62%, -82%) rotate(18deg) scale(1.1); opacity: 1; }
  60% { transform: translate(-66%, -88%) rotate(-12deg) scale(1); opacity: 1; }
  100% { transform: translate(-70%, -95%) rotate(-30deg) scale(0.95); opacity: 0; }
}

/* ring flash where a hit lands */
.hit-ring {
  position: fixed;
  z-index: 84;
  width: 14px; height: 14px;
  border: 4px solid #fff;
  border-radius: 50%;
  pointer-events: none;
  animation: hitRing 0.45s ease-out forwards;
}
@keyframes hitRing {
  from { transform: translate(-50%, -50%) scale(0.5); opacity: 0.95; }
  to { transform: translate(-50%, -50%) scale(4.2); opacity: 0; }
}

/* ---------- Cheer banner ---------- */

#cheer {
  position: absolute;
  top: 16%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 60;
  font-size: clamp(24px, 6vmin, 48px);
  font-weight: 900;
  color: #fff;
  text-shadow: 0 3px 0 #e07b00, 0 0 22px rgba(255, 170, 30, 0.9);
  pointer-events: none;
  white-space: nowrap;
}
#cheer.show { animation: cheerPop 1.15s cubic-bezier(0.2, 1.5, 0.4, 1) forwards; }
@keyframes cheerPop {
  0% { transform: translateX(-50%) scale(0) rotate(-8deg); opacity: 0; }
  25% { transform: translateX(-50%) scale(1.2) rotate(3deg); opacity: 1; }
  45% { transform: translateX(-50%) scale(1) rotate(0deg); }
  75% { transform: translateX(-50%) scale(1) translateY(0); opacity: 1; }
  100% { transform: translateX(-50%) scale(0.95) translateY(-24px); opacity: 0; }
}

/* ---------- Overlays ---------- */

.overlay {
  position: absolute;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(64, 140, 32, 0.28);
  backdrop-filter: blur(2px);
}

#title-screen {
  background: linear-gradient(rgba(99, 200, 242, 0.25), rgba(126, 200, 80, 0.25));
}

.title-card, .panel-card {
  background: rgba(255, 252, 240, 0.96);
  border: 5px solid #f2b91c;
  border-radius: 34px;
  padding: clamp(18px, 4vmin, 40px) clamp(22px, 5vmin, 52px);
  text-align: center;
  box-shadow: 0 12px 0 rgba(120, 80, 10, 0.22), 0 24px 60px rgba(30, 80, 10, 0.3);
  max-width: min(92vw, 520px);
  position: relative;
}
.panel-card { animation: cardIn 0.45s cubic-bezier(0.2, 1.5, 0.4, 1); }
.title-card { animation: cardIn 0.6s cubic-bezier(0.2, 1.5, 0.4, 1); }
@keyframes cardIn {
  from { transform: translateY(40px) scale(0.8); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

.game-title {
  font-size: clamp(34px, 9vmin, 62px);
  line-height: 1.02;
  color: #e07b00;
  text-shadow: 0 3px 0 #fff, 0 6px 0 rgba(180, 110, 0, 0.28);
  letter-spacing: 1px;
  margin-bottom: 12px;
}
.game-title span { display: inline-block; }
.game-title span:nth-child(1) { color: #e07b00; transform: rotate(-3deg); }
.game-title span:nth-child(2) { color: #66bb44; transform: rotate(2deg) translateY(-3px); }
.game-title span:nth-child(3) { color: #3d9bd6; transform: rotate(-1.5deg); }

.tagline {
  font-size: clamp(15px, 3.2vmin, 20px);
  color: #6b4a1d;
  margin-bottom: 20px;
  line-height: 1.45;
}
.title-tip {
  margin-top: 14px;
  font-size: clamp(12px, 2.4vmin, 15px);
  color: #9c7a44;
}

/* little animated moles along the title card top */
.title-moles { height: 62px; position: relative; margin-top: -64px; }
.title-mole {
  position: absolute;
  width: 62px; height: 58px;
  background-image: var(--mole-svg);
  background-size: contain;
  background-repeat: no-repeat;
  filter: drop-shadow(0 4px 3px rgba(0,0,0,0.2));
}
.title-mole::after {
  content: "";
  position: absolute;
  bottom: -6px; left: -6px; right: -6px;
  height: 18px;
  background: radial-gradient(ellipse at 50% 40%, var(--dirt) 0%, var(--dirt-dark) 80%);
  border-radius: 50%;
  z-index: -1;
}
.tm-1 { left: 4%; animation: titleBob 2.2s ease-in-out infinite; }
.tm-2 { left: 50%; margin-left: -31px; animation: titleBob 2.2s ease-in-out 0.5s infinite; width: 74px; height: 68px; }
.tm-3 { right: 4%; animation: titleBob 2.2s ease-in-out 1.1s infinite; }
@keyframes titleBob {
  0%, 100% { transform: translateY(6px) scaleY(0.96); }
  50% { transform: translateY(-10px) scaleY(1.02); }
}

/* buttons */
.big-btn {
  font-family: inherit;
  font-size: clamp(20px, 4.5vmin, 30px);
  font-weight: 800;
  color: #fff;
  background: linear-gradient(#8fdc5e, #57b02e);
  border: none;
  border-radius: 999px;
  padding: 14px 44px;
  cursor: pointer;
  box-shadow: 0 6px 0 #3d8a1c, 0 10px 16px rgba(60, 110, 20, 0.4);
  transition: transform 0.12s, box-shadow 0.12s;
  text-shadow: 0 2px 0 rgba(0,0,0,0.18);
  letter-spacing: 0.5px;
}
.big-btn:hover { transform: translateY(-2px) scale(1.04); box-shadow: 0 8px 0 #3d8a1c, 0 14px 20px rgba(60, 110, 20, 0.4); }
.big-btn:active { transform: translateY(3px) scale(0.97); box-shadow: 0 2px 0 #3d8a1c; }
.big-btn.pulse { animation: btnPulse 1.6s ease-in-out infinite; }
@keyframes btnPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

.small-btn {
  display: block;
  margin: 14px auto 0;
  font-family: inherit;
  font-size: clamp(13px, 2.6vmin, 16px);
  font-weight: 700;
  color: #8a6a34;
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: underline;
}
.small-btn:hover { color: #5a3a12; }

/* round end */
.panel-card h2 {
  font-size: clamp(26px, 6vmin, 42px);
  color: #e07b00;
  text-shadow: 0 2px 0 #fff;
  margin-bottom: 10px;
}
.pause-note { color: #6b4a1d; font-size: clamp(15px, 3vmin, 19px); margin-bottom: 18px; }

.stars-row {
  display: flex;
  justify-content: center;
  gap: 8px;
  font-size: clamp(34px, 8vmin, 54px);
  min-height: 60px;
  margin-bottom: 8px;
}
.stars-row .star {
  display: inline-block;
  opacity: 0.28;
  filter: grayscale(1);
  transform: scale(0.8);
}
.stars-row .star.earned {
  opacity: 1;
  filter: none;
  animation: starEarn 0.6s cubic-bezier(0.2, 1.8, 0.4, 1) forwards;
}
@keyframes starEarn {
  0% { transform: scale(0) rotate(-90deg); opacity: 0; }
  70% { transform: scale(1.35) rotate(10deg); opacity: 1; }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

.badge-row {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
  min-height: 0;
}
.badge {
  background: linear-gradient(#ffe9a8, #ffd35e);
  border: 2px solid #e0a92c;
  color: #7a5210;
  font-weight: 800;
  font-size: clamp(12px, 2.5vmin, 15px);
  border-radius: 999px;
  padding: 4px 12px;
  animation: starEarn 0.5s cubic-bezier(0.2, 1.8, 0.4, 1) backwards;
}
.roundend-score {
  font-size: clamp(20px, 4.5vmin, 30px);
  font-weight: 900;
  color: #57b02e;
  margin-bottom: 4px;
}
.roundend-stats {
  font-size: clamp(13px, 2.8vmin, 17px);
  color: #8a6a34;
  margin-bottom: 18px;
  line-height: 1.5;
}

/* countdown */
#countdown {
  position: absolute;
  inset: 0;
  z-index: 110;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
#countdown span {
  font-size: clamp(70px, 20vmin, 150px);
  font-weight: 900;
  color: #fff;
  text-shadow: 0 6px 0 #e07b00, 0 0 30px rgba(255, 180, 40, 0.9);
  animation: countPop 0.9s cubic-bezier(0.2, 1.6, 0.4, 1) forwards;
}
@keyframes countPop {
  0% { transform: scale(0) rotate(-12deg); opacity: 0; }
  30% { transform: scale(1.25) rotate(4deg); opacity: 1; }
  60% { transform: scale(1); opacity: 1; }
  100% { transform: scale(0.85); opacity: 0; }
}

/* golden glow on golden mole holes */
.mole-wrap.golden-glow::before {
  content: "";
  position: absolute;
  inset: -18% -10%;
  background: radial-gradient(ellipse at 50% 60%, rgba(255, 225, 90, 0.85), transparent 65%);
  z-index: -1;
  animation: goldPulse 0.9s ease-in-out infinite alternate;
  pointer-events: none;
}
@keyframes goldPulse {
  from { opacity: 0.55; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1.08); }
}

/* tap feedback on holes */
.hole.tap-flash .mound-front { filter: brightness(1.25); }

/* board shake when round ends in celebration */
#board.celebrate { animation: boardWiggle 0.5s ease-in-out 3; }
@keyframes boardWiggle {
  0%, 100% { transform: translateX(-50%) rotate(0); }
  25% { transform: translateX(-50.5%) rotate(-0.7deg); }
  75% { transform: translateX(-49.5%) rotate(0.7deg); }
}

/* ---------- small screens ---------- */
@media (max-width: 640px) {
  #board { width: 96vw; bottom: 1.5%; }
  .sun { width: 74px; height: 74px; }
  .sun-face::before { top: 26px; left: 19px; width: 7px; height: 10px; box-shadow: 29px 0 #7a4a12; }
  .sun-face::after { top: 39px; left: 25px; width: 24px; height: 12px; }
  .icon-btn { width: 42px; height: 42px; font-size: 17px; }
  .hud-pill { padding: 3px 10px; border-width: 2px; }
  .title-moles { height: 48px; margin-top: -52px; }
  .title-mole { width: 48px; height: 45px; }
  .tm-2 { width: 58px; height: 53px; margin-left: -29px; }
}

/* reduced motion: keep it calm but playable */
@media (prefers-reduced-motion: reduce) {
  .cloud, .sun, .sun::before, .sun::after, .sun-face::before { animation: none !important; }
  .flower { animation: none !important; }
  .butterfly .wing.left, .butterfly .wing.right { animation-duration: 1.2s; }
  .mole-wrap.up .mole { animation: none; }
  .big-btn.pulse { animation: none; }
  .title-mole { animation: none; }
}

/* mask that clips the mole so it emerges from the hole mouth */
.hole-mask {
  position: absolute;
  left: 19%; right: 19%;
  bottom: 9%;
  height: 108%;
  overflow: hidden;
  z-index: 5;
  pointer-events: none;
}
.hole-mask .mole-wrap {
  position: absolute;
  left: 0; right: 0; top: 0; bottom: 0;
  height: auto;
}
