/* ═══════════════════════════════════════════════════════════
   QURAN PWA — style.css  v3
   Mobile-first · PWA · Recitation panel · Comparison UI
═══════════════════════════════════════════════════════════ */

/* ─── Variables ─────────────────────────────────────────── */
:root {
  --bg-deep:       #0c1219;
  --bg-card:       #131c27;
  --bg-card-hover: #1a2638;
  --bg-verse:      #0f1822;
  --border:        #1e2e42;
  --border-gold:   #8a6a2a;

  --gold-light:    #e8c97a;
  --gold-main:     #c9a84c;
  --gold-dim:      #7a5e28;

  --text-primary:  #e8e0d0;
  --text-secondary:#9aabb8;
  --text-muted:    #4a6070;

  --accent-play:   #1a8c6e;
  --accent-play-h: #22b08a;
  --accent-rec:    #c0392b;

  --correct-bg:    rgba(26, 140, 110, 0.15);
  --correct-border:#1a8c6e;
  --wrong-bg:      rgba(192, 57, 43, 0.18);
  --wrong-border:  #c0392b;
  --missing-bg:    rgba(201, 168, 76, 0.15);
  --missing-border:#c9a84c;
  --extra-bg:      rgba(100, 100, 180, 0.15);
  --extra-border:  #6666cc;

  --radius-sm:  8px;
  --radius-md:  14px;
  --radius-lg:  20px;
  --radius-xl:  28px;

  --font-latin:  'Lora', Georgia, serif;
  --font-title:  'Cinzel', 'Times New Roman', serif;
  --font-arabic: 'Scheherazade New', 'Amiri', 'Traditional Arabic', serif;

  --shadow:      0 4px 24px rgba(0,0,0,0.5);
  --shadow-gold: 0 0 20px rgba(201,168,76,0.15);

  --nav-h:       60px;
  --safe-top:    env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left:   env(safe-area-inset-left, 0px);
  --safe-right:  env(safe-area-inset-right, 0px);
}

/* ─── Reset ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  background: var(--bg-deep);
  color: var(--text-primary);
  font-family: var(--font-latin);
  font-size: 16px;
  line-height: 1.6;
  min-height: 100dvh;
  padding-bottom: calc(var(--nav-h) + var(--safe-bottom) + 1rem);
  padding-left: var(--safe-left);
  padding-right: var(--safe-right);
  overscroll-behavior: none;
  -webkit-overflow-scrolling: touch;
  background-image:
    radial-gradient(ellipse at 20% 0%, rgba(201,168,76,0.04) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 100%, rgba(26,140,110,0.04) 0%, transparent 50%);
}

/* ─── Views ─────────────────────────────────────────────── */
.view { display: none; padding: 0 1rem 2rem; max-width: 900px; margin: 0 auto; }
.view.active { display: block; }

/* ─── Header ────────────────────────────────────────────── */
.app-header {
  background: linear-gradient(180deg, #0a1018 0%, var(--bg-card) 100%);
  border-bottom: 1px solid var(--border-gold);
  text-align: center;
  padding: calc(var(--safe-top) + 0.9rem) 1rem 0.9rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-gold);
  display: flex;
  align-items: center;
  justify-content: center;
}
.header-inner { display: flex; flex-direction: column; align-items: center; gap: 0.1rem; }
.logo-ornament { font-size: 1.5rem; color: var(--gold-main); animation: glow 3s ease-in-out infinite alternate; }
@keyframes glow {
  from { text-shadow: 0 0 8px rgba(201,168,76,0.3); }
  to   { text-shadow: 0 0 20px rgba(201,168,76,0.65); }
}
.app-title { font-family: var(--font-arabic); font-size: clamp(1.3rem, 4vw, 2.2rem); color: var(--gold-light); direction: rtl; font-weight: 700; line-height: 1.2; }
.app-subtitle { font-family: var(--font-title); font-size: 0.6rem; color: var(--text-secondary); letter-spacing: 0.25em; text-transform: uppercase; }

.btn-back {
  position: absolute; left: 1rem; top: 50%; transform: translateY(-50%);
  background: transparent; color: var(--gold-main); border: 1px solid var(--border-gold);
  padding: 0.4rem 0.75rem; border-radius: 50px; cursor: pointer;
  font-family: var(--font-latin); font-size: 0.78rem;
  display: flex; align-items: center; gap: 0.3rem; transition: all 0.2s; white-space: nowrap;
}
.btn-back:hover { background: var(--bg-card-hover); color: var(--gold-light); }
.btn-back.hidden { display: none; }

.btn-install {
  position: absolute; right: 1rem; top: 50%; transform: translateY(-50%);
  background: rgba(201,168,76,0.1); color: var(--gold-main); border: 1px solid var(--border-gold);
  padding: 0.4rem 0.75rem; border-radius: 50px; cursor: pointer;
  font-family: var(--font-latin); font-size: 0.72rem;
  display: flex; align-items: center; gap: 0.3rem; transition: all 0.2s;
}
.btn-install:hover { background: rgba(201,168,76,0.2); }
.btn-install.hidden { display: none; }

/* ─── Toast ─────────────────────────────────────────────── */
.toast { background: rgba(26,140,110,0.12); border: 1px solid var(--accent-play); color: var(--accent-play-h); border-radius: var(--radius-md); padding: 0.6rem 1rem; font-size: 0.82rem; margin: 1rem 0 0; text-align: center; }
.toast.hidden { display: none; }

/* ─── Section title ─────────────────────────────────────── */
.section-title { display: flex; align-items: center; gap: 0.8rem; margin: 1.4rem 0 1rem; color: var(--gold-dim); font-family: var(--font-title); font-size: 0.65rem; letter-spacing: 0.3em; text-transform: uppercase; }
.section-title .line { flex: 1; height: 1px; background: var(--border); }

