/* ===== ToutFiveMFR — Modern Dark ===== */
:root {
  --primary-gradient: linear-gradient(135deg, #3a7bd5, #3a6073);
  --primary-1: #3a7bd5;
  --primary-2: #3a6073;
  --primary-glow: rgba(58,123,213,0.25);

  --bg-0: #0c0c10;
  --bg-1: #111116;
  --bg-2: #18181f;
  --bg-3: #202028;

  --border: rgba(255,255,255,0.06);
  --border-hover: rgba(255,255,255,0.14);
  --border-strong: rgba(255,255,255,0.11);

  --text: #f0f0f8;
  --text-dim: #9898b8;
  --text-mute: #50506a;

  --white: #ffffff;
  --danger: #ef4444;
  --danger-dim: rgba(239,68,68,0.15);
  --success: #22c55e;

  --radius: 14px;
  --radius-sm: 9px;
  --radius-xs: 6px;
  --shadow: 0 8px 40px rgba(0,0,0,0.6);
  --shadow-sm: 0 2px 12px rgba(0,0,0,0.4);
  --sidebar-w: 220px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  background: var(--bg-0);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select, textarea { font-family: inherit; }
.hidden { display: none !important; }

/* ===== Wavy background canvas ===== */
#wavyBg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* ===== Layout ===== */
.app { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; position: relative; z-index: 1; }

/* ===== Sidebar ===== */
.sidebar {
  background: rgba(10,10,14,0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-right: 1px solid var(--border);
  padding: 16px 10px;
  position: sticky; top: 0;
  height: 100vh;
  overflow-y: auto;
  display: flex; flex-direction: column;
}
.sidebar::-webkit-scrollbar { width: 0; }

.brand {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 8px 18px;
  margin-bottom: 6px;
}
.brand-logo-img { width: 36px; height: 36px; border-radius: 10px; object-fit: contain; flex-shrink: 0; }
.brand-title { font-weight: 700; font-size: 14.5px; letter-spacing: -0.3px; color: var(--white); }
.brand-sub { font-size: 10px; color: var(--text-mute); text-transform: uppercase; letter-spacing: 1.2px; }

/* Label section */
.cat-section-label {
  font-size: 9.5px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1.4px; color: var(--text-mute);
  padding: 4px 10px 8px;
  margin-top: 2px;
}

.cat-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }

.cat-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  color: var(--text-dim); font-size: 12.5px; font-weight: 500;
  text-align: left; width: 100%;
  position: relative;
  transition: background 0.15s, color 0.15s, transform 0.1s;
}
.cat-item:hover {
  background: rgba(255,255,255,0.05);
  color: var(--text);
  transform: translateX(2px);
}
.cat-item.active {
  background: var(--primary-gradient);
  color: var(--white);
  font-weight: 600;
  box-shadow: 0 4px 16px rgba(58,123,213,0.3);
  transform: none;
}

/* Icône wrapper stylisé */
.cat-icon {
  width: 30px; height: 30px;
  flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 8px;
  background: rgba(255,255,255,0.05);
  color: var(--text-mute);
  transition: background 0.15s, color 0.15s;
}
.cat-icon svg { width: 14px; height: 14px; }
.cat-item:hover .cat-icon {
  background: rgba(255,255,255,0.08);
  color: var(--text-dim);
}
.cat-item.active .cat-icon {
  background: rgba(255,255,255,0.2);
  color: var(--white);
}

/* Petite puce de comptage optionnelle */
.cat-count {
  margin-left: auto;
  font-size: 10px; font-weight: 700;
  color: var(--text-mute);
  background: rgba(255,255,255,0.05);
  padding: 1px 6px; border-radius: 999px;
}
.cat-item.active .cat-count {
  background: rgba(255,255,255,0.2);
  color: rgba(255,255,255,0.8);
}

/* ===== Sidebar extra buttons ===== */
.sidebar-extra-btns {
  display: flex; flex-direction: column; gap: 4px;
  margin-top: 10px; padding-top: 10px;
  border-top: 1px solid var(--border);
}
.sidebar-extra-btn {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 14px; border-radius: 10px;
  font-size: 13px; font-weight: 600; color: var(--text-dim);
  background: transparent; border: 1px solid transparent;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  cursor: pointer; width: 100%; text-align: left;
}
.sidebar-extra-btn:hover {
  background: var(--bg-3); color: var(--white);
  border-color: var(--border-strong);
}
.sidebar-extra-btn span:first-child { font-size: 16px; }

.sidebar-footer {
  margin-top: 14px; padding-top: 14px;
  border-top: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 6px;
}
.discord-btn {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 12px; border-radius: 10px;
  background: rgba(88,101,242,0.12);
  border: 1px solid rgba(88,101,242,0.2);
  color: #a5b4fc; font-size: 12px; font-weight: 600;
  transition: background 0.15s, border-color 0.15s;
  text-decoration: none;
}
.discord-btn:hover {
  background: rgba(88,101,242,0.22);
  border-color: rgba(88,101,242,0.4);
  color: #c7d2fe;
}
.discord-btn svg { flex-shrink: 0; }
.sidebar-stats {
  font-size: 11px; color: var(--text-mute);
  padding: 2px 4px;
  display: flex; gap: 6px; align-items: center;
}
.side-dot { opacity: 0.3; }
.side-link { color: var(--text-mute); transition: color 0.1s; }
.side-link:hover { color: var(--text-dim); }

/* ===== Main ===== */
.main { padding: 20px 28px 60px; min-width: 0; }

/* ===== Topbar ===== */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding-bottom: 18px; border-bottom: 1px solid var(--border); margin-bottom: 22px;
}
.search-wrap { flex: 1; max-width: 440px; position: relative; }
.search-wrap::before {
  content: '';
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  width: 15px; height: 15px;
  background: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='%2350506a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E") center/contain no-repeat;
  pointer-events: none;
}
#searchInput {
  width: 100%; background: var(--bg-2); border: 1px solid var(--border);
  color: var(--text); padding: 10px 14px 10px 36px;
  border-radius: var(--radius-sm); font-size: 13px; outline: none;
  transition: border 0.15s, background 0.15s;
}
#searchInput:focus { border-color: rgba(255,255,255,0.2); background: var(--bg-3); }
#searchInput::placeholder { color: var(--text-mute); }
.topbar-right { display: flex; align-items: center; gap: 10px; }

