@import url("https://fonts.googleapis.com/css2?family=Noto+Sans+Arabic:wght@100..900&family=Nunito+Sans:ital,opsz,wdth,wght,YTLC@0,6..12,125,200..1000,540;1,6..12,125,200..1000,540&display=swap");

:root {
    --main-color: #41b774;
    --first-color: #92d34f;
    --second-color: #d3ed66;
    --third-color: #2f8986;
    --text-color: #f7ffc7;
}

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

html {
    @media (height <= 860px) {
        font-size: 14px;
        background-color: beige;
    }
}

body {
    background-color: #151515;
    color: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100svh;
    font-family: "Nunito Sans", sans-serif;
}

button {
    cursor: pointer;
    border: none;
    outline: none;
}

span,
a {
    text-decoration: none;
    display: inline-block;
}

.game-view-screen {
    position: relative;
    background-image: url("/front/assets/game-data/sort/assets/objects/meta/wallpaper.webp");
    background-size: 100% 100%;
    height: 90svh;
    width: 95svw;
    border-radius: 5px;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    user-select: none;

    #rotate-notice {
        display: none;
        position: fixed;
        inset: 0;
        background: #000000cc;
        color: white;
        font-size: 24px;
        align-items: center;
        justify-content: center;
        z-index: 9999;
        text-align: center;
    }

    .toggleMusic {
        position: absolute;
        top: 4rem;
        inset-inline-end: 4rem;
        background-color: transparent;
        color: #fff;
        font-size: 3rem;

        &::after {
            position: absolute;
            top: 50%;
            right: 50%;
            translate: 50% -50%;
            display: inline-block;
            content: "";
            width: 0.2em;
            height: 2em;
            background-color: rgb(255, 0, 4);
            border-radius: 1rem;
            rotate: 40deg;
            transition: 0.3s all ease-in-out;
        }

        &:not(.muted)::after {
            height: 0px;
        }

        @media (width <= 1000px) {
            top: 1rem;
            inset-inline-end: 1rem;
            font-size: 2rem;
        }
    }

    .goBack {
        position: absolute;
        top: 4rem;
        inset-inline-start: 4rem;
        width: 70px;
        font-size: 3rem;
        aspect-ratio: 16/13;
        border-radius: 1rem;

        @media (width <= 1000px) {
            top: 1rem;
            inset-inline-start: 1rem;
            width: 50px;
            aspect-ratio: 1/1;
        }
    }

    .play-screen,
    .initial-screen,
    .controls-screen {
        width: 100%;
        height: 100%;
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .end-screen,
    .initial-screen {
        .start-popup {
            position: relative;
            background-color: var(--main-color);
            min-width: min(100%, 300px);
            /* aspect-ratio: 16/11; */
            display: flex;
            justify-content: center;
            align-items: center;
            border-radius: 50px 60px 98px 28px;
            -webkit-border-radius: 50px 60px 98px 108px;
            -moz-border-radius: 50px 60px 98px 100px;
            outline: 6px solid var(--third-color);
            border-top: 10px solid #d3ed66;
            border-left: 10px solid #d3ed66;
            text-align: center;
            max-height: 50svh;
            padding: 2rem 3rem;
            font-size: 2rem;
            aspect-ratio: 16/9;

            > * {
                z-index: 2;
            }

            &::before {
                position: absolute;
                content: "";
                display: block;
                background-color: var(--first-color);
                height: 80%;
                width: 100%;
                top: 0%;
                z-index: 1;
                border-radius: 40px 50px 50% 40%;
            }

            > p {
                font-weight: 600;
                font-size: 2rem;
            }

            .actions {
                display: flex;
                justify-content: center;
                align-items: center;
                gap: 1rem;
                position: absolute;
                inset-inline-start: 50%;
                bottom: 0;
                translate: -50% 50%;

                button {
                    position: relative;
                    padding: 1rem 2rem;
                    border-radius: 50%;
                    font-size: 1rem;
                    rotate: -3deg;
                }
            }
        }
    }

    .initial-screen {
        background-image: url("/front/assets/game-data/sort/assets/initialBG-01.png");
        background-size: 100% 100%;
        margin: -4rem;

        .start-popup {
            padding: 5rem;
            .icon-people {
                position: absolute;
                left: 50%;
                bottom: 100%;
                translate: -50% 19%;
                width: 90%;
            }

            @media (width <= 1000px) {
                padding: 2rem 1rem;
                aspect-ratio: 8/3;
                translate: 0 75%;
            }
        }
    }

    .levels-screen {
        display: none;
        flex-direction: column;
        justify-content: flex-start;
        align-items: flex-start;
        background-color: #92d34f;
        padding: 5vh 10vw;
        height: 90vh;
        width: 95vw;
        margin-inline: -5vw;

        h2 {
            position: sticky;
            top: 0;
            font-size: 3rem;
            font-weight: 800;
            width: 100%;
            text-align: center;
            margin-bottom: 3rem;
        }

        .levels-list {
            display: flex;
            flex-wrap: wrap;
            justify-content: center;
            align-items: center;
            gap: 1rem;
            overflow-y: auto;
            width: 100%;

            .level {
                position: relative;
                display: flex;
                justify-content: center;
                align-items: center;
                gap: 1rem;
                padding: 2rem;
                border: 15px solid #2f8986;
                border-radius: 2rem;
                background-image: url("./game-data/objects/meta/wallpaper.webp");
                background-size: cover;

                .game-info {
                    position: absolute;
                    inset: 0;
                    display: flex;
                    flex-direction: column;
                    justify-content: center;
                    align-items: center;
                    font-size: 1.5rem;
                    text-transform: capitalize;

                    > div {
                        display: inline-block;
                        background-color: #fff;
                        width: auto;
                        max-width: 100%;
                        padding: 1rem;
                        border-radius: 1rem;
                        translate: 0 50px;
                        opacity: 0;
                        transition: 0.3s all ease-in-out;
                    }

                    .lvl-num {
                        font-weight: 700;
                    }
                }

                &.locked {
                    cursor: not-allowed;
                    filter: grayscale(100%);
                }

                div {
                    width: 100%;
                }

                img {
                    width: 120px;
                    transition: 0.3s all ease-in-out;

                    @media (width <= 1000px) {
                        width: 70px;
                    }
                }

                &:not(.locked):hover img {
                    scale: 1.2;
                    filter: drop-shadow(0 0 2px var(--second-color))
                        drop-shadow(0 0 2px var(--second-color))
                        drop-shadow(0 0 2px var(--second-color));
                }

                &:hover .game-info > div {
                    translate: 0 0px;
                    opacity: 0.8;
                }
            }
        }
    }

    .play-screen {
        display: none;

        padding: 2rem;
        .game-screen {
            .baskets {
                position: relative;
                display: flex;
                justify-content: center;
                align-items: center;
                gap: 4rem;

                > div {
                    width: 10vw;
                    aspect-ratio: 9/16;
                }

                img {
                    width: 100%;
                    height: 100%;
                    object-fit: contain;
                }
            }
        }

        .elements-view {
            width: 100%;
            height: 100%;
            position: relative;
            display: flex;
            justify-content: center;
            align-items: center;
        }

        .element-box {
            position: absolute;
            aspect-ratio: 1/1;
            z-index: 2;
            translate: -50% -50%;
            cursor: grab;

            img {
                width: 100%;
                height: 100%;
                object-fit: contain;
                pointer-events: none;
            }

            &:hover {
                img {
                    filter: drop-shadow(0 0 2px var(--first-color))
                        drop-shadow(0 0 2px var(--first-color))
                        drop-shadow(0 0 2px var(--first-color));
                }
            }
        }
    }
}

.primary-bg {
    position: relative;
    background-color: var(--main-color);
    outline: 6px solid var(--third-color);
    border-top: 10px solid var(--second-color);
    border-left: 10px solid var(--second-color);

    > * {
        position: relative;
        z-index: 2;
        color: var(--text-color);
        font-weight: 600;
    }

    &::before {
        position: absolute;
        content: "";
        display: block;
        background-color: var(--first-color);
        height: 85%;
        width: 100%;
        top: 0%;
        left: 0;
        z-index: 1;
        border-radius: inherit;
    }
}

.action-btn-hover:hover {
    animation: pop 1s ease-in-out backwards infinite;
}

@keyframes pop {
    100%,
    0% {
        scale: 1;
        box-shadow: 0 0 10px 10px var(--second-color);
    }
    50% {
        scale: 1.1;
        box-shadow: 0 0 10px 10px var(--second-color);
    }
}
