* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-pink: #ff6b9d;
    --primary-red: #ff1744;
    --primary-gold: #ffd700;
    --dark-pink: #ff4081;
    --light-pink: #ffb3d9;
    --deep-purple: #667eea;
    --soft-pink: #f093fb;
    --coral: #ff6b9d;
    --peach: #ffecd2;
    --shadow-soft: 0 20px 60px rgba(0, 0, 0, 0.15);
    --shadow-glow: 0 0 40px rgba(255, 107, 157, 0.4);
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    min-height: 100vh;
    background: linear-gradient(180deg, #0a0e27 0%, #1a1a3e 40%, #16213e 70%, #0f0f23 100%);
    background-attachment: fixed;
    color: #fff;
    overflow-x: hidden;
    position: relative;
}

/* Звёздное небо */
.background-hearts {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.star {
    position: absolute;
    background: #fff;
    border-radius: 50%;
    animation: twinkle ease-in-out infinite;
}

.star--small {
    width: 2px;
    height: 2px;
}

.star--medium {
    width: 3px;
    height: 3px;
    box-shadow: 0 0 6px rgba(255, 255, 255, 0.8);
}

.star--large {
    width: 4px;
    height: 4px;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.9), 0 0 20px rgba(255, 215, 0, 0.3);
}

@keyframes twinkle {
    0%, 100% {
        opacity: 0.3;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.2);
    }
}

/* Современный заголовок */
.main-header {
    text-align: center;
    padding: 4rem 2rem 3rem;
    position: relative;
    z-index: 1;
}

.animated-title {
    font-size: clamp(2rem, 5vw, 4rem);
    font-weight: 700;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #fff 0%, #ffd700 40%, #ffb3d9 70%, #fff 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 3s linear infinite;
    filter: drop-shadow(0 0 20px rgba(255, 215, 0, 0.4));
}

@keyframes shimmer {
    to {
        background-position: 200% center;
    }
}

.heart-icon {
    font-size: clamp(2rem, 4vw, 3rem);
    animation: heartbeat 2s ease-in-out infinite;
    filter: drop-shadow(0 0 15px rgba(255, 215, 0, 0.6));
}

@keyframes heartbeat {
    0%, 100% {
        transform: scale(1) rotate(0deg);
    }
    25% {
        transform: scale(1.15) rotate(-5deg);
    }
    75% {
        transform: scale(1.15) rotate(5deg);
    }
}

.subtitle {
    font-size: clamp(1rem, 2vw, 1.3rem);
    opacity: 0.9;
    font-weight: 300;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.85);
}

/* Контейнер галереи */
.gallery-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    position: relative;
    z-index: 1;
}

/* Современные кнопки управления */
.gallery-controls {
    text-align: center;
    margin-bottom: 3rem;
}

.control-btn {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: #fff;
    padding: 1rem 2.5rem;
    font-size: 1rem;
    font-weight: 500;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    margin: 0 0.75rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.control-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.control-btn:hover::before {
    left: 100%;
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-3px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
}

.control-btn:active {
    transform: translateY(-1px);
}

.control-btn span {
    margin-right: 0.5rem;
    display: inline-block;
    transition: transform 0.3s ease;
}

.control-btn:hover span {
    transform: scale(1.1);
}

/* Современная сетка открыток */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2.5rem;
    margin-top: 2rem;
}

.card-preview {
    background: var(--glass-bg);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-radius: 24px;
    padding: 0;
    cursor: pointer;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--glass-border);
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.card-preview::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    opacity: 0;
    transition: opacity 0.5s ease;
    z-index: 1;
}

.card-preview:hover::before {
    opacity: 1;
}

.card-preview::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.5s ease;
    z-index: 0;
}

.card-preview:hover::after {
    opacity: 1;
}

.card-preview:hover {
    transform: translateY(-12px) scale(1.02);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25), 0 0 40px rgba(255, 107, 157, 0.3);
    border-color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.15);
}

