@font-face {
    font-family: pixel;
    src: url(fonts/PressStart2P-Regular.ttf);
}

@keyframes flicker {
    0% { opacity: 0.99; }
    50% { opacity: 0.95; }
    100% { opacity: 1; }
}
@keyframes rotate {
    from {
        transform: rotate(0deg);
    }to {
        transform: rotate(360deg);
    }
}
button {
    font-family: inherit;
    color: inherit;
}

input {
    font-family: inherit;
    color: inherit;
}

h1 {
    color: rgb(255, 174, 0);
    text-align: center;
    font-weight: bold;
}

h3 {
    color: rgb(255, 174, 0);
    text-align: center;
    font-weight: normal;
}

body {
    background-image: url('images/Background.webp');
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    background-attachment: fixed;
    margin: 0;
    font-family: pixel;
    color: white;
    height: 100dvh;
    overflow: hidden;

    #menu-loading{
        position: absolute;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        width: 100vw;
        height: 100vh;
        z-index: 200;
        background-color: rgba(0, 0, 0, 1);
        font-size: 2vw;

        #loadingCoin{

            animation: rotate 5s linear infinite;
            width: 10vw;
            z-index: 300 !important;
        }
    }

    #menu {
        position: absolute;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        width: 100%;
        height: 100%;
        opacity: 0;
        pointer-events: none;
        z-index: 60;

        .overlay {
            position: absolute;
            z-index: 50;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0, 0, 0, 0.8);
        }

        #m-title {
            text-align: center;
            font-size: 10vmin;
            margin-top: 0%;
            padding: 10vh;
            z-index: 60;
        }

        .go-resume {
            display: flex;
            flex-direction: column;
            align-items: flex-start;
            z-index: 60;

            .m-content {
                font-size: 3vmin;
                padding: 2vmin 0;
                white-space: nowrap; 
            }
        }

        #btn-skip {
            bottom: 10%;
            font-size: 10vmin;
            background: transparent;
            border: none;
            padding: 12vh 0;
            cursor: pointer;
            z-index: 60;
            outline: 2px red;
        }
    }

    .content {
        width: 90%;
        max-width: 900px;
        margin: 0 auto;
        display: flex;
        flex-direction: column;
        align-items: center;
        padding: 20px 0;

        header {
            #btn-info {
                z-index: 40;
                position: absolute;
                width: 3vw;
                top: 0.5%;
                left: 0.5%;
                padding: auto;
                background: none;
                border: none;
                cursor: pointer;

                img {
                    width: 100%;
                    
                }
            }

            #menu-1 {
                position: fixed;
                top: 0;
                left: 0;
                width: 100dvw;
                height: 100dvh;

                display: flex;
                justify-content: center;
                align-items: center;
                z-index: 100;
                background-color: rgba(0, 0, 0, 0.6) !important;
                opacity: 0;
                pointer-events: none;
                transition: opacity .2s ease;
                img{
                    transition: opacity .2s ease;
                }
                input[type="checkbox"] {
                    appearance: none;
                    -webkit-appearance: none;
                    
                    width: 2vw;
                    height: 2vw;
                    background-color: rgb(240, 231, 212);
                    border-radius: 10%;
                    cursor: pointer;
                    display: inline-grid;
                    place-content: center;
                    transition: border-radius,background-color 1s ease;
                }
                input[type="checkbox"]:checked {
                    transition: border-radius,background-color 1s ease;
                    border-radius: 100%;
                    background-color: rgb(131, 112, 90);
                }
                input[type="checkbox"]:checked::before {
                    transition: content 6s ease;
                    content: "✔";
                    color: white;
                    font-size: 1.5vw;
                }
                #info {
                    z-index: 110;
                    position: absolute;
                    width: 60%;
                    height: auto;
                    display: block;
                    top: 50%;
                    left: 50%;
                    transform: translate(-50%, -50%);
                    opacity: inherit;
                    pointer-events: inherit;
                }
                .flex{
                    display: flex;
                    flex-direction: column;
                    align-items: center;
                }
                .languages{
                    display: flex;
                    align-items: center;
                    .language-btn{
                        border: none;
                        background: none;
                        cursor: pointer;
                        padding-left: 1dvw;

                        img{
                            width: 80%;
                            transition: all .1s ease-in;
                        }
                    }
                }
                #m-main {
                    position: absolute;
                    color: black;
                    z-index: 120;
                    display: flex;
                    flex-direction: column;
                    align-items: center;
                    width: 40vw;
                    height: 30vw;
                    font-size: 1vw;
                    opacity: 1;
                    pointer-events: inherit;
                    padding: 0%;
                    
                    .m1-btn{
                        font-size: 1vw;
                        background: none;
                        border: none;
                        opacity: inherit;
                        pointer-events: inherit;
                        color: rgb(95, 87, 65);
                        padding: .4vw;
                        &:hover{
                            color: black;
                            cursor: pointer;
                        }
                    }
                    .checkboxes{
                        opacity: inherit;
                        pointer-events: inherit;
                        display: flex;
                        flex-direction: column;
                        font-size: 1vw;
                        color: black;
                        padding: 0%;
                        
                    }
                    
                }   
                #m-htp{
                    position: absolute;
                    color: black;
                    z-index: 120;
                    display: flex;
                    flex-direction: column;
                    align-items: center;
                    gap: 1vw;
                    width: 40%;
                    font-size: 1vw;
                    opacity: 0;
                    pointer-events: none;
                    
                    p{
                        font-size: 100%;
                    };
                    .mhtp-btn{
                        font-size: 200%;
                        background: none;
                        border: none;
                        opacity: inherit;
                        pointer-events: inherit;
                        color: rgb(95, 87, 65);
                        &:hover{
                            color: black;
                            cursor: pointer;
                        }
                    }
                }
                #m-controls{
                    position: absolute;
                    color: black;
                    z-index: 120;
                    display: flex;
                    flex-direction: column;
                    align-items: center;
                    gap: 1rem;
                    width: 40%;
                    font-size: 1vw;
                    line-height: 1.3vw;
                    opacity: 0;
                    pointer-events: none;
                    
                    p{
                        font-size: 100%;
                    };
                    .mcontrols-btn{
                        font-size: 150%;
                        background: none;
                        border: none;
                        opacity: inherit;
                        pointer-events: inherit;
                        color: rgb(95, 87, 65);
                        &:hover{
                            color: black;
                            cursor: pointer;
                        }
                    }
                }
                #m-sound {
                    position: absolute;
                    color: black;
                    z-index: 120;
                    display: flex;
                    flex-direction: column;
                    align-items: center;
                    gap: 1vw;
                    width: 40vw;
                    font-size: 2vw;
                    opacity: 0;
                    pointer-events: none;

                    .audio-btn{
                        font-size: 2vw;
                        background: none;
                        border: none;
                        opacity: inherit;
                        pointer-events: inherit;
                        color: rgb(95, 87, 65);
                        padding: 1vw;
                        &:hover{
                            color: black;
                            cursor: pointer;
                        }
                    }
                    .AudioCheckboxes{
                        opacity: inherit;
                        pointer-events: inherit;
                        display: flex;
                        flex-direction: column;
                        font-size: 1vw;
                        color: black;
                    }
                    .sliders{
                        font-size: 1vw;
                        
                        .ranges{
                            width: 30vw; 
                            height: 1vw;
                        }
                    }
                }
                
            }
            

            .scoreboard {
                display: flex;
                justify-content: space-between;
                width: 100vw; 
                position: absolute;
                top: 20px;
                left: 0;
                padding: 0 10%;
                box-sizing: border-box;
                font-size: 1vw;
                white-space: nowrap; 
            }
        }
        
        main {
            font-weight: normal;
            color: rgb(255, 174, 0);
            text-align: center;

            .flag-container {
                position: absolute;
                width: 55vw;
                left: 50%;
                top: 40%;
                transform: translate(-50%, 50%);
                display: block;
                pointer-events: none;

                #border {
                    position: absolute;
                    top: 50%;
                    left: 50%;
                    z-index: 20;
                    width: 65%;
                    transform: translate(-50%, -50%);
                }

                #flag-display {
                    position: absolute;
                    top: 50%;
                    left: 50%;
                    z-index: 10;
                    width: 50%;
                    transform: translate(-50%, -50%);
                }
                
                #ornament {
                    position: absolute;
                    width: 30%;
                    top: 50%;
                    z-index: -10;
                    left: 10%;
                    transform: translate(-50%, -50%);
                }

                #ornament2 {
                    position: absolute;
                    width: 30%;
                    top: 50%;
                    z-index: -10;
                    left: 90%;
                    transform: translate(-50%, -50%) scaleX(-1);
                }
            }
        }
        
        footer {
            position: fixed;
            bottom: 0; 
            left: 0; 
            width: 100%; 
            z-index: 10;

            #remain {
                position: absolute;
                z-index: 20 ;
                width: 40.6%;
                left: 44.7%;
                bottom: 16%;
                pointer-events: none;
                opacity: 50%;
                font-size: .8vw;
                color: rgb(255, 174, 0);
                #remaining {
                    left: 46.7%;
                }
            }
            #country-input {
                position: absolute;
                z-index: 20;
                left: 50%;
                transform: translateX(-50%);
                bottom: 30%;
                width: 39%;
                font-size: 2.5vw;
                padding: 5px;
                text-align: center;
                text-transform: uppercase;
                font-weight: 100;
                background: transparent;
                border: none;
                outline: none;
                color: rgb(255, 174, 0);
            }

            .ui-inputBar {
                width: 100%;  
                height: auto; 
                display: block;
            }
            #m-book{
                position: fixed;
                top: 0;
                left: 0;
                width: 100vw;
                height: 100vh;

                display: flex;
                justify-content: center;
                align-items: center;
                z-index: 100;
                background-color: rgba(0, 0, 0, 0.6) !important;
                opacity: 0;
                pointer-events: none;
                transition: opacity .1s ease;
                #book-pg{
                    transition: opacity .1s ease;
                }
                .pages {
                    position: absolute;
                    color: black;
                    z-index: 110;
                    display: flex;
                    flex-direction: column;
                    align-items: center;
                    width: 65%;
                    opacity: inherit;
                    pointer-events: inherit;
                    user-select: none;
                    #book-close-btn{
                        width: 3%;
                        height: 3%;
                        right: 11%;
                        top: 11%;
                        position: absolute;
                        z-index: 130;
                        font-size: 1vw;
                        opacity: inherit;
                        pointer-events: inherit;
                        color: rgb(131, 112, 90);
                        border: none;
                        background: none;

                        &:hover{
                            color: black;
                            cursor: pointer;
                        }
                    }
                    #book-next-btn{
                        width: 3%;
                        height: 3%;
                        right: 11.5%;
                        bottom: 14.5%;
                        position: absolute;
                        z-index: 130;
                        font-size: 1.5vw;
                        opacity: inherit;
                        pointer-events: inherit;
                        color: rgb(131, 112, 90);
                        border: none;
                        background: none;

                        &:hover{
                            color: black;
                            cursor: pointer;
                        }
                    }
                    #book-back-btn{
                        width: 3%;
                        height: 3%;
                        left: 11.5%;
                        bottom: 14.5%;
                        position: absolute;
                        z-index: 130;
                        font-size: 1.5vw;
                        opacity: 0;
                        pointer-events: none;
                        color: rgb(131, 112, 90);
                        border: none;
                        background: none;

                        &:hover{
                            color: black;
                            cursor: pointer;
                        }
                    }
                    #book-af-btn{
                        width: 10%;
                        height: 8%;
                        right: 1%;
                        top: 25%;
                        position: absolute;
                        z-index: 130;
                        font-size: 1.5vw;
                        opacity: inherit;
                        pointer-events: inherit;
                        background: none;
                        border: none;

                        &:hover{
                            color: black;
                            cursor: pointer;
                        }
                    }
                    #book-am-btn{
                        width: 10%;
                        height: 8%;
                        right: 1%;
                        top: 35.5%;
                        position: absolute;
                        z-index: 130;
                        font-size: 1.5vw;
                        opacity: inherit;
                        pointer-events: inherit;
                        background: none;
                        border: none;

                        &:hover{
                            color: black;
                            cursor: pointer;
                        }
                    }
                    #book-as-btn{
                        width: 10%;
                        height: 8%;
                        right: 1%;
                        top: 46%;
                        position: absolute;
                        z-index: 130;
                        font-size: 1.5vw;
                        opacity: inherit;
                        pointer-events: inherit;
                        background: none;
                        border: none;
                        
                        &:hover{
                            color: black;
                            cursor: pointer;
                        }
                    }
                    #book-eu-btn{
                        width: 10%;
                        height: 8%;
                        right: 1%;
                        bottom: 35.5%;
                        position: absolute;
                        z-index: 130;
                        font-size: 1.5vw;
                        opacity: inherit;
                        pointer-events: inherit;
                        background: none;
                        border: none;
                        
                        &:hover{
                            color: black;
                            cursor: pointer;
                        }
                    }
                    #book-oc-btn{
                        width: 10%;
                        height: 8%;
                        right: 1%;
                        bottom: 25%;
                        position: absolute;
                        z-index: 130;
                        font-size: 1.5vw;
                        opacity: inherit;
                        pointer-events: inherit;
                        background: none;
                        border: none;
                        
                        &:hover{
                            color: black;
                            cursor: pointer;
                        }
                    }
                    #book-pg{
                        width: 100%;
                        pointer-events: none;
                    }
                }
                
            }
            #book {
                position: absolute;
                z-index: 59;
                bottom: 15%;
                left: 17.2%;
                width: 65.3%;
                height: auto;
                display: block;
                pointer-events: none;
                opacity: 0;
            }
            
            .btn-play {
                position: absolute;
                z-index: 20;
                width: 9.3%;
                background: transparent;
                border: none;
                padding: 0;
                bottom: 13.2%;
                left: 88.6%;

                img {
                    width: 100%;
                    height: auto;
                    display: block;
                }

                &:hover img {
                    content: url('images/gem-on.webp');
                    cursor: pointer;
                }

                &:disabled {
                    pointer-events: none;
                }
            }

            .btn-book {
                position: absolute;
                z-index: 20;
                width: 9.3%;
                background: transparent;
                border: none;
                padding: 0;
                bottom: 13.5%;
                left: 2.2%;

                img {
                    width: 100%;
                    height: auto;
                    display: block;
                }

                &:hover img {
                    transition: all 2s ease;
                    content: url('images/book-on.webp');
                    cursor: pointer;
                }
            }
        }   
    }
}

