html, body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #1a1a1a;
  font-family: Arial, sans-serif;
  font-size: 13px; /* ✅ corrige la taille globale */
  color: #ddd;
}
html {
  -webkit-text-size-adjust: none !important; /* ❌ stoppe le zoom texte automatique iOS */
  text-size-adjust: none !important;
}


#renderCanvas {
  width: 100%;
  height: 100%;
  touch-action: none;
  display: block;
}



/* === OVERLAY GLOBAL === */
#avatar-editor-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 3000;
}

/* === PAGE AVATAR === */
.avatar-editor-page {
  width: 85%;
  max-width: 850px;
  height: 95%;
  background: #1e1e1e;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.4);
}

/* === HEADER === */
.avatar-editor-header {
  background: #2a2a2a;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  color: #ddd;
  height: 40px;
}
.avatar-editor-header h2 {
  font-size: 15px;
  margin: 0;
}
.avatar-editor-header .header-actions button {
  background: #e63946;
  color: #fff;
  border: none;
  border-radius: 4px;
  width: 26px;
  height: 26px;
  cursor: pointer;
}

/* === CONTENU PRINCIPAL === */
.avatar-editor-content {
  flex: 1;
  display: flex;
  flex-direction: row;
  gap: 14px;
  padding: 14px;
  overflow-y: auto;
  background: #252525;
}

/* === PRÉVISUALISATION À GAUCHE === */
.avatar-preview-section {
  flex: 1.2;
  min-width: 300px;
  background: #1e1e1e;
  border-radius: 8px;
  display: flex;
  justify-content: center;
  align-items: center;
}
#avatar-preview-container {
  display: flex;
  justify-content: center;
  align-items: center;
}
#avatarPreviewCanvas {
  width: 100%;
  height: 100%;
  border-radius: 8px;
}

/* === CONTRÔLES À DROITE === */
.avatar-controls-section {
  flex: 0.8;
  background: #1e1e1e;
  border-radius: 8px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.avatar-controls-section h4 {
  color: #ddd;
  font-size: 14px;
  margin-bottom: 12px;
}
.color-control {
  display: flex;
  flex-direction: column;
  margin-bottom: 16px;
}
.color-control label {
  color: #bbb;
  font-size: 13px;
  margin-bottom: 6px;
}
.color-control input[type="color"] {
  width: 100%;
  height: 40px;
  border: none;
  border-radius: 6px;
  background: #333;
  cursor: pointer;
}

/* === BOUTON SAUVEGARDE === */
.avatar-actions {
  display: flex;
  justify-content: center;
  margin-top: auto;
}
.save-btn {
  background: #1d9bf0;
  border: none;
  border-radius: 6px;
  padding: 10px 18px;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}
.save-btn:hover {
  background: #1487d1;
  transform: scale(1.03);
}







/* === Notifications serveurs === */

.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #333;
  color: white;
  padding: 10px 16px;
  border-radius: 6px;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s ease;
  z-index: 2000;
  font-size: 14px;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast.success {
  background: #28a745; /* vert */
}

.toast.error {
  background: #dc3545; /* rouge */
}



/* === CHAT HUD (style Roblox, max 5 messages visibles) === */
/* === CHAT HUD (style Roblox, 5 messages visibles pile) === */
#chat-hud {
  position: absolute;
  top: 60px;
  left: 45px;
  width: 360px;
  max-height: 178px; /* ✅ 5 messages visibles sans coupure */
  overflow-y: auto;
  font-family: 'Poppins', sans-serif;
  color: white;
  pointer-events: auto;
  z-index: 10;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.3) transparent;
  padding-right: 4px;
  box-sizing: border-box;
}


/* conteneur messages — ordre naturel */
#chat-messages {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* messages */
#chat-messages .msg {
  display: inline-block;
  width: fit-content;
  max-width: 50%; /* ✅ largeur max avant retour à la ligne */
  background: rgba(0, 0, 0, 0.55);
  padding: 6px 10px;
  border-radius: 10px;
  font-size: 15px;
  line-height: 1.2em;
  word-break: break-word;
  opacity: 0;
  animation: fadeIn 0.2s forwards;
}


/* animation d’apparition */
@keyframes fadeIn {
  to { opacity: 1; }
}

/* zone de saisie */
#chat-input {
  width: 100%;
  background: rgba(20,20,20,0.7);
  border: none;
  color: white;
  font-size: 16px;
  padding: 6px 8px;
  margin-top: 4px;
  border-radius: 6px;
  outline: none;
  pointer-events: auto;
}

/* === BULLES DE CHAT AU-DESSUS DES AVATARS === */
.chat-bubble {
  position: absolute;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  padding: 6px 10px;
  border-radius: 10px;
  font-size: 15px;
  pointer-events: none;
  white-space: nowrap;
  max-width: 300px;
  word-break: break-word;
  transform: translate(-50%, -100%);
  transition: opacity 0.4s ease, transform 0.4s ease;
  opacity: 1;
}


/* === CONTROLES MOBILES === */
#mobile-controls {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 3500;
}

