/* =========================================================
   SAKINA — Thème émeraude & or
   ========================================================= */

:root {
  --bg: #062019;
  --bg-grad: radial-gradient(1200px 600px at 50% -10%, #0c3a2e 0%, #062019 60%);
  --card: #0b2f26;
  --card-2: #0f3a2f;
  --card-3: #14453a;
  --line: rgba(212, 175, 106, .14);
  --gold: #d4af6a;
  --gold-2: #e8c98a;
  --gold-soft: rgba(212, 175, 106, .16);
  --emerald: #27a97f;
  --emerald-2: #35c795;
  --text: #f4efe3;
  --muted: #9dbfb0;
  --muted-2: #6f9486;
  --danger: #e07856;
  --warn: #e0b356;
  --ok: #35c795;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  --r: 18px;
  --font-ui: 'Nunito', system-ui, -apple-system, sans-serif;
  --font-ar: 'Amiri Quran', 'Scheherazade New', 'Amiri', serif;
  --fs: 1;
}

[data-theme="light"] {
  --bg: #f6f0e2;
  --bg-grad: radial-gradient(1200px 600px at 50% -10%, #fdf8ec 0%, #f0e8d5 60%);
  --card: #fffdf6;
  --card-2: #f8f2e2;
  --card-3: #efe6d0;
  --line: rgba(20, 90, 70, .12);
  --gold: #b08a3e;
  --gold-2: #8a6a28;
  --gold-soft: rgba(176, 138, 62, .14);
  --emerald: #157a5b;
  --emerald-2: #0f6a4e;
  --text: #14332a;
  --muted: #4e7265;
  --muted-2: #7f9c90;
  --shadow: 0 10px 25px rgba(60, 45, 10, .12);
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html { font-size: calc(16px * var(--fs)); }
body {
  font-family: var(--font-ui);
  background: var(--bg);
  background-image: var(--bg-grad);
  background-attachment: fixed;
  color: var(--text);
  min-height: 100vh;
  min-height: 100dvh;
  overscroll-behavior-y: none;
}

/* Motif géométrique discret */
body::before {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  opacity: .05;
  background-image: url("data:image/svg+xml,%3Csvg width='96' height='96' viewBox='0 0 96 96' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='%23d4af6a' stroke-width='1'%3E%3Cpath d='M48 8 L58 38 L88 48 L58 58 L48 88 L38 58 L8 48 L38 38 Z'/%3E%3Ccircle cx='48' cy='48' r='6'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 96px 96px;
}

#app { max-width: 680px; margin: 0 auto; padding: 0 16px 110px; position: relative; }

/* ---------- Header ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 2px 10px;
  position: sticky; top: 0; z-index: 30;
  background: linear-gradient(var(--bg) 70%, transparent);
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand .logo {
  width: 40px; height: 40px; border-radius: 13px;
  background: linear-gradient(135deg, #0f5c44, #1b8a67);
  border: 1px solid var(--line);
  display: grid; place-items: center;
  color: var(--gold-2); font-size: 20px;
  box-shadow: var(--shadow);
}
.brand h1 { font-size: 1.15rem; font-weight: 800; letter-spacing: .2px; }
.brand small { display: block; color: var(--muted); font-weight: 600; font-size: .72rem; margin-top: -2px; }
.profile-chip {
  display: flex; align-items: center; gap: 8px;
  background: var(--card); border: 1px solid var(--line);
  padding: 6px 12px 6px 8px; border-radius: 999px;
  cursor: pointer; font-weight: 700; font-size: .85rem; color: var(--text);
}
.profile-chip .av { font-size: 1.2rem; }

/* ---------- Boutons & communs ---------- */
button { font-family: inherit; color: inherit; background: none; border: none; cursor: pointer; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: 14px; padding: 12px 18px;
  font-weight: 800; font-size: .95rem;
  background: var(--card-2); border: 1px solid var(--line);
  transition: transform .12s ease, background .2s;
}
.btn:active { transform: scale(.97); }
.btn-gold {
  background: linear-gradient(135deg, #caa25c, #e8c98a);
  color: #2a1f08; border: none;
  box-shadow: 0 6px 18px rgba(212, 175, 106, .25);
}
.btn-emerald { background: linear-gradient(135deg, #157a5b, #27a97f); color: #eafff6; border: none; }
.btn-ghost { background: transparent; border: 1px solid var(--line); color: var(--muted); }
.btn-big { padding: 16px 22px; font-size: 1.05rem; border-radius: 16px; }
.btn-block { width: 100%; }

.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r); padding: 18px; box-shadow: var(--shadow);
}
.section-title {
  display: flex; align-items: center; gap: 8px;
  font-size: .8rem; font-weight: 800; letter-spacing: .12em;
  text-transform: uppercase; color: var(--gold);
  margin: 26px 4px 10px;
}
.section-title::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 13px; border-radius: 999px;
  background: var(--card-2); border: 1px solid var(--line);
  font-size: .8rem; font-weight: 700; color: var(--muted);
  cursor: pointer; transition: all .15s;
}
.chip.on { background: var(--gold-soft); color: var(--gold-2); border-color: var(--gold); }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- Navigation basse ---------- */
.navbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 40;
  display: flex; justify-content: center;
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  background: linear-gradient(transparent, var(--bg) 40%);
}
.navbar .inner {
  display: flex; gap: 4px; width: 100%; max-width: 480px;
  background: color-mix(in srgb, var(--card) 88%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--line); border-radius: 22px; padding: 8px;
  box-shadow: var(--shadow);
}
.nav-item {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 8px 4px; border-radius: 15px; color: var(--muted-2);
  font-size: .68rem; font-weight: 800;
}
.nav-item .ico { font-size: 1.25rem; line-height: 1; }
.nav-item.on { color: var(--gold-2); background: var(--gold-soft); }

/* ---------- Accueil ---------- */
.hero { margin-top: 6px; }
.hero .salam { font-size: 1.5rem; font-weight: 800; }
.hero .sub { color: var(--muted); font-weight: 600; margin-top: 2px; }
.stat-row { display: flex; gap: 10px; margin-top: 16px; }
.stat {
  flex: 1; text-align: center; padding: 14px 6px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
}
.stat .num { font-size: 1.45rem; font-weight: 800; color: var(--gold-2); }
.stat .lbl { font-size: .72rem; color: var(--muted); font-weight: 700; }

.session-card { margin-top: 16px; position: relative; overflow: hidden; }
.session-card::before {
  content: "۞"; position: absolute; right: -10px; top: -22px;
  font-size: 110px; color: var(--gold); opacity: .07; font-family: var(--font-ar);
}
.session-block {
  display: flex; align-items: center; gap: 14px;
  padding: 13px 6px; border-bottom: 1px dashed var(--line); cursor: pointer;
}
.session-block:last-child { border-bottom: none; }
.session-block .ico {
  width: 44px; height: 44px; border-radius: 13px; flex: none;
  display: grid; place-items: center; font-size: 1.3rem;
  background: var(--card-3); border: 1px solid var(--line);
}
.session-block .t { font-weight: 800; }
.session-block .d { font-size: .8rem; color: var(--muted); font-weight: 600; }
.session-block .go { margin-left: auto; color: var(--gold); font-weight: 800; }

/* ---------- Parcours ---------- */
.stage { margin-bottom: 14px; }
.stage-head { display: flex; align-items: baseline; gap: 10px; margin: 4px 4px 10px; }
.stage-head .n {
  width: 26px; height: 26px; border-radius: 999px; flex: none;
  display: grid; place-items: center;
  background: var(--gold-soft); color: var(--gold-2); font-weight: 800; font-size: .8rem;
  border: 1px solid var(--gold);
}
.stage-head .t { font-weight: 800; }
.stage-head .d { font-size: .78rem; color: var(--muted); font-weight: 600; }
.surah-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }

.surah-tile {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 12px; cursor: pointer; position: relative;
  transition: transform .12s;
}
.surah-tile:active { transform: scale(.97); }
.surah-tile.done { border-color: var(--gold); background: linear-gradient(160deg, var(--card), var(--gold-soft)); }
.surah-tile.current { border-color: var(--emerald-2); box-shadow: 0 0 0 2px rgba(53, 199, 149, .25); }
.surah-tile .ar { font-family: var(--font-ar); font-size: 1.25rem; color: var(--gold-2); }
.surah-tile .fr { font-weight: 800; font-size: .85rem; margin-top: 2px; }
.surah-tile .meta { font-size: .72rem; color: var(--muted); font-weight: 600; margin-top: 1px; }
.mini-bar { height: 5px; border-radius: 99px; background: var(--card-3); margin-top: 9px; overflow: hidden; }
.mini-bar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--emerald), var(--gold)); }
.surah-tile .medal { position: absolute; top: 8px; right: 10px; font-size: 1rem; }

