/* ============================================
   DUAL EMPIRES - Styles de la page Règles
   ============================================ */

/* Override du body pour avoir un scroll et un fond élégant */
body {
  overflow-y: auto;
  align-items: flex-start;
  padding: 2rem 0;
  background: linear-gradient(135deg, #0f1419 0%, #1a2332 50%, #2c1810 100%);
}

/* Suppression de l'animation de fond colorée */
body::before {
  display: none;
}

/* Container de la page */
.page-container {
  max-width: 1100px;
  width: 95%;
  margin: 0 auto;
  position: relative;
  z-index: 10;
}

/* En-tête de la page */
/* Accès au tutoriel interactif, sous l'en-tête */
.regles-tutoriel {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.6rem 1rem;
  margin: -1rem 0 1.6rem;
  color: #e8d4b0;
  font-size: 1rem;
}

.btn-regles-tutoriel {
  padding: 0.55rem 1.1rem;
  font-weight: 700;
  color: #0f1419;
  text-decoration: none;
  background: linear-gradient(135deg, #67e8f9 0%, #a5f3fc 100%);
  border-radius: 8px;
}

.btn-regles-tutoriel:hover {
  box-shadow: 0 0 16px rgba(103, 232, 249, 0.5);
}

/* Académie (lot A5) : accès distinct du tutoriel, accent or */
.btn-regles-academie {
  background: linear-gradient(135deg, #d4a574 0%, #fcd34d 100%);
}

.btn-regles-academie:hover {
  box-shadow: 0 0 16px rgba(252, 211, 77, 0.5);
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid #d4a574;
}

.btn-retour {
  padding: 0.6rem 1.2rem;
  font-size: 0.95rem;
  color: #f5e6c8;
  background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
  border: 1px solid #d4a574;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: inherit;
}

.btn-retour:hover {
  background: linear-gradient(135deg, #8b6f47 0%, #d4a574 100%);
  box-shadow: 0 0 20px rgba(212, 165, 116, 0.4);
}

.page-title {
  font-size: 2rem;
  color: #d4a574;
  text-shadow: 0 0 20px rgba(212, 165, 116, 0.4);
}

/* Sections des règles */
.regles-content {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.regle-section {
  background: linear-gradient(
    135deg,
    rgba(30, 41, 59, 0.7) 0%,
    rgba(51, 65, 85, 0.5) 100%
  );
  border: 1px solid rgba(212, 165, 116, 0.4);
  border-radius: 10px;
  padding: 1.5rem 2rem;
  transition: all 0.3s ease;
}

.regle-section:hover {
  border-color: rgba(212, 165, 116, 0.8);
  box-shadow: 0 0 20px rgba(212, 165, 116, 0.2);
}

/* TITRES CENTRÉS avec ligne de séparation */
.regle-section h2 {
  color: #d4a574;
  margin-bottom: 1.2rem;
  font-size: 1.6rem;
  letter-spacing: 0.05em;
  text-align: center;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid rgba(212, 165, 116, 0.3);
}

.regle-section p {
  color: #e8d4b0;
  line-height: 1.7;
  margin-bottom: 0.8rem;
}

.regle-section strong {
  color: #f5e6c8;
  font-weight: 600;
}

.regle-section ul,
.regle-section ol {
  margin-left: 2rem;
  color: #e8d4b0;
  line-height: 1.8;
  margin-bottom: 0.8rem;
}

.regle-section li {
  margin-bottom: 0.4rem;
}

/* Texte centré */
.text-center {
  text-align: center;
}

/* Texte couleur OR pour Héros légendaire */
.text-or {
  color: #ffd700 !important;
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.4);
}

/* Restrictions en rouge */
.restrictions {
  color: #ef4444 !important;
  text-shadow: 0 0 10px rgba(239, 68, 68, 0.3);
}

/* Texte info en vert */
.info-text {
  color: #4ade80 !important;
  text-align: center;
  font-style: italic;
  margin-top: 1rem;
  padding: 0.8rem;
  background: rgba(74, 222, 128, 0.05);
  border-radius: 6px;
  border: 1px solid rgba(74, 222, 128, 0.2);
}

/* Layout en deux colonnes séparées par une ligne */
.two-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  align-items: stretch;
  position: relative;
}

.two-columns::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgba(212, 165, 116, 0.3);
  transform: translateX(-50%);
}

.two-columns .column {
  padding: 0 0.5rem;
}

/* Colonnes centrées (construction du deck) */
.two-columns .column-centered {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.two-columns .column-centered p {
  text-align: center;
}

/* Liste centrée (sans puces, alignée au milieu) */
.centered-list {
  list-style: none;
  margin-left: 0 !important;
  padding-left: 0;
  text-align: center;
}

.centered-list li {
  margin-bottom: 0.5rem;
}

/* Conditions de victoire avec décalage */
.two-columns .column-left {
  padding-right: 1.5rem;
  text-align: left;
}

.two-columns .column-right-shifted {
  padding-left: 3rem;
  text-align: left;
}

/* Grille des cartes de statistiques */
.stats-grid-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1rem;
}

.stat-card {
  background: linear-gradient(
    135deg,
    var(--stat-tint) 0%,
    rgba(30, 41, 59, 0.5) 100%
  );
  border: 1px solid rgba(212, 165, 116, 0.2);
  border-left: 5px solid var(--stat-color);
  border-radius: 8px;
  padding: 1.1rem 1.3rem;
  transition: all 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
  border-color: var(--stat-color);
}

.stat-card-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.6rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(212, 165, 116, 0.2);
}

.stat-card-icon {
  font-size: 1.5rem;
}

.stat-card-name {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--stat-color);
}

