/* General Styles */
/* Merged theme variables (from user-provided enhanced palette) */
:root {
    /* Paleta de colores más vibrante y pastel */
    --bg: #fcf8e8; /* Very light cream */
    --bg2: #f5e6cc; /* Light beige */
    --card: rgba(255, 255, 255, .95);
    --cardHi: rgba(255, 255, 255, .9);
    --ink: #5a5a5a; /* Slightly softer dark grey */
    --muted: #a0a0a0; /* Softer muted grey */
    --primary: #a890f0; /* Softer purple */
    --primary-light: #c0a8f8; /* Lighter, more pastel purple */
    --success: #8bc34a; /* Brighter, more cheerful green */
    --warning: #ffca28; /* Brighter yellow/orange */
    --danger: #ef5350; /* Keeping red for danger, but could be softened if needed */
    --highlight: #ffeb3b; /* Brighter yellow highlight */
    /* Espaciado y tipografía */
    --space-unit: 1rem;
    --font-heading: 'Fredoka', sans-serif;
    --font-body: 'Nunito', sans-serif;
    --font-size-base: clamp(0.8rem, 1vw + 0.5rem, 1rem);
    --font-size-large: clamp(1.2rem, 1.5vw + 0.5rem, 1.5rem);
    --font-size-xl: clamp(1.5rem, 2vw + 0.5rem, 2rem);
    --font-size-xxl: clamp(2rem, 3vw + 1rem, 3rem);
    /* Sombra y bordes */
    --shadow-small: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-medium: 0 10px 15px rgba(0, 0, 0, 0.15);
    --shadow-large: 0 20px 25px rgba(0, 0, 0, 0.2);
    --border-radius-large: 1.5rem;
    --border-radius-medium: 1rem;
}

/* Compatibility aliases for older variable names used in the stylesheet */
:root {
    --primary-color: var(--primary);
    --secondary-color: var(--warning);
    --accent-color: var(--primary);
    --background-color: var(--bg);
    --text-color: var(--ink);
    --sidebar-bg: var(--card);
    --game-bg: var(--bg2);
    --autumn-leaf: #D32F2F;
    --autumn-orange: #F57C00;
    --autumn-yellow: #FFEB3B;
    --border-radius-lg: var(--border-radius-large);
    --border-radius-md: var(--border-radius-medium);
    --box-shadow: var(--shadow-large);
}

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

body {
    font-family: var(--font-body, 'Nunito', sans-serif);
    background-color: var(--background-color);
    color: var(--text-color);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

#app-container {
    display: flex;
    background-color: #FFFFFF;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--box-shadow);
    width: 100%;
    max-width: 1200px;
    min-height: 800px;
    overflow: hidden;
}

/* Sidebar Styles */
#sidebar {
    width: 280px;
    background-color: var(--sidebar-bg);
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
    border-right: 2px solid rgba(0, 0, 0, 0.05);
}

#sidebar h3 {
    color: var(--accent-color);
    margin-bottom: 15px;
    font-size: 1.6em;
    text-align: center;
}

#avatar-display, #rewards-display, #special-title-display {
    background-color: #FFFFFF;
    border-radius: var(--border-radius-md);
    padding: 20px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
    width: 100%;
    text-align: center;
}

#current-avatar {
    margin-bottom: 20px;
    position: relative; /* For equipped items positioning */
    display: inline-block;
}

#rewards-display p, #special-title-display p {
    font-size: 1.2em;
    margin-bottom: 10px;
}

#special-title-display.hidden {
    display: none;
}

/* Main Content Styles */
#main-content {
    flex-grow: 1;
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
}

.screen {
    display: none;
    width: 100%;
    max-width: 800px;
    text-align: center;
    animation: fadeIn 0.5s ease-out forwards;
}

.screen.active {
    display: block;
}

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

#home-screen h1 {
    color: var(--primary-color);
    font-size: 3.5em;
    margin-bottom: 20px;
}

#home-screen p {
    font-size: 1.5em;
    margin-bottom: 40px;
}

.game-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 25px;
    margin-bottom: 50px;
}

.game-btn {
    background-color: var(--secondary-color);
    color: #FFFFFF;
    border: none;
    border-radius: var(--border-radius-lg);
    padding: 25px 40px;
    font-size: 1.8em;
    font-weight: bold;
    cursor: pointer;
    box-shadow: var(--box-shadow);
    transition: transform 0.2s, background-color 0.2s;
    min-width: 250px;
}

