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

body{
    background:#111;
    color:#fff;
    font-family:Arial,Helvetica,sans-serif;
    display:flex;
    flex-direction:column;
    height:100vh;
    overflow:hidden;
}

header{
    background:#222;
    padding:12px;
    display:flex;
    justify-content:space-between;
    align-items:center;
    border-bottom:1px solid #444;
}

header h1{
    font-size:22px;
    font-weight:normal;
}

#counter{
    font-size:18px;
}

main{
    flex:1;
    display:flex;
    justify-content:center;
    align-items:center;
    overflow:hidden;
}

#viewer{
    width:100%;
    height:100%;
    display:flex;
    justify-content:center;
    align-items:center;
    overflow:hidden;
}

#mainImage{
    max-width:98%;
    max-height:98%;
    cursor:grab;
    user-select:none;
    transition:transform .15s;
}

#mainImage:active{
    cursor:grabbing;
}

#controls{
    display:flex;
    justify-content:center;
    align-items:center;
    gap:15px;
    padding:12px;
    background:#222;
    border-top:1px solid #444;
}

button{
    background:#444;
    color:white;
    border:none;
    border-radius:6px;
    padding:10px 20px;
    font-size:16px;
    cursor:pointer;
}

button:hover{
    background:#666;
}

#thumbnails{
    background:#181818;
    padding:10px;
    display:flex;
    gap:8px;
    overflow-x:auto;
    border-top:1px solid #444;
}

.thumb{
    width:80px;
    height:80px;
    object-fit:cover;
    cursor:pointer;
    border:3px solid transparent;
    border-radius:4px;
    flex:none;
}

.thumb:hover{
    border-color:#00aaff;
}

.thumb.active{
    border-color:#ff3030;
}

@media (max-width:900px){

    .thumb{
        width:60px;
        height:60px;
    }

    button{
        font-size:14px;
        padding:8px 14px;
    }

    header h1{
        font-size:18px;
    }

}
