body {
    font-family: Arial, sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: #f0f0f0;
    margin: 20px;
}

h1 {
    color: #333;
}

.game-container {
    display: flex;
    gap: 30px;
    margin-top: 20px;
    align-items: flex-start;
}

.puzzle-board {
    display: grid;
    /* Grid-Template-Columns und Rows werden per JS dynamisch gesetzt */
    border: 2px solid #ccc;
    background-color: #eee;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    position: relative; /* Wichtig für absolute Positionierung der Teile */
}

.puzzle-piece {
    width: 100%; /* Passend zur Grid-Zelle */
    height: 100%; /* Passend zur Grid-Zelle */
    /* background-size wird per JavaScript gesetzt */
    background-repeat: no-repeat;
    border: 1px solid #ddd;
    box-sizing: border-box; /* Border wird in die Größe einberechnet */
    cursor: grab;
    transition: transform 0.1s ease-out; /* Für sanfte Drag-Animation */
}

.puzzle-piece.dragging {
    opacity: 0.7;
    cursor: grabbing;
    z-index: 1000; /* Stellt sicher, dass das gezogene Element oben ist */
}

.puzzle-piece.placeholder {
    background-color: rgba(0, 0, 0, 0.1);
    border: 2px dashed #999;
}

.controls {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
}

button {
    padding: 10px 20px;
    font-size: 1em;
    cursor: pointer;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    transition: background-color 0.2s;
}

button:hover {
    background-color: #0056b3;
}

.timer {
    font-size: 1.2em;
    font-weight: bold;
    color: #555;
}

.solution-preview {
    text-align: center;
}

.solution-preview img {
    border: 1px solid #ccc;
    box-shadow: 0 0 5px rgba(0,0,0,0.1);
}

.footer-link {
    margin-top: 40px;
    text-align: center;
}

.footer-link a {
    font-size: 24px;
    font-weight: bold;
    color: #007bff;
    text-decoration: none;
    padding: 15px 30px;
    border: 2px solid #007bff;
    border-radius: 8px;
    background-color: #f8f9fa;
    display: inline-block;
    transition: all 0.3s ease;
}

.footer-link a:hover {
    background-color: #007bff;
    color: white;
    transform: scale(1.05);
}