body {
    background: #111;
    color: #eee;
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
}

#game-container {
    margin: 0 auto;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
}

#timer {
    position: absolute;
    top: 5px;
    right: 5px;
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 10px 15px;
    border-radius: 5px;
    font-family: monospace;
    font-size: 16px;
    z-index: 1000;
    /* Assurer que le timer est dans la zone de jeu */
    width: 60px;
    text-align: center;
}

#room-container {
    position: relative;
    margin: auto;
    border: 3px solid #555;
    background: #000;
}

#room-container img {
    display: block;
}

.zone {
    position: absolute;
    cursor: pointer;
}

.zone:hover {
    outline: 2px dotted #d7c800; /* Pointillé noir de 2px */
    border-radius: 8px; /* Coins arrondis */
}

#inventory {
    position: absolute;
    background: rgba(0, 0, 0, 0.6); /* Même fond que le timer */
    padding: 10px 15px; /* Même padding que le timer pour l'espace entre les bords et le texte */
    border: none; /* Pas de bordure comme le timer */
    border-radius: 5px; /* Mêmes coins arrondis que le timer */
    width: 130px; /* Élargir un peu pour faire de la place pour la flèche */
    left: 5px;
    top: 5px;
    /*margin-left: auto;
    margin-right: auto;*/
    cursor: pointer;
    z-index: 1001; /* Assurer que l'inventaire reste au-dessus des autres éléments, y compris de l'overlay */
}

/* Positionner l'inventaire par rapport au room-container */
#room-container #inventory {
    position: absolute;
    left: 5px;
    top: 5px;
}

#inventory h3 {
    margin-top: 0;
    margin-bottom: 0; /* Réduire l'espace sous le titre */
}

#inventory-toggle {
    width: 0;
    height: 0;
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
    border-left: 5px solid #fff;
    margin-left: 5px;
    margin-top: 3px;
    /* Ne pas utiliser flex ici pour éviter de perturber l'affichage des objets */
    flex-shrink: 0; /* Empêcher la flèche de se réduire */
}

#inventory-list {
    /* Par défaut, l'inventaire est caché */
    display: none;
    margin-top: 5px; /* Ajouter un peu d'espace au dessus du contenu */
}

#inventory-list.visible {
    display: block;
}

/* Ajuster la taille des images d'objets dans l'inventaire */
#inventory-list .inventory-item-image {
    width: 60px; /* Taille 60x60 px comme demandé */
    height: 60px;
    object-fit: contain;
    margin-right: 5px;
}

/* Ajuster le layout des items de l'inventaire pour placer l'icône de suppression à droite */
#inventory-list .inventory-item {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
}

#inventory h3 {
    margin-top: 0;
}

#message {
    position: fixed;
    top: 100px;
    left: 50%;
    transform: translateX(-50%);
    width: 768px;
    padding: 20px;

    background: #333;
    border: 2px solid #555;
    color: white;

    z-index: 9999;
    transition: opacity 0.5s ease-out;
    cursor: pointer;

    display: flex;
    align-items: flex-end; /* ← aligne le X en bas */
    gap: 20px;

    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

#image_message {
    width: 80px;
    height: 80px;
    flex-shrink: 0;

    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

#contenu_message {
    flex: 1;
    align-self: center; /* texte centré verticalement */
    text-align: left;
    font-size: 2em;
}

#icone_message {
    font-size: 2em;
    cursor: pointer;
    align-self: flex-end;
}

#icone_message.hidden, #image_message.hidden {
    display:none;
}


#message.msghidden {
    opacity: 0;
    pointer-events: none;
}

.hidden {
    display: none !important;
}

#image-container.hidden {
    display: none;  /* Cacher l'élément par défaut */
}

#image-container,#input-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;  /* Mettre l'image au-dessus des autres éléments */
    background-color: rgba(0, 0, 0, 0.7);  /* Fond semi-transparent */
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}

#image-container img ,#input-container img {
    max-width: 100%;  /* L'image s'adapte à la largeur de l'écran */
    max-height: 80vh; /* L'image ne dépasse pas 80% de la hauteur de la fenêtre */
    cursor: pointer;
}

/* Cacher l'overlay par défaut */
#game-overlay.hidden {
    display: none;
}

/* L'overlay bloque les clics dans #room-container */
#game-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);  /* Fond semi-transparent */
    z-index: 999;  /* Assurer qu'il soit au-dessus du contenu de la pièce */
}

.inventory-item-image {
    cursor:pointer; 
    padding-left:12px;
}

.delete-icon {
    cursor:pointer;
    padding-left:20px;
    vertical-align:20px;
}

#user-input {
    background-color: transparent; 
    border: none; 
    font-size: 24px; 
    color: #000; 
    padding: 5px; 
    font-family: monospace;
    outline: none; 
    width:230px;
}

#submit-button {
    background-color: transparent; 
    border: none;
    font-size: 18px; 
    color: #000; 
    padding: 5px; 
    font-family: monospace;
    outline: none; 
    width:140px;
    border-radius: 12px;
}