.game-btn:hover {
    transform: translateY(-5px);
    background-color: var(--primary-color);
}

/* Buttons */
.btn-primary, .btn-secondary, .btn-sidebar {
    background-color: var(--primary-color);
    color: #FFFFFF;
    border: none;
    border-radius: var(--border-radius-md);
    padding: 15px 30px;
    font-size: 1.2em;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, background-color 0.2s;
    margin-top: 15px;
}

.btn-primary:hover, .btn-sidebar:hover {
    transform: translateY(-3px);
    background-color: var(--accent-color);
}

.btn-secondary {
    background-color: #9E9E9E;
}

.btn-secondary:hover {
    transform: translateY(-3px);
    background-color: #757575;
}

.btn-sidebar {
    font-size: 1em;
    padding: 10px 20px;
    margin-top: 10px;
    width: 80%;
}

/* Avatar Selection */
#avatar-selection-screen h2 {
    color: var(--accent-color);
    font-size: 2.5em;
    margin-bottom: 30px;
}

#avatar-options {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 40px;
}

.avatar-option {
    font-size: 60px;
    cursor: pointer;
    padding: 10px;
    border-radius: var(--border-radius-md);
    transition: transform 0.2s, background-color 0.2s;
}

.avatar-option:hover {
    transform: scale(1.1);
    background-color: rgba(var(--secondary-color), 0.2);
}

.avatar-option.selected {
    background-color: var(--secondary-color);
    box-shadow: var(--box-shadow);
}

#avatar-customization h3 {
    color: var(--primary-color);
    margin-bottom: 20px;
}

#avatar-customization label {
    font-size: 1.2em;
    margin-right: 10px;
}

#clothing-color {
    width: 50px;
    height: 50px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    vertical-align: middle;
}

/* Game Screens */
.game-screen h2 {
    color: var(--primary-color);
    font-size: 2.8em;
    margin-bottom: 30px;
}

#saison-mystere-content, #sons-magiques-content, #meteo-nature-content {
    background-color: var(--game-bg);
    border-radius: var(--border-radius-md);
    padding: 30px;
    box-shadow: var(--box-shadow);
    min-height: 400px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin-bottom: 30px;
}

/* Boutique */
#boutique-screen h2 {
    color: var(--accent-color);
    font-size: 2.5em;
    margin-bottom: 30px;
}

#boutique-items {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 30px;
    margin-top: 30px;
}

.boutique-item {
    background-color: #FFFFFF;
    border-radius: var(--border-radius-md);
    padding: 20px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
    text-align: center;
    width: 180px;
}

.boutique-item p {
    font-size: 1.1em;
    margin: 10px 0;
}

.buy-equip-btn {
    background-color: var(--secondary-color);
    color: #FFFFFF;
    border: none;
    border-radius: 10px;
    padding: 10px 15px;
    font-size: 1em;
    cursor: pointer;
    transition: background-color 0.2s;
}

.buy-equip-btn:hover {
    background-color: var(--primary-color);
}

/* Game specific styles */
.poem-verse-draggable {
    background-color: #FFE0B2; /* Light Orange */
    padding: 15px;
    border-radius: var(--border-radius-md);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    cursor: grab;
    font-size: 1.1em;
    text-align: left;
    width: 100%;
}

.poem-verse-draggable.dragging {
    opacity: 0.5;
    border: 2px dashed var(--accent-color);
}

.image-option-btn {
    background-color: #BBDEFB; /* Lighter Blue */
    border: none;
    border-radius: var(--border-radius-md);
    padding: 20px;
    font-size: 1.5em;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    transition: transform 0.2s;
}

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

.drop-target {
    border: 2px dashed var(--primary-color);
    border-radius: var(--border-radius-md);
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 90%;
    background-color: #FFFFFF;
    font-size: 1.5em;
    padding: 20px;
}

/* New Mini-Games Menu Styles */
#mini-games-menu-screen h2 {
    color: var(--accent-color);
    font-size: 2.5em;
    margin-bottom: 30px;
}

#mini-games-menu-screen p {
    font-size: 1.3em;
    margin-bottom: 40px;
}

