:root {
  --bg-color: #fff0f3;
  --card-bg: #ffffff;
  --primary-pink: #ff85a2;
  --dark-pink: #ef476f;
  --text-gray: #4a4a4a;
  --transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

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

body {
  font-family: "Montserrat", sans-serif;
  background: linear-gradient(135deg, #fff0f3 0%, #ffe5ec 50%, #ffcce4 100%);
  color: var(--text-gray);
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden; /* Важно для игры */
}

.container {
  width: 95%;
  max-width: 500px; /* Сделали чуть уже и аккуратнее */
  background: var(--card-bg);
  padding: 40px 20px;
  border-radius: 30px;
  box-shadow: 0 15px 35px rgba(255, 133, 162, 0.2);
  text-align: center;
  position: relative;
  z-index: 10;
  transition: all 0.3s ease-out;
  height: auto;
  overflow: visible; /* Чтобы кнопки могли вылетать за границы сеток */
}

.title {
  font-family: "Pacifico", cursive;
  color: var(--dark-pink);
  font-size: 2rem;
  margin-bottom: 20px;
}

.screen {
  display: none;
  animation: slideIn 0.5s ease forwards;
}

.screen.active {
  display: block;
}

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

input {
  width: 100%;
  padding: 15px;
  border: 2px solid #ffe5ec;
  border-radius: 15px;
  margin-bottom: 15px;
  font-size: 16px;
  outline: none;
  transition: var(--transition);
}

input:focus {
  border-color: var(--primary-pink);
}

button {
  background: var(--primary-pink);
  color: white;
  border: none;
  padding: 15px 30px;
  border-radius: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  font-size: 16px;
}

button:hover {
  background: var(--dark-pink);
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(239, 71, 111, 0.3);
}

/* Контейнер квиза */
.options-container {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
  min-height: 125px;
  max-width: 320px;
  margin-left: auto;
  margin-right: auto;
}

/* Кнопки */
.quiz-btn {
  border-radius: 12px;
  font-size: 14px;
  z-index: 5;
  width: 140px;
  height: 50px;
  margin: 0;
  position: relative;
  transition: all 0.3s ease;
}

.quiz-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 8px 20px rgba(239, 71, 111, 0.4);
}

/* Кнопка в полете */
.quiz-btn.fleeing {
  z-index: 100;
  transition: transform 0.3s ease;
}
/* Слой игры */
#game-layer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 5;
  overflow: hidden;
}

.falling-heart {
  position: absolute;
  cursor: pointer;
  pointer-events: all;
  user-select: none;
  /* Увеличиваем базовый размер и добавляем тень для объема */
  font-size: 100px;
  filter: drop-shadow(0 8px 15px rgba(255, 133, 162, 0.4));
  /* Две анимации: одна вниз, другая — покачивание влево-вправо */
  animation: fall linear forwards, sideSway ease-in-out infinite alternate;
}

/* Анимация падения (сделаем до 110vh, чтобы уходило за экран) */
@keyframes fall {
  from {
    transform: translateY(-10vh) rotate(0deg);
  }
  to {
    transform: translateY(110vh) rotate(360deg);
  }
}

/* Анимация покачивания (создает эффект плавного падения листка) */
@keyframes sideSway {
  from {
    margin-left: -50px;
  }
  to {
    margin-left: 50px;
  }
}

/* Эффект при клике на сердечко */
.falling-heart:active {
  transform: scale(0.8);
  transition: 0.1s;
}

/* Красивое облачко комплимента */
.compliment {
  position: fixed;
  background: rgba(255, 255, 255, 0.9); /* Более нежный фон */
  padding: 10px 20px;
  border-radius: 25px;
  /* border: убрана для более нежного вида */
  color: var(--dark-pink);
  font-weight: bold;
  font-size: 20px;
  pointer-events: none;
  z-index: 1000;
  white-space: nowrap;
  box-shadow: 0 6px 20px rgba(255, 133, 162, 0.12);
  backdrop-filter: blur(8px); /* Добавляем размытие для нежности */

  /* Увеличиваем длительность до 2.5 или 3 секунд */
  animation: fadeUp 2.5s ease-out forwards;
}

@keyframes fadeUp {
  0% {
    opacity: 0;
    transform: translate(-50%, 0) scale(0.5);
  }
  15% {
    opacity: 1;
    transform: translate(-50%, -60px) scale(1.1);
  }
  80% {
    opacity: 1;
    transform: translate(-50%, -100px) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -140px) scale(0.8);
  }
}
/* Коллаж */
.collage {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 25px;
  flex-wrap: wrap;
}

.photo-frame {
  background: white;
  padding: 8px;
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1);
  transform: rotate(var(--rot));
  border-radius: 8px;
}

.photo-frame:nth-child(odd) {
  --rot: -2deg;
}
.photo-frame:nth-child(even) {
  --rot: 2deg;
}

.photo-frame img {
  width: 160px; /* Ширина для соотношения 3:4 */
  height: 213px; /* Высота = 160 * 4/3 ≈ 213px */
  object-fit: cover;
  border-radius: 5px;
}

.error-text {
  color: var(--dark-pink);
  font-size: 14px;
  margin-top: 10px;
}

#score-counter {
  position: fixed;
  bottom: 30px; /* Перенесли вниз */
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.85);
  padding: 12px 25px;
  border-radius: 50px; /* Сделаем более овальным и милым */
  /* border: убрана для более нежного вида */
  color: var(--dark-pink);
  font-weight: 700;
  font-size: 1.2rem;
  z-index: 1000;
  box-shadow: 0 8px 25px rgba(255, 133, 162, 0.15);
  display: none; /* Скрыт по умолчанию */
  transition: all 0.3s ease;
  backdrop-filter: blur(10px); /* Добавляем размытие для нежности */
}

/* Класс для плавного скрытия контейнера */
.container.hidden {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.9);
  transition: all 0.5s ease;
}

.flee-button {
  background: #cdcdcd;
  color: white;
  cursor: pointer;
  pointer-events: auto;
  opacity: 1;
  transition: opacity 0.8s ease, transform 0.3s ease;
}

.flee-button:hover {
  opacity: 0;
  transform: scale(0.8);
}
.game-description {
  margin-bottom: 25px;
}

.game-description-top {
  margin-top: 25px;
}


/* PNG картинка на границе контейнера */
.corner-decoration {
  position: absolute;
  top: -40px; /* Чуть выше границы контейнера */
  left: -40px; /* Чуть левее границы контейнера */
  width: 100px; /* Можно настроить размер */
  height: auto;
  z-index: 20; /* Поверх контейнера */
  pointer-events: none; /* Чтобы не мешала взаимодействию */
  opacity: 0.8; /* Немного прозрачная */
  /* transition: all 0.3s ease; */ /* Временно убрал transition, чтобы не конфликтовал с JS */
  transform: translate(0, 0); /* Начальная позиция */
}

.corner-decoration:hover {
  opacity: 1; /* Становится полностью видимой при наведении */
}
