/* Word games — mots mêlés, mots croisés, Motus. Reuses the --ef-* brand
   palette from ef-tokens.css, and the --surface/--ink theme variables wherever
   something has to stay legible in dark mode (a hard white here left near-white
   text on near-white paper the first time round, see ef-conjugaison.css). */

.ef-gr { max-width: 860px; margin: 0 auto; }
/* Playing is a different shape from configuring: the builder wants a readable
   column, a puzzle wants every pixel a desktop has, so the grid and its clues
   fit on one screen. The masthead shrinks for the same reason. */
.ef-gr--play { max-width: 1240px; }
.ef-gr--play .ef-gr__lede { display: none; }
.ef-gr--play .ef-gr__h1 { font-size: 1.5rem; margin-bottom: .2rem; }
.ef-gr--play .ef-gr__masthead { margin-bottom: .8rem; }
.ef-gr__masthead { text-align: center; margin: 0 0 1.4rem; }
.ef-gr__kicker { font-size: .72rem; letter-spacing: .16em; text-transform: uppercase; color: var(--ef-primary, #733428); font-weight: 700; }
.ef-gr__h1 { font-family: var(--ef-serif, Georgia, serif); font-size: 2rem; color: var(--ef-primary-dark, #4a2119); margin: .3rem 0 .5rem; }
.ef-gr__lede { color: var(--ef-text, #4a3b35); line-height: 1.6; max-width: 52ch; margin-inline: auto; }

/* numbered step headings, same shape as the conjugation trainer's */
.ef-gr__step { display: flex; align-items: center; justify-content: center; gap: .5rem;
  font-family: var(--ef-serif, Georgia, serif); font-size: 1.05rem; font-weight: 600;
  color: var(--ef-primary-dark, #4a2119); margin: 1.6rem 0 .6rem; text-align: center; }
.ef-gr__step-n { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
  width: 1.6em; height: 1.6em; border-radius: 50%; font-family: system-ui, sans-serif;
  font-size: .78rem; font-weight: 700; background: var(--ef-secondary, #FFF0EE); color: var(--ef-primary, #733428); }
.ef-gr__hint { text-align: center; font-size: .82rem; color: var(--ef-text-muted, #8a7a73); margin: .3rem auto .6rem; max-width: 56ch; }
.ef-gr__warn { text-align: center; min-height: 1.2em; margin: .2rem 0 .6rem; font-size: .86rem; color: var(--ef-wrong-text, #b91c1c); }
/* "here's how it will be built", not "this can't be built" — same line, no alarm */
.ef-gr__warn.is-note { color: var(--ef-text-muted, #8a7a73); }

/* step 1 — the three games */
.ef-gr__games { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: .6rem; margin: 0 0 .6rem; }
.ef-gr__game { display: flex; flex-direction: column; align-items: center; gap: .2rem; text-align: center;
  padding: .9rem .8rem; border-radius: 14px; cursor: pointer;
  background: var(--ef-bg-soft, #FFFBF9); border: 1.5px solid var(--ef-border-light, #F0E4E0); color: var(--ef-text, #4a3b35); }
.ef-gr__game.is-on { background: var(--ef-secondary, #FFF0EE); border-color: var(--ef-primary, #733428); }
.ef-gr__game-ico { font-size: 1.5rem; }
.ef-gr__game-name { font-family: var(--ef-serif, Georgia, serif); font-size: 1.05rem; color: var(--ef-primary-dark, #4a2119); }
.ef-gr__game-sub { font-size: .76rem; color: var(--ef-text-muted, #8a7a73); }

/* tabs + chips, shared with the other tools' visual language */
.ef-gr__tabs { display: flex; gap: .4rem; justify-content: center; flex-wrap: wrap; margin: 0 0 .7rem; }
.ef-gr__tabs button { font-size: .9rem; font-weight: 600; padding: .35rem .9rem; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--ef-border-light, #F0E4E0); background: var(--ef-bg-soft, #FFFBF9); color: var(--ef-primary, #733428); }
.ef-gr__tabs--sub button { font-size: .8rem; padding: .28rem .7rem; }
.ef-gr__tabs button.is-active { background: var(--ef-primary, #733428); color: #fff; border-color: var(--ef-primary, #733428); }

.ef-gr__tools { display: flex; align-items: center; justify-content: center; gap: .5rem; flex-wrap: wrap; margin: 0 0 .7rem; }
.ef-gr__search { flex: 1 1 190px; max-width: 280px; font-size: .92rem; padding: .45rem .8rem; border-radius: 999px;
  border: 1.5px solid var(--ef-border, #E5D4CE); background: var(--surface, #fff); color: var(--ink, #4a3b35); }
.ef-gr__search:focus { outline: none; border-color: var(--ef-primary, #733428); }
.ef-gr__mini { font-size: .78rem; font-weight: 600; padding: .3rem .8rem; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--ef-border-light, #F0E4E0); background: var(--ef-surface, #fff); color: var(--ef-primary, #733428); }
.ef-gr__mini:hover { background: var(--ef-secondary, #FFF0EE); }
.ef-gr__mini.is-active { background: var(--ef-primary, #733428); color: #fff; border-color: var(--ef-primary, #733428); }
.ef-gr__mini:disabled { opacity: .45; cursor: default; }
.ef-gr__count { font-size: .82rem; color: var(--ef-text-muted, #8a7a73); }

/* collapsed word list: the picks, each one removable */
.ef-gr__picked { display: flex; flex-wrap: wrap; gap: .3rem; justify-content: center; margin: 0 0 1rem; }
.ef-gr__chip { display: inline-flex; align-items: center; gap: .35rem; padding: .25rem .5rem .25rem .7rem;
  border-radius: 999px; font-size: .84rem; cursor: pointer;
  background: var(--ef-secondary, #FFF0EE); border: 1px solid var(--ef-tint-strong, #EFC9BE); color: var(--ef-text, #4a3b35); }
.ef-gr__chip-x { font-size: .7rem; color: var(--ef-text-muted, #8a7a73); }
.ef-gr__chip:hover .ef-gr__chip-x { color: var(--ef-wrong-text, #b91c1c); }

/* the word chips */
.ef-gr__words { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .4rem; margin: 0 0 1rem;
  /* A few hundred words otherwise bury the options and the preview under a
     page of scrolling — the list scrolls in place instead. */
  max-height: max(18rem, 46vh); overflow-y: auto; padding: 2px; }
.ef-gr__word { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: .1rem;
  padding: .5rem .7rem; border-radius: 11px; cursor: pointer; text-align: left;
  background: var(--ef-bg-soft, #FFFBF9); border: 1px solid var(--ef-border-light, #F0E4E0); color: var(--ef-text, #4a3b35); }
.ef-gr__word.is-on { background: var(--ef-secondary, #FFF0EE); border-color: var(--ef-tint-strong, #EFC9BE); }
.ef-gr__word-w { font-weight: 600; }
.ef-gr__word-meta { font-size: .72rem; color: var(--ef-text-muted, #8a7a73); }
.ef-gr__word-au { position: absolute; top: .35rem; right: .45rem; font-size: .75rem; }

/* "my own list" */
.ef-gr__mine { text-align: center; margin: 0 0 .8rem; }
.ef-gr__mine-ta { width: 100%; max-width: 520px; font: inherit; font-size: .92rem; padding: .6rem .8rem; border-radius: 12px;
  border: 1.5px solid var(--ef-border, #E5D4CE); background: var(--surface, #fff); color: var(--ink, #4a3b35); resize: vertical; }
.ef-gr__mine-ta:focus { outline: none; border-color: var(--ef-primary, #733428); }
.ef-gr__mine .ef-gr__mini { margin-top: .5rem; }

/* options */
.ef-gr__opts { display: flex; flex-direction: column; gap: .5rem; align-items: center; margin: 0 0 .5rem; }
.ef-gr__optrow { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; justify-content: center; }
.ef-gr__optlabel { font-size: .82rem; color: var(--ef-text-muted, #8a7a73); margin-right: .2rem; }

/* The clue each word actually gets — the puzzle itself, not a setting for it.
   Two columns where there's room: 24 words in one column is a lot of scrolling
   between the list and the preview underneath. */
.ef-gr__perword { margin: .2rem 0 .4rem; }
/* NOT scrollable, and not ellipsised. This list is the puzzle, so anything it
   hides is something Aurélie ships without having read: a capped height put 6
   of 18 rows behind an inner scrollbar that is easy to miss entirely, and a
   fixed-width word column squeezed the definition down to ~90px of "atmosphère
   générale d'un…". Both now grow instead. */
.ef-gr__pw-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: .1rem .9rem; padding: 2px; }
.ef-gr__pw { display: flex; align-items: center; flex-wrap: wrap; gap: .2rem .45rem; padding: .3rem .1rem;
  border-bottom: 1px solid var(--ef-border-light, #F0E4E0); }
.ef-gr__pw-w { flex: 0 1 auto; max-width: 11rem; font-weight: 600; font-size: .88rem; color: var(--ef-text, #4a3b35);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ef-gr__pw-btns { flex: 0 0 auto; display: inline-flex; gap: .15rem; }
/* Picked, but not in this crossword — still editable, because a reroll or a
   larger count brings it straight back. */
.ef-gr__pw.is-out { opacity: .42; }
/* flex-basis under the row width, so a long clue drops to its own line rather
   than shrinking the word or the buttons out of reach. */
.ef-gr__pw-txt { flex: 1 1 9rem; min-width: 0; font-size: .78rem; line-height: 1.35;
  color: var(--ef-text-muted, #8a7a73); }
.ef-gr__pw-none { flex: 1 1 9rem; font-size: .78rem; color: var(--ef-wrong-text, #b91c1c); }

.ef-gr__pw-b { position: relative; width: 1.9rem; height: 1.7rem; padding: 0; font-size: .8rem; line-height: 1;
  cursor: pointer; border-radius: 7px; border: 1px solid var(--ef-border-light, #F0E4E0);
  background: var(--ef-surface, #fff); }
/* The icons are emoji, so "selected" can't be carried by text colour — the
   filled background does it, and a ring keeps it visible in dark mode. */
.ef-gr__pw-b.is-on { background: var(--ef-primary, #733428); border-color: var(--ef-primary, #733428);
  box-shadow: 0 0 0 2px var(--ef-tint, #F6DED7); }
.ef-gr__pw-b:disabled { opacity: .25; cursor: default; }
.ef-gr__pw-b--dice { margin-left: .3rem; opacity: .6; }
.ef-gr__pw-b--dice:hover { opacity: 1; }

/* Hover tooltip straight off the title text — instant, unlike the native one,
   which arrives after a second and never on touch. */
.ef-gr__pw-b[title]:hover::after {
  content: attr(title); position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%);
  z-index: 6; width: max-content; max-width: 12rem; padding: .3rem .5rem; border-radius: 7px;
  font-size: .74rem; font-weight: 500; line-height: 1.3; text-align: center; pointer-events: none;
  background: var(--ef-primary-dark, #4a2119); color: #fff; box-shadow: 0 3px 12px rgba(0,0,0,.2);
}
.ef-gr__pw-b:disabled:hover::after { display: none; }

.ef-gr__pw-legend { display: flex; flex-wrap: wrap; justify-content: center; align-items: center;
  gap: .2rem .9rem; margin: 0 0 .5rem; font-size: .76rem; color: var(--ef-text-muted, #8a7a73); }
.ef-gr__pw-legend-h { font-weight: 600; }
.ef-gr__pw-legend-i { display: inline-flex; align-items: center; gap: .25rem; }
.ef-gr__pw-legend-ico { font-size: .95rem; }

.ef-gr__preview { display: flex; justify-content: center; }
.ef-gr__actions { display: flex; justify-content: center; margin: 1rem 0 .4rem; }
.ef-gr__primary { min-width: 170px; background: var(--ef-primary, #733428); color: #fff; border: none; border-radius: 11px;
  padding: 12px 22px; font-size: 15px; font-weight: 600; cursor: pointer; }
.ef-gr__primary:hover { opacity: .93; }
.ef-gr__primary:disabled { opacity: .5; cursor: default; }
.ef-gr__ghost { background: transparent; color: var(--ef-primary, #733428); border: 1.5px solid var(--ef-border-light, #F0E4E0);
  border-radius: 11px; padding: 10px 18px; font-weight: 600; cursor: pointer; }
.ef-gr__footer { display: flex; gap: .5rem; justify-content: center; margin: 1.4rem 0 0; }

.ef-gr__status { text-align: center; font-weight: 600; color: var(--ef-text, #4a3b35); min-height: 1.4em; margin: 0 0 .7rem; }
.ef-gr__status.is-done { color: var(--ef-correct-text, #15803d); }

/* ---- the boards ---------------------------------------------------------
   One square grid driven by --n (the number of columns). The cell size comes
   from a min() so a 15-wide grid shrinks to fit a phone instead of forcing the
   page sideways — that's the whole reason this isn't a fixed px size.

   The third term of the min() is the one that keeps a puzzle on one screen:
   the board is --n wide by --nh tall, so capping its HEIGHT at --board-h means
   capping its width at --board-h * n / nh. Without it a 15×13 crossword is
   taller than the viewport and the player scrolls between the grid and the
   clues, which is the one thing a crossword must not make you do. */
.ef-gr { --board-h: 68vh; }
/* minmax(0, …) rather than plain 1fr: a track is minmax(auto, 1fr) by default,
   so the squares refuse to shrink below their own letter and a wide board
   pushes the page sideways on a phone instead of getting smaller. */
.ef-gr__board { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr));
  gap: 2px; margin: 0 auto 1rem;
  /* max() floors the height cap: somewhere that resolves vh to 0 (an iframe
     with no layout height, and this is not hypothetical) would otherwise
     collapse the board to nothing. */
  width: min(100%, calc(var(--n) * 2.4rem), max(15rem, calc(var(--board-h) * var(--n) / var(--nh, var(--n)))));
  touch-action: none; -webkit-user-select: none; user-select: none; }
/* line-height:1 so the letter's line box can't set a floor the square has to
   clear — with the default the rows stayed at the text height while the
   columns shrank to fit, and the cells came out visibly taller than wide. */
.ef-gr__cell { aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
  font-family: var(--ef-mono, ui-monospace, Menlo, monospace); font-weight: 600;
  font-size: clamp(.6rem, 2.4vw, 1rem); line-height: 1; border-radius: 4px;
  background: var(--ef-bg-soft, #FFFBF9); border: 1px solid var(--ef-border-light, #F0E4E0); color: var(--ef-text, #4a3b35); }
.ef-gr__cell.is-sel { background: var(--ef-tint, #F6DED7); border-color: var(--ef-primary, #733428); }
.ef-gr__cell.is-found { background: var(--ef-correct-bg, #dcfce7); border-color: var(--ef-correct-border, #16a34a); color: var(--ef-correct-text, #15803d); }

/* mots mêlés: the list of what's still hidden */
.ef-gr__list { margin: 0 0 1rem; }
.ef-gr__list-h { font-family: var(--ef-serif, Georgia, serif); font-size: 1rem; color: var(--ef-primary-dark, #4a2119); text-align: center; margin: 0 0 .5rem; }
.ef-gr__listitem { display: inline-flex; align-items: center; gap: .35rem; margin: .2rem; padding: .3rem .7rem;
  border-radius: 999px; font-size: .88rem; background: var(--ef-bg-soft, #FFFBF9); border: 1px solid var(--ef-border-light, #F0E4E0); }
.ef-gr__listitem.is-found { opacity: .55; border-color: var(--ef-correct-border, #16a34a); }
/* Only the word is struck through once found — a line through the definition
   makes the whole item look cancelled rather than solved. */
.ef-gr__listitem.is-found .ef-gr__listword { text-decoration: line-through; }
.ef-gr__list { text-align: center; }

/* The word itself, until it's found: one blank per letter. Drawn as underlines
   rather than written as "_ _ _ _" so the count can't be miscounted and a
   screen reader gets the number from the aria-label instead of six underscores.
   On the two easiest settings one of the blanks carries its real letter. */
.ef-gr__mask { display: inline-flex; gap: .18rem; align-items: flex-end; }
.ef-gr__mask-l { display: inline-flex; align-items: flex-end; justify-content: center;
  width: .62em; height: 1.05em; border-bottom: 2px solid var(--ef-tint-strong, #EFC9BE);
  font-family: var(--ef-mono, ui-monospace, Menlo, monospace); font-weight: 700; line-height: 1; }
.ef-gr__mask-l.is-shown { color: var(--ef-primary, #733428); border-bottom-color: var(--ef-primary, #733428); }

/* A translation is not French, so it doesn't get to look like the rest of the
   clue text — CJK especially reads as body copy at the same weight. */
.ef-gr__clue-tr { font-style: italic; color: var(--ef-primary-dark, #4a2119); }

/* ---- board beside its clues --------------------------------------------
   One column on a phone, two from 1000px up, where the width exists to put
   the clues (or the word list) next to the grid instead of below it. The
   right-hand column scrolls on its own so the page itself doesn't. */
.ef-gr__split { display: grid; gap: 1rem; align-items: start; }
/* A grid item defaults to min-width:auto, so it refuses to shrink below its
   content and pushes the page sideways instead — a 20-wide board came out
   385px inside a 340px track on a phone. The board's own `min(100%, …)` can
   only do its job once the track is allowed to cap it. */
.ef-gr__split > * { min-width: 0; }
@media (min-width: 1000px) {
  /* The theme centres its content in a ~680px column, so "max-width: 1240px"
     alone buys nothing — the extra width has to be taken back from the page.
     margin-left:50% + translateX(-50%) re-centres on the viewport instead of
     on the container, and 100vw minus a margin leaves room for a scrollbar. */
  .ef-gr--play { width: min(1240px, calc(100vw - 3rem)); max-width: none; margin-left: 50%; transform: translateX(-50%); }
  .ef-gr--play .ef-gr__split { grid-template-columns: minmax(0, 1fr) minmax(280px, 360px); gap: 1.6rem; }
  .ef-gr--play .ef-gr__split > .ef-gr__clues,
  .ef-gr--play .ef-gr__split > .ef-gr__list { max-height: calc(var(--board-h) + 3rem); overflow-y: auto; margin: 0; }
  .ef-gr--play .ef-gr__clues { grid-template-columns: 1fr; gap: .8rem; }
  .ef-gr--play .ef-gr__list { text-align: left; }
}

/* mots croisés */
.ef-gr__board--cw { gap: 1px; }
.ef-gr__boardwrap { position: relative; }
/* the whole entry being typed, so it is obvious which word the keys go into */
.ef-gr__cell--cw.is-active { background: var(--ef-secondary, #FFF0EE); }
.ef-gr__cell--cw.is-active .ef-gr__in { background: transparent; }
.ef-gr__cell--cw.is-active .ef-gr__in:focus { background: var(--ef-tint, #F6DED7); }

/* the clue of the entry being typed, always on screen */
.ef-gr__cur { display: block; text-align: center; min-height: 1.5em; margin: 0 0 .5rem;
  font-size: .92rem; line-height: 1.4; color: var(--ef-primary-dark, #4a2119); }

/* hover tooltip: what the word under the pointer means */
.ef-gr__tip { position: absolute; z-index: 5; transform: translate(-50%, calc(-100% - 6px));
  max-width: min(24rem, 80vw); width: max-content; padding: .35rem .6rem; border-radius: 8px; pointer-events: none;
  font-size: .8rem; line-height: 1.35; text-align: left;
  background: var(--ef-primary-dark, #4a2119); color: #fff; box-shadow: 0 4px 14px rgba(0,0,0,.18); }
.ef-gr__tip.is-below { transform: translate(-50%, 6px); }
.ef-gr__cell--cw { position: relative; padding: 0; background: var(--surface, #fff); }
.ef-gr__cell--cw.is-block { background: transparent; border-color: transparent; }
.ef-gr__num { position: absolute; top: 1px; left: 2px; font-size: .5rem; line-height: 1; color: var(--ef-text-muted, #8a7a73); }
.ef-gr__in { width: 100%; height: 100%; border: none; background: transparent; text-align: center; padding: 0;
  font: inherit; font-size: clamp(.6rem, 2.4vw, 1rem); font-weight: 600; text-transform: uppercase;
  color: var(--ink, #4a3b35); border-radius: 4px; }
.ef-gr__in:focus { outline: none; background: var(--ef-tint, #F6DED7); }
.ef-gr__in.is-wrong { background: var(--ef-wrong-bg, #fee2e2); color: var(--ef-wrong-text, #b91c1c); }
.ef-gr__in.is-given { color: var(--ef-correct-text, #15803d); }

.ef-gr__clues { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem 1.4rem; margin: 0 0 1rem; }
.ef-gr__clue { display: flex; align-items: baseline; gap: .4rem; padding: .3rem .4rem; border-radius: 8px;
  font-size: .88rem; cursor: pointer; line-height: 1.45; }
.ef-gr__clue:hover { background: var(--ef-bg-soft, #FFFBF9); }
.ef-gr__clue.is-current { background: var(--ef-secondary, #FFF0EE); box-shadow: inset 3px 0 0 var(--ef-primary, #733428); }
.ef-gr__clue-n { font-weight: 700; color: var(--ef-primary, #733428); flex: none; }
.ef-gr__clue-len { color: var(--ef-text-muted, #8a7a73); flex: none; }
.ef-gr__clue-audio { display: inline-flex; align-items: center; }
.ef-gr__bar { display: flex; gap: .5rem; justify-content: center; flex-wrap: wrap; }

/* ---- the sequence games: Pendu, Anagrammes, Trouve l'accent -------------
   One word at a time out of the list. They share everything except the middle
   — see renderSequence() — so they share their styling too. */
.ef-gr__seq { max-width: 46rem; margin: 0 auto; }
.ef-gr__seq-bar { height: 5px; border-radius: 999px; overflow: hidden; margin: 0 0 .9rem;
  background: var(--ef-border-light, #F0E4E0); }
.ef-gr__seq-fill { display: block; height: 100%; width: 0; border-radius: 999px;
  background: var(--ef-primary, #733428); transition: width .25s ease; }
@media (prefers-reduced-motion: reduce) { .ef-gr__seq-fill { transition: none; } }
.ef-gr__seq-stage { display: flex; flex-direction: column; align-items: center; gap: .9rem; }
.ef-gr__seq-clue { font-size: 1.02rem; line-height: 1.5; text-align: center; max-width: 40ch;
  color: var(--ef-text, #4a3b35); min-height: 1.5em; }
.ef-gr__seq-foot { display: flex; justify-content: center; margin: 1.1rem 0 0; }
/* The word as it is really written — with its article and its accents, which
   is the part the grid form can never teach. */
.ef-gr__seq-answer { font-family: var(--ef-serif, Georgia, serif); font-size: 1.25rem;
  color: var(--ef-wrong-text, #b91c1c); margin: .2rem 0 0; }
.ef-gr__seq-answer.is-ok { color: var(--ef-correct-text, #15803d); }

/* the answer strip */
.ef-gr__slots { display: flex; flex-wrap: wrap; gap: .3rem; justify-content: center; }
.ef-gr__slot { width: 2.1rem; height: 2.5rem; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 7px; font-family: var(--ef-mono, ui-monospace, Menlo, monospace); font-weight: 700;
  font-size: 1.1rem; line-height: 1; background: var(--ef-bg-soft, #FFFBF9);
  border: 1px solid var(--ef-border-light, #F0E4E0); border-bottom-width: 2px;
  color: var(--ef-text, #4a3b35); }
.ef-gr__slot.is-shown { border-bottom-color: var(--ef-primary, #733428); }
.ef-gr__slot.is-given { color: var(--ef-wrong-text, #b91c1c); }
.ef-gr__slot.is-ok { background: var(--ef-correct-bg, #dcfce7); border-color: var(--ef-correct-border, #16a34a); color: var(--ef-correct-text, #15803d); }
.ef-gr__slot.is-bad { background: var(--ef-wrong-bg, #fee2e2); border-color: var(--ef-wrong-text, #b91c1c); color: var(--ef-wrong-text, #b91c1c); }
/* Trouve l'accent: only the vowels are clickable, and they have to look it. */
.ef-gr__slots--word .ef-gr__slot.is-pick { cursor: pointer; border-style: dashed; }
.ef-gr__slots--word .ef-gr__slot.is-fixed { opacity: .6; }
.ef-gr__slot.is-active { background: var(--ef-secondary, #FFF0EE); border-color: var(--ef-primary, #733428); border-style: solid; }

/* Anagrammes: the letters still to place */
.ef-gr__tray { display: flex; flex-wrap: wrap; gap: .3rem; justify-content: center; }
.ef-gr__tile { width: 2.1rem; height: 2.5rem; cursor: pointer; border-radius: 7px;
  font-family: var(--ef-mono, ui-monospace, Menlo, monospace); font-weight: 700; font-size: 1.1rem;
  border: 1px solid var(--ef-tint-strong, #EFC9BE); background: var(--ef-secondary, #FFF0EE);
  color: var(--ef-primary-dark, #4a2119); }
.ef-gr__tile:hover:not(:disabled) { background: var(--ef-tint, #F6DED7); }
.ef-gr__tile:disabled { opacity: .22; cursor: default; }

/* Trouve l'accent: the accents on offer for the selected letter */
.ef-gr__accents { display: flex; flex-wrap: wrap; gap: .3rem; justify-content: center; min-height: 2.5rem; }
.ef-gr__accent { min-width: 2.4rem; height: 2.4rem; cursor: pointer; border-radius: 8px;
  font-family: var(--ef-serif, Georgia, serif); font-size: 1.15rem;
  border: 1px solid var(--ef-border, #E5D4CE); background: var(--ef-surface, #fff); color: var(--ef-text, #4a3b35); }
.ef-gr__accent:hover { background: var(--ef-secondary, #FFF0EE); }
.ef-gr__accent.is-on { background: var(--ef-primary, #733428); border-color: var(--ef-primary, #733428); color: #fff; }

/* Le Pendu: what is left, and what has been spent */
.ef-gr__pendu-info { display: flex; gap: 1rem; align-items: center; justify-content: center; flex-wrap: wrap; }
.ef-gr__lives { font-family: var(--ef-mono, ui-monospace, Menlo, monospace); font-size: 1rem;
  letter-spacing: .1em; color: var(--ef-primary, #733428); }
.ef-gr__pendu-miss { font-family: var(--ef-mono, ui-monospace, Menlo, monospace); font-size: .9rem;
  letter-spacing: .12em; color: var(--ef-wrong-text, #b91c1c); text-decoration: line-through; }

/* Motus */
.ef-gr__motusboard { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 4px;
  margin: 0 auto 1rem; width: min(100%, calc(var(--n) * 3rem)); }
.ef-gr__mcell { aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
  font-family: var(--ef-mono, ui-monospace, Menlo, monospace); font-weight: 700;
  font-size: clamp(.8rem, 3.4vw, 1.3rem); border-radius: 6px;
  background: var(--ef-bg-soft, #FFFBF9); border: 1.5px solid var(--ef-border-light, #F0E4E0); color: var(--ef-text, #4a3b35); }
/* Wordle colours, not the French Motus ones: green reads as "right" to
   everyone, and red on a correct letter reads as a mistake — which is exactly
   the confusion this replaced. Green = right place, yellow = wrong place. */
.ef-gr__mcell.is-exact { background: var(--ef-correct-border, #16a34a); border-color: var(--ef-correct-border, #16a34a); color: #fff; }
.ef-gr__mcell.is-there { background: #e0a500; border-color: #e0a500; color: #fff; }
.ef-gr__mcell.is-absent { background: var(--ef-border-light, #F0E4E0); border-color: var(--ef-border, #E5D4CE); color: var(--ef-text-muted, #8a7a73); }
.ef-gr__mcell.is-typed { border-color: var(--ef-tint-strong, #EFC9BE); }

.ef-gr__kb { display: flex; flex-direction: column; gap: .3rem; align-items: center; margin: 0 0 .6rem; }
.ef-gr__kbrow { display: flex; gap: .25rem; justify-content: center; flex-wrap: nowrap; }
.ef-gr__key { min-width: 1.9rem; padding: .55rem .2rem; border-radius: 6px; cursor: pointer;
  font-size: .85rem; font-weight: 600; flex: 1 1 auto; max-width: 2.6rem;
  border: 1px solid var(--ef-border-light, #F0E4E0); background: var(--ef-surface, #fff); color: var(--ef-text, #4a3b35); }
.ef-gr__key--wide { max-width: 3.4rem; min-width: 2.6rem; }
.ef-gr__key.is-exact { background: var(--ef-correct-border, #16a34a); border-color: var(--ef-correct-border, #16a34a); color: #fff; }
.ef-gr__key.is-there { background: #e0a500; border-color: #e0a500; color: #fff; }
.ef-gr__key.is-absent { background: var(--ef-border-light, #F0E4E0); color: var(--ef-text-muted, #8a7a73); }

/* The share row is the shared one — .ef-share, in ef-url-state.css. */

/* Le ou La ? — the noun, then the choice. Deliberately large: this is a
   reflex drill, and a reflex is built at a glance, not by reading. */
.ef-gr__genre-word { font-family: var(--ef-serif, Georgia, serif); font-size: clamp(1.6rem, 6vw, 2.4rem);
  color: var(--ef-primary-dark, #4a2119); text-align: center; margin: .4rem 0 .2rem; }
.ef-gr__genre-row { display: flex; gap: .6rem; justify-content: center; }
.ef-gr__genre-btn { min-width: 6.5rem; padding: .8rem 1.4rem; cursor: pointer; border-radius: 12px;
  font-family: var(--ef-mono, ui-monospace, Menlo, monospace); font-size: 1.15rem; font-weight: 700;
  letter-spacing: .06em; border: 1.5px solid var(--ef-border, #E5D4CE);
  background: var(--ef-surface, #fff); color: var(--ef-primary, #733428); }
.ef-gr__genre-btn:hover:not(:disabled) { background: var(--ef-secondary, #FFF0EE); }
.ef-gr__genre-btn.is-ok { background: var(--ef-correct-bg, #dcfce7); border-color: var(--ef-correct-border, #16a34a); color: var(--ef-correct-text, #15803d); }
.ef-gr__genre-btn.is-bad { background: var(--ef-wrong-bg, #fee2e2); border-color: var(--ef-wrong-text, #b91c1c); color: var(--ef-wrong-text, #b91c1c); }
.ef-gr__genre-btn:disabled { cursor: default; }

/* Word order — the sentence being rebuilt, and the words still to place. */
.ef-gr__sentence { display: flex; flex-wrap: wrap; gap: .3rem; justify-content: center; align-items: center;
  min-height: 3rem; width: 100%; padding: .5rem .6rem; border-radius: 11px;
  background: var(--ef-bg-soft, #FFFBF9); border: 1px dashed var(--ef-border, #E5D4CE); }
.ef-gr__sentence-ph { font-size: .86rem; color: var(--ef-text-muted, #8a7a73); }
.ef-gr__chipw { padding: .32rem .6rem; border-radius: 8px; font-size: .95rem; cursor: pointer;
  border: 1px solid var(--ef-tint-strong, #EFC9BE); background: var(--ef-secondary, #FFF0EE);
  color: var(--ef-text, #4a3b35); }
.ef-gr__chipw.is-ok { background: var(--ef-correct-bg, #dcfce7); border-color: var(--ef-correct-border, #16a34a); color: var(--ef-correct-text, #15803d); cursor: default; }
.ef-gr__chipw.is-bad { background: var(--ef-wrong-bg, #fee2e2); border-color: var(--ef-wrong-text, #b91c1c); color: var(--ef-wrong-text, #b91c1c); cursor: default; }
.ef-gr__tray--words { gap: .35rem; }
/* A word tile is as wide as its word, unlike a letter tile. */
.ef-gr__tile--word { width: auto; height: auto; padding: .32rem .6rem; font-family: inherit;
  font-size: .95rem; font-weight: 500; }

/* A space or a hyphen inside an accent puzzle — a separator, not a letter to
   be filled in. 39 of the accented words in the bank are phrases. */
.ef-gr__gap { display: inline-flex; align-items: flex-end; justify-content: center;
  min-width: .7rem; height: 2.5rem; font-family: var(--ef-mono, ui-monospace, Menlo, monospace);
  font-weight: 700; font-size: 1.1rem; color: var(--ef-text-muted, #8a7a73); }
