/* --- Стили для кнопки-заглушки --- */
.play-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1a1a1d 0%, #000000 100%);
    z-index: 9999;
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 1;
    transition: opacity 0.6s ease-out;
}

.play-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

/* --- Hero Section --- */
.hero-section {
    position: relative;
    width: 100%;
    min-height: 100vh;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: none; /* Блокируем клики до старта */
}

/* --- Слайдшоу контейнер --- */
.slideshow-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 1;
    /*!* Важно: фон контейнера должен быть темным, чтобы скрыть возможные белые поля *!*/
    /*background-color: #000;*/
}

/* Базовый стиль картинки */
.slide-image {
    position: absolute;
    top: 50%;
    left: 50%;
    width: auto;
    height: auto;
    max-width: 120%; /* Разрешаем картинке быть чуть больше экрана */
    max-height: 120%;
    transform: translate(-50%, -50%); /* Центрируем через трансформ */
    opacity: 0;
    transition: opacity 1s ease-in-out;
    pointer-events: none;
    z-index: 1;
}

/* Класс для активной картинки */
.slide-image.active {
    opacity: 1;
}

/* --- ВАЖНО: Этот класс решает проблему обрезки и пустых полей --- */
.slide-image-fill {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover; /* Обрежет лишнее, но заполнит весь экран */
    max-width: none !important;
    max-height: none !important;
    transform: none !important; /* Сбрасываем центрирование, так как object-fit сам справится */
    top: 0 !important;
    left: 0 !important;
}

/* Анимация пикселизации */
.pixelated-effect {
    animation: pixelate-out 1s ease-in-out forwards;
}

@keyframes pixelate-out {
    0% { opacity: 1; }
    100% {
        opacity: 0;
        clip-path: polygon(0 0, 20% 0, 20% 20%, 40% 20%, 40% 40%, 60% 40%, 60% 60%, 80% 60%, 80% 80%, 100% 80%, 100% 100%, 0 100%);
    }
}

/* --- Сердце и Дата (ИСПРАВЛЕНО) --- */
.heart-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    text-align: center;

    /* ГЛАВНОЕ ИЗМЕНЕНИЕ: Скрыто по умолчанию */
    opacity: 0;
    pointer-events: none;

    transition: opacity 0.4s ease, transform 0.4s ease;
}

/* Показываем только при наведении на всю секцию Hero */
.hero-section:hover .heart-container {
    opacity: 1;
    pointer-events: all; /* Теперь можно кликнуть */
    /* Легкий эффект всплытия */
    transform: translate(-50%, -40%);
}

/* --- РЕАЛЬНОЕ БЬЮЩЕЕСЯ СЕРДЦЕ --- */
.heart {
    position: relative;
    width: 150px;
    height: 150px;
    background-color: #ff4d4d;
    transform: rotate(-45deg);
    animation: heartbeat 1.5s infinite;
    filter: drop-shadow(0 10px 15px rgba(0,0,0,0.4));
    cursor: pointer;
    margin: 0 auto;
}

/* Левый круг */
.heart::before {
    content: "";
    position: absolute;
    width: 150px;
    height: 150px;
    background-color: #ff4d4d;
    border-radius: 50%;
    top: -75px;
    left: 0;
}

/* Правый круг */
.heart::after {
    content: "";
    position: absolute;
    width: 150px;
    height: 150px;
    background-color: #ff4d4d;
    border-radius: 50%;
    top: 0;
    right: -75px;
}

@keyframes heartbeat {
    0% { transform: rotate(-45deg) scale(1); }
    14% { transform: rotate(-45deg) scale(1.15); }
    28% { transform: rotate(-45deg) scale(1); }
    42% { transform: rotate(-45deg) scale(1.15); }
    70% { transform: rotate(-45deg) scale(1); }
}

/* Убираем hover у самого сердца, чтобы не конфликтовало с анимацией */
.heart:hover {
    transform: rotate(-45deg) scale(1);
}

/* Адаптив */
@media (max-width: 768px) {
    .heart { width: 80px; height: 80px; }
    .heart::before, .heart::after { width: 80px; height: 80px; }
    .heart::before { top: -40px; }
    .heart::after { right: -40px; }

    /* На мобильных лучше сделать сердце видимым всегда или по тапу, 
       но для десктопа оставляем hover */
    .hero-section:hover .heart-container {
        transform: translate(-50%, -30%); /* Чуть выше поднимаем на мобильном */
    }
}

/* ЛАВАНДОВАЯ ДАТА (Крупный шрифт) */
.wedding-date {
    display: block;
    margin-top: 20px;
    font-size: 4rem; /* Увеличенный размер */
    font-weight: 800;
    color: #C4B3D6; /* Лавандовый цвет */
    text-shadow: 0 4px 10px rgba(0,0,0,0.5);
    text-transform: uppercase;
    letter-spacing: 3px;
}

/* --- Модальное окно и Анимация текста --- */
.code-style {
    font-family: 'Courier New', Courier, monospace;
    background: #f0f0f0;
    padding: 15px;
    border-radius: 8px;
    color: #d63031;
    font-size: 0.9rem;
}

/* Анимация появления нового текста */
@keyframes fadeInText {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.text-fade-in {
    animation: fadeInText 0.6s ease-out;
}

.btn-outline-primary {
    border-color: #C4B3D6;
    color: #C4B3D6;
}

.btn-outline-primary:hover {
    background-color: #C4B3D6;
    color: white;
}


/* Адаптив для мобильных */
@media (max-width: 768px) {
    .heart { width: 80px; height: 80px; }
    .wedding-date { font-size: 2rem; }
}

/* Секция игры */
.game-section {
    padding: 40px 20px;
}

.hearts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.heart-tile {
    aspect-ratio: 1;
    background: transparent;
    border: 2px solid #ff4d4d;
    border-radius: 50%; /* делаем круг-подсказку */
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.heart-tile.found {
    background-color: #ff4d4d;
    border-color: #d63031;
}

.letter-display {
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.7;
}

.code-style {
    font-family: 'Courier New', Courier, monospace;
    background: #f5f5f5;
    padding: 12px;
    border-radius: 6px;
    color: #d63031;
}
