/* ============================================================
   sisfeed.css — SIS Feed Social
   Plus Jakarta Sans + Outfit · Dark / Light
   Mobile-first · Android WebView compatible
   ============================================================ */

/* ══════════════════════════════════════════════════════════
   1. DESIGN TOKENS
══════════════════════════════════════════════════════════ */
:root {
  /* Arrière-plans */
  --bg:       #0D0D14;
  --bg2:      #111119;
  --bg3:      #181826;
  --bg4:      #1F1F30;
  --bg5:      #252540;
  --bg6:      #2C2C48;

  /* Bordures */
  --border:   rgba(255,255,255,0.055);
  --border2:  rgba(255,255,255,0.10);
  --border3:  rgba(255,255,255,0.16);

  /* Couleurs principales */
  --blue:     #5B8EF4;
  --purple:   #8B5CF6;
  --pink:     #EC4899;
  --green:    #10B981;
  --orange:   #F59E0B;
  --red:      #EF4444;
  --yellow:   #FBBF24;
  --cyan:     #06B6D4;
  --violet:   #A855F7;

  /* Gradients */
  --grad:     linear-gradient(135deg, #5B8EF4, #8B5CF6);
  --grad2:    linear-gradient(135deg, #EC4899, #8B5CF6);
  --grad3:    linear-gradient(135deg, #F59E0B, #EC4899);
  --grad4:    linear-gradient(135deg, #10B981, #5B8EF4);
  --grad5:    linear-gradient(135deg, #EF4444, #F59E0B);
  --grad6:    linear-gradient(135deg, #06B6D4, #5B8EF4);

  /* Texte */
  --text:     #EAEAF5;
  --text2:    #A0A0C0;
  --muted:    #52527A;

  /* Ombres */
  --shadow:   0 8px 32px rgba(0,0,0,.55);
  --shadow2:  0 2px 12px rgba(0,0,0,.35);
  --shadow3:  0 20px 60px rgba(0,0,0,.65);
  --shadow-up:0 -4px 24px rgba(0,0,0,.4);

  /* Rayons */
  --r:    16px;
  --r2:   12px;
  --r3:   10px;
  --r4:   8px;
  --r5:   6px;
  --r6:   4px;

  /* Layout */
  --topbar-h:  56px;
  --nav-h:     64px;
  --sidebar-l: 252px;
  --sidebar-r: 288px;
}

/* Mode clair */
body.light {
  --bg:       #F0F2F8;
  --bg2:      #FFFFFF;
  --bg3:      #F5F6FA;
  --bg4:      #ECEEF5;
  --bg5:      #E4E6F0;
  --bg6:      #DDDFF0;
  --border:   rgba(0,0,0,.065);
  --border2:  rgba(0,0,0,.11);
  --border3:  rgba(0,0,0,.17);
  --text:     #0D0D20;
  --text2:    #3C3C5A;
  --muted:    #8888A8;
  --shadow:   0 8px 32px rgba(0,0,0,.11);
  --shadow2:  0 2px 12px rgba(0,0,0,.07);
  --shadow3:  0 20px 60px rgba(0,0,0,.14);
  --shadow-up:0 -4px 24px rgba(0,0,0,.06);
}

/* ══════════════════════════════════════════════════════════
   2. RESET & BASE
══════════════════════════════════════════════════════════ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 14px;
  line-height: 1.55;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background .3s, color .3s;
}

a {
  color: var(--blue);
  text-decoration: none;
}

a:hover {
  opacity: .85;
}

button {
  cursor: pointer;
  font-family: inherit;
  line-height: 1;
  border: none;
  background: none;
  padding: 0;
}

input,
textarea,
select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

img {
  display: block;
  max-width: 100%;
}

::selection {
  background: rgba(139,92,246,.3);
  color: var(--text);
}

.hidden {
  display: none !important;
}

/* Scrollbars */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--bg4) transparent;
}

*::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}

*::-webkit-scrollbar-track {
  background: transparent;
}

*::-webkit-scrollbar-thumb {
  background: var(--bg4);
  border-radius: 2px;
}

/* ══════════════════════════════════════════════════════════
   3. TOPBAR
══════════════════════════════════════════════════════════ */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: calc(var(--topbar-h) + env(safe-area-inset-top, 0px));
  padding-top: env(safe-area-inset-top, 0px);
  display: flex;
  align-items: center;
  gap: 12px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  background: rgba(13,13,20,.94);
  border-bottom: 1px solid var(--border);
  transition: background .3s, border-color .3s;
}

body.light .topbar {
  background: rgba(240,242,248,.96);
  box-shadow: 0 1px 0 var(--border), 0 2px 16px rgba(0,0,0,.06);
}

.topbar-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  cursor: pointer;
}

.topbar-brand {
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 18px;
  background: var(--grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -.3px;
}

/* Barre de recherche */
.topbar-search {
  flex: 1;
  max-width: 380px;
  margin: 0 auto;
  position: relative;
}

.topbar-search .search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  width: 15px;
  height: 15px;
  pointer-events: none;
}

.topbar-search input {
  width: 100%;
  padding: 8px 34px 8px 36px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 24px;
  color: var(--text);
  font-size: 13px;
  outline: none;
  transition: border-color .2s, background .2s, box-shadow .2s;
}

.topbar-search input::placeholder {
  color: var(--muted);
}

.topbar-search input:focus {
  border-color: var(--blue);
  background: var(--bg4);
  box-shadow: 0 0 0 3px rgba(91,142,244,.12);
}

.search-clear {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  display: none;
  padding: 2px;
  line-height: 1;
  transition: color .15s;
}

.search-clear:hover {
  color: var(--text2);
}

.search-clear svg {
  width: 13px;
  height: 13px;
}

/* Actions droite */
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  flex-shrink: 0;
}

.tb-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--r4);
  background: transparent;
  color: var(--text2);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s, color .2s, transform .15s;
  position: relative;
}

.tb-btn svg {
  width: 18px;
  height: 18px;
}

.tb-btn:hover {
  background: var(--bg3);
  color: var(--text);
}

.tb-btn:active {
  transform: scale(.92);
}

.notif-badge {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--red);
  border: 2px solid var(--bg);
  animation: badgePop .3s cubic-bezier(.34,1.56,.64,1);
}

body.light .notif-badge {
  border-color: var(--bg2);
}

.tb-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 0 0 2px var(--purple);
  flex-shrink: 0;
  background: var(--bg3);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: box-shadow .2s, transform .2s;
}

.tb-avatar:hover {
  box-shadow: 0 0 0 2px var(--blue);
  transform: scale(1.06);
}

/* ══════════════════════════════════════════════════════════
   4. PANEL NOTIFICATIONS
══════════════════════════════════════════════════════════ */
.notif-panel {
  position: fixed;
  top: calc(var(--topbar-h) + 8px);
  right: 16px;
  z-index: 200;
  width: min(310px, calc(100vw - 32px));
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transition: max-height .3s cubic-bezier(.4,0,.2,1), opacity .2s;
}

.notif-panel.notif-panel-open {
  max-height: 460px;
  opacity: 1;
  pointer-events: all;
  overflow-y: auto;
}

.notif-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--bg2);
  z-index: 1;
}

.notif-panel-title {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 14px;
}

.notif-clear {
  font-size: 11px;
  color: var(--muted);
  cursor: pointer;
  transition: color .2s;
  background: none;
  border: none;
}

.notif-clear:hover {
  color: var(--blue);
}

.notif-item {
  display: flex;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  transition: background .15s;
}

.notif-item:last-child {
  border-bottom: none;
}

.notif-item:hover {
  background: var(--bg3);
}

.notif-icon {
  font-size: 18px;
  flex-shrink: 0;
  margin-top: 1px;
}

.notif-body {
  flex: 1;
  min-width: 0;
}

.notif-msg {
  font-size: 13px;
  color: var(--text);
  line-height: 1.4;
}

.notif-time {
  font-size: 11px;
  color: var(--muted);
  margin-top: 3px;
}

.notif-empty {
  padding: 28px 16px;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
}

/* ══════════════════════════════════════════════════════════
   5. LAYOUT 3 COLONNES
══════════════════════════════════════════════════════════ */
.layout {
  display: grid;
  grid-template-columns: var(--sidebar-l) 1fr var(--sidebar-r);
  max-width: 1200px;
  margin: var(--topbar-h) auto 0;
  padding: 0 12px;
  min-height: calc(100vh - var(--topbar-h));
}

