/* Édition publique : panneau de licence, pied de page, outils retirés */

/* Le calque de référence sert au recalage des gabarits, pas aux créateurs */
.calque-controles { display: none !important; }

.licence { border: 1px solid var(--bord); border-radius: var(--rayon); padding: 4px 12px 10px; margin-bottom: 12px; }
.licence .fort { color: var(--texte); }
.licence .ligne input[type="text"] { flex: 1 1 auto; min-width: 0; }
a.bouton { display: inline-block; text-decoration: none; text-align: center; }

.mentions { margin-top: 24px; padding-top: 12px; border-top: 1px solid var(--bord); color: var(--doux); font-size: 12px; }
.mentions p { margin: 0 0 8px; }
.mentions a { color: var(--texte); }

/* Choix de la langue du site, dans l'en-tête */
.titre { position: relative; }
.choix-langue { position: absolute; top: 16px; right: 0; width: auto; padding: 4px 8px; font-size: 13px; }

/* Après une vidéo gratuite : proposer de retirer le filigrane */
.relance {
  width: min(560px, 100%);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  padding: 10px 12px;
  border: 1px solid #fe2c5566;
  background: #fe2c5514;
  border-radius: var(--rayon);
  font-size: 13px;
}
.relance p { margin: 0; flex: 1 1 260px; }
.relance a.bouton { margin: 0; }
.relance button.discret { padding: 4px 6px; }

/* Le titre ramène à la page de présentation */
.retour-accueil { color: inherit; text-decoration: none; }

/* Fichier prêt, sur téléphone : enregistrer dans les photos ou partager */
.feuille-export {
  position: fixed;
  left: 12px; right: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom));
  z-index: 50;
  background: var(--carte);
  border: 1px solid var(--bord);
  border-radius: 16px;
  padding: 14px 14px 6px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}
.feuille-export .titre-feuille { margin: 0 0 4px; font-weight: 700; font-size: 16px; }
.feuille-export .ligne { align-items: center; }
.feuille-export button.principal { flex: 1; }
.feuille-export button.discret { font-size: 22px; padding: 4px 8px; }

/* ------------------------------------------------------------- téléphone
   L'aperçu reste en haut de l'écran pendant que l'on règle le panneau
   en dessous ; les cartes de gabarit défilent à l'horizontale. */
@media (max-width: 860px) {
  .app { display: flex; flex-direction: column; height: auto; min-height: 100vh; }
  .scene {
    order: -1;
    position: sticky;
    top: 0;
    z-index: 20;
    height: auto;
    padding: 8px 12px 6px;
    gap: 6px;
    background: var(--fond);
    border-bottom: 1px solid var(--bord);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45);
  }
  .cadre { flex: none; height: 38vh; height: 38svh; }
  /* gabarit paysage (chat vidéo) : le cadre prend la hauteur de l'image */
  .app:has(.appli.paysage.actif) .cadre { height: auto; aspect-ratio: 16 / 9; }
  .boite-ecran { border-radius: 12px; }
  .controles { width: 100%; gap: 8px; row-gap: 6px; }
  .controles button, .controles .bouton { padding: 8px 12px; }
  .rond { width: 40px; height: 40px; }
  .temps { min-width: 0; font-size: 12px; }
  /* une seule ligne d'export : la durée exportée est celle du média */
  .controles .fin { display: none; }
  .controles .qualite { font-size: 0; gap: 0; }
  .controles .qualite select { font-size: 14px; width: auto; }
  #exporter { flex: 1 1 auto; }
  .cadrage-outils input[type="range"] { width: 90px; }
  .etat { min-height: 0; font-size: 12px; }
  .etat:empty { display: none; }
  .relance { padding: 8px 10px; font-size: 12px; }
  .choix-langue { top: 12px; font-size: 16px; }

  .ligne { flex-wrap: wrap; }
  .panneau { border-right: none; padding: 0 16px calc(40px + env(safe-area-inset-bottom)); }
  .titre { padding-top: 14px; }
  .applis {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 8px;
    margin: 0 -16px;
    padding: 2px 16px 8px;
    scrollbar-width: none;
  }
  .applis::-webkit-scrollbar { display: none; }
  .appli { flex: 0 0 104px; scroll-snap-align: start; padding: 6px; gap: 6px; }
  .appli.paysage { flex-basis: 168px; }
  .appli strong { font-size: 12px; }
  .appli small { font-size: 10px; }

  /* Safari agrandit la page sur un champ de moins de 16 px */
  input[type="text"], input[type="number"], select, textarea { font-size: 16px; }
  .element input, .element select, .element textarea { font-size: 16px; }
  label.case { min-height: 32px; }
  input[type="checkbox"] { width: 20px; height: 20px; }
  .depot { padding: 20px 12px; }
}

