/* ==========================================
   수학이 보여요 - 파스텔톤 동화책 스타일
   캐릭터: 펭펭 (펭귄)
   ========================================== */

/* CSS 변수 정의 - 파스텔톤 */
:root {
    --primary-color: #A8D8EA;      /* 파스텔 블루 */
    --primary-dark: #6BB9D9;       /* 진한 파스텔 블루 */
    --secondary-color: #FFD3B6;    /* 파스텔 피치 */
    --accent-color: #FDFFAB;       /* 파스텔 옐로우 */
    --accent-pink: #FFAAA5;        /* 파스텔 코랄 */
    --mint-color: #B8E6CF;         /* 파스텔 민트 */
    --lavender-color: #D4A5FF;     /* 파스텔 라벤더 */
    --success-color: #98D89A;      /* 파스텔 그린 */
    --warning-color: #FFE5A0;      /* 파스텔 골드 */
    
    /* 배경 그라데이션 - 동화책 느낌 */
    --bg-gradient: linear-gradient(180deg, #E8F6FF 0%, #FFF5E6 50%, #FFE8EC 100%);
    --bg-sky: linear-gradient(180deg, #E8F6FF 0%, #D4ECFF 100%);
    
    /* 카드 & 그림자 */
    --card-shadow: 0 8px 30px rgba(168, 216, 234, 0.3);
    --card-shadow-hover: 0 15px 45px rgba(168, 216, 234, 0.4);
    
    /* 텍스트 */
    --text-dark: #4A5568;
    --text-light: #718096;
    --text-brown: #8B7355;
    --white: #FFFFFF;
    
    /* 테두리 */
    --border-soft: 3px solid rgba(168, 216, 234, 0.5);
    
    /* 둥글기 */
    --radius-sm: 16px;
    --radius-md: 24px;
    --radius-lg: 32px;
    --radius-full: 50%;
    
    /* 폰트 */
    --font-display: 'Jua', sans-serif;
    --font-body: 'Noto Sans KR', sans-serif;
}

/* 리셋 및 기본 스타일 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: var(--font-body);
    background: var(--bg-gradient);
    color: var(--text-dark);
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

#app {
    width: 100%;
    height: 100%;
    max-width: 500px;
    margin: 0 auto;
    position: relative;
    overflow: hidden;
}

/* 화면 기본 스타일 - 동화책 배경 */
.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-gradient);
    display: none;
    flex-direction: column;
    overflow-y: auto;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 동화책 스타일 배경 패턴 */
.screen::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 20% 20%, rgba(168, 216, 234, 0.2) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255, 211, 182, 0.2) 0%, transparent 50%),
        radial-gradient(circle at 40% 60%, rgba(184, 230, 207, 0.15) 0%, transparent 40%);
    pointer-events: none;
    z-index: 0;
}

.screen > * {
    position: relative;
    z-index: 1;
}

.screen.active {
    display: flex;
    opacity: 1;
    transform: translateX(0);
}

.screen.exit {
    transform: translateX(-100%);
}

/* ==========================================
   화면 1: 시작 화면
   ========================================== */
.start-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100%;
    padding: 40px 20px;
    text-align: center;
}

.logo-area {
    margin-bottom: 40px;
}

.character-intro {
    margin-bottom: 20px;
    animation: float 3s ease-in-out infinite;
}

.app-title {
    font-family: var(--font-display);
    font-size: 42px;
    color: var(--primary-dark);
    text-shadow: 
        2px 2px 0 var(--white), 
        4px 4px 0 rgba(168, 216, 234, 0.4),
        0 0 20px rgba(168, 216, 234, 0.3);
    margin-bottom: 10px;
    letter-spacing: 2px;
}

.app-subtitle {
    font-size: 18px;
    color: var(--text-brown);
    font-weight: 500;
}

.role-selection {
    width: 100%;
    max-width: 340px;
}

.role-question {
    font-family: var(--font-display);
    font-size: 24px;
    color: var(--text-dark);
    margin-bottom: 20px;
}

.role-buttons {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.role-btn {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 30px;
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font-display);
    font-size: 22px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--card-shadow);
    position: relative;
    overflow: hidden;
}