/* ══════════════════════════════════════════════════════════
   6. SIDEBAR GAUCHE
══════════════════════════════════════════════════════════ */
.sidebar-left {
  padding: 20px 14px 20px 0;
  position: sticky;
  top: var(--topbar-h);
  height: calc(100vh - var(--topbar-h));
  overflow-y: auto;
}

/* Carte profil */
.profile-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 18px;
  margin-bottom: 10px;
  transition: background .3s, border-color .3s;
}

.pc-avatar-wrap {
  position: relative;
  width: 62px;
  height: 62px;
  margin: 0 auto 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pc-avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--grad);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 18px;
  color: #fff;
  position: relative;
  z-index: 1;
  flex-shrink: 0;
}

/* Ghost ring animé */
.ghost-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation: ghostSpin 10s linear infinite;
  pointer-events: none;
}

.pc-info {
  text-align: center;
  margin-bottom: 14px;
}

.pc-name {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  flex-wrap: wrap;
  color: var(--text);
  line-height: 1.3;
}

.certified-badge {
  display: inline-flex;
  flex-shrink: 0;
}

.pc-mode {
  font-size: 11px;
  color: var(--muted);
  margin-top: 3px;
}

.pc-level {
  font-size: 11px;
  color: var(--blue);
  margin-top: 2px;
  font-weight: 600;
}

/* Grille stats */
.pc-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 12px;
}

.pc-stat {
  background: var(--bg3);
  border-radius: var(--r3);
  padding: 8px 6px;
  text-align: center;
  transition: background .3s;
}

.pc-stat-n {
  display: block;
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 16px;
  color: var(--text);
}

.pc-stat-l {
  display: block;
  font-size: 10px;
  color: var(--muted);
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: .3px;
}

/* Barre niveau */
.level-bar-wrap {
  margin-bottom: 10px;
}

.level-bar-track {
  height: 4px;
  background: var(--bg3);
  border-radius: 2px;
  overflow: hidden;
}

.level-bar-fill {
  height: 100%;
  background: var(--grad);
  border-radius: 2px;
  transition: width .7s cubic-bezier(.4,0,.2,1);
}

.level-next {
  font-size: 10px;
  color: var(--muted);
  margin-top: 4px;
  text-align: right;
}

/* Streak */
.streak-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg3);
  border-radius: var(--r3);
  padding: 9px 12px;
  margin-bottom: 8px;
  transition: background .3s;
}

.streak-left {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text2);
}

.streak-left svg {
  width: 15px;
  height: 15px;
}

.streak-count {
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 14px;
  color: var(--orange);
}

/* Ghost toggle */
.ghost-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  background: var(--bg3);
  border-radius: var(--r3);
  cursor: pointer;
  margin-bottom: 8px;
  transition: background .2s;
  user-select: none;
}

.ghost-toggle:hover {
  background: var(--bg4);
}

.ghost-toggle-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text2);
}

.ghost-toggle-label svg {
  width: 15px;
  height: 15px;
  color: var(--muted);
}

/* Toggle pill — réutilisé partout */
.toggle-pill {
  width: 36px;
  height: 20px;
  border-radius: 10px;
  background: var(--bg5);
  position: relative;
  border: 1px solid var(--border2);
  transition: background .25s, border-color .25s;
  flex-shrink: 0;
  cursor: pointer;
}

.toggle-pill.on {
  background: var(--purple);
  border-color: var(--purple);
}

.toggle-pill::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  transition: transform .25s cubic-bezier(.34,1.56,.64,1);
  box-shadow: 0 1px 4px rgba(0,0,0,.35);
}

.toggle-pill.on::after {
  transform: translateX(16px);
}

/* Boutons sidebar */
.sidebar-action-btn {
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--r3);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text2);
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  transition: background .2s, color .2s, border-color .2s, transform .1s;
  text-align: left;
}

.sidebar-action-btn svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.sidebar-action-btn:hover {
  background: var(--bg3);
  color: var(--text);
  border-color: var(--border2);
}

.sidebar-action-btn:active {
  transform: scale(.97);
}

/* Mood du jour */
.mood-du-jour {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 16px;
  margin-top: 4px;
  transition: background .3s, border-color .3s;
}

.mood-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .6px;
  margin-bottom: 8px;
}

.mood-word {
  font-family: 'Outfit', sans-serif;
  font-weight: 900;
  font-size: 24px;
  background: var(--grad2);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 4px;
}

.mood-sub {
  font-size: 11px;
  color: var(--muted);
}

/* ══════════════════════════════════════════════════════════
   7. FEED CENTRAL
══════════════════════════════════════════════════════════ */
.feed-col {
  padding: 20px 12px 60px;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  min-height: calc(100vh - var(--topbar-h));
  transition: border-color .3s;
}

/* Bandeau nouveaux posts */
.new-posts-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--grad);
  color: #fff;
  border-radius: var(--r2);
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 14px;
  animation: fadeDown .3s ease;
  transition: opacity .2s, transform .15s;
}

.new-posts-banner:hover {
  opacity: .9;
  transform: translateY(-1px);
}

.new-posts-banner svg {
  width: 14px;
  height: 14px;
}

/* Filtre tag actif */
.tag-filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: rgba(91,142,244,.1);
  border: 1px solid rgba(91,142,244,.25);
  border-radius: var(--r2);
  margin-bottom: 14px;
  font-size: 13px;
  color: var(--blue);
  font-weight: 600;
}

.tag-filter-bar svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}

.tag-filter-close {
  margin-left: auto;
  color: var(--blue);
  display: flex;
  align-items: center;
  opacity: .7;
  transition: opacity .2s;
}

.tag-filter-close:hover {
  opacity: 1;
}

.tag-filter-close svg {
  width: 12px;
  height: 12px;
}

/* ══════════════════════════════════════════════════════════
   8. STORIES
══════════════════════════════════════════════════════════ */
.stories-row {
  display: flex;
  gap: 12px;
  padding: 4px 0 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.stories-row::-webkit-scrollbar { display: none; }
.story-item { scroll-snap-align: start; }

.story-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
  cursor: pointer;
}

.story-ring {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  padding: 2px;
  background: var(--bg4);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .2s, opacity .2s;
}

.story-ring:hover {
  transform: scale(1.06);
}

.story-ring-active {
  background: var(--grad2);
}

.story-add {
  border: 2px dashed var(--border2);
  background: transparent;
}

.story-inner {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--bg3);
  border: 2px solid var(--bg);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}

.story-inner svg {
  width: 22px;
  height: 22px;
}

.story-name {
  font-size: 10px;
  color: var(--text2);
  text-align: center;
  width: 60px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ══════════════════════════════════════════════════════════
   9. FEED TABS
══════════════════════════════════════════════════════════ */
.feed-tabs {
  display: flex;
  gap: 4px;
  padding-bottom: 14px;
  overflow-x: auto;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2px;
}

.tab {
  padding: 7px 15px;
  border-radius: 20px;
  background: transparent;
  color: var(--text2);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  transition: background .2s, color .2s, transform .1s;
  flex-shrink: 0;
}

.tab:hover {
  background: var(--bg3);
  color: var(--text);
}

.tab:active {
  transform: scale(.94);
}

.tab-active {
  background: var(--grad);
  color: #fff;
}

/* ══════════════════════════════════════════════════════════
   10. MOOD PILLS
══════════════════════════════════════════════════════════ */
.mood-pills {
  display: flex;
  gap: 8px;
  padding: 12px 0;
  overflow-x: auto;
}

.pill {
  padding: 5px 12px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--bg3);
  color: var(--text2);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all .2s;
}

.pill:hover {
  border-color: var(--border2);
  color: var(--text);
}

.pill-active {
  border-color: var(--blue);
  color: var(--blue);
  background: rgba(91,142,244,.1);
}

/* ══════════════════════════════════════════════════════════
   11. POST CARDS
══════════════════════════════════════════════════════════ */
.post {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 16px;
  margin-bottom: 12px;
  opacity: 0;
  transform: translateY(18px);
  transition:
    border-color .2s,
    box-shadow .2s,
    background .3s,
    opacity .35s,
    transform .35s;
}

.post.visible {
  opacity: 1;
  transform: translateY(0);
}

.post:hover {
  border-color: var(--border2);
  box-shadow: 0 4px 28px rgba(0,0,0,.28);
}