.stat-card-def {
  font-size: 1rem;
  color: #f5e6c8;
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.stat-card-detail {
  font-size: 0.9rem;
  color: #e8d4b0;
  line-height: 1.5;
}

/* Grille des civilisations détaillées */
.civs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.civ-card {
  background: linear-gradient(
    135deg,
    var(--civ-tint) 0%,
    rgba(30, 41, 59, 0.5) 100%
  );
  border: 1px solid rgba(212, 165, 116, 0.2);
  border-left: 5px solid var(--civ-color);
  border-radius: 8px;
  padding: 1rem 1.2rem;
  transition: all 0.3s ease;
}

.civ-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
  border-color: var(--civ-color);
}

.civ-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.7rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(212, 165, 116, 0.2);
}

.civ-card-name {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--civ-color);
}

.civ-card-resource {
  font-size: 0.95rem;
  color: #e8d4b0;
}

.civ-trait {
  font-size: 0.92rem;
  padding: 0.35rem 0.6rem;
  margin-bottom: 0.35rem;
  border-radius: 4px;
  line-height: 1.4;
}

.trait-force {
  color: #4ade80;
  background: rgba(74, 222, 128, 0.08);
}

.trait-faiblesse {
  color: #f87171;
  background: rgba(248, 113, 113, 0.08);
}

.trait-style {
  color: #93c5fd;
  background: rgba(147, 197, 253, 0.08);
}

/* Grille des phases du tour */
.phases-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.phase-card {
  background: linear-gradient(
    135deg,
    rgba(30, 41, 59, 0.6) 0%,
    rgba(51, 65, 85, 0.4) 100%
  );
  border: 1px solid rgba(212, 165, 116, 0.3);
  border-left: 4px solid #d4a574;
  border-radius: 8px;
  padding: 1.1rem 1.3rem;
  transition: all 0.3s ease;
}

.phase-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
  border-color: rgba(212, 165, 116, 0.7);
  border-left-color: #d4a574;
}

.phase-tag {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #d4a574;
  background: rgba(212, 165, 116, 0.15);
  padding: 0.35rem 0.9rem;
  border-radius: 20px;
  margin-bottom: 0.6rem;
}

.phase-name {
  font-size: 1.2rem;
  font-weight: 700;
  color: #f5e6c8;
  margin-bottom: 0.3rem;
}

.phase-desc {
  font-size: 0.95rem;
  color: #e8d4b0;
  line-height: 1.4;
}

