#inventoryTab {
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 20px;
    border-radius: 15px;
    z-index: 1000;
    display: flex;
    gap: 20px;
    user-select: none;
    max-height: 100%;
}

#inventoryTab h3
{
    background-color: white;
    color:black;
    text-align: center;
    margin:0;
}

#fiche_perso,
#characterSheet,
#itemDetails
{
    width: 25vw; 
}

#fiche_perso
{
    overflow-y: auto;
    overflow-x: hidden;
    max-height: 100%;
    padding-right: 20px; 
    box-sizing: border-box;
}

#fiche_perso::-webkit-scrollbar {
    width: 8px;
}

#fiche_perso::-webkit-scrollbar-track {
    background: rgba(50, 50, 50, 0.3); /* Couleur de fond du rail */
}

#fiche_perso::-webkit-scrollbar-thumb {
    background-color: rgba(200, 200, 200, 0.4); /* Couleur de la barre */
    border-radius: 4px;
}

#fiche_perso::-webkit-scrollbar-thumb:hover {
    background-color: rgba(255, 255, 255, 0.5); /* Survol */
}

.fiche_attaque
{
    width: 100%;
    padding:5px;
    background-color: rgba(255, 0, 0, 0.05);
}

#fiche_perso .fiche_attaque h3
{
    color:white;
    background-color: rgba(255,0,0,0.3);
}

.fiche_defense
{
    width: 100%;
    padding:5px;
    background-color: rgba(0, 81, 255, 0.05);
}

#fiche_perso .fiche_defense h3
{
    color:white;
    background-color: rgba(0, 81, 255, 0.3);
}

.fiche_divers
{
    width: 100%;
    padding:5px;
    background-color: rgba(246, 255, 0, 0.05);
}

#fiche_perso .fiche_divers h3
{
    color:white;
    background-color: rgba(246, 255, 0, 0.3);
}

#fiche_perso p
{
    display: flex;
    justify-content: space-between;
}

#fiche_perso span
{
    margin-left:20px;  
    font-size: 1.2em;
}

#characterSheet {
    min-width: 20vw; /* Largeur de la fiche du personnage */
    max-width: 20vw;
    text-align: center;
}

#characterBackground {
    position: relative;
    width: 100%;
   /* height: 200px;*/
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    margin: 20px 0;
}

#characterImage {
    width: 100%;
    height: 100%;
    opacity: 0.5; /* Semi-transparent */
    object-fit: cover;
}

#equipmentSlots {
    margin-top: 20px;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    flex-direction: column;
}

.equipment-slot {
    width: 70px;
    height: 70px;
    padding: 9px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 5px;
    cursor: pointer;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin: 0 3px;
    font-size: 0.8em;
}

.equipement_container,
.weapon_container
{
    display: flex;
    align-items: center;
    flex-direction: column;
}

.ligne_equipement
{
    display: flex;
}

.titre_slot
{
    font-size: 2em;
    margin: 5px 0;
    text-transform: uppercase;
}

.tooltip {
    visibility: hidden;
    width: 120px;
    background-color: rgba(0, 0, 0, 0.8);
    color: #fff;
    text-align: center;
    border-radius: 5px;
    padding: 5px;
    position: absolute;
    z-index: 1;
    bottom: 125%; /* Position au-dessus de l'emplacement */
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 0.3s ease;
    font-size: 0.7em;
}

.equipment-slot:hover .tooltip {
    visibility: visible;
    opacity: 1;
}

.equipment-slot:hover {
    background: rgba(255, 255, 255, 0.2);
}

.equipment-slot img
{
    width:50px;
}

#inventoryGrid {
    display: grid;
    grid-template-columns: repeat(5, 70px);
    grid-auto-rows: 70px;
    gap: 10px; 
    justify-content: center;
    margin-top:20px
}

.inventory-slot {
    position: relative;
  /*  width: 50px;
    height: 50px;*/
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.inventory-slot:hover {
    background: rgba(255, 255, 255, 0.2);
}

#closeInventory {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 10px 20px;
    font-size: 16px;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.2s ease;
}

#closeInventory:hover {
    background: rgba(255, 255, 255, 0.2);
}

.inventory-item {
    position: relative; /* Permet de positionner le tooltip par rapport à l'élément */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    cursor: pointer;
    user-select: none;
}

.inventory-item img {
    width: 40px; /* Taille de l'image */
    height: 40px;
    object-fit: cover; /* Conserver les proportions de l'image */
    border-radius: 5px; /* Coins arrondis */
    user-select: none;
}

/* Style pour l'indicateur de niveau */
.item-level {
    position: absolute;
    bottom: 5px;
    right: 5px;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 2px 5px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: bold;
    user-select: none;
}

#itemDetails {
    display: flex;
    color: white;
    padding: 20px;
    border-radius: 15px;
    margin-left: 20px; /* Espace entre l'inventaire et le cadre */
    flex-grow: 1;
    flex-direction: column;
}

#itemDetails img {
    width: 30%;
    margin: 0 auto;
}

