/* === 99 Noms Divins — al-Asmāʾ al-Ḥusnā === */

.noms-intro {
  max-width: 760px;
  margin: 0 auto var(--space-xl);
  text-align: center;
}
.noms-intro p {
  color: var(--ink-soft);
  font-size: 1.05rem;
  line-height: 1.85;
}

.noms-source {
  background: rgba(184, 134, 11, 0.06);
  border-left: 3px solid var(--gold);
  padding: var(--space-md) var(--space-lg);
  margin: var(--space-lg) auto;
  max-width: 760px;
  border-radius: 4px;
}
.noms-source__title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.25rem;
  color: var(--ink-title);
  margin-bottom: .5rem;
}
.noms-source__title-ar {
  font-family: 'Amiri', serif;
  font-size: 1.4rem;
  color: var(--gold);
  display: block;
  margin-top: .25rem;
  direction: rtl;
}
.noms-source p {
  color: var(--ink-soft);
  font-size: .95rem;
  line-height: 1.75;
  margin: 0;
}

/* Filtres thématiques */
.noms-filters {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  justify-content: center;
  margin: var(--space-lg) 0;
}
.noms-filter {
  background: transparent;
  border: 1px solid rgba(15, 24, 48, 0.2);
  color: var(--ink);
  padding: .55rem 1.1rem;
  border-radius: 999px;
  font-family: 'Inter', sans-serif;
  font-size: .88rem;
  cursor: pointer;
  transition: all .25s ease;
  letter-spacing: .02em;
}
.noms-filter:hover { border-color: var(--gold); color: var(--gold); }
.noms-filter.active {
  background: var(--ink-title);
  color: var(--paper);
  border-color: var(--ink-title);
}
.noms-filter[data-theme="jamal"].active { background: var(--rose); border-color: var(--rose); }
.noms-filter[data-theme="jalal"].active { background: var(--turquoise); border-color: var(--turquoise); }
.noms-filter[data-theme="kamal"].active { background: var(--gold); border-color: var(--gold); }

.noms-actions {
  display: flex;
  justify-content: center;
  margin: var(--space-md) 0 var(--space-lg);
}
.noms-random {
  background: var(--ink-title);
  color: var(--paper);
  border: none;
  padding: .8rem 1.6rem;
  border-radius: 999px;
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.05rem;
  letter-spacing: .04em;
  cursor: pointer;
  transition: transform .25s ease, box-shadow .25s ease;
  display: inline-flex;
  align-items: center;
  gap: .6rem;
}
.noms-random:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0,0,0,.15); }

/* Grille des Noms */
.noms-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
  margin: var(--space-lg) 0;
}

.nom-card {
  background: var(--paper);
  border: 1px solid rgba(15, 24, 48, 0.08);
  border-radius: 8px;
  padding: 1.1rem .9rem;
  cursor: pointer;
  text-align: center;
  transition: all .3s cubic-bezier(.2,.7,.3,1);
  position: relative;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0,0,0,.02);
}
.nom-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--gold);
  opacity: 0;
  transition: opacity .3s ease;
}
.nom-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(0,0,0,.08);
  border-color: rgba(184, 134, 11, 0.4);
}
.nom-card:hover::before { opacity: 1; }

.nom-card[data-theme="jamal"]::before { background: var(--rose); }
.nom-card[data-theme="jalal"]::before { background: var(--turquoise); }
.nom-card[data-theme="kamal"]::before { background: var(--gold); }

.nom-card.dim { opacity: .25; pointer-events: none; }

.nom-card__num {
  font-family: 'Inter', sans-serif;
  font-size: .72rem;
  color: var(--ink-soft);
  letter-spacing: .12em;
  margin-bottom: .4rem;
}
.nom-card__ar {
  font-family: 'Amiri', serif;
  font-size: 1.85rem;
  color: var(--ink-title);
  line-height: 1.4;
  direction: rtl;
  margin-bottom: .35rem;
}
.nom-card__tr {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 1.1rem;
  color: var(--gold);
  margin-bottom: .25rem;
}
.nom-card__fr {
  font-family: 'Source Serif 4', serif;
  font-size: .85rem;
  color: var(--ink-soft);
  line-height: 1.4;
}

/* Modal — fiche détaillée */
.nom-modal {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 1000;
  align-items: flex-start;
  justify-content: center;
  padding: 2rem 1rem;
  overflow-y: auto;
}
.nom-modal.open { display: flex; }
.nom-modal__backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 24, 48, .55);
  backdrop-filter: blur(4px);
}
.nom-modal__content {
  position: relative;
  background: var(--paper);
  max-width: 780px;
  width: 100%;
  border-radius: 12px;
  padding: 3rem 2.5rem 2.5rem;
  box-shadow: 0 25px 60px rgba(0,0,0,.3);
  margin: auto;
}
.nom-modal__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: transparent;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  color: var(--ink-soft);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.nom-modal__close:hover { background: rgba(0,0,0,.05); color: var(--ink); }

