:root {
  --orange: #ff7a1a;
  --orange-dark: #e35f00;
  --black: #17140f;
  --charcoal: #221e18;
  --card: #2a251d;
  --cream: #fff4e6;
  --muted: #b8ac98;
  --radius: 14px;
  --shadow: 0 6px 20px rgba(0,0,0,0.35);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Poppins', 'Segoe UI', system-ui, sans-serif;
  background: var(--black);
  color: var(--cream);
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }

/* ---------- Header ---------- */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  background: var(--charcoal);
  border-bottom: 3px solid var(--orange);
  position: sticky;
  top: 0;
  z-index: 50;
}

.logo {
  display: inline-flex;
  align-items: center;
  width: 166px;
  height: 52px;
  padding: 0;
  background: transparent;
  overflow: visible;
}
.logo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.nav-links {
  display: flex;
  gap: 18px;
  align-items: center;
  flex-wrap: wrap;
}

.nav-links a {
  color: var(--cream);
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 999px;
  transition: background .15s;
}
.nav-links a:hover { background: rgba(255,122,26,0.15); }

.btn {
  background: var(--orange);
  color: var(--black);
  border: none;
  padding: 10px 20px;
  border-radius: 999px;
  font-weight: 700;
  cursor: pointer;
  transition: transform .1s, background .15s;
}
.btn:hover { background: var(--orange-dark); transform: translateY(-1px); }
.btn.secondary { background: transparent; border: 2px solid var(--orange); color: var(--orange); }
.btn.small { padding: 6px 14px; font-size: 0.85rem; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--card);
  padding: 4px 12px 4px 4px;
  border-radius: 999px;
}
.user-chip img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }

/* ---------- Layout ---------- */
main { max-width: 1200px; margin: 0 auto; padding: 24px; }

.filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.filter-chip {
  background: var(--card);
  padding: 8px 16px;
  border-radius: 999px;
  cursor: pointer;
  border: 2px solid transparent;
  font-weight: 600;
  font-size: 0.9rem;
}
.filter-chip.active { border-color: var(--orange); color: var(--orange); }

/* ---------- Feed grid ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 18px;
}

.post-card {
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform .15s;
}
.post-card:hover { transform: translateY(-4px); }

.post-card .thumb-wrap {
  position: relative;
  aspect-ratio: 4/5;
  background: #000;
}
.post-card .thumb-wrap img,
.post-card .thumb-wrap video {
  width: 100%; height: 100%; object-fit: cover;
}
.badge-cat {
  position: absolute; top: 8px; left: 8px;
  background: rgba(23,20,15,0.8);
  color: var(--orange);
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
}
.post-info { padding: 10px 12px; }
.post-title { font-weight: 700; font-size: 0.95rem; margin: 0 0 6px; }
.post-meta {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 0.8rem; color: var(--muted);
}
.post-meta .cat-name { display: flex; align-items: center; gap: 6px; }
.post-meta img { width: 20px; height: 20px; border-radius: 50%; object-fit: cover; }

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
}

/* ---------- Forms ---------- */
.form-card {
  max-width: 480px;
  margin: 40px auto;
  background: var(--card);
  padding: 32px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.form-card h1 { color: var(--orange); margin-top: 0; }
.form-card p.subtitle { color: var(--muted); margin-top: -8px; }

label { display: block; font-weight: 600; margin: 16px 0 6px; }
input[type="text"], input[type="search"], select, textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 2px solid #443c2e;
  background: var(--black);
  color: var(--cream);
  font-size: 1rem;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--orange); }

.file-drop {
  border: 2px dashed #443c2e;
  border-radius: 10px;
  padding: 24px;
  text-align: center;
  color: var(--muted);
  cursor: pointer;
  margin-top: 8px;
}
.file-drop.has-file { border-color: var(--orange); color: var(--cream); }
.file-drop img, .file-drop video { max-width: 100%; max-height: 220px; border-radius: 8px; margin-top: 10px; }

