body {
    font-family: 'Comic Sans MS', sans-serif;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    margin: 0;
    background-color: #1a1a2e;
    padding: 20px;
    box-sizing: border-box;
    color: #e0e0e0;
}

.container {
    text-align: center;
    background-color: #16213e;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    width: 75%;
    min-width: 768px;
    border: 1px solid #0f3460;
}

h1 {
    color: #e94560;
    margin-bottom: 20px;
	font-size: 3em;
}

#newComicBtn {
    padding: 10px 20px;
    font-size: 1.1em;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    margin-bottom: 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.nav-stack {
	flex-direction: column;
}

#newComicBtn:hover {
    background-color: #0056b3;
}

#comicStrip {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.panel {
    border: 2px solid #0f3460; /* Border color matching container */
    border-radius: 8px;
    padding: 15px;
    width: 280px; /* Fixed width for each panel */
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2); /* Soft shadow */
    background-color: #1a1a2e; /* Darker background for panels */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between; /* Push caption to bottom */
    text-align: center;
    box-sizing: border-box; /* Include padding in the width */
}

.image-container {
    position: relative;
    width: 100%; /* Take full width of the panel */
    height: 200px; /* Fixed height for image container */
    overflow: hidden; /* Hide overflowing parts of images if needed */
    margin-bottom: 15px;
    border: 1px solid #0f3460; /* Subtle border for images */
    border-radius: 5px;
}

.image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Cover the container, cropping if necessary */
    position: absolute;
    top: 0;
    left: 0;
}

.front-image {
    z-index: 10; /* Ensure front image is on top */
}

.caption {
    font-size: 1.1em;
    color: #bbbbbb; /* Lighter grey for captions */
    margin-top: 0; /* Remove default paragraph margin */
    min-height: 50px; /* Ensure some space for captions even if short */
    display: flex;
    align-items: center;
    justify-content: center;
}

.navigation-buttons {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 20px;
    gap: 15px;
}

.navigation-buttons button {
    padding: 10px 20px;
    font-size: 1.1em;
    background-color: #007bff; /* Consistent button color */
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.navigation-buttons button:hover {
    background-color: #0056b3; /* Darker blue on hover */
}

#chapterCounter {
    font-size: 1.2em;
    font-weight: bold;
    color: #e94560; /* Highlight color for chapter counter */
}

@media (max-width: 1280px) {
    .container {
        width: 100%; /* Take full width minus body padding */
        min-width: unset; /* Remove min-width for smaller screens */
        padding: 15px; /* Reduce container padding */
    }

    #newComicBtn,
    .navigation-buttons button {
        padding: 8px 15px; /* Smaller button padding */
        font-size: 1em; /* Smaller button font size */
        margin-bottom: 20px; /* Adjust button margin */
    }

    #comicStrip {
        flex-direction: column; /* Stack panels vertically */
        align-items: center; /* Center panels when stacked */
        gap: 15px; /* Reduce space between panels */
    }

    .panel {
        width: 95%; /* Make panels take more width in vertical layout */
        max-width: 300px; /* Set a reasonable max-width for panels */
        padding: 10px; /* Reduce panel padding */
    }

    .caption {
        font-size: 1em; /* Slightly reduce caption font size */
        min-height: 40px; /* Adjust min-height for captions */
    }

    .navigation-buttons {
        margin-top: 15px;
        gap: 10px;
    }

    #chapterCounter {
        font-size: 1em; /* Reduce chapter counter font size */
    }
}