#itemDetails .item-name-details {
    font-size: 18px;
    font-weight: bold;
    text-align: center;
    margin-bottom: 10px;
}

#itemDetails .item-stats {
    font-size: 16px;
    text-align: left;
    line-height: 1.5;
}

.item-comparison {
    margin-top: 20px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
}

.item-comparison h4 {
    margin: 0 0 10px 0;
    font-size: 16px;
    color: white;
}

.item-comparison p {
    margin: 5px 0;
    font-size: 16px;
    color: white;
    display: flex;
}

.item-comparison .arrow_comparaison
{
    font-size: 10px;
    display: flex;
    line-height: -2px;
    justify-content: center;
    align-items: center;
    margin: 0 5px;
}

.item-comparison strong
{
    margin-right: 5px;
}

.item-comparison h5 {
    margin: 0 0 25px 0;
    font-size: 30px;
    color: gold;
    text-align: center;
}

.stat_positive {
    color: green;
}

.stat_negatif {
    color: red;
}

.stat_egale {
    color: white;
}

.item-name-details.common { border: 5px solid rgb(194, 194, 194); color: rgb(255, 255, 255); font-size: 10px;}
.item-name-details.uncommon { border: 5px solid green; color: green; font-size: 10px;}
.item-name-details.rare { border: 5px solid blue; color: blue; font-size: 10px;background-color: white;}
.item-name-details.epic { border: 5px solid purple; color: purple; font-size: 15px;}
.item-name-details.legendary {  border: 10px solid red; color: red; font-size: 20px;}
.item-name-details.unique {  border: 10px solid orange; color: orange; font-size: 25px; position: relative;}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.8);
    }
}

.equipment-slot img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

.equipment-slot img.unequip-animation {
    animation: fadeOut 0.3s ease forwards;
}

.equipment-slot.highlight {
    border: 2px solid rgb(240, 240, 240);
    box-shadow: 0 0 10px rgb(240, 240, 240);
}


/* Bordures en fonction de la rareté */
.inventory-item.common {
    border: 2px solid white;
}

.inventory-item.uncommon {
    border: 2px solid green;
}

.inventory-item.rare {
    border: 2px solid blue;
}

.inventory-item.epic {
    border: 2px solid purple;
}

.inventory-item.legendary {
    border: 2px solid red;
}

.inventory-item.unique {
    border: 2px solid orange;
    position: relative;
}

/* Étoile dorée pour les objets uniques */
.inventory-item.unique::before {
    content: "★";
    position: absolute;
    top: -10px;
    left: -10px;
    color: gold;
    font-size: 20px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Couleurs de fond pour chaque rareté */
.equipment-slot.common {
    background-color: white; /* Gris pour les objets communs */
}

.equipment-slot.uncommon {
    background-color: green; /* Vert pour les objets peu communs */
}

.equipment-slot.rare {
    background-color: blue; /* Bleu pour les objets rares */
}

.equipment-slot.epic {
    background-color: purple; /* Violet pour les objets épiques */
}

.equipment-slot.legendary {
    background-color: red; /* Orange pour les objets légendaires */
}

.equipment-slot.unique {
    background-color: orange; /* Or pour les objets uniques */
}


/* Style pour le nom de l'objet */
.item-name {
    position: absolute;
    /*top: 100%; /* Position en dessous de l'image */
    left: 50%;
    transform: translateX(-50%); /* Centrer horizontalement */
    background-color: rgb(255, 255, 255); /* Fond blanc */
    border: 5px solid;
    padding: 2px 10px;
    border-radius: 5px;
    text-transform: uppercase;
    text-align: center;
    white-space: nowrap; /* Empêcher le texte de passer à la ligne */
    /*box-shadow: 0 0 10px rgba(0, 0, 0, 0.3); /* Ombre portée */
    z-index: 1000; /* S'assurer que le texte est au-dessus du canvas */
    color: black; /* Couleur du texte par défaut */
}


.item-name.common { border: 5px solid rgb(194, 194, 194); color: black; font-size: 10px;}
.item-name.uncommon { border: 5px solid green; color: green; font-size: 10px;}
.item-name.rare { border: 5px solid blue; color: blue; font-size: 10px;}
.item-name.epic { border: 5px solid purple; color: purple; font-size: 15px;}
.item-name.legendary {  border: 10px solid red; color: red; font-size: 20px;}
.item-name.unique {  border: 10px solid orange; color: orange; font-size: 25px; position: relative; width: fit-content;}

/* Étoile dorée pour les objets uniques */
.item-name.unique::before {
    content: "★";
    position: absolute;
    top: -26px;
    left: -20px;
    color: gold;
    font-size: 60px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.item-name.custom-background {
    background-color: #000000; /* Fond gris clair */
    color: #333; /* Texte foncé */
    border-color: #ccc; /* Bordure grise */
}

/* Aura autour des objets lootés en fonction de la rareté */

.inventory-item.common {
    border: 2px solid white;
}

.inventory-item.uncommon {
    border: 2px solid green;
}

.inventory-item.rare {
    border: 2px solid blue;
}

.inventory-item.epic {
    border: 2px solid purple;
}

.inventory-item.legendary {
    border: 2px solid red;
}

.inventory-item.unique {
    border: 2px solid orange;
    position: relative;
}

#itemsContainer { pointer-events: none; z-index: 500; }

/* Chaque loot (positionné via left/top en pixels CSS) */
.item {
  position: absolute;
  will-change: left, top;
  transform: none;       /* on centre via left/top dans le JS, pas de translate */
  pointer-events: none;  /* évite de bloquer la souris */
  /* la largeur/hauteur sont fixées par le JS via this.size */
}

/* Aura autour des objets */
.item::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    opacity: 0.5;
    z-index: -1;
    animation: pulse 2s infinite; /* Animation de pulsation */
}

/* Animation de pulsation pour l'aura */
@keyframes pulse {
    0% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.2); }
    100% { transform: translate(-50%, -50%) scale(1); }
}

