html, body {
    margin: 0;
    padding: 0;
    overflow: hidden;

    font-family: sans-serif, Arial;
    font-size: 14px;
}

body {
    background-color: #633636;
}

.library-area {
    position: relative;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

.library-background {
    position: absolute;

    height: 100%;
    width: auto;

    left: 50%;
    top: 50%;

    transform: translate(-50%, -50%);
    image-rendering: pixelated;
}

h1 {
    color: #4d1b7b;
    font-size: 3em;
}

h2 {
    font-size: 1.5em;
}

a {
    text-decoration: none;
}

strong {
    font-style: italic;
    text-transform: uppercase;
}

ul,
ol {
    display: inline-block;
    text-align: left;
}


/* Main page box (if you use it) */
.container {
    width: 800px;
    margin: 40px auto;
    padding: 30px;
    text-align: center;

    border: 6px double #6b4423;
    border-radius: 8px;

    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}


/* Twilight */

#twilight {
    position: absolute;

    width: 18%;
    height: auto;

    top: 50%;
    left: 50%;

    transform: translate(-50%, -50%);

    cursor: pointer;
    z-index: 10;

    filter: drop-shadow(0 0 0px #9b59ff);

    transition: 
        transform 0.3s ease,
        filter 0.6s ease;
}




/* Popup */
.popup {
    opacity: 0;
    visibility: hidden;

    position: fixed;
    inset: 0;

    background: rgba(0,0,0,.6);

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

    transition: opacity 0.3s ease, visibility 0.3s ease;

    z-index: 100;
}

.popup.show {
    opacity: 1;
    visibility: visible;
}


.popup-content {
    background: #f8f0ff;

    border: 4px solid #7d4db8;
    border-radius: 20px;

    padding: 30px;
    width: 450px;

    text-align: center;

    box-shadow: 0 0 25px rgba(0,0,0,.4);

    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.popup.show .popup-content {
    transform: scale(1);
}


.close {
    float: right;
    font-size: 30px;
    cursor: pointer;
}


/* Stickers */
.sticker {
    position: absolute;
    width: 90px;

    filter:
        drop-shadow(1px 0 white)
        drop-shadow(-1px 0 white)
        drop-shadow(0 1px white)
        drop-shadow(0 -1px white)
        drop-shadow(3px 4px 5px rgba(0,0,0,.3));
}

.sticker:hover {
    transform: scale(1.08);
}


.sticker1 {
    top: -20px;
    left: -25px;
}

.sticker2 {
    top: 150px;
    right: -30px;
}

.sticker3 {
    bottom: 50px;
    left: 100px;
}


/* Clickable books */
.book-link {
    position: absolute;
    cursor: pointer;
}

.about {
    left: 40%;
    top: 25%;
    width: 50px;
    height: 80px;
}

.projects {
    left: 55%;
    top: 45%;
    width: 60px;
    height: 90px;
}
.book-container {
    position: absolute;

    left: 15%;
    top: 15%;

    text-align: center;
    z-index: 5;
}

.book {
    width: 54px;
    height: 128px;

    opacity: 0;
    transform: translateY(10px);

    cursor: pointer;
    image-rendering: pixelated;

    transition:
        opacity 0.5s ease,
        transform 0.5s ease,
        filter 0.4s ease;
            filter:
        drop-shadow(2px 2px 0 rgba(0,0,0,.4));
}

.book.loaded {
    opacity: 1;
    transform: translateY(0);
}

.book:hover {
    transform: translateX(14px) scale(1.12);

    filter:
        drop-shadow(5px 5px 8px rgba(0,0,0,.5))
        drop-shadow(0 0 12px #38b000);
}



.book-label {
    display: block;

    margin-top: 5px;

    color: white;
    font-size: 12px;

    text-shadow:
        2px 2px black;
        
    opacity: 0;
    transform: translateX(0);
    transition: opacity .3s ease, transform .3s ease;
}

.book:hover + .book-label {
    opacity: 1;
    transform: translateX(6px);
}



.gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}


.gallery img {
    width: 100%;
    height: auto;

    border-radius: 8px;

    image-rendering: auto;
}