/* ---------- Liste des sourates ---------- */
.search {
  width: 100%; padding: 13px 16px; border-radius: 14px;
  background: var(--card); border: 1px solid var(--line);
  color: var(--text); font-family: inherit; font-size: .95rem; font-weight: 600;
  outline: none; margin-bottom: 12px;
}
.search::placeholder { color: var(--muted-2); }
.surah-row {
  display: flex; align-items: center; gap: 13px;
  padding: 12px 8px; border-bottom: 1px solid var(--line); cursor: pointer;
}
.surah-row .num {
  width: 38px; height: 38px; flex: none;
  display: grid; place-items: center;
  background: var(--card-2); border: 1px solid var(--line);
  clip-path: polygon(50% 0%, 63% 13%, 81% 9%, 87% 27%, 100% 37%, 94% 55%, 100% 72%, 84% 79%, 77% 96%, 59% 91%, 43% 100%, 31% 86%, 12% 88%, 9% 70%, 0% 58%, 8% 42%, 3% 24%, 21% 20%, 28% 3%, 46% 8%);
  font-weight: 800; font-size: .8rem; color: var(--gold-2);
}
.surah-row .names { flex: 1; min-width: 0; }
.surah-row .fr { font-weight: 800; }
.surah-row .meta { font-size: .75rem; color: var(--muted); font-weight: 600; }
.surah-row .ar { font-family: var(--font-ar); font-size: 1.35rem; color: var(--gold-2); }
.surah-row .pct { font-size: .72rem; color: var(--emerald-2); font-weight: 800; }

