@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@500;600;700&display=swap');

:root {
  color: #30231d;
  background: #f8d9a9;
  font-family: 'Fredoka', 'Trebuchet MS', sans-serif;
}

* { box-sizing: border-box; }

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 14% 18%, rgba(255, 248, 223, .52) 0 3px, transparent 4px),
    radial-gradient(circle at 84% 76%, rgba(222, 166, 101, .2) 0 5px, transparent 6px),
    #f8d9a9;
}

.game {
  width: min(100% - 40px, 720px);
  margin: 0 auto;
  padding: clamp(42px, 9vw, 84px) 0 64px;
}

.game-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: clamp(34px, 7vw, 58px);
}

h1 {
  margin: 0;
  color: #4c3023;
  font-size: clamp(2.7rem, 9vw, 5.6rem);
  font-weight: 700;
  letter-spacing: -.065em;
  line-height: .88;
  text-shadow: 0 4px 0 #e8b77f;
}

.score {
  display: grid;
  justify-items: end;
  line-height: 1;
}

.score-label {
  color: #9a5f3d;
  font-size: clamp(.95rem, 2.3vw, 1.2rem);
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.score-value {
  color: #4c3023;
  font-size: clamp(2.8rem, 7vw, 4.5rem);
  font-weight: 700;
}

.difficulty {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 0 auto clamp(28px, 5vw, 42px);
}

.difficulty-button {
  padding: 9px 15px;
  border: 2px solid #d59a63;
  border-radius: 999px;
  color: #70432f;
  background: rgba(255, 229, 184, .58);
  font: inherit;
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
}

.difficulty-button:hover,
.difficulty-button.active {
  color: #fff8df;
  background: #9a5f3d;
  border-color: #9a5f3d;
}

.timer { display: grid; justify-items: end; line-height: 1; }

.timer-label {
  color: #9a5f3d;
  font-size: clamp(.95rem, 2.3vw, 1.2rem);
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.timer-value {
  color: #4c3023;
  font-size: clamp(2.8rem, 7vw, 4.5rem);
  font-weight: 700;
}

.board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(18px, 4.8vw, 38px);
  padding: clamp(25px, 5vw, 44px);
  border: 4px solid #e0aa72;
  border-radius: 30px;
  background: rgba(255, 229, 184, .6);
  box-shadow: 0 12px 0 rgba(202, 139, 82, .25), inset 0 2px 0 rgba(255,255,255,.38);
}

.hole {
  position: relative;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #55352b;
  border: clamp(7px, 1.4vw, 12px) solid #774a37;
  box-shadow: inset 0 10px 0 rgba(25, 14, 12, .22), 0 7px 0 #c48851;
}

.cat {
  position: absolute;
  inset: 50% auto auto 50%;
  z-index: 1;
  width: clamp(62px, 21%, 120px);
  aspect-ratio: 1;
  transform: translate(-50%, -58%);
  cursor: pointer;
  user-select: none;
  animation: pop-in .16s ease-out, cat-bob 1.4s ease-in-out .16s infinite;
}

.cat.splat {
  animation: splat .28s ease-out forwards;
  pointer-events: none;
}

.cat.splat::after {
  content: '✦';
  position: absolute;
  inset: 50% auto auto 50%;
  color: #ffb52e;
  font-size: 2.6rem;
  text-shadow: 0 0 0 #e76f51, 18px -10px 0 #e76f51, -18px 8px 0 #e76f51;
  transform: translate(-50%, -50%);
  animation: splat-burst .28s ease-out forwards;
}

.cat.splat .cat-face {
  background: #f0784f;
  border-color: #b94337;
}

.splat-mark {
  position: absolute;
  inset: 50% auto auto 50%;
  z-index: 2;
  width: 58%;
  height: 34%;
  border-radius: 48% 57% 42% 61% / 57% 43% 61% 46%;
  background: #d9473f;
  box-shadow: inset 8px -5px 0 rgba(145, 35, 38, .2), 0 3px 0 #a92f35;
  transform: translate(-50%, -50%) scale(.4) rotate(-8deg);
  animation: splat-mark-in .22s ease-out forwards;
}

.splat-mark::before,
.splat-mark::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  background: #d9473f;
}

.splat-mark::before {
  width: 20%;
  aspect-ratio: 1;
  top: -62%;
  left: 7%;
  box-shadow: 22px 6px 0 -5px, 48px -2px 0 -8px;
}

.splat-mark::after {
  width: 13%;
  aspect-ratio: 1;
  right: -24%;
  bottom: -46%;
  box-shadow: -24px -8px 0 -4px;
}

@keyframes splat-mark-in {
  to { transform: translate(-50%, -50%) scale(1) rotate(-8deg); }
}

