/* animal/style.css - 완전 정비 버전 (2026) */

:root {
    --primary-color: #6a11cb;
    --secondary-color: #2575fc;
    --background-color: #f0f2f5;
    --card-background: #ffffff;
    --text-color: #333;
    --shadow-color: rgba(0, 0, 0, 0.15);
}

body {
    font-family: 'Pretendard', sans-serif;
    margin: 0;
    padding: 0;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;          /* 가로 중앙 정렬 */
    justify-content: flex-start;  /* 위에서부터 시작 */
}

#app {
    width: 92%;
    max-width: 400px;
    background: var(--card-background);
    border-radius: 20px;
    margin: 30px auto 20px;       /* 위 30px, 아래 20px */
    box-shadow: 0 10px 30px var(--shadow-color);
    overflow: hidden;
}

/* ==================== 화면 전환 ==================== */
.screen {
    display: none;
    padding: 30px 25px;
    text-align: center;
    animation: fadeIn 0.4s ease-out forwards;
}

.screen.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(15px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ==================== 기본 텍스트 & 버튼 ==================== */
h1 {
    font-size: 2rem;
    color: var(--primary-color);
    margin: 0 0 1rem;
    line-height: 1.3;
}

h2 {
    font-size: 1.35rem;
    color: var(--text-color);
    margin: 0 0 1.5rem;
}

p {
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 2rem;
    color: var(--text-color);
}

button {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 280px;
    margin: 8px auto;
    display: block;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

button:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ==================== 메뉴 그리드 ==================== */
#menu-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 25px;
}

.menu-item {
    background: var(--background-color);
    border: 2px solid transparent;
    border-radius: 16px;
    padding: 12px 8px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.menu-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 12px var(--shadow-color);
}

.menu-item.selected {
    border-color: var(--primary-color);
    background: #f0e6ff;
}

.menu-item img {
    width: 100%;
    max-width: 62px;
    height: 62px;
    object-fit: contain;
    margin-bottom: 8px;
}

.menu-item span {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-color);
}

/* ==================== 결과 화면 ==================== */
#result-animal img {
    width: 100%;
    max-width: 200px;
    border-radius: 50%;
    margin: 15px 0 20px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.share-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 25px;
}

.share-buttons button {
    width: 100%;
    max-width: none;
    margin: 0;
}

/* ==================== 푸터 (항상 아래 고정) ==================== */
footer {
    width: 92%;
    max-width: 400px;
    margin-top: auto;           /* ← 핵심: 아래로 밀어냄 */
    padding: 25px 0 35px;
    text-align: center;
    color: rgba(255, 255, 255, 0.95);
    font-size: 0.85rem;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 18px;
    margin-bottom: 12px;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    font-size: 0.85rem;
}

.footer-links a:hover {
    text-decoration: underline;
}

/* ==================== 기타 페이지용 (about, privacy 등) ==================== */
.content-page {
    width: 92%;
    max-width: 700px;
    background: var(--card-background);
    border-radius: 20px;
    padding: 35px 25px;
    margin: 30px auto;
    box-shadow: 0 10px 30px var(--shadow-color);
    text-align: left;
}

/* 시작 화면 전용 이미지 스타일 */
#start-image {
    display: block;
    width: 100%;
    max-width: 280px;
    margin: 25px auto;
    border-radius: 18px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    object-fit: cover;           /* 이미지 비율 유지 */
}

/* 모바일에서 더 예쁘게 */
@media (max-width: 480px) {
    #start-image {
        max-width: 260px;
        margin: 20px auto;
        border-radius: 16px;
    }
}