// i18n.jsx — Eme localization (English · Français · العربية) + RTL (exported to window)

const LANGS = [
  { code: 'en', label: 'English',  native: 'English',  dir: 'ltr' },
  { code: 'fr', label: 'Français', native: 'Français', dir: 'ltr' },
  { code: 'ar', label: 'العربية',  native: 'العربية',  dir: 'rtl' },
];

const STRINGS = {
  en: {
    // nav
    nav_focus: 'Focus', nav_progress: 'Progress', nav_settings: 'Settings',
    // focus
    focus_session: 'FOCUS SESSION', current_level: 'Current Level', level_word: 'LEVEL',
    min_tap_change: '{n} MIN · TAP TO CHANGE', time_remaining: 'FOCUS TIME REMAINING',
    touch_anywhere_to_edit: 'Touch anywhere\nto edit',
    focus_in_progress: 'Focus In Progress', pomodoro_in_progress: 'Pomodoro In Progress', tracking_in_progress: 'Tracking In Progress',
    focus_paused: 'Focus Paused', pomodoro_paused: 'Pomodoro Paused', tracking_paused: 'Tracking Paused',
    // ── onboarding v2 ──
    onb_get_started: 'Get Started', onb_continue: 'Continue',
    onb1_title: 'Find your focus.\nBuild your momentum.',
    onb1_sub: 'A beautiful space designed to help you focus, stay consistent, and accomplish more every day.',
    onb2_title: 'What is your primary goal?',
    onb2_hint: "We'll personalize your experience based on your goals.",
    onb_goal_focus: 'Improve Focus', onb_goal_study: 'Study Better', onb_goal_deep: 'Deep Work',
    onb_goal_habits: 'Build Habits', onb_goal_distract: 'Reduce Distractions', onb_goal_productive: 'Be More Productive',
    onb3_title: 'How long can you comfortably focus?',
    onb3_hint: "We'll use this to suggest focus sessions that fit your habits.",
    onb_dur_lt15: 'Less than 15 min', onb_dur_15_30: '15–30 min', onb_dur_30_60: '30–60 min', onb_dur_gt60: 'More than 60 min',
    onb4_title: 'What helps you focus?',
    onb4_hint: 'Choose the atmosphere that helps you stay focused.',
    onb_amb_silence: 'Silence', onb_amb_rain: 'Rain', onb_amb_forest: 'Forest', onb_amb_ocean: 'Ocean', onb_amb_white: 'White Noise',
    onb5_title: 'Stay on track',
    onb5_sub: 'Enable notifications to receive reminders, maintain your streaks, and stay consistent with your focus goals.',
    onb_enable_notifs: 'Enable Notifications', onb_maybe_later: 'Maybe Later',
    onb_preview: 'Preview sound',
    hint_tap_play: 'Tap Play to start your first focus session.',
    pomo_break: 'Break', cycle_of: 'Cycle {n} of {total}',
    choose_mode: 'Timer Mode', start_focus: 'Start Focus',
    mode_standard: 'Standard', mode_standard_sub: 'A simple focus countdown',
    mode_count_up: 'Count-Up', mode_count_up_sub: 'Count upward from zero',
    mode_pomodoro: 'Pomodoro', mode_pomodoro_sub: 'Focus / break cycles · 4 rounds',
    duration: 'Duration', focus_break: 'Focus / Break', goal: 'Goal',
    no_limit: 'No limit', custom: 'Custom',
    custom_premium_hint: 'Custom durations are a Premium feature',
    nature: 'WHITE NOISE', stop: 'STOP', your_rank: 'Your Rank', focus_rank: 'Focus Rank',
    // white noise sheet
    ambient_sounds: 'White Noise', white_noise: 'White Noise', stop_sound: 'Stop sound',
    volume: 'Volume', ambience: 'Ambience',
    sound_rain: 'Rain', sound_ocean: 'Ocean', sound_forest: 'Forest',
    sound_wind: 'Wind', sound_night: 'Night', sound_fire: 'Fireplace',
    sound_coffee: 'Café', sound_classroom: 'Classroom', sound_library: 'Library',
    sound_stream: 'Stream', sound_train: 'Train', sound_whitenoise: 'White Noise',
    sound_brownnoise: 'Brown Noise', sound_pinknoise: 'Pink Noise', sound_thunder: 'Storm',
    sound_mountainwind: 'Mountain Wind', sound_clock: 'Clock', sound_countdown: 'Countdown',
    sound_deepspace: 'Deep Space', sound_nightforest: 'Night Forest',
    sound_campfire: 'Campfire', sound_desertwind: 'Desert Wind', sound_jungle: 'Jungle',
    sound_waterfall: 'Waterfall', sound_snowstorm: 'Snowstorm',
    // duration
    session_length: 'Session Length', minutes: '{m} minutes',
    quick: 'Focused', standard: 'Standard', deep: 'Deep Work',
    custom_min: 'Custom min', set: 'Set', save: 'Save', save_duration: 'Save this duration', saved: 'Saved',
    custom_duration: 'Custom Duration', custom_duration_sub: 'Any length, 1–300 min',
    saved_durations: 'SAVED DURATIONS', any_duration: 'Choose 1–300 minutes', minutes_short: 'min',
    // progress
    progress_title: 'Progress', total_focus_hours: 'total focus hours',
    progress_to: 'Progress to {name}', mastery_reached: 'Mastery reached', max_rank: 'Max Rank Reached',
    greet_morning: 'Good morning', greet_morning_s: 'Start fresh, stay focused.',
    greet_day: 'Good day', greet_day_s: 'Stay present, make it count.',
    greet_afternoon: 'Good afternoon', greet_afternoon_s: 'Keep going, you’re doing great.',
    greet_evening: 'Good evening', greet_evening_s: 'Unwind, reflect, and let go of the rest.',
    greet_night: 'Good night', greet_night_s: 'Rest well, you’ve done enough today.',
    evolution: 'Rank Evolution', level_short: 'LV', starting_tier: 'Starting tier', hours_count: '{n} hours',
    view_all: 'See all', next_target: 'Next', journey_sub: 'Your path from Spark to Crown',
    current_badge: 'CURRENT', statistics: 'Statistics',
    today: 'TODAY', this_week: 'THIS WEEK', this_month: 'THIS MONTH',
    sessions: 'SESSIONS', longest_session: 'LONGEST SESSION',
    min_unit: 'min', days_unit: 'days',
    current_streak: 'CURRENT STREAK', longest_streak: 'LONGEST STREAK',
    achievements: 'Achievements',
    ach_h1: 'First Hour', ach_h10: '10 Hours', ach_h50: '50 Hours', ach_h100: '100 Hours',
    ach_h300: '300 Hours', ach_h500: '500 Hours', ach_h1000: '1000 Hours',
    // settings
    settings_title: 'Settings', preferences: 'Preferences',
    notifications: 'Notifications', notifications_sub: 'Session reminders & milestones',
    sound_effects: 'Sound Effects', sound_effects_sub: 'Buttons, UI, achievement & success sounds',
    achievement_anims: 'Achievement Animations', achievement_anims_sub: 'Show celebration banners when milestones unlock',
    haptics: 'Haptics', haptics_sub: 'Subtle taps & feedback',
    show_progress: 'Show Progression Bar', show_progress_sub: 'Rank progress under the greeting',
    language: 'Language',
    developer: 'Developer',
    sync: 'Sync',
    notif_preview: 'Notification Preview', notif_preview_sub: 'See how alerts appear on device',
    data: 'Data',
    export_stats: 'Export Statistics', export_stats_sub: 'Download your focus history',
    backup: 'Backup & Restore', backup_sub: 'Sync progress to the cloud',
    reset_progress: 'Reset Progress', reset_progress_sub: 'Erase all hours & levels',
    version_line: 'Version 1.0 · Made for deep work',
    // toasts
    toast_stats_exported: 'Statistics exported', toast_backup_complete: 'Backup complete',
    toast_progress_reset: 'Progress reset',
    // level up
    evolution_caps: 'EVOLUTION', evolved_into: 'You have evolved into', continue: 'Continue',
    congrats: 'Congratulations', you_reached: 'You reached', hours_completed: '{n} Focus Hours Completed',
    // confirm reset
    reset_q: 'Reset all progress?',
    reset_body: 'This erases your hours, levels, streaks and achievements. This cannot be undone.',
    cancel: 'Cancel', reset: 'Reset',
    // notification preview
    np_title: 'Notification Preview', np_sub: 'For demonstration & development only',
    np_ios: 'iOS', np_android: 'Android', np_now: 'now', np_close: 'Done',
    np_lockscreen: 'Lock screen preview',
    n_start_title: 'Focus session started', n_start_body: 'Your {min}-minute session has begun. Stay present.',
    n_complete_title: 'Focus session complete', n_complete_body: 'Beautiful work. You focused for {min} minutes.',
    n_daily_title: 'Time to focus', n_daily_body: 'Your daily focus ritual awaits. Light the orb.',
    n_streak_title: 'Keep your streak alive', n_streak_body: "You're on a {days}-day streak. Don't break the chain.",
    n_ach_title: 'Achievement unlocked', n_ach_body: '{name} — you\u2019ve reached a new milestone.',
    n_weekly_title: 'Your week in focus', n_weekly_body: 'You focused {h}h this week — a calm, steady rhythm.',
    reminders: 'Reminders', reminders_sub: 'Quality over quantity — never spam',
    notif_daily: 'Daily Reminder', notif_daily_sub: 'At most once a day',
    notif_streak: 'Streak Reminder', notif_streak_sub: 'Only when your streak is at risk',
    notif_weekly: 'Weekly Summary', notif_weekly_sub: 'A gentle recap, once a week',
    notif_strategy: 'Curated, supportive, never intrusive.',
    // tags
    tag_spark: 'The first light.', tag_ember: 'A steady warmth.', tag_flame: 'Burning brighter.', tag_pulse: 'Momentum builds.', tag_focus: 'Fully locked in.', tag_flow: 'Carried by the current.', tag_glow: 'A calm radiance.', tag_crystal: 'Clear and unbroken.', tag_titan: 'Immense and steady.', tag_champion: 'Proven in the work.', tag_master: 'Effortless command.', tag_grandmaster: 'Mastery refined.', tag_mythic: 'Beyond the ordinary.', tag_crown: 'The summit. Max rank.', tag_legend: 'Mastery, earned.',
    tag_aura: 'A first glimmer of focus.', tag_halo: 'Light gathers and holds.',
    tag_radiant: 'Focus becomes warmth.', tag_nova: 'A quiet brilliance ignites.',
    tag_astral: 'Drifting into deeper calm.', tag_nebula: 'Vast, slow, luminous.',
    tag_stellar: 'Steady as a fixed star.', tag_celestial: 'Aligned with something larger.',
    tag_cosmic: 'Expanding beyond the self.', tag_eternal: 'A flame that does not flicker.',
    tag_ascendant: 'Rising past every limit.', tag_infinite: 'No edges remain.',
    tag_transcendent: 'Pure presence.',
    // sphere / level
    current_level: 'Current Level',
    sphere_reached: 'Your Sphere has reached',
    // premium
    premium: 'PREMIUM', free_badge: 'FREE', locked: 'Locked',
    unlock_with_premium: 'Unlock with Premium',
    premium_eyebrow: 'EMEO PREMIUM',
    premium_title: 'Go deeper with Premium',
    premium_sub: 'Every sound, every insight, every goal — unlocked.',
    premium_cta: 'Unlock Premium',
    premium_continue: 'Subscribe · {price}/month',
    premium_includes: "What\u2019s included",
    premium_maybe: 'Maybe later', premium_restore: 'Restore purchase',
    premium_terms: 'Cancel anytime. Billed monthly at {price}/month.',
    premium_active: 'Premium active', per_month: '/month', per_year: '/year',
    plan_annual: 'Annual', plan_monthly: 'Monthly', best_value: 'BEST VALUE',
    months_free: '{n} months free', save_annual: 'Save with annual billing',
    premium_continue_year: 'Subscribe · {price}/year',
    premium_terms_year: 'Cancel anytime. Billed annually at {price}/year.',
    toast_subscribed: 'Welcome to Emeo Premium',
    toast_restoring: 'Restoring your purchases…',
    perk_sounds: 'Access to all Premium White Noise',
    perk_focus_shield: 'Focus Shield — block distracting apps & sites',
    perk_tags: 'Unlimited tags & projects',
    perk_analytics: 'Advanced analytics & insights',
    perk_heatmap: 'Full focus heatmap history',
    perk_widgets: 'Home & lock-screen widgets',
    perk_auto_protect: 'Automatic streak protection',
    // ── V3 features ──
    // Onboarding V5
    obv_continue: 'Continue',
    ob1_q: 'What would you like to improve?', ob1_sub: 'Choose one or more goals.',
    ob1_a1: 'Stay Focused Longer', ob1_a2: 'Reduce Distractions', ob1_a3: 'Build Discipline', ob1_a4: 'Study More Effectively', ob1_a5: 'Work More Efficiently',
    ob2_q: 'How long can you usually stay focused?',
    ob2_a1: 'Less Than 15 Minutes', ob2_a2: '15–30 Minutes', ob2_a3: '30–60 Minutes', ob2_a4: 'More Than 1 Hour',
    ob3_q: 'What do you focus on most often?',
    ob3_a1: 'Work', ob3_a2: 'Studies', ob3_a3: 'Reading', ob3_a4: 'Personal Projects', ob3_a5: 'Other',
    ob4_q: 'Choose Your First Milestone', ob4_sub: 'Every great habit starts with a target.',
    ob4_d5: 'A strong start.', ob4_d35: 'Your first real achievement.', ob4_d75: 'Building consistency.', ob4_d150: 'A true focus habit.',
    ob_hours: '{n} Hours',
    ob5_title: 'Start Your First Focus Session', ob5_sub: 'Small sessions become lasting habits.',
    ob5_m1: '25 Min Pomodoro', ob5_m2: '50 Min Deep Focus', ob5_m3: 'Count Up',
    ob_start_session: 'Start Session', ob_maybe_later: 'Maybe Later',
    focus_blocking: 'Focus & Blocking',
    project: 'Project', add_tag: 'New tag', tag_name: 'Tag name', tags_limit_hint: 'Unlimited tags on Premium',
    focus_shield: 'Focus Shield',
    focus_shield_sub: 'Block apps & sites',
    focus_shield_desc: 'Block distracting apps & websites automatically during your focus sessions.',
    block_during_sessions: 'Block during sessions',
    shield_on: 'On — activates when a session starts', shield_off: 'Off',
    what_to_block: 'WHAT TO BLOCK',
    shield_block_all: 'Block Everything', shield_block_all_sub: 'All common distracting apps & sites',
    shield_custom: 'Custom Blocking', shield_custom_sub: 'Choose exactly what to block',
    block_presets: 'BLOCK PRESETS', sites_count: '{n} sites', blocked_sites: 'Blocked sites',
    site_placeholder: 'e.g. instagram.com', add: 'Add',
    shield_apps_note: 'App blocking (Instagram, TikTok…) is set up on your device in the Emeo mobile app.',
    shield_native_note: 'Enforcement runs in the Emeo mobile app — configure it here and it activates automatically on device.',
    widgets_live: 'Widgets & Live Activities', widgets_sub: 'Home, lock screen & Dynamic Island',
    widgets_desc: 'Keep your focus and streak visible at a glance.',
    home_widget: 'Home Screen Widget', home_widget_sub: "Today's focus & streak",
    lock_widget: 'Lock Screen Widget', lock_widget_sub: 'Glanceable focus stats',
    live_activity: 'Live Activity & Dynamic Island', live_activity_sub: 'Live session timer',
    widgets_native_note: 'Widgets render on your device via the Emeo mobile app.',
    streak_protection: 'Streak Protection', freeze_available: '{n} freeze available',
    auto_protect: 'Auto-protect streak', freeze_used: 'Streak protected', no_freeze: 'No freeze tokens',
    focus_heatmap: 'Focus Heatmap', last_7_days: 'Last 7 days', heatmap_full_hint: 'Full month & year history on Premium',
    by_project: 'By Project', no_project_data: 'Complete a session to see your project breakdown.',
    more_goals_premium: 'Add weekly & monthly goals with Premium',
    perk_weekly: 'Weekly statistics',
    perk_monthly: 'Monthly statistics',
    perk_streaks: 'Focus streak tracking',
    perk_charts: 'Progress charts',
    perk_goals_achieved: 'Goals achieved tracking',
    perk_custom_goals: 'Weekly & monthly goals (1 daily goal free)',
    perk_daily_goal: 'Daily goal tracking',
    perk_weekly_goal: 'Weekly goal tracking',
    perk_auto_track: 'Automatic goal tracking',
    perk_sync: 'Multi-device sync',
    perk_custom_duration: 'Custom focus duration (1–300 min)',
    perk_future: 'All future premium features',
    // locked progress stats
    advanced_stats: 'Advanced Statistics',
    weekly_focus: 'Weekly Focus Time', monthly_focus: 'Monthly Focus Time',
    focus_streaks: 'Focus Streaks', progress_charts: 'Progress Charts', goals_achieved: 'Goals Achieved',
    weekly_activity: 'Weekly Activity', wk_total: '{h}h {m}m this week', wk_last7: 'Focus over the last 7 days', focus_word: 'focus',
    monthly_activity: 'Monthly Activity', avg_per_day: 'Average per day', act_total: 'Total', mo_last4: 'Focus over the last 4 weeks', act_week_n: 'Week {n}', week_abbr: 'W',
    activity_wk_mo: 'Weekly / Monthly Activity',
    // custom goals
    custom_goals: 'Custom Goals', custom_goals_sub: 'Set daily & weekly focus targets',
    daily_goal: 'Daily goal', weekly_goal: 'Weekly goal',
    goal_today: 'Today', goal_week: 'This week', goal_reached: 'Goal reached',
    // multi-device sync
    multi_sync: 'Multi-Device Sync', multi_sync_sub: 'Phone & tablet, always in sync',
    pair_intro: 'Sync your progress to another device — no account, no login.',
    pair_show_btn: 'Show a pairing code', pair_show_btn_sub: 'On the device that has your data',
    pair_enter_btn: 'Enter a code', pair_enter_btn_sub: 'On the new device you want to sync',
    pair_show_hint: 'On your other device, open Settings → Multi-Device Sync → “Enter a code”, then type this:',
    pair_expires: 'This code expires in 5 minutes and can be used once.',
    pair_enter_hint: 'Type the code shown on your other device.',
    pair_input_ph: 'PAIRING CODE',
    pair_link: 'Link device', pair_linking: 'Linking…', pair_back: 'Back',
    pair_linked: 'Linked! Your devices now share progress.',
    pair_err_gen: 'Could not create a code. Check your connection.',
    pair_err_code: 'Enter the full code.',
    pair_err_invalid: 'Invalid or expired code — generate a new one.',
    // level tags
    tag_zenith: 'The summit of stillness.', tag_eclipse: 'Light folds into shadow.',
    tag_apex: 'Nothing lies beyond.', tag_luminary: 'You have become the light.',
    // phrases
    phrases: ['Deep focus. Pure flow.', 'Let the world go quiet.', 'One breath. One task.',
      'Stillness is a skill.', 'You are exactly here.', 'Let the light gather.', 'Presence over pressure.'],
    // quotes (in-session) + personalized quotes (premium)
    perk_quotes: 'Personalized motivational quotes',
    quotes_label: 'Motivational Quotes', quotes_sub: 'Gentle words during your sessions',
    personalized_quotes: 'Personalized Quotes', personalized_quotes_sub: 'Write quotes that speak to your goals',
    quotes_manage_title: 'Personalized Quotes',
    quotes_manage_intro: 'Craft the words that meet you in deep focus.',
    quote_source: 'What appears in sessions',
    qsrc_system: 'Emeo', qsrc_custom: 'Yours', qsrc_mix: 'Both',
    qsrc_system_sub: 'Our curated phrases', qsrc_custom_sub: 'Only your quotes', qsrc_mix_sub: 'Yours & ours, woven together',
    your_quotes: 'Your Quotes', quote_count: '{n} saved',
    add_quote: 'Add a quote', quote_placeholder: 'Write something that centers you…',
    quote_add_cta: 'Add', no_custom_quotes: 'No personal quotes yet. Add one above to make focus feel like yours.',
    quote_empty_hint: 'Add a quote to use this mode.',
    toast_quote_added: 'Quote added', toast_quote_saved: 'Quote updated', toast_quote_deleted: 'Quote removed',
    // onboarding
    ob_skip: 'Skip',
    ob1_eyebrow: 'WELCOME TO EMEO', ob1_title: 'Focus begins within.',
    ob1_body: 'A calm space built around a single living Sphere — your focus, made visible.',
    ob2_eyebrow: 'HOW IT WORKS', ob2_title: 'Build focus through intentional sessions and watch your Sphere evolve.',
    ob2_body: 'Every hour of deep focus deepens its light and carries it toward a new level.',
    ob3_eyebrow: 'STAY CONSISTENT', ob3_title: 'Stay consistent with gentle reminders.',
    ob3_body: 'A single quiet nudge when it helps — never noise. You can change this anytime.',
    ob_next: 'Continue', ob_enable: 'Enable Notifications', ob_begin: 'Enter Emeo',
    ob_not_now: 'Not now', toast_reminders_on: 'Gentle reminders enabled',
    // session complete
    sc_title: 'Session Complete', sc_sub: 'Beautifully done. Your focus held.',
    sc_session: 'This session', sc_today: 'Focused today', sc_done: 'Done',
    session_history: 'Session History', session_history_sub: 'Every completed focus session',
    share_session: 'Share Session', share_focused: 'Focused for {n} minutes', share_generated: 'Generated with Emeo',
    sess_focus: 'Focus Session', sess_pomodoro: 'Pomodoro', sess_countup: 'Count Up',
    hist_today: 'Today', hist_yesterday: 'Yesterday', hist_search: 'Search sessions',
    hist_all: 'All', hist_range_all: 'All time', hist_range_week: '7 days', hist_range_month: '30 days',
    hist_empty: 'No sessions yet — your completed sessions will appear here.',
    hist_delete: 'Delete', hist_clear: 'Clear history', hist_clear_confirm: 'Tap again to clear everything',
    hist_total_sessions: 'Sessions', hist_total_time: 'Total', hist_longest: 'Longest', hist_streak: 'Streak', hist_best_day: 'Best day',
    // achievement banner
    ab_unlocked: 'Achievement unlocked',
    // share
    share: 'Share', share_title: 'Share your focus', share_caption: 'of focus with Emeo',
    share_streak_label: 'day streak', share_level_label: 'Your Rank', toast_share_ready: 'Share card ready',
    share_total: 'total hours', share_sessions: 'sessions',
    // review
    rv_title: 'Enjoying Emeo?', rv_body: 'A quick rating helps more people find their focus.',
    rv_rate: 'Rate Emeo', rv_later: 'Maybe later', rv_never: "Don't ask again", toast_review_thanks: 'Thank you for the support',
    // settings extras
    replay_intro: 'Replay Intro', replay_intro_sub: 'See the welcome tour again',
    share_progress: 'Share Progress', share_progress_sub: 'A card for your focus milestones',
    // empty states
    empty_journey: 'Your journey begins today.',
    empty_hours_sub: 'Complete your first focus session to start growing your Sphere.',
    empty_ach: 'Your first achievement is waiting for you.',
    ach_progress: '{n} of {total} unlocked',
    ach_unlocked_on: 'Unlocked · {date}', ach_locked: 'Locked',
    ach_g_mastery: 'Timer Mastery', ach_g_consistency: 'Consistency', ach_g_sessions: 'Sessions',
    ach_g_challenge: 'Focus Challenges', ach_g_premium: 'Premium', ach_g_sharing: 'Sharing & Community',
    rar_common: 'Common', rar_rare: 'Rare', rar_epic: 'Epic', rar_legendary: 'Legendary',
    empty_stats: 'Your stats will appear here after your first session.',
    empty_streak: 'Begin today and your streak starts counting.',
  },
  fr: {
    nav_focus: 'Focus', nav_progress: 'Progression', nav_settings: 'Réglages',
    focus_session: 'SESSION DE FOCUS', current_level: 'Niveau actuel', level_word: 'NIVEAU',
    min_tap_change: '{n} MIN · TOUCHEZ POUR MODIFIER', time_remaining: 'TEMPS DE FOCUS RESTANT',
    touch_anywhere_to_edit: 'Touchez\npour modifier',
    focus_in_progress: 'Focus en cours', pomodoro_in_progress: 'Pomodoro en cours', tracking_in_progress: 'Suivi en cours',
    focus_paused: 'Focus en pause', pomodoro_paused: 'Pomodoro en pause', tracking_paused: 'Suivi en pause',
    // ── onboarding v2 ──
    onb_get_started: 'Commencer', onb_continue: 'Continuer',
    onb1_title: 'Trouvez votre focus.\nCréez votre élan.',
    onb1_sub: 'Un espace élégant conçu pour vous aider à vous concentrer, rester régulier et accomplir plus chaque jour.',
    onb2_title: 'Quel est votre objectif principal ?',
    onb2_hint: 'Nous personnaliserons votre expérience selon vos objectifs.',
    onb_goal_focus: 'Améliorer le focus', onb_goal_study: 'Mieux étudier', onb_goal_deep: 'Travail profond',
    onb_goal_habits: 'Créer des habitudes', onb_goal_distract: 'Réduire les distractions', onb_goal_productive: 'Être plus productif',
    onb3_title: 'Combien de temps pouvez-vous vous concentrer ?',
    onb3_hint: 'Nous l’utiliserons pour suggérer des sessions adaptées à vos habitudes.',
    onb_dur_lt15: 'Moins de 15 min', onb_dur_15_30: '15–30 min', onb_dur_30_60: '30–60 min', onb_dur_gt60: 'Plus de 60 min',
    onb4_title: 'Qu’est-ce qui vous aide à vous concentrer ?',
    onb4_hint: 'Choisissez l’atmosphère qui vous aide à rester concentré.',
    onb_amb_silence: 'Silence', onb_amb_rain: 'Pluie', onb_amb_forest: 'Forêt', onb_amb_ocean: 'Océan', onb_amb_white: 'Bruit blanc',
    onb5_title: 'Gardez le cap',
    onb5_sub: 'Activez les notifications pour recevoir des rappels, garder vos séries et rester régulier dans vos objectifs.',
    onb_enable_notifs: 'Activer les notifications', onb_maybe_later: 'Plus tard',
    onb_preview: 'Écouter le son',
    hint_tap_play: 'Appuyez sur Lecture pour démarrer votre première session.',
    pomo_break: 'Pause', cycle_of: 'Cycle {n} sur {total}',
    choose_mode: 'Mode de minuterie', start_focus: 'Lancer le focus',
    mode_standard: 'Standard', mode_standard_sub: 'Un simple compte à rebours',
    mode_count_up: 'Compteur', mode_count_up_sub: 'Compter à partir de zéro',
    mode_pomodoro: 'Pomodoro', mode_pomodoro_sub: 'Cycles focus / pause · 4 tours',
    duration: 'Durée', focus_break: 'Focus / Pause', goal: 'Objectif',
    no_limit: 'Sans limite', custom: 'Personnalisé',
    custom_premium_hint: 'Les durées personnalisées sont une fonction Premium',
    nature: 'BRUIT BLANC', stop: 'ARRÊT', your_rank: 'Votre rang', focus_rank: 'Rang de Focus',
    ambient_sounds: 'Bruit blanc', white_noise: 'Bruit blanc', stop_sound: 'Arrêter le son',
    volume: 'Volume', ambience: 'Ambiance',
    sound_rain: 'Pluie', sound_ocean: 'Vagues', sound_forest: 'Forêt',
    sound_wind: 'Vent', sound_night: 'Grillons', sound_fire: 'Cheminée',
    sound_coffee: 'Café', sound_classroom: 'Salle de classe', sound_library: 'Bibliothèque',
    sound_stream: 'Ruisseau', sound_train: 'Train', sound_whitenoise: 'Bruit blanc',
    sound_brownnoise: 'Bruit brun', sound_pinknoise: 'Bruit rose', sound_thunder: 'Orage',
    sound_mountainwind: 'Vent de montagne', sound_clock: 'Tic-tac', sound_countdown: 'Compte à rebours',
    sound_deepspace: 'Espace profond', sound_nightforest: 'Forêt de nuit',
    sound_campfire: 'Feu de camp', sound_desertwind: 'Vent du désert', sound_jungle: 'Jungle',
    sound_waterfall: 'Cascade', sound_snowstorm: 'Tempête de neige',
    session_length: 'Durée de session', minutes: '{m} minutes',
    quick: 'Concentré', standard: 'Standard', deep: 'Travail profond',
    custom_min: 'Minutes perso', set: 'Définir', save: 'Enregistrer',
    custom_duration: 'Durée personnalisée', custom_duration_sub: 'Toute durée, 1–300 min',
    saved_durations: 'DURÉES ENREGISTRÉES', any_duration: 'Choisir 1 à 300 minutes', minutes_short: 'min',
    progress_title: 'Progression', total_focus_hours: 'heures de focus au total',
    progress_to: 'Progression vers {name}', mastery_reached: 'Maîtrise atteinte', max_rank: 'Rang maximum atteint',
    greet_morning: 'Bonjour', greet_morning_s: 'Commence en douceur, reste concentré.',
    greet_day: 'Bonne journée', greet_day_s: 'Reste présent, fais que ça compte.',
    greet_afternoon: 'Bon après-midi', greet_afternoon_s: 'Continue, tu fais du très bon travail.',
    greet_evening: 'Bonsoir', greet_evening_s: 'Détends-toi, prends du recul, lâche prise.',
    greet_night: 'Bonne nuit', greet_night_s: 'Repose-toi bien, tu en as assez fait aujourd’hui.',
    evolution: 'Évolution du rang', level_short: 'NIV', starting_tier: 'Palier de départ', hours_count: '{n} heures',
    view_all: 'Tout voir', next_target: 'Suivant', journey_sub: 'Votre parcours de Spark à Crown',
    current_badge: 'ACTUEL', statistics: 'Statistiques',
    today: 'AUJOURD\u2019HUI', this_week: 'CETTE SEMAINE', this_month: 'CE MOIS',
    sessions: 'SESSIONS', longest_session: 'SESSION LA PLUS LONGUE',
    min_unit: 'min', days_unit: 'jours',
    current_streak: 'SÉRIE ACTUELLE', longest_streak: 'SÉRIE LA PLUS LONGUE',
    achievements: 'Réalisations',
    ach_h1: 'Première heure', ach_h10: '10 heures', ach_h50: '50 heures', ach_h100: '100 heures',
    ach_h300: '300 heures', ach_h500: '500 heures', ach_h1000: '1000 heures',
    settings_title: 'Réglages', preferences: 'Préférences',
    notifications: 'Notifications', notifications_sub: 'Rappels de session & jalons',
    sound_effects: 'Effets sonores', sound_effects_sub: 'Boutons, interface, succ\u00e8s & r\u00e9ussites',
    achievement_anims: 'Animations de r\u00e9ussite', achievement_anims_sub: 'Afficher les banni\u00e8res de c\u00e9l\u00e9bration aux paliers',
    haptics: 'Retour haptique', haptics_sub: 'Vibrations subtiles',
    show_progress: 'Afficher la barre de progression', show_progress_sub: 'Progression du rang sous la salutation',
    language: 'Langue',
    developer: 'Développeur',
    sync: 'Synchronisation',
    notif_preview: 'Aperçu des notifications', notif_preview_sub: 'Voir l\u2019apparence des alertes',
    data: 'Données',
    export_stats: 'Exporter les statistiques', export_stats_sub: 'Télécharger votre historique',
    backup: 'Sauvegarde & restauration', backup_sub: 'Synchroniser vers le cloud',
    reset_progress: 'Réinitialiser', reset_progress_sub: 'Effacer heures & niveaux',
    version_line: 'Version 1.0 · Conçu pour le travail profond',
    toast_stats_exported: 'Statistiques exportées', toast_backup_complete: 'Sauvegarde terminée',
    toast_progress_reset: 'Progression réinitialisée',
    evolution_caps: 'ÉVOLUTION', evolved_into: 'Vous avez évolué en', continue: 'Continuer',
    congrats: 'Félicitations', you_reached: 'Vous avez atteint', hours_completed: '{n} heures de focus accomplies',
    reset_q: 'Tout réinitialiser ?',
    reset_body: 'Cela efface vos heures, niveaux, séries et réalisations. Action irréversible.',
    cancel: 'Annuler', reset: 'Réinitialiser',
    np_title: 'Aperçu des notifications', np_sub: 'Démonstration & développement uniquement',
    np_ios: 'iOS', np_android: 'Android', np_now: 'maintenant', np_close: 'Terminé',
    np_lockscreen: 'Aperçu écran verrouillé',
    n_start_title: 'Session de focus démarrée', n_start_body: 'Votre session de {min} minutes a commencé. Restez présent.',
    n_complete_title: 'Session de focus terminée', n_complete_body: 'Beau travail. Vous avez été concentré {min} minutes.',
    n_daily_title: 'C\u2019est l\u2019heure de se concentrer', n_daily_body: 'Votre rituel quotidien vous attend. Allumez l\u2019orbe.',
    n_streak_title: 'Maintenez votre série', n_streak_body: 'Série de {days} jours en cours. Ne la brisez pas.',
    n_ach_title: 'Réalisation débloquée', n_ach_body: '{name} — nouveau jalon atteint.',
    n_weekly_title: 'Votre semaine de focus', n_weekly_body: 'Vous avez été concentré {h}h cette semaine — un rythme calme et régulier.',
    reminders: 'Rappels', reminders_sub: 'La qualité avant la quantité — jamais de spam',
    notif_daily: 'Rappel quotidien', notif_daily_sub: 'Au plus une fois par jour',
    notif_streak: 'Rappel de série', notif_streak_sub: 'Seulement quand la série est en danger',
    notif_weekly: 'Résumé hebdomadaire', notif_weekly_sub: 'Un récap en douceur, une fois par semaine',
    notif_strategy: 'Pensé, bienveillant, jamais intrusif.',
    tag_spark: 'La première étincelle.', tag_ember: 'Une chaleur constante.', tag_flame: 'Briller plus fort.', tag_pulse: 'L’élan se construit.', tag_focus: 'Pleinement concentré.', tag_flow: 'Porté par le flux.', tag_glow: 'Un rayonnement calme.', tag_crystal: 'Clair et intact.', tag_titan: 'Immense et stable.', tag_champion: 'Éprouvé par le travail.', tag_master: 'Une maîtrise naturelle.', tag_grandmaster: 'La maîtrise affinée.', tag_mythic: 'Au-delà de l’ordinaire.', tag_crown: 'Le sommet. Rang max.', tag_legend: 'La maîtrise, acquise.',
    tag_aura: 'Une première lueur de concentration.', tag_halo: 'La lumière se rassemble et persiste.',
    tag_radiant: 'Le focus devient chaleur.', tag_nova: 'Un éclat tranquille s\u2019allume.',
    tag_astral: 'Glisser vers un calme plus profond.', tag_nebula: 'Vaste, lent, lumineux.',
    tag_stellar: 'Stable comme une étoile fixe.', tag_celestial: 'Aligné avec plus grand que soi.',
    tag_cosmic: 'S\u2019étendre au-delà de soi.', tag_eternal: 'Une flamme qui ne vacille pas.',
    tag_ascendant: 'S\u2019élever au-delà de toute limite.', tag_infinite: 'Plus aucune limite.',
    tag_transcendent: 'Présence pure.',
    sphere_reached: 'Votre Sphère a atteint',
    premium: 'PREMIUM', free_badge: 'GRATUIT', locked: 'Verrouillé',
    unlock_with_premium: 'Débloquer avec Premium',
    premium_eyebrow: 'EMEO PREMIUM',
    premium_title: 'Allez plus loin avec Premium',
    premium_sub: 'Tous les sons, toutes les statistiques, tous les objectifs — débloqués.',
    premium_cta: 'Débloquer Premium',
    premium_continue: 'S\u2019abonner · {price}/mois',
    premium_includes: 'Ce qui est inclus',
    premium_maybe: 'Plus tard', premium_restore: 'Restaurer l\u2019achat',
    premium_terms: 'Annulable à tout moment. Facturé {price}/mois.',
    premium_active: 'Premium actif', per_month: '/mois', per_year: '/an',
    plan_annual: 'Annuel', plan_monthly: 'Mensuel', best_value: 'MEILLEURE OFFRE',
    months_free: '{n} mois offerts', save_annual: 'Économisez avec le forfait annuel',
    premium_continue_year: 'S’abonner · {price}/an',
    premium_terms_year: 'Annulable à tout moment. Facturé {price}/an.',
    toast_subscribed: 'Bienvenue dans Emeo Premium',
    toast_restoring: 'Restauration de tes achats…',
    perk_sounds: 'Accès à tous les bruits blancs Premium',
    perk_focus_shield: 'Focus Shield — bloque les apps & sites distrayants',
    perk_tags: 'Tags & projets illimités',
    perk_analytics: 'Analyses & insights avancés',
    perk_heatmap: 'Historique complet de la heatmap',
    perk_widgets: 'Widgets écran d’accueil & verrouillage',
    perk_auto_protect: 'Protection automatique des séries',
    perk_weekly: 'Statistiques hebdomadaires',
    perk_monthly: 'Statistiques mensuelles',
    perk_streaks: 'Suivi des séries',
    perk_charts: 'Graphiques de progression',
    perk_goals_achieved: 'Suivi des objectifs atteints',
    perk_custom_goals: 'Objectifs personnalisés',
    perk_daily_goal: 'Objectif quotidien',
    perk_weekly_goal: 'Objectif hebdomadaire',
    perk_auto_track: 'Suivi automatique',
    perk_sync: 'Sync multi-appareils',
    perk_custom_duration: 'Durée personnalisée (1–300 min)',
    perk_future: 'Toutes les futures fonctions premium',
    advanced_stats: 'Statistiques avancées',
    weekly_focus: 'Focus hebdomadaire', monthly_focus: 'Focus mensuel',
    focus_streaks: 'Séries de focus', progress_charts: 'Graphiques', goals_achieved: 'Objectifs atteints',
    weekly_activity: 'Activité hebdomadaire', wk_total: '{h}h {m}m cette semaine', wk_last7: 'Focus des 7 derniers jours', focus_word: 'focus',
    monthly_activity: 'Activité mensuelle', avg_per_day: 'Moyenne par jour', act_total: 'Total', mo_last4: 'Focus des 4 dernières semaines', act_week_n: 'Semaine {n}', week_abbr: 'S',
    activity_wk_mo: 'Activité hebdomadaire / Mensuelle',
    custom_goals: 'Objectifs personnalisés', custom_goals_sub: 'Cibles quotidiennes & hebdomadaires',
    daily_goal: 'Objectif quotidien', weekly_goal: 'Objectif hebdo',
    goal_today: 'Aujourd\u2019hui', goal_week: 'Cette semaine', goal_reached: 'Objectif atteint',
    multi_sync: 'Sync multi-appareils', multi_sync_sub: 'Téléphone & tablette, toujours synchronisés',
    pair_intro: 'Synchronise ta progression vers un autre appareil — sans compte, sans connexion.',
    pair_show_btn: 'Afficher un code', pair_show_btn_sub: 'Sur l’appareil qui a tes données',
    pair_enter_btn: 'Saisir un code', pair_enter_btn_sub: 'Sur le nouvel appareil à synchroniser',
    pair_show_hint: 'Sur l’autre appareil : Réglages → Sync multi-appareils → « Saisir un code », puis tape ceci :',
    pair_expires: 'Ce code expire dans 5 minutes et n’est utilisable qu’une fois.',
    pair_enter_hint: 'Saisis le code affiché sur ton autre appareil.',
    pair_input_ph: 'CODE',
    pair_link: 'Lier l’appareil', pair_linking: 'Liaison…', pair_back: 'Retour',
    pair_linked: 'Lié ! Tes appareils partagent maintenant la progression.',
    pair_err_gen: 'Impossible de créer un code. Vérifie ta connexion.',
    pair_err_code: 'Saisis le code complet.',
    pair_err_invalid: 'Code invalide ou expiré — génères-en un nouveau.',
    tag_zenith: 'Le sommet de la quiétude.', tag_eclipse: 'La lumière se plie à l\u2019ombre.',
    tag_apex: 'Rien au-delà.', tag_luminary: 'Vous êtes devenu la lumière.',
    phrases: ['Focus profond. Flux pur.', 'Laissez le monde se taire.', 'Un souffle. Une tâche.',
      'Le calme est un art.', 'Vous êtes exactement ici.', 'Laissez la lumière se rassembler.', 'Présence plutôt que pression.'],
    // quotes
    perk_quotes: 'Citations de motivation personnalisées',
    quotes_label: 'Citations de motivation', quotes_sub: 'Des mots doux pendant vos séances',
    personalized_quotes: 'Citations personnalisées', personalized_quotes_sub: 'Écrivez des citations fidèles à vos objectifs',
    quotes_manage_title: 'Citations personnalisées',
    quotes_manage_intro: 'Composez les mots qui vous accompagnent en concentration profonde.',
    quote_source: 'Ce qui apparaît pendant les séances',
    qsrc_system: 'Emeo', qsrc_custom: 'Les vôtres', qsrc_mix: 'Les deux',
    qsrc_system_sub: 'Nos phrases choisies', qsrc_custom_sub: 'Uniquement vos citations', qsrc_mix_sub: 'Les vôtres et les nôtres, entremêlées',
    your_quotes: 'Vos citations', quote_count: '{n} enregistrée(s)',
    add_quote: 'Ajouter une citation', quote_placeholder: 'Écrivez ce qui vous recentre…',
    quote_add_cta: 'Ajouter', no_custom_quotes: 'Aucune citation personnelle. Ajoutez-en une ci-dessus pour vous l’approprier.',
    quote_empty_hint: 'Ajoutez une citation pour utiliser ce mode.',
    toast_quote_added: 'Citation ajoutée', toast_quote_saved: 'Citation mise à jour', toast_quote_deleted: 'Citation supprimée',
    ob_skip: 'Passer',
    ob1_eyebrow: 'BIENVENUE SUR EMEO', ob1_title: 'Le focus commence en soi.',
    ob1_body: 'Un espace calme construit autour d’une Sphère vivante — votre concentration, rendue visible.',
    ob2_eyebrow: 'COMMENT ÇA MARCHE', ob2_title: 'Cultivez le focus par des sessions intentionnelles et regardez votre Sphère évoluer.',
    ob2_body: 'Chaque heure de focus profond intensifie sa lumière et la porte vers un nouveau niveau.',
    ob3_eyebrow: 'RESTEZ RÉGULIER', ob3_title: 'Restez régulier grâce à de doux rappels.',
    ob3_body: 'Un seul rappel discret quand il aide — jamais de bruit. Modifiable à tout moment.',
    ob_next: 'Continuer', ob_enable: 'Activer les notifications', ob_begin: 'Entrer dans Emeo',
    ob_not_now: 'Plus tard', toast_reminders_on: 'Rappels en douceur activés',
    sc_title: 'Session terminée', sc_sub: 'Magnifique. Votre focus a tenu.',
    sc_session: 'Cette session', sc_today: 'Focus aujourd’hui', sc_done: 'Terminé',
    session_history: 'Historique des sessions', session_history_sub: 'Chaque session de focus terminée',
    share_session: 'Partager la session', share_focused: 'Concentré pendant {n} minutes', share_generated: 'Généré avec Emeo',
    sess_focus: 'Session Focus', sess_pomodoro: 'Pomodoro', sess_countup: 'Compteur',
    hist_today: 'Aujourd’hui', hist_yesterday: 'Hier', hist_search: 'Rechercher des sessions',
    hist_all: 'Toutes', hist_range_all: 'Tout', hist_range_week: '7 jours', hist_range_month: '30 jours',
    hist_empty: 'Aucune session pour l’instant — vos sessions terminées apparaîtront ici.',
    hist_delete: 'Supprimer', hist_clear: 'Effacer l’historique', hist_clear_confirm: 'Appuyez encore pour tout effacer',
    hist_total_sessions: 'Sessions', hist_total_time: 'Total', hist_longest: 'Plus longue', hist_streak: 'Série', hist_best_day: 'Meilleur jour',
    ab_unlocked: 'Réalisation débloquée',
    share: 'Partager', share_title: 'Partagez votre focus', share_caption: 'de focus avec Emeo',
    share_streak_label: 'jours de série', share_level_label: 'Votre rang', toast_share_ready: 'Carte de partage prête',
    share_total: 'heures au total', share_sessions: 'sessions',
    rv_title: 'Vous aimez Emeo ?', rv_body: 'Une note rapide aide d’autres à trouver leur focus.',
    rv_rate: 'Noter Emeo', rv_later: 'Plus tard', rv_never: 'Ne plus demander', toast_review_thanks: 'Merci pour votre soutien',
    replay_intro: 'Revoir l’intro', replay_intro_sub: 'Revoir la visite de bienvenue',
    share_progress: 'Partager la progression', share_progress_sub: 'Une carte pour vos jalons de focus',
    empty_journey: 'Votre parcours commence aujourd’hui.',
    empty_hours_sub: 'Terminez votre première session pour faire grandir votre Sphère.',
    empty_ach: 'Votre première réalisation vous attend.',
    ach_progress: '{n} sur {total} débloqués',
    ach_unlocked_on: 'Débloqué · {date}', ach_locked: 'Verrouillé',
    ach_g_mastery: 'Maîtrise du minuteur', ach_g_consistency: 'Régularité', ach_g_sessions: 'Sessions',
    ach_g_challenge: 'Défis de concentration', ach_g_premium: 'Premium', ach_g_sharing: 'Partage & communauté',
    rar_common: 'Commun', rar_rare: 'Rare', rar_epic: 'Épique', rar_legendary: 'Légendaire',
    empty_stats: 'Vos statistiques apparaîtront ici après votre première session.',
    empty_streak: 'Commencez aujourd’hui et votre série démarre.',
  },
  ar: {
    nav_focus: 'التركيز', nav_progress: 'التقدّم', nav_settings: 'الإعدادات',
    focus_session: 'جلسة تركيز', current_level: 'المستوى الحالي', level_word: 'المستوى',
    min_tap_change: '{n} دقيقة · انقر للتغيير', time_remaining: 'الوقت المتبقّي للتركيز',
    touch_anywhere_to_edit: 'انقر في أي مكان\nللتعديل',
    focus_in_progress: 'جلسة تركيز جارية', pomodoro_in_progress: 'جلسة بومودورو جارية', tracking_in_progress: 'التتبّع جارٍ',
    focus_paused: 'التركيز متوقّف مؤقتًا', pomodoro_paused: 'بومودورو متوقّف مؤقتًا', tracking_paused: 'التتبّع متوقّف مؤقتًا',
    // ── onboarding v2 ──
    onb_get_started: 'ابدأ الآن', onb_continue: 'متابعة',
    onb1_title: 'اعثر على تركيزك.\nابنِ زخمك.',
    onb1_sub: 'مساحة أنيقة مصمّمة لمساعدتك على التركيز والاستمرار وإنجاز المزيد كل يوم.',
    onb2_title: 'ما هو هدفك الأساسي؟',
    onb2_hint: 'سنخصّص تجربتك بناءً على أهدافك.',
    onb_goal_focus: 'تحسين التركيز', onb_goal_study: 'مذاكرة أفضل', onb_goal_deep: 'عمل عميق',
    onb_goal_habits: 'بناء العادات', onb_goal_distract: 'تقليل المشتتات', onb_goal_productive: 'إنتاجية أعلى',
    onb3_title: 'كم من الوقت يمكنك التركيز بارتياح؟',
    onb3_hint: 'سنستخدم هذا لاقتراح جلسات تناسب عاداتك.',
    onb_dur_lt15: 'أقل من 15 دقيقة', onb_dur_15_30: '15–30 دقيقة', onb_dur_30_60: '30–60 دقيقة', onb_dur_gt60: 'أكثر من 60 دقيقة',
    onb4_title: 'ما الذي يساعدك على التركيز؟',
    onb4_hint: 'اختر الأجواء التي تساعدك على التركيز.',
    onb_amb_silence: 'صمت', onb_amb_rain: 'مطر', onb_amb_forest: 'غابة', onb_amb_ocean: 'محيط', onb_amb_white: 'ضوضاء بيضاء',
    onb5_title: 'ابقَ على المسار',
    onb5_sub: 'فعّل الإشعارات لتلقّي التذكيرات والحفاظ على سلسلتك والاستمرار في تحقيق أهدافك.',
    onb_enable_notifs: 'تفعيل الإشعارات', onb_maybe_later: 'ربما لاحقًا',
    onb_preview: 'استماع للصوت',
    hint_tap_play: 'اضغط تشغيل لبدء أول جلسة تركيز.',
    pomo_break: 'استراحة', cycle_of: 'الدورة {n} من {total}',
    choose_mode: 'وضع المؤقّت', start_focus: 'ابدأ الجلسة',
    mode_standard: 'قياسي', mode_standard_sub: 'عدّ تنازلي بسيط للتركيز',
    mode_count_up: 'العدّ التصاعدي', mode_count_up_sub: 'العدّ تصاعدياً من الصفر',
    mode_pomodoro: 'بومودورو', mode_pomodoro_sub: 'دورات تركيز / استراحة · ٤ جولات',
    duration: 'المدة', focus_break: 'تركيز / استراحة', goal: 'الهدف',
    no_limit: 'بلا حدّ', custom: 'مخصّص',
    custom_premium_hint: 'المدد المخصّصة ميزة بريميوم',
    nature: 'ضوضاء بيضاء', stop: 'إيقاف', your_rank: 'رتبتك', focus_rank: 'رتبة التركيز',
    ambient_sounds: 'ضوضاء بيضاء', white_noise: 'ضوضاء بيضاء', stop_sound: 'إيقاف الصوت',
    volume: 'مستوى الصوت', ambience: 'الأجواء',
    sound_rain: 'مطر', sound_ocean: 'أمواج المحيط', sound_forest: 'غابة',
    sound_wind: 'رياح', sound_night: 'صراصير الليل', sound_fire: 'مدفأة',
    sound_coffee: 'مقهى', sound_classroom: 'قاعة درس', sound_library: 'مكتبة',
    sound_stream: 'جدول', sound_train: 'قطار', sound_whitenoise: 'ضوضاء بيضاء',
    sound_brownnoise: 'ضوضاء بنية', sound_pinknoise: 'ضوضاء وردية', sound_thunder: 'عاصفة رعدية',
    sound_mountainwind: 'رياح الجبل', sound_clock: 'دقّات الساعة', sound_countdown: 'عدّ تنازلي',
    sound_deepspace: 'الفضاء العميق', sound_nightforest: 'غابة ليلية',
    sound_campfire: 'نار المخيم', sound_desertwind: 'رياح الصحراء', sound_jungle: 'أدغال',
    sound_waterfall: 'شلال', sound_snowstorm: 'عاصفة ثلجية',
    session_length: 'مدة الجلسة', minutes: '{m} دقيقة',
    quick: 'سريع', standard: 'قياسي', deep: 'عمل عميق',
    custom_min: 'دقائق مخصّصة', set: 'تعيين', save: 'حفظ',
    custom_duration: 'مدة مخصّصة', custom_duration_sub: 'أي مدة، 1–300 دقيقة',
    saved_durations: 'المدد المحفوظة', any_duration: 'اختر من 1 إلى 300 دقيقة', minutes_short: 'دقيقة',
    progress_title: 'التقدّم', total_focus_hours: 'إجمالي ساعات التركيز',
    progress_to: 'التقدّم إلى {name}', mastery_reached: 'تم بلوغ الإتقان', max_rank: 'أعلى رتبة',
    greet_morning: 'صباح الخير', greet_morning_s: 'ابدأ بهدوء وابقَ مركّزاً.',
    greet_day: 'نهارك سعيد', greet_day_s: 'كن حاضراً واجعل وقتك ذا قيمة.',
    greet_afternoon: 'طاب يومك', greet_afternoon_s: 'واصل، أنت تبلي حسناً.',
    greet_evening: 'مساء الخير', greet_evening_s: 'استرخِ وتأمّل ودع الباقي.',
    greet_night: 'تصبح على خير', greet_night_s: 'ارتح جيداً، لقد فعلت ما يكفي اليوم.',
    evolution: 'تطوّر الرتبة', level_short: 'مستوى', starting_tier: 'المستوى الأول', hours_count: '{n} ساعة',
    view_all: 'عرض الكل', next_target: 'التالي', journey_sub: 'مسارك من سبارك إلى التاج',
    current_badge: 'الحالي', statistics: 'الإحصائيات',
    today: 'اليوم', this_week: 'هذا الأسبوع', this_month: 'هذا الشهر',
    sessions: 'الجلسات', longest_session: 'أطول جلسة',
    min_unit: 'دقيقة', days_unit: 'أيام',
    current_streak: 'السلسلة الحالية', longest_streak: 'أطول سلسلة',
    achievements: 'الإنجازات',
    ach_h1: 'أول ساعة', ach_h10: '10 ساعات', ach_h50: '50 ساعة', ach_h100: '100 ساعة',
    ach_h300: '300 ساعة', ach_h500: '500 ساعة', ach_h1000: '1000 ساعة',
    settings_title: 'الإعدادات', preferences: 'التفضيلات',
    notifications: 'الإشعارات', notifications_sub: 'تذكيرات الجلسات والإنجازات',
    sound_effects: 'المؤثرات الصوتية', sound_effects_sub: 'أصوات الأزرار والواجهة والنجاح والإنجازات',
    achievement_anims: 'رسوم الإنجازات', achievement_anims_sub: 'إظهار لافتات الاحتفال عند تحقيق الإنجازات',
    haptics: 'الاهتزاز', haptics_sub: 'نقرات وردود لمسية خفيفة',
    show_progress: 'إظهار شريط التقدّم', show_progress_sub: 'تقدّم الرتبة أسفل التحية',
    language: 'اللغة',
    developer: 'المطوّر',
    sync: 'المزامنة',
    notif_preview: 'معاينة الإشعارات', notif_preview_sub: 'شاهد كيف تظهر التنبيهات على الجهاز',
    data: 'البيانات',
    export_stats: 'تصدير الإحصائيات', export_stats_sub: 'تنزيل سجل تركيزك',
    backup: 'النسخ والاستعادة', backup_sub: 'مزامنة التقدّم سحابياً',
    reset_progress: 'إعادة تعيين التقدّم', reset_progress_sub: 'مسح كل الساعات والمستويات',
    version_line: 'الإصدار 1.0 · مصمّم للعمل العميق',
    toast_stats_exported: 'تم تصدير الإحصائيات', toast_backup_complete: 'اكتمل النسخ الاحتياطي',
    toast_progress_reset: 'تمت إعادة التعيين',
    evolution_caps: 'تطوّر', evolved_into: 'لقد تطوّرت إلى', continue: 'متابعة',
    congrats: 'تهانينا', you_reached: 'لقد بلغت', hours_completed: 'أكملت {n} ساعة تركيز',
    reset_q: 'إعادة تعيين كل التقدّم؟',
    reset_body: 'سيؤدي ذلك إلى مسح ساعاتك ومستوياتك وسلاسلك وإنجازاتك. لا يمكن التراجع عن هذا.',
    cancel: 'إلغاء', reset: 'إعادة تعيين',
    np_title: 'معاينة الإشعارات', np_sub: 'لأغراض العرض والتطوير فقط',
    np_ios: 'iOS', np_android: 'أندرويد', np_now: 'الآن', np_close: 'تم',
    np_lockscreen: 'معاينة شاشة القفل',
    n_start_title: 'بدأت جلسة التركيز', n_start_body: 'بدأت جلستك ({min} دقيقة). ابقَ حاضراً.',
    n_complete_title: 'اكتملت جلسة التركيز', n_complete_body: 'عمل رائع. ركّزت لمدة {min} دقيقة.',
    n_daily_title: 'حان وقت التركيز', n_daily_body: 'طقس تركيزك اليومي بانتظارك. أضئ الكرة.',
    n_streak_title: 'حافظ على سلسلتك', n_streak_body: 'لديك سلسلة من {days} أيام. لا تكسر السلسلة.',
    n_ach_title: 'تم فتح إنجاز', n_ach_body: '{name} — وصلت إلى إنجاز جديد.',
    n_weekly_title: 'أسبوعك في التركيز', n_weekly_body: 'ركّزت {h} ساعة هذا الأسبوع — إيقاع هادئ وثابت.',
    reminders: 'التذكيرات', reminders_sub: 'الجودة قبل الكثرة — دون إزعاج',
    notif_daily: 'تذكير يومي', notif_daily_sub: 'مرة واحدة كحد أقصى يومياً',
    notif_streak: 'تذكير السلسلة', notif_streak_sub: 'فقط عندما تكون سلسلتك في خطر',
    notif_weekly: 'الملخّص الأسبوعي', notif_weekly_sub: 'تلخيص لطيف، مرة كل أسبوع',
    notif_strategy: 'مُنسّق وداعم، دون إزعاج.',
    tag_spark: 'الضوء الأول.', tag_ember: 'دفءٌ ثابت.', tag_flame: 'تتّقد أكثر.', tag_pulse: 'يتنامى الزخم.', tag_focus: 'تركيز كامل.', tag_flow: 'يحملك التدفّق.', tag_glow: 'إشراقٌ هادئ.', tag_crystal: 'صافٍ ومتماسك.', tag_titan: 'هائلٌ وثابت.', tag_champion: 'مُثبتٌ بالعمل.', tag_master: 'إتقانٌ سلس.', tag_grandmaster: 'إتقانٌ مصقول.', tag_mythic: 'يفوق المألوف.', tag_crown: 'القمّة. أعلى رتبة.', tag_legend: 'إتقانٌ مكتسب.',
    tag_aura: 'أول بصيص من التركيز.', tag_halo: 'يتجمّع النور ويثبت.',
    tag_radiant: 'يتحوّل التركيز إلى دفء.', tag_nova: 'يشتعل تألّق هادئ.',
    tag_astral: 'انجراف نحو هدوء أعمق.', tag_nebula: 'شاسع، بطيء، مضيء.',
    tag_stellar: 'ثابت كنجم راسخ.', tag_celestial: 'متناغم مع ما هو أعظم.',
    tag_cosmic: 'تمدّد يتجاوز الذات.', tag_eternal: 'شعلة لا ترتجف.',
    tag_ascendant: 'ارتقاء فوق كل حد.', tag_infinite: 'لم تبقَ أي حدود.',
    tag_transcendent: 'حضور خالص.',
    sphere_reached: 'وصلت كرتك إلى',
    premium: 'بريميوم', free_badge: 'مجاني', locked: 'مقفل',
    unlock_with_premium: 'افتح مع بريميوم',
    premium_eyebrow: 'EMEO بريميوم',
    premium_title: 'تعمّق أكثر مع بريميوم',
    premium_sub: 'كل صوت، كل إحصائية، كل هدف — مفتوح.',
    premium_cta: 'فتح بريميوم',
    premium_continue: 'اشترك · {price}/شهر',
    premium_includes: 'ما الذي تحصل عليه',
    premium_maybe: 'لاحقاً', premium_restore: 'استعادة الشراء',
    premium_terms: 'إلغاء في أي وقت. يُحاسب {price}/شهر.',
    premium_active: 'بريميوم مُفعّل', per_month: '/شهر', per_year: '/سنة',
    plan_annual: 'سنوي', plan_monthly: 'شهري', best_value: 'أفضل قيمة',
    months_free: '{n} أشهر مجاناً', save_annual: 'وفّر مع الاشتراك السنوي',
    premium_continue_year: 'اشترك · {price}/سنة',
    premium_terms_year: 'إلغاء في أي وقت. يُحاسب {price}/سنة.',
    toast_subscribed: 'مرحباً بك في بريميوم Emeo',
    toast_restoring: 'جارٍ استعادة مشترياتك…',
    perk_sounds: 'الوصول إلى كل الضوضاء البيضاء المميّزة',
    perk_focus_shield: 'درع التركيز — حظر التطبيقات والمواقع المشتّتة',
    perk_tags: 'وسوم ومشاريع غير محدودة',
    perk_analytics: 'تحليلات ورؤى متقدّمة',
    perk_heatmap: 'سجلّ كامل لخريطة التركيز',
    perk_widgets: 'ودجت الشاشة الرئيسية وشاشة القفل',
    perk_auto_protect: 'حماية تلقائية للسلسلة',
    perk_weekly: 'إحصائيات أسبوعية',
    perk_monthly: 'إحصائيات شهرية',
    perk_streaks: 'تتبّع سلاسل التركيز',
    perk_charts: 'رسوم بيانية للتقدّم',
    perk_goals_achieved: 'تتبّع الأهداف المحقّقة',
    perk_custom_goals: 'أهداف مخصّصة',
    perk_daily_goal: 'تتبّع الهدف اليومي',
    perk_weekly_goal: 'تتبّع الهدف الأسبوعي',
    perk_auto_track: 'تتبّع تلقائي للأهداف',
    perk_sync: 'مزامنة متعددة الأجهزة',
    perk_custom_duration: 'مدة تركيز مخصّصة (1–300 دقيقة)',
    perk_future: 'كل الميزات المميّزة المستقبلية',
    advanced_stats: 'إحصائيات متقدّمة',
    weekly_focus: 'تركيز أسبوعي', monthly_focus: 'تركيز شهري',
    focus_streaks: 'سلاسل التركيز', progress_charts: 'الرسوم البيانية', goals_achieved: 'الأهداف المحقّقة',
    weekly_activity: 'النشاط الأسبوعي', wk_total: '{h}س {m}د هذا الأسبوع', wk_last7: 'التركيز خلال آخر 7 أيام', focus_word: 'تركيز',
    monthly_activity: 'النشاط الشهري', avg_per_day: 'المعدّل اليومي', act_total: 'الإجمالي', mo_last4: 'التركيز خلال آخر 4 أسابيع', act_week_n: 'الأسبوع {n}', week_abbr: 'أ',
    activity_wk_mo: 'النشاط الأسبوعي / الشهري',
    custom_goals: 'أهداف مخصّصة', custom_goals_sub: 'حدّد أهدافاً يومية وأسبوعية',
    daily_goal: 'هدف يومي', weekly_goal: 'هدف أسبوعي',
    goal_today: 'اليوم', goal_week: 'هذا الأسبوع', goal_reached: 'تحقّق الهدف',
    multi_sync: 'مزامنة الأجهزة', multi_sync_sub: 'الهاتف واللوحي، متزامنان دائماً',
    pair_intro: 'زامِن تقدّمك مع جهاز آخر — دون حساب ودون تسجيل دخول.',
    pair_show_btn: 'إظهار رمز الإقران', pair_show_btn_sub: 'على الجهاز الذي يحتوي بياناتك',
    pair_enter_btn: 'إدخال رمز', pair_enter_btn_sub: 'على الجهاز الجديد المراد مزامنته',
    pair_show_hint: 'على جهازك الآخر: الإعدادات ← مزامنة الأجهزة ← «إدخال رمز»، ثم اكتب هذا:',
    pair_expires: 'ينتهي هذا الرمز خلال 5 دقائق ويُستخدم مرة واحدة.',
    pair_enter_hint: 'اكتب الرمز الظاهر على جهازك الآخر.',
    pair_input_ph: 'الرمز',
    pair_link: 'ربط الجهاز', pair_linking: 'جارٍ الربط…', pair_back: 'رجوع',
    pair_linked: 'تم الربط! أجهزتك تشارك التقدّم الآن.',
    pair_err_gen: 'تعذّر إنشاء رمز. تحقّق من اتصالك.',
    pair_err_code: 'أدخل الرمز كاملاً.',
    pair_err_invalid: 'رمز غير صالح أو منتهٍ — أنشئ رمزاً جديداً.',
    tag_zenith: 'قمة السكون.', tag_eclipse: 'ينطوي النور في الظل.',
    tag_apex: 'لا شيء وراء ذلك.', tag_luminary: 'لقد أصبحت النور.',
    phrases: ['تركيز عميق. تدفّق صافٍ.', 'دع العالم يهدأ.', 'نفَسٌ واحد. مهمة واحدة.',
      'السكون مهارة.', 'أنت هنا تماماً.', 'دع النور يتجمّع.', 'الحضور قبل الضغط.'],
    // quotes
    perk_quotes: 'اقتباسات تحفيزية مخصّصة',
    quotes_label: 'اقتباسات تحفيزية', quotes_sub: 'كلمات لطيفة أثناء جلساتك',
    personalized_quotes: 'اقتباسات مخصّصة', personalized_quotes_sub: 'اكتب اقتباسات تعبّر عن أهدافك',
    quotes_manage_title: 'اقتباسات مخصّصة',
    quotes_manage_intro: 'صُغ الكلمات التي ترافقك في التركيز العميق.',
    quote_source: 'ما يظهر أثناء الجلسات',
    qsrc_system: 'Emeo', qsrc_custom: 'اقتباساتك', qsrc_mix: 'الاثنان',
    qsrc_system_sub: 'عباراتنا المختارة', qsrc_custom_sub: 'اقتباساتك فقط', qsrc_mix_sub: 'اقتباساتك وعباراتنا معاً',
    your_quotes: 'اقتباساتك', quote_count: '{n} محفوظة',
    add_quote: 'أضف اقتباساً', quote_placeholder: 'اكتب ما يعيد تركيزك…',
    quote_add_cta: 'إضافة', no_custom_quotes: 'لا توجد اقتباسات بعد. أضف واحداً بالأعلى ليصبح التركيز خاصاً بك.',
    quote_empty_hint: 'أضف اقتباساً لاستخدام هذا الوضع.',
    toast_quote_added: 'تمت إضافة الاقتباس', toast_quote_saved: 'تم تحديث الاقتباس', toast_quote_deleted: 'تم حذف الاقتباس',
    ob_skip: 'تخطي',
    ob1_eyebrow: 'مرحباً بك في EMEO', ob1_title: 'التركيز يبدأ من الداخل.',
    ob1_body: 'مساحة هادئة تدور حول كرة حية واحدة — تركيزك وقد أصبح مرئياً.',
    ob2_eyebrow: 'كيف يعمل', ob2_title: 'ابن تركيزك عبر جلسات مقصودة وشاهد كرتك تتطوّر.',
    ob2_body: 'كل ساعة تركيز عميق تزيد نورها وتحملها إلى مستوى جديد.',
    ob3_eyebrow: 'حافظ على الاستمرار', ob3_title: 'حافظ على استمرارك بتذكيرات لطيفة.',
    ob3_body: 'تذكير هادئ واحد عند الحاجة — دون إزعاج. يمكنك تغييره متى شئت.',
    ob_next: 'متابعة', ob_enable: 'تفعيل الإشعارات', ob_begin: 'ادخل إلى Emeo',
    ob_not_now: 'ليس الآن', toast_reminders_on: 'تم تفعيل التذكيرات اللطيفة',
    sc_title: 'اكتملت الجلسة', sc_sub: 'عمل رائع. ثبت تركيزك.',
    sc_session: 'هذه الجلسة', sc_today: 'تركيز اليوم', sc_done: 'تم',
    session_history: 'سجل الجلسات', session_history_sub: 'كل جلسة تركيز مكتملة',
    share_session: 'مشاركة الجلسة', share_focused: 'ركّزت لمدة {n} دقيقة', share_generated: 'أُنشئ بواسطة Emeo',
    sess_focus: 'جلسة تركيز', sess_pomodoro: 'بومودورو', sess_countup: 'العدّ التصاعدي',
    hist_today: 'اليوم', hist_yesterday: 'أمس', hist_search: 'ابحث في الجلسات',
    hist_all: 'الكل', hist_range_all: 'كل الوقت', hist_range_week: '7 أيام', hist_range_month: '30 يوماً',
    hist_empty: 'لا جلسات بعد — ستظهر جلساتك المكتملة هنا.',
    hist_delete: 'حذف', hist_clear: 'مسح السجل', hist_clear_confirm: 'اضغط مرة أخرى لمسح الكل',
    hist_total_sessions: 'الجلسات', hist_total_time: 'الإجمالي', hist_longest: 'الأطول', hist_streak: 'السلسلة', hist_best_day: 'أفضل يوم',
    ab_unlocked: 'تم فتح إنجاز',
    share: 'مشاركة', share_title: 'شارك تركيزك', share_caption: 'من التركيز مع Emeo',
    share_streak_label: 'يوم متواصل', share_level_label: 'رتبتك', toast_share_ready: 'بطاقة المشاركة جاهزة',
    share_total: 'إجمالي الساعات', share_sessions: 'جلسات',
    rv_title: 'هل تستمتع بـ Emeo؟', rv_body: 'تقييم سريع يساعد المزيد على إيجاد تركيزهم.',
    rv_rate: 'قيّم Emeo', rv_later: 'لاحقاً', rv_never: 'لا تسأل مجدداً', toast_review_thanks: 'شكراً لدعمك',
    replay_intro: 'إعادة المقدّمة', replay_intro_sub: 'شاهد جولة الترحيب مجدداً',
    share_progress: 'مشاركة التقدّم', share_progress_sub: 'بطاقة لإنجازات تركيزك',
    empty_journey: 'رحلتك تبدأ اليوم.',
    empty_hours_sub: 'أكمل أول جلسة تركيز لتبدأ بنمو كرتك.',
    empty_ach: 'إنجازك الأول بانتظارك.',
    ach_progress: '{n} من {total} مفتوحة',
    ach_unlocked_on: 'فُتح · {date}', ach_locked: 'مقفل',
    ach_g_mastery: 'إتقان المؤقّت', ach_g_consistency: 'الانتظام', ach_g_sessions: 'الجلسات',
    ach_g_challenge: 'تحديات التركيز', ach_g_premium: 'بريميوم', ach_g_sharing: 'المشاركة والمجتمع',
    rar_common: 'عادي', rar_rare: 'نادر', rar_epic: 'ملحمي', rar_legendary: 'أسطوري',
    empty_stats: 'ستظهر إحصائياتك هنا بعد أول جلسة.',
    empty_streak: 'ابدأ اليوم وتبدأ سلسلتك بالعدّ.',
  },
};

function normalizeLang(v) {
  if (!v) return 'en';
  const s = String(v).toLowerCase();
  if (s === 'fr' || s.indexOf('fran') === 0) return 'fr';
  if (s === 'ar' || s.indexOf('عرب') === 0 || s.indexOf('arab') === 0) return 'ar';
  return 'en';
}
function dirForLang(code) { return code === 'ar' ? 'rtl' : 'ltr'; }

function makeT(code) {
  const lang = normalizeLang(code);
  const dict = STRINGS[lang] || STRINGS.en;
  const t = (key, params) => {
    let str = dict[key] != null ? dict[key] : (STRINGS.en[key] != null ? STRINGS.en[key] : key);
    if (params && typeof str === 'string') {
      for (const k in params) str = str.split('{' + k + '}').join(params[k]);
    }
    return str;
  };
  return { lang, dir: dirForLang(lang), t, phrases: dict.phrases || STRINGS.en.phrases };
}

const I18nCtx = React.createContext(makeT('en'));
const useI18n = () => React.useContext(I18nCtx);

Object.assign(window, { LANGS, STRINGS, normalizeLang, dirForLang, makeT, I18nCtx, useI18n });

  