* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-orange: #E67E22;
    --golden-yellow: #F39C12;
    --burgundy: #922B21;
    --forest-green: #27AE60;
    --cream: #FDF6E3;
    --brown: #8B4513;
    --autumn-red: #C0392B;
}

body {
    font-family: 'Nunito', sans-serif;
    background: var(--cream);
    color: #333;
    overflow-x: hidden;
}

.app {
    min-height: 100vh;
}

/* Header */
.header-section {
    background: linear-gradient(135deg, var(--primary-orange) 0%, var(--golden-yellow) 50%, var(--autumn-red) 100%);
    padding: 2rem 1rem 3rem;
    position: relative;
    overflow: hidden;
    text-align: center;
}

.header-content {
    position: relative;
    z-index: 10;
}

.main-title {
    font-family: 'Fredoka', sans-serif;
    font-size: clamp(2rem, 6vw, 3.5rem);
    color: white;
    text-shadow: 3px 3px 0 var(--brown), -1px -1px 0 var(--brown);
    margin-bottom: 0.5rem;
    animation: titleBounce 2s ease-in-out infinite;
    user-select: none;
}

@keyframes titleBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.subtitle {
    font-size: 1.25rem;
    color: white;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
    margin-bottom: 1.5rem;
}

.dancing-banana {
    font-size: 3rem;
    animation: dance 0.5s ease-in-out infinite;
    margin-bottom: 1rem;
}

@keyframes dance {
    0%, 100% { transform: rotate(-10deg) scale(1); }
    50% { transform: rotate(10deg) scale(1.1); }
}

.hero-image-container {
    display: flex;
    justify-content: center;
}

.hero-image {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    border: 6px solid white;
    box-shadow: 0 8px 30px rgba(0,0,0,0.2);
    object-fit: cover;
    background: var(--cream);
}

/* Falling Leaves */
.falling-leaves-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
}

.falling-leaf {
    position: absolute;
    top: -50px;
    animation: fall linear infinite;
}

@keyframes fall {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(calc(100vh + 100px)) rotate(720deg);
        opacity: 0.3;
    }
}

/* Sections */
.section {
    padding: 3rem 1rem;
    max-width: 800px;
    margin: 0 auto;
}

.section-title {
    font-family: 'Fredoka', sans-serif;
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    color: var(--brown);
    text-align: center;
    margin-bottom: 0.5rem;
}

