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

body {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  font-family: Arial, sans-serif;
  padding: 10px;
}

.container {
  width: 100%;
  max-width: 420px;
  aspect-ratio: 9 / 16;
  background: #ffffff;
  border-radius: 30px;
  padding: 20px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
}

.title {
  text-align: center;
  color: #d44e6c;
  margin-bottom: 15px;
  font-size: 28px;
  font-weight: bold;
}

/* GRID */
.grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 15px;
}

/* 3D CARD */
.grid-item {
  perspective: 1000px;
  border-radius: 15px;
}

.card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.8s cubic-bezier(0.4, 0.2, 0.2, 1);
  transform-style: preserve-3d;
  border-radius: 15px;
}

.grid-item.flipped .card-inner {
  transform: rotateY(180deg);
}

.card-face {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 15px;
  overflow: hidden;
  backface-visibility: hidden;
}

.card-face img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card-back {
  transform: rotateY(180deg);
}

/* Кнопка */
.buttons {
  display: flex;
  justify-content: center;
}

.btn {
  padding: 12px 30px;
  background: #d44e6c;
  color: white;
  border: none;
  border-radius: 25px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 10px rgba(212, 78, 108, 0.3);
}

.btn:hover {
  background: #b63e5a;
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(212, 78, 108, 0.4);
}

.btn:active {
  transform: translateY(0);
}

/* Hint-пульсация (нейтральная) */
@keyframes hintPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(0, 0, 0, 0.2);
  }
  50% {
    box-shadow: 0 0 12px 6px rgba(0, 0, 0, 0.15);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(0, 0, 0, 0.2);
  }
}

.grid-item.hint {
  animation: hintPulse 2s ease-in-out;
  border-radius: 15px;
}

/* Финальное уведомление */
@keyframes fadeInOut {
  0% {
    opacity: 0;
    transform: translate(-50%, -30%);
  }
  15% {
    opacity: 1;
    transform: translate(-50%, -50%);
  }
  85% {
    opacity: 1;
    transform: translate(-50%, -50%);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -70%);
  }
}

/* Анимация появления кнопки */
@keyframes buttonAppear {
  0% {
    opacity: 0;
    transform: scale(0.8);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

.btn.show {
  display: inline-block;
  animation: buttonAppear 0.5s ease;
}

/* Скрываем кнопку по умолчанию */
.btn {
  display: none;
}