.error-msg { color: #ff6b6b; font-weight: 600; margin-top: 10px; }
.success-msg { color: #6bffa0; font-weight: 600; margin-top: 10px; }

/* ---------- Video detail ---------- */
.video-detail {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 30px;
}
@media (max-width: 800px) { .video-detail { grid-template-columns: 1fr; } }

.media-wrap {
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
  max-height: 80vh;
}
.media-wrap img, .media-wrap video { width: 100%; display: block; }

.detail-panel h1 { color: var(--orange); }
.author-line { display: flex; align-items: center; gap: 10px; margin: 16px 0; }
.author-line img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }
.stats-row { display: flex; gap: 20px; margin: 16px 0; color: var(--muted); }
.tags-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
.tag-pill {
  background: var(--black); padding: 4px 12px; border-radius: 999px;
  font-size: 0.8rem; color: var(--orange);
}

.like-btn.liked { background: #ff4d6b; }

/* ---------- Profile ---------- */
.profile-header {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 30px;
}
.profile-header img { width: 90px; height: 90px; border-radius: 50%; object-fit: cover; border: 3px solid var(--orange); }

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

.loading { text-align: center; padding: 40px; color: var(--muted); }

/* ---------- Abonnements et notifications ---------- */
.notification-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--card);
  font-size: 1.15rem;
}
.notification-link:hover { background: rgba(255,122,26,0.18); }
.notification-badge {
  position: absolute;
  top: -3px;
  right: -4px;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border: 2px solid var(--charcoal);
  border-radius: 999px;
  background: #ff4d6b;
  color: white;
  font-size: 0.67rem;
  font-weight: 800;
  line-height: 15px;
  text-align: center;
}

.profile-summary { flex: 1; min-width: 0; }
.profile-title-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.profile-title-row h1 { margin: 0; color: var(--orange); }
.profile-stats {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 9px;
  color: var(--cream);
  font-size: 0.94rem;
}
.profile-stats span { color: var(--muted); }
.profile-stats strong { color: var(--cream); }
.profile-joined { margin: 9px 0 0; color: var(--muted); font-size: 0.88rem; }
.section-title { margin: 0 0 16px; color: var(--cream); font-size: 1.15rem; }

.notifications-page { max-width: 760px; margin: 8px auto; }
.page-heading { margin-bottom: 24px; }
.page-heading h1 { margin: 2px 0 6px; color: var(--orange); }
.eyebrow { margin: 0; color: var(--orange); font-size: 0.75rem; font-weight: 800; letter-spacing: 0.12em; }
.page-subtitle { margin: 0; color: var(--muted); }
.notifications-list {
  display: grid;
  gap: 10px;
}
.notification-item {
  display: flex;
  align-items: center;
  gap: 14px;
  position: relative;
  padding: 14px;
  border: 1px solid #443c2e;
  border-radius: var(--radius);
  background: var(--card);
  transition: transform .15s, border-color .15s;
}
.notification-item:hover { transform: translateY(-2px); border-color: var(--orange); }
.notification-item.unread { border-left: 4px solid var(--orange); background: #332a20; }
.notification-item img {
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  object-fit: cover;
  border: 2px solid var(--orange);
  border-radius: 50%;
  background: var(--black);
}
.notification-item p { margin: 0 24px 4px 0; color: var(--cream); }
.notification-item time { color: var(--muted); font-size: 0.84rem; }
.unread-dot {
  position: absolute;
  right: 17px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--orange);
}

@media (max-width: 620px) {
  .site-header { padding: 12px 14px; }
  .nav-links { gap: 6px; }
  .nav-links a { padding: 7px 9px; font-size: 0.9rem; }
  .profile-header { align-items: flex-start; gap: 14px; }
  .profile-header img { width: 72px; height: 72px; }
  .profile-stats { gap: 8px; font-size: 0.86rem; }
}

/* ---------- Fonctionnalités sociales ---------- */
.nav-links a.active { background: rgba(255, 122, 26, 0.18); color: var(--orange); }

