/* =========================================================
   CALENDRIER MUSICAL DE L'AVENT MUSICLIC
   CSS général du framework
   ========================================================= */

/* Image page principale */
/* Illustration sous le calendrier */
.ml-avent-illustration {
  max-width: 980px;
  margin: 28px auto 34px auto;
  padding: 10px;

  border: 1px solid rgba(122, 69, 31, 0.22);
  border-radius: 22px;

  background: rgba(255, 248, 230, 0.78);
  box-shadow: 0 12px 30px rgba(60, 36, 12, 0.12);

  text-align: center;
}

.ml-avent-illustration img {
  display: block;
  width: 100%;
  height: auto;

  border-radius: 16px;
}

.ml-avent-illustration figcaption {
  margin-top: 8px;

  color: #7b5a24;

  font-size: 0.9rem;
  font-style: italic;
}
.ml-avent-illustration-article {
  margin-top: 30px;
  margin-bottom: 34px;
}
/* =========================================================
   1. RESET LOCAL
   ---------------------------------------------------------
   On limite le reset au calendrier pour éviter d'impacter
   le reste du site Musiclic.
   ========================================================= */

.ml-avent-stage,
.ml-avent-stage * {
  box-sizing: border-box;
}


/* =========================================================
   2. VARIABLES GRAPHIQUES
   ---------------------------------------------------------
   Couleurs principales du calendrier.
   Elles permettent de garder une cohérence dans tous les
   composants du jeu.
   ========================================================= */

.ml-avent-stage {
  --avent-cream: #fff4dd;
  --avent-cream-light: #fff9ed;
  --avent-gold: #c98a2c;
  --avent-gold-dark: #8c5a16;
  --avent-red: #7a2418;
  --avent-green: #2f6b38;
  --avent-blue: #17324d;
  --avent-text: #2c1a0f;
  --avent-soft-shadow: 0 10px 25px rgba(62, 35, 12, 0.18);
}


/* =========================================================
   3. CADRE PRINCIPAL DU CALENDRIER
   ---------------------------------------------------------
   Le décor est une image de fond.
   Le ratio desktop correspond à l'image 1792 x 1024.
   ========================================================= */

.ml-avent-stage {
  position: relative;
  width: 100%;
  max-width: 1600px;
  margin: 32px auto 42px auto;

  aspect-ratio: 1792 / 1024;

  background-image: url("/calendrier-avent/images/avent-bg-desktop.webp");
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;

  overflow: hidden;
  border-radius: 18px;
  box-shadow: 0 18px 45px rgba(40, 22, 8, 0.25);
}

.ml-avent-stage-inner {
  position: absolute;
  inset: 0;
}


/* =========================================================
   4. TITRE INTERNE DU JEU
   ---------------------------------------------------------
   Titre placé en haut de l'image.
   pointer-events:none évite qu'il gêne les clics éventuels.
   ========================================================= */

.ml-avent-game-header {
  position: absolute;
  top: 3.1%;
  left: 50%;
  width: 68%;
  transform: translateX(-50%);

  text-align: center;
  z-index: 3;
  pointer-events: none;
}

.ml-avent-kicker {
  display: inline-block;
  margin-bottom: 0;

  font-size: clamp(0.62rem, 0.75vw, 0.78rem);
  color: #7b5a24;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
}

.ml-avent-game-header h2 {
  margin: 0;

  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.15rem, 1.55vw, 1.75rem);
  line-height: 1.05;

  color: var(--avent-red);
  text-shadow: 0 2px 0 rgba(255, 255, 255, 0.6);
  text-align: center;
}


/* =========================================================
   5. ZONE PRINCIPALE DES PANNEAUX - DESKTOP
   ---------------------------------------------------------
   Les panneaux eux-mêmes sont dessinés dans l'image de fond.
   Ici, on positionne seulement les zones HTML par-dessus.
   ========================================================= */

.ml-avent-board {
  position: absolute;
  top: 18.8%;
  left: 10.2%;
  right: 8.2%;
  bottom: 24.5%;

  display: grid;
  grid-template-columns: minmax(0, 2.35fr) minmax(260px, 1fr);
  gap: 3.5%;

  z-index: 2;
}

.ml-avent-game-panel,
.ml-avent-secret-panel {
  position: relative;
  min-width: 0;
  min-height: 0;
}

.ml-avent-panel-inner {
  height: 100%;
  padding: 1.4% 7% 4.2% 7%;

  overflow-y: auto;
  overflow-x: hidden;
}

.ml-avent-game-container {
  margin-top: 18px;
}


/* =========================================================
   6. TITRES DES PANNEAUX
   ========================================================= */

.ml-avent-panel-title {
  margin: 0 0 8px 0;

  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(0.95rem, 1.18vw, 1.28rem);

  color: var(--avent-blue);
}

.ml-avent-game-container p {
  margin-top: 8px;

  font-size: clamp(1rem, 1.08vw, 1.18rem);
  line-height: 1.55;
  color: var(--avent-text);
}


/* =========================================================
   7. PANNEAU DROIT : JOUR ET MOT SECRET
   ========================================================= */

.ml-avent-secret-panel {
  text-align: center;
}

.ml-avent-secret-inner {
  height: 100%;
  padding: 6% 10% 12% 10%;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
}

.ml-avent-day-block {
  margin-top: 0;
}

.ml-avent-day-label {
  display: block;

  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(0.95rem, 1.25vw, 1.45rem);
  font-weight: 700;

  color: var(--avent-red);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.ml-avent-day-number {
  display: block;
  margin-top: 0;

  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.8rem, 5.1vw, 5.3rem);
  line-height: 0.95;

  color: var(--avent-blue);
  text-shadow: 0 3px 0 rgba(255, 255, 255, 0.55);
}

.ml-avent-secret-separator {
  width: 54%;
  height: 1px;
  margin: 5% auto;

  background: linear-gradient(
    90deg,
    transparent,
    rgba(155, 96, 26, 0.8),
    transparent
  );
}

.ml-avent-secret-title {
  margin: 0 0 10px 0;

  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(0.85rem, 1.05vw, 1.15rem);

  color: var(--avent-gold-dark);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.ml-avent-secret-mask {
  margin: 4px 0 12px 0;

  font-size: clamp(1.25rem, 2vw, 2rem);
  letter-spacing: 0.1em;

  color: #d69a29;
  text-shadow: 0 3px 0 rgba(107, 61, 8, 0.25);
}

.ml-avent-secret-word {
  margin: 6px 0 14px 0;
  padding: 10px 18px;

  border-radius: 14px;
  background: rgba(255, 248, 225, 0.92);
  border: 1px solid rgba(177, 121, 36, 0.45);

  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.35rem, 2.15vw, 2.25rem);
  font-weight: 700;

  color: var(--avent-red);
  letter-spacing: 0.08em;

  box-shadow: var(--avent-soft-shadow);
}

.ml-avent-secret-word.is-confirmed {
  color: var(--avent-green);
  letter-spacing: 0;
  font-size: clamp(1rem, 1.35vw, 1.35rem);
}


/* =========================================================
   8. FENÊTRE DE RÉVÉLATION DU MOT SECRET
   ========================================================= */