.post.heat-warm {
  border-color: rgba(245,158,11,.35);
}

.post.heat-viral {
  border-color: rgba(239,68,68,.5);
  animation: heatPulse 2s ease infinite;
}

/* Header du post */
.post-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.post-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--bg3);
  display: flex;
  align-items: center;
  justify-content: center;
}

.post-meta {
  flex: 1;
  min-width: 0;
}

.post-author {
  font-weight: 700;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  line-height: 1.3;
}

.post-time {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}

/* Badges types */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 7px;
  border-radius: var(--r5);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .3px;
  text-transform: uppercase;
  white-space: nowrap;
}

.badge-confession { background: rgba(139,92,246,.18); color: var(--purple); }
.badge-csdpm      { background: var(--grad2); color: #fff; }
.badge-whisper    { background: rgba(91,142,244,.18); color: var(--blue); }
.badge-battle     { background: rgba(239,68,68,.18); color: var(--red); }
.badge-burn       { background: rgba(245,158,11,.18); color: var(--orange); }
.badge-media      { background: rgba(16,185,129,.18); color: var(--green); }
.badge-poll       { background: rgba(251,191,36,.18); color: var(--yellow); }
.badge-thread     { background: rgba(168,85,247,.18); color: var(--violet); }
.badge-echo       { background: rgba(91,142,244,.12); color: var(--blue); }
.badge-old        { background: rgba(82,82,122,.25); color: var(--muted); }
.badge-viral      { background: var(--red); color: #fff; animation: heatPulse 2s infinite; }

/* Social proof — lecteurs actifs */
.post-readers {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 8px;
}

/* Texte principal */
.post-text {
  font-size: 15px;
  line-height: 1.68;
  color: var(--text);
  margin-bottom: 12px;
  word-break: break-word;
}

.read-more-btn {
  color: var(--blue);
  font-size: 13px;
  font-weight: 600;
  padding: 0;
  display: block;
  margin-bottom: 12px;
  transition: opacity .2s;
}

.read-more-btn:hover {
  opacity: .8;
}

/* Hashtags */
.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.tag {
  color: var(--blue);
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--r5);
  background: rgba(91,142,244,.1);
  cursor: pointer;
  transition: background .2s;
}

.tag:hover {
  background: rgba(91,142,244,.2);
}

/* ─── CSDPM ─── */
.csdpm-label {
  font-family: 'Outfit', sans-serif;
  font-weight: 900;
  font-size: 10px;
  color: var(--pink);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.csdpm-text {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 17px;
  line-height: 1.4;
}

.post[data-type="csdpm"] {
  border: 1px solid transparent;
  background:
    linear-gradient(var(--bg2), var(--bg2)) padding-box,
    var(--grad2) border-box;
}

/* ─── WHISPER ─── */
.whisper-blur {
  filter: blur(6px);
  transition: filter .4s ease;
  cursor: pointer;
  user-select: none;
  border-radius: 8px;
}

.whisper-blur.revealed {
  filter: blur(0);
  cursor: default;
}

.whisper-hint {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 12px;
  margin-top: -6px;
}

.whisper-hint svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}

/* ─── BATTLE ─── */
.battle-opts {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
}

.battle-opt {
  padding: 12px 14px;
  border-radius: var(--r3);
  border: 1px solid var(--border);
  background: var(--bg3);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: border-color .2s;
}

.battle-opt:hover {
  border-color: var(--blue);
}

.battle-voted {
  border-color: var(--purple) !important;
}

.battle-progress {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  background: rgba(139,92,246,.15);
  pointer-events: none;
  transition: width .5s ease;
}

.battle-opt-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  z-index: 1;
}

.battle-opt-label {
  font-weight: 600;
  font-size: 14px;
}

.battle-opt-pct {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 14px;
  color: var(--purple);
}

.battle-footer {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 10px;
}

.battle-footer svg {
  width: 13px;
  height: 13px;
}

/* ─── BURN ─── */
.burn-timer {
  background: var(--bg3);
  border-radius: var(--r3);
  padding: 10px 14px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.burn-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--orange);
}

.burn-icon {
  animation: burnFlicker 1.5s ease infinite;
}

.burn-countdown {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 13px;
  color: var(--orange);
}

.burn-progress-bar {
  height: 3px;
  background: var(--bg3);
  border-radius: 2px;
  margin-top: 12px;
  overflow: hidden;
}

.burn-fill {
  height: 100%;
  background: var(--grad3);
  border-radius: 2px;
  transition: width 1s linear;
}

.burn-views-left {
  font-size: 11px;
  color: var(--muted);
  text-align: right;
  margin-top: 5px;
  margin-bottom: 10px;
}

.burn-destroyed {
  text-align: center;
  padding: 20px;
  font-weight: 600;
  color: var(--muted);
  font-size: 15px;
}

.burn-destroyed-card {
  border-color: rgba(245,158,11,.2) !important;
}

/* ─── MEDIA ─── */
.post-media {
  margin-bottom: 12px;
  border-radius: var(--r2);
  overflow: hidden;
}

.post-img {
  width: 100%;
  border-radius: var(--r2);
  object-fit: cover;
  max-height: 400px;
  background: var(--bg3);
  display: block;
}

/* ─── POLL ─── */
.poll-opts {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 8px;
}

.poll-opt {
  display: flex;
  align-items: center;
  padding: 10px 12px;
  border-radius: var(--r3);
  border: 1px solid var(--border);
  background: var(--bg3);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: border-color .2s;
}

.poll-opt:hover {
  border-color: var(--blue);
}

.poll-bar {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  background: rgba(91,142,244,.12);
  pointer-events: none;
  transition: width .5s ease;
}

.poll-opt-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  position: relative;
  z-index: 1;
}

.poll-label {
  font-size: 13px;
  font-weight: 600;
}

.poll-pct {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 13px;
  color: var(--blue);
}

.poll-footer {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 10px;
}

/* ─── THREAD ─── */
.thread-part {
  background: var(--bg3);
  border-radius: var(--r3);
  padding: 12px;
  margin-bottom: 8px;
  transition: background .3s;
}

.thread-part-hidden {
  display: none;
}

.thread-part-n {
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 5px;
}

.thread-part-text {
  font-size: 14px;
  line-height: 1.5;
}

.thread-more-btn {
  color: var(--blue);
  font-size: 13px;
  font-weight: 600;
  padding: 4px 0;
  margin-bottom: 10px;
  display: block;
  transition: opacity .2s;
}

.thread-more-btn:hover {
  opacity: .8;
}

/* ─── ECHO ─── */
.echo-banner {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 8px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.echo-banner svg {
  width: 13px;
  height: 13px;
}

.echo-preview {
  background: var(--bg3);
  border-radius: var(--r3);
  padding: 10px 12px;
  font-size: 13px;
  color: var(--text2);
  margin-bottom: 10px;
  border-left: 2px solid var(--purple);
  line-height: 1.4;
}

/* ─── Réactions ─── */
.post-reactions {
  display: flex;
  align-items: center;
  gap: 5px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
  transition: border-color .3s;
}

.reaction-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  border-radius: 18px;
  border: 1px solid transparent;
  background: var(--bg3);
  color: var(--text2);
  font-size: 13px;
  font-weight: 600;
  transition: all .2s;
}

.reaction-btn:hover {
  background: var(--bg4);
  color: var(--text);
  transform: scale(1.06);
}

.reaction-active {
  background: rgba(139,92,246,.15);
  color: var(--purple);
  border-color: rgba(139,92,246,.3);
}

.reaction-count {
  font-family: 'Outfit', sans-serif;
  font-size: 12px;
  min-width: 12px;
}

/* Actions post */
.post-actions {
  margin-left: auto;
  display: flex;
  gap: 2px;
}

.act-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--r4);
  background: transparent;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .2s;
  font-size: 12px;
}

.act-btn svg {
  width: 15px;
  height: 15px;
}

.act-btn:hover {
  background: var(--bg3);
  color: var(--text2);
}

.act-count {
  font-size: 11px;
}

.first-reactor-badge {
  font-size: 10px;
  font-weight: 700;
  color: var(--yellow);
  background: rgba(251,191,36,.15);
  padding: 1px 5px;
  border-radius: 4px;
}

/* Menu post */
.post-menu-wrap {
  position: relative;
}

