/* Основные стили для театрального теста */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
body {
    min-height: 100vh;
    height: 100vh;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: rgb(204, 120, 207);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

/* Фоновые театральные маски */
body::before,
body::after {
    content: '';
    position: absolute;
    width: 120px;
    height: 120px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    opacity: 0.45;
    z-index: 0;
}

body::before {
    top: 30%;
    left: 0%;
    background-image: url('mask1.png');
    animation: float 6s ease-in-out infinite;
}

body::after {
    width: 200px !important;
    height: 200px !important;
    bottom: -15%;
    right: -7%;
    background-image: url('mask1.png');
    animation: float 6s ease-in-out infinite reverse;
}

/* Дополнительные театральные маски на фоне */
.mask-bg-1,
.mask-bg-2,
.mask-bg-3,
.mask-bg-4,
.mask-bg-5,
.mask-bg-6,
.mask-bg-7,
.mask-bg-8 {
    position: absolute;
    width: 140px;
    height: 140px;
    opacity: 0.45;
    z-index: 0;
    animation: float 8s ease-in-out infinite;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mask-bg-1 img,
.mask-bg-2 img,
.mask-bg-3 img,
.mask-bg-4 img,
.mask-bg-5 img,
.mask-bg-6 img,
.mask-bg-7 img,
.mask-bg-8 img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.mask-bg-1 {
    width: 200px !important;
    height: 200px !important;
    top: -13%;
    right: -10%;
    animation-delay: 1s;
}

.mask-bg-2 {
    bottom: 20%;
    left: 15%;
    animation-delay: 2s;
}

.mask-bg-3 {
    top: 50%;
    left: 25%;
    animation-delay: 3s;
}

.mask-bg-4 {
    top: 25%;
    right: 30%;
    animation-delay: 4s;
}

.mask-bg-5 {
    top: 70%;
    right: 10%;
    animation-delay: 5s;
}

.mask-bg-6 {
    bottom: 40%;
    left: 5%;
    animation-delay: 6s;
}

.mask-bg-7 {
    top: 35%;
    left: 10%;
    animation-delay: 7s;
}

.mask-bg-8 {
    bottom: 60%;
    right: 25%;
    animation-delay: 8s;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(5deg); }
}

/* Аватар пользователя */
.avatar {
    text-align: center;
    padding: 40px 20px 30px;
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2000;
}

.avatar-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #FF6B6B, #FFE66D);
    border-radius: 50%;
    margin: 0 auto 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    position: relative;
    border: 3px solid white;
}

.avatar-mask {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    background-image: url('IMG_8164.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 50%;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

/* Центральная секция с кнопкой теста */
.center-section {
    position: absolute;
    top: 45%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    width: 100%;
    max-width: 400px;
    padding: 0 20px;
    overflow: visible;
}

/* Основная кнопка теста - по центру */
.main-button {
    background: white;
    border: none;
    border-radius: 35px;
    padding: 20px 5px;
    margin: 0 auto;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.2);
    position: relative;
    overflow: visible;
    display: block;
    width: calc(100% - 60px);
    max-width: 400px;
}

.main-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(139, 92, 246, 0.1), transparent);
    transition: left 0.5s;
}

.main-button:hover::before {
    left: 100%;
}

.main-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(139, 92, 246, 0.3);
}

.main-button-text {
    font-size: 4.4rem;
    font-weight: 700;
    color: rgb(204, 120, 207);
    text-align: center;
    line-height: 1.2;
}

/* Секция рефералов - между основной кнопкой и нижними */
.referral-section {
    position: absolute;
    top: 58%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    width: 100%;
    max-width: 240px;
    padding: 0 20px;
    margin-top: 20px;
    margin-bottom: 20px;
}

.referral-button {
    background: white;
    border-radius: 25px;
    padding: 12px 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.2);
    position: relative;
    overflow: visible;
    width: 100%;
}

.referral-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(139, 92, 246, 0.3);
}

