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

/* document styles */

body {
    width: 100%;
    min-height: 100vh;
    padding: 0;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 16px;
    background: #dbeafe;
    display: flex;
    flex-direction: column;
}

p {
    font-weight: bold;
    font-size: 1.4rem;
    padding: 0.1rem;
    margin: 0 0.2rem;
}

/* Card container styles */

#playing-cards {
    display: flex;
    flex-wrap: wrap;
    padding: 1rem;
    justify-content: center;
    align-content: space-around;
    gap: 1.2rem;
    background: #f8fafc;
    margin: auto 1rem;
}

/* Styling all the cards equally */

.card {
    display: flex;
    justify-content: space-between;
    flex: 0 1 210px;
    height: 300px;
    padding: 0.3rem;
    border: 0.12rem solid #000;
    font-family: 'Times New Roman', serif;
    border-radius: 0.5rem;
    box-shadow: 0.22rem 0.22rem rgb(172, 172, 172);
    background: white;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    transform: translateY(-0.2rem);
    box-shadow: 0.22rem 0.22rem rgb(172, 172, 172), 0.44rem 0.44rem rgb(172, 172, 172);
}

/* Top-left, bottom-right, and middle sections */

.left {
    align-self: start;
}

.middle {
    align-self: center;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    height: 100%;
    width: 100%;
}

.right {
    align-self: end;
}

/* first card and other cards (card-n) middle individual style */

.card .card1 {
    height: auto;
}

.card .card1 p {
    height: auto;
    font-size: 5rem;
}

.card .card-n p {
    font-size: 2.7rem;
}

/* Shapes at the bottom */

.bottom {
    transform: rotate(180deg);
}

.red {
    color: rgb(255, 5, 5);
    border-color: rgb(0, 0, 0);
}

/* top and bottom section of middle shapes */

.top-first {
    margin-right: auto;
}

.top-second {
    margin: 0 0 auto auto;
    transform: translateY(-100%);
}

.bottom-first {
    margin-left: auto;
}

.bottom-second {
    margin: auto auto 0 0;
    transform: translateY(100%) rotate(180deg);
}

/* footer styles */

.footer {
    background-color: rgba(98, 179, 211, 0.397);
    color: rgb(31, 30, 30);
    text-align: center;
    padding: 1rem;
    margin-top: auto;
}

.footer p {
    font-size: 0.9rem;
}

/* Mobile View */

@media (max-width: 420px) {
    #playing-cards {
        width: 100%;
        display: flex;
        flex-direction: column;
        gap: 0.7rem;
    }

    .card {
        width: 90%;
        max-width: 260px;
    }
}