

h1 {
    text-align: left;
    margin-left: 40px;
}

#container {
    display: flex;
    justify-content: flex-start; /* по лівому краю */
    align-items: flex-start;
    gap: 30px;
    margin-left: 0px;
}

#board {
    width: 504px;
    height: 504px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 0px;
    border: 2px dashed #aaa;
    position: relative;
}

.cell {
    width: 250px;
    height: 250px;
    border: 1px dashed #ccc;
    position: relative;
}
img {
    border: none;
}

#pieces_left {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 250px;
    height:510px;

}
#pieces_right {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 250px;
    height:510px;

}

.piece {
    width: 250px;
    height: 250px;
    cursor: grab;
    /*transition: all 0.2s ease;*/
    z-index: 10;
    border: none !important;
}


.snap {
    border: 2px solid limegreen;
}

.glue {
    animation: glue 0.6s ease forwards;
}

@keyframes glue {
    0% { transform: scale(1.05); }
    100% { transform: scale(1); }
}


#board.merged {
    /*border: none;*/
    gap: 0;
    transition: all 0.5s ease;
}

#board.merged .cell {
    border: none;
    padding: 0;
}

#board.merged img {
    box-shadow: none;
    transition: transform 0.5s ease;
}

#board.merged img {
    animation: mergeEffect 0.4s ease-in-out forwards;
}

@keyframes mergeEffect {
    0% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@media (max-width: 1000px) {
    #container {
        flex-direction: column;
        align-items: center;
        gap: 20px;
    }

    #board {
        width: 300px;
        height: 300px;
    }

    .cell {
        width: 150px;
        height: 150px;
    }

    #pieces_left,
    #pieces_right {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        width:300px;
        margin-left:-20px;

        height:150px;

    }

    .piece {
        width: 150px;
        height: 150px;
    }
}

