/* =========================================================
   Thèmes de couleur (data-theme sur <html>)
   ========================================================= */
html[data-theme="aurore"] { --accent: #f472b6; --accent2: #a78bfa; --accent-rgb: 244,114,182; --accent-ink: #2a0619; --b1: #db2777; --b2: #7c3aed; --b3: #f472b6; --b4: #6366f1; }
html[data-theme="braise"] { --accent: #fb923c; --accent2: #f43f5e; --accent-rgb: 251,146,60; --accent-ink: #2a1003; --b1: #ea580c; --b2: #e11d48; --b3: #f59e0b; --b4: #be123c; }
html[data-theme="ocean"] { --accent: #38bdf8; --accent2: #6366f1; --accent-rgb: 56,189,248; --accent-ink: #03182a; --b1: #0284c7; --b2: #4f46e5; --b3: #06b6d4; --b4: #1e40af; }
html[data-theme="jade"] { --accent: #4ade80; --accent2: #a3e635; --accent-rgb: 74,222,128; --accent-ink: #052012; --b1: #16a34a; --b2: #65a30d; --b3: #059669; --b4: #0d9488; }
html[data-theme="nebula"] { --accent: #c084fc; --accent2: #22d3ee; --accent-rgb: 192,132,252; --accent-ink: #1d0730; --b1: #9333ea; --b2: #0891b2; --b3: #c026d3; --b4: #2563eb; }
html[data-theme="mono"] { --accent: #e5e7eb; --accent2: #9ca3af; --accent-rgb: 229,231,235; --accent-ink: #111; --b1: #475569; --b2: #334155; --b3: #64748b; --b4: #1e293b; }
html.no-bg .bg span { display: none; }
html.reduced *, html.reduced *::before, html.reduced *::after { animation-duration: .001s !important; transition-duration: .001s !important; }
.themes { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; margin: 6px 0 14px; }
.theme { position: relative; height: 70px; border-radius: 14px; border: 1px solid var(--edge); cursor: pointer; overflow: hidden; color: #fff; font: inherit; font-weight: 600; font-size: 12px; text-align: left; padding: 8px 10px; display: flex; align-items: flex-end; transition: transform .3s var(--ease), box-shadow .3s; text-shadow: 0 1px 4px rgba(0,0,0,.6); }
.theme:hover { transform: translateY(-3px) scale(1.02); }
.theme.sel { box-shadow: 0 0 0 2px #fff, 0 10px 30px -10px var(--accent); }
.theme.sel::after { content: "✓"; position: absolute; top: 6px; right: 8px; width: 20px; height: 20px; border-radius: 50%; background: #fff; color: #000; display: grid; place-items: center; font-size: 12px; text-shadow: none; }

/* ---------- Icônes SVG ---------- */
i[data-icon] { display: inline-flex; width: 1.15em; height: 1.15em; flex: none; vertical-align: -.2em; font-style: normal; }
i[data-icon] svg { width: 100%; height: 100%; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
i[data-icon="discord"] svg { fill: currentColor; stroke: none; }
nav a i[data-icon] { width: 18px; height: 18px; transition: transform .3s var(--ease), color .2s; }
nav a:hover i[data-icon] { transform: scale(1.15) rotate(-6deg); color: var(--accent); }
nav a.sel i[data-icon] { color: var(--accent); filter: drop-shadow(0 0 6px rgba(var(--accent-rgb), .7)); }
.logo i[data-icon] { width: 22px; height: 22px; }
.tile-ico i[data-icon] { width: 20px; height: 20px; }
.avatar-cta i[data-icon] { width: 22px; height: 22px; margin: 0 auto 2px; }
.hover-cta i[data-icon] { margin-right: 6px; }
.icon-btn i[data-icon] { width: 17px; height: 17px; }
.chip i[data-icon] { width: 12px; height: 12px; margin-right: 3px; }

/* ---------- Barre latérale : recherche, profil ---------- */
.search-btn { display: flex; align-items: center; gap: 8px; margin: 0 4px 14px; padding: 8px 10px; border-radius: 12px; border: 1px solid var(--edge); background: rgba(0,0,0,.2); color: var(--muted); font: inherit; cursor: pointer; transition: border-color .2s, color .2s, background .2s; }
.search-btn:hover { border-color: rgba(var(--accent-rgb), .6); color: var(--text); background: rgba(var(--accent-rgb), .06); }
.search-btn span { flex: 1; text-align: left; }
kbd { font: 600 10px/1 ui-monospace, monospace; padding: 4px 6px; border-radius: 6px; border: 1px solid var(--edge-hi); background: rgba(255,255,255,.06); color: var(--muted); }
.me-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.me-text span, .me-text small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#admin-nav .nav-title { margin-top: 14px; }
.topbar .label { font-size: 10px; }

/* ---------- Palette Ctrl+K ---------- */
.palette { position: fixed; inset: 0; z-index: 60; background: rgba(4,5,8,.55); backdrop-filter: blur(6px); display: grid; place-items: start center; padding-top: 14vh; animation: fadeIn .2s ease; }
@keyframes fadeIn { from { opacity: 0; } }
.palette-box { width: 560px; max-width: 92vw; border-radius: 20px; overflow: hidden; animation: popIn .3s var(--ease); background: rgba(16,19,27,.85); }
@keyframes popIn { from { opacity: 0; transform: translateY(-12px) scale(.97); } }
.palette-search { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--edge); }
.palette-search input { flex: 1; background: none; border: 0; color: var(--text); font: inherit; font-size: 16px; outline: none; }
.palette-search i { color: var(--accent); width: 20px; height: 20px; }
.palette-list { max-height: 50vh; overflow-y: auto; padding: 6px; }
.p-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; cursor: pointer; color: var(--muted); }
.p-item b { color: var(--text); font-weight: 600; }
.p-item i { width: 18px; height: 18px; }
.p-item.sel { background: rgba(var(--accent-rgb), .14); color: var(--text); box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), .35); }
.p-item.sel i { color: var(--accent); }
.p-item small { margin-left: auto; font-size: 11px; }
.p-group { padding: 8px 12px 4px; font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }

/* ---------- Connexion ---------- */
.login-orb { width: 74px; height: 74px; margin: 0 auto 6px; border-radius: 24px; display: grid; place-items: center; color: var(--accent-ink);
  background: linear-gradient(135deg, var(--accent), var(--accent2)); box-shadow: 0 16px 40px -12px rgba(var(--accent-rgb), .8), inset 0 1px 0 rgba(255,255,255,.5); animation: orb 6s ease-in-out infinite; }
.login-orb i { width: 36px; height: 36px; }
@keyframes orb { 50% { transform: translateY(-6px) rotate(6deg); border-radius: 30px; } }
.btn.discord { background: #5865f2; border-color: transparent; color: #fff; box-shadow: 0 10px 30px -10px #5865f2; padding: 11px 16px; font-size: 15px; }
.btn.discord:hover { background: #6d78f5; box-shadow: 0 12px 36px -8px #5865f2; }
.btn i[data-icon] { width: 16px; height: 16px; }
.login-foot { margin-top: 16px; display: flex; align-items: center; gap: 6px; justify-content: center; }

/* ---------- Mini-stats ---------- */
.stat-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-bottom: 16px; }
.mini { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 16px; margin: 0; }
.mini > i { width: 38px; height: 38px; padding: 9px; border-radius: 12px; color: var(--accent); background: rgba(var(--accent-rgb), .12); border: 1px solid rgba(var(--accent-rgb), .25); }
.mini b { display: block; font-size: 20px; font-weight: 800; color: var(--text); line-height: 1.1; }
.mini span { font-size: 12px; color: var(--muted); }
.color-mini { cursor: pointer; }
.color-mini input { margin-left: auto; width: 38px; height: 38px; border: 0; border-radius: 10px; background: none; cursor: pointer; padding: 0; }

/* ---------- Commandes ---------- */
.cmd-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; margin-top: 10px; }
.cmd { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 14px; border-radius: 14px; background: rgba(0,0,0,.22); border: 1px solid var(--edge); transition: all .3s var(--ease); animation: pop .4s var(--ease) backwards; }
.cmd:hover { border-color: rgba(var(--accent-rgb), .5); transform: translateY(-2px); box-shadow: 0 14px 30px -18px rgba(var(--accent-rgb), .8); }
.cmd.off { opacity: .55; }
.cmd-head { display: flex; align-items: center; gap: 8px; }
.cmd-name { font: 700 14px ui-monospace, monospace; color: var(--accent); flex: 1; overflow: hidden; text-overflow: ellipsis; }
.cmd-desc { color: var(--muted); font-size: 12px; min-height: 18px; }
.cmd-foot { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--muted); }
.cmd-foot .btn { margin-left: auto; }
.editor { animation: pop .35s var(--ease); border-color: rgba(var(--accent-rgb), .4); }
.editor-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.sticky-col { position: sticky; top: 84px; }
.prefix-input { display: flex; align-items: center; margin-top: 4px; }
.prefix-input span { padding: 10px 0 10px 12px; background: rgba(0,0,0,.3); border: 1px solid var(--edge); border-right: 0; border-radius: 12px 0 0 12px; color: var(--accent); font-weight: 700; }
.prefix-input .input { margin: 0; border-radius: 0 12px 12px 0; }
.span2 { grid-column: 1 / -1; }
.input.color { height: 42px; padding: 4px; cursor: pointer; }
.toggles { display: flex; gap: 18px; flex-wrap: wrap; margin: 4px 0 12px; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; color: var(--text); font-size: 13px; margin: 0; user-select: none; }
.check.inline { align-self: end; margin-bottom: 18px; }
.check input { display: none; }
.check span { width: 20px; height: 20px; border-radius: 7px; border: 1.5px solid var(--edge-hi); background: rgba(0,0,0,.3); display: grid; place-items: center; transition: all .25s var(--ease); flex: none; }
.check input:checked + span { background: linear-gradient(135deg, var(--accent), var(--accent2)); border-color: transparent; box-shadow: 0 0 12px -2px rgba(var(--accent-rgb), .8); }
.check input:checked + span::after { content: ""; width: 9px; height: 5px; border: 2px solid var(--accent-ink); border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); }

/* ---------- Aperçu façon Discord ---------- */
.dc-preview { margin: 10px 0 12px; padding: 14px 14px 16px; border-radius: 12px; background: #313338; color: #dbdee1; font: 15px/1.375 "gg sans", "Noto Sans", "Segoe UI", sans-serif; min-height: 90px; }
.dc-msg { display: flex; gap: 14px; }
.dc-ava { width: 40px; height: 40px; border-radius: 50%; background: #5865f2; flex: none; object-fit: cover; }
.dc-body { min-width: 0; flex: 1; }
.dc-name { font-weight: 600; color: #f2f3f5; margin-right: 6px; }
.dc-tag { font-size: 10px; font-weight: 600; background: #5865f2; color: #fff; border-radius: 4px; padding: 1px 4px; vertical-align: 1px; }
.dc-time { font-size: 12px; color: #949ba4; margin-left: 6px; }
.dc-text { white-space: pre-wrap; word-wrap: break-word; margin-top: 2px; }
.dc-embed { margin-top: 6px; max-width: 432px; display: grid; grid-template-columns: 1fr auto; gap: 8px; background: #2b2d31; border-left: 4px solid #2dd4bf; border-radius: 4px; padding: 10px 14px 14px 12px; }
.dc-embed .e-author { font-size: 13px; font-weight: 600; color: #f2f3f5; grid-column: 1; }
.dc-embed .e-title { font-weight: 700; color: #f2f3f5; font-size: 15px; grid-column: 1; }
.dc-embed .e-title.link { color: #00a8fc; }
.dc-embed .e-desc { font-size: 14px; white-space: pre-wrap; word-wrap: break-word; grid-column: 1; }
.dc-embed .e-thumb { grid-column: 2; grid-row: 1 / span 3; width: 80px; height: 80px; border-radius: 4px; object-fit: cover; }
.dc-embed .e-image { grid-column: 1 / -1; max-width: 100%; border-radius: 4px; margin-top: 6px; }
.dc-embed .e-footer { grid-column: 1 / -1; font-size: 12px; color: #b5bac1; margin-top: 4px; }
.dc-empty { color: #949ba4; font-style: italic; }

/* ---------- Activité ---------- */
.bars { display: grid; gap: 10px; margin-top: 8px; }
.bar { display: grid; grid-template-columns: 110px 1fr 46px; gap: 10px; align-items: center; font-size: 13px; }
.bar-name { font-family: ui-monospace, monospace; color: var(--text); overflow: hidden; text-overflow: ellipsis; }
.bar-track { height: 10px; border-radius: 999px; background: rgba(255,255,255,.06); overflow: hidden; }
.bar-fill { height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent2), var(--accent)); box-shadow: 0 0 12px rgba(var(--accent-rgb), .6); width: 0; transition: width 1s var(--ease); }
.bar-num { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.feed { display: grid; gap: 4px; max-height: 520px; overflow-y: auto; margin-top: 6px; }
.feed-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; transition: background .2s; animation: pop .35s var(--ease) backwards; }
.feed-item:hover { background: rgba(255,255,255,.04); }
.feed-item .avatar { width: 32px; height: 32px; }
.feed-item .fi-text { flex: 1; min-width: 0; font-size: 13px; }
.feed-item .fi-text div { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed-item code { color: var(--accent); }
.live { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; color: var(--ok); text-transform: uppercase; letter-spacing: .06em; }
.live span { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); animation: ping 1.6s infinite; }
.empty { text-align: center; padding: 30px 10px; color: var(--muted); }
.empty i { width: 40px; height: 40px; color: rgba(var(--accent-rgb), .6); margin-bottom: 8px; display: block; margin-inline: auto; }

/* ---------- Accès ---------- */
.access-hero { background: linear-gradient(135deg, rgba(var(--accent-rgb), .14), rgba(88,101,242,.12)); }
.switch.big { width: 58px; height: 32px; }
.switch.big::after { width: 26px; height: 26px; }
.switch.big.on::after { left: 28px; }
.role-grid { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 14px; min-height: 36px; }
.role { --rc: #99aab5; display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--edge); background: rgba(0,0,0,.25); color: var(--text); font: inherit; font-size: 13px; cursor: pointer; transition: all .25s var(--ease); }
.role::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--rc); box-shadow: 0 0 8px var(--rc); }
.role:hover { border-color: var(--rc); transform: translateY(-1px); }
.role.sel { border-color: var(--rc); background: color-mix(in srgb, var(--rc) 18%, transparent); box-shadow: 0 0 18px -6px var(--rc); }

/* ---------- Finitions ---------- */
.skeleton { position: relative; overflow: hidden; background: rgba(255,255,255,.05); border-radius: 12px; min-height: 60px; }
.skeleton::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255,255,255,.07), transparent); animation: shimmer 1.4s infinite; }
@keyframes shimmer { to { transform: translateX(100%); } }
main::-webkit-scrollbar, .feed::-webkit-scrollbar, .palette-list::-webkit-scrollbar { width: 10px; }
main::-webkit-scrollbar-thumb, .feed::-webkit-scrollbar-thumb, .palette-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }
html { scrollbar-color: rgba(255,255,255,.15) transparent; }
.cursor-glow { position: fixed; width: 460px; height: 460px; border-radius: 50%; pointer-events: none; z-index: 0; background: radial-gradient(circle, rgba(var(--accent-rgb), .08), transparent 65%); transform: translate(-50%, -50%); }
html.reduced .cursor-glow { display: none; }
.layout { position: relative; z-index: 1; }
@media (max-width: 960px) { .editor-grid { grid-template-columns: 1fr; } .sticky-col { position: static; } }

.cmd-cat { color: var(--accent); font-weight: 600; }
.cmd-grid:has(.cmd:nth-child(12)) { max-height: 640px; overflow-y: auto; padding-right: 4px; }