/* === JOYSTICK === */
#joystick {
  position: absolute;
  bottom: 40px; left: 40px;
  width: 110px; height: 110px;
  border-radius: 50%;
  background: rgba(255,255,255,0.05); /* zone externe plus légère */
  border: 1px solid rgba(255,255,255,0.05);
  backdrop-filter: blur(8px);
  pointer-events: auto;
  touch-action: none;
}

#joystick #puck {
  position: absolute;
  width: 50px; height: 50px;
  left: 30px; top: 30px;
  border-radius: 50%;
  background: rgba(10,10,10,0.55); /* 🎨 même couleur que la navbar */
  border: 1px solid rgba(255,255,255,0.05);
  color: #fff;
  transition: transform 0.08s ease-out;
  pointer-events: none;
}

/* === Bouton caméra mobile === */
.mobile-btn.cam-toggle {
  position: absolute;
  right: 20px;
  bottom: 200px; /* au-dessus du bouton Jump */
  width: 70px;
  height: 70px;
  border-radius: 50%;
  font-size: 30px;
  background: rgba(50, 120, 200, 0.85);
  color: white;
  border: none;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  z-index: 100;
}
.mobile-btn.cam-toggle:active {
  background: rgba(80, 160, 255, 0.95);
}

/* === BOUTONS JUMP / DOWN === */
#btnJump, #btnDown {
  position: absolute;
  right: 40px;
  width: 56px; height: 56px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.05);
  font-size: 22px;
  background: rgba(10,10,10,0.55); /* 🎨 idem navbar */
  color: #fff;
  backdrop-filter: blur(8px);
  pointer-events: auto;
  transition: transform 0.1s ease, background 0.2s ease;
}
#btnJump { bottom: 40px; }
#btnDown { bottom: 110px; }

#btnJump:active,
#btnDown:active {
  transform: scale(0.9);
  background: rgba(10,10,10,0.65); /* variation discrète au clic */
}


/* === SYSTEMBLOCK === */
#systemblock-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 3000;
}

.systemblock {
  width: 90%;
  max-width: 800px;
  height: 80%;
  background: #1e1e1e;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 0 15px rgba(0,0,0,0.4);
}

.systemblock header {
  background: #2a2a2a;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 12px;
  color: #ddd;
}

.systemblock header h2 {
  margin: 0;
  font-size: 15px;
}

.systemblock header button {
  background: #e63946;
  border: none;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  color: white;
  cursor: pointer;
}

.systemblock main {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.systemblock-section h3 {
  font-size: 14px;
  margin: 0 0 6px;
  color: #fff;
}

.systemblock-section select,
.systemblock-section input {
  background: #2a2a2a;
  color: #fff;
  border: 1px solid #444;
  padding: 4px 6px;
  border-radius: 6px;
  font-size: 13px;
}

.sys-btn {
  background: #1d3557;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 13px;
  cursor: pointer;
}

.sys-btn.primary {
  background: #457b9d;
}

.sys-effect {
  display: flex;
  gap: 6px;
  align-items: center;
}

.sys-effect select,
.sys-effect input {
  flex: 1;
}








/* === BARRES UI (Dark Glass Light) === */
.ui-bar {
  position: fixed;
  display: flex;
  gap: 8px; /* un peu moins d'espace */
  background: rgba(10,10,10,0.55);
  padding: 5px 8px; /* plus compact */
  border-radius: 20px;
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.05);
  z-index: 4000;
}

/* gauche */
#bar-left {
  top: 8px;
  left: 30px; /* plus centré (avant 10px) */
}

/* centre */
#bar-center {
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
}

/* droite */
#bar-right {
  top: 8px;
  right: 30px; /* plus centré (avant 10px) */
}

/* boutons */
.ui-bar button {
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 50%;
  background: rgba(255,255,255,0.05);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}



.ui-bar button:active {
  transform: scale(0.9);
  background: rgba(255,255,255,0.05); /* garde la même couleur que l'état normal */
}


/* icônes SVG */
.ui-bar svg {
  width: 16px; /* réduit légèrement */
  height: 16px;
  fill: white;
}

/* profil */
#bar-right .profile {
  display: flex;
  align-items: center;
  gap: 5px;
  color: #fff;
  font-size: 13px;
}

#bar-right .profile img {
  width: 26px;
  height: 26px;
  border-radius: 50%;
}






/* === BARRES BUILD / SIZE UI (Dark Glass Light) === */
.build-ui-bar {
  position: fixed;
  display: flex;
  gap: 8px;
  background: rgba(20,20,20,0.65);
  padding: 5px 8px;
  border-radius: 20px;
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.05);
  z-index: 4500;
  align-items: center;
}

/* === BARRE BUILD === */

/* gauche */
#build-bar-left {
  top: 8px;
  left: 30px;
}

/* centre */
#build-bar-center {
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
}

/* droite */
#build-bar-right {
  top: 8px;
  right: 30px;
}

/* === BARRE SIZE === */
#size-bar {
  top: 8px;
  left: 30px; /* aligné avec la barre build gauche */
  display: none; /* masqué par défaut */
}

