@font-face { font-family: 'Amiri Quran'; src: url(../fonts/amiri-quran.woff2) format('woff2'); font-display: block; }
@font-face { font-family: 'Nunito'; font-weight: 400; src: url(../fonts/nunito-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: 'Nunito'; font-weight: 700; src: url(../fonts/nunito-latin-700-normal.woff2) format('woff2'); }
@font-face { font-family: 'Nunito'; font-weight: 800; src: url(../fonts/nunito-latin-800-normal.woff2) format('woff2'); }
@font-face { font-family: 'Baloo Bhaijaan 2'; font-weight: 400; src: url(../fonts/baloo-bhaijaan-2-arabic-400-normal.woff2) format('woff2'); }
@font-face { font-family: 'Baloo Bhaijaan 2'; font-weight: 700; src: url(../fonts/baloo-bhaijaan-2-arabic-700-normal.woff2) format('woff2'); }
@font-face { font-family: 'Baloo Bhaijaan 2'; font-weight: 800; src: url(../fonts/baloo-bhaijaan-2-latin-800-normal.woff2) format('woff2'); }

:root {
  /* Charte Rawda — une seule source de vérité (le thème sombre redéfinit ces variables plus bas) */
  --bg: #f5f2e9; --card: #fffdf7; --surface-2: #f0ece0;
  --ink: #18372e; --text-2: #4b5d55; --muted: #61716a; --line: #e7dfcf; --border: #e7dfcf;
  --primary: #08765a; --primary-d: #064d3c; --emerald: #07513f; --accent: #e6b84f; --gold: #e6b84f;
  --hot: #d89a35; --ok: #27845c; --bad: #c95b55; --c: #0b8061;
  --success-bg: #eaf5eb; --error-bg: #fbebe8; --gold-soft: #f8edcf; --gold-ink: #805c19;
  /* arrondis : petits éléments, boutons, cartes, grandes fenêtres */
  --r-sm: 12px; --r-md: 16px; --r-lg: 22px; --r-xl: 28px; --radius: var(--r-lg);
  /* ombres : cartes posées, éléments en relief */
  --sh-1: 0 7px 20px rgba(27,57,43,.065), 0 1px 3px rgba(27,57,43,.04);
  --sh-2: 0 10px 28px rgba(27,57,43,.12), 0 2px 6px rgba(27,57,43,.06);
  --shadow: var(--sh-1);
  /* espacements */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 24px; --sp-6: 32px;
  --tap: 48px;
  --safe-top: env(safe-area-inset-top, 0px); --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px); --safe-right: env(safe-area-inset-right, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: 'Nunito', system-ui, sans-serif; font-size: 17px; }
body {
  min-height: 100vh; overscroll-behavior: none; user-select: none; -webkit-user-select: none;
  background-image: radial-gradient(circle at 10% 0%, #ffe9c7 0, transparent 40%), radial-gradient(circle at 100% 30%, #e3f6f1 0, transparent 35%);
  background-attachment: fixed;
}
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
button:disabled { cursor: default; }
h1, h2, h3 { font-weight: 800; margin: .4em 0; }
h1 { font-size: 1.75rem; line-height: 1.2; } h2 { font-size: 1.375rem; line-height: 1.25; } h3 { font-size: 1.125rem; margin-top: 1.4em; }
.ar { font-family: 'Amiri Quran', 'Baloo Bhaijaan 2', serif; direction: rtl; }
.quran { line-height: 2.1; text-align: center; word-spacing: .08em; }
.muted { color: var(--muted); } .small { font-size: .85rem; } .block { display: block; } .big { font-size: 1.15rem; }
.center { text-align: center; } .grow { flex: 1; min-width: 0; }
.row { display: flex; align-items: center; } .row.gap, .gap { gap: 10px; } .wrap { flex-wrap: wrap; }
.row.center { justify-content: center; } .row.between { justify-content: space-between; }
.col { display: flex; flex-direction: column; } .col.gap { gap: 10px; }
.pad { padding: 16px; padding-bottom: calc(110px + var(--safe-bottom)); max-width: 720px; margin: 0 auto; }
.hint { color: var(--muted); font-size: .88rem; margin: 8px 0; }
.error { color: var(--bad); font-weight: 700; min-height: 1em; }
.ok-text { color: var(--ok); font-weight: 800; }

/* ---------- Démarrage ---------- */
#splash { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; background: var(--bg); z-index: 100; transition: opacity .5s; font-weight: 800; color: var(--primary-d); }
#splash.hide { opacity: 0; pointer-events: none; }
.logo { font-family: 'Baloo Bhaijaan 2', 'Amiri Quran', serif; font-weight: 800; font-size: 40px; color: #fff; width: 96px; height: 96px; line-height: 104px; border-radius: var(--r-xl); margin: 0 auto 10px;
  background: linear-gradient(135deg, #2a9d8f, #6fd3b9); box-shadow: var(--shadow); text-align: center; }
.logo.big { width: 130px; height: 130px; line-height: 140px; font-size: 54px; border-radius: 40px; }

/* ---------- Transitions ---------- */
.screen { min-height: 100vh; }
.enter { animation: slideIn .28s ease-out; } .enter-back { animation: slideBack .28s ease-out; }
@keyframes slideIn { from { opacity: 0; transform: translateX(24px); } }
@keyframes slideBack { from { opacity: 0; transform: translateX(-24px); } }
.pop { animation: pop .5s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes pop { 0% { transform: scale(.3); } 100% { transform: scale(1); } }
.shake { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }

/* ---------- Barre du haut ---------- */
.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 8px; padding: calc(10px + var(--safe-top)) 12px 10px; background: rgba(255, 248, 238, .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.topbar-title { flex: 1; text-align: center; font-weight: 800; font-size: 1.1rem; min-width: 0; }
.topbar-title small { display: block; font-weight: 600; color: var(--muted); font-size: .8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn { width: var(--tap); height: var(--tap); border-radius: var(--r-sm); font-size: 26px; line-height: 1; display: inline-flex; align-items: center; justify-content: center; background: var(--card); box-shadow: var(--shadow); flex: none; }
.icon-btn.speak { width: var(--tap); height: var(--tap); font-size: 20px; border-radius: 50%; background: var(--success-bg); border: 1.5px solid #9fd3bd; box-shadow: none; }
:root[data-theme="dark"] .icon-btn.speak { background: #1f3a30; border-color: #2f6a55; }
.icon-spacer { width: 44px; flex: none; }

/* ---------- Boutons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 12px 18px; border-radius: var(--r-md); font-weight: 800; background: var(--card); box-shadow: 0 4px 0 #e2d8ca; transition: transform .08s; margin: 4px 0; }
.btn:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 #e2d8ca; }
.btn.primary { background: var(--primary); color: #fff; box-shadow: 0 4px 0 var(--primary-d); }
.btn.hot { background: var(--hot); color: #fff; box-shadow: 0 4px 0 #d85e3f; }
.btn.danger { background: #fde4e4; color: #b33; box-shadow: 0 4px 0 #f1c2c2; }
.btn.ghost { background: transparent; box-shadow: none; color: var(--primary-d); }
.btn.big { padding: 16px 26px; font-size: 1.15rem; width: 100%; max-width: 420px; }
.btn.small { padding: 10px 14px; font-size: .92rem; min-height: 44px; }
.btn:disabled { opacity: .4; }
.btn.listen { background: #e7f5ff; box-shadow: 0 4px 0 #c4e3f8; color: #1b6ea8; margin-top: 8px; }

.card { background: var(--card); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); margin: 12px 0; }
.card-title { font-weight: 800; }
.chip { display: inline-flex; align-items: center; padding: 8px 14px; border-radius: 999px; background: #f3ede4; font-weight: 700; font-size: .9rem; margin: 3px; }
.chip.sel { background: var(--primary); color: #fff; } .chip.ok { background: #e2f7ec; color: #1d8a52; }
.chips { display: flex; flex-wrap: wrap; justify-content: center; }
.stars { letter-spacing: 1px; font-size: 1rem; white-space: nowrap; }
.stars .on { color: var(--gold); text-shadow: 0 1px 0 #d99a00; } .stars .off { color: #e5ddd1; }
.stars.lg { font-size: 2rem; }
.bar { height: 12px; background: #efe6da; border-radius: 99px; overflow: hidden; margin: 4px 0; }
.bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--gold), #ffa53d); border-radius: 99px; transition: width .4s; }
.bar.big { height: 18px; margin: 16px 0; }

/* ---------- Profils ---------- */
.hero { text-align: center; margin: 20px 0; }
.profile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 14px; }
.profile-card { background: var(--card); border-radius: var(--r-xl); padding: 18px 10px; box-shadow: var(--shadow); border: 4px solid var(--c); text-align: center; }
.profile-card.add { border-style: dashed; border-color: #d9cfc1; color: var(--muted); }
.profile-card:active { transform: scale(.97); }
.avatar { display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; background: color-mix(in srgb, var(--c) 22%, white); }
.avatar.xl { width: 84px; height: 84px; font-size: 50px; }
.avatar.md { width: 56px; height: 56px; font-size: 32px; flex: none; }
.pname { font-weight: 800; font-size: 1.2rem; margin-top: 8px; } .pmeta { font-size: .85rem; color: var(--muted); }
.parent-link { display: block; margin: 30px auto; }
.welcome .lead { font-size: 1.1rem; max-width: 460px; margin: 10px auto; }
.feature-list { text-align: start; max-width: 420px; margin: 20px auto; display: grid; gap: 10px; }
.feature-list div { background: var(--card); padding: 12px 14px; border-radius: var(--r-md); box-shadow: var(--shadow); font-weight: 700; }
.form label { display: block; font-weight: 800; margin: 18px 0 6px; }
.input { width: 100%; padding: 14px; border-radius: var(--r-md); border: 2px solid var(--line); background: #fff; font: inherit; font-size: 1.05rem; color: var(--ink); user-select: text; -webkit-user-select: text; }
.input:focus { outline: none; border-color: var(--primary); }
select.input { appearance: auto; }
.choice-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.choice { width: 52px; height: 52px; font-size: 30px; border-radius: var(--r-md); background: var(--card); box-shadow: var(--shadow); border: 3px solid transparent; }
.choice.sel { border-color: var(--primary); transform: scale(1.08); }
.choice.color.sel { border-color: var(--ink); }
.opt { flex: 1; background: var(--card); border-radius: var(--r-md); padding: 14px; box-shadow: var(--shadow); border: 3px solid transparent; display: flex; flex-direction: column; gap: 4px; }
.opt.sel { border-color: var(--primary); background: #e6f6f3; } .opt small { color: var(--muted); }

/* ---------- Accueil ---------- */
.home-head { display: flex; align-items: center; gap: 12px; padding: calc(16px + var(--safe-top)) 16px 18px; background: linear-gradient(135deg, color-mix(in srgb, var(--c) 30%, white), #fff); border-radius: 0 0 30px 30px; box-shadow: var(--shadow); }
.home-head .avatar { border: 3px solid #fff; }
.hello { font-weight: 800; font-size: 1.35rem; } .lvl { font-weight: 700; font-size: .9rem; }
.streak { display: flex; flex-direction: column; align-items: center; background: #fff; border-radius: var(--r-md); padding: 6px 12px; box-shadow: var(--shadow); filter: grayscale(1); opacity: .6; }
.streak.on { filter: none; opacity: 1; } .streak span { font-size: 26px; } .streak b { font-size: 1.1rem; }
.goal-card { display: flex; gap: 16px; align-items: center; background: var(--card); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); }
.ring { position: relative; width: 76px; height: 76px; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: #f0e8dc; stroke-width: 10; } .ring-fg { fill: none; stroke-width: 10; stroke-linecap: round; transition: stroke-dashoffset .8s; }
.ring-label { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-weight: 800; }
.continue-card { display: flex; align-items: center; gap: 14px; width: 100%; margin: 14px 0; padding: 16px; border-radius: var(--radius); background: linear-gradient(135deg, #2a9d8f, #45c4a8); color: #fff; box-shadow: 0 6px 0 var(--primary-d); text-align: start; }
.continue-card small { opacity: .85; font-weight: 700; } .continue-card .muted { color: #e2fff7; }
.cc-ar { font-size: 34px; min-width: 90px; text-align: center; } .cc-name { font-weight: 800; font-size: 1.2rem; }
.cc-go { margin-inline-start: auto; width: 48px; height: 48px; border-radius: 50%; background: #fff; color: var(--primary); display: flex; align-items: center; justify-content: center; font-size: 22px; flex: none; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tile { background: var(--card); border-radius: var(--radius); padding: 16px 10px; box-shadow: var(--shadow); display: flex; flex-direction: column; align-items: center; gap: 2px; }
.tile:active, .action:active, .game-card:active { transform: scale(.97); }
.tile-icon { font-size: 36px; } .tile small { color: var(--muted); font-size: .82rem; }
.tile.hot { background: #fff3e6; border: 3px solid #ffc999; } .tile.done { opacity: .7; }
.review-card { border: 3px solid #bfe9d8; }

/* ---------- Parcours ---------- */
.path { padding: 20px 16px 120px; max-width: 520px; margin: 0 auto; position: relative; }
.path-row { display: flex; align-items: center; gap: 14px; margin: 6px 0; }
.path-row.l { padding-inline-start: 4%; } .path-row.c { padding-inline-start: 28%; } .path-row.r { padding-inline-start: 52%; }
.path-node { position: relative; width: 72px; height: 72px; border-radius: 50%; flex: none; background: #e9e1d5; box-shadow: 0 6px 0 #cfc4b4; font-weight: 800; font-size: 1.3rem; color: #8a8296; }
.path-node.started { background: #ffe08a; box-shadow: 0 6px 0 #e8b93a; color: #7a5600; }
.path-node.done { background: var(--primary); box-shadow: 0 6px 0 var(--primary-d); color: #fff; }
.path-node.rec { box-shadow: 0 6px 0 #cfc4b4, 0 0 0 5px rgba(233, 178, 70, .55); }
/* halo doux qui « respire » autour de la sourate en cours (seule l'opacité bouge : pas de scintillement) */
.path-node.rec::after { content: ''; position: absolute; inset: -9px; border-radius: inherit; box-shadow: 0 0 14px 4px rgba(233, 178, 70, .75); pointer-events: none; opacity: .35; animation: halo 2.4s ease-in-out infinite }
@keyframes halo { 50% { opacity: 1; } }
@keyframes pulse { 50% { transform: scale(1.07); } }
.pn-flag { position: absolute; top: -28px; left: 50%; transform: translateX(-50%); background: var(--hot); color: #fff; font-size: .75rem; padding: 3px 8px; border-radius: 10px; white-space: nowrap; }
.path-label { display: flex; flex-direction: column; min-width: 0; } .path-label small { color: var(--muted); font-size: .8rem; }

/* ---------- Liste ---------- */
.search { margin-bottom: 12px; }
.srow { display: flex; align-items: center; gap: 12px; width: 100%; text-align: start; background: var(--card); padding: 12px; border-radius: var(--r-md); margin: 8px 0; box-shadow: var(--shadow); }
.srow small { display: block; color: var(--muted); font-size: .8rem; }
.snum { width: 40px; height: 40px; flex: none; border-radius: var(--r-sm); background: #f3ede4; display: flex; align-items: center; justify-content: center; font-weight: 800; }
.right { text-align: right; } .sar { font-size: 22px; }

/* ---------- Sourate ---------- */
.surah-head { text-align: center; padding: 20px; border-radius: var(--r-xl); background: linear-gradient(160deg, color-mix(in srgb, var(--c) 18%, white), #fff); box-shadow: var(--shadow); }
.surah-ar { font-size: 52px; line-height: 1.6; color: var(--primary-d); }
.parts { display: flex; gap: 10px; overflow-x: auto; padding: 6px 2px 12px; }
.part { flex: none; background: var(--card); padding: 10px 14px; border-radius: var(--r-md); box-shadow: var(--shadow); display: flex; flex-direction: column; align-items: center; border: 3px solid transparent; }
.part.sel { border-color: var(--primary); } .part small { color: var(--muted); font-size: .82rem; }
.actions { display: grid; gap: 12px; margin: 16px 0; }
.action { display: flex; align-items: center; gap: 14px; background: var(--card); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); text-align: start; }
.action small { display: block; color: var(--muted); } .action b { font-size: 1.15rem; }
.action.hot { background: linear-gradient(135deg, #ff8a5c, #ffb347); color: #fff; } .action.hot small { color: #fff3e6; }
.action-icon { font-size: 36px; } .chev { font-size: 30px; opacity: .5; }

/* ---------- Lecteur ---------- */
.verses { display: grid; gap: 12px; }
.verse { background: var(--card); border-radius: var(--radius); padding: 12px 16px 16px; box-shadow: var(--shadow); border: 3px solid transparent; transition: border-color .2s, background .2s; }
.verse.playing, .basmala.playing { border-color: var(--primary); background: #effaf7; }
.vnum { display: flex; justify-content: space-between; color: var(--muted); font-weight: 800; font-size: .85rem; }
.vplay { color: var(--primary); }
.basmala { text-align: center; font-size: 30px; padding: 10px; border-radius: var(--radius); border: 3px solid transparent; color: var(--primary-d); }
.lit { color: #7656c9; font-style: italic; font-size: .95rem; margin-top: 6px; line-height: 1.5; user-select: text; }
.fr { color: #4b4654; margin-top: 8px; line-height: 1.5; user-select: text; }
.fab { position: fixed; inset-inline-end: 20px; bottom: calc(24px + var(--safe-bottom)); width: 72px; height: 72px; border-radius: 50%; background: var(--primary); color: #fff; font-size: 28px; box-shadow: 0 6px 0 var(--primary-d), 0 10px 30px rgba(0, 0, 0, .2); z-index: 20; }
.fab.loading { animation: pulse 1s infinite; }
.controls { display: none; margin: 10px 16px; } .controls.open { display: grid; gap: 10px; }
.seg { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.seg > span { font-weight: 800; min-width: 74px; font-size: .9rem; }
.seg button { padding: 7px 12px; border-radius: var(--r-sm); background: #f3ede4; font-weight: 700; font-size: .88rem; }
.seg button.sel { background: var(--primary); color: #fff; }

/* ---------- Mémorisation ---------- */
.mem-progress { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin: 4px 0 10px; }
.mem-progress span { width: 22px; height: 8px; border-radius: 9px; background: #e9e1d5; } .mem-progress .done { background: var(--primary); } .mem-progress .cur { background: var(--gold); }
.mem-ar { margin: 10px 0; }
.w { display: inline-block; transition: all .2s; border-radius: 8px; }
.hidden-w { color: transparent; background: #efe6da; min-width: 40px; }
.hidden-w.peek, .hint-w.peek { color: inherit; background: #fff4cf; }
.hint-w .dots { color: #c9bfb1; }
.mask-row { display: flex; justify-content: center; flex-wrap: wrap; margin: 6px 0 10px; }
.method summary { font-weight: 800; cursor: pointer; }
.method-step { display: flex; gap: 12px; align-items: center; margin: 10px 0; } .method-step > span { font-size: 28px; } .method-step small { display: block; color: var(--muted); }

/* ---------- Jeux ---------- */
.game-list { display: grid; gap: 12px; }
.game-card { display: flex; align-items: center; gap: 14px; background: var(--card); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); text-align: start; border-inline-start: 8px solid var(--g); }
.game-card small { display: block; color: var(--muted); } .game-card.disabled { opacity: .5; }
.gc-icon { font-size: 34px; width: 56px; height: 56px; border-radius: var(--r-md); display: flex; align-items: center; justify-content: center; background: color-mix(in srgb, var(--g) 18%, white); flex: none; }
.tags { margin-top: 4px; } .tag { font-size: .82rem; font-weight: 800; background: #f3ede4; padding: 2px 8px; border-radius: 9px; margin-inline-end: 4px; }
.game-head { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 10px; padding: calc(10px + var(--safe-top)) 12px 10px; background: rgba(255, 248, 238, .95); }
.gtitle { font-weight: 800; font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .gtitle small { color: var(--muted); font-weight: 700; }
.qcount { font-weight: 800; color: var(--muted); font-size: .9rem; }
.xp-pill { background: #fff3cf; color: #9a6b00; font-weight: 800; padding: 6px 10px; border-radius: var(--r-sm); white-space: nowrap; }
.qbox.enter { animation: slideIn .3s ease-out; }
.instr { display: flex; align-items: center; justify-content: center; gap: 10px; font-weight: 800; font-size: 1.15rem; text-align: center; margin: 6px 0 4px; }
.options { display: grid; gap: 12px; margin-top: 14px; }
.options.grid { grid-template-columns: 1fr 1fr; }
.option { background: var(--card); border-radius: var(--r-lg); padding: 12px 14px; box-shadow: 0 5px 0 #e2d8ca; border: 3px solid transparent; text-align: center; position: relative; transition: transform .1s; }
.option:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 2px 0 #e2d8ca; }
.option .quran { line-height: 1.9; }
.option.right { border-color: var(--ok); background: #e5f8ee; box-shadow: 0 5px 0 #a9e3c4; }
.option.wrong { border-color: var(--bad); background: #fdeaea; opacity: .7; }
.option.reveal { animation: pulse .8s 2; }
.mini-play { position: absolute; inset-inline-start: 8px; top: 8px; font-size: 18px; background: #e7f5ff; border-radius: 10px; padding: 2px 6px; }
.fr-opt { display: flex; align-items: center; gap: 8px; text-align: start; line-height: 1.4; }
.fr-opt > span { flex: 1; }
.options.audio { grid-template-columns: 1fr; }
.aopt { display: flex; align-items: center; gap: 12px; justify-content: space-between; }
.aopt-n { font-size: 40px; }
.aopt-play { background: #e7f5ff; color: #1b6ea8; padding: 12px 16px; border-radius: var(--r-sm); font-weight: 800; }
.aopt-pick { background: var(--primary); color: #fff; padding: 12px 16px; border-radius: var(--r-sm); font-weight: 800; }
.blank { display: inline-block; min-width: 70px; border-bottom: 4px dashed var(--hot); color: var(--hot); margin: 0 4px; }
.build-line { min-height: 80px; } .build-line .given { color: var(--muted); } .placed { color: var(--primary-d); animation: pop .3s; }
.chips.build { gap: 8px; margin-top: 10px; }
.chip.word { font-size: 26px; padding: 6px 16px; background: var(--card); box-shadow: 0 4px 0 #e2d8ca; border-radius: var(--r-md); }
.chip.word.used { visibility: hidden; }
.placed-list { display: grid; gap: 6px; margin-top: 8px; min-height: 40px; }
.placed-item { display: flex; align-items: center; gap: 10px; background: #e5f8ee; border-radius: var(--r-sm); padding: 6px 10px; animation: pop .3s; }
.pnum { width: 30px; height: 30px; border-radius: 50%; background: var(--ok); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; flex: none; }
.placed-item .quran { flex: 1; line-height: 1.7; }
.voice-line .w.good { color: var(--ok); } .voice-line .w.bad { color: var(--bad); }
.mic { width: 110px; height: 110px; border-radius: 50%; background: var(--hot); color: #fff; font-size: 50px; box-shadow: 0 7px 0 #d85e3f; margin: 16px auto 8px; display: block; }
.mic.on { background: var(--bad); animation: pulse 1s infinite; }
.vstatus { font-weight: 800; min-height: 1.4em; }
.heard { font-family: 'Baloo Bhaijaan 2', serif; color: var(--muted); font-size: 1.1rem; min-height: 1.5em; margin: 6px 0; }
.card.prev .quran { opacity: .8; }
.end h2 { font-size: 1.6rem; }
.end-stars { font-size: 64px; letter-spacing: 6px; margin: 10px 0; }
.end-star { color: #e5ddd1; display: inline-block; transition: all .3s; }
.end-star.on { color: var(--gold); text-shadow: 0 3px 0 #d99a00; animation: pop .5s cubic-bezier(.2, 1.6, .4, 1); }
.xp-gain { display: inline-block; background: #fff3cf; color: #9a6b00; font-weight: 800; font-size: 1.3rem; padding: 8px 18px; border-radius: var(--r-md); margin-bottom: 20px; }
.end .col { align-items: center; }

/* ---------- Badges, jardin ---------- */
.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.badge { background: var(--card); border-radius: var(--radius); padding: 14px; text-align: center; box-shadow: var(--shadow); opacity: .55; }
.badge.got { opacity: 1; border: 3px solid var(--gold); } .badge small { display: block; color: var(--muted); font-size: .8rem; }
.badge-icon { font-size: 44px; } .badge-big { font-size: 90px; }
.big-emoji { font-size: 72px; }
.garden { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; background: linear-gradient(#e8f7e4, #d4efcb); border-radius: var(--r-xl); padding: 16px; }
.plant { display: flex; flex-direction: column; align-items: center; padding: 8px 4px; }
.plant small { font-weight: 700; font-size: .82rem; text-align: center; }
.plant-icon { font-size: 34px; } .plant-icon.g1 { font-size: 42px; } .plant-icon.g2 { font-size: 50px; } .plant-icon.g3 { font-size: 60px; }
.empty { text-align: center; padding: 30px; }
.dua .fr { text-align: center; }

/* ---------- Parents ---------- */
.kid { border-inline-start: 8px solid var(--c); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0; }
.stat { background: #faf6ef; border-radius: var(--r-sm); padding: 8px; text-align: center; }
.stat b { display: block; font-size: 1.2rem; } .stat small { color: var(--muted); font-size: .82rem; }
.week { display: flex; justify-content: space-between; align-items: flex-end; height: 86px; gap: 6px; }
.wd { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.wd i { display: block; width: 100%; max-width: 26px; background: var(--c); border-radius: 6px; }
.wd small { color: var(--muted); font-size: .82rem; }
.setting { background: var(--card); padding: 12px 14px; border-radius: var(--r-md); margin: 8px 0; box-shadow: var(--shadow); gap: 10px; }
.setting > button, .row.between > button { padding: 8px 14px; border-radius: var(--r-sm); background: #f3ede4; font-weight: 800; }
.setting > button.sel, .row.between > button.sel { background: var(--primary); color: #fff; }

/* ---------- Modale, toast ---------- */
.modal-wrap { position: fixed; inset: 0; background: rgba(30, 24, 40, .45); display: flex; align-items: center; justify-content: center; z-index: 50; padding: calc(20px + var(--safe-top)) 20px calc(20px + var(--safe-bottom)); animation: fade .2s; }
@keyframes fade { from { opacity: 0; } }
.modal { background: var(--card); border-radius: var(--r-xl); padding: 24px; width: 100%; max-width: 420px; max-height: 85vh; overflow: auto; animation: pop .35s cubic-bezier(.2, 1.4, .4, 1); }
.modal-text { font-size: 1.1rem; font-weight: 700; }
.modal .row.gap { justify-content: flex-end; margin-top: 12px; }
.toast { position: fixed; left: 50%; bottom: calc(110px + var(--safe-bottom)); transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: var(--r-md); z-index: 60; font-weight: 700; max-width: 90vw; text-align: center; transition: opacity .4s; }
.toast.out { opacity: 0; }
.confetti { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 70; }

.nowrap-btns .btn { white-space: nowrap; padding-left: 12px; padding-right: 12px; }

.voice-select { padding: 8px 10px; font-size: .9rem; width: auto; max-width: 100%; flex: 1; }
.studio-verse.recorded { border-color: #bfe9d8; }
.studio-verse.rec-on { border-color: var(--bad); background: #fff1f1; animation: glow 1.2s infinite; }
@keyframes glow { 50% { box-shadow: 0 0 0 6px rgba(239, 91, 91, .25); } }
.studio-btns { margin-top: 8px; }
.studio-head b { font-size: 1.15rem; }

/* ---------- Récitation suivie ---------- */
.follow-action { border: 3px solid #bfe9df; }
.follow-top { position: sticky; top: calc(65px + var(--safe-top)); z-index: 9; padding: 4px 16px; background: rgba(255, 248, 238, .95); display: flex; gap: 10px; align-items: center; }
.follow-top .bar { flex: 1; }
.follow-pad { padding-bottom: 300px; }
.follow-card { padding: 18px 14px; }
.follow-text { line-height: 2.4; text-align: justify; text-align-last: center; }
.basmala-small { text-align: center; color: var(--primary-d); margin-bottom: 6px; }
.fw { border-radius: 8px; padding: 0 2px; transition: background .2s, color .2s; }
.fw.hid { color: transparent; background: #efe6da; }
.fw.todo { color: #b9b0a4; }
.fw.ok { color: var(--ink); }
.fw.skip { color: #fff; background: var(--bad); }
.fw.err { color: #fff; background: #ff9f43; }
.fw.cur { outline: 3px dashed var(--primary); outline-offset: 2px; }
.fw.hid.cur { background: #d8efe9; }
.fmark { color: var(--primary-d); }
.legend .fw { padding: 2px 8px; font-family: 'Nunito', sans-serif; }
.legend .fw.ok { background: #e5f8ee; color: #1d8a52; }
.follow-dock { position: fixed; left: 0; right: 0; bottom: 0; z-index: 15; background: rgba(255, 255, 255, .97); border-radius: var(--r-xl) 26px 0 0; box-shadow: 0 -6px 24px rgba(0, 0, 0, .08); padding: 10px 16px calc(14px + var(--safe-bottom)); text-align: center; }
.follow-mic { width: 92px; height: 92px; font-size: 42px; margin: 8px auto 4px; }
.follow-dock .heard { font-size: .95rem; margin: 2px 0 0; max-height: 2.8em; overflow: hidden; }

.tagline { margin: -4px 0 8px; font-weight: 800; color: var(--primary-d); }

/* ---------- Mondes & déblocage ---------- */
.world { margin-bottom: 26px; }
.world-head { display: flex; gap: 12px; align-items: center; background: var(--card); border-radius: var(--radius); padding: 12px 14px; box-shadow: var(--shadow); margin: 8px 0 18px; }
.world-head small { display: block; color: var(--muted); font-weight: 700; } .world-head b { font-size: 1.15rem; }
.world-icon { font-size: 38px; }
.world.closed .path-row { opacity: .55; }
.path-node.locked { background: #eee7dd; box-shadow: 0 6px 0 #d8cfc2; font-size: 1.1rem; }
.path-node.boss { width: 86px; height: 86px; border-radius: var(--r-xl); background: linear-gradient(135deg, #8b7bff, #b9a8ff); box-shadow: 0 6px 0 #6a5ad6; color: #fff; font-size: 2rem; }
.path-node.boss.done { background: linear-gradient(135deg, #ffc23d, #ffdb7a); box-shadow: 0 6px 0 #d99a00; }
.path-node.boss.locked { background: #e3dcf5; box-shadow: 0 6px 0 #c9c0e6; }
.pn-pct { position: absolute; bottom: -10px; left: 50%; transform: translateX(-50%); background: #fff; color: #7a5600; font-size: .7rem; padding: 1px 6px; border-radius: 8px; box-shadow: var(--shadow); }
.path-label.dim { opacity: .6; }
.gauge { margin: 10px auto 4px; max-width: 360px; }
.gauge-bar { position: relative; height: 14px; background: #efe6da; border-radius: 99px; overflow: visible; }
.gauge-bar i { display: block; height: 100%; background: linear-gradient(90deg, #3cc5a0, #2a9d8f); border-radius: 99px; transition: width .5s; }
.gauge-mark { position: absolute; top: -4px; width: 4px; height: 22px; background: var(--hot); border-radius: 2px; margin-inline-start: -2px; }
.gauge small { display: block; margin-top: 6px; font-weight: 700; }
.lock-card { border: 3px dashed #d9cfc1; }
.part.locked { opacity: .55; } .ppct { font-weight: 800; color: var(--primary-d); }
.scard-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0 6px; }
.scard-item { background: #faf6ef; border-radius: var(--r-md); padding: 10px 4px; text-align: center; display: flex; flex-direction: column; }
.scard-item span { font-size: 28px; } .scard-item small { color: var(--muted); font-size: .82rem; }
.scard-item.makkah { background: #fff3dc; } .scard-item.madinah { background: #e4f6ef; }
.didyouknow { background: #fff6d6; border-radius: var(--r-md); padding: 10px 12px; margin-top: 8px; line-height: 1.45; }
.boss-emblem { font-size: 110px; margin-top: 10px; }
.pass-msg { font-weight: 800; background: #f3ede4; border-radius: var(--r-sm); padding: 10px 12px; }
.place-opt { display: flex; flex-direction: column; align-items: center; } .big-emoji-sm { font-size: 40px; }
.world-head + .path-row { margin-top: 34px; }
.boss-card { background: linear-gradient(135deg, #8b7bff, #b9a8ff); box-shadow: 0 6px 0 #6a5ad6; } .boss-card .cc-ar { font-size: 48px; }

/* ---------- Mot par mot & tajwid ---------- */
.tw { border-radius: 8px; cursor: pointer; transition: background .2s; }
.tw-on { background: #d8efe9; }
.word-bubble { position: absolute; z-index: 40; background: var(--ink); color: #fff; padding: 6px 12px; border-radius: var(--r-sm); font-weight: 700; width: 140px; text-align: center; font-size: .95rem; pointer-events: none; animation: pop .25s; }
.tj-silent { color: #a6a0ad; }
.tj-madd { color: #e3760c; }
.tj-madd-strong { color: #d0233b; }
.tj-qalqala { color: #1d72d8; }
.tj-ghunna { color: #1f9d55; }
.tj-idgham { color: #8e44ad; }
.tj-iqlab { color: #00a3a3; }
.tj-legend { display: grid; gap: 4px; }
.tj-row { display: flex; align-items: center; gap: 10px; }
.tj-row .ar { font-size: 26px; width: 28px; text-align: center; }

/* ---------- Alphabet ---------- */
.alpha-ic { font-family: 'Baloo Bhaijaan 2', serif; font-size: 30px; }
.letter-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.letter { background: var(--card); border-radius: var(--r-md); padding: 8px 4px; box-shadow: var(--shadow); display: flex; flex-direction: column; align-items: center; border: 3px solid transparent; }
.letter .ar { font-family: 'Baloo Bhaijaan 2', serif; font-size: 40px; line-height: 1.3; }
.letter small { color: var(--muted); font-weight: 700; }
.letter.seen { border-color: #bfe9d8; }
.big-letter { font-family: 'Baloo Bhaijaan 2', serif; font-size: 130px; line-height: 1.2; width: 190px; height: 190px; border-radius: 40px; background: linear-gradient(135deg, #e6f6f3, #fff); box-shadow: var(--shadow); color: var(--primary-d); margin: 6px auto; display: block; }
.letter-name { font-family: 'Baloo Bhaijaan 2', serif; font-size: 32px; }
.forms { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.form { background: var(--card); border-radius: var(--r-md); padding: 8px 2px; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.form .ar { font-family: 'Baloo Bhaijaan 2', serif; font-size: 40px; line-height: 1.4; } .form small { color: var(--muted); font-size: .82rem; }
.ex-word { font-size: 40px; padding: 6px 18px; border-radius: var(--r-md); background: #fff6d6; margin: 8px auto; display: block; }
.haraka { display: flex; align-items: center; gap: 14px; width: 100%; text-align: start; }
.haraka-l { font-family: 'Baloo Bhaijaan 2', serif; font-size: 46px; min-width: 70px; text-align: center; }
.alpha-opt { font-family: 'Baloo Bhaijaan 2', serif; font-size: 48px; line-height: 1.3; }
.big-form { font-family: 'Baloo Bhaijaan 2', serif; font-size: 80px; }
.input.time { width: auto; flex: 1; }
.remind-row > button { padding: 10px 14px; border-radius: var(--r-sm); background: #f3ede4; font-weight: 800; }
.remind-row > button.sel { background: var(--primary); color: #fff; }

/* ---------- Famille, Ramadan, tout-petits ---------- */
.family-card { margin-top: 20px; }
.family-kids { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.fk { background: color-mix(in srgb, var(--c) 20%, white); border-radius: var(--r-sm); padding: 4px 10px; font-weight: 700; font-size: .85rem; }
.ramadan { background: linear-gradient(135deg, #2d3561, #5a4fa1); color: #fff; }
.tiny-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.tiny-btn { border-radius: var(--r-xl); padding: 22px 8px; display: flex; flex-direction: column; align-items: center; gap: 6px; color: #fff; font-size: 1.15rem; box-shadow: 0 7px 0 rgba(0,0,0,.15); min-height: 150px; justify-content: center; }
.tiny-btn span { font-size: 64px; } .tiny-btn:active { transform: translateY(4px); }
.tiny-btn.b1 { background: #2a9d8f; } .tiny-btn.b2 { background: #ff7a59; } .tiny-btn.b3 { background: #8b7bff; }
.tiny-btn.b4 { background: #ffb547; } .tiny-btn.b5 { background: #ff7eb6; } .tiny-btn.b6 { background: #4fb3ff; }
.stars-count { font-weight: 800; font-size: 1.2rem; }

/* ---------- Écrans avec encoche (plein écran) ---------- */
body { padding-left: var(--safe-left); padding-right: var(--safe-right); }
/* écrans sans barre de titre (choix du profil, bienvenue) : on descend sous l'encoche */
.pad.screen { padding-top: calc(20px + var(--safe-top)); }
#splash { padding-top: var(--safe-top); }
.ios-tip { border: 3px solid #cfe3ff; margin-top: 16px; } .ios-tip ol { margin: 8px 0; padding-inline-start: 22px; line-height: 1.6; } .ios-share { display: inline-block; background: #e7f0ff; color: #1a6fd6; border-radius: 6px; padding: 0 6px; font-weight: 800; }

/* ---------- Lecteur audio flottant ---------- */
.player-bar { position: fixed; left: 12px; right: 12px; bottom: calc(12px + var(--safe-bottom)); z-index: 45; display: none; align-items: center; gap: 10px; background: var(--ink); color: #fff; border-radius: var(--r-lg); padding: 8px 10px; box-shadow: 0 8px 24px rgba(0, 0, 0, .25); max-width: 560px; margin: 0 auto; }
.player-bar.on { display: flex; animation: pop .25s; }
.pb-label { flex: 1; min-width: 0; font-weight: 700; font-size: .92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pb-btn { width: 48px; height: 48px; border-radius: 50%; background: var(--primary); color: #fff; font-size: 22px; flex: none; }
.pb-btn.stop { background: #ef5b5b; }
body.audio-on .fab { display: none; }
body.audio-on .toast { bottom: calc(90px + var(--safe-bottom)); }

/* ---------- Célébration « sourate réussie » ---------- */
.trophy-wrap { position: relative; width: 150px; height: 150px; margin: 0 auto; display: flex; align-items: center; justify-content: center; }
.trophy { font-size: 96px; position: relative; z-index: 1; animation: pop .6s cubic-bezier(.2, 1.6, .4, 1), bounce 1.6s .6s ease-in-out infinite; }
.trophy-rays { position: absolute; inset: -10px; border-radius: 50%;
  background: repeating-conic-gradient(from 0deg, rgba(255, 194, 61, .55) 0 12deg, transparent 12deg 30deg); animation: spin 8s linear infinite;
  -webkit-mask: radial-gradient(circle, #000 30%, transparent 70%); mask: radial-gradient(circle, #000 30%, transparent 70%); }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes bounce { 50% { transform: translateY(-10px) scale(1.05); } }
.trophy-stars span { display: inline-block; font-size: 34px; margin: 0 4px; opacity: 0; animation: starIn .5s forwards; }
@keyframes starIn { from { opacity: 0; transform: scale(.2) rotate(-90deg); } to { opacity: 1; transform: scale(1) rotate(0); } }
.unlocked-next { display: flex; align-items: center; gap: 12px; text-align: start; background: #e6f6f3; border: 3px solid #bfe9df; }
.trophy-modal .surah-ar { font-size: 44px; }

/* ---------- Rapports d'erreurs ---------- */
.report-chip { background: #fff1e6; color: #b65a1c; }
.report-cats { justify-content: flex-start; margin-bottom: 8px; }
.report-speech .ar { font-family: 'Amiri Quran', serif; font-size: 1.1rem; }
.report { border-inline-start: 6px solid #ffb547; }

/* ---------- Personnages, photo, garçon/fille ---------- */
.avatar { overflow: hidden; }
.avatar-svg { display: block; width: 100%; height: 100%; }
.avatar-svg svg { width: 100%; height: 100%; display: block; }
.avatar-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }
.choice.svg { padding: 2px; width: 60px; height: 60px; background: color-mix(in srgb, var(--primary) 8%, white); }
.gender-opt { align-items: center; }
.gender-ic { width: 64px; height: 64px; display: block; }
.photo-preview { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.photo-thumb { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; box-shadow: var(--shadow); }

/* ---------- Chemin des lettres ---------- */
.alpha-path { padding: 10px 4px 10px; }
.alpha-node .pn-num { font-family: 'Baloo Bhaijaan 2', serif; font-size: 1.4rem; }
.stage-emblem { font-size: 72px; }
.stage-letters { grid-template-columns: repeat(auto-fit, minmax(70px, 1fr)); }
.block-btn { display: block; margin: 20px auto; }
.studio-letter .studio-l { font-family: 'Baloo Bhaijaan 2', serif; font-size: 40px; }
.slot { display: flex; flex-direction: column; align-items: center; gap: 4px; background: #faf6ef; border-radius: var(--r-sm); padding: 6px 8px; border: 2px solid transparent; }
.slot.has { border-color: #bfe9d8; } .slot.rec-on { border-color: var(--bad); background: #fff1f1; }
.slot-t { font-family: 'Baloo Bhaijaan 2', serif; font-size: 26px; } .slot small { color: var(--muted); font-size: .82rem; }


/* ================================================================
   RAWDA — nouvelle identité visuelle : jardin précieux & apprentissage
   Couche de présentation uniquement : aucune logique métier modifiée.
   ================================================================ */
/* (variables : voir la charte unique en haut du fichier) */
html, body { background: var(--bg); color: var(--ink); }
body {
  background-image: radial-gradient(ellipse at 8% 0%, rgba(224,190,112,.18), transparent 34%),
    radial-gradient(ellipse at 100% 22%, rgba(72,148,111,.12), transparent 34%),
    linear-gradient(180deg,#f8f5ed 0%,#f2f0e6 100%);
}
#splash { background: radial-gradient(ellipse at 50% 32%,#176b50 0%,#084b3a 58%,#06382d 100%); color: #f7e8bd; }
#splash .splash-mark { width: min(72vw,300px); height: min(72vw,300px); object-fit: contain; border-radius: var(--r-lg); box-shadow: 0 24px 60px rgba(0,0,0,.24); }
#splash p { margin: 20px 0 0; font-size: 1.05rem; font-weight: 800; letter-spacing: .04em; color: #f8e7b7; }
#splash p span { display:block; margin-top:5px; font-size:.78rem; font-weight:600; letter-spacing:.02em; color:rgba(248,231,183,.78); }
.logo { background: #07513f url('../img/rawda-emblem.jpg') center/cover no-repeat; color: transparent; font-size: 0; border: 2px solid rgba(218,177,83,.8); box-shadow: 0 9px 22px rgba(7,65,50,.2); }
.logo.big { background-size: cover; }
.topbar { background: rgba(248,246,239,.94); border-bottom: 1px solid rgba(210,199,176,.7); backdrop-filter: blur(16px); }
.topbar-title { color: #173c30; letter-spacing: -.02em; }
.icon-btn { background: #fffdf7; color: var(--primary-d); box-shadow: 0 3px 12px rgba(24,55,46,.09); border: 1px solid #eee7d9; }
.btn { border-radius: 15px; background: #fffdf7; box-shadow: 0 4px 0 #e3dccd; color: #234438; }
.btn.primary { background: linear-gradient(135deg,#0c8060,#07513f); box-shadow: 0 4px 0 #043d30; color:#fff; }
.btn.hot { background: linear-gradient(135deg,#e8b957,#cc8a2c); box-shadow: 0 4px 0 #a66a1e; color:#fff; }
.btn.listen { background:#e8f2ec; box-shadow:0 4px 0 #c8ded0; color:#176247; }
.card, .profile-card, .tile, .srow, .action, .game-card, .continue-card, .goal-card, .part, .option, .verse {
  box-shadow: 0 7px 20px rgba(27,57,43,.065), 0 1px 3px rgba(27,57,43,.04);
}
.card { border: 1px solid rgba(226,216,195,.72); }
.chip { background:#eeeade; color:#4d6257; }
.chip.sel { background:var(--primary); color:#fff; }
.bar { background:#e6e4d8; }
.bar i { background:linear-gradient(90deg,#e5bb5d,#c78b31); }
.profile-card { border-width:2px; border-radius: var(--r-lg); background:linear-gradient(155deg,#fffefa,#f8f5eb); }
.profile-card.add { border:2px dashed #cfc5ae; background:rgba(255,253,247,.58); }
.avatar { border:2px solid rgba(255,255,255,.9); box-shadow:0 3px 10px rgba(0,0,0,.08); }
.profile-card .avatar { width:88px; height:88px; }
.pname { color:#173c30; }
.parent-link { color:#557166; }
.input { background:#fffefa; border:1.5px solid #e4ddce; }
.input:focus { border-color:#178364; box-shadow:0 0 0 3px rgba(23,131,100,.12); }
.goal-card { background:linear-gradient(125deg,#fffdf7,#f0f4e9); border:1px solid #e6e2d3; border-radius: var(--r-lg); }
.continue-card { border:1px solid rgba(222,202,151,.7); background:linear-gradient(120deg,#07513f,#0b7657 70%,#1c8763); color:#fff; border-radius: var(--r-lg); }
.continue-card .muted, .continue-card small { color:rgba(255,255,255,.78); }
.cc-go { background:rgba(255,255,255,.18); border:1px solid rgba(255,255,255,.25); border-radius:50%; }
.tiles { gap:12px; }
.tile { border:1px solid #e8e2d4; background:linear-gradient(145deg,#fffefa,#f8f6ee); border-radius: var(--r-lg); }
.tile b { color:#234638; }
.tile.hot { background:linear-gradient(145deg,#fff7e8,#f9edcf); border:1px solid #e9d4a7; }
.tile.done { background:#edf4ec; }
.path-node { background:#e8e5da; box-shadow:0 5px 0 #d2ccbc; }
.path-node.started { background:#f3d88e; box-shadow:0 5px 0 #d5ae50; }
.path-node.done { background:linear-gradient(145deg,#15936c,#086047); box-shadow:0 5px 0 #064b39; }
.path-node.rec { box-shadow:0 5px 0 #d2ccbc, 0 0 0 5px rgba(233,178,70,.6); }
.path-node.started.rec { box-shadow:0 5px 0 #d5ae50, 0 0 0 5px rgba(233,178,70,.6); }
.surah-head { background:linear-gradient(145deg,#e8f0e5,#fffdf7 70%); border:1px solid #dce5d7; }
.surah-ar, .basmala { color:#12684e; }
.action { border:1px solid #e8e2d4; background:#fffefa; }
.action.hot { background:linear-gradient(125deg,#d49a3f,#e7b95c); border:0; }
.verse.playing, .basmala.playing { border-color:#168362; background:#edf6ef; }
.game-card { border:1px solid #e7e2d5; border-inline-start:6px solid var(--g); background:#fffefa; }
.gc-icon { border-radius:17px; }
.option { background:#fffefa; box-shadow:0 4px 0 #e5dfd2; }
.option.right { background:var(--success-bg); box-shadow:0 4px 0 #c5dfc9; }
.option.wrong { background:var(--error-bg); }
.xp-pill { background:var(--gold-soft); color:var(--gold-ink); }
.ring-bg { stroke:#e3e4d8; }
.ring-fg { stroke-linecap:round; }
.review-card { border:1px solid #d8e8d9; background:#f7fbf4; }
.modal { border:1px solid #e8dfcc; border-radius: var(--r-xl); box-shadow:0 24px 70px rgba(13,43,32,.22); }
.toast { background:#104f3d; color:#fff; border:1px solid rgba(231,195,117,.5); }
.player-bar { background:#0a4e3b; box-shadow:0 8px 30px rgba(4,48,36,.25); }
@media (min-width:700px) {
  .home { max-width:760px; margin:0 auto; }
  .pad { padding-left:24px; padding-right:24px; }
}
@media (prefers-reduced-motion: reduce) {
  /* animations réduites (réglage du téléphone) : une seule fois, jamais en boucle — sinon clignotement très rapide */
  *, *::before, *::after { animation-duration:.01ms !important; animation-iteration-count:1 !important; transition-duration:.01ms !important; }
}

/* Ajustements de la nouvelle identité pour les écrans ajoutés depuis (alphabet, trophées, profils) */
.path-node.locked { background:#ece8dc; box-shadow:0 5px 0 #d6cfbf; }
.alpha-node.done .pn-num, .path-node.done .pn-num { color:#fff; }
.trophy-modal .surah-ar { color:#12684e; }
.unlocked-next { background:#edf6ef; border-color:#cfe5d6; }
.choice.svg { background:#eef4ec; }
.studio-verse.recorded, .letter.seen { border-color:#cfe5d6; }

/* ---------- Mémoriser : récitation sur place ---------- */
.mem-recite { margin: 6px 0 10px; }
.mem-rec { font-size: 1.1rem; padding: 14px 26px; }
.mem-rec.on { background: linear-gradient(135deg, #c95b55, #a8423d); box-shadow: 0 4px 0 #7f2f2b; animation: glow 1.2s infinite; }
.mem-status { margin-top: 6px; }
.w.rv-ok { color: #1f7a54; background: #e7f4ec; animation: pop .3s; }
.w.rv-skip { color: #fff; background: #c95b55; }
.w.rv-err { color: #fff; background: #d89a35; }

/* ---------- Diplômes ---------- */
.dipl-grid { display: grid; gap: 10px; }
.dipl-card { display: flex; align-items: center; gap: 12px; width: 100%; text-align: start; }
.dipl-ic { font-size: 34px; }
.dipl-frame { background: #fff; border-radius: var(--r-sm); padding: 6px; box-shadow: var(--shadow); margin-bottom: 14px; }
.dipl-img { width: 100%; display: block; border-radius: 8px; }

/* ---------- Boucle A-B et mode coucher ---------- */
.loop-card { display: grid; gap: 8px; }
.loop-row { align-items: center; font-weight: 700; font-size: .9rem; }
.loop-sel { width: auto; padding: 6px 8px; font-size: .95rem; }
.bed-btn { background: #1e2a4a; color: #f3e7c0; box-shadow: 0 4px 0 #111a33; }
.bedtime { position: fixed; inset: 0; z-index: 80; background: #05070d; color: #6d7896; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 20px; text-align: center; }
.bed-moon { font-size: 80px; opacity: .35; animation: bounce 6s ease-in-out infinite; }
.bed-name { font-size: 1.4rem; font-weight: 800; color: #8d97b4; }
.bed-sub, .bed-left { font-size: .95rem; }
.bedtime .bed-stop { opacity: 0; pointer-events: none; transition: opacity .3s; background: #1e2a4a; color: #f3e7c0; box-shadow: none; margin-top: 20px; }
.bedtime.show .bed-stop { opacity: 1; pointer-events: auto; }

/* ---------- Leçons de tajwid ---------- */
.tj-lessons { display: grid; gap: 10px; }
.tj-dot { font-family: 'Amiri Quran', serif; font-size: 34px; width: 52px; text-align: center; }
.tj-explain p { line-height: 1.55; margin: 0; }
.tj-big { font-size: 42px; }
.tj-examples { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin-bottom: 16px; }
.tj-ex { background: var(--card); border-radius: var(--r-md); padding: 10px 6px; box-shadow: var(--shadow); display: flex; flex-direction: column; align-items: center; gap: 4px; }
.tj-ex .ar { font-size: 30px; line-height: 1.8; }
.tj-ex small { color: var(--muted); font-size: .82rem; }
.tj-quiz-word { font-size: 54px; line-height: 1.9; padding: 4px 20px; border-radius: var(--r-md); background: #fffdf7; }

/* ---------- Histoires ---------- */
.story-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.story-card { background: var(--card); border-radius: var(--r-lg); padding: 14px 10px; box-shadow: var(--shadow); display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; border: 1px solid #ece5d5; }
.story-card small { color: var(--muted); font-size: .82rem; }
.story-ic { font-size: 40px; }
.story-hero { font-size: 90px; text-align: center; }
.story-text p { line-height: 1.65; font-size: 1.05rem; }
.story-action { border: 1px solid #e9d4a7; background: #fff8ea; }

/* ================================================================
   THÈME SOMBRE (réglage parent : clair / sombre / automatique)
   ================================================================ */
:root[data-theme="dark"] {
  --bg: #0e1a16; --card: #16251f; --ink: #e8efe9; --muted: #93a79c; --line: #253a31;
  --primary: #2fa37f; --primary-d: #1d7a5d; --hot: #e0aa4c; --ok: #4cc28d; --bad: #e07a73; --gold: #e6b84f;
  --surface-2: #1b2c25; --text-2: #c4d3ca; --border: #2a4037; --emerald: #0f5a46; --accent: #e6b84f;
  --success-bg: #173a2e; --error-bg: #3a1f1d; --gold-soft: #2c2716; --gold-ink: #f0d58f;
  --sh-1: 0 6px 18px rgba(0,0,0,.35); --sh-2: 0 10px 26px rgba(0,0,0,.45);
  --shadow: var(--sh-1);
  color-scheme: dark;
}
:root[data-theme="dark"] html, :root[data-theme="dark"] body { background: var(--bg); color: var(--ink); }
:root[data-theme="dark"] body { background-image: radial-gradient(ellipse at 8% 0%, rgba(224,190,112,.07), transparent 34%), linear-gradient(180deg,#0f1c18,#0b1512); }
:root[data-theme="dark"] .topbar, :root[data-theme="dark"] .game-head, :root[data-theme="dark"] .follow-top { background: rgba(14,26,22,.94); border-bottom-color: #22362e; }
:root[data-theme="dark"] .topbar-title, :root[data-theme="dark"] .pname, :root[data-theme="dark"] .tile b, :root[data-theme="dark"] h1,
:root[data-theme="dark"] h2, :root[data-theme="dark"] h3, :root[data-theme="dark"] .hello { color: var(--ink); }
:root[data-theme="dark"] .card, :root[data-theme="dark"] .tile, :root[data-theme="dark"] .action, :root[data-theme="dark"] .option,
:root[data-theme="dark"] .game-card, :root[data-theme="dark"] .srow, :root[data-theme="dark"] .profile-card, :root[data-theme="dark"] .verse,
:root[data-theme="dark"] .goal-card, :root[data-theme="dark"] .part, :root[data-theme="dark"] .modal, :root[data-theme="dark"] .letter,
:root[data-theme="dark"] .form, :root[data-theme="dark"] .story-card, :root[data-theme="dark"] .tj-ex, :root[data-theme="dark"] .badge,
:root[data-theme="dark"] .feature-list div, :root[data-theme="dark"] .opt, :root[data-theme="dark"] .choice, :root[data-theme="dark"] .scard-item,
:root[data-theme="dark"] .stat, :root[data-theme="dark"] .setting, :root[data-theme="dark"] .slot, :root[data-theme="dark"] .follow-dock {
  background: var(--card); color: var(--ink); border-color: #263c33; }
:root[data-theme="dark"] .profile-card.add, :root[data-theme="dark"] .tile.hot, :root[data-theme="dark"] .story-action { background: #1b2c25; border-color: #3a4a32; }
:root[data-theme="dark"] .surah-head, :root[data-theme="dark"] .home-head { background: linear-gradient(145deg,#173027,#121f1a); }
:root[data-theme="dark"] .btn { background: #1e3028; color: var(--ink); box-shadow: 0 4px 0 #0a120f; }
:root[data-theme="dark"] .btn.primary { background: linear-gradient(135deg,#1f8f6c,#0f6047); color: #fff; }
:root[data-theme="dark"] .btn.hot { background: linear-gradient(135deg,#d6a547,#b0741f); color: #fff; }
:root[data-theme="dark"] .btn.ghost { background: transparent; color: #8fd3b6; box-shadow: none; }
:root[data-theme="dark"] .btn.listen { background: #183a2f; color: #9fe0c4; box-shadow: 0 4px 0 #0b1d17; }
:root[data-theme="dark"] .chip, :root[data-theme="dark"] .seg button, :root[data-theme="dark"] .tag { background: #21342c; color: #c6d6cd; }
:root[data-theme="dark"] .chip.sel, :root[data-theme="dark"] .seg button.sel { background: var(--primary); color: #fff; }
:root[data-theme="dark"] .input { background: #101d18; color: var(--ink); border-color: #2a4037; }
:root[data-theme="dark"] .icon-btn { background: #1b2c25; color: #cfe6da; border-color: #2a4037; }
:root[data-theme="dark"] .bar, :root[data-theme="dark"] .gauge-bar { background: #23352d; }
:root[data-theme="dark"] .ring-bg { stroke: #23352d; }
:root[data-theme="dark"] .path-node { background: #23352d; box-shadow: 0 5px 0 #0d1713; color: #a9bdb2; }
:root[data-theme="dark"] .path-node.locked { background: #1a2822; box-shadow: 0 5px 0 #0d1713; }
:root[data-theme="dark"] .path-node.rec { box-shadow: 0 5px 0 #0d1713, 0 0 0 5px rgba(233,178,70,.6); }
:root[data-theme="dark"] .fr, :root[data-theme="dark"] .lit { color: #c4d3ca; }
:root[data-theme="dark"] .surah-ar, :root[data-theme="dark"] .basmala, :root[data-theme="dark"] .trophy-modal .surah-ar { color: #7fd4b1; }
:root[data-theme="dark"] .quran { color: #f1f5f0; }
:root[data-theme="dark"] .verse.playing, :root[data-theme="dark"] .basmala.playing { background: #173a2e; border-color: var(--primary); }
:root[data-theme="dark"] .option.right { background: #173a2e; } :root[data-theme="dark"] .option.wrong { background: #3a1f1d; }
:root[data-theme="dark"] .didyouknow, :root[data-theme="dark"] .xp-pill, :root[data-theme="dark"] .xp-gain, :root[data-theme="dark"] .pass-msg { background: #2c2716; color: #f0d58f; }
:root[data-theme="dark"] .hidden-w, :root[data-theme="dark"] .fw.hid { background: #24372f; }
:root[data-theme="dark"] .tj-quiz-word, :root[data-theme="dark"] .ex-word { background: #1d2f28; }
:root[data-theme="dark"] .tj-silent { color: #7d8a85; }
:root[data-theme="dark"] .muted, :root[data-theme="dark"] small { color: var(--muted); }
:root[data-theme="dark"] .modal-wrap { background: rgba(0,0,0,.6); }
:root[data-theme="dark"] .garden { background: linear-gradient(#14271f,#10201a); }
:root[data-theme="dark"] .dipl-frame { background: #1b2c25; }
:root[data-theme="dark"] .streak { background: #1b2c25; } :root[data-theme="dark"] .cc-go { background: rgba(255,255,255,.12); }

/* ---------- Langue : bouton FR / ع et mise en page arabe (de droite à gauche) ---------- */
.lang-btn { display: inline-flex; align-items: center; gap: 2px; padding: 3px; border-radius: 99px; background: var(--card); box-shadow: 0 2px 0 #e2d8ca; border: 1px solid #e6dfd0; font-weight: 800; font-size: .9rem; line-height: 1; flex: none; }
.lang-btn span { padding: 9px 12px; border-radius: 99px; color: var(--muted); min-width: 40px; text-align: center; }
.lang-btn span:last-child { font-family: 'Baloo Bhaijaan 2', 'Amiri Quran', serif; font-size: 1.05rem; }
.lang-btn span.on { background: var(--primary); color: #fff; }
.lang-btn.corner { position: absolute; top: calc(12px + var(--safe-top)); inset-inline-end: 14px; z-index: 5; }
.pad.center.welcome, #app > .pad { position: relative; }
.head-side { display: flex; flex-direction: column; align-items: center; gap: 8px; }
:root[lang="ar"] body, :root[lang="ar"] button, :root[lang="ar"] input, :root[lang="ar"] select, :root[lang="ar"] textarea { font-family: 'Baloo Bhaijaan 2', 'Nunito', system-ui, sans-serif; }
:root[lang="ar"] body { font-size: 18px; }
:root[dir="rtl"] .lit { direction: ltr; unicode-bidi: isolate; }
:root[lang="ar"] .fr { direction: rtl; font-family: 'Baloo Bhaijaan 2', system-ui, sans-serif; line-height: 1.7; }
:root[dir="rtl"] .icon-btn.back, :root[dir="rtl"] .cc-go { transform: scaleX(-1); }
:root[lang="ar"] .lit { display: none; }

/* ---------- Module « Apprendre la prière » ---------- */
.pr-art svg { display: block; width: 100%; height: 100%; }
.pr-art.big { width: min(240px, 70vw); height: min(230px, 66vw); margin: 0 auto; }
.pr-art.mid { width: 160px; height: 150px; margin: 0 auto; }
.pr-art.hero { width: 130px; height: 130px; flex: none; }
.pr-hero { display: flex; align-items: center; gap: 12px; background: linear-gradient(135deg, #eef7f1, #fffdf7); }
.pr-tile .aicon { font-size: 30px; }
.pr-tile.done { background: #edf6ef; }
.pr-check { color: var(--primary); font-weight: 800; font-size: 1.3rem; }
.pr-step h2 { margin: 6px 0 2px; }
.pr-dua { background: #f6faf6; border: 1px solid #dcebe0; border-radius: var(--r-md); padding: 10px 12px; margin: 10px 0; }
.pr-ar { font-family: 'Amiri Quran', serif; font-size: 1.55rem; line-height: 2.1; color: var(--primary); text-align: center; }
.pr-dua.big .pr-ar { font-size: 1.9rem; }
.pr-lit { font-style: italic; color: var(--gold-ink); font-size: .95rem; margin: 2px 0; }
.pr-mean { color: var(--text-2); font-size: .95rem; margin: 4px 0 8px; }
:root[lang="ar"] .pr-mean { display: none; }
.pr-times { display: inline-block; background: var(--gold-soft); color: var(--gold-ink); border-radius: var(--r-sm); padding: 2px 10px; font-weight: 800; }
.pr-times.big { font-size: 1.3rem; margin: 4px 0; }
.pr-time .aicon { font-size: 30px; }
.pr-rakat { text-align: center; } .pr-rakat i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--primary); margin: 0 2px; }
.pr-rakat small { display: block; }
.pr-minis { justify-content: center; gap: 2px; } .pr-mini { width: 44px; height: 44px; display: inline-block; } .pr-mini svg { width: 100%; height: 100%; }
.pr-rak ul { margin: 6px 0 0; padding-inline-start: 20px; }
.pr-pillars { display: grid; grid-template-columns: 1fr; gap: 8px; }
.pr-pillar { display: flex; align-items: center; gap: 10px; background: var(--card); border-radius: var(--r-md); padding: 10px 12px; box-shadow: var(--shadow); }
.pr-pillar b { flex: 1; } .pr-pillar .aicon { font-size: 26px; }
.pr-pnum { width: 28px; height: 28px; border-radius: 50%; background: var(--primary); color: #fff; font-weight: 800; display: grid; place-items: center; }
.pr-tas-card .pr-ar { font-size: 2rem; }
.pr-count { font-size: 1.6rem; font-weight: 800; color: var(--primary); margin: 6px 0; }
.pr-tasbih { font-size: 64px; width: 120px; height: 120px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff, #e9f4ee); box-shadow: 0 6px 0 #cfe3d7, 0 10px 24px rgba(11,128,97,.15); margin: 6px auto; display: block; }
.pr-tasbih:active { transform: translateY(3px); box-shadow: 0 3px 0 #cfe3d7; }
.pr-qicon { font-size: 72px; }
.option.ar-opt span { font-family: 'Amiri Quran', serif; font-size: 1.3rem; }
.pr-preview { width: 100%; height: 70vh; border: 0; border-radius: var(--r-sm); background: #e9e4d8; }
:root[data-theme="dark"] .pr-dua { background: #1d2c26; border-color: #2c4038; }
:root[data-theme="dark"] .pr-ar { color: #8fd3b5; }
:root[data-theme="dark"] .pr-hero, :root[data-theme="dark"] .pr-tile.done { background: #1d2c26; }
.tile.prayer-tile { grid-column: span 2; background: linear-gradient(135deg, #e8f5ee, #fff8e6); }

.pr-nav { justify-content: space-between; margin-top: 8px; }
.pr-prog span { width: 14px; }
.pr-tile { width: 100%; margin: 0 0 10px; }
.pr-time { width: 100%; margin: 0 0 10px; }
.pr-mini { width: 62px; height: 62px; }

/* ===== Invocations du quotidien, cartes alphabet, fiches (illustrations Muslim Guard) ===== */
.mg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin: 8px 0 14px; }
.mg-tile { display: flex; flex-direction: column; align-items: stretch; padding: 0; border: 0; border-radius: var(--r-md); overflow: hidden; background: var(--card, #fff); box-shadow: 0 2px 8px rgba(0,0,0,.08); cursor: pointer; position: relative; }
.mg-tile img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: center top; display: block; }
.mg-tile b { padding: 8px 8px 10px; font-size: 14px; line-height: 1.25; text-align: center; }
.mg-tile.seen::after { content: '✓'; position: absolute; top: 6px; inset-inline-end: 6px; width: 24px; height: 24px; border-radius: 50%; background: #0b8061; color: #fff; font-weight: 800; line-height: 24px; text-align: center; }
.mg-dua { display: flex; flex-direction: column; align-items: center; }
.mg-dua-img { width: min(240px, 70%); border-radius: var(--r-md); display: block; margin: 0 auto 6px; }
.mg-part { width: 100%; padding: 8px 0; }
.mg-part.sep { border-top: 1px dashed rgba(0,0,0,.15); margin-top: 6px; }
.mg-ar { font-size: 26px; line-height: 1.9; text-align: center; }
.mg-note { text-align: center; font-weight: 700; color: var(--gold-ink); font-size: 14px; }
.mg-credit { font-size: 13px; color: var(--muted); text-align: center; margin: 14px 0 4px; }
.mg-animal { display: flex; flex-direction: column; align-items: center; gap: 4px; margin: 12px auto; padding: 0 0 8px; border: 0; border-radius: var(--r-lg); overflow: hidden; background: var(--card, #fff); box-shadow: 0 2px 10px rgba(0,0,0,.1); cursor: pointer; width: min(260px, 80%); }
.mg-animal img { width: 100%; display: block; }
.mg-animal .ar { font-size: 30px; }
.mg-print { margin-bottom: 10px; }
.mg-print .row.wrap { margin-top: 8px; }
.pt-card { overflow-x: auto; }
table.pt { width: 100%; border-collapse: collapse; }
table.pt th { font-size: 12px; font-weight: 800; padding: 2px; }
table.pt th.today { color: var(--primary); }
table.pt tbody th { text-align: start; white-space: nowrap; }
table.pt tbody th span { font-size: 18px; margin-inline-end: 2px; }
table.pt td { text-align: center; padding: 3px 0; }
.pt-card { padding-inline: 10px; }
table.pt tbody th small { font-size: .8rem; }
.pt-dot { width: min(38px, 8.6vw); height: min(38px, 8.6vw); border-radius: 50%; border: 2px solid #cfe5db; background: #eef6f1; color: #fff; font-weight: 900; font-size: 16px; cursor: pointer; padding: 0; }
.pt-dot.on { background: var(--primary); border-color: var(--primary); }
.pt-dot:disabled { opacity: .35; }
:root[data-theme="dark"] .mg-tile, :root[data-theme="dark"] .mg-animal { background: #1f2a26; }
:root[data-theme="dark"] .pt-dot { background: #24332d; border-color: #35493f; }

/* ================================================================
   Refonte 3.5 — hiérarchie de l'accueil, profils, logo centré
   ================================================================ */
.logo { background: var(--emerald) url('../img/rawda-mark.webp') center/contain no-repeat; width: 112px; height: 112px; border-radius: var(--r-xl); line-height: normal; }
.logo.big { width: 136px; height: 136px; background-size: contain; border-radius: var(--r-xl); }
.hero { margin: 32px 0 22px; }
.hero h1 { margin: 18px 0 0; }
.profile-grid { gap: var(--sp-4); }
.profile-card { padding: 20px 12px 16px; transition: transform .12s; }
.profile-card:active, .tile:active, .continue-card:active { transform: scale(.98); }
.profile-card .bar.sm { height: 8px; margin: 10px 14px 0; background: var(--surface-2); }
.profile-card .bar.sm i { background: var(--c, var(--primary)); }
.continue-card { min-height: 112px; padding: 20px 18px; margin: 6px 0 14px; box-shadow: var(--sh-2); }
.continue-card .cc-name { font-size: 1.35rem; line-height: 1.25; }
.continue-card small { font-weight: 800; letter-spacing: .03em; }
.continue-card .cc-ar { font-size: 38px; }
.goal-card { padding: 12px 14px; }
.home-sec { font-size: 1.05rem; color: var(--text-2); margin: 24px 4px 10px; font-weight: 800; }
.tiles.three { grid-template-columns: repeat(3, 1fr); gap: 10px; }
.tiles.three .tile { padding: 14px 6px; }
.tiles.three .tile-icon { font-size: 30px; }
.tiles.three .tile b { font-size: .95rem; text-align: center; }
.tiles.three .tile small { font-size: .78rem; text-align: center; }
.tile b { text-align: center; }
.hero h1 { font-size: 1.6rem; text-wrap: balance; }
h1, h2, .cc-name, .pname { text-wrap: balance; }

table.pt { table-layout: fixed; } table.pt tbody th { width: 64px; overflow: hidden; } table.pt tbody th small { display: block; font-size: .72rem; }

/* Phase 2 — expérience enfant : composants partagés, sans changement de logique. */
.profile-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 140px), 1fr)); align-items: stretch; }
.profile-grid .profile-card { display: flex; flex-direction: column; align-items: center; gap: var(--sp-2); min-width: 0; padding: var(--sp-4); background: var(--card); border: 2px solid var(--line); border-block-start-color: var(--c, var(--primary)); box-shadow: var(--sh-1); }
.profile-grid .profile-card.add { justify-content: center; background: var(--surface-2); border: 2px dashed var(--border); }
.profile-grid .avatar { background: color-mix(in srgb, var(--c, var(--primary)) 20%, var(--card)); }
.profile-grid .pname { margin: 0; overflow-wrap: anywhere; }
.profile-grid .pmeta { color: var(--text-2); }
.profile-grid .bar.sm { width: 100%; margin: auto 0 0; }
.path { padding-inline: var(--sp-4); }
.path .world-head { padding: var(--sp-4); gap: var(--sp-3); border: 1px solid var(--line); }
.path .path-row { gap: var(--sp-3); margin-block: var(--sp-5); }
.path .path-row.l { padding-inline-start: 0; }
.path .path-row.c { padding-inline-start: 8%; }
.path .path-row.r { padding-inline-start: 16%; }
.path .path-label { flex: 1; overflow-wrap: anywhere; }
.path .path-label.dim, .path .world.closed .path-row { opacity: 1; }
.path .path-label.dim { color: var(--muted); }
.path .path-node { background: var(--surface-2); color: var(--text-2); box-shadow: var(--sh-1); border: 2px solid var(--line); }
.path .path-node.started { background: var(--gold-soft); color: var(--gold-ink); border-color: var(--gold); }
.path .path-node.done { background: var(--primary-d); color: white; border-color: var(--primary); }
.path .path-node.boss:not(.locked) { background: var(--gold-soft); color: var(--gold-ink); border-color: var(--gold); }
.path .path-node.rec { outline: 3px solid var(--gold); outline-offset: 3px; }
.path .path-node.rec::after { animation: none; box-shadow: none; }
.path .pn-flag, .path .pn-pct { background: var(--gold-soft); color: var(--gold-ink); border-radius: var(--r-sm); }
.mem-body { display: grid; gap: var(--sp-3); }
.mem-body .mem-card { margin: 0; padding: var(--sp-4); border: 1px solid var(--line); }
.mem-body .mem-progress { margin: 0; gap: var(--sp-1); }
.mem-body .mem-progress span { flex: 1 1 8px; max-width: 22px; background: var(--surface-2); }
.mem-body .mem-progress .done { background: var(--primary); }
.mem-body .mem-progress .cur { background: var(--gold); }
.mem-body .mask-row { margin: 0; gap: var(--sp-1); }
.mem-body .chip { min-height: var(--tap); margin: 0; }
.mem-body .mem-recite { margin: 0; }
.mem-body .mem-rec { width: 100%; min-height: var(--tap); background: var(--primary-d); color: white; box-shadow: var(--sh-1); }
.mem-body .mem-rec.on { background: var(--error-bg); color: var(--bad); border: 2px solid var(--bad); animation: none; }
.mem-audio, .mem-nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-2); }
.mem-audio .btn:first-child { grid-column: 1 / -1; }
.mem-audio .btn, .mem-nav .btn { min-height: var(--tap); margin: 0; padding: var(--sp-3); white-space: normal; }
.mem-body .method { margin: 0; }
.mem-body .method summary { min-height: var(--tap); align-content: center; }
.mem-body .w { transition: background-color .18s, color .18s; }
.mem-body .hidden-w { background: var(--surface-2); }
.mem-body .w.rv-ok { color: var(--ok); background: var(--success-bg); }
.mem-body .w.rv-skip, .mem-body .w.rv-err { color: var(--gold-ink); background: var(--gold-soft); }
.mem-body .hidden-w.peek, .mem-body .hint-w.peek { color: var(--ink); background: var(--gold-soft); }
.game-list .game-card { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--sp-2) var(--sp-3); padding: var(--sp-4); background: var(--card); border-color: var(--line); border-inline-start-color: var(--g, var(--primary)); }
.game-list .game-card > .stars { grid-column: 2; justify-self: start; }
.game-list .gc-icon { background: color-mix(in srgb, var(--g, var(--primary)) 18%, var(--card)); }
.game-list .tag { background: var(--surface-2); color: var(--text-2); }
.qbox .instr { margin-block: var(--sp-2); overflow-wrap: anywhere; }
.qbox .options { gap: var(--sp-3); margin-block-start: var(--sp-2); }
.qbox .options.grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.qbox .option, .qbox .chip.word { min-height: var(--tap); min-width: 0; padding: var(--sp-3); box-shadow: var(--sh-1); overflow-wrap: anywhere; }
.qbox .option.right { background: var(--success-bg); border-color: var(--ok); opacity: 1; }
.qbox .option.wrong { background: var(--error-bg); border-color: var(--bad); opacity: 1; }
.qbox .option.right::after, .qbox .option.wrong::after { position: absolute; inset-block-start: var(--sp-1); inset-inline-end: var(--sp-1); font-weight: 800; }
.qbox .option.right::after { content: '✓'; color: var(--ok); }
.qbox .option.wrong::after { content: '×'; color: var(--bad); }
.qbox .option.reveal { animation: none; }
.qbox .placed-item { background: var(--success-bg); }
.qbox .aopt { flex-wrap: wrap; }
.qbox .aopt-play, .qbox .aopt-pick { min-height: var(--tap); display: inline-flex; align-items: center; }
.qbox .aopt-play { background: var(--surface-2); color: var(--ink); }
.qbox .mini-play { min-width: var(--tap); min-height: var(--tap); display: grid; place-items: center; background: var(--surface-2); }
.qbox .order-opt:has(.mini-play) { padding-inline-start: calc(var(--tap) + var(--sp-3)); }
.game-feedback, .mem-status { min-height: var(--tap); padding: var(--sp-2); border-radius: var(--r-sm); text-align: center; font-weight: 800; align-content: center; }
.feedback-ok { background: var(--success-bg); color: var(--ok); }
.feedback-retry { background: var(--gold-soft); color: var(--gold-ink); }
.qbox .shake { animation: child-retry .24s ease-out; }
@keyframes child-retry { 50% { transform: scale(.98); } }
@media (prefers-reduced-motion: reduce) { .qbox .shake, .mem-body .w, .path .path-node.rec::after { animation: none !important; transition: none !important; } }
/* Ajustements après relecture de la phase 2 */
.path .path-row.l { padding-inline-start: 2%; } .path .path-row.c { padding-inline-start: 22%; } .path .path-row.r { padding-inline-start: 42%; }
.mem-body .mem-rec:not(.on) { background: linear-gradient(135deg,#e8b957,#cc8a2c); color: #fff; box-shadow: 0 4px 0 #a66a1e; }
.mem-audio .btn:first-child { grid-column: auto; }
