*{
    margin:0;
    padding:0;
    box-sizing:border-box;
}



.gallery{
    position:relative;
    width:95%;
    max-width:1200px;
    height:90vh;
    background:#000;
    border-radius:12px;
    overflow:hidden;
    box-shadow:0 0 30px rgba(0,0,0,.5);
}

#viewer{
    width:100%;
    height:100%;
}

#viewer img,
#viewer video{
    width:100%;
    height:100%;
    object-fit:contain;
    display:block;
    background:#000;
    animation:fade .4s ease;
}

@keyframes fade{
    from{
        opacity:0;
        transform:scale(.98);
    }
    to{
        opacity:1;
        transform:scale(1);
    }
}

button{
    position:absolute;
    top:50%;
    transform:translateY(-50%);
    background:rgba(0,0,0,.6);
    color:#fff;
    border:none;
    width:55px;
    height:55px;
    font-size:28px;
    cursor:pointer;
    border-radius:50%;
    z-index:10;
    transition:.3s;
}

button:hover{
    background:#2196f3;
}

.prev{
    left:20px;
}

.next{
    right:20px;
}

.fullscreen{
    top:20px;
    right:20px;
    left:auto;
    transform:none;
    width:auto;
    height:auto;
    padding:10px 18px;
    border-radius:5px;
    font-size:16px;
}

.caption{
    position:absolute;
    bottom:0;
    left:0;
    width:100%;
    padding:15px;
    background:rgba(0,0,0,.6);
    color:#fff;
    text-align:center;
    font-size:20px;
}

.counter{
    position:absolute;
    top:20px;
    left:20px;
    background:rgba(0,0,0,.7);
    color:#fff;
    padding:8px 15px;
    border-radius:20px;
    z-index:20;
}


.gallery-container{
    display:flex;
    justify-content:center;
    align-items:center;
    width:100%;
    min-height:100vh;
    padding:15px;
    background:#f4f4f4;
}