/* 동화책 스타일 버튼 테두리 */
.role-btn::before {
    content: '';
    position: absolute;
    top: 4px;
    left: 4px;
    right: 4px;
    bottom: 4px;
    border: 2px dashed rgba(255, 255, 255, 0.5);
    border-radius: calc(var(--radius-md) - 4px);
    pointer-events: none;
}

.child-btn {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--mint-color) 100%);
    color: var(--text-dark);
}

.child-btn:hover, .child-btn:active {
    transform: scale(1.05) rotate(-1deg);
    box-shadow: var(--card-shadow-hover);
}

.parent-btn {
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--accent-color) 100%);
    color: var(--text-dark);
}

.parent-btn:hover, .parent-btn:active {
    transform: scale(1.05) rotate(1deg);
    box-shadow: var(--card-shadow-hover);
}

.role-icon {
    font-size: 36px;
}

/* ==========================================
   펭펭(펭귄) 캐릭터
   ========================================== */
.penguin-character {
    position: relative;
    display: inline-block;
}

.penguin-character.large {
    width: 120px;
    height: 150px;
}

.penguin-character.medium {
    width: 90px;
    height: 112px;
}

.penguin-character.small {
    width: 60px;
    height: 75px;
}

/* 펭귄 몸체 컨테이너 */
.penguin-body {
    width: 100%;
    height: 100%;
    position: relative;
}

/* 펭귄 외형 (검은 부분) */
.penguin-outer {
    position: absolute;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, #2D3436 0%, #1E272E 100%);
    border-radius: 50% 50% 45% 45%;
    box-shadow: 
        inset 0 -10px 20px rgba(0, 0, 0, 0.3),
        0 8px 20px rgba(0, 0, 0, 0.15);
}

