/* --- CSS for Draggable Container (Even Smaller) --- */

#imageContainer {
    position: absolute; 
    top: 50px; 
    left: 50px;
    cursor: grab;
    
    /* NEW SIZE: Even Smaller */
    width: 150px; 
    height: 170px; 
    
    overflow: visible; /* Allows the speech bubble to render outside */
    
    transition: transform 0.1s;
}

#imageContainer:hover {
    transform: scale(1.02); 
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.3);
}

/* Title bar text is removed */
#imageContainer::before {
    content: none;
}

/* --- CSS for the Image Overlay --- */
#mainImage {
    width: 100%; /* Image is exactly the width of the container */
    height: 100%; /* Image is exactly the height of the container */
    object-fit: contain; /* Ensures the whole sprite fits */
    display: block;
    transition: opacity 0.3s ease;
    opacity: 1; 
    z-index: 1; /* Ensure image is on a lower layer */
}

/* --- CSS for the Speech Bubble (Kept Compact) --- */
#speechBubble {
    position: absolute;
    top: 50%;
    left: calc(100% + 10px); /* Positioned outside the container */
    transform: translateY(-50%) scale(0);
    
    max-width: 150px;
    padding: 5px 10px;
    font-size: 14px;

    background: #ffffff;
    border: 2px solid #333;
    border-radius: 12px;
    text-align: center;
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s ease;
    z-index: 100;
    pointer-events: none;
}

/* The little triangle/tail of the speech bubble (Pointing LEFT) */
#speechBubble::after {
    content: '';
    position: absolute;
    top: 50%; 
    left: -12px; 
    transform: translateY(-50%); 
    width: 0;
    height: 0;
    
    border: 6px solid transparent;
    border-right-color: #ffffff;
    border-left: 0;
}

.show {
    opacity: 1 !important;
    transform: translateY(-50%) scale(1) !important; 
}