@import url('https://fonts.googleapis.com/css2?family=Jua&display=swap');

:root {
    --male-color: #87CEEB; /* Sky Blue */
    --female-color: #FFB6C1; /* Light Pink */
    --bg-color: #f0f4f7;
    --surface-color: #ffffff;
    --text-color: #333;
    --dark-text-color: #fff;
}

body {
    font-family: 'Jua', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    text-align: center;
    padding: 20px 0;
}

.container {
    background-color: var(--surface-color);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    width: 90%;
    max-width: 500px;
}

.screen { 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
}
.title { 
    font-size: 2.2rem; 
    margin-bottom: 10px;
    color: #ff6b81;
}
.description { 
    font-size: 1.1rem; 
    margin-bottom: 30px; 
    line-height: 1.6; 
    color: #555;
}

.gender-selection {
    display: flex;
    gap: 20px;
    width: 100%;
}
.gender-btn {
    flex: 1;
    font-size: 1.5rem;
    padding: 20px 0;
    border: none;
    color: var(--dark-text-color);
    border-radius: 15px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}
#male-btn { background-color: var(--male-color); }
#female-btn { background-color: var(--female-color); }
.gender-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.15);
}


.btn {
    font-family: 'Jua', sans-serif;
    background-color: #ddd;
    color: var(--text-color);
    border: none;
    padding: 15px 30px;
    border-radius: 12px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: transform 0.2s, background-color 0.2s;
    text-decoration: none;
}
.btn:hover { 
    background-color: #ccc; 
    transform: scale(1.05); 
}

/* 퀴즈 화면 */
#quiz-screen { width: 100%; }
.progress-container { 
    width: 100%; 
    height: 8px; 
    background-color: #e0e0e0; 
    border-radius: 4px; 
    margin-bottom: 5px; 
}
#progress-bar { 
    width: 0%; 
    height: 100%; 
    background: linear-gradient(90deg, var(--male-color), var(--female-color));
    border-radius: 4px; 
    transition: width 0.3s; 
}
#progress-text {
    font-size: 0.9rem;
    color: #777;
    margin-bottom: 20px;
}

#question { 
    margin-bottom: 25px; 
    font-size: 1.5rem; 
    min-height: 4.5rem; 
    line-height: 1.4;
}

.btn-grid { 
    display: grid; 
    grid-template-columns: 1fr; 
    gap: 15px; 
    width: 100%; 
}
.btn-grid .btn { 
    width: 100%; 
    padding: 20px;
    background-color: #f7f7f7;
    border: 2px solid #eee;
    font-size: 1.2rem;
}
.btn-grid .btn:hover {
    background-color: #efefef;
    border-color: #ddd;
}
.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}


/* 결과 화면 */
#result-image { 
    width: 180px; 
    height: 180px; 
    margin: 20px 0; 
    border-radius: 50%; 
    object-fit: cover; 
    border: 5px solid #fff;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}
#result-title { 
    font-size: 2.2rem; 
    margin-bottom: 5px;
}
body[data-gender="male"] #result-title { color: var(--male-color); }
body[data-gender="female"] #result-title { color: var(--female-color); }

#result-percentage {
    font-size: 1.3rem;
    font-weight: bold;
    color: #444;
    margin-bottom: 15px;
    background-color: #f0f4f7;
    padding: 8px 15px;
    border-radius: 20px;
}

#result-description {
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 25px;
    color: #555;
}

/* 공유 버튼 */
#share-buttons {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}
.share-btn {
    background-color: #e9e9e9;
    font-size: 1rem;
    padding: 12px 20px;
}
#kakao-btn { background-color: #FEE500; color: #191919; }
#kakao-btn:hover { background-color: #f7d800; }
.share-btn:hover { background-color: #dcdcdc; }

#retry-btn { 
    background-color: #ff6b81;
    color: white;
    font-size: 1.2rem;
}
#retry-btn:hover {
    background-color: #ff4757;
}


#toast-popup {
    visibility: hidden;
    min-width: 250px;
    background-color: rgba(30, 30, 30, 0.9);
    color: #fff;
    text-align: center;
    border-radius: 10px;
    padding: 16px;
    position: fixed;
    z-index: 10000;
    left: 50%;
    transform: translateX(-50%);
    bottom: 30px;
    font-size: 1rem;
    font-family: 'Jua', sans-serif;
    opacity: 0;
    transition: all 0.5s ease-in-out;
}
#toast-popup.show {
    visibility: visible;
    opacity: 1;
    bottom: 60px;
}