/* 펭귄 배 (흰색 부분) */
.penguin-belly {
    position: absolute;
    width: 70%;
    height: 65%;
    bottom: 10%;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(180deg, #FFFFFF 0%, #F0F0F0 100%);
    border-radius: 50% 50% 45% 45%;
    z-index: 1;
}

/* 펭귄 얼굴 */
.penguin-face {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 2;
}

/* 펭귄 눈 */
.penguin-eyes {
    position: absolute;
    top: 25%;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 3;
}

.penguin-character.large .penguin-eyes {
    gap: 12px;
}

.penguin-character.small .penguin-eyes {
    gap: 5px;
}

.penguin-eyes .eye {
    width: 22px;
    height: 26px;
    background: #FFFFFF;
    border-radius: 50%;
    position: relative;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.penguin-character.large .penguin-eyes .eye {
    width: 28px;
    height: 32px;
}

.penguin-character.small .penguin-eyes .eye {
    width: 14px;
    height: 16px;
}

.penguin-eyes .eye .pupil {
    position: absolute;
    top: 30%;
    left: 50%;
    transform: translateX(-50%);
    width: 12px;
    height: 12px;
    background: #2D3436;
    border-radius: 50%;
}

.penguin-character.large .penguin-eyes .eye .pupil {
    width: 16px;
    height: 16px;
}

.penguin-character.small .penguin-eyes .eye .pupil {
    width: 8px;
    height: 8px;
}

.penguin-eyes .eye .pupil::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 4px;
    height: 4px;
    background: #FFFFFF;
    border-radius: 50%;
}

.penguin-character.large .penguin-eyes .eye .pupil::after {
    width: 5px;
    height: 5px;
}

.penguin-character.small .penguin-eyes .eye .pupil::after {
    width: 3px;
    height: 3px;
}

.penguin-eyes .eye.happy {
    height: 8px;
    border-radius: 0 0 50% 50%;
    background: #2D3436;
}

.penguin-character.large .penguin-eyes .eye.happy {
    height: 10px;
}

.penguin-character.small .penguin-eyes .eye.happy {
    height: 5px;
}

.penguin-eyes .eye.happy .pupil {
    display: none;
}

.penguin-eyes .eye.blink {
    animation: penguinBlink 4s infinite;
}

.penguin-eyes .eye.thinking {
    animation: penguinLook 2s infinite;
}

/* 펭귄 부리 */
.penguin-beak {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 16px solid #FFB347;
    z-index: 3;
}

.penguin-character.large .penguin-beak {
    border-left: 14px solid transparent;
    border-right: 14px solid transparent;
    border-top: 22px solid #FFB347;
}

.penguin-character.small .penguin-beak {
    border-left: 7px solid transparent;
    border-right: 7px solid transparent;
    border-top: 11px solid #FFB347;
}

.penguin-character.medium .penguin-beak {
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 17px solid #FFB347;
}

/* 펭귄 볼터치 */
.penguin-cheeks {
    position: absolute;
    top: 40%;
    left: 0;
    width: 100%;
    z-index: 3;
}

.penguin-cheeks .cheek {
    position: absolute;
    width: 14px;
    height: 10px;
    background: rgba(255, 170, 165, 0.7);
    border-radius: 50%;
}

.penguin-character.large .penguin-cheeks .cheek {
    width: 18px;
    height: 12px;
}

.penguin-character.small .penguin-cheeks .cheek {
    width: 10px;
    height: 7px;
}

.penguin-cheeks .cheek.left {
    left: 12%;
}

.penguin-cheeks .cheek.right {
    right: 12%;
}

.penguin-cheeks .cheek.glow {
    animation: cheekGlow 1s infinite;
}

/* 펭귄 날개 */
.penguin-wings {
    position: absolute;
    top: 40%;
    width: 100%;
    z-index: 0;
}

.penguin-wings .wing {
    position: absolute;
    width: 20px;
    height: 40px;
    background: linear-gradient(180deg, #2D3436 0%, #1E272E 100%);
    border-radius: 50% 50% 60% 60%;
}

.penguin-character.large .penguin-wings .wing {
    width: 26px;
    height: 52px;
}

.penguin-character.small .penguin-wings .wing {
    width: 14px;
    height: 28px;
}

.penguin-wings .wing.left {
    left: -8px;
    transform: rotate(25deg);
    transform-origin: top right;
}

.penguin-wings .wing.right {
    right: -8px;
    transform: rotate(-25deg);
    transform-origin: top left;
}

.penguin-wings .wing.wave {
    animation: wingWave 0.5s ease-in-out infinite alternate;
}

/* 펭귄 발 */
.penguin-feet {
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 0;
}

.penguin-feet .foot {
    width: 22px;
    height: 12px;
    background: #FFB347;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.penguin-character.large .penguin-feet .foot {
    width: 28px;
    height: 15px;
}

.penguin-character.small .penguin-feet .foot {
    width: 15px;
    height: 8px;
}

.penguin-character.small .penguin-feet {
    gap: 5px;
    bottom: -5px;
}

.penguin-character.large .penguin-feet {
    gap: 10px;
    bottom: -10px;
}

/* 펭귄 액세서리 - 리본/머플러 */
.penguin-accessory {
    position: absolute;
    top: 62%;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 10px;
    background: linear-gradient(90deg, var(--accent-pink) 0%, var(--lavender-color) 100%);
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    z-index: 2;
}

.penguin-character.large .penguin-accessory {
    width: 65px;
    height: 12px;
    top: 60%;
}

.penguin-character.small .penguin-accessory {
    width: 35px;
    height: 7px;
}

.penguin-accessory::before,
.penguin-accessory::after {
    content: '';
    position: absolute;
    width: 12px;
    height: 18px;
    background: linear-gradient(180deg, var(--accent-pink) 0%, var(--lavender-color) 100%);
    border-radius: 0 0 50% 50%;
    top: 80%;
}

.penguin-accessory::before {
    left: 10%;
    transform: rotate(-15deg);
}

.penguin-accessory::after {
    right: 10%;
    transform: rotate(15deg);
}

/* 생각 버블 */
.thinking-bubbles {
    position: absolute;
    top: -25px;
    right: -15px;
}

.thinking-bubbles span {
    display: block;
    width: 14px;
    height: 14px;
    background: var(--white);
    border-radius: 50%;
    margin: 4px;
    box-shadow: 0 2px 8px rgba(168, 216, 234, 0.4);
    animation: bubble 1.5s infinite;
}

.thinking-bubbles span:nth-child(2) {
    width: 10px;
    height: 10px;
    animation-delay: 0.3s;
}

.thinking-bubbles span:nth-child(3) {
    width: 6px;
    height: 6px;
    animation-delay: 0.6s;
}

/* ==========================================
   말풍선 - 동화책 스타일
   ========================================== */
.speech-bubble {
    background: var(--white);
    padding: 18px 22px;
    border-radius: var(--radius-md);
    box-shadow: var(--card-shadow);
    position: relative;
    max-width: 250px;
    font-size: 16px;
    line-height: 1.6;
    border: 3px solid rgba(168, 216, 234, 0.4);
}

.speech-bubble::before {
    content: '';
    position: absolute;
    left: -18px;
    top: 50%;
    transform: translateY(-50%);
    border: 12px solid transparent;
    border-right-color: var(--white);
    filter: drop-shadow(-3px 0 0 rgba(168, 216, 234, 0.4));
}

.speech-bubble.large {
    max-width: 300px;
    padding: 22px 26px;
    font-size: 18px;
}

.speech-bubble.celebration {
    background: linear-gradient(135deg, var(--accent-color) 0%, var(--secondary-color) 100%);
    font-family: var(--font-display);
    font-size: 20px;
    border-color: rgba(255, 211, 182, 0.6);
}

.speech-bubble.celebration::before {
    border-right-color: var(--accent-color);
}

.mission-hint {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 2px dashed rgba(168, 216, 234, 0.4);
    font-size: 14px;
    color: var(--text-light);
}

/* ==========================================
   AI 가이드 영역
   ========================================== */
.ai-guide {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    margin-bottom: 20px;
}

.ai-guide.floating {
    flex-direction: column;
    text-align: center;
}

.ai-guide.floating .speech-bubble::before {
    left: 50%;
    top: -18px;
    transform: translateX(-50%) rotate(90deg);
}

/* ==========================================
   화면 2: 미션 선택 화면
   ========================================== */
.mission-container {
    padding: 20px;
    display: flex;
    flex-direction: column;
    min-height: 100%;
}

.mission-list {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 20px;
}

.mission-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: var(--white);
    border: 3px solid rgba(168, 216, 234, 0.3);
    border-radius: var(--radius-md);
    box-shadow: var(--card-shadow);
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    position: relative;
    overflow: hidden;
}

/* 동화책 스타일 장식 */
.mission-card::after {
    content: '✿';
    position: absolute;
    top: 8px;
    right: 12px;
    font-size: 14px;
    opacity: 0.3;
}

.mission-card:nth-child(2)::after {
    content: '❀';
}

.mission-card:nth-child(3)::after {
    content: '✾';
}

.mission-card:hover, .mission-card:active {
    transform: translateY(-5px) scale(1.02);
    box-shadow: var(--card-shadow-hover);
    border-color: var(--primary-color);
}

.mission-icon {
    font-size: 40px;
    width: 65px;
    height: 65px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--mint-color) 100%);
    border-radius: var(--radius-md);
    box-shadow: 0 4px 15px rgba(168, 216, 234, 0.3);
}

