/* Polices hébergées avec le site (licence SIL OFL, voir fonts/LICENSE-*.txt) : plus aucune requête vers Google, et la politique de sécurité n'autorise plus que « self » (audit SV-17).
   Sous-ensemble « latin » : français, anglais, ponctuation, signes monétaires. Tout autre caractère retombe sur la police du système. */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/inter-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/inter-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/inter-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/inter-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Sora"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/sora-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Sora"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/sora-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Sora"; font-style: normal; font-weight: 800; font-display: swap; src: url("../fonts/sora-latin-800-normal.woff2") format("woff2"); }

/* ============ Vinvest — jetons de la charte (direction « Santé ! ») ============
   Sombre par défaut (nuit prune), clair sur demande ou si l'appareil est en mode clair (lin).
   Les jetons de marque ne changent jamais ; les jetons de surface, de texte et d'état changent avec le thème. */
:root {
  /* Marque */
  --nuit: #1B1030;
  --violet: #3A1D5C;
  --or: #F2C14E;
  --or-clair: #FFE08A;
  --corail: #FF6B4A;
  --emeraude: #12805C;
  --lin: #FFF4E3;

  /* Surfaces et texte (thème sombre) */
  --page: #1B1030;
  --bg: #1B1030;
  --bg-2: #241547;
  --surface: #2D1B50;
  --card: #281846;
  --border: #432C6C;
  --texte: #FFF4E3;
  --texte-2: #C6B6DE;
  --titre: #FFF4E3;
  --lien: #FF8E75;
  --or-texte: #F2C14E;
  --focus: #F2C14E;

  /* États */
  --succes: #1FAF7B;
  --erreur: #FF7A8A;
  --ok-bg: #0F3A2E; --ok-fg: #5FE0B0;
  --wait-bg: rgba(242, 193, 78, .16); --wait-fg: #F6D98B;
  --info-bg: #1E2A5E; --info-fg: #A9C0FF;
  --no-bg: #4A1624; --no-fg: #FF9AA8;

  /* Composants */
  --topbar: rgba(27, 16, 48, .86);
  --ghost-hover: rgba(255, 255, 255, .07);
  --t-rose: rgba(255, 107, 74, .15); --t-or: rgba(242, 193, 78, .15); --t-violet: rgba(139, 92, 246, .20); --t-bleu: rgba(18, 128, 92, .26);
  --stat-bord: rgba(255, 255, 255, .08);
  --creme: rgba(242, 193, 78, .10); --creme-bord: rgba(242, 193, 78, .36); --creme-txt: #F6D98B; --quest-done: rgba(242, 193, 78, .10);
  --toast-bg: #FFF4E3; --toast-fg: #1B1030;
  --modal-fond: rgba(10, 4, 24, .72);

  --radius: 22px;
  --radius-sm: 14px;
  --shadow: 0 8px 28px rgba(0, 0, 0, .32);
  --shadow-lg: 0 22px 60px rgba(0, 0, 0, .5);
  --glow-corail: 0 8px 22px rgba(255, 107, 74, .32);
  --grad-hero: radial-gradient(circle at 92% 8%, rgba(255, 107, 74, .5), transparent 45%), radial-gradient(circle at 4% 112%, rgba(18, 128, 92, .46), transparent 52%), linear-gradient(135deg, #3A1D5C, #24124A);
  --grad-or: linear-gradient(180deg, #FFE08A, #F2C14E);
  --grad-barre: linear-gradient(90deg, #FF6B4A, #F2C14E);
  color-scheme: dark;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Sora", "Inter", system-ui, sans-serif;
}

/* ============ Mode clair : lin et prune, mêmes jetons ============ */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --page: #FBF3E4; --bg: #FFFFFF; --bg-2: #F6EBD8; --surface: #F3E7D2; --card: #FFFFFF; --border: #E6D6BC;
    --texte: #1B1030; --texte-2: #645478; --titre: #3A1D5C; --lien: #C4391C; --or-texte: #9A6200; --focus: #3A1D5C;
    --succes: #12805C; --erreur: #C0243C;
    --ok-bg: #D8F2E6; --ok-fg: #0B5C40; --wait-bg: #FCEFC8; --wait-fg: #7A4E00; --info-bg: #DFE7FF; --info-fg: #2A3C99; --no-bg: #FDE0E4; --no-fg: #9B1B30;
    --topbar: rgba(251, 243, 228, .9); --ghost-hover: #FFF0EB;
    --t-rose: #FFE6DF; --t-or: #FCEFC8; --t-violet: #EEE6FD; --t-bleu: #DAF1E8; --stat-bord: rgba(58, 29, 92, .08);
    --creme: #FFF1CF; --creme-bord: #EBCF8C; --creme-txt: #6B4A00; --quest-done: #FFF8E6;
    --toast-bg: #1B1030; --toast-fg: #FFF4E3; --modal-fond: rgba(27, 16, 48, .6);
    --shadow: 0 8px 28px rgba(58, 29, 92, .12); --shadow-lg: 0 22px 60px rgba(58, 29, 92, .28);
    color-scheme: light;
  }
}
:root[data-theme="light"] {
  --page: #FBF3E4; --bg: #FFFFFF; --bg-2: #F6EBD8; --surface: #F3E7D2; --card: #FFFFFF; --border: #E6D6BC;
  --texte: #1B1030; --texte-2: #645478; --titre: #3A1D5C; --lien: #C4391C; --or-texte: #9A6200; --focus: #3A1D5C;
  --succes: #12805C; --erreur: #C0243C;
  --ok-bg: #D8F2E6; --ok-fg: #0B5C40; --wait-bg: #FCEFC8; --wait-fg: #7A4E00; --info-bg: #DFE7FF; --info-fg: #2A3C99; --no-bg: #FDE0E4; --no-fg: #9B1B30;
  --topbar: rgba(251, 243, 228, .9); --ghost-hover: #FFF0EB;
  --t-rose: #FFE6DF; --t-or: #FCEFC8; --t-violet: #EEE6FD; --t-bleu: #DAF1E8; --stat-bord: rgba(58, 29, 92, .08);
  --creme: #FFF1CF; --creme-bord: #EBCF8C; --creme-txt: #6B4A00; --quest-done: #FFF8E6;
  --toast-bg: #1B1030; --toast-fg: #FFF4E3; --modal-fond: rgba(27, 16, 48, .6);
  --shadow: 0 8px 28px rgba(58, 29, 92, .12); --shadow-lg: 0 22px 60px rgba(58, 29, 92, .28);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; font-family: var(--font); color: var(--texte);
  background: var(--page); line-height: 1.55; -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--lien); text-decoration: none; }
h1, h2, h3, h4 { margin: 0 0 .4em; line-height: 1.18; font-family: var(--font-display); font-weight: 700; letter-spacing: -.01em; }
p { margin: 0 0 1em; }
button { font: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.container { width: min(1120px, 100% - 32px); margin-inline: auto; }
.ico-svg { width: 1em; height: 1em; vertical-align: -.125em; flex: none; }

/* ============ Marque ============ */
.brand { display: flex; align-items: center; gap: .6rem; font-family: var(--font-display); font-weight: 800; font-size: 1.4rem; color: var(--texte); letter-spacing: -.02em; }
.brand b { color: var(--or-texte); }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; box-shadow: 0 0 0 1px rgba(242, 193, 78, .4), 0 4px 14px rgba(0, 0, 0, .25); }

