#factions {
    background-image: url("/storage/app/media/new/bg.jpg");
    display: block;
    overflow: hidden;
}

#factions .content {
    text-transform: uppercase;
    position: relative;
    z-index: 2;
    text-align: center;
    margin: 0 auto 0 auto;
    padding: 0 1rem;
}

#factions .content h2 {
    font-size: 5rem;
    line-height: 4rem;
    margin-bottom: 0;
}

@media (max-width: 768px) {
    #factions .content h2 {
        font-size: 2rem;
        line-height: 2rem;
    }
}

#factions .content h3 {
    font-size: 2.5rem;
    line-height: 2rem;
    margin-top: 3rem;
    margin-bottom: 0;
}

#factions .content p {
    margin-top: 0;
    font-size: 1.15rem;
    line-height: 1.5rem;
}

#factions .characters, #factions .ships {
    position: absolute;
    top: 0%;
    left: 0%;
    height: 100%;
    z-index: 1;
    max-width: 50%;
    width: 100%;
}

#factions .ships {
    top: inherit;
    bottom: 0;
    left: inherit; 
    right: 0;
}

#factions .characters img, #factions .ships img {
    position: absolute;
    transform: translateX(-100%);
    opacity: 0;
    transition: transform 0.3s ease-out;
    width: auto;
    height: 100%;
    right: 25%;
}

#factions .ships img {
    top: inherit;
    right: inherit;
    bottom: 0;
    left: 25%;
    transition-delay: 0.2s;
    transform: translateX(100%);
}

#factions .characters img.active, #factions .ships img.active {
    transform: translateX(0);
    opacity: 1;
}

#factions .cards {
    position: relative;
    z-index: 3;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr 1fr 1fr;
    grid-gap: 0.75rem;
    width: 90%;
    max-width: 1000px;
    margin: 0 auto 0 auto;
    padding-top: 2.5rem;
}

#factions .cards a {
    display: block;
    text-decoration: none;
    width: 100%;
    background-color: transparent;
    perspective: 1000px;
}

#factions .cards img {
    width: 100%;
}

#factions .cards a .inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.3s;
    transform-style: preserve-3d;
    padding-bottom: 150%;
}

#factions .cards a:hover .inner {
    transform: rotateY(180deg);
}

#factions .cards a.active .inner {
    transform: rotateY(180deg) scale(1.1);
}

#factions .cards a .inner .front, #factions .cards a .inner .back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
}

#factions .cards a .inner .front {
    background-color: transparent;
    color: #000;
    display: flex;
    justify-content: center;
    align-items: center;
}

#factions .cards a .inner .back {
    background-color: transparent;
    color: white;
    transform: rotateY(180deg);
}

@media (max-width: 600px) {
    #factions {
        background-color: #4580a8;
        background-size: inherit;
        background-position: center bottom;
    }
    #factions video {
        display: none;
    }
    #factions .ships, #factions .characters {
        width: 50%;
        height: 25vh;
        top: inherit;
        bottom: 2.5rem;
    }
    #factions .cards {
        grid-template-columns: 1fr;
    }
    #factions .cards a.active .inner {
        transform: rotateY(180deg) scale(1);
    }
    
}
