/* =============================================
   CocoBlabla — Thème sombre bleu — v3
   ============================================= */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:      #13152a;
  --bg2:     #191c34;
  --bg3:     #1e2240;
  --card:    #21254a;
  --card2:   #272c52;
  --border:  rgba(255,255,255,0.07);
  --border2: rgba(255,255,255,0.13);
  --blue:    #5b7cfa;
  --blue2:   #4568f5;
  --blue3:   #3455e8;
  --blue-gl: rgba(91,124,250,0.22);
  --purple:  #8b5cf6;
  --green:   #22d3a5;
  --red:     #f1416c;
  --text:    #eef0ff;
  --text2:   #c8cde8;
  --muted:   #7880b0;
  --muted2:  #4e5580;
  --fh: ui-rounded, 'SF Pro Rounded', 'Helvetica Neue', Arial, sans-serif;
  --fb: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --r:  12px;
  --r2: 18px;
}

html, body { height: 100%; }

body {
  font-family: var(--fb);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

@keyframes pageIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Transition OUT au clic sur un lien interne */
body.page-out {
  animation: pageOut .18s ease forwards;
  pointer-events: none;
}

@keyframes pageOut {
  from { opacity: 1; }
  to   { opacity: 0; }
}

/* ========== FOND ANIMÉ ========== */

/* Grille et blob sont en position fixed derrière tout */
.bg-layer {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

/* Grille */
.bg-layer::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(91,124,250,0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(91,124,250,0.045) 1px, transparent 1px);
  background-size: 44px 44px;
}

/* Blob lumineux */
.bg-layer::after {
  content: '';
  position: absolute;
  width: 800px; height: 600px;
  top: -180px; left: 50%;
  transform: translateX(-50%);
  background: radial-gradient(ellipse, rgba(91,124,250,0.11) 0%, transparent 68%);
  animation: blobPulse 7s ease-in-out infinite;
}

@keyframes blobPulse {
  0%,100% { transform: translateX(-50%) scale(1);    opacity: .8; }
  50%      { transform: translateX(-50%) scale(1.2);  opacity: 1;  }
}

/* ========== NOIX DE COCO FLOTTANTES ========== */

.floats {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.floats span {
  position: absolute;
  bottom: -80px;          /* start below screen */
  opacity: 0;
  font-size: 28px;
  animation: rise linear infinite;
  will-change: transform, opacity;
}

/* positions et tailles variées */
.floats span:nth-child(1)  { left:  3%; font-size:22px; animation-duration:16s; animation-delay:  0s; }
.floats span:nth-child(2)  { left: 10%; font-size:34px; animation-duration:22s; animation-delay: -4s; }
.floats span:nth-child(3)  { left: 18%; font-size:18px; animation-duration:18s; animation-delay: -8s; }
.floats span:nth-child(4)  { left: 27%; font-size:30px; animation-duration:26s; animation-delay: -2s; }
.floats span:nth-child(5)  { left: 36%; font-size:20px; animation-duration:20s; animation-delay:-13s; }
.floats span:nth-child(6)  { left: 44%; font-size:38px; animation-duration:17s; animation-delay: -6s; }
.floats span:nth-child(7)  { left: 53%; font-size:16px; animation-duration:24s; animation-delay:-11s; }
.floats span:nth-child(8)  { left: 62%; font-size:28px; animation-duration:21s; animation-delay:-15s; }
.floats span:nth-child(9)  { left: 70%; font-size:24px; animation-duration:19s; animation-delay: -3s; }
.floats span:nth-child(10) { left: 78%; font-size:14px; animation-duration:28s; animation-delay:-18s; }
.floats span:nth-child(11) { left: 85%; font-size:32px; animation-duration:23s; animation-delay: -7s; }
.floats span:nth-child(12) { left: 91%; font-size:18px; animation-duration:15s; animation-delay:-10s; }
.floats span:nth-child(13) { left: 20%; font-size:26px; animation-duration:29s; animation-delay:-20s; }
.floats span:nth-child(14) { left: 58%; font-size:20px; animation-duration:25s; animation-delay:-16s; }
.floats span:nth-child(15) { left: 47%; font-size:12px; animation-duration:32s; animation-delay:-24s; }
.floats span:nth-child(16) { left: 75%; font-size:36px; animation-duration:21s; animation-delay: -1s; }

@keyframes rise {
  0%   { transform: translateY(0)      rotate(0deg);   opacity: 0;    }
  6%   { opacity: .35; }
  88%  { opacity: .35; }
  100% { transform: translateY(-105vh) rotate(380deg); opacity: 0;    }
}

/* ========== NAVBAR ========== */

.navbar {
  position: sticky;
  top: 0; z-index: 200;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 52px;
  height: 64px;
  background: rgba(19,21,42,0.9);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border-bottom: 1px solid var(--border);
}

.nav-logo {
  font-family: var(--fh);
  font-weight: 800;
  font-size: 20px;
  color: var(--blue);
  text-decoration: none;
  letter-spacing: -0.4px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Coco du logo : balance constante */
.nav-logo .ic {
  display: inline-block;
  animation: wiggle 2.8s ease-in-out infinite;
  transform-origin: bottom center;
}

@keyframes wiggle {
  0%,100% { transform: rotate(-10deg) scale(1);    }
  25%      { transform: rotate( 10deg) scale(1.15); }
  50%      { transform: rotate( -6deg) scale(1);    }
  75%      { transform: rotate(  8deg) scale(1.08); }
}

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

.nav-links a {
  font-size: 14px;
  font-weight: 500;
  color: var(--text2);
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 8px;
  transition: background .15s, color .15s;
}

.nav-links a:hover {
  color: var(--text);
  background: rgba(255,255,255,0.07);
}

.nav-links a.active-link {
  color: var(--text);
  background: rgba(255,255,255,0.06);
}

/* Bouton Connexion dans navbar */
.nav-links a.nav-btn {
  background: var(--blue2);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 2px 12px var(--blue-gl);
  border-radius: 8px;
}

.nav-links a.nav-btn:hover {
  background: var(--blue3);
  transform: translateY(-1px);
}

/* ========== BOUTONS GÉNÉRAUX ========== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: var(--r);
  font-size: 15px;
  font-weight: 600;
  font-family: var(--fb);
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: all .2s;
  letter-spacing: -.1px;
}

.btn-primary {
  background: var(--blue2);
  color: #fff;
  box-shadow: 0 4px 22px var(--blue-gl);
}
.btn-primary:hover {
  background: var(--blue3);
  transform: translateY(-2px);
  box-shadow: 0 8px 30px var(--blue-gl);
}

.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1.5px solid var(--border2);
}
.btn-outline:hover {
  background: rgba(255,255,255,0.07);
  border-color: rgba(255,255,255,.22);
}

.btn-full   { width: 100%; margin-top: 4px; }
.btn-sm     { padding: 8px 18px; font-size: 13px; }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { filter: brightness(1.1); }

/* ========== FORMULAIRES ========== */

.form-group { display: flex; flex-direction: column; gap: 7px; margin-bottom: 18px; }
.form-group label { font-size: 13px; font-weight: 600; color: var(--text2); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
textarea, select {
  width: 100%;
  background: rgba(255,255,255,0.05);
  border: 1.5px solid var(--border2);
  border-radius: var(--r);
  color: var(--text);
  padding: 11px 15px;
  font-size: 14px;
  font-family: var(--fb);
  transition: border-color .15s, box-shadow .15s;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(91,124,250,.16);
}
input::placeholder { color: var(--muted); }

/* Input avec icône à gauche */
.input-icon { position: relative; }
.input-icon input { padding-left: 42px; }
.input-icon .ico {
  position: absolute;
  left: 13px; top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
  pointer-events: none;
  line-height: 1;
}

/* Bouton œil mot de passe */
.input-pw { position: relative; }
.input-pw input { padding-right: 46px; }
.pw-eye {
  position: absolute; right: 12px; top: 50%;
  transform: translateY(-50%);
  background: none; border: none;
  cursor: pointer; font-size: 16px; opacity: .45;
  transition: opacity .15s; line-height: 1;
}
.pw-eye:hover { opacity: 1; }

/* Sélecteur genre */
.genre-row { display: flex; gap: 10px; flex-wrap: wrap; }
.genre-opt input { display: none; }
.genre-opt span {
  display: block;
  padding: 9px 20px;
  border: 1.5px solid var(--border2);
  border-radius: var(--r);
  cursor: pointer;
  font-size: 14px; font-weight: 500;
  color: var(--text2);
  transition: all .15s;
}
.genre-opt span:hover { border-color: var(--blue); color: var(--text); }
.genre-opt input:checked + span {
  border-color: var(--blue);
  background: rgba(91,124,250,.15);
  color: #93b4ff;
}

/* Checkbox */
.chk-row {
  display: flex; align-items: center; gap: 10px;
  cursor: pointer; font-size: 14px; color: var(--text2);
  margin-bottom: 18px;
}
.chk-row input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--blue); cursor: pointer; }

/* ========== ALERTES ========== */
.alert {
  padding: 11px 16px;
  border-radius: var(--r);
  font-size: 14px;
  margin-bottom: 16px;
  animation: alertIn .2s ease;
}
.alert-error   { background: rgba(241,65,108,.13); border: 1px solid rgba(241,65,108,.3); color: #ff8fab; }
.alert-success { background: rgba(34,211,165,.13); border: 1px solid rgba(34,211,165,.3); color: #6effd9; }
@keyframes alertIn { from{opacity:0;transform:translateY(-6px)} to{opacity:1;transform:translateY(0)} }

/* ========== PAGE AUTH (login / register) ========== */

.auth-page {
  /* on ne met PAS display:flex ici pour ne pas perturber la navbar */
}

.auth-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 64px);
  padding: 32px 24px;
  position: relative;
  z-index: 1;
}

.auth-card {
  width: 100%;
  max-width: 460px;
  background: var(--card);
  border: 1.5px solid var(--border2);
  border-radius: var(--r2);
  padding: 40px 38px;
  box-shadow: 0 8px 48px rgba(0,0,0,.5);
  animation: cardIn .5s ease both;
}

@keyframes cardIn {
  from { opacity:0; transform: translateY(18px) scale(.98); }
  to   { opacity:1; transform: translateY(0) scale(1); }
}

.auth-card h2 {
  font-family: var(--fh);
  font-size: 24px; font-weight: 800;
  letter-spacing: -.5px;
  margin-bottom: 6px;
}

.auth-sub {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 28px;
  line-height: 1.6;
}

.auth-switch {
  text-align: center;
  font-size: 14px;
  color: var(--muted);
  margin-top: 22px;
}
.auth-switch a {
  color: var(--blue);
  text-decoration: none;
  font-weight: 600;
}
.auth-switch a:hover { text-decoration: underline; }

/* Box géolocalisation */
.geo-box {
  display: flex; align-items: center; gap: 12px;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 12px 14px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.geo-info { font-size: 13px; color: var(--muted); flex: 1; }

/* ========== CHAT ========== */

.chat-page { display: flex; flex-direction: column; height: 100vh; overflow: hidden; }

/* Top bar du chat */
.chat-bar {
  height: 60px; flex-shrink: 0;
  background: rgba(19,21,42,.95);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  justify-content: space-between;
  padding: 0 20px; z-index: 100;
  position: relative;
}
.cb-logo {
  font-family: var(--fh); font-weight: 800; font-size: 18px;
  color: var(--blue); display: flex; align-items: center; gap: 7px;
}
.cb-logo .ic { display: inline-block; animation: wiggle 2.8s ease-in-out infinite; }
.cb-room { display: flex; flex-direction: column; align-items: center; gap: 1px; }
.cb-room-name  { font-family: var(--fh); font-weight: 700; font-size: 15px; }
.cb-room-count { font-size: 12px; color: var(--muted); }
.cb-user {
  font-size: 13px; font-weight: 600; color: #93b4ff;
  background: rgba(91,124,250,.12); padding: 5px 14px; border-radius: 20px;
  min-width: 60px; text-align: center;
}

.chat-body { display: flex; flex: 1; overflow: hidden; }

/* Sidebar salons */
.s-rooms {
  width: 228px; flex-shrink: 0;
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column; overflow: hidden;
}
.s-head {
  padding: 14px 16px;
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .9px;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.s-head .plus-btn {
  width: 24px; height: 24px;
  background: var(--blue2); border: none; border-radius: 6px;
  color: #fff; font-size: 20px; font-weight: 300;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  line-height: 1; transition: all .15s;
}
.s-head .plus-btn:hover { background: var(--blue3); transform: scale(1.12) rotate(90deg); }

.rooms-list { flex: 1; overflow-y: auto; padding: 6px; }
.room-row {
  padding: 10px 12px; border-radius: 10px; cursor: pointer;
  margin-bottom: 2px; transition: all .14s;
  border: 1px solid transparent;
}
.room-row:hover { background: var(--bg3); }
.room-row.on {
  background: rgba(91,124,250,.12);
  border-color: rgba(91,124,250,.26);
}
.room-row-name { font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.room-row-info { display: flex; gap: 8px; margin-top: 3px; }
.r-chip { font-size: 11px; color: var(--muted); display: flex; align-items: center; gap: 2px; }
.r-chip.v { color: #6dd5f9; }

/* Zone centrale */
.chat-main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }

/* Barre voix */
.voice-bar {
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  padding: 8px 14px;
  display: flex; align-items: flex-start; gap: 12px; flex-wrap: wrap;
  flex-shrink: 0;
}
.voice-grid { display: flex; gap: 10px; flex-wrap: wrap; flex: 1; align-items: flex-start; }

/* ===== VOICE BOXES ===== */
.vb-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  width: 90px;
  flex-shrink: 0;
}
/* Talking glow sur le wrap */
.vb-wrap.talking .v-box {
  border-color: #34d39a;
  box-shadow: 0 0 0 3px rgba(52,211,154,.18), 0 0 16px rgba(52,211,154,.25);
}

/* Quand la vbox a une vidéo, aligner wave-row et ctrl-row */
.vb-wrap.has-video { width: 120px; }
.vb-wrap.has-video .vb-wave-row { width: 120px; }
.vb-wrap.has-video .vb-wave     { width: 120px; }
.vb-wrap.has-video .vb-ctrl-row { width: 120px; }

.v-box {
  width: 90px; height: 80px;
  background: linear-gradient(145deg, rgba(30,35,60,.9), rgba(15,23,42,.95));
  border: 2px solid rgba(255,255,255,.08);
  border-radius: 12px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; font-size: 12px; font-weight: 600;
  position: relative; overflow: hidden;
  transition: border-color .25s, box-shadow .25s;
}

/* Vidéo dans vbox — contenue, pas géante */
.v-box.has-video {
  width: 120px;
  height: 90px;
}
.v-box.has-video video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; border-radius: 10px;
}
.v-box.has-video .vb-mic-icon { display: none; }

.vb-mic-icon {
  font-size: 22px; position: relative; z-index: 1;
  filter: drop-shadow(0 0 6px rgba(91,124,250,.5));
}
.vb-name {
  font-size: 10px; font-weight: 700; position: relative; z-index: 1;
  max-width: 80px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: rgba(255,255,255,.85);
  letter-spacing: .3px;
}

/* ── Visualiseur canvas ── */
.vb-wave-row {
  width: 90px; height: 26px;
  background: rgba(91,124,250,.06);
  border: 1px solid rgba(91,124,250,.12);
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
}
.vb-wave { display: block; width: 90px; height: 26px; }

/* ── Contrôles mute/volume ── */
.vb-ctrl-row {
  display: flex; align-items: center; gap: 5px;
  width: 90px;
}
.vb-btn {
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1);
  border-radius: 7px; color: var(--text);
  cursor: pointer; font-size: 14px; padding: 3px 6px;
  flex-shrink: 0; transition: background .15s, border-color .15s; line-height: 1;
}
.vb-btn:hover  { background: rgba(91,124,250,.2); border-color: rgba(91,124,250,.4); }
.vb-btn.muted  { color: #f87171; border-color: rgba(248,113,113,.3); }
.vb-vol {
  flex: 1; height: 4px;
  accent-color: var(--blue); cursor: pointer;
  min-width: 0; opacity: .7;
  transition: opacity .15s;
}
.vb-vol:hover { opacity: 1; }
.v-controls { display:flex; flex-direction:column; gap:6px; }
.v-btn {
  padding: 7px 13px; border-radius: 8px;
  border: 1px solid var(--border2); background: var(--card);
  color: var(--text); font-size: 12px; font-weight: 600; font-family: var(--fb);
  cursor: pointer; transition: all .14s; white-space: nowrap;
}
.v-btn:hover { background: var(--card2); }
.v-btn.on    { background:rgba(91,124,250,.2); border-color:var(--blue); color:#93b4ff; }
.v-btn.cam   { background:rgba(139,92,246,.2); border-color:var(--purple); color:#c4b5fd; }

/* Messages */
.msgs-area { flex:1; overflow-y:auto; padding:16px; display:flex; flex-direction:column; gap:2px; }

.empty-room {
  margin: auto; text-align: center; color: var(--muted);
}
.empty-room .ec {
  font-size: 54px; display: block; margin-bottom: 14px;
  animation: bounce 1.8s ease-in-out infinite;
}
@keyframes bounce {
  0%,100% { transform: translateY(0) rotate(-6deg); }
  40%      { transform: translateY(-14px) rotate(7deg); }
  65%      { transform: translateY(-6px) rotate(2deg); }
}
.empty-room p { font-family: var(--fh); font-size:15px; font-weight:700; margin-bottom:6px; }
.empty-room small { font-size:13px; color: var(--muted2); }

.msg { display:flex; gap:10px; padding:3px 0; }
.msg:hover .msg-acts { opacity:1; }
.m-ava {
  width:34px; height:34px; border-radius:50%; flex-shrink:0;
  display:flex; align-items:center; justify-content:center;
  font-weight:800; font-size:13px; margin-top:3px;
}
.m-ava.h { background:linear-gradient(135deg,#4568f5,#2c4ae0); }
.m-ava.f { background:linear-gradient(135deg,#8b5cf6,#6d3ed4); }
.m-ava.a { background:linear-gradient(135deg,#06b6d4,#0891b2); }
.m-body { flex:1; min-width:0; }
.m-head { display:flex; align-items:baseline; gap:7px; margin-bottom:2px; flex-wrap:wrap; }
.m-pseudo { font-size:13px; font-weight:700; cursor:pointer; }
.m-pseudo.h { color:#7ba4ff; }
.m-pseudo.f { color:#b09eff; }
.m-pseudo.a { color:#67e8f9; }
.m-pseudo:hover { text-decoration:underline; }
.m-genre  { font-size:11px; color:var(--muted); }
.m-dist   { font-size:11px; color:var(--muted); background:rgba(255,255,255,.05); padding:1px 7px; border-radius:5px; }
.m-time   { font-size:11px; color:var(--muted2); margin-left:auto; }
.m-text   { font-size:14px; color:var(--text2); line-height:1.6; word-break:break-word; }
.msg-acts { display:flex; gap:4px; margin-top:4px; opacity:0; transition:opacity .15s; }
.m-btn    { background:var(--bg3); border:none; border-radius:5px; padding:3px 9px; font-size:12px; cursor:pointer; color:var(--muted); font-family:var(--fb); transition:all .1s; }
.m-btn:hover { background:var(--card); color:var(--text); }
.m-sys    { text-align:center; font-size:12px; color:var(--muted2); padding:5px; font-style:italic; }

/* Zone de saisie */
.msg-bar {
  display: flex;          /* visible par défaut sur desktop */
  flex-direction: column;
  padding: 0;
  background: var(--bg2);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.msg-bar.hidden {
  display: none !important;
}
.msg-toolbar {
  display: flex; align-items: center; gap: 4px;
  padding: 6px 12px 4px;
  border-bottom: 1px solid rgba(255,255,255,.04);
  position: relative; /* pour le panneau font positionné en absolute */
}
@keyframes fontPanelIn {
  from { opacity: 0; margin-bottom: -6px; }
  to   { opacity: 1; margin-bottom: 0; }
}
#fontPanel[style*="block"] {
  animation: fontPanelIn .15s ease;
}
.msg-form { display:flex; gap:8px; padding: 8px 12px; }
.msg-form input { flex:1; }

/* Sidebar users */
.s-users {
  width: 208px; flex-shrink: 0;
  background: var(--bg2);
  border-left: 1px solid var(--border);
  display: flex; flex-direction: column; overflow: hidden;
}
.users-list { flex:1; overflow-y:auto; padding:6px; }
.u-row {
  display:flex; align-items:center; gap:10px;
  padding:8px 10px; border-radius:10px;
  cursor:pointer; transition:all .14s;
}
.u-row:hover { background:var(--bg3); }
.u-ava {
  width:32px; height:32px; border-radius:50%;
  display:flex; align-items:center; justify-content:center;
  font-weight:800; font-size:12px; flex-shrink:0;
}
.u-ava.h { background:linear-gradient(135deg,#4568f5,#2c4ae0); }
.u-ava.f { background:linear-gradient(135deg,#8b5cf6,#6d3ed4); }
.u-ava.a { background:linear-gradient(135deg,#06b6d4,#0891b2); }
.u-name { font-size:13px; font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.u-dist { font-size:11px; color:var(--muted); }
.badge { background:rgba(91,124,250,.2); color:#93b4ff; padding:2px 8px; border-radius:10px; font-size:11px; font-weight:700; }

/* ========== MODALS ========== */
.modal { position:fixed; inset:0; z-index:1000; display:flex; align-items:center; justify-content:center; }
.modal-bg { position:absolute; inset:0; background:rgba(0,0,0,.75); backdrop-filter:blur(6px); }
.modal-box {
  position:relative; z-index:1;
  background:var(--card); border:1.5px solid var(--border2);
  border-radius:var(--r2); padding:32px;
  width:100%; max-width:450px;
  box-shadow:0 8px 48px rgba(0,0,0,.55);
  animation:modalIn .22s ease both;
}
@keyframes modalIn { from{opacity:0;transform:scale(.93) translateY(14px)} to{opacity:1;transform:scale(1) translateY(0)} }
.modal-box h3 { font-family:var(--fh); font-size:18px; font-weight:800; margin-bottom:22px; }
.modal-foot { display:flex; gap:10px; justify-content:flex-end; margin-top:10px; }

/* MP */
.modal-pm { max-width:500px; display:flex; flex-direction:column; height:520px; }
.pm-top  { display:flex; align-items:center; justify-content:space-between; margin-bottom:16px; }
.pm-top h3 { font-size:16px; margin:0; }
.pm-msgs { flex:1; overflow-y:auto; display:flex; flex-direction:column; gap:10px; padding:4px 0; }
.pm-form { display:flex; gap:8px; margin-top:12px; }
.pm-form input { flex:1; }
.pm-b { max-width:82%; padding:9px 14px; border-radius:12px; font-size:14px; line-height:1.55; }
.pm-b.me    { background:rgba(91,124,250,.18); border:1px solid rgba(91,124,250,.28); align-self:flex-end; }
.pm-b.other { background:var(--bg3); border:1px solid var(--border); align-self:flex-start; }
.pm-who { font-size:11px; font-weight:700; color:var(--muted); margin-bottom:4px; }

/* Menu contextuel */
.ctx {
  position:fixed; z-index:2000;
  background:var(--card2); border:1.5px solid var(--border2);
  border-radius:10px; padding:6px; box-shadow:0 8px 32px rgba(0,0,0,.5);
  min-width:170px; animation:modalIn .15s ease both;
}
.ctx-i { padding:9px 14px; font-size:13px; cursor:pointer; border-radius:7px; transition:all .1s; }
.ctx-i:hover { background:var(--bg3); }
.ctx-i.danger { color:var(--red); }
.ctx-i.danger:hover { background:rgba(241,65,108,.1); }

/* Toast */
.toast {
  position:fixed; bottom:24px; right:24px; z-index:9999;
  padding:13px 22px; border-radius:12px; font-size:14px; font-weight:600;
  font-family:var(--fb); max-width:320px;
  box-shadow:0 6px 28px rgba(0,0,0,.5);
  animation:toastIn .22s ease;
}
.toast.e { background:var(--red);   color:#fff; }
.toast.s { background:var(--green); color:#111; }
.toast.i { background:var(--blue2); color:#fff; }
@keyframes toastIn { from{opacity:0;transform:translateX(16px)} to{opacity:1;transform:translateX(0)} }

/* Scrollbar */
::-webkit-scrollbar { width:5px; }
::-webkit-scrollbar-track { background:transparent; }
::-webkit-scrollbar-thumb { background:var(--muted2); border-radius:3px; }
::-webkit-scrollbar-thumb:hover { background:var(--muted); }

/* Animations globales */
@keyframes fadeUp { from{opacity:0;transform:translateY(18px)} to{opacity:1;transform:translateY(0)} }

/* Responsive */
@media (max-width:768px) {
  .navbar { padding: 0 16px; }
}

/* =============================================
   NOUVEAUTÉS v4
   ============================================= */

/* ========== NOTIF BADGE ========== */
.notif-badge {
  position: absolute;
  top: -5px; right: -5px;
  min-width: 18px; height: 18px;
  background: var(--red);
  color: #fff;
  font-size: 11px; font-weight: 700;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 4px;
  animation: popIn .25s cubic-bezier(.34,1.56,.64,1) both;
  border: 2px solid var(--bg2);
  pointer-events: none;
}
@keyframes popIn {
  from { transform: scale(0); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

/* Room item avec badge */
.room-row { position: relative; }

/* Notification flash sur message entrant */
.msg-new-flash {
  animation: msgFlash .4s ease both;
}
@keyframes msgFlash {
  0%   { background: rgba(91,124,250,.18); }
  100% { background: transparent; }
}

/* ========== TYPING INDICATOR ========== */
.typing-bar {
  padding: 4px 16px 6px;
  min-height: 22px;
  font-size: 12px;
  color: var(--muted);
  font-style: italic;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg2);
}
.typing-dots {
  display: flex; gap: 3px; align-items: center;
}
.typing-dots span {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--blue);
  animation: typDot .9s ease-in-out infinite;
}
.typing-dots span:nth-child(2) { animation-delay: .15s; }
.typing-dots span:nth-child(3) { animation-delay: .30s; }
@keyframes typDot {
  0%,80%,100% { transform: scale(.7); opacity: .4; }
  40%          { transform: scale(1.1); opacity: 1; }
}

/* ========== PROFIL ========== */
.profile-page {
  min-height: calc(100vh - 64px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 48px 24px;
  position: relative; z-index: 1;
}

.profile-wrap {
  width: 100%; max-width: 660px;
  display: flex; flex-direction: column; gap: 20px;
}

.profile-hero {
  background: var(--card);
  border: 1.5px solid var(--border2);
  border-radius: var(--r2);
  padding: 36px;
  display: flex; align-items: center; gap: 28px;
  animation: fadeUp .5s ease both;
  position: relative; overflow: hidden;
}
.profile-hero::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: linear-gradient(90deg, var(--blue2), var(--purple));
}

.profile-avatar-wrap { position: relative; flex-shrink: 0; }
.profile-avatar {
  width: 84px; height: 84px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 32px; font-weight: 800;
  border: 3px solid var(--border2);
  cursor: pointer;
  transition: all .2s;
  position: relative;
}
.profile-avatar:hover { border-color: var(--blue); transform: scale(1.05); }
.profile-avatar.h  { background: linear-gradient(135deg,#4568f5,#2c4ae0); }
.profile-avatar.f  { background: linear-gradient(135deg,#8b5cf6,#6d3ed4); }
.profile-avatar.a  { background: linear-gradient(135deg,#06b6d4,#0891b2); }
.avatar-online {
  position: absolute; bottom: 4px; right: 4px;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--green);
  border: 2px solid var(--card);
  animation: pdot 2s ease-in-out infinite;
}

.profile-info { flex: 1; min-width: 0; }
.profile-pseudo {
  font-family: var(--fh); font-size: 22px; font-weight: 800;
  letter-spacing: -.4px; margin-bottom: 4px;
  display: flex; align-items: center; gap: 10px;
}
.profile-genre-badge {
  font-size: 12px; font-weight: 600;
  padding: 3px 10px; border-radius: 20px;
}
.profile-genre-badge.h { background: rgba(69,104,245,.2); color: #7ba4ff; }
.profile-genre-badge.f { background: rgba(139,92,246,.2); color: #c4b5fd; }
.profile-genre-badge.a { background: rgba(6,182,212,.2);  color: #67e8f9; }
.profile-meta {
  font-size: 13px; color: var(--muted); margin-bottom: 10px;
  display: flex; gap: 14px; flex-wrap: wrap;
}
.profile-meta span { display: flex; align-items: center; gap: 5px; }
.profile-bio {
  font-size: 14px; color: var(--text2); line-height: 1.6;
  font-style: italic;
}

.profile-card {
  background: var(--card);
  border: 1.5px solid var(--border2);
  border-radius: var(--r2);
  padding: 28px 32px;
  animation: fadeUp .5s .08s ease both;
}
.profile-card h3 {
  font-family: var(--fh); font-size: 15px; font-weight: 700;
  margin-bottom: 20px; color: var(--text2);
  display: flex; align-items: center; gap: 8px;
}

.profile-stats {
  display: grid; grid-template-columns: repeat(3,1fr); gap: 12px;
  margin-bottom: 4px;
}
.stat-box {
  background: var(--bg3); border-radius: var(--r);
  padding: 16px; text-align: center;
  border: 1px solid var(--border);
  transition: all .18s;
}
.stat-box:hover { background: var(--card2); border-color: var(--border2); }
.stat-val {
  font-family: var(--fh); font-size: 24px; font-weight: 800;
  color: var(--blue); display: block; margin-bottom: 4px;
}
.stat-lbl { font-size: 12px; color: var(--muted); }

.profile-form .form-group { margin-bottom: 16px; }
.profile-actions {
  display: flex; gap: 10px; justify-content: flex-end; margin-top: 8px;
}

/* Danger zone */
.danger-zone {
  background: rgba(241,65,108,.07);
  border: 1.5px solid rgba(241,65,108,.2);
  border-radius: var(--r2);
  padding: 24px 32px;
  animation: fadeUp .5s .16s ease both;
}
.danger-zone h3 {
  font-family: var(--fh); font-size: 15px; font-weight: 700;
  color: var(--red); margin-bottom: 10px;
  display: flex; align-items: center; gap: 8px;
}
.danger-zone p { font-size: 13px; color: var(--muted); margin-bottom: 16px; }

/* ========== PAGE 404 ========== */
.page-404 {
  min-height: 100vh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center; padding: 24px;
  position: relative; z-index: 1;
}

.p404-cocos {
  font-size: 72px;
  margin-bottom: 16px;
  display: flex; gap: 12px; align-items: flex-end;
  animation: fadeUp .6s ease both;
}
.p404-cocos .c1 { animation: tiltL 2.5s ease-in-out infinite; display:inline-block; }
.p404-cocos .c2 { font-size: 100px; animation: bounce404 1.6s ease-in-out infinite; display:inline-block; }
.p404-cocos .c3 { animation: tiltR 2.5s ease-in-out infinite; display:inline-block; }

@keyframes bounce404 {
  0%,100% { transform: translateY(0); }
  40%      { transform: translateY(-20px); }
  65%      { transform: translateY(-8px); }
}
@keyframes tiltL { 0%,100%{transform:rotate(-12deg)} 50%{transform:rotate(5deg) translateY(-6px)} }
@keyframes tiltR { 0%,100%{transform:rotate( 12deg)} 50%{transform:rotate(-5deg) translateY(-6px)} }

.p404-code {
  font-family: var(--fh); font-size: clamp(80px,14vw,140px); font-weight: 800;
  background: linear-gradient(135deg, var(--blue), var(--purple));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1; margin-bottom: 12px;
  animation: fadeUp .6s .1s ease both;
}
.p404-title {
  font-family: var(--fh); font-size: clamp(20px,4vw,28px); font-weight: 700;
  margin-bottom: 12px;
  animation: fadeUp .6s .18s ease both;
}
.p404-sub {
  font-size: 16px; color: var(--muted); max-width: 420px;
  line-height: 1.7; margin-bottom: 36px;
  animation: fadeUp .6s .26s ease both;
}
.p404-btns {
  display: flex; gap: 14px; flex-wrap: wrap; justify-content: center;
  animation: fadeUp .6s .34s ease both;
}

/* Cocos qui tombent sur 404 */
.p404-fall {
  position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 0;
}
.p404-fall span {
  position: absolute; top: -60px; opacity: 0;
  animation: fall linear infinite;
  font-size: 28px;
}
.p404-fall span:nth-child(1)  { left: 8%;  font-size:24px; animation-duration:3.5s; animation-delay:0s;    }
.p404-fall span:nth-child(2)  { left:20%;  font-size:36px; animation-duration:4.2s; animation-delay:-.8s;  }
.p404-fall span:nth-child(3)  { left:33%;  font-size:20px; animation-duration:3.8s; animation-delay:-1.6s; }
.p404-fall span:nth-child(4)  { left:47%;  font-size:40px; animation-duration:4.5s; animation-delay:-2.4s; }
.p404-fall span:nth-child(5)  { left:60%;  font-size:22px; animation-duration:3.2s; animation-delay:-3.2s; }
.p404-fall span:nth-child(6)  { left:72%;  font-size:32px; animation-duration:4.8s; animation-delay:-.4s;  }
.p404-fall span:nth-child(7)  { left:84%;  font-size:18px; animation-duration:3.6s; animation-delay:-1.2s; }
.p404-fall span:nth-child(8)  { left:91%;  font-size:28px; animation-duration:4.0s; animation-delay:-2.0s; }

@keyframes fall {
  0%   { transform: translateY(0)    rotate(0deg);   opacity:0;   }
  8%   { opacity: .55; }
  90%  { opacity: .55; }
  100% { transform: translateY(105vh) rotate(300deg); opacity:0;  }
}

/* =============================================
   v5 — EMOJIS, IMAGES, VOCAL, GIF, AVATARS, RÔLES
   ============================================= */

/* ===== BARRE D'OUTILS MESSAGES ===== */
/* msg-toolbar — voir .msg-bar ci-dessus */
.tool-btn {
  width: 34px; height: 34px;
  background: transparent; border: none;
  border-radius: 8px; cursor: pointer;
  font-size: 18px; display: flex; align-items: center; justify-content: center;
  transition: background .14s, transform .1s;
  color: var(--muted); position: relative;
}
.tool-btn:hover { background: var(--bg3); color: var(--text); transform: scale(1.12); }
.tool-btn.active { background: rgba(91,124,250,.15); color: var(--blue); }
.tool-btn input[type="file"] {
  position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%;
}

/* ===== PICKER EMOJI ===== */
/* Emoji & GIF pickers — s'ouvrent vers le haut sur mobile */
@media (max-width: 768px) {
  .emoji-picker, .gif-picker {
    bottom: calc(100% + 4px) !important;
    top: auto !important;
    left: 0 !important;
    right: auto !important;
    width: min(340px, 96vw) !important;
    max-height: 280px !important;
  }
}
.emoji-picker {
  position: fixed;
  background: var(--card2); border: 1.5px solid var(--border2);
  border-radius: var(--r2); padding: 12px;
  width: 320px; max-height: 300px;
  box-shadow: 0 -8px 32px rgba(0,0,0,.45);
  z-index: 9999; display: none;
  flex-direction: column; gap: 8px;
  animation: modalIn .18s ease both;
}
.emoji-picker.open { display: flex; }
.emoji-search {
  padding: 7px 12px; border-radius: 8px;
  background: var(--bg3); border: 1px solid var(--border2);
  color: var(--text); font-size: 13px; font-family: var(--fb);
  width: 100%;
}
.emoji-search:focus { outline: none; border-color: var(--blue); }
.emoji-cats { display: flex; gap: 4px; flex-wrap: wrap; }
.emoji-cat {
  padding: 3px 8px; border-radius: 6px; border: none;
  background: var(--bg3); color: var(--text2); font-size: 12px;
  cursor: pointer; transition: all .12s;
}
.emoji-cat:hover, .emoji-cat.on { background: rgba(91,124,250,.2); color: var(--blue); }
.emoji-grid {
  display: grid; grid-template-columns: repeat(8,1fr);
  gap: 2px; overflow-y: auto; max-height: 200px;
}
.emoji-grid button {
  background: none; border: none; cursor: pointer;
  font-size: 20px; padding: 4px; border-radius: 6px;
  transition: background .1s, transform .1s;
  line-height: 1;
}
.emoji-grid button:hover { background: var(--bg3); transform: scale(1.25); }

/* ===== PICKER GIF ===== */
.gif-picker {
  position: fixed;
  background: var(--card2); border: 1.5px solid var(--border2);
  border-radius: var(--r2); padding: 12px;
  width: 340px; max-height: 360px;
  box-shadow: 0 -8px 32px rgba(0,0,0,.45);
  z-index: 9999; display: none; flex-direction: column; gap: 8px;
  animation: modalIn .18s ease both;
}
.gif-picker.open { display: flex; }
.gif-search-row { display: flex; gap: 6px; }
.gif-search-row input { flex: 1; }
.gif-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 6px; overflow-y: auto;
  max-height: 270px;   /* desktop */
  -webkit-overflow-scrolling: touch;
}
.gif-item {
  border-radius: 8px; overflow: hidden; cursor: pointer;
  aspect-ratio: 16/9; background: var(--bg3);
  transition: transform .15s, box-shadow .15s;
  position: relative;
}
.gif-item:hover { transform: scale(1.04); box-shadow: 0 4px 14px rgba(0,0,0,.4); }
.gif-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gif-loading { text-align: center; color: var(--muted); font-size: 13px; padding: 20px; }
.gif-powered { font-size: 10px; color: var(--muted2); text-align: right; margin-top: 2px; }

/* ===== MESSAGES IMAGES / GIF ===== */
.msg-image {
  max-width: 300px; max-height: 250px;
  border-radius: 10px; margin-top: 6px;
  cursor: pointer; display: block;
  border: 1px solid var(--border2);
  transition: transform .15s;
}
.msg-image:hover { transform: scale(1.02); }
.msg-gif {
  max-width: 260px; border-radius: 10px;
  margin-top: 6px; display: block;
  border: 1px solid var(--border);
}
.gif-badge {
  display: inline-block; font-size: 10px; font-weight: 700;
  background: var(--blue2); color: #fff;
  padding: 1px 5px; border-radius: 4px; margin-left: 5px;
  vertical-align: middle;
}

/* ===== MESSAGES VOCAUX ===== */
.msg-audio {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg3); border: 1px solid var(--border2);
  border-radius: 24px; padding: 8px 14px; margin-top: 6px;
  max-width: 280px;
}
.audio-play {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--blue2); border: none; cursor: pointer;
  color: #fff; font-size: 13px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: all .15s;
}
.audio-play:hover { background: var(--blue3); transform: scale(1.08); }
.audio-wave {
  flex: 1; display: flex; align-items: center; gap: 2px; height: 24px;
}
.audio-wave span {
  width: 3px; border-radius: 2px;
  background: var(--blue);
  animation: waveDance 1s ease-in-out infinite;
}
.audio-wave span:nth-child(2){animation-delay:.1s; height:60%}
.audio-wave span:nth-child(3){animation-delay:.2s; height:100%}
.audio-wave span:nth-child(4){animation-delay:.3s; height:70%}
.audio-wave span:nth-child(5){animation-delay:.4s; height:45%}
.audio-wave span:nth-child(6){animation-delay:.5s; height:85%}
.audio-wave span:nth-child(7){animation-delay:.6s; height:55%}
.audio-wave span:nth-child(8){animation-delay:.7s; height:40%}
.audio-wave.paused span { animation-play-state: paused; }
@keyframes waveDance {
  0%,100% { transform: scaleY(1); opacity:.7; }
  50%      { transform: scaleY(1.6); opacity:1; }
}
.audio-dur { font-size: 12px; color: var(--muted); white-space: nowrap; }

/* Bouton enregistrement */
.rec-btn {
  width: 34px; height: 34px; border-radius: 8px;
  background: transparent; border: none; cursor: pointer;
  font-size: 18px; display: flex; align-items: center; justify-content: center;
  transition: all .15s; color: var(--muted); flex-shrink: 0;
}
.rec-btn:hover { background: var(--bg3); color: var(--red); }
.rec-btn.recording {
  background: rgba(241,65,108,.15); color: var(--red);
  animation: recPulse 1s ease-in-out infinite;
}
@keyframes recPulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(241,65,108,.4); }
  50%      { box-shadow: 0 0 0 8px rgba(241,65,108,0); }
}

/* ===== LIGHTBOX IMAGE ===== */
.lightbox {
  position: fixed; inset: 0; z-index: 3000;
  background: rgba(0,0,0,.9); backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  cursor: zoom-out; animation: fadeIn .2s ease;
}
.lightbox img {
  max-width: 90vw; max-height: 90vh;
  border-radius: 12px; box-shadow: 0 20px 60px rgba(0,0,0,.8);
}
.lightbox-close {
  position: absolute; top: 20px; right: 24px;
  background: none; border: none; color: #fff;
  font-size: 28px; cursor: pointer; opacity: .7;
  transition: opacity .15s;
}
.lightbox-close:hover { opacity: 1; }

/* ===== AVATARS ===== */
.m-ava img, .u-ava img {
  width: 100%; height: 100%; object-fit: cover;
  border-radius: 50%;
}

/* ===== RÔLES dans la liste utilisateurs ===== */
.role-icon {
  font-size: 12px; line-height: 1; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
/* Admin */
.role-admin  { color: #fbbf24; } /* ⭐ jaune */
/* Modo (propriétaire du salon) */
.role-owner  { color: #a78bfa; } /* 💜 violet */
/* Modo assigné */
.role-mod    { color: #34d399; } /* 💚 vert */
/* User normal */
.role-user   { color: #60a5fa; } /* 💙 bleu */

.u-row-right { display: flex; align-items: center; gap: 5px; margin-left: auto; }

/* Barre d'enregistrement en cours */
.rec-bar {
  padding: 6px 16px;
  background: rgba(241,65,108,.1);
  border-top: 1px solid rgba(241,65,108,.2);
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; color: var(--red); display: none;
}
.rec-timer { font-weight: 700; font-family: var(--fh); }
.rec-cancel { background: none; border: 1px solid rgba(241,65,108,.4); border-radius: 6px; padding: 3px 10px; color: var(--red); cursor: pointer; font-size: 12px; font-family: var(--fb); }

/* ===== PREVIEW IMAGE AVANT ENVOI ===== */
.img-preview {
  padding: 8px 16px 0;
  display: none; align-items: center; gap: 10px;
}
.img-preview img {
  width: 60px; height: 60px; object-fit: cover;
  border-radius: 8px; border: 1px solid var(--border2);
}
.img-preview-name { font-size: 12px; color: var(--muted); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.img-preview-rm { background: none; border: none; color: var(--red); cursor: pointer; font-size: 16px; }

/* =============================================
   MENTIONS + PSEUDO POPUP
   ============================================= */

/* Mention surlignée */
.mention-me {
  background: rgba(91,124,250,.22);
  color: #93b4ff;
  border-radius: 4px;
  padding: 1px 5px;
  font-weight: 700;
  animation: mentionPop .4s ease both;
}
@keyframes mentionPop {
  0%   { background: rgba(91,124,250,.5); }
  100% { background: rgba(91,124,250,.22); }
}

/* Message qui contient une mention de moi */
.msg.mentioned {
  background: rgba(91,124,250,.07);
  border-left: 3px solid var(--blue);
  padding-left: 10px;
  border-radius: 0 8px 8px 0;
  margin-left: -13px;
}

/* Mini popup pseudo */
.pseudo-popup {
  position: fixed;
  z-index: 2500;
  background: var(--card2);
  border: 1.5px solid var(--border2);
  border-radius: 12px;
  padding: 10px 8px;
  min-width: 185px;
  box-shadow: 0 8px 32px rgba(0,0,0,.55);
  animation: modalIn .15s ease both;
}

.pp-name {
  font-family: var(--fh);
  font-size: 13px;
  font-weight: 700;
  color: var(--blue);
  padding: 2px 8px 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 6px;
}

.pp-btn {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  background: none;
  border: none;
  color: var(--text2);
  font-size: 13px;
  font-family: var(--fb);
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: all .12s;
  text-align: left;
}
.pp-btn:hover { background: var(--bg3); color: var(--text); }
.pp-btn span  { font-size: 15px; width: 20px; text-align: center; flex-shrink: 0; }

.pp-block   { color: var(--muted); }
.pp-block:hover   { color: var(--red) !important; background: rgba(241,65,108,.08) !important; }
.pp-unblock { color: var(--green); }
.pp-unblock:hover { background: rgba(34,211,165,.08) !important; }

/* =============================================
   MODÉRATION
   ============================================= */

/* Panel modération (dans le ctx menu) */
.ctx-section {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .8px; color: var(--muted2);
  padding: 6px 14px 2px;
}

/* Modal modération */
.mod-modal { max-width: 420px; }
.mod-modal h3 { margin-bottom: 6px; }
.mod-target {
  font-size: 13px; color: var(--muted);
  margin-bottom: 20px; padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.mod-target strong { color: var(--text); }
.mod-actions { display: flex; flex-direction: column; gap: 8px; }
.mod-action-btn {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: var(--r);
  background: var(--bg3); border: 1px solid var(--border);
  color: var(--text2); font-size: 14px; font-family: var(--fb);
  cursor: pointer; transition: all .15s; text-align: left; width: 100%;
}
.mod-action-btn:hover { background: var(--card2); border-color: var(--border2); color: var(--text); }
.mod-action-btn .ico { font-size: 20px; width: 28px; text-align: center; flex-shrink: 0; }
.mod-action-btn .lbl { font-weight: 600; font-size: 13px; display: block; }
.mod-action-btn .sub { font-size: 11px; color: var(--muted); display: block; margin-top: 1px; }
.mod-action-btn.danger:hover { background: rgba(241,65,108,.1); border-color: rgba(241,65,108,.3); color: var(--red); }
.mod-action-btn.warn:hover   { background: rgba(251,191,36,.08); border-color: rgba(251,191,36,.3); color: #fbbf24; }
.mod-action-btn.success:hover { background: rgba(34,211,165,.08); border-color: rgba(34,211,165,.3); color: var(--green); }

/* Panel durée mute */
.mute-durations { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.mute-dur-btn {
  padding: 6px 14px; border-radius: 8px;
  border: 1px solid var(--border2); background: var(--bg3);
  color: var(--text2); font-size: 13px; font-weight: 600;
  cursor: pointer; transition: all .14s; font-family: var(--fb);
}
.mute-dur-btn:hover, .mute-dur-btn.on {
  background: rgba(91,124,250,.15); border-color: var(--blue); color: #93b4ff;
}

/* Message supprimé */
.msg-deleted {
  opacity: .4; font-style: italic; font-size: 13px;
  color: var(--muted); pointer-events: none;
}

/* Bouton supprimer message au hover */
.m-btn.del:hover { background: rgba(241,65,108,.15); color: var(--red); }

/* Badge muet dans liste users */
.u-muted { font-size: 12px; opacity: .7; }

/* Bannière muet pour l'utilisateur lui-même */
.muted-bar {
  background: rgba(241,65,108,.1);
  border-top: 1px solid rgba(241,65,108,.2);
  padding: 8px 16px;
  font-size: 13px; color: #ff8fab;
  display: flex; align-items: center; gap: 8px;
}

/* ===== GESTION SALON ===== */
.room-settings-btn {
  background: none; border: none; cursor: pointer;
  font-size: 16px; opacity: .6; transition: opacity .15s, transform .2s;
  padding: 2px 4px; border-radius: 6px;
}
.room-settings-btn:hover { opacity: 1; transform: rotate(45deg); }

.cb-room-desc {
  font-size: 12px; color: var(--muted2);
  max-width: 300px; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}

.room-settings-tabs {
  display: flex; gap: 4px;
  margin-bottom: 16px; padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.rs-tab {
  padding: 6px 16px; border-radius: 8px;
  border: 1px solid var(--border2); background: var(--bg3);
  color: var(--text2); font-size: 13px; font-weight: 600;
  cursor: pointer; transition: all .14s; font-family: var(--fb);
}
.rs-tab:hover, .rs-tab.on {
  background: rgba(91,124,250,.15);
  border-color: var(--blue); color: #93b4ff;
}
.rs-panel { animation: fadeIn .18s ease; }
.rs-user-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px; border-radius: 8px;
  background: var(--bg3); border: 1px solid var(--border);
  margin-bottom: 6px; gap: 10px;
}
.rs-user-row.rs-expired { opacity: .5; }
.rs-list { max-height: 220px; overflow-y: auto; }

/* ===== ZÉBRURE MESSAGES ===== */
.msg-even {
  background: rgba(255,255,255,.025);
  border-radius: 10px;
}

/* ===== NOTIFICATIONS PM ===== */
.toast-pm {
  cursor: pointer;
  border-left: 3px solid var(--blue) !important;
  padding: 12px 16px !important;
}
.toast-pm:hover { opacity: .9; }

/* ===== AMIS ===== */
#friendReqBadge {
  display: none;
  position: absolute;
  top: -4px; right: -4px;
  background: #f1416c; color: #fff;
  border-radius: 50%;
  font-size: 9px; font-weight: 700;
  width: 14px; height: 14px;
  align-items: center; justify-content: center;
  pointer-events: none;
}

/* ===== COMMANDES SLASH ===== */
.m-sys-local {
  color: #93b4ff;
  border-left: 2px solid rgba(91,124,250,.4);
  padding-left: 8px;
  font-style: italic;
}
.m-sys-local b { color: #c4d4ff; font-style: normal; }

.cmd-suggestions {
  position: absolute; bottom: 100%; left: 0; right: 0;
  background: var(--card2); border: 1px solid var(--border2);
  border-radius: 10px 10px 0 0; overflow: hidden;
  box-shadow: 0 -4px 20px rgba(0,0,0,.3);
  z-index: 50;
}
.cmd-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 14px; cursor: pointer;
  transition: background .12s; font-size: 13px;
}
.cmd-item:hover, .cmd-item.on { background: rgba(91,124,250,.15); }
.cmd-item-name { color: #93b4ff; font-weight: 700; font-family: monospace; min-width: 80px; }
.cmd-item-desc { color: var(--muted); font-size: 12px; }

/* ===== NOTICE SALON ===== */
#roomNotice {
  flex-shrink: 0;
  animation: slideDown .3s ease;
}
@keyframes slideDown { from { transform: translateY(-100%); opacity:0; } to { transform: none; opacity:1; } }

/* ===== VOICE BOX ===== */


/* ===== PM INBOX BADGE ===== */
#pmInboxBadge {
  display: none;
  position: absolute;
  top: -4px; right: -4px;
  background: #f1416c; color: #fff;
  border-radius: 50%;
  font-size: 9px; font-weight: 700;
  width: 14px; height: 14px;
  align-items: center; justify-content: center;
  pointer-events: none;
}

/* ===== VIDÉO DANS VBOX ===== */
/* ── Bouton détacher ── */
.vb-popout-btn {
  position: absolute;
  top: 4px; right: 4px;
  background: rgba(0,0,0,.6);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 6px;
  color: #fff; font-size: 12px;
  width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; z-index: 10;
  transition: background .15s, transform .1s;
  line-height: 1;
}
.vb-popout-btn:hover {
  background: rgba(91,124,250,.85);
  transform: scale(1.1);
}

/* ── Overlay pseudo sur vidéo ── */
.vb-vid-name {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  text-align: center;
  font-size: 10px; font-weight: 700;
  color: #fff;
  background: linear-gradient(transparent, rgba(0,0,0,.7));
  padding: 8px 4px 3px;
  z-index: 2;
  pointer-events: none;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ===== FENÊTRE CAMÉRA DÉTACHABLE ===== */
.vid-popout {
  position: fixed;
  top: 80px; right: 20px;
  width: 320px; height: 240px;
  background: #080e1a;
  border: 1px solid rgba(91,124,250,.35);
  border-radius: 14px;
  box-shadow: 0 12px 48px rgba(0,0,0,.7), 0 0 0 1px rgba(255,255,255,.04);
  z-index: 1000;
  display: flex; flex-direction: column;
  resize: both; overflow: hidden;
  min-width: 180px; min-height: 140px;
}
.vid-popout-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 10px;
  background: rgba(255,255,255,.04);
  border-bottom: 1px solid rgba(255,255,255,.07);
  cursor: move;
  flex-shrink: 0; height: 32px;
  user-select: none;
  font-size: 11px; font-weight: 700;
  color: rgba(255,255,255,.7);
  letter-spacing: .4px;
}
.vid-popout-bar button {
  background: none; border: none;
  color: rgba(255,255,255,.4); cursor: pointer;
  font-size: 16px; padding: 0 2px;
  line-height: 1; transition: color .15s;
}
.vid-popout-bar button:hover { color: #f87171; }

/* =============================================
   MOBILE — LAYOUT APP
   ============================================= */
@media (max-width: 768px) {

  /* ── Topbar ── */
  .cb-logo   { display: none; }
  .mob-hide  { display: none !important; }
  .chat-bar  { padding: 0 10px; height: 48px; }
  .cb-user   { font-size: 12px; padding: 3px 8px; }
  .cb-room   { gap: 0; }
  .cb-room-name { font-size: 13px; }
  .cb-room-count, .cb-room-desc { display: none; }
  .room-settings-btn { width: 30px; height: 30px; font-size: 14px; padding: 0; }

  body.chat-page {
    height: 100dvh;
    overflow: hidden;
  }
  body:not(.chat-page) { height: auto !important; overflow-y: auto !important; }

  /* navbar fixe en bas */
  .mobile-nav {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    z-index: 500;
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }

  /* chat-body = zone entre header et navbar */
  .chat-body {
    position: fixed;
    top: 48px;
    left: 0; right: 0;
    bottom: 56px;
    display: flex;
    overflow: visible; /* pas de clip — les pickers fixed doivent sortir */
  }

  /* Chat principal */
  .chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: visible;
    position: relative;
  }

  /* Zone messages : prend tout l'espace restant */
  .msgs-area {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    min-height: 0;
    overscroll-behavior: contain;
    padding-bottom: 4px;
  }

  /* ── Barre de saisie ── */
  .msg-bar {
    display: none;
    flex-shrink: 0;
    padding: 0;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    border-top: 2px solid var(--border);
    position: relative;
    z-index: 10;
  }
  .msg-bar:not(.hidden) {
    display: flex;
  }

  /* ── Toolbar smileys/gif/image/vocal ── */
  .msg-toolbar {
    display: flex !important;
    align-items: center;
    gap: 2px;
    padding: 6px 8px 4px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    flex-shrink: 0;
    border-bottom: 1px solid rgba(255,255,255,.06);
    min-height: 48px;
  }
  .msg-toolbar::-webkit-scrollbar { display: none; }

  /* Boutons toolbar bien tappables */
  .tool-btn {
    width: 42px !important;
    height: 42px !important;
    font-size: 20px !important;
    flex-shrink: 0;
    border-radius: 10px;
    display: flex !important;
    align-items: center;
    justify-content: center;
  }

  /* ── Zone input + bouton envoyer ── */
  .msg-form {
    display: flex !important;
    gap: 8px;
    padding: 8px 10px;
    width: 100%;
    box-sizing: border-box;
    align-items: center;
    min-height: 52px;
  }
  #msgIn {
    font-size: 16px !important; /* évite le zoom iOS */
    flex: 1 !important;
    min-width: 0;
    height: 38px;
    border-radius: 20px;
    padding: 0 14px;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
  }
  .msg-form .btn {
    flex-shrink: 0;
    padding: 0 14px;
    height: 38px;
    border-radius: 20px;
    white-space: nowrap;
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
  }
  /* S'assurer que le form lui-même est visible */
  .msg-form {
    display: flex !important;
    visibility: visible !important;
  }

  /* Pickers emoji/gif pleine largeur sur mobile */
  .emoji-picker, .gif-picker {
    position: fixed !important;
    bottom: 0 !important;
    top: auto !important;
    left: 0 !important;
    right: 0 !important;
    width: 100vw !important;
    max-width: 100vw !important;
    height: 50vh !important;
    max-height: 50vh !important;
    border-radius: 16px 16px 0 0 !important;
    z-index: 9999 !important;
    display: none;
    flex-direction: column;
  }
  .emoji-picker.open, .gif-picker.open {
    display: flex !important;
  }
  .gif-grid {
    flex: 1 !important;
    max-height: none !important;
    overflow-y: auto !important;
  }
  .emoji-grid {
    flex: 1 !important;
    overflow-y: auto !important;
  }

  /* ── Voice bar ── */
  .voice-bar  { padding: 5px 8px; gap: 6px; flex-shrink: 0; }
  .vb-wrap    { width: 70px; }
  .v-box      { width: 70px; height: 62px; }
  .v-box.has-video { width: 100px; height: 76px; }
  .vb-wave-row { width: 70px; height: 22px; }
  .vb-wave    { width: 70px; height: 22px; }
  .vb-ctrl-row { width: 70px; }
  .vb-wrap.has-video { width: 100px; }
  .vb-wrap.has-video .vb-wave-row { width: 100px; }
  .vb-wrap.has-video .vb-wave     { width: 100px; }
  .vb-wrap.has-video .vb-ctrl-row { width: 100px; }
  .vb-name    { font-size: 9px; }

  /* ── Sidebars ── */
  .s-rooms, .s-users {
    position: fixed !important;
    top: 48px; bottom: 56px; z-index: 400;
    background: var(--bg2) !important;
    transition: transform .22s cubic-bezier(.4,0,.2,1);
    overflow-y: auto; -webkit-overflow-scrolling: touch;
    width: 82vw !important; max-width: 300px;
  }
  .s-rooms { left: 0;  transform: translateX(-100%); }
  .s-users { right: 0; transform: translateX(100%);  display: block !important; }
  .s-rooms.mob-open { transform: translateX(0); }
  .s-users.mob-open { transform: translateX(0); }

  /* ── Messages ── */
  .msg  { padding: 6px 10px; font-size: 13px; }
  .welcome-msg, .connect-msg { margin: 10px; }

  /* ── Modaux slide-up ── */
  .modal-box {
    width: 100vw !important; max-width: 100vw !important;
    min-height: 55vh; max-height: 90vh; overflow-y: auto;
    border-radius: 20px 20px 0 0 !important;
    position: fixed !important;
    bottom: 0; left: 0; right: 0; margin: 0 !important;
  }
  .modal-bg { align-items: flex-end !important; }
}

/* Barre de navigation mobile */
.mobile-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 56px;
  background: rgba(19,21,42,.98);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  z-index: 400;
  justify-content: space-around;
  align-items: center;
  padding: 0 8px;
  padding-bottom: env(safe-area-inset-bottom, 0);
}
@media (max-width: 768px) {
  .mobile-nav { display: flex; }
}
.mnav-btn {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  background: none; border: none; cursor: pointer;
  color: var(--muted); padding: 6px 16px; border-radius: 12px;
  transition: all .15s; flex: 1;
}
.mnav-btn.active { color: var(--blue); background: rgba(91,124,250,.12); }
.mnav-ico { font-size: 20px; line-height: 1; }
.mnav-lbl { font-size: 10px; font-weight: 600; letter-spacing: .3px; }

/* Overlay sombre derrière sidebars */
.mobile-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 250;
  pointer-events: none;
}
.mobile-overlay.show { display: block; }


/* ===== MESSAGE CONNEXION ===== */
.connect-msg {
  margin: 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 20px;
  position: relative;
}
.cm-hello {
  font-size: 18px; font-weight: 800;
  font-family: var(--fh);
  color: var(--text);
  margin-bottom: 6px;
}
.cm-text {
  font-size: 13px; color: var(--muted);
  margin-bottom: 16px; line-height: 1.6;
}
.cm-rules {
  background: rgba(91,124,250,.06);
  border: 1px solid rgba(91,124,250,.15);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex; flex-direction: column; gap: 6px;
}
.cm-rules-title {
  font-size: 12px; font-weight: 700;
  color: #93b4ff; margin-bottom: 4px; letter-spacing: .3px;
}
.cm-rule {
  font-size: 13px; color: #cbd5e1; line-height: 1.5;
}
.cm-time {
  position: absolute; top: 14px; right: 16px;
  font-size: 11px; color: var(--muted2);
}

/* ===== MESSAGE BIENVENUE SALON ===== */
.welcome-msg {
  margin: 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--blue);
  border-radius: 14px;
  padding: 16px 18px;
}
.wm-title {
  font-size: 15px; font-weight: 700;
  font-family: var(--fh); color: var(--text);
  margin-bottom: 4px;
}
.wm-desc {
  font-size: 13px; color: var(--muted);
  margin-bottom: 12px; line-height: 1.5;
}
.wm-rules {
  background: rgba(91,124,250,.06);
  border: 1px solid rgba(91,124,250,.12);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex; flex-direction: column; gap: 4px;
  margin-bottom: 10px;
}
.wm-rules-title {
  font-size: 11px; font-weight: 700;
  color: #93b4ff; margin-bottom: 4px; letter-spacing: .3px; text-transform: uppercase;
}
.wm-rule { font-size: 12px; color: #94a3b8; }
.wm-notice {
  background: rgba(251,191,36,.08);
  border: 1px solid rgba(251,191,36,.2);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px; color: #fbbf24; line-height: 1.55;
}

/* ===== BOUTONS EXTRA MOBILE ===== */
.mob-extra-btn {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 12px;
  color: var(--text); font-size: 13px; font-weight: 600;
  padding: 12px 10px;
  cursor: pointer; font-family: var(--fb);
  transition: background .15s;
  position: relative;
}
.mob-extra-btn:hover, .mob-extra-btn:active { background: rgba(91,124,250,.15); border-color: rgba(91,124,250,.3); }

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

/* ── Messages bot ─────────────────────────────────────────── */
.msg-bot { background: rgba(91,124,250,.06); border-left: 3px solid #5b7cfa; border-radius: 0 8px 8px 0; }
.msg-bot .m-pseudo { color: #5b7cfa !important; }
.msg-bot .m-ava { color: #fff !important; font-size: 16px; display:flex;align-items:center;justify-content:center; }
.msg-bot .m-ava:not(:has(img)) { background: linear-gradient(135deg,#5b7cfa,#a78bfa) !important; }
.msg-bot .m-text { line-height: 1.7; }
.msg-bot .m-text strong { color: #e2e6ff; font-weight: 700; }

/* ===== LINK PREVIEWS ===== */
.link-previews { margin-top: 6px; display: flex; flex-direction: column; gap: 6px; }

.link-preview {
  display: flex; gap: 10px; align-items: flex-start;
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-left: 3px solid var(--blue);
  border-radius: 8px;
  padding: 8px 10px;
  max-width: 420px;
  overflow: hidden;
  cursor: default;
}
.link-preview-video {
  flex-direction: column; padding: 0; overflow: hidden;
  max-width: 560px !important;   /* plus large pour la vidéo */
}
.lp-thumb {
  position: relative; width: 100%; padding-top: 56.25%;
  background: #000; border-radius: 8px 8px 0 0; overflow: hidden; cursor: pointer;
}
.lp-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.lp-thumb iframe {
  position: absolute; inset: 0; width: 100%; height: 100%;
  border: none; border-radius: 8px 8px 0 0;
}
.lp-play {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
  background: rgba(0,0,0,.7); color: #fff; font-size: 22px;
  width: 52px; height: 52px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.lp-thumb:hover .lp-play { background: var(--blue); }
.link-preview-video .lp-info { padding: 8px 10px; }

.lp-img {
  width: 72px; height: 54px; object-fit: cover;
  border-radius: 6px; flex-shrink: 0;
}
.lp-info { flex: 1; min-width: 0; }
.lp-site { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 2px; }
.lp-title {
  display: block; font-size: 13px; font-weight: 600; color: var(--text);
  text-decoration: none; line-height: 1.3;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.lp-title:hover { color: var(--blue); }
.lp-desc { font-size: 11px; color: var(--text2); margin-top: 3px; line-height: 1.4; }

.u-owner-title { font-size: 11px; color: var(--blue); font-weight: 600; margin-top: 1px; }

/* ── Badge de pseudo ── */
.pseudo-badge {
  display: inline-block;
  font-size: .9em;
  vertical-align: middle;
  line-height: 1;
  margin-right: 1px;
}
.badge-preset-btn {
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: 6px;
  padding: 5px 7px;
  font-size: 16px;
  cursor: pointer;
  transition: all .12s;
  line-height: 1;
}
.badge-preset-btn:hover { background: var(--bg3); transform: scale(1.15); }
.badge-preset-btn.on {
  background: rgba(91,124,250,.2);
  border-color: var(--blue);
  transform: scale(1.15);
}
