/* ═══════════════════════════════════════════════
   MAMORY — Feuille de style principale
   Extraite de index.html — malingua.fr
   ═══════════════════════════════════════════════ */

/* ─── RESET ─── */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ─── VARIABLES DE THÈME ─── */
:root {
  --bg:   #faf8f5;
  --card: #fff;
  --pri:  #c0392b;
  --pri2: #e74c3c;
  --acc:  #2c3e50;
  --bk:  #000;
  --txt:  #333;
  --txt2: #777;
  --ok:   #27ae60;
  --warn: #f39c12;
  --err:  #c0392b;
  --bdr:  #e8e4df;
  --bgm:  #faf8f5;
  --sh:   0 2px 12px rgba(0,0,0,.08);
  --r:    12px;
  --blue: #3498db;
  --c1: #4ecdc4;   /* rayure claire (turquoise) */
  --c2: #556270;   /* rayure foncée (ardoise)   */
  --mask-img: url('pics/mask-pattern.png');  /* dépose ton PNG transparent ici : public/pics/mask-pattern.png */
}


/* ─── BASE ─── */
body {
  font-family: 'Nunito', sans-serif;
  background: var(--bg);
  color: var(--txt);
  min-height: 100vh;
  padding-bottom: 40px;
}

.logo            { text-align: center; padding: 14px 0 2px; }
.logo img        { width: 110px; }

h1 {
  font-family: "Give You Glory", cursive;
  text-align: center;
  font-size: 3.7rem;
  font-weight: 1000;
  color: var(--acc);
  margin: 1px 0 -4px;
}

h2, .h2 {
  font-family: "Give You Glory", cursive;
  text-align: center;
  font-size: 2rem;
  font-weight: 1000;
  color: var(--acc);
  margin: 0px 0 10px;
}

.title {
  font-family: "Give You Glory", cursive;
  text-align: center;
  font-size: 1rem;
  font-weight: 1000;
  color: var(--acc);
  margin: 0px 0 -4px;
}

.empti {
  font-family: "Give You Glory", cursive;
  text-align: center;
  padding: 30px 16px;
  font-size: 1.2rem;
  font-weight: 1000;
  color: var(--acc);
}


.wrap {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 12px;
}

.copyright {
  text-align: center;
  color: var(--txt2);
  font-size: .65rem;
  padding: 16px 0 8px;
  border-top: 1px solid var(--bdr);
  margin-top: 16px;
}

/* ═══ BARRE SUPÉRIEURE ═══ */
.topbar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 4px 0 8px;
  font-size: .82rem;
  color: var(--txt2);
}
.topbar .uname {
  font-weight: 700;
  color: #000;
}

/* ═══ BOUTONS ═══ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 16px;
  border: none;
  border-radius: 8px;
  font-family: inherit;
  font-size: .85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all .15s;
}
.btn:hover {
  filter: brightness(1.1);
  transform: scale(1.02);
  box-shadow: 0 2px 8px rgba(0,0,0,.12);
}

.btn-pri  { background: var(--pri);  color: #fff; }
.btn-ok   { background: var(--ok);   color: #fff; }
.btn-warn { background: var(--warn); color: #fff; }
.btn-err  { background: var(--err);  color: #fff; }
.btn-blue { background: var(--blue); color: #fff; }
.btn-gray { background: #888;        color: #fff; }
.btn-dark { background: var(--acc);  color: #fff; }

.btn-out { background: transparent; border: 2px solid var(--bdr); color: var(--txt); }
.btn-out:hover { border-color: var(--pri); color: var(--pri); }

.btn-sm { padding: 5px 11px; font-size: .75rem; }
.btn-xs { padding: 3px 8px;  font-size: .68rem; }

/* ═══ BOUTONS ICÔNES ═══ */
.act {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  padding: 0;
  border-radius: 6px;
  transition: all .15s;
  color: var(--txt);
  flex-shrink: 0;
}
.act:hover { background: rgba(0,0,0,.06); transform: scale(1.12); }

.act-edit  { color: var(--acc);  }
.act-bdr  { color: var(--bdr);  }
.act-del   { color: var(--err);  }
.act-play  { color: var(--txt);  }
.act-rec   { color: var(--pri);  }
.act-tts   { color: var(--pri);  }
.act-url   { color: var(--blue); }
.act-mic   { color: var(--pri);  }
.act-black { color: var(--txt);  }
.act-green { color: var(--ok);   }
.act-close { color: var(--txt);  font-size: 1.2rem; }
.act-mask  { font-size: 1.4rem;}

/* Bouton filtre masque cyclique : état combo (mask + œil) */
.act-combo { width: auto; padding: 0 7px; gap: 3px; }
.act-combo i { font-size: 1.1rem; }

/* ─── Sélecteur de couleur arc-en-ciel ─── */
.act-cpick {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid rgba(0,0,0,.15);
  background: conic-gradient(#d5f5d5,#d5e8f5,#f5d5e0,#f5f0d5,#e8d5f5,#e8d5c8,#d5f5d5);
  cursor: pointer;
  transition: all .15s;
  flex-shrink: 0;
  padding: 0;
  margin-right: 5px;
  margin-left: 5px;
}
.act-cpick:hover       { transform: scale(1.2); }
.act-cpick.has-color   { border-width: 3px; }

#textTopBar .act{color:var(--acc)}
#textTopBar .act.on{color:var(--pri)}

.cpopup {
  position: fixed;
  background: var(--card);
  border-radius: 10px;
  padding: 8px 10px;
  box-shadow: 0 4px 16px rgba(0,0,0,.25);
  display: none;
  z-index: 150;
  gap: 6px;
  align-items: center;
}
.cpopup.open { display: flex; }

.cdot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid rgba(0,0,0,.12);
  cursor: pointer;
  transition: all .15s;
  flex-shrink: 0;
  display: inline-block;
}
.cdot:hover       { transform: scale(1.2); }
.cdot.active      { border: 3px solid var(--acc); }

.cfilter {
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.cfilter-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid rgba(0,0,0,.12);
  cursor: pointer;
  transition: all .15s;
}
.cfilter-dot:hover  { transform: scale(1.15); }
.cfilter-dot.active { border: 3px solid var(--acc); }

.color-sel       { display: flex; gap: 5px; align-items: center; margin: 6px 0; }
.color-sel .cdot { width: 24px; height: 24px; }

