/* ========================================
   수학이 보여요 - Math Visible
   CSS Stylesheet
   ======================================== */

/* CSS Variables */
:root {
    --primary: #A8D8EA;
    --primary-dark: #7BC4D9;
    --secondary: #FFD3B6;
    --secondary-dark: #FFBE99;
    --accent: #FDFFAB;
    --accent-dark: #F5F77D;
    --pink: #FFAAA5;
    --pink-dark: #FF8A84;
    --mint: #B8E6CF;
    --mint-dark: #8ED9B3;
    --lavender: #D4A5FF;
    --lavender-dark: #C080FF;
    --success: #98D89A;
    --success-dark: #6FC972;
    --warning: #FFE066;
    --error: #FF7B7B;

    --text-dark: #4A5568;
    --text-light: #718096;
    --text-white: #FFFFFF;

    --bg-light: #F7FAFC;
    --bg-white: #FFFFFF;
    --bg-overlay: rgba(0, 0, 0, 0.5);

    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.2);

    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-full: 50%;

    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, sans-serif;
    background:
        radial-gradient(ellipse at 20% 0%, rgba(168, 216, 234, 0.6) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(184, 230, 207, 0.5) 0%, transparent 40%),
        radial-gradient(ellipse at 40% 80%, rgba(255, 211, 182, 0.5) 0%, transparent 50%),
        radial-gradient(ellipse at 90% 90%, rgba(212, 165, 255, 0.3) 0%, transparent 40%),
        linear-gradient(180deg, #E8F8FF 0%, #F0FFF4 30%, #FFF8F0 70%, #FFF5F5 100%);
    min-height: 100vh;
    color: var(--text-dark);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    position: relative;
}

/* 배경 장식 - 떠다니는 도형들 */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(circle at 10% 20%, rgba(255, 170, 165, 0.15) 0%, transparent 8%),
        radial-gradient(circle at 90% 15%, rgba(168, 216, 234, 0.2) 0%, transparent 10%),
        radial-gradient(circle at 20% 80%, rgba(184, 230, 207, 0.15) 0%, transparent 8%),
        radial-gradient(circle at 85% 70%, rgba(253, 255, 171, 0.2) 0%, transparent 12%),
        radial-gradient(circle at 50% 50%, rgba(212, 165, 255, 0.1) 0%, transparent 15%);
    pointer-events: none;
    z-index: 0;
    animation: bgFloat 20s ease-in-out infinite;
}

@keyframes bgFloat {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-20px) scale(1.02); }
}

#app {
    min-height: 100vh;
    position: relative;
}

/* Screen Management */
.screen {
    display: none;
    min-height: 100vh;
    padding: 20px;
    animation: fadeIn var(--transition-normal);
}

.screen.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

/* Container */
.container {
    max-width: 480px;
    margin: 0 auto;
    padding: 20px;
}

/* Typography - 가독성 좋은 타이틀 */
.title {
    font-family: 'Jua', sans-serif;
    font-size: 2.6rem;
    color: #3D4852;
    text-align: center;
    margin: 20px 0 8px;
    text-shadow:
        2px 2px 0 #FFFFFF,
        3px 3px 0 rgba(168, 216, 234, 0.5);
    letter-spacing: 1px;
}

.subtitle {
    font-family: 'Jua', sans-serif;
    font-size: 1rem;
    color: #718096;
    text-align: center;
    margin-bottom: 30px;
    letter-spacing: 2px;
}

.section-title {
    font-family: 'Jua', sans-serif;
    font-size: 1.75rem;
    color: #3D4852;
    text-align: center;
    margin: 20px 0;
}

/* Back Button */
.back-btn {
    position: absolute;
    top: 20px;
    left: 20px;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-full);
    border: none;
    background: var(--bg-white);
    color: var(--text-dark);
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-fast);
    z-index: 100;
}

.back-btn:hover, .back-btn:focus {
    transform: scale(1.1);
    box-shadow: var(--shadow-md);
}

.back-btn.light {
    background: rgba(255, 255, 255, 0.9);
}

/* ========================================
   Penguin Character - Kawaii Style
   더 귀엽고 친근한 펭귄 "펭펭이"
   ======================================== */
.penguin-character {
    display: flex;
    justify-content: center;
    margin: 30px 0;
    filter: drop-shadow(0 15px 25px rgba(45, 52, 54, 0.25));
}