.mission-info {
    flex: 1;
}

.mission-info h3 {
    font-family: var(--font-display);
    font-size: 20px;
    color: var(--text-dark);
    margin-bottom: 4px;
}

.mission-info p {
    font-size: 14px;
    color: var(--text-light);
}

.mission-stars {
    font-size: 14px;
    opacity: 0.8;
}

/* ==========================================
   화면 3: 미션 상세 화면
   ========================================== */
.mission-detail-container {
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100%;
    text-align: center;
}

.mission-goal-card {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 24px;
    background: var(--white);
    border: 3px solid rgba(168, 216, 234, 0.3);
    border-radius: var(--radius-md);
    box-shadow: var(--card-shadow);
    margin: 20px 0;
    width: 100%;
    max-width: 340px;
}

.goal-icon {
    font-size: 50px;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--accent-color) 0%, var(--secondary-color) 100%);
    border-radius: var(--radius-md);
    box-shadow: 0 4px 15px rgba(255, 211, 182, 0.4);
}

.goal-info {
    text-align: left;
}

.goal-info h2 {
    font-family: var(--font-display);
    font-size: 22px;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.goal-progress {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary-dark);
}

/* ==========================================
   화면 4: 카메라/업로드 화면
   ========================================== */
.camera-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 20px;
}

