/* ==========================================================
   Grayzone Warfare FR — thème violet topographique
   ========================================================== */
:root {
  --bg: #08050f;
  --bg-2: #0f0a1c;
  --panel: rgba(18, 11, 34, 0.72);
  --panel-solid: #120b22;
  --line: rgba(139, 92, 246, 0.16);
  --line-strong: rgba(139, 92, 246, 0.38);
  --violet: #8b5cf6;
  --violet-hi: #a78bfa;
  --violet-pale: #ddd6fe;
  --violet-deep: #5b21b6;
  --text: #ece8f6;
  --muted: #9a90b3;
  --ok: #34d399;
  --warn: #fbbf24;
  --danger: #f87171;
  --radius: 10px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --display: 'Chakra Petch', 'Inter', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, Consolas, monospace;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
}
main { flex: 1; }
img { max-width: 100%; display: block; }
a { color: var(--violet-hi); text-decoration: none; }
a:hover { color: var(--violet-pale); }
h1, h2, h3 { font-family: var(--display); font-weight: 700; line-height: 1.15; margin: 0 0 .5em; letter-spacing: .01em; }
h1 { font-size: clamp(2rem, 5vw, 3rem); }
h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
code { font-family: var(--mono); font-size: .88em; background: rgba(139, 92, 246, .12); padding: .1em .35em; border-radius: 4px; }
::selection { background: var(--violet); color: #fff; }
:focus-visible { outline: 2px solid var(--violet-hi); outline-offset: 2px; }

.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.wrap-narrow { max-width: 780px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.mono { font-family: var(--mono); letter-spacing: .04em; }

/* ---------- Fond : courbes de niveau + grille + halo violet ---------- */
.bg { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden;
  background:
    radial-gradient(ellipse 60% 55% at 78% 58%, rgba(109, 40, 217, .32), transparent 70%),
    radial-gradient(ellipse 50% 45% at 12% 8%, rgba(76, 29, 149, .22), transparent 70%),
    linear-gradient(180deg, #0b0716 0%, var(--bg) 100%);
}
.bg-topo { position: absolute; inset: -2%; background: url('/img/topo.svg') center / cover no-repeat; opacity: .5;
  -webkit-mask-image: radial-gradient(ellipse 90% 80% at 60% 45%, #000 30%, rgba(0,0,0,.35) 100%);
          mask-image: radial-gradient(ellipse 90% 80% at 60% 45%, #000 30%, rgba(0,0,0,.35) 100%);
  animation: drift 60s ease-in-out infinite alternate;
}
.bg-grid { position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(139, 92, 246, .07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(139, 92, 246, .07) 1px, transparent 1px);
  background-size: 48px 48px;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, rgba(0,0,0,.4) 100%);
          mask-image: linear-gradient(180deg, #000 0%, rgba(0,0,0,.4) 100%);
}
@keyframes drift { from { transform: translate3d(0, 0, 0) scale(1); } to { transform: translate3d(-1.5%, 1%, 0) scale(1.04); } }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55em;
  padding: .7em 1.25em; border-radius: 8px; border: 1px solid transparent;
  background: linear-gradient(135deg, var(--violet) 0%, var(--violet-deep) 100%);
  color: #fff; font: 600 .95rem/1.2 var(--font); cursor: pointer;
  box-shadow: 0 0 0 1px rgba(196, 181, 253, .15) inset, 0 8px 24px -10px rgba(139, 92, 246, .8);
  transition: transform .15s, box-shadow .2s, filter .2s;
  white-space: nowrap;
}
.btn:hover { color: #fff; filter: brightness(1.12); transform: translateY(-1px); box-shadow: 0 0 0 1px rgba(196, 181, 253, .25) inset, 0 12px 30px -10px rgba(139, 92, 246, 1); }
.btn:active { transform: translateY(0); }
.btn-lg { padding: .95em 1.6em; font-size: 1.02rem; }
.btn-sm { padding: .45em .85em; font-size: .85rem; border-radius: 6px; }
.btn-block { width: 100%; }
.btn-ghost { background: rgba(139, 92, 246, .08); border-color: var(--line-strong); color: var(--violet-pale); box-shadow: none; }
.btn-ghost:hover { background: rgba(139, 92, 246, .18); color: #fff; box-shadow: none; }
.btn-discord { background: linear-gradient(135deg, #6f7cf7 0%, #5865f2 50%, #6d28d9 100%); box-shadow: 0 0 0 1px rgba(196, 181, 253, .18) inset, 0 8px 28px -10px rgba(88, 101, 242, .9); }
.btn-discord:hover { box-shadow: 0 0 0 1px rgba(196, 181, 253, .3) inset, 0 12px 34px -10px rgba(88, 101, 242, 1); }
.discord-icon { flex-shrink: 0; }
.nav-discord { display: inline-flex !important; align-items: center; gap: 7px; }
.nav-discord .discord-icon { color: #8b95ff; transition: color .2s; }
.nav-discord:hover .discord-icon { color: #fff; }

/* Carte d'invitation Discord */
.discord-card { position: relative; display: grid; grid-template-columns: auto 1fr; gap: 40px; align-items: center; padding: 44px; border-radius: 16px; overflow: hidden;
  border: 1px solid rgba(88, 101, 242, .45);
  background: radial-gradient(ellipse 50% 90% at 12% 50%, rgba(88, 101, 242, .35), transparent 70%),
              radial-gradient(ellipse 40% 80% at 95% 50%, rgba(139, 92, 246, .25), transparent 70%),
              url('/img/topo.svg') center / cover no-repeat, var(--panel-solid); }
.discord-card h2 { margin-bottom: .2em; }
.discord-card-logo { display: grid; place-items: center; width: 190px; height: 190px; border-radius: 50%; color: #5865f2;
  background: radial-gradient(circle, rgba(88, 101, 242, .22) 0%, rgba(88, 101, 242, .06) 60%, transparent 72%);
  border: 1px solid rgba(88, 101, 242, .35); box-shadow: 0 0 60px -10px rgba(88, 101, 242, .7) inset; }
.discord-card-logo .discord-icon { filter: drop-shadow(0 0 22px rgba(88, 101, 242, .8)); animation: hover 6s ease-in-out infinite; }
.invite { display: flex; align-items: center; gap: 16px; margin-top: 22px; padding: 14px 16px; max-width: 560px; border-radius: 12px; background: rgba(8, 5, 15, .75); border: 1px solid var(--line-strong); }
.invite-icon { width: 56px; height: 56px; border-radius: 16px; object-fit: cover; background: var(--bg-2); }
.invite-info { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.invite-info strong { font-size: 1.02rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.invite-counts { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .85rem; color: var(--muted); }
.invite-counts span { display: inline-flex; align-items: center; gap: 6px; }
.dot-online, .dot-members { width: 8px; height: 8px; border-radius: 50%; }
.dot-online { background: #23a55a; }
.dot-members { background: #80848e; }
.btn-danger { background: rgba(248, 113, 113, .1); border-color: rgba(248, 113, 113, .4); color: #fecaca; box-shadow: none; }
.btn-danger:hover { background: rgba(248, 113, 113, .22); color: #fff; box-shadow: none; }

/* ---------- En-tête ---------- */
.topbar { position: sticky; top: 0; z-index: 20; background: rgba(8, 5, 15, .72); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.topbar-inner { display: flex; align-items: center; gap: 24px; height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); }
.brand:hover { color: var(--text); }
.brand-text { font: 600 1.05rem/1 var(--display); letter-spacing: .12em; }
.brand-text b { color: var(--violet-hi); margin-left: .3em; }
.brand-tag { font: 600 .65rem/1 var(--mono); padding: 3px 5px; border: 1px solid var(--line-strong); border-radius: 4px; color: var(--violet-hi); }
.brand-sm .brand-text { font-size: .95rem; }

.nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.nav > a:not(.btn) { padding: 8px 12px; border-radius: 6px; color: var(--muted); font-weight: 500; font-size: .95rem; }
.nav > a:not(.btn):hover { color: var(--text); background: rgba(139, 92, 246, .08); }
.nav > a.active { color: var(--text); }
.nav > a.active::after { content: ''; display: block; height: 2px; margin-top: 3px; background: var(--violet); border-radius: 2px; }
.nav .btn { margin-left: 8px; }

.account { position: relative; margin-left: 8px; }
.account summary { list-style: none; display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 4px 10px 4px 4px; border-radius: 99px; border: 1px solid var(--line-strong); background: rgba(139, 92, 246, .08); font-size: .9rem; font-weight: 500; }
.account summary::-webkit-details-marker { display: none; }
.account summary img { border-radius: 50%; }
.account-menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 200px; padding: 6px; background: var(--panel-solid); border: 1px solid var(--line-strong); border-radius: var(--radius); box-shadow: 0 20px 40px -12px rgba(0,0,0,.7); }
.account-menu a, .account-menu button { display: block; width: 100%; text-align: left; padding: 9px 12px; border-radius: 6px; color: var(--text); font: 500 .9rem var(--font); background: none; border: 0; cursor: pointer; }
.account-menu a:hover, .account-menu button:hover { background: rgba(139, 92, 246, .15); }
.account-menu form { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 6px; }
.account-menu button { color: #fca5a5; }

.menu-btn { display: none; margin-left: auto; width: 40px; height: 40px; background: none; border: 1px solid var(--line-strong); border-radius: 8px; cursor: pointer; padding: 0 10px; }
.menu-btn span { display: block; height: 2px; background: var(--violet-pale); margin: 5px 0; border-radius: 2px; }

/* ---------- Messages ---------- */
.flash { margin: 20px 0 0; padding: 12px 16px; border-radius: 8px; border: 1px solid; font-size: .93rem; }
.flash-ok { background: rgba(52, 211, 153, .08); border-color: rgba(52, 211, 153, .35); color: #a7f3d0; }
.flash-error { background: rgba(248, 113, 113, .08); border-color: rgba(248, 113, 113, .35); color: #fecaca; }
.flash-warn { background: rgba(251, 191, 36, .07); border-color: rgba(251, 191, 36, .3); color: #fde68a; }

/* ---------- Sections ---------- */
.section { padding: 72px 0; }
.section-tight { padding-top: 0; }
.page-head { padding-bottom: 40px; }
.section-head { margin-bottom: 28px; }
.section-head h2 { margin: 0; }
.section-head-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.eyebrow { color: var(--violet-hi); font-size: .78rem; text-transform: uppercase; margin: 0 0 12px; display: flex; align-items: center; gap: 10px; }
.lead { font-size: 1.12rem; color: #c9c1dd; max-width: 60ch; }
.link-arrow { font-weight: 600; font-size: .95rem; }
.link-back { display: inline-block; margin-bottom: 18px; font-size: .9rem; color: var(--muted); }

/* ---------- Hero ---------- */
.hero { padding: 88px 0 56px; }
.hero-inner { display: grid; grid-template-columns: 1.15fr .85fr; gap: 48px; align-items: center; }
.hero-title { font-size: clamp(3rem, 9vw, 6.2rem); line-height: .92; text-transform: uppercase; letter-spacing: .02em; margin-bottom: 24px; }
.hero-title span { background: linear-gradient(100deg, var(--violet-pale) 0%, var(--violet) 55%, #6d28d9 100%); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 0 30px rgba(139, 92, 246, .45)); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 32px 0 40px; }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--violet-hi); box-shadow: 0 0 0 0 rgba(167, 139, 250, .7); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 10px rgba(167, 139, 250, 0); } 100% { box-shadow: 0 0 0 0 rgba(167, 139, 250, 0); } }

.stats { display: flex; gap: 0; margin: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); backdrop-filter: blur(6px); width: fit-content; }
.stats > div { padding: 14px 26px; }
.stats > div + div { border-left: 1px solid var(--line); }
.stats dt { font: 500 .72rem var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: .08em; display: flex; align-items: center; gap: 6px; }
.stats dd { margin: 2px 0 0; font: 700 1.6rem/1.2 var(--display); }
.online-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 8px var(--ok); }

.hero-visual { position: relative; aspect-ratio: 1; max-width: 440px; width: 100%; justify-self: center; }
.radar { position: absolute; inset: 8%; border-radius: 50%; background: radial-gradient(circle, rgba(139, 92, 246, .14) 0%, rgba(139, 92, 246, .03) 60%, transparent 70%); }
.radar-ring { position: absolute; border-radius: 50%; border: 1px solid var(--line-strong); }
.r1 { inset: 0; } .r2 { inset: 17%; border-style: dashed; opacity: .7; } .r3 { inset: 34%; }
.radar-cross { position: absolute; inset: 0; background:
  linear-gradient(90deg, transparent calc(50% - .5px), var(--line-strong) calc(50% - .5px), var(--line-strong) calc(50% + .5px), transparent calc(50% + .5px)),
  linear-gradient(0deg, transparent calc(50% - .5px), var(--line-strong) calc(50% - .5px), var(--line-strong) calc(50% + .5px), transparent calc(50% + .5px)); }
.radar-sweep { position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(from 0deg, rgba(167, 139, 250, .45), rgba(139, 92, 246, .08) 18%, transparent 30%); animation: sweep 6s linear infinite; }
@keyframes sweep { to { transform: rotate(360deg); } }
.blip { position: absolute; width: 8px; height: 8px; border-radius: 50%; background: var(--violet-pale); box-shadow: 0 0 12px var(--violet-hi); animation: blip 6s infinite; }
.b1 { top: 28%; left: 62%; } .b2 { top: 60%; left: 30%; animation-delay: 2.2s; } .b3 { top: 70%; left: 68%; animation-delay: 4s; }
.radar-logo { position: absolute; inset: 22%; width: 56%; height: 56%; object-fit: contain;
  filter: drop-shadow(0 10px 28px rgba(0, 0, 0, .7)) drop-shadow(0 0 36px rgba(139, 92, 246, .45));
  animation: hover 6s ease-in-out infinite; }
@keyframes hover { 50% { transform: translateY(-8px); } }
@keyframes blip { 0%, 100% { opacity: .15; } 10% { opacity: 1; } 50% { opacity: .3; } }
.hud { position: absolute; font-size: .7rem; color: var(--muted); line-height: 1.5; padding: 8px 12px; border: 1px solid var(--line); background: var(--panel); border-radius: 6px; }
.hud b { color: var(--violet-pale); font-weight: 500; }
.hud-tl { top: 0; left: 0; } .hud-br { bottom: 0; right: 0; }

/* ---------- Cartes & panneaux ---------- */
.panel { position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; backdrop-filter: blur(8px); }
.corner { position: absolute; width: 14px; height: 14px; border: 2px solid var(--violet); }
.corner.tl { top: -1px; left: -1px; border-right: 0; border-bottom: 0; border-top-left-radius: var(--radius); }
.corner.tr { top: -1px; right: -1px; border-left: 0; border-bottom: 0; border-top-right-radius: var(--radius); }
.corner.bl { bottom: -1px; left: -1px; border-right: 0; border-top: 0; border-bottom-left-radius: var(--radius); }
.corner.br { bottom: -1px; right: -1px; border-left: 0; border-top: 0; border-bottom-right-radius: var(--radius); }

.features { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.feature { padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); transition: border-color .2s, transform .2s; }
.feature:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.feature p { margin: 0; font-size: .93rem; }
.feature-ico { display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 16px; border-radius: 10px; background: rgba(139, 92, 246, .12); border: 1px solid var(--line-strong); }
.feature-ico svg { width: 22px; height: 22px; fill: none; stroke: var(--violet-hi); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px; }
.card { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); overflow: hidden; color: var(--text); transition: border-color .2s, transform .2s, box-shadow .2s; }
.card:hover { color: var(--text); border-color: var(--line-strong); transform: translateY(-3px); box-shadow: 0 18px 40px -20px rgba(139, 92, 246, .6); }
.card-cover { position: relative; aspect-ratio: 16 / 8; background: var(--bg-2); }
.card-cover img { width: 100%; height: 100%; object-fit: cover; }
.card-cover-empty { background: url('/img/topo.svg') center / 260% no-repeat, radial-gradient(circle at 70% 60%, rgba(109, 40, 217, .4), transparent 70%), var(--bg-2); }
.card-cover .badge { position: absolute; top: 12px; left: 12px; }
.card-body { padding: 18px 20px 20px; display: flex; flex-direction: column; flex: 1; }
.card-body h3 { margin-bottom: .4em; }
.card-body p { font-size: .92rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-meta { margin-top: auto; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; color: var(--muted); font-size: .8rem; }
.card-meta img { border-radius: 50%; }
.dot { opacity: .5; }

.badge { display: inline-block; padding: 3px 9px; border-radius: 4px; font: 600 .7rem/1.4 var(--mono); text-transform: uppercase; letter-spacing: .06em; background: rgba(8, 5, 15, .8); border: 1px solid var(--line-strong); color: var(--violet-pale); backdrop-filter: blur(4px); }
.badge-astuce { border-color: rgba(52, 211, 153, .45); color: #a7f3d0; }
.badge-actu { border-color: rgba(96, 165, 250, .45); color: #bfdbfe; }
.badge-loadout { border-color: rgba(251, 191, 36, .45); color: #fde68a; }
.badge-event { border-color: rgba(244, 114, 182, .45); color: #fbcfe8; }

.empty { text-align: center; padding: 56px 20px; border: 1px dashed var(--line-strong); border-radius: var(--radius); background: rgba(18, 11, 34, .4); }
.empty .mono { color: var(--violet-hi); font-size: .85rem; margin-bottom: .4em; }

.cta { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; padding: 40px; border-radius: 14px; border: 1px solid var(--line-strong);
  background: radial-gradient(ellipse at 85% 50%, rgba(139, 92, 246, .35), transparent 60%), url('/img/topo.svg') center / cover no-repeat, var(--panel-solid); }
.cta h2, .cta h3 { margin-bottom: .2em; }
.cta p { margin: 0; }
.cta-small { margin-top: 56px; padding: 28px; }

/* ---------- Filtres ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 28px; }
.chip { padding: 7px 14px; border-radius: 99px; border: 1px solid var(--line-strong); background: rgba(18, 11, 34, .6); color: var(--muted); font-size: .9rem; font-weight: 500; }
.chip:hover { color: var(--text); }
.chip.active { background: var(--violet); border-color: var(--violet); color: #fff; }
.chip-n { font: .75rem var(--mono); opacity: .75; margin-left: 2px; }

/* ---------- Article ---------- */
.article-head { margin-bottom: 32px; }
.article-head h1 { margin: 14px 0 12px; }
.article-meta { display: flex; align-items: center; gap: 12px; padding-top: 18px; border-top: 1px solid var(--line); }
.article-meta img { border-radius: 50%; }
.article-meta div { display: flex; flex-direction: column; line-height: 1.35; }
.article-meta .btn { margin-left: auto; }
.article-cover { width: 100%; border-radius: var(--radius); border: 1px solid var(--line); margin-bottom: 32px; }

.prose { font-size: 1.04rem; line-height: 1.75; color: #ddd7ec; overflow-wrap: anywhere; }
.prose h1, .prose h2, .prose h3 { margin-top: 1.8em; color: var(--text); }
.prose h2 { padding-left: 14px; border-left: 3px solid var(--violet); }
.prose a { text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
.prose img { border-radius: 8px; border: 1px solid var(--line); margin: 1.5em auto; }
.prose blockquote { margin: 1.5em 0; padding: 14px 20px; border-left: 3px solid var(--violet); background: rgba(139, 92, 246, .08); border-radius: 0 8px 8px 0; color: var(--violet-pale); }
.prose blockquote p:last-child { margin: 0; }
.prose pre { background: #0b0716; border: 1px solid var(--line); padding: 16px; border-radius: 8px; overflow-x: auto; }
.prose pre code { background: none; padding: 0; }
.prose table { width: 100%; border-collapse: collapse; margin: 1.5em 0; font-size: .95rem; }
.prose th, .prose td { border: 1px solid var(--line); padding: 8px 12px; text-align: left; }
.prose th { background: rgba(139, 92, 246, .1); }
.prose hr { border: 0; border-top: 1px solid var(--line-strong); margin: 2.5em 0; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li::marker { color: var(--violet-hi); }

/* ---------- Connexion / profil ---------- */
.login-panel, .error-panel { padding: 44px; text-align: center; }
.login-panel .eyebrow, .error-panel .eyebrow { justify-content: center; }
.login-panel > .muted { max-width: 46ch; margin: 0 auto 28px; }
.dev-login { margin-top: 24px; padding: 16px; border: 1px dashed rgba(251, 191, 36, .4); border-radius: 8px; }
.dev-login p { color: var(--warn); margin-bottom: 10px; }
.dev-login-row { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.roles { list-style: none; padding: 24px 0 0; margin: 28px 0 0; border-top: 1px solid var(--line); text-align: left; display: grid; gap: 10px; font-size: .9rem; color: var(--muted); }
.roles li { display: flex; align-items: center; gap: 12px; }
.role { display: inline-block; min-width: 92px; text-align: center; padding: 3px 10px; border-radius: 4px; font: 600 .72rem/1.5 var(--mono); text-transform: uppercase; letter-spacing: .06em; border: 1px solid; }
.role-member { color: var(--muted); border-color: rgba(154, 144, 179, .4); }
.role-editor { color: #a7f3d0; border-color: rgba(52, 211, 153, .45); background: rgba(52, 211, 153, .07); }
.role-admin { color: var(--violet-pale); border-color: var(--violet); background: rgba(139, 92, 246, .15); }

.profile { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.profile > img { border-radius: 50%; border: 2px solid var(--violet); box-shadow: 0 0 24px rgba(139, 92, 246, .5); }
.profile h1 { margin-bottom: 6px; }
.profile .role { margin-right: 8px; }
.profile-actions { margin-left: auto; display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- Tableaux ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.table th { text-align: left; font: 500 .72rem var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 12px 16px; border-bottom: 1px solid var(--line); background: rgba(139, 92, 246, .05); }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table td a:not(.btn) { color: var(--text); font-weight: 500; }
.table td a:not(.btn):hover { color: var(--violet-hi); }
.table .actions { text-align: right; white-space: nowrap; }
.table .actions form { display: inline; }
.user-cell { display: flex; align-items: center; gap: 10px; }
.user-cell img { border-radius: 50%; }
.user-cell div { display: flex; flex-direction: column; line-height: 1.3; }
.status { font: 500 .78rem var(--mono); }
.status::before { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }
.status-published { color: #a7f3d0; } .status-published::before { background: var(--ok); }
.status-draft { color: var(--warn); } .status-draft::before { background: var(--warn); }

/* ---------- Formulaires ---------- */
input[type=text], input[type=url], input[type=search], select, textarea {
  width: 100%; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--line-strong);
  background: rgba(8, 5, 15, .7); color: var(--text); font: 400 .95rem/1.5 var(--font);
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--violet); box-shadow: 0 0 0 3px rgba(139, 92, 246, .2); }
textarea { resize: vertical; }
textarea[name=content] { font: 400 .92rem/1.65 var(--mono); min-height: 420px; }
select { cursor: pointer; }
.search { max-width: 260px; }
.role-form select { width: auto; min-width: 140px; padding: 6px 10px; font-size: .88rem; }

.field { display: block; margin-bottom: 20px; }
.field > span { display: block; font-weight: 600; font-size: .88rem; margin-bottom: 7px; }
.field em { font-style: normal; font-weight: 400; }
.radio { display: flex; align-items: center; gap: 8px; margin: 6px 0; cursor: pointer; font-size: .93rem; }
.radio input { accent-color: var(--violet); width: 16px; height: 16px; }
.hint { margin: 8px 0 0; }

.editor { display: grid; grid-template-columns: 1fr 320px; gap: 24px; align-items: start; }
.editor-side { position: sticky; top: 88px; }
.editor-tabs { display: flex; align-items: center; gap: 4px; margin-bottom: 8px; flex-wrap: wrap; }
.editor-tabs > button { padding: 6px 14px; border-radius: 6px; border: 1px solid transparent; background: none; color: var(--muted); font: 600 .88rem var(--font); cursor: pointer; }
.editor-tabs > button.active { background: rgba(139, 92, 246, .15); border-color: var(--line-strong); color: var(--text); }
.toolbar { margin-left: auto; display: flex; gap: 2px; }
.toolbar[hidden] { display: none; }
.toolbar button { min-width: 32px; height: 32px; border-radius: 6px; border: 1px solid var(--line); background: rgba(18, 11, 34, .6); color: var(--violet-pale); cursor: pointer; font: 600 .85rem var(--font); }
.toolbar button:hover { border-color: var(--violet); }
.preview { min-height: 420px; padding: 20px 24px; border: 1px solid var(--line-strong); border-radius: 8px; background: rgba(8, 5, 15, .7); }
.danger-zone { margin-top: 14px; text-align: center; }

/* ---------- Pied de page ---------- */
.footer { margin-top: 40px; border-top: 1px solid var(--line); background: rgba(8, 5, 15, .75); }
.footer-inner { display: flex; justify-content: space-between; gap: 32px; flex-wrap: wrap; padding-top: 40px; padding-bottom: 28px; }
.footer-inner p { max-width: 42ch; margin-top: 14px; }
.footer-nav { display: flex; gap: 22px; flex-wrap: wrap; align-items: flex-start; }
.footer-nav a { color: var(--muted); font-size: .92rem; }
.footer-nav a:hover { color: var(--text); }
.footer-coords { font-size: .7rem; color: rgba(154, 144, 179, .6); padding-bottom: 24px; }

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .features { grid-template-columns: repeat(2, 1fr); }
  .editor { grid-template-columns: 1fr; }
  .editor-side { position: static; }
}
@media (max-width: 860px) {
  .hero { padding-top: 48px; }
  .hero-inner { grid-template-columns: 1fr; }
  .hero-visual { display: none; }
  .menu-btn { display: block; }
  .nav { display: none; position: absolute; top: 68px; left: 0; right: 0; flex-direction: column; align-items: stretch; padding: 12px 16px 20px; background: rgba(8, 5, 15, .97); border-bottom: 1px solid var(--line); }
  .nav.open { display: flex; }
  .nav > a.active::after { display: none; }
  .nav .btn, .account { margin: 8px 0 0; }
  .account-menu { position: static; margin-top: 8px; }
}
@media (max-width: 600px) {
  .wrap { padding: 0 16px; }
  .section { padding: 48px 0; }
  .features { grid-template-columns: 1fr; }
  .grid-cards { grid-template-columns: 1fr; }
  .stats { width: 100%; }
  .stats > div { flex: 1; padding: 12px 14px; }
  .stats dd { font-size: 1.3rem; }
  .hero-actions .btn { flex: 1 1 100%; }
  .cta { padding: 28px 22px; }
  .discord-card { grid-template-columns: 1fr; padding: 28px 20px; gap: 20px; text-align: center; }
  .discord-card .eyebrow { justify-content: center; }
  .discord-card-logo { width: 120px; height: 120px; margin: 0 auto; }
  .discord-card-logo .discord-icon { width: 72px; height: 55px; }
  .invite { flex-wrap: wrap; text-align: left; }
  .invite-info strong { white-space: normal; }
  .invite .btn { flex: 1 1 100%; }
  .login-panel, .error-panel { padding: 32px 20px; }
  .profile-actions { margin-left: 0; width: 100%; }
  .search { max-width: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Pages légales */
.legal-nav { display: flex; flex-wrap: wrap; gap: 8px; margin: 22px 0 8px; }
.legal-nav a { padding: 6px 14px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: .88rem; }
.legal-nav a:hover { color: var(--text); border-color: var(--line-strong); }
.legal-nav a.active { color: var(--text); background: rgba(139, 92, 246, .14); border-color: var(--violet); }
.footer-legal { display: flex; flex-wrap: wrap; gap: 6px 20px; padding-bottom: 12px; font-size: .82rem; }
.footer-legal a { color: var(--muted); }
.footer-legal a:hover { color: var(--text); }
.login-legal { margin-top: 14px; text-align: center; }
.login-legal a { text-decoration: underline; text-underline-offset: 3px; }

/* Suppression de compte */
.account-delete { margin-top: 48px; }
.account-delete summary { cursor: pointer; width: max-content; }
.account-delete .panel { margin-top: 12px; }
.account-delete form { margin-top: 14px; }

/* Éditeur : image de couverture */
.cover-drop { position: relative; display: grid; place-items: center; aspect-ratio: 16 / 9; border: 1.5px dashed var(--line-strong); border-radius: 10px; background: rgba(18, 11, 34, .55); cursor: pointer; overflow: hidden; transition: border-color .2s, background .2s; }
.cover-drop:hover, .cover-drop.dragging { border-color: var(--violet); background: rgba(139, 92, 246, .1); }
.cover-drop img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cover-drop img[hidden] { display: none; }
.cover-drop-empty { display: grid; justify-items: center; gap: 2px; text-align: center; padding: 12px; font-size: .9rem; }
.cover-drop-empty svg { width: 30px; height: 30px; fill: none; stroke: var(--violet-hi); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; margin-bottom: 6px; }
.cover-drop.has-image .cover-drop-empty { display: none; }
.cover-drop-busy { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(10, 6, 18, .75); color: var(--violet-pale); letter-spacing: .1em; }
.cover-drop-busy[hidden] { display: none; }
.cover-remove { position: absolute; top: 8px; right: 8px; width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--line-strong); background: rgba(10, 6, 18, .8); color: var(--text); cursor: pointer; display: none; }
.cover-drop.has-image .cover-remove { display: block; }
.cover-remove:hover { border-color: #f87171; color: #fecaca; }
.cover-url { margin-top: 8px; padding: 7px 10px !important; font-size: .8rem !important; }

/* Éditeur en blocs */
.editor-bar { position: sticky; top: 78px; z-index: 5; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px; margin-bottom: 14px; border: 1px solid var(--line-strong); border-radius: 10px; background: rgba(12, 7, 24, .92); backdrop-filter: blur(10px); }
.editor-bar .editor-tabs { margin: 0; }
.editor-bar .toolbar { margin-left: auto; flex-wrap: wrap; }
.toolbar-sep { width: 1px; align-self: stretch; margin: 2px 4px; background: var(--line-strong); }
.toolbar .toolbar-img { padding: 0 12px; background: rgba(139, 92, 246, .18); border-color: var(--line-strong); color: #fff; }

.blocks { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 26px 26px 18px 52px; min-height: 260px; border: 1px solid var(--line); border-radius: 12px; background: rgba(8, 5, 15, .55); }
.blocks[hidden], .blocks-add[hidden], .toolbar[hidden] { display: none; }

.block { position: relative; border-radius: 8px; transition: background .15s, box-shadow .15s, opacity .15s; }
.block:hover, .block:focus-within { background: rgba(139, 92, 246, .05); box-shadow: 0 0 0 1px var(--line); }
.block.is-dragged { opacity: .35; }
.block-body { padding: 6px 12px; }

.block-tools { position: absolute; left: -44px; top: 4px; display: flex; flex-direction: column; gap: 2px; opacity: 0; transition: opacity .15s; }
.block:hover .block-tools, .block:focus-within .block-tools { opacity: 1; }
.block-tools button, .block-insert button { border: 1px solid var(--line); background: var(--panel-solid); color: var(--muted); border-radius: 6px; cursor: pointer; font: 600 .78rem var(--font); }
.block-tools button { width: 30px; height: 26px; }
.block-tools button:hover, .block-insert button:hover { color: #fff; border-color: var(--violet); }
.block-tools .block-handle { cursor: grab; font-size: 1rem; color: var(--violet-hi); }
.block-tools .block-del:hover { border-color: #f87171; color: #fecaca; }

.block-insert { position: absolute; right: 10px; bottom: -14px; z-index: 3; display: flex; gap: 6px; opacity: 0; pointer-events: none; transition: opacity .15s; }
.block:hover > .block-insert { opacity: 1; pointer-events: auto; }
.block-insert button { padding: 4px 10px; background: var(--violet); border-color: var(--violet); color: #fff; box-shadow: 0 6px 16px -6px rgba(139, 92, 246, .8); }

/* Bloc texte : rendu lisible, édition au clic */
.block-input { display: none; width: 100%; min-height: 44px; padding: 4px 0 !important; border: 0 !important; background: transparent !important; box-shadow: none !important; color: var(--text); font: 400 1.02rem/1.7 var(--font) !important; resize: none; overflow: hidden; }
.block-text.editing .block-input { display: block; }
.block-text.editing .block-render { display: none; }
.block-render { cursor: text; min-height: 1.7em; }
.block-render > :first-child { margin-top: 0; }
.block-render > :last-child { margin-bottom: 0; }
.block-text.editing { background: rgba(139, 92, 246, .07); box-shadow: 0 0 0 1px var(--line-strong); }

/* Bloc images : une image ou une galerie */
.img-grid { display: grid; gap: 10px; grid-template-columns: 1fr; }
.is-gallery .img-grid[data-count="2"] { grid-template-columns: repeat(2, 1fr); }
.is-gallery .img-grid[data-count="3"] { grid-template-columns: repeat(3, 1fr); }
.img-item { position: relative; margin: 0; cursor: grab; transition: opacity .15s, transform .15s; }
.img-item.is-dragged { opacity: .3; transform: scale(.97); }
.img-frame { position: relative; overflow: hidden; border-radius: 10px; border: 1px solid var(--line); background: var(--bg-2); }
.img-frame img { display: block; width: 100%; height: auto; max-height: 520px; object-fit: contain; pointer-events: none; }
.is-gallery .img-frame img { aspect-ratio: 4 / 3; object-fit: cover; max-height: none; }
.img-actions { position: absolute; top: 8px; right: 8px; display: flex; gap: 6px; opacity: 0; transition: opacity .15s; }
.img-item:hover .img-actions { opacity: 1; }
.img-actions button { width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line-strong); background: rgba(10, 6, 18, .85); color: #fff; cursor: pointer; font-size: .85rem; }
.img-actions button:hover { border-color: var(--violet); background: var(--violet); }
.img-actions .img-out { display: none; }
.is-gallery .img-actions .img-out { display: inline-block; }
.img-loading { position: absolute; inset: 0; display: none; place-items: center; background: rgba(10, 6, 18, .6); color: var(--violet-pale); font-size: .75rem; letter-spacing: .12em; }
.img-item.uploading .img-loading { display: grid; }
.img-item.uploading .img-loading::before { content: ''; width: 18px; height: 18px; margin-right: 8px; border: 2px solid var(--violet-hi); border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; }
.img-loading { grid-auto-flow: column; }
@keyframes spin { to { transform: rotate(360deg); } }
.img-caption { width: 100%; margin-top: 6px; padding: 4px 6px !important; border: 0 !important; border-bottom: 1px dashed transparent !important; background: transparent !important; box-shadow: none !important; text-align: center; color: var(--muted); font: italic .88rem var(--font) !important; }
.img-caption:hover, .img-caption:focus { border-bottom-color: var(--line-strong) !important; color: var(--text); }

.img-add { grid-column: 1 / -1; display: flex; justify-content: center; align-items: center; gap: 6px; padding: 6px; border: 1.5px dashed var(--line-strong); border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; font: 500 .8rem var(--font); opacity: 0; transition: opacity .15s, border-color .15s; }
.img-add b { font-size: 1.1rem; line-height: 1; color: var(--violet-hi); }
.img-add:hover { border-color: var(--violet); color: #fff; background: rgba(139, 92, 246, .08); }
.block-image:hover .img-add, .img-add.drop-before { opacity: 1; }

/* Indicateurs de dépôt */
.drop-line { position: relative; height: 0; }
.drop-line::after { content: ''; position: absolute; left: 0; right: 0; top: -5px; height: 4px; border-radius: 4px; background: var(--violet); box-shadow: 0 0 14px var(--violet); }
.drop-before { position: relative; }
.drop-before::before { content: ''; position: absolute; left: -7px; top: 0; bottom: 0; width: 4px; border-radius: 4px; background: var(--violet); box-shadow: 0 0 14px var(--violet); z-index: 2; }

.blocks-add { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.upload-status { margin: 10px 0 0; color: var(--violet-pale); }
.upload-status.is-error { color: #fca5a5; }
.upload-status[hidden] { display: none; }
details.hint { margin-top: 14px; }
details.hint summary { cursor: pointer; width: max-content; }
details.hint ul { margin: 8px 0 0; padding-left: 1.2em; }
details.hint li { margin-bottom: 4px; }

/* Aperçu fidèle */
.editor-preview { padding: 30px 34px; border: 1px solid var(--line-strong); border-radius: 12px; background: rgba(8, 5, 15, .82); }
.editor-preview[hidden] { display: none; }
.preview-label { margin-bottom: 22px; font-size: .7rem; color: var(--violet-hi); letter-spacing: .14em; }
.preview-article .article-head h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); }

@media (max-width: 720px) {
  .editor-bar { top: 58px; }
  .blocks { padding: 18px 10px 14px 10px; }
  .block-tools { position: static; flex-direction: row; justify-content: flex-end; opacity: 1; padding: 4px 6px 0; }
  .img-actions { opacity: 1; }
  .img-add { opacity: 1; }
  .block-insert { position: static; transform: none; opacity: 1; pointer-events: auto; justify-content: center; padding: 4px 0 6px; }
  .block-insert button { background: transparent; border-color: var(--line); color: var(--muted); box-shadow: none; }
  .is-gallery .img-grid[data-count="3"] { grid-template-columns: repeat(2, 1fr); }
  .editor-preview { padding: 20px 16px; }
}

/* Articles : images, légendes, galeries */
.prose figure { margin: 2em 0; }
.prose figure img { display: block; width: 100%; height: auto; margin: 0; border-radius: 10px; border: 1px solid var(--line); background: var(--bg-2); box-shadow: 0 20px 50px -30px rgba(139, 92, 246, .7); }
.prose figcaption { margin-top: 10px; text-align: center; color: var(--muted); font-size: .88rem; font-style: italic; }
.prose .gallery { display: grid; gap: 12px; margin: 2em 0; }
.prose .gallery-2 { grid-template-columns: repeat(2, 1fr); }
.prose .gallery-3 { grid-template-columns: repeat(3, 1fr); }
.prose .gallery figure { margin: 0; }
.prose .gallery figure img { aspect-ratio: 4 / 3; object-fit: cover; }
.prose .gallery figcaption { font-size: .8rem; margin-top: 6px; }
.article-cover { aspect-ratio: 16 / 8; object-fit: cover; box-shadow: 0 30px 70px -35px rgba(139, 92, 246, .8); }
.zoomable { cursor: zoom-in; transition: filter .2s, transform .2s; }
.zoomable:hover { filter: brightness(1.08); }
@media (max-width: 640px) {
  .prose .gallery-3 { grid-template-columns: repeat(2, 1fr); }
}

/* Visionneuse */
.lightbox { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; align-content: center; gap: 12px; padding: 24px; background: rgba(6, 3, 12, .92); backdrop-filter: blur(6px); cursor: zoom-out; animation: lb-in .18s ease-out; }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: min(1600px, 100%); max-height: calc(100vh - 110px); border-radius: 8px; box-shadow: 0 30px 80px rgba(0, 0, 0, .6); }
.lightbox-caption { margin: 0; color: var(--muted); font-size: .9rem; text-align: center; }
.lightbox-close { position: absolute; top: 16px; right: 16px; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line-strong); background: rgba(18, 11, 34, .8); color: var(--text); font-size: 1rem; cursor: pointer; }
.no-scroll { overflow: hidden; }
@keyframes lb-in { from { opacity: 0; } }
