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

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  overflow-x: hidden;
}

.game-container {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 20px;
  padding: 30px;
  max-width: 800px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: slideIn 0.5s ease-out;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.game-header {
  text-align: center;
  margin-bottom: 30px;
}

.game-title {
  font-size: 2.5rem;
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
  animation: pulse 2s infinite;
}

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

.title-emoji {
  display: inline-block;
  animation: bounce 2s infinite;
}

@keyframes bounce {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

.game-controls {
  display: flex;
  justify-content: space-around;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 20px;
}

.difficulty-selector,
.game-mode-selector {
  display: flex;
  align-items: center;
  gap: 15px;
}

.difficulty-selector label,
.game-mode-selector label {
  font-weight: bold;
  color: #333;
}

.difficulty-buttons,
.mode-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.difficulty-btn,
.mode-btn {
  padding: 8px 16px;
  border: 2px solid #4facfe;
  background: white;
  color: #4facfe;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.9rem;
}

.difficulty-btn:hover,
.mode-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(79, 172, 254, 0.3);
}

.difficulty-btn.active,
.mode-btn.active {
  background: #4facfe;
  color: white;
}

.stats-bar {
  display: flex;
  justify-content: space-around;
  padding: 15px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 15px;
  margin-bottom: 20px;
  color: white;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.stat-icon {
  font-size: 1.5rem;
}

.stat-label {
  font-size: 0.9rem;
}

.stat-value {
  font-weight: bold;
  font-size: 1.1rem;
}

.power-ups-bar {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-bottom: 20px;
}

.power-up {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 15px;
  background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
  border: none;
  border-radius: 15px;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  min-width: 80px;
}

.power-up:hover:not(.disabled) {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 10px 25px rgba(252, 182, 159, 0.4);
}

.power-up.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.power-up.active {
  background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
  animation: powerUpActive 1s infinite;
}

@keyframes powerUpActive {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

.power-icon {
  font-size: 2rem;
}

.power-name {
  font-size: 0.8rem;
  font-weight: bold;
  color: #333;
}

.power-count {
  position: absolute;
  top: -5px;
  right: -5px;
  background: #ff6b6b;
  color: white;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: bold;
}

.game-board {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 15px;
  padding: 20px;
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  border-radius: 15px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.square {
  width: 120px;
  height: 120px;
  position: relative;
  cursor: crosshair;
}

.hole {
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, #2c3e50 0%, #34495e 70%, #2c3e50 100%);
  border-radius: 50%;
  box-shadow: inset 0 5px 20px rgba(0, 0, 0, 0.5);
  border: 3px solid #1a1a1a;
}

.mole-container {
  position: absolute;
  bottom: -20px;
  left: 50%;
  transform: translateX(-50%);
  transition: bottom 0.3s ease;
}

.mole {
  font-size: 4rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
  animation: moleBob 1s ease-in-out infinite;
}

@keyframes moleBob {
  0%,
  100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-5px);
  }
}

.mole:hover {
  transform: scale(1.1);
  filter: brightness(1.2);
}

.mole:active {
  transform: scale(0.9);
}

.square.active .mole-container {
  bottom: 20px;
  animation: molePopUp 0.3s ease;
}

@keyframes molePopUp {
  0% {
    bottom: -20px;
  }
  100% {
    bottom: 20px;
  }
}

.mole[data-type='golden'] {
  color: #ffd700;
  text-shadow: 0 0 10px #ffff00;
  animation: moleBob 0.5s ease-in-out infinite, goldShine 2s ease-in-out infinite;
}

@keyframes goldShine {
  0%,
  100% {
    filter: brightness(1);
  }
  50% {
    filter: brightness(1.5);
  }
}

.mole[data-type='bomb'] {
  color: #ff4757;
  animation: moleBob 0.8s ease-in-out infinite, bombFlash 1s linear infinite;
}

@keyframes bombFlash {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

.mole[data-type='speed'] {
  color: #3742fa;
  animation: moleBob 0.3s ease-in-out infinite, speedPulse 0.5s linear infinite;
}

@keyframes speedPulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

.square.hit .mole {
  animation: moleHit 0.5s ease;
}

@keyframes moleHit {
  0% {
    transform: scale(1) rotate(0deg);
  }
  25% {
    transform: scale(1.3) rotate(-10deg);
  }
  50% {
    transform: scale(0.8) rotate(10deg);
  }
  100% {
    transform: scale(1) rotate(0deg);
  }
}

.game-controls-bottom {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.control-btn {
  padding: 12px 25px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 25px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.control-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.control-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.achievements-bar {
  background: linear-gradient(135deg, #e0f7fa 0%, #b2ebf2 100%);
  padding: 15px;
  border-radius: 15px;
}

.achievements-bar h3 {
  color: #333;
  margin-bottom: 10px;
}

.achievements-list {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  min-height: 40px;
}

.achievement-item {
  background: white;
  padding: 8px 15px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: achievementSlide 0.5s ease;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

@keyframes achievementSlide {
  from {
    transform: translateX(-50px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.achievement-icon {
  font-size: 1.2rem;
}

.achievement-text {
  font-size: 0.9rem;
  color: #333;
}

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: white;
  padding: 30px;
  border-radius: 20px;
  max-width: 500px;
  width: 90%;
  text-align: center;
  animation: modalPop 0.3s ease;
  position: relative;
}

@keyframes modalPop {
  from {
    transform: scale(0.8);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.close-modal {
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 2rem;
  cursor: pointer;
  color: #999;
  transition: color 0.3s ease;
}

.close-modal:hover {
  color: #333;
}

.modal-title {
  color: #4facfe;
  margin-bottom: 20px;
  font-size: 2rem;
}

.modal-stats {
  display: flex;
  justify-content: space-around;
  margin-bottom: 20px;
}

.final-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.final-stat-label {
  color: #666;
  font-size: 0.9rem;
  margin-bottom: 5px;
}

.final-stat-value {
  font-size: 1.5rem;
  font-weight: bold;
  color: #4facfe;
}

.modal-buttons {
  display: flex;
  justify-content: center;
  gap: 15px;
}

.modal-btn {
  padding: 12px 25px;
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  color: white;
  border: none;
  border-radius: 25px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 1rem;
}

.modal-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(79, 172, 254, 0.3);
}

.leaderboard-tabs {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 20px;
}

.tab-btn {
  padding: 8px 16px;
  border: 2px solid #4facfe;
  background: white;
  color: #4facfe;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.tab-btn.active {
  background: #4facfe;
  color: white;
}

.leaderboard-list {
  text-align: left;
  max-height: 300px;
  overflow-y: auto;
}

.leaderboard-list li {
  padding: 10px;
  margin-bottom: 5px;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  border-radius: 10px;
  display: flex;
  justify-content: space-between;
}

.leaderboard-list li:nth-child(1) {
  background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
}

.leaderboard-list li:nth-child(2) {
  background: linear-gradient(135deg, #c0c0c0 0%, #e8e8e8 100%);
}

.leaderboard-list li:nth-child(3) {
  background: linear-gradient(135deg, #cd7f32 0%, #e6a468 100%);
}

.floating-score {
  position: fixed;
  font-size: 2rem;
  font-weight: bold;
  color: #4facfe;
  pointer-events: none;
  animation: floatUp 1s ease-out forwards;
  z-index: 999;
}

@keyframes floatUp {
  from {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
  to {
    transform: translateY(-100px) scale(0.5);
    opacity: 0;
  }
}

#confetti-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 999;
}

.game-frozen {
  animation: freeze 0.1s infinite;
}

@keyframes freeze {
  0%,
  100% {
    filter: hue-rotate(0deg) brightness(1);
  }
  50% {
    filter: hue-rotate(180deg) brightness(1.2);
  }
}

.slow-motion .mole {
  animation-duration: 3s !important;
}

.multi-hit-mode {
  box-shadow: 0 0 20px #ff6b6b;
}

@media (max-width: 768px) {
  .game-title {
    font-size: 1.8rem;
  }

  .square {
    width: 90px;
    height: 90px;
  }

  .mole {
    font-size: 3rem;
  }

  .game-controls {
    flex-direction: column;
  }

  .stats-bar {
    flex-wrap: wrap;
  }

  .power-ups-bar {
    flex-wrap: wrap;
  }
}