/* === Boutons normaux (petits ronds) === */
.build-ui-bar button.round-btn {
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

.build-ui-bar button.round-btn:active {
  transform: scale(0.9);
}

/* === Boutons larges (texte + icône, auto-width) === */
#btnExitBuild,
#btnExitSize,
#btnSelectedBlock,
#btnSizeBuild {
  width: auto;
  min-width: 34px;
  height: 34px;
  border-radius: 18px;
  padding: 0 12px;
  gap: 6px;
  display: flex;
  align-items: center;
  font-size: 13px;
  background: rgba(255,255,255,0.08);
  color: #fff;
  border: none;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

/* Bouton quitter spécifique (build) */
#btnExitBuild {
  background: rgba(200,60,60,0.2);
  color: #f66;
}

/* Bouton quitter spécifique (size) */
#btnExitSize {
  background: rgba(200, 60, 200, 0.2); /* violet clair */
  color: #f6f;
}

/* Bouton Taille spécifique */
#btnSizeBuild {
  background: rgba(60, 120, 200, 0.2);
  color: #6af;
}

/* Bouton bloc sélectionné / inventaire */
#btnSelectedBlock i {
  font-size: 14px;
}

#btnSelectedBlock img.block-icon {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  object-fit: cover;
}

#btnSelectedBlock .qty {
  font-size: 12px;
  color: #ccc;
}

/* === Switch poser/casser === */
.mode-switch {
  position: relative;
  display: flex;
  align-items: center;
  height: 34px;
  background: rgba(255,255,255,0.08);
  border-radius: 18px;
  overflow: hidden;
  font-size: 13px;
  cursor: pointer;
  padding: 0 4px;
}

.switch-option {
  flex: 1;
  text-align: center;
  padding: 0 12px;
  line-height: 34px;
  z-index: 2;
  color: #fff;
  transition: color 0.3s;
  white-space: nowrap;
}

.switch-option.active {
  color: #6f6;
}

.switch-slider {
  position: absolute;
  top: 3px;
  bottom: 3px;
  left: 3px;
  width: calc(50% - 6px);
  border-radius: 14px;
  background: rgba(100,200,100,0.25);
  transition: transform 0.3s;
  z-index: 1;
}

.mode-switch.active-destroy .switch-slider {
  transform: translateX(100%);
}



/* === AUTH === */
#auth-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 4000;
}

.auth {
  background: #1e1e1e;
  padding: 20px;
  border-radius: 8px;
  width: 90%;
  max-width: 400px;
  color: #fff;
  box-shadow: 0 0 20px rgba(0,0,0,0.5);
}

.auth header h2 {
  margin: 0 0 15px;
  font-size: 18px;
  text-align: center;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.auth-form.hidden {
  display: none;
}

.auth-form label {
  font-size: 13px;
  color: #ccc;
}

.auth-form input {
  background: #2a2a2a;
  border: 1px solid #444;
  border-radius: 6px;
  padding: 8px;
  color: #fff;
  font-size: 14px;
}

.auth-btn {
  background: #1d3557;
  border: none;
  border-radius: 6px;
  padding: 10px;
  color: #fff;
  font-weight: bold;
  cursor: pointer;
}
.auth-btn:hover {
  background: #457b9d;
}

.auth .switch {
  text-align: center;
  font-size: 12px;
  margin-top: 10px;
}

.auth .switch a {
  color: #1d9bf0;
  cursor: pointer;
}

/* === SPACES OVERLAY === */
#spaces-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 3000;
}

/* === CONTAINER === */
.spaces {
  width: 85%;
  max-width: 850px;
  height: 95%;
  background: #1e1e1e;
  border-radius: 8px;
  display: grid;
  grid-template-rows: 40px auto 1fr;
  overflow: hidden;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.4);
  color: #ddd;
}

/* === HEADER === */
.spaces header {
  background: #2a2a2a;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
}

.spaces header h2 {
  font-size: 13px;
  margin: 0;
  font-weight: 500;
}

.spaces header .actions button {
  background: #1d3557;
  border: none;
  border-radius: 6px;
  padding: 4px 8px;
  color: #fff;
  cursor: pointer;
  font-size: 12px;
}
.spaces header .actions button:hover {
  background: #457b9d;
}

.spaces header button#closeSpaces {
  background: #e63946;
  color: white;
  border: none;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  font-size: 12px;
  cursor: pointer;
}

/* === TABS === */
.spaces-tabs {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px;
  border-bottom: 1px solid #444;
  background: #1e1e1e;
}

.spaces-tabs button {
  flex: 0 0 auto;
  padding: 8px 12px;
  background: #222;
  color: #ddd;
  border: none;
  cursor: pointer;
  border-radius: 6px 6px 0 0;
  font-size: 13px;
}

.spaces-tabs button.active {
  background: #444;
  color: #fff;
  font-weight: bold;
}

/* === LISTE DES SPACES === */
.spaces-list {
  background: #202020;
  padding: 10px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.space-card {
  background: #2a2a2a;
  border-radius: 6px;
  padding: 10px;
  display: flex;
  justify-content: space-between;
  border: 1px solid #333;
}

.space-info h3 {
  margin: 0;
  color: #fff;
  font-size: 14px;
}
.space-info p {
  margin: 4px 0;
  font-size: 12px;
  color: #bbb;
}
.space-info small {
  font-size: 11px;
  color: #888;
}

.space-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}
.space-actions button {
  background: #1d3557;
  border: none;
  border-radius: 6px;
  padding: 4px 8px;
  color: #fff;
  cursor: pointer;
  font-size: 12px;
}
.space-actions button:hover {
  background: #457b9d;
}



