/* Listening Maze */
.container:has(.canvas) {
    overflow: visible;
}

#modal-game {
    top: 50%;
    left: 50%; 
    transform: translate(-50%, -50%);
    width: clamp(700px, 80vw, 900px);
    height: 40%;
    border-radius: 20px;
    z-index: 9999;
    box-shadow:  inset 0 0 20px rgb(0, 0, 0, 0.8);
    background: var(--text-gradient);
    
    &::backdrop {
        background-color: rgba(0, 0, 0, .9);
    }
    
    section {
        color: var(--color-text);
        width: 100%;
        height: 100%;
        display: flex;
        flex-direction: column;
        justify-content: space-evenly;
        align-items: center;
        padding: 10px;

        fieldset {
            display: flex;
            justify-content: center;
            align-items: center;
            width: 100%;
            height: 60px;
            gap: 10px;
            border: none;

            button {
                width: clamp(200px, 100%, 250px);
                height: 50px;
                border-radius: 20px;
                cursor: pointer;
                font-weight: bold;
                box-shadow:  inset 0 0 20px rgb(0, 0, 0, 0.8);
                transition: transform .1s ease-in-out;

                &:hover {
                    transform: scale(1.1);
                }
            }

            button:nth-child(1) {
                background-color: #ff4d4d;
                color: white;
            }
            button:nth-child(2) {
                background-color: #4d79ff;
                color: white;
            }
        }
    }
}

.canvas-container {
    #game-listening-maze {
        position: relative;
    }

    #game-mode {
        display: flex;
        justify-content: center;
        width: 100%;
        height: 100px;
        gap: 2px;
        border-radius: 20px;
        margin-bottom: 20px;

        legend {
            font-size: 1.5rem;
        }
        
        button {
            width: 100%;
            height: 35px;
            border-radius: 15px;
            border: none;
            box-shadow: 0 0 20px rgb(0, 0, 0, 0.7);
            cursor: pointer;
            color: var(--color-text);
            font-size: 15px;
            font-weight: 700;
            text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.7);
            box-shadow: inset 0 0 10px rgb(0, 0, 0, 0.5);
            transition: transform .2s ease-in-out,  box-shadow .2s ease-in-out;
            
            &:hover {
                transform: scale(1.1);
                box-shadow: inset 0 0 20px rgb(0, 0, 0, 0.7);
            }
        }

        button:nth-of-type(1) {
            background-color: green;
        }
        button:nth-of-type(2) {
            background-color: rgb(126, 126, 2);
        }
        button:nth-of-type(3) {
            background-color: rgb(150, 0, 0);
        }
        button:nth-of-type(4) {
            background-color: black;
        }
    }

    #start {
        display: flex;
        place-content: center;
        align-items: center;
        font-size: 2rem;
        color: var(--color-text);
        background: var(--text-gradient);
        position: absolute;
        top: 55%;
        left: 50%;
        z-index: 99;
        transform: translate(-50%, -50%);
        width: clamp(40px, 40%, 200px);
        height: 60px;
        border-radius: 15px;
        border: none;
        box-shadow: inset 0 0 20px rgb(0, 0, 0, 0.7);
        cursor: pointer;
        transition: transform .2s ease-in-out;

        &:hover {
            transform: translate(-45%, -45%) scale(1.2);
        }
    }

    #rules {
        text-align: start;

        h2 {
            text-align: center;
        }
    }

    p {
        font-size: 1.5rem;
    }

    .current-info {
        display: flex;
        justify-content: space-evenly;
        align-items: end;
        width: 100%;
        height: 60px;

        #lives {
            overflow: hidden;
            display: flex;
            flex-wrap: wrap;
            justify-content: center;
            align-items: end;
            max-width: 35%;
            width: clamp(60px, 33%, 200px);
            max-height: 90px;
            height: auto;

            img {
                width: fit-content;
                height: 30px;
            }
        }

        p {
            color: var(--color-text);
            border-radius: 10px;
            padding: 10px;
            background: var(--bg-gradient);
        }
    }

    .canvas {
        width: 100%;
        height: auto;
        margin: 20px auto;
        border: 1px solid black;
        border-radius: 15px;
        box-shadow: 0 0 20px rgb(0, 0, 0, 0.7);
        background-image: linear-gradient(180deg, #0000001f 0%, #0000005b 100% ), url("../../public/images/grass-anime-bck.webp");
        background-size: cover;
    }

    #controls.mobile {
        display: none;
        width: 100%;
        height: 70px;
        justify-content: space-evenly;        
        align-items: center;
        border-top: none;
        border-left: none;
        border-right: none;
        border-radius: 20%;

        button {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            border: none;
            box-shadow: 0 0 10px 1px rgb(0, 0, 0, 0.7);
            cursor: pointer;
            transition: transform .2s ease-in-out;

            &:hover {
                transform: scale(1.3);
            }

            img {
                width: 100%;
                height: 100%;
                background: var(--text-gradient);
                border-radius: 50%
            }
        }
    }

    #audioText {
        text-align: start;
        padding: 10px;
    }
}

@media (max-width: 1300px) {
    .canvas-container #start {
        top: 50.5%;
    }

    .canvas-container #controls.mobile {
        display: flex;
    }
}