.ml-avent-modal[hidden] {
  display: none;
}

.ml-avent-modal {
  position: absolute;
  inset: 0;
  z-index: 20;
}

.ml-avent-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(40, 22, 8, 0.45);
  backdrop-filter: blur(2px);
}

.ml-avent-modal-card {
  position: absolute;
  top: 50%;
  left: 50%;

  width: min(88%, 460px);
  transform: translate(-50%, -50%);

  padding: 28px 30px 26px 30px;

  border-radius: 22px;
  background: linear-gradient(
    180deg,
    rgba(255, 251, 239, 0.98),
    rgba(255, 239, 202, 0.98)
  );

  border: 1px solid rgba(184, 126, 39, 0.5);
  box-shadow:
    0 18px 45px rgba(45, 25, 8, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);

  text-align: center;
  color: var(--avent-text);
}

.ml-avent-modal-close {
  position: absolute;
  top: 10px;
  right: 12px;

  width: 34px;
  height: 34px;

  border: none;
  border-radius: 50%;
  background: rgba(122, 36, 24, 0.1);
  color: var(--avent-red);

  font-size: 1.45rem;
  line-height: 1;
  cursor: pointer;
}

.ml-avent-modal-close:hover {
  background: rgba(122, 36, 24, 0.18);
}

.ml-avent-modal-kicker {
  display: inline-block;
  margin-bottom: 8px;

  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;

  color: var(--avent-gold-dark);
}

.ml-avent-modal-card h3 {
  margin: 0 0 12px 0;

  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.7rem, 3vw, 2.4rem);
  color: var(--avent-red);
}

.ml-avent-modal-card p {
  margin: 10px 0;

  font-size: 1rem;
  line-height: 1.45;
}

.ml-avent-modal-word {
  display: inline-block;
  margin: 10px 0 12px 0;
  padding: 10px 22px;

  border-radius: 16px;
  background: #fff8e6;
  border: 1px solid rgba(184, 126, 39, 0.45);

  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.6rem, 3vw, 2.5rem);
  color: var(--avent-blue);
  letter-spacing: 0.08em;
}

.ml-avent-modal-note {
  font-weight: 700;
  color: #5b3510;
}

.ml-avent-modal-button {
  margin-top: 14px;
  padding: 12px 22px;

  border: none;
  border-radius: 14px;

  background: linear-gradient(#3f8d45, #27642f);
  color: #fff;

  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 14px rgba(40, 85, 40, 0.22);
}

.ml-avent-modal-button:hover {
  filter: brightness(1.05);
}


/* =========================================================
   9. NAVIGATION DES 24 JOURS
   ========================================================= */

.ml-avent-days-nav {
  position: absolute;
  left: calc(6.9% - 3px);
  right: calc(6.9% + 3px);
  bottom: 6.8%;
  height: 9.6%;

  display: grid;
  grid-template-columns: repeat(24, minmax(0, 1fr));
  gap: clamp(3px, 0.38vw, 7px);
  align-items: center;

  z-index: 4;
}

.ml-avent-day-button {
  width: 100%;
  max-width: 38px;
  aspect-ratio: 1 / 1;
  justify-self: center;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 0 3px 0 0;
  text-align: center;

  border: 1px solid rgba(130, 83, 28, 0.45);
  border-radius: 50%;

  background: radial-gradient(
    circle at 35% 25%,
    #fffaf0 0%,
    #f5d99c 45%,
    #c58a32 100%
  );

  color: #4f2d0d;

  font-size: clamp(0.62rem, 0.76vw, 0.82rem);
  font-weight: 700;
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1;

  cursor: pointer;
}

.ml-avent-day-button:hover {
  transform: translateY(-2px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 6px 12px rgba(80, 45, 12, 0.25);
}

/* Jour actuellement affiché */
.ml-avent-day-button.is-current {
  background: radial-gradient(
    circle at 35% 25%,
    #ffd8b2 0%,
    #c92d24 48%,
    #7d1510 100%
  );

  color: #fff8e6;
  border-color: rgba(255, 225, 160, 0.95);
  transform: translateY(-2px) scale(1.08);
}

/* Jour déjà réussi */
.ml-avent-day-button.is-completed {
  background: radial-gradient(
    circle at 35% 25%,
    #d7ffd4 0%,
    #3f8d45 50%,
    #205b27 100%
  );

  color: #fff;
}

/* Jour verrouillé */
.ml-avent-day-button.is-locked {
  opacity: 0.42;
  cursor: not-allowed;
  filter: grayscale(0.45);
}

.ml-avent-day-button.is-locked:hover {
  transform: none;
}

/* Case finale */
.ml-avent-day-button.is-final {
  background: radial-gradient(
    circle at 35% 25%,
    #fff2b5 0%,
    #d6a437 48%,
    #946314 100%
  );

  color: #fff;
  border-color: rgba(255, 232, 155, 0.95);
}

.ml-avent-day-button.is-final.is-current {
  transform: translateY(-2px) scale(1.12);
}


/* =========================================================
   10. STYLES GÉNÉRIQUES DES COMPOSANTS DE JEU
   ========================================================= */

.ml-avent-intro {
  margin: 0 0 14px 0;

  font-size: clamp(0.95rem, 1.05vw, 1.12rem);
  line-height: 1.45;

  color: #6b4318;
  font-style: italic;
}

.ml-avent-question {
  margin: 0 0 16px 0;

  font-size: clamp(1rem, 1.18vw, 1.22rem);
  line-height: 1.42;

  color: var(--avent-text);
  font-weight: 700;
}

.ml-avent-input {
  width: 100%;
  max-width: 420px;
  padding: 13px 16px;

  border: 1px solid rgba(132, 88, 32, 0.35);
  border-radius: 12px;
  background: rgba(255, 252, 241, 0.95);

  font-size: 1rem;
  color: var(--avent-text);
}

.ml-avent-input:focus {
  outline: none;
  border-color: rgba(201, 138, 44, 0.95);
  box-shadow:
    0 0 0 3px rgba(201, 138, 44, 0.18),
    inset 0 1px 2px rgba(70, 42, 12, 0.12);
}

.ml-avent-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  min-height: 44px;
  padding: 11px 20px;

  border: none;
  border-radius: 12px;
  background: linear-gradient(#3f8d45, #27642f);
  color: #fff;

  font-weight: 700;
  cursor: pointer;

  box-shadow: 0 6px 14px rgba(40, 85, 40, 0.22);
}

.ml-avent-action:hover {
  filter: brightness(1.05);
}

.ml-avent-action:disabled {
  opacity: 0.55;
  cursor: default;
  filter: none;
}

.ml-avent-action-secondary {
  background: linear-gradient(#b98234, #8c5a16);
}

.ml-avent-feedback {
  margin-top: 16px;
  padding: 13px 16px;

  border-radius: 14px;
  background: rgba(255, 250, 235, 0.84);
  border: 1px solid rgba(177, 121, 36, 0.3);

  color: var(--avent-text);
  box-shadow: 0 6px 14px rgba(70, 42, 12, 0.1);
}

.ml-avent-feedback strong {
  color: var(--avent-green);
}


/* =========================================================
   11. FORMULAIRE DE RÉPONSE TEXTUELLE
   ---------------------------------------------------------
   Cette classe correspond au formulaire généré par le JS :
   <form class="ml-avent-form-row">
   
   row-gap crée l'espace vertical entre le champ réponse
   et le bouton Valider lorsque le bouton passe à la ligne.
   ========================================================= */

.ml-avent-form-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;

  column-gap: 12px;
  row-gap: 18px;

  margin-top: 18px;
}

.ml-avent-form-row .ml-avent-input {
  flex: 1 1 100%;
}

.ml-avent-form-row .ml-avent-action {
  flex: 0 0 auto;
}

.ml-avent-text-answer .ml-avent-input {
  max-width: 420px;
}

.ml-avent-text-answer .ml-avent-action {
  flex: 0 0 auto;
}


/* =========================================================
   12. RANGÉE DE BOUTONS GÉNÉRIQUE
   ---------------------------------------------------------
   Utilisée notamment par certains composants comme SortOrder.
   ========================================================= */

.ml-avent-answer-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}


/* =========================================================
   13. COMPOSANT : INTRUS
   ========================================================= */

.ml-avent-intruder-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.ml-avent-intruder-card {
  min-height: 58px;
  padding: 14px 16px;

  border: 1px solid rgba(132, 88, 32, 0.3);
  border-radius: 16px;

  background: rgba(255, 250, 235, 0.9);
  color: var(--avent-text);

  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1rem, 1.12vw, 1.22rem);
  font-weight: 700;
  text-align: center;

  cursor: pointer;

  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.85),
    0 5px 12px rgba(70, 42, 12, 0.12);

  transition:
    transform 0.15s ease,
    background 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.ml-avent-intruder-card:hover {
  transform: translateY(-2px);
  border-color: rgba(177, 121, 36, 0.65);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 8px 16px rgba(70, 42, 12, 0.16);
}