/* ============ Boutons ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .8rem 1.4rem; border-radius: 999px; border: 2px solid transparent;
  font-weight: 700; transition: transform .15s, box-shadow .15s, background .15s, filter .15s;
}
.btn:hover { transform: translateY(-1px); }
.btn-or { background: var(--grad-or); color: var(--nuit); box-shadow: 0 8px 20px rgba(242, 193, 78, .3); }
.btn-primary { background: var(--corail); color: var(--nuit); box-shadow: var(--glow-corail); }
.btn-primary:hover { filter: brightness(1.07); }
.btn-ghost { background: var(--card); color: var(--lien); border-color: var(--lien); }
.btn-ghost:hover { background: var(--ghost-hover); }
.btn-block { width: 100%; }
.btn-sm { padding: .5rem 1rem; font-size: .9rem; }

/* ============ Landing ============ */
.topbar { position: sticky; top: 0; z-index: 20; background: var(--topbar); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.topbar .container { display: flex; align-items: center; justify-content: space-between; gap: .5rem; height: 68px; }
.topbar nav { display: flex; gap: 1.5rem; align-items: center; }
.topbar nav a.link { color: var(--texte); font-weight: 600; }
.topbar nav a.link:hover { color: var(--lien); }
@media (max-width: 720px) { .topbar nav a.link { display: none; } }
.topbar nav .btn { white-space: nowrap; }
@media (max-width: 560px) {
  .topbar nav { gap: .5rem; }
  .topbar .brand { font-size: 1.2rem; gap: .4rem; }
  .topbar .brand-mark { width: 30px; height: 30px; }
  .topbar nav .btn-sm { padding: .45rem .85rem; font-size: .85rem; }
  .topbar .outils { gap: .3rem; }
  .topbar .outils .icon-btn { width: 38px; height: 38px; }
  .topbar .outils [data-musique] { display: none; } /* le réglage reste dans Paramètres */
}

.hero { background: linear-gradient(180deg, rgba(27, 16, 48, .55), rgba(27, 16, 48, .85)), url("../assets/ambiance.jpg") center / cover no-repeat, var(--nuit); color: var(--lin); overflow: hidden; position: relative; }
.hero .container { display: grid; grid-template-columns: 1.05fr .95fr; gap: 2rem; align-items: center; padding-block: 3.5rem; position: relative; }
.hero h1 { font-size: clamp(2.1rem, 4.8vw, 3.4rem); }
/* Mot en couleur : or clair uni. L'ancien dégradé corail → or se confondait avec les reflets orangés de la photo de fond. */
.hero h1 em { font-style: normal; color: var(--or-clair); text-shadow: 0 2px 18px rgba(27, 16, 48, .85); }
.hero h1, .hero p.lead { text-shadow: 0 2px 16px rgba(27, 16, 48, .7); }
.hero p.lead { opacity: 1; }
.hero p.lead { font-size: 1.2rem; opacity: .95; max-width: 34ch; }
.hero .cta { display: flex; gap: .8rem; flex-wrap: wrap; margin-top: 1.4rem; }
.hero .cta .btn-or { color: var(--nuit); }
.hero .cta .btn-ghost { background: rgba(255, 244, 227, .06); color: var(--lin); border-color: rgba(255, 244, 227, .5); }
.hero .cta .btn-ghost:hover { background: rgba(255, 244, 227, .14); }
.hero-img { border-radius: 28px; box-shadow: var(--shadow-lg), 0 0 0 1px rgba(242, 193, 78, .35), 0 0 60px rgba(255, 107, 74, .22); }
.bulles { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.bulles i { position: absolute; bottom: -24px; border-radius: 50%; border: 1px solid rgba(255, 224, 138, .4); background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, .5), rgba(255, 224, 138, .16) 55%, rgba(255, 224, 138, .04)); animation: monte linear infinite; }
@keyframes monte { from { transform: translate(0, 0); opacity: .9; } to { transform: translate(22px, -115vh); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .bulles { display: none; } html { scroll-behavior: auto; } }
@media (max-width: 820px) { .hero .container { grid-template-columns: 1fr; } .hero-img { max-width: 380px; margin: auto; } }

section.block { padding: 4rem 0; }
section.block h2 { font-size: clamp(1.7rem, 3.5vw, 2.4rem); text-align: center; color: var(--titre); }
section.block .sub { text-align: center; color: var(--texte-2); max-width: 56ch; margin: 0 auto 2.2rem; }

.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.2rem; }
.step { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.6rem; box-shadow: var(--shadow); text-align: center; }
.step .ico { font-size: 2.4rem; }
.step .n { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--corail); color: var(--nuit); font-weight: 800; font-size: .85rem; margin-bottom: .6rem; }

.paliers-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 1.2rem; }
.palier-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.6rem 1.2rem; box-shadow: var(--shadow); text-align: center; transition: .2s; }
.palier-card:hover { border-color: var(--or); transform: translateY(-3px); }
.palier-card .ico { font-size: 2.8rem; color: var(--or-texte); filter: drop-shadow(0 4px 14px rgba(242, 193, 78, .35)); }
.palier-card .prix { font-family: var(--font-display); font-size: 1.2rem; font-weight: 800; color: var(--lien); margin: .3rem 0 1rem; font-variant-numeric: tabular-nums; }

.notice { background: var(--creme); border: 1px solid var(--creme-bord); border-radius: var(--radius-sm); padding: 1rem 1.2rem; color: var(--creme-txt); font-size: .92rem; }
footer.site { background: #140A25; color: #C6B6DE; padding: 2.2rem 0; font-size: .9rem; }
footer.site .container { display: grid; gap: .6rem; }
footer.site .brand { color: var(--lin); }
footer.site .brand b { color: var(--or); }

/* ============ Auth ============ */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-side { background: linear-gradient(180deg, rgba(27, 16, 48, .35), rgba(27, 16, 48, .7)), url("../assets/ambiance.jpg") center / cover no-repeat, var(--nuit); display: grid; place-items: center; padding: 2rem; }
.auth-side img { border-radius: 28px; max-height: 80vh; width: auto; box-shadow: var(--shadow-lg), 0 0 0 1px rgba(242, 193, 78, .35), 0 0 60px rgba(255, 107, 74, .2); }
.auth-main { display: grid; place-items: center; padding: 2rem; background: var(--page); }
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.4rem; box-shadow: var(--shadow); }
.auth-card { width: min(420px, 100%); padding: 2rem; }
.auth-card h1 { color: var(--titre); font-size: 1.7rem; }
.field { display: grid; gap: .3rem; margin-bottom: 1rem; }
.field label { font-weight: 600; font-size: .9rem; }
.field input { padding: .8rem 1rem; border: 1.5px solid var(--border); border-radius: var(--radius-sm); font: inherit; background: var(--bg-2); color: var(--texte); }
.field input::placeholder { color: var(--texte-2); opacity: .8; }
.field input:focus { border-color: var(--or); outline: none; background: var(--card); box-shadow: 0 0 0 3px rgba(242, 193, 78, .22); }
.field .err { color: var(--erreur); font-size: .85rem; min-height: 1em; }
@media (max-width: 820px) { .auth-wrap { grid-template-columns: minmax(0, 1fr); } .auth-side { display: none; } .auth-main { padding: 1rem; } }

