/* ==========================================================================
   LEXAVIRA — Système de design (tokens + composants)
   Dark premium par défaut, thème clair togglable. Zéro valeur en dur ailleurs.
   Base d'espacement : 4px. Tout consomme ces variables.
   ========================================================================== */

/* ---- Polices self-hébergées (woff2 latin, compatibles CSP stricte 'self') ---- */
@font-face {
  font-family: 'Clash Display';
  src: url('../fonts/ClashDisplay.woff2') format('woff2');
  font-weight: 200 700;
  font-display: swap;
}
@font-face {
  font-family: 'Space Grotesk';
  src: url('../fonts/SpaceGrotesk.woff2') format('woff2');
  font-weight: 300 700;
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('../fonts/Inter.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}

/* ============================ TOKENS ============================ */
:root {
  /* Palette — thème sombre (défaut) */
  --bg:            #0B0E17;
  --bg-1:          #0F1320;
  --bg-2:          #151B2B;
  --surface:       rgba(255, 255, 255, 0.035);
  --surface-2:     rgba(255, 255, 255, 0.06);
  --glass:         rgba(19, 24, 38, 0.55);
  --border:        rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);

  --text:          #EDF0F6;
  --text-soft:     #C2C9D6;
  --text-muted:    #8A93A6;
  --text-faint:    #5B6474;

  /* Accent électrique signature (violet -> indigo) */
  --accent:        #7C5CFC;
  --accent-2:      #9D7BFF;
  --accent-ink:    #FFFFFF;
  --accent-glow:   rgba(124, 92, 252, 0.45);

  /* Accent secondaire (cyan) pour les dégradés/contrastes */
  --cyan:          #22D3EE;

  /* Couleur signature du COIN (or/ambre lumineux) */
  --coin:          #F7B733;
  --coin-2:        #FFD976;
  --coin-glow:     rgba(247, 183, 51, 0.40);

  /* Sémantiques */
  --success:       #34D399;
  --danger:        #FB7185;
  --warning:       #FBBF24;
  --info:          #38BDF8;

  /* Typographie */
  --font-display: 'Clash Display', 'Space Grotesk', system-ui, sans-serif;
  --font-body:    'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  --fs-xs:   0.75rem;   /* 12 */
  --fs-sm:   0.875rem;  /* 14 */
  --fs-base: 1rem;      /* 16 */
  --fs-lg:   1.125rem;  /* 18 */
  --fs-xl:   1.375rem;  /* 22 */
  --fs-2xl:  1.75rem;   /* 28 */
  --fs-3xl:  2.375rem;  /* 38 */
  --fs-4xl:  3.25rem;   /* 52 */
  --fs-5xl:  4.5rem;    /* 72 */

  /* Espacements (base 4px) */
  --s-1: 4px;   --s-2: 8px;   --s-3: 12px;  --s-4: 16px;
  --s-5: 20px;  --s-6: 24px;  --s-8: 32px;  --s-10: 40px;
  --s-12: 48px; --s-16: 64px; --s-20: 80px; --s-24: 96px;

  /* Rayons */
  --r-sm: 8px;  --r-md: 12px; --r-lg: 18px; --r-xl: 26px; --r-full: 999px;

  /* Ombres multi-couches */
  --shadow-sm: 0 1px 2px rgba(0,0,0,.30);
  --shadow-md: 0 8px 24px -8px rgba(0,0,0,.45);
  --shadow-lg: 0 24px 60px -18px rgba(0,0,0,.60);
  --shadow-glow: 0 0 0 1px var(--border), 0 12px 40px -12px var(--accent-glow);

  /* Animations */
  --ease: cubic-bezier(.22, 1, .36, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --dur-1: .12s;  --dur-2: .22s;  --dur-3: .4s;  --dur-4: .7s;

  --maxw: 1200px;
  --nav-h: 68px;
}

/* Thème clair */
:root[data-theme="light"] {
  --bg:            #F6F7FB;
  --bg-1:          #FFFFFF;
  --bg-2:          #FFFFFF;
  --surface:       rgba(15, 19, 32, 0.02);
  --surface-2:     rgba(15, 19, 32, 0.045);
  --glass:         rgba(255, 255, 255, 0.75);
  --border:        rgba(11, 14, 23, 0.09);
  --border-strong: rgba(11, 14, 23, 0.16);

  --text:          #0C1120;
  --text-soft:     #2A3346;
  --text-muted:    #5B6577;
  --text-faint:    #8A93A6;

  --accent-glow:   rgba(124, 92, 252, 0.28);
  --coin-glow:     rgba(247, 183, 51, 0.30);

  --shadow-sm: 0 1px 2px rgba(16,24,40,.06);
  --shadow-md: 0 8px 24px -10px rgba(16,24,40,.18);
  --shadow-lg: 0 24px 60px -20px rgba(16,24,40,.24);
}

/* ============================ RESET ============================ */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }

/* Scrollbars premium : fines, thémées, discrètes (Firefox + WebKit) */
* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--border-strong); border-radius: 999px;
  border: 3px solid transparent; background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: color-mix(in srgb, var(--accent) 55%, var(--text-faint)); background-clip: content-box; }
