/* Rue des Lilas — "Grammaire" (interactive grammar lessons). Uses the app's own colour tokens. */
.rdlg {
  position: fixed; inset: 0; z-index: 1000; display: grid; grid-template-rows: auto 1fr;
  background: var(--bg, #f7f3ee); color: var(--text, #2a2430); font-family: var(--font, system-ui, sans-serif);
  animation: rdlg-in .25s ease-out;
}
@keyframes rdlg-in { from { opacity: 0; transform: translateY(8px); } }
.rdlg *, .rdlg *::before, .rdlg *::after { box-sizing: border-box; }
.rdlg button { font: inherit; color: inherit; cursor: pointer; }
.rdlg [hidden] { display: none !important; }
.rdlg-open #app { visibility: hidden; }
.rdlg mark { background: color-mix(in srgb, #f3a712 30%, transparent); color: inherit; padding: 0 .15em; border-radius: 4px; font-weight: 700; }
.rdlg s { color: #c2453d; }

/* Top bar */
.rdlg-top { display: flex; align-items: center; gap: 8px; padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top)); background: var(--surface, #fff); border-bottom: 1px solid var(--line, #e2d9e8); }
.rdlg-back { border: 0; background: none; padding: 6px 8px; margin-left: -8px; border-radius: 10px; font-weight: 700; color: var(--accent, #6b4f8a); }
.rdlg-back:hover { background: var(--surface-2, #efe8f5); }
.rdlg-title { flex: 1; min-width: 0; }
.rdlg-title strong { font-family: "Fraunces", var(--serif, Georgia, serif); font-size: 1.15rem; font-weight: 600; }
.rdlg-xp { font-weight: 800; font-size: .9rem; padding: 6px 10px; border-radius: 999px; background: #fff4d6; color: #8a6400; }
.rdlg-xp.pop { animation: rdlg-pop .45s ease; }
@keyframes rdlg-pop { 40% { transform: scale(1.25); } }
.rdlg-tool { border: 1px solid var(--line, #e2d9e8); background: var(--surface, #fff); border-radius: 999px; min-width: 40px; height: 36px; padding: 0 10px; font-size: .85rem; font-weight: 700; }
.rdlg-tool[aria-pressed="true"] { background: var(--surface-2, #efe8f5); border-color: var(--accent, #6b4f8a); color: var(--accent, #6b4f8a); }

.rdlg-main { overflow-y: auto; min-height: 0; scroll-behavior: smooth; }
.rdlg-wrap { max-width: 860px; margin: 0 auto; padding: 22px clamp(16px, 4vw, 40px) 48px; }
.rdlg h1 { font-family: "Fraunces", var(--serif, Georgia, serif); font-weight: 600; font-size: clamp(1.5rem, 3.6vw, 2rem); margin: 0 0 6px; line-height: 1.15; }
.rdlg-lead { color: var(--muted, #6d6474); line-height: 1.5; margin: 0 0 16px; }
.rdlg-en { display: none; font-size: .88em; color: var(--muted, #6d6474); font-style: italic; margin-top: 2px; }
.rdlg.show-en .rdlg-en, .rdlg-en.always { display: block; }
.rdlg-en mark { background: none; font-weight: 700; padding: 0; }

/* Level tabs */
.rdlg-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 6px 0 18px; }
.rdlg-tab { border: 2px solid var(--line, #e2d9e8); background: var(--surface, #fff); border-radius: 16px; padding: 10px 12px; text-align: left; display: grid; grid-template-columns: auto 1fr; gap: 0 8px; align-items: center; }
.rdlg-tab b { font-size: 1.4rem; color: var(--lv); grid-row: span 2; }
.rdlg-tab span { font-weight: 700; font-size: .85rem; }
.rdlg-tab small { font-size: .75rem; color: var(--muted, #6d6474); grid-column: 2; }
.rdlg-tabbar { grid-column: 2; display: block; height: 6px; border-radius: 999px; background: var(--line, #e2d9e8); overflow: hidden; margin: 4px 0 2px; }
.rdlg-tabbar i { display: block; height: 100%; background: var(--lv); border-radius: 999px; }
.rdlg-tab[aria-selected="true"] { border-color: var(--lv); background: color-mix(in srgb, var(--lv) 8%, var(--surface, #fff)); box-shadow: 0 4px 14px color-mix(in srgb, var(--lv) 22%, transparent); }

/* Lesson cards */
.rdlg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.rdlg-card { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: start; text-align: left; border: 1.5px solid var(--line, #e2d9e8); background: var(--surface, #fff); border-radius: 18px; padding: 14px; box-shadow: var(--shadow); transition: transform .15s, border-color .15s; }
.rdlg-card:hover, .rdlg-card:focus-visible { transform: translateY(-3px) rotate(-.3deg); border-color: var(--lv); outline: none; }
.rdlg-emoji { width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; font-size: 1.8rem; background: color-mix(in srgb, var(--lv) 16%, var(--surface, #fff)); }
.rdlg-cbody { display: grid; gap: 2px; }
.rdlg-cbody small { font-size: .72rem; font-weight: 800; color: var(--lv); text-transform: uppercase; letter-spacing: .04em; }
.rdlg-cbody strong { font-size: 1.05rem; line-height: 1.25; }
.rdlg-csub { font-size: .84rem; color: var(--muted, #6d6474); margin: 0; }
.rdlg-cstars { font-weight: 800; color: #e0a800; font-size: .9rem; margin-top: 4px; }
.rdlg-cstars em { font-style: normal; color: var(--muted, #6d6474); font-size: .8rem; }
.rdlg-cstars.new { color: var(--accent, #6b4f8a); font-size: .8rem; }

/* Lesson hero + blocks */
.rdlg-hero { display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: center; padding: 18px; border-radius: 22px; margin-bottom: 18px; background: linear-gradient(135deg, color-mix(in srgb, var(--lv) 18%, var(--surface, #fff)), var(--surface, #fff)); border: 1px solid color-mix(in srgb, var(--lv) 30%, transparent); }
.rdlg-bigemoji { font-size: 3.2rem; width: 84px; height: 84px; display: grid; place-items: center; background: var(--surface, #fff); border-radius: 24px; box-shadow: var(--shadow); animation: rdlg-float 3.5s ease-in-out infinite; }
@keyframes rdlg-float { 50% { transform: translateY(-5px) rotate(3deg); } }
.rdlg-lvtag { display: inline-block; background: var(--lv); color: #fff; font-weight: 800; font-size: .75rem; padding: 2px 9px; border-radius: 999px; }
.rdlg-hero h1 { margin: 6px 0 2px; }
.rdlg-goal { margin: 8px 0 0; font-weight: 600; line-height: 1.45; }
.rdlg-blk { background: var(--surface, #fff); border: 1px solid var(--line, #e2d9e8); border-radius: 18px; padding: 14px 16px; margin: 12px 0; box-shadow: var(--shadow); }
.rv { opacity: 0; transform: translateY(14px); transition: opacity .45s ease, transform .45s ease; }
.rv.in { opacity: 1; transform: none; }
.rdlg-p p { margin: 0; line-height: 1.6; font-size: 1.02rem; }
.rdlg-h { font-family: "Fraunces", var(--serif, Georgia, serif); font-weight: 600; font-size: 1.25rem; margin: 24px 0 4px; }
.rdlg-exh, .rdlg-tth, .rdlg-tiph, .rdlg-colh { font-weight: 800; font-size: .85rem; margin-bottom: 8px; }
.rdlg-exi { display: grid; grid-template-columns: auto 1fr; gap: 8px; align-items: start; padding: 7px 8px; border-radius: 12px; cursor: pointer; line-height: 1.45; font-size: 1.04rem; transition: background .15s; }
.rdlg-exi:hover { background: var(--surface-2, #efe8f5); }
.rdlg-exi.speaking { background: color-mix(in srgb, #4aa3df 18%, var(--surface, #fff)); }
.rdlg-say { border: 0; background: var(--surface-2, #efe8f5); width: 30px; height: 30px; border-radius: 50%; font-size: .85rem; display: grid; place-items: center; }
.rdlg-say:hover { background: #4aa3df; }
.rdlg-formula { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: center; padding: 18px; background: repeating-linear-gradient(45deg, var(--surface, #fff), var(--surface, #fff) 12px, color-mix(in srgb, #4aa3df 6%, var(--surface, #fff)) 12px, color-mix(in srgb, #4aa3df 6%, var(--surface, #fff)) 24px); }
.fp { padding: 8px 14px; border-radius: 12px; font-weight: 800; font-size: 1.05rem; background: var(--surface-2, #efe8f5); border: 2px solid transparent; }
.fp.hl { background: #fde3d9; border-color: #e4572e; color: #b23a1a; }
.fp.v { background: #ddeefa; border-color: #4aa3df; color: #1d5f8c; }
.fp.stem { background: #e3f3ea; border-color: #3f9a6b; color: #24704a; }
.fp.end { background: #fff1cc; border-color: #f3a712; color: #8a5a00; }
.rdlg-tip { border-left: 6px solid #4aa3df; }
.rdlg-tip.trap { border-left-color: #e4572e; background: color-mix(in srgb, #e4572e 6%, var(--surface, #fff)); }
.rdlg-tip.fun { border-left-color: #f3a712; background: color-mix(in srgb, #f3a712 8%, var(--surface, #fff)); }
.rdlg-tip p { margin: 0 0 4px; line-height: 1.55; }
.rdlg-table { overflow-x: auto; }
.rdlg-table table { width: 100%; border-collapse: separate; border-spacing: 0 4px; font-size: 1.02rem; }
.rdlg-table th { text-align: left; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted, #6d6474); padding: 2px 10px; }
.rdlg-table td { padding: 8px 10px; background: var(--bg, #f7f3ee); }
.rdlg-table td:first-child { border-radius: 10px 0 0 10px; }
.rdlg-table td:last-child { border-radius: 0 10px 10px 0; }
.rdlg-table td.c0 { color: var(--muted, #6d6474); font-weight: 700; white-space: nowrap; width: 1%; padding-right: 22px; }
.rdlg-table td.cs { width: 32px; text-align: center; opacity: .6; }
.rdlg-table tr.sayable { cursor: pointer; }
.rdlg-table tr.sayable:hover td { background: var(--surface-2, #efe8f5); }
.rdlg-table tr.speaking td { background: color-mix(in srgb, #4aa3df 20%, var(--surface, #fff)); }
.rdlg-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 12px; }
.rdlg-col { border-radius: 14px; padding: 10px; }
.rdlg-col.m { background: #e3f1f7; } .rdlg-col.m .rdlg-colh { color: #1d6a8c; }
.rdlg-col.f { background: #fde9e2; } .rdlg-col.f .rdlg-colh { color: #b23a1a; }
.rdlg-col .rdlg-exi { font-size: .98rem; }
.rdlg-tl svg, .rdlg-house svg { width: 100%; height: auto; display: block; }
.rdlg-tl .tl-lb { font-size: 14px; font-weight: 700; fill: #2a2430; }
.rdlg-tl .tl-span { fill: #24704a; }
.rdlg-tl .tl-sm { font-size: 12px; fill: #8f86a0; }
.rdlg-tl .tl-now { font-size: 13px; font-weight: 800; fill: #6b4f8a; }
.rdlg-hv { cursor: pointer; }
.rdlg-hv rect { fill: #fff; stroke: #6b4f8a; stroke-width: 2; transition: fill .2s; }
.rdlg-hv text { font-size: 14px; font-weight: 700; fill: #4b3466; pointer-events: none; }
.rdlg-hv:hover rect, .rdlg-hv:focus rect, .rdlg-hv.hit rect { fill: #f3a712; }
.rdlg-note { font-size: .82rem; color: var(--muted, #6d6474); text-align: center; margin: 6px 0 0; }
.rdlg-ready { text-align: center; padding: 22px; margin-top: 22px; border-radius: 22px; background: linear-gradient(135deg, #fff4d6, #fde3d9); border: 1px solid #f3d6a0; }
.rdlg-ready p { margin: 0 0 12px; font-weight: 700; }

/* Buttons */
.rdlg-btn { border: 1.5px solid var(--line, #e2d9e8); background: var(--surface, #fff); border-radius: 999px; padding: 10px 18px; font-weight: 800; font-size: .95rem; }
.rdlg-btn:hover:not(:disabled) { border-color: var(--accent, #6b4f8a); }
.rdlg-btn.primary { background: var(--accent, #6b4f8a); border-color: var(--accent, #6b4f8a); color: var(--surface, #fff); }
.rdlg-btn.primary:hover:not(:disabled) { filter: brightness(1.08); }
.rdlg-btn.big { font-size: 1.1rem; padding: 14px 26px; box-shadow: 0 6px 18px color-mix(in srgb, var(--accent, #6b4f8a) 30%, transparent); }
.rdlg-btn:disabled { opacity: .45; cursor: default; }
.rdlg-link { border: 0; background: none; color: var(--accent, #6b4f8a); font-weight: 700; font-size: .9rem; padding: 6px 8px; border-radius: 8px; }
.rdlg-link:hover { background: var(--surface-2, #efe8f5); }

/* Quiz */
.rdlg-qtop { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.rdlg-qtitle { font-weight: 800; color: var(--muted, #6d6474); font-size: .9rem; }
.rdlg-streak { font-weight: 800; padding: 4px 10px; border-radius: 999px; background: var(--surface-2, #efe8f5); opacity: .55; transition: all .2s; }
.rdlg-streak.on { opacity: 1; background: #fde3d9; color: #b23a1a; transform: scale(1.08); }
.rdlg-qprog { display: flex; gap: 6px; margin: 10px 0 14px; }
.rdlg-qprog i { flex: 1; height: 10px; border-radius: 999px; background: var(--line, #e2d9e8); }
.rdlg-qprog i.cur { background: var(--accent, #6b4f8a); }
.rdlg-qprog i.ok { background: #3f9a6b; } .rdlg-qprog i.ko { background: #e4572e; }
.rdlg-qcard { background: var(--surface, #fff); border: 2px solid var(--line, #e2d9e8); border-radius: 22px; padding: 18px; box-shadow: var(--shadow); animation: rdlg-in .3s ease; }
.rdlg-qcard.good { border-color: #9fd3b6; }
.rdlg-qcard.bad { border-color: #f0b3a3; animation: rdlg-shake .35s ease; }
@keyframes rdlg-shake { 25% { transform: translateX(-6px); } 50% { transform: translateX(6px); } 75% { transform: translateX(-3px); } }
.rdlg-qk { display: block; font-weight: 800; font-size: .78rem; color: var(--muted, #6d6474); text-transform: uppercase; letter-spacing: .04em; }
.rdlg-q { font-family: "Fraunces", var(--serif, Georgia, serif); font-weight: 600; font-size: clamp(1.2rem, 3vw, 1.5rem); margin: 10px 0 6px; line-height: 1.35; }
.rdlg-sent { font-family: var(--font, system-ui, sans-serif); font-weight: 700; }
.rdlg-blank { display: inline-block; min-width: 70px; border-bottom: 3px dashed var(--accent, #6b4f8a); text-align: center; color: var(--accent, #6b4f8a); }
.rdlg-blank.filled { border-bottom-style: solid; border-color: #3f9a6b; color: #24704a; animation: rdlg-pop .4s ease; }
.rdlg-opts { display: grid; gap: 10px; margin-top: 14px; }
.rdlg-opt { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: center; text-align: left; border: 2px solid var(--line, #e2d9e8); background: var(--surface, #fff); border-radius: 14px; padding: 12px 14px; font-size: 1.05rem; transition: transform .1s, border-color .15s; }
.rdlg-opt:hover:not(:disabled) { border-color: var(--accent, #6b4f8a); transform: translateX(3px); }
.rdlg-opt b { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2, #efe8f5); color: var(--accent, #6b4f8a); font-size: .85rem; }
.rdlg-opt:disabled, .rdlg-tfb:disabled { cursor: default; }
.rdlg-opt.right, .rdlg-tfb.right { border-color: #3f9a6b; background: #e9f6ef; }
.rdlg-opt.right b { background: #3f9a6b; color: #fff; }
.rdlg-opt.wrong { border-color: #e4572e; background: #fdecea; }
.rdlg-opt.wrong b { background: #e4572e; color: #fff; }
.rdlg-tf { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; }
.rdlg-tfb { border: 2px solid var(--line, #e2d9e8); background: var(--surface, #fff); border-radius: 16px; padding: 18px; font-size: 1.15rem; font-weight: 800; }
.rdlg-tfb:hover:not(:disabled) { border-color: var(--accent, #6b4f8a); }
.rdlg-tfb.wrong { opacity: .45; }
.rdlg-typef { display: flex; gap: 8px; margin-top: 14px; }
.rdlg-input { flex: 1; min-width: 0; font: inherit; font-size: 1.1rem; padding: 12px 14px; border-radius: 14px; border: 2px solid var(--line, #e2d9e8); background: var(--surface, #fff); color: var(--text, #2a2430); }
.rdlg-input:focus { outline: none; border-color: var(--accent, #6b4f8a); }
.rdlg-input.right { border-color: #3f9a6b; background: #e9f6ef; }
.rdlg-input.wrong { border-color: #e4572e; background: #fdecea; text-decoration: line-through; }
.rdlg-keys { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.rdlg-key { border: 1px solid var(--line, #e2d9e8); background: var(--surface, #fff); border-radius: 8px; min-width: 32px; height: 32px; font-size: .95rem; }
.rdlg-line { min-height: 58px; margin-top: 14px; padding: 8px; border-radius: 14px; border: 2px dashed var(--line, #e2d9e8); display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.rdlg-line.right { border-style: solid; border-color: #3f9a6b; background: #e9f6ef; }
.rdlg-line.wrong { border-style: solid; border-color: #e4572e; background: #fdecea; }
.rdlg-bank { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; min-height: 46px; }
.rdlg-word { border: 2px solid var(--line, #e2d9e8); border-bottom-width: 4px; background: var(--surface, #fff); border-radius: 12px; padding: 8px 12px; font-size: 1.05rem; font-weight: 700; transition: transform .1s; }
.rdlg-word:hover:not(:disabled) { transform: translateY(-2px); border-color: var(--accent, #6b4f8a); }
.rdlg-line .rdlg-word { background: var(--surface-2, #efe8f5); }
.rdlg-orderbtns { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; }
.rdlg-fb { margin-top: 16px; border-radius: 16px; padding: 14px 16px; }
.rdlg-fb.ok { background: #e9f6ef; } .rdlg-fb.ko { background: #fdecea; }
.rdlg-verdict { font-weight: 800; font-size: 1.15rem; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.rdlg-fb.ok .rdlg-verdict { color: #24704a; } .rdlg-fb.ko .rdlg-verdict { color: #b23a1a; }
.rdlg-plus { background: #f3a712; color: #fff; border-radius: 999px; padding: 1px 9px; font-size: .85rem; animation: rdlg-pop .5s ease; }
.rdlg-combo { background: #e4572e; color: #fff; border-radius: 999px; padding: 1px 9px; font-size: .85rem; }
.rdlg-why { margin: 8px 0 0; line-height: 1.5; }
.rdlg-fbbtns { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 12px; flex-wrap: wrap; }

/* Result */
.rdlg-result { position: relative; overflow: hidden; text-align: center; padding: 26px 18px; border-radius: 24px; background: linear-gradient(160deg, color-mix(in srgb, var(--lv) 16%, var(--surface, #fff)), var(--surface, #fff)); border: 1px solid color-mix(in srgb, var(--lv) 30%, transparent); }
.rdlg-confetti { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.rdlg-rstars { font-size: 3rem; letter-spacing: .1em; }
.rdlg-rstars span { color: #ddd3e6; display: inline-block; }
.rdlg-rstars span.on { color: #f3b400; animation: rdlg-star .5s both; }
@keyframes rdlg-star { from { transform: scale(0) rotate(-90deg); opacity: 0; } 70% { transform: scale(1.3); } to { transform: none; opacity: 1; } }
.rdlg-result h2 { font-size: 2.4rem; margin: 2px 0; }
.rdlg-rmsg { font-weight: 700; margin: 4px 0 14px; }
.rdlg-rstats { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.rdlg-rstats div { background: var(--surface, #fff); border-radius: 14px; padding: 8px 14px; min-width: 96px; box-shadow: var(--shadow); display: grid; }
.rdlg-rstats b { font-size: 1.2rem; }
.rdlg-rstats span { font-size: .75rem; color: var(--muted, #6d6474); }
.rdlg-rec { font-weight: 800; color: #8a6400; margin: 12px 0 0; }
.rdlg-btns { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 18px; }

@media (max-width: 640px) {
  .rdlg-back span { display: none; }
  .rdlg-tabs { gap: 6px; }
  .rdlg-tab { padding: 8px; grid-template-columns: 1fr; }
  .rdlg-tab b { grid-row: auto; font-size: 1.15rem; }
  .rdlg-tab span, .rdlg-tab small, .rdlg-tabbar { grid-column: 1; }
  .rdlg-tab span { font-size: .72rem; }
  .rdlg-grid { grid-template-columns: 1fr; }
  .rdlg-compare { grid-template-columns: 1fr; }
  .rdlg-hero { grid-template-columns: 1fr; text-align: center; justify-items: center; }
  .rdlg-bigemoji { width: 72px; height: 72px; font-size: 2.6rem; }
  .rdlg-tl .tl-lb { font-size: 17px; }
}
@media (prefers-reduced-motion: reduce) {
  .rdlg, .rv, .rdlg-bigemoji, .rdlg-qcard, .rdlg-rstars span, .rdlg-xp.pop { animation: none !important; transition: none !important; opacity: 1 !important; transform: none !important; }
}
.rdlg-tlleg { display: none; gap: 4px; margin-top: 6px; }
.rdlg-tlleg .rdlg-exi { grid-template-columns: auto 1fr; align-items: center; font-size: .95rem; font-weight: 700; }
.rdlg-tlleg i { width: 14px; height: 14px; border-radius: 50%; background: #e4572e; }
.rdlg-tlleg .span i { width: 22px; height: 10px; border-radius: 6px; background: #3f9a6b88; }
@media (max-width: 640px) {
  .rdlg-tlleg { display: grid; }
  .rdlg-tl .tl-lb { display: none; }
  .rdlg-house { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .rdlg-house svg { min-width: 540px; }
  .rdlg-house .rdlg-note::after { content: " ↔"; }
}

/* ---------- Adults / kids switch ---------- */
.rdlg-mode { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0 0 18px; max-width: 540px; }
.rdlg-mode button { border: 1.5px solid var(--line, #e2d9e8); background: var(--surface, #fff); border-radius: 14px; padding: 10px 12px; font-weight: 800; font-size: .95rem; text-align: left; display: grid; gap: 2px; }
.rdlg-mode button small { font-weight: 600; font-size: .78rem; color: var(--muted, #6d6474); }
.rdlg-mode button[aria-pressed="true"] { border-color: var(--accent, #6b4f8a); background: var(--surface-2, #efe8f5); box-shadow: inset 0 0 0 1px var(--accent, #6b4f8a); }
.rdlg.kid { --kid: #e4572e; }
.rdlg.kid .rdlg-mode button[data-mode="kid"][aria-pressed="true"] { border-color: var(--kid); box-shadow: inset 0 0 0 1px var(--kid); background: #fff1ea; }
.rdlg.kid .rdlg-btn.primary { background: var(--kid); border-color: var(--kid); }
.rdlg.kid .rdlg-qprog i.cur { background: var(--kid); }
.rdlg.kid .rdlg-card { border-radius: 22px; }
.rdlg.kid .rdlg-exi, .rdlg.kid .rdlg-p p { font-size: 1.1rem; }
.rdlg.kid .rdlg-opt { font-size: 1.15rem; border-radius: 18px; }
.rdlg-cgames { display: flex; gap: 4px; margin-top: 4px; }
.rdlg-cgames i { font-style: normal; filter: grayscale(1); opacity: .45; font-size: .9rem; }
.rdlg-cgames i.done { filter: none; opacity: 1; }

/* ---------- Lesson path (kids) ---------- */
.rdlg-path { margin-top: 24px; padding: 18px; border-radius: 24px; background: linear-gradient(135deg, #fff4d6, #fde3d9); border: 1px solid #f3d6a0; }
.rdlg-path h3 { margin: 0 0 12px; font-size: 1.15rem; text-align: center; }
.rdlg-steps { display: grid; gap: 10px; }
.rdlg-step { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: center; text-align: left; border: 2px solid #fff; background: var(--surface, #fff); border-radius: 18px; padding: 12px 14px; box-shadow: var(--shadow); transition: transform .15s; }
.rdlg-step:hover { transform: translateY(-2px) scale(1.01); border-color: var(--kid, #e4572e); }
.rdlg-step .ic { font-size: 2rem; width: 52px; height: 52px; display: grid; place-items: center; border-radius: 16px; background: #fff1ea; }
.rdlg-step span:last-child { display: grid; gap: 1px; }
.rdlg-step small { font-size: .74rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--muted, #6d6474); }
.rdlg-step b { font-size: 1.05rem; }
.rdlg-step em { font-style: normal; font-weight: 800; color: #e0a800; font-size: .9rem; }
.rdlg-step.done { border-color: #9fd3b6; }
.rdlg-step.quizstep .ic { background: #fff4d6; }

/* ---------- Games ---------- */
.rdlg-game { text-align: center; }
.rdlg-game .rdlg-qtop { text-align: left; }
.rdlg-oops { font-size: 1rem; letter-spacing: 2px; }
.rdlg-gtitle { font-family: "Fraunces", var(--serif, Georgia, serif); font-weight: 600; font-size: clamp(1.25rem, 3.4vw, 1.6rem); margin: 6px 0 14px; }
.rdlg-ghint { color: var(--muted, #6d6474); font-weight: 700; margin: 14px 0 0; }
.shake { animation: rdlg-shake .4s ease !important; }

/* Sort */
.rdlg-gstage { min-height: 150px; display: grid; place-items: center; }
.rdlg-gcard { display: inline-grid; gap: 4px; justify-items: center; padding: 22px 34px; border-radius: 24px; background: var(--surface, #fff); border: 3px solid var(--line, #e2d9e8); box-shadow: 0 10px 24px #28143c22; font-size: clamp(1.6rem, 6vw, 2.2rem); font-weight: 800; cursor: pointer; animation: rdlg-drop .45s cubic-bezier(.3, 1.5, .5, 1); }
.rdlg-gcard small { font-size: .9rem; opacity: .6; }
@keyframes rdlg-drop { from { transform: translateY(-40px) scale(.7); opacity: 0; } }
.rdlg-gcard.fly { animation: rdlg-fly .8s ease-in forwards; }
@keyframes rdlg-fly { to { transform: translate(var(--dx, 0), 190px) scale(.25) rotate(20deg); opacity: 0; } }
.rdlg-bins { display: grid; grid-template-columns: repeat(var(--n), 1fr); gap: 12px; max-width: 560px; margin: 26px auto 0; }
.rdlg-bin { position: relative; border: 0; border-radius: 10px 10px 26px 26px; padding: 26px 8px 18px; color: #fff; font-size: clamp(1.2rem, 4.5vw, 1.6rem); box-shadow: inset 0 -8px 0 #0002, 0 8px 16px #28143c22; transition: transform .12s; }
.rdlg-bin:hover { transform: translateY(-3px); }
.rdlg-bin .lid { position: absolute; left: -4px; right: -4px; top: -8px; height: 14px; border-radius: 8px; background: inherit; filter: brightness(.85); }
.rdlg-bin b { display: block; text-shadow: 0 2px 0 #0003; }
.rdlg-bin .cnt { position: absolute; top: 8px; right: 10px; font-size: .8rem; font-weight: 800; background: #fff; color: #2a2430; border-radius: 999px; min-width: 22px; padding: 0 5px; }
.rdlg-bin .cnt:empty { display: none; }
.rdlg-bin.b0 { background: #4aa3df; } .rdlg-bin.b1 { background: #e4572e; } .rdlg-bin.b2 { background: #3f9a6b; }
.rdlg-bin.gulp { animation: rdlg-gulp .5s ease .45s; }
@keyframes rdlg-gulp { 40% { transform: scale(1.12, .9); } 70% { transform: scale(.95, 1.06); } }

/* Balloon pop */
.rdlg-gsent { background: var(--surface, #fff); border-radius: 20px; padding: 12px 16px; box-shadow: var(--shadow); display: inline-block; min-width: min(100%, 420px); }
.rdlg-gsent .rdlg-q { margin: 4px 0; }
.rdlg-sky { display: flex; justify-content: center; flex-wrap: wrap; gap: 18px; margin: 30px 0 10px; min-height: 190px; align-items: flex-end; }
.rdlg-balloon { position: relative; width: 104px; height: 124px; border: 0; border-radius: 50% 50% 48% 48% / 55% 55% 45% 45%; color: #fff; font-size: 1.25rem; font-weight: 800; text-shadow: 0 2px 0 #0003; box-shadow: inset -10px -14px 0 #0001, inset 10px 10px 0 #fff3; animation: rdlg-bob 2.6s ease-in-out infinite; }
.rdlg-balloon::after { content: ""; position: absolute; top: 100%; left: 50%; width: 2px; height: 46px; background: #8f86a0; }
.rdlg-balloon.c0 { background: #e4572e; } .rdlg-balloon.c1 { background: #4aa3df; } .rdlg-balloon.c2 { background: #3f9a6b; } .rdlg-balloon.c3 { background: #b47ab8; } .rdlg-balloon.c4 { background: #f3a712; }
@keyframes rdlg-bob { 50% { transform: translateY(-14px) rotate(3deg); } }
.rdlg-balloon:hover:not(:disabled) { filter: brightness(1.08); }
.rdlg-balloon.popped { animation: rdlg-popb .5s ease forwards; }
.rdlg-balloon.popped::after { display: none; }
@keyframes rdlg-popb { 30% { transform: scale(1.35); } 100% { transform: scale(1.8); opacity: 0; } }
.rdlg-balloon.sad { animation: rdlg-sad .6s ease forwards; cursor: default; }
@keyframes rdlg-sad { to { transform: translateY(30px) scale(.75) rotate(-12deg); opacity: .35; } }

/* Memory match */
.rdlg-match { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; max-width: 640px; margin: 10px auto 0; }
.rdlg-match .col { display: grid; gap: 10px; align-content: start; }
.rdlg-mcard { border: 3px solid var(--line, #e2d9e8); background: var(--surface, #fff); border-radius: 18px; padding: 14px 10px; font-size: 1.08rem; font-weight: 800; box-shadow: 0 4px 0 var(--line, #e2d9e8); transition: transform .12s, background .2s; }
.rdlg-mcard.L { background: #e9f4fb; } .rdlg-mcard.R { background: #fff1ea; }
.rdlg-mcard:hover:not(:disabled) { transform: translateY(-2px); }
.rdlg-mcard.sel { border-color: #f3a712; box-shadow: 0 0 0 4px #f3a71255; transform: scale(1.03); }
.rdlg-mcard.ok { border-color: #3f9a6b; background: #e9f6ef; color: #24704a; animation: rdlg-pop .4s ease; opacity: .75; cursor: default; }

@media (max-width: 640px) {
  .rdlg-balloon { width: 86px; height: 104px; font-size: 1.05rem; }
  .rdlg-sky { gap: 12px; }
  .rdlg-bins { gap: 8px; }
  .rdlg-mcard { font-size: .95rem; padding: 12px 6px; }
}
@media (prefers-reduced-motion: reduce) { .rdlg-balloon, .rdlg-gcard, .rdlg-bin { animation: none !important; } }
.rdlg .rdlg-balloon, .rdlg .rdlg-bin { color: #fff; }
.rdlg .rdlg-balloon span { font-size: 1.45rem; }
.rdlg .rdlg-bin b { font-size: clamp(1.4rem, 5vw, 1.9rem); }
.rdlg-sky { margin-bottom: 64px; }
