/* regles — refonte Séance de minuit */
/* ════════════════════════════════════════════════════════════════
   RÈGLES — le grimoire de minuit.
   Chaque .rules-section est un chapitre numéroté : gros chiffre
   creux dans le coin, filet vertical sanglant à gauche, panneaux
   nets sans le moindre arrondi. theme.css est chargé APRÈS ce
   fichier : les sélecteurs sont scopés (.section .rules-section,
   .rules-grid .rule-card) pour primer sur .reveal sans casser
   l'apparition au scroll.
   ════════════════════════════════════════════════════════════════ */

/* ── Compteur de chapitres ── */
.section {
  counter-reset: chapitre;
}

/* ── Chapitre = panneau de grimoire ── */
.section .rules-section {
  counter-increment: chapitre;
  position: relative;
  background: var(--panel);
  border: 1px solid var(--hairline);
  padding: clamp(1.8rem, 4vw, 3rem) clamp(1.4rem, 4vw, 3.2rem);
  margin-bottom: 2.5rem;
  overflow: hidden;
  transition:
    opacity 0.8s ease,
    filter 0.8s ease,
    transform 0.6s cubic-bezier(0.22, 1, 0.36, 1),
    border-color 0.4s ease,
    box-shadow 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Filet rouge vertical, comme une tranche de reliure */
.section .rules-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, var(--crimson), rgba(193, 18, 31, 0.06) 90%);
  pointer-events: none;
}

/* Filet de sang en bas, révélé au survol */
.section .rules-section::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--crimson), transparent 70%);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
}

.section .rules-section:hover {
  border-color: var(--line);
  transform: translateY(-5px);
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.55);
}

.section .rules-section:hover::after {
  transform: scaleX(1);
}

/* ── Titre de chapitre ── */
.rules-section h2 {
  position: relative;
  z-index: 1;
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 2.6vw, 1.8rem);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text);
  margin-bottom: 1.5rem;
  padding-right: clamp(4rem, 10vw, 8rem); /* place pour le chiffre */
}

/* Kicker « Chapitre NN » au-dessus du titre */
.rules-section h2::before {
  content: 'Chapitre ' counter(chapitre, decimal-leading-zero);
  display: block;
  font-family: var(--font-ui);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3em;
  color: var(--crimson);
  margin-bottom: 0.7rem;
}

/* Gros chiffre creux dans le coin, qui s'emplit de sang au survol */
.rules-section h2::after {
  content: counter(chapitre, decimal-leading-zero);
  position: absolute;
  top: -1.2rem;
  right: 0.4rem;
  z-index: -1;
  font-family: var(--font-display);
  font-size: clamp(3.6rem, 8vw, 6.5rem);
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0;
  color: transparent;
  -webkit-text-stroke: 1px rgba(237, 230, 216, 0.5);
  transition: color 0.5s cubic-bezier(0.22, 1, 0.36, 1),
              -webkit-text-stroke-color 0.5s ease,
              text-shadow 0.5s ease;
  pointer-events: none;
}

.section .rules-section:hover h2::after {
  color: var(--crimson);
  -webkit-text-stroke-color: transparent;
  text-shadow: 0 0 40px rgba(193, 18, 31, 0.45);
}

/* ── Sous-titres (termes spéciaux, cas d'égalité…) ── */
.rules-section h3 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text);
  margin: 2rem 0 0.7rem;
  padding-left: 0.9rem;
  border-left: 2px solid var(--crimson);
}

/* ── Texte courant ── */
.rules-section p {
  color: var(--text-dim);
  margin-bottom: 1rem;
  max-width: 75ch;
}

.rules-section strong {
  color: var(--text);
  font-weight: 700;
}

/* ── Listes à puces : tirets sanglants ── */
.rules-section ul {
  list-style: none;
  margin: 0.5rem 0 1.3rem;
}

.rules-section ul li {
  position: relative;
  padding-left: 1.6rem;
  margin-bottom: 0.55rem;
  color: var(--text-dim);
}

.rules-section ul li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.78em;
  width: 9px;
  height: 1px;
  background: var(--crimson);
}

/* ── Listes ordonnées : numérotation rituelle ── */
.rules-section ol {
  list-style: none;
  counter-reset: etape;
  margin: 0.5rem 0 1.3rem;
}

.rules-section ol li {
  counter-increment: etape;
  position: relative;
  padding-left: 2.5rem;
  margin-bottom: 0.6rem;
  color: var(--text-dim);
}

.rules-section ol li::before {
  content: counter(etape, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 0.3em;
  font-family: var(--font-ui);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--crimson);
}

/* ── Encadré clé (objectif, victoire) ── */
.rules-section .highlight-box {
  background: rgba(193, 18, 31, 0.06);
  border: 1px solid rgba(193, 18, 31, 0.3);
  border-left: 3px solid var(--crimson);
  padding: 1.1rem 1.4rem;
  margin: 1.4rem 0;
  color: var(--text);
  line-height: 1.7;
}

.rules-section .highlight-box strong {
  font-family: var(--font-ui);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--crimson-bright);
  margin-right: 0.4rem;
}

/* ── Grille des composantes du deck ── */
.rules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(230px, 100%), 1fr));
  gap: 1.2rem;
  margin-top: 1.6rem;
}

.rules-grid .rule-card {
  position: relative;
  background: #0a0a0a;
  border: 1px solid var(--hairline);
  padding: 1.7rem 1.5rem 1.5rem;
  overflow: hidden;
  transition:
    opacity 0.8s ease,
    filter 0.8s ease,
    transform 0.6s cubic-bezier(0.22, 1, 0.36, 1),
    border-color 0.4s ease,
    box-shadow 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.rules-grid .rule-card::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--crimson), transparent 70%);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
}

.rules-grid .rule-card:hover {
  border-color: var(--line);
  transform: translateY(-5px);
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.55);
}

.rules-grid .rule-card:hover::after {
  transform: scaleX(1);
}

.rule-card .rule-card-icon {
  font-family: var(--font-display);
  font-size: 1.9rem;
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1px rgba(237, 230, 216, 0.5);
  margin-bottom: 1rem;
  transition: color 0.5s cubic-bezier(0.22, 1, 0.36, 1),
              -webkit-text-stroke-color 0.5s ease;
}

.rules-grid .rule-card:hover .rule-card-icon {
  color: var(--crimson);
  -webkit-text-stroke-color: transparent;
}

.rule-card h4 {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text);
  margin-bottom: 0.55rem;
  line-height: 1.4;
}

.rule-card p {
  color: var(--text-dim);
  font-size: 0.92rem;
  margin-bottom: 0;
  line-height: 1.65;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .section .rules-section {
    padding: 1.6rem 1.2rem;
    margin-bottom: 1.8rem;
  }

  .rules-section h2 {
    padding-right: 3.4rem;
  }

  .rules-section h2::after {
    top: -0.6rem;
    right: 0.2rem;
    font-size: 2.8rem;
  }

  .rules-section ol li {
    padding-left: 2rem;
  }

  /* neutralise les indentations inline sur petit écran */
  .rules-section p[style],
  .rules-section ol[style] {
    margin-left: 0.8rem !important;
  }
}