/* Footer de la page */
.page-footer {
  margin-top: 3rem;
  text-align: center;
  padding: 1rem;
  color: #8b6f47;
  font-size: 0.9rem;
  letter-spacing: 0.2em;
}

/* ============================================
   Lot F1 : page Règles actualisée
   (sommaire, sous-titres, tableaux, exemples,
   glossaire, adaptation mobile)
   ============================================ */

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

/* Les ancres ne collent pas au bord haut de l'écran */
.regle-section,
.page-container {
  scroll-margin-top: 1rem;
}

/* Sommaire */
.regles-sommaire {
  margin-bottom: 1.5rem;
  padding: 1.2rem 1.6rem;
  background: rgba(15, 20, 25, 0.75);
  border: 1px solid rgba(212, 165, 116, 0.4);
  border-radius: 10px;
}

.regles-sommaire h2 {
  margin-bottom: 0.8rem;
  font-size: 1.25rem;
  color: #d4a574;
  text-align: center;
  letter-spacing: 0.05em;
}

.sommaire-liste {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.3rem 1.5rem;
  margin: 0;
  padding-left: 1.6rem;
  color: #d4a574;
}

.sommaire-liste li {
  line-height: 1.5;
}

.sommaire-liste a,
.lien-interne,
.regles-haut a {
  color: #f5e6c8;
  text-decoration: underline;
  text-decoration-color: rgba(212, 165, 116, 0.5);
  text-underline-offset: 3px;
}

.sommaire-liste a:hover,
.sommaire-liste a:focus-visible,
.lien-interne:hover,
.lien-interne:focus-visible,
.regles-haut a:hover,
.regles-haut a:focus-visible {
  color: #fcd34d;
  text-decoration-color: #fcd34d;
}

/* Sous-titres des sections */
.regle-section h3 {
  margin: 1.4rem 0 0.7rem;
  font-size: 1.15rem;
  color: #fcd34d;
  letter-spacing: 0.03em;
}

/* Note et encadré d'exemple */
.regle-note {
  margin-top: 1rem;
  padding: 0.7rem 1rem;
  font-size: 0.95rem;
  background: rgba(147, 197, 253, 0.07);
  border-left: 3px solid #93c5fd;
  border-radius: 6px;
}

.regle-exemple {
  margin: 1.2rem 0;
  padding: 1rem 1.2rem;
  background: rgba(212, 165, 116, 0.08);
  border: 1px dashed rgba(212, 165, 116, 0.55);
  border-radius: 8px;
}

.regle-exemple .exemple-titre {
  margin-bottom: 0.5rem;
  font-weight: 700;
  color: #fcd34d;
}

.regle-exemple ul,
.regle-exemple ol {
  margin-left: 1.4rem;
  margin-bottom: 0;
}

.liste-precisions {
  margin-top: 1.2rem;
}

/* Étape obligatoire du tour */
.phase-card.phase-obligatoire-carte {
  border-left-color: #fcd34d;
  box-shadow: inset 0 0 0 1px rgba(252, 211, 77, 0.35);
}

.phase-tag.tag-obligatoire {
  color: #0f1419;
  background: linear-gradient(135deg, #d4a574 0%, #fcd34d 100%);
}

/* Tableaux */
.regles-tableau-defilant {
  margin: 1rem 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.regles-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  color: #e8d4b0;
}

.regles-table caption {
  margin-bottom: 0.5rem;
  font-weight: 700;
  color: #d4a574;
  text-align: left;
}

.regles-table th,
.regles-table td {
  padding: 0.55rem 0.7rem;
  text-align: left;
  vertical-align: top;
  line-height: 1.45;
  border-bottom: 1px solid rgba(212, 165, 116, 0.2);
}

.regles-table thead th {
  color: #f5e6c8;
  background: rgba(212, 165, 116, 0.15);
}

.regles-table tbody th {
  color: #f5e6c8;
  font-weight: 600;
}

.regles-table tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.03);
}

/* Exemple visuel des colonnes */
.exemple-colonnes {
  max-width: 560px;
  margin: 0.8rem auto 1rem;
}

.exemple-rangee-titre {
  margin: 0.5rem 0 0.25rem;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #d4a574;
}

