* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body, img {
    user-select: none;
    -webkit-user-select: none;
    -webkit-user-drag: none;
}

body {
    font-family: system-ui, -apple-system, sans-serif;
    background-color: #fafafa;
    color: #333;
    padding: 2rem 1rem;
}

header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.header-content {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.cat-deco {
    font-size: 1.8rem;
    animation: float 3s ease-in-out infinite alternate;
}

.cat-deco.right {
    animation-delay: 1.5s;
}

@keyframes float {
    0% { transform: translateY(0); }
    100% { transform: translateY(-4px); }
}

h1 {
    font-size: 1.8rem;
    font-weight: 600;
}

.loader {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 32px;
    margin-bottom: 1rem;
}

.spinner {
    width: 22px;
    height: 22px;
    border: 2px solid #e2e8f0;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
    max-width: 1200px;
    margin: 0 auto;
}

.gallery img {
    width: 100%;
    height: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 8px;
    display: block;
    cursor: pointer;
    will-change: transform;
    transform-origin: top left;
    background-color: #eee;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery img.loaded {
    opacity: 1;
}

.gallery img.expanded {
    grid-column: span 2;
    grid-row: span 2;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
    z-index: 5;
}

@media (max-width: 580px) {
    .gallery img.expanded {
        grid-column: span 1;
        grid-row: span 1;
    }
}