/* ==========================================================================
   Thèmes ("Fond") — Noir / Blanc / Bleu nuit / Dégradé
   Le thème actif est posé en attribut data-theme sur <html> (voir layout.html
   + static/theme.js). "Bleu nuit" est la valeur par défaut historique du
   site, donc on la met aussi sur :root pour qu'un visiteur sans préférence
   enregistrée (ou JS désactivé) retrouve l'apparence d'origine.
   ========================================================================== */
:root,
[data-theme="midnight"] {
  --bg: #0f1115;
  --bg-2: #12151b;
  --panel: #171a21;
  --panel-2: #1f2430;
  --panel-3: #2a3040;
  --border: #262b36;
  --text: #e6e8ec;
  --muted: #8b93a1;
  --green: #3fcf8e;
  --orange: #f2a541;
  --red: #ef5b5b;
  color-scheme: dark;
}

[data-theme="dark"] {
  --bg: #08090b;
  --bg-2: #0b0c0f;
  --panel: #131417;
  --panel-2: #1c1d21;
  --panel-3: #26272c;
  --border: #28292e;
  --text: #ececed;
  --muted: #93949a;
  --green: #3fcf8e;
  --orange: #f2a541;
  --red: #ef5b5b;
  color-scheme: dark;
}

[data-theme="light"] {
  --bg: #f3f4f7;
  --bg-2: #ffffff;
  --panel: #ffffff;
  --panel-2: #eceef2;
  --panel-3: #e0e3ea;
  --border: #dde0e7;
  --text: #1b1e24;
  --muted: #666c78;
  --green: #1f9d63;
  --orange: #c9770f;
  --red: #d8433a;
  color-scheme: light;
}

/* "Dégradé" : fond sombre qui part du noir en haut et prend peu à peu la
   teinte du "Ton signal" choisi (vert citron → vert sombre, bleu → bleu
   nuit, etc.). Les panneaux sont teintés de la même couleur pour se fondre
   dans le dégradé au lieu de former des blocs gris. */
[data-theme="gradient"] {
  --bg: #050708;
  --bg-2: color-mix(in srgb, var(--accent) 5%, #0a0d0f);
  --panel: color-mix(in srgb, var(--accent) 6%, #0d1012);
  --panel-2: color-mix(in srgb, var(--accent) 9%, #151a1d);
  --panel-3: color-mix(in srgb, var(--accent) 13%, #1e2427);
  --border: color-mix(in srgb, var(--accent) 12%, #22282b);
  --text: #ececed;
  --muted: #93999c;
  --green: #3fcf8e;
  --orange: #f2a541;
  --red: #ef5b5b;
  color-scheme: dark;
}
[data-theme="gradient"] body { background: transparent; }
/* Le dégradé est sur un calque fixe derrière la page (et pas sur le body en
   "background-attachment: fixed", ignoré par iOS) : il reste en place
   pendant le défilement et couvre tout l'écran. */
[data-theme="gradient"] body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: linear-gradient(165deg, #030505 0%, color-mix(in srgb, var(--accent) 7%, #040607) 45%, color-mix(in srgb, var(--accent) 20%, #050708) 100%);
  pointer-events: none;
}
[data-theme="gradient"] .topbar {
  background: color-mix(in srgb, var(--panel) 75%, transparent);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

/* ==========================================================================
   Couleur du "signal" (accent) — 8 teintes au choix, appliquées à tous les
   boutons et éléments de mise en avant du site via var(--accent). L'attribut
   data-accent est posé sur <html> (défaut : bleu).
   ========================================================================== */
:root,
[data-accent="blue"] {
  --accent: #4f8cff;
  --accent-hover: #7aa8ff;
  --accent-contrast: #ffffff;
}
[data-accent="pink"] {
  --accent: #ff4f8f;
  --accent-hover: #ff7aab;
  --accent-contrast: #ffffff;
}
[data-accent="green"] {
  --accent: #2ecf7d;
  --accent-hover: #58e29c;
  --accent-contrast: #06281a;
}
[data-accent="purple"] {
  --accent: #8b7cf6;
  --accent-hover: #a99cf9;
  --accent-contrast: #ffffff;
}
[data-accent="cyan"] {
  --accent: #22c3e6;
  --accent-hover: #5cd6f0;
  --accent-contrast: #052a33;
}
[data-accent="orange"] {
  --accent: #f2a541;
  --accent-hover: #f7bd6f;
  --accent-contrast: #2e1c02;
}
[data-accent="red"] {
  --accent: #ef5b3f;
  --accent-hover: #f5836b;
  --accent-contrast: #ffffff;
}
[data-accent="lime"] {
  --accent: #a3d63f;
  --accent-hover: #b8e267;
  --accent-contrast: #1c2705;
}

/* ==========================================================================
   Confort — réduction des animations
   ========================================================================== */
[data-reduce-motion="1"] *,
[data-reduce-motion="1"] *::before,
[data-reduce-motion="1"] *::after {
  animation-duration: 0.001ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.001ms !important;
  scroll-behavior: auto !important;
}

* { box-sizing: border-box; }

html {
  overflow-x: hidden;
  /* Filet de sécurité mobile : certains blocs (bannière hero pleine largeur,
     grands titres/noms de torrents, tableaux) peuvent déborder de quelques
     pixels sur petit écran ; on empêche ce débordement de créer un scroll
     horizontal sur toute la page. */
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  margin: 0;
  line-height: 1.5;
  overflow-x: hidden;
  width: 100%;
}

img, video { max-width: 100%; height: auto; }

.hero-title, .card-title, .navcat-group-head span:last-child,
.detail-card h1, .torrent-table td, .description {
  overflow-wrap: break-word;
  word-break: break-word;
}

.topbar {
  /* position + z-index : le thème « Dégradé » applique un backdrop-filter à l'en-tête,
     ce qui en fait un contexte d'empilement à part ; sans z-index propre, le contenu
     de la page (panneau Nouveautés, cartes de survol...) passait par-dessus le menu
     Torrents. 450 = au-dessus des cartes de survol (400), sous les modales (500+). */
  position: relative;
  z-index: 450;
  display: flex;
  justify-content: center;
  padding: 0 28px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 14px 0;
}

.brand {
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--accent);
  text-decoration: none;
}

nav { display: flex; align-items: center; flex-wrap: wrap; }
nav a { color: var(--text); text-decoration: none; margin-left: 18px; }
nav a:hover { color: var(--accent-hover); }
.nav-username { margin-right: 6px; }

.user-pill {
  margin-left: 18px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px;
  background: var(--panel-2);
  border-radius: 999px;
  font-size: 0.85rem;
  color: var(--muted);
}

.user-pill .stat-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  color: var(--accent-hover);
  font-weight: 600;
  white-space: nowrap;
}

.user-pill .stat-chip i, .user-pill .stat-chip .stat-icon { font-size: 0.8em; }

.user-pill .stat-chip.up { background: color-mix(in srgb, var(--green) 18%, transparent); color: var(--green); }
.user-pill .stat-chip.down { background: color-mix(in srgb, var(--orange) 18%, transparent); color: var(--orange); }
.user-pill .stat-chip.bonus { background: color-mix(in srgb, var(--accent) 22%, transparent); color: var(--accent-hover); }

.container { max-width: 1100px; margin: 0 auto; padding: 28px; }

footer { text-align: center; color: var(--muted); padding: 24px; font-size: 0.85rem; }

h1 { margin-top: 0; }

.page-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }

.search { display: flex; gap: 8px; margin-bottom: 20px; }

input, select, textarea, button {
  font-family: inherit;
  font-size: 0.95rem;
}

input[type=text], input[type=password], input[type=file], input[type=number], input[type=date], input[type=url], select, textarea {
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 10px;
  border-radius: 6px;
  width: 100%;
  box-sizing: border-box;
}

input[type=number] { width: auto; }

input[type=date]::-webkit-calendar-picker-indicator { filter: invert(0.8); cursor: pointer; }
[data-theme="light"] input[type=date]::-webkit-calendar-picker-indicator { filter: none; }

input[type=text]:focus, input[type=password]:focus, input[type=file]:focus,
input[type=number]:focus, input[type=date]:focus, input[type=url]:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.form-card, .detail-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 24px;
  max-width: 560px;
  margin: 0 auto;
}

/* Variante pleine largeur : pour les form-card insérées dans une page qui
   contient déjà d'autres blocs pleine largeur (ex: /profile, à côté du
   .stat-grid) et qui doivent s'aligner dessus plutôt que se centrer en
   colonne étroite. */
.form-card-full {
  max-width: none;
  margin: 0;
}

.detail-card { max-width: 800px; }

/* La fiche torrent sort de la largeur habituelle du .container (limité à
   1100px) pour occuper 2/3 de la largeur RÉELLE de la fenêtre, pas 2/3
   d'un conteneur déjà rétréci. */
.detail-page-wide {
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  display: flex;
  justify-content: center;
  padding: 0 24px;
  box-sizing: border-box;
}
.detail-page-wide .detail-card {
  width: 66vw;
  max-width: 1300px;
  min-width: 320px;
}
.detail-page-wide .form-card-wide {
  width: 66vw;
  max-width: 1300px;
  min-width: 320px;
}
/* Accueil : même sortie de conteneur que la fiche torrent (2/3 de la
   largeur réelle de la fenêtre), sans aller jusqu'à la pleine largeur
   utilisée par la shoutbox et /admin. */
.detail-page-wide .home-content-wide {
  width: 66vw;
  max-width: 1300px;
  min-width: 320px;
}
/* Wiki et blog : même largeur que l'accueil. */
.detail-page-wide .article-content-wide {
  width: 66vw;
  max-width: 1300px;
  min-width: 320px;
}
@media (max-width: 900px) {
  .detail-page-wide .detail-card { width: 100%; }
  .detail-page-wide .form-card-wide { width: 100%; }
  .detail-page-wide .home-content-wide { width: 100%; }
  .detail-page-wide .article-content-wide { width: 100%; }
}

.form-card label { display: block; margin: 14px 0 6px; color: var(--muted); font-size: 0.85rem; }

button, .button {
  background: var(--accent);
  color: var(--accent-contrast, #fff);
  border: none;
  padding: 9px 16px;
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  margin-top: 10px;
  margin-right: 8px;
}

button:hover, .button:hover { background: var(--accent-hover); }

.button.secondary { background: var(--panel-3); color: var(--text); }
.button.danger, button.danger { background: var(--red); color: #fff; }

.link-btn {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 0;
  margin: 0;
  text-decoration: underline;
}
.link-btn.danger { color: var(--red); }

/* --- Boutons icône (actions admin : supprimer, reset mdp, passkey...) --- */
.icon-btn {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  cursor: pointer;
  padding: 0;
  margin: 0;
  font-size: 0.85rem;
}
.icon-btn:hover { background: var(--panel-3); color: var(--text); }
/* Le fond est répété explicitement ici : une règle globale plus spécifique
   (button.danger { background: var(--red) }) écraserait sinon le fond sombre
   et rendrait l'icône rouge invisible sur son propre fond rouge. */
.icon-btn.danger { background: var(--panel-2); color: var(--red); border-color: color-mix(in srgb, var(--red) 45%, var(--border)); }
.icon-btn.danger:hover { background: color-mix(in srgb, var(--red) 18%, var(--panel-2)); border-color: var(--red); }
.icon-btn.success { background: var(--panel-2); color: var(--green); border-color: color-mix(in srgb, var(--green) 45%, var(--border)); }
.icon-btn.success:hover { background: color-mix(in srgb, var(--green) 18%, var(--panel-2)); border-color: var(--green); }
.icon-btn-group { display: flex; gap: 6px; align-items: center; }

.inline { display: inline; }
.inline-form { display: flex; gap: 8px; margin-top: 14px; }

.torrent-table { width: 100%; border-collapse: collapse; margin-top: 18px; }
.torrent-table th, .torrent-table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}
.torrent-table th { color: var(--muted); font-weight: 600; font-size: 0.85rem; }
.torrent-table a { color: var(--text); text-decoration: none; }
.torrent-table a:hover { color: var(--accent-hover); }

.seed { color: var(--green); font-weight: 600; }
.leech { color: var(--orange); font-weight: 600; }

.meta { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; color: var(--muted); font-size: 0.9rem; margin: 14px 0; }

.hash-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 0 0 14px; }
.hash-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 0.85rem;
  color: var(--muted);
}
.hash-chip i { color: var(--accent); }
.hash-chip code {
  color: var(--text);
  font-size: 0.82rem;
  word-break: break-all;
  background: none;
  padding: 0;
}

.vt-chip {
  text-decoration: none;
  border-color: rgba(63,207,142,0.4);
  background: rgba(63,207,142,0.1);
  color: var(--green);
  cursor: pointer;
}
.vt-chip:hover { background: rgba(63,207,142,0.18); }
.vt-chip i { color: var(--green); }
.vt-ext-icon { font-size: 0.7rem; margin-left: 2px; }
.description { background: var(--bg-2); padding: 16px; border-radius: 8px; line-height: 1.6; }

.flash { padding: 10px 14px; border-radius: 6px; margin-bottom: 18px; }
.flash.error { background: #3a1c1c; color: #ffb4b4; border: 1px solid #5c2b2b; }
.flash.info { background: #1c3a2a; color: #b4ffcf; border: 1px solid #2b5c40; }

.muted { color: var(--muted); font-size: 0.9rem; }

/* La page admin sort de la largeur habituelle du .container pour profiter
   de (presque) toute la largeur de la fenêtre, comme la shoutbox. */
.admin-page {
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  padding: 0 24px;
  box-sizing: border-box;
}

.admin-block {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 22px 24px;
  margin-bottom: 22px;
}
.admin-block h2 {
  margin-top: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.1rem;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}
.admin-block h2 i { color: var(--accent); width: 1.1em; text-align: center; }
.admin-block h3 { font-size: 0.95rem; color: var(--muted); margin: 20px 0 10px; }

.admin-grid { display: grid; grid-template-columns: 1fr; gap: 22px; align-items: start; margin-bottom: 22px; }
.admin-grid .admin-block { margin-bottom: 0; }
.admin-block-full { grid-column: 1 / -1; }

.admin-search-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.admin-search-bar input[type=text] { max-width: 320px; }
.admin-search-hint { font-size: 0.82rem; color: var(--muted); margin: -4px 0 12px; }
.cat-list { list-style: none; padding: 0; }
.cat-list li { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid var(--border); max-width: 300px; }

/* Catégories (admin) : grille de 6 colonnes plutôt qu'une longue liste
   verticale, pour remplir la largeur de la carte. Chaque catégorie devient
   une petite puce ; les sous-catégories gardent juste une puce légèrement
   différente au lieu d'une indentation (qui n'a pas de sens en grille). */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px 10px;
}
.cat-grid li {
  max-width: none;
  border-bottom: none;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  align-items: center;
  gap: 6px;
}
.cat-grid li span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.88rem;
}
.cat-grid li.cat-grid-sub { background: transparent; border-style: dashed; }
.cat-grid li form { flex-shrink: 0; }
@media (max-width: 1100px) { .cat-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 700px) { .cat-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .cat-grid { grid-template-columns: 1fr; } }

code { background: var(--panel-2); padding: 2px 6px; border-radius: 4px; font-size: 0.85rem; }

/* --- Page d'accueil vitrine (hero + rangées de cards) --- */

.search-title { margin-top: 24px; }

.hero {
  position: relative;
  height: 420px;
  border-radius: 14px;
  overflow: hidden;
  margin: 18px 0 36px;
  background: var(--panel-2);
}

.hero-slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 0.6s ease;
  pointer-events: none;
}
.hero-slide.active { opacity: 1; pointer-events: auto; }

