body {
    text-align: center;
    font-family: "Happy Monkey", cursive;
    background: linear-gradient(#a2d2ff, #efb0c9);
    color: #ffffff;
    overflow-x: hidden; /* Prevent horizontal scroll */
}

h1,
h2,
h3,
h4,
p {
    text-shadow: 0 0 1px black;
}

#bff-img {
    width: 30vw;
    border-radius: 50%;
    border: 6px solid #efb0c9;
    margin-bottom: 10px;
}

#bday-age {
    background: #efb0c9;
    padding: 5px 10px;
    border-radius: 5px;
    margin: 5px 0 10px 0;
}

#bday-date {
    margin: 0;
    background: #efb0c9;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 1.5em;
}

#header {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.gift-section {
    margin-top: 50px;
    overflow: hidden; /* Prevent layout shift on hover */
}

.gift-title {
    margin-bottom: 10px;
}

.gift-hint {
    margin-top: 0;
}

.gift-img {
    margin: 20px auto;
    max-width: 400px;
    height: 400px;
    border: 6px solid white;
    border-radius: 10px;
    background-image: url("images/gift-cover.jpg");
    background-size: cover;
    transition: height 0.6s ease 1s, background-image 0.3s ease 0.1s;
}

#gift-img-happy:hover {
    background-image: url("images/runn_clap.gif");
}

#gift-img-hot:hover {
    background-image: url("images/runn_mango.jpg");
}

#gift-img-funny:hover {
    background-image: url("images/Funny.png");
}

#gift-img-badass:hover {
    background-image: url("images/runn_jump.gif");
    background-position: top 300px;
}

#gift-img-sleep:hover {
    background-image: url("images/runn-sleep.jpg");
}

#gift-img-cheers:hover {
    background-image: url("images/group.jpg");
    background-size: cover;
    background-repeat: no-repeat;
    height: 35vh;
    transition-delay: 0s;
}

#footer {
    font-style: italic;
    width: 400px;
    margin: 40px auto 20px;
}

a {
    color: white;
}

@media (max-width: 600px) {
    .gift-img {
        width: 90vw;
    }

    #bff-img {
        width: 60vw;
    }

    #gift-img-cheers:hover {
        background-image: url("images/group.jpg");
        background-size: contain;
        height: min(60vw, 300px); /* Prevents excessive height */
    }
}