::-webkit-scrollbar-corner { background: transparent; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
ul { list-style: none; padding: 0; }

/* Fond ambiant : aurores dégradées superposées + dérive lente */
body::before {
  content: "";
  position: fixed; inset: -20%; z-index: -2;
  background:
    radial-gradient(45% 38% at 12% -8%, rgba(124,92,252,.22), transparent 62%),
    radial-gradient(42% 34% at 102% 4%, rgba(34,211,238,.13), transparent 58%),
    radial-gradient(55% 45% at 50% 118%, rgba(124,92,252,.14), transparent 62%),
    radial-gradient(30% 30% at 80% 60%, rgba(247,183,51,.06), transparent 60%);
  pointer-events: none;
  animation: aurora 26s ease-in-out infinite alternate;
}
@keyframes aurora {
  0%   { transform: translate3d(0,0,0) scale(1); }
  100% { transform: translate3d(-2%, 1.5%, 0) scale(1.06); }
}
/* Grain filmique très discret (premium, non intrusif) */
body::after {
  content: "";
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  opacity: .035; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
:root[data-theme="light"] body::after { opacity: .02; mix-blend-mode: multiply; }
@media (prefers-reduced-motion: reduce) { body::before { animation: none; } }

/* ============================ TYPOGRAPHIE ============================ */
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; line-height: 1.08; letter-spacing: -.02em; color: var(--text); }
h1 { font-size: clamp(2.4rem, 5vw, var(--fs-5xl)); letter-spacing: -.035em; }
h2 { font-size: clamp(1.8rem, 3.4vw, var(--fs-3xl)); letter-spacing: -.03em; }
h3 { font-size: var(--fs-xl); }
.text-muted { color: var(--text-muted); }
.text-soft { color: var(--text-soft); }
.text-gradient {
  background: linear-gradient(100deg, var(--text) 20%, var(--accent-2) 60%, var(--cyan) 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.eyebrow {
  font-size: var(--fs-xs); letter-spacing: .18em; text-transform: uppercase;
  color: var(--accent-2); font-weight: 600;
}

/* ============================ LAYOUT ============================ */
.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--s-6); }
.section { padding-block: var(--s-24); }
.grid { display: grid; gap: var(--s-6); }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: var(--s-2); } .gap-3 { gap: var(--s-3); } .gap-4 { gap: var(--s-4); } .gap-6 { gap: var(--s-6); }

/* ============================ NAV ============================ */
.nav {
  position: sticky; top: 0; z-index: 50; height: var(--nav-h);
  display: flex; align-items: center;
  backdrop-filter: blur(16px) saturate(160%);
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  border-bottom: 1px solid var(--border);
}
.nav .container { display: flex; align-items: center; justify-content: space-between; }