/* Écran bas (téléphone à l'horizontale) : l'aperçu ne doit pas tout prendre */
@media (max-width: 860px) and (max-height: 500px) {
  .scene { position: static; }
  .cadre { height: 70vh; }
}

/* Lives : blocs « Votre scénario » et « Ambiance » (blocs.js) */
#scenarioTexte { font: 13px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; min-height: 120px; }
.aide.alerte { color: #ffb36b; }
details.sous-bloc { border-top: none; border: 1px solid var(--bord); border-radius: var(--rayon); padding: 6px 10px 4px; margin: 4px 0 8px; }
details.sous-bloc > summary { font-weight: 500; font-size: 13px; color: var(--doux); padding: 2px 0 6px; }
details.sous-bloc[open] > summary { color: var(--texte); }
.titre-curseur { display: flex; justify-content: space-between; margin: 4px 0 2px; font-size: 12px; color: var(--doux); }
.titre-curseur .niveau { color: var(--texte); font-weight: 650; }
.curseur-ambiance { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--doux); margin-bottom: 10px; }
.curseur-ambiance input { flex: 1; accent-color: var(--accent); }
@media (max-width: 860px) {
  #scenarioTexte { font-size: 16px; }
  .curseur-ambiance input { height: 28px; }
}

/* Chat vidéo : le bloc « Dialogue » remplace la saisie rapide de chaque vidéo */
.segment details.options > textarea, .segment details.options > button { display: none; }
#dialogueTexte { font: 13px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; min-height: 120px; }
@media (max-width: 860px) { #dialogueTexte { font-size: 16px; } }

/* Choix à l'export : avec filigrane (gratuit) ou sans (achat, clé) */
.choix-export {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.6);
}
.choix-export .carte {
  position: relative;
  box-sizing: border-box;
  max-height: calc(100vh - 24px);
  overflow-y: auto;
  width: min(420px, 100%);
  background: var(--panneau);
  border: 1px solid var(--bord);
  border-radius: 16px;
  padding: 20px 20px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.6);
}
.choix-export h3 { margin: 0; font-size: 18px; }
.choix-export .texte { margin: 0; color: var(--doux); font-size: 14px; }
.choix-export .aide { margin: 0; text-align: center; }
.choix-export button, .choix-export a.bouton { width: 100%; padding: 11px 14px; font-size: 15px; margin: 0; white-space: normal; line-height: 1.3; }
.choix-export a.bouton.principal { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 650; }
.choix-export a.bouton.secondaire { border-color: var(--accent); color: var(--texte); font-weight: 650; }
.choix-export .fermer { position: absolute; top: 8px; right: 8px; width: auto; font-size: 22px; padding: 4px 10px; }
.choix-export details.cle { border: none; padding: 0; }
.choix-export details.cle summary { font-weight: 500; font-size: 13px; color: var(--doux); }
.choix-export details.cle .ligne button { width: auto; }
@media (max-width: 860px) {
  .choix-export { place-items: end center; padding: 12px 12px calc(12px + env(safe-area-inset-bottom)); }
}

/* Chat vidéo : « Filmer ma réaction » mis en avant */
#omFilmer { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 650; }
#omFilmer:hover { filter: brightness(1.08); }