.post-menu-btn {
  width: 30px;
  height: 30px;
  border-radius: var(--r4);
  background: transparent;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .2s;
}

.post-menu-btn svg {
  width: 16px;
  height: 16px;
}

.post-menu-btn:hover {
  background: var(--bg3);
  color: var(--text2);
}

.post-menu {
  position: absolute;
  right: 0;
  top: 34px;
  z-index: 50;
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: var(--r2);
  padding: 6px;
  min-width: 175px;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: scale(.94) translateY(-6px);
  pointer-events: none;
  transition: all .18s ease;
  transform-origin: top right;
}

.post-menu.post-menu-open {
  opacity: 1;
  transform: scale(1) translateY(0);
  pointer-events: all;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border-radius: var(--r3);
  cursor: pointer;
  font-size: 13px;
  color: var(--text2);
  transition: all .15s;
}

.menu-item:hover {
  background: var(--bg4);
  color: var(--text);
}

.menu-item svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.menu-item-danger {
  color: var(--red);
}

.menu-item-danger:hover {
  background: rgba(239,68,68,.1);
}

.menu-sep {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}

/* ══════════════════════════════════════════════════════════
   12. SKELETONS
══════════════════════════════════════════════════════════ */
.skeleton-post {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 16px;
  margin-bottom: 12px;
  height: 160px;
  position: relative;
  overflow: hidden;
}

.skeleton-post::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255,255,255,.055) 40%,
    rgba(255,255,255,.1) 60%,
    transparent 100%
  );
  background-size: 200% 100%;
  animation: shimmer 1.6s infinite;
}

.skeleton-line {
  height: 12px;
  background: var(--bg3);
  border-radius: 6px;
  margin-bottom: 8px;
  width: 80%;
}

.skeleton-line.short {
  width: 50%;
}

/* ══════════════════════════════════════════════════════════
   13. SCROLL / LOADER / FIN FEED
══════════════════════════════════════════════════════════ */
.scroll-sentinel {
  height: 1px;
}

.load-more-spinner {
  display: flex;
  justify-content: center;
  padding: 20px;
}

.load-more-spinner svg {
  width: 24px;
  height: 24px;
  color: var(--muted);
  animation: spin 1s linear infinite;
}

.feed-end {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 28px;
  font-size: 13px;
  color: var(--muted);
}

.feed-end svg {
  width: 18px;
  height: 18px;
}

/* ══════════════════════════════════════════════════════════
   14. SIDEBAR DROITE
══════════════════════════════════════════════════════════ */
.sidebar-right {
  padding: 20px 0 20px 14px;
  position: sticky;
  top: var(--topbar-h);
  height: calc(100vh - var(--topbar-h));
  overflow-y: auto;
}

.rcard {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 14px;
  margin-bottom: 12px;
  transition: background .3s, border-color .3s;
}

.rcard-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 11px;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 12px;
}

.rcard-title svg {
  color: var(--muted);
  width: 14px;
  height: 14px;
}

/* Live Pulse */
.live-pulse-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.live-dot-svg {
  flex-shrink: 0;
}

.pulse-outer {
  animation: livePulse 2s ease infinite;
}

.live-count {
  font-family: 'Outfit', sans-serif;
  font-weight: 900;
  font-size: 30px;
  color: var(--green);
  line-height: 1;
}

.live-label {
  font-size: 12px;
  color: var(--muted);
}

/* Vibe */
.vibe-row  { display: flex; align-items: center; gap: 12px; }
.vibe-emoji{ font-size: 30px; }
.vibe-text { font-size: 13px; font-weight: 600; color: var(--text); }
.vibe-sub  { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* CSDPM du jour */
.csdpm-question {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
  margin-bottom: 8px;
}

.csdpm-count-row {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 10px;
}

.csdpm-count-row span {
  color: var(--pink);
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
}

.csdpm-reply-btn {
  width: 100%;
  padding: 9px;
  background: var(--grad2);
  border-radius: var(--r3);
  color: #fff;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  transition: opacity .2s;
}

.csdpm-reply-btn:hover {
  opacity: .88;
}

/* Trending */
.trending-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.trend-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 8px;
  border-radius: var(--r3);
  cursor: pointer;
  transition: background .15s;
}

.trend-item:hover {
  background: var(--bg3);
}

.trend-tag {
  color: var(--blue);
  font-weight: 700;
  font-size: 13px;
  margin-bottom: 3px;
}

.trend-bar {
  height: 2px;
  background: var(--grad);
  border-radius: 1px;
}

.trend-count {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}

/* Top semaine */
.top-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.top-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 7px 8px;
  border-radius: var(--r3);
  cursor: pointer;
  transition: background .15s;
}

.top-item:hover {
  background: var(--bg3);
}

.top-n {
  font-family: 'Outfit', sans-serif;
  font-weight: 900;
  font-size: 18px;
  color: var(--muted);
  flex-shrink: 0;
  width: 20px;
  line-height: 1;
  margin-top: 2px;
}

.top-gold {
  color: var(--yellow);
}

.top-text {
  font-size: 12px;
  color: var(--text2);
  line-height: 1.4;
}

.top-reactions {
  font-size: 11px;
  color: var(--muted);
  margin-top: 3px;
}

.empty-state {
  font-size: 12px;
  color: var(--muted);
  padding: 4px 0;
}

/* ══════════════════════════════════════════════════════════
   15. FAB + SCROLL TOP
══════════════════════════════════════════════════════════ */
.fab {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--grad);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(91,142,244,.4);
  transition: transform .2s, box-shadow .2s;
  z-index: 90;
}

.fab:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 28px rgba(91,142,244,.5);
}

.fab svg {
  width: 22px;
  height: 22px;
}

.scroll-top-btn {
  position: fixed;
  bottom: 90px;
  right: 22px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--bg3);
  border: 1px solid var(--border2);
  color: var(--text2);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .25s;
  z-index: 89;
  opacity: 0;
}

.scroll-top-btn:not(.hidden) {
  opacity: 1;
}

.scroll-top-btn:hover {
  background: var(--bg4);
  color: var(--text);
}

/* ══════════════════════════════════════════════════════════
   16. BOTTOM NAV
══════════════════════════════════════════════════════════ */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
  background: var(--bg2);
  border-top: 1px solid var(--border);
  z-index: 100;
  align-items: center;
  justify-content: space-around;
  padding-left: max(8px, env(safe-area-inset-left, 0px));
  padding-right: max(8px, env(safe-area-inset-right, 0px));
  transition: background .3s, border-color .3s;
}

.bn-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  transition: color .2s;
  flex: 1;
  padding: 6px 0;
}

.bn-btn svg {
  width: 22px;
  height: 22px;
}

.bn-btn span {
  line-height: 1;
}

.bn-active {
  color: var(--blue);
}

.bn-icon-wrap {
  position: relative;
}

.bn-notif-dot {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--red);
  border: 2px solid var(--bg2);
}

.bn-create {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--grad);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 16px rgba(91,142,244,.35);
  transition: transform .2s;
}

.bn-create:hover {
  transform: scale(1.05);
}

.bn-create svg {
  width: 22px;
  height: 22px;
  color: #fff;
}

/* ══════════════════════════════════════════════════════════
   17. PANEL PROFIL — slide-up mobile
══════════════════════════════════════════════════════════ */
.profil-panel-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 200;
}

.profil-panel {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 201;
  background: var(--bg2);
  border-radius: var(--r) var(--r) 0 0;
  border-top: 1px solid var(--border);
  padding: 12px 20px 32px;
  max-height: 92vh;
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform .35s cubic-bezier(.34,1.2,.64,1), background .3s;
}

.profil-panel.profil-panel-open {
  transform: translateY(0);
}

.profil-handle {
  width: 36px;
  height: 4px;
  border-radius: 2px;
  background: var(--border2);
  margin: 0 auto 16px;
}

.pp-avatar-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-bottom: 14px;
}

.pp-avatar-wrap {
  position: relative;
  width: 72px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pp-avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--bg3);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
}

.pp-ghost-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%,-50%);
  animation: ghostSpin 10s linear infinite;
}

.pp-name {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 17px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
}

.pp-meta {
  font-size: 12px;
  color: var(--muted);
}

.pp-streak {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  font-weight: 600;
  color: var(--orange);
}

.pp-change-photo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 9px;
  border-radius: var(--r3);
  border: 1px dashed var(--border2);
  background: transparent;
  color: var(--text2);
  font-size: 12px;
  transition: all .2s;
  margin-bottom: 12px;
}

