:root {
  --bg: #121212;
  --bg-elev: #181818;
  --card: #1f1f1f;
  --card-hover: #2a2a2a;
  --line: #2e2e2e;
  --line-strong: #3a3a3a;
  --tab-bg: #000;
  --text: #ffffff;
  --text-dim: #b3b3b3;
  --text-mute: #7a7a7a;
  --accent: #26d07c;
  --accent-press: #1fb56a;
  --radius: 8px;
  --tabbar-h: 64px;
  --mini-h: 60px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-ar: "Amiri", "Noto Naskh Arabic", serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
svg { fill: currentColor; }

#app { min-height: 100%; }

/* ---------- Vue principale ---------- */
.view {
  padding: 16px 16px calc(var(--tabbar-h) + var(--mini-h) + var(--safe-b) + 24px);
  max-width: 900px;
  margin: 0 auto;
  outline: none;
}
.view-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 0 16px;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand img { width: 32px; height: 32px; border-radius: 8px; }
.brand span { font-weight: 800; font-size: 22px; letter-spacing: -0.02em; }
h1 { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; margin: 8px 0 16px; }
h2 { font-size: 20px; font-weight: 700; letter-spacing: -0.01em; margin: 24px 0 12px; }

.placeholder {
  background: var(--bg-elev);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 24px;
  color: var(--text-dim);
  text-align: center;
  font-size: 14px;
}

/* Grille de cartes (utilisée dès l'étape 2) */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 16px;
}
.card {
  background: var(--bg-elev);
  border-radius: var(--radius);
  padding: 12px;
  transition: background .2s;
}
.card:hover { background: var(--card-hover); }
.skeleton {
  background: linear-gradient(90deg, var(--bg-elev) 0%, var(--card-hover) 50%, var(--bg-elev) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite linear;
  border-radius: var(--radius);
}
@keyframes shimmer { to { background-position: -200% 0; } }

.card { display: block; min-width: 0; }
.card-title { font-size: 14px; font-weight: 600; margin-top: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-sub { font-size: 12px; color: var(--text-dim); margin-top: 2px; }

/* Rangée horizontale défilante */
.h-scroll {
  display: grid; grid-auto-flow: column; grid-auto-columns: 140px; gap: 12px;
  overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
  margin: 0 -16px; padding: 0 16px;
}
.h-scroll::-webkit-scrollbar { display: none; }
.h-scroll > * { scroll-snap-align: start; }

/* Avatars générés */
.avatar {
  aspect-ratio: 1; width: 100%; border-radius: 50%;
  display: grid; place-items: center; flex: none;
  box-shadow: 0 8px 20px rgba(0,0,0,.4);
}
.avatar span { font-weight: 800; font-size: 34px; color: rgba(255,255,255,.92); letter-spacing: .02em; }
.avatar.sm { width: 52px; box-shadow: none; }
.avatar.sm span { font-size: 17px; }
.avatar.lg { width: 180px; margin: 0 auto; }
.avatar.lg span { font-size: 60px; }

/* Listes */
.list { display: flex; flex-direction: column; }
.row {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 0; border-radius: 6px;
}
.row:active { background: var(--bg-elev); }
.row-meta { flex: 1; min-width: 0; }
.row-title { font-size: 15px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-sub { font-size: 13px; color: var(--text-dim); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Recherche */
.search-box {
  position: sticky; top: 8px; z-index: 5;
  display: flex; align-items: center; gap: 10px;
  background: #fff; color: #121212; border-radius: 6px;
  padding: 0 12px; height: 46px; margin-bottom: 12px;
}
.search-box > svg { width: 22px; height: 22px; flex: none; }
.search-box input {
  flex: 1; min-width: 0; border: 0; outline: 0; background: none;
  font: 500 15px var(--font); color: #121212;
}
.search-box input::-webkit-search-cancel-button { display: none; }
.search-box .clear { width: 28px; height: 28px; display: grid; place-items: center; }
.search-box .clear svg { width: 18px; height: 18px; }
.empty { text-align: center; padding: 48px 16px; }
.empty p { color: var(--text-dim); font-size: 14px; }

.btn-pill {
  margin-top: 14px; padding: 10px 22px; border-radius: 999px;
  background: var(--text); color: #000; font-weight: 700; font-size: 14px;
}

.avatar { position: relative; overflow: hidden; }
.avatar img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: 50% 10%;
}

/* Page récitateur */
.reciter-bg {
  position: absolute; top: 0; left: 0; right: 0; height: 340px; z-index: -1;
  -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,.55), transparent);
          mask-image: linear-gradient(to bottom, rgba(0,0,0,.55), transparent);
}
.back { position: relative; margin-top: -4px; margin-inline-start: -8px; }
.reciter-hero { text-align: center; padding: 8px 0 8px; }
.reciter-hero h1 { margin: 20px 0 8px; font-size: 28px; }

.chips {
  display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none;
  margin: 8px -16px 0; padding: 0 16px;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; padding: 8px 14px; border-radius: 999px;
  background: var(--card-hover); font-size: 13px; font-weight: 500; white-space: nowrap;
}
.chip.active { background: var(--accent); color: #000; }

.reciter-actions {
  display: flex; align-items: center; justify-content: space-between;
  margin: 16px 0 8px;
}
.reciter-count { font-size: 13px; color: var(--text-dim); }
.play-big {
  width: 56px; height: 56px; border-radius: 50%;
  flex-shrink: 0; /* toujours rond, même quand le texte à côté est long */
  background: var(--accent); color: #000;
  display: grid; place-items: center;
  box-shadow: 0 8px 18px rgba(0,0,0,.35);
  transition: transform .1s, background .15s;
}
.play-big svg { width: 28px; height: 28px; }
.play-big:active { transform: scale(.94); background: var(--accent-press); }

.surah-row { width: 100%; text-align: left; padding: 10px 0; }
.surah-num {
  width: 28px; flex: none; text-align: center;
  font-size: 14px; color: var(--text-dim); font-variant-numeric: tabular-nums;
}
.surah-ar {
  flex: none; font-family: var(--font-ar); font-size: 21px; color: var(--text-dim);
  padding-inline-start: 8px; line-height: 1;
}
.surah-row.playing .row-title, .surah-row.playing .surah-num { color: var(--accent); }

/* ---------- Mini-lecteur ---------- */
.mini-player {
  position: fixed;
  left: 8px; right: 8px;
  bottom: calc(var(--tabbar-h) + var(--safe-b) + 6px);
  height: var(--mini-h);
  background: var(--t-mini);
  border-radius: var(--radius);
  display: flex; align-items: center; gap: 10px;
  padding: 0 8px;
  z-index: 20;
  box-shadow: 0 8px 24px rgba(0,0,0,.4);
}
.mini-player[hidden] { display: none; }
.mini-player { cursor: pointer; }
.mini-cover { width: 44px; height: 44px; border-radius: 4px; background: var(--card); flex: none; overflow: hidden; }
.mini-cover img, .mini-cover span { width: 100%; height: 100%; display: grid; place-items: center; object-fit: cover; object-position: 50% 10%; }
.mini-cover span { font-weight: 800; font-size: 16px; }
.mini-cover { position: relative; }
.mini-cover img { position: absolute; inset: 0; }
.mini-meta { flex: 1; min-width: 0; }
.mini-title, .mini-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-title { font-size: 14px; font-weight: 600; }
.mini-sub { font-size: 12px; color: var(--text-dim); }
.icon-btn { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; }
.icon-btn svg { width: 26px; height: 26px; }
.mini-progress { position: absolute; left: 8px; right: 8px; bottom: 0; height: 2px; background: rgba(255,255,255,.2); border-radius: 2px; overflow: hidden; }
.mini-progress span { display: block; height: 100%; width: 0; background: #fff; }

/* ---------- Favoris ---------- */
.heart {
  flex: none; width: 40px; height: 40px; margin-inline-end: -8px;
  display: grid; place-items: center; color: var(--text-dim);
  transition: transform .15s;
}
.heart svg { width: 20px; height: 20px; }
.heart.on { color: var(--accent); }
.heart:active { transform: scale(.85); }
.heart.big { width: 44px; height: 44px; margin: 0; margin-inline-start: -10px; }
.heart.big svg { width: 28px; height: 28px; }
.ra-left { display: flex; align-items: center; gap: 4px; min-width: 0; }

.fav-tile {
  display: grid; place-items: center; flex: none; aspect-ratio: 1;
  background: linear-gradient(135deg, var(--t-strong), var(--accent) 55%, var(--t-light));
  color: #fff; border-radius: 4px;
}
.fav-tile.sm { width: 52px; }
.fav-tile.sm svg { width: 22px; height: 22px; }
.fav-tile.lg { width: 180px; margin: 0 auto; border-radius: 8px; box-shadow: 0 12px 32px rgba(0,0,0,.45); }
.fav-tile.lg svg { width: 72px; height: 72px; }
.fav-bg { background: linear-gradient(180deg, var(--t-strong), transparent); }
.pin { color: var(--accent); font-size: 9px; vertical-align: 1px; }

.avatar.square { border-radius: 4px; }
.surah-ar-inline { font-family: var(--font-ar); font-size: 16px; color: var(--text-dim); font-weight: 400; margin-inline-start: 4px; }

.lib-chips { margin-bottom: 12px; }
a.btn-pill { display: inline-block; }

.credits { margin-top: 40px; font-size: 13px; color: var(--text-mute); }
.credits summary { cursor: pointer; font-weight: 600; }
.credits p { margin: 10px 0 6px; }
.credits ul { margin: 0; padding-inline-start: 18px; columns: 2; column-gap: 16px; }
.credits a { color: var(--text-dim); text-decoration: underline; text-underline-offset: 2px; }

.toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + var(--mini-h) + var(--safe-b) + 18px);
  transform: translate(-50%, 12px); opacity: 0; pointer-events: none;
  background: #fff; color: #000; font-size: 14px; font-weight: 600;
  padding: 10px 16px; border-radius: 8px; width: max-content; max-width: calc(100% - 32px);
  box-shadow: 0 8px 24px rgba(0,0,0,.4);
  transition: opacity .2s, transform .2s; z-index: 60;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
body.fp-open .toast { bottom: calc(var(--safe-b) + 24px); }

/* ---------- Connexion ---------- */
body.auth-open #app { display: none; }
.auth {
  min-height: 100vh; min-height: 100dvh;
  background: radial-gradient(120% 60% at 50% 0%, var(--t-mid) 0%, #121212 60%);
}
.auth-screen {
  max-width: 420px; margin: 0 auto; min-height: 100vh; min-height: 100dvh;
  padding: calc(env(safe-area-inset-top, 0px) + 16px) 24px calc(var(--safe-b) + 32px);
  display: flex; flex-direction: column;
}
.auth-welcome { flex: 1; display: flex; flex-direction: column; justify-content: center; text-align: center; }
.auth-logo { width: 96px; height: 96px; border-radius: 22px; margin: 0 auto 28px; box-shadow: 0 16px 40px rgba(0,0,0,.5); }
.auth-welcome h1 { font-size: 28px; line-height: 1.2; margin: 0 0 36px; }
.auth-welcome h2 { margin-top: 0; }
.auth-buttons { display: flex; flex-direction: column; gap: 12px; }
.auth-back { margin-inline-start: -8px; }
.auth-screen > h2 { font-size: 26px; margin: 16px 0 24px; }
.auth-text { color: var(--text-dim); font-size: 15px; line-height: 1.5; margin: -8px 0 20px; }
.auth-switch { text-align: center; color: var(--text-dim); font-size: 14px; margin: 18px 0 0; }
.auth-switch a { color: var(--text); font-weight: 700; text-decoration: underline; cursor: pointer; }
.auth-msg { min-height: 20px; font-size: 14px; margin: 4px 0 12px; }
.auth-msg.error { color: #ff7a7a; }
.auth-msg.ok { color: var(--accent); }
.auth-msg code { background: rgba(255,255,255,.08); padding: 1px 5px; border-radius: 4px; }

.btn-primary, .btn-outline {
  display: block; width: 100%; height: 50px; border-radius: 999px;
  font-weight: 700; font-size: 16px; text-align: center; line-height: 50px;
  transition: transform .1s, opacity .15s;
}
.btn-primary { background: var(--accent); color: #000; }
.btn-primary:active, .btn-outline:active { transform: scale(.98); }
.btn-primary:disabled { opacity: .6; }
.btn-outline { border: 1px solid #7a7a7a; color: var(--text); line-height: 48px; }
.btn-provider { display: flex; align-items: center; justify-content: center; gap: 12px; position: relative; }
.btn-provider svg { width: 22px; height: 22px; position: absolute; inset-inline-start: 20px; }
.btn-text { height: 44px; font-weight: 700; font-size: 16px; color: var(--text); }
.auth-or { display: flex; align-items: center; gap: 12px; color: var(--text-mute); font-size: 13px; margin: 20px 0 16px; }
.auth-or::before, .auth-or::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.me-btn img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.btn-outline.small { display: inline-block; width: auto; height: 34px; line-height: 32px; padding: 0 16px; font-size: 13px; }
.btn-outline.wide { margin-top: 32px; }

.field { display: block; margin-bottom: 14px; flex: 1; min-width: 0; }
.field > span { display: block; font-size: 13px; font-weight: 700; margin-bottom: 6px; }
.field-input { display: flex; align-items: center; background: var(--card-hover); border: 1px solid var(--line-strong); border-radius: 6px; }
.field-input:focus-within { border-color: var(--text); }
.field-input input {
  flex: 1; min-width: 0; height: 46px; padding: 0 12px; border: 0; outline: 0; background: none;
  color: var(--text); font: 500 16px var(--font);
}
.field-input input:disabled { color: var(--text-mute); }
.eye { width: 44px; height: 44px; display: grid; place-items: center; color: var(--text-dim); }
.eye svg { width: 20px; height: 20px; }
.eye.on { color: var(--accent); }
.field-row { display: flex; gap: 12px; }
.field-hint { font-size: 12px; color: var(--text-mute); margin: -6px 0 12px; }

/* ---------- Profil ---------- */
.top-bar { display: flex; align-items: center; gap: 12px; padding: 4px 0 12px; }
.top-bar h1 { margin: 0; flex: 1; font-size: 24px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-logo { width: 34px; height: 34px; border-radius: 9px; }
.me-btn {
  flex: none; width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg, #f59e0b, #e2580b); color: #000;
  font-weight: 800; font-size: 13px; display: grid; place-items: center;
}
.me-btn.lg { width: 52px; height: 52px; font-size: 19px; }
.me-btn.xl { width: 116px; height: 116px; font-size: 42px; box-shadow: 0 12px 32px rgba(0,0,0,.5); }

.drawer[hidden] { display: none; }
.drawer-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 70; opacity: 0; transition: opacity .25s; }
.drawer-panel {
  position: fixed; top: 0; bottom: 0; left: 0; width: min(84vw, 340px); z-index: 71;
  background: var(--card); padding: calc(env(safe-area-inset-top, 0px) + 20px) 8px 20px;
  transform: translateX(-100%); transition: transform .25s ease;
  display: flex; flex-direction: column; gap: 2px;
}
.drawer.open .drawer-backdrop { opacity: 1; }
.drawer.open .drawer-panel { transform: none; }
.drawer-panel > a, .drawer-panel > button {
  display: flex; align-items: center; gap: 16px; padding: 14px 12px; border-radius: 6px;
  font-size: 16px; font-weight: 500; text-align: left; width: 100%;
}
.drawer-panel > a:active, .drawer-panel > button:active { background: var(--card-hover); }
.drawer-panel svg { width: 24px; height: 24px; color: var(--text-dim); }
.drawer-me { border-bottom: 1px solid var(--line); border-radius: 0 !important; padding-bottom: 20px !important; margin-bottom: 8px; }
.drawer-me strong { display: block; font-size: 18px; }
.drawer-me small { color: var(--text-dim); font-size: 13px; }

.profile-bg { background: linear-gradient(180deg, #b45309, transparent); }
.profile-hero { display: flex; align-items: flex-end; gap: 16px; margin: 8px 0 16px; }
.profile-hero small { font-size: 12px; font-weight: 700; }
.profile-hero h1 { margin: 2px 0 4px; font-size: 30px; line-height: 1.1; word-break: break-word; }
.profile-hero p { margin: 0; font-size: 13px; color: var(--text-dim); }

.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat { background: var(--bg-elev); border-radius: var(--radius); padding: 14px; }
.stat strong { display: block; font-size: 22px; font-weight: 800; color: var(--accent); }
.stat span { font-size: 12px; color: var(--text-dim); }
.week-chart { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; margin-top: 12px; background: var(--bg-elev); border-radius: var(--radius); padding: 14px 14px 10px; }
.week-day { text-align: center; }
.week-bar { height: 72px; display: flex; align-items: flex-end; justify-content: center; }
.week-bar span { width: 100%; max-width: 22px; min-height: 3px; background: var(--accent); border-radius: 4px 4px 0 0; }
.week-day small { font-size: 11px; color: var(--text-mute); text-transform: uppercase; }
.rank { width: 22px; flex: none; text-align: center; font-weight: 800; color: var(--text-dim); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; }
.section-head a { font-size: 13px; font-weight: 700; color: var(--text-dim); }

.settings-card { background: var(--bg-elev); border-radius: var(--radius); padding: 14px; margin-bottom: 12px; }
.settings-card .btn-pill { margin-top: 2px; }
.setting { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 0; }
.setting + .setting, .setting + .setting-btn { border-top: 1px solid var(--line); }
.setting strong { display: block; font-size: 15px; font-weight: 600; }
.setting small { display: block; font-size: 12px; color: var(--text-dim); margin-top: 2px; }
.setting select { background: var(--card-hover); color: var(--text); border: 1px solid var(--line-strong); border-radius: 6px; padding: 8px; font: 500 14px var(--font); }
.switch {
  -webkit-appearance: none; appearance: none; flex: none; cursor: pointer;
  width: 46px; height: 28px; border-radius: 999px; background: #535353; position: relative; transition: background .2s;
}
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform .2s; }
.switch:checked { background: var(--accent); }
.switch:checked::after { transform: translateX(18px); }
.setting-btn { display: block; width: 100%; text-align: left; padding: 14px 0; font-size: 15px; font-weight: 600; border-top: 1px solid var(--line); }
.setting-btn.danger { color: #ff7a7a; }
.about { text-align: center; font-size: 12px; color: var(--text-mute); margin-top: 20px; }
.about a { text-decoration: underline; }

/* ---------- Langues ---------- */
.lang-select, .setting select[data-action="account-lang"] {
  background: var(--card-hover); color: var(--text); border: 1px solid var(--line-strong); border-radius: 999px;
  padding: 8px 12px; font: 600 13px var(--font);
}
.auth-lang { display: flex; justify-content: flex-end; }

/* Arabe et ourdou : police adaptée et écriture de droite à gauche. */
:root[dir="rtl"] { --font: "Noto Sans Arabic", "Inter", system-ui, sans-serif; }
[dir="rtl"] .back svg, [dir="rtl"] .auth-back svg { transform: scaleX(-1); }
[dir="rtl"] .drawer-panel { left: auto; right: 0; transform: translateX(100%); }
[dir="rtl"] .drawer.open .drawer-panel { transform: none; }
[dir="rtl"] h1, [dir="rtl"] h2 { letter-spacing: 0; }
/* Commandes de lecture et barre de progression : même sens que l'audio, comme dans les lecteurs arabes courants. */
.fp-seek, .fp-controls { direction: ltr; }

/* ---------- Lecteur plein écran ---------- */
.full-player {
  position: fixed; inset: 0; z-index: 50;
  display: flex; flex-direction: column;
  padding: calc(env(safe-area-inset-top, 0px) + 8px) 24px calc(var(--safe-b) + 28px);
  background: linear-gradient(180deg, var(--t-mid) 0%, var(--t-dark) 55%, var(--bg) 100%);
  transform: translateY(100%);
  transition: transform .32s cubic-bezier(.2, .8, .2, 1);
  visibility: hidden;
  overflow-y: auto;
}
.full-player.open { transform: none; visibility: visible; }
body.fp-open { overflow: hidden; }

.fp-header { display: flex; align-items: center; justify-content: space-between; margin: 0 -8px; }
.fp-context { text-align: center; min-width: 0; flex: 1; }
.fp-context small { display: block; font-size: 10px; letter-spacing: .12em; color: var(--text-dim); font-weight: 600; }
.fp-context-name { display: block; font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }

.fp-cover { flex: 1; display: flex; align-items: center; justify-content: center; padding: 24px 0; min-height: 0; }
.cover-art {
  position: relative; width: min(100%, 52vh, 420px); aspect-ratio: 1;
  border-radius: 8px; box-shadow: 0 24px 60px rgba(0,0,0,.55);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  overflow: hidden;
}
.cover-art::after { content: ''; position: absolute; inset: 0; background: radial-gradient(circle at 30% 20%, rgba(255,255,255,.14), transparent 60%); pointer-events: none; }
.cover-logo { position: absolute; top: 14px; right: 14px; width: 30px; height: 30px; border-radius: 8px; }
.cover-ar { font-family: var(--font-ar); font-size: clamp(48px, 15vw, 88px); line-height: 1.3; text-shadow: 0 4px 20px rgba(0,0,0,.35); }
.cover-tr { font-weight: 800; font-size: 15px; letter-spacing: .14em; text-transform: uppercase; opacity: .85; }
.cover-reciter {
  position: absolute; left: 14px; bottom: 14px; right: 14px;
  display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; opacity: .95;
}
.cover-reciter img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; object-position: 50% 10%; }

.fp-info { margin-top: 8px; display: flex; align-items: center; gap: 12px; }
.fp-text { flex: 1; min-width: 0; }
.fp-like .heart { margin-inline-end: -10px; }
.fp-like .heart svg { width: 26px; height: 26px; }
.fp-title { font-size: 22px; font-weight: 800; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fp-artist { font-size: 15px; color: var(--text-dim); margin-top: 4px; }

.fp-seek { margin-top: 20px; }
.fp-seek input {
  --pct: 0%;
  width: 100%; height: 16px; margin: 0; background: none; cursor: pointer;
  -webkit-appearance: none; appearance: none;
}
.fp-seek input::-webkit-slider-runnable-track {
  height: 4px; border-radius: 2px;
  background: linear-gradient(to right, #fff var(--pct), rgba(255,255,255,.25) var(--pct));
}
.fp-seek input::-moz-range-track { height: 4px; border-radius: 2px; background: rgba(255,255,255,.25); }
.fp-seek input::-moz-range-progress { height: 4px; border-radius: 2px; background: #fff; }
.fp-seek input::-webkit-slider-thumb {
  -webkit-appearance: none; width: 13px; height: 13px; border-radius: 50%; background: #fff; margin-top: -4.5px; border: 0;
}
.fp-seek input::-moz-range-thumb { width: 13px; height: 13px; border-radius: 50%; background: #fff; border: 0; }
.fp-times { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-dim); margin-top: 4px; font-variant-numeric: tabular-nums; }

.fp-controls { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; }
.fp-controls .icon-btn { width: 48px; height: 48px; position: relative; }
.fp-prev svg, .fp-next svg { width: 34px; height: 34px; }
.fp-shuffle svg, .fp-repeat svg { width: 24px; height: 24px; color: var(--text-dim); }
.fp-shuffle.on svg, .fp-repeat.on svg { color: var(--accent); }
.fp-shuffle.on::after, .fp-repeat.on::after {
  content: ''; position: absolute; bottom: 4px; left: 50%; width: 4px; height: 4px; margin-left: -2px;
  border-radius: 50%; background: var(--accent);
}
.fp-repeat-one {
  display: none; position: absolute; top: 9px; right: 7px;
  font-size: 9px; font-weight: 800; color: #000; background: var(--accent);
  width: 13px; height: 13px; border-radius: 50%; line-height: 13px; text-align: center;
}
.fp-repeat.one .fp-repeat-one { display: block; }
.fp-play {
  width: 68px; height: 68px; border-radius: 50%; background: #fff; color: #000;
  display: grid; place-items: center; transition: transform .1s;
}
.fp-play svg { width: 32px; height: 32px; }
.fp-play:active { transform: scale(.94); }

/* ---------- Barre de navigation ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0;
  height: calc(var(--tabbar-h) + var(--safe-b));
  padding-bottom: var(--safe-b);
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: linear-gradient(to top, var(--tab-bg) 55%, color-mix(in srgb, var(--tab-bg) 85%, transparent));
  z-index: 30;
}
.tabbar a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  color: var(--text-mute); font-size: 11px; font-weight: 500;
  transition: color .15s;
}
.tabbar a svg { width: 24px; height: 24px; }
.tabbar a.active { color: var(--text); }
.tabbar a:active { transform: scale(.94); }

@media (min-width: 768px) {
  .grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
  .mini-player { left: 50%; right: auto; width: min(884px, calc(100% - 16px)); transform: translateX(-50%); }
}

/* ---------- Accueil personnalisé ---------- */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }
.tile {
  display: flex; align-items: center; gap: 8px; min-width: 0; height: 56px;
  background: var(--card-hover); border-radius: 6px; overflow: hidden; text-align: start;
  transition: background .15s;
}
.tile:active { background: var(--line-strong); }
.avatar.tile-img { width: 56px; height: 56px; border-radius: 0; box-shadow: none; }
.avatar.tile-img span { font-size: 17px; }
.tile-text { min-width: 0; padding-inline-end: 8px; }
.tile-text strong, .tile-text small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-text strong { font-size: 13px; font-weight: 700; }
.tile-text small { font-size: 11px; color: var(--text-dim); }
.section-hint { margin: -8px 0 12px; font-size: 13px; color: var(--text-dim); }

/* ---------- Bibliothèque, téléchargements ---------- */
.lib-icon {
  width: 52px; height: 52px; flex: none; border-radius: 4px; display: grid; place-items: center;
  background: var(--card-hover); color: var(--text-dim);
}
.lib-icon svg { width: 24px; height: 24px; }
.lib-icon.dl { background: linear-gradient(135deg, var(--t-deep), var(--t-strong)); color: #fff; }
.lib-icon.support { background: linear-gradient(135deg, #9d174d, #f472b6); color: #fff; }
.dl-mark { width: 13px; height: 13px; color: var(--accent); vertical-align: -2px; margin-inline-end: 5px; }
.dl-all svg, .fp-dl svg { width: 26px; height: 26px; color: var(--text-dim); }
.dl-all.on svg, .fp-dl.on svg { color: var(--accent); }
.fp-dl { position: relative; }
/* Anneau de progression pendant un téléchargement. */
.fp-dl.busy::before {
  content: ''; position: absolute; inset: 5px; border-radius: 50%;
  background: conic-gradient(var(--accent) var(--p, 0%), transparent 0);
  -webkit-mask: radial-gradient(circle, transparent 62%, #000 64%);
          mask: radial-gradient(circle, transparent 62%, #000 64%);
}

/* ---------- Soutenir ---------- */
.support-hero { text-align: center; padding: 16px 8px 24px; }
.support-hero img { width: 72px; height: 72px; border-radius: 18px; }
.support-hero p { color: var(--text-dim); line-height: 1.6; font-size: 15px; }
.field-hint.center { text-align: center; margin-top: 10px; }
.tabbar a span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; padding: 0 2px; }

/* ---------- Panneau d'actions (menus ⋯) ---------- */
.sheet[hidden] { display: none; }
.sheet-backdrop { position: fixed; inset: 0; z-index: 80; background: rgba(0,0,0,.6); opacity: 0; transition: opacity .2s; }
.sheet-panel {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 81;
  max-height: 80vh; overflow-y: auto; background: var(--card); border-radius: 14px 14px 0 0;
  padding: 8px 8px calc(var(--safe-b) + 12px);
  transform: translateY(100%); transition: transform .22s ease;
}
.sheet.open .sheet-backdrop { opacity: 1; }
.sheet.open .sheet-panel { transform: none; }
.sheet-grip { width: 36px; height: 4px; border-radius: 2px; background: #5a5a5a; margin: 4px auto 10px; }
.sheet-head { display: flex; align-items: center; gap: 12px; padding: 4px 8px 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.sheet-head strong, .sheet-head small { display: block; }
.sheet-head strong { font-size: 15px; }
.sheet-head small { font-size: 13px; color: var(--text-dim); }
.sheet-item { display: flex; align-items: center; gap: 16px; width: 100%; padding: 13px 10px; border-radius: 8px; font-size: 15px; text-align: start; }
.sheet-item:active { background: var(--card-hover); }
.sheet-item svg { width: 22px; height: 22px; color: var(--text-dim); flex: none; }
.sheet-item.active, .sheet-item.active svg { color: var(--accent); }
@media (min-width: 768px) { .sheet-panel { left: 50%; right: auto; width: 480px; transform: translate(-50%, 100%); } .sheet.open .sheet-panel { transform: translateX(-50%); } }

.more-btn { flex: none; width: 34px; height: 40px; display: grid; place-items: center; color: var(--text-dim); margin-inline-end: -10px; }
.more-btn svg { width: 20px; height: 20px; }
.surah-row .heart { margin-inline-end: 0; }

/* ---------- Mémorisation ---------- */
.lib-icon.hifz { background: linear-gradient(135deg, #1e3a8a, #38bdf8); color: #fff; }
.hz-reciter { margin-bottom: 12px; }
.hz-range { display: flex; align-items: center; gap: 8px; color: var(--text-dim); }
.hz-range select, #hz-surah { background: var(--card-hover); color: var(--text); border: 1px solid var(--line-strong); border-radius: 6px; padding: 8px; font: 600 14px var(--font); max-width: 180px; }
.hz-option { padding: 10px 0; }
.hz-option + .hz-option { border-top: 1px solid var(--line); }
.hz-option > span { display: block; font-size: 14px; font-weight: 600; margin-bottom: 8px; }
.chips.wrap { flex-wrap: wrap; margin: 0; padding: 0; overflow: visible; }
.hz-live { text-align: center; padding-top: 8px; }
.hz-live > small { color: var(--text-dim); font-size: 13px; }
.hz-ring {
  width: min(72vw, 280px); aspect-ratio: 1; margin: 28px auto 20px; border-radius: 50%;
  display: grid; place-items: center; padding: 24px;
  background: radial-gradient(circle at 30% 25%, var(--t-mid), var(--t-dark) 70%);
  box-shadow: 0 0 0 3px var(--t-mid), 0 20px 50px rgba(0,0,0,.5);
  transition: box-shadow .3s, background .3s;
}
.hz-ring strong { display: block; font-size: 30px; font-weight: 800; }
.hz-ring span { display: block; margin-top: 8px; color: var(--text-dim); font-size: 14px; }
.hz-ring.your-turn { background: radial-gradient(circle at 30% 25%, var(--accent), var(--t-deep) 75%); box-shadow: 0 0 0 3px var(--accent), 0 0 60px var(--t-glow); animation: hz-pulse 1.6s ease-in-out infinite; }
.hz-ring.your-turn span { color: var(--t-light); }
@keyframes hz-pulse { 50% { box-shadow: 0 0 0 8px var(--t-glow), 0 0 70px var(--t-glow); } }
.hz-meta { color: var(--text-dim); font-size: 13px; }
.hz-progress { height: 4px; border-radius: 2px; background: rgba(255,255,255,.15); margin: 14px 0 18px; overflow: hidden; }
.hz-progress span { display: block; height: 100%; background: var(--accent); transition: width .3s; }
.hz-controls { display: flex; align-items: center; justify-content: center; gap: 28px; direction: ltr; }
.hz-controls .icon-btn svg { width: 32px; height: 32px; }

/* ---------- Accueil de connexion : mosaïque inclinée ---------- */
.auth-welcome-screen, .auth-screen.auth-welcome { position: relative; overflow: hidden; }
.auth-mosaic {
  position: absolute; inset: 0 0 auto 0; height: 68%; overflow: hidden; z-index: 0; pointer-events: none;
  -webkit-mask-image: linear-gradient(to bottom, #000 30%, transparent 88%);
          mask-image: linear-gradient(to bottom, #000 30%, transparent 88%);
}
.mosaic-grid {
  position: absolute; top: -30%; left: -35%; width: 170%;
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px;
  transform: rotate(-16deg);
  opacity: .55;
}
.mosaic-col { display: flex; flex-direction: column; gap: 10px; animation: mosaic-drift 60s linear infinite; }
.mosaic-col:nth-child(even) { margin-top: -60px; animation-direction: reverse; }
.mosaic-tile { aspect-ratio: 1; border-radius: 8px; overflow: hidden; background: var(--card); }
.mosaic-tile img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 10%; }
@keyframes mosaic-drift { to { transform: translateY(-50%); } }
@media (prefers-reduced-motion: reduce) { .mosaic-col { animation: none; } }
.auth-welcome .auth-lang, .auth-screen.auth-welcome .auth-lang { position: relative; z-index: 1; }
.auth-screen.auth-welcome .auth-welcome { position: relative; z-index: 1; justify-content: flex-end; padding-bottom: 8px; }
.auth-screen.auth-welcome .auth-logo { margin-bottom: 18px; }
.auth-screen.auth-welcome h1 { text-shadow: 0 2px 16px rgba(0,0,0,.8); }

/* ---------- Playlists ---------- */
.pl-cover { flex: none; aspect-ratio: 1; border-radius: 4px; overflow: hidden; background: var(--card-hover); display: grid; place-items: center; color: var(--text-dim); }
.pl-cover.sm { width: 52px; }
.pl-cover.lg { width: 180px; margin: 0 auto; border-radius: 8px; box-shadow: 0 12px 32px rgba(0,0,0,.45); }
.pl-cover svg { width: 40%; height: 40%; }
.pl-cover .avatar { width: 100%; border-radius: 0; box-shadow: none; }
.pl-cover.grid4 { grid-template-columns: 1fr 1fr; place-items: stretch; }
.pl-cover.grid4 .avatar span { font-size: 12px; }
.pl-bg { background: linear-gradient(180deg, #4338ca, transparent); }
.pl-owner { margin: -4px 0 0; font-size: 13px; color: var(--text-dim); }
button.row { width: 100%; text-align: start; }

/* ---------- Accueil : recommandation, mix, radios ---------- */
.tile-img.fav-tile { width: 56px; height: 56px; border-radius: 0; flex: none; }
.tile-img.fav-tile svg { width: 22px; height: 22px; }
.reco-card {
  position: relative; display: flex; align-items: center; gap: 14px; width: 100%;
  padding: 14px; border-radius: 10px; text-align: start; overflow: hidden;
  box-shadow: 0 10px 28px rgba(0,0,0,.35);
}
.reco-card::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(0,0,0,.15), rgba(0,0,0,.45)); pointer-events: none; }
.avatar.reco-img { width: 84px; flex: none; border-radius: 8px; box-shadow: 0 6px 16px rgba(0,0,0,.4); position: relative; z-index: 1; }
.reco-text { flex: 1; min-width: 0; position: relative; z-index: 1; }
.reco-text small { display: block; font-size: 12px; font-weight: 600; opacity: .9; }
.reco-text strong { display: block; font-size: 22px; font-weight: 800; margin: 2px 0; }
.reco-text span { display: block; font-size: 13px; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reco-play { position: relative; z-index: 1; width: 48px; height: 48px; flex: none; border-radius: 50%; background: var(--accent); color: #000; display: grid; place-items: center; }
.reco-play svg { width: 24px; height: 24px; }

.mix-card { padding: 0; background: none; }
.mix-card:hover { background: none; }
.mix-cover {
  position: relative; aspect-ratio: 1; border-radius: 8px; overflow: hidden; padding: 10px;
  display: flex; align-items: flex-start; box-shadow: 0 8px 20px rgba(0,0,0,.35);
}
.mix-cover > span { position: relative; z-index: 1; font-weight: 800; font-size: 17px; line-height: 1.15; text-shadow: 0 2px 10px rgba(0,0,0,.4); }
.mix-cover .avatar.mix-face { position: absolute; width: 62%; right: -8%; bottom: -8%; box-shadow: 0 8px 20px rgba(0,0,0,.4); }
[dir="rtl"] .mix-cover .avatar.mix-face { right: auto; left: -8%; }
.mix-card .card-sub { margin-top: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mix-cover.lg { width: 180px; margin: 0 auto; }
.mix-cover.lg > span { font-size: 22px; }

.radio-card { position: relative; text-align: start; }
.live-dot {
  position: absolute; top: 18px; left: 18px; z-index: 2;
  font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
  background: #e11d48; color: #fff; padding: 3px 7px; border-radius: 4px;
}
[dir="rtl"] .live-dot { left: auto; right: 18px; }
body.live .fp-seek, body.live .fp-dl, body.live .fp-like, body.live .fp-shuffle,
body.live .fp-repeat, body.live .fp-prev, body.live .fp-next { visibility: hidden; }
body.live .mini-progress { display: none; }

/* ---------- Recherche de sourates, page sourate ---------- */
.surah-badge {
  width: 52px; height: 52px; flex: none; border-radius: 6px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--t-strong), var(--t-dark)); font-weight: 800; font-size: 16px; color: var(--t-light);
}
.surah-hero {
  width: min(64vw, 240px); aspect-ratio: 1; margin: 8px auto 16px; border-radius: 10px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  box-shadow: 0 18px 44px rgba(0,0,0,.5);
}
.surah-hero .cover-ar { font-size: clamp(40px, 13vw, 64px); }
h1.center, .center { text-align: center; }
.surah-reciter { cursor: pointer; }

/* ---------- Parcourir ---------- */
.browse-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.browse-tile {
  position: relative; height: 92px; border-radius: 8px; padding: 12px; overflow: hidden;
  display: flex; align-items: flex-start; box-shadow: 0 6px 16px rgba(0,0,0,.25);
}
.browse-tile strong { font-size: 16px; font-weight: 800; line-height: 1.2; text-shadow: 0 2px 8px rgba(0,0,0,.3); }
.browse-tile::after {
  content: ''; position: absolute; right: -14px; bottom: -14px; width: 64px; height: 64px; border-radius: 12px;
  background: rgba(255,255,255,.14); transform: rotate(24deg);
}
[dir="rtl"] .browse-tile::after { right: auto; left: -14px; transform: rotate(-24deg); }
.browse-tile:active { transform: scale(.98); }
@media (min-width: 768px) { .browse-grid { grid-template-columns: repeat(3, 1fr); } }
.search-box .clear[hidden] { display: none; }
.surah-num { width: auto; min-width: 28px; }

/* ---------- Légal, consentement ---------- */
.consent { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: var(--text-dim); margin: 4px 0 6px; line-height: 1.45; }
.consent input { width: 18px; height: 18px; margin-top: 1px; accent-color: var(--accent); flex: none; }
.consent a, .auth-legal a { color: var(--text); text-decoration: underline; cursor: pointer; }
.auth-legal { position: relative; z-index: 1; text-align: center; font-size: 12px; color: var(--text-mute); margin: 14px 0 0; }
.legal { max-width: 680px; line-height: 1.6; font-size: 15px; color: #ddd; padding-bottom: 24px; }
.legal h1 { font-size: 26px; }
.legal h2 { font-size: 17px; margin: 22px 0 6px; color: var(--text); }
.legal ul { padding-inline-start: 20px; }
.legal li { margin-bottom: 6px; }
.legal a { color: var(--accent); }
.legal mark { background: #713f12; color: #fde68a; padding: 0 4px; border-radius: 3px; }
.legal-date { color: var(--text-mute); font-size: 13px; }
.auth-screen > .legal { overflow-y: auto; }

/* ---------- Thèmes de couleur (Paramètres › Thème) ---------- */
:root { --accent: #26d07c; --accent-press: #1fb56a; --t-mini: #2b3a32; --t-mid: #2c4a3b; --t-dark: #15201b; --t-strong: #1d6b48; --t-deep: #0f5132; --t-light: #d6ffe9; --t-glow: rgba(38,208,124,.4); }
:root[data-theme="gold"] { --accent: #d4af37; --accent-press: #b8962e; --t-mini: #3a3322; --t-mid: #4a3f22; --t-dark: #1f1a10; --t-strong: #8a6d1f; --t-deep: #5c4813; --t-light: #fbefc5; --t-glow: rgba(212,175,55,.4); }
:root[data-theme="sapphire"] { --accent: #4f8dff; --accent-press: #3b74db; --t-mini: #222f45; --t-mid: #24385e; --t-dark: #111a2b; --t-strong: #1f4fa3; --t-deep: #142f66; --t-light: #dbe7ff; --t-glow: rgba(79,141,255,.4); }
:root[data-theme="ruby"] { --accent: #e0405e; --accent-press: #c2334e; --t-mini: #3d2229; --t-mid: #5a2531; --t-dark: #1f1014; --t-strong: #9b1f37; --t-deep: #6b1426; --t-light: #ffd9e0; --t-glow: rgba(224,64,94,.4); }
:root[data-theme="amethyst"] { --accent: #a97cff; --accent-press: #8e62e6; --t-mini: #30263f; --t-mid: #3e2d5e; --t-dark: #17112a; --t-strong: #6a3fc0; --t-deep: #46288a; --t-light: #ece2ff; --t-glow: rgba(169,124,255,.4); }
:root[data-theme="fuchsia"] { --accent: #ff4fb3; --accent-press: #e03a9a; --t-mini: #3d2236; --t-mid: #5c2650; --t-dark: #1f0f1b; --t-strong: #b0277f; --t-deep: #7a1758; --t-light: #ffd9f0; --t-glow: rgba(255,79,179,.4); }

/* ---------- Choix du thème ---------- */
.theme-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.theme-swatch {
  display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px 6px;
  border-radius: 10px; background: var(--card); font-size: 13px; font-weight: 600; border: 2px solid transparent;
}
.theme-swatch.active { border-color: var(--accent); }
.swatch-dot { width: 40px; height: 40px; border-radius: 50%; box-shadow: inset 0 0 0 2px rgba(255,255,255,.15), 0 6px 14px rgba(0,0,0,.4); }
.swatch-emerald { background: linear-gradient(135deg, #3be38f, #0f5132); }
.swatch-gold { background: linear-gradient(135deg, #f6dd8a, #d4af37 45%, #6b5212); }
.swatch-sapphire { background: linear-gradient(135deg, #8db6ff, #2b5fd0 55%, #0f2257); }
.swatch-ruby { background: linear-gradient(135deg, #ff8ba0, #c8203f 55%, #4d0a17); }
.swatch-amethyst { background: linear-gradient(135deg, #d6c2ff, #8a55f0 55%, #2e1767); }
.swatch-fuchsia { background: linear-gradient(135deg, #ffb3e0, #ff4fb3 50%, #6b0f4a); }

/* ---------- Signalements ---------- */
.report-panel { padding: 8px 16px calc(var(--safe-b) + 18px); }
.report-title { display: flex; align-items: center; gap: 10px; font-size: 20px; margin: 6px 0 4px; }
.report-title svg { width: 24px; height: 24px; color: var(--accent); }
.report-hint { color: var(--text-dim); font-size: 13px; margin: 2px 0 10px; }
.report-back { margin: -4px 0 0 -8px; }
.report-form textarea {
  width: 100%; min-height: 110px; resize: vertical; border: 0; outline: 0; background: none;
  color: var(--text); font: 500 15px var(--font); padding: 10px 12px; line-height: 1.45;
}
.report-done { text-align: center; padding: 18px 8px 4px; }
.report-done p { color: var(--text-dim); line-height: 1.55; }
.report-check { width: 64px; height: 64px; margin: 0 auto 6px; border-radius: 50%; background: var(--accent); color: #000; display: grid; place-items: center; animation: pop .35s ease; }
.report-check svg { width: 34px; height: 34px; }
@keyframes pop { from { transform: scale(.4); opacity: 0; } }
.drawer-panel > button[data-report] { display: flex; }

/* Thèmes immersifs : le fond et les cartes prennent une teinte sombre de la couleur (Émeraude = noir d'origine). */
:root[data-theme="gold"] { --bg: #13110c; --bg-elev: #1c1912; --card: #252015; --card-hover: #2f281a; --line: #3a3220; --line-strong: #4a4029; --tab-bg: #0b0a06; }
:root[data-theme="sapphire"] { --bg: #0d1220; --bg-elev: #141b2c; --card: #1b2438; --card-hover: #232e46; --line: #2c3954; --line-strong: #3a4868; --tab-bg: #070b14; }
:root[data-theme="ruby"] { --bg: #170c10; --bg-elev: #211318; --card: #2b1820; --card-hover: #361f29; --line: #452633; --line-strong: #583242; --tab-bg: #0e0609; }
:root[data-theme="amethyst"] { --bg: #120e1c; --bg-elev: #1a1428; --card: #221a35; --card-hover: #2b2242; --line: #362a52; --line-strong: #453766; --tab-bg: #0a0712; }
:root[data-theme="fuchsia"] { --bg: #180c15; --bg-elev: #22121e; --card: #2c1727; --card-hover: #381e32; --line: #47263f; --line-strong: #5a3150; --tab-bg: #0f060c; }

/* ---------- Espace admin ---------- */
.admin-filters { margin-bottom: 12px; }
.admin-card { background: var(--bg-elev); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 10px; }
.admin-card header { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.admin-card time { font-size: 12px; color: var(--text-mute); white-space: nowrap; }
.admin-badge { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; padding: 3px 8px; border-radius: 4px; background: var(--card-hover); }
.admin-badge.missing_reciter { background: var(--t-strong); color: #fff; }
.admin-badge.bug { background: #9b1c31; color: #fff; }
.admin-badge.suggestion { background: #1f4fa3; color: #fff; }
.admin-msg { margin: 10px 0 6px; white-space: pre-wrap; line-height: 1.5; }
.admin-meta { margin: 0 0 10px; font-size: 12px; color: var(--text-dim); }
.admin-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.admin-actions .chip { padding: 6px 12px; font-size: 12px; }
.chip.danger { background: #5a1a24; color: #ffd0d8; }

/* ---------- Intro au lancement (logo qui zoome, façon Spotify) ---------- */
/* Fond identique à l'écran de lancement d'Android (background_color du manifeste). */
.intro { position: fixed; inset: 0; z-index: 9999; background: #121212; display: flex; align-items: center; justify-content: center;
  animation: intro-safety 0s linear 4s forwards; } /* filet de sécurité : jamais bloquée si le JS échoue */
/* Même cadrage et même taille que l'écran de lancement de Chrome (icône 512 affichée à 128 dp, centrée) :
   l'intro prend le relais sans saut. */
.intro img { width: 128px; height: 128px; will-change: transform, opacity; }
.intro.out { animation: intro-fade .6s ease-in forwards; pointer-events: none; }
.intro.out img { animation: intro-zoom .6s cubic-bezier(.6, 0, .8, .2) forwards; }
/* Léger recul, puis grand zoom : le logo s'efface vite pour ne pas rester en fantôme sur la page. */
@keyframes intro-zoom { 0% { transform: scale(1); opacity: 1; } 25% { transform: scale(.9); opacity: 1; } 55% { opacity: 1; } 75% { opacity: 0; } 100% { transform: scale(9); opacity: 0; } }
@keyframes intro-fade { 0%, 40% { opacity: 1; } 85%, 100% { opacity: 0; } }
@keyframes intro-safety { to { opacity: 0; visibility: hidden; } }
@media (prefers-reduced-motion: reduce) { .intro.out img { animation: none; } .intro.out { animation-duration: .3s; } }

/* Soutenir Uksufy : liens vers les chaînes */
.support-follow { font-size: 17px; text-align: center; margin: 4px 0 12px; }
.social-links { display: flex; gap: 12px; margin-bottom: 24px; }
.social-btn { flex: 1; display: flex; align-items: center; justify-content: center; gap: 10px; padding: 14px 12px;
  border-radius: 999px; font-weight: 700; font-size: 15px; color: #fff; text-decoration: none; }
.social-btn svg { width: 22px; height: 22px; fill: currentColor; }
.social-btn.tiktok { background: #000; border: 1px solid #2f2f2f; }
.social-btn.tiktok svg { filter: drop-shadow(-1.5px -1px 0 #25f4ee) drop-shadow(1.5px 1px 0 #fe2c55); }
.social-btn.youtube { background: #ff0000; }
.social-btn:active { transform: scale(.97); }

/* Carte de bienvenue (premier accès d'un nouveau compte) */
.welcome-card {
  margin: 4px 0 24px; padding: 20px 18px 18px; border-radius: 16px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 28%, var(--card)), var(--card));
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
}
.welcome-card h2 { margin: 0 0 6px; font-size: 20px; }
.welcome-card p { margin: 0 0 12px; color: var(--text-dim); font-size: 14px; }
.welcome-step { display: flex; align-items: center; gap: 12px; padding: 10px 0; font-size: 15px; color: var(--text); text-decoration: none; }
.welcome-step + .welcome-step { border-top: 1px solid rgba(255,255,255,.08); }
.welcome-step span { font-size: 20px; width: 28px; text-align: center; }
.welcome-card .btn-primary { width: 100%; margin-top: 14px; }
.admin-log { margin-top: 8px; font-size: 12px; color: var(--text-dim); }
.admin-log pre { white-space: pre-wrap; margin: 6px 0 0; font-size: 11px; line-height: 1.5; }

/* ---------- Grands écrans ---------- */
/* Tablette : accueil plus aéré, lecteur plein écran centré. */
@media (min-width: 768px) {
  .tiles { grid-template-columns: repeat(3, 1fr); }
  .full-player { padding-inline: max(24px, calc(50vw - 300px)); }
}
/* Ordinateur : menu à gauche à la place de la barre du bas, contenu plus large. */
@media (min-width: 1024px) {
  :root { --sidebar: 232px; }
  .tabbar {
    inset-block: 0; inset-inline: 0 auto;
    width: var(--sidebar); height: auto;
    display: flex; flex-direction: column; gap: 4px;
    padding: 84px 12px 16px;
    background: var(--tab-bg) url('../icons/logo.png') no-repeat 24px 20px / 44px 44px;
    border-inline-end: 1px solid var(--line, rgba(255,255,255,.08));
  }
  [dir="rtl"] .tabbar { background-position: right 24px top 20px; }
  .tabbar a { flex: none; flex-direction: row; justify-content: flex-start; gap: 14px; padding: 12px 14px; border-radius: 8px; font-size: 15px; font-weight: 600; }
  .tabbar a span { max-width: none; }
  .tabbar a:hover { background: var(--card-hover); color: var(--text); }
  .tabbar a.active { background: var(--card-hover); }
  .tabbar a:active { transform: none; }
  .view {
    max-width: 1140px;
    margin-inline: calc(var(--sidebar) + max(0px, (100vw - var(--sidebar) - 1140px) / 2)) auto;
    padding: 24px 32px calc(var(--mini-h) + 32px);
  }
  .mini-player {
    inset-inline: calc(var(--sidebar) + 12px) 12px;
    bottom: 12px;
    width: auto;
    transform: none;
  }
  .tiles { grid-template-columns: repeat(4, 1fr); }
  .top-logo { display: none; } /* déjà dans le menu de gauche */
}

/* Pochette du lecteur avec la photo du récitateur */
.cover-art.has-photo { justify-content: flex-end; padding: 16px 16px 18px; text-align: center; }
.cover-art.has-photo::after { background: linear-gradient(to top, rgba(0,0,0,.82) 0%, rgba(0,0,0,.35) 34%, transparent 58%); }
/* La photo entière, sans recadrage ; le fond autour est la même photo, floutée. */
.cover-blur { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: blur(22px) brightness(.6); transform: scale(1.25); }
.cover-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; object-position: 50% 0; transform: scale(.86); transform-origin: 50% 8%; }
.cover-photo.cropped { object-fit: cover; } /* photo recadrée exprès (ex. texte d'une pochette à masquer) */
.cover-art.has-photo .cover-ar, .cover-art.has-photo .cover-tr, .cover-art.has-photo .cover-logo { z-index: 1; }
.cover-art.has-photo .cover-ar, .cover-art.has-photo .cover-tr { position: relative; }
.cover-art.has-photo .cover-ar { font-size: clamp(38px, 11vw, 62px); line-height: 1.25; }
.cover-art.has-photo .cover-tr { font-size: 13px; }

/* Accueil : salutation, prénom en dessous */
.home-greet { line-height: 1.2; white-space: normal; }
.home-greet small { display: block; font-size: 14px; font-weight: 500; color: var(--text-dim); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