/* Barre admin : marque + outils sur une ligne, onglets sur une barre dédiée en dessous. */
.nav.nav-admin { position: static; height: auto; display: block; }
.nav.nav-admin .admin-bar { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); min-height: var(--nav-h); flex-wrap: wrap; row-gap: 8px; }
.nav.nav-admin .admin-tools { display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap; justify-content: flex-end; }
.nav.nav-admin .admin-tabs { border-top: 1px solid var(--border); }
.nav.nav-admin .admin-tabs .nav-links { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; padding-block: 10px; }
.nav.nav-admin .admin-tabs .nav-links a { padding: 6px 12px; border-radius: 9px; white-space: nowrap; font-size: var(--fs-sm); }
.nav.nav-admin .admin-tabs .nav-links a:hover { background: color-mix(in srgb, var(--text) 8%, transparent); color: var(--text); }
.nav.nav-admin .admin-tabs .nav-links a.active { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--text); font-weight: 600; }
.brand { display: flex; align-items: center; gap: var(--s-3); font-family: var(--font-display); font-weight: 600; font-size: var(--fs-lg); letter-spacing: -.02em; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center;
  background: linear-gradient(135deg, #8E6DFF, var(--accent) 45%, var(--cyan));
  box-shadow: 0 6px 20px -6px var(--accent-glow), inset 0 1px 0 rgba(255,255,255,.4);
  color: #fff; font-weight: 700; font-family: var(--font-display); letter-spacing: -.02em;
}
.nav-links { display: flex; align-items: center; gap: var(--s-6); }
.nav-links a { color: var(--text-muted); font-size: var(--fs-sm); font-weight: 500; transition: color var(--dur-2) var(--ease); }
.nav-links a:hover { color: var(--text); }

/* ============================ BOUTONS ============================ */
.btn {
  --pad-y: 11px; --pad-x: 18px;
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  padding: var(--pad-y) var(--pad-x); border-radius: var(--r-md);
  font-weight: 600; font-size: var(--fs-sm); cursor: pointer;
  border: 1px solid transparent; white-space: nowrap;
  transition: transform var(--dur-2) var(--ease), box-shadow var(--dur-2) var(--ease), background var(--dur-2) var(--ease), border-color var(--dur-2) var(--ease);
}
.btn:active { transform: translateY(1px) scale(.99); }
.btn-primary {
  color: var(--accent-ink);
  background: linear-gradient(135deg, #8E6DFF 0%, var(--accent) 45%, #6A46F0 100%);
  box-shadow: 0 10px 30px -10px var(--accent-glow), inset 0 1px 0 rgba(255,255,255,.28), inset 0 -1px 0 rgba(0,0,0,.15);
}
.btn-primary:hover { box-shadow: 0 18px 46px -12px var(--accent-glow), inset 0 1px 0 rgba(255,255,255,.35); transform: translateY(-1.5px); }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-ghost:hover { background: var(--surface-2); border-color: var(--border-strong); }
.btn-coin {
  color: #2A1A00; background: linear-gradient(135deg, var(--coin-2), var(--coin));
  box-shadow: 0 10px 30px -10px var(--coin-glow), inset 0 1px 0 rgba(255,255,255,.4);
}
.btn-coin:hover { transform: translateY(-1px); box-shadow: 0 16px 40px -12px var(--coin-glow); }
.btn-sm { --pad-y: 8px; --pad-x: 13px; font-size: var(--fs-xs); }
.btn-lg { --pad-y: 15px; --pad-x: 26px; font-size: var(--fs-base); border-radius: var(--r-lg); }
.btn-block { display: flex; width: 100%; }
.btn-danger { background: color-mix(in srgb, var(--danger) 16%, transparent); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 30%, transparent); }

/* ============================ TOGGLE DE THÈME (soleil/lune) ============================ */
.theme-toggle { display: inline-grid; place-items: center; width: 38px; height: 34px; padding: 0; }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .moon { display: none; }
:root[data-theme="light"] .theme-toggle .sun { display: none; }
:root[data-theme="light"] .theme-toggle .moon { display: inline-flex; }

/* ============================ COIN VAULT ============================ */
.vault-safe {
  position: relative; width: 84px; height: 84px; border-radius: 22px; flex-shrink: 0;
  display: grid; place-items: center;
  background: radial-gradient(circle at 35% 28%, var(--coin-2), var(--coin) 65%, #B97F1A 100%);
  box-shadow: 0 0 40px -6px var(--coin-glow), inset 0 -6px 12px rgba(120,60,0,.35), inset 0 3px 6px rgba(255,255,255,.5);
  animation: vault-glow 3.5s var(--ease) infinite;
}
@keyframes vault-glow { 0%,100% { box-shadow: 0 0 34px -8px var(--coin-glow), inset 0 -6px 12px rgba(120,60,0,.35), inset 0 3px 6px rgba(255,255,255,.5); } 50% { box-shadow: 0 0 52px -4px var(--coin-glow), inset 0 -6px 12px rgba(120,60,0,.35), inset 0 3px 6px rgba(255,255,255,.5); } }
.vault-safe .dial { width: 34px; height: 34px; border-radius: 50%; border: 3px solid rgba(74,36,2,.55); position: relative; }
.vault-safe .dial::after { content: ""; position: absolute; inset: 8px; border-radius: 50%; border: 2px solid rgba(74,36,2,.4); }
.vault-safe .dial::before { content: ""; position: absolute; left: 50%; top: -4px; width: 3px; height: 12px; background: rgba(74,36,2,.55); transform: translateX(-50%); border-radius: 2px; }
.plan-card { cursor: pointer; border: 1px solid var(--border); border-radius: var(--r-lg); padding: var(--s-4); transition: border-color var(--dur-2) var(--ease), background var(--dur-2) var(--ease); background: var(--surface); }
.plan-card:hover { border-color: var(--border-strong); }
.plan-card input { position: absolute; opacity: 0; }
.plan-card.selected,
.plan-card:has(input:checked) { border-color: var(--coin); background: color-mix(in srgb, var(--coin) 8%, transparent); box-shadow: 0 0 0 1px var(--coin); }
.plan-apr { font-family: var(--font-display); font-size: var(--fs-2xl); font-weight: 600; color: var(--coin); }

/* ============================ ROUE DE LA FORTUNE ============================ */
.wheel-wrap { position: relative; width: 280px; height: 280px; margin-inline: auto; max-width: 100%; }
.wheel {
  width: 100%; height: 100%; border-radius: 50%; position: relative;
  border: 6px solid var(--bg-2);
  box-shadow: 0 0 0 3px var(--coin), 0 20px 55px -14px var(--coin-glow), inset 0 0 30px rgba(0,0,0,.25);
  transition: transform 4.6s cubic-bezier(.15, .72, .16, 1);
  will-change: transform;
}
.wheel-seg-label { position: absolute; left: 50%; top: 50%; font-family: var(--font-display); font-weight: 600; font-size: var(--fs-sm); color: var(--text); white-space: nowrap; }
.wheel-hub {
  position: absolute; inset: 0; margin: auto; width: 58px; height: 58px; border-radius: 50%; z-index: 2;
  background: radial-gradient(circle at 35% 30%, var(--coin-2), var(--coin) 70%);
  box-shadow: 0 4px 16px rgba(0,0,0,.45), inset 0 -3px 6px rgba(120,60,0,.4), inset 0 2px 4px rgba(255,255,255,.5);
  display: grid; place-items: center;
}
.wheel-pointer {
  position: absolute; top: -4px; left: 50%; transform: translateX(-50%); z-index: 3;
  width: 0; height: 0; border-left: 13px solid transparent; border-right: 13px solid transparent;
  border-top: 24px solid var(--coin-2); filter: drop-shadow(0 3px 4px rgba(0,0,0,.55));
}

/* ============================ SÉLECTEUR DE LANGUE ============================ */
.lang-switch { display: inline-flex; align-items: center; padding: 3px; gap: 2px; border-radius: var(--r-full); background: var(--surface); border: 1px solid var(--border); }
.lang-opt { font-size: 11px; font-weight: 700; letter-spacing: .04em; color: var(--text-muted); padding: 4px 9px; border-radius: var(--r-full); transition: color var(--dur-2) var(--ease), background var(--dur-2) var(--ease); }
.lang-opt:hover { color: var(--text); }
.lang-opt.active { color: var(--accent-ink); background: linear-gradient(135deg, var(--accent), #6D4DF0); box-shadow: 0 4px 12px -4px var(--accent-glow); }

/* ============================ CARTES ============================ */
.card {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--s-6);
  box-shadow: var(--shadow-md);
}
.card-glass {
  position: relative;
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  backdrop-filter: blur(22px) saturate(160%);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
}
/* Bordure dégradée 1px (lumière en haut à gauche, accent en bas à droite) */
.card-glass::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px;
  background: linear-gradient(140deg, rgba(255,255,255,.28), rgba(255,255,255,.04) 34%, transparent 55%, var(--accent-glow));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  pointer-events: none; z-index: 0;
}
.card-glass > * { position: relative; z-index: 1; }
.card-hover { transition: transform var(--dur-3) var(--ease), border-color var(--dur-3) var(--ease), box-shadow var(--dur-3) var(--ease); }
.card-hover:hover { transform: translateY(-4px); border-color: var(--border-strong); box-shadow: var(--shadow-lg); }

/* ============================ BADGES / PILLS ============================ */
.pill {
  display: inline-flex; align-items: center; gap: var(--s-2);
  padding: 5px 11px; border-radius: var(--r-full);
  font-size: var(--fs-xs); font-weight: 600; letter-spacing: .01em;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text-soft);
}
.pill-live { color: var(--success); border-color: color-mix(in srgb, var(--success) 35%, transparent); background: color-mix(in srgb, var(--success) 12%, transparent); }
.pill-demo { color: var(--coin); border-color: color-mix(in srgb, var(--coin) 35%, transparent); background: color-mix(in srgb, var(--coin) 10%, transparent); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 0 currentColor; }
.pill-live .dot { animation: pulse 1.8s var(--ease) infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--success) 60%, transparent); } 70% { box-shadow: 0 0 0 7px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

/* ============================ COIN DISPLAY ============================ */
.coin-badge {
  display: inline-flex; align-items: center; gap: var(--s-2);
  color: var(--coin); font-weight: 700; font-variant-numeric: tabular-nums;
}
.coin-orb {
  width: 22px; height: 22px; border-radius: 50%;
  background: radial-gradient(circle at 34% 28%, #FFF0C4, var(--coin-2) 38%, var(--coin) 72%, #C9871B 100%);
  box-shadow: 0 0 16px -2px var(--coin-glow), inset 0 -2px 4px rgba(120,60,0,.45), inset 0 1.5px 1.5px rgba(255,255,255,.65);
  flex-shrink: 0;
}
.balance-hero {
  font-family: var(--font-display); font-weight: 600; letter-spacing: -.03em;
  font-size: clamp(2.6rem, 7vw, 4.4rem); line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--coin);
  text-shadow: 0 0 40px var(--coin-glow);
}

/* ============================ FORMULAIRES ============================ */
.field { display: flex; flex-direction: column; gap: var(--s-2); margin-bottom: var(--s-5); }
.label { font-size: var(--fs-sm); font-weight: 600; color: var(--text-soft); }
.input {
  width: 100%; padding: 13px 15px; border-radius: var(--r-md);
  background: var(--bg-2); border: 1px solid var(--border); color: var(--text);
  transition: border-color var(--dur-2) var(--ease), box-shadow var(--dur-2) var(--ease);
}
.input::placeholder { color: var(--text-faint); }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-glow); }
.checkbox-row { display: flex; align-items: flex-start; gap: var(--s-3); font-size: var(--fs-sm); color: var(--text-muted); }
.checkbox-row input { margin-top: 3px; accent-color: var(--accent); width: 16px; height: 16px; }

