/* Le chat Mistou 2 – kid app. Mobile first; tablet and desktop widen the layout. */
:root {
  --orange: #ff7043; --orange-d: #e64a19; --purple: #ab47bc; --purple-d: #7b1fa2; --teal: #26a69a; --yellow: #ffca28; --green: #43a047;
  --red: #e53935; --blue: #1e88e5; --ink: #2d2d3a; --mute: #777; --bg: #fff8f0; --card: #fff; --line: #f0e6dc;
  --radius: 22px; --shadow: 0 8px 24px rgba(80, 40, 0, .10); --tap: 52px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body { font-family: 'Baloo Bhaijaan 2', 'Segoe UI', Tahoma, Arial, sans-serif; color: var(--ink); background: var(--bg); font-size: 17px; line-height: 1.45;
  min-height: 100dvh; overscroll-behavior-y: contain; }
button { font-family: inherit; cursor: pointer; }
input { font-family: inherit; }
.hidden { display: none !important; }
.fr { direction: ltr; unicode-bidi: isolate; font-weight: 700; }
.ar { font-size: .92em; color: var(--mute); }
.muted { color: var(--mute); }

/* ---------- header */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 8px; padding: 10px 12px; padding-top: calc(10px + env(safe-area-inset-top));
  background: linear-gradient(135deg, var(--orange), var(--purple)); color: #fff; box-shadow: 0 4px 16px rgba(0,0,0,.18); }
.top-title { flex: 1; font-weight: 800; font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-stats { display: flex; align-items: center; gap: 6px; }
.chip { background: rgba(255,255,255,.22); border-radius: 999px; padding: 4px 10px; font-weight: 800; font-size: 14px; white-space: nowrap; }
.chip.lvl { background: #fff; color: var(--purple-d); }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; border: none; background: rgba(255,255,255,.22); color: #fff; font-size: 18px; display: grid; place-items: center; }
.icon-btn:active { transform: scale(.92); }
#btnBack.hidden { visibility: hidden; display: grid !important; }

/* ---------- screen */
.screen { padding: 16px; max-width: 720px; margin: 0 auto; padding-bottom: 40px; }
@media (min-width: 768px) { .screen { padding: 24px; max-width: 860px; } body { font-size: 18px; } }
@media (min-width: 1100px) { .screen { max-width: 980px; } }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; margin-bottom: 14px; }
h2 { font-size: 22px; margin: 6px 0 10px; }
h3 { font-size: 19px; margin: 4px 0 8px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--tap); padding: 10px 22px; border-radius: 18px; border: none;
  font-size: 18px; font-weight: 800; color: #fff; background: var(--orange); box-shadow: 0 5px 0 var(--orange-d); transition: transform .08s; }
.btn:active { transform: translateY(4px); box-shadow: none; }
.btn.purple { background: var(--purple); box-shadow: 0 5px 0 var(--purple-d); }
.btn.teal { background: var(--teal); box-shadow: 0 5px 0 #00796b; }
.btn.green { background: var(--green); box-shadow: 0 5px 0 #2e7d32; }
.btn.ghost { background: #fff; color: var(--ink); box-shadow: 0 5px 0 #ddd; border: 2px solid #eee; }
.btn.big { font-size: 22px; min-height: 64px; width: 100%; }
.btn.sm { min-height: 40px; font-size: 15px; padding: 6px 14px; }
.btn:disabled { opacity: .5; transform: none; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row.center { justify-content: center; }
.row.between { justify-content: space-between; }
.grow { flex: 1; }

/* ---------- home */
.hero { background: linear-gradient(135deg, #fff3e0, #f3e5f5); border-radius: var(--radius); padding: 18px; display: flex; gap: 14px; align-items: center; box-shadow: var(--shadow); margin-bottom: 14px; }
.hero .cat { font-size: 64px; line-height: 1; }
.hero .name { font-size: 22px; font-weight: 800; }
.hero .lvl { color: var(--purple-d); font-weight: 800; }
.bar { height: 14px; background: #eee; border-radius: 999px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--yellow), var(--orange)); border-radius: 999px; transition: width .6s; }
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 12px 0; }
.stat { background: #fff; border-radius: 16px; padding: 10px 6px; text-align: center; box-shadow: var(--shadow); }
.stat b { display: block; font-size: 20px; }
.stat span { font-size: 12px; color: var(--mute); }
.unit { border-radius: var(--radius); padding: 16px; color: #fff; margin-bottom: 12px; box-shadow: var(--shadow); display: flex; align-items: center; gap: 14px; cursor: pointer; }
.unit .ic { font-size: 44px; }
.unit .t { font-weight: 800; font-size: 20px; }
.unit .s { opacity: .92; font-size: 14px; }
.unit .pct { font-weight: 800; font-size: 20px; margin-inline-start: auto; }

/* ---------- lesson map */
.lessons { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 600px) { .lessons { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1000px) { .lessons { grid-template-columns: 1fr 1fr 1fr; } }
.lesson { background: #fff; border-radius: var(--radius); padding: 14px; display: flex; gap: 12px; align-items: center; box-shadow: var(--shadow); border: 3px solid transparent; position: relative; cursor: pointer; }
.lesson.done { border-color: var(--green); }
.lesson.locked { opacity: .55; filter: grayscale(.5); }
.lesson .ic { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; font-size: 26px; font-weight: 800; color: #fff; background: var(--orange); flex-shrink: 0; }
.lesson .t { font-weight: 800; font-size: 17px; }
.lesson .s { font-size: 13px; color: var(--mute); }
.lesson .stars { color: var(--yellow); font-size: 14px; }
.tag { display: inline-block; font-size: 11px; font-weight: 800; padding: 1px 8px; border-radius: 999px; background: #e0f2f1; color: #00695c; margin-inline-start: 6px; }
.tag.extra { background: #fff8e1; color: #ef6c00; }
.tag.bilan { background: #e8f5e9; color: #2e7d32; }
.lock { position: absolute; inset-inline-end: 12px; top: 12px; font-size: 18px; }

/* ---------- activity list */
.acts { display: grid; gap: 10px; }
.act { background: #fff; border-radius: 18px; padding: 12px 14px; display: flex; gap: 12px; align-items: center; box-shadow: var(--shadow); border: 3px solid transparent; cursor: pointer; }
.act.done { border-color: #c8e6c9; }
.act .n { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: #f3e5f5; color: var(--purple-d); font-weight: 800; flex-shrink: 0; }
.act .t { font-weight: 800; }
.act .s { font-size: 13px; color: var(--mute); }
.act .st { font-size: 15px; color: var(--yellow); white-space: nowrap; }

/* ---------- activity shell */
.instr { background: #fff; border-radius: 18px; padding: 12px 14px; margin-bottom: 14px; display: flex; gap: 10px; align-items: center; box-shadow: var(--shadow); }
.instr .fr { font-size: 17px; }
.instr .ar { display: block; }
.instr .spk { width: 44px; height: 44px; border-radius: 50%; border: none; background: #fff3e0; font-size: 20px; flex-shrink: 0; }
.progress { display: flex; gap: 4px; margin-bottom: 12px; }
.progress i { flex: 1; height: 8px; border-radius: 4px; background: #eee; }
.progress i.on { background: var(--teal); }
.progress i.bad { background: var(--red); }
.feedback { text-align: center; font-weight: 800; font-size: 20px; min-height: 32px; margin: 8px 0; }
.feedback.ok { color: var(--green); } .feedback.no { color: var(--red); }
.pic { display: grid; place-items: center; font-size: 56px; line-height: 1; }
.pic img { width: 100%; max-width: 160px; aspect-ratio: 1; object-fit: contain; border-radius: 16px; }
.pic.sm { font-size: 36px; } .pic.sm img { max-width: 72px; }
.pic.lg { font-size: 96px; } .pic.lg img { max-width: 240px; }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(80px); background: var(--ink); color: #fff; padding: 10px 20px; border-radius: 18px; font-weight: 700; opacity: 0; transition: .3s; z-index: 50; max-width: calc(100vw - 32px); width: max-content; text-align: center; pointer-events: none; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 40; }
.overlay { position: fixed; inset: 0; background: rgba(40, 10, 60, .55); z-index: 30; display: grid; place-items: center; padding: 20px; }
.modal { background: #fff; border-radius: 28px; padding: 24px; width: 100%; max-width: 420px; text-align: center; box-shadow: 0 30px 80px rgba(0,0,0,.4); animation: pop .35s; }
.modal .big-e { font-size: 72px; line-height: 1; }
.modal h2 { margin: 8px 0; }
.modal .stars-big { font-size: 40px; letter-spacing: 4px; }
@keyframes pop { from { transform: scale(.6); opacity: 0 } to { transform: scale(1); opacity: 1 } }
@keyframes shake { 0%,100% { transform: translateX(0) } 25% { transform: translateX(-8px) } 75% { transform: translateX(8px) } }
.shake { animation: shake .35s; }

/* ---------- activity components */
.flash { background: #fff; border-radius: 26px; box-shadow: var(--shadow); padding: 22px 16px; text-align: center; min-height: 300px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; }
.flash .letter { font-size: 110px; font-weight: 800; line-height: 1; color: var(--purple-d); direction: ltr; }
.flash .word { font-size: 34px; font-weight: 800; direction: ltr; }
.flash .arw { font-size: 20px; color: var(--mute); }
.flash .big { font-size: 90px; font-weight: 800; color: var(--orange); line-height: 1; }
.flash .swatch { width: 120px; height: 120px; border-radius: 30px; border: 4px solid #eee; }
.spk-big { width: 64px; height: 64px; border-radius: 50%; border: none; background: var(--orange); color: #fff; font-size: 28px; box-shadow: 0 5px 0 var(--orange-d); }
.spk-big:active { transform: translateY(4px); box-shadow: none; }
.nav-row { display: flex; justify-content: space-between; gap: 10px; margin-top: 14px; }
.dots { text-align: center; color: var(--mute); font-weight: 700; margin: 6px 0; }

.grid { display: grid; gap: 8px; }
.grid.c5 { grid-template-columns: repeat(5, 1fr); } .grid.c4 { grid-template-columns: repeat(4, 1fr); }
.cell { aspect-ratio: 1; display: grid; place-items: center; font-size: 28px; font-weight: 800; background: #fff; border-radius: 14px; border: 3px solid #eee; box-shadow: var(--shadow); direction: ltr; user-select: none; }
.cell.on { background: #fff3e0; border-color: var(--orange); color: var(--orange-d); }
.cell.good { background: #e8f5e9; border-color: var(--green); }
.cell.bad { background: #ffebee; border-color: var(--red); }
.cell.miss { outline: 3px dashed var(--red); }
@media (min-width: 600px) { .cell { font-size: 34px; } }

.items { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 600px) { .items { grid-template-columns: repeat(3, 1fr); } }
.item { background: #fff; border-radius: 18px; padding: 10px; text-align: center; border: 3px solid #eee; box-shadow: var(--shadow); cursor: pointer; }
.item .w { font-weight: 800; direction: ltr; margin-top: 4px; }
.item .a { font-size: 12px; color: var(--mute); }
.item.on { border-color: var(--orange); background: #fff3e0; }
.item.good { border-color: var(--green); background: #e8f5e9; }
.item.bad { border-color: var(--red); background: #ffebee; }
.item.text-only { font-weight: 800; font-size: 18px; direction: ltr; padding: 16px 10px; }

.fillword { font-size: 34px; font-weight: 800; direction: ltr; display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; margin: 14px 0; align-items: center; }
.fillword .art { color: var(--mute); margin-inline-end: 10px; font-size: 24px; }
.fillword .ch { min-width: 24px; text-align: center; }
.fillword .blank { min-width: 34px; height: 46px; border-bottom: 4px solid var(--orange); display: inline-grid; place-items: center; color: var(--orange-d); margin: 0 2px; border-radius: 6px 6px 0 0; }
.fillword .blank.cur { background: #fff3e0; }
.fillword .blank.good { color: var(--green); border-color: var(--green); }
.fillword .blank.bad { color: var(--red); border-color: var(--red); }
.choices { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 10px; }
.choice { min-width: var(--tap); min-height: var(--tap); padding: 8px 18px; border-radius: 16px; border: 3px solid #eee; background: #fff; font-size: 22px; font-weight: 800; direction: ltr; box-shadow: var(--shadow); }
.choice.text { font-size: 18px; text-align: left; }
.choice.good { background: #e8f5e9; border-color: var(--green); } .choice.bad { background: #ffebee; border-color: var(--red); }
.choice.on { background: #fff3e0; border-color: var(--orange); }
.choice.used { opacity: .35; }
.choice.col { width: 64px; height: 64px; border-radius: 50%; }

.match-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; direction: ltr; }
.match-col { display: grid; gap: 8px; align-content: start; }
.mcard { background: #fff; border-radius: 16px; border: 3px solid #eee; box-shadow: var(--shadow); min-height: 64px; display: grid; place-items: center; padding: 8px; font-weight: 800; font-size: 18px; text-align: center; }
.mcard.on { border-color: var(--orange); background: #fff3e0; }
.mcard.good { border-color: var(--green); background: #e8f5e9; opacity: .6; }
.mcard.bad { border-color: var(--red); background: #ffebee; }
.mcard .pic img { max-width: 64px; }

.spot-word { background: #fff; border-radius: 18px; padding: 10px; margin-bottom: 10px; box-shadow: var(--shadow); display: flex; align-items: center; gap: 10px; direction: ltr; flex-wrap: wrap; }
.spot-word .tiles { display: flex; gap: 3px; flex-wrap: wrap; }
.tile { width: 36px; height: 44px; border-radius: 10px; border: 2px solid #eee; display: grid; place-items: center; font-weight: 800; font-size: 22px; background: #fafafa; }
.tile.on { background: #fff3e0; border-color: var(--orange); } .tile.good { background: #e8f5e9; border-color: var(--green); } .tile.bad { background: #ffebee; border-color: var(--red); } .tile.miss { outline: 3px dashed var(--red); }

.mem { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; direction: ltr; }
.mcell { aspect-ratio: 3/4; border-radius: 14px; background: linear-gradient(135deg, var(--purple), var(--orange)); display: grid; place-items: center; color: #fff; font-size: 34px; font-weight: 800; box-shadow: var(--shadow); cursor: pointer; }
.mcell.open { background: #fff; color: var(--ink); border: 3px solid var(--orange); font-size: 15px; text-align: center; padding: 4px; }
.mcell.open .pic { font-size: 36px; } .mcell.open .pic img { max-width: 56px; }
.mcell.found { background: #e8f5e9; border-color: var(--green); opacity: .7; }
@media (min-width: 600px) { .mem { grid-template-columns: repeat(6, 1fr); } }

.spell-word { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; margin: 12px 0; direction: ltr; }
.slot { width: 42px; height: 52px; border-radius: 12px; border: 3px dashed #ddd; display: grid; place-items: center; font-size: 26px; font-weight: 800; background: #fff; }
.slot.filled { border-style: solid; border-color: var(--orange); background: #fff3e0; }
.slot.good { border-color: var(--green); background: #e8f5e9; } .slot.bad { border-color: var(--red); background: #ffebee; }

.para, .line { display: flex; gap: 10px; align-items: flex-start; padding: 10px; border-radius: 14px; margin-bottom: 6px; cursor: pointer; }
.para.on, .line.on { background: #fff3e0; }
.para .spk { width: 40px; height: 40px; border-radius: 50%; border: none; background: #fff3e0; font-size: 18px; flex-shrink: 0; }
.para .fr, .line .fr { font-size: 18px; }
.line .who { background: var(--purple); color: #fff; border-radius: 999px; padding: 2px 10px; font-size: 13px; font-weight: 800; white-space: nowrap; }
.line .spk-ico { margin-inline-start: auto; }
.note { background: #f3e5f5; border-radius: 14px; padding: 10px 12px; margin-top: 10px; color: var(--purple-d); font-weight: 700; }
.phon .sound { font-size: 30px; font-weight: 800; color: var(--purple-d); direction: ltr; }
.syl { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; direction: ltr; }
.syl-b { border: 2px solid #eee; background: #fafafa; border-radius: 12px; padding: 6px 10px; font-size: 17px; font-weight: 700; }
.syl-b.w { background: #fff3e0; border-color: #ffcc80; }
.spk-sm { width: 36px; height: 36px; border-radius: 50%; border: none; background: #fff; font-size: 16px; margin-inline-start: 6px; }

.sort-bins { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 12px; }
@media (min-width: 600px) { .sort-bins { grid-template-columns: repeat(5, 1fr); } }
.bin { background: #fff; border-radius: 16px; border: 3px dashed #ddd; padding: 8px; text-align: center; min-height: 86px; cursor: pointer; }
.bin .e { font-size: 28px; } .bin .l { font-weight: 800; direction: ltr; font-size: 14px; } .bin .a { font-size: 11px; color: var(--mute); }
.bin.on { border-color: var(--orange); background: #fff3e0; }
.bin .inside { display: flex; flex-wrap: wrap; gap: 3px; justify-content: center; margin-top: 4px; }
.bin .inside span { font-size: 20px; }
.bin .inside span.txt { font-size: 12px; font-weight: 700; background: #eef2ff; border-radius: 8px; padding: 2px 6px; direction: ltr; }
.sort-items { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.sort-item { background: #fff; border-radius: 14px; border: 3px solid #eee; padding: 6px 10px; display: flex; align-items: center; gap: 6px; font-weight: 800; direction: ltr; box-shadow: var(--shadow); cursor: pointer; }
.sort-item.on { border-color: var(--orange); background: #fff3e0; }
.sort-item .pic { font-size: 26px; } .sort-item .pic img { max-width: 36px; }

.board { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; direction: ltr; }
.sq { aspect-ratio: 1; border-radius: 12px; background: #fff; border: 3px solid #eee; display: grid; place-items: center; position: relative; font-size: 26px; }
.sq img { width: 70%; aspect-ratio: 1; object-fit: contain; }
.sq .num { position: absolute; top: 2px; left: 5px; font-size: 10px; color: var(--mute); font-weight: 800; }
.sq.here { border-color: var(--orange); background: #fff3e0; box-shadow: 0 0 0 4px #ffe0b2; }
.sq .pawn { position: absolute; bottom: -4px; right: -4px; font-size: 24px; animation: pop .3s; }
.sq.goal { background: #e8f5e9; border-color: var(--green); }
.dice { font-size: 64px; line-height: 1; }
.dice.roll { animation: spin .5s; }
@keyframes spin { from { transform: rotate(0) scale(1) } 50% { transform: rotate(180deg) scale(1.3) } to { transform: rotate(360deg) scale(1) } }
.question { background: #fff; border-radius: 18px; padding: 14px; box-shadow: var(--shadow); margin-bottom: 12px; }
.question .q { font-size: 20px; font-weight: 800; direction: ltr; text-align: left; }
.question .qa { color: var(--mute); font-size: 14px; }
.question .pic { margin: 8px 0; }
.answers { display: grid; gap: 8px; margin-top: 10px; }
.ans { min-height: var(--tap); border-radius: 16px; border: 3px solid #eee; background: #fff; font-size: 18px; font-weight: 700; padding: 10px 14px; text-align: left; direction: ltr; }
.ans.good { background: #e8f5e9; border-color: var(--green); } .ans.bad { background: #ffebee; border-color: var(--red); }
.ans.ar-text { direction: rtl; text-align: right; }
.tf-row { display: flex; gap: 10px; }
.tf-row .btn { flex: 1; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; direction: ltr; margin: 10px 0; min-height: 52px; }
.wchip { padding: 8px 14px; border-radius: 14px; border: 3px solid #eee; background: #fff; font-size: 18px; font-weight: 800; box-shadow: var(--shadow); }
.wchip.on { background: #fff3e0; border-color: var(--orange); }
.wchip.good { background: #e8f5e9; border-color: var(--green); } .wchip.bad { background: #ffebee; border-color: var(--red); }
.sentence { min-height: 64px; border: 3px dashed #ddd; border-radius: 16px; padding: 8px; direction: ltr; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; background: #fff; }
.sentence .wchip { cursor: pointer; }
.fw-text { font-size: 20px; font-weight: 700; direction: ltr; text-align: left; }
.fw-text .gap { display: inline-block; min-width: 90px; border-bottom: 3px solid var(--orange); color: var(--orange-d); text-align: center; margin: 0 4px; }

.trace-wrap { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 600px) { .trace-wrap { grid-template-columns: 1fr 1fr; } }
.trace-box { position: relative; background: #fff; border-radius: 18px; box-shadow: var(--shadow); overflow: hidden; touch-action: none; }
.trace-box canvas { width: 100%; height: auto; display: block; }
.trace-box .guide { position: absolute; inset: 0; display: grid; place-items: center; font-size: 150px; font-weight: 800; color: #e0e0e0; pointer-events: none; direction: ltr; font-family: 'Segoe UI', Arial, sans-serif; }
.trace-box .ok { position: absolute; top: 8px; right: 8px; font-size: 28px; }
.mic-btn { width: 96px; height: 96px; border-radius: 50%; border: none; background: var(--red); color: #fff; font-size: 44px; box-shadow: 0 6px 0 #b71c1c; margin: 10px auto; display: block; }
.mic-btn.listening { animation: pulse 1s infinite; background: var(--green); box-shadow: 0 6px 0 #2e7d32; }
@keyframes pulse { 0%,100% { transform: scale(1) } 50% { transform: scale(1.08) } }
.heard { font-size: 16px; color: var(--mute); min-height: 24px; direction: ltr; }
.draw-tools { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin: 8px 0; }
.draw-tools .col { width: 36px; height: 36px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 2px #ddd; }
.draw-tools .col.on { box-shadow: 0 0 0 3px var(--ink); }
.badge-modal .badges { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.profile-badges { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
@media (min-width: 600px) { .profile-badges { grid-template-columns: repeat(5, 1fr); } }
.pbadge { background: #fff; border-radius: 16px; padding: 10px 6px; text-align: center; box-shadow: var(--shadow); font-size: 13px; }
.pbadge .e { font-size: 36px; } .pbadge.off { opacity: .35; filter: grayscale(1); }

/* ---------- French interface + English hover */
.lang-btn { font-size: 14px; font-weight: 800; }
body.lang-fr .ar, body.lang-fr .arw, body.lang-fr .qa, body.lang-fr .item .a, body.lang-fr .bin .a, body.lang-fr .spot-word .ar, body.lang-fr .fr-sub { display: none !important; }
body.lang-fr .note { display: none; }
body.lang-fr .instr .fr { font-size: 18px; }
.hover-tip { position: fixed; z-index: 60; display: none; background: #1f2937; color: #fff; padding: 8px 12px; border-radius: 12px; font-size: 15px; font-weight: 600;
  line-height: 1.35; box-shadow: 0 8px 24px rgba(0,0,0,.25); pointer-events: none; font-family: 'Segoe UI', Arial, sans-serif; text-align: left; }
.hover-tip .flag { margin-right: 4px; }
.hover-on { outline: 2px dashed #90caf9; outline-offset: 2px; border-radius: 6px; }
body.lang-fr .match-grid, body.lang-fr .spot-word, body.lang-fr .mem, body.lang-fr .board { direction: ltr; }
.sq .pic { font-size: 26px; } .sq .pic img { max-width: 80%; }

/* compact header on phones: back, title, points, level, language, badges, logout */
@media (max-width: 440px) {
  .top { gap: 5px; padding-inline: 8px; }
  .top-title { font-size: 16px; min-width: 60px; }
  .top-stats { gap: 4px; }
  .icon-btn { width: 34px; height: 34px; font-size: 15px; }
  .chip { padding: 3px 7px; font-size: 13px; }
}
@media (max-width: 400px) { #chipLvl { display: none; } }

/* kid avatar (tap to change) */
.avatar-btn { position: relative; border: none; background: #fff; width: 84px; height: 84px; border-radius: 26px; font-size: 54px; box-shadow: 0 6px 16px rgba(123,31,162,.18); flex-shrink: 0; }
.avatar-btn:active { transform: scale(.94); }
.avatar-btn .lvl-badge { position: absolute; bottom: -6px; inset-inline-end: -6px; background: #fff; border-radius: 50%; width: 34px; height: 34px; font-size: 20px; display: grid; place-items: center; box-shadow: 0 2px 8px rgba(0,0,0,.15); }
.avatar-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 10px; }
@media (min-width: 420px) { .avatar-grid { grid-template-columns: repeat(5, 1fr); } }
.avatar-grid button { font-size: 38px; aspect-ratio: 1; border-radius: 18px; border: 3px solid #eee; background: #fafafa; }
.avatar-grid button.on { border-color: var(--purple); background: #f3e5f5; }
.avatar-grid button:active { transform: scale(.9); }
.course-line { font-size: 13px; color: #1565c0; font-weight: 700; margin-top: 2px; }

/* ================= ages 10-12 ("junior"): a calmer, more grown-up journey ================= */
body.band-junior { --orange: #3949ab; --orange-d: #1a237e; --purple: #00897b; --purple-d: #00695c; --yellow: #ffb300; --bg: #eef1f8; --radius: 16px;
  font-family: 'Rubik', 'Segoe UI', Tahoma, Arial, sans-serif; }
body.band-junior .top { background: linear-gradient(120deg, #1a237e, #283593 55%, #00897b); }
body.band-junior .hero { background: linear-gradient(135deg, #1a237e, #3949ab); color: #fff; }
body.band-junior .hero .lvl, body.band-junior .hero .course-line { color: #c5cae9; }
body.band-junior .hero .muted { color: #9fa8da; }
body.band-junior .hero .bar { background: rgba(255,255,255,.18); }
body.band-junior .hero .bar > i { background: linear-gradient(90deg, #26c6da, #ffb300); }
body.band-junior .avatar-btn { background: rgba(255,255,255,.12); box-shadow: 0 0 0 2px rgba(255,255,255,.35); }
body.band-junior .unit { border-radius: 16px; }
body.band-junior .lesson, body.band-junior .act, body.band-junior .card, body.band-junior .question { border-radius: 14px; }
body.band-junior .btn { border-radius: 12px; }
body.band-junior .lesson .ic { border-radius: 12px; }
body.band-junior .act .n { background: #e8eaf6; color: #1a237e; }
body.band-junior .stat b { color: #1a237e; }

/* ---------- activities for older learners */
.fr-in { font: inherit; font-size: 18px; padding: 10px 12px; border: 2px solid #d5d9ec; border-radius: 12px; min-height: 48px; background: #fff; direction: ltr; }
.fr-in:focus { outline: none; border-color: var(--orange); box-shadow: 0 0 0 3px rgba(57,73,171,.15); }
.fr-in.good { border-color: var(--green); background: #e8f5e9; } .fr-in.half { border-color: #ffb300; background: #fff8e1; } .fr-in.bad { border-color: var(--red); background: #ffebee; }
.solution { color: #2e7d32; font-weight: 700; font-size: 14px; margin-top: 2px; }
.accent-bar { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 12px 0 4px; }
.accent-bar button { min-width: 40px; height: 40px; border-radius: 10px; border: 1px solid #d5d9ec; background: #f7f8fd; font-size: 18px; font-weight: 700; }
.accent-bar button:active { background: #e8eaf6; transform: scale(.94); }
.conj-head { display: flex; flex-wrap: wrap; gap: 10px; align-items: baseline; margin-bottom: 10px; }
.conj-head .verb { font-size: 26px; font-weight: 800; color: var(--orange-d); }
.conj-head .tense { background: #e8eaf6; color: #1a237e; border-radius: 999px; padding: 2px 12px; font-weight: 700; }
.conj-rows { display: grid; gap: 8px; }
.conj-row { display: grid; grid-template-columns: 110px 1fr; align-items: center; gap: 8px; }
.conj-row .pron { font-weight: 700; color: #555; text-align: right; }
.conj-row .solution { grid-column: 2; }
.blank-in { display: inline-block; width: auto; margin: 0 4px; padding: 4px 8px; min-height: 40px; }
.dict-in { width: 100%; margin-top: 14px; }
.dict-diff { margin-top: 10px; font-size: 18px; line-height: 1.8; }
.w-ok { color: #2e7d32; } .w-half { color: #f57f17; text-decoration: underline wavy; } .w-bad { color: var(--red); text-decoration: line-through; }
.speed-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-weight: 800; margin-bottom: 6px; }
.speed-time { font-size: 22px; color: var(--orange-d); }
.speed-combo { color: #999; } .speed-combo.hot { color: #e65100; animation: pulse .8s infinite; }
.speed-bar { height: 10px; margin-bottom: 12px; }
.speed-bar > i { background: linear-gradient(90deg, #26c6da, #3949ab); transition: width 1s linear; }
.answers.grid2 { grid-template-columns: 1fr 1fr; }
.hunt { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0; font-size: 19px; }
.hw { border: 2px solid transparent; background: #f5f6fb; border-radius: 10px; padding: 6px 10px; font: inherit; font-weight: 600; }
.hw.bad { border-color: var(--red); background: #ffebee; animation: shake .35s; } .hw.found { border-color: #ffb300; background: #fff8e1; color: #e65100; }
.passage { background: #fff; border-radius: 14px; padding: 10px 14px; box-shadow: var(--shadow); margin-bottom: 12px; }
.passage summary { font-weight: 800; cursor: pointer; }
.ptext p { margin: 8px 0; line-height: 1.7; font-size: 17px; }
.center { text-align: center; }
.conj-row input, .dict-in { width: 100%; min-width: 0; }
.conj-row { grid-template-columns: minmax(70px, 30%) 1fr; }
.feedback[dir="ltr"] { direction: ltr; }
.speed-score, .speed-time, .speed-combo { direction: ltr; unicode-bidi: isolate; }
