@import url('https://fonts.googleapis.com/css2?family=Pixelify+Sans:wght@400..700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Pixelify Sans", sans-serif;
}
html, body {
    width: 100vw;
    height: 100vh;
    background: url("assets/menu_background.png") center / cover;
    overflow: hidden;
}
img {
    display: block;
}
@keyframes show_section {
    from {
        opacity: 0;
        transform: scale(.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}
section {
    width: 100%;
    height: 100%;
    &:not(.active) {
        display: none;
    }
    &.active {
        animation: 1s show_section forwards;
    }
}
.play_button {
    cursor: pointer;
    &:hover {
        svg {
            .back {
                fill: #FE9AB9;
            }
        }
    }
    path {
        transition: all .5s;
    }
    svg {
        width: 100%;
        height: 100%;
    }
}
p {
    font-size: 1.5rem;
    color: #fff;
    text-align: center;
}

#loader, #notify {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    background: rgb(0 0 0 / .75);
    z-index: 99;
    display: flex;
    align-items: center;
    justify-content: center;
    .center {
        img {
            width: 300px;
        }
    }
}
#notify {
    display: none;
    &.active {
        display: flex;
    }
    button {
        font-size: 2rem;
        color: #fff;
        background: none;
        border: 2px solid #FE9AB9;
        border-radius: 1rem;
        padding: 1rem 2rem;
        margin: 1rem auto 0 auto;
        display: block;
        cursor: pointer;
    }
}

@keyframes button_border {
    0% {
        stroke-dashoffset: 6000;
        fill: transparent;
    }
    50% {
        fill: transparent;
    }
    100% {
        fill: #fff;
        stroke-dashoffset: 0;
    }
}
@keyframes button_back {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}
#start {
    grid-template: 50px repeat(4, 1fr) 50px / 50px repeat(4, 1fr) 50px;
    &.active {
        display: grid;
    }
    .play_button {
        grid-area: 5 / 2 / 5 / 2;
        opacity: 0;
        animation: .5s .25s show_section forwards;
        fill: transparent;
        svg {
            .border {
                stroke-dasharray: 6000;
                stroke-dashoffset: 6000;
                animation: 4s .5s button_border forwards;
            }
            .back {
                opacity: 0;
                animation: 2s 2.5s button_back forwards;
            }
        }
    }
    .background {
        grid-area: 1 / 1 / -1 / -1;
        img {
            width: 100%;
            height: 100%;
            object-fit: contain;
            object-position: right bottom;
            opacity: 0;
            animation: 1.5s 1.25s show_section forwards;
        }
    }
}

#choice {
    grid-template: 50px calc(100vh - 250px) 150px 50px / 50px 2fr 1fr 2fr 50px;
    align-items: center;
    &.active {
        display: grid;
    }
    .left {
        grid-area: 2 / 2 / 2 / 2;
        overflow: hidden;
        height: 100%;
    }
    .vs {
        grid-area: 2 / 3 / 2 / 3;
        place-self: center;
        img {
            width: 7.5rem;
        }
    }
    .right {
        grid-area: 2 / 4 / 2 / 4;
        overflow: hidden;
        height: 100%;
    }
    .hero_carousel {
        height: 100%;
        display: flex;
        flex-direction: column;
        gap: 1rem;
        margin-bottom: 2rem;
        overflow: hidden;
        .heroes {
            display: grid;
            grid-template: 1fr / 1fr;
            overflow: hidden;
            .hero {
                grid-area: 1 / 1 / 1 / 1;
                opacity: 0;
                transform: scale(.9);
                transition: all .5s;
                overflow: hidden;
                &.active {
                    opacity: 1;
                    transform: scale(1);
                }
            }
        }
        .controls {
            display: flex;
            gap: 3rem;
            justify-content: center;
            .prev, .next {
                cursor: pointer;
            }
            .prev {
                transform: rotate(180deg);
            }
            img {
                width: 2rem;
            }
        }
        img {
            width: 100%;
            height: 100%;
            object-fit: contain;
            object-position: center bottom;
        }
    }
    .bottom {
        grid-area: 3 / 3 / 3 / 3;
        .play_button {
            fill: #fff;
        }
    }
}

#game {
    background-size: cover;
    background-position: center;
    .info {
        position: absolute;
        top: 0;
        width: 100%;
        display: flex;
        padding-inline: 2rem;
        justify-content: space-between;
        img {
            width: 100px;
        }
    }
    .players {
        position: absolute;
        bottom: 0;
        width: 100%;
        #player_2 {
            transform: scaleX(-1);
        }
        > div {
            position: absolute;
            bottom: 0;
            width: 500px;
            &.mirror_container {
                img {
                    position: absolute;
                    left: 0;
                    bottom: 0;
                }
            }
        }
    }
}