.mini-game-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 50px;
    width: 100%;
    max-width: 900px; /* Adjust as needed */
}

.mini-game-btn {
    background-color: var(--primary-color);
    color: #FFFFFF;
    border: none;
    border-radius: var(--border-radius-lg); /* Rounder buttons */
    padding: 20px 15px;
    font-size: 1.4em;
    font-weight: bold;
    cursor: pointer;
    box-shadow: var(--box-shadow);
    transition: transform 0.2s, background-color 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 120px; /* Ensure buttons are large enough */
}

.mini-game-btn:hover {
    transform: translateY(-5px);
    background-color: var(--secondary-color);
}

.mini-game-btn span {
    font-size: 2em; /* Larger icons */
    margin-bottom: 5px;
}

/* Individual Mini-Game Screen Containers */
.mini-game-screen h2 {
    color: var(--primary-color);
    font-size: 2.8em;
    margin-bottom: 30px;
}

.mini-game-screen > div {
    background-color: var(--game-bg);
    border-radius: var(--border-radius-md);
    padding: 30px;
    box-shadow: var(--box-shadow);
    min-height: 400px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin-bottom: 30px;
}

/* Associe Image Mot Game Specific Styles */
.associe-image-mot-question {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}

.question-image {
    background-color: #FFFFFF;
    border-radius: var(--border-radius-md);
    padding: 20px;
    box-shadow: var(--box-shadow);
}

.options-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
}

.options-container .option-btn {
    min-width: 150px;
    padding: 20px;
    font-size: 1.5em;
    border-radius: var(--border-radius-lg);
}

/* Phrase à Trous Game Specific Styles */
.phrase-a-trous-question {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}

.sentence-display {
    font-size: 2em;
    margin-bottom: 20px;
    background-color: #FFFFFF;
    padding: 15px 25px;
    border-radius: var(--border-radius-md);
    box-shadow: var(--box-shadow);
}

.blank-space {
    display: inline-block;
    min-width: 100px;
    text-align: center;
    border-bottom: 3px solid var(--accent-color);
    padding: 0 5px;
}

/* Dictée Audio Game Specific Styles */
.dictee-audio-question {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.dictee-audio-question p {
    font-size: 1.8em;
    color: var(--text-color);
}

.dictee-audio-question #play-audio-btn {
    padding: 20px 30px;
    font-size: 1.5em;
    border-radius: var(--border-radius-lg);
    background-color: var(--accent-color);
}

.dictee-audio-question #play-audio-btn:hover {
    background-color: var(--primary-color);
}

.dictee-audio-question #dictee-input {
    padding: 15px;
    font-size: 1.5em;
    border-radius: var(--border-radius-md);
    border: 2px solid var(--primary-color);
    width: 80%;
    max-width: 400px;
    text-align: center;
}

.dictee-audio-question #dictee-input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(106, 5, 127, 0.3);
}

.dictee-audio-question #check-dictee-btn {
    padding: 18px 35px;
    font-size: 1.4em;
    border-radius: var(--border-radius-lg);
}

/* Memory Game Specific Styles */
.memory-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* Adjust based on number of cards */
    gap: 15px;
    perspective: 1000px;
    margin-top: 30px;
}

.memory-card {
    width: 120px;
    height: 120px;
    position: relative;
    cursor: pointer;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.memory-card.flipped {
    transform: rotateY(180deg);
}

.memory-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.6s;
    transform-style: preserve-3d;
    border-radius: var(--border-radius-md);
    box-shadow: var(--box-shadow);
}

.memory-card-front, .memory-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3em;
    font-weight: bold;
    border-radius: var(--border-radius-md);
}

.memory-card-front {
    background-color: var(--secondary-color);
    color: #FFFFFF;
}

.memory-card-back {
    background-color: #FFFFFF;
    color: var(--text-color);
    transform: rotateY(180deg);
}

.memory-card.matched .memory-card-back {
    background-color: #D4EDDA; /* Light green for matched */
}