.exemple-rangee,
.exemple-numeros {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.4rem;
}

.exemple-rangee .case {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 2.6rem;
  padding: 0.2rem;
  font-size: 0.8rem;
  line-height: 1.2;
  text-align: center;
  border-radius: 6px;
  overflow-wrap: anywhere;
}

.case.vide {
  border: 1px dashed rgba(212, 165, 116, 0.3);
}

.case.batiment {
  color: #fcd34d;
  background: rgba(252, 211, 77, 0.12);
  border: 1px solid rgba(252, 211, 77, 0.5);
}

.case.ennemi {
  color: #fca5a5;
  background: rgba(248, 113, 113, 0.12);
  border: 1px solid rgba(248, 113, 113, 0.5);
}

.case.allie {
  color: #86efac;
  background: rgba(74, 222, 128, 0.12);
  border: 1px solid rgba(74, 222, 128, 0.5);
}

.exemple-numeros {
  margin-top: 0.3rem;
  font-size: 0.8rem;
  text-align: center;
  color: #d4a574;
}

/* Glossaire des capacités */
.regles-glossaire {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem 1.2rem;
}

.regles-glossaire > div {
  padding: 0.8rem 1rem;
  background: rgba(15, 20, 25, 0.35);
  border: 1px solid rgba(212, 165, 116, 0.25);
  border-radius: 8px;
}

.regles-glossaire dt {
  margin-bottom: 0.3rem;
  font-weight: 700;
  color: #f5e6c8;
}

.regles-glossaire dd {
  margin: 0;
  color: #e8d4b0;
  line-height: 1.55;
}

/* Section « Tutoriel rapide et Académie » */
.btn-regles-apprendre {
  display: inline-block;
  margin-top: auto;
  padding: 0.55rem 1.1rem;
  font-weight: 700;
  color: #0f1419;
  text-decoration: none;
  background: linear-gradient(135deg, #67e8f9 0%, #a5f3fc 100%);
  border-radius: 8px;
}

.btn-regles-apprendre-academie {
  background: linear-gradient(135deg, #d4a574 0%, #fcd34d 100%);
}

.btn-regles-apprendre:hover,
.btn-regles-apprendre:focus-visible {
  box-shadow: 0 0 16px rgba(252, 211, 77, 0.45);
}

.regles-haut {
  margin-top: 1.5rem;
  text-align: center;
}

/* Tablette */
@media (max-width: 900px) {
  .sommaire-liste {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Mobile */
@media (max-width: 700px) {
  body {
    padding: 1rem 0;
  }

  /* Largeur explicite : le body (style.css) est un conteneur flex centré,
     une largeur automatique suivrait le contenu le plus large. */
  .page-container {
    width: calc(100% - 32px);
    min-width: 0;
    margin: 0 16px;
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.8rem;
  }

  .page-title {
    font-size: 1.6rem;
  }

  .regles-tutoriel {
    margin-top: 0;
  }

  .regles-sommaire {
    padding: 1rem;
  }

  .regle-section {
    padding: 1.1rem 1rem;
  }

  .regle-section h2 {
    font-size: 1.3rem;
  }

  .regle-section ul,
  .regle-section ol {
    margin-left: 1.2rem;
  }

  .sommaire-liste,
  .two-columns,
  .phases-grid,
  .regles-glossaire {
    grid-template-columns: 1fr;
  }

  .two-columns::after {
    display: none;
  }

  .civs-grid,
  .stats-grid-cards {
    grid-template-columns: 1fr;
  }

  .regles-table {
    min-width: 480px;
    font-size: 0.88rem;
  }

  .exemple-rangee .case {
    min-height: 2.4rem;
    font-size: 0.7rem;
  }
}

/* Petits écrans : noms entiers dans les cases de l'exemple */
@media (max-width: 420px) {
  .exemple-rangee {
    gap: 0.25rem;
  }

  .exemple-rangee .case {
    padding: 0.15rem 0.05rem;
    font-size: 0.6rem;
    overflow-wrap: normal;
    hyphens: auto;
  }
}