.ml-avent-intruder-card.is-selected {
  border-color: rgba(201, 138, 44, 0.85);
}

.ml-avent-intruder-card.is-correct {
  background: rgba(232, 255, 229, 0.95);
  border-color: rgba(47, 107, 56, 0.85);
  color: #24632c;
}

.ml-avent-intruder-card.is-wrong {
  background: rgba(255, 236, 232, 0.95);
  border-color: rgba(168, 32, 24, 0.75);
  color: #8d1712;
}

.ml-avent-intruder-card:disabled {
  cursor: default;
}

.ml-avent-intruder-card:disabled:hover {
  transform: none;
}


/* =========================================================
   14. COMPOSANT : ASSOCIATION
   ========================================================= */

.ml-avent-match-board {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 18px;
}

.ml-avent-match-column {
  display: grid;
  gap: 10px;
}

.ml-avent-match-column-title {
  display: block;
  margin-bottom: 2px;

  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;

  color: #7b5a24;
}

.ml-avent-match-card {
  min-height: 52px;
  padding: 12px 14px;

  border: 1px solid rgba(132, 88, 32, 0.3);
  border-radius: 15px;

  background: rgba(255, 250, 235, 0.9);
  color: var(--avent-text);

  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(0.9rem, 1vw, 1.08rem);
  font-weight: 700;
  text-align: center;

  cursor: pointer;

  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.85),
    0 5px 12px rgba(70, 42, 12, 0.12);

  transition:
    transform 0.15s ease,
    background 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.ml-avent-match-card:hover {
  transform: translateY(-2px);
  border-color: rgba(177, 121, 36, 0.65);
}

.ml-avent-match-card.is-selected {
  background: rgba(255, 239, 198, 0.95);
  border-color: rgba(201, 138, 44, 0.9);
  color: #6a3d0f;
}

.ml-avent-match-card.is-correct {
  background: rgba(232, 255, 229, 0.95);
  border-color: rgba(47, 107, 56, 0.85);
  color: #24632c;
}

.ml-avent-match-card.is-wrong {
  background: rgba(255, 236, 232, 0.95);
  border-color: rgba(168, 32, 24, 0.75);
  color: #8d1712;
}

.ml-avent-match-card:disabled {
  cursor: default;
}

.ml-avent-match-card:disabled:hover {
  transform: none;
}


/* =========================================================
   15. COMPOSANT : CLASSEMENT / REMISE DANS L'ORDRE
   ========================================================= */

.ml-avent-sort-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.ml-avent-sort-card {
  min-width: 0;
  min-height: 56px;
  padding: 12px 6px;

  border: 1px solid rgba(132, 88, 32, 0.3);
  border-radius: 16px;

  background: rgba(255, 250, 235, 0.9);
  color: var(--avent-text);

  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(0.82rem, 0.95vw, 1.08rem);
  font-weight: 700;
  line-height: 1.15;
  text-align: center;

  overflow-wrap: break-word;
  word-break: normal;

  cursor: pointer;

  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.85),
    0 5px 12px rgba(70, 42, 12, 0.12);

  transition:
    transform 0.15s ease,
    background 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.ml-avent-sort-card:hover {
  transform: translateY(-2px);
  border-color: rgba(177, 121, 36, 0.65);
}

.ml-avent-sort-card.is-selected {
  background: rgba(255, 239, 198, 0.95);
  border-color: rgba(201, 138, 44, 0.85);
  color: #6a3d0f;
}

.ml-avent-sort-card.is-correct {
  background: rgba(232, 255, 229, 0.95);
  border-color: rgba(47, 107, 56, 0.85);
  color: #24632c;
}

.ml-avent-sort-card.is-wrong {
  background: rgba(255, 236, 232, 0.95);
  border-color: rgba(168, 32, 24, 0.75);
  color: #8d1712;
}

.ml-avent-sort-card:disabled {
  cursor: default;
}

.ml-avent-sort-card:disabled:hover {
  transform: none;
}

.ml-avent-sort-result {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 46px;
  margin-top: 18px;
  padding: 10px 12px;

  border-radius: 14px;
  background: rgba(255, 248, 225, 0.7);
  border: 1px dashed rgba(132, 88, 32, 0.35);
}

.ml-avent-sort-placeholder {
  color: #7b5a24;
  font-style: italic;
}

.ml-avent-sort-pill {
  display: inline-flex;
  align-items: center;

  padding: 6px 10px;
  border-radius: 999px;

  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(177, 121, 36, 0.35);

  font-size: 0.92rem;
  font-weight: 700;
  color: var(--avent-text);
}

/* =========================================================
   COMPOSANT : DICTÉE DE NOTES AVEC LECTEUR AUDIO
   ========================================================= */

.ml-avent-audio-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;

  margin: 18px 0 16px 0;
}

.ml-avent-audio-help {
  color: #7b5a24;

  font-size: 0.92rem;
  font-weight: 700;
  font-style: italic;
}



/* =========================================================
   COMPOSANT : PUZZLE VISUEL EN FENÊTRE MODALE
   ========================================================= */

/* ---------------------------------------------------------
   Texte d’introduction dans le panneau du jeu
   --------------------------------------------------------- */