.camera-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.camera-header h2 {
    font-family: var(--font-display);
    font-size: 20px;
    color: var(--text-dark);
}

.progress-badge {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--mint-color) 100%);
    color: var(--text-dark);
    padding: 8px 16px;
    border-radius: var(--radius-lg);
    font-weight: 700;
    box-shadow: 0 3px 10px rgba(168, 216, 234, 0.3);
}

.camera-preview {
    flex: 1;
    background: var(--white);
    border: 3px dashed rgba(168, 216, 234, 0.5);
    border-radius: var(--radius-md);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    box-shadow: var(--card-shadow);
    min-height: 250px;
}

.preview-placeholder {
    text-align: center;
    color: var(--text-light);
}

.preview-placeholder i {
    font-size: 60px;
    margin-bottom: 16px;
    opacity: 0.3;
    color: var(--primary-color);
}

#preview-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.camera-actions {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
}

.btn-camera, .btn-gallery {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 20px;
    border-radius: var(--radius-md);
    font-family: var(--font-display);
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--card-shadow);
    border: 3px solid transparent;
}

.btn-camera {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--lavender-color) 100%);
    color: var(--text-dark);
}

.btn-gallery {
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--accent-color) 100%);
    color: var(--text-dark);
}

.btn-camera i, .btn-gallery i {
    font-size: 28px;
}

.btn-camera:hover, .btn-gallery:hover {
    transform: scale(1.05);
    box-shadow: var(--card-shadow-hover);
}

/* ==========================================
   화면 5: 분석 중 화면
   ========================================== */
.analyzing-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 40px;
    text-align: center;
}

.analyzing-text {
    font-family: var(--font-display);
    font-size: 28px;
    color: var(--text-dark);
    margin: 30px 0 20px;
}

.analyzing-progress {
    width: 80%;
    max-width: 300px;
}

.progress-bar {
    height: 14px;
    background: rgba(168, 216, 234, 0.3);
    border-radius: 7px;
    overflow: hidden;
    border: 2px solid rgba(168, 216, 234, 0.5);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--mint-color), var(--accent-color));
    border-radius: 5px;
    width: 0%;
    animation: progressFill 2s ease-in-out forwards;
}

.analyzing-hint {
    margin-top: 20px;
    color: var(--text-light);
    font-size: 16px;
}

.penguin-character.thinking {
    animation: thinking 1s infinite;
}

/* ==========================================
   화면 6: 결과 화면
   ========================================== */
.result-container {
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100%;
}

.result-header {
    text-align: center;
    position: relative;
    margin-bottom: 20px;
}

.confetti {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 200%;
    height: 200px;
    pointer-events: none;
}

.result-card {
    background: var(--white);
    border: 3px solid rgba(168, 216, 234, 0.3);
    border-radius: var(--radius-md);
    padding: 24px;
    width: 100%;
    max-width: 340px;
    box-shadow: var(--card-shadow);
    text-align: center;
    margin-bottom: 20px;
    position: relative;
}

/* 동화책 스타일 장식 */
.result-card::before {
    content: '🌸';
    position: absolute;
    top: -15px;
    left: 20px;
    font-size: 24px;
}

.result-card::after {
    content: '🌼';
    position: absolute;
    top: -15px;
    right: 20px;
    font-size: 24px;
}

.result-stars {
    font-size: 40px;
    margin-bottom: 16px;
    animation: starBounce 0.5s ease infinite alternate;
}

.result-card h2 {
    font-family: var(--font-display);
    font-size: 24px;
    color: var(--text-dark);
    margin-bottom: 20px;
}

.found-items {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-bottom: 20px;
}

.found-item {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--mint-color) 100%);
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
    animation: popIn 0.3s ease backwards;
    box-shadow: 0 3px 10px rgba(168, 216, 234, 0.3);
}

.found-item:nth-child(1) { animation-delay: 0.1s; }
.found-item:nth-child(2) { animation-delay: 0.2s; }
.found-item:nth-child(3) { animation-delay: 0.3s; }
.found-item:nth-child(4) { animation-delay: 0.4s; }
.found-item:nth-child(5) { animation-delay: 0.5s; }

