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

body {
    font-family: Arial, sans-serif;
    background-color: #1a1a1a;
    color: #fff;
    padding: 20px;
}

h1 {
    text-align: center;
    margin-bottom: 40px;
    font-size: 2.5rem;
}

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

.gallery-item {
    overflow: hidden;
    border-radius: 8px;
    aspect-ratio: 1;
    background-color: #333;
    transition: transform 0.3s ease;
    cursor: pointer;
}

.gallery-item:hover {
    transform: scale(1.05);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.lightbox.active {
    display: flex;
}

.lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

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

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 40px;
    cursor: pointer;
    color: #fff;
    transition: color 0.3s ease;
    z-index: 1001;
}

.lightbox-close:hover {
    color: #bbb;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 40px;
    cursor: pointer;
    color: #fff;
    padding: 10px 20px;
    transition: color 0.3s ease;
    user-select: none;
    z-index: 1001;
}

.lightbox-nav:hover {
    color: #bbb;
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

.lightbox-counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    font-size: 16px;
    background-color: rgba(0, 0, 0, 0.5);
    padding: 10px 20px;
    border-radius: 5px;
    z-index: 1001;
}

@media (max-width: 768px) {
    h1 {
        font-size: 1.8rem;
        margin-bottom: 30px;
    }

    .gallery {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 10px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }

    h1 {
        font-size: 1.5rem;
        margin-bottom: 20px;
    }

    .gallery {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 8px;
    }

    .lightbox-nav {
        font-size: 30px;
        padding: 8px 15px;
    }

    .lightbox-prev {
        left: 10px;
    }

    .lightbox-next {
        right: 10px;
    }

    .lightbox-close {
        font-size: 30px;
        right: 15px;
        top: 15px;
    }
}