/* ============================ ALERTES ============================ */
.alert { padding: var(--s-4) var(--s-5); border-radius: var(--r-md); font-size: var(--fs-sm); font-weight: 500; margin-bottom: var(--s-5); border: 1px solid; }
.alert-success { background: color-mix(in srgb, var(--success) 12%, transparent); border-color: color-mix(in srgb, var(--success) 30%, transparent); color: color-mix(in srgb, var(--success) 85%, white); }
.alert-error { background: color-mix(in srgb, var(--danger) 12%, transparent); border-color: color-mix(in srgb, var(--danger) 30%, transparent); color: color-mix(in srgb, var(--danger) 88%, white); }

/* ============================ TABLES ============================ */
.table-wrap { overflow-x: auto; border-radius: var(--r-lg); border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
th { text-align: left; padding: var(--s-3) var(--s-4); color: var(--text-muted); font-weight: 600; font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .06em; border-bottom: 1px solid var(--border); }
td { padding: var(--s-4); border-bottom: 1px solid var(--border); color: var(--text-soft); }
tr:last-child td { border-bottom: none; }
.amount-pos { color: var(--success); font-weight: 600; font-variant-numeric: tabular-nums; }
.amount-neg { color: var(--danger); font-weight: 600; font-variant-numeric: tabular-nums; }

/* ============================ PROGRESS ============================ */
.progress { height: 10px; border-radius: var(--r-full); background: var(--surface-2); overflow: hidden; border: 1px solid var(--border); }
.progress-bar { height: 100%; border-radius: var(--r-full); background: linear-gradient(90deg, var(--accent), var(--cyan)); box-shadow: 0 0 18px -2px var(--accent-glow); transition: width var(--dur-4) var(--ease-out); }

/* ============================ STAT TILES ============================ */
.stat { padding: var(--s-5); border-radius: var(--r-lg); background: var(--bg-1); border: 1px solid var(--border); }
.stat-label { font-size: var(--fs-xs); color: var(--text-muted); text-transform: uppercase; letter-spacing: .07em; font-weight: 600; }
.stat-value { font-family: var(--font-display); font-size: var(--fs-2xl); font-weight: 600; margin-top: var(--s-2); font-variant-numeric: tabular-nums; }

/* ============================ APP SHELL (auth) ============================ */
.app { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; padding: var(--s-5) var(--s-3);
  border-right: 1px solid var(--border); background: color-mix(in srgb, var(--bg-1) 70%, transparent);
  backdrop-filter: blur(12px); display: flex; flex-direction: column; gap: 3px;
  overflow-y: auto; overscroll-behavior: contain;
}
.side-link { display: flex; align-items: center; gap: var(--s-3); padding: 9px 12px; border-radius: var(--r-md); color: var(--text-muted); font-weight: 500; font-size: var(--fs-sm); transition: background var(--dur-2) var(--ease), color var(--dur-2) var(--ease); }
.side-link:hover { background: var(--surface); color: var(--text); }
.side-link.active { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--text); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 30%, transparent); }
.side-link .ico { width: 20px; height: 20px; flex-shrink: 0; }
.app-main { padding: var(--s-8) var(--s-8) var(--s-24); min-width: 0; }