.nom-fiche__head { text-align: center; margin-bottom: 2rem; }
.nom-fiche__num {
  font-family: 'Inter', sans-serif;
  font-size: .8rem;
  color: var(--ink-soft);
  letter-spacing: .2em;
  margin-bottom: .6rem;
}
.nom-fiche__ar {
  font-family: 'Amiri', serif;
  font-size: 3.4rem;
  color: var(--ink-title);
  line-height: 1.3;
  direction: rtl;
  margin-bottom: .5rem;
}
.nom-fiche__tr {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 1.8rem;
  color: var(--gold);
  margin-bottom: .3rem;
}
.nom-fiche__fr {
  font-family: 'Source Serif 4', serif;
  font-size: 1.1rem;
  color: var(--ink-soft);
}
.nom-fiche__badge {
  display: inline-block;
  margin-top: 1rem;
  padding: .3rem .9rem;
  border-radius: 999px;
  font-family: 'Inter', sans-serif;
  font-size: .75rem;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.nom-fiche__badge[data-theme="jamal"] { background: rgba(166, 90, 74, .12); color: var(--rose); }
.nom-fiche__badge[data-theme="jalal"] { background: rgba(46, 125, 122, .12); color: var(--turquoise); }
.nom-fiche__badge[data-theme="kamal"] { background: rgba(184, 134, 11, .12); color: var(--gold); }

.nom-fiche__sens {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 1.25rem;
  color: var(--ink-title);
  text-align: center;
  line-height: 1.6;
  padding: 1.2rem 0;
  border-top: 1px solid rgba(0,0,0,.08);
  border-bottom: 1px solid rgba(0,0,0,.08);
  margin-bottom: 2rem;
}

.nom-fiche__section { margin-bottom: 1.8rem; }
.nom-fiche__section h3 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.2rem;
  color: var(--gold);
  margin-bottom: .6rem;
  display: flex;
  align-items: baseline;
  gap: .6rem;
}
.nom-fiche__section h3 span {
  font-family: 'Amiri', serif;
  font-size: 1rem;
  color: var(--ink-soft);
}
.nom-fiche__section p {
  font-family: 'Source Serif 4', serif;
  color: var(--ink);
  line-height: 1.85;
  font-size: 1rem;
}

.nom-fiche__part {
  background: rgba(184, 134, 11, 0.06);
  border-left: 3px solid var(--gold);
  padding: 1rem 1.3rem;
  border-radius: 4px;
}

.nom-fiche__nav {
  display: flex;
  justify-content: space-between;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(0,0,0,.08);
  gap: 1rem;
}
.nom-fiche__nav button {
  background: transparent;
  border: 1px solid rgba(0,0,0,.15);
  padding: .55rem 1rem;
  border-radius: 6px;
  font-family: 'Inter', sans-serif;
  font-size: .85rem;
  cursor: pointer;
  color: var(--ink);
  transition: all .2s ease;
}
.nom-fiche__nav button:hover { border-color: var(--gold); color: var(--gold); }

.nom-fiche__empty {
  text-align: center;
  color: var(--ink-soft);
  font-style: italic;
  padding: 1rem;
  font-size: .92rem;
}

/* === Bouton "Méditer ce Nom" dans la modale === */
.nom-fiche__meditate {
  text-align: center;
  margin-top: 1.2rem;
  padding-top: 1.2rem;
  border-top: 1px dashed rgba(184, 134, 11, 0.2);
}
.nom-fiche__meditate-btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .65rem 1.4rem;
  background: var(--gold);
  color: #fff;
  border: none;
  border-radius: 999px;
  font-family: 'Inter', sans-serif;
  font-size: .9rem;
  letter-spacing: .04em;
  cursor: pointer;
  transition: transform .25s ease, background .25s ease;
}
.nom-fiche__meditate-btn:hover {
  transform: translateY(-2px);
  background: #d4a04b;
}

