/* ============== M O D A L - H E L P ================ */
#pomosh-menu {
    display: none;
    flex-direction: column;
    align-items: center;

    position: fixed;
    overflow-y: auto;
    z-index: 203;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scaleY(0);
    transform-origin: center center; /* Точка трансформации — центр верхней границы */
    transition: transform 1.5s ease;

    max-width: 30rem;
    width: 100vw;
    max-height: 100vh; /* Фоллбэк для старых браузеров, не умеющих dvh */
    max-height: 100dvh;

    margin: 0 auto;
    background-color: rgb(43, 43, 43);
    box-shadow: 1rem 1rem 3rem #000;

    line-height: 1.2;
}

#pomosh-menu.rollopenhelp {
    transform: translate(-50%, -50%) scaleY(1);
    opacity: 1;
}

/* Это для мелкого изображения, которое обтекает текст */
.left-float-art {
  float: left;
  height: 2.5rem;
  max-width: 50%;
  margin: 0.1rem 0.3rem 0.1rem 0;
  width: auto;
}

#pomosh-menu h3 {
    text-align: center;
    margin-top: 4rem;
}

#pomosh-menu p {
    padding: 0.1rem;
}

.help-img {
    width: 90%;
    margin: 0 auto;
}

#but-close-help {
    display: block;
    position: fixed;
    z-index: 204;
    cursor: pointer;
    outline: none;
    max-width: 80vw;
    width: 9rem;
    height: 3rem;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;

    top: 0.1rem;
    left: 50%;
    transform: translateX(-50%);
    background-image: url('/image/games/5goroshin/but_close.svg');

    /* Начальное состояние: полностью невидимая */
    opacity: 0;
    visibility: hidden;
    pointer-events: none; /* Полностью отключаем события мыши */
  
    /* Анимация появления */
    transition: opacity 2s ease-out;
}

/* Класс для плавного появления */
#but-close-help.but-appear {
  opacity: 1;
  visibility: visible;
  pointer-events: auto; /* Включаем события при видимости */
}


/* ============== M O D A L - SeTTingS================ */
#settings-menu {
    display: none;
    position: fixed;
    overflow-y: auto;
    z-index: 201;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scaleY(0);
    transform-origin: center center; /* Точка трансформации — центр верхней границы */
    transition: transform 1s ease;

    width: 88vw;
    height: 88vh; /* Фоллбэк для старых браузеров, не умеющих dvh */
    height: 88dvh;

    grid-template-areas:
    "setgrid-txt1   setgrid-txt1"
    "setgrid-trig1  setgrid-trig1"
    "setgrid-trig2  setgrid-trig2"
    "setgrid-trig3  setgrid-trig3"
    "setgrid-thx    setgrid-thx"
    "setgrid-link1  setgrid-link2"    
    "setgrid-close  setgrid-close"
    "setgrid-copy   setgrid-copy";

    grid-template-rows: auto 2fr 2fr 2fr auto auto 2fr 1fr;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;

    box-sizing: border-box;
    
    margin: 0 auto;
    background-color: rgb(43, 43, 43);
    box-shadow: 1rem 1rem 3rem #000;
    color:rgb(238, 190, 127);
}
#settings-menu.rollopensettings {
    transform: translate(-50%, -50%) scaleY(1);
    opacity: 1;
}

.modal-text {
    margin: 0.3rem auto 0 auto;
    padding: 0;
    color:rgb(238, 190, 127);
}
#settings-text1 {
    grid-area: setgrid-txt1;
    margin: 0;
    color:rgb(238, 190, 127);
}
#settings-text1 h2 {
    color:rgb(238, 190, 127);
}


.modal-buttons {
    display: flex;
    justify-content: center;
    align-items: center;
}
.modal-buttons img {
    max-width: 90%;
    cursor: pointer;
}
#but-close-settings {
    grid-area: setgrid-close;
}
#but-close-settings img {
    max-height: 3.5rem;
    cursor: pointer;
}