.section-desc {
    text-align: center;
    color: #666;
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

/* Scene Generator */
.scene-generator {
    background: linear-gradient(180deg, transparent 0%, rgba(230, 126, 34, 0.1) 100%);
}

.generate-btn {
    display: block;
    margin: 0 auto 1.5rem;
    padding: 1rem 2rem;
    font-family: 'Fredoka', sans-serif;
    font-size: 1.2rem;
    background: linear-gradient(135deg, var(--primary-orange), var(--golden-yellow));
    color: white;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(230, 126, 34, 0.4);
    transition: all 0.3s ease;
}

.generate-btn:hover:not(:disabled) {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 6px 20px rgba(230, 126, 34, 0.5);
}

.generate-btn:disabled {
    opacity: 0.7;
    cursor: wait;
}

.loading-bounce {
    font-size: 3rem;
    text-align: center;
    animation: bounce 0.6s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

.scene-frame {
    background: linear-gradient(135deg, #8B4513, #A0522D);
    padding: 15px;
    border-radius: 20px;
    max-width: 550px;
    margin: 0 auto;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.generated-image {
    width: 100%;
    border-radius: 12px;
    display: block;
}

.cached-scenes {
    margin-top: 2rem;
}

.cached-title {
    font-family: 'Fredoka', sans-serif;
    text-align: center;
    color: var(--brown);
    margin-bottom: 1rem;
}

.cached-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 1rem;
    max-width: 500px;
    margin: 0 auto;
}

.cached-image {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 12px;
    cursor: pointer;
    border: 3px solid var(--golden-yellow);
    transition: transform 0.3s ease;
}

.cached-image:hover {
    transform: scale(1.05);
}

/* Gratitude Wall */
.gratitude-wall {
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23e67e22' fill-opacity='0.08'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.gratitude-form {
    display: flex;
    gap: 0.5rem;
    max-width: 500px;
    margin: 0 auto 2rem;
    flex-wrap: wrap;
    justify-content: center;
}

.gratitude-input {
    flex: 1;
    min-width: 200px;
    padding: 0.75rem 1rem;
    border: 3px solid var(--golden-yellow);
    border-radius: 25px;
    font-family: 'Nunito', sans-serif;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s ease;
}

.gratitude-input:focus {
    border-color: var(--primary-orange);
}

.add-btn {
    padding: 0.75rem 1.5rem;
    background: var(--forest-green);
    color: white;
    border: none;
    border-radius: 25px;
    font-family: 'Fredoka', sans-serif;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.add-btn:hover {
    background: #219a52;
    transform: scale(1.05);
}

.leaves-pile {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    max-width: 700px;
    margin: 0 auto;
}

.gratitude-leaf {
    padding: 1rem 1.5rem;
    color: white;
    border-radius: 30px 10px 30px 10px;
    font-size: 0.95rem;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    animation: leafDrop 0.5s ease-out forwards;
    max-width: 250px;
    text-align: center;
}

@keyframes leafDrop {
    from {
        opacity: 0;
        transform: translateY(-30px) rotate(-20deg);
    }
    to {
        opacity: 1;
        transform: translateY(0) rotate(var(--rotation, 0deg));
    }
}

/* Fun Facts Carousel */
.fun-facts {
    background: linear-gradient(180deg, rgba(243, 156, 18, 0.1) 0%, transparent 100%);
}

.carousel-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    max-width: 600px;
    margin: 0 auto;
}

.carousel-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--primary-orange);
    color: white;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.carousel-btn:hover {
    background: var(--golden-yellow);
    transform: scale(1.1);
}

.fact-card {
    background: linear-gradient(135deg, #FFF8E7, #FDF6E3);
    border: 3px solid var(--golden-yellow);
    border-radius: 20px;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
    flex: 1;
    min-height: 280px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.fact-banana {
    position: relative;
    margin-bottom: 1rem;
}

.fact-banana img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
}

.reaction-emoji {
    position: absolute;
    bottom: -5px;
    right: -5px;
    font-size: 1.5rem;
    background: white;
    border-radius: 50%;
    padding: 2px 6px;
}

.fact-text {
    font-size: 1.2rem;
    color: var(--brown);
    font-weight: 600;
    margin-bottom: 1rem;
}

.fact-dots {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ddd;
    cursor: pointer;
    transition: all 0.3s ease;
}

.dot.active {
    background: var(--primary-orange);
    transform: scale(1.3);
}

/* Quiz Section */
.quiz-section {
    background: url("data:image/svg+xml,%3Csvg width='52' height='26' viewBox='0 0 52 26' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23922b21' fill-opacity='0.06'%3E%3Cpath d='M10 10c0-2.21-1.79-4-4-4-3.314 0-6-2.686-6-6h2c0 2.21 1.79 4 4 4 3.314 0 6 2.686 6 6 0 2.21 1.79 4 4 4 3.314 0 6 2.686 6 6 0 2.21 1.79 4 4 4v2c-3.314 0-6-2.686-6-6 0-2.21-1.79-4-4-4-3.314 0-6-2.686-6-6zm25.464-1.95l8.486 8.486-1.414 1.414-8.486-8.486 1.414-1.414z' /%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.quiz-progress {
    display: flex;
    justify-content: space-between;
    max-width: 400px;
    margin: 0 auto 1rem;
    font-weight: 600;
    color: var(--brown);
}

.quiz-card {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    max-width: 500px;
    margin: 0 auto;
    box-shadow: 0 8px 30px rgba(0,0,0,0.1);
    border: 3px solid var(--golden-yellow);
}

.quiz-fact {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--brown);
    text-align: center;
    margin-bottom: 1.5rem;
    font-style: italic;
}

.quiz-options {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.quiz-option {
    padding: 1rem 2rem;
    border: 3px solid #ddd;
    border-radius: 15px;
    font-family: 'Fredoka', sans-serif;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
    min-width: 140px;
}

.quiz-option:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.quiz-option.turkey {
    border-color: var(--burgundy);
    color: var(--burgundy);
}

.quiz-option.turkey:hover:not(:disabled) {
    background: var(--burgundy);
    color: white;
}

.quiz-option.banana {
    border-color: var(--golden-yellow);
    color: var(--brown);
}

.quiz-option.banana:hover:not(:disabled) {
    background: var(--golden-yellow);
    color: white;
}

.quiz-option.correct {
    background: var(--forest-green) !important;
    border-color: var(--forest-green) !important;
    color: white !important;
}

.quiz-option.wrong {
    background: var(--autumn-red) !important;
    border-color: var(--autumn-red) !important;
    color: white !important;
}

.answer-reveal {
    margin-top: 1.5rem;
    padding: 1rem;
    border-radius: 15px;
    text-align: center;
}

.answer-reveal.correct {
    background: rgba(39, 174, 96, 0.1);
}

.answer-reveal.wrong {
    background: rgba(192, 57, 43, 0.1);
}

.explanation {
    color: #666;
    font-size: 0.95rem;
    margin: 0.5rem 0;
}

.next-btn {
    margin-top: 1rem;
    padding: 0.75rem 1.5rem;
    background: var(--primary-orange);
    color: white;
    border: none;
    border-radius: 25px;
    font-family: 'Fredoka', sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
}

.next-btn:hover {
    background: var(--golden-yellow);
    transform: scale(1.05);
}

/* Quiz Result */
.quiz-result {
    text-align: center;
    position: relative;
    padding: 2rem;
}

.confetti-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
}

.confetti {
    position: absolute;
    top: -20px;
    font-size: 1.5rem;
    animation: confettiFall 3s ease-in-out infinite;
}

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

.result-banana {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    margin-bottom: 1rem;
    border: 4px solid var(--golden-yellow);
}

.score-text {
    font-family: 'Fredoka', sans-serif;
    font-size: 2rem;
    color: var(--brown);
    margin-bottom: 0.5rem;
}

.score-comment {
    font-size: 1.2rem;
    color: #666;
    margin-bottom: 1.5rem;
}

.quiz-btn {
    padding: 1rem 2rem;
    background: var(--forest-green);
    color: white;
    border: none;
    border-radius: 25px;
    font-family: 'Fredoka', sans-serif;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.quiz-btn:hover {
    transform: scale(1.05);
    background: #219a52;
}

/* Gobble Button */
.gobble-container {
    text-align: center;
    padding: 2rem;
    position: relative;
}

.gobble-btn {
    padding: 1.25rem 2.5rem;
    background: linear-gradient(135deg, var(--burgundy), var(--autumn-red));
    color: white;
    border: none;
    border-radius: 50px;
    font-family: 'Fredoka', sans-serif;
    font-size: 1.3rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 6px 20px rgba(146, 43, 33, 0.4);
}

.gobble-btn:hover {
    transform: scale(1.05);
}

.gobble-btn.active {
    animation: shake 0.5s ease-in-out infinite;
    background: linear-gradient(135deg, var(--golden-yellow), var(--primary-orange));
}

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

.surprised-banana {
    position: absolute;
    top: -50px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 100px;
    border-radius: 50%;
    animation: pop 0.3s ease-out;
}

@keyframes pop {
    from { transform: translateX(-50%) scale(0); }
    to { transform: translateX(-50%) scale(1); }
}

/* Footer */
.footer {
    background: linear-gradient(135deg, var(--brown) 0%, #5D3A1A 100%);
    padding: 3rem 1rem;
    text-align: center;
}

.footer-content {
    max-width: 600px;
    margin: 0 auto;
}

.footer-message {
    font-family: 'Fredoka', sans-serif;
    font-size: 1.5rem;
    color: var(--cream);
    margin-bottom: 1rem;
}

.footer-banana img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin-bottom: 1rem;
    animation: wave 1s ease-in-out infinite;
}

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

.footer-link {
    color: var(--golden-yellow);
    text-decoration: none;
    font-size: 1rem;
    transition: color 0.3s ease;
}

.footer-link:hover {
    color: white;
}

/* Responsive */
@media (max-width: 600px) {
    .section {
        padding: 2rem 1rem;
    }
    
    .hero-image {
        width: 150px;
        height: 150px;
    }
    
    .carousel-container {
        flex-direction: column;
    }
    
    .carousel-btn {
        display: none;
    }
    
    .fact-card {
        min-height: auto;
    }
    
    .quiz-options {
        flex-direction: column;
    }
    
    .quiz-option {
        width: 100%;
    }
}