body {
    display: flex;
    align-items: center;
    flex-direction: column;
    background-image: url("../images/back/bg-tarot.webp");
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
    background-color: black;
    color: hotpink;
    margin: auto;
    padding-bottom: 30px;
}

h1 {
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    width: 100%;
    font-family: 'Uncial Antiqua', cursive;
    background-color: black;
    color: hotpink;
    margin: 0 auto;
    height: 20vh;
}

h3 {
    justify-content: center;
    font-family: 'Italianno', cursive;
    font-style: italic;
    margin: 20px auto;
    padding: 20px;
    color: hotpink;
    text-align: center;
}

section {
    display: flex;
    flex-direction: row;
    margin-left: 150px;
}

main {
    margin: auto;
    margin-top: 20px;
    margin-bottom: 20px;
}

p {
    font-family: 'Uncial Antiqua', cursive;
    font-size: 34px;
    color: rgb(255, 11, 145);
    text-align: center;
    margin-top: 110px;
}

.card {
    height: 310px;
    width: 202px;
    background-image: url("../images/back/alien-back.webp");
    background-position: center;
    background-size: cover;
    border: 5px solid hotpink;
    border-radius: 10px;
    transform-style: preserve-3d;
    transition: all 0.9s ease;
    transform: scale(1);
    margin-right: 20px;
    margin-bottom: 20px;
    flex-shrink: 0; /* Prevent shrinking */
}

.card:last-child {
    margin-right: 0;
}

.card:active {
    transform: scale(.98);
    transition: transform .2s;
}

.card.flip {
    transform: rotateY(-180deg);
}

img {
    height: 100%;
    width: 100%;
    background-position: center;
    background-size: cover;
}

button {
    display: block;
    width: 100px;
    height: 50px;
    margin: 20px auto;
    align-items: center;
    background-color: hotpink;
    color: rgb(0, 0, 0);
    border: 1px solid transparent;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
}

.deck-container {
    display: flex;
    flex-wrap: nowrap; /* Ensures the cards do not wrap to the next line */
    justify-content: flex-start; /* Align items to the start */
    overflow-x: auto; /* Allows horizontal scrolling if cards overflow the container */
    width: 100%;
    margin: 0 auto;
    height: auto; /* Adjust height to fit cards dynamically */
    padding: 10px 0; /* Add some padding for better look */
    box-sizing: border-box; /* Ensure padding is included in the width calculation */
}

@keyframes shuffle {
    0% { transform: translateY(0); }
    50% { transform: translateY(100px); }
    100% { transform: translateY(0); }
}

.shuffling {
    animation: shuffle 0.5s ease-in-out infinite;
}

/* Large screens */
@media (min-width: 768px) {
    main {
        display: flex;
    }

    .deck {
        width: 192px;
        height: 300px;
        margin-left: -12rem;
        margin-bottom: 20px;
        background-image: url("../images/back/tarot-back.webp");
        background-position: center;
        background-size: cover;
        border: 5px solid hotpink;
        border-radius: 10px;
        flex: 1;
    }

    .deck:active {
        transform: scale(.98);
        transition: transform .2s;
    }
}

/* Smaller screens */
@media (max-width: 767px) {
    .deck-container {
        padding: 10px;
        flex-wrap: nowrap; /* Ensures the cards do not wrap to the next line */
    }

    .card {
        height: 150px; /* Smaller height for smaller screens */
        width: 100px; /* Smaller width for smaller screens */
        margin-right: 10px; /* Reduce margin to fit more cards in a row */
        margin-bottom: 10px;
    }

    img {
        height: 100%;
        width: 100%;
    }
}