.modal-triggers {
    display: flex;
    justify-content: center;
    align-items: center;
}
.modal-triggers img {
    max-width: 90%;
    max-height: 3.5rem;
    cursor: pointer;
}
#trigger1 {
    grid-area: setgrid-trig1;
}
#trigger2 {
    grid-area: setgrid-trig2;
}
#trigger3 {
    grid-area: setgrid-trig3;
}

.thx {
    grid-area: setgrid-thx;
    margin: 0.5rem auto 0 auto;
    padding: 0;

    display: flex;
    justify-content: center;
    align-items: flex-end;
}

#modal-link1 {
    grid-area: setgrid-link1;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    margin: 0;
}
#modal-link2 {
    grid-area: setgrid-link2;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    margin: 0;
}
.sm-icon {
    max-height: 3rem;
    margin: 0.1rem 0 1rem 0.3rem;
    padding: 0;
}
.modal-links p {
    margin: 0 0 0 0.3rem;
    padding: 0;
    color:rgb(195, 145, 96);
}
#modal-copyright {
    grid-area: setgrid-copy;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    margin-bottom: 0.5rem;
}

/* ============== M O D A L - E X I T ================ */
#exit-menu {
    display: none;
    position: fixed;
    overflow-y: auto;
    z-index: 202;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scaleY(0);
    transform-origin: center center; /* Точка трансформации — центр верхней границы */
    transition: transform 1.5s ease;

    width: 88vw;
    height: 88vh; /* Фоллбэк для старых браузеров, не умеющих dvh */
    height: 90dvh;


    grid-template-areas:
    "exitgrid-logo"
    "exitgrid-results"
    "exitgrid-msg"
    "exitgrid-close"
    "exitgrid-zanovo"    
    "exitgrid-return";

    grid-template-rows: auto auto auto 1fr 1fr 1fr;
    grid-template-columns: 1fr;
    gap: 0.5rem;

    box-sizing: border-box;
    
    margin: 0 auto;
    background-color: rgb(43, 43, 43);
    box-shadow: 1rem 1rem 3rem #000;
}

#exit-menu.rollopenexit {
    transform: translate(-50%, -50%) scaleY(1);
    opacity: 1;
}

#exit-message {
    grid-area: exitgrid-msg;
    margin: 0;
    padding: 0.5rem;

    display: flex;
    justify-content: center;
    align-items: center;
}
#exit-message-text {
    color:rgb(238, 190, 127);
    margin: 0 auto;
    text-align: center;
}

#exit-logo {
    grid-area: exitgrid-logo;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0;
    padding: 0;

}
#exit-logo img {
    max-width: 93%;
    max-height: 33vh;
    display: block;
    margin: 1rem 0 0 0;
    padding: 0;
}

#results {
    grid-area: exitgrid-results;
    display: flex;
    gap: 1rem;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    margin: 0 0 1rem 0;
    padding: 0;
}
#results h2 {
    margin: 0 0 1rem 0;
    padding: 0;
}
#res1 {
    font-size: 1.5rem;
    color:rgb(238, 190, 127);
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    align-items: center;
}
#res2 {
    font-size: 1.5rem;
    color:rgb(238, 190, 127);
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    align-items: center;
}

.modal-buttons {
    display: flex;
    justify-content: center;
    align-items: center;
}
.modal-buttons img {
    max-width: 90%;
}

#but-zanovo {
    grid-area: exitgrid-zanovo;
}
#but-zanovo img {
    max-height: 3rem;
}

#but-return {
    grid-area: exitgrid-return;
}
#but-return img {
    max-height: 3rem;
}

#but-prodolzhit {
    grid-area: exitgrid-close;
}
#but-prodolzhit img {
    max-height: 4.2rem;
}



