:root {
    --neutral-bg: #e8f5e9;
    --positive-bg: #fff9c4;
    --negative-bg: #cfd8dc;

    --primary: #4caf50;
    --accent: #ffeb3b;
    --error: #ef5350;
    --text: #2e7d32;
    --white: #ffffff;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    transition: background-color 0.8s ease, filter 0.5s ease;
    font-family: 'Quicksand', sans-serif;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    color: var(--text);
}

body.theme-neutral {
    background-color: var(--neutral-bg);
}

body.theme-positive {
    background-color: var(--positive-bg);
}

body.theme-negative {
    background-color: var(--negative-bg);
    filter: grayscale(0.4);
}

#game-container {
    width: 100%;
    max-width: 600px;
    padding: 20px;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* --- Character Area --- */
.character-area {
    margin-bottom: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.character-sprout {
    width: 120px;
    height: 120px;
    background: #aed581;
    border-radius: 50% 50% 40% 40%;
    position: relative;
    border: 4px solid #689f38;
    box-shadow: 0 8px 0 rgba(0, 0, 0, 0.05);
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    animation: idle 3s infinite ease-in-out;
}

.character-sprout::before {
    /* Leaf on top */
    content: '🍃';
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 2.5rem;
}

.character-sprout .eyes {
    position: absolute;
    top: 40%;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-around;
    padding: 0 25px;
}

.character-sprout .eyes::before,
.character-sprout .eyes::after {
    content: '';
    width: 12px;
    height: 12px;
    background: #33691e;
    border-radius: 50%;
}

.character-sprout .mouth {
    position: absolute;
    bottom: 25px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 10px;
    border-bottom: 3px solid #33691e;
    border-radius: 0 0 10px 10px;
}

/* States */
.happy .character-sprout {
    background: #d4e157;
    transform: scale(1.1) rotate(5deg);
}

.happy .character-sprout .mouth {
    height: 15px;
    background: #33691e;
    border-radius: 50% 50% 10% 10%;
    border: none;
}

.sad .character-sprout {
    background: #90a4ae;
    transform: scale(0.9) rotate(-10deg);
    filter: contrast(0.8);
}

.sad .character-sprout .mouth {
    border-bottom: none;
    border-top: 3px solid #37474f;
    border-radius: 10px 10px 0 0;
}

.sad .character-sprout::before {
    content: '🍂';
}

.feedback-bubble {
    margin-top: 20px;
    background: var(--white);
    padding: 10px 20px;
    border-radius: 20px;
    font-weight: 700;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    position: relative;
    font-size: 0.9rem;
}

/* --- Screens --- */
.screen {
    width: 100%;
    background: var(--white);
    padding: 40px 30px;
    border-radius: 40px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.05);
    text-align: center;
    transition: opacity 0.5s ease;
}

.hidden {
    display: none !important;
    opacity: 0;
}

.title {
    font-family: 'Outfit', sans-serif;
    color: var(--primary);
    margin-bottom: 10px;
}

.subtitle {
    margin-bottom: 30px;
    font-weight: 700;
    opacity: 0.7;
}

/* --- Difficulty Picker --- */
.difficulty-picker {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.diff-btn {
    padding: 20px;
    border: none;
    border-radius: 20px;
    font-weight: 700;
    font-size: 1.2rem;
    cursor: pointer;
    transition: transform 0.2s, background 0.3s;
    background: #f1f8e9;
}

.diff-btn span {
    font-size: 0.8rem;
    opacity: 0.6;
}

.diff-btn.easy {
    color: #2e7d32;
}

.diff-btn.medium {
    color: #f9a825;
}

.diff-btn.hard {
    color: #c62828;
}

.diff-btn:hover {
    transform: translateY(-3px);
    background: #fff;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
}

/* --- Question Area --- */
.quiz-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    font-weight: 700;
    font-size: 0.8rem;
    color: var(--primary);
}

#question-text {
    font-size: 1.2rem;
    margin-bottom: 25px;
    font-family: 'Outfit', sans-serif;
}

.options-grid {
    display: grid;
    gap: 10px;
}

.option-btn {
    padding: 15px;
    background: #f1f8e9;
    border: 2px solid transparent;
    border-radius: 15px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.3s;
    text-align: left;
}

.option-btn:hover {
    background: #fff;
    border-color: var(--primary);
}

.option-btn.correct {
    background: #c8e6c9;
    border-color: var(--primary);
    color: #1b5e20;
}

.option-btn.wrong {
    background: #ffcdd2;
    border-color: var(--error);
    color: #b71c1c;
}

/* --- Animations --- */
@keyframes idle {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-5px);
    }
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    75% {
        transform: translateX(5px);
    }
}

.shake {
    animation: shake 0.3s linear 3;
}

/* Result screen components */
.final-score-area {
    font-size: 4rem;
    font-family: 'Outfit', sans-serif;
    color: var(--primary);
    margin: 20px 0;
}

.final-score-area span {
    font-size: 2rem;
    opacity: 0.6;
}

.reset-btn {
    background: var(--primary);
    color: white;
    padding: 15px 30px;
    border-radius: 30px;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 700;
}