/* === CREATE SPACE OVERLAY === */
#create-space-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 3000;
}

/* === CONTAINER === */
.create-space {
  width: 85%;
  max-width: 850px;
  height: 95%;
  background: #1e1e1e;
  border-radius: 8px;
  display: grid;
  grid-template-rows: 40px 1fr;
  overflow: hidden;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.4);
  color: #ddd;
}

/* === HEADER === */
.create-space header {
  background: #2a2a2a;
  color: #ddd;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
}

.create-space header h2 {
  font-size: 13px;
  font-weight: 500;
  margin: 0;
}

.create-space header button#closeCreateSpace {
  background: #e63946;
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  font-size: 12px;
  cursor: pointer;
}

/* === FORMULAIRE === */
.create-space form {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.create-space label {
  color: #ccc;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.3;
  display: block;
  margin-top: 6px;
  margin-bottom: 2px;
}


.create-space input,
.create-space textarea,
.create-space select {
  background: #262626;
  border: 1px solid #3a3a3a;
  border-radius: 5px;
  color: #f1f1f1;
  padding: 6px 8px;
  font-size: 13px;
  outline: none;
}

.create-space input:focus,
.create-space textarea:focus,
.create-space select:focus {
  border-color: #457b9d;
  background: #2c2c2c;
}

.create-space textarea {
  resize: none;
  min-height: 60px;
  line-height: 1.4;
}

/* === BOUTON CRÉER === */
.create-space .create-btn {
  background: #1d3557;
  border: none;
  border-radius: 5px;
  padding: 7px 0;
  color: #fff;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  margin-top: 10px;
}
.create-space .create-btn:hover {
  background: #457b9d;
}



/* === EDIT SPACE OVERLAY === */
#edit-space-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 3000;
}

/* === CONTAINER === */
.edit-space {
  width: 85%;
  max-width: 850px;
  height: 95%;
  background: #1e1e1e;
  border-radius: 8px;
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
  color: #ddd;
}

/* === HEADER === */
.edit-space header {
  background: #2a2a2a;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  border-bottom: 1px solid #333;
}

.edit-space header h2 {
  font-size: 13px;
  font-weight: 500;
  margin: 0;
  flex: 1;
}

.edit-space header button#closeEditSpace {
  background: #e63946;
  color: white;
  border: none;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  font-size: 12px;
  cursor: pointer;
}

/* === TABS === */
.edit-space .tabs {
  display: flex;
  gap: 6px;
  margin-left: 10px;
}
.edit-space .tabs button {
  background: #333;
  border: none;
  padding: 6px 12px;
  border-radius: 6px 6px 0 0;
  color: #bbb;
  cursor: pointer;
  font-size: 13px;
}
.edit-space .tabs button:hover {
  background: #444;
  color: #fff;
}
.edit-space .tabs button.active {
  background: #1d3557;
  color: #fff;
}

/* === CONTENU === */
.edit-space main {
  padding: 12px;
  overflow-y: auto;
  max-height: 70vh;
}
.edit-space .tab-content {
  display: none;
}
.edit-space .tab-content.active {
  display: block;
}

/* === FORM GÉNÉRAL === */
.edit-space form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.edit-space label {
  color: #ccc;
  font-size: 13px;
}
.edit-space input,
.edit-space textarea,
.edit-space select {
  background: #2a2a2a;
  border: 1px solid #444;
  border-radius: 6px;
  color: #fff;
  padding: 6px;
  font-size: 13px;
}
.edit-space textarea {
  resize: none;
  min-height: 60px;
}
.edit-space .save-btn {
  background: #1d3557;
  border: none;
  border-radius: 6px;
  padding: 8px;
  color: #fff;
  cursor: pointer;
  font-size: 13px;
  margin-top: 10px;
}
.edit-space .save-btn:hover {
  background: #457b9d;
}

/* === ONGLET AVANCÉ === */
.tab-content[data-tab="advanced"] h3 {
  margin: 0 0 10px;
  font-size: 13px;
  color: #fff;
}
.tab-content[data-tab="advanced"] label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 6px 0;
  font-size: 13px;
}
.tab-content[data-tab="advanced"] input[type="checkbox"] {
  accent-color: #1d3557;
  width: 16px;
  height: 16px;
}

/* === ONGLET MEMBRES === */
.tab-content[data-tab="members"] h3 {
  margin: 0 0 10px;
  font-size: 13px;
  color: #fff;
}
#spaceMembersList {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
#spaceMembersList li {
  background: #2a2a2a;
  padding: 8px 10px;
  border-radius: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
#spaceMembersList li .role {
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 10px;
  background: #444;
  color: #bbb;
  text-transform: uppercase;
}
#spaceMembersList li .role.owner { background: #e63946; color: #fff; }
#spaceMembersList li .role.admin { background: #1d3557; color: #fff; }
#spaceMembersList li .role.builder { background: #457b9d; color: #fff; }
#spaceMembersList li .role.visitor { background: #777; color: #eee; }