/* Jeu de Copie Game Specific Styles */
.jeu-de-copie-question {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.jeu-de-copie-question .instruction {
    font-size: 1.5em;
    color: var(--text-color);
}

.jeu-de-copie-question .word-display {
    font-size: 3em;
    font-weight: bold;
    color: var(--accent-color);
    background-color: #FFFFFF;
    padding: 15px 30px;
    border-radius: var(--border-radius-md);
    box-shadow: var(--box-shadow);
    min-width: 250px;
}

.jeu-de-copie-question .word-display.hidden {
    visibility: hidden;
}

.jeu-de-copie-question input[type="text"] {
    padding: 15px;
    font-size: 1.5em;
    border-radius: var(--border-radius-md);
    border: 2px solid var(--primary-color);
    width: 80%;
    max-width: 400px;
    text-align: center;
}

.jeu-de-copie-question input[type="text"]:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(106, 5, 127, 0.3);
}

/* Mots Cachés Game Specific Styles */
.mots-caches-game {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.mots-caches-game .instruction {
    font-size: 1.5em;
    color: var(--text-color);
    margin-bottom: 10px;
}

.wordsearch-grid {
    display: grid;
    border: 2px solid var(--primary-color);
    border-radius: var(--border-radius-md);
    overflow: hidden;
}

.grid-cell {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2em;
    font-weight: bold;
    border: 1px solid #EEE;
    cursor: pointer;
    user-select: none;
    background-color: #FFFFFF;
    transition: background-color 0.2s;
}

.grid-cell.selected {
    background-color: var(--secondary-color);
    color: #FFFFFF;
}

.grid-cell.found {
    background-color: #D4EDDA; /* Light green for found words */
    color: #333;
}

.found-words-display {
    margin-top: 20px;
    font-size: 1.2em;
    color: var(--accent-color);
    font-weight: bold;
}

.found-word {
    background-color: var(--secondary-color);
    color: #FFFFFF;
    padding: 5px 10px;
    border-radius: 10px;
    margin: 0 5px;
}

/* Relier les Colonnes Game Specific Styles */
.relier-colonnes-game {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    position: relative;
    width: 100%;
    max-width: 700px;
}

.relier-colonnes-game .instruction {
    font-size: 1.5em;
    color: var(--text-color);
    margin-bottom: 10px;
}

.columns-container {
    display: flex;
    justify-content: space-around;
    width: 100%;
    position: relative;
    padding: 20px 0;
}

.column {
    display: flex;
    flex-direction: column;
    gap: 15px;
    z-index: 1;
}

.word-item {
    background-color: #FFFFFF;
    padding: 15px 25px;
    border-radius: var(--border-radius-md);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
    font-size: 1.5em;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.2s;
    min-width: 150px;
    text-align: center;
}

.word-item.script {
    color: var(--primary-color);
}

.word-item.cursive {
    font-family: 'Dancing Script', cursive; /* Example cursive font */
    color: var(--accent-color);
}

.word-item:hover {
    transform: scale(1.05);
}

.word-item.selected {
    background-color: var(--secondary-color);
    color: #FFFFFF;
    border: 2px solid var(--accent-color);
}

.word-item.matched {
    background-color: #D4EDDA; /* Light green for matched */
    color: #333;
    cursor: default;
}

#lines-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none; /* Allow clicks to pass through SVG */
    z-index: 0;
}

/* Puzzle de Lettres Game Specific Styles */
.puzzle-lettres-question {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}

.puzzle-lettres-question .instruction {
    font-size: 1.5em;
    color: var(--text-color);
    margin-bottom: 10px;
}

.drop-zone {
    border: 2px dashed var(--primary-color);
    border-radius: var(--border-radius-md);
    min-height: 80px;
    width: 100%;
    max-width: 500px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background-color: #F0F4C3; /* Light yellow-green */
}

.drop-zone.drag-over {
    background-color: #C5E1A5; /* Lighter green */
    border-color: var(--accent-color);
}

.letters-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
    background-color: #FFFFFF;
    padding: 20px;
    border-radius: var(--border-radius-md);
    box-shadow: var(--box-shadow);
}

.draggable-letter {
    background-color: var(--secondary-color);
    color: #FFFFFF;
    padding: 15px 20px;
    border-radius: var(--border-radius-md);
    font-size: 2em;
    font-weight: bold;
    cursor: grab;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s;
}

.draggable-letter:hover {
    transform: translateY(-3px);
}

