/* =========================================================
   ИГРА "НАЙДИ 5 ПЕРСОНАЖЕЙ"
   Стиль под Pastel Aurora сайта "Карусель"
   ========================================================= */

/* Затемнение фона */
.character-game-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000000;

    display: none;
    align-items: center;
    justify-content: center;

    padding: 20px;

    background:
        radial-gradient(
            circle at 20% 20%,
            rgba(255, 183, 231, 0.18),
            transparent 32%
        ),
        radial-gradient(
            circle at 80% 22%,
            rgba(145, 183, 255, 0.18),
            transparent 34%
        ),
        rgba(50, 35, 78, 0.48);

    backdrop-filter: blur(16px) saturate(1.1);
}

.character-game-overlay.is-visible {
    display: flex;
}

/* Главное окно */
.character-game-modal {
    position: relative;

    width: min(560px, 100%);
    padding: 54px 42px 38px;

    overflow: hidden;

    border: 1px solid rgba(142, 116, 214, 0.24);
    border-radius: 34px;

    background:
        radial-gradient(
            circle at 12% 10%,
            rgba(255, 183, 231, 0.52),
            transparent 32%
        ),
        radial-gradient(
            circle at 88% 12%,
            rgba(145, 183, 255, 0.44),
            transparent 34%
        ),
        radial-gradient(
            circle at 50% 100%,
            rgba(198, 168, 255, 0.34),
            transparent 42%
        ),
        linear-gradient(
            145deg,
            rgba(255, 255, 255, 0.94),
            rgba(255, 248, 253, 0.88) 45%,
            rgba(239, 244, 255, 0.88)
        );

    box-shadow:
        0 34px 100px rgba(50, 31, 81, 0.30),
        0 0 70px rgba(185, 157, 255, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.92);

    color: #32264a;
    text-align: center;

    animation: characterModalAppear 0.45s cubic-bezier(.2, .8, .2, 1);
}

/* Светящаяся цветная рамка */
.character-game-modal::before {
    content: '';

    position: absolute;
    inset: 0;

    padding: 2px;
    border-radius: inherit;

    background:
        linear-gradient(
            135deg,
            #ffb7e7,
            #c6a8ff,
            #91b7ff,
            #b9f0ff,
            #ffc7ee
        );

    -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);

    -webkit-mask-composite: xor;
    mask-composite: exclude;

    pointer-events: none;
}

/* Декоративные звёзды */
.character-game-modal::after {
    content: '✦';

    position: absolute;
    left: 28px;
    top: 24px;

    color: #8f70ff;
    font-size: 28px;

    text-shadow:
        0 0 14px rgba(143, 112, 255, 0.45),
        120px 18px 0 #ffb7e7,
        430px 42px 0 #91b7ff,
        390px 310px 0 #c6a8ff,
        35px 300px 0 #ffb7e7;

    animation: characterSparkle 2.2s ease-in-out infinite;
}

/* Заголовок */
.character-game-modal h2 {
    position: relative;
    z-index: 1;

    margin: 0 0 20px;

    font-family: 'Cormorant Garamond', serif !important;
    font-size: clamp(34px, 6vw, 50px);
    line-height: 1.02;
    letter-spacing: -0.035em;

    color: #34224f !important;

    text-shadow:
        0 1px 0 rgba(255, 255, 255, 0.9),
        0 10px 28px rgba(137, 111, 218, 0.14);
}

.character-game-modal h2::after {
    content: '';

    display: block;

    width: 180px;
    height: 3px;

    margin: 20px auto 0;

    border-radius: 999px;

    background:
        linear-gradient(
            90deg,
            transparent,
            #ffb7e7,
            #c6a8ff,
            #91b7ff,
            transparent
        );
}

/* Текст */
.character-game-modal p {
    position: relative;
    z-index: 1;

    max-width: 450px;
    margin: 0 auto 16px;

    font-family: 'Manrope', sans-serif !important;
    font-size: 17px;
    line-height: 1.65;

    color: #725f8e !important;
}

