/* ════════════════════════════════════════
   CATALOGUE — refonte complète
   ════════════════════════════════════════ */

.catalogue-contenu {
  max-width: 1500px;
  margin: 0 auto;
  padding: 0 40px 100px;
}

/* ── Header ── */
.catalogue-header {
  padding: 48px 0 36px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 28px;
}

.catalogue-header h2 {
  font-size: 42px;
  font-weight: 800;
  color: var(--text);
  margin: 0;
  line-height: 1;
  letter-spacing: -1.5px;
}

.catalogue-header-sub {
  font-size: 13px;
  color: var(--text-dim);
  font-weight: 500;
  padding-bottom: 6px;
}

.catalogue-header-titre {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* ── Bouton « Les classiques » : mis en avant, à part des filtres ── */
.bouton-classiques {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 12px 22px;
  border: none;
  border-radius: var(--radius-pill);
  cursor: pointer;
  color: #fff;
  background: linear-gradient(120deg, #f6c945 0%, #f47521 55%, #ff5d8f 100%);
  box-shadow: 0 6px 20px rgba(244, 117, 33, 0.35);
  transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease), filter 0.18s var(--ease);
  flex-shrink: 0;
}
.bouton-classiques:hover { transform: translateY(-2px); box-shadow: 0 9px 26px rgba(244, 117, 33, 0.5); }
.bouton-classiques .bc-etoile { font-size: 24px; line-height: 1; filter: drop-shadow(0 1px 2px rgba(0,0,0,.3)); }
.bouton-classiques .bc-texte,
.bouton-random .bc-texte {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.2px;
}
.bouton-classiques .bc-texte small,
.bouton-random .bc-texte small {
  font-size: 11px;
  font-weight: 600;
  opacity: 0.9;
}
.bouton-classiques.actif {
  background: var(--surface-2, #1a1a20);
  color: var(--text);
  box-shadow: inset 0 0 0 2px #f6c945;
}
.bouton-classiques.actif .bc-etoile { color: #f6c945; }

.catalogue-boutons-speciaux { display: flex; gap: 12px; flex-wrap: wrap; flex-shrink: 0; }

/* Bouton « Au hasard » : même gabarit, teinte violette pour le distinguer */
.bouton-random {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 12px 22px;
  border: none;
  border-radius: var(--radius-pill);
  cursor: pointer;
  color: #fff;
  background: linear-gradient(120deg, #7c3aed 0%, #4f46e5 55%, #2563eb 100%);
  box-shadow: 0 6px 20px rgba(124, 58, 237, 0.35);
  transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease), filter 0.18s var(--ease);
}
.bouton-random:hover { transform: translateY(-2px); box-shadow: 0 9px 26px rgba(124, 58, 237, 0.5); }
.bouton-random .bc-etoile { font-size: 22px; line-height: 1; }
.bouton-random.charge { filter: grayscale(0.5); pointer-events: none; }
.bouton-random.charge .bc-etoile { animation: dé-tourne 0.6s linear infinite; }
@keyframes dé-tourne { to { transform: rotate(360deg); } }

@media (max-width: 640px) {
  .catalogue-header { flex-direction: column; align-items: flex-start; }
  .bouton-classiques .bc-texte small, .bouton-random .bc-texte small { display: none; }
}

/* ── Layout : filtres en colonne gauche + contenu ── */
.catalogue-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 36px;
  align-items: start;
}
.catalogue-layout.sans-sidebar { grid-template-columns: 1fr; }

.catalogue-layout-principal { min-width: 0; }

/* ── Filtres : sticky, genres en grille 2 colonnes pour combler l'espace ── */
.filtre-side-wrap {
  position: sticky;
  top: 90px;
  border-right: 1px solid var(--border);
  padding-right: 20px;
}

.filtre-bar { display: block; }

.filtre-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filtre-entete {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 10px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.filtre-titre-section {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 6px;
}

.filtre-compteur {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  background: var(--rose);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  border-radius: 0;
}

.filtre-reset {
  background: none;
  border: none;
  color: var(--text-faint);
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  cursor: pointer;
  padding: 0;
  transition: color .15s;
}

.filtre-reset:hover { color: var(--rose); }

/* ── Pastilles de genre ── */
.filtre-chip {
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text-dim);
  border-radius: 20px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font-corps);
  cursor: pointer;
  transition: background .15s var(--ease), color .15s var(--ease),
              border-color .15s var(--ease);
}
.filtre-chip:hover {
  color: #fff;
  border-color: var(--accent);
}
.filtre-chip.actif {
  background: var(--accent);
  border-color: transparent;
  color: #fff;
  font-weight: 700;
}

/* ── Grille 4 colonnes max ── */
.catalogue-grille {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

@media (max-width: 1300px) { .catalogue-grille { grid-template-columns: repeat(3, 1fr); } }
@media (max-width:  900px) {
  .catalogue-layout { grid-template-columns: 1fr; }
  .filtre-side-wrap {
    position: static;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding-right: 0;
    padding-bottom: 16px;
    margin-bottom: 20px;
  }
  .filtre-bar {
    grid-template-columns: repeat(3, 1fr);
  }
  .catalogue-grille { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width:  580px) { .catalogue-grille { grid-template-columns: repeat(2, 1fr); gap: 12px; } }

/* ── Carte streaming : arrondie, ombre, survol qui soulève ── */
.catalogue-carte {
  position: relative;
  background: var(--surface-card);
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}

.catalogue-carte::before { content: none; }

.catalogue-carte:hover {
  transform: scale(1.04);
  box-shadow: var(--shadow-glow-violet);
  z-index: 5;
}

/* Poster */
.catalogue-carte-poster {
  display: block;
  position: relative;
  width: 100%;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  text-decoration: none;
  background: var(--surface-2);
}

.catalogue-carte-poster img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .35s var(--ease);
}

.catalogue-carte:hover .catalogue-carte-poster img { transform: scale(1.06); }

.catalogue-carte-poster::after { content: none; }
.catalogue-carte-poster .carte-titre-img { display: none; }

/* Note : badge cyan flottant en haut-droite (design exporté) */
.catalogue-carte-note {
  position: absolute;
  top: 6px; right: 6px;
  z-index: 2;
  background: var(--cyan);
  border: none;
  border-radius: 4px;
  color: #08181a;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 6px;
  letter-spacing: 0;
}

/* Bande basse du poster : SUB à gauche, bouton statut/▶ à droite */
.cc-bas {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  background: rgba(8, 7, 12, 0.6);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

.cc-sub {
  font-size: 9px;
  font-weight: 800;
  color: #fff;
  background: rgba(124, 58, 237, 0.9);
  padding: 2px 5px;
  border-radius: 3px;
}

.catalogue-action {
  background: none;
  border: none;
  padding: 0;
  width: 20px; height: 20px;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform .15s var(--ease);
}

.catalogue-action:hover { transform: scale(1.2); }

.catalogue-carte .statut-menu {
  position: absolute;
  top: auto;
  bottom: 44px;
  right: 8px;
  z-index: 10;
}

.catalogue-carte .statut-option-retirer { color: var(--rouge); }

/* Info bar sous le poster */
.catalogue-carte-info {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  background: transparent;
}

.catalogue-carte-titre {
  font-size: 14px;
  font-weight: 800;
  font-family: var(--font-corps);
  color: #fff;
  text-decoration: none;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color .15s;
}

.catalogue-carte:hover .catalogue-carte-titre { color: var(--accent-2); }

.catalogue-carte-meta {
  font-size: 11px;
  color: var(--text-dim);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.catalogue-carte-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.catalogue-carte-tag {
  font-size: 9px;
  font-weight: 700;
  color: #c4b5fd;
  background: rgba(124, 58, 237, 0.22);
  border: none;
  border-radius: 10px;
  padding: 2px 7px;
}

/* ── Pagination ── */
.catalogue-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 60px;
}

.catalogue-pagination button {
  background: var(--surface-glass);
  border: 1.5px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  padding: 10px 26px;
  cursor: pointer;
  transition: all .2s;
}

.catalogue-pagination button:hover:not(:disabled) {
  border-color: var(--rose);
  background: color-mix(in srgb, var(--rose) 10%, transparent);
  color: var(--rose);
}

.catalogue-pagination button:disabled { opacity: 0.25; cursor: not-allowed; }

.catalogue-page-label {
  font-size: 13px;
  color: var(--text-dim);
  min-width: 130px;
  text-align: center;
}

.catalogue-page-saut {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-dim);
}

.catalogue-page-total {
  font-weight: 600;
  color: var(--text);
}

.catalogue-page-saut input {
  width: 64px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 2px solid var(--border-strong);
  color: var(--text);
  font-size: 13px;
  padding: 8px 8px;
  text-align: center;
  -moz-appearance: textfield;
}
.catalogue-page-saut input::-webkit-inner-spin-button,
.catalogue-page-saut input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.catalogue-page-saut input:focus { outline: none; border-left-color: var(--rose); }

.catalogue-page-saut button {
  padding: 8px 16px !important;
  border-radius: 0 !important;
}

@media (max-width: 640px) {
  .catalogue-pagination { flex-wrap: wrap; }
}

.chargement, .aucun-resultat {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--text-dim);
  padding: 100px 0;
  font-size: 14px;
}

.erreur-externe {
  grid-column: 1 / -1;
  text-align: center;
  padding: 90px 24px;
  max-width: 460px;
  margin: 0 auto;
}

.erreur-externe-titre {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 8px;
}

.erreur-externe-texte {
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.5;
  margin: 0 0 20px;
}

.erreur-externe-retry {
  background: transparent;
  border: 1px solid var(--rose);
  color: var(--rose);
  border-radius: 0;
  padding: 9px 20px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background .15s, color .15s;
}

.erreur-externe-retry:hover {
  background: var(--rose);
  color: #fff;
}

/* Toggle « Uniquement +18 » (propriétaire uniquement) */
.filtre-adulte {
  display: block;
  width: 100%;
  text-align: center;
  border: 1px solid rgba(244, 114, 182, 0.45);
  background: rgba(244, 114, 182, 0.08);
  color: var(--text-dim);
  border-radius: var(--radius-pill);
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  margin-bottom: 16px;
  transition: background 0.15s var(--ease), color 0.15s var(--ease), border-color 0.15s var(--ease), transform 0.12s var(--ease);
}
.filtre-adulte:hover { transform: translateY(-1px); color: var(--text); }
.filtre-adulte.actif {
  background: linear-gradient(120deg, #f472b6 0%, #db2777 100%);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 14px rgba(219, 39, 119, 0.35);
}

/* Toggle « Manhwa +18 » : teinte verte pour le distinguer du +18 rose */
.filtre-manhwa { border-color: rgba(52, 211, 153, 0.45); background: rgba(52, 211, 153, 0.08); }
.filtre-manhwa.actif {
  background: linear-gradient(120deg, #34d399 0%, #059669 100%);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 14px rgba(5, 150, 105, 0.35);
}

/* Tri (modes +18 / manhwa) */
.filtre-tri-titre {
  font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-dim); margin: 2px 0 8px;
}
.filtre-tri { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.filtre-tri-chip {
  border: 1px solid var(--border);
  background: var(--surface-glass);
  color: var(--text-dim);
  border-radius: var(--radius-pill);
  padding: 6px 12px; font-size: 12px; font-weight: 700; cursor: pointer;
  transition: background .15s var(--ease), color .15s var(--ease), border-color .15s var(--ease);
}
.filtre-tri-chip:hover { color: var(--text); border-color: var(--accent); }
.filtre-tri-chip.actif { background: var(--gradient-principal); border-color: transparent; color: #fff; }
.filtre-chip-adulte.actif { background: linear-gradient(120deg,#f472b6,#db2777) !important; }

/* ---- Espace Manhwa : accueil, nouveautés, classements ---- */
.mw-section { margin-bottom: 42px; }
.mw-section-entete { margin-bottom: 16px; }
.mw-section-entete h3 {
  font-size: 20px; font-weight: 800; margin: 0;
  display: flex; align-items: center; gap: 8px;
}
.mw-section-note { color: var(--text-dim); font-size: 13px; margin: 4px 0 0; }

.mw-tabs { display: flex; flex-wrap: wrap; gap: 10px; margin: 4px 0 26px; }
.mw-tab {
  padding: 9px 18px; border-radius: 999px; cursor: pointer;
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text-dim); font-size: 14px; font-weight: 600;
  transition: background .15s, color .15s, border-color .15s;
}
.mw-tab:hover { color: var(--text); border-color: var(--border-strong); }
.mw-tab.actif { background: var(--gradient-principal); border-color: transparent; color: #fff; }

/* Badge de rang pour les classements */
.catalogue-carte { position: relative; }
.mw-rang {
  position: absolute; top: 8px; left: 8px; z-index: 3;
  min-width: 26px; height: 26px; padding: 0 7px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 999px; font-size: 13px; font-weight: 800; color: #fff;
  background: rgba(17, 17, 27, 0.82); border: 1px solid rgba(255,255,255,0.18);
  backdrop-filter: blur(4px);
}

/* Drapeau pays : coin haut-gauche de la carte catalogue.
   Sélecteur qualifié pour battre « .catalogue-carte-poster img » (sinon le
   drapeau prend 100% du poster). */
.catalogue-carte-poster img.cc-drapeau {
  position: absolute;
  top: 6px; left: 6px;
  z-index: 2;
  width: 24px; height: 16px;
  object-fit: cover;
  border-radius: 3px;
  box-shadow: 0 1px 3px rgba(0,0,0,.6);
  transition: none;
}

/* Badge « disponible sur MangaDex » (couleur de marque) */
.mw-md-badge {
  position: absolute;
  left: 6px; bottom: 6px;
  z-index: 2;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.04em;
  color: #fff;
  background: #ff6740;
  padding: 2px 6px;
  border-radius: 4px;
  box-shadow: 0 1px 4px rgba(0,0,0,.5);
}

/* Filtres personnels (mon suivi / type) — appliqués sur la page affichée. */
.filtre-info-locale {
  font-size: 11px; color: var(--orange, #f59e0b);
  margin: 8px 0 0; font-style: italic;
}
.filtre-info-locale[hidden] { display: none; }
.filtre-astuce { font-size: 12px; color: var(--text-faint); }

/* Prochaine diffusion mise en avant sur la carte (vue « mes sorties »). */
.catalogue-carte-meta { line-height: 1.35; }

/* ════════ Roulette « Au hasard » (style CS:GO) ════════ */
.roulette-overlay {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(6, 5, 12, .88); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.roulette-boite {
  width: 100%; max-width: 900px;
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: 18px; padding: 26px 28px 22px;
  box-shadow: 0 30px 80px rgba(0,0,0,.7);
}
.roulette-titre {
  margin: 0 0 18px; font-size: 19px; font-weight: 800;
  color: var(--text); text-align: center;
}

/* Piste : fenêtre qui masque le ruban défilant */
.roulette-piste {
  position: relative; overflow: hidden;
  border-radius: 12px; padding: 14px 0;
  background: var(--surface-2);
  border: 1px solid var(--border);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}
.roulette-ruban { display: flex; gap: 12px; will-change: transform; }

.roulette-case {
  position: relative; flex: 0 0 160px; width: 160px;
  border-radius: 10px; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border);
  transition: box-shadow .3s var(--ease), transform .3s var(--ease);
}
.roulette-case img {
  width: 100%; height: 210px; object-fit: cover; display: block;
}
.roulette-case .rc-titre {
  display: block; padding: 7px 9px; font-size: 11px; font-weight: 700;
  color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.roulette-case.gagnante {
  box-shadow: 0 0 0 3px #f6c945, 0 0 30px rgba(246, 201, 69, .6);
  transform: scale(1.03);
}
.roulette-case.gagnante .rc-titre { color: #f6c945; }

/* Marqueur central */
.roulette-marqueur {
  position: absolute; top: 0; bottom: 0; left: 50%; width: 3px;
  margin-left: -1.5px; z-index: 3;
  background: linear-gradient(180deg, #ff5d8f, #f6c945);
  box-shadow: 0 0 14px rgba(246, 201, 69, .9);
}
.roulette-marqueur::before, .roulette-marqueur::after {
  content: ""; position: absolute; left: 50%; transform: translateX(-50%);
  border-left: 7px solid transparent; border-right: 7px solid transparent;
}
.roulette-marqueur::before { top: -1px; border-top: 9px solid #f6c945; }
.roulette-marqueur::after { bottom: -1px; border-bottom: 9px solid #f6c945; }

/* Résultat */
.roulette-resultat {
  display: flex; align-items: center; gap: 18px; margin-top: 20px;
  padding: 16px; border-radius: 12px;
  background: var(--surface-2); border: 1px solid rgba(246, 201, 69, .35);
  animation: pop-in .3s var(--ease);
}
.roulette-resultat[hidden] { display: none; }
.rr-img { width: 74px; border-radius: 8px; flex-shrink: 0; }
.rr-infos { flex: 1; min-width: 0; }
.rr-titre { margin: 0 0 3px; font-size: 17px; font-weight: 800; color: var(--text); }
.rr-meta { margin: 0 0 12px; font-size: 12.5px; color: var(--text-dim); }
.rr-boutons { display: flex; gap: 10px; flex-wrap: wrap; }
.rr-voir, .rr-relancer {
  border-radius: 999px; padding: 10px 20px; font-size: 13.5px;
  font-weight: 700; cursor: pointer; border: none; font-family: inherit;
  text-decoration: none; display: inline-block;
}
.rr-voir { background: var(--gradient-principal); color: #fff; }
.rr-voir:hover { filter: brightness(1.1); }
.rr-relancer { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.rr-relancer:hover { background: var(--border-strong); }

.roulette-actions { display: flex; justify-content: center; margin-top: 16px; }
.roulette-btn-fermer {
  background: none; border: none; color: var(--text-faint);
  font-size: 12.5px; cursor: pointer; font-family: inherit;
}
.roulette-btn-fermer:hover { color: var(--text); }

@media (max-width: 600px) {
  .roulette-case { flex: 0 0 110px; width: 110px; }
  .roulette-case img { height: 150px; }
  .roulette-resultat { flex-direction: column; text-align: center; }
}

/* Interrupteurs Animation / Son, empilés à côté du bouton Au hasard */
.roulette-options {
  display: flex; flex-direction: column; gap: 8px;
  align-self: center; padding-left: 4px;
}
.switch-ligne {
  display: flex; align-items: center; gap: 9px;
  cursor: pointer; user-select: none;
}
.switch-ligne input { position: absolute; opacity: 0; pointer-events: none; }

.switch {
  position: relative; flex-shrink: 0;
  width: 38px; height: 21px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--border);
  transition: background .3s var(--ease), border-color .3s var(--ease),
              box-shadow .3s var(--ease);
}
.switch-bille {
  position: absolute; top: 2px; left: 2px;
  width: 15px; height: 15px; border-radius: 50%;
  background: var(--text-faint);
  transition: transform .32s cubic-bezier(.34, 1.56, .64, 1),
              background .3s var(--ease), box-shadow .3s var(--ease);
}
/* Activé : bascule + halo violet */
.switch-ligne input:checked + .switch {
  background: var(--gradient-principal, #7c3aed);
  border-color: transparent;
  box-shadow: 0 0 12px rgba(124, 58, 237, .55);
}
.switch-ligne input:checked + .switch .switch-bille {
  transform: translateX(17px);
  background: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,.4);
}
.switch-ligne:active .switch-bille { width: 19px; }   /* léger étirement au clic */
.switch-ligne input:focus-visible + .switch { outline: 2px solid var(--accent, #7c3aed); outline-offset: 2px; }

.switch-txt {
  font-size: 12px; font-weight: 600; color: var(--text-faint);
  white-space: nowrap; transition: color .25s var(--ease);
}
.switch-ligne input:checked ~ .switch-txt { color: var(--text); }
.switch-ligne:hover .switch-txt { color: var(--text); }

@media (max-width: 640px) {
  .roulette-options { flex-direction: row; gap: 14px; padding-left: 0; }
}

/* Genres + description dans le résultat de la roulette */
.rr-genres { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.rr-genre {
  background: var(--surface); border: 1px solid var(--border); color: var(--text-dim);
  border-radius: 999px; padding: 3px 10px; font-size: 11px; font-weight: 600;
}
.rr-desc {
  margin: 0 0 12px; font-size: 12.5px; line-height: 1.5; color: var(--text-dim);
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden;
}
.roulette-resultat { align-items: flex-start; }
.rr-img { width: 100px; }

/* Confettis superposés à la boîte de résultat */
.roulette-boite { position: relative; }
.roulette-confettis {
  position: absolute; inset: 0; pointer-events: none; z-index: 10;
}

/* Switch FR/EN dans le résultat de la roulette (styles de base dans anime.css,
   dupliqués ici car le catalogue ne charge pas cette feuille). */
.rr-langue-switch { margin-bottom: 8px; }
.langue-switch {
  position: relative; display: inline-flex;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 999px; padding: 3px;
}
.langue-btn {
  position: relative; z-index: 2;
  background: none; border: none; cursor: pointer;
  padding: 4px 14px; border-radius: 999px;
  font-size: 11px; font-weight: 800; letter-spacing: .04em;
  color: var(--text-faint); font-family: var(--font-corps);
  transition: color .25s var(--ease);
}
.langue-btn.actif { color: #fff; }
.langue-btn:disabled { opacity: .35; cursor: not-allowed; }
.langue-btn:not(.actif):not(:disabled):hover { color: var(--text); }
.langue-glisseur {
  position: absolute; z-index: 1; top: 3px; bottom: 3px; left: 3px;
  width: calc(50% - 3px); border-radius: 999px;
  background: var(--gradient-principal, #7c3aed);
  box-shadow: 0 0 10px rgba(124,58,237,.5);
  transition: transform .3s cubic-bezier(.34, 1.4, .64, 1);
}
.langue-switch[data-langue="en"] .langue-glisseur { transform: translateX(100%); }
.rr-desc { transition: opacity .13s var(--ease); }
.rr-desc.synopsis-fondu { opacity: 0; }

/* Bouton FR pendant la traduction : ⏳ + chrono en centièmes */
.langue-btn.langue-attente {
  color: var(--orange, #f59e0b);
  font-variant-numeric: tabular-nums;   /* chiffres de largeur fixe : pas de tremblement */
  min-width: 68px;
  animation: langue-pulse 1.1s ease-in-out infinite;
}
@keyframes langue-pulse {
  0%, 100% { opacity: .5; }
  50%      { opacity: .95; }
}

.erreur-externe-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 6px; }

/* Niveau d'attente — cinq flammes, la dernière partiellement remplie. */
.cc-attente { margin-top: 8px; }

.cc-attente-tete {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  font-size: 9.5px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.cc-attente-tete b {
  font-size: 10px;
  font-weight: 700;
  color: #ff8a3d;
  letter-spacing: .02em;
  text-transform: none;
  white-space: nowrap;
}

.cc-flammes { display: flex; gap: 3px; margin-top: 5px; }

.cc-flamme {
  font-style: normal;
  font-size: 12px;
  line-height: 1;
  position: relative;
  /* Éteinte : désaturée et estompée, pour que seules les allumées se voient. */
  filter: grayscale(1);
  opacity: .28;
}

.cc-flamme.pleine { filter: none; opacity: 1; }

/* Remplissage partiel : on masque la fin de la flamme avec la couleur de la
   carte, ce qui donne une demi-flamme sans dupliquer l'icône. */
.cc-flamme.pleine[style*="--part"]::after {
  content: "";
  position: absolute;
  inset: 0 0 0 var(--part);
  background: var(--surface);
  opacity: .78;
}

/* --- Carte « brûlante » : palier d'attente le plus haut ------------------
   Contour animé obtenu par deux fonds superposés — l'un peint l'intérieur,
   l'autre la bordure — plutôt qu'un élément qui tourne : pas de débordement
   à masquer, et le navigateur n'anime qu'une position de dégradé. */
.catalogue-carte.carte-brulante {
  border: 1.5px solid transparent;
  background-image:
    linear-gradient(var(--surface-card), var(--surface-card)),
    linear-gradient(100deg, #ff5f6d 0%, #ffb03a 25%, #ff5f6d 50%, #ffb03a 75%, #ff5f6d 100%);
  background-origin: border-box;
  background-clip: padding-box, border-box;
  background-size: 100% 100%, 300% 100%;
  animation: brulant-defile 6s linear infinite;
  box-shadow: 0 0 0 1px rgba(255, 138, 61, .1), 0 8px 26px -14px rgba(255, 95, 109, .85);
}

@keyframes brulant-defile {
  to { background-position: 0 0, 300% 0; }
}

.catalogue-carte.carte-brulante:hover {
  box-shadow: 0 0 0 1px rgba(255, 138, 61, .25), 0 14px 34px -12px rgba(255, 95, 109, 1);
}

/* Le libellé et les flammes reprennent la même chaleur. */
.carte-brulante .cc-attente-tete b {
  color: #ffb03a;
  text-shadow: 0 0 10px rgba(255, 138, 61, .5);
}

.carte-brulante .cc-flamme.pleine { animation: brulant-vacille 2.4s ease-in-out infinite; }
.carte-brulante .cc-flamme.pleine:nth-child(2) { animation-delay: .18s; }
.carte-brulante .cc-flamme.pleine:nth-child(3) { animation-delay: .36s; }
.carte-brulante .cc-flamme.pleine:nth-child(4) { animation-delay: .54s; }
.carte-brulante .cc-flamme.pleine:nth-child(5) { animation-delay: .72s; }

/* Vacillement très léger : une flamme bouge, elle ne sautille pas. */
@keyframes brulant-vacille {
  0%, 100% { transform: translateY(0) scale(1); }
  50%      { transform: translateY(-1px) scale(1.09); }
}

@media (prefers-reduced-motion: reduce) {
  html:not([data-anim="on"]) .catalogue-carte.carte-brulante,
  html:not([data-anim="on"]) .carte-brulante .cc-flamme.pleine { animation: none; }
}

/* ======================================================================
   Carte « légendaire » — le titre le plus attendu de son horizon.
   Un seul par période : c'est la rareté qui autorise l'excès.
   ====================================================================== */
.catalogue-carte.carte-legendaire {
  border-width: 2px;
  background-size: 100% 100%, 220% 100%;
  animation: brulant-defile 3s linear infinite,
             legendaire-souffle 3.6s ease-in-out infinite;
  z-index: 2;
}

/* L'aura respire au lieu de rester allumée : une lueur fixe se remarque
   moins qu'une lueur qui varie. */
@keyframes legendaire-souffle {
  0%, 100% { box-shadow: 0 0 0 1px rgba(255, 176, 58, .3),
                         0 10px 30px -14px rgba(255, 95, 109, .9),
                         0 0 26px -6px rgba(255, 138, 61, .35); }
  50%      { box-shadow: 0 0 0 1px rgba(255, 176, 58, .55),
                         0 14px 42px -12px rgba(255, 95, 109, 1),
                         0 0 46px -4px rgba(255, 138, 61, .7); }
}

.catalogue-carte.carte-legendaire:hover { animation-play-state: running; }

/* Ruban d'annonce, en haut de la jaquette */
.cc-couronne {
  position: absolute;
  /* Sous le drapeau du pays (6 px + 16 px de haut) plutôt que par-dessus. */
  top: 28px;
  left: 6px;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: var(--radius-pill, 999px);
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: .04em;
  color: #2a1103;
  background: linear-gradient(100deg, #ffd166, #ff8a3d, #ffd166);
  background-size: 200% 100%;
  animation: brulant-defile 3s linear infinite;
  box-shadow: 0 2px 10px -2px rgba(255, 138, 61, .8);
  white-space: nowrap;
}

/* Reflet qui traverse la jaquette, comme sur une carte à collectionner */
.cc-eclat {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background: linear-gradient(105deg, transparent 38%, rgba(255, 233, 190, .38) 50%, transparent 62%);
  background-size: 250% 100%;
  background-position: 250% 0;
  animation: legendaire-eclat 4.5s ease-in-out infinite;
}

@keyframes legendaire-eclat {
  0%, 62% { background-position: 250% 0; }
  100%    { background-position: -150% 0; }
}

/* Braises qui montent le long de la carte */
.cc-braises {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  overflow: hidden;
  border-radius: inherit;
}

.cc-braises i {
  position: absolute;
  bottom: -6px;
  width: var(--taille, 3px);
  height: var(--taille, 3px);
  border-radius: 50%;
  background: #ffb03a;
  box-shadow: 0 0 6px 1px rgba(255, 138, 61, .9);
  opacity: 0;
  animation: braise-monte var(--duree, 3s) linear var(--retard, 0s) infinite;
}

@keyframes braise-monte {
  0%   { transform: translateY(0) scale(.6); opacity: 0; }
  12%  { opacity: .95; }
  70%  { opacity: .7; }
  100% { transform: translateY(-190px) translateX(8px) scale(.3); opacity: 0; }
}

/* Le libellé d'attente passe en doré plein */
.carte-legendaire .cc-attente-tete b {
  color: #ffd166;
  text-shadow: 0 0 14px rgba(255, 176, 58, .75);
}

@media (prefers-reduced-motion: reduce) {
  html:not([data-anim="on"]) .catalogue-carte.carte-legendaire,
  html:not([data-anim="on"]) .cc-couronne,
  html:not([data-anim="on"]) .cc-eclat { animation: none; }
  /* Le reflet n'existe que par son passage : sans mouvement, il n'a plus
     d'objet. Les braises non plus — une braise immobile n'est qu'un point. */
  html:not([data-anim="on"]) .cc-eclat,
  html:not([data-anim="on"]) .cc-braises { display: none; }
  /* Le contour garde son dégradé, simplement figé. */
  html:not([data-anim="on"]) .catalogue-carte.carte-legendaire { background-position: 0 0, 40% 0; }
}

/* --- Couronne de feu autour de la carte légendaire ----------------------
   Un contour continu déformé par du bruit fractal, et non une série de petites
   flammes : des formes identiques régulièrement espacées font une guirlande,
   jamais du feu. La carte passe en débordement visible pour que le feu sorte
   de ses bords. */
.catalogue-carte.carte-legendaire { overflow: visible; }

.cc-feu {
  position: absolute;
  /* Dimensions explicites, pas `inset` : un SVG est un élément remplacé, il se
     dimensionne sur le ratio de son viewBox et ignore la contrainte basse —
     il manquait 74 px de hauteur, donc tout le feu du bas. */
  top: -16px;
  left: -16px;
  width: calc(100% + 32px);
  height: calc(100% + 32px);
  /* Derrière le fond de la carte, donc visible uniquement autour d'elle :
     le feu ne doit jamais recouvrir la jaquette ni les genres. */
  z-index: -1;
  pointer-events: none;
  overflow: visible;
}

/* Les trois anneaux se relaient en fondu. Chacun est décalé d'un tiers de
   cycle : à tout instant, deux se recouvrent et le troisième s'efface, ce qui
   maintient une luminosité à peu près constante.
   Seule l'opacité est animée — la propriété la moins coûteuse qui soit. */
.cc-feu rect {
  opacity: 0;
  animation: feu-fondu 11s cubic-bezier(.4, 0, .6, 1) infinite;
  will-change: opacity;
}

.cc-feu rect:nth-of-type(1) { animation-delay: 0s; }
.cc-feu rect:nth-of-type(2) { animation-delay: -3.67s; }
.cc-feu rect:nth-of-type(3) { animation-delay: -7.33s; }

@keyframes feu-fondu {
  0%   { opacity: 0; }
  50%  { opacity: .95; }
  100% { opacity: 0; }
}

/* Mouvement réduit : un seul anneau, figé et visible. */
@media (prefers-reduced-motion: reduce) {
  html:not([data-anim="on"]) .cc-feu rect { animation: none; opacity: 0; }
  html:not([data-anim="on"]) .cc-feu rect:nth-of-type(1) { opacity: .92; }
}




/* Réglage « Animations : jamais » — s'impose même sans préférence système. */
html[data-anim="off"] .catalogue-carte.carte-brulante,
html[data-anim="off"] .catalogue-carte.carte-legendaire,
html[data-anim="off"] .cc-couronne,
html[data-anim="off"] .cc-eclat,
html[data-anim="off"] .cc-feu rect,
html[data-anim="off"] .carte-brulante .cc-flamme.pleine { animation: none; }
html[data-anim="off"] .cc-eclat,
html[data-anim="off"] .cc-braises { display: none; }
html[data-anim="off"] .cc-feu rect { opacity: 0; }
html[data-anim="off"] .cc-feu rect:nth-of-type(1) { opacity: .92; }