/*        ==========================================        */
/*        ======== [ FOR LANDSCAPE SCREENS ]========        */
/*        ==========================================        */
/* @media screen and (orientation:landscape){ */
@media only screen and (min-aspect-ratio: 4/3) {

        /* ============== M O D A L - E X I T ================ */
    #exit-menu {
        display: none;
        position: fixed;
        overflow-y: auto;
        z-index: 202;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%) scaleY(0);
        transform-origin: center center; /* Точка трансформации — центр верхней границы */
        transition: transform 1.5s ease;

        width: 75vw;
        height: 85vh; /* Фоллбэк для старых браузеров, не умеющих dvh */
        height: 90dvh;

        grid-template-areas:
        "exitgrid-logo    exitgrid-results  exitgrid-close"
        "exitgrid-logo    exitgrid-results  exitgrid-zanovo"    
        "exitgrid-msg     exitgrid-msg      exitgrid-return";

        grid-template-rows: auto auto auto;
        grid-template-columns: 1fr 1fr 1fr;
        gap: 0.5rem;

        box-sizing: border-box;
        
        margin: 0 auto;
        padding: 0;
        background-color: rgb(43, 43, 43);
        box-shadow: 1rem 1rem 3rem #000;
    }

    #exit-menu.rollopenexit {
        transform: translate(-50%, -50%) scaleY(1);
        opacity: 1;
    }

    #exit-logo {
        justify-self: end; /* Align to the right */
        align-self: center;  /* Center vertically */

        margin: 0 auto;
        padding: 0;
    }
    #exit-logo img {
        display: block;
        max-width: 100%;
        max-height: 95%;
        margin: 0 0 0 1rem;
        padding: 0;
    }

    #results {
        align-self: center;  /* Center vertically */

        display: flex;
        gap: 1rem;
        flex-direction: column;
        justify-content: flex-start;
        align-items: center;
        margin: auto 0;
        padding: 0;
    }
    #results h2 {
        margin: 0 0 1rem 0;
        padding: 0;
    }
    #res1 {
        font-size: 1.5rem;
        color:rgb(238, 190, 127);
        display: flex;
        gap: 0.5rem;
        justify-content: center;
        align-items: center;
    }
    #res2 {
        font-size: 1.5rem;
        color:rgb(238, 190, 127);
        display: flex;
        gap: 0.5rem;
        justify-content: center;
        align-items: center;
    }
    .modal-buttons {
        display: flex;
        justify-content: center;
        align-items: center;
    }
    .modal-buttons img {
        max-width: 90%;
    }
    #but-zanovo img {
        max-height: 3rem;
    }
    #but-return img {
        max-height: 3rem;
    }
    #but-close-exit img {
        max-height: 4.2rem;
    }
    
    /* ==============[ S E T T I N G S landscape  ]============== */
    #settings-menu {
        width: 88vw;
        max-width: 50rem;
        max-height: 25rem;

        grid-template-areas:
        "setgrid-txt1   setgrid-thx    setgrid-thx"
        "setgrid-trig1  setgrid-link1  setgrid-link2"
        "setgrid-trig2  setgrid-close  setgrid-close"
        "setgrid-trig3  setgrid-copy   setgrid-copy";
    
        grid-template-rows: auto 1fr 1fr 1fr;
        grid-template-columns: 2fr 1fr 1fr;
    
    }
    #but-close-settings img {
        max-width: 9rem;
        max-height: 18vh;
    }
    .modal-triggers img {
        max-width: 15rem;
        max-height: 18vh;
    }
    

}

/* ----------- iPad 1, 2, Mini and Air LANDSCAPE----------- */
@media only screen 
  and (min-device-width: 768px) 
  and (max-device-width: 1024px) 
  and (orientation: landscape) 
  and (-webkit-min-device-pixel-ratio: 1) {
    #exit-menu {
        width: 80vw;
        height: 80vh; /* Фоллбэк для старых браузеров, не умеющих dvh */
        height: 80dvh;
    }
}

/* ----------- Non-Retina Laptops ----------- */
@media screen and (min-device-width: 1200px){
    #exit-menu {
        width: 70vw;
        height: 60vh; /* Фоллбэк для старых браузеров, не умеющих dvh */
        height: 60dvh;
    }
     

}
