#middle {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 40rem;    
    overflow-y: auto;
    border: 1px solid rgba(77, 46, 0, 0.9); 
    margin-top: 0;
    box-sizing: border-box;
    background-color: rgba(255, 253, 208, 0.9);
    z-index: 1;
}

a{
    color: blue;
}
a:hover{
    color:rgb(116, 116, 255);
}

#left_sphere{
    width: 100%;
    max-width: 600px;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: auto;
}

#search_main {
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 1px solid black;
    background-color: rgb(254, 255, 199);
    margin-bottom: 10px;
    border-radius: 30px;
    width: 40rem;
    padding: 0;
    box-sizing: border-box;
    overflow: hidden; 
}

#look_up {
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: rgb(255, 211, 144);
    height: 2rem;
    width: 100%; 
    box-sizing: border-box; 
    padding: 0;
    margin-bottom: 15px;
}

#search_p{
    font-size: 1.2em;
    font-weight: bold;
    padding: 0;
    margin: 0;
}

#search_h1{
    font-size: 2em;
    color: rgba(77, 46, 0, 0.9);
    padding: 0;
    margin: 0;
}

#left {
    width: 100%;
    max-width: 600px;
    height: 400px;
    border-radius: 25%;
    border: 3px solid;
    overflow: hidden;
    position: relative;
    display: inline-block;
    cursor: pointer;
}

.leftimg {
    width: 100%;
    max-width: 650px;
    height: 100%;
    max-height: 500px;
    background-image: url("/img/ksiegarnia.png");
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
    border-radius: 25%;
    transition: transform 0.5s;
}

.leftimg::before {
    content: "";
    display: none;
    height: 100%;
    width: 100%;
    position: absolute;
    top: 0;
    left: 0;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 25%;
}

#left:hover .leftimg:before,
#left:focus .leftimg:before {
    display: block;
}

#left:hover .leftimg,
#left:focus .leftimg {
    transform: scale(1.3);
}

#span_img_left {
    position: absolute;
    left: 30%;
    top: 45%;
    color: rgba(241, 241, 241, 0.75);
    font-family: sans-serif;
    visibility: hidden;
    font-size: 200%;
    height: 100%;
    max-height: 100px;
    width: 100%;
    max-width: 400px;
    text-shadow: 2px 2px 3px #1d1d1f, 2px 2px 5px #dba42d;
}

#left:hover #span_img_left,
#left:focus #span_img_left {
    display: block;
    visibility: visible;
    cursor: pointer;
}

#hellopage {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    max-width: 1000px;
    height: 100%;
    max-height: 600px;
    background-image: url("/img/grafika_wstep.png");
    background-repeat: no-repeat;
    background-size: 100%;
    filter: drop-shadow(2px 2px 3px #b58260);
}

#midmess {
    height: 40%;
    width: 70%;
    display: flex;
    font-size: 150%;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin:0;
    padding:0;
}

#time_p {
    font-size: 1rem;
    font-weight: bold;
    margin-top:-1rem;
    height:3rem;
    width:4rem;
}

@media screen and (max-width: 767px) {
#welcome_h1{
        font-size: 1rem;
    }

#middle{
        height: 33rem;
    }

#left_sphere{
        margin-top: 1.2rem;
        max-width: 100%;
        max-height: 600px;
}

#search_main{
    width: 20rem;
}

#look_up {
    height: fit-content;
}


    #left {
        margin-top: 1.2rem;
        max-width: 85%;
        max-height: 250px; /* Zmieniono wysokość left na auto, aby dostosować do różnych ekranów */
    }

    .leftimg {
        max-width: 100%;
        max-height: 400px;
    }

    #span_img_left {
        font-size: 1rem;
    }

    #hellopage {
    background-size: 105%;
    background-position-x: center;
    max-height: 250px;
    }

    #midmess {
        font-size: 0.35rem;
        height: 9rem;
    }
}