/* ============================================
   もぐらたたき - 固有スタイル
   ============================================ */

/* スコアエリア */
.score-area {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.score-box {
  background: #BBADA0;
  border-radius: 8px;
  padding: 0.5rem 1rem;
  text-align: center;
  min-width: 70px;
}

.score-label {
  display: block;
  font-size: 0.7rem;
  color: #EEE4DA;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.score-value {
  display: block;
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
}

/* タイマー警告 */
.timer-box.warning {
  background: #E67E22;
  animation: timer-pulse 0.5s ease-in-out infinite alternate;
}

.timer-box.danger {
  background: #E74C3C;
  animation: timer-pulse 0.3s ease-in-out infinite alternate;
}

@keyframes timer-pulse {
  0% {
    transform: scale(1);
  }
  100% {
    transform: scale(1.05);
  }
}

.btn-new-game {
  margin-left: auto;
  background: #8F7A66;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0.5rem 1.25rem;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
  font-family: inherit;
}

.btn-new-game:hover {
  background: #7A6658;
}

/* ゲームボード */
.board-wrapper {
  position: relative;
  width: 100%;
  max-width: 500px;
  margin: 0 auto;
}

.mole-board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 12px;
  padding: 20px;
  background: #BBADA0;
  border-radius: 12px;
  aspect-ratio: 1 / 1;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

/* 穴 */
.mole-hole {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  background: #CDC1B4;
  cursor: pointer;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

/* 土の部分（穴の下部） */
.mole-dirt {
  position: absolute;
  bottom: 0;
  left: -5%;
  right: -5%;
  height: 35%;
  background: radial-gradient(ellipse at center, #8B6914 0%, #A0782C 40%, #BBADA0 75%);
  border-radius: 50% 50% 0 0 / 100% 100% 0 0;
  z-index: 3;
  pointer-events: none;
}

/* もぐら */
.mole {
  position: absolute;
  bottom: -60%;
  left: 50%;
  transform: translateX(-50%);
  width: 70%;
  height: 65%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  transition: bottom 0.15s ease-out;
  pointer-events: none;
}

.mole.active {
  bottom: 15%;
  pointer-events: auto;
}

.mole-face {
  font-size: 3rem;
  line-height: 1;
  display: block;
  transition: transform 0.1s ease;
}

/* たたかれた時のエフェクト */
.mole.whacked .mole-face {
  transform: scale(0.7) rotate(15deg);
}

.mole.whacked::after {
  content: '+10';
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1rem;
  font-weight: 700;
  color: #E67E22;
  animation: score-pop 0.6s ease-out forwards;
  pointer-events: none;
}

@keyframes score-pop {
  0% {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateX(-50%) translateY(-30px) scale(1.3);
  }
}

/* 穴のホバーエフェクト（デスクトップ） */
@media (hover: hover) {
  .mole-hole:hover {
    background: #C5B9AD;
  }
}

/* ゲームオーバーレイ */
.game-overlay {
  position: absolute;
  inset: 0;
  background: rgba(238, 228, 218, 0.88);
  border-radius: 12px;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10;
  animation: overlay-appear 0.3s ease;
}

.game-overlay.active {
  display: flex;
}

@keyframes overlay-appear {
  0% {
    opacity: 0;
    transform: scale(0.95);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

.overlay-content {
  text-align: center;
  padding: 2rem 1.5rem;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  max-width: 300px;
  width: 90%;
}

.overlay-content h2 {
  font-size: 1.75rem;
  color: #E67E22;
  margin-bottom: 0.5rem;
}

.overlay-content p {
  font-size: 1.1rem;
  color: #776E65;
  margin-bottom: 0.75rem;
  line-height: 1.6;
}

.overlay-content .best-result {
  font-size: 0.95rem;
  color: #E67E22;
  font-weight: 600;
  margin-bottom: 1rem;
}

.overlay-content .btn-primary {
  margin-top: 0.5rem;
}

/* レスポンシブ */
@media (max-width: 500px) {
  .mole-board {
    gap: 8px;
    padding: 12px;
  }

  .mole-hole {
    border-radius: 10px;
  }

  .mole-face {
    font-size: 2.25rem;
  }

  .mole.whacked::after {
    font-size: 0.85rem;
  }
}

@media (max-width: 360px) {
  .mole-board {
    gap: 6px;
    padding: 10px;
  }

  .mole-hole {
    border-radius: 8px;
  }

  .mole-face {
    font-size: 1.85rem;
  }

  .score-box {
    padding: 0.4rem 0.75rem;
    min-width: 55px;
  }

  .score-value {
    font-size: 1rem;
  }

  .score-area {
    gap: 0.5rem;
  }

  .btn-new-game {
    padding: 0.4rem 0.75rem;
    font-size: 0.75rem;
  }
}
