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

:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --secondary: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --background: #0f172a;
  --surface: #1e293b;
  --surface-light: #334155;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --accent: #22d3ee;
  --gradient: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  --shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  --glow: 0 0 20px rgba(99, 102, 241, 0.3);
}

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--background);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem;
  position: relative;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at 20% 80%, rgba(99, 102, 241, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(34, 211, 238, 0.1) 0%, transparent 50%);
  pointer-events: none;
  z-index: -1;
}

.header {
  text-align: center;
  margin-bottom: 2rem;
  position: relative;
}

.title {
  font-size: clamp(2.5rem, 8vw, 4rem);
  font-weight: 800;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 1rem;
  text-shadow: 0 0 30px rgba(99, 102, 241, 0.3);
  animation: pulse 2s ease-in-out infinite alternate;
}

@keyframes pulse {
  from {
    filter: brightness(1);
  }

  to {
    filter: brightness(1.1);
  }
}

.stats-bar {
  display: flex;
  gap: 2rem;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.stat {
  background: var(--surface);
  padding: 1rem 2rem;
  border-radius: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 120px;
  box-shadow: var(--shadow);
  border: 1px solid var(--surface-light);
  position: relative;
  overflow: hidden;
}

.stat::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gradient);
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 0.25rem;
}

.stat-label {
  font-size: 0.875rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 500;
  letter-spacing: 0.05em;
}

.game-controls {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  justify-content: center;
}

.btn {
  padding: 1rem 2rem;
  border: none;
  border-radius: 0.75rem;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

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

.btn-primary {
  background: var(--gradient);
  color: white;
  box-shadow: var(--shadow);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: var(--shadow), var(--glow);
}

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--surface-light);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--surface-light);
  transform: translateY(-2px);
}

.game-container {
  background: var(--surface);
  border-radius: 2rem;
  padding: 2rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--surface-light);
  position: relative;
  max-width: 800px;
  width: 100%;
}

.game-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  max-width: 600px;
  margin: 0 auto;
}

.hole {
  aspect-ratio: 1;
  background: radial-gradient(circle at center, var(--surface-light) 0%, var(--background) 70%);
  border-radius: 50%;
  position: relative;
  cursor: pointer;
  overflow: hidden;
  border: 3px solid var(--surface-light);
  transition: all 0.3s ease;
  box-shadow: inset 0 10px 20px rgba(0, 0, 0, 0.3);
}

.hole:hover {
  transform: scale(1.05);
  border-color: var(--primary);
}

.mole {
  position: absolute;
  width: 80%;
  height: 80%;
  background: url('./assets/mole.png') center/60% no-repeat,
    var(--gradient);
  border-radius: 50%;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  box-shadow: var(--shadow);
  border: 2px solid rgba(255, 255, 255, 0.2);
}

.mole::before {
  content: '';
  animation: bounce 0.6s ease-in-out infinite alternate;
}

@keyframes bounce {
  from {
    transform: translateY(0);
  }

  to {
    transform: translateY(-3px);
  }
}

.hole.up .mole {
  top: 10%;
  animation: pop-up 0.4s ease-out;
}

@keyframes pop-up {
  0% {
    top: 100%;
    transform: translateX(-50%) scale(0.8);
  }

  50% {
    transform: translateX(-50%) scale(1.1);
  }

  100% {
    top: 10%;
    transform: translateX(-50%) scale(1);
  }
}

.mole:hover {
  transform: translateX(-50%) scale(1.1);
  box-shadow: var(--shadow), var(--glow);
}

.hit-effect {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--secondary);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 2rem;
  font-weight: 600;
  font-size: 1.2rem;
  pointer-events: none;
  animation: hit-animation 0.8s ease-out forwards;
  z-index: 10;
}

@keyframes hit-animation {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(0.5);
  }

  50% {
    transform: translate(-50%, -50%) scale(1.2);
  }

  100% {
    opacity: 0;
    transform: translate(-50%, -70%) scale(1);
  }
}

.game-over {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.95);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 2rem;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.game-over.show {
  opacity: 1;
  visibility: visible;
}

.game-over h2 {
  font-size: 3rem;
  margin-bottom: 1rem;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.final-score {
  font-size: 4rem;
  font-weight: 800;
  color: var(--accent);
  margin-bottom: 2rem;
}

.difficulty-selector {
  display: flex;
  gap: 0.5rem;
  background: var(--background);
  padding: 0.5rem;
  border-radius: 0.75rem;
  border: 1px solid var(--surface-light);
}

.difficulty-btn {
  padding: 0.5rem 1rem;
  border: none;
  background: transparent;
  color: var(--text-muted);
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.875rem;
  font-weight: 500;
}

.difficulty-btn:hover {
  background-color: #1e293b;
  color: #e0e0e0;
}

.difficulty-btn.active {
  background: var(--gradient);
  color: white;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--background);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 2rem;
}

.progress-fill {
  height: 100%;
  background: var(--gradient);
  width: 100%;
  transition: width 0.1s linear;
  position: relative;
}

.progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 20px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3));
  animation: shimmer 1.5s ease-in-out infinite;
}

@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }

  100% {
    transform: translateX(100%);
  }
}

@media (max-width: 768px) {
  .game-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }

  .stats-bar {
    gap: 1rem;
  }

  .stat {
    min-width: 100px;
    padding: 0.75rem 1.5rem;
  }

  .btn {
    padding: 0.75rem 1.5rem;
    font-size: 0.875rem;
  }
}

@media (max-width: 480px) {
  body {
    padding: 1rem;
  }

  .game-container {
    padding: 1rem;
  }

  .game-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }
}