/* General Styling */
body {
    font-family: sans-serif;
    background-color: #f0f0f0;
    text-align: center;
}

.game-header {
    width: 100%;
    max-width: 800px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    box-sizing: border-box;
}

.back-btn {
    background: rgba(255, 255, 255, 0.5);
    color: #333;
    border: 2px solid rgba(0, 0, 0, 0.1);
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.8);
    transform: translateY(-2px);
}

h1 {
    color: #333;
}

#puzzle-board {
    border: 2px solid #333;
    position: relative;
    margin: 20px auto;
    background-size: 100% 100%;
}

#piece-container {
    width: 420px;
    min-height: 120px;
    border: 2px solid #333;
    margin: 20px auto;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    padding: 10px;
    gap: 10px;
    z-index: 20;
}

.puzzle-piece {
    border: 1px solid #fff;
    cursor: grab;
    position: relative;
    z-index: 10;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    transition: all 0.2s ease-in-out;
    box-sizing: border-box;
    touch-action: none;
}

.puzzle-piece:active {
    cursor: grabbing;
    box-shadow: 0 8px 16px rgba(0,0,0,0.3);
    z-index: 20;
}

.drop-zone {
    border: 1px dashed #aaa;
    position: absolute;
    box-sizing: border-box;
}

.solved-piece {
    box-sizing: border-box;
    border: 1px solid #ccc;
}

#win-message {
    margin-top: 20px;
    padding: 20px;
    background-color: #4CAF50;
    color: white;
    border-radius: 8px;
    display: none; /* Hidden by default */
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
}

#new-game-btn {
    padding: 10px 20px;
    font-size: 16px;
    cursor: pointer;
    border: none;
    background-color: #f1f1f1;
    color: #333;
    border-radius: 4px;
    margin-top: 10px;
}

#new-game-btn:hover {
    background-color: #ddd;
}
