/* ─────────────────────────────────────────────────────────────
   Design system — clair, corporate, sobre (esprit Stripe / hCaptcha).
   Un seul accent, pas de dégradé criard, typo Inter, icônes SVG.
   ───────────────────────────────────────────────────────────── */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/fonts/inter.woff2') format('woff2');
}

:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f3f5f8;
  --surface-3: #e9edf3;
  --border: #e6e9ef;
  --border-strong: #d4d9e2;
  --text: #0f1729;
  --text-2: #384152;
  --muted: #667085;
  --faint: #98a2b3;
  --accent: #3b5bdb;
  --accent-hover: #2f49b8;
  --accent-soft: #eef2ff;
  --accent-border: #c7d2fe;
  --brand: #3b5bdb;                 /* bleu de marque, constant dans les 2 thèmes */
  --topbar-bg: rgba(255,255,255,.85);
  --success: #0f9d58;
  --success-soft: #e7f6ee;
  --danger: #d92d20;
  --danger-soft: #fdecea;
  --warn: #b7791f;
  --warn-soft: #fdf3e3;
  --radius: 14px;
  --radius-sm: 9px;
  --radius-lg: 20px;
  --shadow-xs: 0 1px 2px rgba(16,24,40,.05);
  --shadow-sm: 0 1px 3px rgba(16,24,40,.09), 0 1px 2px rgba(16,24,40,.05);
  --shadow-md: 0 4px 14px rgba(16,24,40,.08);
  --shadow-lg: 0 16px 40px rgba(16,24,40,.12);
  --ring: 0 0 0 4px var(--accent-soft);
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

/* ── Thème sombre : appliqué si l'OS est sombre (sans choix explicite) OU si data-theme="dark" ── */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d1117;
  --surface: #161b22;
  --surface-2: #1b222c;
  --surface-3: #232c38;
  --border: #262f3c;
  --border-strong: #37414f;
  --text: #e8eef7;
  --text-2: #c2cbd8;
  --muted: #8b97a9;
  --faint: #667283;
  --accent: #7c9cff;
  --accent-hover: #9db4ff;
  --accent-soft: rgba(124,156,255,.14);
  --accent-border: rgba(124,156,255,.34);
  --topbar-bg: rgba(13,17,23,.85);
  --success: #2fb37a;
  --success-soft: rgba(47,179,122,.16);
  --danger: #f26d6d;
  --danger-soft: rgba(242,109,109,.15);
  --warn: #d9a441;
  --warn-soft: rgba(217,164,65,.15);
  --shadow-xs: 0 1px 2px rgba(0,0,0,.4);
  --shadow-sm: 0 1px 3px rgba(0,0,0,.5);
  --shadow-md: 0 4px 14px rgba(0,0,0,.45);
  --shadow-lg: 0 16px 40px rgba(0,0,0,.6);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0d1117;
    --surface: #161b22;
    --surface-2: #1b222c;
    --surface-3: #232c38;
    --border: #262f3c;
    --border-strong: #37414f;
    --text: #e8eef7;
    --text-2: #c2cbd8;
    --muted: #8b97a9;
    --faint: #667283;
    --accent: #7c9cff;
    --accent-hover: #9db4ff;
    --accent-soft: rgba(124,156,255,.14);
    --accent-border: rgba(124,156,255,.34);
    --topbar-bg: rgba(13,17,23,.85);
    --success: #2fb37a;
    --success-soft: rgba(47,179,122,.16);
    --danger: #f26d6d;
    --danger-soft: rgba(242,109,109,.15);
    --warn: #d9a441;
    --warn-soft: rgba(217,164,65,.15);
    --shadow-xs: 0 1px 2px rgba(0,0,0,.4);
    --shadow-sm: 0 1px 3px rgba(0,0,0,.5);
    --shadow-md: 0 4px 14px rgba(0,0,0,.45);
    --shadow-lg: 0 16px 40px rgba(0,0,0,.6);
  }
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  overflow-x: hidden;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }
h1, h2, h3 { line-height: 1.15; letter-spacing: -0.02em; color: var(--text); }
svg { display: block; }

.container { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.center { text-align: center; }
.muted { color: var(--muted); }
.hidden { display: none !important; }
.mono { font-variant-numeric: tabular-nums; }

/* ── Icônes SVG (trait, héritent de currentColor) ── */
.icon { width: 18px; height: 18px; flex-shrink: 0; stroke: currentColor; fill: none;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-sm { width: 15px; height: 15px; }

/* ── Boutons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-2);
  padding: 9px 15px; border-radius: var(--radius-sm); font-weight: 600; font-size: 14px;
  box-shadow: var(--shadow-xs);
  transition: background .14s ease, border-color .14s ease, box-shadow .14s ease, transform .05s;
}
.btn:hover { background: var(--surface-2); border-color: var(--border-strong); }
.btn:active { transform: translateY(.5px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-mint { background: var(--success); border-color: var(--success); color: #fff; }
.btn-mint:hover { filter: brightness(.95); background: var(--success); }
.btn-danger { background: var(--surface); border-color: #f1c4c0; color: var(--danger); }
.btn-danger:hover { background: var(--danger-soft); }
.btn-ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--muted); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-sm { padding: 7px 11px; font-size: 13px; }
.btn-lg { padding: 13px 22px; font-size: 15px; border-radius: 11px; }
.btn-discord { background: #5865F2; border-color: #5865F2; color: #fff; box-shadow: var(--shadow-sm); }
.btn-discord:hover { background: #4752c4; border-color: #4752c4; }

/* ── Cartes ── */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow-xs); }

/* ── Badges / pills ── */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 8px;
  font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); }