/* Превью открытки — на всю ширину карточки, без скроллбара */
.card-preview-iframe-wrapper {
    width: 100%;
    height: 240px;
    border-radius: 24px 24px 0 0;
    overflow: hidden;
    position: relative;
    z-index: 2;
    background: rgba(0, 0, 0, 0.3);
}

.card-preview-iframe {
    position: absolute;
    left: 0;
    top: 0;
    width: 800px;
    height: 600px;
    transform-origin: 0 0;
    border: none;
    pointer-events: none;
    transition: transform 0.3s ease;
    /* масштаб задаётся из JS по ширине обёртки */
}

.card-preview-content {
    padding: 1.75rem;
    position: relative;
    z-index: 2;
}

.card-preview-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: #fff;
    letter-spacing: -0.01em;
    line-height: 1.3;
}

.card-preview-description {
    font-size: 0.95rem;
    opacity: 0.85;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 300;
}

.card-preview-number {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    background: linear-gradient(135deg, rgba(255, 107, 157, 0.9), rgba(102, 126, 234, 0.9));
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    z-index: 3;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.card-preview:hover .card-preview-number {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 6px 30px rgba(255, 107, 157, 0.4);
}

/* Современное слайдшоу */
.slideshow-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        backdrop-filter: blur(0px);
    }
    to {
        opacity: 1;
        backdrop-filter: blur(10px);
    }
}

.slideshow-close {
    position: absolute;
    top: 2rem;
    right: 2rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: #fff;
    width: 56px;
    height: 56px;
    border-radius: 12px;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 1001;
    backdrop-filter: blur(20px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.slideshow-close:hover {
    background: rgba(255, 107, 157, 0.3);
    transform: rotate(90deg) scale(1.1);
    border-color: rgba(255, 107, 157, 0.5);
}

.slideshow-content {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 90%;
    max-width: 1200px;
    gap: 2rem;
}

.slideshow-nav {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: #fff;
    width: 64px;
    height: 64px;
    border-radius: 16px;
    font-size: 2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(20px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.slideshow-nav:hover {
    background: rgba(255, 107, 157, 0.3);
    transform: scale(1.1);
    border-color: rgba(255, 107, 157, 0.5);
}

#slideshow-card {
    flex: 1;
    max-width: 800px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px) saturate(180%);
    border-radius: 24px;
    padding: 3rem;
    border: 1px solid var(--glass-border);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

/* Современный футер */
.main-footer {
    text-align: center;
    padding: 3rem 2rem;
    position: relative;
    z-index: 1;
    font-size: 1rem;
    opacity: 0.85;
    font-weight: 300;
    letter-spacing: 0.05em;
}

/* Адаптивность */
@media (max-width: 768px) {
    .main-header {
        padding: 3rem 1.5rem 2rem;
    }

    .animated-title {
        flex-direction: column;
        gap: 1rem;
    }

    .heart-icon {
        font-size: 2rem;
    }

    .cards-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .gallery-container {
        padding: 1.5rem 1rem;
    }

    .control-btn {
        padding: 0.875rem 2rem;
        font-size: 0.9rem;
        margin: 0.5rem;
    }

    .slideshow-content {
        flex-direction: column;
        width: 95%;
        gap: 1.5rem;
    }

    .slideshow-nav {
        width: 56px;
        height: 56px;
        font-size: 1.5rem;
    }

    .card-preview-image {
        height: 200px;
    }

    .card-preview-content {
        padding: 1.5rem;
    }
}

/* Анимация появления карточек */
@keyframes cardAppear {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card-preview {
    animation: cardAppear 0.6s ease forwards;
}

.card-preview:nth-child(1) { animation-delay: 0.1s; }
.card-preview:nth-child(2) { animation-delay: 0.2s; }
.card-preview:nth-child(3) { animation-delay: 0.3s; }
.card-preview:nth-child(4) { animation-delay: 0.4s; }
.card-preview:nth-child(5) { animation-delay: 0.5s; }
.card-preview:nth-child(6) { animation-delay: 0.6s; }