.draggable-letter.hide {
    opacity: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    #app-container {
        flex-direction: column;
        min-height: unset;
        height: auto;
    }

    #sidebar {
        width: 100%;
        padding: 20px;
        flex-direction: row;
        justify-content: space-around;
        border-right: none;
        border-bottom: 2px solid rgba(0, 0, 0, 0.05);
    }

    #avatar-display, #rewards-display, #special-title-display {
        width: 45%;
        padding: 15px;
    }

    #sidebar h3 {
        font-size: 1.2em;
        margin-bottom: 10px;
    }

    #rewards-display p, #special-title-display p {
        font-size: 1em;
    }

    .btn-sidebar {
        width: auto;
        padding: 8px 15px;
        font-size: 0.9em;
    }

    #main-content {
        padding: 20px;
    }

    #home-screen h1 {
        font-size: 2.5em;
    }

    #home-screen p {
        font-size: 1.2em;
    }

    .game-buttons {
        flex-direction: column;
        gap: 15px;
    }

    .game-btn {
        font-size: 1.5em;
        padding: 20px 30px;
        min-width: unset;
        width: 100%;
    }

    #avatar-options {
        flex-wrap: wrap;
    }

    .avatar-option {
        font-size: 50px;
    }

    .game-screen h2 {
        font-size: 2em;
    }

    #saison-mystere-content, #sons-magiques-content, #meteo-nature-content,
    .mini-game-screen > div {
        padding: 20px;
    }

    .quiz-container, .listen-find-container, .rhyme-container, .sons-magiques-game-content, .meteo-nature-game-content {
        padding: 20px;
    }

    .mini-game-buttons {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }

    .mini-game-btn {
        font-size: 1.2em;
        min-height: 100px;
    }

    .options-container .option-btn {
        min-width: 120px;
        padding: 15px;
        font-size: 1.2em;
    }

    .sentence-display {
        font-size: 1.5em;
    }

    .blank-space {
        min-width: 80px;
    }

    .dictee-audio-question p {
        font-size: 1.4em;
    }

    .dictee-audio-question #play-audio-btn {
        padding: 15px 25px;
        font-size: 1.2em;
    }

    .dictee-audio-question #dictee-input {
        padding: 12px;
        font-size: 1.2em;
        width: 90%;
    }

    .dictee-audio-question #check-dictee-btn {
        padding: 15px 30px;
        font-size: 1.2em;
    }

    .memory-grid {
        grid-template-columns: repeat(3, 1fr); /* Adjust for smaller screens */
    }

    .memory-card {
        width: 90px;
        height: 90px;
    }

    .memory-card-front, .memory-card-back {
        font-size: 2em;
    }

    .jeu-de-copie-question .instruction {
        font-size: 1.2em;
    }

    .jeu-de-copie-question .word-display {
        font-size: 2em;
        min-width: 180px;
    }

    .jeu-de-copie-question input[type="text"] {
        padding: 12px;
        font-size: 1.2em;
        width: 90%;
    }

    .grid-cell {
        width: 30px;
        height: 30px;
        font-size: 1em;
    }

    .columns-container {
        flex-direction: column;
        gap: 10px;
    }

    .column {
        width: 90%;
    }

    .word-item {
        min-width: unset;
        width: 80%;
        font-size: 1.2em;
    }

    .puzzle-lettres-question .instruction {
        font-size: 1.2em;
    }

    .drop-zone {
        min-height: 60px;
        gap: 5px;
    }

    .letters-container {
        padding: 15px;
    }

    .draggable-letter {
        padding: 10px 15px;
        font-size: 1.5em;
    }
}
/* --- Appended enhanced theme and animations (user-provided) --- */

/* Base adjustments to integrate new variables with existing class names */
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(1rem, 4vw, 2.5rem);
  min-height: 100vh;
  padding: clamp(1rem, 3vw, 2.5rem);
  line-height: 1.6;
  font-size: var(--font-size-base);
  transition: background-color 0.5s ease-in-out;
}