.referral-button-text {
    font-size: 1.1rem;
    font-weight: 700;
    color: rgb(204, 120, 207);
    text-align: center;
    line-height: 1.3;
    margin-bottom: 15px;
}

.user-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: rgb(204, 120, 207);
    border-radius: 18px;
    padding: 10px 14px;
    margin: 0 auto;
    width: fit-content;
    position: absolute;
    bottom: -25px;
    left: 50%;
    transform: translateX(-50%);
    border: 2px solid white;
}

.user-avatar {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    background: white;
    border-radius: 50%;
}

.user-name {
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.user-emoji {
    font-size: 0.9rem;
}

/* Нижняя секция */
.bottom-section {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 2;
    padding: 20px;
}

/* Вторичные кнопки */
.secondary-buttons {
    padding: 0 30px 25px;
    max-width: 400px;
    margin: 0 auto;
}

.secondary-button {
    background: white;
    border-radius: 30px;
    padding: 18px 20px;
    margin-bottom: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 1.1rem;
    color: rgb(204, 120, 207);
    font-weight: 600;
    width: 80%;
    margin-left: auto;
    margin-right: auto;
}

.secondary-button:hover {
    border-color: rgb(204, 120, 207);
    background: #F8FAFF;
    transform: translateY(-2px);
}

.secondary-button-icon {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    background: rgb(204, 120, 207);
    border-radius: 50%;
    flex-shrink: 0;
}

/* Нижний профиль */
.profile-section {
    text-align: center;
    padding: 20px 30px 30px;
    max-width: 400px;
    margin: 0 auto;
}

.profile-tag {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid white;
    border-radius: 20px;
    padding: 5px 25px;
    display: inline-block;
    color: white;
    font-size: 0.9rem;
    font-weight: 600;
    min-width: 150px;
}

/* Прогресс-бейдж */
.progress-badge {
    background: rgb(204, 120, 207);
    color: white;
    padding: 5px 24px;
    font-size: 1.5rem;
    font-weight: 600;
    display: inline-block;
    margin-top: 10px;
    z-index: 10000;
    border-radius: 20px;
    border: 2px solid white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    position: absolute;
    top: -35px;
    left: 50%;
    transform: translateX(-50%);
}

/* Секция вопроса */
.question-section {
    padding: 0 30px 30px;
    text-align: center;
}

.question-text {
    font-size: 1.4rem;
    color: #333;
    line-height: 1.4;
    font-weight: 600;
}

/* Секция ответов */
.answers-section {
    padding: 0 30px 30px;
}

.answer-button {
    background: white;
    border: 2px solid #E0E7FF;
    border-radius: 15px;
    padding: 18px 20px;
    margin-bottom: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 1.1rem;
    color: #8B5CF6;
    font-weight: 600;
    width: 100%;
    text-align: left;
}

.answer-button:hover {
    border-color: #8B5CF6;
    background: #F8FAFF;
    transform: translateY(-2px);
}

.answer-button.selected {
    border-color: #8B5CF6;
    background: #8B5CF6;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.3);
}

.answer-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.answer-text {
    flex: 1;
}

/* Кнопка "Далее" */
.next-button {
    background: linear-gradient(135deg, #8B5CF6, #EC4899);
    color: white;
    border: none;
    border-radius: 20px;
    padding: 18px 30px;
    margin: 0 30px 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.1rem;
    font-weight: 600;
    display: block;
    width: calc(100% - 60px);
    text-align: center;
}

.next-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(139, 92, 246, 0.3);
}

/* Анимации появления */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.container {
    animation: slideUp 0.8s ease-out;
}


.question-section {
    animation: slideUp 0.8s ease-out 0.2s both;
}

.answers-section {
    animation: slideUp 0.8s ease-out 0.3s both;
}

.main-button {
    animation: slideUp 0.8s ease-out 0.2s both;
}

.secondary-buttons {
    animation: slideUp 0.8s ease-out 0.3s both;
}

.profile-section {
    animation: slideUp 0.8s ease-out 0.4s both;
}

/* Адаптивность */
@media (max-width: 768px) {
    body {
        padding: 10px;
        overflow-x: hidden;
        overflow-y: auto;
        min-height: 100vh;
        height: auto;
    }
    
    .avatar {
        position: absolute;
        top: 20px;
        left: 50%;
        transform: translateX(-50%);
        padding: 10px 15px 15px;
    }
    
    .avatar-icon {
        width: 60px;
        height: 60px;
        font-size: 2rem;
    }
    
    .avatar-mask {
        width: 60px;
        height: 60px;
    }
    
    .center-section {
        position: absolute;
        top: 35%;
        left: 50%;
        transform: translate(-50%, -50%);
        padding: 0 15px;
        width: 100%;
    }
    
    .main-button {
        padding: 15px 10px;
        width: calc(100% - 40px);
        max-width: 320px;
    }
    
    .main-button-text {
        font-size: 3.2rem;
        line-height: 1.1;
    }
    
    .referral-section {
        position: absolute;
        top: 55%;
        left: 50%;
        transform: translate(-50%, -50%);
        padding: 0 15px;
        margin-top: 10px;
        margin-bottom: 10px;
        width: 100%;
        max-width: 220px;
    }
    
    .referral-button {
        padding: 10px 8px;
        border-radius: 20px;
    }
    
    .referral-button-text {
        font-size: 1rem;
        margin-bottom: 12px;
    }
    
    .user-info {
        padding: 6px 10px;
        gap: 6px;
        border-radius: 14px;
        bottom: -20px;
    }
    
    .user-avatar {
        width: 22px;
        height: 22px;
        font-size: 0.9rem;
    }
    
    .user-name {
        font-size: 0.8rem;
    }
    
    .bottom-section {
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        padding: 10px;
    }
    
    .secondary-buttons {
        padding: 0 15px 15px;
        max-width: 320px;
        margin: 0 auto;
    }
    
    .secondary-button {
        padding: 12px 15px;
        font-size: 1rem;
        margin-bottom: 10px;
        width: 90%;
    }
    
    .secondary-button-icon {
        width: 40px;
        height: 40px;
        font-size: 1.5rem;
    }
    
    .profile-section {
        padding: 10px 15px 20px;
    }
    
    .profile-tag {
        font-size: 0.8rem;
        padding: 4px 20px;
        min-width: 120px;
    }
    
    /* Скрываем некоторые фоновые маски на мобильных */
    .mask-bg-2, .mask-bg-3, .mask-bg-4, .mask-bg-5, .mask-bg-6, .mask-bg-7, .mask-bg-8 {
        display: none;
    }
    
    body::before, body::after {
        opacity: 0.45;
    }
    
    .mask-bg-1 {
        opacity: 0.45;
    }
}

/* Медиа-запрос для очень маленьких экранов */
@media (max-width: 480px) and (max-height: 700px) {
    .avatar {
        top: 15px;
        padding: 5px 10px 10px;
    }
    
    .avatar-icon {
        width: 50px;
        height: 50px;
        font-size: 1.8rem;
    }
    
    .avatar-mask {
        width: 50px;
        height: 50px;
    }
    
    .center-section {
        top: 32%;
    }
    
    .main-button-text {
        font-size: 2.8rem;
    }
    
    .referral-section {
        top: 52%;
        max-width: 200px;
    }
    
    .referral-button-text {
        font-size: 0.9rem;
        margin-bottom: 10px;
    }
    
    .secondary-button {
        padding: 10px 12px;
        font-size: 0.9rem;
        margin-bottom: 8px;
    }
    
    .secondary-button-icon {
        width: 35px;
        height: 35px;
        font-size: 1.3rem;
    }
    
    .profile-section {
        padding: 8px 10px 15px;
    }
    
    .profile-tag {
        font-size: 0.75rem;
        padding: 3px 15px;
        min-width: 100px;
    }
}