.detail-category { position: static; display: inline-block; margin-bottom: 6px; }
.post-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 20px; }
.favorite-btn.is-favorite { background: #f9d658; border-color: #f9d658; color: var(--black); }
.text-action {
  border: 0;
  padding: 8px 6px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
}
.text-action:hover { color: var(--cream); }
.danger-action:hover { color: #ff7777; }

.comments-section {
  max-width: 790px;
  margin: 42px auto 0;
  padding-top: 28px;
  border-top: 1px solid #443c2e;
}
.section-heading-row { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 16px; }
.comment-form {
  margin: 0 0 22px;
  padding: 16px;
  border: 1px solid #443c2e;
  border-radius: var(--radius);
  background: var(--card);
}
.comment-form label { margin-top: 0; }
.comment-form textarea { resize: vertical; }
.comment-form-footer, .form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
}
.form-feedback { min-height: 1.1rem; color: var(--muted); font-size: 0.86rem; }
.comment-login-note {
  margin: 0 0 22px;
  padding: 14px 16px;
  border-radius: var(--radius);
  background: #2d281f;
  color: var(--muted);
}
.comment-login-note a, .empty-state a, .private-note a { color: var(--orange); font-weight: 700; }
.comments-list { display: grid; gap: 12px; }
.comment-item { display: flex; gap: 12px; padding: 14px 0; border-bottom: 1px solid #383126; }
.comment-item img { width: 40px; height: 40px; border: 2px solid #443c2e; border-radius: 50%; object-fit: cover; background: var(--black); }
.comment-body { min-width: 0; flex: 1; }
.comment-meta { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; color: var(--muted); font-size: 0.84rem; }
.comment-meta strong { color: var(--cream); }
.comment-body p { margin: 5px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.empty-comments { padding: 24px 0; color: var(--muted); text-align: center; }

.following-feed-page { min-height: 62vh; }
.center-actions { display: flex; justify-content: center; margin: 28px 0 10px; }

.profile-bio { margin: 12px 0 0; max-width: 680px; line-height: 1.55; color: var(--cream); white-space: pre-wrap; }
.profile-facts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.profile-facts span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  background: #332c22;
  color: var(--muted);
  font-size: 0.84rem;
}
.profile-facts strong { color: var(--orange); font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.04em; }
.profile-badges { margin: -10px 0 28px 110px; }
.badges-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 7px; }
.profile-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid rgba(255, 122, 26, 0.45);
  border-radius: 999px;
  background: rgba(255, 122, 26, 0.09);
  color: var(--cream);
  font-size: 0.83rem;
  font-weight: 700;
}
.profile-tabs {
  display: flex;
  gap: 4px;
  margin: 28px 0 18px;
  padding-bottom: 1px;
  border-bottom: 1px solid #443c2e;
}
.profile-tab {
  border: 0;
  border-bottom: 3px solid transparent;
  padding: 10px 14px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.profile-tab:hover { color: var(--cream); }
.profile-tab.active { border-color: var(--orange); color: var(--orange); }
.profile-edit-card { max-width: 680px; margin: 0 0 28px; }
.profile-edit-card h2 { color: var(--orange); margin-top: 0; }
.private-note { margin: -10px 0 18px; color: var(--muted); }

@media (max-width: 800px) {
  .profile-badges { margin-left: 0; }
  .comments-section { margin-top: 30px; }
}

@media (max-width: 620px) {
  .post-actions .btn { padding: 9px 14px; }
  .profile-tabs { overflow-x: auto; }
  .profile-tab { flex: 0 0 auto; }
  .comment-form-footer, .form-actions { align-items: flex-end; }
}

/* ---------- Modération ---------- */
.moderation-page { max-width: 1080px; }
.moderation-access-denied {
  max-width: 620px;
  margin: 50px auto;
  padding: 30px;
  border: 1px solid #634236;
  border-radius: var(--radius);
  background: var(--card);
}
.moderation-access-denied h2 { margin-top: 0; color: #ff8b77; }
.moderation-access-denied p { color: var(--muted); line-height: 1.55; }
.moderation-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 18px;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: var(--card);
}
.moderation-toolbar label { margin: 0; }
.moderation-toolbar select { width: auto; min-width: 185px; padding: 8px 10px; }
.moderation-count { margin-left: auto; color: var(--muted); font-size: 0.9rem; }
.reports-list { display: grid; gap: 16px; }
.report-card {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid #443c2e;
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
}
.report-media { min-height: 180px; background: #000; }
.report-media img, .report-media video { width: 100%; height: 100%; display: block; object-fit: cover; }
.report-content { min-width: 0; padding: 18px; }
.report-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.report-header h2 { margin: 3px 0 0; color: var(--cream); font-size: 1.05rem; }
.report-id { color: var(--orange); font-size: 0.78rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.report-details { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 20px; margin: 16px 0; }
.report-details div { min-width: 0; }
.report-details dt { color: var(--muted); font-size: .76rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.report-details dd { margin: 3px 0 0; overflow-wrap: anywhere; }
.existing-moderation-note { margin: 0 0 14px; color: var(--muted); font-size: .9rem; }
.existing-moderation-note strong { color: var(--cream); }
.moderation-note-label { margin: 0 0 6px; color: var(--muted); font-size: .84rem; }
.moderation-note { resize: vertical; }
.moderation-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }

@media (max-width: 680px) {
  .moderation-toolbar { align-items: flex-start; flex-wrap: wrap; }
  .moderation-count { width: 100%; margin-left: 0; }
  .report-card { grid-template-columns: 1fr; }
  .report-media { max-height: 280px; }
  .report-details { grid-template-columns: 1fr; gap: 8px; }
}

/* ---------- Collection de badges ---------- */
.profile-badge { font: inherit; line-height: 1.2; cursor: pointer; }
.profile-badge:hover, .profile-badge:focus-visible {
  border-color: var(--orange);
  background: rgba(255, 122, 26, 0.19);
  outline: none;
}
.badges-hint { margin: 9px 0 0; color: var(--muted); font-size: 0.8rem; }
.badge-dialog {
  width: min(680px, calc(100vw - 32px));
  max-height: min(720px, calc(100vh - 32px));
  overflow: hidden;
  padding: 0;
  border: 1px solid #5c4a32;
  border-radius: 18px;
  background: var(--charcoal);
  color: var(--cream);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.65);
}
.badge-dialog::backdrop { background: rgba(8, 7, 5, 0.76); backdrop-filter: blur(3px); }
.badge-dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 24px 0;
}
.badge-dialog-header h2 { margin: 4px 0 0; color: var(--orange); }
.dialog-close {
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  place-items: center;
  border: 1px solid #514432;
  border-radius: 50%;
  background: var(--card);
  color: var(--cream);
  font-size: 1.45rem;
  line-height: 1;
  cursor: pointer;
}
.dialog-close:hover, .dialog-close:focus-visible { border-color: var(--orange); color: var(--orange); outline: none; }
.badge-dialog-intro { margin: 12px 24px 18px; color: var(--muted); line-height: 1.5; }
.badge-catalog {
  display: grid;
  gap: 10px;
  max-height: min(52vh, 440px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0 24px 24px;
  scrollbar-color: var(--orange) var(--card);
}
.badge-catalog-item {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 13px;
  align-items: center;
  padding: 14px;
  border: 1px solid #443c2e;
  border-radius: 12px;
  background: var(--card);
}
.badge-catalog-item.earned { border-color: rgba(255, 122, 26, 0.62); background: #35291d; }
.badge-catalog-item.locked { opacity: 0.72; }
.badge-catalog-icon {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 50%;
  background: var(--black);
  font-size: 1.45rem;
}
.badge-catalog-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.badge-catalog-title h3 { margin: 0; font-size: 0.98rem; }
.badge-catalog-title span {
  flex: 0 0 auto;
  padding: 3px 8px;
  border-radius: 999px;
  background: #443c2e;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}
.badge-catalog-item.earned .badge-catalog-title span { background: rgba(255, 122, 26, 0.18); color: var(--orange); }
.badge-catalog-item p { margin: 5px 0 0; color: var(--muted); font-size: 0.88rem; line-height: 1.45; }

@media (max-width: 500px) {
  .badge-dialog-header { padding: 20px 18px 0; }
  .badge-dialog-intro { margin-right: 18px; margin-left: 18px; }
  .badge-catalog { padding-right: 18px; padding-bottom: 18px; padding-left: 18px; }
  .badge-catalog-item { grid-template-columns: 42px minmax(0, 1fr); padding: 12px; }
  .badge-catalog-icon { width: 42px; height: 42px; font-size: 1.25rem; }
  .badge-catalog-title { align-items: flex-start; flex-direction: column; gap: 4px; }
}

/* ---------- Badges mis en avant ---------- */
.featured-badges { margin: -8px 0 26px 110px; }
.featured-badges-list { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 7px; }
.featured-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 12px;
  border: 1px solid rgba(255, 207, 92, 0.65);
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(255, 207, 92, 0.18), rgba(255, 122, 26, 0.14));
  color: var(--cream);
  font: inherit;
  font-size: 0.87rem;
  font-weight: 800;
  line-height: 1.2;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
}
.featured-badge:hover, .featured-badge:focus-visible {
  border-color: var(--cream);
  transform: translateY(-1px);
  outline: none;
}
.feature-badges-form { display: flex; min-height: 0; flex-direction: column; }
.feature-badges-form .badge-dialog-intro { margin-bottom: 7px; }
.featured-badges-count { margin: 0 24px 13px; color: var(--orange); font-size: 0.86rem; font-weight: 800; }
.feature-badge-options {
  display: grid;
  gap: 9px;
  max-height: min(48vh, 390px);
  overflow-y: auto;
  padding: 0 24px;
  scrollbar-color: var(--orange) var(--card);
}
.feature-badge-option {
  display: grid;
  grid-template-columns: auto 42px minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  margin: 0;
  padding: 11px;
  border: 1px solid #443c2e;
  border-radius: 12px;
  background: var(--card);
  cursor: pointer;
}
.feature-badge-option:has(input:checked) { border-color: var(--orange); background: #35291d; }
.feature-badge-option:has(input:disabled) { opacity: 0.55; cursor: not-allowed; }
.feature-badge-option input { width: 18px; height: 18px; accent-color: var(--orange); }
.feature-badge-option .badge-catalog-icon { width: 42px; height: 42px; font-size: 1.2rem; }
.feature-badge-option strong { display: block; color: var(--cream); font-size: 0.9rem; }
.feature-badge-option small { display: block; margin-top: 3px; color: var(--muted); font-size: 0.78rem; line-height: 1.35; }
.feature-badges-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 24px 24px;
}

@media (max-width: 800px) {
  .featured-badges { margin-left: 0; }
}

@media (max-width: 500px) {
  .featured-badges-count { margin-right: 18px; margin-left: 18px; }
  .feature-badge-options { padding-right: 18px; padding-left: 18px; }
  .feature-badges-footer { padding: 16px 18px 18px; }
}
