@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700;900&display=swap');

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

body {
  min-height: 100vh;
  min-height: 100dvh;
  background-color: rgb(58, 129, 0);
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(10px, 2vh, 18px);
  overflow-x: hidden;
  overflow-y: auto;
  cursor: none;
  padding: max(56px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
}
.box {
  position: relative;
  top: auto;
  left: auto;
  border: 1px solid #fff;
  padding: 0.8rem;
  width: min(520px, 100%);
  background: rgba(0, 0, 0, 0.16);
  border-radius: 10px;
}
h3 {
  font-size: clamp(1rem, 3.4vw, 1.4rem);
  /* margin-bottom: 1rem; */
}
.score,
.countdown {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.score span,
.countdown span {
  margin: 0px 2px;
}
.board {
  height: min(500px, calc(100vw - 32px), calc(100dvh - 300px));
  width: min(500px, calc(100vw - 32px), calc(100dvh - 300px));
  min-height: 248px;
  min-width: 248px;
  /* border: 1px solid #000; */
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: clamp(14px, 6vw, 40px);
}
.hole {
  /* background-color: cyan; */
  background-color: rgb(165, 85, 11);
  border-radius: 50%;
  box-shadow: inset 0 10px 0 7px rgb(53, 21, 6),
    inset 0 20px 20px 15px rgba(0, 0, 0, 0.3), 0 0 5px rgba(0, 0, 0, 0.5);
  position: relative;
  overflow: hidden;
}
.hole .mole {
  width: 70%;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  animation: raise 0.3s ease-out;
}
@keyframes raise {
  0% {
    transform: translateX(-50%) translateY(100%);
  }
  100% {
    transform: translateX(-50%) translateY(0);
  }
}
.cursor {
  width: 110px;
  height: 110px;
  position: absolute;
  top: 100px;
  left: 100px;
  /* background-color: rgb(165, 85, 11); */
  background-image: url("./assets/hammer.png");
  background-size: 100% 100%;
  transform: translate(-20%, -20%);
  transition: transform 0.1s;
  pointer-events: none;
}

.cursor.active {
  transform: translate(-20%, -20%) rotate(-45deg);
}
.finalScore {
  display: none;
  border: 1px solid #fff;
  padding: 1rem;
  width: 320px;
  text-align: center;
}
.restartBtn {
  display: none;
  padding: 0.5rem 1rem;
  background-color: teal;
  font-size: 18px;
  letter-spacing: 2px;
  border: 1px solid teal;
  color: #fff;
  margin: 10px 0;
  transition: all 0.3s;
  cursor: pointer;
  border-radius: 6px;
}
.restartBtn:hover {
  background-color: transparent;
  border: 1px solid #fff;
}

/* Card shake animation for wrong matches (Memory Match) */
@keyframes shake { 0%,100%{transform:translateX(0)} 20%{transform:translateX(-8px)} 40%{transform:translateX(8px)} 60%{transform:translateX(-5px)} 80%{transform:translateX(5px)} }
.shake { animation: shake 0.4s ease !important; }

/* Mole whack score display improvements */
.score { font-family: 'Orbitron', monospace; }
.countdown { font-family: 'Orbitron', monospace; color: #fbbf24; }
.finalScore { display: none; font-family: 'Orbitron', monospace; text-align: center; color: #fbbf24; }
.restartBtn { display: none; }

#moleStats {
  width: min(480px, 100%) !important;
  flex-wrap: wrap;
  gap: 8px;
}

.dBtn,
#startMoleBtn,
.restartBtn {
  min-height: 44px;
  touch-action: manipulation;
}

.box > div:first-child {
  flex-wrap: wrap;
}


@media (max-width: 380px) {
  .board {
    height: min(500px, calc(100vw - 24px), calc(100dvh - 288px));
    width: min(500px, calc(100vw - 24px), calc(100dvh - 288px));
    min-height: 226px;
    min-width: 226px;
    gap: 12px;
  }
  .dBtn {
    padding-inline: 10px !important;
    font-size: 0.55rem !important;
  }
}