/* === Mode méditation plein écran (99 Noms) === */
.nom-med-mode {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 2500;
  background: radial-gradient(ellipse at center, #1a1f3a 0%, #0a0c1f 75%);
  color: #FBF7EF;
  flex-direction: column;
  padding: 2rem 1rem;
  overflow-y: auto;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.nom-med-mode__inner {
  max-width: 720px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem 0 4rem;
  pointer-events: none; /* Les enfants à pointer-events:auto pour la zone de tap globale */
}
.nom-med-mode__inner > * { pointer-events: auto; }
.nom-med-mode__tap-feedback {
  position: absolute;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 1.5px solid rgba(184, 134, 11, 0.7);
  pointer-events: none;
  opacity: 0;
  animation: tapPulse 0.6s ease-out forwards;
}
@keyframes tapPulse {
  0% { transform: scale(0.4); opacity: 0.9; }
  100% { transform: scale(1.6); opacity: 0; }
}
.nom-med-mode.open { display: flex; }
.nom-med-mode__close {
  position: absolute;
  top: 2rem;
  right: 2rem;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 50%;
  color: #fff;
  width: 40px;
  height: 40px;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.nom-med-mode__num {
  font-family: 'Inter', sans-serif;
  font-size: .75rem;
  letter-spacing: .2em;
  color: var(--gold);
  margin-bottom: 1rem;
}
.nom-med-mode__ar {
  font-family: 'Amiri', serif;
  font-size: clamp(4rem, 12vw, 7rem);
  color: var(--gold);
  text-align: center;
  line-height: 1.3;
  margin-bottom: .5rem;
  filter: drop-shadow(0 0 35px rgba(184,134,11,0.5));
  direction: rtl;
}
.nom-med-mode__tr {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 1.7rem;
  color: #d4a04b;
  margin-bottom: .3rem;
  text-align: center;
}
.nom-med-mode__fr {
  font-family: 'Source Serif 4', serif;
  font-size: 1.05rem;
  color: rgba(255,255,255,0.7);
  margin-bottom: 1.8rem;
  text-align: center;
}
.nom-med-mode__audio {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: transparent;
  border: 1px solid rgba(184, 134, 11, 0.35);
  border-radius: 50%;
  color: #d4a04b;
  font-size: 0.9rem;
  margin-left: 0.5rem;
  cursor: pointer;
  vertical-align: middle;
  transition: all 0.25s ease;
}
.nom-med-mode__audio:hover {
  background: rgba(184, 134, 11, 0.15);
  border-color: var(--gold);
  color: #fff;
}
.nom-med-mode__audio.is-playing {
  background: rgba(184, 134, 11, 0.25);
  border-color: var(--gold);
}

.nom-med-mode__sens {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: clamp(1.1rem, 2.5vw, 1.35rem);
  color: #FBF7EF;
  max-width: 640px;
  text-align: center;
  line-height: 1.7;
  margin-bottom: 1.5rem;
  opacity: 0.95;
}

.nom-med-mode__meditation {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: clamp(0.95rem, 2vw, 1.05rem);
  color: rgba(251, 247, 239, 0.78);
  max-width: 640px;
  text-align: center;
  line-height: 1.85;
  margin-bottom: 2.5rem;
  padding: 0 1rem;
}
.nom-med-mode__meditation em {
  color: var(--gold);
  font-style: italic;
}

/* === Chapelet (tasbīḥ) === */
.nom-med-mode__tasbih {
  position: relative;
  width: clamp(280px, 65vw, 420px);
  height: clamp(280px, 65vw, 420px);
  margin: 1.5rem 0 0.8rem;
}
.nom-med-mode__tasbih.hidden { display: none; }
.tasbih-bead {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(184, 134, 11, 0.18);
  border: 1px solid rgba(184, 134, 11, 0.25);
  transition: background 0.4s ease, transform 0.3s ease, box-shadow 0.4s ease;
}
.tasbih-bead.filled {
  background: var(--gold);
  border-color: var(--gold);
  box-shadow: 0 0 8px rgba(184, 134, 11, 0.6);
}
.tasbih-bead.last {
  transform: scale(1.4);
  box-shadow: 0 0 16px rgba(212, 160, 75, 0.9);
}
.tasbih-counter {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
}
.tasbih-counter__num {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(4rem, 11vw, 6rem);
  color: var(--gold);
  line-height: 1;
  transition: transform 0.2s ease;
}
.tasbih-counter__num.beat {
  transform: scale(1.08);
}
.tasbih-counter__target {
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  color: rgba(251, 247, 239, 0.45);
  margin-top: 0.3rem;
  text-transform: uppercase;
}

/* Nom répété sous le cercle (pour garder le contact visuel) */
.nom-med-mode__echo {
  text-align: center;
  margin: 0.3rem 0 1.2rem;
  pointer-events: none;
}
.nom-med-mode__echo-ar {
  font-family: 'Amiri', serif;
  font-size: clamp(1.8rem, 4.5vw, 2.6rem);
  color: var(--gold);
  line-height: 1.3;
  margin-bottom: 0.2rem;
  filter: drop-shadow(0 0 12px rgba(184, 134, 11, 0.4));
  direction: rtl;
}
.nom-med-mode__echo-tr {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 1rem;
  color: rgba(212, 160, 75, 0.75);
  letter-spacing: 0.06em;
}

.nom-med-mode__tap-hint {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 0.9rem;
  color: rgba(251, 247, 239, 0.4);
  margin-bottom: 1.5rem;
  text-align: center;
}

/* Choix de la cible */
.nom-med-mode__targets {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}
.nom-med-mode__target {
  background: transparent;
  border: 1px solid rgba(184, 134, 11, 0.3);
  border-radius: 999px;
  padding: 0.35rem 0.9rem;
  color: rgba(251, 247, 239, 0.65);
  font-family: 'Inter', sans-serif;
  font-size: 0.78rem;
  cursor: pointer;
  transition: all 0.2s ease;
}
.nom-med-mode__target:hover {
  border-color: var(--gold);
  color: #fff;
}
.nom-med-mode__target.active {
  background: rgba(184, 134, 11, 0.2);
  border-color: var(--gold);
  color: #fff;
}

/* Mode automatique + curseur de vitesse */
.nom-med-mode__auto-wrap {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 1rem;
  padding: 0.8rem 1.2rem;
  background: rgba(184, 134, 11, 0.05);
  border: 1px solid rgba(184, 134, 11, 0.18);
  border-radius: 999px;
}
.nom-med-mode__speed {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: 'Inter', sans-serif;
  font-size: 0.78rem;
  color: rgba(251, 247, 239, 0.6);
}
.nom-med-mode__speed-label {
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-size: 0.7rem;
}
.nom-med-mode__speed-value {
  min-width: 2.2rem;
  text-align: right;
  color: #d4a04b;
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 0.95rem;
}
.nom-med-mode__speed-range {
  -webkit-appearance: none;
  appearance: none;
  width: 140px;
  height: 2px;
  background: rgba(184, 134, 11, 0.3);
  outline: none;
  cursor: pointer;
}
.nom-med-mode__speed-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  background: var(--gold);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 0 6px rgba(184, 134, 11, 0.6);
  transition: transform 0.2s ease;
}
.nom-med-mode__speed-range::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}
.nom-med-mode__speed-range::-moz-range-thumb {
  width: 14px;
  height: 14px;
  background: var(--gold);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 0 6px rgba(184, 134, 11, 0.6);
}

/* Toggles bas de page */
.nom-med-mode__toggles {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}
.nom-med-mode__toggle {
  background: transparent;
  border: 1px solid rgba(184, 134, 11, 0.25);
  border-radius: 999px;
  padding: 0.4rem 1rem;
  color: rgba(251, 247, 239, 0.55);
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.nom-med-mode__toggle.is-on {
  background: rgba(184, 134, 11, 0.15);
  border-color: rgba(184, 134, 11, 0.6);
  color: #d4a04b;
}
.nom-med-mode__toggle.is-off {
  opacity: 0.5;
}
.nom-med-mode__timer {
  font-family: 'Cormorant Garamond', serif;
  font-size: 2.5rem;
  color: var(--gold);
  margin-bottom: 1.5rem;
}
.nom-med-mode__controls {
  display: flex;
  gap: .8rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  justify-content: center;
}
.nom-med-mode__btn {
  background: transparent;
  border: 1px solid rgba(184,134,11,0.4);
  border-radius: 999px;
  padding: .5rem 1.2rem;
  color: #d4a04b;
  font-family: 'Inter', sans-serif;
  font-size: .85rem;
  cursor: pointer;
  transition: all .25s ease;
}
.nom-med-mode__btn:hover, .nom-med-mode__btn.active {
  background: rgba(184,134,11,0.15);
  border-color: var(--gold);
  color: #fff;
}
.nom-med-mode__btn--start {
  background: var(--gold);
  color: #fff;
  border-color: var(--gold);
}
.nom-med-mode__btn--start:hover { background: #d4a04b; }
.nom-med-mode__notes-label {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  color: #d4a04b;
  margin-bottom: .5rem;
  display: none;
  text-align: center;
}
.nom-med-mode__notes-label.visible { display: block; }
.nom-med-mode__notes {
  width: 100%;
  max-width: 600px;
  min-height: 100px;
  padding: 1rem;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 8px;
  color: #FBF7EF;
  font-family: 'Source Serif 4', serif;
  font-size: 1rem;
  line-height: 1.6;
  resize: vertical;
  outline: none;
  display: none;
  margin-bottom: 1rem;
}
.nom-med-mode__notes:focus { border-color: var(--gold); }
.nom-med-mode__notes.visible { display: block; }

/* Responsive */
@media (max-width: 820px) {
  .noms-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .7rem; }
  .nom-card { padding: .9rem .6rem; }
  .nom-card__ar { font-size: 1.55rem; }
  .nom-card__tr { font-size: 1rem; }
  .nom-modal__content { padding: 2.5rem 1.4rem 1.8rem; }
  .nom-fiche__ar { font-size: 2.6rem; }
  .nom-fiche__tr { font-size: 1.4rem; }
}
@media (max-width: 480px) {
  .noms-grid { grid-template-columns: repeat(2, 1fr); gap: .6rem; }
  .nom-card__ar { font-size: 1.4rem; }
}