.ml-avent-puzzle-open-text {
  margin: 14px 0 16px 0;

  color: #6d4a20;

  font-size: 0.95rem;
  font-style: italic;
}

/* ---------------------------------------------------------
   Fenêtre modale du puzzle
   --------------------------------------------------------- */

.ml-avent-puzzle-modal[hidden] {
  display: none !important;
}

.ml-avent-puzzle-modal {
  position: fixed !important;
  inset: 0 !important;

  z-index: 2147483000 !important;
}

.ml-avent-puzzle-modal-backdrop {
  position: fixed !important;
  inset: 0 !important;

  z-index: 2147483001 !important;

  background: rgba(24, 14, 6, 0.82) !important;
}

.ml-avent-puzzle-modal-card {
  position: fixed !important;
  top: 50% !important;
  left: 50% !important;

  z-index: 2147483002 !important;

  width: min(92vw, 760px) !important;
  max-height: 88vh !important;

  transform: translate(-50%, -50%) !important;

  padding: 18px !important;
  overflow: auto !important;

  border: 1px solid rgba(122, 69, 31, 0.35);
  border-radius: 20px;

  background: #fff8e6;

  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.55);
}

.ml-avent-puzzle-modal-close {
  position: absolute;
  top: 10px;
  right: 12px;

  z-index: 2147483003 !important;

  width: 38px;
  height: 38px;

  border: none;
  border-radius: 50%;

  background: #7a2418;
  color: #fff8e6;

  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1;

  cursor: pointer;

  box-shadow: 0 7px 16px rgba(0, 0, 0, 0.28);
}

.ml-avent-puzzle-modal-close:hover {
  background: #5f1b12;
}

/* ---------------------------------------------------------
   Titres et textes de la fenêtre
   --------------------------------------------------------- */

.ml-avent-puzzle-modal-card h3 {
  margin: 6px 0 8px 0;

  color: #3d2010;

  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.25rem, 2vw, 1.75rem);
}

.ml-avent-puzzle-modal-question {
  margin: 0 0 10px 0;

  color: #4d3218;

  font-weight: 700;
}

.ml-avent-puzzle-help {
  margin: 0 0 10px 0;

  color: #5f3517;

  font-size: 0.92rem;
  font-style: italic;
}

/* ---------------------------------------------------------
   Zones du puzzle
   --------------------------------------------------------- */

.ml-avent-puzzle-zone {
  margin-top: 12px;
}

.ml-avent-puzzle-zone h4 {
  margin: 0 0 7px 0;

  color: #5f3517;

  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ---------------------------------------------------------
   Fragments mélangés
   --------------------------------------------------------- */

.ml-avent-puzzle-pool {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;

  min-height: 52px;
  padding: 12px;

  border: 1px solid rgba(122, 69, 31, 0.25);
  border-radius: 16px;

  background: rgba(255, 248, 230, 0.8);
}

/* ---------------------------------------------------------
   Zone de reconstitution
   --------------------------------------------------------- */

.ml-avent-puzzle-scroll {
  width: 100%;
  overflow-x: auto;
  padding-bottom: 8px;
}

.ml-avent-puzzle-slots {
  display: grid;
  gap: 0;

  min-width: 480px !important;
  max-width: 560px !important;

  margin: 0 auto;
  padding: 10px;

  border: 1px solid rgba(122, 69, 31, 0.25);
  border-radius: 16px;

  background: rgba(255, 248, 230, 0.8);
}

/* ---------------------------------------------------------
   Fragments et emplacements
   --------------------------------------------------------- */

.ml-avent-puzzle-piece,
.ml-avent-puzzle-slot {
  display: block;

  width: 100%;
  height: 230px !important;
  min-height: 0 !important;

  border: 1px solid rgba(91, 55, 23, 0.45);
  border-radius: 8px;

  background-color: #fffdf5;
  background-repeat: no-repeat;

  box-sizing: border-box;
}

.ml-avent-puzzle-piece {
  cursor: grab;

  box-shadow: 0 4px 10px rgba(60, 36, 12, 0.16);

  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease,
    border-color 0.15s ease,
    opacity 0.15s ease;
}

.ml-avent-puzzle-piece:hover {
  transform: translateY(-2px);
  border-color: rgba(122, 36, 24, 0.65);
  box-shadow: 0 7px 15px rgba(60, 36, 12, 0.22);
}

.ml-avent-puzzle-piece:active {
  cursor: grabbing;
}

.ml-avent-puzzle-piece:disabled {
  cursor: default;
  transform: none;
  opacity: 0.9;
}

/* Fragments dans la réserve */
.ml-avent-puzzle-pool .ml-avent-puzzle-piece {
  flex: 0 0 auto;

  width: 54px !important;
  height: 230px !important;
}

/* Fragments placés dans le puzzle */
.ml-avent-puzzle-slots .ml-avent-puzzle-piece,
.ml-avent-puzzle-slots .ml-avent-puzzle-slot {
  width: 100%;
  height: 230px !important;

  border-radius: 0;
}

.ml-avent-puzzle-slots .ml-avent-puzzle-piece:first-child,
.ml-avent-puzzle-slots .ml-avent-puzzle-slot:first-child {
  border-radius: 8px 0 0 8px;
}

.ml-avent-puzzle-slots .ml-avent-puzzle-piece:last-child,
.ml-avent-puzzle-slots .ml-avent-puzzle-slot:last-child {
  border-radius: 0 8px 8px 0;
}

/* Emplacement vide */
.ml-avent-puzzle-slot {
  border-style: dashed;

  background:
    linear-gradient(
      135deg,
      rgba(122, 69, 31, 0.06),
      rgba(255, 255, 255, 0.35)
    );
}

/* ---------------------------------------------------------
   États drag & drop / clic de secours
   --------------------------------------------------------- */

.ml-avent-puzzle-piece.is-picked {
  outline: 3px solid rgba(122, 36, 24, 0.85);
  outline-offset: 3px;
}

.ml-avent-puzzle-piece.is-dragging {
  opacity: 0.45;
}

.ml-avent-puzzle-slot.is-drag-over,
.ml-avent-puzzle-piece.is-drag-over {
  box-shadow:
    inset 0 0 0 3px rgba(47, 107, 56, 0.7),
    0 0 0 3px rgba(47, 107, 56, 0.15);
}

/* ---------------------------------------------------------
   Boutons
   --------------------------------------------------------- */

.ml-avent-puzzle-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;

  margin-top: 14px;
}

/* ---------------------------------------------------------
   Blocage du scroll de la page quand la modale est ouverte
   --------------------------------------------------------- */

.ml-avent-modal-is-open {
  overflow: hidden;
}

/* ---------------------------------------------------------
   Responsive
   --------------------------------------------------------- */