/* ============ App shell ============ */
.app { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.sidebar { background: linear-gradient(180deg, #2B1752 0%, #1B1030 100%); border-right: 1px solid rgba(255, 255, 255, .06); color: var(--lin); padding: 1.2rem 1rem; display: flex; flex-direction: column; gap: 1.2rem; position: sticky; top: 0; height: 100vh; }
.sidebar .brand { color: var(--lin); font-size: 1.55rem; justify-content: center; padding: .4rem 0 .8rem; }
.sidebar .brand b { color: var(--or); }
.sidebar nav { display: grid; gap: .3rem; flex: 1; align-content: start; }
.sidebar nav a, .sidebar nav button.nav-btn { display: flex; align-items: center; gap: .8rem; padding: .8rem 1rem; border-radius: 14px; color: #D9CCEE; font-weight: 600; font-size: .95rem; background: none; border: 0; text-align: left; width: 100%; }
.sidebar nav a:hover, .sidebar nav button.nav-btn:hover { background: rgba(255, 255, 255, .09); color: #fff; }
.sidebar nav a.active { background: var(--or); color: var(--nuit); box-shadow: 0 6px 18px rgba(242, 193, 78, .28); }
.sidebar svg { width: 20px; height: 20px; flex: none; }
.sidebar :focus-visible { outline-color: var(--or); }
.main { padding: 1.2rem 1.6rem 3rem; min-width: 0; }
.appbar { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.2rem; }
.search { flex: 1; display: flex; align-items: center; gap: .6rem; background: var(--card); border: 1.5px solid var(--border); border-radius: 999px; padding: .6rem 1.1rem; max-width: 520px; }
.search input { border: 0; outline: 0; flex: 1; font: inherit; background: transparent; color: var(--texte); }
.icon-btn { position: relative; background: var(--card); border: 1.5px solid var(--border); border-radius: 50%; width: 42px; height: 42px; display: grid; place-items: center; }
.icon-btn .badge { position: absolute; top: -4px; right: -4px; background: var(--corail); color: var(--nuit); font-size: .7rem; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; }
.avatar { width: 42px; height: 42px; border-radius: 50%; background: var(--violet); color: var(--or-clair); border: 1.5px solid rgba(242, 193, 78, .5); display: grid; place-items: center; font-weight: 800; font-family: var(--font-display); }
.menu-toggle { display: none; }
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 40; width: 260px; inset: 0 auto 0 0; transform: translateX(-100%); transition: transform .25s; }
  .sidebar.open { transform: none; box-shadow: var(--shadow-lg); }
  .menu-toggle { display: grid; }
  .main { padding: 1rem; }
}

.banner { background: var(--grad-hero); color: var(--lin); border: 1px solid rgba(242, 193, 78, .22); border-radius: var(--radius); padding: 1.6rem 2rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; box-shadow: var(--shadow-lg); position: relative; overflow: hidden; }
.banner h2 { font-size: clamp(1.4rem, 3vw, 2rem); }
.banner h2 em { color: var(--or); font-style: normal; }
.banner .deco { display: flex; align-items: flex-end; font-size: 3.6rem; color: var(--or); filter: drop-shadow(0 6px 16px rgba(242, 193, 78, .4)); }
.banner .deco .c1 { transform: rotate(-14deg); }
.banner .deco .c2 { transform: rotate(14deg); margin-left: -.35em; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 1rem; margin: 1.2rem 0; }
.stat { border-radius: var(--radius); padding: 1.2rem; display: flex; gap: 1rem; align-items: center; border: 1px solid var(--stat-bord); box-shadow: var(--shadow); }
.stat .ico { font-size: 2rem; }
.stat small { color: var(--texte-2); font-weight: 600; }
.stat strong { display: block; font-family: var(--font-display); font-size: 1.5rem; font-variant-numeric: tabular-nums; }
.stat .delta { color: var(--succes); font-weight: 800; font-size: .85rem; }
.stat.rose { background: var(--t-rose); } .stat.or { background: var(--t-or); } .stat.violet { background: var(--t-violet); } .stat.bleu { background: var(--t-bleu); }

.grid-2 { display: grid; grid-template-columns: 1.4fr 1fr; gap: 1rem; }
@media (max-width: 1100px) { .grid-2 { grid-template-columns: 1fr; } }
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; gap: .8rem; padding: .8rem .2rem; border-bottom: 1px solid var(--border); }
.list li:last-child { border-bottom: 0; }
.list .grow { flex: 1; font-weight: 600; }
.list .price { font-weight: 700; color: var(--texte-2); font-variant-numeric: tabular-nums; }
.list .ico { font-size: 1.5rem; width: 2rem; text-align: center; color: var(--or-texte); }

/* Médaille de niveau : le symbole du niveau dans un médaillon doré */
.medal { width: 1.5em; height: 1.5em; margin-inline: auto; border-radius: 50%; display: grid; place-items: center; color: var(--or); background: radial-gradient(circle at 30% 25%, rgba(242, 193, 78, .38), rgba(242, 193, 78, .08)); border: 2px solid rgba(242, 193, 78, .6); box-shadow: 0 8px 24px rgba(242, 193, 78, .2); }
.medal .ico-svg { width: .7em; height: .7em; vertical-align: 0; filter: drop-shadow(0 3px 8px rgba(242, 193, 78, .5)); }
.level { text-align: center; }
.level .medal { font-size: 4.2rem; }
.level .ribbon { display: inline-block; background: var(--grad-or); color: var(--nuit); font-weight: 800; padding: .3rem 1.4rem; border-radius: 8px; margin: .6rem 0 .8rem; }
.progress { height: 10px; background: var(--border); border-radius: 99px; overflow: hidden; }
.progress > div { height: 100%; background: var(--grad-barre); border-radius: 99px; transition: width .6s; }
.progress-row { display: flex; align-items: center; gap: .8rem; font-weight: 700; margin: .6rem 0 1rem; }
.progress-row .progress { flex: 1; }

.page-title { color: var(--titre); font-size: 1.7rem; margin-bottom: 1rem; }
table.tbl { width: 100%; border-collapse: collapse; }
.tbl th, .tbl td { text-align: left; padding: .75rem .6rem; border-bottom: 1px solid var(--border); }
.tbl th { font-size: .8rem; color: var(--texte-2); text-transform: uppercase; letter-spacing: .05em; }
.tag { display: inline-block; padding: .15rem .7rem; border-radius: 99px; font-size: .8rem; font-weight: 700; }
.tag.ok { background: var(--ok-bg); color: var(--ok-fg); } .tag.wait { background: var(--wait-bg); color: var(--wait-fg); } .tag.info { background: var(--info-bg); color: var(--info-fg); } .tag.no { background: var(--no-bg); color: var(--no-fg); }
.recap-palier { display: flex; align-items: center; gap: .9rem; padding: .9rem 1rem; margin: .4rem 0 1.2rem; border: 1.5px solid var(--creme-bord); border-radius: var(--radius-sm); background: var(--creme); }
.recap-palier .ico { font-size: 1.8rem; line-height: 1; }
.recap-palier .grow { display: grid; min-width: 0; }
.recap-palier small { color: var(--texte-2); }
.recap-palier .prix { font-weight: 800; color: var(--or-texte); white-space: nowrap; }
.tel-row { display: flex; gap: .5rem; align-items: stretch; }
.tel-row input { flex: 1; min-width: 0; }
.tel-pre { display: inline-flex; align-items: center; padding: 0 .9rem; border: 1.5px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-2); color: var(--texte-2); font-weight: 700; }
.pm-group { border: 0; padding: 0; margin: 0 0 1rem; display: grid; gap: .6rem; min-width: 0; }
.pm-group legend { font-weight: 600; font-size: .9rem; margin-bottom: .4rem; padding: 0; }
.pm { display: flex; gap: .8rem; align-items: flex-start; padding: .9rem 1rem; border: 1.5px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-2); cursor: pointer; min-height: 44px; }
.pm.reco { border-color: var(--creme-bord); background: var(--creme); }
.pm:has(input:checked) { border-color: var(--or); box-shadow: 0 0 0 3px rgba(242, 193, 78, .22); }
.pm:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.pm.off { opacity: .55; cursor: not-allowed; }
.pm input { margin-top: .25rem; accent-color: var(--or); width: 1.1rem; height: 1.1rem; flex: none; }
.pm-body { display: grid; gap: .2rem; min-width: 0; }
.pm-body small { color: var(--texte-2); font-size: .85rem; }
.copy-box { display: flex; gap: .6rem; background: var(--bg-2); border: 1.5px dashed var(--or); padding: .8rem 1rem; border-radius: var(--radius-sm); align-items: center; justify-content: space-between; flex-wrap: wrap; word-break: break-all; font-weight: 700; }
.tiers { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 1rem; }
.reward { text-align: center; padding: 1.2rem; border-radius: var(--radius); background: var(--card); border: 1px solid var(--border); box-shadow: var(--shadow); }
.reward.locked { opacity: .55; filter: grayscale(.7); }
.reward .ico { font-size: 2.6rem; color: var(--or-texte); }