/* Bottom nav mobile (PWA feel) */
.bottom-nav { display: none; }

/* ============================ HERO ============================ */
.hero { position: relative; padding-block: var(--s-24) var(--s-16); text-align: center; }
.hero p.lead { font-size: clamp(1.05rem, 2vw, var(--fs-xl)); color: var(--text-muted); max-width: 620px; margin: var(--s-6) auto var(--s-8); }
.hero-cta { display: flex; gap: var(--s-4); justify-content: center; flex-wrap: wrap; }

/* Marquee de paiements */
.marquee { overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.marquee-track { display: flex; gap: var(--s-4); width: max-content; animation: scroll-x 32s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes scroll-x { to { transform: translateX(-50%); } }
.payout-chip { display: flex; align-items: center; gap: var(--s-3); padding: 10px 16px; border-radius: var(--r-full); background: var(--surface); border: 1px solid var(--border); font-size: var(--fs-sm); white-space: nowrap; }

/* ============================ OFFER CARDS ============================ */
.offer-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--s-5); }
.offer { display: flex; flex-direction: column; gap: var(--s-3); }
.offer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s-3); }
.offer-payout { color: var(--coin); font-weight: 700; font-family: var(--font-display); font-size: var(--fs-lg); display: inline-flex; align-items: center; gap: var(--s-2); font-variant-numeric: tabular-nums; }
.offer-cat { font-size: var(--fs-xs); color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; }
.offer-desc { color: var(--text-muted); font-size: var(--fs-sm); flex: 1; }