.penguin {
    position: relative;
    animation: penguinFloat 3s ease-in-out infinite;
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.penguin:hover {
    animation-play-state: paused;
    transform: scale(1.05) rotate(-3deg);
}

.penguin:active {
    transform: scale(0.95);
}

.penguin.small {
    transform: scale(0.5);
}

.penguin.tiny {
    transform: scale(0.35);
}

.penguin.medium {
    transform: scale(0.7);
}

.penguin.large {
    transform: scale(1);
}

/* 펭귄 몸통 - 더 통통하고 부드러운 느낌 */
.penguin-body {
    width: 130px;
    height: 150px;
    background: linear-gradient(160deg, #3d4447 0%, #2D3436 40%, #1e2324 100%);
    border-radius: 65px 65px 55px 55px;
    position: relative;
    box-shadow:
        inset 5px 5px 15px rgba(255, 255, 255, 0.1),
        inset -3px -3px 10px rgba(0, 0, 0, 0.3);
}

/* 반짝이는 하이라이트 */
.penguin-body::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 20px;
    width: 25px;
    height: 40px;
    background: linear-gradient(180deg, rgba(255,255,255,0.3) 0%, transparent 100%);
    border-radius: 50%;
    transform: rotate(-20deg);
}

/* 배 - 더 크고 부드러운 크림색 */
.penguin-belly {
    width: 90px;
    height: 110px;
    background: linear-gradient(180deg, #FFFEF9 0%, #FFF8E7 50%, #FFE8D6 100%);
    border-radius: 45px 45px 40px 40px;
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    box-shadow:
        inset 0 5px 20px rgba(255, 255, 255, 0.8),
        inset 0 -5px 15px rgba(255, 200, 150, 0.3);
}

/* 배 하트 무늬 */
.penguin-belly::after {
    content: '♥';
    position: absolute;
    bottom: 25px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 18px;
    color: var(--pink);
    opacity: 0.5;
    animation: heartBeat 1.5s ease-in-out infinite;
}

/* 얼굴 영역 - 몸통 안에 위치 */
.penguin-face {
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 80px;
}

/* 눈 - 크고 반짝이는 애니메이션 눈 */
.penguin-eye {
    width: 32px;
    height: 34px;
    background: linear-gradient(180deg, #FFFFFF 0%, #F0F4FF 100%);
    border-radius: 50% 50% 45% 45%;
    position: absolute;
    top: 10px;
    box-shadow:
        0 3px 10px rgba(0, 0, 0, 0.2),
        inset 0 -3px 8px rgba(200, 220, 255, 0.5);
    overflow: hidden;
    animation: eyeSquish 4s ease-in-out infinite;
}

.penguin-eye.left {
    left: 15px;
    animation-delay: 0s;
}

.penguin-eye.right {
    right: 15px;
    animation-delay: 0.1s;
}

/* 눈동자 - 더 크고 귀여운 */
.penguin-eye::after {
    content: '';
    width: 20px;
    height: 22px;
    background: radial-gradient(circle at 30% 30%, #4A5568 0%, #2D3436 50%, #1a1a1a 100%);
    border-radius: 50%;
    position: absolute;
    top: 8px;
    left: 8px;
    animation: eyeLook 6s ease-in-out infinite;
}

/* 눈 반짝이 - 2개의 하이라이트 */
.penguin-eye::before {
    content: '';
    width: 10px;
    height: 10px;
    background: #FFFFFF;
    border-radius: 50%;
    position: absolute;
    top: 10px;
    left: 12px;
    z-index: 10;
    box-shadow:
        6px 8px 0 3px rgba(255, 255, 255, 0.6);
    animation: sparkle 2s ease-in-out infinite;
}

/* 행복한 눈 - 웃는 눈 */
.penguin-eye.happy {
    height: 20px;
    border-radius: 20px 20px 50% 50%;
    background: linear-gradient(180deg, #3d4447 0%, #2D3436 100%);
    box-shadow: none;
    overflow: visible;
}

.penguin-eye.happy::after {
    display: none;
}

.penguin-eye.happy::before {
    content: '';
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, #3d4447 0%, #2D3436 100%);
    border-radius: inherit;
    top: 0;
    left: 0;
    box-shadow: none;
    animation: none;
}

/* 생각하는 눈 */
.penguin-eye.thinking-eye::after {
    animation: eyeThink 2.5s ease-in-out infinite;
}

/* 부리 - 더 귀엽고 통통한 */
.penguin-beak {
    width: 24px;
    height: 16px;
    background: linear-gradient(180deg, #FFB347 0%, #FF9500 50%, #E88600 100%);
    border-radius: 50% 50% 50% 50% / 40% 40% 60% 60%;
    position: absolute;
    top: 42px;
    left: 50%;
    transform: translateX(-50%);
    box-shadow:
        0 3px 8px rgba(255, 149, 0, 0.4),
        inset 0 2px 4px rgba(255, 255, 255, 0.4);
    animation: beakWiggle 4s ease-in-out infinite;
}

/* 부리 하이라이트 */
.penguin-beak::before {
    content: '';
    position: absolute;
    top: 3px;
    left: 5px;
    width: 8px;
    height: 5px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
}

/* 웃는 부리 */
.penguin-beak.smile {
    height: 12px;
    width: 20px;
    border-radius: 0 0 50% 50% / 0 0 100% 100%;
    background: linear-gradient(180deg, #FFB347 0%, #FF9500 100%);
    top: 55px;
}

/* 볼터치 - 더 크고 발그레한 */
.penguin-blush {
    width: 24px;
    height: 14px;
    background: radial-gradient(ellipse, #FFB5B5 0%, #FF9999 50%, transparent 70%);
    border-radius: 50%;
    position: absolute;
    top: 42px;
    opacity: 0.9;
    animation: blushPulse 3s ease-in-out infinite;
}

.penguin-blush.left {
    left: 2px;
    animation-delay: 0s;
}

.penguin-blush.right {
    right: 2px;
    animation-delay: 0.5s;
}

.penguin-blush.big {
    width: 35px;
    height: 20px;
    opacity: 1;
    background: radial-gradient(ellipse, #FF9999 0%, #FF7777 40%, transparent 70%);
}

/* 날개 - 더 귀엽고 통통한 */
.penguin-wing {
    width: 38px;
    height: 75px;
    background: linear-gradient(160deg, #3d4447 0%, #2D3436 50%, #1e2324 100%);
    border-radius: 20px 20px 25px 25px;
    position: absolute;
    top: 35px;
    box-shadow:
        inset 2px 2px 8px rgba(255, 255, 255, 0.1),
        3px 3px 10px rgba(0, 0, 0, 0.2);
}

/* 날개 하이라이트 */
.penguin-wing::before {
    content: '';
    position: absolute;
    top: 5px;
    left: 5px;
    width: 12px;
    height: 25px;
    background: linear-gradient(180deg, rgba(255,255,255,0.15) 0%, transparent 100%);
    border-radius: 50%;
}

.penguin-wing.left {
    left: -18px;
    transform: rotate(-12deg);
    transform-origin: top center;
    animation: wingGentleLeft 2.5s ease-in-out infinite;
}

.penguin-wing.right {
    right: -18px;
    transform: rotate(12deg);
    transform-origin: top center;
    animation: wingGentleRight 2.5s ease-in-out infinite;
    animation-delay: 0.3s;
}

.penguin-wing.wave {
    animation: wingGentleWave 1.5s ease-in-out infinite !important;
}

.penguin-wing.celebrate-wing {
    animation: wingCelebrate 0.5s ease-in-out infinite alternate !important;
}

/* 발 - 더 귀여운 오리발 */
.penguin-feet {
    display: flex;
    justify-content: center;
    gap: 25px;
    position: absolute;
    bottom: -18px;
    left: 50%;
    transform: translateX(-50%);
}

.foot {
    width: 38px;
    height: 18px;
    background: linear-gradient(180deg, #FFB347 0%, #FF9500 50%, #E88600 100%);
    border-radius: 50% 50% 45% 45% / 30% 30% 70% 70%;
    box-shadow:
        0 4px 8px rgba(255, 149, 0, 0.3),
        inset 0 2px 4px rgba(255, 255, 255, 0.3);
    animation: footTap 2s ease-in-out infinite;
}

.foot.left {
    animation-delay: 0s;
}

.foot.right {
    animation-delay: 0.3s;
}

/* 머리 위 장식 - 작은 왕관/리본 (선택적) */
.penguin-accessory {
    position: absolute;
    top: -55px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 24px;
    animation: accessoryBounce 2s ease-in-out infinite;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

/* ========================================
   Penguin Animations - 더 생동감 있게
   ======================================== */
@keyframes penguinFloat {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    25% {
        transform: translateY(-8px) rotate(-1deg);
    }
    50% {
        transform: translateY(-12px) rotate(0deg);
    }
    75% {
        transform: translateY(-8px) rotate(1deg);
    }
}

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

@keyframes eyeLook {
    0%, 40%, 100% {
        transform: translateX(0);
    }
    45%, 55% {
        transform: translateX(-3px) translateY(1px);
    }
    60%, 70% {
        transform: translateX(3px) translateY(-1px);
    }
}

@keyframes eyeThink {
    0%, 100% { transform: translateX(0) translateY(0); }
    20% { transform: translateX(-4px) translateY(-2px); }
    40% { transform: translateX(4px) translateY(-2px); }
    60% { transform: translateX(2px) translateY(2px); }
    80% { transform: translateX(-2px) translateY(0); }
}

@keyframes sparkle {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(0.9);
    }
}

@keyframes beakWiggle {
    0%, 100% { transform: translateX(-50%) rotate(0deg); }
    25% { transform: translateX(-50%) rotate(-2deg); }
    75% { transform: translateX(-50%) rotate(2deg); }
}

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

@keyframes wingGentleLeft {
    0%, 100% { transform: rotate(-12deg); }
    50% { transform: rotate(-18deg); }
}

@keyframes wingGentleRight {
    0%, 100% { transform: rotate(12deg); }
    50% { transform: rotate(18deg); }
}

@keyframes wingGentleWave {
    0%, 100% { transform: rotate(-12deg); }
    50% { transform: rotate(-22deg); }
}

@keyframes wingCelebrate {
    from {
        transform: rotate(-35deg) translateY(0);
    }
    to {
        transform: rotate(-70deg) translateY(-15px);
    }
}

@keyframes footTap {
    0%, 100% { transform: rotate(0deg); }
    50% { transform: rotate(-5deg) translateY(-2px); }
}

@keyframes heartBeat {
    0%, 100% {
        transform: translateX(-50%) scale(1);
        opacity: 0.5;
    }
    50% {
        transform: translateX(-50%) scale(1.2);
        opacity: 0.7;
    }
}

@keyframes accessoryBounce {
    0%, 100% { transform: translateX(-50%) translateY(0) rotate(-5deg); }
    50% { transform: translateX(-50%) translateY(-5px) rotate(5deg); }
}

/* 스케일 상태에서 애니메이션 조정 */
.penguin.small {
    filter: drop-shadow(0 8px 15px rgba(45, 52, 54, 0.2));
}

.penguin.tiny {
    filter: drop-shadow(0 5px 10px rgba(45, 52, 54, 0.15));
}

/* Thinking Animation */
.penguin.thinking {
    animation: penguinThink 2s ease-in-out infinite;
}

@keyframes penguinThink {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    25% {
        transform: translateY(-5px) rotate(-3deg);
    }
    50% {
        transform: translateY(-8px) rotate(0deg);
    }
    75% {
        transform: translateY(-5px) rotate(3deg);
    }
}

.thinking-bubbles {
    position: absolute;
    top: -60px;
    right: -35px;
}

.bubble {
    background: linear-gradient(135deg, #FFFFFF 0%, #E8F4FF 100%);
    border-radius: var(--radius-full);
    position: absolute;
    animation: bubbleFloat 1.5s ease-in-out infinite;
    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.1),
        inset 0 1px 3px rgba(255, 255, 255, 0.8);
}

.bubble::after {
    content: '?';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 10px;
    color: var(--primary-dark);
    font-weight: bold;
}

.bubble.b1 {
    width: 12px;
    height: 12px;
    bottom: 0;
    right: 0;
    animation-delay: 0s;
}

.bubble.b1::after { font-size: 8px; content: '·'; }

.bubble.b2 {
    width: 18px;
    height: 18px;
    bottom: 18px;
    right: 12px;
    animation-delay: 0.2s;
}

.bubble.b2::after { font-size: 10px; content: '·'; }

.bubble.b3 {
    width: 26px;
    height: 26px;
    bottom: 35px;
    right: 15px;
    animation-delay: 0.4s;
}

@keyframes bubbleFloat {
    0%, 100% { opacity: 0.5; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.2); }
}

/* Mini Penguin */
.penguin-mini {
    display: inline-flex;
    vertical-align: middle;
}

.penguin-mini.floating {
    animation: penguinFloat 2s ease-in-out infinite;
}

/* ========================================
   SVG Penguin Image Styles
   ======================================== */
.penguin-img {
    width: 180px;
    height: auto;
    animation: penguinFloat 3s ease-in-out infinite;
    filter: drop-shadow(0 10px 20px rgba(45, 52, 54, 0.25));
    cursor: pointer;
    transition: transform 0.3s ease;
}

.penguin-img:hover {
    transform: scale(1.05);
}

.penguin-img.small {
    width: 80px;
}

.penguin-img.tiny {
    width: 50px;
}

.penguin-img.medium {
    width: 120px;
}

.penguin-img.large {
    width: 200px;
}

/* 펭귄 캐릭터 컨테이너 */
.penguin-character {
    display: flex;
    justify-content: center;
    margin: 20px 0;
}

.penguin-guide {
    display: flex;
    justify-content: center;
    margin: 15px 0;
}

/* ========================================
   Speech Bubble - 더 귀여운 말풍선
   ======================================== */
.speech-bubble {
    background: linear-gradient(180deg, #FFFFFF 0%, #FFF9F5 100%);
    border-radius: 28px;
    padding: 22px 28px;
    margin: 20px auto;
    max-width: 320px;
    text-align: center;
    position: relative;
    box-shadow:
        0 8px 25px rgba(168, 216, 234, 0.3),
        0 4px 12px rgba(0, 0, 0, 0.08),
        inset 0 2px 4px rgba(255, 255, 255, 0.9);
    animation: bubblePop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 3px solid rgba(168, 216, 234, 0.3);
}

/* 말풍선 꼬리 */
.speech-bubble::after {
    content: '';
    position: absolute;
    bottom: -18px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 18px solid transparent;
    border-right: 18px solid transparent;
    border-top: 20px solid #FFF9F5;
    filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.06));
}

/* 말풍선 꼬리 테두리 */
.speech-bubble::before {
    content: '';
    position: absolute;
    bottom: -22px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 20px solid transparent;
    border-right: 20px solid transparent;
    border-top: 22px solid rgba(168, 216, 234, 0.3);
    z-index: -1;
}

@keyframes bubblePop {
    0% {
        opacity: 0;
        transform: scale(0.8) translateY(20px);
    }
    50% {
        transform: scale(1.05) translateY(-5px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.speech-bubble.small {
    padding: 14px 20px;
    font-size: 0.9rem;
    border-radius: 22px;
}

.speech-bubble p {
    font-family: 'Jua', sans-serif;
    font-size: 1.15rem;
    line-height: 1.7;
    color: var(--text-dark);
    letter-spacing: 0.5px;
}

.speech-bubble strong {
    color: #FF6B9D;
    font-size: 1.25em;
    text-shadow: 1px 1px 0 rgba(255, 107, 157, 0.2);
}

/* 말풍선 호버 효과 */
.speech-bubble:hover {
    transform: scale(1.02);
    box-shadow:
        0 12px 35px rgba(168, 216, 234, 0.4),
        0 6px 15px rgba(0, 0, 0, 0.1),
        inset 0 2px 4px rgba(255, 255, 255, 0.9);
}

/* ========================================
   Role Selection (Screen 1) - 귀여운 버튼
   ======================================== */
.role-selection {
    display: flex;
    gap: 25px;
    justify-content: center;
    margin-top: 30px;
}

.role-btn {
    width: 145px;
    padding: 28px 22px;
    border-radius: 28px;
    border: 4px solid rgba(255, 255, 255, 0.6);
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    box-shadow:
        0 8px 25px rgba(0, 0, 0, 0.15),
        inset 0 2px 10px rgba(255, 255, 255, 0.5);
    position: relative;
    overflow: hidden;
}

/* 버튼 반짝이 효과 */
.role-btn::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 30%,
        rgba(255, 255, 255, 0.4) 50%,
        transparent 70%
    );
    transform: rotate(45deg) translateY(-100%);
    transition: transform 0.6s ease;
}

.role-btn:hover::before {
    transform: rotate(45deg) translateY(100%);
}

.role-btn i {
    font-size: 2.8rem;
    filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.2));
    transition: transform 0.3s ease;
}

.role-btn:hover i {
    transform: scale(1.15) rotate(-5deg);
}

.role-btn span {
    font-family: 'Jua', sans-serif;
    font-size: 1.4rem;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.5);
}

.role-btn small {
    font-size: 0.85rem;
    opacity: 0.9;
    font-weight: 500;
}

.child-btn {
    background: linear-gradient(145deg, #7DD3FC 0%, #A8D8EA 30%, #B8E6CF 100%);
    color: var(--text-dark);
}

.child-btn:hover, .child-btn:focus {
    transform: translateY(-8px) scale(1.05) rotate(-2deg);
    border-color: #7DD3FC;
    box-shadow:
        0 15px 35px rgba(125, 211, 252, 0.4),
        0 8px 20px rgba(0, 0, 0, 0.15),
        inset 0 2px 10px rgba(255, 255, 255, 0.6);
}

.parent-btn {
    background: linear-gradient(145deg, #E9D5FF 0%, #D4A5FF 30%, #FFAAA5 100%);
    color: var(--text-dark);
}

.parent-btn:hover, .parent-btn:focus {
    transform: translateY(-8px) scale(1.05) rotate(2deg);
    border-color: #D4A5FF;
    box-shadow:
        0 15px 35px rgba(212, 165, 255, 0.4),
        0 8px 20px rgba(0, 0, 0, 0.15),
        inset 0 2px 10px rgba(255, 255, 255, 0.6);
}

/* 버튼 클릭 효과 */
.role-btn:active {
    transform: translateY(-2px) scale(0.98);
}

.parent-btn:hover, .parent-btn:focus {
    transform: translateY(-5px) scale(1.02);
    border-color: var(--lavender-dark);
    box-shadow: var(--shadow-lg);
}

/* ========================================
   Age Selection (Screen 2)
   ======================================== */
.age-selection {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
}

.age-btn {
    display: flex;
    align-items: center;
    padding: 20px 25px;
    background: var(--bg-white);
    border: 3px solid transparent;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-sm);
}

.age-btn:hover, .age-btn:focus {
    transform: translateX(10px);
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
}

.age-number {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--secondary) 100%);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Jua', sans-serif;
    font-size: 2rem;
    color: var(--text-dark);
    margin-right: 20px;
}

.age-label {
    font-family: 'Jua', sans-serif;
    font-size: 1.4rem;
    color: var(--text-dark);
    flex: 1;
}

.age-stars {
    font-size: 1.2rem;
}

/* ========================================
   Missions (Screen 3)
   ======================================== */
.header-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-top: 50px;
}

.age-badge {
    display: inline-block;
    background: var(--accent);
    padding: 8px 20px;
    border-radius: var(--radius-full);
    font-family: 'Jua', sans-serif;
    font-size: 1rem;
    color: var(--text-dark);
    margin: 0 auto 20px;
    text-align: center;
}

.missions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.mission-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 20px 15px;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-sm);
    border: 3px solid transparent;
    position: relative;
    overflow: hidden;
}

.mission-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: var(--primary);
    transform: scaleX(0);
    transition: transform var(--transition-normal);
}

.mission-card:hover::before,
.mission-card:focus::before {
    transform: scaleX(1);
}

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

.mission-card.completed {
    background: linear-gradient(135deg, var(--mint) 0%, var(--success) 100%);
}

.mission-card.completed::after {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    top: 10px;
    right: 10px;
    color: var(--success-dark);
    font-size: 1rem;
}

.mission-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 12px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
}

.mission-icon.shape { background: var(--primary); color: var(--text-dark); }
.mission-icon.color { background: var(--pink); color: var(--text-dark); }
.mission-icon.size { background: var(--secondary); color: var(--text-dark); }
.mission-icon.counting { background: var(--mint); color: var(--text-dark); }
.mission-icon.pattern { background: var(--lavender); color: var(--text-dark); }

.mission-name {
    font-family: 'Jua', sans-serif;
    font-size: 1rem;
    color: var(--text-dark);
    margin-bottom: 5px;
}

.mission-stars {
    font-size: 0.9rem;
    color: var(--warning);
}

/* ========================================
   Mission Detail (Screen 4)
   ======================================== */
.mission-detail-content {
    padding-top: 50px;
    text-align: center;
}

.mission-icon-large {
    width: 100px;
    height: 100px;
    margin: 0 auto 20px;
    border-radius: var(--radius-full);
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: var(--text-dark);
    box-shadow: var(--shadow-md);
    animation: pulse 2s ease-in-out infinite;
}

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

.mission-title {
    font-family: 'Jua', sans-serif;
    font-size: 1.8rem;
    color: var(--text-dark);
    margin-bottom: 20px;
}

.penguin-guide {
    display: flex;
    justify-content: center;
    margin: 20px 0;
}

.mission-speech {
    margin-bottom: 20px;
}

.mission-hints {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin: 20px 0;
    text-align: left;
    box-shadow: var(--shadow-sm);
}

.mission-hints h3 {
    font-family: 'Jua', sans-serif;
    font-size: 1.1rem;
    color: var(--warning);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.mission-hints ul {
    list-style: none;
    padding-left: 10px;
}

.mission-hints li {
    padding: 8px 0;
    color: var(--text-dark);
    position: relative;
    padding-left: 25px;
}

.mission-hints li::before {
    content: '💡';
    position: absolute;
    left: 0;
}

.start-mission-btn {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 18px 40px;
    background: linear-gradient(135deg, var(--success) 0%, var(--mint) 100%);
    border: none;
    border-radius: var(--radius-full);
    font-family: 'Jua', sans-serif;
    font-size: 1.3rem;
    color: var(--text-dark);
    cursor: pointer;
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-md);
    margin-top: 10px;
}

.start-mission-btn:hover, .start-mission-btn:focus {
    transform: scale(1.05);
    box-shadow: var(--shadow-lg);
}

.start-mission-btn i {
    font-size: 1.5rem;
}

/* ========================================
   Camera Screen (Screen 5)
   ======================================== */
.camera-container {
    padding: 0;
    max-width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.camera-wrapper {
    flex: 1;
    position: relative;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

#camera-preview,
#preview-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.camera-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

.camera-guide {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 70%;
    height: 50%;
    max-width: 300px;
    max-height: 300px;
}

.guide-corner {
    position: absolute;
    width: 30px;
    height: 30px;
    border: 4px solid var(--bg-white);
}

.guide-corner.top-left {
    top: 0;
    left: 0;
    border-right: none;
    border-bottom: none;
    border-radius: 10px 0 0 0;
}

.guide-corner.top-right {
    top: 0;
    right: 0;
    border-left: none;
    border-bottom: none;
    border-radius: 0 10px 0 0;
}

.guide-corner.bottom-left {
    bottom: 0;
    left: 0;
    border-right: none;
    border-top: none;
    border-radius: 0 0 0 10px;
}

.guide-corner.bottom-right {
    bottom: 0;
    right: 0;
    border-left: none;
    border-top: none;
    border-radius: 0 0 10px 0;
}

.camera-permission-error {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: var(--bg-white);
    padding: 30px;
}

.camera-permission-error i {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.7;
}

.camera-permission-error p {
    font-family: 'Jua', sans-serif;
    font-size: 1.3rem;
    margin-bottom: 10px;
}

.camera-permission-error small {
    opacity: 0.8;
}

.camera-hint {
    background: var(--bg-white);
    padding: 15px 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    justify-content: center;
}

.camera-hint p {
    font-size: 0.95rem;
    color: var(--text-dark);
}

.camera-controls {
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding: 20px;
    background: var(--bg-white);
}

.camera-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 15px;
    border: none;
    background: transparent;
    cursor: pointer;
    transition: all var(--transition-fast);
    color: var(--text-dark);
}

.camera-btn:hover, .camera-btn:focus {
    transform: scale(1.1);
}

.camera-btn i {
    font-size: 1.5rem;
}

.camera-btn span {
    font-size: 0.75rem;
}

.capture-btn {
    width: 70px;
    height: 70px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--pink) 0%, var(--secondary) 100%);
    box-shadow: var(--shadow-md);
}