.toast { position: fixed; bottom: 1.2rem; left: 50%; transform: translate(-50%, 20px); background: var(--toast-bg); color: var(--toast-fg); font-weight: 600; padding: .8rem 1.2rem; border-radius: 14px; box-shadow: var(--shadow-lg); opacity: 0; transition: .25s; z-index: 100; pointer-events: none; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.modal-bg { position: fixed; inset: 0; background: var(--modal-fond); backdrop-filter: blur(4px); display: grid; place-items: center; z-index: 80; padding: 1rem; }
.modal { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.6rem; width: min(440px, 100%); box-shadow: var(--shadow-lg); }

/* Barre du haut : éviter le débordement sur mobile */
.icon-btn, .avatar { flex: none; }
.search { min-width: 0; }
.search input { min-width: 0; width: 100%; }
@media (max-width: 600px) {
  .appbar { gap: .5rem; }
  .search { padding: .5rem .8rem; }
}

/* ============ XP, niveaux, objectifs ============ */
.lvl-chip { flex: none; white-space: nowrap; background: var(--grad-or); color: var(--nuit); font-weight: 800; font-size: .85rem; padding: .35rem .8rem; border-radius: 99px; box-shadow: var(--shadow); }
.lvl-chip:hover { filter: brightness(1.05); }
.progress.xp > div { background: var(--grad-barre); }
.progress.xp { height: 12px; }
.xp-line { display: flex; justify-content: space-between; gap: .5rem; font-weight: 700; font-size: .9rem; margin-top: .4rem; }
.xp-line span:last-child { color: var(--texte-2); font-weight: 600; }
.xp-hint { margin: .5rem 0 1rem; color: var(--texte-2); font-size: .92rem; }
.level .xp-line, .level .progress { text-align: left; }
.btn[disabled] { opacity: .6; cursor: default; filter: none; transform: none; box-shadow: none; }

.xp-hero { gap: 1.5rem; }
.xp-hero .xp-who { display: flex; align-items: center; gap: 1.2rem; }
.xp-hero .medal { font-size: 3.8rem; margin-inline: 0; }
.xp-hero small { opacity: .85; font-weight: 600; }
.xp-hero h2 { margin: 0; }
.xp-total { color: var(--or); font-family: var(--font-display); font-size: 1.3rem; }
.xp-bar-wrap { flex: 1 1 280px; min-width: 0; }
.xp-hero .xp-line span:last-child, .xp-hero .xp-hint { color: #D9CCEE; }
.xp-hero .progress { background: rgba(255, 255, 255, .2); }

/* Le verre du jour : sept verres qui se remplissent au fil de la série */
.streak { display: flex; gap: .4rem; margin: .8rem 0 1rem; flex-wrap: wrap; }
.streak i { flex: 1 0 2.6rem; max-width: 3.4rem; display: grid; justify-items: center; gap: .1rem; padding: .45rem 0 .3rem; border-radius: 16px; font-style: normal; font-weight: 700; background: var(--bg-2); border: 2px dashed var(--border); color: var(--texte-2); }
.streak i .ico-svg { font-size: 1.35rem; }
.streak i span { font-size: .7rem; line-height: 1; }
.streak i.on { background: var(--t-or); border: 2px solid var(--or); color: var(--or-texte); }
.streak i.on .ico-svg [fill-opacity] { fill-opacity: .85; }
.how .price { white-space: nowrap; font-size: .9rem; }

.sec-title { color: var(--titre); font-size: 1.35rem; margin: 2rem 0 .4rem; display: flex; flex-wrap: wrap; gap: .3rem .8rem; align-items: baseline; }
.sec-title small { font-family: var(--font); font-size: .9rem; color: var(--texte-2); font-weight: 600; }
.sec-title small b { color: var(--lien); }
.cat-title { margin: 1.2rem 0 .6rem; font-family: var(--font); font-size: .85rem; text-transform: uppercase; letter-spacing: .07em; color: var(--texte-2); }
.quests { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 1rem; }
.quest { display: flex; gap: 1rem; align-items: center; background: var(--card); border-radius: var(--radius); padding: 1rem 1.2rem; box-shadow: var(--shadow); border: 2px solid var(--border); }
.quest .q-ico { font-size: 2.2rem; flex: none; width: 3rem; text-align: center; }
.quest .q-body { flex: 1; min-width: 0; }
.quest h4 { margin: 0; }
.quest p { margin: .1rem 0 0; color: var(--texte-2); font-size: .9rem; }
.quest .progress-row { margin: .5rem 0 0; font-size: .8rem; }
.quest .progress-row small { color: var(--texte-2); white-space: nowrap; }
.quest .q-act { display: grid; gap: .4rem; justify-items: end; flex: none; }
.xp-chip { background: var(--t-or); color: var(--wait-fg); font-weight: 800; font-size: .8rem; padding: .15rem .6rem; border-radius: 99px; border: 1px solid var(--creme-bord); }
.quest.done { border-color: var(--or); background: linear-gradient(180deg, var(--quest-done), var(--card)); }
.quest.claimed { opacity: .7; }
.quest.claimed .progress > div { background: var(--succes); }
.reward.now { border: 2px solid var(--or); box-shadow: 0 0 0 4px rgba(242, 193, 78, .22), var(--shadow); }
.reward h4 { margin: .3rem 0 .1rem; }
@media (max-width: 520px) { .quest { flex-wrap: wrap; } .quest .q-act { width: 100%; grid-auto-flow: column; justify-content: space-between; align-items: center; } }

.celebre { text-align: center; position: relative; overflow: hidden; animation: pop .45s cubic-bezier(.2, 1.4, .4, 1); }
.celebre .medal { font-size: 4.6rem; }
.celebre h2 { color: var(--titre); margin: .6rem 0 .4rem; font-size: 2rem; }
.celebre .kicker { margin: .6rem 0 .2rem; color: var(--lien); font-weight: 800; text-transform: uppercase; letter-spacing: .09em; font-size: .85rem; }
.celebre .ribbon { display: inline-block; background: var(--grad-or); color: var(--nuit); font-weight: 800; padding: .3rem 1.4rem; border-radius: 8px; }
.confetti i { position: absolute; top: 0; font-style: normal; font-size: 1.4rem; animation: confetti 1.8s ease-in infinite; }
@keyframes pop { from { transform: scale(.7); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes confetti { from { transform: translateY(-20px) rotate(0); opacity: 1; } to { transform: translateY(300px) rotate(300deg); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .celebre, .confetti i { animation: none; } .confetti { display: none; } .progress > div { transition: none; } }

.stats .stat strong { font-size: 1.3rem; }

/* ============ Outils rapides, solde, notifications ============ */
section.block.alt { background: var(--bg); }
.outils { display: flex; gap: .4rem; align-items: center; }
.icon-btn.txt { font-weight: 800; font-size: .8rem; color: var(--texte); }
.icon-btn { color: var(--texte); cursor: pointer; }
.float-tools { position: fixed; top: .8rem; right: .8rem; z-index: 30; }
.grow { flex: 1; }
.solde-chip { display: inline-flex; align-items: center; gap: .5rem; background: var(--card); color: var(--texte); border: 1.5px solid var(--border); border-radius: 999px; padding: .35rem .9rem; font: inherit; white-space: nowrap; }
.solde-chip .solde-lbl { color: var(--texte-2); font-weight: 600; font-size: .8rem; }
.solde-chip strong { font-variant-numeric: tabular-nums; }
.solde-chip:hover { border-color: var(--or); }
.notif-wrap { position: relative; }
.notif-panel { position: absolute; right: 0; top: calc(100% + .5rem); width: min(340px, calc(100vw - 2rem)); background: var(--card); color: var(--texte); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 1rem; z-index: 50; max-height: 70vh; overflow-y: auto; }
.notif-panel h4 { margin: 0 0 .6rem; }
.notif-panel ul { list-style: none; margin: 0; padding: 0; }
.notif-panel li { display: grid; gap: .1rem; padding: .6rem .5rem; border-bottom: 1px solid var(--border); font-size: .92rem; border-radius: 8px; }
.notif-panel li:last-child { border-bottom: 0; }
.notif-panel li.new { background: var(--t-or); }
.notif-panel small, .notif-panel .vide { color: var(--texte-2); }
.nav-badge { margin-left: auto; background: var(--corail); color: var(--nuit); font-size: .75rem; font-weight: 800; padding: .05rem .5rem; border-radius: 99px; }
.sidebar { overflow-y: auto; }
.admin-pill { display: inline-flex; align-items: center; gap: .4rem; background: var(--violet); color: #fff; font-weight: 700; font-size: .85rem; padding: .35rem .9rem; border-radius: 99px; }
@media (max-width: 760px) { .search { display: none; } .solde-chip { margin-left: auto; } .solde-chip .solde-lbl { display: none; } .appbar { flex-wrap: wrap; } }

/* ============ Paramètres ============ */
.settings h3 { margin-bottom: .4rem; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .9rem 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.set-row:last-of-type { border-bottom: 0; }
.set-row h4 { margin: 0; }
.set-row p { margin: .1rem 0 0; color: var(--texte-2); font-size: .9rem; max-width: 46ch; }
.set-btns { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.settings .note, .note { color: var(--texte-2); font-size: .85rem; margin: .6rem 0 0; }
.settings input[type=time], .field select, .decision input { padding: .6rem .8rem; border: 1.5px solid var(--border); border-radius: var(--radius-sm); font: inherit; background: var(--bg-2); color: var(--texte); }
.field select { padding: .8rem 1rem; }
.field input, .field select { color: var(--texte); }
.settings select { padding: .55rem .8rem; border: 1.5px solid var(--border); border-radius: var(--radius-sm); font: inherit; background: var(--bg-2); max-width: 100%; }
.seg { display: inline-flex; background: var(--bg-2); border: 1.5px solid var(--border); border-radius: 999px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: none; color: var(--texte-2); font-weight: 700; padding: .4rem 1rem; border-radius: 999px; }
.seg button[aria-pressed=true] { background: var(--corail); color: var(--nuit); }
.seg.tabs { flex-wrap: wrap; border-radius: 16px; }
.seg.tabs b { font-weight: 800; opacity: .8; }
.switch { position: relative; display: inline-block; width: 52px; height: 30px; flex: none; }
.switch input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.switch span[aria-hidden] { position: absolute; inset: 0; background: var(--border); border-radius: 99px; transition: background .2s; }
.switch span[aria-hidden]::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; background: #fff; border-radius: 50%; transition: transform .2s; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); }
.switch input:checked + span { background: var(--succes); }
.switch input:checked + span::after { transform: translateX(22px); }
.switch input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .switch span[aria-hidden], .switch span[aria-hidden]::after { transition: none; } }

/* ============ Code PIN ============ */
.pin-bg { position: fixed; inset: 0; z-index: 200; background: linear-gradient(180deg, rgba(27, 16, 48, .55), rgba(27, 16, 48, .92)), url("../assets/ambiance.jpg") center / cover no-repeat, var(--nuit); display: grid; place-items: center; padding: 1rem; overflow-y: auto; }
.pin { width: min(340px, 100%); text-align: center; color: var(--lin); }
.pin-logo { width: 72px; height: 72px; border-radius: 20px; margin: 0 auto .4rem; box-shadow: 0 0 0 1px rgba(242, 193, 78, .45), 0 10px 30px rgba(0, 0, 0, .4); }
.pin h2 { margin: .4rem 0 .2rem; font-size: 1.5rem; }
.pin-sous { color: #D9CCEE; margin: 0 0 1rem; }
.pin-dots { display: flex; justify-content: center; gap: 1rem; margin: .6rem 0; }
.pin-dots i { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--or); transition: background .12s; }
.pin-dots i.on { background: var(--or); }
.pin-dots.non { animation: secoue .4s; }
@keyframes secoue { 20%, 60% { transform: translateX(-10px); } 40%, 80% { transform: translateX(10px); } }
.pin-err { min-height: 1.4em; margin: .4rem 0 .6rem; font-weight: 700; color: var(--or); font-size: .9rem; }
.pin-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: .8rem; justify-items: center; }
.pin-pad button { width: 76px; height: 76px; border-radius: 50%; border: 1px solid rgba(255, 244, 227, .14); background: rgba(255, 244, 227, .1); color: var(--lin); font-family: var(--font-display); font-size: 1.6rem; font-weight: 700; transition: background .1s, transform .1s; }
.pin-pad button:hover { background: rgba(255, 244, 227, .18); }
.pin-pad button:active { background: rgba(242, 193, 78, .3); transform: scale(.94); }
.pin-pad button.aux { background: none; border-color: transparent; font-family: var(--font); font-size: 1rem; }
.pin-oubli { margin-top: 1.2rem; background: none; border: 0; color: #D9CCEE; text-decoration: underline; font-size: .9rem; }
.pin :focus-visible { outline-color: var(--or); }
@media (prefers-reduced-motion: reduce) { .pin-dots.non { animation: none; } }

/* ============ Espace administrateur ============ */
.grid-2.even { grid-template-columns: 1fr 1fr; }
@media (max-width: 900px) { .grid-2.even { grid-template-columns: 1fr; } }
.page-title .count { font-size: .9rem; color: var(--texte-2); font-weight: 600; margin-left: .4rem; }
.hbar { display: grid; grid-template-columns: minmax(150px, 1.5fr) 2fr 2.4rem; gap: .6rem; align-items: center; padding: .3rem 0; font-size: .92rem; }
.hbar .l { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar .v { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.cols { display: flex; align-items: flex-end; gap: .6rem; height: 190px; padding-top: 1.4rem; }
.cols .col { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: .3rem; min-width: 0; }
.cols .col .bar { width: 100%; max-width: 44px; min-height: 4px; background: var(--grad-or); border-radius: 8px 8px 0 0; }
.cols .col .n { font-weight: 700; font-size: .85rem; }
.cols .col .d { color: var(--texte-2); font-size: .8rem; text-transform: capitalize; }
.decision { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; min-width: 280px; }
.decision input { flex: 1 1 140px; min-width: 0; padding: .45rem .7rem; }
.tbl td { vertical-align: top; }
.field input[type=search] { width: 100%; }
select { color: var(--texte); }

/* ============ Cloche : alertes à faire ============ */
.notif-panel h5 { margin: .6rem 0 .3rem; font-family: var(--font); font-size: .75rem; text-transform: uppercase; letter-spacing: .07em; color: var(--texte-2); }
.notif-panel ul.alertes li { padding: 0; border-bottom: 0; }
.notif-panel ul.alertes a { display: block; padding: .6rem .6rem; border-radius: 12px; background: var(--t-or); color: var(--texte); font-weight: 600; margin-bottom: .3rem; }
.notif-panel ul.alertes a:hover { outline: 2px solid var(--or); }
/* Évènements écrits par le serveur (paiement confirmé, annulation, retrait…) : restent jusqu'à lecture. */
.notif-panel ul.evenements { max-height: 46vh; overflow-y: auto; margin-bottom: .4rem; }
.notif-panel ul.evenements li { border-left: 3px solid transparent; padding-left: .7rem; }
.notif-panel ul.evenements li.success { border-left-color: var(--ok-fg); }
.notif-panel ul.evenements li.warning { border-left-color: var(--corail); }
.notif-panel ul.evenements li.new span { font-weight: 700; }
/* Avertissement important : bannière en haut de la page jusqu'à « J'ai compris ». */
.avertissement { display: grid; gap: .6rem; margin: 0 0 1rem; }
.avert-ligne { display: flex; gap: 1rem; align-items: center; justify-content: space-between; background: var(--creme); color: var(--creme-txt); border: 1px solid var(--creme-bord); border-left: 5px solid var(--corail); border-radius: var(--radius-sm); padding: .9rem 1.1rem; }
.avert-ligne p { margin: 0; font-weight: 600; line-height: 1.45; }
@media (max-width: 600px) { .avert-ligne { flex-direction: column; align-items: stretch; } }
.icon-btn .badge { animation: pulse 2.2s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.18); } }
@media (prefers-reduced-motion: reduce) { .icon-btn .badge { animation: none; } }

/* ============ Profil : étiquettes et médailles ============ */
.profil-head { display: flex; align-items: center; gap: 1.2rem; flex-wrap: wrap; }
.profil-head h2 { margin: 0; }
.profil-head p { margin: .1rem 0 .6rem; color: var(--texte-2); }
.avatar.grand { width: 76px; height: 76px; font-size: 2rem; flex: none; }
.chips { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 1rem; margin-top: 1rem; }
.badge-item { display: grid; justify-items: center; gap: .15rem; text-align: center; padding: .9rem .4rem; border-radius: var(--radius); background: var(--bg-2); border: 2px solid transparent; }
.badge-item b { font-size: .9rem; line-height: 1.2; }
.badge-item small { color: var(--texte-2); font-size: .75rem; }
.medal-b { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; font-size: 1.9rem; margin-bottom: .3rem; background: var(--bg); border: 3px dashed var(--border); color: var(--texte-2); }
.badge-item.earned { border-color: var(--or); background: var(--t-or); }
.badge-item.earned .medal-b { background: var(--grad-or); border: 3px solid var(--or-clair); color: var(--nuit); box-shadow: 0 6px 16px rgba(242, 193, 78, .35); }
.badge-item.locked { opacity: .65; }
.badge-item.locked .medal-b { font-size: 1.4rem; filter: grayscale(1); }
.trophees { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: .8rem; margin-top: .8rem; }
.trophy { display: flex; align-items: center; gap: .8rem; padding: .8rem 1rem; border-radius: var(--radius-sm); background: var(--bg-2); border: 2px solid transparent; }
.trophy .t-ico { font-size: 1.9rem; width: 2.4rem; text-align: center; flex: none; }
.trophy b { display: block; }
.trophy small { color: var(--texte-2); }
.trophy.earned { border-color: var(--or); background: var(--t-or); }
.trophy.locked .t-ico { filter: grayscale(1); opacity: .6; }

/* ============ Jeux ============ */
/* Le disque est un carré qui tourne : sa boîte dépasse de l'écran en diagonale (402 px sur un écran de 390). La page s'élargissait alors, et sur téléphone la barre du bas se retrouvait à moitié hors de l'écran. La carte coupe ce débordement. */
.roue-card { overflow: hidden; }
.roue { position: relative; width: min(300px, 100%); aspect-ratio: 1; margin: 1.2rem auto; }
.roue-disque { width: 100%; height: 100%; border-radius: 50%; box-shadow: 0 10px 34px rgba(255, 107, 74, .3), 0 0 0 1px rgba(242, 193, 78, .35); }
.roue-disque svg { display: block; width: 100%; height: 100%; }
.roue-disque.tourne { transition: transform 4.6s cubic-bezier(.12, .7, .1, 1); will-change: transform; }
.roue-pointe { position: absolute; top: -10px; left: 50%; transform: translateX(-50%); z-index: 2; width: 0; height: 0; border-left: 13px solid transparent; border-right: 13px solid transparent; border-top: 26px solid var(--or-clair); filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .5)); }
@media (prefers-reduced-motion: reduce) { .roue-disque.tourne { transition-duration: .5s; } }

/* ============ Tour de parrainage ============ */
.tour { width: min(300px, 86%); margin: 1rem auto .4rem; color: var(--texte-2); }
.tour svg { display: block; width: 100%; height: auto; }
.tour.locked { opacity: .85; }
.tour-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: .6rem; margin-top: 1rem; text-align: center; }
.tour-stats div { background: var(--bg-2); border-radius: var(--radius-sm); padding: .6rem; }
.tour-stats small { display: block; color: var(--texte-2); font-weight: 600; font-size: .75rem; }
.tour-stats strong { font-size: 1.05rem; font-variant-numeric: tabular-nums; }

/* ============ Son ============ */
.icon-btn[aria-pressed=true] { background: var(--t-or); border-color: var(--or); color: var(--or-texte); }
input[type=range] { -webkit-appearance: none; appearance: none; width: min(220px, 100%); height: 6px; border-radius: 99px; background: var(--border); outline-offset: 6px; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 22px; height: 22px; border-radius: 50%; background: var(--grad-or); border: 2px solid var(--violet); cursor: pointer; }
input[type=range]::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: var(--or); border: 2px solid var(--violet); cursor: pointer; }

/* Mot de passe proposé par la plateforme (inscription) */
.mdp-prop { background: var(--creme); border: 1px solid var(--creme-bord); border-radius: var(--radius-sm); padding: .9rem 1rem; margin-bottom: 1rem; color: var(--creme-txt); }
.mdp-prop[hidden] { display: none; }
.mdp-titre { margin: 0 0 .5rem; }
.mdp-ligne { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.mdp-ligne code { flex: 1 1 14rem; padding: .6rem .8rem; background: var(--card); border: 1.5px dashed var(--or); border-radius: var(--radius-sm); font: 700 1.05rem/1.2 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .03em; color: var(--texte); user-select: all; overflow-wrap: anywhere; }
.mdp-aide { font-size: .85rem; margin: .6rem 0 0; }
.mdp-garde { display: flex; gap: .5rem; align-items: flex-start; margin-top: .7rem; font-weight: 700; font-size: .9rem; cursor: pointer; }
.mdp-garde input { margin-top: .2rem; }

/* ======================================================================================================================
   Téléphone d'abord : tout ce qui suit adapte l'application au pouce (barre du bas, feuilles qui montent, zones de toucher larges,
   encoches et barres du système, clavier). L'ordinateur garde sa barre latérale.
   ====================================================================================================================== */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  -webkit-tap-highlight-color: transparent; overscroll-behavior-y: contain;
  overflow-x: hidden; overflow-x: clip; /* filet de sécurité : aucun élément ne doit élargir la page (voir .roue-card) */
  padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right);
}
a, button, [role=button], label, input, select, summary { touch-action: manipulation; } /* pas de zoom au double toucher, pas de délai */
button, .btn, .tabbar a, .feuille a { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
body.fige { overflow: hidden; }
.auth-wrap { min-height: 100dvh; }
.app { min-height: 100dvh; }
.sidebar { height: 100dvh; }

/* Retour au toucher : l'élément s'enfonce légèrement */
.btn, .icon-btn, .palier-card, .quest, .reward, .tabbar a, .tabbar button, .feuille a, .solde-chip, .lvl-chip { transition: transform .12s, box-shadow .15s, background .15s, filter .15s; }
.btn:active, .icon-btn:active, .solde-chip:active, .lvl-chip:active { transform: scale(.96); }
.palier-card:active, .quest:active, .reward:active { transform: scale(.98); }
@media (hover: none) { .btn:hover, .palier-card:hover { transform: none; } .palier-card:hover { border-color: var(--border); } } /* pas de survol « collé » sur un écran tactile */

/* Zones de toucher d'au moins 44 px */
@media (pointer: coarse) {
  .btn { min-height: 46px; }
  .btn-sm { min-height: 44px; padding: .55rem 1.1rem; }
  .icon-btn { width: 44px; height: 44px; }
  .seg button { min-height: 40px; padding: .5rem 1rem; }
  .switch { width: 56px; height: 32px; }
  .switch span[aria-hidden]::after { width: 26px; height: 26px; }
  .switch input:checked + span::after { transform: translateX(24px); }
  .mdp-garde input, .field input[type=checkbox] { width: 22px; height: 22px; }
  .pin-pad button { width: 78px; height: 78px; }
}
/* 16 px minimum dans les champs : en dessous, le navigateur de l'iPhone zoome sur la page à chaque saisie */
@media (max-width: 900px) { input, select, textarea { font-size: 16px; } }

/* Animations d'entrée et de feu d'artifice */
.page.entre { animation: entree .26s cubic-bezier(.2, .8, .3, 1); }
@keyframes entree { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.page.secoue { animation: secousse .5s cubic-bezier(.36, .07, .19, .97); }
@keyframes secousse {
  10%, 90% { transform: translate3d(calc(-1px * var(--sec, 1)), 0, 0); } 20%, 80% { transform: translate3d(calc(3px * var(--sec, 1)), 0, 0); }
  30%, 50%, 70% { transform: translate3d(calc(-5px * var(--sec, 1)), 0, 0); } 40%, 60% { transform: translate3d(calc(5px * var(--sec, 1)), 0, 0); }
}
.etincelles { position: fixed; inset: 0; pointer-events: none; z-index: 300; overflow: hidden; }
.etincelles i { position: absolute; border-radius: 50%; box-shadow: 0 0 8px currentColor; }
.barre-chargement { position: fixed; top: 0; left: 0; height: 3px; width: 0; z-index: 400; background: var(--grad-barre); box-shadow: 0 0 10px rgba(255, 107, 74, .6); opacity: 0; transition: width .35s ease-out, opacity .2s; pointer-events: none; }
.barre-chargement.actif { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .page.entre, .page.secoue, .feuille, .feuille-bg, .modal.bas { animation: none; transition: none; } }

/* Fenêtre de confirmation et invitation à activer le son */
.modal .poignee, .feuille .poignee { width: 44px; height: 5px; border-radius: 99px; background: var(--border); margin: .1rem auto .9rem; display: none; }
.modal.bas h3 { font-size: 1.25rem; }
.cf-actions { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; margin-top: 1.2rem; }
.invite-son { position: fixed; left: 50%; bottom: calc(1rem + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 55; width: min(460px, calc(100% - 2rem));
  display: flex; align-items: center; justify-content: space-between; gap: .8rem; flex-wrap: wrap; padding: .9rem 1rem; border-radius: var(--radius);
  background: var(--card); color: var(--texte); border: 1px solid var(--creme-bord); box-shadow: var(--shadow-lg); animation: monte-carte .35s cubic-bezier(.2, .9, .3, 1); }
.invite-son.part { opacity: 0; transform: translate(-50%, 16px); transition: .2s; }
.invite-txt { display: grid; gap: .1rem; flex: 1 1 220px; min-width: 0; }
.invite-txt span { color: var(--texte-2); font-size: .88rem; }
.invite-act { display: flex; gap: .5rem; margin-left: auto; }
@keyframes monte-carte { from { opacity: 0; transform: translate(-50%, 24px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* Barre du bas et feuille « Plus » : réservées au téléphone et à la tablette */
.appbar-marque { display: none; flex: none; }
.tabbar, .feuille, .feuille-bg { display: none; }
@media (max-width: 900px) {
  .app { display: block; }
  .sidebar, .menu-toggle, .appbar .search, .appbar .outils { display: none; }
  .main { padding: 0 1rem calc(88px + env(safe-area-inset-bottom)); }
  .appbar { position: sticky; top: 0; z-index: 25; margin: 0 -1rem 1rem; padding: calc(.55rem + env(safe-area-inset-top)) 1rem .55rem; gap: .5rem; flex-wrap: nowrap;
    background: var(--topbar); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border-bottom: 1px solid var(--border); }
  .appbar-marque { display: grid; place-items: center; width: 44px; height: 44px; }
  .appbar .lvl-chip { display: inline-flex; align-items: center; gap: .25rem; min-height: 44px; padding: 0 .8rem; }
  .appbar .solde-chip { min-height: 44px; }
  .appbar .avatar { width: 44px; height: 44px; }
  .appbar .solde-chip { margin-left: 0; flex: 1; justify-content: center; min-width: 0; }
  .appbar .solde-chip .solde-lbl { display: inline; }
  .notif-panel { position: fixed; left: 1rem; right: 1rem; top: calc(64px + env(safe-area-inset-top)); width: auto; }
  .toast { bottom: calc(86px + env(safe-area-inset-bottom)); max-width: calc(100% - 2rem); text-align: center; }
  body:has(.tabbar) .invite-son { bottom: calc(86px + env(safe-area-inset-bottom)); }

  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 35; padding: .3rem .4rem calc(.3rem + env(safe-area-inset-bottom));
    background: var(--topbar); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); border-top: 1px solid var(--border); transition: transform .2s;
    /* Calque à part : sur iPhone, une animation lourde dans la page (roue qui tourne) peut faire sauter une barre fixe floutée */
    transform: translate3d(0, 0, 0); -webkit-transform: translate3d(0, 0, 0); will-change: transform; }
  .tabbar a, .tabbar button { position: relative; display: grid; justify-items: center; align-content: center; gap: .2rem; min-height: 54px; padding: .35rem 0; border: 0; border-radius: 16px;
    background: none; color: var(--texte-2); font: 700 .68rem/1 var(--font); }
  .tabbar svg { width: 24px; height: 24px; }
  .tabbar .active { color: var(--or-texte); }
  .tabbar .active::before { content: ""; position: absolute; top: -.3rem; left: 50%; width: 28px; height: 3px; margin-left: -14px; border-radius: 0 0 4px 4px; background: var(--or); }
  .tabbar .pastille { position: absolute; top: 4px; left: calc(50% + 6px); min-width: 17px; height: 17px; padding: 0 4px; border-radius: 99px; background: var(--corail); color: var(--nuit); font-size: .66rem; display: grid; place-items: center; }
  body.clavier .tabbar { transform: translate3d(0, 110%, 0); } /* le clavier ouvert prend la place : la barre s'efface (classe posée par main.js, seulement pour un champ de texte avec clavier réellement ouvert) */

  .feuille-bg { display: block; position: fixed; inset: 0; z-index: 60; background: var(--modal-fond); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); opacity: 0; transition: opacity .24s; }
  .feuille-bg.ouvert { opacity: 1; }
  .feuille { display: block; position: fixed; left: 0; right: 0; bottom: 0; z-index: 61; max-height: 88dvh; overflow-y: auto; overscroll-behavior: contain;
    padding: .7rem 1rem calc(1rem + env(safe-area-inset-bottom)); background: var(--card); border: 1px solid var(--border); border-bottom: 0; border-radius: 28px 28px 0 0;
    box-shadow: var(--shadow-lg); transform: translateY(100%); transition: transform .28s cubic-bezier(.2, .9, .3, 1); }
  .feuille.ouvert { transform: none; }
  .feuille[hidden], .feuille-bg[hidden] { display: none; }
  .feuille .poignee, .modal.bas .poignee { display: block; }
  .feuille-liens { display: grid; gap: .2rem; }
  .feuille-liens a { display: flex; align-items: center; gap: .9rem; min-height: 54px; padding: .5rem .8rem; border-radius: 16px; color: var(--texte); font-weight: 600; }
  .feuille-liens a:active { background: var(--ghost-hover); }
  .feuille-liens a.active { background: var(--t-or); color: var(--or-texte); }
  .feuille-liens svg { width: 22px; height: 22px; flex: none; }
  .feuille-outils { display: flex; align-items: center; justify-content: space-between; gap: .8rem; margin: .8rem 0; padding: .8rem; border-radius: 16px; background: var(--bg-2); font-weight: 600; font-size: .92rem; }
  .feuille-outils .outils { display: flex; }

  .modal-bg.bas { place-items: end stretch; padding: 0; }
  .modal.bas { width: 100%; border-radius: 28px 28px 0 0; padding: .7rem 1.2rem calc(1.2rem + env(safe-area-inset-bottom)); animation: monte-feuille .28s cubic-bezier(.2, .9, .3, 1); }
  @keyframes monte-feuille { from { transform: translateY(100%); } to { transform: none; } }
}
@media (min-width: 901px) { .tabbar, .feuille, .feuille-bg { display: none !important; } }

/* Contenu : deux colonnes là où une seule laissait des cartes très hautes, textes et marges resserrés */
@media (max-width: 600px) {
  .page-title { font-size: 1.45rem; margin-bottom: .8rem; }
  .card { padding: 1rem; }
  .paliers-grid, .tiers { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; }
  .palier-card { padding: 1rem .6rem; }
  .palier-card .ico { font-size: 2.2rem; }
  .palier-card .prix { font-size: 1rem; margin-bottom: .6rem; }
  .palier-card h3, .palier-card h4 { font-size: .98rem; }
  .reward { padding: .9rem .5rem; }
  .reward .ico { font-size: 2.1rem; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; margin: 1rem 0; }
  .stat { flex-direction: column; align-items: flex-start; gap: .3rem; padding: .9rem; }
  .stat .ico { font-size: 1.6rem; }
  .stat strong, .stats .stat strong { font-size: 1.05rem; }
  .banner { padding: 1.2rem; }
  .banner .deco { font-size: 2.4rem; }
  .xp-hero .xp-who { width: 100%; }
  .grid-2 { gap: .8rem; }
  .sec-title { margin-top: 1.5rem; font-size: 1.2rem; }
  .quest { padding: .9rem; }
  .steps { gap: .8rem; }
  .step { padding: 1.1rem; }
  section.block { padding: 2.4rem 0; }
  .hero .container { padding-block: 2rem; gap: 1.5rem; }
  .hero .cta .btn { flex: 1 1 140px; }
  .set-row { gap: .6rem; }
  .set-row .seg { max-width: 100%; }
  .tour-stats { grid-template-columns: 1fr; }
}

/* Pages de connexion : l'illustration devient une bannière, la carte la chevauche */
@media (max-width: 820px) {
  .auth-wrap { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .auth-side { display: block; height: 180px; padding: 0; background: none; }
  .auth-side img { width: 100%; height: 100%; max-height: none; object-fit: cover; object-position: center 38%; border-radius: 0 0 30px 30px; box-shadow: var(--shadow-lg); }
  .auth-main { align-items: start; padding: 0 1rem calc(2rem + env(safe-area-inset-bottom)); margin-top: -2.4rem; position: relative; z-index: 2; }
  .auth-card { padding: 1.4rem; }
  .float-tools { top: calc(.6rem + env(safe-area-inset-top)); right: calc(.6rem + env(safe-area-inset-right)); }
  .float-tools .icon-btn { background: var(--topbar); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
}
.topbar { padding-top: env(safe-area-inset-top); }
.pin-bg { padding: calc(1rem + env(safe-area-inset-top)) 1rem calc(1rem + env(safe-area-inset-bottom)); min-height: 100dvh; }

/* Petits téléphones : la barre du haut garde l'essentiel (le profil est dans « Plus ») */
@media (max-width: 480px) {
  .appbar .avatar, .appbar .solde-chip .solde-lbl { display: none; }
  .appbar .lvl-chip { padding: 0 .65rem; }
}

/* Correctifs téléphone : colonne du héros qui peut rétrécir, message qui s'étale, interrupteurs à côté de leur texte, titres équilibrés */
h1, h2, h3 { text-wrap: balance; }
.toast { width: max-content; max-width: calc(100vw - 2rem); }
@media (max-width: 820px) {
  .hero .container { grid-template-columns: minmax(0, 1fr); }
  .hero-img { width: 100%; height: auto; }
}
@media (max-width: 600px) {
  .banner .deco { display: none; }
  .set-row:has(.switch) { flex-wrap: nowrap; }
  .set-row:has(.switch) > div:first-child { flex: 1; min-width: 0; }
  .set-row:has(.switch) p { max-width: none; }
}

/* Attente du serveur : écran de chargement et bandeau « le serveur se réveille » */
.splash { min-height: 100dvh; display: grid; place-content: center; justify-items: center; gap: 1.4rem; background: var(--page); }
.splash .brand-mark { width: 72px; height: 72px; border-radius: 20px; animation: respire 1.6s ease-in-out infinite; }
.splash-points { display: flex; gap: .5rem; }
.splash-points i { width: 9px; height: 9px; border-radius: 50%; background: var(--or); animation: point 1.2s ease-in-out infinite; }
.splash-points i:nth-child(2) { animation-delay: .15s; } .splash-points i:nth-child(3) { animation-delay: .3s; }
@keyframes respire { 50% { transform: scale(1.07); box-shadow: 0 0 34px rgba(242, 193, 78, .45); } }
@keyframes point { 0%, 80%, 100% { opacity: .25; transform: scale(.8); } 40% { opacity: 1; transform: scale(1.15); } }
.reveil { position: fixed; top: calc(.7rem + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); z-index: 420; width: max-content; max-width: calc(100vw - 2rem);
  display: flex; align-items: center; gap: .6rem; padding: .6rem 1rem; border-radius: 999px; background: var(--card); color: var(--texte); border: 1px solid var(--creme-bord);
  box-shadow: var(--shadow-lg); font-size: .92rem; font-weight: 600; animation: monte-carte .3s cubic-bezier(.2, .9, .3, 1); }
.reveil i { flex: none; width: 16px; height: 16px; border-radius: 50%; border: 2.5px solid var(--border); border-top-color: var(--or); animation: tourne 0.8s linear infinite; }
@keyframes tourne { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .splash .brand-mark, .splash-points i, .reveil, .reveil i { animation: none; } }

/* Vérification du numéro à l'inscription (WhatsApp ou Telegram) */
.verif { display: grid; gap: .6rem; padding: 1rem; margin-bottom: 1rem; background: var(--creme); border: 1px solid var(--creme-bord); border-radius: var(--radius-sm); color: var(--creme-txt); }
.verif[hidden] { display: none; }
.verif h2 { margin: 0; font-size: 1.15rem; color: var(--creme-txt); }
.verif-aide { margin: 0; font-size: .9rem; }
.verif-aide[hidden], .verif a[hidden] { display: none; }
/* Mot de passe oublié : les trois étapes se masquent avec l'attribut hidden, que « .field » et « .btn » (qui définissent display) ne doivent pas écraser. */
#f-oubli [hidden] { display: none !important; }
.verif-etat { margin: .2rem 0 0; font-weight: 700; }
.verif .btn-sm { justify-self: start; }

/* ============ Utilitaires (audit SV-17) ============
   Ils remplacent les attributs style="…" des gabarits : la politique de sécurité du site n'autorise plus les styles en ligne.
   « !important » : un style en ligne l'emportait toujours sur une règle de feuille ; ces classes gardent le même rendu qu'avant. */
.u-muted { color: var(--texte-2) !important; }
.u-w500 { font-weight: 500 !important; }
.u-small { font-size: .9rem !important; }
.u-center { text-align: center !important; }
.u-self-start { justify-self: start !important; }
.u-scroll-x { overflow-x: auto !important; }
.u-mw-520 { max-width: 520px !important; }
.u-mw-560 { max-width: 560px !important; }
.u-mt-auto { margin-top: auto !important; }
.u-mt-03 { margin-top: .3rem !important; }
.u-mt-08 { margin-top: .8rem !important; }
.u-mt-10 { margin-top: 1rem !important; }
.u-mt-12 { margin-top: 1.2rem !important; }
.u-mt-m06 { margin-top: -.6rem !important; }
.u-mb-06 { margin-bottom: .6rem !important; }
.u-mb-10 { margin-bottom: 1rem !important; }
.u-my-08 { margin: .8rem 0 !important; }
.u-m-100 { margin: 1rem 0 0 !important; }
.u-m-040 { margin: .4rem 0 0 !important; }