/* ============================ ANIMATIONS D'ENTRÉE ============================ */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity var(--dur-4) var(--ease-out), transform var(--dur-4) var(--ease-out); }
.reveal.in { opacity: 1; transform: none; }

/* Skeletons */
.skeleton { background: linear-gradient(100deg, var(--surface) 30%, var(--surface-2) 50%, var(--surface) 70%); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: var(--r-md); }
@keyframes shimmer { to { background-position: -200% 0; } }

/* Coin burst (crédit) */
.coin-burst { position: relative; }

/* ============================ HELPERS ============================ */
.mt-2 { margin-top: var(--s-2); } .mt-4 { margin-top: var(--s-4); } .mt-6 { margin-top: var(--s-6); } .mt-8 { margin-top: var(--s-8); }
.mb-4 { margin-bottom: var(--s-4); } .mb-6 { margin-bottom: var(--s-6); } .mb-8 { margin-bottom: var(--s-8); }
.text-center { text-align: center; }
.divider { height: 1px; background: var(--border); margin-block: var(--s-6); }
.hide-mobile { }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s-6); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-6); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s-5); }

/* ============================ RESPONSIVE ============================ */
@media (max-width: 900px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: 1fr; }
  .app { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .app-main { padding: var(--s-5) var(--s-4) 96px; }
  .nav-links .hide-mobile { display: none; }
  .bottom-nav {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 60;
    justify-content: space-around; padding: 10px 8px calc(10px + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--bg-1) 88%, transparent); backdrop-filter: blur(18px);
    border-top: 1px solid var(--border);
  }
  .bottom-nav a { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 10px; color: var(--text-muted); font-weight: 600; padding: 4px 10px; border-radius: var(--r-md); }
  .bottom-nav a.active { color: var(--accent-2); }
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .grid-4 { grid-template-columns: 1fr; }
  .container { padding-inline: var(--s-4); }
  .section { padding-block: var(--s-16); }
}

