/* Feuille de l'éditeur v3 et aperçu (page « préparer »). Réponses : pastilles D34 (js/reponses.js) ; la bonne
   réponse est marquée par l'état « juste » (coche verte), jamais par la couleur de la réponse. */

.ed-feuille { display: grid; gap: 0.9rem; max-width: 40rem; }

.ed-haut { display: flex; align-items: center; flex-wrap: wrap; gap: 0.6rem 1rem; }
.ed-titre { flex: 1 1 auto; color: var(--encre-douce); font-size: 0.95rem; font-weight: 500; }
.ed-lien { margin: -0.4rem 0 0; color: var(--encre-douce); font-size: 0.88rem; font-style: italic; }

/* Type : un segment par type courant, « ⋯ » pour les autres */
.types { display: inline-flex; gap: 2px; padding: 3px; border-radius: 11px; background: var(--fond-creux); }
.type {
  min-height: 34px;
  padding: 0.2rem 0.8rem;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--encre-douce);
  font: inherit;
  font-size: 0.92rem;
  font-weight: 500;
  cursor: pointer;
}
.type:hover { color: var(--encre); }
.type[aria-pressed='true'] { background: #ffffff; color: var(--encre); font-weight: 600; box-shadow: 0 1px 2px rgba(31, 41, 51, 0.15); }
.type-plus { padding: 0.2rem 0.6rem; font-weight: 700; }

/* La question : grande, sans cadre */
.preparer .ed-texte {
  min-height: 2.6rem;
  padding: 0.3rem 0 0.5rem;
  border: 0;
  border-bottom: 2px solid var(--filet);
  border-radius: 0;
  background: transparent;
  font-family: 'Fredoka', system-ui, sans-serif;
  font-size: 1.45rem;
  font-weight: 500;
  line-height: 1.3;
  resize: none;
}
.preparer .ed-texte:focus { border-bottom-color: var(--agir); }
.preparer .ed-texte::placeholder { color: var(--encre-pale); font-weight: 400; }

/* Médias de la question */
.ed-medias { display: grid; gap: 0.5rem; }
.ed-medias:empty { display: none; }
.ed-medias-boutons { display: flex; flex-wrap: wrap; gap: 0.2rem; margin-left: -0.6rem; }
.ed-media-ajouter-picto { width: 1.2em; color: var(--encre-pale); text-align: center; }
.ed-media { display: flex; align-items: center; gap: 0.9rem; margin: 0; }
.ed-media-apercu {
  position: relative;
  flex: none;
  display: grid;
  place-items: center;
  width: 128px;
  height: 72px;
  overflow: hidden;
  border-radius: 8px;
  background: var(--fond-creux);
}
.ed-media-apercu .media-image { width: auto; height: 100%; max-width: 100%; }
.ed-media-miniature { width: 100%; height: 100%; object-fit: cover; }
.ed-media-picto { position: absolute; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: rgba(31, 41, 51, 0.75); color: #fff; font-size: 0.85rem; }
.ed-media-ecouter { width: 44px; height: 44px; border: 0; border-radius: 50%; background: var(--encre); color: #fff; font: inherit; font-size: 1rem; cursor: pointer; }
.ed-media-legende { display: grid; gap: 0.1rem; min-width: 0; font-size: 0.9rem; }
.ed-media-nom { font-weight: 500; }
.ed-media-credit { color: var(--encre-pale); font-size: 0.8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ed-media-actions { display: flex; gap: 0.1rem; margin-left: -0.6rem; }
.ed-media.mort .ed-media-apercu { outline: 2px dashed var(--faux); outline-offset: -2px; }
.ed-media-mort { color: var(--faux); font-weight: 600; }
.ed-media .media-son { display: none; }
.ed-media-conflit { margin: 0; padding: 0.35rem 0.7rem; border-left: 3px solid #d9a400; color: #6e4a00; font-size: 0.9rem; }
.ed-media-conflit .btn-discret { color: var(--agir); font-weight: 600; }

/* Réponses */
.ed-consigne { margin: 0.2rem 0 -0.4rem; color: var(--encre-douce); font-size: 0.88rem; }
.ed-consigne:empty { display: none; }
.ed-choix { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.35rem; }
.ed-rep {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.3rem 0.4rem 0.3rem 0.3rem;
  border-radius: 14px;
}
.ed-rep.juste { background: var(--rep-clair); }
.ed-pastille {
  position: relative;
  flex: none;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: transparent;
  cursor: pointer;
}
.ed-pastille .pastille-rep { width: 40px; height: 40px; transition: transform 0.12s; }
button.ed-pastille:hover .pastille-rep { transform: scale(1.08); }
span.ed-pastille { cursor: default; }
.ed-coche {
  position: absolute;
  right: -3px;
  bottom: -3px;
  display: none;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 2px solid var(--feuille);
  border-radius: 50%;
  background: var(--juste);
  color: var(--juste-texte);
  font-size: 0.75rem;
  font-weight: 700;
}
.ed-rep.juste .ed-coche { display: grid; }
button.ed-pastille:not([aria-pressed='true']):hover .ed-coche { display: grid; opacity: 0.45; }
.preparer .ed-choix-texte { flex: 1 1 auto; min-width: 0; min-height: 44px; font-size: 1.05rem; background: #ffffff; }
.preparer .ed-rep.juste .ed-choix-texte { border-color: var(--juste); }
.preparer .ed-choix-texte[readonly] { background: transparent; border-color: transparent; font-weight: 500; cursor: default; }
.ed-rep-bonne { flex: none; width: 4.4rem; color: var(--juste); font-size: 0.85rem; font-weight: 600; }
/* Outils d'une réponse (image, retirer) : au survol, à la place du mot « bonne ». */
.ed-rep-outils { position: absolute; right: 0.4rem; top: 50%; display: flex; gap: 2px; transform: translateY(-50%); visibility: hidden; }
.ed-rep:hover .ed-rep-outils, .ed-rep:focus-within .ed-rep-outils { visibility: visible; }
.ed-rep:hover .ed-rep-outils ~ .ed-rep-bonne, .ed-rep:focus-within .ed-rep-outils ~ .ed-rep-bonne { visibility: hidden; }
.ed-rep-outil {
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--encre-douce);
  font: inherit;
  cursor: pointer;
}
.ed-rep-outil:hover { background: var(--survol); color: var(--encre); }
.ed-rep-vignette { flex: none; width: 64px; height: 44px; padding: 0; overflow: hidden; border: 0; border-radius: 8px; background: var(--fond-creux); cursor: pointer; }
.ed-rep-vignette .media-image { width: auto; height: 100%; max-width: 100%; margin: 0 auto; }
.ed-rep-vignette.mort { outline: 2px dashed var(--faux); outline-offset: -2px; }

.ed-options { display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem 1.2rem; margin-top: -0.2rem; }
.ed-options .btn-discret { margin-left: 2.9rem; }
.interrupteur { display: inline-flex; align-items: center; gap: 0.45rem; min-height: 34px; color: var(--encre-douce); font-size: 0.92rem; cursor: pointer; }
.interrupteur input { width: 1.1rem; height: 1.1rem; margin: 0; accent-color: var(--agir); }

.messages { margin: 0; padding: 0.45rem 0.8rem; list-style: none; border-left: 3px solid #d9a400; color: #6e4a00; font-size: 0.9rem; }
.messages-erreur { border-left-color: var(--faux); color: #8f2418; font-weight: 500; }

/* Étiquettes et options (repliées) */
.ed-plus { border-top: 1px solid var(--filet); padding-top: 0.6rem; }
.ed-plus > summary {
  display: block;
  min-height: 34px;
  padding: 0.3rem 0;
  color: var(--encre-douce);
  font-weight: 500;
  cursor: pointer;
  list-style: none;
}
.ed-plus > summary::-webkit-details-marker { display: none; }
.ed-plus > summary::before { content: '▸'; display: inline-block; width: 1.1em; color: var(--encre-pale); transition: transform 0.15s; }
.ed-plus[open] > summary::before { transform: rotate(90deg); }
.ed-plus-resume { margin-left: 0.5rem; color: var(--encre-pale); font-size: 0.88rem; font-weight: 400; }
.ed-plus-corps { display: grid; gap: 0.8rem; padding: 0.4rem 0 0.2rem 1.2rem; }
.pastilles-champ { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; }
.pastilles-champ input { flex: 1 1 8rem; width: auto; }
.pastilles { display: contents; list-style: none; }
.pastille { display: inline-flex; align-items: center; gap: 0.2rem; padding: 0.1rem 0.2rem 0.1rem 0.6rem; border-radius: 999px; background: var(--fond-creux); color: var(--encre); font-size: 0.88rem; }
.pastille-x { width: 24px; height: 24px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--encre-douce); cursor: pointer; }
.pastille-x:hover { background: var(--survol); }
.ed-voix { margin: 0; color: var(--encre-douce); font-size: 0.88rem; }

/* ---------- Aperçu : la scène de la projection (css/scene.css), en vignette 16:9 ---------- */

.apercu {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 12px;
  box-shadow: var(--ombre-douce);
}
.apercu:empty { visibility: hidden; }
.apercu-note { margin: 0.8rem 0.2rem 0; color: var(--encre-douce); font-size: 0.92rem; }