@media (max-width: 640px) {
  .ml-avent-puzzle-modal-card {
    width: 96vw !important;
    max-height: 90vh !important;
    padding: 14px !important;
  }

  .ml-avent-puzzle-slots {
    min-width: 420px !important;
    max-width: 520px !important;
  }

  .ml-avent-puzzle-piece,
  .ml-avent-puzzle-slot,
  .ml-avent-puzzle-pool .ml-avent-puzzle-piece,
  .ml-avent-puzzle-slots .ml-avent-puzzle-piece,
  .ml-avent-puzzle-slots .ml-avent-puzzle-slot {
    height: 205px !important;
  }

  .ml-avent-puzzle-pool .ml-avent-puzzle-piece {
    width: 48px !important;
  }
}
.ml-avent-puzzle-piece.is-correct-flash {
  box-shadow:
    inset 0 0 0 1.5px rgba(47, 107, 56, 0.95),
    0 0 0 1px rgba(47, 107, 56, 0.16),
    0 4px 10px rgba(60, 36, 12, 0.16) !important;

  border-color: rgba(47, 107, 56, 0.85) !important;
}
/* =========================================================
   CORRECTION PUZZLE : conserver les proportions de l’image
   ========================================================= */

/* Largeur globale du puzzle reconstitué */
.ml-avent-puzzle-slots {
  width: min(88vw, 420px) !important;
  min-width: 0 !important;
  max-width: 420px !important;

  margin: 0 auto !important;

  grid-template-columns: repeat(8, 1fr) !important;
}

/* Les fragments gardent le ratio original :
   image 560 x 360 découpée en 8 fragments = 70 x 360 */
.ml-avent-puzzle-piece,
.ml-avent-puzzle-slot {
  height: auto !important;
  min-height: 0 !important;

  aspect-ratio: 70 / 360 !important;
}

/* Fragments dans la réserve */
.ml-avent-puzzle-pool .ml-avent-puzzle-piece {
  width: 52px !important;
  height: auto !important;

  aspect-ratio: 70 / 360 !important;
}

/* Fragments placés dans le puzzle */
.ml-avent-puzzle-slots .ml-avent-puzzle-piece,
.ml-avent-puzzle-slots .ml-avent-puzzle-slot {
  width: 100% !important;
  height: auto !important;

  aspect-ratio: 70 / 360 !important;
}


/* =========================================================
   COMPOSANT : LECTURE DE NOTES ÉCLAIR
   ========================================================= */

.ml-avent-flash-box {
  margin-top: 18px;
}

.ml-avent-flash-info {
  margin: 12px 0 0 0;

  color: #6d4a20;

  font-size: 0.95rem;
  font-style: italic;
}

.ml-avent-flash-image-wrap {
  position: relative;

  margin-top: 16px;
  padding: 10px;

  border: 1px solid rgba(122, 69, 31, 0.25);
  border-radius: 16px;

  background: rgba(255, 248, 230, 0.78);
}

.ml-avent-flash-image {
  display: block;

  width: 100%;
  max-width: 640px;
  height: auto;
  max-height: 118px;

  object-fit: contain;

  margin: 0 auto;

  border-radius: 12px;
}

.ml-avent-flash-countdown {
  position: absolute;
  top: 10px;
  right: 4px;

  width: 26px;
  height: 26px;

  display: flex;
  align-items: center;
  justify-content: center;

  border-radius: 50%;

  background: #7a2418;
  color: #fff8e6;

  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1;

  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
}

/* =========================================================
   COMPOSANT : MOTS MÊLÉS FINAL
   ========================================================= */

.ml-avent-final-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 190px;
  gap: 16px;

  margin-top: 16px;
}

.ml-avent-wordsearch-wrap {
  overflow-x: auto;
  padding-bottom: 6px;
}

.ml-avent-wordsearch-grid {
  display: grid;
  gap: 2px;

  width: min(100%, 520px);
  margin: 0 auto;
  padding: 8px;

  border: 1px solid rgba(122, 69, 31, 0.28);
  border-radius: 16px;

  background: rgba(255, 248, 230, 0.78);

  touch-action: none;
  user-select: none;
}

.ml-avent-wordsearch-cell {
  aspect-ratio: 1 / 1;

  min-width: 0;
  padding: 0;

  border: 1px solid rgba(122, 69, 31, 0.18);
  border-radius: 5px;

  background: #fffdf5;
  color: #3d2010;

  font-size: clamp(0.58rem, 1.05vw, 0.82rem);
  font-weight: 800;
  line-height: 1;

  cursor: pointer;
}

.ml-avent-wordsearch-cell.is-selecting {
  background: #ffe8a6;
  border-color: rgba(122, 36, 24, 0.55);
}

.ml-avent-wordsearch-cell.is-found {
  background: rgba(47, 107, 56, 0.18);
  border-color: rgba(47, 107, 56, 0.62);
  color: #235329;
}

.ml-avent-final-words {
  padding: 12px;

  border: 1px solid rgba(122, 69, 31, 0.25);
  border-radius: 16px;

  background: rgba(255, 248, 230, 0.75);
}

.ml-avent-final-words h4 {
  margin: 0 0 6px 0;

  color: #5f3517;

  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.95rem;
}

.ml-avent-final-note {
  margin: 0 0 10px 0;

  color: #7b5a24;

  font-size: 0.82rem;
  font-style: italic;
}

.ml-avent-final-word-list {
  display: grid;
  gap: 4px;
}

.ml-avent-final-word {
  padding: 4px 6px;

  border-radius: 7px;

  color: #3d2010;

  font-family: Consolas, "Courier New", monospace;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.ml-avent-final-word.is-found {
  background: rgba(47, 107, 56, 0.14);
  color: #235329;
  text-decoration: line-through;
}

.ml-avent-final-counter {
  margin-top: 10px;
  padding-top: 8px;

  border-top: 1px solid rgba(122, 69, 31, 0.2);

  color: #7a2418;

  font-size: 0.9rem;
  font-weight: 800;
}
.ml-avent-contest-small {
  margin: 4px 0 0 0;
  color: #7b5a24;
  font-size: 0.82rem;
  font-style: italic;
}
.ml-avent-contest-form-wrap {
  margin-top: 20px;
  padding: 16px;

  border: 1px solid rgba(47, 107, 56, 0.35);
  border-radius: 18px;

  background: rgba(245, 255, 238, 0.88);
}

.ml-avent-contest-form-wrap[hidden] {
  display: none;
}

.ml-avent-contest-form-wrap h3 {
  margin: 0 0 8px 0;

  color: #235329;

  font-family: Georgia, "Times New Roman", serif;
}

.ml-avent-contest-date {
  color: #7a2418;
  font-weight: 700;
}

.ml-avent-contest-form {
  display: grid;
  gap: 10px;

  margin-top: 12px;
}

.ml-avent-contest-form label {
  display: grid;
  gap: 5px;

  color: #4d3218;

  font-size: 0.9rem;
  font-weight: 700;
}

.ml-avent-contest-form input[type="text"],
.ml-avent-contest-form input[type="email"] {
  width: 100%;

  padding: 10px 12px;

  border: 1px solid rgba(122, 69, 31, 0.32);
  border-radius: 10px;

  background: #fffdf5;
  color: #2c1a0f;

  font-size: 0.95rem;
}

.ml-avent-contest-form input:focus {
  outline: none;
  border-color: #7a2418;
  box-shadow: 0 0 0 3px rgba(122, 36, 24, 0.12);
}

@media (max-width: 767px) {
  .ml-avent-final-layout {
    grid-template-columns: 1fr;
  }

  .ml-avent-final-words {
    order: -1;
  }

  .ml-avent-wordsearch-grid {
    width: min(100%, 500px);
  }

  .ml-avent-wordsearch-cell {
    font-size: 0.66rem;
  }

  .ml-avent-final-word-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* =========================================================
   JOUR 24 : MOTS MÊLÉS EN FENÊTRE MODALE
   ========================================================= */

.ml-avent-final-open-text {
  margin: 14px 0 16px 0;

  color: #6d4a20;

  font-size: 0.95rem;
  font-style: italic;
}

.ml-avent-final-modal[hidden] {
  display: none !important;
}

.ml-avent-final-modal {
  position: fixed !important;
  inset: 0 !important;

  z-index: 2147483000 !important;
}

.ml-avent-final-modal-backdrop {
  position: fixed !important;
  inset: 0 !important;

  z-index: 2147483001 !important;

  background: rgba(24, 14, 6, 0.82) !important;
}

.ml-avent-final-modal-card {
  position: fixed !important;
  top: 50% !important;
  left: 50% !important;

  z-index: 2147483002 !important;

  width: min(96vw, 1120px) !important;
  max-height: 92vh !important;

  transform: translate(-50%, -50%) !important;

  padding: 20px !important;
  overflow: auto !important;

  border: 1px solid rgba(122, 69, 31, 0.35);
  border-radius: 22px;

  background: #fff8e6;

  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.55);
}

.ml-avent-final-modal-close {
  position: absolute;
  top: 10px;
  right: 12px;

  z-index: 2147483003 !important;

  width: 38px;
  height: 38px;

  border: none;
  border-radius: 50%;

  background: #7a2418;
  color: #fff8e6;

  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1;

  cursor: pointer;

  box-shadow: 0 7px 16px rgba(0, 0, 0, 0.28);
}

.ml-avent-final-modal-card h3 {
  margin: 6px 0 8px 0;

  color: #3d2010;

  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.25rem, 2vw, 1.75rem);
}

