/* ============================================================
   DRAVOO PLAY — FEUILLE DE STYLE PRINCIPALE
   ============================================================
   Identité : « carnet de quêtes nocturne ».
   - Fond encre violette avec une trame de points (carte de jeu).
   - Deux polices : Unbounded (titres, chiffres) et Manrope (texte).
   - Élément signature : le « ticket » doré de récompense (.stub)
     et la piste d'objectifs (.track). Tout le reste reste sobre.

   Les 3 couleurs de marque viennent de theme.css.php (réglages
   admin) : --color-primary, --color-secondary, --color-accent.
   Tout le reste se règle ci-dessous dans :root.

   Sommaire
     1. Polices            7. Ticket de récompense & pistes
     2. Variables          8. Catalogue et cartes d'offres
     3. Base               9. Page offre
     4. Mise en page      10. Portefeuille, historique
     5. Navigation        11. Accueil (visiteurs)
     6. Composants        12. Utilitaires & accessibilité
   ============================================================ */

/* ---------- 1. Polices (hébergées sur le site : aucun appel externe) ---------- */
@font-face { font-family: "Unbounded"; font-style: normal; font-weight: 600; font-display: swap;
    src: url("../fonts/unbounded-latin-600-normal.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Unbounded"; font-style: normal; font-weight: 600; font-display: swap;
    src: url("../fonts/unbounded-latin-ext-600-normal.woff2") format("woff2");
    unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Unbounded"; font-style: normal; font-weight: 800; font-display: swap;
    src: url("../fonts/unbounded-latin-800-normal.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Unbounded"; font-style: normal; font-weight: 800; font-display: swap;
    src: url("../fonts/unbounded-latin-ext-800-normal.woff2") format("woff2");
    unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Manrope"; font-style: normal; font-weight: 400; font-display: swap;
    src: url("../fonts/manrope-latin-400-normal.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Manrope"; font-style: normal; font-weight: 400; font-display: swap;
    src: url("../fonts/manrope-latin-ext-400-normal.woff2") format("woff2");
    unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Manrope"; font-style: normal; font-weight: 600; font-display: swap;
    src: url("../fonts/manrope-latin-600-normal.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Manrope"; font-style: normal; font-weight: 600; font-display: swap;
    src: url("../fonts/manrope-latin-ext-600-normal.woff2") format("woff2");
    unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Manrope"; font-style: normal; font-weight: 800; font-display: swap;
    src: url("../fonts/manrope-latin-800-normal.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Manrope"; font-style: normal; font-weight: 800; font-display: swap;
    src: url("../fonts/manrope-latin-ext-800-normal.woff2") format("woff2");
    unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

/* ---------- 2. Variables ---------- */
:root {
    /* Fonds (encre violette, jamais un noir neutre) */
    --ink: #120E24;
    --ink-2: #1A1533;          /* panneaux */
    --ink-3: #241D45;          /* éléments surélevés, survol */
    --line: #342B60;           /* bordures */
    --line-soft: #2A2350;
    --input: #0F0B1F;

    /* Textes */
    --text: #F4F1FF;
    --text-2: #C9C2EC;
    --muted: #9C93C6;

    /* États */
    --danger: #FF6B86;
    --warning: #FFC94D;
    --success: #3EE6B5;
    --info: #79B8FF;

    /* Formes : rayons différents selon la hiérarchie */
    --r-xs: 6px;      /* étiquettes */
    --r-sm: 10px;     /* champs, boutons */
    --r-md: 16px;     /* cartes d'offres */
    --r-lg: 24px;     /* grands panneaux */

    /* Typographie (échelle 1,25) */
    --font-display: "Unbounded", "Arial Black", system-ui, sans-serif;
    --font-body: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --fs-xs: 0.8rem;
    --fs-sm: 0.875rem;
    --fs-md: 1rem;
    --fs-lg: 1.25rem;
    --fs-xl: 1.563rem;
    --fs-2xl: 1.953rem;
    --fs-3xl: 2.441rem;
    --fs-4xl: clamp(2.2rem, 6vw, 3.815rem);

    /* Espacements */
    --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 72px;
    --container: 1240px;
    --topbar-h: 68px;
    --tabbar-h: 64px;

    --ease: cubic-bezier(.2, .7, .2, 1);
}

/* ---------- 3. Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--topbar-h) + 16px); }

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    color: var(--text);
    font-family: var(--font-body);
    font-size: var(--fs-md);
    line-height: 1.6;
    background-color: var(--ink);
    /* Trame de points discrète, comme une carte de jeu */
    background-image: radial-gradient(rgb(255 255 255 / 0.045) 1px, transparent 1.2px);
    background-size: 22px 22px;
}

a { color: var(--color-secondary); text-decoration: none; text-underline-offset: 3px; }
a:hover { text-decoration: underline; }

h1, h2, h3 { font-family: var(--font-display); font-weight: 800; line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 var(--s3); text-wrap: balance; }
h1 { font-size: var(--fs-2xl); }
h2 { font-size: var(--fs-lg); }
h3 { font-size: var(--fs-md); font-weight: 600; letter-spacing: 0; }
p  { margin: 0 0 var(--s4); max-width: 68ch; }

img { max-width: 100%; height: auto; display: block; }
[hidden] { display: none !important; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.icon { width: 20px; height: 20px; flex: none; }

:focus-visible { outline: 2px solid var(--color-secondary); outline-offset: 3px; border-radius: 4px; }

/* ---------- 4. Mise en page ---------- */
.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 var(--s4); }
.container.narrow { max-width: 460px; }
.container.medium { max-width: 780px; }

.page { flex: 1; padding: var(--s6) 0 var(--s8); }

.page-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: var(--s4); margin-bottom: var(--s5); }
.page-head h1 { margin: 0; }
.page-head p { margin: var(--s1) 0 0; color: var(--muted); }

.grid { display: grid; gap: var(--s4); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.stack > * + * { margin-top: var(--s4); }
.section { margin-top: var(--s7); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s4); margin-bottom: var(--s4); }
.section-head h2 { margin: 0; }

/* ---------- 5. Navigation ---------- */
.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { left: 16px; top: 16px; z-index: 100; background: var(--ink-2); padding: 8px 12px; border-radius: var(--r-sm); }

.topbar {
    position: sticky; top: 0; z-index: 50;
    background: rgb(18 14 36 / 0.88);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line-soft);
}
.topbar-inner { display: flex; align-items: center; gap: var(--s5); min-height: var(--topbar-h); }

.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-family: var(--font-display); font-weight: 800; font-size: 1.05rem; letter-spacing: -0.02em; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand-logo { height: 34px; width: auto; }
/* Marque : un « jeton » carré tourné à 45°, aux couleurs du thème */
.brand-mark {
    width: 22px; height: 22px; margin: 0 4px;
    border-radius: 6px;
    transform: rotate(45deg);
    background: linear-gradient(135deg, var(--color-primary) 0 50%, var(--color-secondary) 50% 100%);
    box-shadow: 0 0 0 3px var(--ink), 0 0 0 4px var(--color-accent);
}

.main-nav { display: flex; align-items: center; gap: 2px; }
.nav-link {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 8px 12px; border-radius: var(--r-sm);
    color: var(--muted); font-weight: 600; font-size: var(--fs-sm);
}
.nav-link .icon { width: 18px; height: 18px; }
.nav-link:hover { color: var(--text); background: var(--ink-3); text-decoration: none; }
.nav-link.is-active { color: var(--text); background: var(--ink-3); box-shadow: inset 0 -2px 0 var(--color-primary); }

.nav-end { margin-left: auto; display: flex; align-items: center; gap: var(--s3); }

.lang-switch { display: flex; padding: 3px; border: 1px solid var(--line); border-radius: var(--r-sm); }
.lang-link { padding: 3px 8px; border-radius: 7px; font-size: var(--fs-xs); font-weight: 800; color: var(--muted); }
.lang-link.is-active { background: var(--ink-3); color: var(--text); }
.lang-link:hover { text-decoration: none; color: var(--text); }

.balance-chip {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 6px 14px 6px 8px; border-radius: 999px;
    background: rgb(var(--rgb-accent) / 0.12);
    border: 1px solid rgb(var(--rgb-accent) / 0.4);
    color: var(--text); font-family: var(--font-display); font-weight: 600; font-size: var(--fs-sm);
}
.balance-chip:hover { text-decoration: none; border-color: var(--color-accent); }

.nav-admin { display: inline-flex; align-items: center; gap: 6px; color: var(--color-accent); font-weight: 700; font-size: var(--fs-sm); }

.avatar {
    width: 38px; height: 38px; border-radius: 50%;
    display: grid; place-items: center;
    background: var(--ink-3); border: 1px solid var(--line);
    color: var(--text); font-family: var(--font-display); font-weight: 800; font-size: var(--fs-sm);
}
.avatar:hover, .avatar.is-active { border-color: var(--color-primary); text-decoration: none; }

/* Pièce : utilisée partout où des points apparaissent */
.coin {
    display: inline-block; flex: none;
    width: 1em; height: 1em; border-radius: 50%;
    background:
        radial-gradient(circle at 32% 30%, rgb(255 255 255 / 0.75) 0 12%, transparent 13%),
        radial-gradient(circle, transparent 0 52%, rgb(0 0 0 / 0.18) 53% 60%, transparent 61%),
        var(--color-accent);
    box-shadow: inset 0 -2px 0 rgb(0 0 0 / 0.2);
}

/* Barre d'onglets (mobile, membres connectés) */
.tabbar { display: none; }

@media (max-width: 860px) {
    .main-nav, .nav-admin span { display: none; }
    .topbar-inner { gap: var(--s3); }
    .brand-name { font-size: 0.95rem; }
    body.has-tabbar .page { padding-bottom: calc(var(--tabbar-h) + var(--s7)); }
    body.has-tabbar .site-footer { padding-bottom: calc(var(--tabbar-h) + var(--s5)); }
    .tabbar {
        display: grid; grid-template-columns: repeat(4, 1fr);
        position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
        height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
        padding-bottom: env(safe-area-inset-bottom);
        background: rgb(26 21 51 / 0.96);
        backdrop-filter: blur(14px);
        border-top: 1px solid var(--line);
    }
    .tab {
        display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
        color: var(--muted); font-size: 0.72rem; font-weight: 700;
    }
    .tab .icon { width: 22px; height: 22px; }
    .tab:hover { text-decoration: none; color: var(--text); }
    .tab.is-active { color: var(--text); }
    .tab.is-active .icon { color: var(--color-secondary); }
}
@media (max-width: 480px) {
    .brand-name { display: none; }
    body:not(.has-tabbar) .brand-name { display: inline; }
    body:not(.has-tabbar) .nav-end .btn-ghost { display: none; } /* « Connexion » reste dans la page */
}

/* ---------- 6. Composants ---------- */

/* Boutons */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 46px; padding: 10px 20px;
    border: 1px solid transparent; border-radius: var(--r-sm);
    font: inherit; font-weight: 800; font-size: var(--fs-sm); line-height: 1.2;
    color: var(--text); background: var(--ink-3);
    cursor: pointer; text-decoration: none; white-space: nowrap;
    transition: background-color .15s var(--ease), border-color .15s var(--ease), transform .1s var(--ease);
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn.is-disabled { opacity: .45; cursor: not-allowed; transform: none; pointer-events: none; }
.btn .icon { width: 18px; height: 18px; }
.btn-primary { background: var(--color-primary); box-shadow: 0 6px 20px rgb(var(--rgb-primary) / 0.35), inset 0 1px 0 rgb(255 255 255 / 0.18); }
.btn-primary:hover { background: color-mix(in srgb, var(--color-primary) 88%, white); }
.btn-ghost { background: transparent; border-color: var(--line); }
.btn-ghost:hover { border-color: var(--muted); background: var(--ink-3); }
.btn-gold { background: var(--color-accent); color: #2A1B00; }
.btn-gold:hover { background: color-mix(in srgb, var(--color-accent) 88%, white); }
.btn-block { width: 100%; }
.btn-sm { min-height: 38px; padding: 6px 14px; }
.btn-lg { min-height: 54px; padding: 12px 28px; font-size: var(--fs-md); }

/* Panneaux */
.panel {
    background: var(--ink-2);
    border: 1px solid var(--line-soft);
    border-radius: var(--r-lg);
    padding: var(--s5);
}
.panel-tight { padding: var(--s4); }
.card { background: var(--ink-2); border: 1px solid var(--line-soft); border-radius: var(--r-lg); padding: var(--s5); }
.card-title { margin-top: 0; }

/* Étiquettes */
.tag {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 2px 8px; border-radius: var(--r-xs);
    background: var(--ink-3); color: var(--text-2);
    font-size: var(--fs-xs); font-weight: 700; line-height: 1.6;
}
.tag .icon { width: 14px; height: 14px; }
.tag-demo { background: rgb(var(--rgb-accent) / 0.16); color: var(--color-accent); }

/* Pastilles de statut */
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: var(--fs-xs); font-weight: 800; white-space: nowrap; }
.pill-available, .pill-paid, .pill-approved { background: rgb(62 230 181 / 0.14); color: var(--success); }
.pill-pending { background: rgb(255 201 77 / 0.14); color: var(--warning); }
.pill-review { background: rgb(121 184 255 / 0.14); color: var(--info); }
.pill-cancelled, .pill-rejected { background: rgb(255 107 134 / 0.14); color: var(--danger); }

/* Formulaires */
.form { display: grid; gap: 18px; }
.field { display: grid; gap: 6px; }
.field label { font-weight: 700; font-size: var(--fs-sm); }
.field .hint { color: var(--muted); font-size: var(--fs-xs); }
.input, .select {
    width: 100%; min-height: 48px; padding: 10px 14px;
    border: 1px solid var(--line); border-radius: var(--r-sm);
    background: var(--input); color: var(--text); font: inherit;
    transition: border-color .15s, box-shadow .15s;
}
.select { appearance: none; padding-right: 36px;
    background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
    background-position: calc(100% - 18px) 21px, calc(100% - 13px) 21px; background-size: 5px 5px; background-repeat: no-repeat; }
.input:focus, .select:focus { outline: none; border-color: var(--color-primary); box-shadow: 0 0 0 3px rgb(var(--rgb-primary) / 0.3); }
.input[disabled] { opacity: .5; }
.checkbox { display: flex; gap: 10px; align-items: flex-start; font-size: var(--fs-sm); }
.checkbox input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--color-primary); flex: none; }
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-footer { text-align: center; color: var(--muted); font-size: var(--fs-sm); margin: var(--s4) auto 0; }

/* Alertes */
.flash-stack { margin-top: var(--s4); display: grid; gap: var(--s2); }
.alert { padding: 12px 16px; border-radius: var(--r-sm); border: 1px solid; font-size: var(--fs-sm); }
.alert ul { margin: 0; padding-left: 18px; }
.alert-success { border-color: rgb(62 230 181 / 0.4); background: rgb(62 230 181 / 0.08); }
.alert-error   { border-color: rgb(255 107 134 / 0.45); background: rgb(255 107 134 / 0.08); }
.alert-warning { border-color: rgb(255 201 77 / 0.45); background: rgb(255 201 77 / 0.08); }
.alert-info    { border-color: rgb(121 184 255 / 0.4); background: rgb(121 184 255 / 0.08); }

/* Bandeau démo */
.demo-banner {
    display: flex; gap: var(--s3); align-items: flex-start;
    padding: var(--s3) var(--s4); margin-bottom: var(--s5);
    border-radius: var(--r-sm);
    border: 1px dashed rgb(var(--rgb-accent) / 0.6);
    background: rgb(var(--rgb-accent) / 0.07);
    color: var(--text-2); font-size: var(--fs-sm);
}
.demo-banner .icon { color: var(--color-accent); margin-top: 2px; }

/* Écran vide */
.empty { text-align: center; padding: var(--s7) var(--s4); }
.empty-icon { width: 44px; height: 44px; color: var(--muted); margin-bottom: var(--s3); }
.empty h3 { font-size: var(--fs-lg); font-weight: 800; }
.empty p { margin: 0 auto var(--s4); }

/* Pagination */
.pager { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: var(--s3); margin-top: var(--s6); }
.pager > :last-child { justify-self: end; }
.pager-info { color: var(--muted); font-size: var(--fs-sm); }

/* Accordéon (FAQ) */
.faq { border-top: 1px solid var(--line-soft); }
.faq details { border-bottom: 1px solid var(--line-soft); }
.faq summary {
    cursor: pointer; list-style: none;
    display: flex; justify-content: space-between; align-items: center; gap: var(--s4);
    padding: var(--s4) 0; font-weight: 800;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-family: var(--font-display); color: var(--muted); font-size: 1.2rem; transition: transform .2s var(--ease); }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { color: var(--text-2); padding-bottom: var(--s4); margin: 0; }

/* ---------- 7. Ticket de récompense & pistes d'objectifs ---------- */

/* Le ticket : bloc doré à encoches latérales. Élément signature. */
.stub {
    --notch: 7px;
    position: relative;
    display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 8px 18px;
    border-radius: 8px;
    background: var(--color-accent);
    color: #2A1B00;
    line-height: 1.1;
    /* Encoches demi-cercles à gauche et à droite */
    -webkit-mask: radial-gradient(circle var(--notch) at 0 50%, transparent 98%, #000) left / 51% 100% no-repeat,
                  radial-gradient(circle var(--notch) at 100% 50%, transparent 98%, #000) right / 51% 100% no-repeat;
            mask: radial-gradient(circle var(--notch) at 0 50%, transparent 98%, #000) left / 51% 100% no-repeat,
                  radial-gradient(circle var(--notch) at 100% 50%, transparent 98%, #000) right / 51% 100% no-repeat;
}
.stub::after { /* ligne pointillée de découpe */
    content: ""; position: absolute; top: 6px; bottom: 6px; left: 8px; right: 8px;
    border-left: 1.5px dashed rgb(42 27 0 / 0.25); border-right: 1.5px dashed rgb(42 27 0 / 0.25);
    pointer-events: none;
}
.stub-prefix { font-size: 0.68rem; font-weight: 800; opacity: .75; }
.stub-value { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-display); font-weight: 800; font-size: 1.05rem; letter-spacing: -0.02em; white-space: nowrap; }
.stub .coin { background: radial-gradient(circle at 32% 30%, rgb(255 255 255 / 0.8) 0 12%, transparent 13%), #2A1B00; width: .8em; height: .8em; box-shadow: none; }
.stub-lg { --notch: 10px; padding: 14px 30px; border-radius: 12px; }
.stub-lg .stub-value { font-size: var(--fs-2xl); }
.stub-lg .stub-prefix { font-size: var(--fs-xs); }

/* Mini-piste sur les cartes : un nœud par objectif */
.mini-track { display: inline-flex; align-items: center; gap: 0; }
.mini-node { width: 7px; height: 7px; border-radius: 50%; background: var(--color-secondary); }
.mini-node + .mini-node { margin-left: 8px; position: relative; }
.mini-node + .mini-node::before { content: ""; position: absolute; right: 7px; top: 3px; width: 8px; height: 1px; background: rgb(var(--rgb-secondary) / 0.5); }
.mini-label { margin-left: 8px; font-size: var(--fs-xs); color: var(--muted); font-weight: 700; }

/* Grande piste verticale (page offre) */
.track { list-style: none; margin: 0; padding: 0; counter-reset: goal; }
.track-step {
    position: relative;
    display: grid; grid-template-columns: 36px 1fr auto; align-items: center; gap: var(--s3);
    padding: var(--s3) 0;
}
.track-step::before { /* ligne qui relie les étapes */
    content: ""; position: absolute; left: 17px; top: 0; bottom: 0; width: 2px;
    background: linear-gradient(var(--line), var(--line));
}
.track-step:first-child::before { top: 50%; }
.track-step:last-child::before { bottom: 50%; }
.track-step:only-child::before { display: none; }
.track-node {
    position: relative; z-index: 1;
    width: 36px; height: 36px; border-radius: 50%;
    display: grid; place-items: center;
    background: var(--ink); border: 2px solid var(--color-secondary);
    font-family: var(--font-display); font-weight: 800; font-size: var(--fs-xs); color: var(--color-secondary);
}
.track-step:last-child .track-node { border-color: var(--color-accent); color: var(--color-accent); }
.track-name { font-weight: 700; }
.track-points { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-display); font-weight: 600; font-size: var(--fs-sm); color: var(--color-accent); white-space: nowrap; }
.track-points.is-unknown { font-family: var(--font-body); font-weight: 600; color: var(--muted); font-size: var(--fs-xs); }

/* ---------- 8. Catalogue et cartes d'offres ---------- */
.catalog { display: grid; grid-template-columns: 250px 1fr; gap: var(--s6); align-items: start; }
.catalog > * { min-width: 0; } /* empêche les puces défilantes d'élargir la page */

.filters { position: sticky; top: calc(var(--topbar-h) + var(--s4)); display: grid; gap: var(--s5); }
.filters-toggle { display: none; }
.filter-group h2 { font-family: var(--font-body); font-size: var(--fs-sm); font-weight: 800; color: var(--muted); letter-spacing: 0; margin-bottom: var(--s2); }
.filter-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.filter-link {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 12px; border-radius: var(--r-sm);
    color: var(--text-2); font-weight: 600; font-size: var(--fs-sm);
}
.filter-link .icon { width: 18px; height: 18px; color: var(--muted); }
.filter-link .count { margin-left: auto; color: var(--muted); font-size: var(--fs-xs); font-weight: 700; }
.filter-link:hover { background: var(--ink-2); text-decoration: none; color: var(--text); }
.filter-link.is-active { background: var(--ink-3); color: var(--text); }
.filter-link.is-active .icon { color: var(--color-secondary); }

.toolbar { display: flex; flex-wrap: wrap; gap: var(--s3); align-items: center; margin-bottom: var(--s4); }
.search { position: relative; flex: 1 1 260px; }
.search .icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search .input { padding-left: 44px; }
.toolbar .select { width: auto; min-width: 190px; }
.segmented { display: inline-flex; padding: 3px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--input); }
.segmented a { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 7px; color: var(--muted); }
.segmented a.is-active { background: var(--ink-3); color: var(--text); }
.segmented a:hover { color: var(--text); text-decoration: none; }
.result-count { color: var(--muted); font-size: var(--fs-sm); margin: 0 0 var(--s4); }

/* Puces de catégories (mobile) */
.chips { display: none; gap: var(--s2); overflow-x: auto; padding-bottom: var(--s2); margin-bottom: var(--s3); scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
    flex: none; display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 14px; border-radius: 999px;
    border: 1px solid var(--line); color: var(--text-2); font-weight: 700; font-size: var(--fs-sm);
}
.chip .icon { width: 16px; height: 16px; }
.chip.is-active { background: var(--text); color: var(--ink); border-color: var(--text); }
.chip:hover { text-decoration: none; }

/* Cartes d'offres — mode grille */
.offer-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: var(--s4); }
.offer-card { position: relative; }
.offer-link {
    height: 100%;
    display: flex; flex-direction: column;
    background: var(--ink-2);
    border: 1px solid var(--line-soft);
    border-radius: var(--r-md);
    padding: var(--s3);
    color: var(--text);
    transition: border-color .15s var(--ease), background-color .15s var(--ease);
}
.offer-link:hover { text-decoration: none; border-color: var(--line); background: var(--ink-3); }
.offer-link:focus-visible { outline-offset: 2px; border-radius: var(--r-md); }
.offer-card .thumb { width: 100%; aspect-ratio: 4 / 3; height: auto; border-radius: 12px; }
.offer-body { display: flex; flex-direction: column; gap: 6px; flex: 1; padding: var(--s3) var(--s1) var(--s3); }
.offer-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.offer-title { font-family: var(--font-display); font-weight: 600; font-size: 1.02rem; line-height: 1.25; letter-spacing: -0.01em; }
.offer-desc { color: var(--muted); font-size: var(--fs-sm); line-height: 1.45;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.offer-foot { margin-top: auto; padding-top: 6px; display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3); }
.offer-note { font-size: var(--fs-xs); color: var(--warning); font-weight: 700; }
.offer-card .stub { align-self: stretch; }
.offer-card.is-other-device .thumb { opacity: .55; }

/* Plateformes */
.platforms { display: inline-flex; gap: 6px; color: var(--muted); }
.platform { display: inline-flex; }
.platform .icon { width: 17px; height: 17px; }

/* Vignettes de repli (initiale sur fond coloré) */
.thumb { object-fit: cover; background: var(--ink-3); }
.thumb-fallback {
    display: grid; place-items: center;
    font-family: var(--font-display); font-weight: 800; font-size: 2.6rem; color: rgb(255 255 255 / 0.92);
}
.thumb-sm { width: 52px; height: 52px; border-radius: 12px; }
.thumb-sm.thumb-fallback { font-size: 1.2rem; }
.thumb-lg { width: 128px; height: 128px; border-radius: 26px; }
.thumb-hue-0 { background: linear-gradient(140deg, #6D5BFF, #3B2F9E); }
.thumb-hue-1 { background: linear-gradient(140deg, #18B79A, #0F5F63); }
.thumb-hue-2 { background: linear-gradient(140deg, #FF8A5B, #B03A55); }
.thumb-hue-3 { background: linear-gradient(140deg, #4EA8FF, #2A3FA8); }
.thumb-hue-4 { background: linear-gradient(140deg, #E36BD2, #6A2D8F); }
.thumb-hue-5 { background: linear-gradient(140deg, #C9A227, #6E5413); }

/* Cartes d'offres — mode liste */
.offer-list { display: grid; gap: var(--s2); }
.offer-list .offer-link { flex-direction: row; align-items: center; gap: var(--s4); padding: var(--s3) var(--s4); }
.offer-list .thumb { width: 64px; height: 64px; aspect-ratio: auto; flex: none; border-radius: 14px; }
.offer-list .thumb-fallback { font-size: 1.5rem; }
.offer-list .offer-body { padding: 0; gap: 4px; }
.offer-list .offer-desc { -webkit-line-clamp: 1; }
.offer-list .offer-foot { padding-top: 2px; }
.offer-list .offer-card .stub { align-self: center; min-width: 120px; }

@media (max-width: 960px) {
    .catalog { grid-template-columns: 1fr; }
    .filters { position: static; display: none; }
    .filters.is-open { display: grid; padding: var(--s4); background: var(--ink-2); border: 1px solid var(--line-soft); border-radius: var(--r-md); margin-bottom: var(--s4); }
    .filters-toggle { display: inline-flex; }
    .chips { display: flex; }
}
@media (max-width: 560px) {
    .offer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s3); }
    .offer-grid .offer-desc { display: none; }
    .offer-grid .offer-title { font-size: .92rem; }
    .offer-grid .offer-link { padding: 10px; }
    .offer-grid .offer-body { padding: 10px 2px; }
    .offer-grid .mini-label { display: none; }
    .offer-grid .stub-value { font-size: .95rem; }
    .offer-list .offer-link { flex-wrap: wrap; }
    .offer-list .offer-body { flex: 1 1 calc(100% - 90px); }
    .offer-list .offer-card .stub { flex-direction: row; gap: 8px; width: 100%; }
    .toolbar .select { flex: 1; min-width: 0; }
}

/* ---------- 9. Page offre ---------- */
.back-link { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-weight: 700; font-size: var(--fs-sm); margin-bottom: var(--s4); }
.back-link .icon { width: 16px; height: 16px; }

.offer-hero { display: grid; grid-template-columns: auto 1fr auto; gap: var(--s5); align-items: center; }
.offer-hero h1 { font-size: var(--fs-3xl); margin-bottom: var(--s2); }
.offer-hero .offer-meta { margin-bottom: var(--s3); }
.offer-hero-reward { text-align: center; }
.offer-hero-reward .hint { display: block; margin-top: var(--s2); font-size: var(--fs-xs); color: var(--muted); max-width: 22ch; }

.offer-layout { display: grid; grid-template-columns: 1fr 340px; gap: var(--s5); margin-top: var(--s6); align-items: start; }
.offer-aside { position: sticky; top: calc(var(--topbar-h) + var(--s4)); }
.facts { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s3); }
.facts li { display: flex; gap: var(--s3); align-items: flex-start; font-size: var(--fs-sm); color: var(--text-2); }
.facts .icon { color: var(--muted); margin-top: 1px; }
.facts strong { display: block; color: var(--text); }

.start-bar { display: grid; gap: var(--s3); }
.start-note { font-size: var(--fs-xs); color: var(--muted); margin: 0; }

@media (max-width: 860px) {
    .offer-hero { grid-template-columns: auto 1fr; }
    .offer-hero .thumb-lg { width: 88px; height: 88px; border-radius: 20px; }
    .offer-hero h1 { font-size: var(--fs-xl); }
    .offer-hero-reward { grid-column: 1 / -1; display: flex; align-items: center; gap: var(--s4); text-align: left; }
    .offer-hero-reward .hint { margin: 0; max-width: none; }
    .offer-layout { grid-template-columns: 1fr; }
    .offer-aside { position: static; }
    /* Bouton « Commencer » collé en bas, au-dessus de la barre d'onglets */
    .start-sticky {
        position: fixed; left: 0; right: 0; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); z-index: 55;
        padding: var(--s3) var(--s4);
        background: rgb(18 14 36 / 0.95); border-top: 1px solid var(--line);
    }
    .start-sticky .start-note { display: none; }
    body.has-offer-cta .page { padding-bottom: calc(var(--tabbar-h) + 100px); }
}

/* ---------- 10. Tableau de bord, portefeuille, historique ---------- */
.balance-panel {
    display: grid; grid-template-columns: 1.4fr 1fr; gap: var(--s5);
    padding: var(--s6);
    border-radius: var(--r-lg);
    background:
        radial-gradient(500px 220px at 0% 0%, rgb(var(--rgb-primary) / 0.28), transparent 70%),
        var(--ink-2);
    border: 1px solid var(--line);
}
.balance-label { color: var(--text-2); font-weight: 700; font-size: var(--fs-sm); margin: 0 0 var(--s1); }
.balance-big { display: flex; align-items: center; gap: 12px; font-family: var(--font-display); font-weight: 800; font-size: var(--fs-4xl); line-height: 1; letter-spacing: -0.03em; }
.balance-big .coin { width: .7em; height: .7em; }
.balance-sub { color: var(--muted); margin: var(--s3) 0 0; font-size: var(--fs-sm); }
.balance-side { display: grid; gap: var(--s4); align-content: center; }
.mini-stat { display: flex; justify-content: space-between; gap: var(--s3); padding-bottom: var(--s3); border-bottom: 1px solid var(--line-soft); font-size: var(--fs-sm); color: var(--text-2); }
.mini-stat:last-child { border-bottom: 0; padding-bottom: 0; }
.mini-stat strong { font-family: var(--font-display); font-weight: 600; color: var(--text); }
.balance-actions { display: flex; flex-wrap: wrap; gap: var(--s3); margin-top: var(--s5); }

/* Progression vers le premier retrait */
.progress { margin-top: var(--s5); }
/* Élément <progress> natif (pas de style inline : la CSP l'interdit) */
.progress-bar { -webkit-appearance: none; appearance: none; display: block; width: 100%; height: 10px; border: 0; border-radius: 999px; background: var(--input); overflow: hidden; }
.progress-bar::-webkit-progress-bar { background: var(--input); border-radius: 999px; }
.progress-bar::-webkit-progress-value { background: linear-gradient(90deg, var(--color-secondary), var(--color-accent)); border-radius: 999px; }
.progress-bar::-moz-progress-bar { background: linear-gradient(90deg, var(--color-secondary), var(--color-accent)); border-radius: 999px; }
.progress-text { display: flex; justify-content: space-between; gap: var(--s3); margin-top: var(--s2); font-size: var(--fs-sm); color: var(--muted); }
.progress-text strong { color: var(--text); }

@media (max-width: 760px) {
    .balance-panel { grid-template-columns: 1fr; padding: var(--s5); }
}

/* Lignes d'activité */
.activity { list-style: none; margin: 0; padding: 0; }
.activity-row {
    display: grid; grid-template-columns: 1fr auto; gap: var(--s2) var(--s4); align-items: center;
    padding: var(--s3) 0; border-bottom: 1px solid var(--line-soft);
}
.activity-row:last-child { border-bottom: 0; }
.activity-title { font-weight: 700; }
.activity-detail { display: block; color: var(--muted); font-size: var(--fs-xs); }
.activity-amount { text-align: right; font-family: var(--font-display); font-weight: 600; white-space: nowrap; }
.activity-amount.is-plus { color: var(--success); }
.activity-amount.is-minus { color: var(--text-2); }
.activity-amount small { display: block; font-family: var(--font-body); font-weight: 600; font-size: var(--fs-xs); color: var(--muted); margin-top: 2px; }
.activity-meta { display: flex; gap: var(--s2); align-items: center; grid-column: 1 / -1; font-size: var(--fs-xs); color: var(--muted); }

.filter-bar { display: flex; flex-wrap: wrap; gap: var(--s2); margin-bottom: var(--s4); }

/* Retrait */
.withdraw-layout { display: grid; grid-template-columns: 1fr 320px; gap: var(--s5); align-items: start; }
@media (max-width: 860px) { .withdraw-layout { grid-template-columns: 1fr; } }
.rules { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--s3); }
.rules li { display: flex; gap: var(--s3); font-size: var(--fs-sm); color: var(--text-2); }
.rules .icon { color: var(--color-secondary); margin-top: 1px; }
.method { display: flex; align-items: center; gap: var(--s3); padding: var(--s3) var(--s4); border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--input); }
.method.is-selected { border-color: var(--color-primary); box-shadow: 0 0 0 1px var(--color-primary); }
.method.is-soon { opacity: .55; }
.method-name { font-weight: 800; }
.method .tag { margin-left: auto; }

/* Profil */
.kv { display: grid; grid-template-columns: max-content 1fr; gap: var(--s2) var(--s5); margin: 0; font-size: var(--fs-sm); }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 700; overflow-wrap: anywhere; }

/* ---------- 11. Accueil (visiteurs) ---------- */
.home-hero { display: grid; grid-template-columns: 1.15fr 1fr; gap: var(--s7); align-items: center; padding: var(--s6) 0 var(--s7); }
.home-hero h1 { font-size: var(--fs-4xl); line-height: 1.02; letter-spacing: -0.035em; margin-bottom: var(--s4); }
.home-hero .lead { font-size: var(--fs-lg); color: var(--text-2); max-width: 34ch; }
.hero-actions { display: flex; gap: var(--s3); flex-wrap: wrap; margin-top: var(--s5); }
.hero-note { margin-top: var(--s4); font-size: var(--fs-sm); color: var(--muted); }

/* Illustration du héros : une quête en cours, à titre d'exemple */
.quest-demo { position: relative; padding: var(--s5); border-radius: var(--r-lg); background: var(--ink-2); border: 1px solid var(--line); }
.quest-demo-head { display: flex; align-items: center; gap: var(--s3); margin-bottom: var(--s4); }
.quest-demo-head strong { font-family: var(--font-display); font-weight: 600; display: block; }
.quest-demo-head small { color: var(--muted); }
.quest-demo .tag-example { position: absolute; top: -12px; right: 20px; background: var(--ink); border: 1px solid var(--line); color: var(--muted); }
.quest-demo .track-step.is-done .track-node { background: var(--color-secondary); color: var(--ink); }
.quest-demo .track-step.is-done .track-name { color: var(--muted); text-decoration: line-through; text-decoration-color: rgb(255 255 255 / 0.3); }
.quest-demo .track-step.is-current .track-node { box-shadow: 0 0 0 6px rgb(var(--rgb-secondary) / 0.18); }

/* Le seul moment animé du site : la piste se remplit au chargement */
@media (prefers-reduced-motion: no-preference) {
    .quest-demo .track-step { animation: step-in .5s var(--ease) both; }
    .quest-demo .track-step:nth-child(2) { animation-delay: .15s; }
    .quest-demo .track-step:nth-child(3) { animation-delay: .3s; }
    .quest-demo .track-step:nth-child(4) { animation-delay: .45s; }
    .quest-demo .track-step.is-current .track-node { animation: pulse 2.4s .9s ease-in-out infinite; }
}
@keyframes step-in { from { opacity: 0; transform: translateX(-10px); } to { opacity: 1; transform: none; } }
@keyframes pulse { 50% { box-shadow: 0 0 0 10px rgb(var(--rgb-secondary) / 0.06); } }

.how { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s5); list-style: none; padding: 0; margin: 0; counter-reset: how; }
.how li { counter-increment: how; padding-top: var(--s4); border-top: 2px solid var(--line); }
.how li::before { content: counter(how); display: block; font-family: var(--font-display); font-weight: 800; font-size: var(--fs-3xl); color: var(--color-primary); line-height: 1; margin-bottom: var(--s3); }
.how h3 { font-size: var(--fs-lg); font-weight: 800; }
.how p { color: var(--text-2); font-size: var(--fs-sm); }

.promise { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--s5); }
.promise-item { display: flex; gap: var(--s3); }
.promise-item .icon { width: 26px; height: 26px; color: var(--color-secondary); margin-top: 2px; }
.promise-item h3 { margin-bottom: var(--s1); }
.promise-item p { color: var(--muted); font-size: var(--fs-sm); margin: 0; }

.cta-band {
    display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: var(--s5);
    padding: var(--s6); border-radius: var(--r-lg);
    background: var(--color-primary);
    background-image: radial-gradient(rgb(255 255 255 / 0.12) 1px, transparent 1.2px);
    background-size: 18px 18px;
}
.cta-band h2 { font-size: var(--fs-xl); margin: 0; max-width: 22ch; }
.cta-band .btn { background: var(--text); color: var(--ink); }

@media (max-width: 860px) {
    .home-hero { grid-template-columns: 1fr; gap: var(--s6); padding-top: var(--s3); }
    .how { grid-template-columns: 1fr; }
}

/* ---------- 12. Pied de page, utilitaires, accessibilité ---------- */
.site-footer { border-top: 1px solid var(--line-soft); padding: var(--s6) 0; }
.footer-inner { display: grid; gap: var(--s4); grid-template-columns: 1fr auto; align-items: start; }
.footer-brand p { max-width: 60ch; }
.footer-links { display: flex; flex-wrap: wrap; gap: var(--s4); }
.footer-links a { color: var(--muted); font-size: var(--fs-sm); }
.footer-copy { grid-column: 1 / -1; margin: 0; }
@media (max-width: 700px) { .footer-inner { grid-template-columns: 1fr; } }

.muted { color: var(--muted); }
.small { font-size: var(--fs-sm); }
.center { text-align: center; }
.center p { margin-left: auto; margin-right: auto; }
.mt-0 { margin-top: 0; }
.nowrap { white-space: nowrap; }
.code-pill { overflow-wrap: anywhere; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .85em; background: var(--input); padding: 2px 8px; border-radius: var(--r-xs); border: 1px solid var(--line); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.legal-content p { color: var(--text-2); white-space: pre-line; }
.inline-form { display: inline; margin: 0; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* ---------- Administration ---------- */
.admin-nav { display: flex; flex-wrap: wrap; margin-bottom: var(--s5); overflow: visible; }
.admin-nav .chip { padding: 6px 12px; }