/* ═══ LAYOUT ═══ */
.box {
  background: var(--card);
  border-radius: var(--r);
  padding: 22px;
  box-shadow: var(--sh);
  margin-bottom: 14px;
}
.box-center {
  max-width: 380px;
  margin: 30px auto;
  text-align: center;
}

.box input[type=text],
.box input[type=email],
.box input[type=password] {
  width: 100%;
  padding: 10px 13px;
  border: 2px solid var(--bdr);
  border-radius: 8px;
  font-size: .95rem;
  font-family: inherit;
  margin-bottom: 8px;
}
.box input:focus { outline: none; border-color: var(--pri); }

.box textarea {
  width: 100%;
  padding: 10px 13px;
  border: 2px solid var(--bdr);
  border-radius: 8px;
  font-size: .95rem;
  font-family: inherit;
  resize: vertical;
  margin-bottom: 8px;
  display: block;
}
.box textarea:focus { outline: none; border-color: var(--pri); }

/* ─── Barre de progression ─── */
.pbar {
  width: 100%;
  height: 5px;
  background: var(--bdr);
  border-radius: 3px;
  margin-bottom: 14px;
  overflow: hidden;
}
.pfill {
  height: 100%;
  background: linear-gradient(90deg, var(--pri), var(--pri2));
  border-radius: 3px;
  transition: width .4s;
}

/* ═══ CARTE D'APPRENTISSAGE ═══ */
.phrase {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--acc);
  text-align: center;
  padding: 12px;
  margin-bottom: 10px;
  line-height: 1.5;
}

.hint {
  background: #fef9e7;
  border: 1px solid #f9e79f;
  border-radius: 8px;
  padding: 8px 12px;
  margin-bottom: 10px;
  font-size: .8rem;
  color: #7d6608;
  cursor: pointer;
  text-align: center;
}
.hint .hc          { display: none; margin-top: 4px; font-weight: 700; }
.hint.open .hc     { display: block; }

.mic-area { text-align: center; margin: 12px 0; }

