@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: #6fb9b1;
    --first-color: #81c2ba;
    --second-color: #d3ed66;
    --third-color: #3b8278;
    --text-color: #de6964;
}

* {
    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-color: #f4cfcf;
    background-image: url("/front/assets/game-data/puzzle/assets/bg.png");
    background-size: 100% 100%;
    height: 90svh;
    width: 95svw;
    border-radius: 5px;
    padding: 3rem;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    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;
    }

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

    .initial-screen,
    .controls-screen {
        display: flex;
    }

    .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;
        }
    }

    .end-screen,
    .initial-screen {
        .start-popup {
            position: relative;
            min-width: min(100%, 400px);
            max-height: 50svh;
            display: flex;
            justify-content: center;
            align-items: center;
            padding: 2rem 3rem;
            font-size: 2rem;

            .icon {
                width: max(30vh, 300px);
                aspect-ratio: 1/1;
                /* translate: 0 10%; */
                object-fit: contain;
            }

            > p {
                color: var(--text-color);
                font-weight: 600;
                font-size: 2rem;
            }

            .actions {
                position: absolute;
                inset-inline-start: 50%;
                bottom: 0;
                translate: -50% 50%;

                button {
                    position: relative;
                    padding: 2rem 4rem;
                    border-radius: 2rem;
                    font-size: 2rem;
                    white-space: nowrap;
                }
            }
        }
    }

    .end-screen {
        .start-popup {
            .actions {
                display: flex;
                justify-content: center;
                align-items: center;
                gap: 10px;

                button {
                    position: relative;
                    padding: 1rem 2rem;
                    border-radius: 1rem;
                    font-size: 1rem;
                }
            }
        }
    }

    .games-list-screen {
        display: flex;
        justify-content: center;
        align-items: center;
        flex-direction: column;
        gap: 3rem;
        width: 80%;

        display: none;

        h2 {
            font-size: 3rem;
        }

        .games-list {
            display: grid;
            grid-template-columns: repeat(3, minmax(0, 1fr));
            gap: 2rem;
            align-items: stretch;
            max-height: 60svh;
            overflow-y: auto;

            .game-box {
                padding: 0.7rem;
                border-radius: 5px;

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

                    &::before {
                        position: absolute;
                        top: 50%;
                        left: 50%;
                        translate: -50% -50%;
                        font-size: 5rem;
                        color: #fff;
                        content: "\f023";
                        font-weight: 600;
                        font-family: "Font Awesome 5 Free";
                    }
                }
            }

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

    .play-screen {
        display: none;
        svg path {
            cursor: grab;
            pointer-events: none;
            z-index: 1;

            &.item-box:not([data-done="true"]):hover {
                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));
            }

            &.item-box[data-done="true"] {
                pointer-events: none;
                z-index: 1 !important;
            }
        }

        #preview_img {
            position: absolute;
            inset-inline-end: 1rem;
            bottom: 1rem;
            max-width: 100px;
            border-radius: 5px;
        }
    }
}

.primary-bg {
    position: relative;
    background-color: var(--main-color);
    border-radius: 3rem;

    > * {
        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 0px var(--text-color);
    }
    50% {
        scale: 1.1;
        box-shadow: 0 0 10px 0px var(--text-color);
    }
}
