/* Test de personnalité : un carnet à remplir, un profil, une note, l'effet Barnum.
   Boutons, champs et fenêtre viennent de /games/_shared/css/party.css ; le reste de /_shared/css/mval.css. */

:root { --accent: var(--cinabre); --accent-dark: #a93224; }

.test { display: grid; max-width: 34rem; }
.test section { display: grid; gap: 1.2rem; }
.test-title { font-size: 1.5rem; }
.test-title:focus { outline: none; }

/* La consigne de l'étape en cours, au-dessus du carnet */
.step-box { gap: 0.3rem; border-color: var(--accent); box-shadow: 4px 4px 0 var(--accent); }
.step-kicker { margin: 0; font-family: var(--data); font-size: 0.85rem; color: var(--soft); }
.step-text { margin: 0; font-weight: 700; font-size: 1.1rem; line-height: 1.4; }

/* Le carnet : des lignes numérotées, comme sur une page à spirale */
.notebook { display: grid; gap: 1.2rem; }
.lines {
  margin: 0;
  padding: 0.6rem 1rem 0.8rem;
  list-style: none;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: 4px 4px 0 var(--ink);
}
.line { display: flex; align-items: center; gap: 0.8rem; padding: 0.25rem 0; }
.line .text-input { flex: 1; min-width: 0; }
.line .text-input:disabled { border-bottom-style: dashed; border-bottom-color: var(--rule); background: transparent; }
.line-num {
  flex: none;
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border: 2px solid var(--ink);
  border-radius: 50%;
  font-family: var(--data);
  font-weight: 700;
  font-size: 0.9rem;
  background: var(--paper);
}
/* Les lignes de l'étape en cours : surlignées, numéro à l'encre */
.line { margin: 0 -0.5rem; padding: 0.25rem 0.5rem; border-radius: 6px; }
.line.is-current { background: #c23b2a14; }
.line.is-current .line-num { background: var(--accent); color: #ffffff; }
.line.is-current .text-input { border-bottom-color: var(--accent); }
/* Lignes déjà remplies d'une étape passée : lisibles, plus modifiables */
.line .text-input:disabled { color: var(--ink); -webkit-text-fill-color: var(--ink); opacity: 1; }
/* Tant que l'étape n'est pas remplie, le bouton reste visible mais en retrait (il explique ce qui manque) */
.btn.is-waiting { opacity: 0.55; }

/* Le profil */
.profile { display: grid; gap: 0.7rem; margin: 0; padding: 0; list-style: none; }
.trait {
  display: flex;
  gap: 0.8rem;
  align-items: flex-start;
  padding: 0.8rem 0.9rem;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 8px;
  box-shadow: 3px 3px 0 var(--ink);
}
.trait p { margin: 0.2rem 0 0; line-height: 1.45; }
.trait strong { color: var(--accent); overflow-wrap: anywhere; }

/* La note de précision : six boutons de 0 à 5 */
.rating { margin: 0.6rem 0 0; min-width: 0; }
.rating legend { float: left; width: 100%; padding: 0; font-family: var(--title); font-weight: 800; font-size: 1.15rem; }
.rating-help { margin: 0; color: var(--soft); font-size: 0.9rem; }
.rating-scale { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0.5rem; width: 100%; }
.rate {
  min-height: 3rem;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: var(--paper);
  font-family: var(--data);
  font-weight: 700;
  font-size: 1.2rem;
  box-shadow: 2px 2px 0 var(--ink);
}
.rate:hover { background: var(--hover); }
.rate[aria-pressed="true"] { background: var(--accent); color: #ffffff; }

/* Le chargement de l'« analyse » */
.loading-panel { gap: 1rem; }
.loading .progress { text-align: left; }
.loading-text { margin: 0; min-height: 1.5em; font-weight: 700; font-size: 1.1rem; }

/* Le texte de l'analyse */
.analysis { gap: 0.8rem; }
.analysis p { margin: 0; line-height: 1.6; }

/* L'effet Barnum */
.barnum { margin-top: 2.5rem; padding-top: 2rem; border-top: 1.5px solid var(--rule); }
.barnum p { margin: 0; line-height: 1.55; }
.barnum-lead { font-weight: 700; font-size: 1.1rem; }
.source { font-size: 0.85rem; color: var(--soft); }
.source a { color: inherit; }

/* La consigne, en fenêtre par-dessus la page */
.overlay.is-fixed { position: fixed; z-index: 20; }
.intro-text { display: grid; gap: 0.6rem; text-align: left; }
.step-dialog-text { margin: 0.2rem 0 0.4rem; font-family: var(--title); font-weight: 800; font-size: 1.45rem; line-height: 1.25; }
.intro-text p { margin: 0; }
body.has-dialog { overflow: hidden; }