.pill-mint { background: var(--success-soft); color: var(--success); border-color: #bfe6cd; }
.pill-warn { background: var(--warn-soft); color: var(--warn); border-color: #f0dcb0; }
.pill-danger { background: var(--danger-soft); color: var(--danger); border-color: #f3c6c1; }
.pill-accent { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-border); }

/* ── Top bar ── */
.topbar { position: sticky; top: 0; z-index: 20; background: var(--topbar-bg);
  backdrop-filter: saturate(180%) blur(10px); border-bottom: 1px solid var(--border); }
.topbar-inner { display: flex; align-items: center; gap: 14px; height: 62px; }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 17px; color: var(--text); }
.brand .logo { display: inline-flex; }
.brand .logo svg { width: 28px; height: 28px; }
.brand .logo img { width: 28px; height: 28px; display: block; }
.spacer { flex: 1; }

.balance-chip { display: flex; align-items: center; gap: 7px; background: var(--surface); color: var(--text);
  border: 1px solid var(--border-strong); border-radius: 999px; padding: 5px 13px 5px 10px; font-weight: 700;
  box-shadow: var(--shadow-xs); }
.balance-chip .coin { color: var(--accent); display: inline-flex; }
.avatar { width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--border-strong); }

/* ── Navigation onglets ── */
.nav { display: flex; gap: 3px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 4px; margin: 22px 0; overflow-x: auto; scrollbar-width: none; box-shadow: var(--shadow-xs); }
.nav::-webkit-scrollbar { display: none; }
.nav button { flex: 1 0 auto; white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  background: transparent; border: none; color: var(--muted); padding: 9px 14px; border-radius: 8px;
  font-weight: 600; font-size: 14px; transition: .14s; }
.nav button:hover:not(.active) { color: var(--text); background: var(--surface-2); }
.nav button.active { background: var(--accent-soft); color: var(--accent); }
.nav button .icon { width: 16px; height: 16px; }

/* ── Grille stats ── */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow-xs); }
.stat .label { color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .4px; }
.stat .value { font-size: 26px; font-weight: 700; margin-top: 7px; color: var(--text); }
.stat-sub { font-size: 14px; color: var(--muted); font-weight: 500; }

/* ── Barre de progression ── */
.progress { height: 8px; background: var(--surface-3); border-radius: 999px; overflow: hidden; }
.progress > div { height: 100%; background: var(--accent); border-radius: 999px; transition: width .4s ease; }

/* ── Formulaires ── */
label { font-size: 13px; color: var(--text-2); font-weight: 600; }
input[type=text], input[type=email], input[type=number], select {
  width: 100%; background: var(--surface); border: 1px solid var(--border-strong); color: var(--text);
  padding: 10px 13px; border-radius: var(--radius-sm); font-size: 15px; font-family: inherit; transition: .14s;
}
input::placeholder { color: var(--faint); }
input:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }

/* ── Tables ── */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; }
tbody tr:hover { background: var(--surface-2); }
tr:last-child td { border-bottom: none; }

/* ── Toast ── */
.toast-wrap { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 100;
  display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { background: var(--surface); border: 1px solid var(--border-strong); color: var(--text);
  padding: 12px 18px; border-radius: 11px; box-shadow: var(--shadow-lg); font-weight: 600; font-size: 14px;
  display: flex; align-items: center; gap: 9px; animation: toastIn .2s ease; }
.toast.success { border-color: #bfe6cd; }
.toast.success::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--success); }
.toast.error { border-color: #f3c6c1; }
.toast.error::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; } }

/* ── Utilitaires layout ── */
.row { display: flex; gap: 12px; align-items: center; }
.col { display: flex; flex-direction: column; gap: 12px; }
.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.mt { margin-top: 16px; } .mt-lg { margin-top: 28px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 720px) { .grid-2 { grid-template-columns: 1fr; } }

/* ─────────────────────────────────────────────────────────────
   Dashboard /app
   ───────────────────────────────────────────────────────────── */
.app-main { padding-bottom: 70px; }
.section { display: none; }
.section.active { display: block; animation: fade .2s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; } }