/* === TCHAT === */
#chat-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 3000;
}

.chat {
  width: 85%;
  max-width: 850px;
  height: 95%;
  background: #1e1e1e;
  border-radius: 8px;
  display: flex;
  flex-direction: column;   /* header + contenu en colonne */
  overflow: hidden;
  box-shadow: 0 0 15px rgba(0,0,0,0.4);
}

/* --- Header fixe --- */
.chat header {
  flex-shrink: 0;
  height: 40px;
  background: #2a2a2a;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  color: #ddd;
  font-size: 14px;
}

.chat header h2 {
  font-size: 14px;
  margin: 0;
  font-weight: normal;
}

.chat header .tabs {
  display: flex;
  gap: 6px;
}

.chat header .tabs button {
  background: none;
  border: 1px solid #444;
  border-radius: 6px;
  padding: 2px 8px;
  color: #bbb;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.2s;
}
.chat header .tabs button.active,
.chat header .tabs button:hover {
  background: #1d3557;
  color: #fff;
}

.chat header button#closeChat {
  background: #e63946;
  color: white;
  border: none;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  font-size: 12px;
  cursor: pointer;
}

/* --- Contenu --- */
.chat-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;   /* ✅ nécessaire pour que .messages scrolle */
}

/* Onglets */
.chat-tab {
  flex: 1;
  display: none;
  flex-direction: column;
  min-height: 0;   /* ✅ idem */
}
.chat-tab.active {
  display: flex;
}

/* --- Zone messages --- */
.messages {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 0;   /* ✅ évite que ça pousse l’input */
}

.message {
  background: #2a2a2a;
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 13px;
  color: #eee;
  display: flex;
  flex-direction: column;
  max-width: 70%;
}
.message.self {
  background: #1d3557;
  align-self: flex-end;
  color: #fff;
}
.message .author {
  font-weight: bold;
  margin-bottom: 2px;
  font-size: 12px;
}
.message small {
  font-size: 10px;
  color: #aaa;
  margin-top: 2px;
  align-self: flex-end;
}

/* --- Barre input en bas --- */
.chat-input {
  flex-shrink: 0;   /* ✅ reste figée */
  display: flex;
  border-top: 1px solid #333;
  padding: 6px;
  background: #222;
}
.chat-input input {
  flex: 1;
  background: #2a2a2a;
  border: 1px solid #444;
  border-radius: 6px;
  color: #fff;
  padding: 6px;
  font-size: 13px;
}
.chat-input button {
  margin-left: 6px;
  background: #1d3557;
  border: none;
  border-radius: 6px;
  width: 36px;
  height: 36px;
  color: #fff;
  cursor: pointer;
}
.chat-input button:hover {
  background: #457b9d;
}

/* --- Liste de conversations --- */
.conversations {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.conversation {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border-bottom: 1px solid #333;
  cursor: pointer;
  transition: background 0.2s;
}
.conversation:hover {
  background: #2a2a2a;
}
.conversation img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
}
.conv-info {
  flex: 1;
}
.conv-info strong {
  color: #fff;
  font-size: 13px;
}
.conv-info small {
  color: #aaa;
  font-size: 12px;
}
.conv-time {
  color: #777;
  font-size: 11px;
}

/* --- Fenêtre conv privée --- */
.private-chat.hidden {
  display: none;
}
.private-chat {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;   /* ✅ permet le scroll dans messages privés */
}
.conv-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px;
  background: #252525;
  border-bottom: 1px solid #333;
}
.conv-header h3 {
  margin: 0;
  font-size: 14px;
  color: #fff;
}
.conv-header button {
  background: none;
  border: none;
  color: #fff;
  font-size: 14px;
  cursor: pointer;
}



/* === OVERLAYS === */
#profile-overlay,
#settings-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 3000;
}

/* === PAGE PROFIL === */
.profile-page {
  width: 85%;
  max-width: 850px;
  height: 95%;
  background: #1e1e1e;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.4);
}

/* === HEADER === */
.profile-header {
  background: #2a2a2a;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  color: #ddd;
  height: 40px;
}
.profile-header h2 {
  font-size: 15px;
  margin: 0;
}
.profile-header .header-actions {
  display: flex;
  gap: 6px;
}
.profile-header button {
  background: #333;
  color: #fff;
  border: none;
  border-radius: 4px;
  width: 26px;
  height: 26px;
  cursor: pointer;
}
.profile-header button#closeProfile {
  background: #e63946;
}

/* === CONTENU === */
.profile-content {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* === SECTIONS GÉNÉRALES === */
.profile-section {
  background: #252525;
  border-radius: 8px;
  padding: 12px;
  position: relative;
}
.profile-section h4 {
  color: #ddd;
  font-size: 14px;
  margin: 0 0 8px 0;
}

/* === PROFIL + BADGES CÔTE À CÔTE === */
.profile-main {
  display: flex;
  flex-direction: row;
  gap: 16px;
  flex-wrap: wrap;
}

/* Profil à gauche */
#profile-info {
  flex: 1;
  min-width: 220px;
  text-align: center;
}
#profile-avatar {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  border: 2px solid #1d9bf0;
  margin-bottom: 6px;
}
#profile-username {
  color: #fff;
  margin: 4px 0;
  font-size: 18px;
}
#profile-bio {
  color: #bbb;
  font-size: 13px;
}
.profile-edit-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: none;
  color: #1d9bf0;
  border: none;
  font-size: 15px;
  cursor: pointer;
}

