/* Wird — nuit de lapis-lazuli, feuille d'or, étoile à huit branches. */

@font-face { font-family: "Reem Kufi"; font-weight: 500; font-display: swap; src: url(fonts/reem-kufi-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: "Reem Kufi"; font-weight: 700; font-display: swap; src: url(fonts/reem-kufi-latin-700-normal.woff2) format("woff2"); }
@font-face { font-family: "Amiri"; font-weight: 400; font-display: swap; src: url(fonts/amiri-arabic-400-normal.woff2) format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: "Amiri"; font-weight: 700; font-display: swap; src: url(fonts/amiri-arabic-700-normal.woff2) format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: "Alegreya Sans"; font-weight: 400; font-display: swap; src: url(fonts/alegreya-sans-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Alegreya Sans"; font-weight: 500; font-display: swap; src: url(fonts/alegreya-sans-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: "Alegreya Sans"; font-weight: 700; font-display: swap; src: url(fonts/alegreya-sans-latin-700-normal.woff2) format("woff2"); }

:root {
  --nuit: #0E2140;        /* fond : lapis-lazuli de nuit */
  --nuit-2: #142B50;      /* panneaux */
  --nuit-3: #1C3A69;      /* reliefs */
  --or: #D9B25F;          /* feuille d'or */
  --or-clair: #F1DDA8;
  --ivoire: #F4ECDA;      /* texte */
  --brume: #A9B8CF;       /* texte secondaire */
  --filet: rgba(217, 178, 95, 0.26);
  --encre: #1A1405;       /* texte sur l'or */
  --titre: "Reem Kufi", "Segoe UI", system-ui, sans-serif;
  --texte: "Alegreya Sans", "Segoe UI", system-ui, sans-serif;
  --arabe: "Amiri", "Traditional Arabic", serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  font: 400 17px/1.45 var(--texte);
  color: var(--ivoire);
  background-color: var(--nuit);
  background-image:
    radial-gradient(120% 60% at 50% -10%, rgba(52, 96, 160, 0.45), transparent 70%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64'%3E%3Cg fill='none' stroke='%23D9B25F' stroke-opacity='.055' stroke-width='1'%3E%3Crect x='21' y='21' width='22' height='22'/%3E%3Crect x='21' y='21' width='22' height='22' transform='rotate(45 32 32)'/%3E%3Cpath d='M0 0L9 9M64 0L55 9M0 64L9 55M64 64L55 55'/%3E%3C/g%3E%3C/svg%3E");
  background-attachment: fixed, scroll;
  -webkit-tap-highlight-color: transparent;
}
#app { max-width: 520px; margin: 0 auto; padding-bottom: env(safe-area-inset-bottom); }
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: default; }
:focus-visible { outline: 2px solid var(--or-clair); outline-offset: 3px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

/* ---------- Boutons ---------- */
.bouton-or {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  border: 0; border-radius: 999px; padding: .75rem 1.5rem;
  font: 500 1.05rem/1.2 var(--titre); letter-spacing: .01em; color: var(--encre);
  background: linear-gradient(180deg, #EBCB7E 0%, #D4A64F 55%, #C39343 100%);
  box-shadow: inset 0 1px 0 rgba(255, 245, 215, .7), 0 6px 18px -8px rgba(217, 178, 95, .7);
  transition: transform .15s ease, filter .15s ease;
}
.bouton-or:active { transform: scale(.98); }
.bouton-or:disabled { filter: grayscale(.6) brightness(.7); box-shadow: none; }
.bouton-or.grand { display: flex; width: 100%; max-width: 340px; margin: 1.1rem auto 0; padding: 1rem 1.5rem; font-size: 1.15rem; }
.bouton-or.petit { padding: .5rem 1.1rem; font-size: .95rem; }
.bouton-ligne {
  border: 1px solid var(--or); background: transparent; color: var(--or-clair);
  border-radius: 999px; padding: .6rem 1.15rem; margin: .35rem 0;
}
.bouton-texte { border: 0; background: none; color: var(--brume); text-decoration: underline; text-underline-offset: 3px; padding: .5rem 0; display: block; }

/* ---------- Champs ---------- */
.etiquette { display: block; font-size: .92rem; color: var(--brume); margin: 1rem 0 .35rem; }
.champ {
  width: 100%; padding: .75rem .9rem; border-radius: 12px;
  border: 1px solid rgba(169, 184, 207, .28); background: rgba(6, 16, 34, .45);
  color: var(--ivoire); font: 400 1.05rem var(--texte);
}
.champ:focus { outline: none; border-color: var(--or); box-shadow: 0 0 0 3px rgba(217, 178, 95, .2); }
.champ-petit { width: 7.5rem; }
select.champ { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--or) 50%), linear-gradient(135deg, var(--or) 50%, transparent 50%); background-position: calc(100% - 18px) 55%, calc(100% - 12px) 55%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 2rem; }
input[type="date"].champ { min-height: 3rem; }
.aide { font-size: .92rem; color: var(--brume); margin: .4rem 0; }
.aide.centre, .centre { text-align: center; }
.erreur { color: #F7A9B4; font-size: .95rem; margin: .5rem 0 0; min-height: 0; }
.erreur:empty { display: none; }
.groupe-choix { border: 0; padding: 0; margin: 0; }
.choix { display: flex; align-items: center; gap: .65rem; padding: .5rem 0; cursor: pointer; }
.choix input { width: 20px; height: 20px; accent-color: var(--or); margin: 0; flex: none; }
.choix-case.alerte { background: rgba(217, 178, 95, .1); border: 1px solid var(--filet); border-radius: 12px; padding: .6rem .8rem; margin: .6rem 0; }

/* ---------- Seuil (code famille) ---------- */
.ecran-seuil { min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 2rem 1.5rem; }
.seuil-sceau { margin-bottom: .5rem; filter: drop-shadow(0 0 18px rgba(217, 178, 95, .35)); }
.seuil-titre { font: 500 3.2rem/1 var(--titre); color: var(--or-clair); margin: .4rem 0 0; letter-spacing: .02em; }
.seuil-ar { font: 700 2.1rem/1.4 var(--arabe); color: var(--or); margin: 0; }
.seuil-slogan { color: var(--brume); margin: .4rem 0 2rem; font-size: 1.05rem; }
.form-code { width: 100%; max-width: 320px; display: flex; flex-direction: column; }
.form-code .etiquette { text-align: center; margin-top: 0; }
.champ-code { font: 500 1.7rem var(--titre); letter-spacing: .14em; text-align: center; text-transform: uppercase; }
.form-code .bouton-or { margin-top: 1.1rem; }

/* ---------- Qui es-tu ---------- */
.ecran-qui { padding: 2.2rem 1.25rem 3rem; }
.qui-liste { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .65rem; }
.qui-membre {
  display: flex; flex-direction: column; align-items: center; gap: .45rem; padding: 1rem .5rem;
  border: 1px solid var(--filet); border-radius: 16px; background: rgba(20, 43, 80, .55);
  font: 500 1.05rem var(--titre);
}
.qui-membre:active { background: rgba(217, 178, 95, .12); }
.separateur { height: 1px; margin: 2rem 0 .5rem; background: linear-gradient(90deg, transparent, var(--filet), transparent); }
.couleurs { display: flex; flex-wrap: wrap; gap: .35rem; }
.couleur { background: none; border: 2px solid transparent; border-radius: 50%; padding: 3px; line-height: 0; }
.couleur[aria-checked="true"] { border-color: var(--c); background: rgba(255, 255, 255, .06); }
.bloc-page { margin-top: .2rem; }
.form-nouveau .bouton-or { margin-top: 1.2rem; width: 100%; }

/* ---------- En-tête ---------- */
.entete { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: .5rem; padding: max(.9rem, env(safe-area-inset-top)) 1.1rem 0; }
.marque { display: flex; align-items: center; gap: .45rem; }
.marque-nom { font: 500 1.4rem var(--titre); color: var(--or-clair); letter-spacing: .02em; }
.dates { display: flex; flex-direction: column; align-items: center; line-height: 1.25; }
.date-hijri { font: 400 1.08rem var(--arabe); color: var(--or-clair); }
.date-greg { font-size: .8rem; color: var(--brume); }
.date-greg::first-letter { text-transform: uppercase; }
.bouton-moi { border: 0; background: none; padding: 2px; border-radius: 50%; line-height: 0; }

.principal { padding: 0 1.1rem calc(6rem + env(safe-area-inset-bottom)); }

/* ---------- Onglets ---------- */
.onglets {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: flex; justify-content: center;
  background: rgba(10, 25, 49, .9); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-top: 1px solid var(--filet); padding: .3rem .5rem calc(.35rem + env(safe-area-inset-bottom));
}
.onglets-int { display: grid; grid-template-columns: repeat(3, 1fr); width: 100%; max-width: 520px; }
.onglet { position: relative; display: flex; flex-direction: column; align-items: center; gap: .2rem; border: 0; background: none; color: var(--brume); padding: .5rem 0 .35rem; border-radius: 12px; }
.onglet svg { width: 27px; height: 27px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.onglet-nom { font-size: .8rem; line-height: 1; }
.onglet[aria-current="page"] { color: var(--or-clair); }
.onglet[aria-current="page"] .onglet-nom { font-weight: 700; }
.onglet[aria-current="page"]::before { content: ""; position: absolute; top: -.42rem; width: 9px; height: 9px; background: var(--or); transform: rotate(45deg); box-shadow: 0 0 10px rgba(217, 178, 95, .7); }
.onglet:active { background: rgba(255, 255, 255, .04); }
.onglet-badge { position: absolute; top: .2rem; left: calc(50% + 7px); min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px; background: #E8677C; color: #fff; font: 700 .72rem/19px var(--texte); text-align: center; box-shadow: 0 0 0 2px var(--nuit); }
.ml-toi { font: 400 .85rem var(--texte); color: var(--brume); }
.mes-stats { margin-top: .5rem; }
.famille > .aide, .fil > .aide { margin-top: -.1rem; }
.famille .vide { margin-top: 1.4rem; }

/* ---------- Bandeaux ---------- */
.bandeau { border: 1px solid var(--filet); background: rgba(217, 178, 95, .07); border-radius: 14px; padding: .75rem 1rem; margin: .9rem 0 0; }
.bandeau p { margin: 0; font-size: .95rem; }
.bandeau-actions { display: flex; align-items: center; gap: 1rem; margin-top: .55rem; }
.bandeau-actions .bouton-texte { padding: 0; }

/* ---------- Le médaillon (seul élément audacieux) ---------- */
.hero { text-align: center; padding-top: 1rem; }
.salut { margin: .2rem 0 .6rem; color: var(--brume); font-size: 1rem; }
.arche { position: relative; width: min(86vw, 330px); aspect-ratio: 300 / 380; margin: 0 auto; }
.hero-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible;
  -webkit-mask-image: linear-gradient(to bottom, #000 72%, transparent 100%); mask-image: linear-gradient(to bottom, #000 72%, transparent 100%); }
.stop-arche-haut { stop-color: #1F4377; }
.stop-arche-bas { stop-color: #10264A; }
.motif-etoile { fill: none; stroke: var(--or); stroke-opacity: .09; stroke-width: 1; }
.arche-filet { fill: none; stroke: var(--or); stroke-width: 1.4; stroke-opacity: .85; }
.arche-filet.fin { stroke-width: .7; stroke-opacity: .5; }
.juz-perle { fill: rgba(169, 184, 207, .22); }
.juz-perle.faite { fill: var(--or); }
.juz-perle.encours { fill: var(--or-clair); animation: lueur 2.4s ease-in-out infinite; }
.etoile-fond { fill: rgba(11, 27, 54, .65); stroke: rgba(217, 178, 95, .2); stroke-width: 2.2; stroke-linejoin: round; }
.etoile-interieure { fill: none; stroke: rgba(217, 178, 95, .2); stroke-width: 1; stroke-linejoin: round; }
.stop-coeur-1 { stop-color: #24497F; }
.stop-coeur-2 { stop-color: #12294B; }
.coeur-filet { fill: none; stroke: rgba(217, 178, 95, .4); stroke-width: 1; }
.etoile-trace {
  fill: none; stroke: var(--or); stroke-width: 4.2; stroke-linejoin: round; stroke-linecap: round;
  filter: drop-shadow(0 0 5px rgba(217, 178, 95, .55));
  transition: stroke-dashoffset 1.8s cubic-bezier(.45, 0, .2, 1);
}
.arche.terminee .etoile-fond { fill: rgba(217, 178, 95, .14); }
.hero-centre { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; line-height: 1; }
.hero-page { font: 700 clamp(2.5rem, 11vw, 3.2rem)/1 var(--titre); color: var(--ivoire); font-variant-numeric: lining-nums; }
.hero-sur { font-size: .82rem; color: var(--brume); margin-top: .3rem; }
.hero-ar { position: absolute; left: 0; right: 0; top: 79%; margin: 0; font: 700 1.95rem/1.2 var(--arabe); color: var(--or-clair); }
.hero-info { position: absolute; left: 0; right: 0; top: 92%; margin: 0; font-size: .95rem; color: var(--brume); }
.pastilles { display: flex; flex-wrap: wrap; justify-content: center; gap: .45rem; margin-top: 1.5rem; }
.pastille { display: inline-flex; align-items: center; gap: .35rem; border: 1px solid rgba(169, 184, 207, .25); border-radius: 999px; padding: .3rem .8rem; font-size: .9rem; color: var(--brume); }
.pastille.active { color: var(--ivoire); border-color: var(--or); }
.pastille.serie { color: var(--ivoire); }
.flamme path { fill: #F29563; }
.objectif { margin: .9rem auto 0; max-width: 340px; font-size: .95rem; color: var(--or-clair); }

/* ---------- Famille ---------- */
.titre-section { font: 500 1.3rem/1.2 var(--titre); color: var(--or-clair); margin: 2.4rem 0 .5rem; }
.titre-ligne { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.compteur { font-size: .88rem; color: var(--brume); }
.titre-petit { font: 500 1rem var(--titre); color: var(--or-clair); margin: 1.4rem 0 .5rem; }
.liste-famille { list-style: none; margin: 0; padding: 0; }
.liste-famille li + li { border-top: 1px solid rgba(217, 178, 95, .14); }
.membre-ligne { display: grid; grid-template-columns: 42px 1fr auto; align-items: center; gap: .85rem; width: 100%; padding: .85rem .15rem; border: 0; background: none; text-align: left; border-radius: 10px; }
.membre-ligne:active { background: rgba(255, 255, 255, .04); }
.ml-corps { display: flex; flex-direction: column; min-width: 0; }
.ml-haut { display: flex; align-items: center; gap: .5rem; }
.ml-nom { font: 500 1.08rem var(--titre); }
.ml-serie { display: inline-flex; align-items: center; gap: .15rem; font-size: .85rem; color: var(--brume); }
.ml-pos { font-size: .92rem; color: var(--brume); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.zellige { display: flex; gap: 2px; margin-top: .5rem; max-width: 15rem; }
.zellige i { flex: 1; height: 7px; background: rgba(169, 184, 207, .2); clip-path: polygon(18% 0, 100% 0, 82% 100%, 0 100%); }
.zellige i.fait { background: var(--c); }
.zellige i.encours { background: linear-gradient(90deg, var(--c) var(--p), rgba(169, 184, 207, .2) var(--p)); }
.ml-jour { display: flex; flex-direction: column; align-items: flex-end; min-width: 4.2rem; }
.ml-jour strong { font: 700 1.2rem/1.1 var(--titre); color: var(--c); }
.ml-jour small { font-size: .75rem; color: var(--brume); }
.ml-jour.rien strong { color: rgba(169, 184, 207, .5); }
.vide { border: 1px dashed var(--filet); border-radius: 14px; padding: 1rem; text-align: center; }
.vide p { margin: 0 0 .8rem; color: var(--brume); }

/* ---------- Fil ---------- */
.fil-jour { display: flex; align-items: center; gap: .7rem; font: 500 .92rem var(--titre); color: var(--brume); margin: 1.3rem 0 .2rem; }
.fil-jour::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--filet), transparent); }
.fil-liste { list-style: none; margin: 0; padding: 0; }
.fil-item { display: grid; grid-template-columns: 34px 1fr; gap: .75rem; padding: .7rem 0; }
.fil-item.khatma { background: rgba(217, 178, 95, .09); border: 1px solid var(--filet); border-radius: 14px; padding: .8rem; margin: .3rem 0; }
.fil-corps { min-width: 0; }
.fil-texte { margin: 0; }
.fil-texte strong { color: var(--c); font-weight: 700; }
.fil-detail { margin: .1rem 0 0; font-size: .9rem; color: var(--brume); }
.fil-heure { margin-left: .5rem; opacity: .75; white-space: nowrap; }
.reactions { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .5rem; }
.reactions:empty { display: none; }
.reaction { display: inline-flex; align-items: center; gap: .3rem; border: 1px solid rgba(169, 184, 207, .25); background: transparent; color: var(--brume); border-radius: 999px; padding: .25rem .65rem; font-size: .85rem; min-height: 32px; }
.reaction:disabled { opacity: 1; }
.reaction.mienne { background: rgba(217, 178, 95, .16); border-color: var(--or); color: var(--ivoire); }
.reaction-n { font-weight: 700; }
.reaction.pop { animation: pop .35s ease; }
.fil-encourage { margin: .35rem 0 0; font-size: .82rem; color: var(--brume); font-style: italic; }
.pied { text-align: center; font-size: .78rem; color: var(--brume); opacity: .7; margin: 2.5rem 0 1rem; }

/* ---------- Feuilles ---------- */
.fond { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center; background: rgba(4, 11, 24, .62); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); animation: apparait .2s ease; }
.fond.sortie { animation: disparait .2s ease forwards; }
.feuille {
  width: min(100%, 520px); max-height: 92dvh; overflow-y: auto; overscroll-behavior: contain;
  background: var(--nuit-2); border-top: 1px solid var(--or); border-radius: 22px 22px 0 0;
  padding: 1rem 1.25rem calc(1.6rem + env(safe-area-inset-bottom));
  box-shadow: 0 -20px 40px -20px rgba(0, 0, 0, .6);
  animation: monte .28s cubic-bezier(.2, .8, .2, 1);
}
.fond.sortie .feuille { animation: descend .2s ease forwards; }
.feuille-tete { display: flex; align-items: center; justify-content: space-between; gap: 1rem; position: sticky; top: -1rem; background: var(--nuit-2); padding: .4rem 0 .4rem; margin-top: -.4rem; z-index: 1; }
.feuille-titre { font: 500 1.3rem var(--titre); color: var(--or-clair); margin: 0; }
.feuille-titre:focus { outline: none; }
.bouton-fermer { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--filet); background: transparent; font-size: 1.5rem; line-height: 1; color: var(--brume); flex: none; }
.bloc { border-top: 1px solid var(--filet); margin-top: 1.2rem; padding-top: .2rem; }
.bloc:first-of-type { border-top: 0; margin-top: 0; }
.code-affiche { font: 500 1.6rem var(--titre); letter-spacing: .15em; color: var(--or-clair); text-align: center; background: rgba(6, 16, 34, .45); border-radius: 12px; padding: .6rem; margin: .4rem 0 .6rem; user-select: all; }
.credits { font-size: .78rem; color: var(--brume); opacity: .7; margin-top: 1.2rem; }
.etapes { padding-left: 1.3rem; margin: .3rem 0; }
.etapes li { margin: .45rem 0; }

/* Noter */
.compteur-page { display: flex; align-items: center; justify-content: center; gap: 1rem; margin: .6rem 0 .2rem; }
.pas { width: 52px; height: 52px; border-radius: 50%; border: 1px solid var(--or); background: rgba(217, 178, 95, .08); color: var(--or-clair); font: 500 1.6rem/1 var(--titre); flex: none; }
.pas:active { background: rgba(217, 178, 95, .2); }
.champ-page { width: 4.2ch; font: 700 3.1rem/1.1 var(--titre); text-align: center; color: var(--ivoire); background: transparent; border: 0; border-bottom: 2px solid var(--or); padding: 0 0 .1rem; -moz-appearance: textfield; }
.champ-page::-webkit-outer-spin-button, .champ-page::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.champ-page:focus { outline: none; border-bottom-color: var(--or-clair); }
.noter-repere { text-align: center; margin: .5rem 0 .9rem; color: var(--brume); font-size: .95rem; min-height: 3.4rem; }
.noter-ar { display: block; font: 700 1.6rem/1.3 var(--arabe); color: var(--or-clair); }
.puces { display: flex; flex-wrap: wrap; justify-content: center; gap: .45rem; }
.puce { border: 1px solid rgba(169, 184, 207, .28); background: transparent; color: var(--ivoire); border-radius: 999px; padding: .4rem .85rem; font-size: .92rem; min-height: 36px; }
.puce:active { border-color: var(--or); background: rgba(217, 178, 95, .12); }
.par-verset { margin: 1rem 0 .3rem; }
.par-verset summary { cursor: pointer; color: var(--or-clair); font-size: .95rem; }
.ligne-verset { display: flex; gap: .5rem; margin-top: .6rem; align-items: center; }
.ligne-verset select { flex: 1; min-width: 0; }
.noter-resume { text-align: center; font: 500 1.15rem var(--titre); color: var(--or-clair); margin: 1rem 0 0; }

/* Fiche d'un membre */
.fiche-tete { display: flex; align-items: center; gap: 1rem; margin: .4rem 0 .2rem; }
.fiche-pos { font: 500 1.2rem var(--titre); margin: 0; color: var(--c); }
.fiche-tete .aide { margin: .15rem 0 0; }
.chiffres { display: grid; grid-template-columns: 1fr 1fr; gap: .55rem; margin: 1rem 0 0; }
.chiffre { border: 1px solid rgba(169, 184, 207, .2); border-radius: 12px; padding: .65rem .8rem; }
.chiffre dt { font-size: .8rem; color: var(--brume); }
.chiffre dd { margin: .1rem 0 0; font: 500 1.12rem var(--titre); }
.chiffre small { display: block; font: 400 .75rem var(--texte); color: var(--brume); }
.histo { width: 100%; height: auto; display: block; }
.histo-sol { fill: rgba(169, 184, 207, .22); }
.histo-val { font: 500 9px var(--titre); fill: var(--brume); }
.histo-jour { font: 400 9px var(--texte); fill: var(--brume); }
.histo-jour.auj { fill: var(--or-clair); font-weight: 700; }
.mosaique { width: 100%; max-width: 360px; height: auto; display: block; margin: 0 auto; color: var(--brume); }
.mz-num { font: 500 11px var(--titre); fill: var(--brume); }
.mz-num.plein { fill: #0B1B36; }
.badges { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: .8rem .5rem; }
.badges li { display: flex; flex-direction: column; align-items: center; text-align: center; opacity: .42; }
.badges li.gagne { opacity: 1; }
.badge-titre { font: 500 .95rem var(--titre); margin-top: .25rem; }
.badge-nom { font-size: .72rem; color: var(--brume); line-height: 1.25; }
.medaille path { fill: rgba(169, 184, 207, .1); stroke: rgba(169, 184, 207, .45); stroke-width: 1.2; stroke-linejoin: round; }
.medaille.gagnee path { fill: var(--or); stroke: var(--or-clair); }
.medaille .medaille-int { fill: none; stroke: rgba(169, 184, 207, .3); }
.medaille.gagnee .medaille-int { fill: none; stroke: rgba(14, 33, 64, .45); }

/* ---------- Avatars, sceau ---------- */
.avatar { display: block; flex: none; }
.avatar-lettre { font: 700 15px var(--titre); }
.sceau path { fill: none; stroke: var(--or); stroke-width: 1.6; stroke-linejoin: round; }
.sceau circle { fill: var(--or); }

/* ---------- Messages, célébration, chargement ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(5.6rem + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 100;
  width: max-content; max-width: calc(100vw - 2rem); text-align: center;
  background: var(--or-clair); color: var(--encre); border-radius: 999px; padding: .7rem 1.2rem; font-weight: 500;
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, .6); animation: monte-toast .3s ease;
}
.celebration { position: fixed; inset: 0; z-index: 80; display: flex; align-items: center; justify-content: center; padding: 1.5rem; background: radial-gradient(circle at 50% 40%, rgba(31, 67, 119, .97), rgba(8, 19, 38, .98)); animation: apparait .3s ease; }
.celebration-boite { text-align: center; max-width: 360px; }
.celebration-sceau { display: inline-block; filter: drop-shadow(0 0 24px rgba(217, 178, 95, .6)); animation: eclot 1.2s cubic-bezier(.2, .8, .2, 1); }
.celebration-sceau svg { animation: tourne 30s linear infinite; }
.celebration-ar { font: 700 2.5rem/1.3 var(--arabe); color: var(--or-clair); margin: .8rem 0 0; }
.celebration-titre { font: 500 1.5rem var(--titre); margin: .3rem 0 .6rem; }
.celebration-texte { color: var(--brume); }
.chargement { min-height: 80dvh; display: flex; align-items: center; justify-content: center; }
.chargement svg { animation: tourne 6s linear infinite; opacity: .8; }

@keyframes apparait { from { opacity: 0; } }
@keyframes disparait { to { opacity: 0; } }
@keyframes monte { from { transform: translateY(100%); } }
@keyframes descend { to { transform: translateY(100%); } }
@keyframes monte-toast { from { opacity: 0; transform: translate(-50%, 12px); } }
@keyframes pop { 50% { transform: scale(1.18); } }
@keyframes lueur { 50% { opacity: .45; } }
@keyframes eclot { from { transform: scale(.3) rotate(-90deg); opacity: 0; } }
@keyframes tourne { to { transform: rotate(360deg); } }

@media (min-width: 700px) {
  .fond { align-items: center; }
  .feuille { border-radius: 22px; border: 1px solid var(--filet); border-top-color: var(--or); max-height: 86dvh; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Décompte du Ramadan ---------- */
.ramadan {
  margin: 2rem 0 0; padding: 1rem 1.1rem 1.05rem; border-radius: 18px;
  border: 1px solid var(--filet);
  background:
    radial-gradient(90% 120% at 0% 0%, rgba(217, 178, 95, .14), transparent 60%),
    linear-gradient(160deg, rgba(31, 67, 119, .55), rgba(10, 24, 47, .6));
}
.ramadan-haut { display: flex; align-items: center; gap: .85rem; }
.croissant { flex: none; filter: drop-shadow(0 0 10px rgba(217, 178, 95, .45)); }
.croissant-lune { fill: var(--or); }
.croissant-etoile { fill: var(--or-clair); }
.ramadan-compte { display: flex; flex-direction: column; line-height: 1.05; min-width: 0; }
.ramadan-nombre { font: 700 2.4rem/1 var(--titre); color: var(--ivoire); }
.ramadan-libelle { font: 500 .98rem var(--titre); color: var(--or-clair); }
.ramadan-ar { margin-left: auto; font: 700 1.7rem/1 var(--arabe); color: var(--or); opacity: .9; }
.ramadan-texte { margin: .75rem 0 0; font-size: .95rem; color: var(--ivoire); }
.ramadan-conseil { margin: .45rem 0 0; font-size: .9rem; color: var(--brume); }
.ramadan.en-cours { border-color: var(--or); }

/* ---------- Accès personnel ---------- */
.bienvenue-tete { text-align: center; margin-bottom: .5rem; }
.bienvenue-tete .titre-section { margin-top: .6rem; }
.attente { margin-top: 1rem; text-align: center; font-style: italic; }

/* Encouragements en arabe */
.reaction-ar { font: 700 1.1rem/1.2 var(--arabe); color: var(--or-clair); padding: 0 .1rem; }
.reaction.mienne .reaction-ar { color: var(--ivoire); }
.reaction-emoji { font-size: .95rem; line-height: 1; }
