* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Montserrat', sans-serif;
}

body {
    min-height: 100vh;
    min-height: 100dvh;
    background: #1a1017;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-x: hidden;
    overflow-y: auto;
    position: relative;
    padding: 20px;
    transition: background 1.4s ease;
}

body:has(.slide-dark.active)   { background: #1a1017; }
body:has(.slide-warm.active)   { background: linear-gradient(135deg, #ffdde1 0%, #ee9ca7 100%); }
body:has(.slide-bright.active) { background: linear-gradient(135deg, #a18cd1 0%, #fbc2eb 100%); }
body:has(.slide-light.active)  { background: #fdf5f7; }

/* ===== Фоновые сердечки ===== */
.hearts-bg {
    position: fixed;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
}

.heart {
    position: absolute;
    color: rgba(255, 255, 255, 0.5);
    font-size: 20px;
    animation: floatUp linear infinite;
}

@keyframes floatUp {
    0%   { transform: translateY(100vh) scale(0.5); opacity: 0; }
    10%  { opacity: 1; }
    100% { transform: translateY(-10vh) scale(1.2); opacity: 0; }
}

/* ===== Контейнер и слайды ===== */
.slide-container {
    position: relative;
    width: 100%;
    max-width: 640px;
    z-index: 1;
    margin: auto;
}

.slide { display: none; opacity: 0; }
.slide.active {
    display: block;
    animation: fadeIn 1.4s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(30px) scale(0.98); filter: blur(2px); }
    to   { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}

/* ===== Карточка ===== */
.card {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-radius: 28px;
    padding: 50px 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25),
                0 0 0 1px rgba(255, 255, 255, 0.4) inset;
    text-align: center;
    position: relative;
}

.card-dark {
    background: rgba(30, 20, 28, 0.85);
    color: #f5e6eb;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6),
                0 0 0 1px rgba(255, 182, 193, 0.15) inset;
}

/* ===== Заголовки и текст ===== */
.title-simple {
    font-family: 'Great Vibes', cursive;
    font-size: 2.6rem;
    color: #c2185b;
    font-weight: 400;
    line-height: 1.15;
    margin-bottom: 26px;
}
.card-dark .title-simple { color: #ffb6d5; }

.text-main {
    color: #4a2c3a;
    font-size: 1.1rem;
    line-height: 1.7;
    margin-bottom: 18px;
}
.card-dark .text-main { color: #f5e6eb; }

.text-hint {
    color: #8a5a6b;
    font-size: 0.95rem;
    font-style: italic;
    margin-bottom: 26px;
    margin-top: 8px;
}
.card-dark .text-hint { color: #d8a8bd; }

/* ===== Кнопки общего вида ===== */
.btn {
    padding: 15px 40px;
    border: none;
    border-radius: 50px;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    letter-spacing: 0.4px;
    display: inline-block;
    text-decoration: none;
    text-align: center;
}

.btn-next {
    background: linear-gradient(135deg, #ff6b9d, #c2185b);
    color: white;
    box-shadow: 0 10px 28px rgba(194, 24, 91, 0.4);
    margin-top: 10px;
}
.btn-next:hover {
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 15px 40px rgba(194, 24, 91, 0.55);
}

/* ===== СЛАЙД 1: выбор имени ===== */
.name-options {
    display: flex;
    justify-content: center;
    gap: 14px;
    flex-wrap: wrap;
    margin-top: 10px;
    transition: opacity 0.5s ease, transform 0.5s ease;
}
.name-options.fade-out {
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
}

.btn-name {
    background: rgba(255, 255, 255, 0.1);
    color: #f5e6eb;
    border: 2px solid rgba(255, 182, 213, 0.4);
    padding: 14px 30px;
    font-size: 1rem;
}
.btn-name:hover {
    background: linear-gradient(135deg, #ff6b9d, #c2185b);
    border-color: transparent;
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 10px 30px rgba(194, 24, 91, 0.5);
    color: white;
}

.name-reveal {
    display: none;
    opacity: 0;
    animation: revealIn 1.2s ease 0.2s forwards;
}
.name-reveal.show { display: block; }

@keyframes revealIn {
    to { opacity: 1; }
}

/* ===== СЛАЙД 3: боулинг снизу вверх ===== */
.bowl-stage {
    position: relative;
    margin: 20px 0 30px;
    min-height: 260px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 10px 0;
}

.bowl-text {
    color: #4a2c3a;
    font-size: 1.05rem;
    line-height: 1.9;
    text-align: center;
    padding: 0 10px;
    position: relative;
    z-index: 1;
}

.bowl-text .letter {
    display: inline-block;
    will-change: transform, opacity;
}

/* Шар снизу, по центру по горизонтали */
.bowling-ball {
    position: absolute;
    bottom: 0;
    left: 50%;
    margin-left: -32px;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #4a4a4a, #0d0d0d);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4),
                inset -8px -10px 20px rgba(0, 0, 0, 0.6),
                inset 8px 10px 20px rgba(255, 255, 255, 0.1);
    cursor: pointer;
    z-index: 5;
    transition: transform 0.3s ease;
}
.bowling-ball::before,
.bowling-ball::after {
    content: '';
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.8);
}
.bowling-ball::before { top: 18px; left: 24px; }
.bowling-ball::after  { top: 30px; left: 32px; }

.ball-shine {
    position: absolute;
    top: 10px; left: 12px;
    width: 18px; height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(-30deg);
}

.bowling-ball:hover {
    transform: scale(1.08);
    box-shadow: 0 12px 30px rgba(255, 107, 157, 0.5),
                inset -8px -10px 20px rgba(0, 0, 0, 0.6);
}

/* Шар едет снизу вверх через всю сцену */
.bowling-ball.rolling-up {
    animation: rollUp 1.6s cubic-bezier(0.45, 0.05, 0.55, 0.95) forwards;
}

@keyframes rollUp {
    0%   { bottom: 0;                    transform: rotate(0deg); }
    100% { bottom: calc(100% - 64px);    transform: rotate(-1080deg); }
}

.bowl-hint {
    color: #8a5a6b;
    font-size: 0.9rem;
    font-style: italic;
    margin: 10px 0 0;
    transition: opacity 0.5s ease;
}

/* «Вот такие делааа» после взрыва букв */
.strike-reveal {
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 1s ease 0.3s, transform 1s ease 0.3s;
    margin-top: 10px;
}
.strike-reveal.show {
    opacity: 1;
    transform: translateY(0);
}

.strike-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.5rem;
    color: #c2185b;
    font-weight: 600;
    margin-bottom: 22px;
    line-height: 1.4;
    letter-spacing: 0.3px;
}

/* ===== СЛАЙД 4: постер ===== */
.poster-frame {
    margin: 0 auto 24px;
    max-width: 280px;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 15px 40px rgba(180, 80, 120, 0.25);
    border: 4px solid white;
    position: relative;
}

.poster-img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 16px;
}

.poster-placeholder {
    background: linear-gradient(135deg, #ffdde1 0%, #ee9ca7 100%);
    height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: white;
    font-size: 2.5rem;
}
.poster-placeholder small {
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 1px;
    opacity: 0.9;
}

/* ===== СЛАЙД 6: финальные кнопки ===== */
.final-buttons {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 25px;
    align-items: center;
    opacity: 0;
    transform: translateY(15px);
    animation: finalShow 1.4s ease 1.5s forwards;
}

@keyframes finalShow {
    to { opacity: 1; transform: translateY(0); }
}

.btn-final-ready {
    background: linear-gradient(135deg, #34d399, #059669);
    color: white;
    box-shadow: 0 12px 30px rgba(5, 150, 105, 0.4);
    padding: 18px 46px;
    font-size: 1.15rem;
    min-width: 260px;
}
.btn-final-ready:hover {
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 15px 40px rgba(5, 150, 105, 0.55);
}

.btn-final-notready {
    background: transparent;
    color: #b07a8a;
    border: 2px solid rgba(176, 122, 138, 0.35);
    padding: 12px 32px;
    font-size: 0.9rem;
    font-weight: 500;
    min-width: 200px;
    transition: all 0.3s ease;
    will-change: left, top, transform;
}
.btn-final-notready:hover {
    background: rgba(176, 122, 138, 0.08);
    border-color: rgba(176, 122, 138, 0.6);
}

/* Намёк-стрелка после 3 попыток */
.notready-hint-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 22px;
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}
.notready-hint-wrap.show {
    opacity: 1;
    transform: translateY(0);
}

.notready-hint {
    font-style: italic;
    color: #c2185b;
    font-size: 1.05rem;
    font-weight: 500;
    line-height: 1.4;
}

.arrow-to-ready {
    font-size: 2rem;
    color: #34d399;
    animation: arrowBounce 1.2s ease infinite;
    transform: scaleX(-1);
}

@keyframes arrowBounce {
    0%, 100% { transform: scaleX(-1) translateY(0); }
    50%      { transform: scaleX(-1) translateY(-8px); }
}

/* ===== P.S. — рукописным шрифтом ===== */
.ps-note {
    margin-top: 34px;
    font-family: 'Great Vibes', cursive;
    color: #c2185b;
    font-size: 1.55rem;
    line-height: 1.5;
    opacity: 0;
    transform: translateY(8px);
    animation: psShow 1.8s ease 3s forwards;
}

@keyframes psShow {
    to { opacity: 1; transform: translateY(0); }
}

/* ===== Музыка ===== */
.music-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.75);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
    font-size: 1.3rem;
    cursor: pointer;
    z-index: 200;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}
.music-toggle:hover { transform: scale(1.1); background: #fff; }
.music-toggle.playing {
    background: linear-gradient(135deg, #ff6b9d, #c2185b);
    color: white;
}

/* ===== Мобильная версия ===== */
@media (max-width: 600px) {
    body { align-items: flex-start; padding: 14px; }
    .card { padding: 32px 22px; border-radius: 22px; }
    .title-simple { font-size: 2rem; }
    .text-main { font-size: 1rem; }
    .text-hint { font-size: 0.88rem; }
    .btn { padding: 14px 32px; font-size: 1rem; }
    .btn-final-ready { min-width: 100%; }
    .btn-final-notready { min-width: 100%; }
    .btn-name { padding: 12px 22px; font-size: 0.92rem; }
    .music-toggle { top: 12px; right: 12px; width: 42px; height: 42px; font-size: 1.1rem; }
        .bowling-ball { width: 54px; height: 54px; margin-left: -27px; }
    @keyframes rollUp {
        0%   { bottom: 0;                    transform: rotate(0deg); }
        100% { bottom: calc(100% - 54px);    transform: rotate(-1080deg); }
    }
    .poster-placeholder { height: 160px; }
    .strike-title { font-size: 2rem; }
    .ps-note { font-size: 1.3rem; }
}

/* ============================================================ */
/* ============ ЧЕЛОВЕК-ПАУК НА СЛАЙДЕ 2 ===================== */
/* ============================================================ */

.spider-overlay {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 999;
    opacity: 0;
    transition: opacity 0.2s ease;
    overflow: hidden;
}

.spider-overlay.active {
    opacity: 1;
}

/* ===== ПАУК ===== */
.spider-fly {
    position: absolute;
    top: -25%;
    left: -25%;
    font-size: 5rem;
    filter: drop-shadow(0 10px 25px rgba(0, 0, 0, 0.6));
    z-index: 3;
}

.spider-overlay.active .spider-fly {
    animation: spiderFlight 6s cubic-bezier(0.45, 0.05, 0.55, 0.95) forwards;
}

@keyframes spiderFlight {
    0% {
        top: -25%;
        left: -25%;
        transform: rotate(0deg) scale(1);
    }
    30% {
        top: 15%;
        left: 20%;
        transform: rotate(30deg) scale(1.3);
    }
    45% {
        top: 35%;
        left: 40%;
        transform: rotate(10deg) scale(1.5);
    }
    55% {
        /* паук «замер» и кидает паутину */
        top: 40%;
        left: 45%;
        transform: rotate(-5deg) scale(1.7);
    }
    70% {
        /* дольше висит и «держит» паутину */
        top: 40%;
        left: 45%;
        transform: rotate(-5deg) scale(1.7);
    }
    100% {
        top: 130%;
        left: 130%;
        transform: rotate(50deg) scale(0.6);
    }
}

.spider-emoji {
    display: inline-block;
}

img.spider-emoji {
    width: 110px;
    height: auto;
}

/* ===== ПАУТИНА: крупные белые нити + кольца ===== */
.web-burst {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    z-index: 2;
    pointer-events: none;
    filter: drop-shadow(0 0 12px rgba(255, 255, 255, 0.9))
            drop-shadow(0 0 4px rgba(255, 255, 255, 1));
}

.web-burst line {
    stroke: rgba(255, 255, 255, 0.95);
    stroke-width: 0.6;
    stroke-linecap: round;
}

.web-burst circle {
    fill: none;
    stroke: rgba(255, 255, 255, 0.85);
    stroke-width: 0.6;
    stroke-dasharray: 2 1.5;
}

/* Вспышка паутины: быстро появляется, держится ~1.2 сек, плавно уходит */
.spider-overlay.active .web-burst {
    animation: webBurst 6s ease forwards;
}

@keyframes webBurst {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    32% {
        opacity: 0;
        transform: scale(0.3);
    }
    38% {
        opacity: 1;
        transform: scale(1.05);
    }
    46% {
        opacity: 1;
        transform: scale(1);
    }
    75% {
        opacity: 1;
        transform: scale(1);
    }
    100% {
        opacity: 0;
        transform: scale(1.15);
    }
}

/* ===== ПЕРЕВОРАЧИВАНИЕ КАРТОЧКИ КАК СТРАНИЦЫ КНИГИ ===== */
.page-card {
    transform-origin: left center;
    transition: transform 2.4s cubic-bezier(0.5, 0, 0.2, 1),
                opacity 2.4s ease,
                box-shadow 2.4s ease;
    perspective: 1600px;
    backface-visibility: hidden;
}

.page-card.page-flip {
    transform: perspective(1400px) rotateY(-90deg) translateX(-40px) scale(0.96);
    opacity: 0.6;
    box-shadow: -20px 0 60px rgba(0, 0, 0, 0.3);
}

/* Лёгкая вибрация карточки в момент удара паутиной (~1.4 сек) */
@keyframes cardShake {
    0%, 100% { translate: 0 0; }
    20%      { translate: -4px 2px; }
    40%      { translate: 4px -2px; }
    60%      { translate: -3px 1px; }
    80%      { translate: 3px -1px; }
}

.spider-overlay.active ~ .page-card {
    animation: cardShake 0.5s ease 1.4s;
}

/* ===== Мобильная версия ===== */
@media (max-width: 600px) {
    .spider-fly { font-size: 3.5rem; }
    img.spider-emoji { width: 80px; }
    .web-burst line,
    .web-burst circle { stroke-width: 0.8; }
}