/* =========================================================
   Collectytics — thème premium sombre
   ========================================================= */

@property --mx { syntax: "<percentage>"; inherits: true; initial-value: 50%; }
@property --my { syntax: "<percentage>"; inherits: true; initial-value: 50%; }

:root {
  --bg: #06070d;
  --bg-2: #0b0d18;
  --surface: rgb(255 255 255 / 4.5%);
  --surface-2: rgb(255 255 255 / 7%);
  --surface-plein: #10121f;
  --surface-haut: #161929;
  --bordure: rgb(255 255 255 / 8%);
  --bordure-forte: rgb(255 255 255 / 15%);
  --texte: #f3f4fb;
  --texte-doux: #9aa0bd;
  --texte-faible: #626884;
  /* Couleurs du logo : jaune #f9cd5e et noir #0e0e14. Le dégradé holo est réservé aux cartes et aux célébrations. */
  --or: #f9cd5e;
  --jaune-logo: #f9cd5e;
  --noir-logo: #0e0e14;
  --grad-or: linear-gradient(135deg, #ffe7a8 0%, #f9cd5e 45%, #eeb142 100%);
  --grad-holo: linear-gradient(120deg, #7ef0ff 0%, #a78bfa 35%, #ff7ac6 65%, #ffd166 100%);
  --pos: #3ee8a0;
  --neg: #ff6b7d;
  --pos-fond: rgb(62 232 160 / 12%);
  --neg-fond: rgb(255 107 125 / 12%);
  --titre: "Space Grotesk", "Inter", system-ui, sans-serif;
  --sans: "Inter", system-ui, -apple-system, sans-serif;
  --ressort: cubic-bezier(.2, .9, .25, 1.15);
  --doux: cubic-bezier(.2, .8, .2, 1);
  --dock-h: 72px;
  --bas: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0; min-height: 100dvh;
  background: var(--bg); color: var(--texte);
  font-family: var(--sans); font-size: 16px; line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
svg { width: 1em; height: 1em; flex-shrink: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--or); outline-offset: 2px; }
.discret { color: var(--texte-doux); }
.petit { font-size: 13.5px; }

/* ---------- Fond aurore ---------- */
.aurore { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.aurore span {
  position: absolute; width: 70vmax; height: 70vmax; border-radius: 50%;
  filter: blur(90px); opacity: .22; will-change: transform;
}
.aurore span:nth-child(1) { background: #f9cd5e; opacity: .11; top: -38vmax; left: -28vmax; animation: derive 26s ease-in-out infinite alternate; }
.aurore span:nth-child(2) { background: #34407a; top: -30vmax; right: -35vmax; opacity: .22; animation: derive 32s ease-in-out infinite alternate-reverse; }
.aurore span:nth-child(3) { background: #ee9b3a; bottom: -50vmax; left: 10vmax; opacity: .07; animation: derive 38s ease-in-out infinite alternate; }
@keyframes derive { to { transform: translate(8vmax, 6vmax) scale(1.1); } }

/* ---------- En-tête ---------- */
.entete {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(10px + env(safe-area-inset-top, 0px)) 16px 10px;
  background: linear-gradient(to bottom, rgb(6 7 13 / 92%), rgb(6 7 13 / 70%));
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border-bottom: 1px solid var(--bordure);
}
.marque { display: flex; align-items: center; gap: 9px; text-decoration: none; }
.logo { width: 34px; height: 34px; transition: transform .5s var(--ressort); }
.marque:hover .logo { transform: rotate(-6deg) scale(1.06); }
.mot { font-family: "Poppins", var(--titre); font-weight: 800; font-size: 20px; letter-spacing: -.035em; color: #f1f1f6; }
.mot span { color: var(--jaune-logo); }

.bouton-rond {
  width: 42px; height: 42px; border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center; font-size: 20px;
  border: 1px solid var(--bordure); background: var(--surface); color: var(--texte);
  transition: background .2s, transform .15s var(--ressort), border-color .2s;
}
.bouton-rond:hover { background: var(--surface-2); border-color: var(--bordure-forte); }
.bouton-rond:active { transform: scale(.92); }
.bouton-rond.petit { width: 36px; height: 36px; font-size: 17px; }
.bouton-rond.tourne svg { animation: tourne .8s linear infinite; }
@keyframes tourne { to { transform: rotate(360deg); } }

/* ---------- Page & vues ---------- */
.page {
  width: 100%; max-width: 680px; margin: 0 auto;
  padding: 18px 16px calc(var(--dock-h) + var(--bas) + 40px);
}
.vue { animation: vue-entree .45s var(--doux); }
@keyframes vue-entree { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
::view-transition-old(root) { animation: .18s ease both fondu-sortie; }
::view-transition-new(root) { animation: .32s var(--doux) both fondu-entree; }
@keyframes fondu-sortie { to { opacity: 0; transform: translateY(-6px); } }
@keyframes fondu-entree { from { opacity: 0; transform: translateY(8px); } }

.apparition { animation: monte-doux .6s var(--doux) both; animation-delay: calc(var(--i, 0) * 70ms); }
@keyframes monte-doux { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.titre-vue { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 6px 0 14px; }
.titre-vue h1 { margin: 0; font-family: var(--titre); font-size: 30px; letter-spacing: -.03em; }

/* ---------- Boutons ---------- */
.btn {
  position: relative; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  border: 0; border-radius: 14px; padding: 13px 18px; min-height: 48px;
  font-weight: 700; font-size: 15.5px; letter-spacing: -.005em;
  transition: transform .15s var(--ressort), filter .2s, box-shadow .25s, background .2s;
}
.btn svg { font-size: 19px; }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .55; cursor: progress; }
.btn-or {
  background: var(--grad-or); color: #0e0e14;
  box-shadow: 0 8px 26px -8px rgb(238 177 66 / 65%), inset 0 1px 0 rgb(255 255 255 / 55%);
}
.btn-or::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(105deg, transparent 35%, rgb(255 255 255 / 55%) 50%, transparent 65%);
  transform: translateX(-120%);
}
.btn-or:hover::after { transition: transform .8s var(--doux); transform: translateX(120%); }
.btn-or:hover { filter: brightness(1.04); box-shadow: 0 12px 32px -8px rgb(238 177 66 / 75%), inset 0 1px 0 rgb(255 255 255 / 55%); }
.btn-large { width: 100%; padding: 16px 22px; font-size: 16.5px; border-radius: 16px; }
.btn-secondaire { background: var(--surface-2); color: var(--texte); border: 1px solid var(--bordure); }
.btn-secondaire:hover { background: rgb(255 255 255 / 10%); }
.btn-danger { background: var(--neg-fond); color: var(--neg); }
.lien { border: 0; background: none; padding: 6px 0; color: var(--texte-doux); font-weight: 600; font-size: 14px; transition: color .2s; }
.lien:hover { color: var(--texte); }
.lien.danger { color: var(--neg); display: block; margin: 26px auto 8px; }
.rangee { display: flex; gap: 10px; }
.rangee > * { flex: 1; }

/* ---------- Bienvenue (collection vide) ---------- */
.bienvenue { text-align: center; padding: 10px 4px 20px; }
.pile { position: relative; height: 250px; margin: 6px auto 8px; perspective: 900px; }
.pile .carte-deco {
  position: absolute; left: 50%; top: 24px; width: 136px; aspect-ratio: 63 / 88;
  translate: calc(-50% + var(--x)) 0; rotate: var(--r);
  border-radius: 12px; border: 3px solid rgb(255 255 255 / 12%);
  background: linear-gradient(160deg, #262a48, #10121f);
  box-shadow: 0 30px 60px -20px rgb(0 0 0 / 80%);
  animation: flotte 6s ease-in-out infinite; animation-delay: var(--d);
}
.pile .carte-deco.centre { z-index: 2; top: 8px; width: 150px; border-color: rgb(249 205 94 / 45%); }
.carte-deco .motif { position: absolute; inset: 9%; border-radius: 7px; opacity: .9; }
.motif.m1 { background: radial-gradient(circle at 50% 40%, #7ef0ff 0 22%, transparent 23%), linear-gradient(160deg, #3b3f8f, #1d1f45); }
.motif.m2 { background: radial-gradient(circle at 50% 40%, #ff7ac6 0 22%, transparent 23%), linear-gradient(160deg, #6b2c5c, #2a1230); }
.motif.m3 { background: radial-gradient(circle at 50% 38%, #ffe7a3 0 20%, #f9cd5e 21% 24%, transparent 25%), linear-gradient(160deg, #6a4a12, #2a1d08); }
@keyframes flotte { 50% { transform: translateY(-10px); } }

.bienvenue h1 { font-family: var(--titre); font-size: clamp(34px, 9.5vw, 50px); line-height: 1.02; letter-spacing: -.035em; margin: 8px 0 14px; }
.texte-holo {
  background: var(--grad-holo); background-size: 200% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: glisse-holo 6s ease-in-out infinite alternate;
}
@keyframes glisse-holo { to { background-position: 100% 0; } }
.texte-or {
  background: linear-gradient(110deg, #eeb142 0%, #f9cd5e 30%, #fff3cf 50%, #f9cd5e 70%, #eeb142 100%); background-size: 250% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: glisse-holo 5s ease-in-out infinite alternate;
}
.accroche { color: var(--texte-doux); max-width: 420px; margin: 0 auto 24px; font-size: 16px; }
.bienvenue .btn-large { max-width: 360px; }
.atouts { list-style: none; padding: 0; margin: 28px auto 18px; max-width: 420px; display: grid; gap: 10px; text-align: left; }
.atouts li {
  display: flex; align-items: center; gap: 14px; padding: 12px 14px;
  background: var(--surface); border: 1px solid var(--bordure); border-radius: 16px;
  animation: monte-doux .6s var(--doux) both;
}
.atouts li:nth-child(1) { animation-delay: .15s; }
.atouts li:nth-child(2) { animation-delay: .25s; }
.atouts li:nth-child(3) { animation-delay: .35s; }
.atouts strong { display: block; font-size: 15px; }
.atouts span span, .atouts li > span:last-child { font-size: 13.5px; color: var(--texte-doux); }
.atout-icone {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-size: 20px;
  background: linear-gradient(135deg, rgb(249 205 94 / 18%), rgb(249 205 94 / 6%)); color: var(--or);
  border: 1px solid var(--bordure);
}

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden; isolation: isolate;
  padding: 22px 20px 20px; border-radius: 26px;
  background:
    radial-gradient(120% 120% at 100% 0%, rgb(249 205 94 / 13%), transparent 55%),
    radial-gradient(90% 100% at 0% 100%, rgb(249 205 94 / 14%), transparent 60%),
    linear-gradient(160deg, #141733, #0c0e1c);
  border: 1px solid rgb(255 255 255 / 10%);
  box-shadow: 0 30px 60px -30px rgb(0 0 0 / 90%), inset 0 1px 0 rgb(255 255 255 / 8%);
}
.hero::before {
  content: ""; position: absolute; inset: -1px; z-index: -1; border-radius: inherit; padding: 1px;
  background: linear-gradient(140deg, rgb(249 205 94 / 85%), rgb(249 205 94 / 5%) 45%, rgb(255 255 255 / 25%)); opacity: .45;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
}
.sur-titre { margin: 0; font-size: 12.5px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--texte-doux); }
.valeur-zone { position: relative; display: flex; align-items: flex-end; }
.valeur {
  margin: 6px 0 12px; font-family: var(--titre); font-weight: 700;
  font-size: clamp(44px, 13vw, 66px); line-height: 1; letter-spacing: -.045em;
  background: var(--grad-or); -webkit-background-clip: text; background-clip: text; color: transparent;
  font-variant-numeric: tabular-nums;
  filter: drop-shadow(0 6px 22px rgb(238 177 66 / 25%));
}
.delta-flottant {
  position: absolute; left: 4px; top: -8px;
  font-weight: 700; font-size: 15px; font-variant-numeric: tabular-nums;
  opacity: 0; pointer-events: none;
}
.delta-flottant.pos { color: var(--pos); }
.delta-flottant.neg { color: var(--neg); }
.delta-flottant.joue { animation: delta 1.8s var(--doux); }
@keyframes delta {
  0% { opacity: 0; transform: translateY(12px) scale(.8); }
  15% { opacity: 1; transform: translateY(0) scale(1.05); }
  70% { opacity: 1; transform: translateY(-6px) scale(1); }
  100% { opacity: 0; transform: translateY(-16px); }
}
.hero-ligne { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.hero-sous { margin: 0; font-size: 14px; color: var(--texte-doux); }
.evolution { margin-top: 10px; display: flex; align-items: center; gap: 6px; }
.puce { display: inline-flex; align-items: center; gap: 4px; padding: 5px 11px; border-radius: 999px; font-weight: 700; font-size: 14px; font-variant-numeric: tabular-nums; }
.puce.pos { background: var(--pos-fond); color: var(--pos); }
.puce.neg { background: var(--neg-fond); color: var(--neg); }

/* ---------- Carte holographique ---------- */
.holo {
  --rx: 0deg; --ry: 0deg; --o: 0;
  position: relative; isolation: isolate; overflow: hidden;
  border-radius: 4.6% / 3.3%;
  transform: perspective(800px) rotateX(var(--rx)) rotateY(var(--ry));
  transition: transform .6s var(--doux), box-shadow .4s;
  will-change: transform;
}
.holo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.holo::before, .holo::after { content: ""; position: absolute; inset: 0; pointer-events: none; transition: opacity .4s; }
.holo::before {
  z-index: 1;
  background:
    repeating-linear-gradient(115deg, #ff5ec4 0%, #ffd35e 7%, #5effd2 14%, #5eaaff 21%, #b35eff 28%, #ff5ec4 35%);
  background-size: 300% 300%;
  background-position: var(--mx) var(--my);
  mix-blend-mode: color-dodge; filter: brightness(.7) contrast(1.3) saturate(1.2);
  opacity: calc(var(--o) * .5);
}
.holo::after {
  z-index: 2;
  background: radial-gradient(farthest-corner circle at var(--mx) var(--my), rgb(255 255 255 / 70%) 0%, rgb(255 255 255 / 12%) 30%, transparent 60%);
  mix-blend-mode: overlay; opacity: var(--o);
}
.holo.actif { transition: transform .08s linear, box-shadow .4s; }
.holo.reflet:not(.actif) { --o: .55; animation: reflet 7s ease-in-out infinite alternate; }
@keyframes reflet { 0% { --mx: 10%; --my: 20%; } 100% { --mx: 90%; --my: 80%; } }

/* ---------- Vitrine ---------- */
.vitrine {
  position: relative; height: 250px; display: flex; justify-content: center; align-items: center;
  perspective: 1000px; margin-top: 4px;
}
.vitrine-carte {
  position: absolute; width: 138px; aspect-ratio: 63 / 88;
  border: 0; padding: 0; background: var(--surface-haut); border-radius: 4.6% / 3.3%;
  translate: var(--x) var(--y); rotate: var(--r);
  box-shadow: 0 24px 40px -18px rgb(0 0 0 / 85%);
  animation: vitrine-entree .9s var(--ressort) both; animation-delay: calc(var(--i) * 110ms + .1s);
  transition: translate .5s var(--ressort), rotate .5s var(--ressort), scale .4s var(--ressort);
}
.vitrine-carte:hover { scale: 1.05; z-index: 5 !important; }
.vitrine-carte .prix {
  position: absolute; left: 50%; bottom: 7%; z-index: 3; translate: -50% 0;
  padding: 4px 10px; border-radius: 999px; font-size: 13px; font-weight: 700; white-space: nowrap;
  background: rgb(10 11 20 / 85%); border: 1px solid var(--bordure-forte); color: var(--or);
  backdrop-filter: blur(6px); font-variant-numeric: tabular-nums;
}
@keyframes vitrine-entree { from { opacity: 0; translate: 0 60px; rotate: 0deg; scale: .7; } }
.vitrine-vide {
  width: 138px; aspect-ratio: 63/88; border-radius: 10px; display: grid; place-items: center; text-align: center;
  padding: 12px; font-size: 13px; color: var(--texte-doux);
  background: linear-gradient(160deg, #1d2036, #0d0f1c); border: 1px dashed var(--bordure-forte);
}

/* ---------- Tuiles ---------- */
.tuiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 18px; }
.tuile {
  background: var(--surface); border: 1px solid var(--bordure); border-radius: 18px;
  padding: 14px 10px; text-align: center;
}
.tuile strong { display: block; font-family: var(--titre); font-size: 24px; line-height: 1.15; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.tuile span { font-size: 12px; color: var(--texte-doux); line-height: 1.25; display: block; margin-top: 2px; }

/* ---------- Blocs & listes ---------- */
.bloc { margin-top: 26px; }
.bloc h2, .panneau h2 { margin: 0; font-family: var(--titre); font-size: 19px; letter-spacing: -.02em; }
.bloc-titre { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; }
.liste { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.liste.cascade > li { animation: monte-doux .5s var(--doux) both; animation-delay: calc(min(var(--i, 0), 12) * 35ms); }
.ligne {
  width: 100%; display: flex; align-items: center; gap: 13px; text-align: left;
  background: var(--surface); border: 1px solid var(--bordure); border-radius: 18px;
  padding: 9px 14px 9px 9px;
  transition: background .2s, border-color .2s, transform .2s var(--ressort);
}
.ligne:hover { background: var(--surface-2); border-color: var(--bordure-forte); }
.ligne:active { transform: scale(.985); }
.vignette {
  width: 46px; height: 64px; border-radius: 6px; object-fit: cover; flex-shrink: 0;
  background: var(--surface-haut); box-shadow: 0 6px 14px -6px rgb(0 0 0 / 80%);
  transition: transform .3s var(--ressort);
}
.ligne:hover .vignette { transform: rotate(-4deg) scale(1.06); }
.vignette-vide { display: grid; place-items: center; font-size: 22px; color: var(--texte-doux); background: linear-gradient(160deg, #1d2036, #111324); border: 1px solid var(--bordure); }
.rang {
  width: 22px; flex-shrink: 0; text-align: center; font-family: var(--titre); font-weight: 700; font-size: 15px; color: var(--texte-faible);
}
.rang.r1 { color: var(--or); }
.ligne-texte { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.ligne-nom { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qte { color: var(--texte-doux); font-weight: 500; }
.ligne-sous { font-size: 13px; color: var(--texte-doux); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ligne-valeur { display: flex; flex-direction: column; align-items: flex-end; flex-shrink: 0; font-variant-numeric: tabular-nums; }
.ligne-valeur strong { font-size: 15.5px; }
.ligne-valeur small { font-size: 12.5px; font-weight: 600; }
.pos { color: var(--pos); }
.neg { color: var(--neg); }
.neutre { color: var(--texte-faible); }

.prix-info { margin: 22px 0 0; text-align: center; font-size: 12.5px; color: var(--texte-faible); display: flex; flex-direction: column; gap: 2px; }

/* ---------- Collection ---------- */
.outils { display: flex; gap: 8px; align-items: center; }
.champ-recherche {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px;
  padding: 0 14px; height: 46px; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--bordure);
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.champ-recherche:focus-within { border-color: rgb(249 205 94 / 55%); box-shadow: 0 0 0 4px rgb(249 205 94 / 10%); background: var(--surface-2); }
.champ-recherche svg { color: var(--texte-doux); font-size: 18px; }
.champ-recherche input { flex: 1; min-width: 0; border: 0; background: none; outline: none; font-size: 16px; height: 100%; }
.champ-recherche.grand { height: 54px; border-radius: 16px; }
#tri {
  height: 46px; border-radius: 14px; padding: 0 12px; font-size: 14.5px; font-weight: 600;
  background: var(--surface); border: 1px solid var(--bordure); outline: none;
}
.puces-filtre { display: flex; gap: 6px; margin: 12px 0 14px; overflow-x: auto; scrollbar-width: none; }
.puces-filtre::-webkit-scrollbar { display: none; }
.filtre {
  flex-shrink: 0; border: 1px solid var(--bordure); background: var(--surface); border-radius: 999px;
  padding: 8px 14px; font-size: 14px; font-weight: 600; color: var(--texte-doux);
  transition: background .25s, color .25s, border-color .25s, transform .15s var(--ressort);
}
.filtre:active { transform: scale(.95); }
.filtre.actif { background: var(--texte); color: var(--bg); border-color: var(--texte); }
.vide-mini { text-align: center; color: var(--texte-doux); padding: 30px 0; }

/* Vue grille (classeur) */
.liste.grille { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px 10px; }
@media (min-width: 560px) { .liste.grille { grid-template-columns: repeat(4, 1fr); } }
.case {
  width: 100%; border: 0; background: none; padding: 0; text-align: left;
  display: flex; flex-direction: column; gap: 6px;
}
.case .holo, .case .case-vide { width: 100%; aspect-ratio: 63 / 88; box-shadow: 0 14px 26px -14px rgb(0 0 0 / 90%); background: var(--surface-haut); }
.case-vide {
  border-radius: 8px; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 6px;
  padding: 10px; text-align: center; font-size: 12px; font-weight: 600; color: var(--texte-doux);
  background: linear-gradient(160deg, #1d2036, #0d0f1c) !important; border: 1px solid var(--bordure);
}
.case-vide svg { font-size: 26px; color: var(--or); }
.case-bas { display: flex; justify-content: space-between; gap: 4px; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.case-bas strong { font-size: 13px; }
.case .badge-qte {
  position: absolute; top: 6px; right: 6px; z-index: 3; padding: 2px 7px; border-radius: 999px;
  background: rgb(6 7 13 / 80%); font-size: 12px; font-weight: 700; border: 1px solid var(--bordure-forte);
}

/* ---------- Profil ---------- */
.panneau {
  background: var(--surface); border: 1px solid var(--bordure); border-radius: 20px;
  padding: 18px; margin-bottom: 12px;
}
.panneau p { margin: 8px 0 14px; font-size: 14.5px; }
.panneau p:last-child { margin-bottom: 0; }
.resume { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 14px 0 0; }
.resume dt { font-size: 12.5px; color: var(--texte-doux); }
.resume dd { margin: 2px 0 0; font-family: var(--titre); font-size: 22px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.pub { display: flex; gap: 14px; align-items: center; background: linear-gradient(135deg, rgb(249 205 94 / 10%), rgb(249 205 94 / 3%)); }
.logo-mini { width: 46px; height: 46px; }
.pub a { color: var(--or); font-weight: 600; }
.mentions { font-size: 12px; color: var(--texte-faible); text-align: center; margin-top: 18px; }
.mentions a { color: var(--texte-doux); }

/* ---------- Dock ---------- */
.dock {
  position: fixed; z-index: 40; left: 50%; translate: -50% 0;
  bottom: calc(10px + var(--bas));
  width: min(calc(100% - 20px), 460px); height: var(--dock-h);
  display: grid; grid-template-columns: 1fr 1fr 76px 1fr 1fr; align-items: center;
  padding: 0 6px; border-radius: 26px;
  background: rgb(18 20 34 / 78%);
  backdrop-filter: blur(22px) saturate(160%); -webkit-backdrop-filter: blur(22px) saturate(160%);
  border: 1px solid var(--bordure-forte);
  box-shadow: 0 20px 40px -12px rgb(0 0 0 / 80%), inset 0 1px 0 rgb(255 255 255 / 6%);
}
.dock-btn {
  position: relative; z-index: 1; height: 58px; border: 0; background: none; border-radius: 18px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--texte-faible); font-size: 11px; font-weight: 600;
  transition: color .25s;
}
.dock-btn svg { font-size: 23px; transition: transform .35s var(--ressort); }
.dock-btn:active svg { transform: scale(.85); }
.dock-btn.actif { color: var(--texte); }
.dock-btn.actif svg { transform: translateY(-1px); }
.dock-indicateur {
  position: absolute; top: 7px; height: 58px; border-radius: 18px;
  background: rgb(255 255 255 / 7%); border: 1px solid rgb(255 255 255 / 6%);
  transition: left .45s var(--ressort), width .45s var(--ressort);
}
.dock-ajout {
  justify-self: center; width: 60px; height: 60px; border-radius: 20px; border: 0;
  display: grid; place-items: center; font-size: 26px; color: #0e0e14;
  background: var(--grad-or);
  box-shadow: 0 10px 28px -6px rgb(238 177 66 / 70%), inset 0 1px 0 rgb(255 255 255 / 60%);
  translate: 0 -14px;
  transition: transform .25s var(--ressort), box-shadow .25s;
}
.dock-ajout:hover { transform: rotate(90deg) scale(1.05); }
.dock-ajout:active { transform: scale(.9); }
.sans-articles .dock-ajout { animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 10px 28px -6px rgb(238 177 66 / 70%), 0 0 0 10px rgb(249 205 94 / 0%), 0 0 0 6px rgb(249 205 94 / 18%); } }

/* ---------- Feuilles (dialogues) ---------- */
.feuille {
  width: 100%; max-width: 560px; max-height: calc(100dvh - 40px);
  margin: auto auto 0; padding: 0 18px calc(22px + var(--bas));
  border: 1px solid var(--bordure-forte); border-bottom: 0; border-radius: 28px 28px 0 0;
  background: linear-gradient(180deg, #161929, #0e1020);
  color: var(--texte);
  overflow-y: auto; overscroll-behavior: contain;
  box-shadow: 0 -20px 60px rgb(0 0 0 / 60%);
}
.feuille::backdrop { background: rgb(3 4 10 / 62%); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.feuille[open] { animation: feuille-monte .45s var(--ressort); }
.feuille[open]::backdrop { animation: fondu .3s ease; }
.feuille.ferme { animation: feuille-descend .22s ease-in forwards; }
.feuille.ferme::backdrop { animation: fondu .22s ease reverse forwards; }
.feuille.glisse { animation: none; transition: none; }
.feuille:focus { outline: none; }
@keyframes feuille-monte { from { transform: translateY(100%); } to { transform: none; } }
@keyframes feuille-descend { to { transform: translateY(100%); } }
@keyframes fondu { from { opacity: 0; } }
@media (min-width: 640px) {
  .feuille { margin: auto; border-radius: 28px; border-bottom: 1px solid var(--bordure-forte); padding-bottom: 24px; max-height: min(88dvh, 900px); }
  .feuille[open] { animation: feuille-zoom .35s var(--ressort); }
  .feuille.ferme { animation: feuille-dezoom .18s ease-in forwards; }
  @keyframes feuille-zoom { from { opacity: 0; transform: scale(.94) translateY(10px); } }
  @keyframes feuille-dezoom { to { opacity: 0; transform: scale(.96); } }
  .poignee { display: none; }
}
.feuille-tete {
  position: sticky; top: 0; z-index: 5;
  display: flex; justify-content: space-between; align-items: center;
  padding: 22px 0 12px; margin: 0 -18px 4px; padding-inline: 18px;
  background: linear-gradient(180deg, #161929 75%, rgb(22 25 41 / 0%));
  touch-action: none; cursor: grab;
}
.feuille-tete h2 { margin: 0; font-family: var(--titre); font-size: 22px; letter-spacing: -.02em; }
.poignee { position: absolute; top: 8px; left: 50%; translate: -50% 0; width: 42px; height: 5px; border-radius: 3px; background: rgb(255 255 255 / 22%); }

.segments {
  position: relative; display: grid; grid-template-columns: 1fr 1fr;
  background: rgb(255 255 255 / 5%); border: 1px solid var(--bordure); border-radius: 14px; padding: 4px; margin-bottom: 16px;
}
.segment-indicateur {
  position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc(50% - 4px);
  border-radius: 10px; background: rgb(255 255 255 / 10%); box-shadow: 0 4px 12px rgb(0 0 0 / 30%);
  transition: transform .4s var(--ressort);
}
.segments[data-mode="manuel"] .segment-indicateur { transform: translateX(100%); }
.segment { position: relative; z-index: 1; border: 0; background: none; padding: 10px; border-radius: 10px; font-weight: 600; font-size: 14.5px; color: var(--texte-doux); transition: color .25s; }
.segment.actif { color: var(--texte); }

#recherche-etat { margin: 10px 2px 12px; min-height: 1.4em; }
.grille-cartes { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(98px, 1fr)); gap: 14px 10px; }
.grille-cartes li { animation: monte-doux .45s var(--doux) both; animation-delay: calc(min(var(--i, 0), 15) * 25ms); }
.resultat { width: 100%; border: 0; background: none; padding: 0; text-align: left; display: flex; flex-direction: column; gap: 4px; }
.resultat img, .sans-image, .squelette {
  width: 100%; aspect-ratio: 63 / 88; border-radius: 7px; object-fit: cover;
  background: var(--surface-haut); transition: transform .3s var(--ressort), box-shadow .3s;
}
.sans-image { display: grid; place-items: center; padding: 8px; text-align: center; font-size: 12.5px; font-weight: 600; color: var(--texte-doux); border: 1px dashed var(--bordure-forte); }
.resultat:hover img, .resultat:hover .sans-image { transform: translateY(-4px) rotate(-1.5deg); box-shadow: 0 16px 30px -12px rgb(0 0 0 / 90%); }
.resultat:active img { transform: scale(.96); }
.resultat-nom { font-size: 13px; font-weight: 600; line-height: 1.2; }
.resultat-set { font-size: 11.5px; color: var(--texte-doux); line-height: 1.2; }
.squelette {
  background: linear-gradient(100deg, var(--surface-haut) 30%, #22263d 50%, var(--surface-haut) 70%);
  background-size: 300% 100%; animation: shimmer 1.3s linear infinite;
}
.squelette-ligne { height: 10px; border-radius: 5px; margin-top: 6px; width: 80%; background: var(--surface-haut); }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }

.formulaire { display: flex; flex-direction: column; gap: 14px; }
.formulaire label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--texte-doux); }
.formulaire input:not([type=checkbox]), .formulaire select {
  width: 100%; min-width: 0; height: 50px; padding: 0 14px; border-radius: 14px;
  border: 1px solid var(--bordure); background: rgb(255 255 255 / 4%); outline: none; font-size: 16px; font-weight: 500; color: var(--texte);
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.formulaire input:focus, .formulaire select:focus { border-color: rgb(249 205 94 / 55%); box-shadow: 0 0 0 4px rgb(249 205 94 / 10%); background: rgb(255 255 255 / 6%); }
.formulaire input::placeholder { color: var(--texte-faible); }
select option { background: var(--surface-plein); }
.deux-col { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stepper { display: flex; align-items: center; height: 50px; border-radius: 14px; border: 1px solid var(--bordure); background: rgb(255 255 255 / 4%); overflow: hidden; }
.stepper input { border: 0 !important; background: none !important; box-shadow: none !important; text-align: center; padding: 0 !important; -moz-appearance: textfield; }
.stepper input::-webkit-inner-spin-button, .stepper input::-webkit-outer-spin-button { -webkit-appearance: none; }
.stepper button { width: 42px; height: 100%; border: 0; background: none; font-size: 20px; color: var(--texte); flex-shrink: 0; transition: background .2s; }
.stepper button:active { background: rgb(255 255 255 / 8%); }
.retour { align-self: flex-start; }
.presentation { display: flex; gap: 18px; align-items: center; }
.carte-grande { width: 132px; aspect-ratio: 63 / 88; flex-shrink: 0; background: var(--surface-haut); box-shadow: 0 24px 40px -18px rgb(0 0 0 / 90%); touch-action: none; }
.presentation-infos { min-width: 0; }
.presentation-infos p { margin: 0; }
.fc-nom { font-family: var(--titre); font-size: 24px; font-weight: 700; line-height: 1.1; letter-spacing: -.02em; margin-bottom: 4px !important; }
.cote {
  margin-top: 12px !important; display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 11px; border-radius: 10px; font-weight: 700; font-size: 15px;
  background: rgb(249 205 94 / 10%); color: var(--or); font-variant-numeric: tabular-nums;
}
.cote.absente { background: var(--surface-2); color: var(--texte-doux); font-weight: 600; font-size: 13.5px; }
.mini-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 14px 0 0; }
.mini-stats dt { font-size: 11.5px; color: var(--texte-doux); }
.mini-stats dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.presentation.sans-carte .carte-grande { display: none; }
.presentation.manuel-visuel .carte-grande { display: grid; place-items: center; font-size: 46px; color: var(--or); background: linear-gradient(160deg, #262a48, #10121f); border: 1px solid var(--bordure-forte); }
details { background: rgb(255 255 255 / 4%); border: 1px solid var(--bordure); border-radius: 14px; padding: 12px 14px; }
details[open] { display: flex; flex-direction: column; gap: 12px; }
summary { cursor: pointer; font-size: 14px; font-weight: 600; color: var(--texte-doux); }

.partage-apercu { display: grid; place-items: center; margin: 4px 0 14px; }
.partage-apercu img {
  width: 100%; max-width: 300px; aspect-ratio: 4 / 5; border-radius: 16px; background: #0c0e1c;
  box-shadow: 0 30px 60px -20px rgb(0 0 0 / 90%); border: 1px solid var(--bordure-forte);
  transition: opacity .25s, transform .4s var(--ressort);
}
.partage-apercu img.charge { opacity: .35; transform: scale(.97); }
.options { display: flex; flex-direction: column; gap: 4px; margin-bottom: 16px; background: rgb(255 255 255 / 4%); border: 1px solid var(--bordure); border-radius: 16px; padding: 4px 14px; }
.interrupteur { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; font-size: 15px; font-weight: 500; cursor: pointer; }
.interrupteur + .interrupteur { border-top: 1px solid var(--bordure); }
.interrupteur input {
  appearance: none; -webkit-appearance: none; flex-shrink: 0;
  width: 46px; height: 28px; border-radius: 999px; background: rgb(255 255 255 / 14%); position: relative; cursor: pointer;
  transition: background .25s;
}
.interrupteur input::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff;
  box-shadow: 0 2px 6px rgb(0 0 0 / 40%); transition: transform .3s var(--ressort);
}
.interrupteur input:checked { background: linear-gradient(135deg, #f9cd5e, #eeb142); }
.interrupteur input:checked::after { transform: translateX(18px); }

/* ---------- Toast & confettis ---------- */
.toast {
  position: fixed; left: 50%; z-index: 100; bottom: calc(var(--dock-h) + var(--bas) + 24px);
  translate: -50% 20px; opacity: 0; pointer-events: none;
  display: flex; align-items: center; gap: 8px;
  padding: 12px 18px; border-radius: 16px; max-width: calc(100vw - 32px);
  background: rgb(28 31 50 / 92%); border: 1px solid var(--bordure-forte);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 16px 40px -10px rgb(0 0 0 / 80%);
  font-size: 14.5px; font-weight: 600; text-align: center;
  transition: opacity .25s, translate .4s var(--ressort);
}
.toast.visible { opacity: 1; translate: -50% 0; }
#confettis { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 2147483647; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .aurore span { animation: none; }
}

@media (max-width: 370px) {
  .tuile strong { font-size: 20px; }
  .deux-col { grid-template-columns: 1fr; }
  .dock { grid-template-columns: 1fr 1fr 68px 1fr 1fr; }
  .dock-btn span { font-size: 10px; }
  .carte-grande { width: 110px; }
}

@media (min-width: 900px) {
  .page { padding-top: 30px; }
  .vitrine { height: 290px; }
  .vitrine-carte { width: 160px; }
}

/* Calques affichés en « top layer » via l'API popover : on neutralise les styles par défaut. */
.toast[popover] {
  inset: auto; margin: 0; color: var(--texte); overflow: visible;
  left: 50%; bottom: calc(var(--dock-h) + var(--bas) + 24px);
  background: rgb(28 31 50 / 92%); border: 1px solid var(--bordure-forte); padding: 12px 18px;
}
#confettis[popover] {
  inset: 0; margin: 0; padding: 0; border: 0; background: transparent;
  width: 100vw; height: 100vh; max-width: none; max-height: none; overflow: hidden;
}

/* =========================================================
   Fonctionnalités : courbe, alertes, extensions, souhaits,
   ouvertures, bilan mensuel
   ========================================================= */
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.centre { text-align: center; }
.centre-bloc { display: block; margin: 18px auto 4px; }
svg.inline { width: 15px; height: 15px; vertical-align: -2px; }

/* ---------- En-tête : alertes ---------- */
.entete-actions { display: flex; gap: 8px; }
.bouton-rond { position: relative; }
.badge {
  position: absolute; top: -3px; right: -3px; min-width: 19px; height: 19px; padding: 0 5px;
  border-radius: 999px; background: #ff5f7a; color: #fff; font-size: 11px; font-weight: 700;
  display: grid; place-items: center; border: 2px solid var(--bg);
  animation: badge-pop .5s var(--ressort);
}
@keyframes badge-pop { from { transform: scale(0); } }
.bouton-rond.sonne svg { animation: sonne 1s ease-in-out 2; transform-origin: 50% 15%; }
@keyframes sonne { 0%, 100% { transform: rotate(0); } 20% { transform: rotate(14deg); } 40% { transform: rotate(-12deg); } 60% { transform: rotate(8deg); } 80% { transform: rotate(-4deg); } }

/* ---------- Courbe ---------- */
.courbe-bloc { margin-top: 18px; }
.periodes { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.periode {
  border: 0; background: none; padding: 6px 10px; border-radius: 999px;
  font-size: 12.5px; font-weight: 700; color: var(--texte-faible); transition: background .2s, color .2s;
}
.periode:hover { color: var(--texte-doux); }
.periode.actif { background: rgb(255 255 255 / 9%); color: var(--texte); }
.evolution { margin-left: auto; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--texte-doux); }
.courbe { position: relative; height: 128px; margin-top: 8px; touch-action: pan-y; }
.courbe svg { width: 100%; height: 100%; overflow: visible; display: block; }
.courbe .ligne-courbe { fill: none; stroke: url(#g-or); stroke-width: 2px; stroke-linejoin: round; stroke-linecap: round; }
.courbe .ligne-courbe.dessine { animation: dessine 1.2s var(--doux) both; }
@keyframes dessine { from { stroke-dashoffset: var(--longueur); } to { stroke-dashoffset: 0; } }
.courbe .aire { fill: url(#g-aire); }
.courbe .aire.dessine { animation: fondu .9s .3s ease both; }
.courbe .grille-h { stroke: rgb(255 255 255 / 7%); stroke-width: 1px; shape-rendering: crispEdges; }
.courbe .etiquette-axe { fill: var(--texte-faible); font-size: 10.5px; font-family: var(--sans); font-variant-numeric: tabular-nums; }
.courbe .viseur { stroke: rgb(255 255 255 / 35%); stroke-width: 1px; shape-rendering: crispEdges; }
.courbe .point { fill: #f9cd5e; stroke: #121528; stroke-width: 2px; }
.courbe .point-fin { fill: #f9cd5e; stroke: #121528; stroke-width: 2px; }
.courbe .halo { fill: #f9cd5e; opacity: .25; animation: halo 2s ease-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes halo { from { transform: scale(.6); opacity: .45; } to { transform: scale(2.4); opacity: 0; } }
.courbe-bulle {
  position: absolute; top: -6px; z-index: 3; pointer-events: none;
  translate: -50% -100%; padding: 6px 10px; border-radius: 10px;
  background: rgb(12 14 28 / 95%); border: 1px solid var(--bordure-forte);
  box-shadow: 0 10px 24px -8px rgb(0 0 0 / 80%);
  display: flex; flex-direction: column; align-items: center; white-space: nowrap;
}
.courbe-bulle strong { font-size: 14px; font-variant-numeric: tabular-nums; }
.courbe-bulle span { font-size: 11.5px; color: var(--texte-doux); }
.courbe-vide {
  position: absolute; inset: 0; margin: 0; display: grid; place-items: center; text-align: center;
  font-size: 13px; color: var(--texte-doux); line-height: 1.5;
}

/* ---------- Carte bilan du mois ---------- */
.carte-bilan {
  position: relative; overflow: hidden; width: 100%; margin-top: 14px;
  display: flex; align-items: center; gap: 14px; text-align: left;
  padding: 16px 18px; border-radius: 20px; border: 1px solid rgb(255 255 255 / 12%);
  background: linear-gradient(120deg, rgb(126 240 255 / 14%), rgb(167 139 250 / 16%) 45%, rgb(255 122 198 / 14%));
  transition: transform .2s var(--ressort), border-color .2s;
}
.carte-bilan:hover { border-color: rgb(255 255 255 / 25%); }
.carte-bilan:active { transform: scale(.985); }
.bilan-eclat {
  width: 44px; height: 44px; flex-shrink: 0; border-radius: 14px;
  background: conic-gradient(from 0deg, #7ef0ff, #a78bfa, #ff7ac6, #ffd166, #7ef0ff);
  animation: tourne 6s linear infinite; box-shadow: 0 0 24px rgb(167 139 250 / 45%);
  mask: radial-gradient(circle, #000 55%, transparent 56%), linear-gradient(#000 0 0);
  mask-composite: exclude; -webkit-mask-composite: xor;
}
.bilan-texte { flex: 1; display: flex; flex-direction: column; }
.bilan-texte strong { font-family: var(--titre); font-size: 17px; letter-spacing: -.01em; }
.bilan-texte span { font-size: 13.5px; color: var(--texte-doux); }
.bilan-fleche { font-size: 22px; color: var(--texte-doux); transition: transform .3s var(--ressort); }
.carte-bilan:hover .bilan-fleche { transform: translateX(4px); }

/* ---------- Sous-onglets de la collection ---------- */
.sous-onglets {
  position: relative; display: flex; gap: 2px; margin-bottom: 16px;
  border-bottom: 1px solid var(--bordure); overflow-x: auto; scrollbar-width: none;
}
.sous-onglets::-webkit-scrollbar { display: none; }
.sous-onglet {
  flex: 1 1 auto; border: 0; background: none; padding: 10px 6px 12px;
  font-size: 14px; white-space: nowrap; font-weight: 600; color: var(--texte-faible); transition: color .2s;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.sous-onglet.actif { color: var(--texte); }
.sous-indicateur {
  position: absolute; bottom: -1px; height: 2px; border-radius: 2px; background: var(--grad-or);
  transition: left .4s var(--ressort), width .4s var(--ressort);
}
.pastille { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; font-size: 11px; font-weight: 700; background: rgb(255 255 255 / 10%); color: var(--texte-doux); display: inline-grid; place-items: center; }
.sous-vue { animation: monte-doux .4s var(--doux); }
.intro-sous { margin: 0 0 14px; font-size: 14px; }
.bloc-bouton { width: 100%; margin-top: 12px; }

/* ---------- Extensions ---------- */
.ext-ligne {
  width: 100%; display: flex; align-items: center; gap: 14px; text-align: left;
  background: var(--surface); border: 1px solid var(--bordure); border-radius: 18px; padding: 12px 14px;
  transition: background .2s, border-color .2s, transform .2s var(--ressort);
}
.ext-ligne:hover { background: var(--surface-2); border-color: var(--bordure-forte); }
.ext-ligne:active { transform: scale(.985); }
.ext-vignette { width: 64px; height: 40px; flex-shrink: 0; display: grid; place-items: center; }
.ext-vignette img { max-width: 100%; max-height: 100%; object-fit: contain; filter: drop-shadow(0 4px 8px rgb(0 0 0 / 60%)); }
.ext-vignette .ext-sigle { font-family: var(--titre); font-weight: 700; font-size: 13px; color: var(--texte-doux); }
.ext-infos { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.ext-nom { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ext-chiffres { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--texte-doux); font-variant-numeric: tabular-nums; }
.barre-progression { height: 6px; border-radius: 999px; background: rgb(255 255 255 / 8%); overflow: hidden; }
.barre-progression span {
  display: block; height: 100%; width: 0; border-radius: inherit; background: var(--grad-or);
  transition: width 1s var(--doux);
}
.barre-progression.grande { height: 12px; }
.barre-progression .complet { background: linear-gradient(90deg, #3ee8a0, #f9cd5e); }
.ext-entete { display: flex; align-items: center; gap: 16px; margin-bottom: 14px; }
.ext-logo { width: 110px; height: 60px; flex-shrink: 0; display: grid; place-items: center; }
.ext-logo img { max-width: 100%; max-height: 100%; object-fit: contain; }
.ext-progression { flex: 1; min-width: 0; }
.ext-progression p { margin: 0 0 6px; }
.ext-progression strong { font-family: var(--titre); font-size: 22px; }
.grille-ext { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 10px 8px; }
.ext-case { width: 100%; border: 0; padding: 0; background: none; display: flex; flex-direction: column; gap: 3px; text-align: left; }
.ext-case .visuel { position: relative; width: 100%; aspect-ratio: 63 / 88; border-radius: 6px; overflow: hidden; background: var(--surface-haut); }
.ext-case img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ext-case.manquante img { filter: grayscale(1) brightness(.45); }
.ext-case.manquante .visuel::after { content: "+"; position: absolute; inset: 0; display: grid; place-items: center; font-size: 26px; color: rgb(255 255 255 / 55%); opacity: 0; transition: opacity .2s; }
.ext-case.manquante:hover .visuel::after { opacity: 1; }
.ext-case.possedee .visuel { box-shadow: 0 0 0 2px rgb(249 205 94 / 70%), 0 10px 20px -10px rgb(0 0 0 / 80%); }
.ext-case .num { font-size: 11px; color: var(--texte-faible); font-variant-numeric: tabular-nums; }
.ext-case.possedee .num { color: var(--or); font-weight: 700; }
.ext-case .souhait-marque { position: absolute; top: 4px; right: 4px; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; background: rgb(255 95 122 / 90%); color: #fff; font-size: 10px; }
.choix-extensions .ext-ligne { padding: 10px 12px; }
.choix-extensions .suivie { font-size: 12px; color: var(--or); font-weight: 700; }
.feuille-haute { min-height: min(80dvh, 700px); }

/* ---------- Souhaits ---------- */
.budget { text-align: center; background: linear-gradient(135deg, rgb(255 95 122 / 10%), rgb(249 205 94 / 7%)); }
.panneau .budget-valeur { margin: 4px 0 2px !important; font-family: var(--titre); font-size: 34px; font-weight: 700; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.etiquette-bon-plan {
  display: inline-flex; align-items: center; gap: 4px; margin-left: 6px; padding: 2px 7px; border-radius: 999px;
  font-size: 11px; font-weight: 700; background: var(--pos-fond); color: var(--pos); vertical-align: 1px;
}

/* ---------- Alertes ---------- */
.alerte {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 16px;
  background: var(--surface); border: 1px solid var(--bordure);
}
.alerte.non-lue { border-color: rgb(249 205 94 / 35%); background: rgb(249 205 94 / 5%); }
.alerte-icone { width: 34px; height: 34px; flex-shrink: 0; border-radius: 10px; display: grid; place-items: center; font-size: 17px; }
.alerte-icone.hausse { background: var(--pos-fond); color: var(--pos); }
.alerte-icone.baisse { background: var(--neg-fond); color: var(--neg); }
.alerte-icone.cible { background: rgb(249 205 94 / 12%); color: var(--or); }
.alerte-texte { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 14px; }
.alerte-texte strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.alerte-texte span { color: var(--texte-doux); font-size: 13px; }
.alerte-quand { font-size: 11.5px; color: var(--texte-faible); flex-shrink: 0; }
.alerte-champs { border: 1px solid var(--bordure); border-radius: 14px; padding: 12px 14px 14px; margin: 0; background: rgb(255 255 255 / 3%); display: flex; flex-direction: column; gap: 10px; }
.alerte-champs legend { display: flex; align-items: center; gap: 6px; padding: 0 6px; font-size: 13px; font-weight: 700; color: var(--texte-doux); }
.alerte-champs p { margin: 0; }

/* ---------- Ouvertures ---------- */
.stats-ouvertures { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; text-align: center; padding: 14px 10px; }
.stats-ouvertures span { display: block; font-size: 11.5px; color: var(--texte-doux); }
.stats-ouvertures strong { font-family: var(--titre); font-size: 17px; font-variant-numeric: tabular-nums; }
#btn-nouvelle-ouverture { margin-bottom: 16px; }
.ouv-ligne .ouv-icone { width: 46px; height: 64px; flex-shrink: 0; border-radius: 8px; display: grid; place-items: center; font-size: 24px; color: var(--or); background: linear-gradient(160deg, #3a2a0c, #15110a); border: 1px solid rgb(249 205 94 / 25%); }
.jauge { background: var(--surface); border: 1px solid var(--bordure); border-radius: 18px; padding: 14px; margin-bottom: 14px; transition: border-color .4s, box-shadow .4s; }
.jauge.rentable { border-color: rgb(62 232 160 / 45%); box-shadow: 0 0 0 4px rgb(62 232 160 / 8%); }
.jauge-textes { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; font-size: 14px; }
.jauge-textes strong { font-family: var(--titre); font-size: 20px; font-variant-numeric: tabular-nums; }
.jauge-statut { margin: 8px 0 0; font-size: 13px; color: var(--texte-doux); }
.jauge.rentable .jauge-statut { color: var(--pos); font-weight: 700; }
.tirages { list-style: none; padding: 0; margin: 0 0 14px; display: flex; flex-direction: column; gap: 8px; }
.tirage {
  display: flex; align-items: center; gap: 10px; padding: 6px 8px 6px 6px; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--bordure); animation: tirage-entre .5s var(--ressort);
}
@keyframes tirage-entre { from { opacity: 0; transform: translateY(-10px) scale(.96); } }
.tirage img { width: 38px; height: 53px; border-radius: 4px; object-fit: cover; background: var(--surface-haut); }
.tirage-infos { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 13.5px; }
.tirage-infos strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tirage-infos button { align-self: flex-start; border: 0; background: rgb(255 255 255 / 7%); color: var(--texte-doux); font-size: 11.5px; font-weight: 600; border-radius: 999px; padding: 2px 8px; margin-top: 2px; }
.tirage-infos button.reverse { background: rgb(167 139 250 / 20%); color: #cbb8ff; }
.tirage-valeur { font-weight: 700; font-variant-numeric: tabular-nums; font-size: 14px; }
.tirage-retirer { width: 30px; height: 30px; border: 0; border-radius: 50%; background: none; color: var(--texte-faible); font-size: 15px; display: grid; place-items: center; }
.collant-bas { position: sticky; bottom: 0; margin-top: 16px; z-index: 4; }
.resultat-ouverture { text-align: center; }
.res-valeur { margin: 6px 0 0; font-family: var(--titre); font-size: 56px; font-weight: 700; letter-spacing: -.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.res-verdict { margin: 8px 0 14px; font-weight: 700; font-size: 16px; }
.res-detail { display: flex; justify-content: center; gap: 18px; font-size: 13.5px; color: var(--texte-doux); margin-bottom: 14px; }
.res-detail strong { color: var(--texte); }

/* ---------- Bilan mensuel (story) ---------- */
.story {
  width: 100vw; height: 100dvh; max-width: 100vw; max-height: 100dvh; margin: 0; padding: 0; border: 0;
  background: #06070d; color: var(--texte); overflow: hidden;
}
@media (min-width: 640px) {
  .story { width: min(430px, 100vw); height: min(860px, 100dvh); margin: auto; border-radius: 28px; border: 1px solid var(--bordure-forte); }
}
.story::backdrop { background: rgb(3 4 10 / 88%); backdrop-filter: blur(8px); }
.story[open] { animation: story-ouvre .4s var(--doux); }
.story.ferme { animation: story-ferme .25s ease-in forwards; }
@keyframes story-ouvre { from { opacity: 0; transform: scale(1.04); } }
@keyframes story-ferme { to { opacity: 0; transform: scale(.97); } }
.story:focus { outline: none; }
.story-barres { position: absolute; z-index: 5; top: calc(12px + env(safe-area-inset-top, 0px)); left: 12px; right: 12px; display: flex; gap: 4px; }
.story-barres span { flex: 1; height: 3px; border-radius: 3px; background: rgb(255 255 255 / 22%); overflow: hidden; }
.story-barres i { display: block; height: 100%; width: 0; background: #fff; }
.story-barres .fait i { width: 100%; }
.story-barres .courant i { animation: progression var(--duree, 5s) linear forwards; }
.story.pause .story-barres .courant i { animation-play-state: paused; }
@keyframes progression { to { width: 100%; } }
.story-fermer { position: absolute; z-index: 6; top: calc(24px + env(safe-area-inset-top, 0px)); right: 12px; background: rgb(0 0 0 / 30%); }
.story-zone { position: absolute; z-index: 2; top: 70px; bottom: 120px; width: 35%; border: 0; background: none; }
.story-precedent { left: 0; }
.story-suivant { right: 0; width: 65%; }
.story-scene { position: absolute; inset: 0; }
.diapo {
  position: absolute; inset: 0; padding: 90px 28px 40px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 14px;
}
.diapo > * { animation: diapo-entre .7s var(--ressort) both; }
.diapo > *:nth-child(2) { animation-delay: .12s; }
.diapo > *:nth-child(3) { animation-delay: .24s; }
.diapo > *:nth-child(4) { animation-delay: .36s; }
.diapo > *:nth-child(5) { animation-delay: .48s; }
@keyframes diapo-entre { from { opacity: 0; transform: translateY(24px) scale(.96); } }
.diapo-fond { position: absolute; inset: 0; z-index: -1; }
.diapo .petit-titre { font-size: 14px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: rgb(255 255 255 / 65%); margin: 0; }
.diapo .grand-titre { font-family: var(--titre); font-size: clamp(34px, 9vw, 44px); line-height: 1.05; letter-spacing: -.035em; margin: 0; }
.diapo .enorme { font-family: var(--titre); font-weight: 700; font-size: clamp(72px, 24vw, 110px); line-height: .95; letter-spacing: -.05em; margin: 0; font-variant-numeric: tabular-nums; }
.diapo .or { background: var(--grad-or); -webkit-background-clip: text; background-clip: text; color: transparent; }
.diapo .texte { font-size: 17px; color: rgb(255 255 255 / 75%); margin: 0; max-width: 320px; }
.diapo .eventail { position: relative; width: 260px; height: 190px; margin: 10px 0; }
.diapo .eventail img { position: absolute; left: 50%; top: 0; width: 118px; aspect-ratio: 63/88; object-fit: cover; border-radius: 8px; box-shadow: 0 20px 40px -12px rgb(0 0 0 / 90%); }
.diapo .pepite { width: 190px; aspect-ratio: 63 / 88; box-shadow: 0 30px 60px -20px rgb(0 0 0 / 95%), 0 0 60px rgb(249 205 94 / 25%); }
.diapo .pepite-vide { display: grid; place-items: center; font-size: 60px; color: var(--or); background: linear-gradient(160deg, #262a48, #10121f); border-radius: 12px; }
.diapo .mini-courbe { width: 100%; max-width: 330px; height: 110px; }
.diapo .recap-image { width: min(76vw, 300px); aspect-ratio: 9 / 16; border-radius: 18px; box-shadow: 0 30px 60px -20px rgb(0 0 0 / 95%); border: 1px solid var(--bordure-forte); background: #0c0e1c; }
.diapo .rangee { width: 100%; max-width: 330px; position: relative; z-index: 4; }
.diapo-finale { justify-content: flex-start; padding-top: 72px; gap: 16px; }

@media (max-width: 370px) { .sous-onglets { gap: 0; } .sous-onglet { font-size: 12.5px; padding-inline: 2px; } .pastille { display: none; } }

/* =========================================================
   Comptes, installation, profil public
   ========================================================= */
.segments[data-mode="inscription"] .segment-indicateur { transform: translateX(100%); }
.segments-3 { grid-template-columns: repeat(3, 1fr); margin: 14px 0 12px; }
.segments-3 .segment-indicateur { width: calc(33.333% - 2.67px); }
.segments-3 .segment { font-size: 13px; padding: 9px 4px; }
.segments-3[data-mode="android"] .segment-indicateur { transform: translateX(100%); }
.segments-3[data-mode="ordi"] .segment-indicateur { transform: translateX(200%); }

/* Guide d'installation */
.etapes { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; animation: monte-doux .35s var(--doux); }
.etapes li { display: flex; gap: 12px; align-items: flex-start; font-size: 14.5px; line-height: 1.5; }
.etapes .num {
  width: 26px; height: 26px; flex-shrink: 0; border-radius: 50%; display: grid; place-items: center;
  font-family: var(--titre); font-weight: 700; font-size: 13px; color: #0e0e14; background: var(--grad-or);
}
.etapes .astuce { padding: 10px 12px; border-radius: 12px; background: rgb(255 255 255 / 4%); color: var(--texte-doux); font-size: 13.5px; }
.etapes .astuce .num { background: rgb(255 255 255 / 12%); color: var(--texte); font-family: Georgia, serif; font-style: italic; }
.pictogramme {
  display: inline-grid; place-items: center; width: 24px; height: 24px; margin: 0 2px; vertical-align: -6px;
  border-radius: 7px; background: rgb(255 255 255 / 9%); border: 1px solid var(--bordure); font-size: 15px; color: #7ab8ff;
}
.alerte-navigateur { padding: 12px 14px; border-radius: 14px; background: rgb(249 205 94 / 10%); border: 1px solid rgb(249 205 94 / 30%); color: var(--or); font-size: 14px; font-weight: 600; }
.installe { color: var(--pos); font-weight: 700; }
#btn-installer { margin-bottom: 4px; }

.bandeau-install {
  display: flex; align-items: center; gap: 12px; margin-top: 14px; padding: 12px 10px 12px 14px;
  border-radius: 18px; background: var(--surface); border: 1px solid var(--bordure);
}
.bandeau-install .logo-mini { width: 38px; height: 38px; }
.bandeau-texte { flex: 1; border: 0; background: none; padding: 0; text-align: left; display: flex; flex-direction: column; }
.bandeau-texte strong { font-size: 15px; }
.bandeau-texte span { font-size: 13px; color: var(--texte-doux); }

/* Compte */
.compte-tete { display: flex; align-items: center; gap: 14px; }
.compte-tete p { margin: 4px 0 0 !important; }
.compte-identite { flex: 1; min-width: 0; }
.compte-identite h2 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#compte-deconnecte .rangee { margin-top: 16px; }
.avatar {
  position: relative; width: 52px; height: 52px; flex-shrink: 0; border-radius: 50%;
  display: grid; place-items: center; font-family: var(--titre); font-weight: 700; font-size: 22px; color: #fff;
  background: linear-gradient(145deg, #2a2f5c, #151830);
}
.avatar::before {
  content: ""; position: absolute; inset: -3px; border-radius: 50%; padding: 3px;
  background: conic-gradient(from 210deg, #ffe7a8, #f9cd5e, #eeb142, #f9cd5e, #ffe7a8);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); mask-composite: exclude;
}
.avatar-vide { font-size: 24px; color: var(--texte-doux); }
.avatar-vide::before { background: var(--bordure-forte); }
.avatar-grand { width: 96px; height: 96px; font-size: 40px; }
.avatar-grand::before { inset: -4px; padding: 4px; animation: tourne 8s linear infinite; }
.statut-sync { display: flex; align-items: center; gap: 8px; margin: 14px 0 10px !important; font-size: 13.5px; color: var(--texte-doux); }
.point-sync { width: 8px; height: 8px; border-radius: 50%; background: var(--pos); box-shadow: 0 0 0 3px rgb(62 232 160 / 20%); }
.statut-sync.en-cours .point-sync { background: var(--or); box-shadow: 0 0 0 3px rgb(249 205 94 / 20%); animation: pulse-point 1s ease-in-out infinite; }
.statut-sync.erreur .point-sync { background: var(--neg); box-shadow: 0 0 0 3px rgb(255 107 125 / 20%); }
@keyframes pulse-point { 50% { opacity: .35; } }
.panneau .options { margin: 0 0 12px; }
.lien-profil { display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 14px; margin-bottom: 12px; border-radius: 14px; background: rgb(249 205 94 / 7%); border: 1px solid rgb(249 205 94 / 22%); }
.lien-profil code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; color: var(--or); font-family: var(--sans); font-weight: 600; }
a.btn { text-decoration: none; }

.champ-prefixe { display: flex; align-items: center; height: 50px; border-radius: 14px; border: 1px solid var(--bordure); background: rgb(255 255 255 / 4%); padding-left: 14px; transition: border-color .2s, box-shadow .2s; }
.champ-prefixe:focus-within { border-color: rgb(249 205 94 / 55%); box-shadow: 0 0 0 4px rgb(249 205 94 / 10%); }
.champ-prefixe > span { color: var(--texte-doux); font-weight: 700; font-size: 16px; }
.formulaire .champ-prefixe input { border: 0 !important; background: none !important; box-shadow: none !important; padding-left: 4px !important; height: 48px !important; }
.champ-mdp { position: relative; display: block; }
.champ-mdp input { padding-right: 84px !important; }
.champ-mdp .lien { position: absolute; right: 12px; top: 50%; translate: 0 -50%; font-size: 13px; }
.aide-champ { font-size: 12.5px; font-weight: 500; color: var(--texte-faible); }
.aide-champ.ok { color: var(--pos); }
.aide-champ.ko { color: var(--neg); }
.erreur { margin: 0; padding: 10px 12px; border-radius: 12px; background: var(--neg-fond); color: var(--neg); font-size: 14px; font-weight: 600; }
.message-mail { text-align: center; padding: 10px 0 6px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.message-mail h3 { margin: 0; font-family: var(--titre); font-size: 22px; }
.message-mail p { margin: 0 0 8px; max-width: 360px; }
.grande-icone { width: 72px; height: 72px; border-radius: 22px; display: grid; place-items: center; font-size: 34px; color: var(--or); background: rgb(249 205 94 / 10%); border: 1px solid rgb(249 205 94 / 25%); animation: badge-pop .6s var(--ressort); }

.choix-conflit { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 16px 0; }
.choix {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 16px 10px; text-align: center;
  border-radius: 18px; background: var(--surface); border: 1px solid var(--bordure); transition: border-color .2s, transform .15s var(--ressort);
}
.choix:hover { border-color: var(--bordure-forte); }
.choix:active { transform: scale(.97); }
.choix span:last-child { font-size: 13px; color: var(--texte-doux); }
.choix-icone { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; font-size: 22px; background: rgb(255 255 255 / 7%); }

/* Profil public */
.mode-public .dock, .mode-public .entete-actions { display: none; }
.mode-public .page { padding-bottom: 40px; }
.pub-tete { text-align: center; padding: 18px 0 8px; display: flex; flex-direction: column; align-items: center; }
.pub-tete h1 { margin: 16px 0 2px; font-family: var(--titre); font-size: 30px; letter-spacing: -.03em; }
.pub-tete p { margin: 0; }
.hero-public { text-align: center; margin-top: 14px; }
.hero-public .valeur { margin-bottom: 4px; }
.pub-cta { text-align: center; margin-top: 30px; padding: 22px 18px; border-radius: 22px; background: linear-gradient(120deg, rgb(249 205 94 / 12%), rgb(249 205 94 / 4%)); border: 1px solid rgb(249 205 94 / 22%); }
.pub-cta p { margin: 0 0 14px; font-family: var(--titre); font-size: 20px; font-weight: 700; }
.pub-chargement { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 40px 0; }
.squelette.rond { width: 96px; height: 96px; border-radius: 50%; aspect-ratio: 1; }
.pub-chargement .squelette-ligne { height: 14px; }
#pub-grille .case-bas { flex-direction: column; gap: 1px; }
#pub-grille .case-bas strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Rappel : créer un compte pour sauvegarder sa collection */
.rappel-compte {
  position: relative; display: flex; gap: 14px; align-items: flex-start; margin-top: 14px;
  padding: 16px 14px 16px 16px; border-radius: 20px;
  background: linear-gradient(135deg, rgb(249 205 94 / 13%), rgb(255 255 255 / 3%));
  border: 1px solid rgb(249 205 94 / 32%);
}
.rappel-icone {
  width: 44px; height: 44px; flex-shrink: 0; border-radius: 14px; display: grid; place-items: center;
  font-size: 22px; color: #0e0e14; background: var(--grad-or); box-shadow: 0 6px 18px -6px rgb(238 177 66 / 60%);
}
.rappel-texte { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; padding-right: 26px; }
.rappel-texte strong { font-family: var(--titre); font-size: 17px; letter-spacing: -.01em; }
.rappel-texte > span { font-size: 13.5px; line-height: 1.45; color: var(--texte-doux); }
.rappel-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 10px; }
.rappel-actions .btn { min-height: 40px; padding: 9px 16px; font-size: 14.5px; border-radius: 12px; }
.rappel-compte .bouton-rond { position: absolute; top: 10px; right: 10px; width: 30px; height: 30px; font-size: 14px; background: transparent; border-color: transparent; color: var(--texte-doux); }
.rappel-compte.part { animation: rappel-part .3s ease-in forwards; }
@keyframes rappel-part { to { opacity: 0; transform: translateY(-6px) scale(.98); } }

/* Scellé ouvert : lien vers les ouvertures */
.formulaire .option-ouvert {
  display: flex; flex-direction: row; align-items: center; gap: 12px; width: 100%; text-align: left;
  padding: 12px 14px; border-radius: 16px; cursor: pointer;
  background: linear-gradient(120deg, rgb(249 205 94 / 10%), rgb(238 155 58 / 5%)); border: 1px solid rgb(249 205 94 / 25%);
  color: var(--texte); font-size: 15px; transition: border-color .2s, transform .15s var(--ressort);
}
.option-ouvert:hover { border-color: rgb(249 205 94 / 45%); }
.bouton-ouvrir:active { transform: scale(.985); }
.option-icone { width: 40px; height: 40px; flex-shrink: 0; border-radius: 12px; display: grid; place-items: center; font-size: 21px; color: var(--or); background: rgb(249 205 94 / 12%); }
.option-texte { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.option-texte strong { font-size: 15px; }
.option-texte small { font-size: 12.5px; font-weight: 500; color: var(--texte-doux); line-height: 1.35; }
.option-ouvert input[type=checkbox] {
  appearance: none; -webkit-appearance: none; flex-shrink: 0; width: 46px !important; height: 28px !important; padding: 0 !important;
  border-radius: 999px !important; border: 0 !important; background: rgb(255 255 255 / 14%) !important; position: relative; cursor: pointer; transition: background .25s;
}
.option-ouvert input[type=checkbox]::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff;
  box-shadow: 0 2px 6px rgb(0 0 0 / 40%); transition: transform .3s var(--ressort);
}
.option-ouvert input[type=checkbox]:checked { background: linear-gradient(135deg, #f9cd5e, #eeb142) !important; }
.option-ouvert input[type=checkbox]:checked::after { transform: translateX(18px); }

/* Mobile : le dock est collé au bas de l'écran, sur toute la largeur.
   La zone de sécurité (barre d'accueil de l'iPhone) est incluse dans sa hauteur. */
@media (max-width: 639px) {
  .dock {
    left: 0; right: 0; bottom: 0; translate: none; width: 100%;
    height: calc(var(--dock-h) + var(--bas));
    padding: 0 8px var(--bas);
    border-radius: 22px 22px 0 0; border-width: 1px 0 0;
    background: rgb(14 16 28 / 92%);
    box-shadow: 0 -12px 30px -14px rgb(0 0 0 / 75%), inset 0 1px 0 rgb(255 255 255 / 6%);
  }
  .page { padding-bottom: calc(var(--dock-h) + var(--bas) + 28px); }
}

/* =========================================================
   Navigation mobile dynamique
   ========================================================= */
html, body { overscroll-behavior-y: contain; } /* pas de rechargement natif en tirant la page */
.page { touch-action: pan-y; transform: translateY(var(--tirer-page, 0px)); transition: transform .35s var(--ressort); min-height: calc(100dvh - 64px); }
.geste-tirer .page { transition: none; }
.puces-filtre, .sous-onglets { touch-action: pan-x pan-y; }

/* Entrée des pages et sous-onglets selon le sens de navigation */
.vue.glisse-d, .sous-vue.glisse-d { animation: entre-droite .42s cubic-bezier(.2,.85,.25,1) both; }
.vue.glisse-g, .sous-vue.glisse-g { animation: entre-gauche .42s cubic-bezier(.2,.85,.25,1) both; }
@keyframes entre-droite { from { opacity: 0; transform: translateX(34px); } to { opacity: 1; transform: none; } }
@keyframes entre-gauche { from { opacity: 0; transform: translateX(-34px); } to { opacity: 1; transform: none; } }

/* Rebond de l'icône du menu */
.dock-btn.rebond svg { animation: rebond .5s var(--ressort); }
@keyframes rebond { 0% { transform: scale(1); } 35% { transform: scale(1.3) translateY(-3px); } 70% { transform: scale(.94); } 100% { transform: translateY(-1px); } }
.dock-btn::after {
  content: ""; position: absolute; bottom: 7px; left: 50%; width: 4px; height: 4px; border-radius: 50%;
  background: var(--or); transform: translateX(-50%) scale(0); transition: transform .35s var(--ressort);
}
.dock-btn.actif::after { transform: translateX(-50%) scale(1); }
.dock-btn span { transition: color .25s, font-weight .25s; }

/* En-tête compact au défilement */
.entete { transition: padding .3s var(--doux), box-shadow .3s, background .3s; }
.entete .logo, .entete .mot { transition: transform .3s var(--doux); transform-origin: left center; }
.defile .entete { box-shadow: 0 12px 30px -18px rgb(0 0 0 / 90%); }

/* Tirer pour actualiser */
.tirer {
  position: fixed; z-index: 25; left: 50%; top: calc(64px + env(safe-area-inset-top, 0px));
  width: 46px; height: 46px; margin-left: -23px; border-radius: 50%;
  display: grid; place-items: center; pointer-events: none;
  background: var(--surface-plein); border: 1px solid var(--bordure-forte);
  box-shadow: 0 10px 26px -8px rgb(0 0 0 / 80%);
  opacity: var(--tirer-o, 0);
  transform: translateY(calc(var(--tirer-page, 0px) / 2 - 18px)) rotate(var(--tirer-rot, 0deg)) scale(calc(.6 + var(--tirer-o, 0) * .4));
  transition: transform .35s var(--ressort), opacity .25s, border-color .2s;
}
.tirer.tire { transition: border-color .2s; }
.tirer.pret { border-color: rgb(249 205 94 / 60%); }
.tirer-logo { width: 28px; height: 28px; }
.tirer.charge .tirer-logo { animation: tourne .9s linear infinite; }

@media (max-width: 639px) {
  .dock { transition: transform .38s cubic-bezier(.2,.85,.25,1); }
  .defile-bas .dock { transform: translateY(calc(100% + 20px)); }
  .defile .entete { padding-top: calc(6px + env(safe-area-inset-top, 0px)); padding-bottom: 6px; }
  .defile .entete .logo { transform: scale(.86); }
  .defile .entete .mot { transform: scale(.92); }
}
@media (prefers-reduced-motion: reduce) {
  .defile-bas .dock { transform: none; }
}

/* Recherche multilingue */
.resultat { position: relative; }
.etiquette-langue {
  position: absolute; top: 6px; right: 6px; padding: 1px 6px; border-radius: 6px;
  font-size: 10.5px; font-weight: 800; letter-spacing: .04em; color: #fff; background: rgb(59 91 219 / 85%);
}
.grille-cartes .voir-plus { grid-column: 1 / -1; display: flex; justify-content: center; padding: 6px 0 4px; }
.grille-cartes .voir-plus .btn { min-height: 42px; }

/* Cartes gradées */
.estimation {
  margin: -2px 0 0; padding: 10px 12px; border-radius: 12px; font-size: 13.5px; line-height: 1.45;
  background: rgb(249 205 94 / 7%); border: 1px solid rgb(249 205 94 / 22%); color: var(--texte-doux);
}
.estimation strong { color: var(--texte); font-size: 15px; }
.badge-grade {
  position: absolute; top: 6px; left: 6px; z-index: 3; padding: 2px 7px; border-radius: 6px;
  font-size: 11px; font-weight: 800; color: #0e0e14; background: var(--grad-or); box-shadow: 0 2px 8px rgb(0 0 0 / 45%);
}
.approx { color: var(--texte-doux); font-weight: 600; margin-right: 1px; }
.coefs { margin-top: 12px; }
.coefs[open] { gap: 10px; }
.coefs .sur-titre { margin: 6px 0 0; font-size: 11.5px; }
.grille-coefs { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.grille-coefs label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; font-weight: 600; color: var(--texte-doux); }
.grille-coefs input {
  width: 100%; height: 40px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--bordure);
  background: rgb(255 255 255 / 4%); color: var(--texte); font-size: 16px; font-variant-numeric: tabular-nums; outline: none;
}
.grille-coefs input:focus { border-color: rgb(249 205 94 / 55%); }

/* ---------- Cookies, contact, liens légaux ---------- */
.bandeau-cookies {
  position: fixed; z-index: 45; left: 50%; translate: -50% 0;
  bottom: calc(var(--dock-h) + var(--bas) + 22px);
  width: min(calc(100% - 20px), 460px);
  padding: 16px 16px 14px; border-radius: 22px;
  background: rgb(22 25 41 / 94%);
  backdrop-filter: blur(22px) saturate(160%); -webkit-backdrop-filter: blur(22px) saturate(160%);
  border: 1px solid var(--bordure-forte);
  box-shadow: 0 24px 50px -14px rgb(0 0 0 / 85%), inset 0 1px 0 rgb(255 255 255 / 6%);
  animation: cookies-monte .5s var(--ressort) both;
}
.bandeau-cookies.part { animation: cookies-part .26s ease-in forwards; }
@keyframes cookies-monte { from { opacity: 0; transform: translateY(24px) scale(.97); } }
@keyframes cookies-part { to { opacity: 0; transform: translateY(18px) scale(.98); } }
.cookies-titre { margin: 0 0 6px; display: flex; align-items: center; gap: 8px; font-family: var(--titre); font-size: 17px; font-weight: 700; letter-spacing: -.01em; }
.cookies-icone { font-size: 22px; animation: cookies-croque 2.8s ease-in-out 1s infinite; }
@keyframes cookies-croque { 0%, 80%, 100% { transform: none; } 86% { transform: rotate(-14deg) scale(1.1); } 93% { transform: rotate(10deg); } }
.cookies-texte { margin: 0 0 12px; font-size: 13.5px; line-height: 1.5; color: var(--texte-doux); }
.cookies-texte a { color: var(--or); font-weight: 600; }
.cookies-etat { margin: -4px 0 12px; font-size: 13px; font-weight: 600; color: var(--texte); }
.bandeau-cookies .rangee .btn { flex: 1; min-height: 44px; padding: 10px 14px; font-size: 15px; }
@media (max-width: 639px) {
  .bandeau-cookies { bottom: calc(var(--dock-h) + var(--bas) + 12px); }
}
@media (prefers-reduced-motion: reduce) {
  .bandeau-cookies, .cookies-icone { animation: none; }
}

.liens-legaux { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 16px; margin-top: 22px; }
.liens-legaux a, .liens-legaux button {
  border: 0; background: none; padding: 6px 0; font-size: 13px; font-weight: 600; color: var(--texte-doux); text-decoration: none;
  transition: color .2s;
}
.liens-legaux a:hover, .liens-legaux button:hover { color: var(--texte); }

.formulaire .case-accord { flex-direction: row; align-items: flex-start; gap: 10px; font-size: 13.5px; font-weight: 500; line-height: 1.45; cursor: pointer; }
.case-accord a { color: var(--or); font-weight: 600; }
.case-accord input {
  appearance: none; -webkit-appearance: none; flex-shrink: 0; width: 22px; height: 22px; margin: 0; border-radius: 7px;
  border: 1.5px solid var(--bordure-forte); background: rgb(255 255 255 / 4%); display: grid; place-items: center; cursor: pointer;
  transition: background .2s, border-color .2s;
}
.case-accord input::after { content: ""; width: 10px; height: 6px; border: solid #0e0e14; border-width: 0 0 2.5px 2.5px; rotate: -45deg; translate: 0 -1px; scale: 0; transition: scale .25s var(--ressort); }
.case-accord input:checked { background: var(--grad-or); border-color: transparent; }
.case-accord input:checked::after { scale: 1; }

.formulaire textarea {
  width: 100%; min-height: 120px; padding: 12px 14px; border-radius: 14px; resize: vertical;
  border: 1px solid var(--bordure); background: rgb(255 255 255 / 4%); outline: none;
  font: inherit; font-size: 16px; font-weight: 500; color: var(--texte); line-height: 1.45;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.formulaire textarea:focus { border-color: rgb(249 205 94 / 55%); box-shadow: 0 0 0 4px rgb(249 205 94 / 10%); background: rgb(255 255 255 / 6%); }
.formulaire textarea::placeholder { color: var(--texte-faible); }
.facultatif { font-weight: 500; color: var(--texte-faible); }
.formulaire .piege { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Scanner de cartes ---------- */
.btn-scanner { width: 100%; margin-top: 10px; }
.btn-scanner svg { color: var(--or); }
.scanner {
  position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none;
  margin: 0; padding: 0; border: 0; background: #000; color: #fff; overflow: hidden;
}
.scanner::backdrop { background: #000; }
.scanner[open] { animation: fondu .25s ease; }
.scanner.ferme { animation: fondu .2s ease reverse forwards; }
.scanner:focus { outline: none; }
#scan-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #000; }
.scan-voile { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; padding-bottom: 12dvh; }
.scan-cadre {
  position: relative; width: min(74vw, 330px, calc(56dvh * 63 / 88)); aspect-ratio: 63 / 88; border-radius: 16px;
  box-shadow: 0 0 0 200vmax rgb(0 0 0 / 58%); border: 2px solid rgb(255 255 255 / 55%);
  transition: border-color .25s, transform .3s var(--ressort);
}
.scan-cadre::before, .scan-cadre::after {
  content: ""; position: absolute; inset: -6px; border-radius: 20px; pointer-events: none;
  border: 4px solid var(--or);
  -webkit-mask: conic-gradient(#000 0 0) top left / 34px 34px no-repeat, conic-gradient(#000 0 0) top right / 34px 34px no-repeat, conic-gradient(#000 0 0) bottom left / 34px 34px no-repeat, conic-gradient(#000 0 0) bottom right / 34px 34px no-repeat;
  mask: conic-gradient(#000 0 0) top left / 34px 34px no-repeat, conic-gradient(#000 0 0) top right / 34px 34px no-repeat, conic-gradient(#000 0 0) bottom left / 34px 34px no-repeat, conic-gradient(#000 0 0) bottom right / 34px 34px no-repeat;
}
.scan-cadre::after { opacity: 0; transition: opacity .3s; border-color: var(--pos); }
.scan-cadre.lu { border-color: rgb(249 205 94 / 85%); }
.scan-cadre.trouve { border-color: var(--pos); transform: scale(1.02); }
.scan-cadre.trouve::after { opacity: 1; }
.scan-zone { position: absolute; left: 3%; right: 3%; border: 1.5px dashed rgb(255 255 255 / 35%); border-radius: 8px; }
.scan-zone span { position: absolute; left: 8px; font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: rgb(255 255 255 / 70%); }
.scan-zone-nom { top: 2%; height: 10%; right: 20%; }
.scan-zone-nom span { top: calc(100% + 4px); }
.scan-zone-num { bottom: 1.5%; height: 12%; }
.scan-zone-num span { bottom: calc(100% + 4px); }
.scan-cadre.lu .scan-zone-num { border-color: var(--or); border-style: solid; background: rgb(249 205 94 / 10%); }
.scan-laser {
  position: absolute; left: 4%; right: 4%; top: 8%; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--or), transparent); box-shadow: 0 0 14px 2px rgb(249 205 94 / 60%);
  animation: laser 2.2s ease-in-out infinite alternate;
}
.scan-cadre.trouve .scan-laser { display: none; }
@keyframes laser { to { top: 92%; } }
.scan-haut {
  position: absolute; top: 0; left: 0; right: 0; z-index: 2; display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; gap: 10px;
  padding: calc(12px + env(safe-area-inset-top, 0px)) 14px 12px;
  background: linear-gradient(rgb(0 0 0 / 60%), transparent);
}
.scan-haut .bouton-rond { background: rgb(0 0 0 / 45%); border-color: rgb(255 255 255 / 18%); color: #fff; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.scan-haut .bouton-rond[aria-pressed="true"] { background: var(--or); color: var(--noir-logo); }
.scan-titre { margin: 0; text-align: center; font-family: var(--titre); font-weight: 700; font-size: 17px; }
.scan-haut #scan-torche { grid-column: 3; }
.scan-bas {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; display: flex; flex-direction: column; gap: 10px; align-items: center;
  padding: 16px 16px calc(16px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(transparent, rgb(0 0 0 / 70%) 30%);
}
.scan-bas > * { width: 100%; max-width: 460px; }
.scan-etat { margin: 0; text-align: center; font-size: 14.5px; font-weight: 600; color: rgb(255 255 255 / 88%); text-shadow: 0 1px 8px rgb(0 0 0 / 80%); }
.scan-etat.ok { color: var(--or); }
.scan-etat.alerte { color: #ffc2ca; }
.scan-compteur { margin: 0; text-align: center; font-size: 13px; font-weight: 700; color: var(--pos); }
.scan-actions .btn { flex: 1; min-height: 46px; background: rgb(22 25 41 / 85%); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.scan-resultats {
  padding: 10px; border-radius: 20px; background: rgb(22 25 41 / 94%); border: 1px solid var(--bordure-forte);
  box-shadow: 0 -10px 40px rgb(0 0 0 / 60%); max-height: 46dvh; overflow-y: auto;
}
.scan-resultats ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.scan-choix {
  width: 100%; display: flex; align-items: center; gap: 12px; padding: 8px 12px 8px 8px; text-align: left;
  border-radius: 14px; border: 1px solid var(--bordure); background: var(--surface); color: var(--texte);
  transition: background .2s, transform .15s var(--ressort);
}
.scan-choix:active { transform: scale(.98); }
.scan-choix:hover { background: var(--surface-2); }
.scan-choix img, .scan-choix .sans-image { width: 46px; aspect-ratio: 63 / 88; border-radius: 5px; object-fit: cover; background: var(--surface-haut); flex-shrink: 0; }
.scan-choix-texte { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.scan-choix-texte strong { font-size: 15.5px; }
.scan-choix-texte small { color: var(--texte-doux); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scan-choix > svg { width: 34px; height: 34px; padding: 8px; border-radius: 11px; background: var(--grad-or); color: var(--noir-logo); flex-shrink: 0; }
.scan-resultats .lien { display: block; margin: 6px auto 0; font-size: 13.5px; }
@media (prefers-reduced-motion: reduce) { .scan-laser { animation: none; top: 50%; } }

/* Accueil de bienvenue : masqué avant le premier affichage si une collection existe déjà (voir index.html). */
.a-collection #vide { display: none; }
.guides { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; max-width: 420px; margin: 26px auto 0; }
.guides .sur-titre { width: 100%; text-align: center; margin-bottom: 2px; }
.guides a {
  padding: 8px 14px; border-radius: 999px; font-size: 13.5px; font-weight: 600; text-decoration: none;
  color: var(--texte-doux); background: var(--surface); border: 1px solid var(--bordure); transition: color .2s, border-color .2s;
}
.guides a:hover { color: var(--texte); border-color: rgb(249 205 94 / 40%); }
.liens-legaux + .liens-legaux { margin-top: 0; }