.pp-change-photo:hover {
  border-color: var(--blue);
  color: var(--blue);
}

.pp-upload-progress {
  margin-bottom: 8px;
}

.pp-upload-bar {
  height: 4px;
  background: var(--bg3);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 4px;
}

.pp-upload-fill {
  height: 100%;
  background: var(--grad);
  border-radius: 2px;
  transition: width .2s linear;
  width: 0%;
}

.pp-upload-label {
  font-size: 11px;
  color: var(--muted);
  text-align: right;
  display: block;
}

.pp-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-bottom: 12px;
}

.pp-stat {
  background: var(--bg3);
  border-radius: var(--r3);
  padding: 10px 6px;
  text-align: center;
}

.pp-stat-n {
  display: block;
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 16px;
  color: var(--text);
}

.pp-stat-l {
  display: block;
  font-size: 10px;
  color: var(--muted);
  margin-top: 2px;
}

.pp-level-wrap {
  margin-bottom: 12px;
}

.pp-level-bar-track {
  height: 4px;
  background: var(--bg3);
  border-radius: 2px;
  overflow: hidden;
}

.pp-level-bar-fill {
  height: 100%;
  background: var(--grad);
  border-radius: 2px;
  transition: width .6s ease;
}

.pp-level-next {
  font-size: 11px;
  color: var(--muted);
  text-align: right;
  margin-top: 4px;
  display: block;
}

.aura-msg {
  text-align: center;
  font-size: 13px;
  color: var(--yellow);
  font-weight: 600;
  padding: 10px;
  border-radius: var(--r3);
  background: rgba(251,191,36,.1);
  margin-bottom: 10px;
  animation: badgePop .4s ease;
}

.pp-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}

.pp-toggle-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text2);
}

.pp-toggle-label svg {
  width: 15px;
  height: 15px;
}

.pp-logout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-top: 14px;
  padding: 11px;
  border-radius: var(--r3);
  border: 1px solid rgba(239,68,68,.3);
  background: rgba(239,68,68,.08);
  color: var(--red);
  font-size: 14px;
  font-weight: 600;
  transition: all .2s;
}

.pp-logout:hover {
  background: rgba(239,68,68,.15);
}

/* ══════════════════════════════════════════════════════════
   18. MODALS — layout commun
══════════════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(0,0,0,.65);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  overscroll-behavior: contain;
  touch-action: none;
}

.modal-overlay.hidden {
  display: none;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.modal-title {
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 17px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-title svg {
  width: 18px;
  height: 18px;
}

.modal-close {
  width: 30px;
  height: 30px;
  border-radius: var(--r4);
  background: var(--bg3);
  color: var(--text2);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .2s;
}

.modal-close:hover {
  background: var(--bg4);
  color: var(--text);
}

.modal-close svg {
  width: 14px;
  height: 14px;
}

/* Composer */
.composer-modal {
  width: 100%;
  max-width: 540px;
  background: var(--bg2);
  border-radius: var(--r) var(--r) 0 0;
  border: 1px solid var(--border);
  border-bottom: none;
  padding: 20px;
  animation: slideUp .3s cubic-bezier(.34,1.2,.64,1);
  max-height: 90vh;
  overflow-y: auto;
}

.composer-types {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  margin-bottom: 14px;
  padding-bottom: 2px;
}

.ctype {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 10px;
  border-radius: var(--r3);
  border: 1px solid var(--border);
  background: var(--bg3);
  transition: all .18s;
  flex-shrink: 0;
  min-width: 56px;
  font-size: 10px;
  font-weight: 600;
  color: var(--text2);
}

.ctype svg {
  width: 18px;
  height: 18px;
}

.ctype:hover {
  border-color: var(--border2);
}

.ctype-active {
  border-color: var(--purple);
  background: rgba(139,92,246,.1);
  color: var(--purple);
}

.composer-textarea {
  width: 100%;
  min-height: 100px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--r2);
  padding: 12px;
  color: var(--text);
  font-size: 15px;
  resize: vertical;
  outline: none;
  transition: border-color .2s;
  line-height: 1.55;
}

.composer-textarea::placeholder {
  color: var(--muted);
}

.composer-textarea:focus {
  border-color: var(--blue);
}

.composer-char-count {
  font-size: 11px;
  color: var(--muted);
  text-align: right;
  margin-top: 4px;
  margin-bottom: 12px;
}

.composer-options {
  margin-bottom: 12px;
}

.composer-type-opts {
  margin-top: 10px;
}

.opts-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.opts-label {
  font-size: 12px;
  color: var(--text2);
  font-weight: 600;
  flex-shrink: 0;
  min-width: 60px;
}

.opts-chips {
  display: flex;
  gap: 6px;
}

.chip {
  padding: 5px 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--bg3);
  color: var(--text2);
  font-size: 12px;
  font-weight: 600;
  transition: all .18s;
}

.chip:hover {
  border-color: var(--border2);
  color: var(--text);
}

.chip-active {
  border-color: var(--purple);
  color: var(--purple);
  background: rgba(139,92,246,.1);
}

.battle-opts-list,
.poll-opts-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 8px;
}

.battle-opt-input-row,
.poll-opt-input-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.battle-opt-input,
.poll-opt-input {
  flex: 1;
  padding: 8px 12px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--r3);
  color: var(--text);
  font-size: 13px;
  outline: none;
  transition: border-color .2s;
}

.battle-opt-input:focus,
.poll-opt-input:focus {
  border-color: var(--blue);
}

.battle-opt-remove,
.poll-opt-remove {
  width: 28px;
  height: 28px;
  border-radius: var(--r4);
  background: var(--bg3);
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all .15s;
}

.battle-opt-remove:hover,
.poll-opt-remove:hover {
  background: rgba(239,68,68,.1);
  color: var(--red);
}

.battle-opt-remove svg,
.poll-opt-remove svg {
  width: 12px;
  height: 12px;
}

.add-battle-opt,
.add-poll-opt,
.add-thread-part {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--blue);
  padding: 4px 0;
  font-weight: 600;
  transition: opacity .2s;
}

.add-battle-opt:hover,
.add-poll-opt:hover,
.add-thread-part:hover {
  opacity: .8;
}

.add-battle-opt svg,
.add-poll-opt svg,
.add-thread-part svg {
  width: 13px;
  height: 13px;
}

/* Upload zone */
.media-upload-zone {
  border: 2px dashed var(--border2);
  border-radius: var(--r2);
  padding: 28px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: border-color .2s, background .2s;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 13px;
}

.media-upload-zone:hover {
  border-color: var(--blue);
  background: rgba(91,142,244,.04);
}

.media-upload-zone.drag-over {
  border-color: var(--blue);
  background: rgba(91,142,244,.08);
}

.media-upload-zone svg {
  width: 28px;
  height: 28px;
}

.media-preview {
  position: relative;
  border-radius: var(--r2);
  overflow: hidden;
  margin-bottom: 10px;
}

.media-preview img {
  width: 100%;
  max-height: 240px;
  object-fit: cover;
  border-radius: var(--r2);
  display: block;
}

.media-preview-remove {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(0,0,0,.6);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.media-preview-remove svg {
  width: 12px;
  height: 12px;
}

.media-upload-progress {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.media-upload-bar {
  flex: 1;
  height: 4px;
  background: var(--bg3);
  border-radius: 2px;
  overflow: hidden;
}

.media-upload-fill {
  height: 100%;
  background: var(--grad);
  border-radius: 2px;
  transition: width .2s linear;
  width: 0%;
}

/* GIF */
.gif-section {
  margin-top: 8px;
}

.gif-search-row {
  display: flex;
  gap: 6px;
}

.gif-search-input {
  flex: 1;
  padding: 7px 12px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--r3);
  color: var(--text);
  font-size: 13px;
  outline: none;
  transition: border-color .2s;
}

.gif-search-input:focus {
  border-color: var(--blue);
}

.gif-search-btn {
  padding: 7px 14px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--r3);
  color: var(--text2);
  font-size: 12px;
  font-weight: 700;
  transition: all .2s;
}

.gif-search-btn:hover {
  border-color: var(--border2);
  color: var(--text);
}

.gif-results {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-top: 10px;
  max-height: 200px;
  overflow-y: auto;
}