/* === BADGES === */
#profile-badges {
  flex: 2;
  min-width: 300px;
}

#profile-badge-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr); /* ✅ 2 badges par ligne */
  gap: 10px;
}

/* === CARTE DE BADGE === */
.profile-badge-card {
  display: flex;
  align-items: center;
  background: #2a2a2a;
  border: 1px solid #333;
  border-radius: 6px;
  padding: 6px 8px;
  gap: 10px;
  transition: background 0.15s, transform 0.15s;
}

.profile-badge-card:hover {
  background: #343434;
  transform: scale(1.03);
}

/* === ICÔNES (image ou emoji) === */
.badge-icon,
.emoji {
  width: 50px;
  height: 50px;
  object-fit: contain;
  flex-shrink: 0;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px; /* taille des emojis */
  background: #222;
}

/* === TEXTE DU BADGE === */
.badge-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.badge-name {
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  margin: 0;
}

.badge-desc {
  color: #aaa;
  font-size: 12px;
  margin: 2px 0 0 0;
  line-height: 1.2;
}

.manage-badges {
  background: #1e1e1e;
  border-radius: 8px;
  padding: 10px;
  width: 600px;
  max-height: 80%;
  overflow-y: auto;
  margin: auto;
}
.badge-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.badge-select {
  border: 1px solid #444;
  border-radius: 6px;
  background: #2a2a2a;
  padding: 8px;
  text-align: center;
  cursor: pointer;
  transition: transform 0.15s, background 0.15s;
}
.badge-select.selected {
  background: #1d9bf0;
  border-color: #1d9bf0;
}

/* === OVERLAY BADGES === */
#manage-badges-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  z-index: 3000;
  align-items: center;
  justify-content: center;
}

/* === POPUP === */
.manage-badges {
  background: #1e1e1e;
  border-radius: 8px;
  padding: 16px;
  width: 650px;
  max-width: 95%;
  max-height: 80%;
  overflow-y: auto;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
}

.manage-badges header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #333;
  padding-bottom: 8px;
  margin-bottom: 12px;
}

.manage-badges h3 {
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  margin: 0;
}

.close-btn {
  background: none;
  color: #aaa;
  border: none;
  font-size: 18px;
  cursor: pointer;
}

/* === LISTE DES BADGES === */
.badge-manage-card {
  display: flex;
  align-items: center;
  background: #252525;
  border: 1px solid #333;
  border-radius: 6px;
  padding: 8px 10px;
  margin-bottom: 8px;
  gap: 10px;
  cursor: pointer;
}

/* Pas d’animation, pas de hover, sobre */
.badge-manage-card:hover {
  background: #252525;
}

/* Icône / image */
.badge-manage-card .badge-icon,
.badge-manage-card .emoji {
  width: 48px;
  height: 48px;
  object-fit: contain;
  flex-shrink: 0;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  background: #1b1b1b;
}

/* Texte */
.badge-manage-card .badge-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.badge-manage-card .badge-name {
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  margin: 0;
}

.badge-manage-card .badge-desc {
  color: #888;
  font-size: 12px;
  line-height: 1.3;
  margin-top: 2px;
}

/* Sélection sobre (gris clair) */
.badge-manage-card.selected {
  background: #333;
  border-color: #555;
}

/* === BOUTON ENREGISTRER === */
.save-btn {
  background: #444;
  color: #fff;
  border: none;
  padding: 8px 14px;
  border-radius: 6px;
  margin-top: 14px;
  cursor: pointer;
  font-weight: 500;
}


/* === SPACES === */
#profile-spaces-list {
  padding: 0;
  background: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.profile-space-card {
  background: #2a2a2a;
  border-radius: 6px;
  padding: 10px;
  border: 1px solid #333;
}
.profile-space-info h3 {
  margin: 0;
  color: #fff;
  font-size: 14px;
}
.profile-space-info p {
  margin: 4px 0;
  font-size: 12px;
  color: #bbb;
}
.profile-space-info small {
  font-size: 11px;
  color: #888;
}


/* === PAGE PARAMÈTRES === */
.settings-page {
   width: 85%;
  max-width: 850px;
  height: 95%;
  background: #1e1e1e;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.4);
}

.settings-header {
  background: #2a2a2a;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  color: #ddd;
  height: 40px;
}
.settings-header h2 {
  font-size: 15px;
  margin: 0;
}
.settings-header .header-actions {
  display: flex;
  gap: 6px;
}
.settings-header button {
  background: #333;
  color: #fff;
  border: none;
  border-radius: 4px;
  width: 26px;
  height: 26px;
  cursor: pointer;
}
.settings-header #closeSettings {
  background: #e63946;
}

.settings-content {
  padding: 12px;
  background: #202020;
  overflow-y: auto;
  flex: 1;
}