.result-stats {
    display: flex;
    justify-content: center;
    gap: 30px;
    padding-top: 16px;
    border-top: 2px dashed rgba(168, 216, 234, 0.4);
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.stat-icon {
    font-size: 24px;
}

.stat-value {
    font-family: var(--font-display);
    font-size: 24px;
    color: var(--primary-dark);
}

.stat-label {
    font-size: 12px;
    color: var(--text-light);
}

.result-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    max-width: 340px;
}

/* ==========================================
   화면 7: 성장 리포트 화면
   ========================================== */
.report-container {
    padding: 20px;
    display: flex;
    flex-direction: column;
    min-height: 100%;
}

.report-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.report-header h2 {
    font-family: var(--font-display);
    font-size: 22px;
    color: var(--text-dark);
}

.report-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.summary-card {
    background: var(--white);
    padding: 16px 12px;
    border-radius: var(--radius-md);
    text-align: center;
    box-shadow: var(--card-shadow);
    border: 2px solid rgba(168, 216, 234, 0.3);
}

.summary-icon {
    font-size: 28px;
    margin-bottom: 8px;
}

.summary-value {
    display: block;
    font-family: var(--font-display);
    font-size: 24px;
    color: var(--primary-dark);
}

.summary-label {
    font-size: 11px;
    color: var(--text-light);
}

.achievements-section {
    margin-bottom: 24px;
}

.achievements-section h3 {
    font-family: var(--font-display);
    font-size: 18px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-dark);
}

.achievements-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.achievement-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--white);
    border-radius: var(--radius-sm);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    border: 2px solid rgba(168, 216, 234, 0.2);
}

.achievement-item.locked {
    opacity: 0.5;
}

.achievement-item.unlocked {
    border-color: var(--accent-color);
    background: linear-gradient(135deg, var(--white) 0%, rgba(253, 255, 171, 0.2) 100%);
}

.achievement-icon {
    font-size: 32px;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--accent-color) 0%, var(--secondary-color) 100%);
    border-radius: var(--radius-sm);
}

.achievement-item.locked .achievement-icon {
    background: #E0E0E0;
}

.achievement-info {
    flex: 1;
}

.achievement-title {
    display: block;
    font-weight: 700;
    font-size: 16px;
    margin-bottom: 2px;
    color: var(--text-dark);
}

.achievement-desc {
    font-size: 13px;
    color: var(--text-light);
}

.parent-tips {
    margin-bottom: 24px;
}

.parent-tips h3 {
    font-family: var(--font-display);
    font-size: 18px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--secondary-color);
}

.tip-card {
    background: linear-gradient(135deg, rgba(255, 211, 182, 0.3) 0%, rgba(253, 255, 171, 0.3) 100%);
    padding: 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
    font-size: 14px;
    line-height: 1.6;
    border-left: 4px solid var(--secondary-color);
}

/* ==========================================
   공통 버튼 스타일 - 동화책 스타일
   ========================================== */
.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--mint-color) 100%);
    color: var(--text-dark);
    border: 3px solid rgba(255, 255, 255, 0.5);
    padding: 16px 32px;
    border-radius: var(--radius-lg);
    font-family: var(--font-display);
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 25px rgba(168, 216, 234, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    right: 3px;
    bottom: 3px;
    border: 2px dashed rgba(255, 255, 255, 0.4);
    border-radius: calc(var(--radius-lg) - 3px);
    pointer-events: none;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-3px) rotate(-1deg);
    box-shadow: 0 12px 35px rgba(168, 216, 234, 0.5);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary.large {
    padding: 20px 40px;
    font-size: 22px;
}

.btn-primary.pulse {
    animation: pulse 2s infinite;
}

.btn-secondary {
    background: var(--white);
    color: var(--text-dark);
    border: 3px solid rgba(168, 216, 234, 0.5);
    padding: 14px 28px;
    border-radius: var(--radius-lg);
    font-family: var(--font-display);
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
}

.btn-secondary:hover {
    border-color: var(--primary-color);
    background: rgba(168, 216, 234, 0.1);
}

.btn-outline {
    background: transparent;
    color: var(--primary-dark);
    border: 3px solid var(--primary-color);
    padding: 14px 28px;
    border-radius: var(--radius-lg);
    font-family: var(--font-display);
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
}