.character-game-modal strong {
    color: #795bd7;
    font-weight: 900;
}

/* Кнопка закрытия */
.character-game-close {
    position: absolute;
    top: 15px;
    right: 16px;
    z-index: 5;

    display: flex;
    align-items: center;
    justify-content: center;

    width: 42px !important;
    height: 42px !important;
    min-height: 42px !important;

    padding: 0 !important;

    border: 1px solid rgba(137, 111, 218, 0.20) !important;
    border-radius: 50% !important;

    background: rgba(255, 255, 255, 0.70) !important;

    color: #4d3b70 !important;
    font-size: 27px !important;
    line-height: 1 !important;

    box-shadow:
        0 10px 26px rgba(91, 71, 140, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.90);

    cursor: pointer;

    transition:
        transform 0.25s ease,
        box-shadow 0.25s ease;
}

.character-game-close:hover {
    transform: rotate(8deg) scale(1.08);

    box-shadow:
        0 14px 34px rgba(137, 111, 218, 0.22);
}

/* Главная кнопка */
.character-game-button {
    position: relative;
    z-index: 1;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-width: 230px;
    min-height: 58px !important;

    margin-top: 14px;
    padding: 16px 30px !important;

    border: 1px solid rgba(255, 255, 255, 0.82) !important;
    border-radius: 999px !important;

    background:
        linear-gradient(
            135deg,
            #ffd7f1 0%,
            #c6a8ff 34%,
            #91b7ff 72%,
            #b9f0ff 100%
        ) !important;

    color: #32264a !important;

    font-family: 'Manrope', sans-serif !important;
    font-size: 16px !important;
    font-weight: 900 !important;
    letter-spacing: 0.02em;

    box-shadow:
        0 18px 42px rgba(137, 111, 218, 0.25),
        0 0 32px rgba(145, 183, 255, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.82) !important;

    cursor: pointer;

    transition:
        transform 0.25s ease,
        box-shadow 0.25s ease;
}

.character-game-button::before {
    content: '✨';
    margin-right: 9px;
}

.character-game-button:hover {
    transform: translateY(-3px) scale(1.02);

    box-shadow:
        0 24px 52px rgba(137, 111, 218, 0.32),
        0 0 42px rgba(145, 183, 255, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.9) !important;
}

/* Счётчик */
.character-game-progress {
    position: fixed;
    right: 18px;
    bottom: 90px;
    z-index: 999900;

    display: flex;
    align-items: center;
    gap: 9px;

    min-height: 48px !important;
    padding: 11px 18px !important;

    border: 1px solid rgba(142, 116, 214, 0.24) !important;
    border-radius: 999px !important;

    background:
        linear-gradient(
            135deg,
            rgba(255, 255, 255, 0.88),
            rgba(247, 237, 255, 0.82),
            rgba(235, 242, 255, 0.84)
        ) !important;

    box-shadow:
        0 18px 42px rgba(91, 71, 140, 0.18),
        0 0 30px rgba(145, 183, 255, 0.14),
        inset 0 1px 0 rgba(255, 255, 255, 0.86);

    backdrop-filter: blur(16px);

    color: #4b3670 !important;

    font-family: 'Manrope', sans-serif !important;
    font-size: 14px !important;
    font-weight: 900 !important;

    cursor: pointer;

    transition:
        transform 0.25s ease,
        box-shadow 0.25s ease;
}

.character-game-progress:hover {
    transform: translateY(-2px);

    box-shadow:
        0 22px 48px rgba(137, 111, 218, 0.24),
        0 0 38px rgba(145, 183, 255, 0.20);
}

/* Кодовое слово */
.character-game-code {
    position: relative;
    z-index: 1;

    display: block;

    margin: 20px auto;
    padding: 17px 20px;

    border: 2px dashed rgba(137, 111, 218, 0.40);
    border-radius: 20px;

    background:
        linear-gradient(
            135deg,
            rgba(255, 215, 241, 0.62),
            rgba(198, 168, 255, 0.48),
            rgba(145, 183, 255, 0.44)
        );

    color: #5c3fb2;

    font-family: 'Manrope', sans-serif;
    font-size: 32px;
    font-weight: 900;
    letter-spacing: 5px;

    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.76),
        0 14px 36px rgba(137, 111, 218, 0.16);
}