.capture-btn i {
    font-size: 1.8rem;
}

.preview-controls {
    display: flex;
    gap: 20px;
    padding: 20px;
    background: var(--bg-white);
    justify-content: center;
}

.preview-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 30px;
    border: none;
    border-radius: var(--radius-full);
    font-family: 'Jua', sans-serif;
    font-size: 1rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.retake-btn {
    background: var(--bg-light);
    color: var(--text-dark);
}

.confirm-btn {
    background: linear-gradient(135deg, var(--success) 0%, var(--mint) 100%);
    color: var(--text-dark);
    box-shadow: var(--shadow-sm);
}

.preview-btn:hover, .preview-btn:focus {
    transform: scale(1.05);
}

/* ========================================
   Analyzing Screen (Screen 6)
   ======================================== */
.analyzing-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    text-align: center;
}

.analyzing-animation {
    position: relative;
    margin-bottom: 30px;
}

.magnifier {
    position: absolute;
    bottom: 20px;
    right: -20px;
    width: 60px;
    height: 60px;
    background: var(--bg-white);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--primary-dark);
    box-shadow: var(--shadow-md);
    animation: magnifierBounce 1s ease-in-out infinite;
}

@keyframes magnifierBounce {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(-5px, -5px) rotate(-10deg); }
    75% { transform: translate(5px, -5px) rotate(10deg); }
}

