/* Styles propres à POVs (perso) : publicité, premium, duels, synthèses des tests personnalisés.
   Le design commun est dans /commun/css/povs.css. */

/* ---------- Thème chaleureux (POVs perso) ----------
   Crème, brun doux et vert « capybara », coins arrondis, police arrondie si disponible.
   POVs Pro garde le thème sobre et bleu du design commun. */

:root {
  --hauteur-bandeau-pub: 72px;
  --fond: #fbf6ee;
  --surface: #ffffff;
  --surface-douce: #f4ecdf;
  --texte: #2e2519;
  --texte-secondaire: #6d5f4c;
  --texte-discret: #9a8b75;
  --bordure: rgba(46, 37, 25, 0.10);
  --bordure-forte: rgba(46, 37, 25, 0.22);
  --accent: #3d8b4f;
  --accent-texte: #2b6b3a;
  --accent-fond: #e4f2e2;
  --rayon: 14px;
  --rayon-carte: 20px;
}

body { font-family: ui-rounded, 'SF Pro Rounded', 'Nunito', 'Segoe UI', system-ui, sans-serif; }
h1, h2, h3 { font-weight: 700; }
.carte { box-shadow: 0 2px 0 rgba(46, 37, 25, 0.04); }
.entete { background: #fffdf8; }
.bouton-principal { box-shadow: 0 3px 0 #2b6b3a; }
.bouton-principal:active { transform: translateY(2px); box-shadow: 0 1px 0 #2b6b3a; }

/* Tuiles et curseur aux couleurs chaudes */
.grille-tuiles {
  --tuile-trait: #e4d5bc;
  --tuile-survol: #fbf3e6;
  --tuile-plus-fond: #dcefd8;
  --tuile-plus-signe: #3d8b4f;
  --tuile-moins-fond: #f5e4d6;
  --tuile-moins-signe: #a5683f;
  --tuile-signe: #b8a587;
}
.curseur { --curseur-plein: #8fca8e; --curseur-vide: #efe4d2; --curseur-bouton: #3d8b4f; }
.echelle .bouton.selectionne { background: var(--accent-fond); border-color: var(--accent); color: var(--accent-texte); }

/* ---------- Capi, la mascotte ---------- */

.mascotte { display: flex; align-items: flex-end; gap: 12px; margin: 0 0 1.25rem; }
.mascotte-image { width: 110px; height: auto; flex-shrink: 0; }
.mascotte-petite .mascotte-image { width: 105px; }
.mascotte-grande .mascotte-image { width: 160px; }
.bulle {
  position: relative; flex: 1; min-width: 0;
  background: #fff; border: 2px solid #e4d5bc; border-radius: 20px;
  padding: 12px 16px; margin-bottom: 18px; font-size: 1.02rem; line-height: 1.45;
}
.bulle::before, .bulle::after { content: ''; position: absolute; left: -12px; bottom: 14px; border-style: solid; }
.bulle::before { border-width: 9px 12px 9px 0; border-color: transparent #e4d5bc transparent transparent; left: -14px; }
.bulle::after { border-width: 7px 10px 7px 0; border-color: transparent #fff transparent transparent; bottom: 16px; left: -10px; }
.bulle p:last-child { margin-bottom: 0; }
.bulle-question { display: block; font-size: 1.15rem; line-height: 1.3; }
.bulle-consigne { display: block; font-size: 0.85rem; color: var(--texte-secondaire); margin-top: 4px; }
.mascotte-grande .bulle { font-size: 1.1rem; }
@media (max-width: 520px) {
  .mascotte-image { width: 88px; }
  .mascotte-petite .mascotte-image { width: 92px; }
  .mascotte-grande .mascotte-image { width: 96px; }
  .bulle { padding: 10px 12px; }
}

body.sans-publicite { padding-bottom: 24px; }
.bouton-premium { background: var(--premium-fond); border-color: var(--premium); color: var(--premium); }
.carte-premium { border: 2px solid var(--premium); background: var(--premium-fond); }
.etiquette-premium { background: var(--premium-fond); color: var(--premium); }
/* Duel : affiche « Hugues contre Julie » et mot de la question en grand. */
.affiche-duel { display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap; margin: 1rem 0 1.5rem; font-size: 1.6rem; font-weight: 700; color: var(--accent-texte); }
.affiche-duel .contre { font-size: 0.9rem; font-weight: 500; color: var(--texte-discret); text-transform: uppercase; letter-spacing: 0.1em; }
.intitule-duel { font-size: 2.2rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--accent-texte); }
.score-duel { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; text-align: center; }
.score-duel .nom { font-size: 1.2rem; font-weight: 600; overflow-wrap: anywhere; }
.score-duel .points { font-size: 3rem; font-weight: 700; color: var(--accent-texte); }
.score-duel .gagnant .points { color: var(--tuile-plus-signe, #2f5fc4); }
.barre-duel { display: flex; height: 14px; border-radius: 999px; overflow: hidden; background: #efe4d2; margin: 6px 0 2px; }
.barre-duel span:first-child { background: #8fca8e; }
.barre-duel span:last-child { background: #e0c4a2; }
.ligne-repartition { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 10px; align-items: start; padding: 8px 0; border-top: 1px dashed var(--bordure); }
.ligne-repartition.sans-vote { color: var(--texte-discret); }
@media (max-width: 520px) { .ligne-repartition { grid-template-columns: 1fr; gap: 4px; } }
.pastille-source { display: inline-flex; align-items: center; gap: 6px; font-size: 0.85rem; padding: 2px 10px 2px 8px; margin: 2px 4px 2px 0; border-radius: 999px; background: var(--surface-douce); }
.signe-plus, .signe-moins { display: inline-block; width: 1.2em; font-weight: 700; }
.signe-plus { color: var(--succes); }
.signe-moins { color: var(--danger); }
.mini-barres { display: flex; gap: 3px; align-items: flex-end; height: 28px; }
.mini-barres span { width: 9px; border-radius: 2px 2px 0 0; min-height: 2px; }
.barre-selection { position: sticky; bottom: calc(var(--hauteur-bandeau-pub) + 12px); background: var(--surface); border: 2px solid var(--accent); border-radius: var(--rayon-carte); padding: 12px 16px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 1rem; }
body.sans-publicite .barre-selection { bottom: 12px; }
.barre-selection input[type='text'] { flex: 1 1 200px; }
/* Sur téléphone : une seule ligne compacte ; le titre (facultatif) prend sa valeur par défaut. */
@media (max-width: 560px) {
  .barre-selection { flex-wrap: nowrap; justify-content: space-between; padding: 8px 12px; gap: 8px; }
  .barre-selection input[type='text'] { display: none; }
  .barre-selection .bouton { padding: 8px 14px; white-space: nowrap; }
  .barre-selection .message-erreur:empty { display: none; }
}
/* ---------- Bandeau publicitaire ---------- */

.bandeau-publicite {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  height: var(--hauteur-bandeau-pub);
  background: var(--surface); border-top: 1px solid var(--bordure);
  display: flex; align-items: center; justify-content: center; gap: 16px; padding: 0 16px;
  font-size: 0.9rem; color: var(--texte-secondaire);
}
.bandeau-publicite .mention { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--texte-discret); }
.bandeau-publicite ins { display: block; width: 100%; max-width: 728px; height: 64px; }
.bandeau-publicite .texte-ecran-etroit { display: none; }
@media (max-width: 640px) {
  .bandeau-publicite { gap: 10px; }
  .bandeau-publicite .texte-ecran-large { display: none; }
  .bandeau-publicite .texte-ecran-etroit { display: inline; }
}

.bandeau-consentement {
  position: fixed; left: 12px; right: 12px; bottom: calc(var(--hauteur-bandeau-pub) + 12px); z-index: 60;
  max-width: 560px; margin: 0 auto; padding: 16px 18px;
  background: var(--surface); border: 1px solid var(--bordure-forte); border-radius: var(--rayon-carte);
  box-shadow: 0 8px 24px rgba(23, 32, 51, 0.12); font-size: 0.92rem;
}
.bandeau-consentement .groupe-boutons .bouton { flex: 1; } /* même taille et même style pour Refuser et Accepter */

.bloc-statistiques { margin-top: 0.5rem; padding-top: 0.75rem; border-top: 1px dashed var(--bordure); }
.bloc-statistiques select { margin-bottom: 8px; }
.percentile { font-size: 0.85rem; color: var(--texte-secondaire); margin: -4px 0 10px; }
.mascotte-sans-image .bulle::before, .mascotte-sans-image .bulle::after { display: none; }

/* Grands écrans : Capi plus présent */
@media (min-width: 1100px) {
  .mascotte-image { width: 150px; }
  .mascotte-petite .mascotte-image { width: 130px; }
  .mascotte-grande .mascotte-image { width: 210px; }
}

/* ---------- Partage en story (image 1080 × 1920 générée par js/carte-story.js) ---------- */
.bloc-partage-story { display: flex; align-items: center; gap: 20px; border: 2px solid var(--accent); }
.bloc-partage-texte { flex: 1; min-width: 0; }
.bloc-partage-texte h2 { margin-top: 0; }
.apercu-story { width: 120px; aspect-ratio: 9 / 16; object-fit: cover; border-radius: 14px; box-shadow: 0 6px 18px rgba(46, 37, 25, 0.18); background: var(--surface-douce); flex-shrink: 0; }
.apercu-story:not([src]) { visibility: hidden; }
@media (max-width: 520px) {
  .apercu-story { width: 92px; }
  .bloc-partage-story { gap: 14px; }
}

/* ---------- FasTEST (versions flash) ---------- */
.carte-fastest { border: 2px solid #f0b429; background: #fffaf0; }
.etiquette-fastest { background: #fde9b8; color: #8a5a00; font-size: 0.72rem; vertical-align: middle; }

/* ---------- Invitations : choix du mode, envoi, QR code ---------- */
.choix-modes { display: grid; gap: 10px; }
.choix-mode { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border: 2px solid var(--bordure-forte); border-radius: var(--rayon); cursor: pointer; font-weight: 400; margin: 0; background: var(--surface); }
.choix-mode input { position: absolute; opacity: 0; pointer-events: none; }
.choix-mode.choisi { border-color: var(--accent); background: var(--accent-fond); }
.choix-mode-icone { font-size: 1.8rem; line-height: 1; }
.choix-mode strong { display: block; }
@media (min-width: 760px) { .choix-modes { grid-template-columns: repeat(3, 1fr); } .choix-mode { flex-direction: column; text-align: center; } }
.bouton-envoi-natif { width: 100%; font-size: 1.1rem; padding: 14px; margin-bottom: 12px; }
.qr-relais { display: flex; align-items: center; gap: 16px; margin-bottom: 12px; }
.qr-code { width: 150px; flex-shrink: 0; background: #fff; border-radius: 12px; padding: 6px; border: 1px solid var(--bordure); }
.qr-code svg { width: 100%; height: auto; display: block; }
.bandeau-anonyme { border: 2px solid var(--accent); background: var(--accent-fond); }
.bandeau-anonyme p { margin: 0 0 6px; }
.ligne-liste-bloc { border-bottom: 1px solid var(--bordure); }
.ligne-liste-bloc:last-child { border-bottom: 0; }
.ligne-liste-bloc .ligne-liste { border-bottom: 0; }
.moyenne-anonyme { padding: 4px 0 14px; }

/* ---------- Vue miroir « Mon POV vs Leurs POVs » ----------
   Une ligne par dimension : ma barre part du centre vers la gauche, la leur du centre vers la droite. */
.miroir { display: grid; gap: 14px; }
.miroir-entete, .miroir-ligne { display: grid; grid-template-columns: minmax(0, 1fr) clamp(88px, 26%, 160px) minmax(0, 1fr); align-items: center; gap: 8px; }
.miroir-entete { font-weight: 700; font-size: 0.9rem; color: var(--texte-secondaire); }
.miroir-entete span:first-child { text-align: right; }
.miroir-libelle { text-align: center; font-weight: 700; font-size: 0.92rem; line-height: 1.2; overflow-wrap: anywhere; }
.miroir-cote { display: flex; align-items: center; gap: 8px; min-width: 0; }
.miroir-gauche { flex-direction: row-reverse; }
.miroir-piste { flex: 1; height: 22px; background: var(--surface-douce); border-radius: 999px; display: flex; overflow: hidden; }
.miroir-gauche .miroir-piste { justify-content: flex-end; }
.miroir-barre { height: 100%; border-radius: 999px; }
.miroir-droite .miroir-barre { opacity: 0.6; }
.miroir-valeur { font-weight: 700; font-size: 0.9rem; min-width: 2ch; text-align: center; color: var(--texte-secondaire); }
.miroir-vide .miroir-valeur { flex: 1; }
.miroir-ecart { display: block; margin: 3px auto 0; width: fit-content; font-size: 0.72rem; font-weight: 700; padding: 1px 8px; border-radius: 999px; background: #fde9b8; color: #8a5a00; }
.miroir-accord { display: block; color: var(--accent); }
.miroir-mots .miroir-gauche { justify-content: flex-start; }
.mot-miroir { font-weight: 700; color: var(--accent-texte); overflow-wrap: anywhere; }
.miroir-mots .miroir-gauche .mot-miroir { text-align: right; width: 100%; }
.filtres-relation { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.pastille-filtre { border: 1.5px solid var(--bordure-forte); background: var(--surface); border-radius: 999px; padding: 6px 14px; font: inherit; font-size: 0.88rem; cursor: pointer; }
.pastille-filtre.active { border-color: var(--accent); background: var(--accent-fond); color: var(--accent-texte); font-weight: 700; }
.carte-povs-verrouilles { border: 2px dashed var(--premium); background: var(--premium-fond); }
.carte-povs-verrouilles p { margin: 0 0 8px; }
@media (max-width: 520px) {
  .miroir-piste { height: 16px; }
  .miroir-libelle { font-size: 0.82rem; }
}

/* Tuiles « Mes résultats » de Mon espace (une par test) */
.grille-mes-tests { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
.tuile-mon-test { display: block; text-decoration: none; color: inherit; margin: 0; transition: transform 0.12s, box-shadow 0.12s; }
.tuile-mon-test:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(46, 37, 25, 0.1); }
.tuile-mon-test h3 { margin: 6px 0 10px; }
.tuile-mon-test .etat-ligne { display: flex; justify-content: space-between; gap: 8px; font-size: 0.92rem; padding: 4px 0; }
.tuile-mon-test .bouton { margin-top: 10px; width: 100%; justify-content: center; }

/* Historique détaillé (repliable) et POVs verrouillés */
.historique-detaille > summary { cursor: pointer; list-style: none; display: flex; flex-direction: column; gap: 2px; padding: 12px 0; border-top: 1px solid var(--bordure); }
.historique-detaille > summary::-webkit-details-marker { display: none; }
.historique-detaille > summary h2 { margin: 0; }
.historique-detaille > summary h2::after { content: ' ▾'; color: var(--texte-discret); font-size: 0.8em; }
.historique-detaille[open] > summary h2::after { content: ' ▴'; }
.ligne-verrouillee { opacity: 0.85; }

/* ---------- Sauvegarde de l'espace par e-mail ---------- */
.bloc-sauvegarde { border: 2px solid var(--accent); background: var(--accent-fond); }
.bloc-sauvegarde h2 { margin-top: 0; }
.ligne-sauvegarde { display: flex; gap: 8px; flex-wrap: wrap; }
.ligne-sauvegarde input { flex: 1 1 200px; min-width: 0; }
.ligne-sauvegarde .bouton { flex: 0 0 auto; }