body::after {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
    pointer-events: none;
    background: linear-gradient(
        rgba(255, 255, 255, 0) 50%,
        rgba(0, 0, 0, 0.35) 50%
    );
    background-size: 100% 4px;
    box-shadow: inset 0 0 150px rgba(0, 0, 0, 0.95);
    animation: flicker 0.15s infinite;
}

@media (max-width: 768px) {

    .flag-container {
        width: 100dvw !important;
        bottom: 50% !important;
    }
    .flag-container img {
        width: 100% !important;
    }
    .flag-container #flag-display {
        width: 79% !important;
    }
    .flag-container #border{
        width: 100dvw !important;
    }
    .flag-container #ornament {
        display: none;
    }
    .flag-container #ornament2 {
        display: none;
    }
    #info{
        width: 150% !important;
        transform: translate(-50%,-50%) rotate(90deg) !important;
    }
    #btn-info{
        width: 12dvw !important;
    }
    p{
        font-size: 4dvw !important;
    }
    #m-main {
        margin-top: -7vh !important;
        width: 90dvw !important;
        height: 100dvw !important;
        .m1-btn{
            font-size: 5vw !important;
        }
        .checkboxes{
            font-size: 5vw !important;
        }
        
    }   
    input[type="checkbox"] {
        width: 8vw !important;
        height: 8vw !important;
    }
    input[type="checkbox"]:checked::before {
        font-size: 5dvw !important;
    }
    .audio-btn{
        font-size: 5dvw !important;
        padding: 10dvw !important;
    }
    #m-sound {
        gap: 1dvw !important;
        width: 80dvw !important;
        font-size: 8dvw !important;
    }
    .AudioCheckboxes{
        font-size: 5dvw !important;
    }
    .sliders{
        .ranges{
            width: 80dvw !important; 
        }
    }
    .scoreboard{
        width: 50% !important;
        top: 1% !important;
        left: 3% !important;
        flex-direction: column !important;
        font-size: 2dvw !important;
    }
    .pages{
        width: 100% !important;
    }
    #btn-htp{
        display: none;
    }
    #btn-controls{
        display: none;
    }
}