/* Accessibilité : focus visible */
:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; border-radius: 4px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

/* ============================ NOTICES (annonces + support) ============================ */
.notice { display: flex; align-items: flex-start; gap: 12px; justify-content: space-between; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--border); border-left-width: 4px; margin-bottom: var(--s-4); background: var(--bg-1); }
.notice-body { display: flex; flex-direction: column; gap: 2px; }
.notice-body strong { font-weight: 600; }
.notice-body span { color: var(--text-muted); font-size: var(--fs-sm); }
.notice-info    { border-left-color: #3b82f6; background: color-mix(in srgb, #3b82f6 10%, var(--bg-1)); }
.notice-success { border-left-color: #22c55e; background: color-mix(in srgb, #22c55e 10%, var(--bg-1)); }
.notice-warning { border-left-color: #f59e0b; background: color-mix(in srgb, #f59e0b 12%, var(--bg-1)); }
.notice-danger  { border-left-color: #ef4444; background: color-mix(in srgb, #ef4444 12%, var(--bg-1)); }
.notice-support { border-left-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--bg-1)); color: var(--text); align-items: center; text-decoration: none; }
.notice-support:hover { background: color-mix(in srgb, var(--accent) 18%, var(--bg-1)); }
.notice-badge { background: var(--accent); color: #fff; font-size: var(--fs-xs); font-weight: 700; min-width: 22px; height: 22px; border-radius: 11px; display: grid; place-items: center; padding: 0 6px; }

/* ============================ SUPPORT : bulle + chat ============================ */
.support-fab { position: fixed; right: 22px; bottom: 22px; z-index: 70; width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--accent), var(--cyan, var(--accent))); box-shadow: 0 10px 30px -8px var(--accent-glow, rgba(0,0,0,.4)); transition: transform .2s var(--ease, ease); }
.support-fab:hover { transform: translateY(-2px) scale(1.05); }
.support-fab-badge { position: absolute; top: -2px; right: -2px; background: #ef4444; color: #fff; font-size: 11px; font-weight: 700; min-width: 20px; height: 20px; border-radius: 10px; display: grid; place-items: center; padding: 0 5px; border: 2px solid var(--bg-1); }

.chat { padding: 0; overflow: hidden; }
.chat-thread { display: flex; flex-direction: column; gap: 10px; padding: var(--s-5); max-height: 60vh; overflow-y: auto; }
.chat-msg { display: flex; }
.chat-out { justify-content: flex-end; }
.chat-in  { justify-content: flex-start; }
.chat-bubble { max-width: 78%; padding: 10px 14px; border-radius: 16px; font-size: var(--fs-sm); line-height: 1.5; }
.chat-out .chat-bubble { background: var(--accent); color: #fff; border-bottom-right-radius: 4px; }
.chat-in .chat-bubble  { background: var(--bg-1); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.chat-time { display: block; font-size: 10px; opacity: .7; margin-top: 4px; }
.chat-form { display: flex; gap: 10px; padding: var(--s-4); border-top: 1px solid var(--border); align-items: flex-end; }
.chat-form textarea { flex: 1; resize: vertical; }

@media (max-width: 900px) {
  .support-fab { bottom: 88px; right: 16px; } /* au-dessus de la barre de navigation mobile */
}