.btn-outline:hover {
    background: var(--primary-color);
    color: var(--text-dark);
}

.btn-icon {
    background: var(--white);
    border: 2px solid rgba(168, 216, 234, 0.4);
    width: 46px;
    height: 46px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.btn-icon:hover {
    transform: scale(1.1);
    border-color: var(--primary-color);
}

.btn-icon i {
    font-size: 18px;
    color: var(--text-dark);
}

/* ==========================================
   애니메이션
   ========================================== */
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

@keyframes penguinBlink {
    0%, 90%, 100% { transform: scaleY(1); }
    95% { transform: scaleY(0.1); }
}

@keyframes penguinLook {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-20%); }
    75% { transform: translateX(20%); }
}

@keyframes wingWave {
    0% { transform: rotate(25deg); }
    100% { transform: rotate(35deg); }
}

@keyframes bubble {
    0%, 100% { opacity: 0.3; transform: scale(0.8); }
    50% { opacity: 1; transform: scale(1); }
}

@keyframes progressFill {
    0% { width: 0%; }
    100% { width: 100%; }
}

@keyframes thinking {
    0%, 100% { transform: rotate(-3deg); }
    50% { transform: rotate(3deg); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes starBounce {
    0% { transform: scale(1); }
    100% { transform: scale(1.1); }
}

@keyframes popIn {
    0% { opacity: 0; transform: scale(0.5); }
    100% { opacity: 1; transform: scale(1); }
}

@keyframes cheekGlow {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

@keyframes confettiFall {
    0% { transform: translateY(-100%) rotate(0deg); opacity: 1; }
    100% { transform: translateY(500%) rotate(720deg); opacity: 0; }
}

.confetti-piece {
    position: absolute;
    width: 10px;
    height: 10px;
    animation: confettiFall 3s ease-out forwards;
}

/* ==========================================
   반응형 스타일
   ========================================== */
@media (max-width: 380px) {
    .app-title {
        font-size: 32px;
    }
    
    .role-btn {
        padding: 16px 24px;
        font-size: 18px;
    }
    
    .mission-card {
        padding: 16px;
    }
    
    .mission-icon {
        width: 50px;
        height: 50px;
        font-size: 32px;
    }
    
    .speech-bubble {
        font-size: 14px;
        padding: 12px 16px;
    }
    
    .penguin-character.large {
        width: 120px;
        height: 136px;
    }
}

@media (min-width: 500px) {
    #app {
        border-radius: 30px;
        margin-top: 20px;
        height: calc(100% - 40px);
        box-shadow: 
            0 20px 60px rgba(168, 216, 234, 0.4),
            0 0 0 1px rgba(168, 216, 234, 0.2);
    }
    
    .screen {
        border-radius: 30px;
    }
}

/* iOS Safari 안전 영역 */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .screen {
        padding-bottom: calc(20px + env(safe-area-inset-bottom));
    }
}

/* ==========================================
   동화책 스타일 추가 장식
   ========================================== */

/* 구름 장식 */
.cloud-decoration {
    position: absolute;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    box-shadow: 0 5px 15px rgba(168, 216, 234, 0.2);
}

/* 별 장식 */
.star-decoration {
    position: absolute;
    font-size: 20px;
    opacity: 0.3;
    animation: twinkle 2s infinite;
}

@keyframes twinkle {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.2); }
}

/* ==========================================
   연령 선택 화면
   ========================================== */
.age-container {
    padding: 20px;
    display: flex;
    flex-direction: column;
    min-height: 100%;
}

.age-selection {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 20px;
}

.age-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: var(--white);
    border: 3px solid rgba(168, 216, 234, 0.3);
    border-radius: var(--radius-md);
    box-shadow: var(--card-shadow);
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
}

.age-card:hover, .age-card:active {
    transform: translateY(-5px) scale(1.02);
    box-shadow: var(--card-shadow-hover);
    border-color: var(--primary-color);
}

.age-card:nth-child(1) {
    border-left: 5px solid var(--mint-color);
}

.age-card:nth-child(2) {
    border-left: 5px solid var(--primary-color);
}

.age-card:nth-child(3) {
    border-left: 5px solid var(--lavender-color);
}