.gif-thumb {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: var(--r4);
  cursor: pointer;
  transition: transform .2s, opacity .2s;
}

.gif-thumb:hover {
  transform: scale(1.04);
  opacity: .9;
}

/* Hashtags */
.hashtag-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-top: 1px solid var(--border);
  margin-top: 4px;
}

.hashtag-row svg {
  width: 14px;
  height: 14px;
  color: var(--muted);
  flex-shrink: 0;
}

.hashtag-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 13px;
}

.hashtag-input::placeholder {
  color: var(--muted);
}

.hashtag-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.hashtag-suggest {
  padding: 3px 10px;
  border-radius: 12px;
  background: rgba(91,142,244,.1);
  color: var(--blue);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}

.hashtag-suggest:hover {
  background: rgba(91,142,244,.2);
}

/* Footer composer */
.composer-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
  gap: 10px;
  flex-wrap: wrap;
}

.anon-opts {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.anon-opt {
  padding: 5px 10px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--bg3);
  color: var(--text2);
  font-size: 11px;
  font-weight: 600;
  transition: all .18s;
}

.anon-opt:hover {
  border-color: var(--border2);
  color: var(--text);
}

.anon-active {
  border-color: var(--purple);
  color: var(--purple);
  background: rgba(139,92,246,.1);
}

.publish-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 20px;
  border-radius: 20px;
  background: var(--grad);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  transition: opacity .2s, transform .15s;
}

.publish-btn svg {
  width: 14px;
  height: 14px;
}

.publish-btn:hover {
  opacity: .9;
  transform: scale(1.02);
}

/* ── Le Pacte ── */
.pacte-overlay {
  align-items: center;
  background: rgba(0,0,0,.82);
}

.pacte-modal {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 28px 24px;
  max-width: 420px;
  width: calc(100% - 32px);
  animation: scaleIn .3s cubic-bezier(.34,1.2,.64,1);
}

.pacte-eyebrow {
  font-size: 11px;
  font-weight: 700;
  color: var(--purple);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.pacte-title {
  font-family: 'Outfit', sans-serif;
  font-weight: 900;
  font-size: 22px;
  line-height: 1.3;
  margin-bottom: 18px;
}

.pacte-post-preview {
  background: var(--bg3);
  border-radius: var(--r2);
  padding: 16px;
  margin-bottom: 18px;
  min-height: 80px;
}

.pacte-post-text {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
}

.pacte-post-author {
  font-size: 11px;
  color: var(--muted);
  margin-top: 8px;
}

.pacte-reactions {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.pacte-react-btn {
  flex: 1;
  padding: 13px 8px;
  border-radius: var(--r2);
  border: 1px solid var(--border);
  background: var(--bg3);
  font-size: 22px;
  text-align: center;
  transition: all .2s;
}

.pacte-react-btn:hover {
  background: var(--bg4);
  transform: scale(1.12);
  border-color: var(--border2);
}

.pacte-sub {
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  margin-bottom: 10px;
}

.pacte-skip {
  display: block;
  width: 100%;
  padding: 8px;
  color: var(--muted);
  font-size: 12px;
  font-family: inherit;
  transition: color .2s;
}

.pacte-skip:not(.hidden) {
  opacity: 1;
}

.pacte-skip:hover {
  color: var(--text2);
}

/* ── Commentaires ── */
.comments-modal {
  width: 100%;
  max-width: 540px;
  background: var(--bg2);
  border-radius: var(--r) var(--r) 0 0;
  border: 1px solid var(--border);
  border-bottom: none;
  padding: 20px 20px 0;
  animation: slideUp .3s cubic-bezier(.34,1.2,.64,1);
  max-height: 85vh;
  display: flex;
  flex-direction: column;
}

.comment-post-summary {
  font-size: 13px;
  color: var(--text2);
  line-height: 1.4;
  padding: 10px 12px;
  background: var(--bg3);
  border-radius: var(--r3);
  margin-bottom: 14px;
  border-left: 3px solid var(--purple);
}

.comments-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-bottom: 8px;
  max-height: 50vh;
}

.comment-item {
  display: flex;
  gap: 10px;
}

.comment-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--bg3);
}

.comment-body {
  flex: 1;
}

.comment-author {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 3px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.comment-text {
  font-size: 13px;
  color: var(--text2);
  line-height: 1.4;
}

.comment-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 5px;
}

.comment-time {
  font-size: 11px;
  color: var(--muted);
}

.comment-like {
  color: var(--muted);
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: color .15s;
}

.comment-like svg {
  width: 12px;
  height: 12px;
}

.comment-like:hover {
  color: var(--pink);
}

.comments-empty {
  font-size: 13px;
  color: var(--muted);
  text-align: center;
  padding: 20px;
}

.comment-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 0 20px;
  border-top: 1px solid var(--border);
  margin-top: 8px;
}

.comment-input-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--bg3);
}

#commentInput {
  flex: 1;
  padding: 8px 12px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text);
  font-size: 13px;
  outline: none;
  transition: border-color .2s;
}

#commentInput:focus {
  border-color: var(--blue);
}

.comment-send-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--grad);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform .2s;
}

.comment-send-btn:hover {
  transform: scale(1.08);
}

.comment-send-btn svg {
  width: 16px;
  height: 16px;
}

/* ── Echo ── */
.echo-modal {
  width: 100%;
  max-width: 540px;
  background: var(--bg2);
  border-radius: var(--r) var(--r) 0 0;
  border: 1px solid var(--border);
  border-bottom: none;
  padding: 20px;
  animation: slideUp .3s cubic-bezier(.34,1.2,.64,1);
}

.echo-original-preview {
  background: var(--bg3);
  border-radius: var(--r3);
  padding: 12px;
  margin-bottom: 12px;
  border-left: 3px solid var(--purple);
}

.echo-orig-text {
  font-size: 13px;
  color: var(--text2);
  line-height: 1.4;
}

.echo-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
}

.echo-char-count {
  font-size: 11px;
  color: var(--muted);
  text-align: right;
  margin-top: 4px;
  margin-bottom: 12px;
}

/* ── Signalement ── */
.report-modal {
  width: 100%;
  max-width: 440px;
  background: var(--bg2);
  border-radius: var(--r) var(--r) 0 0;
  border: 1px solid var(--border);
  border-bottom: none;
  padding: 20px;
  animation: slideUp .3s cubic-bezier(.34,1.2,.64,1);
}

.report-reasons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 14px;
}

.report-reason {
  padding: 10px 12px;
  border-radius: var(--r3);
  border: 1px solid var(--border);
  background: var(--bg3);
  color: var(--text2);
  font-size: 13px;
  text-align: center;
  transition: all .18s;
}

.report-reason:hover {
  border-color: var(--border2);
  color: var(--text);
}

.report-reason-active {
  border-color: var(--red);
  color: var(--red);
  background: rgba(239,68,68,.1);
}

.report-submit {
  width: 100%;
  justify-content: center;
  background: var(--red);
}

/* ── Roulette ── */
.roulette-modal {
  width: 100%;
  max-width: 460px;
  background: var(--bg2);
  border-radius: var(--r) var(--r) 0 0;
  border: 1px solid var(--border);
  border-bottom: none;
  padding: 20px;
  animation: slideUp .3s cubic-bezier(.34,1.2,.64,1);
}

.roulette-post-card {
  background: var(--bg3);
  border-radius: var(--r2);
  padding: 20px;
  margin-bottom: 16px;
  animation: fadeUp .3s ease;
}

.roulette-post-text {
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  font-weight: 500;
}

.roulette-post-meta {
  font-size: 11px;
  color: var(--muted);
  margin-top: 10px;
}

.roulette-empty {
  font-size: 13px;
  color: var(--muted);
  text-align: center;
  padding: 30px 0;
}

.roulette-next {
  width: 100%;
  padding: 12px;
  background: var(--grad);
  border-radius: var(--r2);
  color: #fff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  transition: opacity .2s;
}

.roulette-next:hover {
  opacity: .9;
}

/* ══════════════════════════════════════════════════════════
   19. STORY VIEWER
══════════════════════════════════════════════════════════ */
.story-viewer {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: #000;
  display: flex;
  flex-direction: column;
}

.story-progress-bars {
  display: flex;
  gap: 4px;
  padding: 12px 12px 8px;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2;
}

.story-progress-bar {
  flex: 1;
  height: 3px;
  background: rgba(255,255,255,.3);
  border-radius: 2px;
  overflow: hidden;
}

