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

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: linear-gradient(135deg, #8fd3f4, #84fab0);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #123;
}

#click-image {
    object-fit: contain;
}

.game {
  background: rgba(255, 255, 255, 0.92);
  border-radius: 20px;
  padding: 24px 20px 28px;
  max-width: 420px;
  width: 100%;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.15);
}

.title {
  text-align: center;
  margin-bottom: 16px;
  font-size: 1.6rem;
}

.hud {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
}

.hud-item {
  font-size: 1rem;
}

.label {
  font-weight: 600;
  margin-right: 4px;
}

.progress-wrapper {
  width: 100%;
  height: 10px;
  background: #e3f2fd;
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 16px;
}

#progress-bar {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #42a5f5, #66bb6a);
  transition: width 0.25s ease-out;
}

.click-area-wrapper {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}

.click-area {
  width: 260px;
  height: 260px;
  border-radius: 30px;
  background: #f1f8e9;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  user-select: none;
  touch-action: manipulation;
}

.click-area img {
  max-width: 90%;
  max-height: 90%;
  pointer-events: none;
}

/* Анимация «поп» для картинки */
.click-pop {
  animation: img-pop 0.18s ease-out;
}

@keyframes img-pop {
  0% {
    transform: scale(1);
  }
  40% {
    transform: scale(1.08);
  }
  100% {
    transform: scale(1);
  }
}

/* Всплывающие очки */
.score-pop {
  position: absolute;
  font-size: 2.1rem;
  font-weight: 700;
  color: #f1e884;
  text-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
  pointer-events: none;
  animation: score-pop 0.5s ease-out forwards;
}

@keyframes score-pop {
  0% {
    opacity: 0;
    transform: translateY(0) scale(0.6);
  }
  20% {
    opacity: 1;
    transform: translateY(-8px) scale(1.02);
  }
  100% {
    opacity: 0;
    transform: translateY(-60px) scale(0.9);
  }
}

/* Анимация смены уровня */
.level-change {
  animation: level-pop 0.4s ease-out;
}

@keyframes level-pop {
  0% {
    transform: scale(0.9);
    opacity: 0.2;
  }
  60% {
    transform: scale(1.05);
    opacity: 1;
  }
  100% {
    transform: scale(1);
  }
}

.controls {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 4px;
}

button {
  flex: 1;
  border: none;
  border-radius: 999px;
  padding: 8px 10px;
  font-size: 0.9rem;
  cursor: pointer;
  background: #42a5f5;
  color: white;
  font-weight: 600;
  box-shadow: 0 3px 8px rgba(66, 165, 245, 0.4);
  transition: transform 0.08s ease, box-shadow 0.08s ease, background 0.2s ease;
}

button:hover {
  background: #1e88e5;
  transform: translateY(-1px);
  box-shadow: 0 5px 12px rgba(30, 136, 229, 0.45);
}

button:active {
  transform: translateY(0);
  box-shadow: 0 3px 8px rgba(30, 136, 229, 0.4);
}

@media (max-width: 480px) {
  .game {
    margin: 12px;
    padding: 16px 12px 20px;
  }

  .click-area {
    width: 220px;
    height: 220px;
  }
}
