/* ===== Palette parchemin / 7ème Mer ===== */
:root {
  --bg: #f5efe0;
  --bg-card: #fffbf0;
  --bg-elevated: #fffefb;
  --ink: #2c1810;
  --ink-soft: #5c4838;
  --ink-mute: #877766;
  --accent: #8b3a3a;
  --accent-soft: #c97070;
  --border: #d4c4a0;
  --border-soft: #e8dcc0;
  --shadow: 0 2px 6px rgba(60, 30, 10, 0.08);
  --shadow-lg: 0 8px 28px rgba(60, 30, 10, 0.18);
  --radius: 6px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: Georgia, "Iowan Old Style", "Palatino Linotype", serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
}

h1, h2, h3, h4 { font-weight: 600; line-height: 1.2; margin: 0 0 0.5em; }
p { margin: 0 0 0.6em; }

/* ===== Topbar ===== */
.topbar {
  background: linear-gradient(180deg, #2c1810 0%, #3a2418 100%);
  color: #f5efe0;
  border-bottom: 3px solid var(--accent);
  padding: 1rem 1.25rem;
}
.topbar-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.topbar-titlelink {
  text-decoration: none;
  color: inherit;
  display: block;
}
.topbar-titlelink:hover h1 { color: #f0d8a0; }
.topbar h1 {
  font-size: 1.6rem;
  letter-spacing: 0.02em;
  margin: 0;
  transition: color 0.12s;
}
.topbar .subtitle {
  margin: 0.2rem 0 0;
  color: #d4c4a0;
  font-size: 0.9rem;
  font-style: italic;
}

/* Bouton hamburger pour le menu mobile */
.menu-toggle {
  display: none;
  background: transparent;
  border: 1px solid #6b4828;
  color: #f5efe0;
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius);
  cursor: pointer;
  font: inherit;
  font-size: 0.9rem;
}
.menu-toggle:hover { background: rgba(255,255,255,0.08); }

/* ===== Menu horizontal principal ===== */
.main-menu {
  background: #3a2418;
  border-bottom: 1px solid #1a0a04;
  padding: 0 1.25rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  max-width: 100%;
}
.main-menu .menu-item {
  display: inline-block;
  padding: 0.6rem 0.85rem;
  color: #e8d4a8;
  text-decoration: none;
  font-size: 0.92rem;
  border-bottom: 3px solid transparent;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
  white-space: nowrap;
}
.main-menu .menu-item:hover:not(.is-disabled) {
  background: rgba(255,255,255,0.05);
  color: #fff8e0;
}
.main-menu .menu-item.is-current {
  color: #fff8e0;
  background: rgba(0,0,0,0.18);
  border-bottom-color: var(--accent-soft);
  font-weight: 600;
}
.main-menu .menu-item.is-disabled {
  color: #7a5a40;
  cursor: not-allowed;
  font-style: italic;
}

/* ===== Dropdown du menu horizontal (groupe d'items) ===== */
.menu-dropdown { position: relative; display: inline-block; }
.menu-dropdown-button {
  background: transparent;
  border: none;
  font: inherit;
  cursor: pointer;
}
.menu-dropdown-caret {
  display: inline-block;
  margin-left: 0.15rem;
  font-size: 0.75em;
  opacity: 0.85;
  transition: transform 0.15s;
}
.menu-dropdown.is-open .menu-dropdown-caret,
.menu-dropdown:hover .menu-dropdown-caret { transform: rotate(180deg); }
.menu-dropdown-panel {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 50;
  flex-direction: column;
  min-width: 230px;
  background: #3a2418;
  border: 1px solid #1a0a04;
  padding: 0.25rem 0;
  box-shadow: 0 6px 20px rgba(0,0,0,0.5);
}
.menu-dropdown:hover .menu-dropdown-panel,
.menu-dropdown.is-open .menu-dropdown-panel,
.menu-dropdown:focus-within .menu-dropdown-panel { display: flex; }
.menu-dropdown-item {
  display: block;
  padding: 0.55rem 1rem;
  color: #e8d4a8;
  text-decoration: none;
  font-size: 0.92rem;
  white-space: nowrap;
  border-left: 3px solid transparent;
}
.menu-dropdown-item:hover:not(.is-disabled) {
  background: rgba(255,255,255,0.07);
  color: #fff8e0;
}
.menu-dropdown-item.is-current {
  color: #fff8e0;
  background: rgba(0,0,0,0.25);
  border-left-color: var(--accent-soft);
  font-weight: 600;
}
.menu-dropdown-item.is-disabled {
  color: #7a5a40;
  cursor: not-allowed;
  font-style: italic;
}

/* École citée dans une technique mais introuvable dans la base
   (typo non aliasée ou école supprimée). Affichée en texte discret. */
.ecole-inconnue {
  color: #8a7060;
  font-style: italic;
  text-decoration: line-through dotted rgba(0,0,0,0.3);
}

/* Sous-titre 'Métiers (N)' / 'Entraînements (N)' sur fiche compétence. */
.acces-sous-titre {
  margin: 0.6rem 0 0.2rem;
  font-size: 0.95rem;
  color: var(--accent);
  font-weight: 600;
}
.acces-sous-titre:first-child { margin-top: 0; }

/* Choix de compétences dans une fiche métier ('Choisir N parmi : …'). */
.competence-choix {
  margin-top: 0.5rem;
  padding: 0.5rem 0.7rem;
  background: rgba(232, 212, 168, 0.08);
  border-left: 3px solid var(--accent-soft);
  border-radius: 0 4px 4px 0;
}
.competence-choix-intro {
  margin: 0 0 0.3rem;
  font-weight: 600;
  color: #5a4030;
  font-size: 0.92rem;
}
.competence-choix-options { margin: 0; }
.competence-choix-note {
  margin: 0.4rem 0 0;
  font-size: 0.85rem;
  color: #6b5040;
}

.nation-sous-titre {
  margin: 1rem 0 0.4rem;
  font-family: 'Cinzel', Georgia, serif;
  font-size: 1.05rem;
  color: var(--accent);
  border-bottom: 1px solid rgba(232, 212, 168, 0.25);
  padding-bottom: 0.2rem;
}

/* ====== Création de personnage ====== */
.creation-main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem;
}
.creation-stepper {
  display: flex;
  gap: 0.5rem;
  margin: 1rem 0 1.5rem;
  flex-wrap: wrap;
}
.creation-step {
  flex: 1 1 200px;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  background: rgba(232, 212, 168, 0.1);
  border: 1px solid rgba(232, 212, 168, 0.3);
  padding: 0.7rem 1rem;
  cursor: pointer;
  font-family: inherit;
  color: var(--text);
  border-radius: 4px;
  transition: background 0.15s, border-color 0.15s;
}
.creation-step:hover { background: rgba(232, 212, 168, 0.18); }
.creation-step.is-active {
  background: rgba(232, 212, 168, 0.25);
  border-color: var(--accent);
  font-weight: 600;
}
.creation-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  background: var(--accent);
  color: #fff;
  border-radius: 50%;
  font-weight: 700;
}
.creation-step.is-active .creation-step-num {
  background: var(--accent-soft);
  color: var(--bg);
}
.creation-step-content { animation: fadein 0.2s ease-in; }
@keyframes fadein { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.creation-block {
  background: rgba(232, 212, 168, 0.05);
  border-left: 3px solid var(--accent-soft);
  border-radius: 0 6px 6px 0;
  padding: 1rem 1.2rem;
  margin: 1.2rem 0;
}
.creation-intro-bloc {
  background: rgba(195, 70, 70, 0.06);
  border-left-color: var(--accent);
}
.creation-intro-bloc .creation-paragraph {
  margin: 0 0 0.8rem;
  line-height: 1.6;
}
.creation-intro-bloc .creation-paragraph:last-child { margin-bottom: 0; }
.creation-block h4 { margin: 0 0 0.5rem; color: var(--accent); }
.creation-note {
  font-size: 0.92rem;
  color: var(--text);
  opacity: 0.85;
  margin: 0 0 0.8rem;
}
.creation-paragraph {
  line-height: 1.6;
  margin: 0 0 0.7rem;
}
/* Traits — sélecteur style 7ème Mer (cliquable pour +1 libre) */
.traits-grid { display: grid; gap: 0.5rem; }
.trait-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  align-items: center;
  padding: 0.7rem;
  background: rgba(232, 212, 168, 0.06);
  border-radius: 4px;
  text-align: left;
}
.trait-row-button {
  width: 100%;
  border: 2px solid transparent;
  font: inherit;
  color: inherit;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.trait-row-button:hover {
  background: rgba(232, 212, 168, 0.12);
  border-color: rgba(195, 70, 70, 0.35);
}
.trait-row-button:focus {
  outline: none;
  border-color: var(--accent);
}
.trait-row.has-libre {
  border-color: var(--accent);
  background: rgba(195, 70, 70, 0.10);
}
.trait-row.has-nation {
  border-left: 4px solid #c9a861;
}
.trait-label strong {
  font-family: 'Cinzel', Georgia, serif;
  font-size: 1.1rem;
  color: var(--accent);
}
.trait-desc {
  margin: 0.3rem 0 0;
  font-size: 0.85rem;
  opacity: 0.8;
  line-height: 1.5;
}
.trait-droite {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}
.trait-cercles {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}
.trait-cercle {
  width: 1.3rem;
  height: 1.3rem;
  border-radius: 50%;
  border: 2px solid var(--accent-soft);
  background: rgba(255, 255, 255, 0.5);
  display: inline-block;
}
.trait-cercle.is-filled { background: #000; border-color: #000; }
.trait-cercle.is-libre {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(195, 70, 70, 0.4);
}
.trait-cercle.is-nation {
  background: #c9a861;
  border-color: #c9a861;
  box-shadow: 0 0 0 2px rgba(201, 168, 97, 0.4);
}
.trait-valeur {
  min-width: 1.6rem;
  text-align: center;
  font-family: 'Cinzel', Georgia, serif;
  font-weight: 700;
  font-size: 1.4rem;
  color: var(--accent);
}
/* ====== Bouton 'Ajouter à ma création' (dans les modales) ====== */
.btn-add-creation {
  display: block;
  margin: 0.5rem 0 1rem;
  background: var(--accent);
  color: #fff;
  border: 2px solid var(--accent);
  font: inherit;
  font-weight: 600;
  padding: 0.6rem 1rem;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s, transform 0.15s;
  font-family: 'Cinzel', Georgia, serif;
  font-size: 0.92rem;
  letter-spacing: 0.02em;
}
.btn-add-creation:hover {
  background: #a23a3a;
  transform: translateY(-1px);
}
.btn-add-creation.is-added {
  background: rgba(107, 139, 91, 0.7);
  border-color: #6b8b5b;
}
.btn-add-creation.is-added:hover {
  background: rgba(139, 72, 68, 0.7);
  border-color: #8b3a3a;
}
.btn-add-creation .btn-pp {
  font-family: 'Courier New', monospace;
  font-weight: 700;
  opacity: 0.85;
  margin-left: 0.4rem;
}
.creation-info-hors-nation {
  background: rgba(201, 168, 97, 0.15);
  border-left: 3px solid #c9a861;
  padding: 0.5rem 0.8rem;
  border-radius: 0 4px 4px 0;
  margin: 0 0 1rem;
  font-size: 0.9rem;
  color: #8a6a26;
}

/* ====== Listes des items choisis dans Étape 3 ====== */
.spec-empty-list {
  margin: 0.4rem 0;
  font-style: italic;
  opacity: 0.7;
  font-size: 0.88rem;
}
.spec-chosen-list {
  list-style: none;
  padding: 0;
  margin: 0.4rem 0;
  display: grid;
  gap: 0.3rem;
}
.spec-chosen-list li {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 0.5rem;
  align-items: center;
  padding: 0.4rem 0.6rem;
  background: rgba(232, 212, 168, 0.08);
  border-left: 3px solid var(--accent-soft);
  border-radius: 0 4px 4px 0;
}
.chosen-item-name {
  font-weight: 600;
  color: var(--accent);
}
.chosen-item-meta {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.chosen-tag {
  background: rgba(0, 0, 0, 0.12);
  padding: 0.1rem 0.45rem;
  border-radius: 3px;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  opacity: 0.8;
}
.chosen-tag-warn {
  background: rgba(201, 168, 97, 0.3);
  color: #8a6a26;
  opacity: 1;
}
.chosen-pp {
  font-family: 'Courier New', monospace;
  font-weight: 700;
  color: var(--accent);
  font-size: 0.88rem;
}
.chosen-remove {
  background: rgba(139, 72, 68, 0.2);
  color: #8b3a3a;
  border: 1px solid rgba(139, 72, 68, 0.4);
  width: 1.8rem;
  height: 1.8rem;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1;
  transition: background 0.12s;
}
.chosen-remove:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* ====== Sticky PP bar (création de personnage) ====== */
.pp-bar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: linear-gradient(180deg, #3a2418 0%, #2d1c10 100%);
  border-bottom: 2px solid var(--accent);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  color: #e8d4a8;
  padding: 0.5rem 0.75rem;
}
.pp-bar-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.pp-bar-label {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-width: 130px;
}
.pp-bar-label strong {
  font-family: 'Cinzel', Georgia, serif;
  font-size: 0.95rem;
  color: var(--accent-soft);
}
.pp-bar-sub {
  font-size: 0.72rem;
  opacity: 0.65;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.pp-bar-chiffres {
  font-family: 'Cinzel', Georgia, serif;
  font-weight: 700;
  font-size: 1.6rem;
  display: flex;
  align-items: baseline;
  gap: 0.3rem;
}
.pp-bar-depenses { color: #fff8e0; }
.pp-bar-sep      { color: var(--accent-soft); opacity: 0.5; }
.pp-bar-budget   { color: var(--accent-soft); font-size: 1.2rem; }
.pp-bar-reste {
  font-size: 0.92rem;
  padding: 0.25rem 0.6rem;
  border-radius: 3px;
  font-weight: 600;
}
.pp-bar.is-leftover .pp-bar-restant { color: #7fbe70; }
.pp-bar.is-exact    .pp-bar-restant { color: #e8d4a8; }
.pp-bar.is-overspent .pp-bar-restant {
  color: #ffb0b0;
}
.pp-bar.is-overspent .pp-bar-chiffres .pp-bar-depenses {
  color: #ff9090;
  text-shadow: 0 0 8px rgba(255, 64, 64, 0.4);
}
.pp-bar-reset {
  background: rgba(255, 255, 255, 0.05);
  color: #e8d4a8;
  border: 1px solid rgba(232, 212, 168, 0.3);
  padding: 0.35rem 0.7rem;
  border-radius: 3px;
  cursor: pointer;
  font: inherit;
  font-size: 0.82rem;
  transition: background 0.15s;
}
.pp-bar-reset:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--accent);
}

/* ====== Barre PP globale (toutes pages hors création) ====== */
.pp-bar-global {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  z-index: 600;
  background: #1c1612;
  border: 1px solid var(--accent);
  border-radius: 10px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
  font-family: inherit;
  animation: pp-bar-global-in 0.25s ease-out;
}
@keyframes pp-bar-global-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.pp-bar-global-link {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 0.9rem;
  text-decoration: none;
  color: var(--text);
  border-radius: 10px;
  transition: background 0.15s;
}
.pp-bar-global-link:hover {
  background: rgba(232, 212, 168, 0.06);
}
.pp-bar-global-label {
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-soft);
  font-weight: 700;
}
.pp-bar-global-chiffres {
  display: inline-flex;
  align-items: baseline;
  gap: 0.15rem;
  font-weight: 700;
  font-size: 1rem;
  line-height: 1;
}
.pp-bar-global-depenses { color: #fff8e0; }
.pp-bar-global-sep      { color: var(--accent-soft); opacity: 0.5; }
.pp-bar-global-budget   { color: var(--accent-soft); font-size: 0.9rem; }
.pp-bar-global-restant {
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: 5px;
  background: rgba(232, 212, 168, 0.10);
}
.pp-bar-global.is-leftover .pp-bar-global-restant {
  color: #9fd28b;
  background: rgba(127, 190, 112, 0.14);
}
.pp-bar-global.is-exact .pp-bar-global-restant {
  color: #e8d4a8;
}
.pp-bar-global.is-overspent {
  border-color: #c34646;
}
.pp-bar-global.is-overspent .pp-bar-global-restant {
  color: #fff;
  background: #c34646;
}
.pp-bar-global.is-overspent .pp-bar-global-depenses {
  color: #ff9b9b;
}
@media (max-width: 640px) {
  .pp-bar-global {
    bottom: 0.6rem;
    right: 0.6rem;
  }
  .pp-bar-global-link {
    padding: 0.45rem 0.7rem;
    gap: 0.4rem;
  }
}

/* ====== Carte 'Compétences' (étape 3) : bloc compétences disponibles ====== */
.spec-comp-dispo {
  margin: 0.7rem 0 0.5rem 0;
}
.spec-comp-dispo-details {
  background: rgba(232, 212, 168, 0.05);
  border: 1px solid rgba(232, 212, 168, 0.18);
  border-radius: 8px;
  padding: 0.5rem 0.8rem 0.7rem 0.8rem;
}
.spec-comp-dispo-details[open] {
  padding-bottom: 0.9rem;
}
.spec-comp-dispo-summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  padding: 0.25rem 0;
  user-select: none;
}
.spec-comp-dispo-summary::-webkit-details-marker { display: none; }
.spec-comp-dispo-summary::before {
  content: "▸";
  color: var(--accent-soft);
  transition: transform 0.15s;
  display: inline-block;
}
.spec-comp-dispo-details[open] .spec-comp-dispo-summary::before {
  transform: rotate(90deg);
}
.spec-comp-dispo-titre {
  font-family: 'Cinzel', Georgia, serif;
  font-size: 0.95rem;
  color: var(--accent);
  font-weight: 600;
  letter-spacing: 0.02em;
  flex: 1 1 auto;
}
.spec-comp-dispo-stats {
  display: inline-flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}
.spec-comp-dispo-section {
  margin-top: 0.7rem;
}
.spec-comp-dispo-section-titre {
  margin: 0 0 0.35rem 0;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
}
.spec-comp-dispo-count {
  color: var(--accent-soft);
  opacity: 0.75;
  font-size: 0.8rem;
}
.spec-comp-dispo-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.spec-comp-dispo-item {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  flex-wrap: wrap;
  padding: 0.2rem 0.3rem;
  border-radius: 4px;
  transition: background 0.12s;
}
.spec-comp-dispo-item:hover {
  background: rgba(232, 212, 168, 0.08);
}
.spec-comp-dispo-nom {
  background: transparent;
  border: none;
  color: var(--text);
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
  text-align: left;
  border-bottom: 1px dotted rgba(232, 212, 168, 0.35);
  transition: color 0.12s, border-color 0.12s;
}
.spec-comp-dispo-nom:hover,
.spec-comp-dispo-nom:focus {
  color: var(--accent);
  border-bottom-color: var(--accent);
  outline: none;
}
.spec-comp-dispo-sep {
  color: var(--accent-soft);
  opacity: 0.55;
}
.spec-comp-dispo-source {
  font-size: 0.82rem;
  color: var(--accent-soft);
  opacity: 0.85;
  font-style: italic;
}

/* ====== Carte 'Compétences' — fiche-style avec radios de rang ====== */
.fiche-comp-wrapper {
  margin: 0.7rem 0 0.5rem 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.fiche-comp-section {
  background: rgba(232, 212, 168, 0.05);
  border: 1px solid rgba(232, 212, 168, 0.18);
  border-radius: 8px;
  padding: 0.7rem 0.9rem;
}
.fiche-comp-section-titre {
  margin: 0 0 0.5rem 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.92rem;
}
.fiche-comp-count {
  color: var(--accent-soft);
  opacity: 0.75;
  font-size: 0.82rem;
}
.fiche-comp-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.fiche-comp-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.35rem 0.55rem;
  border-radius: 4px;
  border-bottom: 1px dotted rgba(232, 212, 168, 0.15);
  transition: background 0.12s;
}
.fiche-comp-row:hover { background: rgba(232, 212, 168, 0.07); }
.fiche-comp-nom {
  background: transparent;
  border: none;
  color: var(--text);
  font-weight: 600;
  font-size: 0.95rem;
  text-align: left;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
  flex: 1 1 auto;
  border-bottom: 1px dotted rgba(232, 212, 168, 0.4);
  transition: color 0.12s;
}
.fiche-comp-nom:hover,
.fiche-comp-nom:focus {
  color: var(--accent);
  border-bottom-color: var(--accent);
  outline: none;
}
.fiche-comp-radios {
  display: inline-flex;
  gap: 0.32rem;
  flex-shrink: 0;
}
.fiche-radio {
  width: 1.4rem;
  height: 1.4rem;
  border: 2px solid var(--accent-soft);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  padding: 0;
  transition: background 0.12s, border-color 0.12s, transform 0.12s;
}
.fiche-radio:hover {
  background: rgba(232, 212, 168, 0.20);
  transform: scale(1.08);
}
/* Cercle rempli (rang atteint, offert ou acheté) : remplissage plein.
   Couleur dépend de la section (base = vert, avancée = doré). */
.fiche-radio.is-filled {
  background: #6b8b5b;
  border-color: #6b8b5b;
}
.fiche-comp-avancee .fiche-radio.is-filled {
  background: #c9a861;
  border-color: #c9a861;
}
/* Rang acheté par-dessus l'offert : nuance plus saturée pour distinguer
   subtilement (sans nuire à la lisibilité). */
.fiche-radio.is-filled:not(.is-offert) {
  background: #87a875;
  border-color: #87a875;
}
.fiche-comp-avancee .fiche-radio.is-filled:not(.is-offert) {
  background: #d9bb70;
  border-color: #d9bb70;
}
/* Rang offert (gratuit) : pas d'effet de survol, pas cliquable. */
.fiche-radio.is-offert {
  cursor: default;
}
.fiche-radio.is-offert:hover { transform: none; background: #6b8b5b; }
.fiche-comp-avancee .fiche-radio.is-offert:hover { background: #c9a861; }
/* Rangs au-delà de la limite création (4 et 5) : visibles mais désactivés. */
.fiche-radio.is-hors-creation {
  cursor: not-allowed;
  border-color: rgba(232, 212, 168, 0.25);
  background: transparent;
  opacity: 0.45;
}
.fiche-radio.is-hors-creation:hover {
  transform: none;
  background: transparent;
}
/* Séparateur visuel entre les rangs création (1-3) et hors-création (4-5) :
   on cible le 1er cercle hors-création (le 4e cercle de la rangée). */
.fiche-radio.is-hors-creation:nth-child(4) {
  margin-left: 0.55rem;
  position: relative;
}
.fiche-radio.is-hors-creation:nth-child(4)::before {
  content: "";
  position: absolute;
  left: -0.35rem;
  top: 10%;
  height: 80%;
  width: 1px;
  background: rgba(232, 212, 168, 0.4);
}

/* Popup compétence (description + sources) */
.fiche-popup-sources {
  list-style: none;
  margin: 0.3rem 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.fiche-popup-sources li {
  padding: 0.35rem 0.55rem;
  background: rgba(232, 212, 168, 0.07);
  border-left: 3px solid var(--accent-soft);
  border-radius: 0 4px 4px 0;
  font-size: 0.9rem;
}

/* ====== Sélecteur de rang de compétence (dans modale) ====== */
.comp-rang-selector {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin: 0.8rem 0 1rem 0;
  padding: 0.6rem 0.8rem;
  background: rgba(232, 212, 168, 0.06);
  border: 1px solid rgba(232, 212, 168, 0.18);
  border-radius: 8px;
}
.comp-rang-label {
  font-size: 0.82rem;
  color: var(--accent-soft);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-right: 0.2rem;
}
.rang-buttons {
  display: inline-flex;
  gap: 0.3rem;
}
.rang-btn {
  cursor: pointer;
  min-width: 3.4rem;
  padding: 0.35rem 0.6rem;
  font: inherit;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  border: 1px solid rgba(232, 212, 168, 0.25);
  border-radius: 6px;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
  line-height: 1.1;
}
.rang-btn-label { font-size: 0.85rem; }
.rang-btn-cout {
  font-size: 0.7rem;
  font-weight: 500;
  opacity: 0.78;
  letter-spacing: 0.02em;
}
.rang-btn:hover {
  background: rgba(232, 212, 168, 0.12);
  border-color: var(--accent);
}
.rang-btn.is-selected {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.rang-typecout {
  font-size: 0.78rem;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  font-weight: 600;
}
.rang-typecout-base    { background: rgba(127, 190, 112, 0.18); color: #9fd28b; border: 1px solid rgba(127, 190, 112, 0.35); }
.rang-typecout-avancee { background: rgba(232, 212, 168, 0.18); color: #e8d4a8; border: 1px solid rgba(232, 212, 168, 0.35); }
.rang-typecout-hors    { background: rgba(195, 70, 70, 0.18);   color: #e29191; border: 1px solid rgba(195, 70, 70, 0.35); }
.rang-cout-total {
  margin-left: auto;
  font-size: 0.85rem;
  color: var(--accent-soft);
  font-weight: 600;
}
.rang-cout-total strong { color: var(--text); font-size: 1rem; }

/* Cadre autour du sélecteur de rang dans la modale Compétence */
.competence-rang-selector {
  background: rgba(232, 212, 168, 0.05);
  border: 1px solid rgba(232, 212, 168, 0.18);
  border-radius: 8px;
  padding: 0.8rem 1rem;
}
.competence-rang-selector .rang-buttons {
  margin-top: 0.4rem;
  flex-wrap: wrap;
}
.competence-rang-info {
  margin: 0.3rem 0 0.5rem 0;
  font-size: 0.92rem;
  line-height: 1.45;
}
.competence-rang-recap {
  margin: 0.6rem 0 0 0;
  font-size: 0.92rem;
  color: var(--accent-soft);
}
.competence-rang-note {
  margin: 0.6rem 0 0 0;
  font-size: 0.82rem;
  color: rgba(232, 212, 168, 0.6);
  line-height: 1.4;
}

/* ====== Filtre 'Issues de mes spécialités' ====== */
.mes-spe-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.mes-spe-list label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.9rem;
  padding: 0.2rem 0;
}
.mes-spe-list label:hover { color: var(--accent); }
.mes-spe-list .filter-empty-note {
  margin: 0;
  font-size: 0.82rem;
  color: rgba(232, 212, 168, 0.6);
  font-style: italic;
  line-height: 1.4;
}
.btn-mes-spe-clear {
  margin-top: 0.3rem;
  padding: 0.25rem 0.6rem;
  background: transparent;
  color: rgba(232, 212, 168, 0.7);
  border: 1px solid rgba(232, 212, 168, 0.2);
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.78rem;
  align-self: flex-start;
  transition: background 0.15s, color 0.15s;
}
.btn-mes-spe-clear:hover {
  background: rgba(195, 70, 70, 0.12);
  border-color: var(--accent);
  color: var(--accent);
}

/* ====== Étape 3 — sélecteurs interactifs ====== */
.age-btn {
  cursor: pointer;
  border: 2px solid transparent;
  font: inherit;
  text-align: left;
  width: 100%;
  transition: background 0.15s, border-color 0.15s;
}
.age-btn:hover { background: rgba(232, 212, 168, 0.14); }
.age-btn.is-selected {
  background: rgba(195, 70, 70, 0.10);
  border-color: var(--accent);
  border-left-color: var(--accent);
}

.spec-sorcel-row {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin: 0.4rem 0;
}
.spec-sorcel-btn {
  background: rgba(232, 212, 168, 0.10);
  border: 2px solid rgba(232, 212, 168, 0.25);
  font: inherit;
  color: var(--text);
  padding: 0.35rem 0.7rem;
  border-radius: 3px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: background 0.12s, border-color 0.12s;
}
.spec-sorcel-btn:hover { background: rgba(232, 212, 168, 0.2); }
.spec-sorcel-btn.is-selected {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
}

.spec-interactif {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin: 0.3rem 0;
}
.spec-mini-label {
  flex: 1 1 auto;
  font-size: 0.88rem;
  min-width: 150px;
}
.counter-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: rgba(0, 0, 0, 0.10);
  padding: 0.15rem;
  border-radius: 3px;
}
.counter-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  width: 1.8rem;
  height: 1.8rem;
  border-radius: 3px;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.12s;
}
.counter-btn:hover:not(:disabled) { background: #a23a3a; }
.counter-btn:disabled {
  background: rgba(232, 212, 168, 0.2);
  cursor: not-allowed;
}
.counter-value {
  min-width: 1.8rem;
  text-align: center;
  font-family: 'Courier New', monospace;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--accent);
}
.spec-pp-input {
  width: 5rem;
  padding: 0.35rem 0.5rem;
  border: 2px solid rgba(232, 212, 168, 0.3);
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.08);
  color: var(--text);
  font: inherit;
  font-family: 'Courier New', monospace;
  font-weight: 700;
  font-size: 1rem;
  text-align: right;
}
.spec-pp-input:focus {
  outline: none;
  border-color: var(--accent);
}

/* ====== Étape 3 — PP & Spécificités ====== */
.budget-pp {
  background: rgba(195, 70, 70, 0.08);
  padding: 0.6rem 0.9rem;
  border-left: 4px solid var(--accent);
  border-radius: 0 4px 4px 0;
  margin-top: 0.6rem;
}
.age-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.7rem;
}
.age-card {
  background: rgba(232, 212, 168, 0.08);
  border-left: 3px solid var(--accent-soft);
  border-radius: 0 4px 4px 0;
  padding: 0.7rem 0.9rem;
}
.age-plage {
  font-family: 'Cinzel', Georgia, serif;
  color: var(--accent);
  font-weight: 700;
  font-size: 1rem;
}
.age-label {
  font-size: 0.82rem;
  opacity: 0.7;
  font-style: italic;
  margin-bottom: 0.4rem;
}
.age-bonus { margin: 0; line-height: 1.5; font-size: 0.92rem; }

/* Carte âge : zone d'en-tête cliquable (toggle) + panneau de bonus en dessous */
.age-card.is-selected {
  background: rgba(195, 70, 70, 0.10);
  border-left-color: var(--accent);
}
.age-card-header {
  cursor: pointer;
  outline: none;
  border-radius: 4px;
  transition: background 0.15s;
}
.age-card-header:hover,
.age-card-header:focus {
  background: rgba(232, 212, 168, 0.10);
}

/* Panneau bonus (sous le header de la carte sélectionnée) */
.age-bonus-pane {
  margin-top: 0.6rem;
  padding-top: 0.6rem;
  border-top: 1px dashed rgba(232, 212, 168, 0.3);
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}
.age-bonus-slot {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(232, 212, 168, 0.15);
  border-radius: 6px;
  padding: 0.55rem 0.75rem;
}
.age-bonus-slot-titre {
  margin: 0 0 0.3rem 0;
  font-family: 'Cinzel', Georgia, serif;
  font-size: 0.88rem;
  color: var(--accent-soft);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.age-bonus-desc {
  margin: 0 0 0.4rem 0;
  font-size: 0.85rem;
  opacity: 0.85;
  line-height: 1.4;
}
.age-bonus-choisi {
  margin: 0.2rem 0 0.5rem 0;
  padding: 0.3rem 0.5rem;
  background: rgba(127, 190, 112, 0.12);
  border-left: 3px solid #6b8b5b;
  border-radius: 0 4px 4px 0;
  font-size: 0.92rem;
}
.age-bonus-vide {
  margin: 0.2rem 0 0.5rem 0;
  font-size: 0.85rem;
  font-style: italic;
  opacity: 0.65;
}
.age-bonus-btn {
  margin: 0;
  font-size: 0.85rem;
  padding: 0.45rem 0.8rem;
}

/* Popup bonus d'âge : liste sélecteur (utilisée pour métiers / entraînements / vertus) */
.popup-bonus-list {
  list-style: none;
  margin: 0.5rem 0 0.5rem 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  max-height: 60vh;
  overflow-y: auto;
}
.popup-bonus-item {
  cursor: pointer;
  padding: 0.55rem 0.8rem;
  border: 1px solid rgba(232, 212, 168, 0.2);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.02);
  transition: background 0.12s, border-color 0.12s;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.popup-bonus-item:hover,
.popup-bonus-item:focus {
  background: rgba(232, 212, 168, 0.10);
  border-color: var(--accent-soft);
  outline: none;
}
.popup-bonus-item.is-selected {
  background: rgba(195, 70, 70, 0.14);
  border-color: var(--accent);
}
.popup-bonus-item.is-selected .popup-bonus-nom::before {
  content: "✓ ";
  color: var(--accent);
}
.popup-bonus-nom {
  font-family: 'Cinzel', Georgia, serif;
  font-weight: 600;
  color: var(--accent);
  font-size: 0.95rem;
}
.popup-bonus-desc {
  font-size: 0.82rem;
  opacity: 0.78;
  font-style: italic;
}
/* Groupes (par type d'école) dans le popup École bonus */
.popup-bonus-groupe {
  margin-top: 0.6rem;
}
.popup-bonus-groupe-titre {
  margin: 0 0 0.35rem 0;
  font-family: 'Cinzel', Georgia, serif;
  font-size: 0.9rem;
  color: var(--accent);
  letter-spacing: 0.04em;
  border-bottom: 1px solid rgba(232, 212, 168, 0.2);
  padding-bottom: 0.25rem;
}

/* Cartes de spécificité */
.creation-note.rappel {
  background: rgba(201, 168, 97, 0.10);
  border-left: 3px solid #c9a861;
  padding: 0.4rem 0.7rem;
  border-radius: 0 4px 4px 0;
  margin-bottom: 0.5rem;
}
.specs-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.8rem;
  margin-top: 0.6rem;
}
.spec-card {
  background: rgba(232, 212, 168, 0.05);
  border: 2px solid rgba(232, 212, 168, 0.25);
  border-radius: 6px;
  padding: 0.8rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.spec-card.is-a-venir { opacity: 0.65; }
.spec-card-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.spec-card-head h5 {
  margin: 0;
  font-family: 'Cinzel', Georgia, serif;
  color: var(--accent);
  font-size: 1rem;
  flex: 1;
}
.spec-badge-avenir {
  background: rgba(201, 168, 97, 0.22);
  color: #8a6a26;
  padding: 0.1rem 0.5rem;
  border-radius: 3px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.spec-resume {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.5;
  opacity: 0.92;
}
.spec-couts-list {
  list-style: none;
  padding: 0;
  margin: 0.3rem 0;
}
.spec-couts-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.3rem 0.5rem;
  background: rgba(0, 0, 0, 0.08);
  border-radius: 3px;
  margin-bottom: 0.2rem;
  font-size: 0.88rem;
  gap: 0.5rem;
}
.spec-cout-label { flex: 1; }
.spec-cout-pp {
  font-family: 'Courier New', monospace;
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
}
.spec-cout-unitaire {
  margin: 0.2rem 0;
  font-size: 0.92rem;
}
.spec-max {
  margin: 0.2rem 0;
  font-size: 0.85rem;
  color: #8b3a3a;
}
.spec-majoration {
  margin: 0.2rem 0;
  font-size: 0.85rem;
  opacity: 0.8;
  font-style: italic;
}
.spec-pages-row {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}
.spec-page-btn {
  display: inline-block;
  background: var(--accent);
  color: #fff !important;
  padding: 0.4rem 0.7rem;
  border-radius: 4px;
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  transition: background 0.15s;
}
.spec-page-btn:hover { background: #a23a3a; }
.spec-page-btn.is-disabled {
  background: rgba(232, 212, 168, 0.18);
  color: rgba(232, 212, 168, 0.5) !important;
  cursor: not-allowed;
}

/* Langues */
.langues-bloc { display: grid; gap: 0.5rem; }
.langue-bloc {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.7rem;
  align-items: center;
  padding: 0.6rem 0.8rem;
  background: rgba(232, 212, 168, 0.06);
  border-left: 3px solid var(--accent-soft);
  border-radius: 0 4px 4px 0;
}
.langue-native { border-left-color: #6b8b5b; background: rgba(107, 139, 91, 0.08); }
.langue-universelle { border-left-color: #c9a861; background: rgba(201, 168, 97, 0.08); }
.langue-icone { font-size: 1.6rem; }
.langue-content strong {
  font-family: 'Cinzel', Georgia, serif;
  color: var(--accent);
}
.langue-content p { margin: 0.2rem 0 0; font-size: 0.9rem; line-height: 1.4; }
.langue-cout {
  font-family: 'Courier New', monospace;
  font-weight: 700;
  color: var(--accent);
  font-size: 0.85rem;
}
.langue-vide { font-style: italic; opacity: 0.75; }
.langues-extras { margin-top: 0.5rem; font-size: 0.88rem; opacity: 0.85; }

/* Légendes Vertu / Travers (étape 2) */
.legende-vertu, .legende-travers {
  font-weight: 700;
  padding: 0 0.3em;
  border-radius: 3px;
}
.legende-vertu   { background: rgba(107, 139, 91, 0.22); color: #4a6a3a; }
.legende-travers { background: rgba(139, 72, 68, 0.22); color: #8b3a3a; }

/* Étape 2 — Actions (bouton tirage aléatoire) */
.arcanes-actions {
  display: flex;
  gap: 0.6rem;
  margin: 0.5rem 0 1rem;
  flex-wrap: wrap;
}
.btn-tirage {
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 700;
  font-family: 'Cinzel', Georgia, serif;
  border: 2px solid var(--accent);
  padding: 0.7rem 1.3rem;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s, transform 0.15s, box-shadow 0.15s;
  font-size: 1rem;
  letter-spacing: 0.02em;
}
.btn-tirage:hover {
  background: #a23a3a;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(195, 70, 70, 0.4);
}
.btn-tirage:active { transform: translateY(0); }

/* Étape 2 — Arcanes (grille de cartes) */
.arcanes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.7rem;
  margin-top: 0.5rem;
}
.arcane-img-mini {
  width: 100%;
  height: auto;
  max-height: 180px;
  object-fit: contain;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.05);
  margin-bottom: 0.3rem;
}
.arcane-img-grande {
  max-width: 200px;
  height: auto;
  border-radius: 6px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  border: 2px solid var(--accent);
}
.arcane-carte {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  padding: 0.8rem 0.7rem;
  background: linear-gradient(180deg, rgba(232, 212, 168, 0.08) 0%, rgba(195, 70, 70, 0.04) 100%);
  border: 2px solid rgba(232, 212, 168, 0.3);
  border-radius: 6px;
  cursor: pointer;
  text-align: center;
  font: inherit;
  color: inherit;
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.arcane-carte:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.18);
}
.arcane-carte.is-selected {
  border-color: var(--accent);
  background: rgba(195, 70, 70, 0.12);
  box-shadow: 0 0 0 3px rgba(195, 70, 70, 0.25);
}
.arcane-numero {
  font-family: 'Cinzel', Georgia, serif;
  font-weight: 700;
  font-size: 1.4rem;
  color: var(--accent);
  background: rgba(0, 0, 0, 0.15);
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--accent-soft);
}
.arcane-nom {
  font-family: 'Cinzel', Georgia, serif;
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--accent);
}
.arcane-paire {
  font-size: 0.82rem;
  display: flex;
  gap: 0.4rem;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  opacity: 0.9;
}
.arcane-vertu   { color: #4a6a3a; font-weight: 600; }
.arcane-travers { color: #8b3a3a; font-weight: 600; }
.arcane-sep     { opacity: 0.5; }

/* Bloc Détail tirage */
.arcane-selection { display: grid; gap: 1rem; }
.arcane-tirage-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding-bottom: 0.7rem;
  border-bottom: 1px solid rgba(232, 212, 168, 0.25);
}
.arcane-tirage-numero {
  font-family: 'Cinzel', Georgia, serif;
  font-weight: 700;
  font-size: 2rem;
  color: var(--accent);
  background: rgba(195, 70, 70, 0.1);
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 3px solid var(--accent);
  flex-shrink: 0;
}
.arcane-tirage-titre h5 {
  margin: 0;
  font-family: 'Cinzel', Georgia, serif;
  color: var(--accent);
  font-size: 1.3rem;
}
.arcane-pair-bloc {
  padding: 0.7rem 0.9rem;
  border-left: 4px solid;
  border-radius: 0 4px 4px 0;
}
.arcane-vertu-bloc   { background: rgba(107, 139, 91, 0.07); border-left-color: #6b8b5b; }
.arcane-travers-bloc { background: rgba(139, 72, 68, 0.07);  border-left-color: #8b3a3a; }
.arcane-pair-bloc h6 {
  margin: 0 0 0.4rem;
  font-size: 1rem;
  font-family: Georgia, serif;
  font-weight: 400;
}
.arcane-resume {
  margin: 0 0 0.4rem;
  line-height: 1.5;
}
.arcane-activation {
  margin: 0;
  font-size: 0.9rem;
  opacity: 0.85;
  line-height: 1.45;
}

/* Étape 1.2 — Statistiques dérivées (calcul auto) */
.stats-derivees { display: grid; gap: 0.4rem; }
.stat-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  align-items: center;
  padding: 0.6rem 0.9rem;
  background: rgba(232, 212, 168, 0.04);
  border-left: 3px solid var(--accent-soft);
  border-radius: 0 4px 4px 0;
}
.stat-label { display: flex; flex-direction: column; gap: 0.15rem; }
.stat-label strong {
  font-family: 'Cinzel', Georgia, serif;
  font-size: 1rem;
  color: var(--accent);
}
.stat-formule {
  font-size: 0.8rem;
  color: var(--accent-soft);
  font-family: 'Courier New', monospace;
  background: rgba(232, 212, 168, 0.08);
  padding: 0.05rem 0.4rem;
  border-radius: 3px;
  align-self: flex-start;
}
.stat-desc {
  margin: 0.2rem 0 0;
  font-size: 0.82rem;
  opacity: 0.8;
  line-height: 1.45;
}
.stat-valeur {
  min-width: 3rem;
  text-align: center;
  font-family: 'Cinzel', Georgia, serif;
  font-weight: 700;
  font-size: 1.8rem;
  color: var(--accent);
  background: rgba(195, 70, 70, 0.08);
  padding: 0.4rem 0.7rem;
  border-radius: 6px;
  border: 2px solid rgba(195, 70, 70, 0.2);
}
/* Légendes inline dans le texte d'aide */
.legende-libre, .legende-nation {
  font-weight: 700;
  padding: 0 0.25em;
  border-radius: 3px;
}
.legende-libre { background: rgba(195, 70, 70, 0.18); color: var(--accent); }
.legende-nation { background: rgba(201, 168, 97, 0.22); color: #8a6a26; }
/* Tableau des Nations groupé par continent (avec coloration discrète) */
.nations-continent {
  margin-bottom: 1.5rem;
  padding: 0.5rem 0.8rem;
  border-left: 4px solid;
  border-radius: 0 4px 4px 0;
  background: var(--continent-bg, transparent);
  border-left-color: var(--continent-color, var(--accent-soft));
}
.nations-continent-titre {
  font-family: 'Cinzel', Georgia, serif;
  color: var(--continent-color, var(--accent));
  font-size: 1.05rem;
  margin: 0 0 0.5rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid rgba(232, 212, 168, 0.25);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.nations-continent-pastille {
  display: inline-block;
  width: 0.9rem;
  height: 0.9rem;
  border-radius: 50%;
  background: var(--continent-color, var(--accent));
  border: 2px solid rgba(255, 255, 255, 0.4);
  flex-shrink: 0;
}
.nations-continent-equiv {
  font-family: Georgia, serif;
  font-size: 0.85rem;
  font-style: italic;
  color: var(--text);
  opacity: 0.75;
  font-weight: 400;
}
/* Palette : 1 couleur par continent (subtile, cohérente avec le thème) */
.continent-trois-royaumes { --continent-color: #5b7a99; --continent-bg: rgba(91, 122, 153, 0.06); }
.continent-theah          { --continent-color: #6b8b5b; --continent-bg: rgba(107, 139, 91, 0.06); }
.continent-pirates        { --continent-color: #8b4844; --continent-bg: rgba(139, 72, 68, 0.07); }
.continent-ifri           { --continent-color: #c08644; --continent-bg: rgba(192, 134, 68, 0.07); }
.continent-croissant      { --continent-color: #5a8e8e; --continent-bg: rgba(90, 142, 142, 0.07); }
.continent-cathay         { --continent-color: #b0743a; --continent-bg: rgba(176, 116, 58, 0.07); }
.continent-universelle    { --continent-color: #c9a861; --continent-bg: rgba(201, 168, 97, 0.10); }
.nations-tbl { width: 100%; border-collapse: collapse; }
.nations-tbl th, .nations-tbl td {
  padding: 0.5rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid rgba(232, 212, 168, 0.15);
}
.nations-tbl th {
  font-size: 0.85rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}
.nation-row {
  cursor: pointer;
  transition: background 0.15s;
}
.nation-row:hover, .nation-row:focus {
  background: rgba(232, 212, 168, 0.12);
  outline: none;
}
.nation-row.is-selected {
  background: rgba(195, 70, 70, 0.12);
  font-weight: 600;
}
.nation-row.is-selected .nation-nom::before {
  content: "✓ ";
  color: var(--accent);
}
.nation-nom { font-weight: 600; }
.nation-bonus { font-style: italic; }
.nation-equiv { opacity: 0.75; font-size: 0.9rem; }

/* ====== Sélecteur de langues (modal) ====== */
.modal-langues-intro {
  margin: 0.4rem 0 0.6rem 0;
  font-size: 0.92rem;
  line-height: 1.5;
}
.modal-langues-recap {
  margin: 0.2rem 0 1rem 0;
  padding: 0.45rem 0.75rem;
  background: rgba(232, 212, 168, 0.08);
  border-left: 3px solid var(--accent-soft);
  border-radius: 0 4px 4px 0;
  font-size: 0.95rem;
}
.langues-section { margin-bottom: 1.25rem; }
.langues-tbl .langue-cout-cell {
  text-align: right;
  font-weight: 600;
  white-space: nowrap;
  opacity: 0.9;
}
.langue-row.is-selected .nation-nom::before {
  content: "✓ ";
  color: var(--accent);
}
/* Ligne langue native : verrouillée, doré, toujours cochée */
.langue-row.langue-native-row {
  background: rgba(201, 168, 97, 0.14);
  cursor: default;
  font-weight: 600;
}
.langue-row.langue-native-row:hover,
.langue-row.langue-native-row:focus {
  background: rgba(201, 168, 97, 0.14);
  outline: none;
}
.langue-row.langue-native-row .nation-nom::before {
  content: "🔒 ";
  color: var(--accent-soft);
}
.langue-row.langue-native-row .langue-cout-cell {
  color: var(--accent-soft);
  font-style: italic;
}

/* ====== Choix des spécialisations 'A OU B' (carte Écoles) ====== */
.ecole-specs-choix {
  margin: 0.45rem 0 0.2rem 0;
  padding: 0.45rem 0.6rem;
  background: rgba(232, 212, 168, 0.05);
  border-left: 3px solid var(--accent-soft);
  border-radius: 0 4px 4px 0;
}
.ecole-specs-choix-titre {
  margin: 0 0 0.35rem 0;
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--accent-soft);
  font-weight: 600;
}
.ecole-specs-choix-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  margin-bottom: 0.25rem;
}
.ecole-specs-choix-row:last-child { margin-bottom: 0; }
.ecole-specs-choix-label {
  font-size: 0.85rem;
  font-style: italic;
  color: var(--text);
  opacity: 0.8;
  flex: 0 0 auto;
}
.ecole-specs-choix-opt {
  font: inherit;
  font-size: 0.82rem;
  padding: 0.2rem 0.55rem;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  border: 1px solid rgba(232, 212, 168, 0.3);
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}
.ecole-specs-choix-opt:hover {
  background: rgba(232, 212, 168, 0.15);
  border-color: var(--accent-soft);
}
.ecole-specs-choix-opt.is-selected {
  background: #6b8b5b;
  border-color: #6b8b5b;
  color: #fff;
  font-weight: 600;
}

/* Étape 3 — affichage de la langue native dans la carte 'Langues' */
.spec-langue-native {
  margin: 0.4rem 0;
  padding: 0.45rem 0.7rem;
  background: rgba(201, 168, 97, 0.12);
  border-left: 3px solid #c9a861;
  border-radius: 0 4px 4px 0;
  font-size: 0.92rem;
}
.spec-langue-btn {
  width: 100%;
  margin-top: 0.5rem;
}
/* Modal : boutons trait dans la fiche Nation */
.trait-bouton-row {
  display: flex;
  gap: 0.7rem;
  margin: 0.5rem 0;
  flex-wrap: wrap;
}
.trait-bouton {
  flex: 1 1 auto;
  background: rgba(232, 212, 168, 0.15);
  border: 2px solid var(--accent-soft);
  color: var(--text);
  font: inherit;
  padding: 0.7rem 1.2rem;
  cursor: pointer;
  border-radius: 4px;
  font-weight: 600;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.trait-bouton:hover {
  background: rgba(232, 212, 168, 0.3);
  border-color: var(--accent);
}
.trait-bouton.is-selected {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ====== École classifiée style CIA (Quinn) ======
   Texte remplacé par █ et caché par couleur de fond pour empêcher le
   copié-collé du contenu réel (le DOM ne contient que les blocs). */
.redacted-text {
  display: inline-block;
  background: #000;
  color: #000; /* texte █ invisible : seul le rectangle noir est vu */
  font-family: 'Courier New', Consolas, monospace;
  letter-spacing: -0.05em;
  padding: 0 0.15em;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  pointer-events: none;
  cursor: not-allowed;
  vertical-align: baseline;
}
.ecole-redacted-banner {
  background: linear-gradient(90deg, #000 0, #1a0a04 100%);
  color: #c33;
  padding: 0.5rem 0.9rem;
  margin: 0 0 1rem;
  border: 2px dashed #c33;
  font-family: 'Courier New', Consolas, monospace;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-align: center;
}
.badge.organisation-antagoniste {
  background: #000;
  color: #c33;
  border: 1px dashed #c33;
  font-family: 'Courier New', Consolas, monospace;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-size: 0.75rem;
}
.ecole-card.is-redacted {
  background: #1a0a04;
  border-left: 4px solid #c33;
}
.ecole-card.is-redacted .arme {
  font-family: 'Courier New', Consolas, monospace;
}

/* Note 'compétences indicatives' sur les fiches métiers. */
.metier-note-pp {
  margin: 0.75rem 0 0;
  padding: 0.5rem 0.8rem;
  border-left: 3px solid var(--accent-soft);
  background: rgba(232, 212, 168, 0.08);
  color: #5a4030;
  font-size: 0.9rem;
}

/* Liste des écoles enseignantes regroupées par arme (ex: Exploiter les faiblesses). */
.ecoles-groupees-list {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0 0;
}
.ecoles-groupees-list .ecoles-groupees-arme {
  padding: 0.35rem 0;
  border-bottom: 1px solid rgba(60,30,10,0.08);
  line-height: 1.7;
}
.ecoles-groupees-list .ecoles-groupees-arme:last-child { border-bottom: none; }
.ecoles-groupees-list .ecoles-groupees-arme strong {
  color: var(--accent);
  margin-right: 0.15rem;
}

/* ===== Titre de section sous la topbar (pages internes) ===== */
.page-section-title {
  max-width: 1280px;
  margin: 1.25rem auto 0;
  padding: 0 1.25rem;
}
.page-section-title h2 {
  color: var(--accent);
  font-size: 1.5rem;
  margin: 0;
  border-bottom: 2px solid var(--border);
  padding-bottom: 0.4rem;
}
.page-section-sub {
  color: var(--ink-mute);
  font-size: 0.95rem;
  font-style: italic;
  margin: 0.4rem 0 0;
}

/* ===== Layout ===== */
.layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 1.5rem;
  max-width: 1280px;
  margin: 1.5rem auto;
  padding: 0 1.25rem;
}

.filters-toggle {
  display: none;
}

/* ===== Filtres ===== */
.filters {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  position: sticky;
  top: 1rem;
  /* Hauteur limitée à la fenêtre + ascenseur propre : permet d'atteindre le bas
     des filtres sans scroller toute la page (utile sur petits écrans). */
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
  box-shadow: var(--shadow);
}

.filter-group { margin-bottom: 1.25rem; }
.filter-group:last-of-type { margin-bottom: 1rem; }

.filter-group > label,
.filter-group > h3 {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  margin-bottom: 0.5rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid var(--border-soft);
}

#search {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  font: inherit;
  color: var(--ink);
}
#search:focus {
  outline: 2px solid var(--accent-soft);
  outline-offset: 1px;
}

.checkbox-list {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  max-height: 320px;
  overflow-y: auto;
}

.checkbox-list label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0.4rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.95rem;
  color: var(--ink-soft);
  transition: background 0.12s;
}
.checkbox-list label:hover { background: #f0e8d0; color: var(--ink); }
.checkbox-list input[type="checkbox"] {
  accent-color: var(--accent);
  margin: 0;
  flex-shrink: 0;
}
.checkbox-list .count {
  margin-left: auto;
  font-size: 0.8rem;
  color: var(--ink-mute);
}

.btn-reset {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--ink-soft);
  border-radius: var(--radius);
  cursor: pointer;
  font: inherit;
  font-size: 0.9rem;
}
.btn-reset:hover {
  background: var(--accent);
  color: #fffbf0;
  border-color: var(--accent);
}

/* ===== Résultats ===== */
.results-bar {
  margin-bottom: 0.8rem;
  font-size: 0.9rem;
  color: var(--ink-mute);
}
.results-count { font-weight: 600; color: var(--ink-soft); }

.ecoles-grid {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

.ecole-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  box-shadow: var(--shadow);
  transition: transform 0.12s, box-shadow 0.12s;
}
.ecole-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}
.ecole-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.ecole-card h2 {
  font-size: 1.15rem;
  margin: 0;
  color: var(--ink);
}

.ecole-card .arme {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.92rem;
  font-style: italic;
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin: 0;
}

.badge {
  font-size: 0.75rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: #efe5cc;
  color: var(--ink-soft);
  border: 1px solid var(--border-soft);
  white-space: nowrap;
  font-family: -apple-system, system-ui, sans-serif;
}
.badge.nation { background: #e8d8a8; color: #4a3a1a; }
.badge.origine-officielle { background: #d4e5d4; color: #2c4a2c; }
.badge.origine-combat_reclassee { background: #f5d8b0; color: #6b3a10; }
.badge.origine-seconde_edition_adaptee { background: #d8d8ec; color: #2c2c5a; }
.badge.enrichie { background: var(--accent); color: #fffbf0; border-color: var(--accent); }
.badge.restriction-interdite { background: #2c1810; color: #fff; border-color: #2c1810; }
.badge.restriction-limitee { background: #d4a23a; color: #4a3010; border-color: #b88820; }
.badge.genre-femmes { background: #d4a8c8; color: #5a2050; border-color: #b886a8; }
.badge.genre-hommes { background: #a8c4d4; color: #1a3a5a; border-color: #86a8c4; }

.ecole-card.is-enrichie { border-left-color: #c68a30; }

.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--ink-mute);
  font-style: italic;
}

/* ===== Modal détail ===== */
.ecole-detail {
  max-width: 720px;
  width: calc(100% - 2rem);
  max-height: calc(100vh - 2rem);
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elevated);
  color: var(--ink);
  box-shadow: var(--shadow-lg);
  overflow: auto;
}
.ecole-detail::backdrop {
  background: rgba(20, 12, 6, 0.6);
}

.ecole-detail-close {
  position: sticky;
  top: 0;
  float: right;
  background: transparent;
  border: none;
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
  color: var(--ink-mute);
  padding: 0 0.4rem;
  margin: -0.5rem -0.5rem 0 0;
}
.ecole-detail-close:hover { color: var(--accent); }

/* ===== Cross-modal : header avec bouton Retour ===== */
.cross-modal-header {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
  margin: -1rem -1rem 0.6rem;
  padding: 0.6rem 1rem 0.5rem;
  background: linear-gradient(180deg, var(--bg-elevated) 85%, transparent);
}
.cross-modal-back {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--accent);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius);
  cursor: pointer;
  font: inherit;
  font-size: 0.9rem;
  font-style: italic;
  transition: background 0.12s, color 0.12s;
}
.cross-modal-back:hover { background: var(--accent); color: #fffbf0; border-color: var(--accent); }
.cross-modal-header .ecole-detail-close {
  position: static;
  float: none;
  margin: 0;
}

.detail-header {
  border-bottom: 2px solid var(--accent);
  padding-bottom: 0.75rem;
  margin-bottom: 1rem;
}
.detail-header h2 {
  margin: 0 0 0.4rem;
  font-size: 1.8rem;
  color: var(--accent);
}
.detail-header .badges { margin-top: 0.4rem; }

.detail-section {
  margin-bottom: 1.25rem;
}
.detail-section h3 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  margin: 0 0 0.5rem;
  padding-bottom: 0.25rem;
  border-bottom: 1px solid var(--border-soft);
}

.detail-meta {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.3rem 0.8rem;
  font-size: 0.95rem;
}
.detail-meta dt { font-weight: 600; color: var(--ink-soft); }
.detail-meta dd { margin: 0; }

.description-text {
  font-style: italic;
  color: var(--ink-soft);
  background: #faf3df;
  padding: 0.6rem 0.8rem;
  border-left: 3px solid var(--border);
  border-radius: 0 4px 4px 0;
}

.description-paragraph {
  margin: 0 0 0.8rem;
  color: var(--ink);
  text-indent: 1.5rem;
  /* text-align: justify; retiré : créait des espaces étirés disgracieux dans les
     lignes courtes (CSS n'a pas la césure typographique des PDFs). */
}
.description-paragraph:last-child { margin-bottom: 0; }

.detail-banner {
  background: #fdf3d8;
  border: 1px solid #d4b870;
  border-left: 4px solid #c68a30;
  padding: 0.6rem 0.9rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  color: #5a4010;
  font-size: 0.95rem;
}
.banner-appartenance {
  background: #e8d4e8;
  border-color: #b070b0;
  border-left-color: #8b3a8b;
  color: #4a204a;
}
.banner-restriction {
  background: #e6ddc4;
  border-color: #b89a50;
  border-left-color: #8a6a20;
  color: #4a3a10;
}

/* Badges de restriction métier */
.badge.restriction-nationalite { background: #cfe0d0; color: #2c4a30; border-color: #8fb595; }
.badge.restriction-societe { background: #d0d4ec; color: #2c2c5a; border-color: #9098cc; }

.niveau-bloc {
  margin-bottom: 1.2rem;
  padding: 0.7rem 0.9rem;
  background: #faf3df;
  border-radius: var(--radius);
  border-left: 3px solid var(--accent-soft);
}
.niveau-bloc:last-child { margin-bottom: 0; }

.niveau-titre {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.niveau-fluff {
  margin: 0 0 0.5rem;
  font-style: italic;
  color: var(--ink-soft);
}

.niveau-regles {
  background: #fffbf0;
  padding: 0.5rem 0.7rem;
  border-radius: 4px;
  border: 1px dashed var(--border);
  font-size: 0.93rem;
}
.niveau-regles-label {
  font-weight: 600;
  color: var(--accent);
}

.technique-desc p {
  margin: 0 0 0.4rem;
  font-size: 0.93rem;
  color: var(--ink-soft);
}
.technique-desc p:last-child { margin-bottom: 0; }

.technique-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.6rem;
  font-size: 0.88rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
}
.technique-table th,
.technique-table td {
  padding: 0.35rem 0.6rem;
  text-align: left;
  border-bottom: 1px solid var(--border-soft);
  color: var(--ink);
}
.technique-table th {
  background: #efe5cc;
  font-weight: 600;
  color: var(--accent);
}
.technique-table tr:last-child td { border-bottom: none; }

.technique-item {
  margin-bottom: 0.9rem;
  padding-left: 0.8rem;
  border-left: 2px solid var(--border-soft);
}
.technique-item .technique-nom {
  font-weight: 600;
  color: var(--ink);
}
.technique-item .technique-variante {
  font-weight: normal;
  color: var(--ink-mute);
  font-style: italic;
}
.technique-item .technique-desc {
  margin: 0.3rem 0 0;
  color: var(--ink-soft);
}
.technique-item .technique-missing {
  margin: 0.2rem 0 0;
  font-size: 0.85rem;
  color: var(--ink-mute);
  font-style: italic;
}

.avantage-niveau {
  margin-bottom: 0.7rem;
}
.avantage-niveau .niveau-label {
  font-weight: 600;
  color: var(--accent);
  font-size: 0.95rem;
}
.avantage-niveau p {
  margin: 0.2rem 0 0;
  color: var(--ink-soft);
}
.avantage-niveau .avantage-vide {
  color: var(--ink-mute);
  font-style: italic;
}

/* ===== Responsive ===== */
@media (max-width: 760px) {
  .layout {
    grid-template-columns: 1fr;
    padding: 0 0.8rem;
    margin-top: 1rem;
  }
  .filters {
    position: static;
    display: none;
    max-height: none;   /* sur mobile, le panneau déplié coule naturellement */
    overflow-y: visible;
  }
  .filters.is-open { display: block; }

  .filters-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.7rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    font: inherit;
    font-size: 0.95rem;
    color: var(--ink);
    box-shadow: var(--shadow);
  }
  .filters-toggle-count {
    margin-left: auto;
    background: var(--accent);
    color: #fffbf0;
    padding: 0.1rem 0.55rem;
    border-radius: 999px;
    font-size: 0.8rem;
  }

  .topbar h1 { font-size: 1.3rem; }
  .ecoles-grid { grid-template-columns: 1fr; }
  .ecole-detail { padding: 1rem; }
  .detail-header h2 { font-size: 1.4rem; }

  /* Menu : passe en hamburger (caché par défaut, ouvert via toggle) */
  .menu-toggle { display: inline-block; }
  .main-menu {
    display: none;
    flex-direction: column;
    padding: 0;
  }
  .main-menu.is-open { display: flex; }
  .main-menu .menu-item {
    padding: 0.7rem 1rem;
    text-align: left;
    border-bottom: 1px solid #2c1810;
  }
  .main-menu .menu-item.is-current {
    border-bottom-color: var(--accent-soft);
  }

  /* Dropdown mobile : aplati en accordéon visuel dans le hamburger. */
  .menu-dropdown { display: block; }
  .menu-dropdown-button {
    display: block;
    width: 100%;
    text-align: left;
    padding: 0.7rem 1rem;
    border-bottom: 1px solid #2c1810;
  }
  .menu-dropdown-panel {
    display: flex;
    position: static;
    min-width: 0;
    background: rgba(0,0,0,0.18);
    border: none;
    box-shadow: none;
    padding: 0;
  }
  .menu-dropdown .menu-dropdown-caret { display: none; }
  .menu-dropdown-item {
    padding: 0.7rem 1rem 0.7rem 2rem;
    border-bottom: 1px solid #2c1810;
    white-space: normal;
  }
}

/* ===== Page Compétences : liens cliquables vers spécialisations ===== */
.specialisations-line {
  margin: 0;
  line-height: 1.7;
}
.specialisations-line .specialisation-link {
  color: var(--accent);
  text-decoration: underline dotted;
  text-underline-offset: 3px;
}
.specialisations-line .specialisation-link:hover {
  color: var(--accent-soft);
  text-decoration: underline solid;
}
.specialisations-line .specialisation-text {
  color: var(--ink-soft);
}

/* ===== Page Entraînements : compétences ===== */
.competence-section {
  margin-bottom: 1rem;
  padding: 0.7rem 0.9rem;
  background: #faf3df;
  border-radius: var(--radius);
  border-left: 3px solid var(--accent-soft);
}
.competence-section.competence-avancee {
  border-left-color: #c68a30;
  background: #fdf3d8;
}
.competence-section h4 {
  margin: 0 0 0.4rem;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
}
.competence-list {
  list-style: disc inside;
  margin: 0;
  padding: 0;
  color: var(--ink);
}
.competence-list li {
  margin: 0.15rem 0;
  font-size: 0.95rem;
}

/* ===== Page d'accueil ===== */
.home-main {
  max-width: 1100px;
  margin: 1.5rem auto;
  padding: 0 1.25rem;
}
.home-intro {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow);
}
.home-intro h2 {
  color: var(--accent);
  font-size: 1.4rem;
  margin: 0 0 0.5rem;
}
.home-intro p { margin: 0; color: var(--ink-soft); }

.home-group-title {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  margin: 1.5rem 0 0.6rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid var(--border-soft);
}

.home-grid {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.8rem;
}

.home-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.4rem;
  min-height: 76px;
  box-shadow: var(--shadow);
  transition: transform 0.12s, box-shadow 0.12s;
}
.home-card-link {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.4rem;
  text-decoration: none;
  color: inherit;
  flex: 1;
}
.home-card:hover:not(.is-disabled) {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}
.home-card.is-disabled {
  background: #f0e8d4;
  border-left-color: #b8a888;
  color: var(--ink-mute);
  opacity: 0.65;
}
.home-card-label {
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--ink);
}
.home-card.is-disabled .home-card-label { color: var(--ink-mute); }
.home-card-cta {
  font-size: 0.85rem;
  color: var(--accent);
  font-style: italic;
}
.home-card-tag {
  font-size: 0.75rem;
  color: var(--ink-mute);
  background: #ddd0b8;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  align-self: flex-start;
  font-family: -apple-system, system-ui, sans-serif;
}

/* ====== Page Avantages ====== */
.avant-card .arme.avant-cout {
  font-family: 'Cinzel', Georgia, serif;
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.03em;
}
.avant-badge-v2 {
  background: rgba(201, 168, 97, 0.22);
  color: #c9a861;
  border: 1px solid rgba(201, 168, 97, 0.35);
}
.avant-badge-h {
  background: rgba(195, 70, 70, 0.18);
  color: #e29191;
  border: 1px solid rgba(195, 70, 70, 0.35);
  font-weight: 700;
}
.avant-badge-restrict {
  background: rgba(195, 70, 70, 0.14);
  color: #e29191;
  border: 1px solid rgba(195, 70, 70, 0.35);
}
.avant-badge-reduc {
  background: rgba(127, 190, 112, 0.14);
  color: #9fd28b;
  border: 1px solid rgba(127, 190, 112, 0.35);
}
.avant-cout-detail {
  font-family: 'Cinzel', Georgia, serif;
  font-weight: 700;
  color: var(--accent);
  font-size: 1.05rem;
  letter-spacing: 0.04em;
}
.avant-section-nation {
  background: rgba(232, 212, 168, 0.06);
  border-left: 3px solid var(--accent-soft);
  border-radius: 0 4px 4px 0;
  padding: 0.5rem 0.8rem;
}
