body, html {
    height: 100%;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

#main-div {
    width: 100%;
    height: 100%;
    max-width: 819px;
    max-height: 1024px;
    aspect-ratio: 819 / 1024;
    margin: auto;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
}

#random-number {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 24px;
}

#gif-container {
    width: 95%;
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 5%;
}

.gif-row {
    display: flex;
    justify-content: space-between;
    width: 100%;
    margin: 10px 0;
}

.small-gif {
    width: 28%;
    height: auto;
    object-fit: contain;
    border: 1px solid white; /* Added white border */
}

/* Media query for smaller screens */
@media (max-width: 819px), (max-height: 1024px) {
    #main-div {
        width: min(100vw, 100vh * (819 / 1024));
        height: min(100vh, 100vw * (1024 / 819));
    }
}