/* Questions pour un champion — feuille de style
   (identité omnia amplecti : fond noir + or + serif) */
:root {
  --bg: #14110f;
  --bg2: #1b1714;
  --carte: #211c18;
  --carte2: #2a241f;
  --bordure: #392f27;
  --encre: #f4ede1;
  --texte: #e7ddcd;
  --muet: #a99c8b;
  --or: #c8a24e;
  --or-clair: #e7c878;
  --or-fonce: #e0bd6a;
  --ok: #3f7a45;        /* facile (1 pt) */
  --ambre: #c2722e;     /* difficile (3 pts) */
  --rouge: #b14a39;     /* très difficile (4 pts) */
  --rayon: 12px;
  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --sans: "Montserrat", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { background: var(--bg); }
.pied { order: 1; }  /* pied de page toujours en dernier (body en flex) */
body {
  margin: 0;
  font-family: var(--sans);
  background: radial-gradient(1200px 700px at 50% -15%, #2a221b, var(--bg)) fixed;
  color: var(--texte);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* En-tête / masthead */
.entete { width: 100%; max-width: 820px; padding: 1.3rem 0.9rem 0.2rem; text-align: left; }
.marque {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-family: var(--serif); font-style: normal; font-weight: 600;
  font-size: 1.25rem; color: var(--encre); text-decoration: none;
  padding: 0.15rem 0; transition: color 0.15s;
}
.marque:hover { color: var(--or-clair); }
.marque .embleme { color: var(--or-clair); font-style: normal; font-size: 1.5rem; line-height: 1; }

.entete h1 {
  margin: 0.7rem 0 0.1rem;
  font-family: var(--serif); font-weight: 700;
  font-size: 2.7rem; line-height: 1.04; letter-spacing: 0.01em;
  color: var(--encre);
}
.accroche {
  margin: 0.1rem 0 0.7rem; color: var(--muet);
  font-family: var(--serif); font-style: italic; font-size: 1.15rem;
}
.lien-aide {
  background: var(--carte); border: 1px solid var(--bordure); color: var(--texte);
  padding: 0.3rem 0.8rem; border-radius: 999px; cursor: pointer; font-size: 0.82rem;
}
.lien-aide:hover { color: var(--encre); border-color: var(--or); }
.filet {
  height: 2px; margin: 0.9rem 0 0.2rem;
  background: linear-gradient(90deg, transparent, var(--or) 18%, var(--or-clair) 50%, var(--or) 82%, transparent);
  opacity: 0.8;
}

main { width: 100%; max-width: 820px; padding: 0.6rem 0.9rem 2rem; }

/* Choix de la manche */
.mode-select { text-align: center; padding: 1.4rem 0.5rem; }
.mode-select h2 { font-family: var(--serif); color: var(--encre); margin: 0 0 1.2rem; font-size: 1.7rem; font-weight: 700; }
.modes { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }
.mode-carte {
  flex: 1 1 220px; max-width: 260px; text-align: left; cursor: pointer;
  background: var(--carte); border: 1px solid var(--bordure); border-radius: var(--rayon);
  padding: 1.1rem 1.2rem; color: var(--texte);
  display: flex; flex-direction: column; gap: 0.4rem;
  transition: border-color .15s, transform .15s, box-shadow .15s;
}
.mode-carte:hover { border-color: var(--or); transform: translateY(-2px); box-shadow: 0 8px 22px rgba(0, 0, 0, 0.4); }
.mode-titre { font-family: var(--serif); font-size: 1.25rem; font-weight: 700; color: var(--or-clair); }
.mode-desc { font-size: 0.9rem; color: var(--muet); }
.mode-note { color: var(--muet); font-size: 0.84rem; margin-top: 1.2rem; }

/* Barre de manche */
.mode-barre { text-align: center; color: var(--muet); font-size: 0.88rem; margin: 0.2rem 0 0.9rem; }
.mode-barre strong { color: var(--or-clair); }
.mode-barre a { color: var(--muet); text-decoration: underline; }
.mode-barre a:hover { color: var(--or-clair); }

/* Barre de contrôles */
.controles {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.7rem 1rem;
  background: var(--carte); border: 1px solid var(--bordure); border-radius: var(--rayon);
  padding: 1rem 1.1rem;
}
.controle-champ { display: flex; flex-direction: column; gap: 0.3rem; }
.controle-champ label { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muet); }
#taille {
  background: var(--bg2); border: 1px solid var(--bordure); color: var(--encre);
  border-radius: 8px; padding: 0.5rem 0.7rem; font-size: 0.95rem; font-family: var(--sans); cursor: pointer;
}
#taille:focus { outline: none; border-color: var(--or); }
.controles-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-left: auto; }

