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

body {
  background: #5c8a3c;
  background-image:
    radial-gradient(ellipse at top, #6fa84a, #3d6127);
  min-height: 100vh;
  font-family: 'Segoe UI', sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── 오버레이 ── */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.overlay.hidden {
  display: none;
}

.overlay-box {
  background: #fff;
  border-radius: 24px;
  padding: 48px 56px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
  animation: popIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes popIn {
  from { transform: scale(0.6); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}

.title-mole {
  font-size: 72px;
  margin-bottom: 12px;
}

.overlay-box h1 {
  font-size: 2rem;
  color: #333;
  margin-bottom: 12px;
}

.overlay-box p {
  color: #666;
  margin-bottom: 32px;
  font-size: 1rem;
}

.overlay-box button {
  background: #e8a020;
  color: #fff;
  border: none;
  border-radius: 50px;
  padding: 14px 48px;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

.overlay-box button:hover {
  background: #cf8a10;
  transform: scale(1.05);
}

/* ── 게임 컨테이너 ── */
.game-container {
  width: 560px;
  user-select: none;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}

.game-title {
  color: #fff;
  font-size: 1.6rem;
  text-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.stat {
  background: rgba(0,0,0,0.25);
  border-radius: 16px;
  padding: 10px 20px;
  text-align: center;
  min-width: 90px;
}

.stat .label {
  display: block;
  color: #c8f0a0;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.stat .value {
  display: block;
  color: #fff;
  font-size: 1.8rem;
  font-weight: 800;
  line-height: 1.2;
}

/* ── 그리드 ── */
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

/* ── 구멍 ── */
.hole {
  position: relative;
  height: 150px;
  overflow: hidden;
  cursor: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='40' height='40'><text y='34' font-size='34'>🔨</text></svg>") 8 8, pointer;
}

.hole-ground {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 50px;
  background: #4a3020;
  border-radius: 50%;
  box-shadow: 0 8px 0 #3a2010, inset 0 -6px 12px rgba(0,0,0,0.5);
  z-index: 1;
}

/* ── 두더지 ── */
.mole {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%) translateY(100%);
  width: 90px;
  height: 100px;
  transition: transform 0.18s cubic-bezier(0.34, 1.3, 0.64, 1);
  pointer-events: none;
  text-align: center;
  line-height: 1;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.4));
  z-index: 2;
}

.mole img {
  width: 90px;
  height: 100px;
  object-fit: cover;
  object-position: center top;
  border-radius: 50% 50% 40% 40%;
  border: 3px solid #fff;
  display: block;
}

.hole.up .mole {
  transform: translateX(-50%) translateY(0%);
}

/* 맞았을 때 */
.hole.whacked .mole {
  filter: drop-shadow(0 0 12px #ffdd00) brightness(1.4);
  transition: none;
}

/* ── 히트 메시지 ── */
.hit-message {
  position: fixed;
  font-size: 2.5rem;
  font-weight: 900;
  color: #ffdd00;
  text-shadow: 0 2px 8px rgba(0,0,0,0.5);
  pointer-events: none;
  opacity: 0;
  transition: none;
}

.hit-message.show {
  animation: floatUp 0.7s ease-out forwards;
}

@keyframes floatUp {
  0%   { opacity: 1; transform: translateY(0) scale(1.3); }
  100% { opacity: 0; transform: translateY(-80px) scale(0.8); }
}

/* ── 피 물방울 ── */
.blood-drop {
  position: fixed;
  width: 10px;
  height: 14px;
  background: radial-gradient(circle at 40% 35%, #ff4444, #990000);
  border-radius: 50% 50% 60% 60%;
  pointer-events: none;
  z-index: 999;
  animation: bloodSplat 0.6s ease-out forwards;
}

@keyframes bloodSplat {
  0%   { transform: translate(0, 0) scale(1.2); opacity: 1; }
  100% { transform: translate(var(--tx), var(--ty)) scale(0.2); opacity: 0; }
}

/* ── 타이머 경고 ── */
.stat .value.danger {
  color: #ff6b6b;
  animation: pulse 0.5s infinite alternate;
}

@keyframes pulse {
  from { transform: scale(1); }
  to   { transform: scale(1.15); }
}
