/* Quiz Choufli Hal. S'appuie sur les boutons et la table de chkobba.css (même tapis vert).
   Compatibilité : pas de flex gap, pas d'aspect-ratio (vieux Safari / Android). */

.qz-racine .ck-cadre {
  max-width: 560px;
}

.qz-centre {
  max-width: 420px;
  margin: 0 auto;
  padding: 40px 0;
  text-align: center;
}

.qz-attente {
  opacity: 0.85;
}

/* ---------- thèmes ---------- */

.qz-titre {
  margin: 8px 0 14px;
  font-family: var(--display);
  font-size: 22px;
  font-weight: 800;
  color: var(--jasmin);
}

[lang^='ar'] .qz-titre {
  font-family: var(--arabe);
  font-weight: 700;
}

.qz-fil {
  display: flex;
  align-items: center;
  margin: 6px 0 12px;
}

.qz-fil .ck-quitter {
  margin-inline-start: 0;
  margin-inline-end: 12px;
  flex: 0 0 auto;
}

.qz-chemin {
  font-family: var(--arabe);
  font-size: 15px;
  opacity: 0.85;
  min-width: 0;
}

.qz-liste {
  list-style: none;
  margin: 0;
  padding: 0;
}

.qz-liste li + li {
  margin-top: 8px;
}

.qz-theme {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 60px;
  padding: 8px 14px 8px 8px;
  font: inherit;
  color: var(--papier);
  text-align: start;
  background: var(--tapis-2);
  border: 1.5px solid rgba(245, 239, 227, 0.35);
  border-radius: 14px;
  cursor: pointer;
}

[dir='rtl'] .qz-theme {
  padding: 8px 8px 8px 14px;
}

.qz-theme:hover {
  border-color: var(--papier);
}

.qz-theme:focus-visible {
  outline: 3px solid var(--jasmin);
  outline-offset: 2px;
}

.qz-theme img,
.qz-pastille {
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  margin-inline-end: 12px;
  border-radius: 10px;
  object-fit: cover;
  background: var(--papier-2);
}

.qz-grandes .qz-theme {
  min-height: 80px;
}

.qz-grandes .qz-theme img,
.qz-grandes .qz-pastille {
  width: 62px;
  height: 62px;
}

.qz-pastille {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--display);
  font-weight: 800;
  font-size: 22px;
  color: var(--encre);
  background: var(--jasmin);
}

.qz-nom {
  flex: 1 1 auto;
  min-width: 0;
  font-family: var(--arabe);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.5;
}

.qz-grandes .qz-nom {
  font-size: 20px;
}

.qz-nom small {
  display: block;
  font-family: var(--corps);
  font-size: 13px;
  font-weight: 400;
  opacity: 0.8;
}

/* Chevron qui pointe vers la fin de ligne, retourné en arabe. */
.qz-fleche {
  flex: 0 0 auto;
  width: 10px;
  height: 10px;
  margin-inline-start: 10px;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
  transform: rotate(45deg);
  opacity: 0.7;
}

[dir='rtl'] .qz-fleche {
  transform: rotate(-135deg);
}

.qz-message {
  margin: 10px 0;
  padding: 10px 14px;
  font-size: 15px;
  color: var(--encre);
  background: var(--jasmin);
  border-radius: 10px;
}

/* ---------- partie ---------- */

.qz-barre .ck-manche {
  line-height: 1.5;
}

.qz-progres {
  height: 4px;
  margin: 0 0 14px;
  background: rgba(245, 239, 227, 0.15);
  border-radius: 2px;
  overflow: hidden;
}

.qz-progres span {
  display: block;
  height: 100%;
  background: var(--jasmin);
  transition: width 0.3s ease-out;
}

[dir='rtl'] .qz-progres span {
  margin-inline-start: 0;
}

.qz-carte {
  padding: 14px;
  color: var(--encre);
  background: #fffdf8;
  border: 1.5px solid var(--encre);
  border-radius: 16px;
}

.qz-image {
  margin: -4px -4px 12px;
  text-align: center;
  background: var(--papier-2);
  border-radius: 10px;
  overflow: hidden;
}

.qz-image img {
  display: block;
  max-width: 100%;
  max-height: 38vh;
  max-height: 38svh;
  margin: 0 auto;
}

.qz-question {
  font-family: var(--arabe);
  font-size: 21px;
  font-weight: 700;
  line-height: 1.7;
  text-align: center;
}

.qz-question:focus {
  outline: none;
}

.qz-choix {
  margin-top: 12px;
}