.mic-btn {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 3px solid var(--pri);
  background: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all .3s;
}
.mic-btn svg { width: 24px; height: 24px; fill: var(--pri); }
.mic-btn.on  {
  background: var(--pri);
  border-color: var(--pri);
  animation: pls 1s infinite;
}
.mic-btn.on svg { fill: #fff; }

@keyframes pls {
  0%,100% { box-shadow: 0 0 0 0   rgba(192,57,43,.4); }
  50%     { box-shadow: 0 0 0 12px rgba(192,57,43,0);  }
}

.answer-in {
  width: 100%;
  padding: 10px;
  border: 2px solid var(--bdr);
  border-radius: 8px;
  font-size: .95rem;
  font-family: inherit;
  text-align: center;
  margin: 8px 0;
}
.answer-in:focus { outline: none; border-color: var(--pri); }

/* ─── Zone de solution ─── */
.sol {
  border-radius: var(--r);
  padding: 14px;
  margin-top: 12px;
  display: none;
}
.sol.right { background: #f0faf0; border: 2px solid var(--ok); }
.sol.wrong { background: #fdf0f0; border: 2px solid var(--err); }
.sol h4    { margin-bottom: 6px; font-size: .85rem; }
.sol .sru  { font-size: 1.05rem; font-weight: 700; color: var(--acc); margin-bottom: 3px; }
.sol .sfr  { font-size: .95rem; color: var(--txt2); margin-bottom: 6px; }
.sol-btns  { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; align-items: center; }

/* ═══ ONGLETS ═══ */
.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 10px;
  flex-wrap: wrap;
  justify-content: center;
}
.tab {
  padding: 6px 13px;
  border-radius: 18px;
  border: 2px solid var(--bdr);
  background: var(--card);
  font-weight: 600;
  font-size: .73rem;
  cursor: pointer;
  transition: all .15s;
}
.tab:hover   { background: var(--bdr); }
.tab.on      { background: var(--acc); color: #fff; border-color: var(--acc); }

.badge {
  display: inline-block;
  color: #fff;
  border-radius: 50%;
  min-width: 16px;
  height: 16px;
  line-height: 16px;
  font-size: .6rem;
  text-align: center;
  margin-left: 3px;
  vertical-align: middle;
}
.badge-r      { background: var(--err);  }
.badge-c      { background: var(--ok);   }
.badge-k      { background: var(--blue); }
.tab.on .badge { background: rgba(255,255,255,.35); }

/* 2) ONGLET FUSIONNÉ « Couleurs / Masque » — séparateur discret entre les
      deux icônes. Le bouton lui-même garde le style .tab standard. */
      .tab.tab-cm { display: inline-flex; align-items: center; }
      .tab-sep {
        display: inline-block;
        width: 1px;
        height: .85em;
        margin: 0 7px;
        background: currentColor;
        opacity: .4;
        vertical-align: middle;
      }


/* 3) ACTIONS DE CARTE onglet fusionné : [masque] + 7 pastilles = 8 boutons, 4 par ligne */
.cli-acts.mask-acts {
  display: grid;
  grid-template-columns: repeat(4, 34px);
  gap: 3px;
  justify-content: flex-end;
  align-items: center;
}
.cli-acts.mask-acts .cdot { width: 28px; height: 28px; }
.cli-acts.mask-acts .act  { width: 28px; height: 28px; font-size: 1.6rem; }


/* ═══ TOGGLE (interrupteur) ═══ */
.toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .78rem;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
}
.toggle input { display: none; }
.toggle .sw {
  width: 36px;
  height: 20px;
  background: var(--bdr);
  border-radius: 10px;
  position: relative;
  transition: background .2s;
}
.toggle .sw::after {
  content: '';
  width: 16px;
  height: 16px;
  background: #fff;
  border-radius: 50%;
  position: absolute;
  top: 2px;
  left: 2px;
  transition: transform .2s;
}
.toggle input:checked + .sw            { background: var(--pri); }
.toggle input:checked + .sw::after    { transform: translateX(16px); }

/* Bandeau modes/options en 2 lignes */
.mode-options-bar { display:flex; flex-direction:column; gap:8px; }
.mo-row { display:flex; align-items:center; flex-wrap:wrap; gap:6px; }
.mo-tag { font-family: "Give You Glory"; font-size:1.2rem; font-weight:400; color:var(--bk); text-transform:none; letter-spacing:normal; margin: 1px 0 -4px; }
.mo-btns { display:inline-flex; gap:4px; flex-wrap:wrap; }
.mo-btn {
  width:32px; height:32px; border:none; background:transparent; cursor:pointer;
  display:inline-flex; align-items:center; justify-content:center; font-size:1.1rem;
  padding:0; border-radius:6px; transition:all .15s; color:var(--txt); flex-shrink:0;
}
.mo-btn:hover { background:rgba(0,0,0,.06); transform:scale(1.12); }
.mo-btn.sel   { color:var(--pri); }
.mo-btn .mo-combo { display:inline-flex; gap:0; font-size:.78rem; }

/* Switches en boutons icônes (Indice / Recto-Verso / Muet / Mains-libres) */
.mo-sw {
  width:36px; height:36px; border:2px solid var(--bdr); background:transparent; cursor:pointer;
  display:inline-flex; align-items:center; justify-content:center; font-size:1.15rem;
  padding:0; border-radius:9px; transition:all .15s; color:var(--txt2); flex-shrink:0;
}
.mo-sw:hover { background:rgba(0,0,0,.06); }
.mo-sw.on { color:#fff; background:var(--pri); border-color:var(--pri); }

.mem-cell.matched { position:relative; }
.mem-edit-acts { position:absolute; bottom:2px; right:2px; display:flex; gap:2px; }
.mem-edit-acts .act { width:22px; height:22px; font-size:.7rem; }

/* ═══ LISTES ═══ */
.ilist    { list-style: none; }
.ilist li {
  background: var(--card);
  border: 1px solid var(--bdr);
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.empty {
  text-align: center;
  padding: 30px 16px;
  color: var(--txt2);
}

/* ─── Statistiques ─── */
.stats {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.stat    { text-align: center; padding: 6px 12px; background: var(--card); border-radius: 8px; box-shadow: var(--sh); }
.stat .sn { font-size: 1.1rem; font-weight: 800; color: var(--acc); }
.stat .sl { font-size: .65rem; color: var(--txt2); }

/* ─── Timer bar ─── */
.tbar  { height: 3px; background: var(--bdr); border-radius: 2px; margin-top: 8px; overflow: hidden; }
.tfill { height: 100%; background: var(--warn); transition: width .1s linear; }

/* ═══ ÉCRANS ═══ */
.screen        { display: none; }
.screen.active { display: block; }

/* ═══ MODALES ═══ */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 100;
  align-items: center;
  justify-content: center;
}
.modal.open { display: flex; }

.modal-box {
  background: var(--card);
  border-radius: var(--r);
  padding: 24px;
  max-width: 420px;
  width: 90%;
  box-shadow: 0 8px 30px rgba(0,0,0,.2);
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
}
.modal-box h3 {
  font-family: 'Give You Glory', serif; font-size: 1.5rem;
  color: var(--acc);
  margin-bottom: 12px;
  padding-right: 30px;
}
.modal-box select,
.modal-box input[type=text] {
  width: 100%;
  padding: 8px 11px;
  border: 2px solid var(--bdr);
  border-radius: 8px;
  font-size: .88rem;
  font-family: inherit;
  margin-bottom: 8px;
}
.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 1.2rem;
  color: var(--txt);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
}
.modal-close:hover { background: rgba(0,0,0,.08); }

/* ═══ LISTE DE CARTES ═══ */
.card-list { list-style: none; padding: 0; }

.cli {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 8px;
  background: var(--card);
  border: 1px solid var(--bdr);
  border-radius: 8px;
  margin-bottom: 6px;
  cursor: pointer;
  transition: all .15s;
}
.cli:hover { box-shadow: 0 2px 8px rgba(0,0,0,.1); transform: translateY(-1px); }

.cli-text { flex: 1; min-width: 0; }
.cli-tgt  {
  font-weight: 700;
  color: var(--acc);
  font-size: .85rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cli-src {
  color: var(--txt2);
  font-size: .75rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cli-acts { display: grid; grid-template-columns: repeat(3, auto); gap: 2px; margin-left:auto; }
.cli-actss { display: grid; grid-template-columns: repeat(4, auto); gap: 2px; margin-left:auto; }
.cli-acts.txt-acts { grid-template-columns: repeat(2, auto); }

/* ═══ RECHERCHE D'IMAGES ═══ */
.img-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 5px;
  max-height: 280px;
  overflow-y: auto;
  margin: 6px 0;
  padding: 4px;
}
.img-grid-item {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 6px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all .15s;
}
.img-grid-item:hover    { border-color: var(--pri); transform: scale(1.05); }
.img-grid-item.selected { border-color: var(--ok);  box-shadow: 0 0 0 3px rgba(39,174,96,.3); }

.img-source { font-size: .5rem; color: var(--txt2); text-align: center; }

.emoji-item {
  font-size: 2rem;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  border: 2px solid transparent;
  text-align: center;
  transition: all .15s;
}
.emoji-item:hover    { background: rgba(0,0,0,.05); transform: scale(1.15); }
.emoji-item.selected { border-color: var(--ok); background: rgba(39,174,96,.1); }

.card-img {
  width: 80px;
  height: 80px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--bdr);
}

/* ═══ ZONE DANGEREUSE ═══ */
.danger-zone    { background: #444; color: #fff; border-radius: var(--r); padding: 16px; margin-top: 12px; }
.danger-zone h4 { color: #ff8888; margin-bottom: 8px; }

/* ═══ RESPONSIVE ═══ */
@media (max-width: 500px) {
  .phrase { font-size: .95rem; padding: 8px; }
  .box    { padding: 16px; }
  h1      { font-size: 3.6rem; }
}

/* ═══════════════════════════════════════════════
   ÉTAPE 4 — Barre mode + options + onglet Liste
   ═══════════════════════════════════════════════ */

/* ─── Barre regroupant mode (gauche), toggles (centre), options (droite) ─── */
.mode-options-bar {
  padding: 8px 12px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.mode-zone,
.option-zone {
  display: flex;
  align-items: center;
  gap: 6px;
}

.mode-label,
.option-label {
  font-size: .8rem;
  font-weight: 700;
  color: var(--acc);
  white-space: nowrap;
}

.toggles-zone {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  flex: 1;
}

/* Boutons mode + options : bordeaux discret, ressort au survol */
.act-mode,
.act-options {
  color: var(--pri);
}
.act-mode:hover,
.act-options:hover {
  background: rgba(192, 57, 43, .1);
}

/* ─── Popup du sélecteur de mode (similaire à cpopup) ─── */
.mode-popup {
  flex-direction: column;
  align-items: stretch;
  padding: 6px;
  min-width: 160px;
  gap: 4px;
}
.mode-popup.open {
  display: flex;
}
.mode-opt {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: transparent;
  border: 2px solid var(--bdr);
  border-radius: 8px;
  font-family: inherit;
  font-size: .85rem;
  font-weight: 600;
  color: var(--txt);
  cursor: pointer;
  text-align: left;
  transition: all .15s;
}
.mode-opt:hover {
  background: var(--bdr);
  border-color: var(--pri);
}
.mode-opt.active {
  background: var(--pri);
  color: #fff;
  border-color: var(--pri);
}

/* ─── Onglet "Liste" : comme les autres, bordure --acc ─── */
.tab.tab-list {
  border-color: var(--acc);
}
.tab.tab-list.on {
  background: var(--acc);
  color: #fff;
  border-color: var(--acc);
}

/* ─── Adaptations mobile pour la nouvelle barre ─── */
@media (max-width: 500px) {
  .mode-options-bar {
    gap: 6px;
    padding: 6px 8px;
  }
  .mode-label,
  .option-label {
    font-size: .72rem;
  }
}

/* ═══ MODE EASY (QCM) ═══ */
.easy-opts { display:flex; flex-direction:column; gap:8px; margin:10px 0; }
.easy-opt {
  width:100%; min-height:46px; padding:12px 14px;
  border:2px solid var(--bdr); border-radius:10px;
  background:var(--card); color:var(--acc);
  font-family:inherit; font-size:.95rem; font-weight:700;
  text-align:center; cursor:pointer; transition:all .15s;
}
.easy-opt:hover:not(:disabled):not(.empty) {
  border-color:var(--pri); transform:translateY(-1px); box-shadow:0 2px 8px rgba(0,0,0,.1);
}
.easy-opt.empty     { background:transparent; border-style:dashed; opacity:.4; cursor:default; }
.easy-opt.correct   { background:#f0faf0; border-color:var(--ok);  color:var(--ok); }
.easy-opt.incorrect { background:#fdf0f0; border-color:var(--err); color:var(--err); }
.easy-opt.answered  { cursor:default; }


/* ═══════════════════════════════════════════════
   MODE MEMORY (6 paires)
   À coller à la fin de css/style.css (ou en css/modes/memory.css)
   Réutilise les variables de thème existantes (--pri, --acc, etc.)
   ═══════════════════════════════════════════════ */

.mem-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: .73rem;
  color: var(--txt2);
  margin-bottom: 10px;
}
.mem-head #memScore { font-weight: 700; color: var(--acc); }

.mem-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 4px 0;
}

.mem-cell {
  position: relative;
  aspect-ratio: 3 / 2.3;
  min-height: 64px;
  border: 2px solid var(--bdr);
  border-radius: 10px;
  background: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 6px;
  text-align: center;
  overflow: hidden;
  transition: transform .15s, border-color .2s, box-shadow .2s;
}

/* Face cachée */
.mem-cell.down {
  cursor: pointer;
  background-color: var(--bgm);
  background-image: var(--mask-img);
  background-repeat: repeat;            /* hauteur + longueur, toute la surface */
  background-position: center;
  border-color: var(--bdr);
}
.mem-cell.down:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,.18);
}

/* Face révélée (animation de retournement) */
.mem-cell.up {
  border-color: var(--acc);
  animation: memFlip .25s ease;
}
@keyframes memFlip {
  from { transform: rotateY(90deg); opacity: .25; }
  to   { transform: rotateY(0);     opacity: 1;   }
}

/* Paire trouvée : la bordure de couleur vive est posée en inline */
.mem-cell.matched { animation: memPop .3s ease; }
@keyframes memPop {
  0%   { transform: scale(.9); }
  60%  { transform: scale(1.06); }
  100% { transform: scale(1); }
}

/* Case vide (moins de 6 paires disponibles) */
.mem-cell.empty {
  border-style: dashed;
  opacity: .35;
  background: transparent;
}

.mem-txt {
  font-size: .8rem;
  font-weight: 700;
  color: var(--acc);
  line-height: 1.25;
  word-break: break-word;
}
.mem-img { font-size: 1.8rem; line-height: 1; }
.mem-img img {
  max-width: 100%;
  max-height: 56px;
  border-radius: 6px;
  object-fit: cover;
}

/* Écran de fin de partie */
.mem-end { text-align: center; padding: 8px 0; }
.mem-end h3 {
  font-family: 'Give You Glory', serif;
  color: var(--acc);
  margin-bottom: 6px;
}
.mem-end-btns {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 12px;
}

/* Mobile : 3 colonnes */
@media (max-width: 500px) {
  .mem-board { grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .mem-cell  { min-height: 58px; }
  .mem-txt   { font-size: .72rem; }
  .mem-img   { font-size: 1.5rem; }
  .mem-img img { max-height: 48px; }
}

/* ═══════════════════════════════════════════════
   MODE MASQUE
   ═══════════════════════════════════════════════ */
.mask-tip     { font-size:.8rem; color:var(--warn); text-align:center; margin-bottom:6px; }
.mask-phrase  { font-size:1.15rem; font-weight:700; color:var(--acc); text-align:center;
                line-height:1.9; padding:4px 4px 8px; word-break:break-word; }
.mask-src     { font-size:.9rem; color:var(--txt2); text-align:center; }

.mw                       { border-radius:4px; padding:0 2px; transition:background .12s; }
.mask-phrase .mw          { cursor:pointer; }
.mask-phrase .mw:hover    { background:rgba(0,0,0,.08); }
.mask-phrase .mw.masked { cursor: pointer; }
.mw.masked {
  position: relative;                   /* ancre l'overlay ::after du motif */
  background-color: var(--bgm);
  color: transparent;
  border-radius: 4px;
  transition: color .15s, background-color .15s;
}
/* Motif porté par un overlay dont on bascule l'OPACITÉ (et non background-size) :
   Android repeint l'opacité de façon fiable → l'image perso revient après une
   révélation (fix mobile ; sur PC le comportement est identique). */
.mw.masked::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background-image: var(--mask-img);
  background-repeat: repeat-x;
  background-position: center center;
  background-size: auto 100%;
  opacity: 1;
  transition: opacity .15s;
  pointer-events: none;                 /* laisse passer tap/clic vers le mot */
}
/* Survol / toucher : on voit le mot (masquage totalement transparent) */
.mask-phrase .mw.masked.reveal,
.text-body   .mw.masked.reveal {
  background-color: transparent;
  color: var(--acc);
}
.mask-phrase .mw.masked.reveal::after,
.text-body   .mw.masked.reveal::after { opacity: 0; }


#mdPhrase .mw.masked { cursor: pointer; }
#mdPhrase .mw.masked:hover {
  background-color: transparent;
  color: var(--acc);
}
#mdPhrase .mw.masked:hover::after { opacity: 0; }

/* ── LOT E ── Mots cliquables en flashcards (espace mots) ──
   Prompt verso + ligne solution (.sru). Hors mode Masque, un mot « masqué » est
   seulement affiché en gras --pri (jamais caché) ; la solution reste complète. */
.fc-words .mw            { cursor: pointer; }
.fc-words .mw:hover      { background: rgba(0,0,0,.06); }
.fc-words .mw.fc-marked  { color: var(--pri); font-weight: 700; }


.mask-rate      { text-align:center; margin-top:10px; }
.mask-rate-btns { display:flex; gap:6px; justify-content:center; flex-wrap:wrap; align-items:center; }


/* ─── Textes : lecteur/éditeur plein écran ─── */
.text-body {
  white-space: pre-wrap;            /* conserve espaces et retours ligne */
  user-select: none; -webkit-user-select: none;
  line-height: 1.95; font-size: 1.05rem; color: var(--acc); word-break: break-word;
}
.text-body .mw { border-radius: 4px; padding: 0 1px; }
.text-body .mw:not(.masked):hover { background: rgba(0,0,0,.06); cursor: pointer; }
.text-body .mw.masked { cursor: pointer; }


/* ═══════════════════════════════════════════════════════
   MAMORY — style.css — PATCH PHASE 4
   Éditeur inline de mot dans le lecteur de texte
   Coller à la fin de style.css (ou dans la section Textes).
   ═══════════════════════════════════════════════════════ */

/* Conteneur inline : input + 2 boutons icône, alignés sur la baseline du texte */
.mw-edit-wrap {
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
  vertical-align: baseline;
}

/* Champ de saisie : hérite la police du texte pour rester invisible dans la prose */
.mw-edit-in {
  font: inherit;
  color: var(--txt);
  background: var(--bg2, #f2f5f8);
  border: 1.5px solid var(--acc, #4a7fc1);
  border-radius: 3px;
  padding: 1px 5px;
  min-width: 2em;
  max-width: 15em;
  outline: none;
  line-height: 1.5;
  /* Largeur minimale adaptative selon le contenu initial via JS */
}

/* Micro-boutons icône : taille réduite pour ne pas déformer la ligne */
.mw-edit-mic,
.mw-edit-ok {
  font-size: .78rem !important;
  padding: 2px 5px !important;
  line-height: 1.3 !important;
}

/* Micro actif → rouge */
.mw-edit-mic.on {
  color: var(--red, #c44) !important;
}

/* Valider → vert */
.mw-edit-ok {
  color: var(--green, #2a9) !important;
}


/* ═══════════════════════════════════════════════════════
   MAMORY — PATCH PHASE 5 : Images flottantes dans le texte
   Coller à la fin de style.css
   ═══════════════════════════════════════════════════════ */

/* Wrapper flottant : ancre l'image à gauche, le texte l'habille à droite.
   max-width 45% pour laisser au moins la moitié du conteneur au texte. */
   .text-img-wrap {
    position: relative;
    float: left;
    max-width: 45%;
    margin: 4px 12px 8px 0;
  }

  /* Image proprement dite : ratio naturel préservé (pas d'object-fit:cover).
     max-height pour éviter qu'une image portrait n'écrase le texte. */
  .text-img {
    display: block;
    max-width: 100%;
    max-height: 220px;
    border-radius: 8px;
  }

  /* Bouton de suppression : positionné dans le coin supérieur droit du wrapper,
     invisible au repos, visible au survol du wrapper. */
  .text-img-del {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    padding: 0;
    font-size: .68rem;
    line-height: 1;
    background: rgba(0, 0, 0, .55);
    color: #fff;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity .15s;
  }
  .text-img-wrap:hover .text-img-del { opacity: 1; }

  /* Clearfix sur le conteneur du texte : évite que le contenu qui suit
     le texte ne remonte sous les images flottantes non soldées. */
  .text-body::after {
    content: '';
    display: table;
    clear: both;
  }

  /* ░░ Textes : phrases-cartes ░░ */
.tphr-add{cursor:pointer;color:var(--txt2);font-size:.82em;opacity:1;margin-right:6px;vertical-align:baseline;touch-action:manipulation}
.tphr-add:hover{opacity:1}
.tphr-menu{position:fixed;display:none;z-index:1200;background:#fff;border:1px solid var(--bdr);border-radius:10px;box-shadow:0 6px 24px rgba(0,0,0,.18);padding:6px;gap:4px;align-items:center;flex-wrap:wrap;max-width:230px}
.tphr-menu.open{display:flex}
.tphr-menu button{border:none;background:transparent;cursor:pointer;font-size:1.05rem;color:var(--acc);width:34px;height:34px;border-radius:8px}
.tphr-menu button:hover{background:rgba(0,0,0,.06)}
.tphr-card-tgt{font-size:1.5rem;font-weight:700;color:var(--acc)}
.tphr-card-lit{font-style:italic;color:var(--txt2);font-size:.85rem;margin-top:4px}
.tphr-card-nat{font-size:1rem;margin-top:2px}

/* Modal carte texte : bandeau actions separe par --acc */
.tc-head-row{display:flex;align-items:center;gap:4px;margin-bottom:4px}
.tc-footer{display:flex;align-items:center;gap:4px;background:#fff;margin:14px -24px -24px;padding:10px 16px;border-top:1px solid var(--bdr);border-radius:0 0 var(--r) var(--r)}
.tc-footer .color-sel{margin:0;flex-wrap:nowrap}
.tc-footer .cdot{width:22px;height:22px}

/* Surlignage couleur d'une phrase dans le texte */
.tphr-block{border-radius:4px;padding:1px 0;display:inline}
#modalTextAlert{z-index:1300}
#modalImgSearch{z-index:1250}

/* ░░ Textes : lecteur audio fixe (viewer) ░░ */
#textAudioBar{
  position:fixed; left:0; right:0; bottom:0; z-index:60;
  display:flex; align-items:center; gap:8px;
  padding:8px 12px; background:#fff;
  border-top:1px solid var(--bdr);
  box-shadow:0 -4px 16px rgba(0,0,0,.08);
}
#textAudioBar audio{ max-width:100%; }
/* Évite que le bas du texte passe sous la barre */
#scrTextView.active{ padding-bottom:64px; }
@media (max-width:500px){ #scrTextView.active{ padding-bottom:60px; } }


/* ░░ Vue texte refondue : barre de switches + lignes phrase ░░ */
#textViewHead{position:sticky;top:0;z-index:6;background:var(--bg,#fff)}
.tv-head-row{display:flex;align-items:center;gap:10px;padding:8px 4px}

/* Barre du haut = div blanc avec de vrais switchs (comme l'espace mots) */
#textTopBar{
  display:flex;align-items:center;justify-content:center;gap:14px;flex-wrap:wrap;
  background:var(--card);border:1px solid var(--bdr);border-radius:var(--r);
  box-shadow:var(--sh);padding:8px 12px;margin:6px 0 10px;
}

/* Texte du div proche des bords (zones boutons collées aux bords) */
/* ↓↓ ESPACE BORD ↔ BOUTON : 2e valeur = horizontal (augmenter pour éloigner du bord) */
#scrTextView > .box{padding:12px 16px}

/* Une phrase par ligne : zone boutons gauche | texte | zone boutons droite.
   AUCUN fond ni bordure sur la ligne : le fond couleur vit sur .tphr-block. */
/* ↓↓ ESPACE BOUTON ↔ TEXTE : régler "gap" (augmenter pour décoller le texte des boutons) */
.tphr-row{display:flex;align-items:flex-start;gap:12px;padding:1px 0;margin:2px 0}
/* « plus » et haut-parleur ALIGNÉS (côte à côte) : flex-direction row */
.tphr-col{display:flex;flex-direction:row;align-items:center;gap:6px;flex-shrink:0;padding-top:3px}
.tphr-col .tphr-add{margin:0;font-size:1.05rem;color:var(--acc)}   /* « plus » → --acc */
.tphr-col .tphr-spk{width:26px;height:26px;font-size:.95rem;color:var(--pri)} /* haut-parleur → --pri */
/* Image de la phrase : posée à l'initiale du texte (inline), pas dans la zone boutons */
.tphr-rowimg{display:inline-block;vertical-align:middle;margin-right:6px}
.tphr-rowimg img{border-radius:6px;display:inline-block;vertical-align:middle}
.tphr-main{flex:1;min-width:0}
.tphr-line{line-height:1.85}
.tphr-rowend{flex-shrink:0;padding-top:4px}
.tphr-del{cursor:pointer;color:var(--pri);font-size:.95rem;opacity:.8;touch-action:manipulation} /* poubelle → --pri */
.tphr-del:hover{opacity:1}
.tphr-trans{margin-top:3px;padding-left:2px}
.tphr-tr-lit{font-style:italic;color:var(--txt2);font-size:.8rem}
.tphr-tr-nat{color:var(--txt2);font-size:.82rem}
/* Surlignage de lecture auto : léger fond, sans toucher au fond couleur des mots */
.tphr-row.playing{background:rgba(192,57,43,.06);border-radius:6px}
.tphr-row.playing .tphr-line{font-weight:700}

/* Fond couleur d'une phrase : du 1er au dernier mot, sans bordure */
.text-body .tphr-block{border-radius:4px;padding:1px 0;display:inline;border:none}

/* ─── Mode correction inline de la vue texte ─── */
.tphr-edit{display:block;margin:6px 0;padding:6px;border-radius:8px;background:rgba(0,0,0,.025)}
.tphr-edit .tphr-main{display:flex;flex-direction:column;gap:4px}
.tphr-emain{display:flex;flex-direction:column;gap:6px}
.tphr-eacts{display:flex;flex-wrap:wrap;gap:2px;align-items:center}
.tphr-eb{width:30px;height:30px;font-size:.95rem}
.tphr-f{width:100%;font:inherit;font-size:.95rem;border:1.5px solid var(--bdr);border-radius:6px;padding:4px 8px;resize:none;overflow:hidden;background:#fff;color:var(--txt);line-height:1.4;user-select:text;-webkit-user-select:text}
.tphr-f-tgt{color:var(--acc);font-weight:600}
.tphr-f:focus{outline:none;border-color:var(--acc)}
.tphr-frow{display:flex;gap:4px;align-items:flex-start}
.tphr-frow .tphr-f{flex:1}
.tphr-dic{width:30px;height:34px;flex:0 0 auto;font-size:.95rem}
.act-mic.mic-armed{color:var(--err)}
.tphr-mic{width:30px;height:30px;font-size:.95rem}
.tphr-mic.on{color:var(--pri)!important}

/* Barre de réglage des cues (mode CC) */
.tv-cuebar{display:flex;flex-wrap:wrap;gap:6px;align-items:center;margin-top:4px;padding-top:4px;border-top:1px dashed var(--bdr)}
.tv-cue-grp{display:inline-flex;align-items:center;gap:1px;border:1px solid var(--bdr);border-radius:6px;padding:1px 3px}
.tv-cue-tag{font-size:.68rem;color:var(--txt2);margin-right:2px;text-transform:uppercase;letter-spacing:.02em}
.tv-cue-s,.tv-cue-e{font-family:ui-monospace,Menlo,Consolas,monospace;font-size:.8rem;color:var(--txt);min-width:3.6em;text-align:center}
.tv-cue-step{width:26px;height:26px;font-size:.78rem}
.tv-cuebar .act{width:28px;height:28px;font-size:.85rem}
.tv-play{color:var(--pri)}

/* Bascule crayon ↔ coche dans la barre de titre */
#textEditToggle.on{color:var(--pri)}

/* Menu « + » sur une seule ligne (plus long, moins large) */
.tphr-menu{flex-wrap:nowrap;max-width:none;white-space:nowrap}


/* Mot masqué rendu transparent (switch « masquages » off, ou révélé au clic/survol)
   → texte en couleur --pri pour signaler qu'il s'agit d'un mot masqué démasqué. */
   .text-body .mw.masked.reveal,
   .text-body.mask-hidden .mw.masked{
     background-color:transparent;
     color:var(--pri);
   }
   .text-body .mw.masked.reveal::after,
   .text-body.mask-hidden .mw.masked::after{ opacity:0; }


   /* Page création texte : bandeau + zone upload */
.nt-hint     { font-size:.82rem; color:var(--txt2); margin:0 0 8px; text-align:center; }
.nt-upload   { display:flex; gap:18px; justify-content:center; align-items:center; margin-bottom:4px; }
.nt-upload .act { font-size:1.5rem; }
.nt-up-pri   { color:var(--pri); }
.nt-up-acc   { color:var(--acc); }
.nt-upstatus { display:flex; gap:10px; justify-content:center; font-size:.72rem; color:var(--txt2); min-height:1em; margin-bottom:4px; }
.nt-sep      { border:none; border-top:2px solid var(--bdr); margin:10px 0 12px; }


/* Tâche 3 : mots masqués en rouge dans le modal carte (comme la vue texte) */
.tphr-card-tgt .tc-masked{ color:var(--pri); }
.tphr-card-tgt .tcw{cursor:pointer;user-select:none;-webkit-user-select:none;border-radius:4px;padding:0 1px}
.tphr-card-tgt .tcw.sel{outline:2px solid var(--acc);outline-offset:1px}

/* Tâche 5 : la confirmation passe AU-DESSUS du modal carte (et de l'alerte) */
#modalConfirm{ z-index:1400; }


/* Cartes (espace mots) — rapprocher indice/commentaire de la phrase promptée */
.phrase { margin-bottom: 4px; padding: 8px 12px; }
/* ─── Boutons TTS multi-fournisseur (wavenet / azure) + état quota épuisé (Conv 4) ─── */
.tts-btns { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-bottom: 4px; }
.tts-prov { }
.tts-prov .tts-prov-lbl { white-space: nowrap; }
.tts-prov.tts-spent { opacity: .5; border-color: var(--bdr); color: var(--txt2); }
.tts-prov.tts-spent:hover { border-color: var(--warn); color: var(--warn); }
/* Pas de clé/droit : grisé mais cliquable (ouvre le modal clés API). */
.tts-prov.tts-noapi { opacity: .45; border-color: var(--bdr); color: var(--txt2); }
.tts-prov.tts-noapi:hover { opacity: .7; border-color: var(--acc); color: var(--acc); }

/* Bouton fournisseur image Unsplash sans clé : grisé mais cliquable (ouvre clés API). */
#srcBtnUnsplash.img-noapi { opacity: .45; }
#srcBtnUnsplash.img-noapi:hover { opacity: .7; }

/* Séparateur dans la barre d'options de la vue texte. */
.ttb-sep { display: inline-block; width: 1px; height: 22px; background: var(--bdr); margin: 0 6px; vertical-align: middle; }

/* Modal d'aide contextuelle (gestes & clics). */
.help-body { display: flex; flex-direction: column; gap: 10px; max-height: 70vh; overflow-y: auto; }
.help-row { display: flex; gap: 10px; align-items: flex-start; }
.help-ic { color: var(--acc); width: 22px; text-align: center; margin-top: 2px; flex-shrink: 0; }
.help-row b { font-size: .9rem; }
.help-desc { font-size: .8rem; color: var(--txt2); margin-top: 1px; }

/* Modal recherche images : label du bouton « Importer » visible au survol seul */
.img-up-lbl{display:none;font-size:.7rem}
.img-up-btn:hover .img-up-lbl,
.img-up-btn:focus-visible .img-up-lbl{display:inline}

/* Bouton Dictionnaire (autres sens, modal Mots) — 3 états */
#ecDictBtn{font-size:1rem;cursor:pointer}
#ecDictBtn.dict-warn{color:var(--warn)}
#ecDictBtn.dict-on{color:var(--acc)}
#ecDictBtn.dict-off{color:var(--txt2);opacity:.45;cursor:not-allowed}


/* ═══ LOT D — Fiche mot (mini-dictionnaire) — à coller dans style.css ═══ */
#wdBox { text-align: left; }
.wd-head { text-align: center; }
.wd-headword { font-size: 1.25rem; font-weight: 700; line-height: 1.2; }
.wd-lemma { color: var(--pri); font-weight: 700; }
.wd-meta { display: flex; gap: 8px; justify-content: center; align-items: center; flex-wrap: wrap; margin-top: 2px; }
.wd-pos { font-size: .72rem; color: var(--txt2); font-style: italic; }
.wd-root { font-size: .82rem; color: var(--acc); }
.wd-gloss { text-align: center; font-size: .85rem; color: var(--txt2); margin-top: 2px; }
.wd-actions { display: flex; gap: 6px; justify-content: center; margin-top: 6px; }
.wd-conj { display: flex; flex-wrap: wrap; gap: 5px; justify-content: center; margin: 6px 0; }
.wd-cj { font-size: .74rem; padding: 2px 7px; border: 1px solid var(--bdr); border-radius: 999px; background: var(--bg); white-space: nowrap; }
.wd-cj b { color: var(--txt2); font-weight: 600; margin-right: 3px; }
.wd-senses { margin: 6px 0; padding: 6px 8px; border: 1px solid var(--bdr); border-radius: 8px; background: var(--bg); }

.wd-sec { margin-top: 10px; }
.wd-sec-h { font-size: .74rem; font-weight: 700; color: var(--txt2); text-transform: uppercase; letter-spacing: .03em; margin-bottom: 4px; }
.wd-phr-tgt { font-size: .95rem; line-height: 1.5; margin-bottom: 6px; }
.wd-phr-tgt .wd-hi { color: var(--pri); font-weight: 700; }
.wd-lab { display: block; font-weight: 700; font-size: .76rem; margin: 4px 0 2px; }
.wd-row { display: flex; gap: 4px; margin-bottom: 2px; }

.wd-others { display: flex; flex-direction: column; gap: 5px; max-height: 190px; overflow-y: auto; }
.wd-occ { padding: 5px 8px; border: 1px solid var(--bdr); border-radius: 8px; background: var(--bg); font-size: .82rem; }
.wd-occ-t { display: block; font-weight: 600; }
.wd-occ-s { display: block; color: var(--txt2); font-size: .78rem; margin-top: 1px; }
.wd-occ-x { color: var(--acc); cursor: default; }
.wd-occ-x i { margin-right: 4px; }

.wd-foot { display: flex; gap: 6px; justify-content: center; margin-top: 10px; }


/* ════════════════════════════════════════════════════════════════
   LOT E — Expressions figées encadrées dans le modal carte-phrase
   À coller dans css/style.css (ajout ciblé, ne pas remplacer le fichier).
   ════════════════════════════════════════════════════════════════ */

/* Cadre d'une expression dans la cible de la carte (et aperçu fiche mot). */
.tc-expr {
  border: 1px dashed var(--acc);
  border-radius: 6px;
  padding: 0 3px;
  -webkit-box-decoration-break: clone;   /* le cadre suit les retours de ligne */
          box-decoration-break: clone;
}

/* Seule la cible de la CARTE est cliquable (ouvre le modal-expression). */
#tcTgtView .tc-expr {
  cursor: pointer;
  transition: border-color .12s ease, background-color .12s ease;
}
#tcTgtView .tc-expr:hover {
  border-color: var(--pri);
  background: var(--bg);
}



Style add lotf · CSS
/* ════════════════════════════════════════════════════════════════
   LOT F — Recherche corpus (loupes des 2 espaces, modal #modalCorpus)
   À COLLER en fin de css/style.css (ajout ciblé, ne PAS remplacer le fichier).
   Réutilise .wd-occ / .wd-* pour les résultats & le bloc dico.
   ════════════════════════════════════════════════════════════════ */
.cs-bar { display: flex; flex-wrap: nowrap; gap: 6px; align-items: center; margin-bottom: 8px; }
#csInput {
  flex: 1; min-width: 0; padding: 9px 10px; border: 2px solid var(--bdr); border-radius: 8px;
  font-family: inherit; font-size: .92rem; background: var(--card, #fff); color: var(--txt);
}
#csInput:focus { outline: none; border-color: var(--pri); }
.cs-dict {
  text-align: center; border: 1px solid var(--bdr); border-radius: 8px;
  background: var(--bg); padding: 8px; margin-bottom: 8px;
}
.cs-results { display: flex; flex-direction: column; gap: 5px; max-height: 46vh; overflow-y: auto; }
.cs-empty { text-align: center; color: var(--txt2); font-size: .82rem; padding: 14px 4px; }
.cs-occ-link { cursor: pointer; transition: border-color .12s ease, background-color .12s ease; }
.cs-occ-link:hover { border-color: var(--pri); background: var(--card, #fff); }


/* ════════════════════════════════════════════════════════════════════
   MAMORY — Ajouts CSS (à intégrer dans style.css, ne pas remplacer le fichier)
   Conv « Améliorations A/B/C ».
   ════════════════════════════════════════════════════════════════════ */

/* ── Tâche C ── Mots masqués (vue texte) : AJOUTER `font-weight:700`
   à la règle existante (≈ ligne 1229). Avant :

   .text-body .mw.masked.reveal,
   .text-body.mask-hidden .mw.masked{
     background-color:transparent;
     color:var(--pri);
   }

   Après : */
   .text-body .mw.masked.reveal,
   .text-body.mask-hidden .mw.masked{
     background-color:transparent;
     color:var(--pri);
     font-weight:700;            /* gras comme dans les modaux carte/mot/expression */
   }

   /* ── Tâche A2 ── États du bouton « dictionnaire » de la fiche mot / expression.
      À AJOUTER (par ex. juste après le bloc « .tphr-card-tgt .tc-masked »). */
   #wdDictBtn.dict-warn   { color: var(--warn); }   /* sens pas encore consultés via GPT */
   #wdDictBtn.dict-cached { color: var(--acc);  }   /* sens déjà en cache               */
   #wdDictBtn.dict-noapi  { color: var(--txt2); opacity: .55; }  /* aucune clé ChatGPT  */

   /* ── Tâche B ── Puces de l'aide vue texte (rendu liste dans le modal #modalHelp).
      À AJOUTER (par ex. juste après « .help-desc »). */
   .help-ul { margin: 2px 0 0; padding-left: 16px; font-size: .8rem; color: var(--txt2); }
   .help-ul li { margin: 1px 0; }


   /* ════════════════════════════════════════════════════════════════
   ÉDITION INLINE SUR LES CARTES (crayon) — carte-phrase + fiche mot
   À COLLER en fin de css/style.css (ajout ciblé, ne PAS remplacer le fichier).
   ════════════════════════════════════════════════════════════════ */

/* — Carte-phrase (#modalTextCard) : crayon dans la barre du haut + champs inline — */
.tc-edit-toggle.on { color: var(--pri); background: rgba(0,0,0,.06); }
#tcEdit .tc-ef {
  flex: 1; padding: 8px; border: 2px solid var(--bdr); border-radius: 8px;
  font-family: inherit; font-size: .85rem; resize: vertical;
}
.tc-elab { display: block; font-weight: 700; font-size: .78rem; margin: 4px 0 2px; }
.tc-elab-req { color: var(--err); }
.tc-eactions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 8px; }

/* — Fiche mot/expression (#modalWordDict) : crayon en haut à droite + vue jolie des trads — */
.wd-edit-toggle {
  position: absolute; top: 12px; right: 46px;
  width: 28px; height: 28px; border: none; background: transparent;
  cursor: pointer; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
}
.wd-edit-toggle:hover { background: rgba(0,0,0,.08); }
.wd-edit-toggle.on { color: var(--pri); background: rgba(0,0,0,.06); }
.wd-trad-nat { font-size: .85rem; line-height: 1.3; }
.wd-trad-lit { font-style: italic; color: var(--txt2); font-size: .85rem; margin-top: 1px; line-height: 1.3; }
.wd-trad-empty { color: var(--txt2); font-style: italic; }


/* ════════════════════════════════════════════════════════════════
   LOT F — Carte unifiée mot/expression (footer #modalWordDict)
   → à APPENDRE à la fin de style.css (ajouts ciblés, jamais le fichier complet)
   ════════════════════════════════════════════════════════════════ */
   .wd-img            { display:flex; justify-content:center; margin:6px 0; }
   .wd-img img        { max-width:120px; max-height:120px; border-radius:8px; object-fit:cover; }

   /* le pied passe en colonne : [outils image/audio/GPT + couleurs] puis [nouvelle FC + envoyer] */
   .wd-foot           { flex-direction:column; gap:8px; align-items:stretch; }
   .wd-tools          { display:flex; align-items:center; gap:6px; flex-wrap:wrap; }
   .wd-tools .color-sel { margin:0; flex-wrap:nowrap; }
   .wd-tools .cdot    { width:22px; height:22px; }
   .wd-send-row       { display:flex; justify-content:center; gap:8px; }