.ml-avent-final-modal-question {
  margin: 0 0 16px 0;

  color: #4d3218;

  font-weight: 700;
}

/* Mise en page agrandie dans la modale */
.ml-avent-final-modal .ml-avent-final-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 230px;
  gap: 20px;

  align-items: start;

  margin-top: 16px;
}

.ml-avent-final-modal .ml-avent-wordsearch-wrap {
  overflow-x: auto;
  padding-bottom: 8px;
}

.ml-avent-final-modal .ml-avent-wordsearch-grid {
  width: min(68vw, 680px);
  max-width: 100%;

  margin: 0 auto;
}

.ml-avent-final-modal .ml-avent-wordsearch-cell {
  font-size: clamp(0.7rem, 1vw, 0.95rem);
}

/* Liste des mots plus lisible en grand */
.ml-avent-final-modal .ml-avent-final-words {
  max-height: 70vh;
  overflow: auto;
}

.ml-avent-modal-is-open {
  overflow: hidden;
}

@media (max-width: 820px) {
  .ml-avent-final-modal-card {
    width: 96vw !important;
    max-height: 92vh !important;
    padding: 14px !important;
  }

  .ml-avent-final-modal .ml-avent-final-layout {
    grid-template-columns: 1fr;
  }

  .ml-avent-final-modal .ml-avent-final-words {
    order: -1;
    max-height: none;
  }

  .ml-avent-final-modal .ml-avent-final-word-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ml-avent-final-modal .ml-avent-wordsearch-grid {
    width: min(94vw, 560px);
  }
}

/* =========================================================
   JOUR 24 : grille finale plus compacte et mieux centrée
   ========================================================= */

/* Fenêtre un peu mieux équilibrée */
.ml-avent-final-modal-card {
  width: min(94vw, 1060px) !important;
  padding: 22px 24px !important;
}

/* Mise en page générale : grille + indices centrés */
.ml-avent-final-modal .ml-avent-final-layout {
  display: grid !important;
  grid-template-columns: 500px 360px !important;
  gap: 28px !important;

  justify-content: center !important;
  align-items: start !important;

  margin-top: 18px !important;
}

/* Cadre de la grille un peu plus petit */
.ml-avent-final-modal .ml-avent-wordsearch-grid {
  width: 500px !important;
  max-width: 500px !important;

  margin: 0 auto !important;
  padding: 7px !important;

  gap: 2px !important;
}

/* Lettres plus compactes */
.ml-avent-final-modal .ml-avent-wordsearch-cell {
  border-radius: 4px !important;

  font-size: 0.72rem !important;
  font-weight: 800 !important;
}

/* Bloc des mots à retrouver plus large */
.ml-avent-final-modal .ml-avent-final-words {
  width: 360px !important;
  max-height: none !important;
  overflow: visible !important;

  padding: 14px !important;
}

/* Liste des mots sur 2 colonnes */
.ml-avent-final-modal .ml-avent-final-word-list {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  column-gap: 16px !important;
  row-gap: 5px !important;
}

/* Chaque indice plus compact */
.ml-avent-final-modal .ml-avent-final-word {
  padding: 3px 4px !important;

  font-size: 0.78rem !important;
  line-height: 1.25 !important;
}

/* Compteur sous les deux colonnes */
.ml-avent-final-modal .ml-avent-final-counter {
  margin-top: 12px !important;
}

/* Responsive : sur petits écrans, on repasse en une colonne */
@media (max-width: 920px) {
  .ml-avent-final-modal .ml-avent-final-layout {
    grid-template-columns: 1fr !important;
    gap: 18px !important;
  }

  .ml-avent-final-modal .ml-avent-final-words {
    width: auto !important;
    order: -1;
  }

  .ml-avent-final-modal .ml-avent-wordsearch-grid {
    width: min(92vw, 500px) !important;
    max-width: 500px !important;
  }
}
.ml-avent-final-test-actions {
  margin-top: 14px;
  text-align: center;
}
/* =========================================================
   JOUR 24 : équilibre grille finale sans ascenseur horizontal
   ========================================================= */

.ml-avent-final-modal-card {
  width: min(94vw, 1040px) !important;
  padding: 22px 24px !important;
}

/* Ensemble grille + mots mieux centré */
.ml-avent-final-modal .ml-avent-final-layout {
  display: grid !important;
  grid-template-columns: 470px 370px !important;
  gap: 26px !important;

  justify-content: center !important;
  align-items: start !important;

  margin-top: 18px !important;
}

/* Plus besoin d'ascenseur horizontal sur desktop */
.ml-avent-final-modal .ml-avent-wordsearch-wrap {
  width: 470px !important;
  max-width: 470px !important;

  overflow-x: visible !important;
  padding-bottom: 0 !important;
}

/* Grille un peu plus compacte */
.ml-avent-final-modal .ml-avent-wordsearch-grid {
  width: 470px !important;
  max-width: 470px !important;

  box-sizing: border-box !important;

  margin: 0 auto !important;
  padding: 7px !important;

  gap: 2px !important;
}

/* Cases légèrement plus compactes */
.ml-avent-final-modal .ml-avent-wordsearch-cell {
  min-width: 0 !important;

  border-radius: 4px !important;

  font-size: 0.68rem !important;
  font-weight: 800 !important;
}