body.has-custom-background {
  background: linear-gradient(160deg, var(--custom-bg-start, #fce4ec), var(--custom-bg-end, #f8bbd0));
  color: var(--custom-text-color, var(--ink));
}

/* Decorative floating icons */
#floatingDecor { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 0; }
.floating-decor__icon { position: absolute; font-size: clamp(1.6rem, 3vw, 2.6rem); opacity: 0.4; filter: drop-shadow(0 6px 12px rgba(0,0,0,0.25)); }

/* Level themed backgrounds */
.body-level-1 { background: linear-gradient(180deg, #fce4ec 0%, #f8bbd0 45%, #f48fb1 100%); }
.body-level-2 { background: linear-gradient(180deg, #e3f2fd 0%, #bbdefb 40%, #64b5f6 100%); }
.body-level-3 { background: linear-gradient(180deg, #e8f5e9 0%, #c8e6c9 45%, #81c784 100%); }
.body-level-4 { background: linear-gradient(180deg, #fff3e0 0%, #ffe0b2 42%, #ffb74d 100%); }
.body-level-5 { background: linear-gradient(180deg, #f3e5f5 0%, #e1bee7 42%, #ba68c8 100%); }
.body-level-6 { background: linear-gradient(180deg, #e0f2f1 0%, #b2dfdb 40%, #4db6ac 100%); }
.body-level-7 { background: linear-gradient(180deg, #f1f8e9 0%, #dcedc8 40%, #aed581 100%); }
.body-level-8 { background: linear-gradient(180deg, #e1f5fe 0%, #b3e5fc 40%, #4fc3f7 100%); }
.body-level-9 { background: linear-gradient(180deg, #fffde7 0%, #fff59d 42%, #fdd835 100%); }
.body-level-10 { background: linear-gradient(180deg, #efebe9 0%, #d7ccc8 40%, #a1887f 100%); }
.body-level-11 { background: linear-gradient(180deg, #fbe9e7 0%, #ffccbc 40%, #ff8a65 100%); }
.body-level-12 { background: linear-gradient(180deg, #ede7f6 0%, #d1c4e9 40%, #9575cd 100%); }

/* Header / Stage top */
#stageTop { display:flex; flex-wrap:wrap; justify-content:space-between; align-items:center; gap:1rem; max-width:900px; width:100%; padding:var(--space-unit); font-family:var(--font-heading); font-size:var(--font-size-large); color:var(--primary); position:relative; z-index:1; }
#stageTop span { display:inline-flex; align-items:center; gap:0.5rem; padding:0.25rem 0.75rem; border-radius:9999px; background:var(--card); box-shadow:var(--shadow-small); }

/* Topic buttons styled to be large and friendly */
.topic-btn { font-family:var(--font-heading); padding:1rem 1.5rem; border-radius:1.5rem; border:none; background:var(--bg2); color:var(--primary); cursor:pointer; transition:all .25s ease-in-out; display:flex; flex-direction:column; align-items:center; gap:0.5rem; font-size:var(--font-size-large); box-shadow: -6px -6px 12px rgba(255,255,255,0.9), 6px 6px 12px rgba(0,0,0,0.25); }
.topic-btn:hover { transform:translateY(-3px); box-shadow: -2px -2px 6px rgba(255,255,255,0.7), 6px 6px 12px rgba(0,0,0,0.25); }

/* Options and cards tuned for focus and TDAH friendliness */
.option { background:var(--bg2); border-radius:var(--border-radius-medium); padding:clamp(1rem,2.5vw,1.75rem); box-shadow:0 8px 20px rgba(148,102,255,0.2); min-height:clamp(72px,12vh,160px); }
.option:hover { border-color:var(--primary-light); background:linear-gradient(135deg, rgba(255,255,255,0.9), rgba(255,255,255,0.75)); }

/* Buttons and progress */
.btn { font-family:var(--font-heading); font-size:var(--font-size-large); padding:0.75rem 2rem; border-radius:var(--border-radius-medium); }
.audio-btn { background:var(--primary); }

/* Progress tracker */
.progress-tracker__fill { background: linear-gradient(135deg, rgba(171,71,188,0.9), rgba(48,63,159,0.9)); }

/* Shop modal styles to match theme */
.shop-modal__dialog { background: var(--cardHi); }

/* Small helpers */
.fx-pulse { animation: pulse 2s infinite ease-in-out; }

/* Accessibility focus outline override */
:focus { outline: 3px solid var(--highlight); outline-offset: 3px; }

/* Ensure dynamic-game-screen displays when active via 'active' class (matches .screen.active above) */
#dynamic-game-screen { display: none; }
.screen.active#dynamic-game-screen, .screen#dynamic-game-screen.active { display: block; }

/* End appended enhanced CSS */