.story-progress-fill {
  height: 100%;
  background: #fff;
  border-radius: 2px;
  width: 0%;
}

.story-viewer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 52px 16px 12px;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2;
  background: linear-gradient(180deg, rgba(0,0,0,.5) 0%, transparent 100%);
}

.story-viewer-author {
  display: flex;
  align-items: center;
  gap: 10px;
}

.story-viewer-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid #fff;
}

.story-viewer-name {
  font-weight: 700;
  font-size: 14px;
  color: #fff;
}

.story-viewer-time {
  font-size: 11px;
  color: rgba(255,255,255,.7);
}

.story-viewer-close {
  background: rgba(0,0,0,.4);
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.story-viewer-close svg {
  width: 20px;
  height: 20px;
}

.story-content {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.story-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.story-text-card {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 30px;
}

.story-text-content {
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 24px;
  color: #fff;
  text-align: center;
  line-height: 1.4;
  text-shadow: 0 2px 12px rgba(0,0,0,.3);
}

.story-tap-left,
.story-tap-right {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 40%;
  z-index: 3;
}

.story-tap-left  { left: 0; }
.story-tap-right { right: 0; }

/* Create story */
.create-story-modal {
  width: 100%;
  max-width: 480px;
  background: var(--bg2);
  border-radius: var(--r) var(--r) 0 0;
  border: 1px solid var(--border);
  border-bottom: none;
  padding: 20px;
  animation: slideUp .3s cubic-bezier(.34,1.2,.64,1);
}

.story-type-row {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.story-type-btn {
  flex: 1;
  padding: 9px 12px;
  border-radius: var(--r3);
  border: 1px solid var(--border);
  background: var(--bg3);
  color: var(--text2);
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all .18s;
}

.story-type-btn svg {
  width: 16px;
  height: 16px;
}

.story-type-active {
  border-color: var(--purple);
  color: var(--purple);
  background: rgba(139,92,246,.1);
}

.story-bg-picker {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.story-bg-opt {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  transition: transform .18s;
  border: 2px solid transparent;
  flex-shrink: 0;
}

.story-bg-opt:hover {
  transform: scale(1.1);
}

.story-bg-active {
  border-color: #fff;
  box-shadow: 0 0 0 2px var(--purple);
}

/* ══════════════════════════════════════════════════════════
   20. TOAST
══════════════════════════════════════════════════════════ */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(16px);
  background: var(--bg4);
  border: 1px solid var(--border2);
  border-radius: 24px;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s, transform .25s;
  z-index: 9999;
  box-shadow: var(--shadow2);
}

.toast.toast-show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast-success { border-color: rgba(16,185,129,.4); }
.toast-error   { border-color: rgba(239,68,68,.4); }
.toast-info    { border-color: rgba(91,142,244,.3); }

.toast-icon {
  font-size: 14px;
}

/* ══════════════════════════════════════════════════════════
   21. ANIMATIONS KEYFRAMES
══════════════════════════════════════════════════════════ */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeDown {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(.92); }
  to   { opacity: 1; transform: scale(1); }
}

@keyframes ghostSpin {
  to { transform: rotate(360deg); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes burnFlicker {
  0%, 100% { opacity: 1; }
  50%       { opacity: .6; }
}

@keyframes heatPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,.4); }
  50%       { box-shadow: 0 0 20px 4px rgba(239,68,68,.15); }
}

@keyframes badgePop {
  0%   { transform: scale(0); }
  70%  { transform: scale(1.2); }
  100% { transform: scale(1); }
}

@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position:  200% 0; }
}

@keyframes livePulse {
  0%, 100% { r: 7; opacity: .25; }
  50%       { r: 9; opacity: .1; }
}

/* ══════════════════════════════════════════════════════════
   22. RESPONSIVE
══════════════════════════════════════════════════════════ */

/* Tablette */
/* ══════════════════════════════════════════════════════════
   AUTH OVERLAY — inline dans sisfeed.html
══════════════════════════════════════════════════════════ */
.auth-overlay {
  position: fixed; inset: 0; z-index: 10000;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(139,92,246,.18) 0%, transparent 60%),
    radial-gradient(ellipse 40% 30% at 90% 90%, rgba(91,142,244,.08) 0%, transparent 50%),
    var(--bg);
  display: flex; align-items: center; justify-content: center;
  padding: 20px; overflow-y: auto;
}
.auth-card {
  width: 100%; max-width: 420px; background: var(--bg2);
  border: 1px solid var(--border2); border-radius: 24px; padding: 36px 32px;
  animation: scaleIn .4s cubic-bezier(.34,1.2,.64,1) both;
}
.auth-logo { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 28px; }
.auth-logo-icon { width: 48px; height: 48px; border-radius: 14px; background: var(--grad); display: flex; align-items: center; justify-content: center; box-shadow: 0 8px 24px rgba(91,142,244,.3); flex-shrink: 0; }
.auth-logo-text { font-family: 'Outfit', sans-serif; font-weight: 900; font-size: 30px; background: var(--grad); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.auth-tabs { display: flex; background: var(--bg3); border-radius: var(--r2); padding: 4px; margin-bottom: 22px; }
.auth-tab { flex: 1; padding: 9px; border-radius: var(--r3); background: transparent; color: var(--muted); font-size: 13px; font-weight: 600; font-family: inherit; cursor: pointer; transition: all .2s; }
.auth-tab.auth-tab-active { background: var(--bg2); color: var(--text); box-shadow: 0 2px 8px rgba(0,0,0,.3); }
.auth-title { font-family: 'Outfit', sans-serif; font-weight: 800; font-size: 20px; margin-bottom: 5px; color: var(--text); }
.auth-sub   { font-size: 13px; color: var(--muted); margin-bottom: 20px; line-height: 1.5; }
.auth-form-group { margin-bottom: 13px; }
.auth-label { display: block; font-size: 11px; font-weight: 700; color: var(--text2); margin-bottom: 6px; text-transform: uppercase; letter-spacing: .5px; }
.auth-input-wrap { position: relative; }
.auth-input {
  width: 100%; padding: 11px 14px; background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--r3); color: var(--text); font-size: 16px; font-family: inherit;
  outline: none; transition: border-color .2s, box-shadow .2s;
}
.auth-input-wrap .auth-input { padding-right: 42px; }
.auth-input::placeholder { color: var(--muted); }
.auth-input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(91,142,244,.12); }
.auth-input.auth-input-error { border-color: var(--red); box-shadow: 0 0 0 3px rgba(239,68,68,.1); }
.auth-toggle-pw { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); background: none; border: none; color: var(--muted); cursor: pointer; padding: 4px; display: flex; align-items: center; transition: color .15s; }
.auth-toggle-pw:hover { color: var(--text2); }
.auth-toggle-pw svg { width: 16px; height: 16px; }
.auth-error { font-size: 12px; color: var(--red); margin-top: 5px; min-height: 16px; }
.auth-strength-bars { display: flex; gap: 4px; margin-top: 7px; }
.auth-strength-bar { flex: 1; height: 3px; border-radius: 2px; background: var(--bg4); transition: background .3s; }
.auth-forgot { display: block; text-align: right; font-size: 12px; color: var(--blue); margin-top: -6px; margin-bottom: 12px; cursor: pointer; background: none; border: none; font-family: inherit; transition: opacity .2s; }
.auth-forgot:hover { opacity: .8; }
.auth-btn-main { width: 100%; padding: 13px; border-radius: var(--r3); border: none; background: var(--grad); color: #fff; font-size: 14px; font-weight: 700; font-family: inherit; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; transition: opacity .2s, transform .15s; margin-top: 4px; }
.auth-btn-main svg     { width: 15px; height: 15px; flex-shrink: 0; }
.auth-btn-main:hover   { opacity: .9; transform: scale(1.01); }
.auth-btn-main:active  { transform: scale(.98); }
.auth-btn-main:disabled{ opacity: .5; cursor: not-allowed; transform: none; }
.auth-spinner { width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.3); border-top-color: #fff; border-radius: 50%; animation: spin 1s linear infinite; flex-shrink: 0; }
.auth-separator { display: flex; align-items: center; gap: 12px; margin: 16px 0; }
.auth-separator::before, .auth-separator::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.auth-separator span { font-size: 11px; color: var(--muted); white-space: nowrap; }
.auth-btn-anon { width: 100%; padding: 11px; border-radius: var(--r3); border: 1px solid var(--border2); background: transparent; color: var(--text2); font-size: 13px; font-weight: 600; font-family: inherit; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; transition: all .2s; }
.auth-btn-anon:hover { background: var(--bg3); color: var(--text); }
.auth-btn-anon svg   { width: 15px; height: 15px; }
.auth-anon-info { background: rgba(139,92,246,.08); border: 1px solid rgba(139,92,246,.2); border-radius: var(--r3); padding: 11px 14px; margin-top: 10px; font-size: 12px; color: var(--text2); line-height: 1.6; animation: fadeUp .2s ease; }
.auth-anon-info strong { color: var(--purple); }
.auth-footer { text-align: center; font-size: 11px; color: var(--muted); margin-top: 18px; line-height: 1.7; }
.auth-footer span { color: var(--purple); font-weight: 700; }
.auth-reset-overlay { position: fixed; inset: 0; z-index: 10001; background: rgba(0,0,0,.7); display: flex; align-items: center; justify-content: center; padding: 20px; }
.auth-reset-modal { background: var(--bg2); border: 1px solid var(--border2); border-radius: var(--r); padding: 26px 24px; max-width: 380px; width: 100%; animation: scaleIn .3s cubic-bezier(.34,1.2,.64,1); }
.auth-reset-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.auth-reset-title { font-family: 'Outfit', sans-serif; font-weight: 800; font-size: 17px; }
.auth-reset-sub { font-size: 13px; color: var(--muted); margin-bottom: 14px; line-height: 1.5; }

/* ══════════════════════════════════════════════════════════
   RESPONSIVE — 5 breakpoints
══════════════════════════════════════════════════════════ */

/* Tablette large */
@media (max-width: 1100px) {
  .layout { grid-template-columns: 220px 1fr 260px; }
}

/* Tablette */
@media (max-width: 1023px) {
  .layout { grid-template-columns: 220px 1fr; max-width: 100%; }
  .sidebar-right { display: none; }
  .fab { display: flex; bottom: 20px; right: 20px; }
  .topbar-search { max-width: 280px; }
}

/* Tablette petite */
@media (max-width: 820px) {
  .layout { grid-template-columns: 180px 1fr; }
  .sidebar-left { padding: 16px 10px 16px 0; }
  .profile-card { padding: 14px; }
  .topbar-search { max-width: 200px; }
}

/* iPad Mini — sidebar trop serrée, on la cache */
@media (max-width: 768px) {
  .layout { grid-template-columns: 1fr; padding: 0; }
  .sidebar-left  { display: none; }
  .sidebar-right { display: none; }
  .feed-col {
    padding: 12px 12px calc(var(--nav-h) + env(safe-area-inset-bottom, 0px) + 20px);
    border-left: none;
    border-right: none;
  }
  .fab { display: none; }
  .bottom-nav { display: flex; }
  .scroll-top-btn {
    bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px) + 14px);
    right: 14px;
  }
  .toast {
    bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px) + 16px);
    max-width: calc(100vw - 32px);
    white-space: normal;
    text-align: center;
  }
}