.bouton {
  display: inline-block; text-decoration: none; text-align: center;
  background: linear-gradient(180deg, var(--or-clair), var(--or));
  color: #2c2102; border: none; padding: 0.7rem 1.4rem; border-radius: 999px;
  font-size: 0.95rem; font-weight: 700; cursor: pointer;
}
.bouton:hover { filter: brightness(1.06); }
.bouton-secondaire {
  background: var(--carte2); border: 1px solid var(--bordure); color: var(--texte);
  padding: 0.55rem 0.9rem; border-radius: 999px; font-size: 0.85rem; cursor: pointer;
}
.bouton-secondaire:hover { border-color: var(--or); color: var(--encre); }
.bouton-secondaire[aria-pressed="true"] { background: var(--or); color: #2c2102; border-color: var(--or); font-weight: 700; }

/* Message flash */
.message {
  text-align: center; min-height: 1.2rem; color: var(--or-clair);
  font-size: 0.9rem; opacity: 0; transition: opacity 0.2s; margin: 0.5rem 0 0.2rem;
}
.message.visible { opacity: 1; }

/* Résumé du tirage */
.resume {
  display: flex; flex-wrap: wrap; gap: 0.4rem 1.1rem; justify-content: center;
  color: var(--muet); font-size: 0.86rem; margin: 0.3rem 0 1rem;
}
.resume strong { color: var(--or-clair); }
.resume .resume-graine { font-variant-numeric: tabular-nums; }

/* Sortie : listes de questions */
.sortie { margin-top: 0.3rem; }
.qpuc-liste { list-style: none; counter-reset: q; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.55rem; }
.qpuc-item {
  display: flex; gap: 0.8rem; align-items: flex-start;
  background: var(--carte); border: 1px solid var(--bordure); border-radius: 10px;
  padding: 0.8rem 0.9rem;
  animation: apparition 0.22s ease both;
}
.qpuc-num {
  flex: 0 0 auto; min-width: 1.9rem; height: 1.9rem; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--carte2); border: 1px solid var(--bordure);
  font-family: var(--serif); font-weight: 700; color: var(--or-clair); font-size: 0.95rem;
}
.qpuc-corps { flex: 1; min-width: 0; }
.qpuc-meta { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 0.35rem; align-items: center; }
.qpuc-q { margin: 0; font-size: 1.02rem; line-height: 1.4; color: var(--encre); }