.hero-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 32px;
  background: linear-gradient(90deg, rgba(10,11,14,0.95) 10%, rgba(10,11,14,0.55) 55%, rgba(10,11,14,0.15) 100%),
              linear-gradient(0deg, rgba(10,11,14,0.9) 0%, rgba(10,11,14,0.1) 60%);
  /* Le dégradé de l'overlay reste toujours sombre (quel que soit le thème
     "Fond") car il sert à faire ressortir le texte sur la photo du hero. */
  color: #f2f3f6;
}

.hero-meta { color: rgba(242,243,246,0.72) !important; }

.hero-badges { display: flex; gap: 8px; margin-bottom: 10px; }
.badge {
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  color: var(--accent-hover);
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.hero-title { font-size: 2.2rem; margin: 0 0 8px; max-width: 700px; }
.hero-meta { color: var(--muted); margin-bottom: 16px; }
.hero-actions { display: flex; gap: 10px; }

.hero-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.4);
  border: none;
  color: white;
  font-size: 1rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
  z-index: 2;
}
.hero-nav.prev { left: 16px; }
.hero-nav.next { right: 16px; }
.hero-nav:hover { background: rgba(0,0,0,0.65); }

.hero-dots { position: absolute; bottom: 14px; right: 24px; display: flex; gap: 6px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,0.35); cursor: pointer; }
.dot.active { background: var(--accent); }

.cat-row { margin-bottom: 34px; }
.cat-row h2 { font-size: 1.15rem; margin-bottom: 12px; }

.card-scroll {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  /* overflow-x: auto force le navigateur à traiter overflow-y comme "auto"
     lui aussi (impossible d'avoir un axe scrollable et l'autre visible) —
     ce qui rognait le léger zoom au survol de .card-poster juste en dessous.
     On ajoute donc une marge de respiration en haut, compensée par une
     marge négative pour ne pas décaler le reste de la mise en page. */
  padding: 8px 0;
  margin-top: -8px;
  scrollbar-width: thin;
}

.card {
  flex: 0 0 auto;
  width: 160px;
  text-decoration: none;
  color: var(--text);
}

.card-poster {
  width: 160px;
  height: 230px;
  border-radius: 8px;
  background: var(--panel-2) center/cover no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  transition: transform 0.15s ease;
}
.card:hover .card-poster { transform: scale(1.04); }

.card-poster-fallback {
  padding: 10px;
  text-align: center;
  font-size: 0.85rem;
  color: var(--muted);
}

.card-info { padding: 8px 2px; }
.card-title {
  font-size: 0.88rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card-meta { font-size: 0.78rem; color: var(--muted); margin-top: 2px; }

/* --- Détail torrent --- */

.detail-head { display: flex; gap: 24px; align-items: flex-start; }
.detail-poster { width: 200px; height: auto; max-height: 300px; object-fit: contain; border-radius: 10px; border: 1px solid var(--border); flex-shrink: 0; align-self: flex-start; background: var(--panel); }

.lang-flag { font-size: 1.1em; margin-left: 2px; }
.detail-main { flex: 1; }

.nfo {
  background: #0a0c10;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  overflow-x: auto;
  font-family: "Courier New", monospace;
  font-size: 0.8rem;
  line-height: 1.3;
  white-space: pre;
}

textarea.mono { font-family: "Courier New", monospace; font-size: 0.85rem; }

/* --- Accordéon "Afficher le NFO / MediaInfo / Fichiers" (page torrent) --- */
.expand-list {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  margin: 18px 0;
  background: var(--bg-2);
}
.expand-item + .expand-item { border-top: 1px solid var(--border); }

.expand-toggle-row { display: flex; align-items: center; }
.expand-toggle-row:hover { background: #171a22; }
.expand-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
  background: none;
  border: none;
  color: var(--text);
  padding: 12px 16px;
  margin: 0;
  font-size: 0.92rem;
  text-align: left;
  cursor: pointer;
}
.expand-toggle .fa-chevron-right { transition: transform 0.15s ease; color: var(--muted); font-size: 0.8rem; }
.expand-item.open .expand-toggle .fa-chevron-right { transform: rotate(90deg); }
.expand-toggle-label { flex: 1; }
.expand-toggle-extra {
  color: var(--accent);
  font-size: 0.85rem;
  text-decoration: none;
  padding: 6px 16px 6px 4px;
  white-space: nowrap;
  flex-shrink: 0;
}
.expand-toggle-extra:hover { color: var(--accent-hover); text-decoration: underline; }

.expand-panel {
  display: none;
  padding: 0 16px 16px;
}
.expand-item.open .expand-panel { display: block; }

.file-entry-list { list-style: none; padding: 0; margin: 0; }
.file-entry-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
}
.file-entry-list li:last-child { border-bottom: none; }
.file-entry-list .file-path { color: var(--text); word-break: break-all; }
.file-entry-list .file-size { color: var(--muted); flex-shrink: 0; white-space: nowrap; }

.poster-preview { width: 140px; border-radius: 8px; border: 1px solid var(--border); display: block; margin-top: 6px; }

@media (max-width: 700px) {
  /* Le slider hero (bannière avec rotation + flèches) est peu adapté au
     tactile/petit écran (flèches minuscules, defilement auto qui gêne la
     lecture) : on le masque simplement sur mobile, le reste de la page
     (rangées de cartes, catégories) reste inchangé. */
  .hero { display: none; }
  .detail-head { flex-direction: column; }
}

/* --- Barre de stats --- */
.statsbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 18px;
  padding: 10px 28px;
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  font-size: 0.82rem;
  color: var(--muted);
}
.statsbar strong { color: var(--text); }
.statsbar .online strong { color: var(--green); }
.statsbar .pending-stat strong { color: var(--orange); }

.unread-badge {
  background: var(--red);
  color: white;
  border-radius: 999px;
  padding: 1px 6px;
  font-size: 0.7rem;
  margin-left: 4px;
}

.flash.pending {
  background: #3a2f1c;
  color: #ffd9a0;
  border: 1px solid #5c4a2b;
}

.flash.warning {
  background: #3a2f1c;
  color: #ffd9a0;
  border: 1px solid #5c4a2b;
  display: flex;
  align-items: center;
  gap: 8px;
}
.flash.warning i { color: var(--orange); }

/* --- Shoutbox --- */

/* La page shoutbox sort de la largeur habituelle du .container pour
   occuper (presque) toute la largeur de la fenêtre, à la manière d'une
   appli de chat (salons à gauche, discussion large à droite). */
.shoutbox-page {
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  padding: 0 24px;
  box-sizing: border-box;
}
.shoutbox-app {
  display: flex;
  align-items: stretch;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  height: 74vh;
  min-height: 520px;
}

/* Colonne de gauche : liste des salons */
.room-sidebar {
  width: 260px;
  flex: 0 0 260px;
  display: flex;
  flex-direction: column;
  background: var(--bg-2);
  border-right: 1px solid var(--border);
}
.room-sidebar-head {
  padding: 16px 18px;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
}
.room-sidebar-head i { color: var(--accent); }
.room-list { flex: 1; overflow-y: auto; padding: 8px; }
.room-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  margin-bottom: 2px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--text);
  position: relative;
}
.room-item:hover { background: var(--panel-2); }
.room-item.active { background: color-mix(in srgb, var(--accent) 20%, transparent); }
.room-item-icon {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--panel);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: var(--muted);
}
.room-item.active .room-item-icon { border-color: var(--accent); color: var(--accent-hover); }
.room-item-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.room-item-name {
  font-weight: 600;
  font-size: 0.88rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.room-item-sub {
  font-size: 0.72rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.room-item-unread {
  flex-shrink: 0;
  margin-left: 8px;
  background: var(--accent);
  color: #05202b;
  font-weight: 700;
  font-size: 0.72rem;
  line-height: 1;
  padding: 4px 8px;
  border-radius: 999px;
  min-width: 20px;
  text-align: center;
}

/* Colonne de droite : la discussion, large */
.shoutbox-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.shoutbox-main-head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
}
.shoutbox-main-head .room-icon-lg { font-size: 1.3rem; }
.shoutbox-main-head-text { display: flex; flex-direction: column; line-height: 1.25; }
.shoutbox-main-head-text strong { font-size: 1rem; }
.shoutbox-main-head-text .muted { font-size: 0.78rem; }

.shoutbox-app .my-emoji-bar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: none;
  margin: 0;
  padding: 8px 20px;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
}
.my-emoji-bar .emoji-btn { width: 34px; height: 34px; font-size: 1rem; }

.shoutbox-app .shout-list {
  flex: 1;
  height: auto;
  overflow-y: auto;
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 16px 20px;
}
.shout-line { padding: 4px 0; font-size: 0.9rem; }
.shout-time { color: var(--muted); font-size: 0.75rem; margin-right: 8px; }
.shout-emoji { margin-right: 4px; }
.shout-user { font-weight: 600; color: var(--accent-hover); margin-right: 6px; }
.shout-user.admin { color: var(--orange); }
.shout-badge { margin-right: 6px; }

.shoutbox-app .shout-form {
  flex: 0 0 auto;
  display: flex;
  gap: 8px;
  background: var(--panel);
  border: none;
  border-top: 1px solid var(--border);
  border-radius: 0;
  padding: 12px 20px;
}
.shout-form > input { flex: 1; margin: 0; }
.shout-form button { margin: 0; }

/* Salons en lecture seule */
.room-locked-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  background: color-mix(in srgb, var(--orange) 18%, transparent);
  color: var(--orange);
  border: 1px solid color-mix(in srgb, var(--orange) 45%, transparent);
  vertical-align: middle;
}
.room-lock-icon { font-size: 0.72rem; color: var(--orange); margin-left: 2px; }
.shout-form-disabled {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.85rem;
  font-style: italic;
}
.room-locked-check {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--muted);
  margin: 0 4px;
}
.room-locked-check input { width: auto; margin: 0; }
.inline-actions { display: flex; gap: 6px; align-items: center; }

@media (max-width: 900px) {
  .shoutbox-app { height: 78vh; }
  .room-sidebar { width: 210px; flex-basis: 210px; }
}

@media (max-width: 700px) {
  .shoutbox-page { padding: 0 12px; }
  .admin-page { padding: 0 12px; }
  .shoutbox-app { flex-direction: column; height: auto; border-radius: 10px; }
  .room-sidebar { width: 100%; flex-basis: auto; border-right: none; border-bottom: 1px solid var(--border); }
  .room-list { display: flex; flex-direction: row; gap: 6px; overflow-x: auto; padding: 10px; }
  .room-item { flex-direction: column; text-align: center; min-width: 84px; }
  .room-item-text { align-items: center; }
  .room-item-sub { display: none; }
  .room-item-unread { position: absolute; top: 4px; right: 6px; margin-left: 0; }
  .shoutbox-app .shout-list { height: 55vh; flex: none; padding: 12px 14px; }

  .shoutbox-main-head { padding: 10px 14px; }
  .shoutbox-main-head-text .muted { display: none; }
  .shoutbox-app .my-emoji-bar { padding: 8px 14px; flex-wrap: wrap; }

  /* Barre de composition : sur téléphone, il n'y a pas la place pour les
     3 boutons d'icône + le champ texte + "Envoyer" sur une seule ligne
     (le champ finissait écrasé à quelques pixels de large). On passe le
     champ de saisie sur sa propre ligne, pleine largeur, avec les
     boutons juste en dessous. */
  .shoutbox-app .shout-form {
    flex-wrap: wrap;
    padding: 10px 14px;
    gap: 8px;
  }
  .shout-form > input#shout-input {
    order: -1;
    flex: 1 1 100%;
    width: 100%;
  }
  .shout-form .emoji-picker-wrap, .shout-form button[type=submit] { flex: 0 0 auto; }

  /* Les popovers (émojis / GIF) sont dimensionnés pour desktop (260-588px) :
     on les borne à la largeur de l'écran pour qu'ils ne débordent plus. */
  .emoji-panel, .discord-emoji-panel {
    width: auto;
    min-width: 220px;
    max-width: calc(100vw - 24px);
  }
  .gif-panel {
    width: calc(100vw - 24px) !important;
    max-width: 420px;
    max-height: 60vh;
  }
  .gif-results { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gif-result img { width: 100%; height: 100%; aspect-ratio: 1 / 1; }

  .attachment-preview { padding: 8px 14px; flex-wrap: wrap; }
}


