.panel img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.panel.loading::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin-top: -20px;
    margin-left: -20px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
body {
    font-family: sans-serif;
    background-color: #f0f0f0;
    background-image: subtle-pattern.png;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

header {
    background-color: #333;
    color: white;
    text-align: center;
    padding: 1rem 0;
}

main {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.container {
    width: 80%;
    max-width: 1200px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

#story-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

#story {
    width: 100%;
    height: 100px;
    padding: 1rem;
    border-radius: 4px;
    border: 1px solid #ccc;
    resize: vertical;
}

#generate {
    padding: 1rem;
    background-color: #333;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

#generate:hover {
    background-color: #555;
}

#cartoon-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 1rem;
    width: 100%;
    aspect-ratio: 1 / 1;
}

.panel {
    background-color: #eee;
    border: 1px solid #ccc;
    border-radius: 4px;
    position: relative;
    overflow: hidden;
}

footer {
    background-color: #333;
    color: white;
    text-align: center;
    padding: 1rem 0;
    margin-top: auto;
}