.age-icon {
    font-size: 40px;
    width: 65px;
    height: 65px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--accent-color) 0%, var(--secondary-color) 100%);
    border-radius: var(--radius-md);
}

.age-info {
    flex: 1;
}

.age-info h3 {
    font-family: var(--font-display);
    font-size: 22px;
    color: var(--text-dark);
    margin-bottom: 4px;
}

.age-info p {
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 8px;
}

.age-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.tag {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--mint-color) 100%);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    color: var(--text-dark);
}

/* ==========================================
   연령 배지
   ========================================== */
.age-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, var(--accent-color) 0%, var(--secondary-color) 100%);
    padding: 8px 16px;
    border-radius: var(--radius-lg);
    font-family: var(--font-display);
    font-size: 14px;
    margin-bottom: 16px;
    box-shadow: 0 4px 15px rgba(255, 211, 182, 0.3);
}

.age-badge-icon {
    font-size: 18px;
}

.age-badge-text {
    color: var(--text-dark);
}

/* ==========================================
   미션 카드 확장 스타일
   ========================================== */
.mission-meta {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.difficulty {
    padding: 3px 8px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 600;
}

.difficulty.easy {
    background: var(--mint-color);
    color: #2D6A4F;
}

.difficulty.medium {
    background: var(--accent-color);
    color: #856404;
}

.difficulty.hard {
    background: var(--lavender-color);
    color: #5A3D8A;
}

.learning-tag {
    font-size: 11px;
    color: var(--text-light);
}

.mission-nav-buttons {
    margin-top: auto;
}

/* ==========================================
   미션 상세 화면 확장
   ========================================== */
.goal-learning {
    font-size: 13px;
    color: var(--text-light);
    margin-bottom: 8px;
}

/* ==========================================
   결과 화면 - 학습 성취
   ========================================== */
.learning-achieved {
    margin-bottom: 16px;
}

.learning-badge {
    display: inline-block;
    background: linear-gradient(135deg, var(--accent-color) 0%, var(--mint-color) 100%);
    padding: 8px 16px;
    border-radius: var(--radius-lg);
    font-family: var(--font-display);
    font-size: 14px;
    color: var(--text-dark);
    animation: popIn 0.5s ease backwards;
    animation-delay: 0.3s;
}

/* ==========================================
   리포트 - 연령 정보
   ========================================== */
.report-age-info {
    display: flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, var(--accent-color) 0%, var(--secondary-color) 100%);
    padding: 10px 16px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    font-family: var(--font-display);
    font-size: 16px;
}

/* ==========================================
   리포트 - 학습 영역 진행률
   ========================================== */
.learning-progress-section {
    margin-bottom: 24px;
}

.learning-progress-section h3 {
    font-family: var(--font-display);
    font-size: 18px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-dark);
}

.learning-areas {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.learning-area {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--white);
    border-radius: var(--radius-sm);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.area-name {
    font-size: 13px;
    min-width: 100px;
    color: var(--text-dark);
}

.area-bar {
    flex: 1;
    height: 12px;
    background: rgba(168, 216, 234, 0.2);
    border-radius: 6px;
    overflow: hidden;
}

.area-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--mint-color));
    border-radius: 6px;
    transition: width 0.5s ease;
}

.area-count {
    font-size: 12px;
    font-weight: 600;
    color: var(--primary-dark);
    min-width: 35px;
    text-align: right;
}

/* ==========================================
   누리과정 팁 카드
   ========================================== */
.tip-card.curriculum-tip {
    background: linear-gradient(135deg, rgba(212, 165, 255, 0.2) 0%, rgba(168, 216, 234, 0.2) 100%);
    border-left-color: var(--lavender-color);
}

/* ==========================================
   반응형 추가
   ========================================== */
@media (max-width: 380px) {
    .age-card {
        padding: 16px;
    }
    
    .age-icon {
        width: 55px;
        height: 55px;
        font-size: 32px;
    }
    
    .age-info h3 {
        font-size: 18px;
    }
    
    .tag {
        font-size: 10px;
        padding: 3px 8px;
    }
    
    .area-name {
        min-width: 80px;
        font-size: 11px;
    }
}
