.gaming-puzzle-wrapper {
    width: 100%;
    max-width: 800px;
    margin: 20px auto 20px auto;
    padding: 40px;
    display: block !important;
    overflow: visible;
}

.gaming-puzzle {
    position: relative;
    margin: 20px auto;
    background-color: #ddd; 
    border: 2px solid #808080;
    overflow: hidden;
    max-width: 100%;
    max-height: 60vh;
    aspect-ratio: 16 / 9;
    box-sizing: border-box;
}

.gaming-puzzle::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border: 2px solid #808080;
    pointer-events: none;
    z-index: 10;
    box-sizing: border-box;
}
    
.gaming-puzzle .image-overlay {
    position: absolute; 
    top: 0;
    left: 0; 
    width: 100%; 
    height: 100%;
    background-color: #ddd; 
    z-index: 9; 
}

.puzzle-piece {
    border: 1px solid #aaa;
    box-sizing: border-box;
    transition: border 0.3s ease;
    cursor: pointer;
    touch-action: none;
    z-index: 4;
    position: absolute;
}

.puzzle-piece.grouped {
    border: none;
    z-index: 4; /* Keep grouped pieces on top since they can still move */
}

.puzzle-piece.placed {
    border: none;
    z-index: 1; /* Placed pieces go to the bottom */
}

.reset-puzzle-btn {
    background: none;
    border: none;
    padding: 0;
    margin: 10px auto 0 auto;
    display: block;
    cursor: pointer;
    width: 10vw;
    max-width: 80px;
    min-width: 40px;
}

.reset-puzzle-btn img.reset-puzzle-img {
    width: 100%;
    height: auto;
    display: block;
}