/* Bloc des mots à retrouver */
.ml-avent-final-modal .ml-avent-final-words {
  width: 370px !important;
  max-width: 370px !important;

  max-height: none !important;
  overflow: visible !important;

  box-sizing: border-box !important;

  padding: 14px 16px !important;
}

/* Mots sur 2 colonnes */
.ml-avent-final-modal .ml-avent-final-word-list {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;

  column-gap: 18px !important;
  row-gap: 5px !important;
}

.ml-avent-final-modal .ml-avent-final-word {
  padding: 3px 4px !important;

  font-size: 0.76rem !important;
  line-height: 1.25 !important;
}

.ml-avent-final-modal .ml-avent-final-counter {
  margin-top: 12px !important;
}

/* Responsive : sur petits écrans on garde le scroll si nécessaire */
@media (max-width: 920px) {
  .ml-avent-final-modal .ml-avent-final-layout {
    grid-template-columns: 1fr !important;
    gap: 18px !important;
  }

  .ml-avent-final-modal .ml-avent-final-words {
    width: auto !important;
    max-width: none !important;

    order: -1;
  }

  .ml-avent-final-modal .ml-avent-wordsearch-wrap {
    width: 100% !important;
    max-width: 100% !important;

    overflow-x: auto !important;
    padding-bottom: 6px !important;
  }

  .ml-avent-final-modal .ml-avent-wordsearch-grid {
    width: 470px !important;
    max-width: 470px !important;
  }

  .ml-avent-final-modal .ml-avent-final-word-list {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}



/* =========================================================
   COMPOSANT : COFFRE MUSICAL À CODE
   ========================================================= */

.ml-avent-code-clues {
  display: grid;
  gap: 10px;

  margin-top: 18px;
}

.ml-avent-code-clue {
  display: flex;
  align-items: flex-start;
  gap: 10px;

  padding: 10px 12px;

  border: 1px solid rgba(122, 69, 31, 0.22);
  border-radius: 14px;

  background: rgba(255, 248, 230, 0.75);
}

.ml-avent-code-clue span {
  flex: 0 0 auto;

  width: 26px;
  height: 26px;

  display: flex;
  align-items: center;
  justify-content: center;

  border-radius: 50%;

  background: #7a2418;
  color: #fff8e6;

  font-weight: 700;
}

.ml-avent-code-clue p {
  margin: 2px 0 0 0;

  color: #4d3218;

  font-weight: 700;
  line-height: 1.35;
}

.ml-avent-code-inputs {
  display: flex;
  justify-content: center;
  gap: 10px;

  margin-top: 22px;
}

.ml-avent-code-digit {
  width: 48px;
  height: 54px;

  border: 2px solid rgba(122, 69, 31, 0.35);
  border-radius: 12px;

  background: #fffdf5;
  color: #3d2010;

  font-size: 1.8rem;
  font-weight: 700;
  text-align: center;

  box-shadow: inset 0 2px 5px rgba(60, 36, 12, 0.08);
}

.ml-avent-code-digit:focus {
  outline: none;
  border-color: #7a2418;
  box-shadow:
    0 0 0 3px rgba(122, 36, 24, 0.14),
    inset 0 2px 5px rgba(60, 36, 12, 0.08);
}

.ml-avent-code-actions {
  display: flex;
  justify-content: center;

  margin-top: 18px;
}

/* =========================================================
   COMPOSANT : MINI-MEMORY MUSICAL
   ========================================================= */

.ml-avent-memory-help {
  margin: 14px 0 16px 0;

  color: #6d4a20;

  font-size: 0.95rem;
  font-style: italic;
}

.ml-avent-memory-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(70px, 1fr));
  gap: 10px;

  margin-top: 16px;
}

.ml-avent-memory-card {
  position: relative;

  min-height: 82px;

  padding: 0;

  border: none;
  border-radius: 14px;

  background: transparent;

  cursor: pointer;

  perspective: 800px;
}

.ml-avent-memory-card-inner {
  position: relative;

  display: block;

  width: 100%;
  height: 100%;
  min-height: 82px;

  transition: transform 0.35s ease;
  transform-style: preserve-3d;
}

.ml-avent-memory-card.is-flipped .ml-avent-memory-card-inner,
.ml-avent-memory-card.is-matched .ml-avent-memory-card-inner {
  transform: rotateY(180deg);
}

.ml-avent-memory-card-front,
.ml-avent-memory-card-back {
  position: absolute;
  inset: 0;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 10px;

  border: 1px solid rgba(122, 69, 31, 0.28);
  border-radius: 14px;

  backface-visibility: hidden;

  box-shadow: 0 5px 14px rgba(60, 36, 12, 0.14);

  box-sizing: border-box;
}

.ml-avent-memory-card-front {
  background:
    radial-gradient(circle at top, rgba(255,255,255,0.92), rgba(255, 236, 188, 0.9));

  color: #7a2418;

  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.8rem;
  font-weight: 700;
}

.ml-avent-memory-card-back {
  transform: rotateY(180deg);

  background: #fff8e6;
  color: #3d2010;

  font-size: 0.9rem;
  font-weight: 700;
  text-align: center;
  line-height: 1.15;
}

.ml-avent-memory-card-back.is-symbol {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2rem;
  line-height: 1;
}

.ml-avent-memory-card.is-matched .ml-avent-memory-card-back {
  border-color: rgba(47, 107, 56, 0.65);
  box-shadow:
    inset 0 0 0 2px rgba(47, 107, 56, 0.18),
    0 5px 14px rgba(60, 36, 12, 0.14);
}

.ml-avent-memory-card:disabled {
  cursor: default;
}

@media (max-width: 640px) {
  .ml-avent-memory-grid {
    grid-template-columns: repeat(3, minmax(70px, 1fr));
  }

  .ml-avent-memory-card,
  .ml-avent-memory-card-inner {
    min-height: 76px;
  }

  .ml-avent-memory-card-back {
    font-size: 0.82rem;
  }

  .ml-avent-memory-card-back.is-symbol {
    font-size: 1.7rem;
  }
}

/* =========================================================
   16. IMAGE D'OBSERVATION DANS UN DÉFI
   ---------------------------------------------------------
   Miniature affichée dans le panneau du jeu.
   Au clic, le JS ouvre l'image en grand.
   ========================================================= */

.ml-avent-image-preview {
  display: block;
  width: 100%;
  margin: 14px 0 16px 0;
  padding: 8px;

  border: 1px solid rgba(132, 88, 32, 0.3);
  border-radius: 16px;

  background: rgba(255, 250, 235, 0.9);
  cursor: pointer;

  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.85),
    0 5px 12px rgba(70, 42, 12, 0.12);
}

.ml-avent-image-preview img {
  display: block;
  width: 100%;
  max-height: 190px;

  object-fit: cover;
  border-radius: 12px;
}

.ml-avent-image-preview span {
  display: block;
  margin-top: 7px;

  color: #7b5a24;
  font-size: 0.86rem;
  font-weight: 700;
  text-align: center;
}