.settings-form form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.settings-form label {
  font-size: 12px;
  color: #bbb;
}
.settings-form input,
.settings-form select {
  background: #2a2a2a;
  border: 1px solid #444;
  border-radius: 4px;
  padding: 5px;
  color: #fff;
  font-size: 13px;
}
.settings-form .checkboxes {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: #ccc;
}
.settings-form .save-btn {
  margin-top: 10px;
  background: #1d3557;
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 6px 10px;
  cursor: pointer;
}

/* Form settings */
.settings form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.settings label {
  font-size: 12px;
  color: #bbb;
}
.settings input,
.settings select {
  background: #2a2a2a;
  border: 1px solid #444;
  border-radius: 4px;
  padding: 5px;
  color: #fff;
  font-size: 13px;
}
.settings .checkboxes {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: #ccc;
}
.settings .save-btn {
  margin-top: 10px;
  background: #1d3557;
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 6px 10px;
  cursor: pointer;
}

/* Activité */
.activity ul {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 12px;
  color: #ccc;
}
.activity li {
  margin: 4px 0;
}
.activity small {
  color: #888;
  margin-right: 4px;
}











/* === NOTIFICATIONS === */
#notifications-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 3000;
}

.notifications {
   width: 85%;
  max-width: 850px;
  height: 95%;
  background: #1e1e1e;
  border-radius: 8px;
  display: grid;
  grid-template-rows: 40px 1fr;
  overflow: hidden;
  box-shadow: 0 0 15px rgba(0,0,0,0.4);
}

.notifications header {
  background: #2a2a2a;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  color: #ddd;
  font-size: 14px;
}

.notifications header h2 {
  font-size: 15px; /* idem catalogue */
  margin: 0;
}

.notifications header .actions {
  display: flex;
  gap: 6px;
}

.notifications header .actions button {
  background: none;
  border: 1px solid #444;
  border-radius: 6px;
  width: 24px;
  height: 24px;
  color: #bbb;
  cursor: pointer;
  font-size: 12px;
}

.notifications header .actions button:hover {
  background: #1d3557;
  color: #fff;
}

.notifications header button#closeNotifications {
  background: #e63946;
  color: white;
  border: none;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  font-size: 12px;
  cursor: pointer;
}

/* Liste */
.notif-list {
  padding: 10px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.notif {
  display: flex;
  gap: 10px;
  background: #2a2a2a;
  border-radius: 6px;
  padding: 8px;
  border: 1px solid #333;
}

.notif.unread {
  border-left: 3px solid #1d3557;
}

.notif-icon {
  width: 32px;
  height: 32px;
  background: #1d3557;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: white;
  flex-shrink: 0;
}

.notif-content h3 {
  margin: 0;
  font-size: 13px;
  color: #fff;
  font-weight: 500;
}

.notif-content p {
  margin: 2px 0;
  font-size: 12px;
  color: #bbb;
}

.notif-content small {
  font-size: 11px;
  color: #888;
}












/* === MISSIONS === */
#missions-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 3000;
}

.missions {
 width: 85%;
  max-width: 850px;
  height: 95%;
  background: #1e1e1e;
  border-radius: 8px;
  display: grid;
  grid-template-rows: 40px 1fr;
  overflow: hidden;
  box-shadow: 0 0 15px rgba(0,0,0,0.4);
}

.missions header {
  background: #2a2a2a;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  color: #ddd;
  font-size: 14px;
}

.missions header h2 {
  font-size: 14px;
  margin: 0;
  font-weight: normal;
}

.missions header .tabs {
  display: flex;
  gap: 6px;
}

.missions header .tabs button {
  background: none;
  border: 1px solid #444;
  border-radius: 6px;
  padding: 2px 8px;
  color: #bbb;
  font-size: 12px;
  cursor: pointer;
}

.missions header .tabs button.active {
  background: #1d3557;
  color: #fff;
}

.missions header button {
  background: #e63946;
  color: white;
  border: none;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  font-size: 12px;
  cursor: pointer;
}

/* Liste missions */
.mission-list {
  padding: 10px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mission-card {
  background: #2a2a2a;
  border-radius: 6px;
  padding: 10px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  border: 1px solid #333;
}

.mission-info h3 {
  margin: 0;
  font-size: 13px;
  color: #fff;
  font-weight: 500;
}

.mission-info p {
  margin: 2px 0 6px;
  font-size: 12px;
  color: #bbb;
}

.progress {
  background: #111;
  border-radius: 4px;
  height: 6px;
  margin-bottom: 4px;
  overflow: hidden;
}

.progress .bar {
  background: #1d3557;
  height: 100%;
  border-radius: 4px;
}

.mission-info small {
  font-size: 11px;
  color: #888;
}

/* Récompenses */
.mission-reward {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  font-size: 12px;
  color: #ddd;
}

.mission-reward span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.mission-reward .claim {
  margin-top: 4px;
  background: #1d3557;
  border: none;
  border-radius: 4px;
  padding: 3px 8px;
  color: #fff;
  font-size: 12px;
  cursor: pointer;
}

.mission-reward .claim.disabled {
  background: #444;
  cursor: not-allowed;
}









/* === INVENTAIRE === */
#inventory-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 3000;
}