/* 광고 컨테이너 */
.ad-container {
    width: 100%;
    margin: 25px 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100px;
}

/* 모바일 반응형 */
@media (max-width: 480px) {
    .container {
        padding: 20px;
    }
    .title {
        font-size: 1.8rem;
    }
    .description {
        font-size: 1rem;
    }
    .gender-btn {
        font-size: 1.2rem;
        padding: 15px 0;
    }
    #question {
        font-size: 1.3rem;
    }
    .btn-grid .btn {
        padding: 15px;
        font-size: 1rem;
    }
    #result-image {
        width: 150px;
        height: 150px;
    }
    #result-title {
        font-size: 1.8rem;
    }
    #result-percentage {
        font-size: 1.1rem;
    }
    #result-description {
        font-size: 1rem;
    }
  
}

/* ================================== */
/*   신박한 애니메이션 효과 (수정된 코드)   */
/* ================================== */
#animation {
    position: relative; /* 자식 요소의 위치 기준점 */
    overflow: hidden;   /* 영역을 벗어나는 아이콘을 숨김 */
    background: #f0f4f7;
    border-radius: 12px;
    min-height: 90px;
    cursor: default; /* 마우스 커서 기본 모양으로 */
    user-select: none; /* 텍스트 선택 방지 */
}

/* [추가] 배경 텍스트(워터마크) 스타일 */
.background-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.8rem; /* 폰트 크기 조정 */
    font-weight: 700;  /* 굵게 */
    color: #dfe6eb;   /* 배경색보다 살짝 어두운 색상 */
    z-index: 1;        /* 아이콘보다 뒤에 위치하도록 설정 (낮은 숫자) */
    pointer-events: none; /* 텍스트가 클릭되지 않도록 설정 */
    letter-spacing: 1px; /* 글자 간격 살짝 넓히기 */
}

#animation span {
    position: absolute;
    bottom: -50px; /* 시작 위치를 영역 아래쪽 밖으로 */
    font-size: 2rem; 
    opacity: 0;
    animation: float-up 10s infinite linear;
    z-index: 2; /* [추가] 텍스트보다 위에 위치하도록 설정 (높은 숫자) */
}

/* 
  nth-child를 사용해 각 아이콘에 다른 스타일과 
  애니메이션 지연 시간을 부여하여 다채로운 효과를 만듭니다.
*/
#animation span:nth-child(2) { /* nth-child 순서 조정 */
    left: 10%;
    animation-delay: 0s;
    font-size: 2.5rem;
    color: var(--female-color);
}
#animation span:nth-child(3) {
    left: 25%;
    animation-delay: 1.5s;
    font-size: 1.5rem;
    color: var(--male-color);
}
#animation span:nth-child(4) {
    left: 40%;
    animation-delay: 3s;
    font-size: 2rem;
    color: #f9ca24; /* Yellow Star */
}
#animation span:nth-child(5) {
    left: 60%;
    animation-delay: 4.5s;
    font-size: 2.2rem;
    color: var(--male-color);
}
#animation span:nth-child(6) {
    left: 75%;
    animation-delay: 6s;
    font-size: 1.8rem;
    color: #ff6b81;
}
#animation span:nth-child(7) {
    left: 90%;
    animation-delay: 7.5s;
    font-size: 2.8rem;
    color: var(--female-color);
}

/* 위로 떠오르면서 서서히 나타났다가 사라지는 키프레임 애니메이션 */
@keyframes float-up {
    0% {
        transform: translateY(0);
        opacity: 0;
    }
    10% {
        opacity: 0.9;
    }
    90% {
        opacity: 0.9;
    }
    100% {
        transform: translateY(-150px); /* 150px 만큼 위로 이동 */
        opacity: 0;
    }
}

.other-tests {
    margin-top: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.other-test-btn {
    background-color: #f8f9fa;
    color: #495057;
    border: 1px solid #dee2e6;
    font-size: 1.1rem;
}

.other-test-btn:hover {
    background-color: #e9ecef;
    border-color: #ced4da;
    transform: scale(1.03); /* 살짝 커지는 효과 */
}