/* bots.unosial.fr : accueil des bots, page de chaque bot, classements et panel.
   Même DA que le site : encre, lavande (--gold), titres condensés, boutons en pilule.
   Chaque bot pose sa couleur avec style="--gold:…; --gold-rgb:…" sur son conteneur. */

.sf { width: 1.1em; height: 1.1em; flex: none; display: inline-block; vertical-align: -0.18em; }

/* ---------- Cartes des bots ---------- */
.bot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 18px; }
.bcard { position: relative; display: flex; flex-direction: column; gap: 16px; padding: 24px; border-radius: 20px; background: var(--ink-2); border: 1px solid var(--line); overflow: hidden; isolation: isolate; transition: transform .5s var(--ease), border-color .3s; }
.bcard::after { content: ""; position: absolute; inset: 0 0 auto; height: 4px; background: var(--gold); }
.bcard::before { content: ""; position: absolute; inset: -40% -40% auto auto; width: 260px; height: 260px; border-radius: 50%; background: radial-gradient(circle, rgba(var(--gold-rgb), .18), transparent 65%); z-index: -1; }
.bcard:hover { transform: translateY(-4px); border-color: var(--gold); }
.bcard-top { display: flex; align-items: center; gap: 14px; }
.bot-avatar { width: 64px; height: 64px; border-radius: 18px; background: var(--ink-3); border: 1px solid var(--line-2); display: grid; place-items: center; overflow: hidden; flex: none; color: var(--gold); position: relative; }
.bot-avatar img { width: 100%; height: 100%; object-fit: cover; }
.bot-avatar .icon { width: 28px; height: 28px; }
.bcard-name { font-family: var(--f-display); font-weight: 900; text-transform: uppercase; font-size: 30px; line-height: .95; letter-spacing: .005em; }
.bcard-by { color: var(--mute); font-size: 14px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 4px; }
.bcard p { color: var(--mute); font-size: 15px; margin: 0; flex: 1; }
.bcard-meta { display: flex; gap: 16px; flex-wrap: wrap; color: var(--mute); font-size: 13px; }
.bcard-meta span { display: inline-flex; align-items: center; gap: 6px; }
.bcard-meta b { color: var(--ivory); }
.bcard-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--dim); display: inline-block; flex: none; }
.live-dot.on { background: var(--ok); box-shadow: 0 0 10px var(--ok); }

/* ---------- Page d'un bot ---------- */
.bot-hero { position: relative; padding-block: clamp(36px, 7vw, 96px) 40px; overflow: hidden; }
.bot-hero::before { content: ""; position: absolute; width: 70vw; height: 70vw; right: -25vw; top: -35vw; border-radius: 50%; background: radial-gradient(circle, rgba(var(--gold-rgb), .2), transparent 62%); pointer-events: none; }
.bot-hero .wrap { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: clamp(20px, 4vw, 48px); align-items: center; }
.bot-hero .bot-avatar { width: clamp(110px, 16vw, 180px); height: clamp(110px, 16vw, 180px); border-radius: 32px; border: 2px solid var(--gold); box-shadow: 0 20px 60px -20px rgba(var(--gold-rgb), .6); }
.bot-hero .bot-avatar .icon { width: 56px; height: 56px; }
.bot-hero .h1 { margin: 8px 0 12px; }
.bot-hero .lead { margin-bottom: 26px; white-space: pre-line; }
.bot-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; margin-top: 8px; }
.bot-stats div { background: var(--ink-2); padding: 20px; }
.bot-stats b { display: block; font-family: var(--f-display); font-weight: 900; font-size: 44px; line-height: 1; }
.bot-stats span { color: var(--mute); font-size: 13px; letter-spacing: .12em; text-transform: uppercase; font-weight: 700; }