.hero-row { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 18px; margin-top: 26px; }
.hero-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; background: var(--surface); box-shadow: var(--shadow-xs); }
.hero-welcome { display: flex; align-items: center; gap: 18px; }
.hero-avatar { width: 60px; height: 60px; border-radius: 50%; border: 1px solid var(--border-strong); }
.hero-balance { display: flex; flex-direction: column; align-items: flex-start;
  background: var(--brand); border-color: var(--brand); color: #fff; }
.hero-balance .muted { color: rgba(255,255,255,.8); }
.hero-balance-val { font-size: 40px; font-weight: 800; line-height: 1; margin-top: 6px;
  display: flex; align-items: center; gap: 10px; letter-spacing: -.02em; }
.hero-coin { display: inline-flex; opacity: .9; }
.hero-balance .btn-mint { background: #fff; border-color: #fff; color: var(--brand); }
.hero-balance .btn-mint:hover { background: #f0f2ff; }

.beta-banner { display: flex; gap: 11px; align-items: center; padding: 13px 16px; border-radius: 11px;
  border: 1px solid var(--accent-border); background: var(--accent-soft); margin-bottom: 18px; font-size: 14px; color: var(--text-2); }
.beta-banner .icon { color: var(--accent); }

.captcha-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; align-items: stretch; }
.captcha-main { min-height: 360px; display: flex; flex-direction: column; }
.captcha-main > #captchaHost { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.captcha-side { display: flex; flex-direction: column; }
.captcha-side h3 { font-size: 15px; margin-bottom: 4px; }

.ring-wrap { display: grid; place-items: center; margin: 14px 0 18px; }
.ring { width: 128px; height: 128px; border-radius: 50%; display: grid; place-items: center; position: relative;
  background: conic-gradient(var(--accent) var(--p, 0%), var(--surface-3) 0); transition: background .4s ease; }
.ring::before { content: ''; position: absolute; inset: 11px; border-radius: 50%; background: var(--surface); }
.ring span { position: relative; font-weight: 700; font-size: 20px; color: var(--text); }
.side-line { display: flex; justify-content: space-between; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--border); }
.side-line:last-of-type { border-bottom: none; }

.copy-field { display: flex; gap: 8px; }
.copy-field input { flex: 1; }
.delta-pos { color: var(--success); font-weight: 700; }
.delta-neg { color: var(--danger); font-weight: 700; }
.table-scroll { overflow-x: auto; }

/* ─────────────────────────────────────────────────────────────
   Widget captcha
   ───────────────────────────────────────────────────────────── */
.captcha-box { max-width: 420px; margin: 0 auto; }
.robot-check { display: flex; align-items: center; gap: 14px; background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: 11px; padding: 15px 18px; cursor: pointer;
  transition: border-color .15s, box-shadow .15s; box-shadow: var(--shadow-xs); }
.robot-check:hover { border-color: var(--accent); box-shadow: var(--ring); }
.robot-box { width: 26px; height: 26px; border-radius: 6px; border: 2px solid var(--border-strong);
  display: grid; place-items: center; flex-shrink: 0; transition: .2s; color: #fff; }
.robot-check.loading .robot-box { border-color: var(--accent); }
.robot-box.checked { background: var(--success); border-color: var(--success); }
.spinner { width: 18px; height: 18px; border: 3px solid var(--surface-3); border-top-color: var(--accent);
  border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.cap-prompt { font-weight: 700; margin-bottom: 14px; color: var(--text); }
.cap-grid { display: grid; gap: 8px; }
.cap-cell { aspect-ratio: 1; border-radius: 10px; background: var(--surface-2); border: 2px solid var(--border);
  display: grid; place-items: center; font-size: clamp(26px, 8vw, 40px); cursor: pointer; transition: .1s; user-select: none; }
.cap-cell:hover { border-color: var(--border-strong); }
.cap-cell.sel { border-color: var(--accent); background: var(--accent-soft); }

.cap-track { position: relative; height: 52px; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 11px; margin: 18px 0; overflow: hidden; }
.cap-notch { position: absolute; top: 0; bottom: 0; width: 38px; transform: translateX(-50%);
  background: var(--accent-soft); border-left: 2px dashed var(--accent); border-right: 2px dashed var(--accent); }
.cap-range { width: 100%; }
input[type=range].cap-range { -webkit-appearance: none; appearance: none; height: 8px; border-radius: 999px;
  background: var(--surface-3); outline: none; }
input[type=range].cap-range::-webkit-slider-thumb { -webkit-appearance: none; width: 26px; height: 26px;
  border-radius: 50%; background: var(--accent); cursor: grab; box-shadow: var(--shadow-sm); border: 3px solid #fff; }
input[type=range].cap-range::-moz-range-thumb { width: 24px; height: 24px; border: 3px solid #fff; border-radius: 50%;
  background: var(--accent); cursor: grab; }

.cap-rotate-stage { display: grid; place-items: center; height: 140px; }
.cap-rotate-emoji { font-size: 80px; transition: transform .05s linear; }

.cap-seq-display { display: flex; gap: 8px; justify-content: center; height: 58px; align-items: center; }
.cap-seq-dot { width: 44px; height: 44px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); transition: .15s; }
.cap-palette { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 10px; }
.cap-color { width: 46px; height: 46px; border-radius: 12px; border: 2px solid var(--border); cursor: pointer; transition: transform .08s; }
.cap-color:active { transform: scale(.9); }
.cap-built { display: flex; gap: 6px; justify-content: center; min-height: 26px; margin-top: 10px; }
.cap-built span { width: 22px; height: 22px; border-radius: 6px; }

.c-rouge{background:#e5484d}.c-bleu{background:#3b5bdb}.c-vert{background:#0f9d58}
.c-jaune{background:#f5a623}.c-violet{background:#7c5cff}.c-orange{background:#f2732e}

.dots { display: flex; gap: 5px; flex-wrap: wrap; justify-content: center; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--surface-3); }
.dot.done { background: var(--accent); }

.coin-burst { position: fixed; pointer-events: none; z-index: 200; font-weight: 800; font-size: 18px;
  color: var(--success); animation: burst 1s ease forwards; }
@keyframes burst { 0% { opacity: 0; transform: translateY(0) scale(.6); } 20% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-70px) scale(1.15); } }

/* ── Responsive ── */
@media (max-width: 820px) {
  .hero-row { grid-template-columns: 1fr; }
  .captcha-layout { grid-template-columns: 1fr; }
  .captcha-main { min-height: 0; }
}
@media (max-width: 560px) {
  .topbar-inner { gap: 8px; }
  .brand .brand-wordmark { display: none; }
  .hero-balance-val { font-size: 34px; }
  #logout .logout-txt { display: none; }
  #adminLink .admin-txt { display: none; }
}

/* ── Bascule de thème (soleil/lune) ── */
.theme-toggle { padding: 7px 9px; }
.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: none; }
  :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: block; }
}

/* ── Captchas additionnels (ordre, Stroop) ── */
.cap-order-badge { position: absolute; top: 4px; right: 4px; min-width: 18px; height: 18px; border-radius: 50%;
  background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; display: none;
  align-items: center; justify-content: center; padding: 0 4px; line-height: 1; }
.cap-cell.sel .cap-order-badge { display: inline-flex; }
.cap-stroop-word { font-size: clamp(38px, 12vw, 52px); font-weight: 800; letter-spacing: .02em; margin: 6px 0 20px; }
.cap-color.sel { box-shadow: 0 0 0 3px var(--surface), 0 0 0 6px var(--accent); }

/* ── Captcha texte déformé ── */
.cap-text-canvas { width: 100%; max-width: 300px; height: auto; border-radius: 8px;
  border: 1px solid var(--border-strong); display: block; margin: 0 auto; box-shadow: var(--shadow-xs); }
.cap-text-input { max-width: 260px; margin: 14px auto 0; text-align: center; text-transform: uppercase;
  letter-spacing: 4px; font-weight: 700; font-size: 18px; }

/* ── Captcha puzzle glissant ── */
.cap-puzzle-stage { position: relative; margin: 0 auto; width: 100%; max-width: 280px; border-radius: 8px;
  overflow: hidden; border: 1px solid var(--border-strong); box-shadow: var(--shadow-xs); }
