/* Rue des Lilas — "Le mot qui manque". Uses the app's own colour tokens (light & dark). */
.rdlt {
  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: rdlt-in .25s ease-out;
  --noun: #3f72af; --verb: #d4622a;
}
@keyframes rdlt-in { from { opacity: 0; transform: translateY(8px); } }
.rdlt *, .rdlt *::before, .rdlt *::after { box-sizing: border-box; }
.rdlt button { font: inherit; color: inherit; cursor: pointer; }
.rdlt [hidden] { display: none !important; }
.rdlt a { color: inherit; }
.rdlt-open #app { visibility: hidden; }

.rdlt-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); }
.rdlt-back { border: 0; background: none; padding: 6px 8px; margin-left: -8px; border-radius: 10px; font-weight: 700; color: var(--accent, #6b4f8a); white-space: nowrap; }
.rdlt-back:hover { background: color-mix(in srgb, var(--accent, #6b4f8a) 10%, transparent); }
.rdlt-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rdlt-title strong { font-family: "Fraunces", var(--serif, Georgia, serif); font-size: 1.12rem; font-weight: 600; }
.rdlt-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; white-space: nowrap; }
.rdlt-tool[aria-pressed="true"] { background: color-mix(in srgb, var(--accent, #6b4f8a) 12%, var(--surface, #fff)); border-color: var(--accent, #6b4f8a); color: var(--accent, #6b4f8a); }
.rdlt-printbtn { background: var(--accent, #6b4f8a); color: #fff !important; border-color: transparent; }
@media (max-width: 520px) { .rdlt-title { display: none; } .rdlt-back { margin-right: auto; } }

.rdlt-main { overflow-y: auto; min-height: 0; max-width: none; width: 100%; margin: 0; padding: 0; }
.rdlt-wrap { max-width: 860px; margin: 0 auto; padding: 22px clamp(14px, 4vw, 40px) 70px; }
.rdlt h1 { font-family: "Fraunces", var(--serif, Georgia, serif); font-weight: 600; font-size: clamp(1.5rem, 3.6vw, 2.1rem); margin: 0 0 6px; line-height: 1.15; }
.rdlt-lead { color: var(--muted, #6d6474); line-height: 1.5; margin: 0 0 16px; }
.rdlt-note { color: var(--muted, #6d6474); font-size: .9rem; line-height: 1.5; margin-top: 24px; }

.rdlt-btn { display: inline-flex; align-items: center; gap: 6px; border: 2px solid var(--accent, #6b4f8a); background: var(--accent, #6b4f8a); color: #fff !important; border-radius: 999px; padding: 8px 15px; font-weight: 700; font-size: .9rem; text-decoration: none; line-height: 1.2; }
.rdlt-btn.ghost { background: var(--surface, #fff); color: var(--accent, #6b4f8a) !important; border-color: var(--line, #e2d9e8); }
.rdlt-btn.ghost:hover { border-color: var(--accent, #6b4f8a); }
.rdlt-btn[aria-pressed="true"] { border-color: var(--accent, #6b4f8a); background: color-mix(in srgb, var(--accent, #6b4f8a) 12%, var(--surface, #fff)); }
.rdlt-btn.armed { background: var(--bad, #c2453d) !important; border-color: var(--bad, #c2453d) !important; color: #fff !important; }

/* list */
.rdlt-bar { display: grid; gap: 8px; margin-bottom: 8px; }
.rdlt-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.rdlt-chips button { border: 1px solid var(--line, #e2d9e8); background: var(--surface, #fff); border-radius: 999px; padding: 6px 12px; font-weight: 700; font-size: .87rem; }
.rdlt-chips button[aria-pressed="true"] { background: var(--text, #2a2430); color: var(--bg, #fff); border-color: transparent; }
.rdlt-bar2 { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin: 10px 0 14px; }
.rdlt-count { color: var(--muted, #6d6474); font-weight: 700; font-size: .87rem; }
.rdlt-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.rdlt-card { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: 16px; background: var(--surface, #fff); border: 1px solid var(--line, #e2d9e8); text-decoration: none; transition: transform .12s, box-shadow .12s; }
.rdlt-card:hover { transform: translateY(-2px); box-shadow: var(--shadow, 0 4px 14px #0001); }
.rdlt-card .em { font-size: 1.9rem; width: 54px; height: 54px; display: grid; place-items: center; border-radius: 14px; flex: none; background: #e8f0fb; }
.rdlt-card.th-animaux .em { background: #e3f4e8; }
.rdlt-card.th-espace .em { background: #ece6fa; }
.rdlt-card.th-cuisine .em { background: #fdeede; }
.rdlt-card .tx { display: grid; gap: 3px; min-width: 0; flex: 1; }
.rdlt-card .tag { font-size: .74rem; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; color: var(--accent, #6b4f8a); }
.rdlt-card strong { font-size: 1.04rem; line-height: 1.25; }
.rdlt-card .muted { color: var(--muted, #6d6474); font-size: .86rem; line-height: 1.35; }
.rdlt-card .st { display: block; height: 6px; border-radius: 6px; background: var(--line, #e2d9e8); margin-top: 6px; overflow: hidden; }
.rdlt-card .st i { display: block; height: 100%; background: var(--good, #2f8a5b); }
.rdlt-card .st.done { height: auto; background: none; color: var(--good, #2f8a5b); font-weight: 800; font-size: .84rem; }

/* story */
.rdlt-head { text-align: center; margin-bottom: 10px; }
.rdlt-scene { font-size: clamp(2.6rem, 9vw, 3.6rem); letter-spacing: .1em; line-height: 1.2; margin-bottom: 4px; }
.rdlt-head .tag { font-size: .78rem; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; color: var(--accent, #6b4f8a); }
.rdlt-head h1 { margin-top: 4px; }
.rdlt-sub { margin: 0; color: var(--muted, #6d6474); }
.rdlt-how { color: var(--muted, #6d6474); font-size: .92rem; line-height: 1.5; text-align: center; margin: 10px auto 12px; max-width: 620px; }
.pill { display: inline-block; padding: 1px 8px; border-radius: 999px; font-weight: 800; font-size: .82em; color: #fff; }
.pill.n { background: var(--noun); } .pill.v { background: var(--verb); }
.rdlt-tools { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-bottom: 12px; }
.rdlt-bank { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; padding: 12px; border: 2px dashed var(--line, #e2d9e8); border-radius: 16px; margin-bottom: 16px; background: var(--surface, #fff); }
.rdlt-bank .hd { width: 100%; text-align: center; margin: 0 0 4px; font-size: .84rem; color: var(--muted, #6d6474); font-weight: 700; }
.rdlt-bank .hd b { color: var(--verb); }
.rdlt-bank button { border: 1.5px solid var(--line, #e2d9e8); background: var(--bg, #f7f3ee); border-radius: 12px; padding: 6px 12px; font-weight: 800; font-size: 1rem; }
.rdlt-bank button:hover { border-color: var(--accent, #6b4f8a); }
.rdlt-bank button.used { text-decoration: line-through; opacity: .4; }

.rdlt-story { background: var(--surface, #fff); border: 1px solid var(--line, #e2d9e8); border-radius: 20px; padding: clamp(16px, 4vw, 30px); font-size: clamp(1.08rem, 2.6vw, 1.28rem); line-height: 2.25; box-shadow: var(--shadow, none); }
.rdlt-story .sn { cursor: pointer; border-radius: 8px; transition: background .2s; }
.rdlt-story .sn:hover { background: color-mix(in srgb, var(--accent, #6b4f8a) 6%, transparent); }
.rdlt-story .sn.cur { background: color-mix(in srgb, #f3a712 28%, transparent); }
.rdlt-story .tr { display: none; }
.rdlt.show-en .rdlt-story { line-height: 1.9; }
.rdlt.show-en .rdlt-story .sn { display: block; margin-bottom: 10px; }
.rdlt.show-en .rdlt-story .tr { display: block; font-size: .78em; line-height: 1.4; color: var(--muted, #6d6474); font-style: italic; }
.rdlt .gap { display: inline-flex; flex-direction: column; vertical-align: baseline; position: relative; }
.rdlt .gap input { width: var(--w); min-width: 4.5ch; font: inherit; font-weight: 800; color: var(--text, #2a2430); text-align: center; padding: 0 6px; height: 1.75em; line-height: 1; border: 0; border-bottom: 3px solid var(--noun); border-radius: 8px 8px 2px 2px; background: color-mix(in srgb, var(--noun) 9%, var(--surface, #fff)); outline: none; }
.rdlt .gap.k-v input { border-bottom-color: var(--verb); background: color-mix(in srgb, var(--verb) 9%, var(--surface, #fff)); }
.rdlt .gap input::placeholder { color: var(--noun); opacity: .75; font-weight: 700; font-size: .7em; text-transform: uppercase; letter-spacing: .06em; }
.rdlt .gap.k-v input::placeholder { color: var(--verb); }
.rdlt .gap.sel input, .rdlt .gap input:focus { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent, #6b4f8a) 35%, transparent); }
.rdlt .gap input.bad { border-bottom-color: var(--bad, #c2453d); background: color-mix(in srgb, var(--bad, #c2453d) 13%, var(--surface, #fff)); color: var(--bad, #c2453d); animation: rdlt-shake .35s; }
@keyframes rdlt-shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.rdlt .gap.ok input { border-bottom-color: var(--good, #2f8a5b); background: color-mix(in srgb, var(--good, #2f8a5b) 14%, var(--surface, #fff)); color: var(--good, #2f8a5b); animation: rdlt-pop .35s; }
@keyframes rdlt-pop { 50% { transform: scale(1.1); } }
.rdlt .gap .fb { position: absolute; left: 50%; top: 100%; transform: translateX(-50%); white-space: nowrap; font-size: .62em; line-height: 1.2; font-style: normal; font-weight: 700; color: var(--good, #2f8a5b); background: var(--surface, #fff); padding: 1px 6px; border-radius: 6px; z-index: 2; pointer-events: none; }

.rdlt-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 18px; }
.rdlt-score { margin-left: auto; font-weight: 800; color: var(--good, #2f8a5b); }

.rdlt-win { margin-top: 18px; position: relative; overflow: hidden; border-radius: 18px; padding: 18px; text-align: center; background: color-mix(in srgb, var(--good, #2f8a5b) 14%, var(--surface, #fff)); border: 2px solid var(--good, #2f8a5b); display: grid; gap: 4px; justify-items: center; }
.rdlt-win strong { font-family: "Fraunces", var(--serif, Georgia, serif); font-size: 1.6rem; }
.rdlt-win .row { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 8px; }
.rdlt-win .burst i { position: absolute; left: calc(var(--i) * 6.6%); top: -10%; font-style: normal; font-size: 1.3rem; animation: rdlt-fall 2.4s ease-in forwards; animation-delay: calc(var(--i) * 60ms); opacity: 0; }
@keyframes rdlt-fall { 0% { opacity: 1; transform: translateY(0) rotate(0); } 100% { opacity: 0; transform: translateY(260px) rotate(300deg); } }

.rdlt-toast { position: fixed; left: 50%; bottom: max(22px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 1003; background: var(--text, #2a2430); color: var(--bg, #fff); padding: 10px 16px; border-radius: 12px; font-weight: 700; font-size: .92rem; max-width: 92vw; box-shadow: 0 8px 30px #0003; animation: rdlt-in .2s; }
.rdlt-toast.ok { background: var(--good, #2f8a5b); color: #fff; }
.rdlt-toast.ko { background: var(--bad, #c2453d); color: #fff; }

.rdlt-dlg { position: fixed; inset: 0; z-index: 1002; background: #1a102488; display: grid; place-items: center; padding: 16px; animation: rdlt-in .15s; }
.rdlt-dlg .box { background: var(--surface, #fff); color: var(--text, #2a2430); border-radius: 20px; padding: 20px 22px; width: min(470px, 100%); box-shadow: 0 20px 60px #0004; max-height: 92vh; overflow: auto; }
.rdlt-dlg h2 { margin: 0 0 4px; font-family: "Fraunces", var(--serif, Georgia, serif); font-weight: 600; font-size: 1.3rem; }
.rdlt-dlg .muted { color: var(--muted, #6d6474); margin: 0 0 12px; font-size: .95rem; }
.rdlt-dlg .opts { display: grid; gap: 6px; margin-bottom: 10px; }
.rdlt-dlg .opts label { display: flex; gap: 10px; align-items: flex-start; padding: 9px 11px; border: 1.5px solid var(--line, #e2d9e8); border-radius: 12px; cursor: pointer; }
.rdlt-dlg .opts label:has(input:checked) { border-color: var(--accent, #6b4f8a); background: color-mix(in srgb, var(--accent, #6b4f8a) 8%, var(--surface, #fff)); }
.rdlt-dlg label input { margin-top: 3px; accent-color: var(--accent, #6b4f8a); }
.rdlt-dlg label span { display: grid; }
.rdlt-dlg label small { color: var(--muted, #6d6474); }
.rdlt-dlg .chk { display: flex; gap: 8px; align-items: center; padding: 4px 2px; cursor: pointer; font-weight: 600; }
.rdlt-dlg .chk input { margin: 0; }
.rdlt-dlg .tip { font-size: .85rem; color: var(--muted, #6d6474); background: color-mix(in srgb, #f3a712 12%, transparent); border-radius: 10px; padding: 8px 10px; margin: 12px 0; line-height: 1.4; }
.rdlt-dlg .row { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }

/* ---------- print sheets ---------- */
.rdlt-print { display: none; }
@media print {
  @page { size: A4 portrait; margin: 14mm 14mm; }
  html.rdlt-printing, html.rdlt-printing body { overflow: visible !important; height: auto !important; background: #fff !important; }
  html.rdlt-printing body > *:not(.rdlt-print) { display: none !important; }
  html.rdlt-printing .rdlt-print { display: block !important; }
}
.rdlt-print { color: #111; font-family: "Nunito", "Inter", system-ui, sans-serif; font-size: 12pt; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.rdlt-print .sheet { break-after: page; page-break-after: always; }
.rdlt-print .ph { border-bottom: 1.5pt solid #6b4f8a; padding-bottom: 6pt; margin-bottom: 10pt; }
.rdlt-print .brand { font-size: 8pt; text-transform: uppercase; letter-spacing: .08em; color: #6b4f8a; font-weight: 700; }
.rdlt-print h2 { font-family: "Fraunces", Georgia, serif; font-weight: 600; font-size: 21pt; margin: 3pt 0 0; }
.rdlt-print h2 .sc { font-size: .9em; }
.rdlt-print .name { margin-top: 8pt; font-size: 10pt; display: flex; gap: 6pt; align-items: flex-end; }
.rdlt-print .name i { display: inline-block; border-bottom: .8pt solid #888; width: 6cm; height: 1em; margin-right: 12pt; }
.rdlt-print .inst { font-size: 10.5pt; margin: 0 0 10pt; line-height: 1.4; }
.rdlt-print .inst small { color: #666; font-style: italic; }
.rdlt-print .pbank { border: 1.2pt dashed #888; border-radius: 8pt; padding: 7pt 10pt; margin-bottom: 14pt; text-align: center; }
.rdlt-print .pbank h3 { margin: 0 0 4pt; font-size: 9.5pt; text-transform: uppercase; letter-spacing: .06em; color: #6b4f8a; }
.rdlt-print .pbank h3 small { text-transform: none; letter-spacing: 0; color: #d4622a; }
.rdlt-print .pbank span { display: inline-block; margin: 2pt 9pt; font-weight: 800; font-size: 12.5pt; }
.rdlt-print .pstory { font-size: 13.5pt; line-height: 2.5; }
.rdlt-print .blank { display: inline-block; position: relative; white-space: nowrap; }
.rdlt-print .blank b { font-size: 7.5pt; color: #fff; background: #3f72af; border-radius: 50%; display: inline-grid; place-items: center; width: 13pt; height: 13pt; vertical-align: 3pt; margin-right: 2pt; }
.rdlt-print .blank.k-v b { background: #d4622a; }
.rdlt-print .blank i { display: inline-block; width: 3.4cm; border-bottom: 1.2pt solid #333; height: 1em; }
.rdlt-print .blank small { position: absolute; right: 0; bottom: -8pt; font-size: 6.5pt; line-height: 1; color: #3f72af; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
.rdlt-print .blank.k-v small { color: #d4622a; }
.rdlt-print .with-en .pstory { line-height: 2.1; }
.rdlt-print .with-en .s { display: block; margin-bottom: 4pt; }
.rdlt-print .with-en em { display: block; font-size: 9.5pt; line-height: 1.3; color: #666; }
.rdlt-print .kh { font-size: 18pt; border-bottom: 1.5pt solid #6b4f8a; padding-bottom: 4pt; margin: 0 0 10pt; }
.rdlt-print .kh small { font-family: "Nunito", system-ui, sans-serif; font-size: 10pt; color: #777; font-weight: 600; }
.rdlt-print .key { break-inside: avoid; margin-bottom: 14pt; padding-bottom: 8pt; border-bottom: .6pt solid #ddd; }
.rdlt-print .key h3 { font-size: 12.5pt; margin: 0 0 4pt; }
.rdlt-print .key ol { columns: 2; margin: 0 0 4pt; padding-left: 18pt; font-size: 10.5pt; }
.rdlt-print .key ol small { color: #666; }
.rdlt-print .key .full { font-size: 9pt; line-height: 1.45; color: #444; margin: 0; }
.rdlt-print .key .full u { text-decoration-color: #d4622a; text-decoration-thickness: 1.2pt; font-weight: 700; color: #111; }