.inventory {
  width: 85%;
  max-width: 850px;
  height: 95%;
  background: #1e1e1e;
  border-radius: 8px;
  display: grid;
  grid-template-rows: 40px 1fr; /* header + liste */
  overflow: hidden;
  box-shadow: 0 0 15px rgba(0,0,0,0.4);
  position: relative;
}

.inventory header {
  background: #2a2a2a;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  color: #ddd;
  font-size: 14px;
}
.inventory header h2 {
  font-size: 15px;
  margin: 0;
}
.inventory header button {
  background: #e63946;
  color: white;
  border: none;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  font-size: 14px;
  cursor: pointer;
}

/* Liste items */
.inventory main.items {
  background: #202020;
  padding: 8px;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 8px;
}
.inventory .item {
  background: #2a2a2a;
  border-radius: 4px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  transition: background 0.2s;
}
.inventory .item:hover {
  background: #353535;
}
.inventory .item img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  margin-bottom: 4px;
}
.inventory .item span {
  font-size: 12px;
  color: #eee;
  text-align: center;
}
.inventory .item small {
  font-size: 11px;
  color: #aaa;
}






/* === CATALOGUE === */
#catalog-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 3000;
}

.catalog {
 width: 85%;
  max-width: 850px;
  height: 95%;
  background: #1e1e1e;
  border-radius: 8px;
  display: grid;
  grid-template-rows: 40px 1fr;
  grid-template-columns: 150px 1fr;
  overflow: hidden;
  box-shadow: 0 0 15px rgba(0,0,0,0.4);
  position: relative;
}

.catalog header {
  grid-column: 1 / span 2;
  background: #2a2a2a;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  color: #ddd;
  font-size: 14px;
}
.catalog header h2 {
  font-size: 15px;
  margin: 0;
}
.catalog header .balance {
  font-size: 14px;
  color: #eee;
}
.catalog header button {
  background: #e63946;
  color: white;
  border: none;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  font-size: 14px;
  cursor: pointer;
}

/* Sidebar catégories */
.catalog aside {
  background: #252525;
  overflow-y: auto;
}
.catalog aside button {
  display: block;
  width: 100%;
  padding: 6px 10px;
  background: none;
  color: #bbb;
  text-align: left;
  border: none;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.2s;
}

.catalog aside button.active {
  background: #1d3557;
  color: #fff;
}

/* Liste des items */
.catalog main {
  background: #202020;
  padding: 8px;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 8px;
}

.catalog .item {
  background: #2a2a2a;
  border-radius: 4px;
  padding: 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  transition: background 0.2s;
}

.catalog .item img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  border-radius: 6px;
  padding: 4px;
}
.catalog .item span {
  margin-top: 4px;
  font-size: 11px;
  color: #eee;
  text-align: center;
  line-height: 1.2;
}

/* === PANEL ARTICLE === */
.item-panel {
  position: absolute;
  top: 40px;
  right: 0;
  bottom: 0;
  background: #1d1d1d;
  width: 0;
  overflow: hidden;
  transition: width 0.25s ease, padding 0.25s ease;
  display: flex;
  flex-direction: column;
  border-left: 1px solid #333;
  padding: 0;
}
.item-panel.open {
  width: 240px;
  padding: 10px;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.panel-header h3 {
  color: #fff;
  margin: 0;
  font-size: 14px;
}
.panel-header button {
  background: #e63946;
  border: none;
  color: #fff;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 12px;
}

.panel-content {
  flex: 1; /* occupe tout l'espace restant */
  overflow-y: auto;
  padding-bottom: 10px;
}
.panel-content img {
  width: 70px;
  height: 70px;
  object-fit: contain;
  display: block;
  margin: 0 auto 10px auto;
  border-radius: 6px;
  padding: 4px;
}
.panel-content p {
  color: #ccc;
  font-size: 12px;
  margin-bottom: 8px;
  white-space: pre-line;
}

/* === FOOTER DU PANEL === */
.panel-footer {
  margin-top: auto;
  border-top: 1px solid #333;
  padding-top: 10px;
}

.buy-controls {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-bottom: 8px;
}
.buy-controls input {
  width: 40px;        /* plus étroit */
  height: 32px;       /* plus bas */
  text-align: center;
  border: 1px solid #555;
  border-radius: 4px;
  background: #2a2a2a;
  color: #fff;
  font-size: 13px;
  padding: 0;
}

.buy-controls button {
  min-width: 36px;
  min-height: 36px;
  padding: 6px 10px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 14px;
  background: #333;
  color: #fff;
  transition: background 0.2s;
}

#buyBtn {
  flex: 1;
  background: #1d3557;
  font-size: 14px;
  min-height: 40px;
}

/* boutons rapides */
.quick-qty {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.quick-qty button {
  flex: 1;
  min-width: 50px;
  min-height: 36px;
  padding: 6px;
  border: none;
  border-radius: 5px;
  background: #2a2a2a;
  color: #ddd;
  font-size: 13px;
  cursor: pointer;
}


/* Divers */
* {
  -webkit-user-select: none;
  -webkit-touch-callout: none;
	
  user-select: none;
}
body {
  touch-action: manipulation;
}