.splat-label {
  position: absolute;
  top: -30%;
  left: 50%;
  z-index: 3;
  color: #fff8df;
  font-size: clamp(.7rem, 2vw, 1rem);
  font-weight: 700;
  letter-spacing: .08em;
  text-shadow: 0 2px 0 #b94337;
  transform: translateX(-50%) rotate(-8deg);
}

@keyframes splat {
  to { opacity: .82; transform: translate(-50%, -58%) scale(1.35, .65); }
}

@keyframes splat-burst {
  from { opacity: 1; transform: translate(-50%, -50%) scale(.45) rotate(0); }
  to { opacity: 0; transform: translate(-50%, -50%) scale(1.35) rotate(20deg); }
}

.cat-face {
  position: absolute;
  inset: 12% 0 0;
  border-radius: 48% 48% 45% 45%;
  background: #f2a75d;
  border: 3px solid #a95e3e;
  box-shadow: inset 0 -7px 0 rgba(185, 91, 49, .16), 0 5px 0 rgba(38, 21, 16, .2);
}

.golden-mole .cat-face,
.golden-mole .cat-ear {
  background: #ffd43b;
  border-color: #b87908;
}

.golden-mole .cat-face {
  box-shadow: inset 0 -7px 0 rgba(184, 121, 8, .2), 0 0 14px rgba(255, 196, 37, .85), 0 5px 0 rgba(38, 21, 16, .2);
}

.cat-ear {
  position: absolute;
  top: 0;
  z-index: -1;
  width: 42%;
  height: 46%;
  border: 3px solid #a95e3e;
  background: #f2a75d;
}

.cat-ear-left { left: 4%; transform: rotate(-28deg); border-radius: 70% 15% 20% 15%; }
.cat-ear-right { right: 4%; transform: rotate(28deg); border-radius: 15% 70% 15% 20%; }

.cat-eye {
  position: absolute;
  top: 31%;
  width: 11%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #30231d;
}

.cat-eye-left { left: 27%; }
.cat-eye-right { right: 27%; }

.cat-nose {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 13%;
  aspect-ratio: 1.2;
  border-radius: 50% 50% 45% 45%;
  background: #d96d72;
  transform: translateX(-50%);
}

.cat-mouth {
  position: absolute;
  top: 57%;
  left: 50%;
  width: 17%;
  height: 12%;
  border-bottom: 2px solid #6f3b32;
  border-radius: 0 0 50% 50%;
  transform: translateX(-50%);
}

.cat-whiskers {
  position: absolute;
  top: 55%;
  width: 32%;
  height: 2px;
  background: #6f3b32;
  box-shadow: 0 7px #6f3b32;
}

.cat-whiskers-left { left: -22%; transform: rotate(7deg); }
.cat-whiskers-right { right: -22%; transform: rotate(-7deg); }

@keyframes cat-bob {
  50% { transform: translate(-50%, -64%); }
}

@keyframes pop-in {
  from { opacity: 0; transform: translate(-50%, -35%) scale(.7); }
  to { opacity: 1; transform: translate(-50%, -58%) scale(1); }
}

.game-over {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(76, 48, 35, .32);
}

.game-over[hidden] { display: none; }

.game-over-card {
  min-width: min(100%, 360px);
  padding: 32px 40px 38px;
  border: 4px solid #e0aa72;
  border-radius: 28px;
  background: #ffe5b8;
  text-align: center;
  box-shadow: 0 12px 0 rgba(80, 43, 27, .2);
}

.game-over-label {
  margin: 0 0 8px;
  color: #9a5f3d;
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.final-score {
  margin: 0;
  color: #4c3023;
  font-size: 2.2rem;
  font-weight: 700;
}

.final-score-value { font-size: 3.5rem; }

.bonus-pop {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 10;
  color: #ffd43b;
  font-size: clamp(3rem, 10vw, 6rem);
  font-weight: 700;
  line-height: 1;
  pointer-events: none;
  text-shadow: 0 4px 0 #8b570c, 0 0 18px rgba(255, 212, 59, .7);
  transform: translate(-50%, -50%);
  animation: bonus-float .8s ease-out forwards;
}

.combo-bonus { color: #ff8f4d; }
.regular-bonus { color: #fff8df; }

@keyframes bonus-float {
  from { opacity: 1; transform: translate(-50%, -50%) scale(.7); }
  to { opacity: 0; transform: translate(-50%, -95%) scale(1.1); }
}

.play-again {
  margin-top: 24px;
  padding: 12px 22px;
  border: 0;
  border-radius: 999px;
  color: #fff8df;
  background: #9a5f3d;
  font: inherit;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 0 #70422f;
}

.play-again:hover { background: #aa6b45; }
.play-again:active { transform: translateY(3px); box-shadow: 0 1px 0 #70422f; }


@media (max-width: 480px) {
  .game { width: min(100% - 24px, 720px); }
  .game-header { align-items: center; }
  .board { border-radius: 22px; padding: 19px; gap: 15px; }
}