/* =========================================================
   17. MODALE D'AGRANDISSEMENT D'IMAGE
   ========================================================= */

.ml-avent-image-modal[hidden] {
  display: none;
}

.ml-avent-image-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
}

.ml-avent-image-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(30, 18, 8, 0.75);
}

.ml-avent-image-modal-card {
  position: absolute;
  top: 50%;
  left: 50%;

  width: min(94vw, 1100px);
  max-height: 92vh;

  transform: translate(-50%, -50%);

  padding: 18px;
  border-radius: 22px;

  background: #fff8e6;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
}

.ml-avent-image-modal-card img {
  display: block;
  width: 100%;
  max-height: 82vh;

  object-fit: contain;
  border-radius: 14px;
}

.ml-avent-image-modal-close {
  position: absolute;
  top: -14px;
  right: -14px;

  width: 38px;
  height: 38px;

  border: none;
  border-radius: 50%;

  background: var(--avent-red);
  color: #fff8e6;

  font-size: 1.6rem;
  line-height: 1;

  cursor: pointer;
}


/* =========================================================
   18. COMPOSANT FUTUR : OBSERVATION / SYMBOLE À CLIQUER
   ---------------------------------------------------------
   Pas utilisé par le jour 5 finalement, mais conservé pour
   de futurs défis visuels.
   ========================================================= */

.ml-avent-observation-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.ml-avent-observation-card {
  min-height: 78px;
  padding: 12px;

  border: 1px solid rgba(132, 88, 32, 0.3);
  border-radius: 18px;

  background: rgba(255, 250, 235, 0.9);
  color: var(--avent-text);

  cursor: pointer;

  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.85),
    0 5px 12px rgba(70, 42, 12, 0.12);

  transition:
    transform 0.15s ease,
    background 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.ml-avent-observation-card:hover {
  transform: translateY(-2px);
  border-color: rgba(177, 121, 36, 0.65);
}

.ml-avent-observation-symbol {
  display: block;

  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 3.3vw, 3.6rem);
  line-height: 1;

  color: var(--avent-blue);
}

.ml-avent-observation-card.is-selected {
  border-color: rgba(201, 138, 44, 0.85);
}

.ml-avent-observation-card.is-correct {
  background: rgba(232, 255, 229, 0.95);
  border-color: rgba(47, 107, 56, 0.85);
}

.ml-avent-observation-card.is-correct .ml-avent-observation-symbol {
  color: #24632c;
}

.ml-avent-observation-card.is-wrong {
  background: rgba(255, 236, 232, 0.95);
  border-color: rgba(168, 32, 24, 0.75);
}

.ml-avent-observation-card.is-wrong .ml-avent-observation-symbol {
  color: #8d1712;
}

.ml-avent-observation-card:disabled {
  cursor: default;
}

.ml-avent-observation-card:disabled:hover {
  transform: none;
}


/* =========================================================
   19. VERSION MOBILE
   ========================================================= */

@media (max-width: 767px) {

  .ml-avent-stage {
    max-width: 520px;
    margin: 24px auto 36px auto;

    aspect-ratio: 9 / 16;

    background-image: url("/calendrier-avent/images/avent-bg-mobile.webp");
    border-radius: 14px;
  }

  .ml-avent-game-header {
    top: 3.5%;
    left: 8%;
    right: 8%;
    width: auto;
    transform: none;
  }

  .ml-avent-kicker {
    font-size: 0.68rem;
  }

  .ml-avent-game-header h2 {
    font-size: clamp(1.05rem, 5vw, 1.65rem);
  }

  .ml-avent-board {
    position: static;
    display: block;
  }

  .ml-avent-secret-panel {
    position: absolute;
    top: 15.8%;
    left: 17%;
    right: 17%;
    height: 10.2%;
  }

  .ml-avent-secret-inner {
    padding: 6px 14px;
    justify-content: center;
  }

  .ml-avent-day-block {
    margin: 0;
  }

  .ml-avent-day-label {
    font-size: 0.72rem;
  }

  .ml-avent-day-number {
    margin-top: 0;
    font-size: clamp(1.75rem, 9vw, 3rem);
  }

  .ml-avent-secret-separator {
    display: none;
  }

  .ml-avent-secret-title {
    margin: 4px 0 2px 0;
    font-size: 0.68rem;
  }

  .ml-avent-secret-mask {
    margin: 0;
    font-size: clamp(1rem, 5vw, 1.45rem);
  }

  .ml-avent-secret-word {
    margin: 2px 0 0 0;
    padding: 4px 9px;

    font-size: clamp(1rem, 5vw, 1.45rem);
  }

  .ml-avent-secret-help {
    display: none;
  }

  .ml-avent-game-panel {
    position: absolute;
    top: 27.3%;
    left: 13.3%;
    right: 13.3%;
    bottom: 17.2%;
  }

  .ml-avent-panel-inner {
    padding: 7% 7.5%;
  }

  .ml-avent-panel-title {
    margin: 0 0 14px 0;

    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(1rem, 1.25vw, 1.35rem);

    color: var(--avent-blue);
  }

  .ml-avent-game-container p,
  .ml-avent-question {
    font-size: clamp(0.9rem, 4vw, 1.05rem);
    line-height: 1.45;
  }

  .ml-avent-days-nav {
    left: 8%;
    right: 8%;
    bottom: 5.4%;
    height: 8.8%;

    grid-template-columns: repeat(12, minmax(0, 1fr));
    grid-template-rows: repeat(2, minmax(0, 1fr));
    gap: 5px;
  }

  .ml-avent-form-row {
    row-gap: 16px;
  }

  .ml-avent-input {
    max-width: 100%;
    font-size: 0.95rem;
  }

  .ml-avent-action {
    min-height: 40px;
    padding: 9px 16px;
    font-size: 0.9rem;
  }

  .ml-avent-intruder-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .ml-avent-intruder-card {
    min-height: 48px;
    padding: 10px 12px;
    font-size: 0.95rem;
  }

  .ml-avent-match-board {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .ml-avent-match-column {
    gap: 8px;
  }

  .ml-avent-match-card {
    min-height: 44px;
    padding: 9px 10px;
    font-size: 0.9rem;
  }

  .ml-avent-sort-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .ml-avent-sort-card {
    min-height: 48px;
    padding: 10px 12px;
    font-size: 0.95rem;
  }

  .ml-avent-sort-result {
    gap: 6px;
    padding: 8px;
  }

  .ml-avent-sort-pill {
    font-size: 0.85rem;
  }

  .ml-avent-image-preview img {
    max-height: 150px;
  }

  .ml-avent-observation-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .ml-avent-observation-card {
    min-height: 58px;
    padding: 9px;
  }

  .ml-avent-observation-symbol {
    font-size: 2.1rem;
  }
}


/* =========================================================
   20. PETITS ÉCRANS TRÈS ÉTROITS
   ========================================================= */

@media (max-width: 390px) {

  .ml-avent-game-header h2 {
    font-size: 1rem;
  }

  .ml-avent-panel-inner {
    padding: 8% 8%;
  }

  .ml-avent-days-nav {
    gap: 4px;
  }

  .ml-avent-day-button {
    font-size: 0.6rem;
  }
}