/* Mobile */
@media (max-width: 767px) {
  .topbar { gap: 8px; }
  .topbar-brand { display: none; }
  .topbar-search { max-width: none; flex: 1; }
  .topbar-actions { gap: 2px; }
  .post { padding: 14px; }
  .post-text { font-size: 14px; }
  .post-img { max-height: 280px; }
  .csdpm-text { font-size: 15px; }
  .reaction-btn { padding: 5px 8px; font-size: 12px; }
  .composer-modal, .comments-modal, .echo-modal,
  .report-modal, .roulette-modal, .create-story-modal { max-width: 100%; }
  .pacte-modal { margin: 12px; border-radius: var(--r); max-width: calc(100% - 24px); padding: 22px 18px; }
  .report-reasons { grid-template-columns: 1fr; }
  .pp-stats { grid-template-columns: repeat(2, 1fr); }
  .auth-card { padding: 26px 18px; border-radius: var(--r); }
  .auth-reset-modal { padding: 22px 18px; }
  .stories-row { gap: 10px; }
  .story-ring  { width: 52px; height: 52px; }
  .story-inner { width: 46px; height: 46px; }
  .feed-tabs { gap: 3px; }
  .tab { padding: 6px 12px; font-size: 12px; }
  /* Inputs 16px pour éviter zoom iOS sur tous les champs */
  .form-input, #commentInput, .composer-textarea,
  .poll-opt-input, .battle-opt-input, .gif-search-input,
  .hashtag-input, .topbar-search input { font-size: 16px; }
}

/* Petit mobile */
@media (max-width: 390px) {
  .topbar { gap: 6px; }
  .tb-btn { width: 32px; height: 32px; }
  .tb-avatar { width: 28px; height: 28px; }
  .post { padding: 12px; margin-bottom: 10px; }
  .post-text { font-size: 13px; }
  .post-header { gap: 8px; }
  .post-avatar { width: 34px; height: 34px; }
  .reaction-btn { padding: 5px 7px; font-size: 11px; }
  .auth-card { padding: 22px 14px; }
  .auth-title { font-size: 18px; }
  .bn-create { width: 44px; height: 44px; }
  .bn-btn { font-size: 9px; }
  .bn-btn svg { width: 20px; height: 20px; }
  .post-img { max-height: 220px; }
}

/* ══════════════════════════════════════════════════════════
   FIXES MOBILES ADDITIONNELS
══════════════════════════════════════════════════════════ */

/* Feed tabs sans scrollbar visible */
.feed-tabs::-webkit-scrollbar { display: none; }

/* Mood pills scrollable horizontal */
.mood-pills {
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.mood-pills::-webkit-scrollbar { display: none; }

/* Post reactions — scroll si trop serré */
.post-reactions {
  -webkit-overflow-scrolling: touch;
}

/* Composer overlay — centré sur mobile */
@media (max-width: 540px) {
  .composer-overlay {
    padding: 0;
    align-items: flex-end;
  }
  .composer-modal {
    border-radius: 20px 20px 0 0;
    max-height: 95vh;
    padding-bottom: env(safe-area-inset-bottom, 12px);
  }
  .comments-overlay {
    padding: 0;
    align-items: flex-end;
  }
  .comments-modal {
    border-radius: 20px 20px 0 0;
    max-height: 95vh;
    padding-bottom: env(safe-area-inset-bottom, 12px);
  }
  .echo-overlay {
    padding: 0;
    align-items: flex-end;
  }
  .echo-modal {
    border-radius: 20px 20px 0 0;
    padding-bottom: env(safe-area-inset-bottom, 12px);
  }
  .report-overlay {
    padding: 0;
    align-items: flex-end;
  }
  .report-modal {
    border-radius: 20px 20px 0 0;
    padding-bottom: env(safe-area-inset-bottom, 12px);
  }
  .notif-panel {
    top: auto;
    bottom: calc(var(--nav-h) + 8px);
    left: 8px;
    right: 8px;
    width: auto;
  }
}

/* Corrections layout sur iPhone SE (320px) */
@media (max-width: 360px) {
  .post-reactions {
    flex-wrap: wrap;
    gap: 4px;
  }
  .reaction-btn {
    padding: 4px 6px;
    font-size: 11px;
  }
  .feed-tabs {
    gap: 2px;
  }
  .tab {
    padding: 5px 10px;
    font-size: 11px;
    flex-shrink: 0;
  }
  .topbar-search input {
    font-size: 14px;
  }
  .auth-card {
    padding: 18px 12px;
  }
}

/* Touch targets — minimum 44px sur mobile */
@media (max-width: 768px) {
  .reaction-btn,
  .act-btn,
  .tb-btn,
  .bn-btn {
    min-height: 44px;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .bn-btn {
    min-height: 44px;
    min-width: 48px;
  }
  /* Post menu accessible au tap */
  .post-menu-btn {
    min-width: 36px;
    min-height: 36px;
  }
  /* Éviter le zoom iOS sur focus input */
  input[type="text"],
  input[type="email"],
  input[type="password"],
  textarea,
  select {
    font-size: 16px !important;
  }
  /* Story viewer plein écran */
  .story-viewer {
    padding: 0;
  }
  .story-viewer-inner {
    border-radius: 0;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
  }
}

/* Animations réduites sur préférence utilisateur */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}