/* --- Freeleech --- */
.freeleech-banner {
  background: linear-gradient(90deg, #2b6cff, #7a3cff);
  color: white;
  text-align: center;
  padding: 8px 12px;
  font-weight: 600;
  font-size: 0.9rem;
}

/* --- Sélecteur de rôle admin --- */
.role-form select {
  width: auto;
  padding: 4px 8px;
  font-size: 0.85rem;
}

/* --- Hover card (survol d'un torrent dans une liste) --- */
.hover-trigger { position: relative; display: inline-block; }
.hover-card {
  /* position: fixed (et non absolute) pour échapper complètement à
     .table-scroll, qui doit rester overflow-x: auto pour le défilement
     horizontal du tableau — et qui, de ce fait, coupe aussi tout ce qui
     déborde verticalement (couplage overflow-x/overflow-y du CSS). La
     position exacte (top/left) est calculée au survol par le script en
     bas de home.html, à partir de la position réelle du lien. */
  position: fixed;
  width: 280px;
  max-width: calc(100vw - 32px);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 12px 30px rgba(0,0,0,0.5);
  z-index: 400;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.15s ease, transform 0.15s ease;
  overflow: hidden;
}
.hover-trigger:hover .hover-card {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.hover-card img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  display: block;
}
.hover-card-body { padding: 10px 12px; }
.hover-card-body strong { display: block; margin-bottom: 4px; font-size: 0.9rem; }
.hover-card-body p {
  margin: 6px 0 0;
  font-size: 0.82rem;
  color: var(--muted);
  max-height: 80px;
  overflow: hidden;
}

/* --- Bannières ratio / team note --- */
.ratio-banner {
  background: #3a1c1c;
  color: #ffb4b4;
  text-align: center;
  padding: 8px 12px;
  font-weight: 600;
  font-size: 0.85rem;
}
.flash.team-note {
  background: #1c2a3a;
  color: #a0c8ff;
  border: 1px solid #2b405c;
}

/* --- Icônes de catégorie (image / FontAwesome / texte) --- */
.cat-icon-img {
  width: 1.1em;
  height: 1.1em;
  object-fit: cover;
  border-radius: 3px;
  vertical-align: -0.15em;
  margin-right: 2px;
}

/* --- Petits formulaires inline (tokens, uploader...) --- */
.tokens-form { display: flex; align-items: center; gap: 4px; }
.tokens-form input { padding: 3px 6px; }

/* --- Grades --- */
.grade-pill {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  margin-right: 6px;
  white-space: nowrap;
}
.grade-lvl-0 { background: #2a2e38; color: #9aa3b2; }
.grade-lvl-1 { background: #1c3a2a; color: #7CFFB2; }
.grade-lvl-2 { background: #1c3350; color: #7cc4ff; }
.grade-lvl-3 { background: #2a1c50; color: #b28cff; }
.grade-lvl-4 { background: #4a1c50; color: #ff8cf0; }
.grade-lvl-5 { background: #502a1c; color: #ffb27c; }
.grade-lvl-6 { background: #503a1c; color: #ffd27c; }
.grade-lvl-7 { background: linear-gradient(90deg, #ffd27c, #ff8cf0); color: #12141a; }

.grade-ladder {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 14px;
}
.grade-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  opacity: 0.55;
}
.grade-card.achieved { opacity: 1; }
.grade-card.current { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.grade-card-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.grade-name { font-weight: 700; font-size: 1.05rem; }
.grade-level { color: var(--muted); font-size: 0.8rem; }
.grade-you { margin-left: auto; background: var(--accent); color: var(--accent-contrast, #fff); padding: 1px 8px; border-radius: 999px; font-size: 0.72rem; }

/* --- Avatar dans la nav --- */
.avatar-link { display: inline-flex; margin-left: 10px; }
.avatar-img, .avatar-fallback {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border);
}
.avatar-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: var(--accent-contrast, #fff);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.85rem;
}

/* --- Page profil --- */
.profile-head {
  display: flex;
  gap: 24px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
  margin-bottom: 28px;
}
.avatar-upload { flex-shrink: 0; }
.avatar-big {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 25%, transparent), color-mix(in srgb, var(--accent) 5%, transparent));
  border: 2px solid color-mix(in srgb, var(--accent) 40%, transparent);
  cursor: pointer;
  overflow: hidden;
  position: relative;
}
.avatar-big img { width: 100%; height: 100%; object-fit: cover; }
.avatar-big i { font-size: 2.2rem; color: var(--accent-hover); }
.avatar-big input[type=file] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
}

.profile-headinfo { flex: 1; }
.profile-name-row { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.grade-name-big { font-size: 1.8rem; font-weight: 800; background: none; }
.grade-name-big.grade-lvl-0 { color: #9aa3b2; }
.grade-name-big.grade-lvl-1 { color: #7CFFB2; }
.grade-name-big.grade-lvl-2 { color: #7cc4ff; }
.grade-name-big.grade-lvl-3 { color: #b28cff; }
.grade-name-big.grade-lvl-4 { color: #ff8cf0; }
.grade-name-big.grade-lvl-5 { color: #ffb27c; }
.grade-name-big.grade-lvl-6 { color: #ffd27c; }
.grade-name-big.grade-lvl-7 { color: #ffd27c; }

.profile-badges { display: flex; gap: 10px; margin-bottom: 16px; }
.right-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
}
.right-badge.vote { background: rgba(63,207,142,0.15); color: var(--green); border: 1px solid rgba(63,207,142,0.4); }
.right-badge.propose { background: rgba(242,165,65,0.15); color: var(--orange); border: 1px solid rgba(242,165,65,0.4); }

.progress-block { margin-bottom: 12px; } /* pleine largeur de la card */
.progress-label { display: flex; justify-content: space-between; font-size: 0.85rem; color: var(--muted); margin-bottom: 6px; }
.next-grade-name { font-weight: 700; background: none; }
.progress-bar { height: 8px; background: var(--panel-2); border-radius: 999px; overflow: hidden; }
.progress-bar-fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-hover)); }
.progress-percent { font-size: 0.78rem; color: var(--muted); margin-top: 4px; text-align: center; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 30px;
}
.stat-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  border-left: 3px solid var(--border);
}
.stat-label { font-size: 0.78rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.03em; margin-bottom: 6px; }
.stat-label i { margin-right: 2px; }
.stat-value { font-size: 1.3rem; font-weight: 700; }

.stat-card.up { border-left-color: var(--green); }
.stat-card.up .stat-label i, .stat-card.up .stat-value { color: var(--green); }
.stat-card.down { border-left-color: var(--orange); }
.stat-card.down .stat-label i, .stat-card.down .stat-value { color: var(--orange); }
.stat-card.ratio { border-left-color: var(--accent); }
.stat-card.ratio .stat-label i, .stat-card.ratio .stat-value { color: var(--accent-hover); }
.stat-card.seedtime { border-left-color: #b28cff; }
.stat-card.seedtime .stat-label i, .stat-card.seedtime .stat-value { color: #b28cff; }
.stat-card.shared { border-left-color: var(--accent); }
.stat-card.shared .stat-label i, .stat-card.shared .stat-value { color: var(--accent-hover); }
.stat-card.age .stat-label i, .stat-card.age .stat-value { color: var(--text); }

/* --- Détail des critères de grade (profil + accordéon) --- */
.criteria-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px 18px; margin-top: 14px; }
.criterion { font-size: 0.82rem; }
.criterion-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 4px; gap: 8px; }
.criterion-label { color: var(--muted); }
.criterion-label i { width: 14px; text-align: center; margin-right: 3px; }
.criterion-values { color: var(--text); font-weight: 600; white-space: nowrap; }
.criterion-values i { color: var(--green); margin-left: 2px; }
.criterion-bar { height: 6px; background: var(--panel-2); border-radius: 999px; overflow: hidden; }
.criterion-bar-fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-hover)); border-radius: 999px; }
.criterion.met .criterion-bar-fill { background: var(--green); }
.criterion.met .criterion-values { color: var(--green); }

.grade-timeline { position: relative; padding-left: 6px; }
.grade-timeline::before {
  content: "";
  position: absolute;
  left: 15px;
  top: 16px;
  bottom: 16px;
  width: 2px;
  background: var(--border);
}
.timeline-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
}
.timeline-row.current { background: color-mix(in srgb, var(--accent) 6%, transparent); border-radius: 8px; }
.timeline-dot {
  z-index: 1;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--panel-2);
  border: 2px solid var(--border);
  color: var(--muted);
  font-size: 0.85rem;
}
.timeline-dot.achieved { border-color: currentColor; }
.timeline-dot.grade-lvl-0.achieved { color: #9aa3b2; }
.timeline-dot.grade-lvl-1.achieved { color: #7CFFB2; }
.timeline-dot.grade-lvl-2.achieved { color: #7cc4ff; }
.timeline-dot.grade-lvl-3.achieved { color: #b28cff; }
.timeline-dot.grade-lvl-4.achieved { color: #ff8cf0; }
.timeline-dot.grade-lvl-5.achieved { color: #ffb27c; }
.timeline-dot.grade-lvl-6.achieved { color: #ffd27c; }
.timeline-dot.grade-lvl-7.achieved { color: #ffd27c; }
.timeline-row.current .timeline-dot { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent); }
.timeline-name {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
  white-space: nowrap;
}
.timeline-tag {
  font-size: 0.72rem;
  padding: 2px 10px;
  border-radius: 999px;
  font-weight: 700;
}
.timeline-tag.current { background: var(--accent); color: var(--accent-contrast, #fff); }
.timeline-tag.achieved { background: rgba(63,207,142,0.15); color: var(--green); }
.timeline-tag.locked { background: var(--panel-2); color: var(--muted); }

/* --- Landing page (visiteur déconnecté) --- */
.landing-hero {
  text-align: center;
  padding: 60px 20px 40px;
}
.landing-hero h1 { font-size: 2.2rem; margin-bottom: 8px; }
.landing-actions { display: flex; justify-content: center; gap: 12px; margin-top: 20px; }

/* --- Site cards (bandeau administrable) --- */
.site-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.site-card {
  min-height: 180px;
  border-radius: 12px;
  background: #171a21 center/cover no-repeat;
  border: 1px solid var(--border);
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}
.site-card-overlay {
  width: 100%;
  padding: 18px;
  background: linear-gradient(0deg, rgba(10,11,14,0.92) 20%, rgba(10,11,14,0.15) 100%);
}
.site-card-overlay h2 { margin: 0 0 6px; font-size: 1.15rem; }
.site-card-overlay p { margin: 0 0 10px; font-size: 0.85rem; color: var(--muted); }

/* --- Admin : gestion des cartes --- */
.card-admin-row {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.card-admin-row.archived { opacity: 0.5; }
.card-edit-form { display: flex; flex-wrap: wrap; gap: 8px; flex: 1; }
.card-edit-form input, .card-edit-form textarea { flex: 1; min-width: 140px; }
.card-edit-form textarea { flex-basis: 100%; }
.card-admin-thumb { width: 56px; height: 56px; object-fit: cover; border-radius: 6px; }
.card-admin-actions { display: flex; flex-direction: column; gap: 6px; padding-top: 6px; }

/* --- Statut de compte (admin) --- */
tr.row-suspended { opacity: 0.55; }

/* --- Accordéon d'explication des grades (page profil) --- */
.grade-timeline details.timeline-row {
  border-bottom: 1px solid var(--border);
  padding: 4px 0;
}
.grade-timeline summary {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 4px;
  cursor: pointer;
  list-style: none;
}
.grade-timeline summary::-webkit-details-marker { display: none; }
.timeline-chevron { margin-left: auto; color: var(--muted); font-size: 0.75rem; transition: transform 0.15s ease; }
details[open] .timeline-chevron { transform: rotate(180deg); }
.timeline-detail {
  padding: 6px 4px 16px 44px;
}
.timeline-detail-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; color: var(--muted); font-size: 0.85rem; }

/* --- Panneau "Nouveautés" (changelog) --- */
.changelog-panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 24px;
  margin-bottom: 28px;
}
.changelog-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  font-weight: 700;
}
.changelog-panel-head span:first-child { color: var(--green); }
.changelog-panel-head a { color: var(--green); font-size: 0.85rem; text-decoration: none; }
.changelog-panel-head a:hover { text-decoration: underline; }

.changelog-meta { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.version-pill {
  background: rgba(63,207,142,0.15);
  color: var(--green);
  border: 1px solid rgba(63,207,142,0.4);
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
}
.changelog-entry h3 { font-size: 0.95rem; margin: 14px 0 6px; }
.changelog-items { margin: 0 0 4px; padding-left: 20px; color: var(--muted); font-size: 0.88rem; }
.changelog-items li { padding: 2px 0; }
.changelog-entry-full { margin-bottom: 30px; padding-bottom: 20px; border-bottom: 1px solid var(--border); }

.changelog-admin-row { border-bottom: 1px solid var(--border); padding: 10px 0; }
.changelog-admin-row summary { cursor: pointer; font-weight: 600; padding: 4px 0; }

/* --- Badges --- */
.badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  border: 1px solid;
  margin-right: 4px;
}

.badge-toggle-cell { display: flex; flex-wrap: wrap; gap: 4px; max-width: 160px; }
.badge-toggle {
  --badge-color: #4f8cff;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--muted);
  cursor: pointer;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
}
.badge-toggle.active {
  background: color-mix(in srgb, var(--badge-color) 20%, var(--panel-2));
  border-color: var(--badge-color);
  color: var(--badge-color);
}

/* --- Pseudo + badges regroupés (affiché partout où un membre est nommé) --- */
.user-tag { display: inline-flex; align-items: center; gap: 4px; vertical-align: middle; }
.user-tag .badge-pill { margin-right: 0; }

/* --- Effets visuels de badge (choisis par l'admin, indépendants par badge) --- */
.badge-fx-glow {
  --badge-glow-color: var(--badge-color, currentColor);
  animation: badge-fx-glow-pulse 1.8s ease-in-out infinite;
}
@keyframes badge-fx-glow-pulse {
  0%, 100% { box-shadow: 0 0 2px var(--badge-glow-color, color-mix(in srgb, var(--accent-hover) 60%, transparent)); }
  50% { box-shadow: 0 0 10px var(--badge-glow-color, var(--accent-hover)), 0 0 18px var(--badge-glow-color, color-mix(in srgb, var(--accent-hover) 60%, transparent)); }
}

.badge-fx-pulse { animation: badge-fx-pulse-scale 1.4s ease-in-out infinite; }
@keyframes badge-fx-pulse-scale {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.12); }
}

.badge-fx-shine { position: relative; overflow: hidden; }
.badge-fx-shine::after {
  content: "";
  position: absolute;
  top: 0; left: -60%;
  width: 40%; height: 100%;
  background: linear-gradient(120deg, transparent, rgba(255,255,255,0.55), transparent);
  animation: badge-fx-shine-sweep 2.4s ease-in-out infinite;
}
@keyframes badge-fx-shine-sweep {
  0% { left: -60%; }
  60%, 100% { left: 130%; }
}

.badge-fx-outline {
  animation: badge-fx-outline-cycle 3s linear infinite;
}
@keyframes badge-fx-outline-cycle {
  0%, 100% { border-color: var(--badge-color, currentColor); }
  50% { border-color: #ffffff; }
}

.badge-fx-rainbow {
  animation: badge-fx-rainbow-hue 3s linear infinite;
}
@keyframes badge-fx-rainbow-hue {
  0% { filter: hue-rotate(0deg); }
  100% { filter: hue-rotate(360deg); }
}

/* --- Admin : gestion des badges --- */
.badge-admin-list li { flex-wrap: wrap; gap: 10px; align-items: center; }
.badge-admin-preview { min-width: 150px; display: inline-flex; align-items: center; }
.badge-edit-form { flex-wrap: wrap; }

/* --- Onglets de salons (shoutbox) --- */
.room-tabs { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.room-tab {
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--muted);
  text-decoration: none;
  font-size: 0.85rem;
}
.room-tab.active { background: var(--accent); border-color: var(--accent); color: var(--accent-contrast, #fff); }

/* --- Sélecteur d'émojis (shoutbox) --- */
.emoji-picker-wrap { position: relative; }
.emoji-btn {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  width: 40px;
  height: 40px;
  font-size: 1.1rem;
  color: var(--text);
  cursor: pointer;
  margin: 0;
  padding: 0;
}
.emoji-btn:hover { background: var(--panel-3); color: var(--accent-hover); }
.emoji-panel {
  position: absolute;
  bottom: 48px;
  left: 0;
  width: 260px;
  max-height: 220px;
  overflow-y: auto;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 2px;
  box-shadow: 0 12px 30px rgba(0,0,0,0.5);
  z-index: 50;
}
.emoji-panel.hidden { display: none; }
.emoji-option {
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 4px;
  margin: 0;
  border-radius: 6px;
  line-height: 1;
}
.emoji-option:hover { background: var(--panel-3); }

/* --- Sélecteur d'émoji "à la Discord" (message de shoutbox) --- */
.discord-emoji-panel { width: 300px; max-height: 260px; display: flex; flex-direction: column; padding: 0; grid-template-columns: none; }
.emoji-tabs {
  display: flex;
  gap: 2px;
  padding: 6px 6px 0;
  border-bottom: 1px solid var(--border);
  flex: 0 0 auto;
}
.emoji-tab {
  background: none;
  border: none;
  border-radius: 6px 6px 0 0;
  color: var(--muted);
  font-size: 1rem;
  padding: 6px 10px;
  margin: 0;
  cursor: pointer;
}
.emoji-tab:hover { background: var(--panel-3); }
.emoji-tab.active { color: var(--text); background: var(--panel-3); }
.emoji-grid {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 2px;
}
.custom-emoji-option img { width: 22px; height: 22px; object-fit: contain; }
.chat-emoji { width: 22px; height: 22px; object-fit: contain; vertical-align: middle; margin: 0 1px; }

/* --- Pièce jointe (image envoyée dans un message, ou aperçu avant envoi) --- */
.shout-attachment-wrap { display: block; margin: 4px 0 4px 0; }
.shout-attachment { max-width: 260px; max-height: 260px; border-radius: 8px; border: 1px solid var(--border); display: block; }
.attachment-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 20px;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
}
.attachment-preview.hidden { display: none; }
.attachment-preview img { max-height: 60px; max-width: 100px; border-radius: 6px; border: 1px solid var(--border); object-fit: cover; }

/* --- Sélecteur de GIF (Klipy) --- */
.gif-btn-label { font-size: 0.75rem; font-weight: 700; width: auto; padding: 0 10px; }
.gif-panel {
  position: fixed;
  width: 588px;
  max-height: 500px;
  display: flex;
  flex-direction: column;
  padding: 10px;
  grid-template-columns: none;
  gap: 10px;
}
.gif-search-wrap { position: relative; flex: 0 0 auto; }
.gif-search-wrap i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 0.85rem; pointer-events: none; }
.gif-search-input { margin: 0; padding-left: 34px !important; }
.gif-results {
  flex: 1;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.gif-hint { grid-column: 1 / -1; text-align: center; margin: 10px 0; }
.gif-result {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  border-radius: 6px;
  overflow: hidden;
  line-height: 0;
}
.gif-result img { width: 100%; height: 100%; aspect-ratio: 1 / 1; object-fit: cover; display: block; border-radius: 8px; }
.gif-result:hover img { outline: 2px solid var(--accent); }

/* --- Admin : émojis personnalisés --- */
.custom-emoji-preview { width: 20px; height: 20px; object-fit: contain; vertical-align: middle; margin-right: 6px; }

/* --- Admin : archives de la shoutbox --- */
.shout-archive-preview { max-height: 320px; overflow-y: auto; padding: 8px 0 4px; }

/* --- Classement --- */
.leaderboard-table .rank-cell { font-weight: 700; color: var(--muted); width: 50px; }
.leaderboard-table tr.podium td { background: rgba(255,255,255,0.02); }
.leaderboard-table tr.podium-1 .rank-cell { font-size: 1.1rem; }
.medal-gold { color: #ffd700; }
.medal-silver { color: #c7ccd1; }
.medal-bronze { color: #cd7f32; }
.leaderboard-user { display: inline-flex; align-items: center; gap: 8px; color: var(--text); text-decoration: none; font-weight: 600; }
.leaderboard-user:hover { color: var(--accent-hover); }
.leaderboard-user .avatar-img, .leaderboard-user .avatar-fallback { width: 26px; height: 26px; font-size: 0.7rem; }
.leaderboard-note { margin-top: 10px; }

/* --- Fiche torrent : titre + badge validation --- */
.detail-title-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.detail-title-row h1 { margin: 0; }
.validated-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  background: rgba(63,207,142,0.15);
  color: var(--green);
  border: 1px solid rgba(63,207,142,0.4);
}

/* --- Votes --- */
.vote-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; align-items: center; }
.vote-sep { width: 1px; align-self: stretch; background: var(--border); margin: 0 4px; }
.vote-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.85rem;
  cursor: pointer;
}
.vote-btn:hover { border-color: var(--accent); color: var(--text); }
.vote-count { font-weight: 700; color: var(--text); }
.vote-btn.active-like, .vote-btn.active-ok { background: rgba(63,207,142,0.15); border-color: var(--green); color: var(--green); }
.vote-btn.active-like .vote-count, .vote-btn.active-ok .vote-count { color: var(--green); }
.vote-btn.active-dislike, .vote-btn.active-notok { background: rgba(224,80,80,0.15); border-color: var(--red); color: var(--red); }
.vote-btn.active-dislike .vote-count, .vote-btn.active-notok .vote-count { color: var(--red); }

/* --- Panneau "Confiance communautaire" (fiche torrent) --- */
.trust-panel {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  margin: 18px 0;
}
.trust-head { font-weight: 700; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.trust-status-row { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-bottom: 10px; }
.trust-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  border: 1px solid var(--border);
}
.trust-pill.trust-untested { background: rgba(240,170,60,0.15); color: var(--orange); border-color: rgba(240,170,60,0.4); }
.trust-pill.trust-validated { background: rgba(63,207,142,0.15); color: var(--green); border-color: rgba(63,207,142,0.4); }
.trust-pill.trust-flagged { background: rgba(224,80,80,0.15); color: var(--red); border-color: rgba(224,80,80,0.4); }
.trust-counts { color: var(--muted); font-size: 0.85rem; display: inline-flex; align-items: center; gap: 6px; }
.trust-actions { display: flex; gap: 8px; }

/* --- Liste "Versions" (autres uploads regroupés) --- */
.version-list { list-style: none; padding: 0; margin: 0; }
.version-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
}
.version-list li:last-child { border-bottom: none; }
.version-list a { color: var(--text); text-decoration: none; }
.version-list a:hover { color: var(--accent-hover); }
.version-meta { display: flex; gap: 10px; color: var(--muted); flex-shrink: 0; white-space: nowrap; }

/* --- Galerie d'images sur la fiche torrent --- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  margin: 16px 0 28px;
}
.gallery-thumb {
  width: 100%;
  height: 110px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.gallery-thumb:hover { transform: scale(1.03); border-color: var(--accent); }

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
  cursor: zoom-out;
  padding: 30px;
}
.lightbox.hidden { display: none; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 8px; box-shadow: 0 20px 60px rgba(0,0,0,0.6); }

/* --- Galerie en édition (miniatures + case à cocher "supprimer") --- */
.gallery-edit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 10px;
  margin: 8px 0 16px;
}
.gallery-edit-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  color: var(--muted);
  cursor: pointer;
}
.gallery-edit-item img { width: 100%; height: 90px; object-fit: cover; border-radius: 6px; border: 1px solid var(--border); }
.gallery-edit-item span { display: flex; align-items: center; gap: 4px; }

/* --- Commentaires --- */
.comment-form { display: flex; flex-direction: column; gap: 10px; margin: 14px 0 26px; }
.comment-form textarea { width: 100%; }
.comment-form button { align-self: flex-end; }
.comment-list { display: flex; flex-direction: column; gap: 16px; margin-bottom: 20px; }
.comment { border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; background: var(--panel); }
.comment-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.comment-author { display: inline-flex; align-items: center; gap: 6px; color: var(--text); text-decoration: none; font-weight: 600; }
.comment-author:hover { color: var(--accent-hover); }
.comment-author .avatar-img, .comment-author .avatar-fallback { width: 24px; height: 24px; font-size: 0.7rem; }
.comment-date { margin-left: auto; font-size: 0.78rem; }
.comment-delete { margin-left: 4px; }
.comment-body { margin: 0; line-height: 1.5; }

/* --- Ajustement de ratio en admin --- */
.ratio-adjust { display: inline-flex; align-items: center; gap: 6px; }
.ratio-adjust-note { display: block; font-size: 0.72rem; margin-top: 2px; }

/* --- Effets de pseudo --- */
.uname { display: inline-block; }

.uname-neon {
  color: #7ff5ff;
  font-weight: 700;
  text-shadow:
    0 0 4px #7ff5ff,
    0 0 10px #7ff5ff,
    0 0 18px #2ec5ff,
    0 0 32px #2ec5ff;
}

.uname-rainbow {
  font-weight: 700;
  background: linear-gradient(90deg, #ff5b5b, #f2a541, #f5e663, #3fcf8e, #4f8cff, #b28cff, #ff5b5b);
  background-size: 300% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: uname-rainbow-shift 4s linear infinite;
}
@keyframes uname-rainbow-shift {
  0% { background-position: 0% 50%; }
  100% { background-position: 300% 50%; }
}

.uname-glow {
  color: var(--accent-hover);
  font-weight: 700;
  animation: uname-glow-pulse 1.8s ease-in-out infinite;
}
@keyframes uname-glow-pulse {
  0%, 100% { text-shadow: 0 0 4px color-mix(in srgb, var(--accent-hover) 50%, transparent); }
  50% { text-shadow: 0 0 14px var(--accent-hover), 0 0 26px color-mix(in srgb, var(--accent-hover) 60%, transparent); }
}

.uname-shadow {
  color: var(--text);
  font-weight: 700;
  animation: uname-shadow-drift 3s ease-in-out infinite;
}
@keyframes uname-shadow-drift {
  0%, 100% { text-shadow: 3px 3px 0 rgba(0,0,0,0.5); }
  50% { text-shadow: -3px 3px 0 color-mix(in srgb, var(--accent) 50%, transparent); }
}

/* --- Effets de pseudo supplémentaires --- */
/* Les dégradés de texte utilisent filter: drop-shadow (et non text-shadow,
   qui apparaîtrait à travers le texte transparent). */
.uname-fire {
  font-weight: 700;
  background: linear-gradient(0deg, #ff2a00, #ff8a00 50%, #ffe27a);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  animation: uname-fire-flicker 1.6s ease-in-out infinite;
}
@keyframes uname-fire-flicker {
  0%, 100% { filter: drop-shadow(0 0 3px rgba(255,90,0,.7)); }
  25% { filter: drop-shadow(0 -2px 6px rgba(255,140,0,.9)); }
  50% { filter: drop-shadow(0 0 5px rgba(255,60,0,.8)); }
  75% { filter: drop-shadow(0 -3px 8px rgba(255,170,0,.85)); }
}

.uname-ice {
  font-weight: 700;
  background: linear-gradient(90deg, #a9e4ff, #ffffff, #6fc8ff, #ffffff, #a9e4ff);
  background-size: 300% auto;
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 5px rgba(120,205,255,.8));
  animation: uname-sheen 5s linear infinite;
}

.uname-gold {
  font-weight: 800;
  background: linear-gradient(110deg, #b8860b 0%, #ffd700 25%, #fff6b0 40%, #ffd700 55%, #b8860b 100%);
  background-size: 250% auto;
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,.55));
  animation: uname-sheen 3.5s linear infinite;
}

.uname-glitch {
  color: #fff; font-weight: 700;
  text-shadow: -2px 0 #ff2a6d, 2px 0 #05d9e8;
  animation: uname-glitch 3s steps(1, end) infinite;
}
@keyframes uname-glitch {
  0%, 88%, 100% { text-shadow: -2px 0 #ff2a6d, 2px 0 #05d9e8; transform: none; }
  90% { text-shadow: 3px 0 #ff2a6d, -3px 0 #05d9e8; transform: translateX(-1px); }
  92% { text-shadow: -3px 1px #ff2a6d, 3px -1px #05d9e8; transform: translateX(1px); }
  94% { text-shadow: 2px 0 #ff2a6d, -2px 0 #05d9e8; transform: none; }
}

.uname-toxic {
  color: #b6ff00; font-weight: 700;
  animation: uname-toxic-pulse 2.4s ease-in-out infinite;
}
@keyframes uname-toxic-pulse {
  0%, 100% { text-shadow: 0 0 5px #7dff00, 0 0 12px #3fa800; }
  50% { text-shadow: 0 0 9px #b6ff00, 0 0 22px #5ed400, 0 0 34px #2f8000; }
}

.uname-sunset {
  font-weight: 700;
  background: linear-gradient(90deg, #ff5f6d, #ffc371, #ff5f9e, #a64bf4, #ff5f6d);
  background-size: 300% auto;
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 4px rgba(255,110,140,.55));
  animation: uname-sheen 6s linear infinite;
}

.uname-aurora {
  font-weight: 700;
  background: linear-gradient(90deg, #00ffa3, #00cfff, #7b5cff, #00ffa3);
  background-size: 300% auto;
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 6px rgba(0,255,200,.5));
  animation: uname-sheen 5s linear infinite;
}

.uname-electric {
  color: #fff36b; font-weight: 700;
  animation: uname-electric-zap 2.2s ease-in-out infinite;
}
@keyframes uname-electric-zap {
  0%, 100% { text-shadow: 0 0 4px #fff, 0 0 10px #ffe600, 0 0 20px #ffb700; }
  45% { text-shadow: 0 0 3px #fff, 0 0 6px #ffe600, 0 0 10px #ffb700; }
  50% { text-shadow: 0 0 6px #fff, 0 0 16px #fff36b, 0 0 30px #ffb700; }
}

.uname-candy {
  font-weight: 700;
  background: linear-gradient(90deg, #ff6ec7, #ffd1f0, #9ad9ff, #ff6ec7);
  background-size: 300% auto;
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 5px rgba(255,110,199,.65));
  animation: uname-sheen 4s linear infinite;
}

.uname-blood {
  color: #e01b24; font-weight: 800;
  animation: uname-blood-beat 2.4s ease-in-out infinite;
}
@keyframes uname-blood-beat {
  0%, 100% { text-shadow: 0 1px 0 #7a0000, 0 3px 4px rgba(120,0,0,.9), 0 0 8px rgba(224,27,36,.45); }
  15% { text-shadow: 0 1px 0 #7a0000, 0 4px 6px rgba(120,0,0,.95), 0 0 16px rgba(224,27,36,.8); }
  30% { text-shadow: 0 1px 0 #7a0000, 0 3px 4px rgba(120,0,0,.9), 0 0 9px rgba(224,27,36,.5); }
  45% { text-shadow: 0 1px 0 #7a0000, 0 4px 6px rgba(120,0,0,.95), 0 0 14px rgba(224,27,36,.7); }
}

.uname-chrome {
  font-weight: 800;
  background: linear-gradient(110deg, #7d858d 0%, #f4f6f8 20%, #7d858d 40%, #dfe4e9 60%, #7d858d 80%, #f4f6f8 100%);
  background-size: 250% auto;
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 1px 1px rgba(0,0,0,.6));
  animation: uname-sheen 4.5s linear infinite;
}

/* Balayage commun aux effets en dégradé */
@keyframes uname-sheen {
  0% { background-position: 0% 50%; }
  100% { background-position: 300% 50%; }
}

/* 16 effets : une grille de 8 colonnes (2 lignes) sur grand écran */
.effect-picker { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 12px; margin: 14px 0 30px; }
@media (max-width: 1100px) { .effect-picker { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 560px)  { .effect-picker { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.effect-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 14px 8px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel);
  cursor: pointer;
  min-width: 0;
}
/* pas d'overflow:hidden ici : il couperait les lueurs (néon, feu…) */
.effect-option .uname { max-width: 100%; overflow-wrap: anywhere; text-align: center; }
.effect-option:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.effect-option input { position: absolute; opacity: 0; pointer-events: none; }
.effect-option .uname { font-size: 1rem; }
.effect-label { font-size: 0.75rem; color: var(--muted); }

/* --- Cross-seed --- */
.lead { color: var(--muted); max-width: 780px; margin-bottom: 20px; line-height: 1.6; }
.crossseed-help { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; margin-bottom: 26px; }
.crossseed-help-item { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; }
.crossseed-help-item > strong { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.crossseed-help-item p { margin: 0; color: var(--muted); font-size: 0.85rem; line-height: 1.5; }
.lead.crossseed-lead { max-width: none; }
.crossseed-form { display: flex; flex-direction: column; gap: 10px; max-width: none; margin-bottom: 30px; }
.crossseed-form button { align-self: center; width: auto; min-width: 240px; padding: 9px 26px; margin: 6px 0 0; }
.crossseed-form textarea { font-family: "Courier New", monospace; font-size: 0.85rem; }
.crossseed-badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 0.75rem; font-weight: 700; white-space: nowrap; }
.crossseed-badge.hash { background: rgba(63,207,142,0.15); color: var(--green); border: 1px solid rgba(63,207,142,0.4); }
.crossseed-badge.name { background: color-mix(in srgb, var(--accent) 15%, transparent); color: var(--accent-hover); border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent); }

/* --- Onglets génériques (ex: boîte de réception / archivées) --- */
.tabs { display: flex; gap: 8px; margin-top: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.tab {
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--muted);
  text-decoration: none;
  font-size: 0.85rem;
}
.tab:hover { color: var(--text); }
.tab.active { background: var(--accent); border-color: var(--accent); color: var(--accent-contrast, #fff); }

/* --- Tables : défilement horizontal de secours sur petit écran --- */
.table-scroll { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-scroll .torrent-table { min-width: 560px; }
/* ==========================================================================
   Responsive — menu mobile + réajustements petit écran
   ========================================================================== */

.nav-toggle-checkbox { display: none; }
.nav-burger {
  display: none;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--text);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.05rem;
  margin-left: auto;
  flex-shrink: 0;
}
.nav-burger:hover { background: var(--panel-3); }

@media (max-width: 900px) {
  .topbar { padding: 0 16px; }
  .topbar-inner { flex-wrap: wrap; padding: 12px 0; }
  .nav-burger { display: flex; }

  nav {
    flex-basis: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
    width: 100%;
  }
  .nav-toggle-checkbox:checked ~ nav {
    max-height: 900px;
    padding-top: 10px;
    margin-top: 10px;
    border-top: 1px solid var(--border);
  }
  nav a {
    margin-left: 0;
    padding: 10px 4px;
  }
  nav .grade-pill, nav .badge-pill { margin-left: 0; align-self: flex-start; margin-top: 6px; }
  nav .user-pill {
    margin-left: 0;
    margin-top: 10px;
    flex-wrap: wrap;
    background: none;
    padding: 0;
  }
  nav .avatar-link { margin-left: 0; margin-top: 10px; }
}

@media (max-width: 700px) {
  .container { padding: 18px 16px; }
  h1 { font-size: 1.4rem; }

  .statsbar { padding: 10px 16px; gap: 10px 14px; justify-content: flex-start; }

  .page-head { align-items: flex-start; }

  .search { flex-wrap: wrap; }
  .search input[type=text] { flex: 1 1 100%; }
  .search select, .search button { flex: 1 1 auto; }

  .profile-head { flex-direction: column; align-items: flex-start; padding: 18px; }

  .stat-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .criteria-grid { grid-template-columns: 1fr; }

  .detail-poster { width: 140px; }

  .form-card, .detail-card { padding: 18px; max-width: 100%; min-width: 0; }

  .card { width: 130px; }
  .card-poster { width: 130px; height: 190px; }

  .icon-btn-group { flex-wrap: wrap; }
  .site-cards { grid-template-columns: 1fr; }

  /* Tableaux "responsive" (ex: messagerie) : passage en cartes empilées
     plutôt qu'en défilement horizontal, plus lisible sur mobile. */
  .responsive-table, .responsive-table thead, .responsive-table tbody,
  .responsive-table th, .responsive-table td, .responsive-table tr {
    display: block;
  }
  .responsive-table thead { display: none; }
  .responsive-table tr {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 12px;
    margin-bottom: 10px;
    background: var(--panel);
  }
  .responsive-table td {
    border-bottom: none;
    padding: 4px 0;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
  }
  .responsive-table td[data-label]:not([data-label=""])::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 600;
    flex-shrink: 0;
  }
  .responsive-table td:empty { display: none; }
}

@media (max-width: 480px) {
  .hero-title { font-size: 1.25rem; }
  .hero-overlay { padding: 20px; }
  .hero-actions { flex-wrap: wrap; }
  .criterion-values { white-space: normal; }
}

/* --- BBCode (commentaires, présentation détaillée) --- */
.bbcode-hint { font-size: 0.8rem; margin-top: -6px; margin-bottom: 10px; }
.bbcode-quote {
  margin: 10px 0;
  padding: 10px 14px;
  border-left: 3px solid #3a3f4b;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 4px;
}
.bbcode-quote cite { display: block; font-style: normal; font-weight: 600; margin-bottom: 4px; opacity: 0.75; }
.bbcode-spoiler {
  margin: 10px 0;
  padding: 8px 12px;
  border: 1px dashed #3a3f4b;
  border-radius: 4px;
}
.bbcode-spoiler summary { cursor: pointer; font-weight: 600; }
.bbcode-code {
  margin: 10px 0;
  padding: 10px 12px;
  background: #0d0f13;
  border-radius: 6px;
  overflow-x: auto;
  font-size: 0.85rem;
}
.bbcode-list { margin: 8px 0; padding-left: 22px; }
.bbcode-list li { margin: 2px 0; }
.bbcode-img { max-width: 100%; border-radius: 6px; margin: 8px 0; }
.bbcode-align-left { text-align: left; }
.bbcode-align-center { text-align: center; }
.bbcode-align-right { text-align: right; }

/* --- Modération shoutbox : boutons par message + modal de ban --- */
.shout-line { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; }
.shout-mod-actions {
  display: inline-flex;
  gap: 4px;
  margin-left: auto;
  opacity: 0.35;
  transition: opacity 0.15s ease;
}
.shout-line:hover .shout-mod-actions { opacity: 1; }
.shout-mod-btn {
  background: none;
  border: 1px solid transparent;
  color: var(--muted);
  border-radius: 6px;
  padding: 2px 6px;
  font-size: 0.8rem;
  cursor: pointer;
}
.shout-mod-btn:hover { background: var(--panel-2); border-color: var(--border); color: var(--text); }
.shout-ban-btn:hover { color: var(--red); border-color: color-mix(in srgb, var(--red) 45%, var(--border)); }

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
  padding: 16px;
}
.modal-overlay.hidden { display: none; }
.modal-box {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  width: 100%;
  max-width: 360px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}
.modal-box h3 { margin: 0 0 14px; font-size: 1rem; }
.modal-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; font-size: 0.85rem; color: var(--muted); }
.modal-field select, .modal-field textarea {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 8px;
  font-family: inherit;
  font-size: 0.9rem;
  resize: vertical;
}
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 6px; }

/* --- Bandeau de ban actif dans /admin --- */
.ban-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  font-size: 0.75rem;
  color: var(--red);
}

/* ==========================================================================
   Panneau de personnalisation de l'apparence (Fond / Ton signal / Confort)
   ========================================================================== */
.theme-fab {
  position: fixed;
  right: 22px;
  bottom: 22px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-contrast, #fff);
  border: none;
  font-size: 1.15rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0,0,0,0.35);
  z-index: 200;
  margin: 0;
  padding: 0;
}
.theme-fab:hover { background: var(--accent-hover); }
/* Version « en-tête » (utilisateur connecté) : même gabarit que la cloche et l'éclair */
.theme-fab.theme-fab-nav {
  position: relative; right: auto; bottom: auto; z-index: auto;
  width: 36px; height: 36px; border-radius: 10px; font-size: 1rem; box-shadow: none;
  background: var(--panel-2); border: 1px solid var(--border); color: var(--text);
}
.theme-fab.theme-fab-nav:hover { background: var(--panel-3); color: var(--accent-hover); }
/* le panneau s'ouvre alors sous l'en-tête, à droite */
body[data-authed] .theme-panel { top: 64px; bottom: auto; transform-origin: top right; max-height: calc(100vh - 90px); }

.theme-panel-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  z-index: 599;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease;
}
.theme-panel-backdrop.open { opacity: 1; visibility: visible; }

.theme-panel {
  position: fixed;
  right: 22px;
  bottom: 86px;
  width: 300px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.45);
  z-index: 600;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px) scale(0.98);
  transform-origin: bottom right;
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
}
.theme-panel.open { opacity: 1; visibility: visible; transform: translateY(0) scale(1); }

.theme-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  font-weight: 700;
}
.theme-panel-close {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 1rem;
  padding: 4px;
  margin: 0;
}
.theme-panel-close:hover { color: var(--text); background: none; }

.theme-panel-body { padding: 16px 18px 20px; }
.theme-section { margin-bottom: 20px; }
.theme-section:last-child { margin-bottom: 0; }
.theme-section-title {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}

.theme-fond-row { display: flex; flex-wrap: wrap; gap: 10px; }
.fond-swatch {
  flex: 1 1 calc(50% - 5px);
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  background: var(--panel-2);
  border: 2px solid transparent;
  border-radius: 10px;
  padding: 10px 6px;
  cursor: pointer;
  color: var(--text);
  font-size: 0.72rem;
  margin: 0;
}
.fond-swatch:hover { background: var(--panel-3); }
.fond-swatch.active { border-color: var(--accent); }
.fond-dot {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--border);
}
.fond-dot.fond-dark { background: #08090b; }
.fond-dot.fond-light { background: #f6f7f9; }
.fond-dot.fond-midnight { background: #0f1115; }
.fond-dot.fond-gradient { background: linear-gradient(160deg, #030505 0%, color-mix(in srgb, var(--accent) 45%, #050708) 100%); }

.theme-accent-row { display: flex; flex-wrap: wrap; gap: 10px; }
.accent-swatch {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--sw);
  border: 3px solid transparent;
  box-shadow: 0 0 0 1px var(--border) inset;
  cursor: pointer;
  padding: 0;
  margin: 0;
}
.accent-swatch:hover { filter: brightness(1.08); }
.accent-swatch.active { border-color: var(--panel); box-shadow: 0 0 0 2px var(--sw); }

.theme-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.88rem;
  color: var(--text);
  cursor: pointer;
}
.switch { position: relative; display: inline-block; width: 40px; height: 22px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch-slider {
  position: absolute;
  inset: 0;
  background: var(--panel-3);
  border-radius: 999px;
  transition: background 0.15s ease;
}
.switch-slider::before {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.15s ease;
}
.switch input:checked + .switch-slider { background: var(--accent); }
.switch input:checked + .switch-slider::before { transform: translateX(18px); }

@media (max-width: 480px) {
  .theme-panel { right: 12px; left: 12px; width: auto; bottom: 82px; }
  .theme-fab { right: 16px; bottom: 16px; }
}

/* ==========================================================================
   Méga-menu "Torrents" (catégories) dans l'en-tête
   ========================================================================== */
.navcat-wrap {
  position: relative;
  margin-left: 18px;
}
.navcat-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text);
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.navcat-toggle::-webkit-details-marker { display: none; }
.navcat-toggle:hover { color: var(--accent-hover); }
.navcat-toggle i { font-size: 0.68em; transition: transform 0.15s ease; }
.navcat-wrap[open] .navcat-toggle i { transform: rotate(180deg); }

.navcat-menu {
  /* position: fixed (et non absolute) pour échapper au clipping vertical
     de html/body (overflow-x: hidden y force aussi overflow-y: auto —
     même couplage overflow-x/overflow-y que .table-scroll / .card-scroll
     plus haut), qui coupait ce menu sur les pages plus courtes que
     l'accueil. Position calculée en JS (voir layout.html) à partir du
     bouton "Torrents"/"Communauté" réellement cliqué. */
  position: fixed;
  top: 0;
  left: 0;
  width: 760px;
  max-width: calc(100vw - 32px);
  max-height: 70vh;
  overflow-y: auto;
  overscroll-behavior: contain; /* empêche le scroll de "fuiter" vers la page derrière une fois en haut/bas du menu */
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.45);
  padding: 18px;
  /* Au-dessus des cartes de survol (400), emoji/réactions (200), modales (300) ;
     reste sous le panneau de notifications (1500) et la modale freeleech (2000). */
  z-index: 1200;
}

.navcat-quicklinks {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.navcat-quicklinks a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--panel-2);
  border-radius: 10px;
  color: var(--text);
  font-weight: 600;
  font-size: 0.85rem;
  margin: 0;
}
.navcat-quicklinks a:hover { background: var(--panel-3); color: var(--text); }
.navcat-quicklinks a i { color: var(--accent); }

.navcat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px 22px;
  align-items: start;
}

.navcat-group-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.navcat-group-head {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 700;
  font-size: 0.92rem;
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
}
.navcat-chev {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 0;
  border-radius: 8px;
  color: var(--muted);
  cursor: pointer;
  padding: 0;
  margin: 0;
}
.navcat-chev:hover { background: var(--panel-3); color: var(--text); }
.navcat-chev i { font-size: 0.7rem; transition: transform 0.15s ease; }
.navcat-group.open .navcat-chev i { transform: rotate(180deg); }
/* sous-menus repliés par défaut */
.navcat-group .navcat-subs { display: none; margin-top: 8px; }
.navcat-group.open .navcat-subs { display: flex; }
/* une carte de survol (affiche de torrent) ne doit jamais masquer un menu ouvert */
body:has(.navcat-wrap[open]) .hover-card { display: none; }
.navcat-group-head:hover { color: var(--text); }
.navcat-icon {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  flex-shrink: 0;
  color: #fff;
  background: var(--accent);
}
/* Couleurs cycliques des icônes (une teinte par catégorie racine, dans
   l'ordre de création — se répète au-delà de 9 catégories). */
.navcat-group:nth-of-type(9n+1) .navcat-icon { background: #4f8cff; }
.navcat-group:nth-of-type(9n+2) .navcat-icon { background: #f2a541; }
.navcat-group:nth-of-type(9n+3) .navcat-icon { background: #8b7cf6; }
.navcat-group:nth-of-type(9n+4) .navcat-icon { background: #5b7cfa; }
.navcat-group:nth-of-type(9n+5) .navcat-icon { background: #2ecf7d; }
.navcat-group:nth-of-type(9n+6) .navcat-icon { background: #22c3e6; }
.navcat-group:nth-of-type(9n+7) .navcat-icon { background: #ef5b8f; }
.navcat-group:nth-of-type(9n+8) .navcat-icon { background: #3fcf8e; }
.navcat-group:nth-of-type(9n+9) .navcat-icon { background: #ffb15c; }

.navcat-subs { display: flex; flex-direction: column; gap: 5px; margin-left: 40px; }
.navcat-subs a {
  color: var(--accent-hover);
  font-size: 0.83rem;
  margin: 0;
  opacity: 0.85;
}
.navcat-subs a:hover { opacity: 1; text-decoration: underline; color: var(--accent-hover); }

@media (max-width: 900px) {
  .navcat-wrap { margin-left: 0; }
  .navcat-toggle { padding: 10px 4px; }
  .navcat-menu {
    position: static;
    width: 100%;
    max-width: none;
    max-height: none;
    box-shadow: none;
    margin-top: 4px;
    margin-bottom: 6px;
  }
  .navcat-grid { grid-template-columns: 1fr; }
  .navcat-subs { margin-left: 30px; }
}

/* ==========================================================================
   Éditeur visuel BBCode (barre d'outils + aperçu) — /upload, /edit,
   commentaires de /torrent/{slug}. Construit dynamiquement par
   static/bbcode-editor.js autour de tout <textarea class="bbcode-editor">.
   ========================================================================== */
.bbcode-editor-wrap {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg);
  margin: 6px 0 4px;
}

.bbcode-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 2px;
  padding: 6px 8px;
  background: var(--panel-2);
  border-bottom: 1px solid var(--border);
}
.bbcode-toolbar button {
  background: none;
  border: none;
  color: var(--muted);
  width: 30px;
  height: 30px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.82rem;
  padding: 0;
  margin: 0;
}
.bbcode-toolbar button:hover { background: var(--panel-3); color: var(--text); }
.bbcode-sep { width: 1px; align-self: stretch; background: var(--border); margin: 4px 4px; }
.bbcode-toolbar-spacer { flex: 1; min-width: 6px; }

.bbcode-color-btn {
  position: relative;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  cursor: pointer;
  margin: 0;
}
.bbcode-color-btn:hover { background: var(--panel-3); color: var(--text); }
.bbcode-color-btn input[type=color] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
  padding: 0;
  border: none;
}

.bbcode-mode-btn.active { background: color-mix(in srgb, var(--accent) 20%, transparent); color: var(--accent); }

.bbcode-editor-wrap textarea {
  display: block;
  width: 100%;
  box-sizing: border-box;
  border: none;
  border-radius: 0;
  margin: 0;
  resize: vertical;
  background: var(--bg);
}
.bbcode-editor-wrap textarea:focus { outline: none; box-shadow: none; }

.bbcode-preview {
  padding: 12px 14px;
  min-height: 90px;
  color: var(--text);
  font-size: 0.92rem;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.bbcode-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 10px;
  background: var(--panel-2);
  border-top: 1px solid var(--border);
  font-size: 0.72rem;
  color: var(--muted);
}
.bbcode-footer-hint { cursor: help; display: flex; align-items: center; gap: 6px; }
.bbcode-counter { white-space: nowrap; }

/* ===== Communauté : Blog / Wiki / Teams ===== */

.community-menu-wrap { margin-left: 18px; }
.community-menu { width: 230px; padding: 10px; }
.community-menu .navcat-quicklinks {
  flex-direction: column;
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
  gap: 6px;
}
.community-menu .navcat-quicklinks a { width: 100%; }

.community-page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.community-page-head h1 { margin: 0; }

/* Blog */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  grid-auto-rows: 200px;
  align-items: start;
  gap: 18px;
}
.blog-card {
  display: block;
  position: relative;
  height: 200px;
  border-radius: 16px;
  overflow: hidden;
  background: var(--panel-2) center/cover no-repeat;
  border: 1px solid var(--border);
  color: var(--text);
}
.blog-card-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 16px;
  background: linear-gradient(180deg, rgba(0,0,0,0) 30%, rgba(0,0,0,0.85) 100%);
}
.blog-card-overlay h2 { margin: 0 0 8px; font-size: 1.1rem; color: #fff; }
.blog-card-overlay h2 a { color: inherit; text-decoration: none; }
.blog-card-overlay h2 a.stretched-link::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.blog-card-meta { display: flex; justify-content: space-between; align-items: center; font-size: 0.8rem; color: #d8dbe3; }
.blog-card-meta a { position: relative; z-index: 2; }

.blog-article-cover { width: 100%; max-height: 360px; object-fit: cover; border-radius: 16px; margin-bottom: 18px; }
.blog-article-meta { color: var(--muted); margin-bottom: 18px; }
.blog-article-body { font-size: 1rem; line-height: 1.7; }

/* Wiki */
.wiki-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 4px; }
.wiki-list li a {
  display: block;
  padding: 12px 16px;
  border-radius: 10px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--text);
}
.wiki-list li a:hover { background: var(--panel-3); }
.wiki-list li a i { color: var(--accent); margin-right: 8px; }

/* Teams : grille de cartes (inspirée des pages de scène type "Monument du P2P") */
.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}
.team-card {
  display: block;
  border-radius: 16px;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--text);
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.team-card:hover { transform: translateY(-2px); border-color: var(--accent); }
.team-card-banner {
  height: 110px;
  background: linear-gradient(135deg, var(--panel-3), var(--panel-2)) center/cover no-repeat;
  position: relative;
}
.team-card-count {
  position: absolute;
  top: 10px;
  right: 10px;
  background: color-mix(in srgb, var(--orange) 25%, #000 55%);
  color: var(--orange);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--orange) 50%, transparent);
}
.team-card-body { padding: 16px; }
.team-card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.team-card-logo {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}
.team-card-logo img { width: 100%; height: 100%; object-fit: cover; }
.team-card-logo i { color: var(--accent); font-size: 1.2rem; }
.team-card-name { font-weight: 800; font-size: 1.05rem; }
.team-card-sub { display: flex; align-items: center; gap: 8px; font-size: 0.8rem; margin-top: 2px; }

.team-tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 20%, transparent);
  color: var(--accent-hover);
  font-weight: 700;
  font-size: 0.72rem;
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
}
.team-tag-pill-link { text-decoration: none; }
.team-tag-pill-nav { margin-left: 10px; }
.team-tag-logo { width: 14px; height: 14px; border-radius: 4px; object-fit: cover; }

.team-card-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.team-stat {
  background: var(--panel-2);
  border-radius: 10px;
  padding: 8px 4px;
  text-align: center;
}
.team-stat-value { display: block; font-weight: 800; color: var(--text); font-size: 1rem; }
.team-stat-seed .team-stat-value { color: var(--green); }
.team-stat-label { display: block; font-size: 0.65rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; margin-top: 2px; }
.team-card-foot { margin-top: 12px; font-size: 0.78rem; }

.team-detail-stats { max-width: 460px; margin-bottom: 22px; }

/* Team : page détail */
.team-hero {
  border-radius: 18px;
  background: linear-gradient(135deg, var(--panel-3), var(--panel-2)) center/cover no-repeat;
  border: 1px solid var(--border);
  margin-bottom: 20px;
  overflow: hidden;
}
.team-hero-overlay {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 22px;
  background: linear-gradient(90deg, rgba(0,0,0,0.55), rgba(0,0,0,0.15));
}
.team-hero-overlay h1 { margin: 0 0 4px; display: flex; align-items: center; gap: 10px; color: #fff; }
.team-hero-logo {
  width: 68px;
  height: 68px;
  border-radius: 16px;
  background: var(--panel);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}
.team-hero-logo img { width: 100%; height: 100%; object-fit: cover; }
.team-hero-logo i { font-size: 1.6rem; color: var(--accent); }
.team-hero-actions { margin-left: auto; }

.team-member-list { list-style: none; padding: 0; margin: 0 0 14px; display: flex; flex-direction: column; gap: 8px; }
.team-member-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--panel-2);
  border: 1px solid var(--border);
}
.team-leader-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--orange);
  font-size: 0.75rem;
  font-weight: 700;
}
.team-admin-hint { font-size: 0.7rem; margin-left: 4px; }

.avatar-big-static { cursor: default; }

.edit-current-image {
  display: block;
  max-width: 100%;
  max-height: 160px;
  border-radius: 10px;
  margin-bottom: 8px;
  border: 1px solid var(--border);
}
.edit-current-logo { max-height: 80px; width: auto; }

/* ==========================================================================
   Header centré (nav + barre de stats)
   ========================================================================== */
@media (min-width: 901px) {
  .topbar-inner { gap: 24px; }
  .topbar-inner nav {
    flex: 1 1 auto;
    justify-content: center;
    gap: 8px 20px;
  }
  .topbar-inner nav > * { margin-left: 0; }
  .topbar-inner nav > .nav-username { margin-right: 0; }
}
@media (min-width: 701px) {
  .statsbar { justify-content: center; text-align: center; }
}

/* ==========================================================================
   Admin : badges (cartes lisibles)
   ========================================================================== */
.admin-count {
  margin-left: auto;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 10px;
}

.badge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 16px;
  margin-top: 18px;
}
.badge-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px 18px 18px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.badge-card-new { border-style: dashed; background: transparent; }
.badge-card-preview {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 10px 14px;
  padding-right: 52px;
  font-size: 1.05rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.badge-card-preview-new { color: var(--muted); font-size: 0.95rem; }
.badge-delete-form { position: absolute; top: 16px; right: 18px; margin: 0; }

.badge-form {
  display: grid;
  grid-template-columns: 70px 1fr 70px;
  gap: 12px;
  align-items: end;
}
.badge-field { display: flex; flex-direction: column; gap: 5px; margin: 0; min-width: 0; }
.badge-field > span {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.badge-field input[type=text], .badge-field select { width: 100%; margin: 0; }
.badge-field input[type=color] {
  width: 100%;
  height: 38px;
  padding: 2px;
  margin: 0;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
}
.badge-field-icon input { text-align: center; }
.badge-field-pos, .badge-field-effect { grid-column: span 3; }
.badge-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; }

.btn-save { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }

/* Tableau utilisateurs : colonne badges un peu plus aérée */
.badge-toggle-cell { max-width: 240px; gap: 6px; }

@media (max-width: 700px) {
  .badge-grid { grid-template-columns: 1fr; }
}

/* ==========================================================================
   Admin : journal fail2ban
   ========================================================================== */
.nowrap { white-space: nowrap; }
.f2b-stats { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0; }
.f2b-stat {
  padding: 6px 12px;
  font-size: 0.85rem;
  color: var(--muted);
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 999px;
}
.f2b-stat strong { color: var(--text); }
.f2b-stat.f2b-ban strong { color: var(--red); }
.f2b-stat.f2b-unban strong { color: var(--green); }
.f2b-stat.f2b-found strong { color: var(--orange); }
.f2b-banned { margin: 0 0 14px; font-size: 0.88rem; line-height: 2; }
.f2b-banned i { color: var(--red); margin-right: 4px; }
.f2b-banned code {
  padding: 2px 8px;
  margin-right: 4px;
  background: color-mix(in srgb, var(--red) 14%, var(--panel-2));
  border: 1px solid color-mix(in srgb, var(--red) 40%, var(--border));
  border-radius: 6px;
}
.f2b-filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.f2b-filters input[type=text] { flex: 1 1 240px; max-width: 360px; margin: 0; }
.f2b-filters select { width: auto; margin: 0; }
.f2b-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.f2b-table { font-size: 0.85rem; }
.f2b-table td { padding: 6px 10px; }
.f2b-row.f2b-ban td:nth-child(3) { color: var(--red); font-weight: 600; }
.f2b-row.f2b-unban td:nth-child(3) { color: var(--green); font-weight: 600; }
.f2b-row.f2b-found td:nth-child(3) { color: var(--orange); }
.f2b-archives { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.f2b-archives li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  padding: 10px 14px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.f2b-arch-name { font-weight: 600; }
.f2b-arch-name i { color: var(--accent); margin-right: 6px; }
.f2b-arch-actions { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; }
.f2b-arch-actions .icon-btn { text-decoration: none; }


/* --- Logo / pied de page bicolores (Tracker + Pro) --- */
.brand-a { color: var(--text); }
.brand-b { color: var(--accent); }
.brand { font-weight: 800; letter-spacing: -0.01em; }
footer .brand-a, footer .brand-b { font-weight: 700; }
footer .brand-a { color: var(--text); }
.footer-item { white-space: nowrap; }
.footer-sep { margin: 0 8px; opacity: 0.5; }
.footer-ip { background: var(--panel-2); padding: 1px 6px; border-radius: 6px; font-size: 0.85em; }
@media (max-width: 600px) {
  footer { display: flex; flex-direction: column; gap: 4px; align-items: center; }
  .footer-sep { display: none; }
}

/* --- Réactions émoji sur les messages de shoutbox (façon Discord) --- */
.shout-line { position: relative; }
/* Bouton « ajouter une réaction » : visible au survol du message, collé au
   texte (aucune réaction encore) ou au bout des pastilles (déjà des
   réactions), comme sur Discord. */
.shout-react-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.85rem;
  line-height: 1;
  opacity: 0;
  transition: opacity 0.12s ease, color 0.12s ease;
}
.shout-react-btn:hover { color: var(--accent-hover); border-color: var(--muted); }
.shout-line:hover .shout-react-btn, .shout-react-btn:focus-visible { opacity: 1; }
.shout-react-inline { padding: 2px 7px; margin-left: 6px; }
.shout-react-inrow { padding: 0 8px; min-height: 22px; }
@media (hover: none) { .shout-react-btn { opacity: 0.7; } }
.shout-reactions {
  flex: 0 0 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  /* Collé sous le message, aligné avec le pseudo (colonne de l'heure = 34px + 8px). */
  margin: -3px 0 0 42px;
}
.shout-reaction {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0 7px;
  min-height: 22px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--muted);
  font-size: 0.85rem;
  cursor: pointer;
  line-height: 1.2;
}
.shout-reaction:hover { border-color: var(--muted); }
.shout-reaction-emoji { font-size: 1rem; }
.shout-reaction-count { font-weight: 600; font-size: 0.8rem; }
.shout-reaction.mine {
  background: color-mix(in srgb, var(--accent) 20%, transparent);
  border-color: var(--accent);
  color: var(--accent-hover);
}
.react-panel {
  position: fixed;
  bottom: auto;
  width: 300px;
  max-height: 220px;
  z-index: 200;
}
@media (max-width: 600px) {
  .react-panel { width: calc(100vw - 16px); }
}

/* Colonne de l'heure à largeur fixe : tous les pseudos (et les réactions
   dessous) démarrent au même endroit. */
.shout-time { display: inline-block; min-width: 34px; }
@media (max-width: 600px) { .shout-reactions { margin-left: 42px; } }

/* "Ton emoji dans le chat" : la barre est tout en haut du cadre (qui coupe
   ce qui dépasse, overflow: hidden), donc le sélecteur s'ouvre vers le BAS
   au lieu de vers le haut, sinon il était tronqué. */
.my-emoji-bar .emoji-panel {
  top: calc(100% + 6px);
  bottom: auto;
  left: 0;
  width: 300px;
  max-width: calc(100vw - 48px);
  max-height: 260px;
  grid-template-columns: repeat(8, 1fr);
  z-index: 60;
}
.my-emoji-bar .emoji-panel.hidden { display: none; }

/* Version de la release affichée après le titre, dans la couleur d'accent choisie dans « Apparence » */
.tver { color: var(--accent); font-weight: 700; }

/* Fiche de torrent dans la shoutbox (lien interne /torrent/<uuid>) :
   affiche en haut, texte en dessous. */
.shout-cards { display: flex; flex-wrap: wrap; gap: 8px; width: 100%; margin: 4px 0; }
.shout-torrent-card {
  display: flex; flex-direction: column;
  width: 280px; max-width: 100%;
  background: var(--panel-2); border: 1px solid var(--border); border-top: 3px solid var(--accent);
  border-radius: 10px; overflow: hidden; text-decoration: none; color: var(--text);
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.shout-torrent-card:hover { border-color: var(--accent); transform: translateY(-1px); }
.shout-torrent-card img, .shout-torrent-card .stc-noposter {
  width: 100%; height: 160px; object-fit: cover; display: block;
}
.shout-torrent-card .stc-noposter {
  display: flex; align-items: center; justify-content: center;
  background: var(--panel-3); color: var(--muted); font-size: 2rem;
}
.shout-torrent-card .stc-body { display: flex; flex-direction: column; gap: 3px; padding: 10px 12px; min-width: 0; }
.shout-torrent-card .stc-title { font-weight: 600; font-size: 0.92rem; overflow-wrap: anywhere; }
.shout-torrent-card .stc-meta, .shout-torrent-card .stc-seed { font-size: 0.78rem; color: var(--muted); }

/* ====== Shoutbox : discussions en cards (façon Discord) ====== */
.sx-list { display: flex; flex-direction: column; gap: 10px; }
.sx-list > .muted { margin: 0; }
.sx-item { position: relative; }
.sx-row { display: flex; align-items: flex-start; gap: 10px; }
.sx-avatar {
  flex: 0 0 34px; width: 34px; height: 34px; border-radius: 50%;
  overflow: hidden; display: flex; align-items: center; justify-content: center;
  background: var(--panel-3); color: var(--muted); font-weight: 700; font-size: 0.9rem;
  text-decoration: none; margin-top: 2px;
}
.sx-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sx-main { flex: 1; min-width: 0; }
.sx-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 3px; }
.sx-name { font-weight: 600; color: var(--accent-hover); text-decoration: none; font-size: 0.9rem; }
.sx-emoji { margin: 0; }
.sx-bubble {
  display: inline-block; max-width: min(100%, 680px);
  background: color-mix(in srgb, var(--accent) 10%, var(--panel-2));
  border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--border));
  border-radius: 4px 14px 14px 14px;
  padding: 8px 12px 6px;
  font-size: 0.92rem; line-height: 1.4;
  overflow-wrap: anywhere;
}
.sx-text { white-space: pre-wrap; }
.sx-bubble .shout-attachment-wrap { margin: 6px 0 2px; }
.sx-foot { margin-top: 4px; font-size: 0.72rem; color: var(--muted); }
.shout-edited { font-style: italic; }
.sx-bubble .shout-reactions { margin: 8px 0 0; flex: none; }

/* Actions au survol (réagir / modifier / supprimer / bannir) : la petite
   barre apparaît juste à côté de la card du message, pas au bord de la page. */
.sx-bubble-wrap { display: flex; align-items: flex-start; gap: 6px; max-width: 100%; }
.sx-bubble-wrap .sx-bubble { flex: 0 1 auto; min-width: 0; }
.sx-actions {
  flex: 0 0 auto;
  display: inline-flex; align-items: center; gap: 2px;
  padding: 2px 4px; border-radius: 8px;
  background: var(--panel); border: 1px solid var(--border);
  opacity: 0; transition: opacity 0.12s ease;
}
.sx-bubble-wrap:hover .sx-actions, .sx-actions:focus-within { opacity: 1; }
.sx-actions .shout-react-btn { opacity: 1; background: none; border-color: transparent; padding: 2px 6px; }
.sx-actions .shout-react-btn:hover { background: var(--panel-2); }
.sx-actions form.inline { display: inline-flex; margin: 0; }
/* Réactions dans la card : le bouton « + émoji » est toujours visible */
.sx-bubble .shout-reactions .shout-react-btn { opacity: 1; }
@media (hover: none) { .sx-actions { opacity: 1; } .sx-bubble-wrap { flex-wrap: wrap; } }

/* Rôle affiché à la place de l'emoji */
.role-pill {
  display: inline-flex; align-items: center;
  padding: 0 8px; min-height: 18px; border-radius: 999px;
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.02em;
  border: 1px solid var(--border); background: var(--panel-3); color: var(--text);
}
.role-pill.role-admin { color: #f87171; background: rgba(239,68,68,0.14); border-color: rgba(239,68,68,0.55); }
.role-pill.role-moderator { color: #a78bfa; background: rgba(139,92,246,0.14); border-color: rgba(139,92,246,0.55); }
.role-pill.role-helper { color: #34d399; background: rgba(16,185,129,0.14); border-color: rgba(16,185,129,0.55); }

/* @mentions */
.mention {
  display: inline-block; padding: 0 4px; border-radius: 5px;
  background: color-mix(in srgb, var(--accent) 22%, transparent);
  color: var(--accent-hover); font-weight: 600; text-decoration: none;
}
.mention:hover { background: color-mix(in srgb, var(--accent) 38%, transparent); }
.mention.mention-me { background: rgba(250,204,21,0.25); color: #fde047; }
.sx-item.sx-mentioned > .sx-row .sx-bubble {
  border-color: #facc15;
  box-shadow: inset 3px 0 0 #facc15;
}
.mention-box {
  position: fixed; z-index: 220; max-height: 280px; overflow-y: auto;
  background: var(--panel); border: 1px solid var(--border); border-radius: 10px;
  padding: 4px; box-shadow: 0 12px 30px rgba(0,0,0,0.5);
}
.mention-box.hidden { display: none; }
.mention-opt {
  display: flex; align-items: center; gap: 8px; width: 100%;
  background: none; border: none; border-radius: 6px; margin: 0;
  padding: 6px 8px; color: var(--text); cursor: pointer; text-align: left; font-size: 0.9rem;
}
.mention-opt.active, .mention-opt:hover { background: color-mix(in srgb, var(--accent) 22%, transparent); }
.mention-av {
  flex: 0 0 24px; width: 24px; height: 24px; border-radius: 50%; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  background: var(--panel-3); color: var(--muted); font-size: 0.75rem; font-weight: 700;
}
.mention-av img { width: 100%; height: 100%; object-fit: cover; }
.mention-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Premier message d'un membre : bandeau « accueillez-le dignement » */
.sx-item.sx-first {
  border: 1px solid rgba(251,146,60,0.55);
  border-radius: 12px; overflow: hidden;
  background: linear-gradient(135deg, rgba(220,38,38,0.10), rgba(124,58,237,0.10));
}
.sx-first-banner {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 12px;
  background: linear-gradient(90deg, rgba(220,38,38,0.35), rgba(124,58,237,0.35));
  border-bottom: 1px solid rgba(251,146,60,0.35);
  font-size: 0.82rem; font-weight: 700; color: #fde68a;
}
.sx-first-ico { font-size: 1.05rem; }
.sx-first-text { flex: 1; min-width: 0; }
.sx-first-banner .mention { background: none; padding: 0; color: #f9a8d4; }
.sx-first-spark { font-size: 1.1rem; }
.sx-item.sx-first > .sx-row { padding: 8px 12px 10px; }

/* Modification d'un message */
.sx-edit { display: flex; flex-direction: column; gap: 6px; min-width: min(420px, 70vw); }
.sx-edit-input { margin: 0; width: 100%; }
.sx-edit-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sx-edit-actions button { margin: 0; }
.sx-edit-hint { font-size: 0.72rem; }

@media (max-width: 600px) {
  .sx-avatar { flex-basis: 28px; width: 28px; height: 28px; }
  .sx-bubble { max-width: 100%; }
  .sx-first-banner { font-size: 0.75rem; }
}

/* Bandeau « non testé » de la fiche torrent : version compacte (titre en gras
   + explication en petit dessous). */
.flash.flash-compact { display: flex; align-items: center; gap: 10px; padding: 6px 12px; margin-bottom: 12px; }
.flash-compact-text { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.flash-compact-text strong { font-size: 0.85rem; }
.flash-compact-text small { font-size: 0.74rem; opacity: 0.85; }

/* Configuration requise (fiche torrent) */
.sysreq-wrap { overflow-x: auto; }
.sysreq-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.sysreq-table th, .sysreq-table td { padding: 8px 12px; border: 1px solid var(--border); text-align: left; vertical-align: top; }
.sysreq-table thead th { background: color-mix(in srgb, var(--accent) 14%, var(--panel-2)); color: var(--accent-hover); border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.sysreq-table tbody th { width: 1%; white-space: nowrap; font-weight: 700; background: var(--panel-2); }
.sysreq-table td { overflow-wrap: anywhere; }

/* ====== Bandeaux du site (info / normal / urgent), tout en haut des pages ====== */
.site-banner {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 8px 16px; text-align: center; font-size: 0.9rem; line-height: 1.35;
  border-bottom: 1px solid transparent;
}
.site-banner span { min-width: 0; overflow-wrap: anywhere; }
.site-banner-info   { background: rgba(59,130,246,0.20);  border-bottom-color: rgba(59,130,246,0.55);  color: #bfdbfe; }
.site-banner-normal { background: rgba(16,185,129,0.20);  border-bottom-color: rgba(16,185,129,0.55);  color: #a7f3d0; }
.site-banner-urgent { background: rgba(239,68,68,0.28);   border-bottom-color: rgba(239,68,68,0.70);   color: #fee2e2; font-weight: 700; }

/* Gestion des bandeaux dans /admin */
.bn-lvl-info { color: #60a5fa; } .bn-lvl-normal { color: #34d399; } .bn-lvl-urgent { color: #f87171; }
.banner-admin {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  padding: 8px 10px; margin-bottom: 8px; border-radius: 8px;
  background: var(--panel-2); border: 1px solid var(--border); border-left-width: 4px;
}
.banner-admin-info   { border-left-color: #3b82f6; }
.banner-admin-normal { border-left-color: #10b981; }
.banner-admin-urgent { border-left-color: #ef4444; }
.banner-admin.banner-off { opacity: 0.6; }
.banner-admin-form { display: flex; flex: 1 1 420px; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; }
.banner-admin-form input[type="text"] { flex: 1 1 260px; margin: 0; }
.banner-admin-form select, .banner-admin-form button { margin: 0; }
.banner-admin-new { margin-top: 12px; }
.banner-admin .inline button { margin: 0; }

/* Header : pseudo + badges (emoji) + rang dans un seul bloc, comme la pastille de stats */
.identity-pill { gap: 6px; padding: 4px 4px 4px 12px; }
.identity-pill a.nav-username { margin: 0; padding: 0; font-weight: 700; color: var(--text); }
.identity-pill a.nav-username:hover { color: var(--accent-hover); }
.identity-pill .badge-pill, .identity-pill .grade-pill { margin: 0; align-self: center; }
.identity-pill .grade-pill { padding: 4px 10px; }
@media (max-width: 900px) {
  nav .identity-pill { background: var(--panel-2); padding: 4px 4px 4px 12px; margin-top: 10px; align-self: flex-start; flex-wrap: wrap; }
  nav .identity-pill a { padding: 0; }
  nav .identity-pill .badge-pill, nav .identity-pill .grade-pill { margin: 0; align-self: center; }
}


/* ====== Freeleech : bandeau cliquable + popup détaillé ====== */

.fl-modal { position: fixed; inset: 0; z-index: 2000; display: flex; align-items: center; justify-content: center; padding: 16px; }
.fl-modal[hidden] { display: none; }
.fl-modal-backdrop {
  position: absolute; inset: 0; background: rgba(5,8,16,0.55);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.fl-dialog {
  position: relative; width: 100%; max-width: 540px; max-height: calc(100vh - 32px); overflow-y: auto;
  background: #0f1426; color: #e6e8ec; border: 1px solid #263050; border-radius: 16px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.6);
  animation: fl-pop .18s ease-out;
}
@keyframes fl-pop { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
html[data-reduce-motion] .fl-dialog { animation: none; }
.fl-dialog-head { display: flex; align-items: center; gap: 14px; padding: 18px 20px; border-bottom: 1px solid #263050; }
.fl-dialog-icon {
  flex: none; width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 55%, #000)); color: #fff; font-size: 1.4rem;
}
.fl-dialog-titles { flex: 1; min-width: 0; }
.fl-dialog-titles h2 { margin: 0; font-size: 1.1rem; overflow-wrap: anywhere; }
.fl-remaining { color: #ff6b6b; font-size: 0.85rem; }
.fl-close { flex: none; background: none; border: 0; color: #9aa3b8; font-size: 1.2rem; cursor: pointer; padding: 6px; margin: 0; }
.fl-close:hover { color: #fff; }
.fl-dialog-body { padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; }
.fl-message {
  padding: 14px 16px; border-radius: 10px; line-height: 1.5; white-space: pre-line; overflow-wrap: anywhere;
  background: rgba(239,68,68,0.10); border: 1px solid rgba(239,68,68,0.35);
}
.fl-perks { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.fl-perk { padding: 14px 10px; border-radius: 10px; text-align: center; display: flex; flex-direction: column; gap: 4px; }
.fl-perk strong { font-size: 1.6rem; letter-spacing: .02em; }
.fl-perk small { font-size: 0.72rem; }
.fl-perk-down { background: rgba(16,185,129,0.12); border: 1px solid rgba(16,185,129,0.40); color: #34d399; }
.fl-perk-up   { background: rgba(59,130,246,0.12); border: 1px solid rgba(59,130,246,0.40); color: #60a5fa; }
.fl-dates { padding: 14px 16px; border-radius: 10px; background: #1a2036; }
.fl-dates-title { font-weight: 600; margin-bottom: 10px; }
.fl-dates-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.fl-dates-grid span { display: block; color: #8b93a1; font-size: 0.82rem; margin-bottom: 2px; }
.fl-dates-grid strong { font-size: 0.92rem; font-weight: 600; }
.fl-explain { padding: 14px 16px; border-radius: 10px; background: rgba(245,158,11,0.08); border: 1px solid rgba(245,158,11,0.35); color: #fbbf24; }
.fl-explain-title { font-weight: 600; margin-bottom: 6px; color: #fcd34d; }
.fl-explain p { margin: 0; font-size: 0.88rem; line-height: 1.5; }
.fl-dialog-foot { padding: 14px 20px; border-top: 1px solid #263050; display: flex; justify-content: flex-end; }
.fl-ok { margin: 0; background: #10d9a0; color: #04281e; border: 0; border-radius: 8px; padding: 8px 18px; font-weight: 700; cursor: pointer; }
.fl-ok:hover { filter: brightness(1.1); }
body.fl-modal-open { overflow: hidden; }
@media (max-width: 520px) {
  .fl-perks, .fl-dates-grid { grid-template-columns: 1fr; }
}

/* Formulaire freeleech / notifications dans /admin */
.fl-form { display: flex; flex-direction: column; gap: 10px; margin: 10px 0 14px; }
.fl-form input[type="text"], .fl-form textarea, .fl-form select, .fl-form input[type="datetime-local"], .fl-form input[type="number"] { margin: 0; }
.fl-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.fl-row label { display: flex; align-items: center; gap: 6px; }
.fl-check { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.fl-check input { width: auto; margin: 0; }
.fl-hint { margin: 0; font-size: 0.82rem; }
.fl-actions { display: flex; gap: 8px; }
.fl-actions button { margin: 0; }
.fl-popup-opts { display: flex; flex-direction: column; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--panel-2); }
.fl-popup-opts[open] > summary { margin-bottom: 10px; }
.fl-popup-opts > summary { cursor: pointer; font-weight: 600; }
.fl-popup-opts[open] { display: flex; }
.fl-popup-opts > *:not(summary) { margin-top: 8px; }

.notif-admin {
  display: flex; align-items: flex-start; gap: 10px; padding: 8px 10px; margin-bottom: 8px; border-radius: 8px;
  background: var(--panel-2); border: 1px solid var(--border); border-left-width: 4px;
}
.notif-admin-body { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.notif-admin-info    { border-left-color: #3b82f6; }
.notif-admin-success { border-left-color: #10b981; }
.notif-admin-warning { border-left-color: #f59e0b; }
.notif-admin-urgent  { border-left-color: #ef4444; }
.notif-admin .inline button { margin: 0; }

/* ====== Cloche de notifications (en-tête) ====== */
.nav-icons { display: inline-flex; align-items: center; gap: 8px; margin-left: 14px; }
.notif-wrap { position: relative; display: inline-flex; }
.notif-bell {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; margin: 0; padding: 0; border-radius: 10px; cursor: pointer;
  background: var(--panel-2); border: 1px solid var(--border); color: var(--text); font-size: 1rem;
}
.notif-bell:hover, .notif-bell[aria-expanded="true"] { background: var(--panel-3); color: var(--accent-hover); }
.notif-bell.has-unread i { animation: notif-ring 1.6s ease-in-out 1; transform-origin: 50% 0; }
html[data-reduce-motion] .notif-bell.has-unread i { animation: none; }
@keyframes notif-ring { 0%,100% { transform: rotate(0); } 15% { transform: rotate(14deg); } 30% { transform: rotate(-12deg); } 45% { transform: rotate(8deg); } 60% { transform: rotate(-6deg); } }
.notif-badge {
  position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  background: #ef4444; color: #fff; font-size: 0.7rem; font-weight: 700; line-height: 18px; text-align: center;
  box-shadow: 0 0 0 2px var(--bg, #0f1115);
}
.notif-badge[hidden] { display: none; }
.notif-panel {
  position: fixed; z-index: 1500; width: 380px; max-width: calc(100vw - 24px); max-height: min(70vh, 520px);
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--panel); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 16px 48px rgba(0,0,0,0.45);
}
.notif-panel[hidden] { display: none; }
.notif-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--border); font-weight: 700; }
.notif-readall { background: none; border: 0; margin: 0; padding: 0; color: var(--accent-hover); font-size: 0.8rem; font-weight: 600; cursor: pointer; }
.notif-readall:hover { text-decoration: underline; }
.notif-readall[disabled] { opacity: .4; cursor: default; text-decoration: none; }
.notif-list { overflow-y: auto; }
.notif-empty { margin: 0; padding: 22px 14px; text-align: center; color: var(--muted); font-size: 0.9rem; }
.notif-item {
  display: flex; gap: 10px; padding: 11px 14px; border-bottom: 1px solid var(--border);
  color: var(--text); text-decoration: none; margin: 0;
}
nav a.notif-item { margin-left: 0; }
.notif-item:last-child { border-bottom: 0; }
a.notif-item:hover { background: var(--panel-2); color: var(--text); }
.notif-item.is-unread { background: color-mix(in srgb, var(--accent) 9%, transparent); }
.notif-ico { flex: none; width: 30px; height: 30px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 0.85rem; }
.notif-lvl-info    .notif-ico { background: rgba(59,130,246,0.18);  color: #60a5fa; }
.notif-lvl-success .notif-ico { background: rgba(16,185,129,0.18);  color: #34d399; }
.notif-lvl-warning .notif-ico { background: rgba(245,158,11,0.18);  color: #fbbf24; }
.notif-lvl-urgent  .notif-ico { background: rgba(239,68,68,0.22);   color: #f87171; }
.notif-content { min-width: 0; flex: 1; }
.notif-title { font-weight: 600; font-size: 0.9rem; overflow-wrap: anywhere; }
.notif-text { margin-top: 2px; font-size: 0.82rem; color: var(--muted); white-space: pre-line; overflow-wrap: anywhere; }
.notif-time { margin-top: 3px; font-size: 0.74rem; color: var(--muted); opacity: .8; }
.notif-dot { flex: none; align-self: center; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }

.notif-toast {
  position: fixed; right: 16px; bottom: 16px; z-index: 1600; max-width: 340px; display: flex; gap: 10px; align-items: flex-start;
  padding: 12px 14px; border-radius: 12px; cursor: pointer; background: var(--panel); color: var(--text);
  border: 1px solid var(--border); border-left: 4px solid var(--accent); box-shadow: 0 12px 40px rgba(0,0,0,0.45);
}
.notif-toast strong { display: block; font-size: 0.9rem; }
.notif-toast span { font-size: 0.8rem; color: var(--muted); }

@media (max-width: 900px) {
  .nav-icons { margin: 10px 0 0; align-self: flex-start; }
  .notif-panel { left: 12px !important; right: 12px; width: auto; }
}

/* ====== Annonces longues (BBCode) dans la shoutbox ====== */
.sx-item.sx-rich .sx-bubble { display: block; max-width: min(100%, 860px); }
.sx-item.sx-rich .sx-bubble-wrap { display: flex; }
.sx-item.sx-rich .sx-bubble-wrap .sx-bubble { flex: 1 1 auto; }
.sx-rich-body { white-space: normal; line-height: 1.5; position: relative; }
.sx-rich-body:not(.expanded) { max-height: 340px; overflow: hidden; }
.sx-rich-body:not(.expanded):has(+ .sx-rich-toggle:not([hidden]))::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 70px; pointer-events: none;
  background: linear-gradient(to bottom, transparent, color-mix(in srgb, var(--accent) 10%, var(--panel-2)));
}
.sx-rich-toggle {
  display: block; margin: 8px 0 0; padding: 4px 14px; border-radius: 999px; cursor: pointer;
  background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent-hover);
  border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--border)); font-size: 0.82rem; font-weight: 600;
}
.sx-rich-toggle[hidden] { display: none; }
.sx-rich-toggle:hover { background: color-mix(in srgb, var(--accent) 28%, transparent); }
.sx-rich-body .bbcode-list { margin: 6px 0 10px; }


/* ====== Éclair freeleech (à droite de la cloche) : couleur = « Ton signal » choisi dans Apparence ====== */
.fl-bolt {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; margin: 0; padding: 0; border-radius: 10px; cursor: pointer;
  background: color-mix(in srgb, var(--accent) 12%, var(--panel-2));
  border: 1px solid color-mix(in srgb, var(--accent) 55%, var(--border));
  color: var(--accent); font-size: 1rem;
  animation: fl-bolt-pulse 1.8s ease-out infinite;
}
.fl-bolt i { animation: fl-bolt-flash 1.8s ease-in-out infinite; }
.fl-bolt:hover { background: color-mix(in srgb, var(--accent) 24%, var(--panel-2)); color: var(--accent-hover); }
@keyframes fl-bolt-pulse {
  0%   { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 65%, transparent); }
  70%  { box-shadow: 0 0 0 10px color-mix(in srgb, var(--accent) 0%, transparent); }
  100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 0%, transparent); }
}
@keyframes fl-bolt-flash { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.15); opacity: .8; } }
html[data-reduce-motion] .fl-bolt, html[data-reduce-motion] .fl-bolt i { animation: none; }
@media (prefers-reduced-motion: reduce) { .fl-bolt, .fl-bolt i { animation: none; } }


/* ====== Maintenance / saisons ====== */
.maint-strip {
  background: #7a1f1f; color: #fff; text-align: center; padding: 7px 14px; font-size: 0.85rem; font-weight: 600;
}
.maint-strip a { color: #ffd6d6; text-decoration: underline; margin-left: 8px; }
.season-toggle {
  background: none; border: 0; margin: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; opacity: .85;
}
.season-toggle:hover { opacity: 1; text-decoration: underline; }
#season-canvas { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 1000; pointer-events: none; }


/* Changement de pseudo (admin) */
.rename-notice { margin: 8px 0 12px; padding: 9px 14px; border-radius: 8px; font-size: 0.9rem; border: 1px solid; }
.rename-ok  { background: rgba(16,185,129,0.12); border-color: rgba(16,185,129,0.45); color: #34d399; }
.rename-err { background: rgba(239,68,68,0.12);  border-color: rgba(239,68,68,0.45);  color: #f87171; }
.rename-former { font-size: 0.72rem; margin-top: 2px; }

/* ====== Nouveautés repliable (accueil) ====== */
.changelog-toggle {
  display: inline-flex; align-items: center; gap: 8px; margin: 0; padding: 0; border: 0; background: none;
  color: var(--green); font: inherit; font-weight: 700; cursor: pointer; text-align: left;
}
.changelog-toggle:hover { filter: brightness(1.15); }
.changelog-head-version { display: none; font-size: 0.75rem; }
.changelog-chevron { font-size: 0.8rem; opacity: .8; transition: transform .2s ease; }
.changelog-panel.is-collapsed .changelog-chevron { transform: rotate(-90deg); }
.changelog-panel.is-collapsed .changelog-head-version { display: inline-block; }
.changelog-panel.is-collapsed { padding-top: 12px; padding-bottom: 12px; }
.changelog-panel.is-collapsed .changelog-panel-head { margin-bottom: 0; padding-bottom: 0; border-bottom: 0; }
.changelog-body[hidden] { display: none; }
.changelog-items code, .cl-preview code { background: var(--panel-2); padding: 1px 5px; border-radius: 4px; font-size: 0.85em; }

/* ====== Édition du changelog : légende, barre d'outils, aperçu ====== */
.md-legend { margin: 10px 0 14px; border: 1px solid var(--border); border-radius: 8px; background: var(--panel-2); padding: 8px 12px; }
.md-legend > summary { cursor: pointer; font-weight: 600; font-size: 0.9rem; }
.md-legend-table { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: 0.85rem; }
.md-legend-table td { padding: 5px 8px; border-top: 1px solid var(--border); vertical-align: top; }
.md-legend-table td:first-child { white-space: nowrap; width: 1%; }
.md-legend-note { font-size: 0.8rem; margin: 10px 0 2px; }
.cl-toolbar { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.cl-tool {
  margin: 0; padding: 4px 10px; font-size: 0.8rem; border-radius: 6px; cursor: pointer;
  background: var(--panel-2); color: var(--text); border: 1px solid var(--border);
}
.cl-tool:hover, .cl-tool.active { border-color: var(--accent); color: var(--accent-hover); }
.cl-preview { margin-top: 8px; padding: 10px 14px; border: 1px dashed var(--border); border-radius: 8px; }
.cl-preview[hidden] { display: none; }
.cl-preview h4 { margin: 10px 0 4px; font-size: 0.95rem; }
.cl-preview ul { margin: 0 0 4px; padding-left: 20px; color: var(--muted); font-size: 0.88rem; }