.badge-dom {
  font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--or-fonce); background: var(--bg2); border: 1px solid var(--bordure);
  padding: 2px 8px; border-radius: 999px; white-space: nowrap;
}
.badge-pts {
  font-size: 0.72rem; font-weight: 700; color: #fff; white-space: nowrap;
  padding: 2px 8px; border-radius: 999px;
}
.pts-1 { background: var(--ok); }
.pts-2 { background: var(--or); color: #2c2102; }
.pts-3 { background: var(--ambre); }
.pts-4 { background: var(--rouge); }

/* Réponses (masquées par défaut, cliquables) */
.reponse {
  margin-top: 0.5rem; display: inline-flex; align-items: center; gap: 0.4rem;
  background: var(--bg2); border: 1px dashed var(--bordure); color: var(--muet);
  border-radius: 8px; padding: 0.35rem 0.7rem; font-size: 0.9rem; cursor: pointer;
  font-family: var(--sans); text-align: left;
}
.reponse:hover { border-color: var(--or); color: var(--texte); }
.reponse .reponse-texte { display: none; color: var(--or-clair); font-weight: 600; }
.reponse .reponse-cache::before { content: "👁 "; }
.reponse.ouverte, .reponses-visibles .reponse {
  border-style: solid; border-color: var(--ok); background: rgba(63, 122, 69, 0.12); cursor: default;
}
.reponse.ouverte .reponse-cache, .reponses-visibles .reponse .reponse-cache { display: none; }
.reponse.ouverte .reponse-texte, .reponses-visibles .reponse .reponse-texte { display: inline; }

/* 4 à la suite : blocs de thèmes */
.qpuc-theme { margin-bottom: 1.3rem; }
.qpuc-theme-titre {
  font-family: var(--serif); color: var(--or-clair); font-size: 1.4rem; font-weight: 700;
  margin: 0 0 0.2rem; display: flex; align-items: baseline; gap: 0.6rem; flex-wrap: wrap;
}
.qpuc-theme-titre .theme-num { color: var(--muet); font-size: 0.95rem; font-style: italic; }
.qpuc-theme-sous { color: var(--muet); font-size: 0.82rem; margin: 0 0 0.6rem; }

/* Face-à-face : énigmes */
.qpuc-enigme .qpuc-q { font-size: 1.05rem; line-height: 1.5; }
.qpuc-enigme .qpuc-q .je-suis { color: var(--or-clair); font-weight: 700; font-style: italic; }

@keyframes apparition { from { transform: translateY(-3px); opacity: 0; } to { transform: none; opacity: 1; } }

/* Aide (dialog) */
dialog#aide {
  max-width: 540px; border: 1px solid var(--or); border-radius: var(--rayon);
  background: var(--carte); color: var(--texte); padding: 1.4rem;
}
dialog#aide::backdrop { background: rgba(0, 0, 0, 0.6); }
dialog#aide h2 { font-family: var(--serif); margin-top: 0; color: var(--or-clair); }
dialog#aide ul { padding-left: 1.1rem; }
dialog#aide li { margin: 0.5rem 0; }

.pied { color: var(--muet); font-size: 0.85rem; padding: 1rem 0 2rem; font-family: var(--serif); font-style: italic; }

/* Responsive */
@media (max-width: 620px) {
  .entete h1 { font-size: 2.1rem; }
  .controles-actions { margin-left: 0; width: 100%; }
  .controle-champ { flex: 1 1 100%; }
  #taille { width: 100%; }
}

/* Impression : fiche animateur lisible, réponses visibles */
@media print {
  body { background: #fff; color: #111; display: block; }
  .entete, .filet, .accroche, .lien-aide, .marque, .mode-select,
  .mode-barre, .controles, .message, .pied, dialog { display: none !important; }
  main { max-width: none; padding: 0; }
  .entete h1 { color: #111; }
  .qpuc-item { border: 1px solid #ccc; break-inside: avoid; page-break-inside: avoid; }
  .qpuc-num { color: #111; border-color: #999; background: #f2f2f2; }
  .qpuc-q { color: #111; }
  .badge-dom { color: #333; border-color: #bbb; background: #f2f2f2; }
  .qpuc-theme-titre, .qpuc-theme-titre .theme-num, .qpuc-enigme .qpuc-q .je-suis { color: #111; }
  .resume { color: #333; }
  .resume strong { color: #111; }
  .reponse {
    border: none !important; background: none !important; padding: 0.3rem 0; cursor: default;
    color: #111 !important; display: block; margin-top: 0.4rem;
  }
  .reponse .reponse-cache { display: none !important; }
  .reponse .reponse-texte { display: inline !important; color: #0a6b1e !important; font-weight: 700; }
  .reponse .reponse-texte::before { content: "Réponse : "; color: #555; font-weight: 400; }
}