.cmd-tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 20px; }
.cmd-tools input { max-width: 360px; }
.cmd-cats { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.cmd-cats button { display: inline-flex; align-items: center; gap: 8px; padding: 9px 15px; border-radius: 999px; border: 1px solid var(--line-2); background: transparent; color: var(--mute); font-weight: 700; font-size: 14px; cursor: pointer; }
.cmd-cats button:hover { color: var(--ivory); border-color: var(--ivory); }
.cmd-cats button[aria-pressed="true"] { background: var(--gold); color: var(--ink); border-color: var(--gold); }
.cmd-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.cmd { padding: 16px 18px; border-radius: 14px; background: var(--ink-2); border: 1px solid var(--line); }
.cmd code { color: var(--gold); font-weight: 800; font-size: 15px; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
.cmd p { margin: 4px 0 0; color: var(--mute); font-size: 14px; }
.cmd .subs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.cmd .subs span { font-size: 12px; padding: 2px 9px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--mute); }

/* ---------- Classement ---------- */
.lb { display: grid; gap: 10px; max-width: 820px; }
.lb-row { display: grid; grid-template-columns: 40px 46px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 14px 18px; border-radius: 14px; background: var(--ink-2); border: 1px solid var(--line); }
.lb-pos { font-family: var(--f-display); font-weight: 900; font-size: 28px; color: var(--dim); text-align: center; }
.lb-row:nth-child(1) .lb-pos { color: var(--gold); }
.lb-row:nth-child(2) .lb-pos, .lb-row:nth-child(3) .lb-pos { color: var(--ivory); }
.lb-av { width: 46px; height: 46px; border-radius: 50%; background: var(--ink-3); overflow: hidden; display: grid; place-items: center; color: var(--mute); }
.lb-av img { width: 100%; height: 100%; object-fit: cover; }
.lb-name { min-width: 0; }
.lb-name strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-bar { height: 6px; border-radius: 99px; background: var(--ink-4); margin-top: 8px; overflow: hidden; }
.lb-bar i { display: block; height: 100%; border-radius: 99px; background: var(--gold); }
.lb-level { text-align: right; }
.lb-level b { font-family: var(--f-display); font-weight: 900; font-size: 26px; display: block; line-height: 1; }
.lb-level span { color: var(--mute); font-size: 12px; }

/* ---------- Panel ---------- */
.bp { padding-bottom: 90px; }
.bp-shell { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 28px; align-items: start; }
.bp-side { position: sticky; top: 92px; display: grid; gap: 4px; padding: 14px; border-radius: 18px; background: var(--ink-2); border: 1px solid var(--line); max-height: calc(100vh - 110px); overflow-y: auto; }
.bp-side-head { display: flex; gap: 10px; align-items: center; padding: 6px 6px 14px; margin-bottom: 6px; border-bottom: 1px solid var(--line); text-decoration: none; }
.bp-side-head .bot-avatar { width: 40px; height: 40px; border-radius: 12px; }
.bp-side-head b { display: block; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bp-side-head small { color: var(--mute); font-size: 12px; }
.bp-side-label { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--dim); font-weight: 800; padding: 14px 8px 6px; }
.bp-side a.item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; color: var(--mute); text-decoration: none; font-weight: 600; font-size: 14px; }
.bp-side a.item:hover { background: var(--ink-3); color: var(--ivory); }
.bp-side a.item[aria-current="page"] { background: var(--gold-wash); color: var(--ivory); }
.bp-side a.item[aria-current="page"] .sf { color: var(--gold); }
.bp-side a.item .on { margin-left: auto; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); }
.bp-head { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; margin-bottom: 24px; }
.bp-head h1 { font-family: var(--f-display); font-weight: 900; text-transform: uppercase; font-size: clamp(38px, 5vw, 64px); line-height: .9; display: flex; align-items: center; gap: 14px; }
.bp-head h1 .sf { color: var(--gold); width: .7em; height: .7em; }
.bp-head p { color: var(--mute); margin: 6px 0 0; }
.bp-head .actions { margin-left: auto; display: flex; gap: 10px; flex-wrap: wrap; }
.bp .card { margin-bottom: 16px; }
.bp .card-title { display: flex; align-items: center; gap: 10px; }
.bp .card-title .sf { color: var(--gold); }
.bp-row { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 14px 0; border-top: 1px solid var(--line); }
.bp-row:first-of-type { border-top: 0; padding-top: 0; }
.bp-row b { display: block; font-size: 15px; }
.bp-row small { color: var(--mute); font-size: 13px; }
.bp .field { margin-top: 14px; }
.bp .field:first-child { margin-top: 0; }
.bp .field small { color: var(--mute); font-size: 13px; }
.bp .grid-2 .field { margin-top: 14px; }
.bp input[type=number] { max-width: 180px; }

.switch { position: relative; width: 48px; height: 28px; flex: none; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: var(--ink-4); border: 1px solid var(--line-2); cursor: pointer; transition: .2s; }
.switch span::before { content: ""; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--ivory); transition: .2s var(--ease); }
.switch input:checked + span { background: var(--gold); border-color: var(--gold); }
.switch input:checked + span::before { transform: translateX(20px); background: var(--ink); }
.switch input:focus-visible + span { outline: 2px solid var(--gold); outline-offset: 3px; }

