body {
    font-family: 'Comic Sans MS', 'Comic Sans', cursive;
    background-color: #f0f0f0; 
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    padding: 20px;
}

.main-container {
    display: flex;
    gap: 40px;
    align-items: flex-start;
}

.storybook-container {
    display: flex;
    gap: 20px;
}

.page {
    width: 450px;
    height: 600px;
    background-color: #ffffff;
    border: 5px solid #a0522d; 
    border-radius: 10px;
    box-shadow: 5px 5px 15px rgba(0,0,0,0.2);
    padding: 20px;
    position: relative; /* This is key for positioning dragged images */
    overflow: hidden;
}

.draggable-image {
    position: absolute; /* This allows us to move the image freely */
    cursor: grab;
    max-width: 30%;
    max-height: 30%;
    object-fit: contain;
    z-index: 10;
}

.story-text {
    width: 100%;
    height: 80px;
    position: absolute;
    bottom: 20px;
    left: 0;
    padding: 0 20px;
    border: none;
    resize: none;
    font-size: 16px;
    text-align: center;
    background: none;
}

.controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding: 20px;
    background-color: #f9f9f9;
    border-radius: 8px;
    box-shadow: 2px 2px 10px rgba(0,0,0,0.1);
}

.image-gallery {
    border: 2px dashed #ccc;
    width: 250px;
    min-height: 150px;
    padding: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    align-items: center;
}

.image-gallery img {
    max-width: 80px;
    max-height: 80px;
    cursor: grab;
}

.backgrounds-palette {
    display: flex;
    gap: 10px;
}

.bg-option {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 2px solid #ccc;
    cursor: pointer;
    transition: transform 0.2s;
}

.bg-option:hover {
    transform: scale(1.1);
}

.bg-option[data-color="#f0e6d2"] { background-color: #f0e6d2; }
.bg-option[data-color="#d4e6f1"] { background-color: #d4e6f1; }
.bg-option[data-color="#f9c7e0"] { background-color: #f9c7e0; }