.qz-reponse {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 12px 14px;
  font-family: var(--arabe);
  font-size: 18px;
  font-weight: 600;
  color: var(--encre);
  background: var(--papier);
  border: 1.5px solid var(--encre);
  border-radius: 12px;
  cursor: pointer;
}

.qz-oui-non {
  display: flex;
  margin-inline-start: -4px;
  margin-inline-end: -4px;
}

.qz-oui-non .qz-reponse {
  flex: 1 1 0;
  margin-inline-start: 4px;
  margin-inline-end: 4px;
}

.qz-reponse:hover:not([disabled]) {
  background: var(--papier-2);
}

.qz-reponse:focus-visible,
.qz-lettre:focus-visible,
.qz-case:focus-visible {
  outline: 3px solid var(--jasmin);
  outline-offset: 2px;
}

.qz-reponse[disabled] {
  cursor: default;
  opacity: 0.55;
}

/* Bonne réponse en vert, mauvaise en brique : couleurs ET bordure épaisse (pas seulement la couleur). */
.qz-reponse.qz-bon,
.qz-case.qz-bon {
  opacity: 1;
  color: #fff;
  background: #2f7d4f;
  border: 3px solid var(--encre);
}

.qz-reponse.qz-mauvais,
.qz-case.qz-mauvais {
  opacity: 1;
  color: #fff;
  background: var(--brique);
  border: 3px dashed var(--encre);
}

/* ---------- grille de lettres ---------- */

.qz-consigne {
  margin-top: 12px;
  font-size: 14px;
  text-align: center;
  color: var(--encre-2);
}

.qz-cases,
.qz-lettres {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
}

.qz-cases {
  margin: 8px 0 12px;
}

.qz-case,
.qz-lettre {
  width: 44px;
  height: 48px;
  margin: 3px;
  padding: 0;
  font-family: var(--arabe);
  font-size: 22px;
  font-weight: 700;
  color: var(--encre);
  border-radius: 9px;
  cursor: pointer;
}

.qz-case {
  width: 38px;
  background: var(--papier);
  border: 1.5px dashed var(--encre-2);
}

.qz-case:not([disabled]) {
  border-style: solid;
  border-color: var(--encre);
}

.qz-lettre {
  background: var(--jasmin);
  border: 1.5px solid var(--encre);
}

.qz-lettre[disabled] {
  background: var(--papier-2);
  border-style: dashed;
  border-color: var(--encre-2);
  cursor: default;
}

.qz-case[disabled] {
  cursor: default;
}

.qz-effacer {
  display: block;
  margin: 10px auto 0;
  color: var(--encre);
  border-color: var(--encre);
}

.qz-effacer[disabled] {
  opacity: 0.4;
}

@media (max-width: 360px) {
  .qz-lettre {
    width: 40px;
    height: 44px;
  }

  .qz-case {
    width: 34px;
  }
}

/* ---------- après la réponse ---------- */

.qz-retour {
  margin-top: 12px;
  padding: 12px 14px;
  font-size: 16px;
  text-align: center;
  border-radius: 12px;
}

.qz-juste {
  color: var(--encre);
  background: var(--jasmin);
}

.qz-faux {
  color: var(--papier);
  background: rgba(0, 0, 0, 0.25);
  border: 1.5px solid rgba(245, 239, 227, 0.4);
}

.qz-attendu {
  font-family: var(--arabe);
  font-weight: 700;
  font-size: 18px;
}

/* ---------- fin ---------- */

.qz-fin {
  text-align: center;
}

.qz-verdict {
  margin-top: 14px;
  font-family: var(--display);
  font-size: 26px;
  font-weight: 800;
  color: var(--jasmin);
}

[lang^='ar'] .qz-verdict {
  font-family: var(--arabe);
  font-weight: 700;
}

.qz-verdict:focus {
  outline: none;
}

.qz-gros {
  margin: 6px 0 0;
  font-family: var(--display);
  font-size: 26px;
  direction: ltr;
}

.qz-gros b {
  font-size: 64px;
  font-weight: 800;
  line-height: 1;
}

.qz-theme-fin {
  margin-top: 6px;
  font-family: var(--arabe);
  opacity: 0.85;
}

.qz-record {
  display: inline-block;
  margin-top: 12px;
  padding: 6px 14px;
  font-weight: 700;
  color: var(--encre);
  background: var(--jasmin);
  border-radius: 999px;
}

.qz-ancien {
  margin-top: 10px;
  font-size: 14px;
  opacity: 0.8;
}

.qz-credits a {
  font-weight: 600;
}