.analyzing-text {
    font-family: 'Jua', sans-serif;
    font-size: 1.5rem;
    color: var(--text-dark);
    margin-bottom: 20px;
}

.progress-bar {
    width: 80%;
    max-width: 300px;
    height: 12px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-bottom: 20px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, var(--mint) 50%, var(--success) 100%);
    border-radius: var(--radius-full);
    transition: width 0.3s ease;
    width: 0%;
}

.analyzing-messages p {
    color: var(--text-dark);
    font-size: 1rem;
}

/* ========================================
   Result Screen (Screen 7) - 축하 화면
   ======================================== */
.result-container {
    text-align: center;
    padding-top: 20px;
    background: radial-gradient(ellipse at center top, rgba(255, 230, 102, 0.2) 0%, transparent 50%);
}

.result-header {
    position: relative;
    margin-bottom: 20px;
    padding-top: 20px;
}

/* 컨페티 컨테이너 */
.confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
    overflow: hidden;
}

/* 컨페티 조각들 */
.confetti {
    position: absolute;
    width: 12px;
    height: 12px;
    animation: confettiFall 4s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

.confetti:nth-child(odd) {
    border-radius: 50%;
}

.confetti:nth-child(even) {
    border-radius: 2px;
    transform: rotate(45deg);
}

.confetti:nth-child(3n) {
    width: 8px;
    height: 16px;
    border-radius: 4px;
}

@keyframes confettiFall {
    0% {
        transform: translateY(-100%) rotate(0deg) scale(0);
        opacity: 0;
    }
    10% {
        opacity: 1;
        transform: translateY(0) rotate(180deg) scale(1);
    }
    100% {
        transform: translateY(100vh) rotate(720deg) scale(0.8);
        opacity: 0;
    }
}

/* 별점 표시 - 더 화려하게 */
.stars-display {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 25px;
    perspective: 500px;
}

.star {
    font-size: 3rem;
    color: #E0E0E0;
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.star.active {
    color: #FFD700;
    animation: starPop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    filter: drop-shadow(0 4px 15px rgba(255, 215, 0, 0.6));
}

.star.active i {
    animation: starGlow 1.5s ease-in-out infinite;
}

@keyframes starPop {
    0% {
        transform: scale(0) rotateY(180deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.4) rotateY(0deg);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes starGlow {
    0%, 100% {
        filter: brightness(1);
        transform: scale(1);
    }
    50% {
        filter: brightness(1.2);
        transform: scale(1.1);
    }
}

/* 축하하는 펭귄 */
.result-header .penguin {
    margin: 0 auto;
    animation: penguinCelebrate 0.8s ease-in-out infinite;
}

.result-header .penguin.celebrate {
    animation: penguinJump 0.5s ease-in-out infinite;
}

@keyframes penguinCelebrate {
    0%, 100% {
        transform: translateY(0) rotate(-2deg);
    }
    50% {
        transform: translateY(-10px) rotate(2deg);
    }
}

@keyframes penguinJump {
    0%, 100% {
        transform: translateY(0) scale(1);
    }
    50% {
        transform: translateY(-20px) scale(1.05);
    }
}

.result-speech {
    margin: 20px auto;
}

.result-speech p {
    font-size: 1.2rem;
}

.result-image-container {
    position: relative;
    margin: 20px auto;
    max-width: 300px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: inline-block;
}

.result-image-container img {
    display: block;
    width: 100%;
    height: auto;
}

/* 성공 오버레이 - 이미지 위에 겹쳐서 표시 */
.success-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(76, 175, 80, 0.3);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 10;
}

.success-overlay.show {
    display: flex;
    animation: overlayFadeIn 0.5s ease;
}

@keyframes overlayFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.success-badge {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(76, 175, 80, 0.5);
    animation: badgePop 0.5s ease 0.2s both;
    transform: scale(0);
}

@keyframes badgePop {
    0% { transform: scale(0) rotate(-45deg); }
    50% { transform: scale(1.2) rotate(0deg); }
    100% { transform: scale(1) rotate(0deg); }
}

.success-badge i {
    font-size: 2.5rem;
    color: white;
}

.success-label {
    margin-top: 12px;
    padding: 8px 20px;
    background: rgba(76, 175, 80, 0.9);
    color: white;
    font-family: 'Jua', sans-serif;
    font-size: 1.2rem;
    border-radius: 20px;
    animation: labelSlide 0.4s ease 0.4s both;
    opacity: 0;
    transform: translateY(10px);
}

@keyframes labelSlide {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
    box-shadow: var(--shadow-md);
}

#result-image {
    width: 100%;
    display: block;
}

#result-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.result-details {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin: 20px 0;
    text-align: left;
}

.detected-items h3 {
    font-family: 'Jua', sans-serif;
    font-size: 1.1rem;
    color: var(--text-dark);
    margin-bottom: 12px;
}

.detected-items ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.detected-item {
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    color: var(--text-dark);
    background: linear-gradient(135deg, #E8F5E9 0%, #C8E6C9 100%);
    border-radius: var(--radius-md);
    border-left: 4px solid var(--success);
    animation: itemSlideIn 0.4s ease forwards;
    opacity: 0;
    transform: translateX(-20px);
}

@keyframes itemSlideIn {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.check-badge {
    width: 32px;
    height: 32px;
    background: var(--success);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    animation: checkPop 0.3s ease 0.2s forwards;
    transform: scale(0);
}

@keyframes checkPop {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.check-badge i {
    color: white;
    font-size: 1rem;
}

.item-name {
    font-family: 'Jua', sans-serif;
    font-size: 1.1rem;
    color: var(--text-dark);
}

/* 감지 실패 시 스타일 */
.check-badge.empty {
    background: var(--text-light);
}

/* 감지 통계 스타일 */
.detected-item.detection-stats {
    background: linear-gradient(135deg, #E3F2FD 0%, #BBDEFB 100%);
    border-left-color: var(--primary);
}

.stats-icon {
    width: 32px;
    height: 32px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stats-icon i {
    color: white;
    font-size: 0.9rem;
}

.result-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin: 20px 0;
}

.result-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 25px;
    border: none;
    border-radius: var(--radius-full);
    font-family: 'Jua', sans-serif;
    font-size: 1rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.retry-btn {
    background: var(--bg-white);
    color: var(--text-dark);
    box-shadow: var(--shadow-sm);
}

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

.result-btn:hover, .result-btn:focus {
    transform: scale(1.05);
}

.home-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: transparent;
    border: 2px solid var(--text-light);
    border-radius: var(--radius-full);
    color: var(--text-dark);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    margin-top: 10px;
}

.home-btn:hover, .home-btn:focus {
    background: var(--bg-white);
    border-color: var(--text-dark);
}

/* ========================================
   Report Screen (Screen 8)
   ======================================== */
.report-container {
    padding-top: 60px;
}

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

.summary-card {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    padding: 15px 10px;
    text-align: center;
    box-shadow: var(--shadow-sm);
}

.summary-icon {
    width: 45px;
    height: 45px;
    margin: 0 auto 10px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.total-missions .summary-icon {
    background: var(--primary);
    color: var(--text-dark);
}

.total-stars .summary-icon {
    background: var(--warning);
    color: var(--text-dark);
}

.streak .summary-icon {
    background: var(--pink);
    color: var(--text-dark);
}

.summary-number {
    display: block;
    font-family: 'Jua', sans-serif;
    font-size: 1.8rem;
    color: var(--text-dark);
}

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

.skill-progress {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin: 20px 0;
    box-shadow: var(--shadow-sm);
}

.skill-progress h3 {
    font-family: 'Jua', sans-serif;
    font-size: 1.1rem;
    color: var(--text-dark);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.skill-item {
    margin-bottom: 15px;
}

.skill-item:last-child {
    margin-bottom: 0;
}

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

.skill-name {
    font-size: 0.9rem;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 8px;
}

.skill-name i {
    color: var(--primary-dark);
}

.skill-percent {
    font-size: 0.85rem;
    color: var(--text-light);
    font-weight: 500;
}

.skill-bar {
    height: 10px;
    background: var(--bg-light);
    border-radius: var(--radius-full);
    overflow: hidden;
}

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

.recent-activities {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin: 20px 0;
    box-shadow: var(--shadow-sm);
}

.recent-activities h3 {
    font-family: 'Jua', sans-serif;
    font-size: 1.1rem;
    color: var(--text-dark);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.activities-list {
    max-height: 200px;
    overflow-y: auto;
}

.activity-item {
    display: flex;
    align-items: center;
    padding: 12px;
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    background: var(--bg-light);
}

.activity-item.empty {
    justify-content: center;
    text-align: center;
    color: var(--text-light);
    padding: 30px;
}

.activity-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    font-size: 1rem;
}

.activity-content {
    flex: 1;
}

.activity-name {
    font-weight: 500;
    color: var(--text-dark);
    font-size: 0.9rem;
}

.activity-date {
    font-size: 0.75rem;
    color: var(--text-light);
}

.activity-stars {
    color: var(--warning);
    font-size: 0.9rem;
}

.achievements-section {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin: 20px 0;
    box-shadow: var(--shadow-sm);
}

.achievements-section h3 {
    font-family: 'Jua', sans-serif;
    font-size: 1.1rem;
    color: var(--text-dark);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.badges-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.badge-item {
    text-align: center;
    padding: 15px 10px;
    border-radius: var(--radius-md);
    background: var(--bg-light);
    transition: all var(--transition-normal);
}

.badge-item.locked {
    opacity: 0.5;
    filter: grayscale(100%);
}

.badge-item.unlocked {
    background: linear-gradient(135deg, var(--accent) 0%, var(--secondary) 100%);
    opacity: 1;
    filter: none;
    box-shadow: var(--shadow-sm);
}

.badge-icon {
    width: 50px;
    height: 50px;
    margin: 0 auto 8px;
    border-radius: var(--radius-full);
    background: var(--bg-white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: var(--lavender);
}

.badge-item.unlocked .badge-icon {
    color: var(--warning);
}

.badge-name {
    font-size: 0.75rem;
    color: var(--text-dark);
}

.reset-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 15px;
    background: transparent;
    border: 2px solid var(--error);
    border-radius: var(--radius-md);
    color: var(--error);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    margin-top: 30px;
}

.reset-btn:hover, .reset-btn:focus {
    background: var(--error);
    color: var(--text-white);
}

/* ========================================
   Responsive Design
   ======================================== */
@media (max-width: 380px) {
    html {
        font-size: 14px;
    }

    .role-selection {
        flex-direction: column;
        align-items: center;
    }

    .role-btn {
        width: 100%;
        max-width: 200px;
    }

    .missions-grid {
        grid-template-columns: 1fr 1fr;
    }

    .report-summary {
        grid-template-columns: 1fr;
    }

    .badges-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 768px) {
    .container {
        max-width: 600px;
    }

    .missions-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .title {
        font-size: 3rem;
    }

    .penguin {
        transform: scale(1.1);
    }

    .penguin.small {
        transform: scale(0.6);
    }
}

@media (min-width: 1024px) {
    .container {
        max-width: 700px;
    }

    .camera-container {
        max-width: 600px;
        margin: 0 auto;
    }
}

/* ========================================
   Accessibility
   ======================================== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

:focus {
    outline: 3px solid var(--primary-dark);
    outline-offset: 2px;
}

:focus:not(:focus-visible) {
    outline: none;
}

:focus-visible {
    outline: 3px solid var(--primary-dark);
    outline-offset: 2px;
}

/* Skip Link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--text-dark);
    color: var(--text-white);
    padding: 8px 16px;
    z-index: 1001;
    text-decoration: none;
    border-radius: 0 0 var(--radius-sm) 0;
}

.skip-link:focus {
    top: 0;
}

/* Ripple Effect */
.ripple {
    position: relative;
    overflow: hidden;
}

.ripple::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.4);
    border-radius: var(--radius-full);
    transform: translate(-50%, -50%);
    opacity: 0;
}

.ripple:active::after {
    width: 200px;
    height: 200px;
    opacity: 1;
    transition: width 0.3s, height 0.3s, opacity 0.3s;
}

/* Loading Skeleton */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Dark Mode Support (Optional) */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-light: #1A202C;
        --bg-white: #2D3748;
        --text-dark: #E2E8F0;
        --text-light: #A0AEB5;
    }
}