/* ---------- Vue apprentissage ---------- */
.learn-head { display: flex; align-items: center; gap: 10px; padding: 4px 0 12px; }
.learn-head .back {
  width: 40px; height: 40px; border-radius: 13px; flex: none;
  background: var(--card); border: 1px solid var(--line);
  display: grid; place-items: center; font-size: 1.1rem;
}
.learn-head .titles { flex: 1; min-width: 0; }
.learn-head .t { font-weight: 800; font-size: 1.05rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.learn-head .s { font-size: .76rem; color: var(--muted); font-weight: 700; }
.learn-head .reciter-btn {
  display: flex; align-items: center; gap: 7px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 999px; padding: 8px 13px;
  font-size: .78rem; font-weight: 800; color: var(--gold-2);
  max-width: 150px;
}
.learn-head .reciter-btn span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.basmala {
  text-align: center; font-family: var(--font-ar);
  font-size: 1.7rem; color: var(--gold); opacity: .85;
  margin: 6px 0 12px;
}

.verse-card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 22px; padding: 26px 22px; box-shadow: var(--shadow);
  position: relative; overflow: hidden;
}
.verse-card::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  border-radius: 22px;
  background: radial-gradient(400px 120px at 50% 0%, var(--gold-soft), transparent 70%);
  opacity: .5;
}
.v-num {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: .75rem; font-weight: 800; color: var(--muted);
  margin-bottom: 14px;
}
.v-num .badge {
  background: var(--gold-soft); color: var(--gold-2);
  padding: 3px 11px; border-radius: 999px; border: 1px solid var(--line);
}
.v-arabic {
  font-family: var(--font-ar);
  font-size: calc(2.1rem * var(--fs));
  line-height: 2.1;
  text-align: center;
  direction: rtl;
  color: var(--text);
  transition: filter .25s;
}
.v-phonetic {
  margin-top: 18px; text-align: center;
  color: var(--gold-2); font-weight: 700;
  font-size: 1.12rem; line-height: 1.85;
  letter-spacing: .015em;
  transition: filter .25s, color .3s, text-shadow .3s;
}
.v-phonetic.active {
  color: var(--emerald-2);
  text-shadow: 0 0 22px rgba(53, 199, 149, .35);
}
.v-tafsir {
  margin-top: 16px; padding: 13px 15px;
  background: var(--card-2); border: 1px solid var(--line);
  border-left: 3px solid var(--gold);
  border-radius: 12px;
  font-size: .84rem; line-height: 1.7; color: var(--muted);
  font-weight: 600; text-align: left; white-space: pre-line;
}
.v-tafsir b { color: var(--gold-2); }
.v-french {
  margin-top: 14px; text-align: center;
  color: var(--muted); font-weight: 600;
  font-size: .92rem; line-height: 1.6;
  font-style: italic;
}
.masked .v-arabic, .masked .v-phonetic { filter: blur(14px); }
.mask-hint {
  text-align: center; margin-top: 14px; font-size: .8rem;
  color: var(--gold); font-weight: 700; cursor: pointer;
}
.repeat-indicator {
  text-align: center; margin-top: 12px;
  font-size: .8rem; font-weight: 800; color: var(--emerald-2);
  min-height: 1.2em;
}