.tags { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 8px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--ink); min-height: 50px; }
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 5px 6px 5px 11px; border-radius: 999px; background: var(--ink-3); border: 1px solid var(--line-2); font-size: 13px; font-weight: 600; }
.tag i { width: 9px; height: 9px; border-radius: 50%; }
.tag button { background: none; border: 0; color: var(--mute); cursor: pointer; display: grid; place-items: center; padding: 2px; border-radius: 50%; }
.tag button:hover { color: var(--warn); }
.tags input, .tags select { flex: 1; min-width: 160px; border: 0 !important; background-color: transparent !important; box-shadow: none !important; min-height: 34px; padding: 4px 8px; }
.list-row { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; flex-wrap: wrap; }
.list-row > input, .list-row > select { flex: 1; min-width: 160px; }

.bp-servers { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.gcard { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; padding: 22px 16px; border-radius: 16px; background: var(--ink-2); border: 1px solid var(--line); transition: border-color .3s, transform .4s var(--ease); }
.gcard:hover { border-color: var(--gold); transform: translateY(-3px); }
.gicon { width: 64px; height: 64px; border-radius: 18px; background: var(--ink-3); display: grid; place-items: center; font-family: var(--f-display); font-weight: 900; font-size: 24px; color: var(--gold); overflow: hidden; }
.gicon img { width: 100%; height: 100%; object-fit: cover; }
.gcard b { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { padding: 18px; border-radius: 16px; background: var(--ink-2); border: 1px solid var(--line); }
.kpi span { color: var(--mute); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; font-weight: 700; display: flex; justify-content: space-between; }
.kpi b { display: block; font-family: var(--f-display); font-weight: 900; font-size: 40px; line-height: 1.1; }
.mods { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.mod { display: flex; align-items: center; gap: 10px; padding: 14px; border-radius: 14px; border: 1px solid var(--line-2); text-decoration: none; font-weight: 700; font-size: 14px; }
.mod:hover { border-color: var(--gold); }
.mod .sf { color: var(--gold); width: 20px; height: 20px; }
.mod .st { margin-left: auto; }
.preview { border-left: 4px solid var(--gold); background: var(--ink); border-radius: 8px; padding: 14px 16px; margin-top: 16px; }
.preview b { display: block; margin-bottom: 4px; }
.preview p { color: var(--mute); font-size: 14px; white-space: pre-wrap; margin: 0; }
.preview img { border-radius: 8px; margin-top: 10px; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; color: var(--mute); font-weight: 700; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; padding: 10px 8px; border-bottom: 1px solid var(--line); }
.table td { padding: 12px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 12px; color: var(--mute); }

.savebar { position: fixed; left: 50%; bottom: 22px; z-index: 120; transform: translate(-50%, 160%); opacity: 0; pointer-events: none; transition: .3s var(--ease); display: flex; align-items: center; gap: 14px; padding: 10px 10px 10px 20px; border-radius: 999px; background: var(--ink-3); border: 1px solid var(--line-2); box-shadow: 0 20px 60px -10px rgba(0, 0, 0, .7); font-weight: 700; font-size: 14px; }
.savebar.show { transform: translate(-50%, 0); opacity: 1; pointer-events: auto; }
.bp-toast { position: fixed; right: 20px; top: 96px; z-index: 160; display: flex; gap: 10px; align-items: center; padding: 12px 16px; border-radius: 12px; background: var(--ink-2); border: 1px solid rgba(var(--gold-rgb), .55); font-size: 14px; font-weight: 600; animation: bp-in .25s var(--ease); }
.bp-toast.err { border-color: rgba(232, 161, 90, .6); }
.bp-toast .sf { color: var(--gold); } .bp-toast.err .sf { color: var(--warn); }
@keyframes bp-in { from { opacity: 0; transform: translateY(-8px); } }
.bp-loader { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--ink-4); border-top-color: var(--gold); animation: bp-spin .8s linear infinite; margin: 60px auto; }
@keyframes bp-spin { to { transform: rotate(360deg); } }
.bp-burger { display: none; }

@media (max-width: 900px) {
  .bp-shell { grid-template-columns: minmax(0, 1fr); }
  .bp-side { position: static; max-height: none; display: none; }
  .bp-side.open { display: grid; }
  .bp-burger { display: inline-flex; }
  .mods, .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cmd-list { grid-template-columns: minmax(0, 1fr); }
  .bot-hero .wrap { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  .mods { grid-template-columns: minmax(0, 1fr); }
  .bot-stats b { font-size: 32px; }
  .lb-row { grid-template-columns: 30px 40px minmax(0, 1fr) auto; padding: 12px; gap: 10px; }
}
.service-ic .sf { width: 22px; height: 22px; }
.sf.flip { transform: scaleX(-1); }
.bp-side-head .gicon { width: 40px; height: 40px; border-radius: 12px; font-size: 16px; flex: none; }