/* ─── Recherche ─────────────────────────────────────────── */
.search-wrap { position: relative; margin-bottom: 1.2rem; }
.search-icon { position: absolute; left: 0.9rem; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--text-muted); pointer-events: none; }
.search-input { width: 100%; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); color: var(--text-primary); padding: 0.8rem 2.4rem 0.8rem 2.5rem; font-family: var(--font-latin); font-size: 0.95rem; outline: none; transition: border-color 0.2s; -webkit-appearance: none; }
.search-input:focus { border-color: var(--gold-dim); }
.search-input::placeholder { color: var(--text-muted); }
.search-clear { position: absolute; right: 0.75rem; top: 50%; transform: translateY(-50%); background: var(--bg-card-hover); border: none; color: var(--text-muted); width: 22px; height: 22px; border-radius: 50%; cursor: pointer; font-size: 0.7rem; display: flex; align-items: center; justify-content: center; }
.search-clear.hidden { display: none; }

/* ─── Grille sourates ───────────────────────────────────── */
.sourate-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.6rem; }

.sourate-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 0.9rem; cursor: pointer;
  transition: all 0.2s ease; display: flex; flex-direction: column; gap: 0.25rem;
  position: relative; overflow: hidden; animation: fadeUp 0.35s ease both;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation; user-select: none;
}
.sourate-card:hover, .sourate-card:active { background: var(--bg-card-hover); border-color: var(--border-gold); transform: scale(0.98); }
.card-number { font-family: var(--font-title); font-size: 0.62rem; color: var(--gold-dim); letter-spacing: 0.1em; }
.card-name-ar { font-family: var(--font-arabic); font-size: 1.15rem; color: var(--gold-light); text-align: right; direction: rtl; line-height: 1.4; }
.card-name-fr { font-size: 0.75rem; color: var(--text-secondary); font-style: italic; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-verses { font-size: 0.68rem; color: var(--text-muted); margin-top: auto; }

/* ─── Sourate header ────────────────────────────────────── */
.sourate-header { display: flex; align-items: center; gap: 0.9rem; padding: 1.2rem 0 1rem; border-bottom: 1px solid var(--border); margin-bottom: 1rem; flex-wrap: wrap; }
.sourate-number-badge { min-width: 46px; height: 46px; border-radius: 50%; border: 2px solid var(--border-gold); display: flex; align-items: center; justify-content: center; font-family: var(--font-title); font-size: 0.88rem; color: var(--gold-main); background: rgba(201,168,76,0.06); flex-shrink: 0; }
.sourate-info { flex: 1; min-width: 120px; }
.sourate-name-ar { font-family: var(--font-arabic); font-size: clamp(1.3rem, 3.5vw, 1.8rem); color: var(--gold-light); direction: rtl; line-height: 1.3; }
.sourate-name-fr { color: var(--text-secondary); font-style: italic; font-size: 0.86rem; }
.sourate-meta { font-size: 0.7rem; color: var(--text-muted); margin-top: 0.1rem; }

/* Sélecteur récitateur */
.reciter-wrap { display: flex; flex-direction: column; gap: 0.2rem; }
.reciter-label { font-size: 0.62rem; color: var(--text-muted); font-family: var(--font-title); letter-spacing: 0.1em; text-transform: uppercase; }
.reciter-select { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text-secondary); padding: 0.35rem 0.6rem; font-size: 0.78rem; font-family: var(--font-latin); outline: none; cursor: pointer; max-width: 160px; }
.reciter-select:focus { border-color: var(--gold-dim); }

.basmala { text-align: center; font-family: var(--font-arabic); font-size: clamp(1.2rem, 4vw, 1.8rem); color: var(--gold-main); direction: rtl; padding: 1rem; margin-bottom: 1rem; border-bottom: 1px solid var(--border); text-shadow: 0 0 15px rgba(201,168,76,0.2); }
.basmala.hidden { display: none; }

/* ─── Versets ───────────────────────────────────────────── */
.verses-list { display: flex; flex-direction: column; gap: 0.85rem; }

.verse-card { background: var(--bg-verse); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 1rem 1rem 0.85rem; transition: border-color 0.2s, box-shadow 0.2s; scroll-margin-top: 74px; }
.verse-card.playing { border-color: var(--accent-play); box-shadow: 0 0 0 2px rgba(26,140,110,0.2); background: rgba(26,140,110,0.04); }

.verse-top { display: flex; align-items: flex-start; gap: 0.75rem; margin-bottom: 0.7rem; }
.verse-number { min-width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--border-gold); display: flex; align-items: center; justify-content: center; font-size: 0.65rem; color: var(--gold-dim); font-family: var(--font-title); flex-shrink: 0; margin-top: 0.3rem; }
.verse-arabic { font-family: var(--font-arabic); font-size: clamp(1.35rem, 3.5vw, 1.85rem); direction: rtl; text-align: right; line-height: 2.2; color: var(--text-primary); flex: 1; }
.verse-translation { font-size: 0.83rem; color: var(--text-secondary); font-style: italic; line-height: 1.65; margin-top: 0.6rem; padding-top: 0.6rem; border-top: 1px solid var(--border); }

.verse-actions { margin-top: 0.75rem; display: flex; gap: 0.5rem; flex-wrap: wrap; }