.toggles { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 14px 0 4px; }

/* auto-évaluation */
.evalbar { display: flex; gap: 8px; margin-top: 14px; }
.evalbar .btn { flex: 1; padding: 12px 6px; font-size: .85rem; }
.ev-again { color: #ffd9cb; background: rgba(224, 120, 86, .18); border-color: rgba(224, 120, 86, .4); }
.ev-almost { color: #ffedc2; background: rgba(224, 179, 86, .16); border-color: rgba(224, 179, 86, .4); }
.ev-good { color: #d2ffe9; background: rgba(53, 199, 149, .16); border-color: rgba(53, 199, 149, .45); }

/* mini-carte des versets */
.verse-dots { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 16px 2px 0; }
.vdot {
  width: 26px; height: 26px; border-radius: 9px;
  display: grid; place-items: center;
  background: var(--card-2); border: 1px solid var(--line);
  font-size: .62rem; font-weight: 800; color: var(--muted-2); cursor: pointer;
}
.vdot.learning { background: rgba(224, 179, 86, .2); color: var(--warn); border-color: rgba(224,179,86,.4); }
.vdot.known { background: rgba(53, 199, 149, .18); color: var(--ok); border-color: rgba(53,199,149,.4); }
.vdot.due { background: rgba(224, 120, 86, .18); color: var(--danger); border-color: rgba(224,120,86,.4); }
.vdot.on { outline: 2px solid var(--gold); outline-offset: 1px; color: var(--gold-2); }

/* ---------- Lecteur ---------- */
.player {
  position: fixed; left: 0; right: 0; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 35;
  display: flex; justify-content: center; padding: 0 14px;
}
#learn-root { padding-bottom: 220px; }
.player .inner {
  width: 100%; max-width: 640px;
  background: color-mix(in srgb, var(--card) 94%, transparent);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--line); border-radius: 22px;
  padding: 12px 14px; box-shadow: var(--shadow);
}
.player-main { display: flex; align-items: center; justify-content: center; gap: 18px; }
.pbtn {
  width: 46px; height: 46px; border-radius: 999px;
  display: grid; place-items: center; font-size: 1.15rem;
  background: var(--card-2); border: 1px solid var(--line); color: var(--text);
}
.pbtn.play {
  width: 62px; height: 62px; font-size: 1.5rem;
  background: linear-gradient(135deg, #caa25c, #e8c98a);
  color: #2a1f08; border: none;
  box-shadow: 0 8px 22px rgba(212, 175, 106, .35);
}
.player-opts { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 10px; }
.popt {
  font-size: .72rem; font-weight: 800; padding: 6px 11px;
  border-radius: 999px; background: var(--card-2);
  border: 1px solid var(--line); color: var(--muted); cursor: pointer;
}
.popt.on { background: var(--gold-soft); color: var(--gold-2); border-color: var(--gold); }

/* ---------- Fiches modales ---------- */
.sheet-veil {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(2, 12, 9, .6);
  backdrop-filter: blur(3px);
  display: flex; align-items: flex-end; justify-content: center;
  animation: fadein .18s ease;
}
.sheet {
  width: 100%; max-width: 640px; max-height: 86vh; overflow-y: auto;
  background: var(--bg); border: 1px solid var(--line);
  border-radius: 26px 26px 0 0; padding: 10px 20px calc(24px + env(safe-area-inset-bottom));
  animation: slideup .22s ease;
}
.sheet .grab { width: 44px; height: 5px; border-radius: 99px; background: var(--line); margin: 8px auto 16px; }
.sheet h3 { font-size: 1.1rem; margin-bottom: 14px; }
@keyframes slideup { from { transform: translateY(40px); opacity: .4; } to { transform: none; opacity: 1; } }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }

.reciter-item {
  display: flex; align-items: center; gap: 13px;
  padding: 12px 8px; border-bottom: 1px solid var(--line); cursor: pointer;
  border-radius: 10px;
}
.reciter-item .av {
  width: 42px; height: 42px; border-radius: 999px; flex: none;
  background: var(--card-3); border: 1px solid var(--line);
  display: grid; place-items: center; font-size: 1.1rem; color: var(--gold-2);
}
.reciter-item .n { font-weight: 800; }
.reciter-item .d { font-size: .75rem; color: var(--muted); font-weight: 600; }
.reciter-item .check { margin-left: auto; color: var(--emerald-2); font-weight: 800; }
.reciter-item.on { background: var(--gold-soft); }

/* ---------- Profils ---------- */
.onboard { padding: 40px 6px 20px; text-align: center; }
.onboard .big-logo {
  width: 86px; height: 86px; margin: 0 auto 18px; border-radius: 26px;
  background: linear-gradient(135deg, #0f5c44, #1b8a67);
  border: 1px solid var(--line); box-shadow: var(--shadow);
  display: grid; place-items: center; font-size: 44px; color: var(--gold-2);
}
.onboard h2 { font-size: 1.5rem; }
.onboard p { color: var(--muted); font-weight: 600; margin: 8px 0 24px; }
.profil-card {
  display: flex; align-items: center; gap: 14px;
  padding: 14px; margin-bottom: 10px; cursor: pointer;
  background: var(--card); border: 1px solid var(--line); border-radius: 18px;
  text-align: left;
}
.profil-card .av { font-size: 2rem; }
.profil-card .n { font-weight: 800; font-size: 1.05rem; }
.profil-card .d { font-size: .78rem; color: var(--muted); font-weight: 700; }
.avatar-grid { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 10px 0 18px; }
.avatar-grid .av {
  width: 52px; height: 52px; border-radius: 16px; font-size: 1.6rem;
  display: grid; place-items: center;
  background: var(--card); border: 2px solid var(--line); cursor: pointer;
}
.avatar-grid .av.on { border-color: var(--gold); background: var(--gold-soft); }
.input {
  width: 100%; padding: 14px 16px; border-radius: 14px;
  background: var(--card); border: 1px solid var(--line);
  color: var(--text); font-family: inherit; font-size: 1rem; font-weight: 700;
  outline: none; text-align: center;
}
.mode-row { display: flex; gap: 8px; margin: 14px 0 20px; }
.mode-card {
  flex: 1; padding: 13px 8px; border-radius: 16px; cursor: pointer;
  background: var(--card); border: 2px solid var(--line); text-align: center;
}
.mode-card.on { border-color: var(--gold); background: var(--gold-soft); }
.mode-card .e { font-size: 1.5rem; }
.mode-card .t { font-weight: 800; font-size: .8rem; margin-top: 4px; }
.mode-card .d { font-size: .66rem; color: var(--muted); font-weight: 700; }

/* ---------- Stats ---------- */
.heatmap { display: grid; grid-template-columns: repeat(14, 1fr); gap: 4px; margin-top: 8px; }
.hm-cell { aspect-ratio: 1; border-radius: 5px; background: var(--card-3); }
.hm-cell.l1 { background: #1d5d47; }
.hm-cell.l2 { background: #27906c; }
.hm-cell.l3 { background: #35c795; }
.hm-cell.l4 { background: var(--gold); }
.badge-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.badge-item {
  width: 74px; text-align: center; padding: 10px 4px;
  background: var(--card); border: 1px solid var(--gold); border-radius: 16px;
}
.badge-item .e { font-size: 1.5rem; }
.badge-item .t { font-size: .62rem; font-weight: 800; color: var(--gold-2); margin-top: 3px; }

/* ---------- Mode enfant ---------- */
.kid body, [data-kid] { }
.kid-learn .verse-card { border-radius: 30px; padding: 30px 20px; }
.kid-learn .v-arabic { font-size: calc(2.5rem * var(--fs)); }
.kid-learn .v-phonetic { font-size: 1.25rem; }
.kid-stars { display: flex; justify-content: center; gap: 10px; margin: 18px 0 4px; font-size: 2.2rem; }
.kid-stars .st { filter: grayscale(1) opacity(.35); transform: scale(.9); transition: all .3s; }
.kid-stars .st.on { filter: none; transform: scale(1.1); animation: pop .4s ease; }
@keyframes pop { 0% { transform: scale(.5); } 60% { transform: scale(1.35); } 100% { transform: scale(1.1); } }
.kid-bigplay {
  width: 96px; height: 96px; border-radius: 999px; margin: 18px auto;
  display: grid; place-items: center; font-size: 2.3rem;
  background: linear-gradient(135deg, #caa25c, #e8c98a); color: #2a1f08;
  box-shadow: 0 10px 30px rgba(212, 175, 106, .4);
  border: none; cursor: pointer;
  transition: transform .15s;
}
.kid-bigplay:active { transform: scale(.93); }
.kid-actions { display: flex; gap: 10px; margin-top: 14px; }
.kid-actions .btn { flex: 1; font-size: 1rem; padding: 16px 8px; border-radius: 18px; }

/* confettis */
.confetti {
  position: fixed; inset: 0; pointer-events: none; z-index: 100; overflow: hidden;
}
.confetti i {
  position: absolute; top: -20px; width: 10px; height: 14px; border-radius: 3px;
  animation: fall linear forwards;
}
@keyframes fall {
  to { transform: translateY(110vh) rotate(720deg); opacity: .6; }
}

/* toast */
.toast {
  position: fixed; bottom: 170px; left: 50%; transform: translateX(-50%);
  background: var(--card-3); color: var(--text);
  border: 1px solid var(--gold); border-radius: 999px;
  padding: 10px 20px; font-weight: 800; font-size: .85rem;
  z-index: 90; box-shadow: var(--shadow);
  animation: fadein .2s ease;
  white-space: nowrap;
}

/* range selects */
.range-row { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 8px; font-size: .8rem; font-weight: 700; color: var(--muted); }
.range-row select {
  background: var(--card-2); color: var(--text); border: 1px solid var(--line);
  border-radius: 10px; padding: 6px 10px; font-family: inherit; font-weight: 700;
}

.progress-line { height: 8px; border-radius: 99px; background: var(--card-3); overflow: hidden; margin-top: 8px; }
.progress-line i { display: block; height: 100%; background: linear-gradient(90deg, var(--emerald), var(--gold)); border-radius: 99px; transition: width .4s; }

.small-note { font-size: .72rem; color: var(--muted-2); font-weight: 600; text-align: center; margin-top: 14px; line-height: 1.5; }

.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 4px; border-bottom: 1px solid var(--line); }
.setting-row .l { font-weight: 800; font-size: .92rem; }
.setting-row .d { font-size: .74rem; color: var(--muted); font-weight: 600; }

/* ---------- Lecture continue ---------- */
.read-verses .verse-row {
  margin-bottom: 12px;
  border-radius: 18px; padding: 18px 18px 16px;
  transition: border-color .3s, box-shadow .3s, background .3s;
  scroll-margin: 120px;
}
.verse-row.playing {
  border-color: var(--emerald-2);
  box-shadow: 0 0 0 2px rgba(53, 199, 149, .28), var(--shadow);
  background: linear-gradient(160deg, var(--card), rgba(53, 199, 149, .07));
}
.verse-row.playing .v-phonetic { color: var(--emerald-2); text-shadow: 0 0 20px rgba(53,199,149,.3); }
.verse-row .v-phonetic { margin-top: 12px; font-size: 1.02rem; }
.verse-row .v-french { margin-top: 10px; }
.vplay {
  width: 30px; height: 30px; border-radius: 10px;
  display: inline-grid; place-items: center;
  background: var(--card-2); border: 1px solid var(--line);
  color: var(--gold-2); font-size: .72rem; cursor: pointer;
}
.vplay:hover { background: var(--gold-soft); }

/* Bandeau discret quand l'appareil est hors connexion (dans le flux, sans chevauchement) */
body.offline .topbar::after {
  content: "📴 Hors connexion — contenu téléchargé disponible";
  display: block;
  position: absolute; left: 0; right: 0; bottom: -2px;
  text-align: center; font-size: .66rem; font-weight: 800;
  color: var(--gold-2); background: var(--card);
  border: 1px solid var(--line); border-radius: 999px;
  padding: 3px 10px; letter-spacing: .02em; white-space: nowrap;
  width: fit-content; margin: 0 auto;
}
body.offline .topbar { position: relative; padding-bottom: 22px; }

/* Sur mobile/tablette, pas de barre de navigation dans les vues immersives */
@media (max-width: 959px) {
  body[data-view="learn"] .navbar, body[data-view="read"] .navbar { display: none; }
}

/* ---------- Responsive : iPad ---------- */
@media (min-width: 560px) {
  .surah-grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
  #app { max-width: 760px; }
  .v-arabic { font-size: calc(2.4rem * var(--fs)); }
}

/* ---------- Responsive : ordinateur (Mac) — barre latérale ---------- */
@media (min-width: 960px) {
  #app { max-width: 820px; padding-left: 240px; padding-bottom: 40px; }
  .topbar { background: none; }
  .navbar {
    left: 0; right: auto; top: 0; bottom: 0;
    width: 220px; padding: 24px 18px;
    background: none; align-items: flex-start;
  }
  .navbar .inner {
    flex-direction: column; gap: 6px; height: fit-content;
    width: 100%; border-radius: 22px; padding: 12px;
    margin-top: 86px;
  }
  .nav-item {
    flex: none; width: 100%;
    flex-direction: row; justify-content: flex-start; gap: 12px;
    padding: 12px 14px; font-size: .88rem;
  }
  .nav-item .ico { font-size: 1.15rem; }
  .player { left: 240px; }
  .player .inner { max-width: 780px; }
  .sheet-veil { align-items: center; }
  .sheet { border-radius: 26px; max-width: 560px; }
  .verse-card { padding: 34px 40px; }
  .v-arabic { font-size: calc(2.6rem * var(--fs)); line-height: 2.2; }
  .v-phonetic { font-size: 1.18rem; }
  .v-french { font-size: 1rem; }
  .surah-grid { grid-template-columns: repeat(auto-fill, minmax(185px, 1fr)); }
  .heatmap { grid-template-columns: repeat(28, 1fr); }
  .btn:hover, .chip:hover, .popt:hover, .nav-item:hover { filter: brightness(1.12); }
  .surah-tile:hover, .surah-row:hover, .reciter-item:hover { background: var(--card-2); }
}

/* Écran très large */
@media (min-width: 1400px) {
  #app { max-width: 900px; }
}
