body {
    font-family: Arial, sans-serif;
}

#puzzlePieces, #puzzleGrid {
    width: 100%;
    max-width: 500px;
    aspect-ratio: 1/1;
}

.puzzle-piece, .grid-box {
    width: 100%;
    aspect-ratio: 1/1;
    border: 1px solid #ccc;
    background-size: cover;
    background-position: center;
    cursor: move;
    user-select: none;
    touch-action: none;
}

.grid-box {
    background-color: #f0f0f0;
}

.grid-box.correct {
    background-color: #3b82f6;
}

#puzzlePieces:empty::before, #puzzleGrid:empty::before {
    content: "Upload an image to start";
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #666;
}

#winnerModal, #loserModal {
    z-index: 1000;
}

#winnerModal .bg-green-500, #loserModal .bg-red-500 {
    transform: scale(0);
    transition: transform 0.3s ease;
}

#winnerModal:not(.hidden) .bg-green-500, #loserModal:not(.hidden) .bg-red-500 {
    transform: scale(1);
}

@media (max-width: 768px) {
    #puzzlePieces, #puzzleGrid {
        max-width: 300px;
    }

    h1 {
        font-size: 1.5rem;
    }

    #timer {
        font-size: 1rem;
    }

    #resetButton {
        font-size: 0.875rem;
        padding: 0.5rem 1rem;
    }

    #winnerModal .bg-green-500, #loserModal .bg-red-500 {
        max-width: 90%;
        padding: 1rem;
    }

    #winnerModal h2, #loserModal h2 {
        font-size: 1.25rem;
    }
}