/* Общие стили, фон и базовые настройки */
body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  font-family: Arial, sans-serif;
  background: linear-gradient(135deg, #FFB6C1, #FFC0CB);
}

/* Фоновый слой с облаками */
.background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
  overflow: hidden;
}

/* Контейнер для падающих звёзд */
.falling-stars {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
}

/*  Фоновые сердечки */
 .background-hearts {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -3;
    pointer-events: none;  /* Важно, чтобы сердечки не перехватывали события */
}

.background-heart { /*  стили сердечек */
    position: absolute;
    width: 30px;
    height: 30px;
    background-size: contain;
    background-repeat: no-repeat;
     pointer-events: auto; /*  взаимодействие */
    cursor: pointer;
}

.heart.clicked {  /*  для отскока */
    animation: bounce 0.5s;
}
/*  CSS-анимация для "отскока" */
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-30px); }
    60% { transform: translateY(-15px); }
}
.heart:hover {
    transform: scale(1.2); /* Увеличение при наведении */
}


/* Оптимизация для анимируемых элементов */
/* Добавил .pulsing-star */
.cloud, .time-unit, .cat-container,  .sparkle, .background-heart, .pulsing-star {
  will-change: transform, opacity;
}


/* Облака */
.cloud {
  position: absolute;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  /* filter: blur(10px); */
  box-shadow: 0 0 30px 20px rgba(255, 255, 255, 0.3); /* Используем box-shadow вместо filter: blur */
  animation: float 30s infinite linear;
}
.cloud1 {
  width: 300px;
  height: 200px;
  left: 10%;
  top: 20%;
}
.cloud2 {
  width: 250px;
  height: 150px;
  left: 50%;
  top: 10%;
  animation-duration: 35s;
}
.cloud3 {
  width: 350px;
  height: 220px;
  left: 70%;
  top: 30%;
  animation-duration: 40s;
}
@keyframes float {
  0% { transform: translateY(0) translateX(0); }
  50% { transform: translateY(20px) translateX(20px); }
  100% { transform: translateY(0) translateX(0); }
}

/* Заголовок */
.header {
  text-align: center;
  margin-top: 50px;
  overflow: hidden;  /*  для анимации текста */
}
.header h1 {
    color: #FF69B4;
    font-size: 3rem;
   /*  text-shadow: 0 0 10px #FFC0CB; */  /* Убрал, т.к. анимируем */
    margin-bottom: 10px;
}

/* Контейнер для текста в заголовке */
.header-text-container {
  position: relative; /* Для позиционирования анимации */
  display: inline-block; /* Чтобы контейнер занимал ширину содержимого */

}
.love-message {
    font-size: 1.5rem;
    color: white;
     /* text-shadow: 0 0 5px #FFB6C1; */ /* Убрал, т.к. анимируем */
}


/* Жидкий переход */
.liquid-transition {
  width: 100%;
  height: 100px;
  background: linear-gradient(180deg, transparent, #FFC0CB);
  clip-path: ellipse(150% 100% at 50% 0%);
  opacity: 0.8;
}

/* Таймер */
.timer-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 50px auto;
}
.timer {
  display: flex;
  gap: 20px;
  background: radial-gradient(circle, rgba(255,255,255,0.3), transparent);
  padding: 20px;
  border-radius: 50%;
  box-shadow: 0 0 20px rgba(255,182,193,0.5);
  animation: glow 3s infinite alternate;
}
@keyframes glow {
  from { box-shadow: 0 0 20px rgba(255,182,193,0.5); }
  to { box-shadow: 0 0 40px #FF69B4; }
}

/* Единица времени */
.time-unit {
  position: relative;
  width: 80px;
  height: 100px;
  background: rgba(255,255,255,0.2);
  border: 2px solid #FF69B4;
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  box-shadow: 0 0 15px rgba(255,105,180,0.5);
  transition: box-shadow 0.3s;
}
.time-unit:hover {
  box-shadow: 0 0 25px #FF69B4;
}
.time-unit .number {
  font-size: 2rem;
  font-weight: bold;
  color: white;
  text-shadow: 0 0 5px #FFB6C1, 0 0 10px #FF69B4;
  position: relative;
}
.time-unit .label {
    font-size: 1rem;
    font-weight: bold;
    color: white;
    text-shadow: 0 0 3px #FFB6C1, 0 0 6px #FF69B4;
    margin-top: 5px;
}

/* Контейнер для котика */
.cat-container {
    position: relative;
    display: inline-block;
    overflow: hidden;
    border-radius: 15px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Рамка для котика  */
.cat-container::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #FF69B4, #FFB6C1, #FF69B4);
    background-size: 400% 400%;
    animation: gradientAnimation 5s ease infinite;
    z-index: -1;
    border-radius: 17px;
}

@keyframes gradientAnimation {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.cats {
    position: absolute;
    bottom: 50px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    justify-content: center;
}

/* Стили для котиков */
.cats .cat {
    width: 150px;
    margin: 0 20px;
    cursor: pointer;
    transition: transform 0.3s ease;
    display: block;
}

.cats .cat:hover {
    transform: scale(1.1);
}

/* Падающие звёзды */
.falling-stars .star {
    position: absolute;
    opacity: 0.8;
}

/* Пульсирующие звезды */
.pulsing-star {
    animation: pulse 2s infinite ease-in-out;
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.3); opacity: 1; }
    100% { transform: scale(1); opacity: 0.8;}
}


/* Мерцающие блёстки */
.sparkle {
  position: absolute;
  background: url('sparkle.png') no-repeat center;
  width: 20px;
  height: 20px;
  animation: sparkle 1.5s infinite;
}
@keyframes sparkle {
  0% { opacity: 1; }
  50% { opacity: 0.5; transform: scale(1.2); }
  100% { opacity: 1; transform: scale(1); }
}

/* Модальное окно */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10;
}
.modal.hidden {
  display: none;
}
.modal .modal-content {
  background: white;
  padding: 20px;
  border-radius: 10px;
  text-align: center;
  position: relative;
  box-shadow: 0 0 20px rgba(0,0,0,0.3);
}
.modal .modal-content .close-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  cursor: pointer;
  font-size: 1.5rem;
}
.modal .modal-content img.zhenya-photo {
  max-width: 100%;
  height: auto;
  border-radius: 10px;
  margin-bottom: 15px;
}
/* Карточка имени */
.name-card {
  margin-bottom: 15px;
}
.sparkling-name {
  font-size: 2rem;
  font-weight: bold;
  color: #FF69B4;
  text-shadow: 0 0 10px #FFC0CB, 0 0 20px #FFB6C1;
  animation: sparkleText 2s infinite;
}
@keyframes sparkleText {
  0%, 100% { text-shadow: 0 0 10px #FFC0CB, 0 0 20px #FFB6C1; }
  50% { text-shadow: 0 0 20px #FFC0CB, 0 0 30px #FFB6C1; }
}

/* Кнопка управления музыкой */
#music-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  background: #FFB6C1;
  border: none;
  padding: 10px 20px;
  border-radius: 30px;
  cursor: pointer;
  font-size: 1rem;
  color: white;
  box-shadow: 0 0 10px #FF69B4;
  transition: background 0.3s ease;
  z-index: 5;
}
#music-toggle:hover {
  background: #FF69B4;
}

/* Адаптивные стили */
@media (max-width: 768px) {
  .timer { gap: 10px; }
  .time-unit { width: 60px; height: 80px; }
  .header h1 { font-size: 2rem; }
  .cats .cat { width: 70px; }
}