.btn-play {
  display: inline-flex; align-items: center; gap: 0.35rem;
  background: transparent; color: var(--accent-play); border: 1px solid var(--accent-play);
  padding: 0.38rem 0.85rem; border-radius: 50px; cursor: pointer; font-size: 0.8rem;
  font-family: var(--font-latin); transition: all 0.2s;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.btn-play:hover, .btn-play.active { background: var(--accent-play); color: #fff; }
.btn-play:disabled { opacity: 0.35; cursor: not-allowed; }

/* Bouton Tester */
.btn-test {
  display: inline-flex; align-items: center; gap: 0.35rem;
  background: transparent; color: var(--gold-main); border: 1px solid var(--border-gold);
  padding: 0.38rem 0.85rem; border-radius: 50px; cursor: pointer; font-size: 0.8rem;
  font-family: var(--font-latin); transition: all 0.2s;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.btn-test:hover { background: rgba(201,168,76,0.1); color: var(--gold-light); }

/* ─── Barre audio flottante ─────────────────────────────── */
.audio-bar { position: fixed; bottom: calc(var(--nav-h) + var(--safe-bottom) + 0.75rem); left: 1rem; right: 1rem; max-width: 560px; margin: 0 auto; background: rgba(19,28,39,0.95); border: 1px solid var(--accent-play); border-radius: var(--radius-lg); padding: 0.7rem 1rem; display: flex; align-items: center; justify-content: space-between; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: 0 4px 20px rgba(0,0,0,0.6); z-index: 150; animation: slideUp 0.3s ease; }
.audio-bar.hidden { display: none; }
.audio-bar-info { display: flex; align-items: center; gap: 0.5rem; font-size: 0.82rem; color: var(--text-secondary); }
.audio-bar-icon { animation: pulse-dot 1.2s ease-in-out infinite; }
.audio-bar-stop { background: rgba(192,57,43,0.15); border: 1px solid var(--accent-rec); color: var(--accent-rec); width: 32px; height: 32px; border-radius: 50%; cursor: pointer; font-size: 0.85rem; display: flex; align-items: center; justify-content: center; transition: background 0.2s; }
.audio-bar-stop:hover { background: var(--accent-rec); color: #fff; }

/* ─── Spinner ───────────────────────────────────────────── */
.loading-spinner { grid-column: 1 / -1; display: flex; flex-direction: column; align-items: center; gap: 0.8rem; padding: 2.5rem; color: var(--text-muted); font-size: 0.85rem; }
.spinner { width: 32px; height: 32px; border: 3px solid var(--border); border-top-color: var(--gold-main); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ══════════════════════════════════════════════════════════
   PANEL DE RÉCITATION (bottom-sheet)
══════════════════════════════════════════════════════════ */
.recitation-panel {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
.recitation-panel.hidden { display: none; }

.rp-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.6); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }

.rp-sheet {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-gold);
  border-bottom: none;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding: 0.6rem 1.2rem calc(var(--safe-bottom) + 1.5rem);
  max-height: 92dvh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  animation: sheetUp 0.35s cubic-bezier(0.32, 0.72, 0, 1);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

@keyframes sheetUp {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}

.rp-handle { width: 40px; height: 4px; background: var(--border-gold); border-radius: 2px; margin: 0 auto 0.2rem; opacity: 0.5; }

/* Verset cible */
.rp-verse-target { background: var(--bg-verse); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 1rem; }
.rp-verse-header { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.7rem; }
.rp-verse-badge { min-width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--border-gold); display: flex; align-items: center; justify-content: center; font-size: 0.65rem; color: var(--gold-dim); font-family: var(--font-title); flex-shrink: 0; }
.rp-verse-title { font-family: var(--font-title); font-size: 0.7rem; color: var(--gold-dim); letter-spacing: 0.1em; text-transform: uppercase; }


/* ── Zone verset masqué ──────────────────────────────────── */
.rp-verse-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.7rem;
}
.rp-verse-title { flex: 1; }  /* pousse le bouton révéler à droite */

.rp-btn-reveal {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(201,168,76,0.1);
  color: var(--gold-main);
  border: 1px solid var(--border-gold);
  padding: 0.3rem 0.7rem;
  border-radius: 50px;
  cursor: pointer;
  font-family: var(--font-latin);
  font-size: 0.72rem;
  transition: all 0.2s;
  white-space: nowrap;
  flex-shrink: 0;
}
.rp-btn-reveal:hover { background: rgba(201,168,76,0.22); color: var(--gold-light); }
.rp-btn-reveal.hidden { display: none; }

.rp-verse-hidden {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1.2rem 1rem;
  color: var(--text-muted);
  text-align: center;
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 0.2rem;
}
.rp-verse-hidden p {
  font-size: 0.88rem;
  line-height: 1.5;
  font-style: italic;
}
.rp-verse-hidden p span {
  font-size: 0.75rem;
  opacity: 0.7;
}
.rp-verse-hidden.hidden { display: none; }

/* override : hidden sur les éléments du panel */
.rp-arabic.hidden, .rp-translation.hidden { display: none; }

.rp-arabic { font-family: var(--font-arabic); font-size: clamp(1.3rem, 4vw, 1.75rem); direction: rtl; text-align: right; line-height: 2; color: var(--text-primary); }
.rp-translation { font-size: 0.82rem; color: var(--text-secondary); font-style: italic; margin-top: 0.5rem; padding-top: 0.5rem; border-top: 1px solid var(--border); }

/* Contrôles */
.rp-controls { display: flex; gap: 0.6rem; align-items: center; }

.rp-btn {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.55rem 1.1rem; border-radius: 50px; cursor: pointer;
  font-family: var(--font-latin); font-size: 0.85rem;
  transition: all 0.2s; -webkit-tap-highlight-color: transparent;
  touch-action: manipulation; border: none;
}
.rp-btn-listen { background: rgba(26,140,110,0.15); color: var(--accent-play-h); border: 1px solid var(--accent-play); }
.rp-btn-listen:hover { background: var(--accent-play); color: #fff; }
.rp-btn-record { background: rgba(201,168,76,0.1); color: var(--gold-main); border: 1px solid var(--border-gold); flex: 1; justify-content: center; }
.rp-btn-record:hover { background: rgba(201,168,76,0.2); }
.rp-btn-record.recording { background: rgba(192,57,43,0.15); color: var(--accent-rec); border-color: var(--accent-rec); animation: pulse-border 1.2s ease-in-out infinite; }
.rp-btn-close { background: var(--bg-verse); color: var(--text-muted); border: 1px solid var(--border); padding: 0.55rem 0.75rem; }
.rp-btn-close:hover { color: var(--text-primary); }

/* Indicateur */
.stt-indicator { display: flex; align-items: center; gap: 0.6rem; color: var(--accent-rec); font-size: 0.82rem; }
.stt-indicator.hidden { display: none; }
.pulse-ring { width: 11px; height: 11px; border-radius: 50%; background: var(--accent-rec); animation: pulse-dot 1s ease-in-out infinite; }
@keyframes pulse-dot { 0%,100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.45); opacity: 0.6; } }

/* Transcription */
.rp-transcript-wrap { background: var(--bg-verse); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 0.9rem 1rem; }
.rp-transcript-wrap.hidden { display: none; }
.rp-transcript-label { font-size: 0.72rem; color: var(--text-muted); font-family: var(--font-title); letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 0.5rem; }
.rp-transcript { font-family: var(--font-arabic); font-size: 1.2rem; line-height: 1.9; color: var(--text-primary); min-height: 2rem; }

/* ──── Résultat ──── */
.rp-result { display: flex; flex-direction: column; gap: 1rem; }
.rp-result.hidden { display: none; }

/* Score */
.rp-score-row { display: flex; align-items: center; gap: 1.2rem; }
.rp-score-circle {
  min-width: 70px; height: 70px; border-radius: 50%;
  border: 3px solid var(--border-gold);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-family: var(--font-title); background: var(--bg-verse); flex-shrink: 0;
  transition: border-color 0.4s;
}
.rp-score-circle.great  { border-color: var(--accent-play); }
.rp-score-circle.good   { border-color: var(--gold-main); }
.rp-score-circle.bad    { border-color: var(--accent-rec); }

.rp-score-value { font-size: 1.5rem; font-weight: 600; line-height: 1; color: var(--gold-light); transition: color 0.4s; }
.rp-score-circle.great .rp-score-value { color: var(--accent-play-h); }
.rp-score-circle.bad   .rp-score-value { color: #e74c3c; }
.rp-score-pct { font-size: 0.65rem; color: var(--text-muted); }

.rp-score-msg { font-size: 1rem; color: var(--text-primary); flex: 1; }
.rp-score-msg strong { display: block; font-size: 1.1rem; }
.rp-score-msg.correct strong { color: var(--accent-play-h); }
.rp-score-msg.wrong   strong { color: #e74c3c; }

/* Verset annoté */
.rp-annotated-wrap { background: var(--bg-verse); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 1rem; }
.rp-annotated-label { font-size: 0.72rem; color: var(--text-muted); font-family: var(--font-title); letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 0.6rem; }
.rp-annotated { font-family: var(--font-arabic); font-size: clamp(1.15rem, 3.5vw, 1.6rem); direction: rtl; text-align: right; line-height: 2.2; }

/* Mots surlignés */
.word-correct  { color: var(--accent-play-h); }
.word-wrong    { background: var(--wrong-bg); color: #ff7066; border-radius: 4px; padding: 0 2px; border-bottom: 2px solid var(--accent-rec); }
.word-missing  { background: var(--missing-bg); color: var(--gold-light); border-radius: 4px; padding: 0 2px; border-bottom: 2px dashed var(--gold-main); opacity: 0.7; }

/* Erreurs */
.rp-errors-wrap { background: var(--bg-verse); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 1rem; }
.rp-errors-wrap.hidden { display: none; }
.rp-errors-label { font-size: 0.72rem; color: var(--text-muted); font-family: var(--font-title); letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 0.6rem; }
.rp-errors-list { list-style: none; display: flex; flex-direction: column; gap: 0.5rem; }
.rp-error-item { display: flex; align-items: center; gap: 0.6rem; font-size: 0.82rem; padding: 0.5rem 0.7rem; border-radius: var(--radius-sm); background: var(--bg-card); }
.rp-error-type { font-size: 0.65rem; font-family: var(--font-title); letter-spacing: 0.08em; text-transform: uppercase; padding: 0.15rem 0.45rem; border-radius: 4px; flex-shrink: 0; }
.rp-error-type.wrong   { background: var(--wrong-bg);   color: #ff7066;          border: 1px solid var(--accent-rec); }
.rp-error-type.missing { background: var(--missing-bg); color: var(--gold-light); border: 1px solid var(--gold-main); }
.rp-error-type.extra   { background: var(--extra-bg);   color: #9999ee;          border: 1px solid var(--extra-border); }
.rp-error-text { font-family: var(--font-arabic); font-size: 1rem; direction: rtl; flex: 1; color: var(--text-primary); }
.rp-error-arrow { color: var(--text-muted); font-size: 0.8rem; }

/* Actions résultat */
.rp-result-actions { display: flex; gap: 0.6rem; }

/* ─── Section STT globale ───────────────────────────────── */
.stt-section { max-width: 900px; margin: 1.5rem auto 0; padding: 0 1rem; }
.stt-inner { background: var(--bg-card); border: 1px solid var(--border-gold); border-radius: var(--radius-xl); padding: 1.5rem; box-shadow: var(--shadow-gold); display: flex; flex-direction: column; align-items: center; gap: 0.9rem; text-align: center; }
.stt-header { display: flex; align-items: center; gap: 0.5rem; color: var(--gold-light); }
.stt-icon { font-size: 1.3rem; }
.stt-header h3 { font-family: var(--font-title); font-size: 0.95rem; letter-spacing: 0.1em; }
.stt-desc { font-size: 0.85rem; color: var(--text-secondary); max-width: 400px; line-height: 1.7; }
.stt-compat { font-size: 0.72rem; color: var(--text-muted); }

/* ─── Bottom nav ────────────────────────────────────────── */
.bottom-nav { position: fixed; bottom: 0; left: 0; right: 0; height: calc(var(--nav-h) + var(--safe-bottom)); background: rgba(13,20,30,0.96); border-top: 1px solid var(--border-gold); display: flex; align-items: flex-start; padding-bottom: var(--safe-bottom); z-index: 200; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.nav-item { flex: 1; height: var(--nav-h); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.2rem; background: transparent; border: none; color: var(--text-muted); cursor: pointer; transition: color 0.2s; font-family: var(--font-latin); font-size: 0.62rem; letter-spacing: 0.05em; }
.nav-item svg { width: 22px; height: 22px; transition: transform 0.2s; }
.nav-item.active { color: var(--gold-main); }
.nav-item.active svg { transform: scale(1.1); }


/* ══════════════════════════════════════════════════════════
   TAJWID — Couleurs des règles de récitation
   Source : api.quran.com (classes préfixées tj-)
   
   Règles et couleurs (convention pédagogique standard) :
   ▸ Rouge/rose  → Iqlab (transformation nun/tanwin)
   ▸ Vert        → Ghunna (nasalisation 2 temps)
   ▸ Bleu        → Idghâm (assimilation avec ghunna)
   ▸ Bleu clair  → Idghâm shafawi / sans ghunna
   ▸ Orange      → Ikhfâ (occultation)
   ▸ Or/jaune    → Qalqala (écho sur lettres قطبجد)
   ▸ Violet      → Madd (prolongation)
   ▸ Gris doux   → Ham wasl / Laam shamsiyah (lettres silencieuses)
══════════════════════════════════════════════════════════ */

/* ─── Texte arabe avec tajwid ────────────────────────────── */
.verse-arabic.tajweed-text {
  font-family: var(--font-arabic);
  font-size: clamp(1.35rem, 3.5vw, 1.85rem);
  line-height: 2.5;
  color: var(--text-primary);  /* couleur de base */
  flex: 1;
}

/* ─── Règles colorées ────────────────────────────────────── */

/* ── Palette Tajwid — standard Quran.com Mushaf ──────────────
   Sobre, pédagogique, lisible sur fond sombre.
   Inspirée du New Tajweed Mushaf de Quran.com.
──────────────────────────────────────────────────────────── */

/* Ghunna — nasalisation 2 temps (vert sauge, pas trop vif) */
.tj-ghunnah          { color: #4caf7d; }

/* Idghâm avec ghunna — assimilation nasale (bleu quran.com) */
.tj-idgham_ghunnah   { color: #4a90d9; }

/* Idghâm sans ghunna — plus doux, même famille bleue */
.tj-idgham_wo_ghunnah{ color: #74afd4; }

/* Idghâm shafawi — bleu encore plus discret */
.tj-idgham_shafawi   { color: #8fbfda; }

/* Ikhfâ — occultation (orange chaud, lisible) */
.tj-ikhafa           { color: #d4832a; }

/* Ikhfâ shafawi — variante orange plus claire */
.tj-ikhafa_shafawi   { color: #d99a52; }

/* Iqlab — transformation nun → mim (rouge brique, standard) */
.tj-iqlab            { color: #c0392b; }

/* Qalqala — écho sur lettres قطبجد (or chaud, distinctif) */
.tj-qalaqah          { color: #c9a84c; }

/* Madd normal — prolongation 2 temps (mauve clair) */
.tj-madda_normal     { color: #9b7ec8; }

/* Madd permissif — 2 ou 4-5 temps (violet moyen) */
.tj-madda_permissible{ color: #8360c3; }

/* Madd obligatoire — 4-5 temps (violet plus soutenu) */
.tj-madda_obligatory { color: #6e4bab; }

/* Madd nécessaire — 6 temps (violet foncé, maximal) */
.tj-madda_necessary  { color: #5c3d99; }

/* Hamza wasl — alef de liaison (gris neutre, non colorié) */
.tj-ham_wasl         { color: #7a8e9a; }

/* Lâm shamsiyah — lam solaire assimilée (gris légèrement bleuté) */
.tj-laam_shamsiyah   { color: #7a8e9a; }

/* Lettre silencieuse / non prononcée */
.tj-slnt             { color: #7a8e9a; opacity: 0.55; }



/* ══════════════════════════════════════════════════════════
   SURLIGNAGE MOT EN COURS DE LECTURE — .word-playing
   
   Séparé du surlignage d'erreurs (.tj-word-wrong, .tj-word-missing).
   Compatible avec les couleurs tajwid sur les spans enfants.
   Le fond s'applique sur le tj-word wrapper, pas sur les lettres.
══════════════════════════════════════════════════════════ */
.word-playing {
  background: rgba(201, 168, 76, 0.18);   /* or doux, thème de l'app */
  border-radius: 5px;
  padding: 0 3px;
  box-shadow: 0 0 0 1.5px rgba(201, 168, 76, 0.35);
  transition: background 0.15s ease, box-shadow 0.15s ease;
  /* Animation légère : légère pulsation */
  animation: word-pulse 0.4s ease;
}

@keyframes word-pulse {
  0%   { background: rgba(201, 168, 76, 0.08); box-shadow: 0 0 0 0 rgba(201, 168, 76, 0.5); }
  50%  { background: rgba(201, 168, 76, 0.28); box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.15); }
  100% { background: rgba(201, 168, 76, 0.18); box-shadow: 0 0 0 1.5px rgba(201, 168, 76, 0.35); }
}

/* Assurer que .word-playing ne masque pas .tj-word-wrong ou .tj-word-missing
   (les erreurs priment toujours sur le surlignage de lecture) */
.tj-word-wrong.word-playing,
.tj-word-missing.word-playing {
  animation: none;
  background: inherit;
  box-shadow: inherit;
}

/* ══════════════════════════════════════════════════════════
   SURLIGNAGE DES ERREURS DE RÉCITATION (sur le texte tajwid)

   Principe : on ajoute background/outline sur les tj-word spans
   SANS toucher aux couleurs tajwid des lettres à l'intérieur.
   Les couleurs tajwid (.tj-ghunnah, .tj-ikhafa…) restent actives
   car elles sont sur des spans enfants, pas sur le tj-word lui-même.
══════════════════════════════════════════════════════════ */

/* Mot incorrect (dit différemment) → fond rouge discret */
.tj-word-wrong {
  background: rgba(192, 57, 43, 0.22);
  border-radius: 4px;
  padding: 0 2px;
  box-shadow: inset 0 -2px 0 rgba(192, 57, 43, 0.6);
  transition: background 0.3s;
}

/* Mot manquant (non prononcé) → contour orange pointillé */
.tj-word-missing {
  outline: 1.5px dashed rgba(230, 126, 34, 0.7);
  border-radius: 4px;
  padding: 0 2px;
  opacity: 0.6;
  transition: opacity 0.3s;
}

/* ─── Badge de score sous le verset ──────────────────────── */
.verse-score-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.6rem;
  padding: 0.45rem 0.8rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-family: var(--font-latin);
  border: 1px solid transparent;
  animation: fadeUp 0.3s ease;
}
.verse-score-badge.hidden { display: none; }

/* Couleurs selon le résultat */
.verse-score-badge.badge-great {
  background: rgba(26, 140, 110, 0.12);
  border-color: rgba(26, 140, 110, 0.4);
  color: var(--accent-play-h);
}
.verse-score-badge.badge-good {
  background: rgba(201, 168, 76, 0.1);
  border-color: rgba(201, 168, 76, 0.35);
  color: var(--gold-main);
}
.verse-score-badge.badge-bad {
  background: rgba(192, 57, 43, 0.1);
  border-color: rgba(192, 57, 43, 0.35);
  color: #e07070;
}

.badge-icon { font-size: 0.9rem; }
.badge-msg  { flex: 1; }
.badge-score {
  font-family: var(--font-title);
  font-size: 0.75rem;
  opacity: 0.8;
  letter-spacing: 0.05em;
}


/* ─── Analyse mot par mot : détail spoken vs expected ──── */

/* Mot récité (affiché en rouge sous le mot attendu) */
.wm-spoken {
  display: block;
  font-size: 0.75em;
  color: var(--accent-rec);
  opacity: 0.9;
  line-height: 1.3;
  direction: rtl;
}

/* Étiquette « ? » pour mot manquant */
.wm-missing-label {
  display: inline-block;
  font-family: var(--font-latin);
  font-size: 0.6em;
  background: rgba(230,126,34,0.25);
  color: #d4832a;
  border-radius: 3px;
  padding: 0 3px;
  vertical-align: super;
  margin-right: 2px;
}

/* Position du mot dans la liste d'erreurs */
.rp-error-pos {
  font-family: var(--font-title);
  font-size: 0.62rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  flex-shrink: 0;
}

/* Mot prononcé dans la liste d'erreurs */
.rp-error-spoken {
  color: var(--accent-rec) !important;
}

/* ─── Légende tajwid ─────────────────────────────────────── */
.tajweed-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.65rem 0.9rem;
  margin-bottom: 0.85rem;
  font-size: 0.72rem;
}

.tj-legend-title {
  color: var(--text-muted);
  font-family: var(--font-title);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-right: 0.3rem;
}

.tj-badge {
  padding: 0.18rem 0.55rem;
  border-radius: 50px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  font-family: var(--font-latin);
  font-size: 0.68rem;
  cursor: default;
}

/* ─── Message fallback si tajwid indispo ─────────────────── */
.tajweed-unavailable {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-style: italic;
  font-family: var(--font-latin);
}


/* ══════════════════════════════════════════════════════════
   MODE HIFZ / RÉCITATION — Shazone-inspired
   Immersif, épuré, centré sur la récitation de mémoire.
══════════════════════════════════════════════════════════ */

/* ── Vue fullscreen ──────────────────────────────────────── */
.view-recitation {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  flex-direction: column;
  background: #07101a;
  overflow: hidden;
  padding-top:    var(--safe-top);
  padding-bottom: var(--safe-bottom);
  /* Légère texture pour profondeur */
  background-image: radial-gradient(ellipse at 50% 0%, rgba(201,168,76,0.05) 0%, transparent 60%);
}
.view-recitation.hidden { display: none; }

/* ── Header compact ──────────────────────────────────────── */
.vr-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.2rem 0.6rem;
  border-bottom: 1px solid rgba(201,168,76,0.12);
  flex-shrink: 0;
}

.vr-meta {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.vr-sourate-name {
  font-family: var(--font-title);
  font-size: 0.7rem;
  color: var(--gold-main);
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.vr-verse-counter {
  font-size: 0.62rem;
  color: var(--text-muted);
  font-family: var(--font-latin);
  letter-spacing: 0.05em;
}

.vr-btn-close {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--text-muted);
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.vr-btn-close:hover { border-color: var(--gold-dim); color: var(--gold-main); }

/* ── Zone principale (défilable) ─────────────────────────── */
.vr-stage {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 1.4rem 0.5rem;
  text-align: center;
  gap: 1rem;
}

/* ── Prompt Hifz (état initial) ──────────────────────────── */
.vr-hifz-prompt {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.7rem;
  padding: 1rem;
  animation: fadeUp 0.4s ease;
}
.vr-hifz-prompt.hidden { display: none; }

.vr-hifz-icon { color: var(--gold-dim); margin-bottom: 0.2rem; }

.vr-hifz-label {
  font-family: var(--font-title);
  font-size: 0.88rem;
  color: var(--gold-main);
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.vr-hifz-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-family: var(--font-latin);
}

/* ── Verset révélé ───────────────────────────────────────── */
.vr-verse-revealed {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  max-width: 620px;
  animation: fadeUp 0.4s ease;
}
.vr-verse-revealed.hidden { display: none; }

.vr-basmala {
  font-family: var(--font-arabic);
  font-size: clamp(1rem, 3vw, 1.3rem);
  color: var(--gold-dim);
  direction: rtl;
  opacity: 0.75;
}
.vr-basmala.hidden { display: none; }

/* Texte arabe : grand, centré, aéré */
.vr-arabic {
  font-family: var(--font-arabic);
  font-size: clamp(1.9rem, 6.5vw, 3.2rem);
  direction: rtl;
  text-align: center;
  line-height: 2.6;
  color: var(--text-primary);
  width: 100%;
}

.vr-verse-ornament {
  font-family: var(--font-arabic);
  font-size: 1rem;
  color: var(--gold-dim);
  opacity: 0.6;
  margin-top: -0.5rem;
}

.vr-translation {
  font-family: var(--font-latin);
  font-size: clamp(0.8rem, 2.2vw, 0.9rem);
  color: var(--text-secondary);
  font-style: italic;
  max-width: 480px;
  line-height: 1.6;
  padding: 0.5rem 0.8rem;
  border-top: 1px solid var(--border);
  width: 100%;
  text-align: center;
}

/* ── Résultat ────────────────────────────────────────────── */
.vr-result {
  width: 100%;
  max-width: 520px;
  background: rgba(10,18,28,0.9);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem 1.2rem 0.8rem;
  display: flex; flex-direction: column; gap: 0.8rem;
  animation: fadeUp 0.35s ease;
}
.vr-result.hidden { display: none; }

/* Bandeau résultat */
.vr-result-banner {
  font-family: var(--font-latin);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.45rem 0.8rem;
  border-radius: var(--radius-sm);
  text-align: center;
  letter-spacing: 0.02em;
}
.vr-result-banner.banner-success {
  background: rgba(26,140,110,0.18);
  color: var(--accent-play-h);
  border: 1px solid rgba(26,140,110,0.35);
}
.vr-result-banner.banner-error {
  background: rgba(192,57,43,0.18);
  color: #f08080;
  border: 1px solid rgba(192,57,43,0.35);
}
.vr-result-banner.banner-warning {
  background: rgba(201,168,76,0.12);
  color: var(--gold-main);
  border: 1px solid rgba(201,168,76,0.3);
}

.vr-result-score-row { display: flex; align-items: center; gap: 1rem; }

.vr-result-circle {
  min-width: 58px; height: 58px; border-radius: 50%;
  border: 3px solid var(--border-gold);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  font-family: var(--font-title); flex-shrink: 0;
  transition: border-color 0.3s;
}
.vr-result-circle.great { border-color: var(--accent-play); }
.vr-result-circle.good  { border-color: var(--gold-main); }
.vr-result-circle.bad   { border-color: var(--accent-rec); }

.vr-result-value {
  font-size: 1.25rem; font-weight: 600;
  color: var(--gold-light); line-height: 1;
}
.vr-result-circle.great .vr-result-value { color: var(--accent-play-h); }
.vr-result-circle.bad   .vr-result-value { color: #f08080; }
.vr-result-pct { font-size: 0.58rem; color: var(--text-muted); }

.vr-result-msg { flex: 1; font-size: 0.86rem; color: var(--text-primary); line-height: 1.5; }
.vr-result-msg strong { display: block; }
.vr-result-msg.correct strong { color: var(--accent-play-h); }
.vr-result-msg.wrong   strong { color: #f08080; }

.vr-annotated-label {
  font-family: var(--font-title); font-size: 0.62rem;
  color: var(--text-muted); letter-spacing: 0.15em; text-transform: uppercase;
  margin-bottom: 0.35rem;
}

.vr-result-annotated-wrap { text-align: right; }

.vr-result-annotated {
  font-family: var(--font-arabic);
  font-size: clamp(1.1rem, 3.5vw, 1.5rem);
  direction: rtl; text-align: right; line-height: 2.2;
}

.vr-result-errors { border-top: 1px solid var(--border); padding-top: 0.6rem; }
.vr-result-errors.hidden { display: none; }

/* Boutons d'action résultat */
.vr-result-actions {
  display: flex; gap: 0.5rem; flex-wrap: wrap;
}

.vr-action-btn {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.45rem 0.9rem; border-radius: 50px;
  font-family: var(--font-latin); font-size: 0.8rem;
  cursor: pointer; transition: all 0.2s;
  -webkit-tap-highlight-color: transparent; border: none;
}
.vr-action-listen {
  background: rgba(26,140,110,0.15); color: var(--accent-play-h);
  border: 1px solid rgba(26,140,110,0.35);
}
.vr-action-listen:hover { background: var(--accent-play); color: #fff; }

.vr-action-retry {
  background: rgba(201,168,76,0.1); color: var(--gold-main);
  border: 1px solid rgba(201,168,76,0.3);
}
.vr-action-retry:hover { background: rgba(201,168,76,0.22); }

.vr-action-errors {
  background: transparent; color: var(--text-muted);
  border: 1px solid var(--border);
}
.vr-action-errors:hover { color: #f08080; border-color: rgba(192,57,43,0.4); }
.vr-action-errors.hidden { display: none; }
.vr-action-errors.active { color: #f08080; border-color: var(--accent-rec); }

/* ── Zone Micro (fixe au centre-bas) ─────────────────────── */
.vr-mic-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem 0.4rem;
  flex-shrink: 0;
  border-top: 1px solid rgba(255,255,255,0.05);
}

/* Message contextuel */
.vr-mic-message {
  font-family: var(--font-latin);
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  transition: color 0.3s;
  min-height: 1.2em;
  text-align: center;
}
.vr-mic-message.state-listening { color: #f08080; font-weight: 600; }
.vr-mic-message.state-analyzing { color: var(--gold-dim); }

/* Zone transcription live */
.vr-transcript-wrap {
  width: 100%; max-width: 480px;
  background: rgba(10,18,28,0.8);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.5rem 0.9rem;
  min-height: 2.2rem;
}
.vr-transcript-wrap.hidden { display: none; }

.vr-transcript {
  font-family: var(--font-arabic);
  font-size: 1.05rem;
  direction: rtl; text-align: center;
  color: var(--text-primary);
  line-height: 1.7;
}

/* Conteneur bouton micro (pour l'ondulation derrière) */
.vr-mic-container {
  position: relative;
  display: flex; align-items: center; justify-content: center;
}

/* Ondulation animée (écoute active) */
.vr-mic-ripple {
  position: absolute;
  width: 84px; height: 84px;
  border-radius: 50%;
  background: rgba(192,57,43,0.15);
  animation: vr-ripple 1.4s ease-out infinite;
}
.vr-mic-ripple.hidden { display: none; }
@keyframes vr-ripple {
  0%   { transform: scale(0.9); opacity: 0.8; }
  100% { transform: scale(1.7); opacity: 0; }
}

/* ── Bouton micro (3 états) ──────────────────────────────── */
.vr-btn-mic {
  position: relative; z-index: 1;
  width: 72px; height: 72px;
  border-radius: 50%;
  border: 3px solid transparent;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: all 0.25s;
  -webkit-tap-highlight-color: transparent;
}
.vr-btn-mic:active { transform: scale(0.94); }

/* Idle : vert profond */
.vr-btn-mic.state-idle {
  background: var(--accent-play);
  border-color: var(--accent-play-h);
  box-shadow: 0 4px 18px rgba(26,140,110,0.4);
  color: #fff;
}
.vr-btn-mic.state-idle:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 24px rgba(26,140,110,0.55);
}

/* Listening : rouge pulsant */
.vr-btn-mic.state-listening {
  background: #c0392b;
  border-color: #e74c3c;
  box-shadow: 0 4px 18px rgba(192,57,43,0.5);
  color: #fff;
  animation: vr-mic-pulse 1.1s ease-in-out infinite;
}
@keyframes vr-mic-pulse {
  0%,100% { box-shadow: 0 4px 18px rgba(192,57,43,0.5); }
  50%     { box-shadow: 0 4px 28px rgba(192,57,43,0.8), 0 0 0 8px rgba(192,57,43,0.12); }
}

/* Analyzing : neutre/gris */
.vr-btn-mic.state-analyzing {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.2);
  color: var(--text-muted);
  cursor: not-allowed;
}

/* Icônes dans le bouton */
.vr-icon-mic, .vr-icon-stop { transition: opacity 0.15s; }
.vr-icon-mic.hidden, .vr-icon-stop.hidden, .vr-icon-spinner.hidden { display: none; }

/* Spinner (état analyzing) */
.vr-icon-spinner {
  width: 26px; height: 26px;
  border: 3px solid rgba(255,255,255,0.15);
  border-top-color: var(--gold-dim);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* Label sous le bouton */
.vr-mic-label {
  font-family: var(--font-title);
  font-size: 0.62rem;
  color: var(--text-muted);
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

/* ── Toolbar basse ───────────────────────────────────────── */
.vr-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 0.55rem 1rem calc(0.6rem + var(--safe-bottom));
  background: rgba(5,10,18,0.98);
  border-top: 1px solid rgba(201,168,76,0.1);
  flex-shrink: 0;
  gap: 0.4rem;
}

.vr-nav-btn {
  width: 42px; height: 42px; border-radius: 50%;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--text-secondary);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
  flex-shrink: 0;
}
.vr-nav-btn:hover { border-color: var(--gold-dim); color: var(--gold-main); }
.vr-nav-btn:disabled { opacity: 0.2; cursor: not-allowed; }

.vr-tool-btn {
  display: flex; flex-direction: column;
  align-items: center; gap: 0.2rem;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--text-secondary);
  padding: 0.45rem 0.8rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-family: var(--font-latin); font-size: 0.6rem;
  letter-spacing: 0.06em; text-transform: uppercase;
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
  min-width: 58px;
}
.vr-tool-btn:hover { border-color: var(--gold-dim); color: var(--gold-main); }

/* ── Responsive ──────────────────────────────────────────── */
@media (min-width: 640px) {
  .vr-arabic { font-size: clamp(2.2rem, 5vw, 3.5rem); line-height: 2.8; }
  .vr-btn-mic { width: 80px; height: 80px; }
  .vr-mic-ripple { width: 92px; height: 92px; }
}

@media (max-height: 620px) and (orientation: landscape) {
  .vr-stage { padding: 0.5rem 1rem 0.2rem; justify-content: flex-start; }
  .vr-arabic { font-size: 1.5rem; line-height: 1.9; }
  .vr-btn-mic { width: 56px; height: 56px; }
  .vr-mic-ripple { width: 68px; height: 68px; }
}

/* ─── Footer ────────────────────────────────────────────── */
.app-footer { text-align: center; padding: 1.5rem 1rem; font-size: 0.72rem; color: var(--text-muted); margin-top: 1.5rem; border-top: 1px solid var(--border); max-width: 900px; margin-left: auto; margin-right: auto; }
.app-footer a { color: var(--gold-dim); text-decoration: none; }
.sw-status { margin-top: 0.3rem; font-size: 0.68rem; color: var(--text-muted); }

/* ─── Erreur ────────────────────────────────────────────── */
.error-msg { text-align: center; color: #e74c3c; padding: 2rem; font-size: 0.88rem; grid-column: 1 / -1; }

/* ─── Animations ────────────────────────────────────────── */
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes pulse-border { 0%,100% { box-shadow: 0 0 0 0 rgba(192,57,43,0.3); } 50% { box-shadow: 0 0 0 8px rgba(192,57,43,0); } }

/* ─── Responsive ────────────────────────────────────────── */
@media (min-width: 480px) {
  .sourate-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 640px) {
  .sourate-grid { grid-template-columns: repeat(3, 1fr); gap: 0.75rem; }
  .sourate-card { padding: 1.1rem; }
  .card-name-ar { font-size: 1.3rem; }
}
@media (min-width: 900px) {
  .sourate-grid { grid-template-columns: repeat(4, 1fr); }
  .rp-sheet { max-width: 600px; margin: 0 auto; border-radius: var(--radius-xl); border-bottom: 1px solid var(--border-gold); bottom: 2rem; }
  .recitation-panel { align-items: center; justify-content: center; }
}
@media (min-width: 1100px) {
  .sourate-grid { grid-template-columns: repeat(5, 1fr); }
}
@media (max-height: 500px) and (orientation: landscape) {
  .app-header { padding-top: 0.4rem; padding-bottom: 0.4rem; }
  .logo-ornament, .app-subtitle { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
