/* Popup für Türchen 5: Schiebepuzzle — Bild in einem 4x4-Raster wieder zusammensetzen */
#popup-tuerchen5 {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 25px;
    padding: 40px;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgb(27, 14, 100);
    border: 5px solid #c0392b;
    border-radius: 20px;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
    z-index: 1000;
}

#popup-tuerchen5 h2 {
    color: #fff;
    margin: 0;
    text-align: center;
}

/* Das Raster selbst — Größe/Position der Kacheln steuert puzzle.js über "order" */
#puzzle-container {
    display: grid;
    width: 360px;
    height: 360px;
    border: 3px solid #f1c40f;
    border-radius: 10px;
    overflow: hidden;
}

.puzzle-tile {
    background-repeat: no-repeat;
    cursor: pointer;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.3);
}

.puzzle-tile.puzzle-leer {
    background-image: none !important;
    cursor: default;
    box-shadow: none;
}

#puzzle-feedback {
    margin: 0;
    min-height: 24px;
    font-size: 20px;
    color: #fff;
}

#puzzle-feedback.richtig {
    color: #2ecc71;
}

#zurueck-5 {
    padding: 15px 40px;
    color: white;
    border-radius: 10px;
    font-size: 18px;
    background-color: red;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

#zurueck-5:active {
    background-color: #d4a500;
}

/* Handy-Layout: kleineres Raster, damit es nicht aus dem Bild läuft */
@media (max-width: 768px) {
    #popup-tuerchen5 {
        width: 94vw;
        padding: 25px 15px;
        gap: 18px;
    }

    #puzzle-container {
        width: min(80vw, 320px);
        height: min(80vw, 320px);
    }
}