/* Couleurs de l'aura en fonction de la rareté */
.item.common::after {
    background: radial-gradient(
        circle,
        rgba(255, 255, 255, 0.6) 10%, /* Couleur intense au centre */
        rgba(198, 198, 198, 0.3) 50%, /* Transition vers une couleur plus claire */
        rgba(45, 45, 45, 0) 100% /* Transparence à l'extérieur */
    );
    box-shadow: 0 0 15px 5px rgba(198, 198, 198, 0.5);
    filter: blur(10px);
}

.item.uncommon::after {
    background: radial-gradient(
        circle,
        rgba(0, 255, 34, 0.6) 10%, /* Couleur intense au centre */
        rgba(82, 250, 79, 0.3) 50%, /* Transition vers une couleur plus claire */
        rgba(97, 255, 115, 0) 100% /* Transparence à l'extérieur */
    );
    box-shadow: 0 0 15px 5px rgba(82, 250, 79, 0.5);
    filter: blur(10px);
}

.item.rare::after {
    background: radial-gradient(
        circle,
        rgba(30, 30, 242, 0.6) 10%, /* Couleur intense au centre */
        rgba(111, 79, 255, 0.3) 50%, /* Transition vers une couleur plus claire */
        rgba(139, 162, 255, 0) 100% /* Transparence à l'extérieur */
    );
    box-shadow: 0 0 15px 5px rgba(111, 79, 255,6, 0.5);
    filter: blur(10px);
}

.item.epic::after {
    background: radial-gradient(
        circle,
        rgba(249, 26, 190, 0.6) 10%, /* Couleur intense au centre */
        rgba(235, 129, 216, 0.3) 50%, /* Transition vers une couleur plus claire */
        rgba(255, 144, 231, 0) 100% /* Transparence à l'extérieur */
    );
    box-shadow: 0 0 15px 5px rgba(235, 129, 216, 0.5);
    filter: blur(10px);
}

.item.legendary::after {
    background: radial-gradient(
        circle,
        rgba(255, 0, 0, 0.6) 10%, /* Couleur intense au centre */
        rgba(248, 113, 113, 0.3) 50%, /* Transition vers une couleur plus claire */
        rgba(255, 144, 144, 0) 100% /* Transparence à l'extérieur */
    );
    box-shadow: 0 0 15px 5px rgba(248, 113, 113, 0.5);
    filter: blur(10px);
}

.item.unique::after {
    background: radial-gradient(
        circle,
        rgba(255, 162, 0, 0.751) 10%, /* Couleur intense au centre */
        rgba(248, 196, 113, 0.51) 50%, /* Transition vers une couleur plus claire */
        rgba(255, 237, 144, 0) 100% /* Transparence à l'extérieur */
    );
    box-shadow: 0 0 15px 5px rgb(235, 159, 38);
    filter: blur(10px);
}

/* Désactiver l'aura pour les consommables */
.item.no-aura::after {
    display: none; /* Masquer l'aura */
}

/* Style pour la valeur du loot (pièces) */
.item-value {
    position: absolute;
    bottom: 12px;

    color: gold;
    font-size: 14px;
    font-weight: bold;
    text-shadow: 1px 1px 2px black;
}

/* Ajoutez cette classe pour l'objet sélectionné */
.selected-item {
    background: rgb(255,255,255);
    background: radial-gradient(circle, rgba(255,255,255,1) 0%, rgba(0,0,0,1) 91%, rgba(0,0,0,1) 100%);
}

.equipment-slot.active-weapon {
    border: 2px solid rgb(17, 255, 0);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 5px rgb(17, 255, 0);
    }
    50% {
        box-shadow: 0 0 15px rgb(17, 255, 0);
    }
    100% {
        box-shadow: 0 0 5px rgb(17, 255, 0);
    }
}

.active-weapon-indicator {
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 20px;
    color: gold; /* Couleur dorée pour bien voir */
    animation: pulseIcon 1.5s infinite;
}

@keyframes pulseIcon {
    0% { transform: translateX(-50%) scale(1); }
    50% { transform: translateX(-50%) scale(1.2); }
    100% { transform: translateX(-50%) scale(1); }
}