'use strict';

/* ────────────────────────────────────────────────────────────────
   KidMode — LEGENDARY kid-friendly game creation system
   
   Features:
   • Simplified language (no jargon)
   • Drag-and-drop entity creation
   • Visual block programming (Scratch-like concepts)
   • Emoji-based node system
   • Age-appropriate content filtering
   • Gamification (stars, badges, streaks)
   • Classroom mode
   • Parent dashboard config
──────────────────────────────────────────────────────────────── */
const DEFAULT_PARENT_CONFIG = {
    dailyTimeLimitMinutes: 60,
    allowSharing: false,
    contentFilter: 'strict',
    allowChat: false,
    settingsPin: '',
    allowedSpriteCategories: ['animals', 'people', 'vehicles', 'nature', 'food', 'fantasy', 'space', 'sports', 'buildings', 'effects'],
    enableSounds: true,
};
const DEFAULT_KID_MODE_CONFIG = {
    enabled: false,
    ageGroup: '9-11',
    parentConfig: DEFAULT_PARENT_CONFIG,
};
class KidModeManager {
    constructor(config) {
        this.profile = null;
        this.sessionStartTime = 0;
        this.sessionPlayTime = 0;
        this.storageKey = 'nice2dev_kid_profile';
        this.config = { ...DEFAULT_KID_MODE_CONFIG, ...config };
        this.loadProfile();
    }
    /* ── Mode Management ────────────────────────────────────────── */
    isEnabled() {
        return this.config.enabled;
    }
    enable(ageGroup) {
        this.config.enabled = true;
        if (ageGroup)
            this.config.ageGroup = ageGroup;
        this.sessionStartTime = Date.now();
    }
    disable() {
        this.config.enabled = false;
        this.saveProfile();
    }
    getAgeGroup() {
        return this.config.ageGroup;
    }
    setAgeGroup(age) {
        this.config.ageGroup = age;
    }
    /* ── Profile Management ─────────────────────────────────────── */
    getProfile() {
        return this.profile;
    }
    createProfile(name, avatarEmoji, ageGroup, locale) {
        this.profile = {
            name,
            avatarEmoji,
            ageGroup,
            locale,
            stars: 0,
            streak: 0,
            lastActiveDate: new Date().toISOString().split('T')[0],
            earnedBadges: [],
            completedTutorials: [],
            createdProjects: [],
            totalBlocksUsed: 0,
            totalPlayTime: 0,
        };
        this.saveProfile();
        return this.profile;
    }
    /** Award stars (gamification) */
    awardStars(count) {
        if (!this.profile)
            return 0;
        this.profile.stars += count;
        this.saveProfile();
        return this.profile.stars;
    }
    /** Check and update streak */
    updateStreak() {
        if (!this.profile)
            return 0;
        const today = new Date().toISOString().split('T')[0];
        const lastDate = this.profile.lastActiveDate;
        if (lastDate === today)
            return this.profile.streak;
        const last = new Date(lastDate);
        const now = new Date(today);
        const diffDays = Math.floor((now.getTime() - last.getTime()) / 86400000);
        if (diffDays === 1) {
            this.profile.streak++;
        }
        else if (diffDays > 1) {
            this.profile.streak = 1;
        }
        this.profile.lastActiveDate = today;
        this.saveProfile();
        return this.profile.streak;
    }
    /** Mark tutorial as completed, award stars */
    completeTutorial(tutorialId) {
        if (!this.profile)
            return 0;
        if (!this.profile.completedTutorials.includes(tutorialId)) {
            this.profile.completedTutorials.push(tutorialId);
            this.awardStars(5);
        }
        this.saveProfile();
        return this.profile.stars;
    }
    /* ── Badge System ───────────────────────────────────────────── */
    /** Check if a badge is earned */
    checkBadge(badge) {
        if (!this.profile)
            return false;
        if (this.profile.earnedBadges.includes(badge.id))
            return true;
        const c = badge.condition;
        let earned = false;
        switch (c.type) {
            case 'tutorials_completed':
                earned = this.profile.completedTutorials.length >= c.count;
                break;
            case 'games_created':
                earned = this.profile.createdProjects.length >= c.count;
                break;
            case 'blocks_used':
                earned = this.profile.totalBlocksUsed >= c.count;
                break;
            case 'days_active':
                earned = this.profile.streak >= c.count;
                break;
            default:
                earned = false;
        }
        if (earned && !this.profile.earnedBadges.includes(badge.id)) {
            this.profile.earnedBadges.push(badge.id);
            this.awardStars(10);
            this.saveProfile();
        }
        return earned;
    }
    /* ── Time Management (parental controls) ────────────────────── */
    /** Get remaining play time in minutes. -1 = unlimited. */
    getRemainingTime() {
        const limit = this.config.parentConfig.dailyTimeLimitMinutes;
        if (limit === 0)
            return -1;
        const elapsed = this.sessionPlayTime + (Date.now() - this.sessionStartTime) / 60000;
        return Math.max(0, limit - elapsed);
    }
    /** Check if time limit is exceeded */
    isTimeLimitExceeded() {
        const remaining = this.getRemainingTime();
        return remaining !== -1 && remaining <= 0;
    }
    /* ── Content Filtering ──────────────────────────────────────── */
    /** Check if a sprite is appropriate for current settings */
    isSpriteAllowed(sprite) {
        const parentConfig = this.config.parentConfig;
        if (!parentConfig.allowedSpriteCategories.includes(sprite.category))
            return false;
        const ageOrder = ['6-8', '9-11', '12-14', '15+'];
        const currentIdx = ageOrder.indexOf(this.config.ageGroup);
        const spriteIdx = ageOrder.indexOf(sprite.ageAppropriate);
        return spriteIdx <= currentIdx;
    }
    /** Filter blocks by age group */
    getAvailableBlocks(allBlocks) {
        const ageOrder = ['6-8', '9-11', '12-14', '15+'];
        const currentIdx = ageOrder.indexOf(this.config.ageGroup);
        return allBlocks.filter(b => {
            const blockIdx = ageOrder.indexOf(b.minAge);
            return blockIdx <= currentIdx;
        });
    }
    /* ── Difficulty Mapping ─────────────────────────────────────── */
    /** Map kid difficulty to engine concepts */
    getDifficultySettings(difficulty) {
        return KID_DIFFICULTY_PRESETS[difficulty];
    }
    /* ── Parent Config ──────────────────────────────────────────── */
    getParentConfig() {
        return { ...this.config.parentConfig };
    }
    updateParentConfig(updates) {
        this.config.parentConfig = { ...this.config.parentConfig, ...updates };
    }
    /* ── Classroom ──────────────────────────────────────────────── */
    getClassroom() {
        return this.config.classroom;
    }
    setClassroom(classroom) {
        this.config.classroom = classroom;
    }
    /** Get leaderboard sorted by stars */
    getLeaderboard() {
        const classroom = this.config.classroom;
        if (!(classroom === null || classroom === void 0 ? void 0 : classroom.showLeaderboard))
            return [];
        return classroom.students
            .map(s => ({ name: s.name, emoji: s.avatarEmoji, stars: s.stars }))
            .sort((a, b) => b.stars - a.stars);
    }
    /* ── Persistence ────────────────────────────────────────────── */
    saveProfile() {
        if (!this.profile)
            return;
        try {
            if (typeof localStorage !== 'undefined') {
                localStorage.setItem(this.storageKey, JSON.stringify(this.profile));
            }
        }
        catch ( /* quota exceeded or unavailable */_a) { /* quota exceeded or unavailable */ }
    }
    loadProfile() {
        try {
            if (typeof localStorage === 'undefined')
                return;
            const raw = localStorage.getItem(this.storageKey);
            if (!raw)
                return;
            const parsed = JSON.parse(raw);
            if (isKidProfile(parsed)) {
                this.profile = parsed;
            }
        }
        catch ( /* ignore */_a) { /* ignore */ }
    }
    dispose() {
        this.saveProfile();
        this.profile = null;
    }
}
/* ── Type guard ───────────────────────────────────────────────── */
function isKidProfile(v) {
    if (typeof v !== 'object' || v === null)
        return false;
    const o = v;
    return typeof o.name === 'string' && typeof o.stars === 'number' && Array.isArray(o.earnedBadges);
}
const KID_DIFFICULTY_PRESETS = {
    explorer: {
        label: { en: 'Explorer', pl: 'Odkrywca', de: 'Entdecker' },
        emoji: '🔭',
        enabledCategories: ['motion', 'looks', 'events'],
        maxEntities: 10,
        showCodeView: false,
        showInspector: false,
        enablePhysics: false,
        enableScripting: false,
    },
    creator: {
        label: { en: 'Creator', pl: 'Twórca', de: 'Schöpfer' },
        emoji: '🎨',
        enabledCategories: ['motion', 'looks', 'events', 'control', 'sounds'],
        maxEntities: 25,
        showCodeView: false,
        showInspector: true,
        enablePhysics: true,
        enableScripting: false,
    },
    inventor: {
        label: { en: 'Inventor', pl: 'Wynalazca', de: 'Erfinder' },
        emoji: '🔧',
        enabledCategories: ['motion', 'looks', 'events', 'control', 'sensing', 'operators', 'sounds'],
        maxEntities: 50,
        showCodeView: true,
        showInspector: true,
        enablePhysics: true,
        enableScripting: true,
    },
    master: {
        label: { en: 'Master', pl: 'Mistrz', de: 'Meister' },
        emoji: '🏆',
        enabledCategories: ['motion', 'looks', 'events', 'control', 'sensing', 'operators', 'variables', 'sounds'],
        maxEntities: 200,
        showCodeView: true,
        showInspector: true,
        enablePhysics: true,
        enableScripting: true,
    },
};
/* ── Built-in Visual Blocks ───────────────────────────────────── */
const VISUAL_BLOCKS = [
    // Motion
    {
        id: 'move-right',
        category: 'motion',
        emoji: '➡️',
        label: { en: 'Move Right', pl: 'Idź w prawo', de: 'Rechts bewegen' },
        description: { en: 'Move the character to the right', pl: 'Przesuń postać w prawo', de: 'Bewege die Figur nach rechts' },
        params: [
            { name: 'speed', type: 'number', label: { en: 'Speed', pl: 'Prędkość', de: 'Geschwindigkeit' }, defaultValue: 5, min: 1, max: 20 },
        ],
        generatesAction: 'transform.x += params.speed',
        minAge: '6-8',
    },
    {
        id: 'move-left',
        category: 'motion',
        emoji: '⬅️',
        label: { en: 'Move Left', pl: 'Idź w lewo', de: 'Links bewegen' },
        description: { en: 'Move the character to the left', pl: 'Przesuń postać w lewo', de: 'Bewege die Figur nach links' },
        params: [
            { name: 'speed', type: 'number', label: { en: 'Speed', pl: 'Prędkość', de: 'Geschwindigkeit' }, defaultValue: 5, min: 1, max: 20 },
        ],
        generatesAction: 'transform.x -= params.speed',
        minAge: '6-8',
    },
    {
        id: 'move-up',
        category: 'motion',
        emoji: '⬆️',
        label: { en: 'Move Up', pl: 'Idź w górę', de: 'Nach oben' },
        description: { en: 'Move the character up', pl: 'Przesuń postać w górę', de: 'Bewege die Figur nach oben' },
        params: [
            { name: 'speed', type: 'number', label: { en: 'Speed', pl: 'Prędkość', de: 'Geschwindigkeit' }, defaultValue: 5, min: 1, max: 20 },
        ],
        generatesAction: 'transform.y -= params.speed',
        minAge: '6-8',
    },
    {
        id: 'move-down',
        category: 'motion',
        emoji: '⬇️',
        label: { en: 'Move Down', pl: 'Idź w dół', de: 'Nach unten' },
        description: { en: 'Move the character down', pl: 'Przesuń postać w dół', de: 'Bewege die Figur nach unten' },
        params: [
            { name: 'speed', type: 'number', label: { en: 'Speed', pl: 'Prędkość', de: 'Geschwindigkeit' }, defaultValue: 5, min: 1, max: 20 },
        ],
        generatesAction: 'transform.y += params.speed',
        minAge: '6-8',
    },
    {
        id: 'jump',
        category: 'motion',
        emoji: '🦘',
        label: { en: 'Jump!', pl: 'Skocz!', de: 'Springe!' },
        description: { en: 'Make the character jump', pl: 'Spraw, żeby postać skoczyła', de: 'Lass die Figur springen' },
        params: [
            { name: 'force', type: 'number', label: { en: 'Jump Force', pl: 'Siła skoku', de: 'Sprungkraft' }, defaultValue: 10, min: 5, max: 30 },
        ],
        generatesAction: 'rigidbody.velocity.y = -params.force',
        minAge: '6-8',
    },
    {
        id: 'rotate',
        category: 'motion',
        emoji: '🔄',
        label: { en: 'Rotate', pl: 'Obróć', de: 'Drehen' },
        description: { en: 'Rotate the character', pl: 'Obróć postać', de: 'Drehe die Figur' },
        params: [
            { name: 'degrees', type: 'number', label: { en: 'Degrees', pl: 'Stopnie', de: 'Grad' }, defaultValue: 15, min: 1, max: 360 },
        ],
        generatesAction: 'transform.rotation += params.degrees',
        minAge: '6-8',
    },
    // Looks
    {
        id: 'show',
        category: 'looks',
        emoji: '👁️',
        label: { en: 'Show', pl: 'Pokaż', de: 'Zeigen' },
        description: { en: 'Make visible', pl: 'Pokaż obiekt', de: 'Sichtbar machen' },
        params: [],
        generatesAction: 'sprite.visible = true',
        minAge: '6-8',
    },
    {
        id: 'hide',
        category: 'looks',
        emoji: '🙈',
        label: { en: 'Hide', pl: 'Ukryj', de: 'Verstecken' },
        description: { en: 'Make invisible', pl: 'Ukryj obiekt', de: 'Unsichtbar machen' },
        params: [],
        generatesAction: 'sprite.visible = false',
        minAge: '6-8',
    },
    {
        id: 'change-color',
        category: 'looks',
        emoji: '🎨',
        label: { en: 'Change Color', pl: 'Zmień kolor', de: 'Farbe ändern' },
        description: { en: 'Change the color', pl: 'Zmień kolor obiektu', de: 'Ändere die Farbe' },
        params: [
            { name: 'color', type: 'color', label: { en: 'Color', pl: 'Kolor', de: 'Farbe' }, defaultValue: '#ff0000' },
        ],
        generatesAction: 'sprite.color = params.color',
        minAge: '6-8',
    },
    {
        id: 'say',
        category: 'looks',
        emoji: '💬',
        label: { en: 'Say', pl: 'Powiedz', de: 'Sagen' },
        description: { en: 'Show a speech bubble', pl: 'Pokaż dymek z tekstem', de: 'Sprechblase zeigen' },
        params: [
            { name: 'text', type: 'string', label: { en: 'Text', pl: 'Tekst', de: 'Text' }, defaultValue: 'Hello!' },
        ],
        generatesAction: 'ui.showBubble(entity, params.text)',
        minAge: '6-8',
    },
    {
        id: 'grow',
        category: 'looks',
        emoji: '🔍',
        label: { en: 'Grow', pl: 'Powiększ', de: 'Vergrößern' },
        description: { en: 'Make bigger', pl: 'Powiększ obiekt', de: 'Größer machen' },
        params: [
            { name: 'amount', type: 'number', label: { en: 'Amount', pl: 'Ilość', de: 'Menge' }, defaultValue: 0.1, min: 0.01, max: 2 },
        ],
        generatesAction: 'transform.scaleX += params.amount; transform.scaleY += params.amount',
        minAge: '6-8',
    },
    // Events
    {
        id: 'when-start',
        category: 'events',
        emoji: '🏁',
        label: { en: 'When Game Starts', pl: 'Gdy gra się zaczyna', de: 'Wenn Spiel startet' },
        description: { en: 'Run when the game begins', pl: 'Uruchom gdy gra się rozpocznie', de: 'Ausführen, wenn das Spiel beginnt' },
        params: [],
        generatesAction: 'events.on("engine:started")',
        minAge: '6-8',
    },
    {
        id: 'when-key',
        category: 'events',
        emoji: '⌨️',
        label: { en: 'When Key Pressed', pl: 'Gdy naciśniesz klawisz', de: 'Wenn Taste gedrückt' },
        description: { en: 'Run when a key is pressed', pl: 'Uruchom po naciśnięciu klawisza', de: 'Ausführen, wenn Taste gedrückt' },
        params: [
            {
                name: 'key',
                type: 'dropdown',
                label: { en: 'Key', pl: 'Klawisz', de: 'Taste' },
                defaultValue: 'Space',
                options: [
                    { value: 'ArrowUp', label: { en: '↑ Up', pl: '↑ Góra', de: '↑ Oben' } },
                    { value: 'ArrowDown', label: { en: '↓ Down', pl: '↓ Dół', de: '↓ Unten' } },
                    { value: 'ArrowLeft', label: { en: '← Left', pl: '← Lewo', de: '← Links' } },
                    { value: 'ArrowRight', label: { en: '→ Right', pl: '→ Prawo', de: '→ Rechts' } },
                    { value: 'Space', label: { en: '␣ Space', pl: '␣ Spacja', de: '␣ Leertaste' } },
                ],
            },
        ],
        generatesAction: 'input.isKeyPressed(params.key)',
        minAge: '6-8',
    },
    {
        id: 'when-click',
        category: 'events',
        emoji: '👆',
        label: { en: 'When Clicked', pl: 'Gdy klikniesz', de: 'Wenn geklickt' },
        description: { en: 'Run when this object is clicked', pl: 'Uruchom po kliknięciu obiektu', de: 'Ausführen, wenn Objekt geklickt' },
        params: [],
        generatesAction: 'events.on("entity:clicked")',
        minAge: '6-8',
    },
    // Control
    {
        id: 'repeat',
        category: 'control',
        emoji: '🔁',
        label: { en: 'Repeat', pl: 'Powtórz', de: 'Wiederholen' },
        description: { en: 'Repeat blocks N times', pl: 'Powtórz bloki N razy', de: 'Blöcke N-mal wiederholen' },
        params: [
            { name: 'times', type: 'number', label: { en: 'Times', pl: 'Razy', de: 'Mal' }, defaultValue: 10, min: 1, max: 1000 },
        ],
        generatesAction: 'for(let i=0; i<params.times; i++)',
        minAge: '6-8',
    },
    {
        id: 'forever',
        category: 'control',
        emoji: '♾️',
        label: { en: 'Forever', pl: 'Zawsze', de: 'Immer' },
        description: { en: 'Repeat forever (every frame)', pl: 'Powtarzaj bez końca (co klatkę)', de: 'Immer wiederholen (jedes Frame)' },
        params: [],
        generatesAction: 'system.update',
        minAge: '6-8',
    },
    {
        id: 'if-then',
        category: 'control',
        emoji: '❓',
        label: { en: 'If...Then', pl: 'Jeśli...To', de: 'Wenn...Dann' },
        description: { en: 'Do something only if a condition is true', pl: 'Zrób coś tylko gdy warunek jest prawdziwy', de: 'Etwas nur tun, wenn Bedingung wahr' },
        params: [],
        generatesAction: 'if(condition)',
        minAge: '9-11',
    },
    {
        id: 'wait',
        category: 'control',
        emoji: '⏱️',
        label: { en: 'Wait', pl: 'Czekaj', de: 'Warten' },
        description: { en: 'Wait for some time', pl: 'Poczekaj chwilę', de: 'Eine Weile warten' },
        params: [
            { name: 'seconds', type: 'number', label: { en: 'Seconds', pl: 'Sekund', de: 'Sekunden' }, defaultValue: 1, min: 0.1, max: 60 },
        ],
        generatesAction: 'await wait(params.seconds)',
        minAge: '6-8',
    },
    // Sensing
    {
        id: 'touching',
        category: 'sensing',
        emoji: '🤝',
        label: { en: 'Touching?', pl: 'Dotyka?', de: 'Berührt?' },
        description: { en: 'Is this touching another object?', pl: 'Czy dotyka innego obiektu?', de: 'Berührt es ein anderes Objekt?' },
        params: [
            { name: 'target', type: 'entity', label: { en: 'Target', pl: 'Cel', de: 'Ziel' }, defaultValue: '' },
        ],
        generatesAction: 'physics.isTouching(entity, params.target)',
        minAge: '9-11',
    },
    {
        id: 'distance-to',
        category: 'sensing',
        emoji: '📏',
        label: { en: 'Distance To', pl: 'Odległość do', de: 'Abstand zu' },
        description: { en: 'How far is another object?', pl: 'Jak daleko jest inny obiekt?', de: 'Wie weit ist ein anderes Objekt?' },
        params: [
            { name: 'target', type: 'entity', label: { en: 'Target', pl: 'Cel', de: 'Ziel' }, defaultValue: '' },
        ],
        generatesAction: 'v2.dist(transform, targetTransform)',
        minAge: '9-11',
    },
    // Operators
    {
        id: 'random',
        category: 'operators',
        emoji: '🎲',
        label: { en: 'Random Number', pl: 'Losowa liczba', de: 'Zufallszahl' },
        description: { en: 'Pick a random number', pl: 'Wylosuj liczbę', de: 'Zufallszahl wählen' },
        params: [
            { name: 'min', type: 'number', label: { en: 'Min', pl: 'Min', de: 'Min' }, defaultValue: 1, min: -1e3, max: 1000 },
            { name: 'max', type: 'number', label: { en: 'Max', pl: 'Max', de: 'Max' }, defaultValue: 10, min: -1e3, max: 1000 },
        ],
        generatesAction: 'Math.random() * (params.max - params.min) + params.min',
        minAge: '9-11',
    },
    // Variables
    {
        id: 'set-score',
        category: 'variables',
        emoji: '🏆',
        label: { en: 'Set Score', pl: 'Ustaw wynik', de: 'Punktzahl setzen' },
        description: { en: 'Set the score value', pl: 'Ustaw wartość wyniku', de: 'Punktzahl-Wert setzen' },
        params: [
            { name: 'value', type: 'number', label: { en: 'Score', pl: 'Wynik', de: 'Punkte' }, defaultValue: 0, min: 0, max: 999999 },
        ],
        generatesAction: 'variables.score = params.value',
        minAge: '9-11',
    },
    {
        id: 'change-score',
        category: 'variables',
        emoji: '➕',
        label: { en: 'Change Score By', pl: 'Zmień wynik o', de: 'Punktzahl ändern um' },
        description: { en: 'Add to the score', pl: 'Dodaj do wyniku', de: 'Punktzahl erhöhen' },
        params: [
            { name: 'amount', type: 'number', label: { en: 'Amount', pl: 'Ilość', de: 'Menge' }, defaultValue: 1, min: -100, max: 100 },
        ],
        generatesAction: 'variables.score += params.amount',
        minAge: '9-11',
    },
];
/* ── Built-in Badges ──────────────────────────────────────────── */
const KID_BADGES = [
    {
        id: 'first-steps',
        emoji: '👶',
        name: { en: 'First Steps', pl: 'Pierwsze kroki', de: 'Erste Schritte' },
        description: { en: 'Complete your first tutorial', pl: 'Ukończ swój pierwszy samouczek', de: 'Schließe dein erstes Tutorial ab' },
        condition: { type: 'tutorials_completed', count: 1 },
    },
    {
        id: 'tutorial-master',
        emoji: '🎓',
        name: { en: 'Tutorial Master', pl: 'Mistrz samouczków', de: 'Tutorial-Meister' },
        description: { en: 'Complete 5 tutorials', pl: 'Ukończ 5 samouczków', de: 'Schließe 5 Tutorials ab' },
        condition: { type: 'tutorials_completed', count: 5 },
    },
    {
        id: 'game-creator',
        emoji: '🎮',
        name: { en: 'Game Creator', pl: 'Twórca gier', de: 'Spieleentwickler' },
        description: { en: 'Create your first game', pl: 'Stwórz swoją pierwszą grę', de: 'Erstelle dein erstes Spiel' },
        condition: { type: 'games_created', count: 1 },
    },
    {
        id: 'block-builder',
        emoji: '🧱',
        name: { en: 'Block Builder', pl: 'Budowniczy bloków', de: 'Blockbauer' },
        description: { en: 'Use 100 blocks', pl: 'Użyj 100 bloków', de: 'Verwende 100 Blöcke' },
        condition: { type: 'blocks_used', count: 100 },
    },
    {
        id: 'streak-3',
        emoji: '🔥',
        name: { en: '3-Day Streak!', pl: 'Seria 3 dni!', de: '3-Tage-Serie!' },
        description: { en: 'Use the engine 3 days in a row', pl: 'Używaj silnika 3 dni z rzędu', de: 'Verwende die Engine 3 Tage hintereinander' },
        condition: { type: 'days_active', count: 3 },
    },
    {
        id: 'streak-7',
        emoji: '⚡',
        name: { en: 'Week Warrior!', pl: 'Tygodniowy wojownik!', de: 'Wochenkrieger!' },
        description: { en: 'Use the engine 7 days in a row', pl: 'Używaj silnika 7 dni z rzędu', de: 'Verwende die Engine 7 Tage hintereinander' },
        condition: { type: 'days_active', count: 7 },
    },
    {
        id: 'prolific-creator',
        emoji: '🌟',
        name: { en: 'Prolific Creator', pl: 'Płodny twórca', de: 'Produktiver Schöpfer' },
        description: { en: 'Create 5 games', pl: 'Stwórz 5 gier', de: 'Erstelle 5 Spiele' },
        condition: { type: 'games_created', count: 5 },
    },
    {
        id: 'tutorial-legend',
        emoji: '👑',
        name: { en: 'Tutorial Legend', pl: 'Legenda samouczków', de: 'Tutorial-Legende' },
        description: { en: 'Complete 15 tutorials', pl: 'Ukończ 15 samouczków', de: 'Schließe 15 Tutorials ab' },
        condition: { type: 'tutorials_completed', count: 15 },
    },
];
/* ── Built-in Kid Sprites ─────────────────────────────────────── */
const KID_SPRITES = [
    { id: 'cat', name: { en: 'Cat', pl: 'Kot', de: 'Katze' }, category: 'animals', emoji: '🐱', assetPath: 'sprites/kids/cat', frameCount: 4, ageAppropriate: '6-8', tags: ['animal', 'pet'] },
    { id: 'dog', name: { en: 'Dog', pl: 'Pies', de: 'Hund' }, category: 'animals', emoji: '🐶', assetPath: 'sprites/kids/dog', frameCount: 4, ageAppropriate: '6-8', tags: ['animal', 'pet'] },
    { id: 'rabbit', name: { en: 'Rabbit', pl: 'Królik', de: 'Hase' }, category: 'animals', emoji: '🐰', assetPath: 'sprites/kids/rabbit', frameCount: 4, ageAppropriate: '6-8', tags: ['animal', 'pet'] },
    { id: 'bird', name: { en: 'Bird', pl: 'Ptak', de: 'Vogel' }, category: 'animals', emoji: '🐦', assetPath: 'sprites/kids/bird', frameCount: 4, ageAppropriate: '6-8', tags: ['animal', 'flying'] },
    { id: 'fish', name: { en: 'Fish', pl: 'Ryba', de: 'Fisch' }, category: 'animals', emoji: '🐟', assetPath: 'sprites/kids/fish', frameCount: 4, ageAppropriate: '6-8', tags: ['animal', 'water'] },
    { id: 'dragon', name: { en: 'Dragon', pl: 'Smok', de: 'Drache' }, category: 'fantasy', emoji: '🐉', assetPath: 'sprites/kids/dragon', frameCount: 6, ageAppropriate: '6-8', tags: ['fantasy', 'magic'] },
    { id: 'unicorn', name: { en: 'Unicorn', pl: 'Jednorożec', de: 'Einhorn' }, category: 'fantasy', emoji: '🦄', assetPath: 'sprites/kids/unicorn', frameCount: 4, ageAppropriate: '6-8', tags: ['fantasy', 'magic'] },
    { id: 'rocket', name: { en: 'Rocket', pl: 'Rakieta', de: 'Rakete' }, category: 'space', emoji: '🚀', assetPath: 'sprites/kids/rocket', frameCount: 3, ageAppropriate: '6-8', tags: ['space', 'vehicle'] },
    { id: 'car', name: { en: 'Car', pl: 'Samochód', de: 'Auto' }, category: 'vehicles', emoji: '🚗', assetPath: 'sprites/kids/car', frameCount: 2, ageAppropriate: '6-8', tags: ['vehicle', 'racing'] },
    { id: 'tree', name: { en: 'Tree', pl: 'Drzewo', de: 'Baum' }, category: 'nature', emoji: '🌳', assetPath: 'sprites/kids/tree', frameCount: 1, ageAppropriate: '6-8', tags: ['nature', 'plant'] },
    { id: 'star', name: { en: 'Star', pl: 'Gwiazdka', de: 'Stern' }, category: 'effects', emoji: '⭐', assetPath: 'sprites/kids/star', frameCount: 2, ageAppropriate: '6-8', tags: ['effect', 'collectible'] },
    { id: 'heart', name: { en: 'Heart', pl: 'Serce', de: 'Herz' }, category: 'effects', emoji: '❤️', assetPath: 'sprites/kids/heart', frameCount: 2, ageAppropriate: '6-8', tags: ['effect', 'health'] },
    { id: 'coin', name: { en: 'Coin', pl: 'Moneta', de: 'Münze' }, category: 'effects', emoji: '🪙', assetPath: 'sprites/kids/coin', frameCount: 4, ageAppropriate: '6-8', tags: ['effect', 'collectible'] },
    { id: 'knight', name: { en: 'Knight', pl: 'Rycerz', de: 'Ritter' }, category: 'people', emoji: '🤺', assetPath: 'sprites/kids/knight', frameCount: 6, ageAppropriate: '6-8', tags: ['people', 'fantasy'] },
    { id: 'wizard', name: { en: 'Wizard', pl: 'Czarodziej', de: 'Zauberer' }, category: 'fantasy', emoji: '🧙', assetPath: 'sprites/kids/wizard', frameCount: 4, ageAppropriate: '6-8', tags: ['fantasy', 'magic'] },
    { id: 'alien', name: { en: 'Alien', pl: 'Kosmita', de: 'Alien' }, category: 'space', emoji: '👽', assetPath: 'sprites/kids/alien', frameCount: 4, ageAppropriate: '6-8', tags: ['space', 'sci-fi'] },
    { id: 'ball', name: { en: 'Ball', pl: 'Piłka', de: 'Ball' }, category: 'sports', emoji: '⚽', assetPath: 'sprites/kids/ball', frameCount: 1, ageAppropriate: '6-8', tags: ['sports', 'toy'] },
    { id: 'castle', name: { en: 'Castle', pl: 'Zamek', de: 'Burg' }, category: 'buildings', emoji: '🏰', assetPath: 'sprites/kids/castle', frameCount: 1, ageAppropriate: '6-8', tags: ['building', 'fantasy'] },
    { id: 'house', name: { en: 'House', pl: 'Dom', de: 'Haus' }, category: 'buildings', emoji: '🏠', assetPath: 'sprites/kids/house', frameCount: 1, ageAppropriate: '6-8', tags: ['building'] },
    { id: 'apple', name: { en: 'Apple', pl: 'Jabłko', de: 'Apfel' }, category: 'food', emoji: '🍎', assetPath: 'sprites/kids/apple', frameCount: 1, ageAppropriate: '6-8', tags: ['food', 'collectible'] },
];

exports.DEFAULT_KID_MODE_CONFIG = DEFAULT_KID_MODE_CONFIG;
exports.KID_BADGES = KID_BADGES;
exports.KID_DIFFICULTY_PRESETS = KID_DIFFICULTY_PRESETS;
exports.KID_SPRITES = KID_SPRITES;
exports.KidModeManager = KidModeManager;
exports.VISUAL_BLOCKS = VISUAL_BLOCKS;
//# sourceMappingURL=KidMode.js.map
