body, html {
    margin: 0;
    padding: 0;
    height: 100%;
    width: 100%;
    overflow: hidden; /* Prevent scrolling */
}

.book-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1; /* Ensure book container is above background */
    padding: 10px; /* Add padding for better appearance on smaller screens */
    box-sizing: border-box;
}

.book-image {
    width: 100%;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.hidden {
    display: none;
}

.open-button, .close-button, .back-button {
    position: fixed;
    padding: 10px 20px;
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid #fff;
    color: #fff;
    font-family: 'Cinzel', serif;
    cursor: pointer;
    border-radius: 5px;
    transition: all 0.3s ease;
    z-index: 2; /* Ensure buttons are above book images */
}

.open-button {
    bottom: 70px; /* Increase space from the bottom */
    left: 50%;
    transform: translateX(-50%);
}

.close-button {
    bottom: 70px; /* Ensure it is positioned above the back button */
    left: 50%;
    transform: translateX(-50%);
}

.back-button {
    bottom: 20px; /* Positioned at the bottom */
    left: 50%;
    transform: translateX(-50%);
}

.open-button:hover, .close-button:hover, .back-button:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-color: #fff;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .open-button, .close-button, .back-button {
        padding: 8px 16px; /* Reduce padding for smaller screens */
        font-size: 14px; /* Adjust font size for better readability */
    }

    .open-button, .close-button {
        bottom: 60px; /* Adjust button positioning for smaller screens */
    }

    .back-button {
        bottom: 10px; /* Adjust back button positioning */
    }
}

@media (max-width: 480px) {
    .open-button, .close-button, .back-button {
        padding: 6px 12px; /* Further reduce padding for very small screens */
        font-size: 12px; /* Smaller font size for narrow screens */
    }

    .open-button, .close-button {
        bottom: 50px; /* Adjust button positioning for very small screens */
    }

    .back-button {
        bottom: 5px; /* Adjust back button positioning */
    }

    .book-container {
        padding: 5px; /* Reduce container padding for very small screens */
    }
}