.cap-puzzle-canvas { display: block; width: 100%; height: auto; }
.cap-range { max-width: 280px; margin: 0 auto; }
.cap-puzzle-piece { position: absolute; border-radius: 3px; box-shadow: 0 2px 10px rgba(0,0,0,.5);
  outline: 2px solid #fff; outline-offset: -1px; }
.cap-puzzle-hint { font-size: 12px; margin: 12px 0 8px; }

/* ── Captcha flèche + match couleur ── */
.cap-arrow-canvas { width: 180px; max-width: 100%; height: auto; border-radius: 8px;
  border: 1px solid var(--border-strong); display: block; margin: 0 auto; box-shadow: var(--shadow-xs); }
.cap-color-row { display: flex; gap: 26px; justify-content: center; margin-bottom: 18px; }
.cap-color-swatch { width: 72px; height: 72px; border-radius: 14px; border: 1px solid var(--border-strong); box-shadow: var(--shadow-xs); }
.cap-color-label { font-size: 12px; margin-bottom: 6px; }
input[type=range].cap-hue { background: linear-gradient(to right,
  hsl(0,68%,52%), hsl(60,68%,52%), hsl(120,68%,52%), hsl(180,68%,52%), hsl(240,68%,52%), hsl(300,68%,52%), hsl(360,68%,52%)); }

/* ── Captchas formes / cible / jauge / pastilles ── */
.cap-shape-canvas { width: 100%; max-width: 280px; height: auto; border-radius: 8px;
  border: 1px solid var(--border-strong); display: block; margin: 0 auto; box-shadow: var(--shadow-xs); cursor: pointer; }
.cap-canvas-wrap { position: relative; display: inline-block; max-width: 100%; line-height: 0; }
.cap-click-marker { position: absolute; width: 16px; height: 16px; margin: -8px 0 0 -8px; border: 2px solid #3b5bdb;
  border-radius: 50%; background: rgba(59,91,219,.3); pointer-events: none; }
.cap-shape-ref { width: 48px; height: 48px; border-radius: 8px; border: 1px solid var(--border-strong); }
.cap-ref-row { display: inline-flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.cap-shape-cell { padding: 0; overflow: hidden; }
.cap-shape-cell canvas { width: 100%; height: 100%; display: block; }

/* ─────────────────────────────────────────────────────────────
   Dashboard "façon maquette" — wordmark, toggle pilule, tuiles, Aujourd'hui
   ───────────────────────────────────────────────────────────── */
.brand-accent { color: var(--accent); }
.brand-wordmark { font-weight: 700; }

/* Toggle thème segmenté (soleil | lune) */
.theme-toggle { display: inline-flex; align-items: center; gap: 2px; padding: 3px; cursor: pointer;
  border: 1px solid var(--border-strong); background: var(--surface-2); border-radius: 999px; box-shadow: var(--shadow-xs); }
.theme-toggle .tt-opt { display: grid; place-items: center; width: 30px; height: 26px; border-radius: 999px; color: var(--muted); transition: .15s; }
.theme-toggle .tt-opt .icon { width: 15px; height: 15px; }
.theme-toggle .tt-light { background: #fff; color: var(--accent); box-shadow: var(--shadow-xs); }
:root[data-theme="dark"] .theme-toggle .tt-light { background: transparent; color: var(--muted); box-shadow: none; }
:root[data-theme="dark"] .theme-toggle .tt-dark { background: var(--surface-3); color: var(--accent); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .tt-light { background: transparent; color: var(--muted); box-shadow: none; }
  :root:not([data-theme="light"]) .theme-toggle .tt-dark { background: var(--surface-3); color: var(--accent); }
}

/* Carte bienvenue : citation */
.hero-div { border: none; border-top: 1px solid var(--border); margin: 14px 0 12px; }
.hero-quote { font-style: italic; color: var(--muted); font-size: 14px; line-height: 1.5; }

/* Carte solde en 2 colonnes */
.hero-balance { flex-direction: row; align-items: stretch; justify-content: space-between; gap: 18px; }
.hb-left { display: flex; flex-direction: column; align-items: flex-start; }
.hb-euros { color: rgba(255,255,255,.82); margin-top: 2px; }
.hb-right { max-width: 170px; padding-left: 18px; border-left: 1px solid rgba(255,255,255,.28);
  color: rgba(255,255,255,.85); font-size: 14px; line-height: 1.4; display: flex; align-items: center; }
@media (max-width: 720px) { .hb-right { display: none; } }

/* Tuiles stats avec icône colorée */
.stat-tile { display: flex; align-items: flex-start; gap: 14px; }
.stat-ic { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; flex-shrink: 0; }
.stat-ic .icon { width: 22px; height: 22px; }
.ic-blue { background: var(--accent-soft); color: var(--accent); }
.ic-green { background: var(--success-soft); color: var(--success); }
.ic-violet { background: rgba(124,92,255,.14); color: #7c5cff; }
.ic-orange { background: rgba(242,115,46,.15); color: #f2732e; }
.stat-body { flex: 1; min-width: 0; }
.stat-note { font-size: 12px; color: var(--muted); margin-top: 4px; }
.xp { margin-top: 8px; }
.xp-bar { height: 5px; background: var(--surface-3); border-radius: 999px; overflow: hidden; }
.xp-bar > div { height: 100%; background: var(--accent); border-radius: 999px; transition: width .4s ease; }
.xp-text { font-size: 11px; color: var(--muted); display: block; margin-top: 5px; }

/* Carte "Aujourd'hui" enrichie */
.ring { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 108px; height: 108px; }
.ring span { position: relative; font-weight: 700; font-size: 19px; color: var(--text); line-height: 1.1; }
.ring small { position: relative; font-size: 11px; color: var(--muted); }
.side-top { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.side-mini { display: flex; flex-direction: column; gap: 10px; flex: 1; }
.mini-stat { display: flex; align-items: center; gap: 10px; }
.mini-ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; }
.mini-ic .icon { width: 17px; height: 17px; }
.mini-ok { background: var(--accent-soft); color: var(--accent); }
.mini-ko { background: var(--danger-soft); color: var(--danger); }
.mini-stat strong { font-size: 18px; }
.side-banner { display: flex; align-items: center; gap: 10px; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 10px; padding: 10px 12px; font-size: 13px; color: var(--text-2); margin-top: auto; }
.side-banner .icon { color: var(--accent); flex-shrink: 0; }

/* ── Carte récompense quotidienne ── */
.daily-card { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.daily-left { display: flex; align-items: center; gap: 14px; }
.daily-ic { width: 46px; height: 46px; border-radius: 12px; flex-shrink: 0; display: grid; place-items: center;
  background: rgba(242,115,46,.15); color: #f2732e; }
.daily-title { font-weight: 700; }

/* ── Captcha texte : image SVG serveur (remplace le canvas) ── */
.cap-text-img { display: inline-block; border-radius: 8px; border: 1px solid var(--border-strong);
  overflow: hidden; box-shadow: var(--shadow-xs); background: #eef1f5; line-height: 0; max-width: 100%; user-select: none; }
.cap-text-img svg { display: block; max-width: 100%; height: auto; }

/* ─────────────────────────────────────────────────────────────
   Captchas "image serveur + interaction"
   ───────────────────────────────────────────────────────────── */
.cap-img { display: block; max-width: 100%; line-height: 0; }
.cap-img svg { display: block; max-width: 100%; height: auto; }
.cap-clickimg { width: 100%; max-width: 280px; margin: 0 auto; border-radius: 8px;
  border: 1px solid var(--border-strong); box-shadow: var(--shadow-xs); cursor: pointer; overflow: hidden; }
.cap-clickimg svg { width: 100%; }
.cap-canvas-wrap { position: relative; display: block; width: 100%; max-width: 280px; margin: 0 auto; line-height: 0; }
.cap-shape-ref2 { width: 48px; height: 48px; border-radius: 8px; border: 1px solid var(--border-strong); overflow: hidden; line-height: 0; }
.cap-shape-ref2 svg { width: 100%; height: 100%; display: block; }

/* Puzzle */
.cap-puzzle-stage2 { position: relative; width: 100%; max-width: 280px; margin: 0 auto; border-radius: 8px;
  overflow: hidden; border: 1px solid var(--border-strong); box-shadow: var(--shadow-xs); }
.cap-puzzle-scene { width: 100%; }
.cap-puzzle-scene svg { width: 100%; height: auto; display: block; }
.cap-puzzle-piece2 { position: absolute; border-radius: 3px; box-shadow: 0 2px 10px rgba(0,0,0,.5);
  outline: 2px solid #fff; outline-offset: -1px; overflow: hidden; line-height: 0; }
.cap-puzzle-piece2 svg { width: 100%; height: 100%; display: block; }

/* Flèche */
.cap-arrow2 { width: 160px; max-width: 100%; margin: 0 auto; transition: transform .05s linear; }
.cap-arrow2 svg { width: 100%; height: auto; display: block; border-radius: 8px; border: 1px solid var(--border-strong); }

/* Couleur */
.cap-color-swatch2 { width: 72px; height: 72px; border-radius: 14px; border: 1px solid var(--border-strong); overflow: hidden; line-height: 0; }
.cap-color-swatch2 svg { width: 100%; height: 100%; display: block; }

/* Grille */
.cap-grid-stage { position: relative; width: 100%; max-width: 270px; margin: 0 auto; }
.cap-grid-stage .cap-img svg { width: 100%; height: auto; display: block; border-radius: 10px; }
.cap-grid-overlay { position: absolute; inset: 0; display: grid; }
.cap-grid-cell { cursor: pointer; border-radius: 8px; }
.cap-grid-cell.sel { outline: 3px solid var(--accent); outline-offset: -4px; background: rgba(59,91,219,.14); }

/* Jauge */
.cap-gauge-stage { position: relative; width: 100%; max-width: 280px; margin: 0 auto; }
.cap-gauge-img svg { width: 100%; height: auto; display: block; border-radius: 8px; border: 1px solid var(--border-strong); }
.cap-gauge-blue { position: absolute; top: 8%; bottom: 8%; width: 3px; background: var(--accent); transform: translateX(-50%); pointer-events: none; }

/* Pastilles */
.cap-dots-marks { position: absolute; inset: 0; pointer-events: none; }
.cap-dot-mark { position: absolute; transform: translate(-50%,-50%); width: 22px; height: 22px; border-radius: 50%;
  background: var(--accent); color: #fff; font-size: 12px; font-weight: 700; display: grid; place-items: center; }

/* ─────────────────────────────────────────────────────────────
   Pages légales (CGU, confidentialité, mentions)
   ───────────────────────────────────────────────────────────── */
.legal-doc { max-width: 780px; margin: 0 auto; padding: 36px 0 64px; }
.legal-doc .back { color: var(--muted); font-size: 14px; display: inline-flex; align-items: center; gap: 6px; }
.legal-doc .back:hover { color: var(--text); }
.legal-doc h1 { font-size: clamp(28px, 4vw, 38px); font-weight: 800; letter-spacing: -.02em; margin: 18px 0 8px; }
.legal-meta { color: var(--faint); font-size: 13px; margin-bottom: 12px; }
.legal-intro { color: var(--muted); font-size: 15px; line-height: 1.6; }
.legal-toc { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 16px 20px; margin: 24px 0 8px; box-shadow: var(--shadow-xs); }
.legal-toc h2 { font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); margin-bottom: 10px; }
.legal-toc ol { margin: 0; padding-left: 20px; display: grid; gap: 7px; }
.legal-toc a { color: var(--accent); font-size: 14px; }
.legal-section { margin-top: 30px; scroll-margin-top: 80px; }
.legal-section h2 { font-size: 19px; font-weight: 700; margin-bottom: 8px; }
.legal-section h2 .num { color: var(--accent); margin-right: 8px; }
.legal-section p { color: var(--text-2); font-size: 15px; line-height: 1.7; margin-top: 8px; }
.legal-section ul { margin: 10px 0 0; padding-left: 20px; display: grid; gap: 7px; }
.legal-section li { color: var(--text-2); font-size: 15px; line-height: 1.55; }
.legal-note { margin-top: 40px; padding: 14px 16px; border-radius: 10px; background: var(--surface-2);
  border: 1px solid var(--border); color: var(--muted); font-size: 13px; line-height: 1.6; }
.legal-fill { color: var(--accent); font-weight: 600; }

/* ─────────────────────────────────────────────────────────────
   Landing — profondeur & richesse
   ───────────────────────────────────────────────────────────── */
.bg-glow { position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(680px 460px at 82% -6%, rgba(59,91,219,.13), transparent 62%),
    radial-gradient(560px 440px at -6% 12%, rgba(124,92,255,.08), transparent 58%),
    radial-gradient(700px 500px at 50% 108%, rgba(59,91,219,.07), transparent 60%); }
:root[data-theme="dark"] .bg-glow { background:
    radial-gradient(680px 460px at 82% -6%, rgba(108,140,255,.16), transparent 62%),
    radial-gradient(560px 440px at -6% 12%, rgba(124,92,255,.12), transparent 58%),
    radial-gradient(700px 500px at 50% 108%, rgba(108,140,255,.10), transparent 60%); }

/* Apparition au scroll */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } }

/* Cartes qui réagissent (landing uniquement) */
.steps .card, .why .card, .showcase-grid .cap-demo { transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.steps .card:hover, .why .card:hover, .showcase-grid .cap-demo:hover {
  transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--accent-border); }

/* Vitrine des captchas */
.showcase-wrap { margin-top: 26px; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 34px 26px; }
.showcase-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 16px; }
.cap-demo { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 14px;
  box-shadow: var(--shadow-xs); text-align: center; }
.cap-demo svg { width: 100%; height: auto; border-radius: 8px; display: block; }
.cap-demo .cap-demo-label { margin-top: 10px; font-weight: 600; font-size: 14px; }


/* ── Ajouts : progression retrait, classement parrains, explication bonus, onglets mobile ── */
.wd-progress { margin-top: 12px; }
.wd-progress-bar { height: 8px; border-radius: 6px; background: rgba(255,255,255,.25); overflow: hidden; }
.wd-progress-bar span { display: block; height: 100%; width: 0; background: #fff; border-radius: 6px; transition: width .5s ease; }
.wd-progress-text { margin-top: 6px; font-size: 12.5px; color: rgba(255,255,255,.9); }

.ref-how { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 18px 0 4px; }
.ref-step { border: 1px solid var(--border); border-radius: 12px; padding: 14px; background: var(--surface-2); }
.ref-step .rh-ic { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); margin-bottom: 8px; }
.ref-step .rh-ic .icon { width: 20px; height: 20px; }
.ref-step h4 { font-size: 14px; margin-bottom: 3px; }
.ref-step p { color: var(--muted); font-size: 13px; }
@media (max-width: 560px) { .ref-how { grid-template-columns: 1fr; } }

.lb { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.lb-row { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); }
.lb-rank { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; font-weight: 700; font-size: 13px; background: var(--accent-soft); color: var(--accent); flex-shrink: 0; }
.lb-row.top1 .lb-rank { background: #fef3c7; color: #b45309; }
.lb-row.top2 .lb-rank { background: #e5e7eb; color: #4b5563; }
.lb-row.top3 .lb-rank { background: #fde4d0; color: #c2410c; }
.lb-name { flex: 1; font-weight: 600; font-size: 14px; }
.lb-count { color: var(--muted); font-size: 13px; }
.lb-empty { color: var(--muted); font-size: 14px; padding: 8px 2px; }

@media (max-width: 560px) {
  .nav button { padding: 8px 10px; font-size: 13px; gap: 5px; }
  .nav button .icon { width: 15px; height: 15px; }
}

.paid-band { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 26px auto 0; max-width: 640px; padding: 12px 18px; border-radius: 12px; background: var(--success-soft); border: 1px solid rgba(15,157,88,.25); color: var(--success); font-size: 14px; font-weight: 600; text-align: center; }
.paid-band .icon { width: 18px; height: 18px; flex-shrink: 0; }
.paid-band strong { color: var(--success); }

/* Avatars : cadrage propre (fallback initiales géré en JS) + petit anneau au survol */
.avatar, .hero-avatar { object-fit: cover; background: var(--surface-2); }
.avatar { transition: box-shadow .15s ease; }
.avatar:hover { box-shadow: 0 0 0 3px var(--accent-soft); }
.topbar .btn { gap: 6px; }
.topbar .btn .icon { width: 16px; height: 16px; }
@media (max-width: 560px) { .topbar .btn.btn-ghost { padding: 8px; } }

/* Entrée en fondu du dashboard (sensation plus premium) */
.app-main { animation: appFade .45s ease; }
@keyframes appFade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .app-main { animation: none; } }

/* ─────────────────────────────────────────────────────────────
   Finitions UI/UX — accessibilité, états de chargement, densité
   ───────────────────────────────────────────────────────────── */

/* Nos composants en display:flex/grid écrasaient la règle navigateur [hidden].
   Conséquence : le bandeau « déjà payé » s'affichait à 0 € et la carte
   quotidienne apparaissait avant que le JS ne décide. */
[hidden] { display: none !important; }

/* Focus clavier visible partout (rien n'était visible à la tabulation). */
:where(a, button, input, select, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px;
}
.btn:focus-visible, .nav button:focus-visible { outline-offset: 3px; }

/* Ancres : ne pas se glisser sous la barre collante. */
section[id], .section-head[id] { scroll-margin-top: 84px; }

/* Barre supérieure : profondeur une fois qu'on a défilé. */
.topbar { transition: box-shadow .2s ease; }
.topbar.scrolled { box-shadow: 0 1px 0 var(--border), 0 8px 24px rgba(16,24,40,.07); }
:root[data-theme="dark"] .topbar.scrolled { box-shadow: 0 1px 0 var(--border), 0 8px 24px rgba(0,0,0,.5); }

/* Bouton secondaire (CTA « Voir comment ça marche »). */
.btn-outline { background: transparent; border-color: var(--border-strong); color: var(--text-2); box-shadow: none; }
.btn-outline:hover { background: var(--surface); border-color: var(--accent-border); color: var(--text); }

/* Relief au survol des boutons pleins. */
.btn-primary, .btn-discord, .btn-mint { transition: background .14s ease, border-color .14s ease, box-shadow .14s ease, transform .12s ease; }
.btn-primary:hover, .btn-discord:hover, .btn-mint:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-primary:active, .btn-discord:active, .btn-mint:active { transform: translateY(0); }

/* Le glyphe Discord garde ses proportions dans un bouton. */
.btn > svg[fill="currentColor"] { flex-shrink: 0; }

/* ── Zone captcha : contenu centré, média plus lisible ── */
.captcha-main { min-height: 420px; justify-content: center; }
.captcha-box { max-width: 460px; width: 100%; }
.cap-clickimg, .cap-canvas-wrap, .cap-puzzle-stage2, .cap-gauge-stage,
.cap-text-img, .cap-range, .cap-puzzle-stage, .cap-shape-canvas, .cap-text-canvas { max-width: 320px; }
.cap-grid-stage { max-width: 300px; }
.cap-prompt { font-size: 15px; line-height: 1.35; }

/* Case « Je ne suis pas un robot » : c'est un vrai bouton (clavier + lecteurs d'écran). */
.robot-check { width: 100%; text-align: left; font: inherit; color: var(--text); padding: 17px 20px; }
.robot-check:focus-visible { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
.robot-check[disabled] { cursor: progress; }
.robot-check strong { display: block; font-size: 15px; }

/* Bouton de validation en cours d'envoi. */
.btn .btn-spin { width: 15px; height: 15px; border: 2px solid rgba(255,255,255,.45);
  border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }

/* Fin de quota : carte de félicitations sans emoji. */
.cap-done-ic { width: 52px; height: 52px; border-radius: 50%; margin: 0 auto 12px;
  display: grid; place-items: center; background: var(--success-soft); color: var(--success); }
.cap-done-ic .icon { width: 26px; height: 26px; stroke-width: 2.4; }

/* ── Squelettes de chargement (les onglets s'ouvraient sur du vide) ── */
.skel { position: relative; overflow: hidden; background: var(--surface-2); border-radius: 7px; }
.skel::after { content: ''; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.6), transparent); animation: shimmer 1.25s infinite; }
:root[data-theme="dark"] .skel::after { background: linear-gradient(90deg, transparent, rgba(255,255,255,.06), transparent); }
@keyframes shimmer { to { transform: translateX(100%); } }
.skel-line { height: 12px; }
.skel-rows { display: flex; flex-direction: column; gap: 10px; padding: 4px 0; }
.skel-row { display: flex; align-items: center; gap: 14px; }
.skel-row .skel:nth-child(1) { flex: 2; } .skel-row .skel:nth-child(2) { flex: 1; }
.skel-row .skel:nth-child(3) { flex: 1; } .skel-row .skel:nth-child(4) { flex: 1; }

/* ── États vides explicites plutôt qu'une ligne de texte grise ── */
.empty { display: grid; place-items: center; gap: 6px; padding: 28px 16px; text-align: center; }
.empty .empty-ic { width: 44px; height: 44px; border-radius: 13px; background: var(--surface-2);
  color: var(--faint); display: grid; place-items: center; margin-bottom: 4px; }
.empty .empty-ic .icon { width: 21px; height: 21px; }
.empty-title { font-weight: 600; color: var(--text-2); font-size: 14px; }
.empty-sub { color: var(--muted); font-size: 13px; max-width: 300px; }

/* ── Carte solde : la colonne de droite porte des chiffres, plus un slogan ── */
.hb-right { flex-direction: column; justify-content: center; gap: 14px; align-items: flex-start; }
.hb-kpi .hb-kpi-l { font-size: 11.5px; text-transform: uppercase; letter-spacing: .5px; color: rgba(255,255,255,.72); font-weight: 600; }
.hb-kpi .hb-kpi-v { font-size: 17px; font-weight: 700; color: #fff; line-height: 1.2; margin-top: 2px; }

/* Chiffres alignés dans les tableaux. */
td, .stat .value, .mini-stat strong { font-variant-numeric: tabular-nums; }

/* Toasts : un peu plus lisibles, empilés proprement. */
.toast { min-width: 210px; max-width: min(92vw, 420px); }
.toast-wrap { bottom: 26px; }

/* Aperçu du hero : la carte flottante ne doit pas mordre le bouton. */
.preview-balance { bottom: -30px; right: -12px; }

/* ── Respect de « animations réduites » sur tout le site ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important; animation-iteration-count: 1 !important;
    transition-duration: .001ms !important; scroll-behavior: auto !important;
  }
}

/* ── Mobile : densité et zones tactiles ── */
@media (max-width: 560px) {
  .hero-balance { flex-direction: column; gap: 14px; }
  .hero-cta .btn-lg { width: 100%; }
  .captcha-main { min-height: 0; padding: 18px; }
  .card { padding: 18px; }
  .nav { position: sticky; top: 62px; z-index: 10; }
  .toast-wrap { left: 12px; right: 12px; transform: none; }
  .toast { width: 100%; }
}

/* Admin : même wordmark que le reste du site. */
.brand .admin-suffix { color: var(--muted); font-weight: 600; }

/* ── Offre de lancement (seuil de retrait abaissé, places limitées) ── */
.offer-band { display: flex; align-items: center; gap: 11px; margin-bottom: 18px; padding: 13px 16px;
  border-radius: 11px; border: 1px solid var(--warn-soft); background: var(--warn-soft);
  color: var(--text-2); font-size: 14px; }
.offer-band .offer-ic { display: inline-flex; color: var(--warn); }
.offer-band .icon { fill: currentColor; stroke: none; width: 18px; height: 18px; }
.offer-band strong { color: var(--text); }

/* ── Fin de quota : ce qui vient ensuite, plutôt qu'un cul-de-sac ── */
.done-next { display: flex; align-items: center; justify-content: center; gap: 9px; margin-top: 16px;
  padding: 11px 14px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border);
  font-size: 13.5px; color: var(--text-2); }
.done-next-ic { display: inline-flex; color: #f2732e; }
.done-ref { margin-top: 14px; padding-top: 16px; border-top: 1px solid var(--border); }
.done-ref-t { font-weight: 700; font-size: 14px; margin-bottom: 4px; }
.done-ref p { font-size: 13px; margin-bottom: 12px; }

/* ─────────────────────────────────────────────────────────────
   Admin — tableau de bord
   ───────────────────────────────────────────────────────────── */
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; }

.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--shadow-xs); }
.kpi-l { color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .4px; }
.kpi-v { font-size: 28px; font-weight: 800; letter-spacing: -.02em; margin-top: 6px; line-height: 1.1; }
.trend { display: inline-block; margin-top: 7px; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 7px; }
.trend.up { background: var(--success-soft); color: var(--success); }
.trend.down { background: var(--danger-soft); color: var(--danger); }
.trend.flat { background: var(--surface-2); color: var(--muted); }

.chart-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 820px) { .chart-row { grid-template-columns: 1fr; } }
.chart-card { padding: 18px 20px; }
.chart-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.chart-head h3 { font-size: 15px; }
.chart-wrap { width: 100%; }
.chart-svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart-bars rect { fill: var(--accent); opacity: .85; transition: opacity .12s ease; }
.chart-bars rect:hover { opacity: 1; }
.chart-axis { stroke: var(--border-strong); stroke-width: 1; }
.chart-ticks text { fill: var(--faint); font-size: 10px; font-family: var(--font); }

.st-kv { display: flex; flex-direction: column; }
.st-row { display: flex; align-items: baseline; justify-content: space-between; gap: 14px;
  padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.st-row:last-child { border-bottom: none; }
.st-k { color: var(--muted); }
.st-v { font-weight: 700; color: var(--text); text-align: right; }
.st-v.ok { color: var(--success); }
.st-v.warn { color: var(--warn); }
.st-v.bad { color: var(--danger); }

/* Réglages groupés */
.cfg-group { padding: 20px 22px; }
.cfg-title { font-size: 15px; }
.cfg-sub { font-size: 13px; margin: 4px 0 14px; }
.cfg-hint { font-size: 11.5px; color: var(--muted); }
.cfg-save { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.cfg-warn { margin-top: 12px; padding: 10px 13px; border-radius: 9px; font-size: 13px;
  background: var(--warn-soft); border: 1px solid var(--warn-soft); color: var(--warn); font-weight: 600; }
.ref-cap { font-size: 12.5px; margin-top: 10px; }

/* Widget Discord réel (remplace la pile de faux avatars). */
.discord-widget { width: 100%; max-width: 350px; height: 500px; border: 0; border-radius: 12px;
  display: block; box-shadow: 0 10px 30px rgba(20,30,80,.28); background: rgba(0,0,0,.15); }
@media (max-width: 720px) { .discord-widget { max-width: 100%; height: 420px; margin-inline: auto; } }

/* ── Section communauté : le widget doit garder sa largeur utile ── */
/* align-items:center sur la colonne empêchait l'iframe de s'étendre : elle
   tombait à 140 px et le widget Discord n'affichait plus rien. */
.community-inner { grid-template-columns: minmax(0, 1fr) 350px; gap: 40px; align-items: center; }
.community-side { align-items: stretch; }
.discord-widget { width: 350px; max-width: 100%; height: 460px; align-self: center; }

.community-list { list-style: none; margin: 20px 0 0; padding: 0; display: grid; gap: 12px; }
.community-list li { display: flex; align-items: flex-start; gap: 11px; font-size: 14.5px;
  color: rgba(255,255,255,.92); line-height: 1.45; }
.community-list .icon { width: 18px; height: 18px; flex-shrink: 0; margin-top: 2px; color: rgba(255,255,255,.85); }

@media (max-width: 880px) {
  .community-inner { grid-template-columns: 1fr; gap: 28px; }
  .community-list { max-width: 460px; margin-inline: auto; text-align: left; }
  .discord-widget { margin-inline: auto; }
}

/* ── Carte « en ligne » (remplace l'iframe Discord, trop étrangère au site) ── */
.live-card { background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.22);
  border-radius: 16px; padding: 26px 24px; text-align: center; backdrop-filter: blur(6px); }
.live-head { display: flex; align-items: center; justify-content: center; gap: 10px;
  font-size: 18px; font-weight: 800; color: #fff; }
.live-pulse { width: 10px; height: 10px; border-radius: 50%; background: #4ade80; flex-shrink: 0;
  box-shadow: 0 0 0 0 rgba(74,222,128,.6); animation: livePulse 2s infinite; }
.live-avatars { display: flex; justify-content: center; margin: 20px 0 14px; }
.live-av { width: 46px; height: 46px; border-radius: 50%; margin-left: -12px; object-fit: cover;
  border: 3px solid rgba(255,255,255,.9); background: var(--surface-2);
  box-shadow: 0 6px 14px rgba(20,30,80,.3); }
.live-av:first-child { margin-left: 0; }
.live-foot { font-size: 13px; color: rgba(255,255,255,.82); }
@media (max-width: 880px) { .live-card { max-width: 360px; margin-inline: auto; } }