.character-game-note {
    font-size: 13px !important;
    opacity: 0.86;
}

/* =========================================================
   ПЕРСОНАЖИ
   ========================================================= */

.hidden-game-character {
    position: absolute;
    z-index: 500;

    width: 120px;
    height: 120px;

    padding: 0 !important;

    border: none !important;
    outline: none !important;

    background: transparent !important;

    cursor: pointer;

    filter:
        drop-shadow(0 10px 14px rgba(60, 35, 90, 0.22));

    animation:
        gameCharacterFloat 2.6s ease-in-out infinite;

    transition:
        opacity 0.3s ease,
        transform 0.3s ease,
        filter 0.3s ease;
}

.hidden-game-character img {
    display: block;

    width: 100%;
    height: 100%;

    object-fit: contain;

    background: transparent !important;

    pointer-events: none;
}

.hidden-game-character:hover {
    transform: scale(1.12);

    filter:
        drop-shadow(0 14px 18px rgba(137, 111, 218, 0.32))
        drop-shadow(0 0 18px rgba(145, 183, 255, 0.28));
}

.hidden-game-character.character-found {
    opacity: 0;
    transform: scale(1.8);
    pointer-events: none;
}

/* =========================================================
   ПОЗИЦИИ ПЕРСОНАЖЕЙ
   ========================================================= */

/* Главная */
.hero {
    position: relative;
}

.character-main {
    right: 6%;
    bottom: 12%;
}

/* Услуги */
.services-details {
    position: relative;
}

.character-services {
    right: 5%;
    top: 110px;
}

/* Портфолио */
.portfolio-gallery {
    position: relative;
}

.character-portfolio {
    left: 4%;
    top: 100px;
}

/* Лофты */
.loft-card-mystic {
    position: relative;
}

.character-lofts {
    right: 3%;
    top: 45%;
}

/* Контакты */
.contact-form-section {
    position: relative;
}

.character-contact {
    left: 4%;
    top: 160px;
}

/* =========================================================
   АНИМАЦИИ
   ========================================================= */

@keyframes characterModalAppear {
    from {
        opacity: 0;
        transform: translateY(28px) scale(0.92);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes characterSparkle {
    0%,
    100% {
        opacity: 0.55;
        transform: scale(0.94) rotate(0deg);
    }

    50% {
        opacity: 1;
        transform: scale(1.08) rotate(8deg);
    }
}

@keyframes gameCharacterFloat {
    0%,
    100% {
        translate: 0 0;
    }

    50% {
        translate: 0 -9px;
    }
}

/* =========================================================
   МОБИЛЬНАЯ ВЕРСИЯ
   ========================================================= */

@media (max-width: 768px) {
    .hidden-game-character {
        width: 90px;
        height: 90px;
    }

    .character-game-progress {
        right: 10px;
        bottom: 82px;

        padding: 9px 13px !important;

        font-size: 12px !important;
    }

    .character-main {
        right: 5%;
        bottom: 8%;
    }

    .character-services {
        right: 4%;
        top: 140px;
    }

    .character-portfolio {
        left: 3%;
        top: 80px;
    }

    .character-lofts {
        right: 3%;
        top: 34%;
    }

    .character-contact {
        left: auto;
        right: 4%;
        top: 120px;
    }
}

@media (max-width: 600px) {
    .character-game-overlay {
        padding: 14px;
    }

    .character-game-modal {
        padding: 48px 22px 28px;
        border-radius: 26px;
    }

    .character-game-modal h2 {
        font-size: clamp(31px, 11vw, 42px);
    }

    .character-game-modal p {
        font-size: 15px;
    }

    .character-game-button {
        width: 100%;
        min-width: 0;
    }

    .character-game-code {
        font-size: 26px;
        letter-spacing: 3px;
    }
}