/* ===== Top 3 Podium ===== */
.top3-podium {
  display: flex; align-items: center; gap: 4px;
  background: var(--bg-2); border: 1px solid var(--border-strong);
  border-radius: 999px; padding: 4px 10px 4px 8px;
}
.top3-item {
  display: flex; align-items: center; gap: 5px;
  padding: 2px 6px 2px 2px;
  border-radius: 999px;
  transition: background 0.15s;
  cursor: default;
  position: relative;
}
.top3-item:not(:last-child)::after {
  content: '';
  display: block;
  width: 1px; height: 16px;
  background: var(--border);
  margin-left: 6px;
}
.top3-item:hover { background: var(--bg-3); }
.top3-medal { font-size: 13px; line-height: 1; }
.top3-item img {
  width: 24px; height: 24px; border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,0.12);
  object-fit: cover;
}
.top3-first img  { border-color: #f59e0b; box-shadow: 0 0 6px rgba(245,158,11,0.5); }
.top3-second img { border-color: #94a3b8; box-shadow: 0 0 6px rgba(148,163,184,0.4); }
.top3-third img  { border-color: #cd7f32; box-shadow: 0 0 6px rgba(205,127,50,0.4); }
.top3-pseudo { font-size: 11px; font-weight: 600; color: var(--white); max-width: 64px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top3-count { font-size: 10px; color: var(--text-mute); font-weight: 500; }
@media (max-width: 900px) { .top3-podium { display: none; } }

/* ===== Buttons ===== */
.btn {
  padding: 9px 16px; border-radius: var(--radius-sm);
  font-weight: 600; font-size: 13px;
  display: inline-flex; align-items: center; gap: 6px;
  cursor: pointer; transition: filter 0.1s, transform 0.06s, opacity 0.1s;
  white-space: nowrap;
}
.btn:active { transform: scale(0.97); }
.btn-primary {
  background: var(--primary-gradient); color: var(--white);
  box-shadow: 0 2px 12px var(--primary-glow);
}
.btn-primary:hover { filter: brightness(1.12); }
.btn-ghost {
  background: var(--bg-2); color: var(--text-dim);
  border: 1px solid var(--border-strong);
}
.btn-ghost:hover { background: var(--bg-3); color: var(--text); }
.btn-discord { background: #5865F2; color: var(--white); }
.btn-discord:hover { filter: brightness(1.1); }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-locked {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 12px; border-radius: var(--radius-sm); font-size: 12.5px; font-weight: 600;
  background: var(--bg-3); color: var(--text-mute); border: 1px solid var(--border);
  transition: all 0.1s;
}
.btn-locked:hover { background: rgba(88,101,242,0.12); color: #818cf8; border-color: rgba(88,101,242,0.3); }
.btn-dl, .btn-locked { display: inline-flex; align-items: center; gap: 6px; }
.btn-delete {
  display: flex; align-items: center; justify-content: center;
  padding: 8px 10px; border-radius: var(--radius-sm);
  background: transparent; color: var(--text-mute); border: 1px solid var(--border);
  transition: all 0.1s;
}
.btn-delete:hover { color: var(--danger); border-color: rgba(239,68,68,0.4); background: var(--danger-dim); }

/* ===== User chip ===== */
.user-chip {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 10px 4px 4px;
  background: var(--bg-2); border: 1px solid var(--border-strong); border-radius: 999px;
}
.user-chip img { width: 28px; height: 28px; border-radius: 50%; border: 1.5px solid rgba(255,255,255,0.15); }
.user-chip .pseudo { font-size: 13px; font-weight: 600; color: var(--white); }
.user-chip .logout { margin-left: 2px; font-size: 11px; color: var(--text-mute); transition: color 0.1s; }
.user-chip .logout:hover { color: var(--danger); }

/* ===== Hero ===== */
.hero {
  padding: 28px 32px;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 28px;
  position: relative; overflow: hidden;
}
.hero::after {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  background: radial-gradient(ellipse at 80% 50%, rgba(58,123,213,0.08) 0%, transparent 70%);
  pointer-events: none;
}
.hero h1 {
  font-size: 22px; font-weight: 700; margin-bottom: 8px;
  letter-spacing: -0.4px; color: var(--white); line-height: 1.3;
}
.hero-accent {
  background: var(--primary-gradient);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.hero p { color: var(--text-dim); max-width: 580px; font-size: 13.5px; }

/* ===== Filters bar ===== */
.filters-bar { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 18px; }
.filters-bar h2 { font-size: 16px; font-weight: 700; color: var(--white); }
.results-count { font-size: 11px; color: var(--text-mute); }

/* ===== Grid ===== */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(255px, 1fr)); gap: 16px; }

/* ===== Card ===== */
.card {
  background: var(--bg-1); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  display: flex; flex-direction: column;
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
  position: relative;
}
.card:hover {
  transform: translateY(-2px);
  border-color: var(--border-hover);
  box-shadow: var(--shadow-sm);
}

.card-img-wrap { position: relative; cursor: pointer; }
.card-img {
  aspect-ratio: 16/9; background: var(--bg-2);
  background-size: cover; background-position: center;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.card-img.placeholder { background: linear-gradient(135deg, var(--bg-2), var(--bg-3)); }
.placeholder-icon { opacity: 0.1; display: flex; align-items: center; justify-content: center; color: var(--white); }
.placeholder-icon svg { width: 48px; height: 48px; stroke-width: 1.2; }

.yt-play-overlay {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.28); opacity: 0; transition: opacity 0.15s;
}
.card-img-wrap:hover .yt-play-overlay { opacity: 1; }
.yt-play-overlay svg { filter: drop-shadow(0 2px 8px rgba(0,0,0,0.7)); }

.card-cat-badge {
  position: absolute; top: 8px; left: 8px;
  background: rgba(0,0,0,0.7); color: var(--white);
  font-size: 9.5px; font-weight: 700; letter-spacing: 0.8px; text-transform: uppercase;
  padding: 3px 8px; border-radius: 999px;
  backdrop-filter: blur(4px);
  pointer-events: none;
}
.card-preview-count {
  position: absolute; top: 8px; right: 8px;
  background: rgba(0,0,0,0.6); color: var(--text-dim);
  font-size: 9.5px; font-weight: 600; padding: 3px 7px; border-radius: 999px;
  backdrop-filter: blur(4px);
}

.card-body { padding: 13px; flex: 1; display: flex; flex-direction: column; }
.card-title {
  font-size: 14px; font-weight: 700; margin-bottom: 5px;
  color: var(--white); line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-clickable { cursor: pointer; }
.card-clickable:hover { color: rgba(255,255,255,0.75); }
.card-desc {
  font-size: 12px; color: var(--text-dim); margin-bottom: 10px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; flex: 1;
}
.card-author { display: flex; align-items: center; gap: 7px; margin-bottom: 10px; font-size: 11.5px; color: var(--text-mute); }
.card-author img { width: 20px; height: 20px; border-radius: 50%; }
.card-actions { display: flex; gap: 7px; margin-top: auto; }
.card-actions .btn { flex: 1; justify-content: center; padding: 8px; font-size: 12px; }
.card-meta { font-size: 11px; color: var(--text-mute); margin-top: 8px; display: flex; justify-content: space-between; gap: 6px; }
.meta-dl { display: inline-flex; align-items: center; gap: 3px; }

/* ===== Empty / Footer ===== */
.empty { text-align: center; padding: 60px 20px; color: var(--text-dim); }
.empty-icon { font-size: 36px; margin-bottom: 12px; opacity: 0.4; }
.empty h3 { margin-bottom: 6px; color: var(--white); font-size: 16px; }
.footer { margin-top: 60px; padding-top: 20px; border-top: 1px solid var(--border); font-size: 11px; color: var(--text-mute); text-align: center; }

/* ===== Modal base ===== */
.modal {
  position: fixed; inset: 0; z-index: 400;
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.8); backdrop-filter: blur(8px); }
.modal-card {
  position: relative; background: var(--bg-1);
  border: 1px solid var(--border-strong); border-radius: var(--radius);
  width: 100%; max-width: 480px;
  box-shadow: 0 32px 80px rgba(0,0,0,0.7);
  max-height: 90vh; overflow-y: auto;
}
.modal-card::-webkit-scrollbar { width: 3px; }
.modal-card::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 2px; }
.modal-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: 16px 18px; border-bottom: 1px solid var(--border); gap: 12px;
  position: sticky; top: 0; background: var(--bg-1); z-index: 1;
}
.modal-header h3 { font-size: 15px; font-weight: 700; color: var(--white); }
.modal-close {
  width: 26px; height: 26px; border-radius: var(--radius-xs);
  color: var(--text-mute); font-size: 13px;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.1s, color 0.1s; flex-shrink: 0;
}
.modal-close:hover { background: var(--bg-3); color: var(--text); }
.modal-body { padding: 16px 18px 20px; }
.modal-body label { display: flex; flex-direction: column; margin-bottom: 14px; gap: 6px; }
.modal-body label > span:first-child {
  font-size: 11px; color: var(--text-mute); font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.6px;
}
.modal-body label em { color: #ef4444; font-style: normal; }
.modal-body input, .modal-body textarea {
  background: var(--bg-2); border: 1px solid var(--border-strong); color: var(--text);
  padding: 10px 12px; border-radius: var(--radius-sm); font-size: 13px;
  outline: none; resize: vertical; transition: border 0.15s, background 0.15s;
}
.modal-body input:focus, .modal-body textarea:focus {
  border-color: rgba(255,255,255,0.22); background: var(--bg-3);
}

/* Select catégorie stylisé */
.modal-body select {
  appearance: none; -webkit-appearance: none;
  background: var(--bg-2);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%239898b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  border: 1px solid var(--border-strong);
  color: var(--text);
  padding: 10px 36px 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  outline: none;
  cursor: pointer;
  transition: border 0.15s, background-color 0.15s, box-shadow 0.15s;
  width: 100%;
}
.modal-body select:focus {
  border-color: var(--primary-1);
  background-color: var(--bg-3);
  box-shadow: 0 0 0 3px var(--primary-glow);
}
.modal-body select:hover { border-color: var(--border-hover); }
.modal-body select option {
  background: var(--bg-2);
  color: var(--text);
  padding: 8px;
}
.form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.form-error {
  margin-top: 10px; padding: 10px 12px;
  background: var(--danger-dim); border: 1px solid rgba(239,68,68,0.3);
  border-radius: var(--radius-sm); color: #fca5a5; font-size: 12px;
}

/* ===== Dynamic fields ===== */
.dynamic-section { margin-bottom: 14px; }
.dynamic-label { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.dynamic-label > span:first-child { font-size: 11px; color: var(--text-mute); font-weight: 600; text-transform: uppercase; letter-spacing: 0.6px; }
.dynamic-label em { color: #ef4444; font-style: normal; }
.field-count { font-size: 10px; color: var(--text-mute); }
.field-list { display: flex; flex-direction: column; gap: 7px; margin-bottom: 8px; }
.field-row { display: flex; gap: 6px; align-items: center; }
.field-row input {
  flex: 1; background: var(--bg-2); border: 1px solid var(--border-strong); color: var(--text);
  padding: 9px 12px; border-radius: var(--radius-sm); font-size: 12.5px; outline: none; transition: border 0.15s;
}
.field-row input:focus { border-color: rgba(255,255,255,0.22); }
.btn-remove-field {
  width: 28px; height: 28px; flex-shrink: 0; border-radius: var(--radius-xs);
  color: var(--text-mute); font-size: 12px;
  display: flex; align-items: center; justify-content: center; transition: all 0.1s;
}
.btn-remove-field:hover { background: var(--danger-dim); color: var(--danger); }
.btn-add-field {
  font-size: 12px; color: var(--text-dim); font-weight: 600;
  padding: 6px 10px; border-radius: var(--radius-sm);
  border: 1px dashed var(--border-strong); transition: all 0.1s;
}
.btn-add-field:hover { background: var(--bg-2); color: var(--text); border-color: var(--border-hover); }
.btn-add-field:disabled { opacity: 0.35; cursor: not-allowed; }
.field-hint { font-size: 11px; color: var(--text-mute); margin-top: 4px; padding: 0 2px; }

/* ===== Label checkbox ===== */
.label-checkbox { flex-direction: row !important; align-items: center; gap: 10px; cursor: pointer; }
.label-checkbox input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--primary-1); cursor: pointer; flex-shrink: 0; }
.label-checkbox span { font-size: 13px; color: var(--text-dim); }

/* ===== MODAL CLASSEMENT ===== */
.modal-leaderboard { max-width: 460px; }
.leaderboard-body { padding: 8px 0 4px; max-height: 70vh; overflow-y: auto; }
.leaderboard-loading { text-align: center; color: var(--text-mute); padding: 32px; }

.lb-podium {
  display: flex; align-items: flex-end; justify-content: center; gap: 12px;
  padding: 24px 16px 8px; margin-bottom: 8px;
}
.lb-podium-item {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  flex: 1; max-width: 130px;
}
.lb-podium-item.rank-1 { order: 2; }
.lb-podium-item.rank-2 { order: 1; }
.lb-podium-item.rank-3 { order: 3; }
.lb-crown { font-size: 28px; margin-bottom: 2px; }
.lb-pfp-wrap { position: relative; }
.lb-pfp-wrap img {
  border-radius: 50%; object-fit: cover;
  border: 3px solid var(--border-strong);
  display: block;
}
.rank-1 .lb-pfp-wrap img { width: 72px; height: 72px; border-color: #f59e0b; box-shadow: 0 0 18px rgba(245,158,11,0.5); }
.rank-2 .lb-pfp-wrap img { width: 56px; height: 56px; border-color: #94a3b8; box-shadow: 0 0 10px rgba(148,163,184,0.4); }
.rank-3 .lb-pfp-wrap img { width: 52px; height: 52px; border-color: #cd7f32; box-shadow: 0 0 10px rgba(205,127,50,0.4); }
.lb-rank-badge {
  position: absolute; bottom: -4px; right: -4px;
  width: 20px; height: 20px; border-radius: 50%;
  font-size: 10px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--bg-2);
}
.rank-1 .lb-rank-badge { background: #f59e0b; color: #000; }
.rank-2 .lb-rank-badge { background: #94a3b8; color: #000; }
.rank-3 .lb-rank-badge { background: #cd7f32; color: #000; }
.lb-pseudo { font-size: 12px; font-weight: 700; color: var(--white); text-align: center; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-count { font-size: 11px; color: var(--text-mute); }
.lb-podium-block {
  display: flex; align-items: flex-end; justify-content: center;
  width: 100%; border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  margin-top: 6px;
}
.rank-1 .lb-podium-block { height: 54px; background: linear-gradient(180deg, rgba(245,158,11,0.25), rgba(245,158,11,0.08)); }
.rank-2 .lb-podium-block { height: 38px; background: linear-gradient(180deg, rgba(148,163,184,0.18), rgba(148,163,184,0.06)); }
.rank-3 .lb-podium-block { height: 28px; background: linear-gradient(180deg, rgba(205,127,50,0.18), rgba(205,127,50,0.06)); }

.lb-list { display: flex; flex-direction: column; gap: 2px; padding: 0 8px 8px; }
.lb-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  transition: background 0.12s;
}
.lb-row:hover { background: var(--bg-2); }
.lb-row-rank { font-size: 12px; font-weight: 700; color: var(--text-mute); width: 20px; text-align: center; flex-shrink: 0; }
.lb-row img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; border: 1.5px solid var(--border-strong); flex-shrink: 0; }
.lb-row-info { flex: 1; min-width: 0; }
.lb-row-pseudo { font-size: 13px; font-weight: 600; color: var(--white); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-row-count { font-size: 11px; color: var(--text-mute); }
.lb-row-bar-wrap { width: 90px; height: 4px; background: var(--bg-3); border-radius: 99px; overflow: hidden; flex-shrink: 0; }
.lb-row-bar { height: 100%; border-radius: 99px; background: var(--primary-gradient); }

/* ===== MODAL SONDAGES ===== */
.modal-polls { max-width: 600px; }
.modal-poll-detail { max-width: 520px; }
.polls-body { padding: 4px 0 8px; max-height: 72vh; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; }
.poll-card {
  background: var(--bg-2); border: 1px solid var(--border-strong);
  border-radius: var(--radius); padding: 16px; cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.poll-card:hover { border-color: var(--border-hover); background: var(--bg-3); }
.poll-card-img { width: 100%; max-height: 160px; object-fit: cover; border-radius: var(--radius-sm); margin-bottom: 12px; }
.poll-card-question { font-size: 14px; font-weight: 700; color: var(--white); margin-bottom: 10px; line-height: 1.4; }
.poll-options-preview { display: flex; flex-direction: column; gap: 6px; }
.poll-option-bar {
  position: relative; padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg-1); overflow: hidden;
  cursor: pointer; transition: border-color 0.15s;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  font-size: 13px; color: var(--text);
}
.poll-option-bar.selected { border-color: var(--primary-1); color: var(--white); font-weight: 600; }
.poll-option-bar.selected::before {
  content: '✓ '; color: var(--primary-1);
}
.poll-option-fill {
  position: absolute; left: 0; top: 0; height: 100%;
  background: linear-gradient(90deg, rgba(58,123,213,0.18), rgba(58,96,115,0.10));
  border-radius: var(--radius-sm); transition: width 0.4s ease; pointer-events: none;
}
.poll-option-pct { font-size: 11px; color: var(--text-mute); white-space: nowrap; flex-shrink: 0; z-index: 1; }
.poll-option-text { z-index: 1; }
.poll-card-meta { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 11px; color: var(--text-mute); }
.poll-card-meta img { width: 18px; height: 18px; border-radius: 50%; }
.poll-card-actions { display: flex; gap: 8px; margin-top: 12px; }
.poll-voters-section { margin-top: 14px; border-top: 1px solid var(--border); padding-top: 14px; }
.poll-voters-title { font-size: 12px; font-weight: 700; color: var(--text-dim); margin-bottom: 10px; text-transform: uppercase; letter-spacing: 0.5px; }
.poll-voters-option { margin-bottom: 12px; }
.poll-voters-option-name { font-size: 13px; font-weight: 600; color: var(--white); margin-bottom: 6px; display: flex; align-items: center; justify-content: space-between; }
.poll-voters-list { display: flex; flex-wrap: wrap; gap: 6px; }
.poll-voter-chip { display: flex; align-items: center; gap: 5px; padding: 3px 8px 3px 3px; background: var(--bg-2); border: 1px solid var(--border-strong); border-radius: 999px; font-size: 11px; color: var(--text-dim); }
.poll-voter-chip img { width: 18px; height: 18px; border-radius: 50%; }
.poll-options-section { display: flex; flex-direction: column; gap: 7px; margin-bottom: 4px; }
.poll-detail-body { padding: 8px 0 4px; max-height: 72vh; overflow-y: auto; }
.poll-empty { text-align: center; padding: 40px; color: var(--text-mute); font-size: 14px; }

/* ===== MODAL DETAIL ===== */
.modal-detail { max-width: 740px; }
.detail-header-meta { display: flex; flex-direction: column; gap: 5px; min-width: 0; flex: 1; }
.detail-header-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.detail-cat-badge {
  display: inline-block; font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.8px;
  color: var(--text-dim); background: var(--bg-3); border: 1px solid var(--border-strong);
  padding: 2px 8px; border-radius: 999px; width: fit-content;
}
.modal-detail .modal-header h3 { font-size: 17px; font-weight: 700; line-height: 1.3; color: var(--white); }

/* ===== Carousel ===== */
.carousel { background: #000; position: relative; }
.carousel-viewport {
  aspect-ratio: 16/9; width: 100%;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; background: var(--bg-2);
}
.carousel-viewport img { width: 100%; height: 100%; object-fit: contain; display: block; }
.carousel-viewport iframe { width: 100%; height: 100%; border: none; display: block; }
.carousel-placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.carousel-placeholder .placeholder-icon { opacity: 0.08; }
.carousel-placeholder .placeholder-icon svg { width: 80px; height: 80px; }
.carousel-controls {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 8px 12px; background: rgba(0,0,0,0.5);
}
.carousel-btn {
  width: 26px; height: 26px; border-radius: 50%;
  background: rgba(255,255,255,0.1); color: var(--white); font-size: 17px; line-height: 1;
  display: flex; align-items: center; justify-content: center; transition: background 0.1s;
}
.carousel-btn:hover { background: rgba(255,255,255,0.2); }
.carousel-dots { display: flex; gap: 5px; flex-wrap: wrap; justify-content: center; }
.dot {
  width: 30px; height: 22px; border-radius: var(--radius-xs);
  background-size: cover; background-position: center; background-color: var(--bg-3);
  border: 2px solid transparent; transition: border-color 0.1s; cursor: pointer;
}
.dot.active { border-color: var(--white); }
.dot:hover { border-color: rgba(255,255,255,0.4); }

/* ===== Detail body ===== */
.detail-body { padding: 16px 18px 20px; }
.detail-author-row {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--text-dim); margin-bottom: 14px; flex-wrap: wrap;
}
.detail-author-row img { width: 22px; height: 22px; border-radius: 50%; }
.detail-sep { color: var(--text-mute); opacity: 0.4; }
.detail-desc { color: var(--text-dim); font-size: 13px; line-height: 1.65; margin-bottom: 20px; white-space: pre-wrap; }
.detail-section { margin-bottom: 20px; }
.detail-section:last-child { margin-bottom: 0; }
.detail-section-title {
  display: flex; align-items: center; gap: 7px;
  font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.8px;
  color: var(--text-mute); margin-bottom: 10px;
  padding-bottom: 8px; border-bottom: 1px solid var(--border);
}
.detail-dl-list { display: flex; flex-wrap: wrap; gap: 8px; }
.btn-dl-detail { font-size: 12.5px; }
.dl-domain { font-size: 10.5px; opacity: 0.6; font-weight: 400; }

/* ===== Comments ===== */
.comments-list {
  display: flex; flex-direction: column; gap: 14px;
  margin-bottom: 14px; max-height: 320px; overflow-y: auto; padding-right: 2px;
}
.comments-list::-webkit-scrollbar { width: 3px; }
.comments-list::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 2px; }
.no-comments { color: var(--text-mute); font-size: 12.5px; padding: 8px 0; }
.comment { display: flex; gap: 10px; }
.comment-pfp { width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0; }
.comment-content { flex: 1; min-width: 0; }
.comment-header { display: flex; align-items: center; gap: 8px; margin-bottom: 3px; flex-wrap: wrap; }
.comment-pseudo { font-size: 12.5px; font-weight: 700; color: var(--white); }
.comment-date { font-size: 10.5px; color: var(--text-mute); }
.comment-text { font-size: 13px; color: var(--text-dim); line-height: 1.55; white-space: pre-wrap; word-break: break-word; }
.btn-comment-delete {
  margin-left: auto; display: flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; border-radius: 4px; color: var(--text-mute);
  opacity: 0; transition: opacity 0.1s, color 0.1s;
}
.comment:hover .btn-comment-delete { opacity: 1; }
.btn-comment-delete:hover { color: var(--danger); }
.comment-form { display: flex; gap: 8px; align-items: flex-end; }
.comment-form textarea {
  flex: 1; background: var(--bg-2); border: 1px solid var(--border-strong); color: var(--text);
  padding: 9px 12px; border-radius: var(--radius-sm); font-size: 13px; outline: none;
  resize: none; transition: border 0.15s;
}
.comment-form textarea:focus { border-color: rgba(255,255,255,0.2); }
.comment-login-hint { padding: 8px 0; }

/* ===== Responsive ===== */
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: relative; top: 0; height: auto; border-right: none; border-bottom: 1px solid var(--border); }
  .cat-nav { flex-direction: row; flex-wrap: wrap; gap: 5px; }
  .cat-item { flex: 0 0 auto; padding: 7px 11px; }
  .cat-item.active { border-left: none; border-bottom: 2px solid var(--white); padding-left: 10px; }
  .main { padding: 16px; }
  .hero { padding: 20px; }
  .hero h1 { font-size: 18px; }
  .topbar { flex-wrap: wrap; }
  .search-wrap { order: 3; max-width: 100%; flex-basis: 100%; }
  .modal-detail { max-width: 100%; }
}

/* ===== Reduced motion ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0ms !important; animation-duration: 0ms !important; }
}
