* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    background-color: rgb(24, 24, 24);
}

body {
    min-height: 100dvh;
    color: #ffffff;
    margin: 0;
    padding: 0;
    background-color: rgba(0, 0, 0, 0.55);
    font-family: Verdana, Geneva, Tahoma, sans-serif;
}

.background {
    position: fixed;
    inset: 0;
    background-color: rgb(24, 24, 24);
    background-image: url("../media/background-stars.jpg");
    background-image: image-set(
        url("../media/background-stars.avif") type("image/avif"),
        url("../media/background-stars.jpg") type("image/jpeg")
    );
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center;
    z-index: 0;
}

.back {
    z-index: 20;
    position: fixed;
    top: 14px;
    left: 14px;
    padding: 0.5rem;
    text-decoration: none;
    display: inline-flex;
    transition: transform 0.25s ease;
}

.back svg {
    transform: scale(1.45);
}

.back:hover {
    transform: scale(1.1);
}

.story-layout {
    position: relative;
    z-index: 1;
    display: flex;
    width: 100%;
    min-height: 100dvh;
    background-color: rgba(0, 0, 0, 0.55);
}

.info {
    color: #ffffff;
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(3px) brightness(75%);
    padding: 0 1rem 2rem;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.info::-webkit-scrollbar {
    display: none;
}

.info .cover {
    margin-top: 5vh;
    display: flex;
    width: 100%;
    justify-content: center;
}

.info .cover img {
    border: 0.1em solid #000000;
    border-radius: 10%;
    max-width: 95%;
    width: auto;
    height: 50dvh;
    max-height: 520px;
    display: block;
    object-fit: cover;
}

.read-btn {
    display: flex;
    width: 100%;
    justify-content: center;
    align-items: center;
}

#read-btn {
    border: 0.2em solid #ffffff;
    background-color: transparent;
    border-radius: 5%;
    font-weight: bold;
    color: #ffffff;
    margin: 1.1em 0;
    font-size: 1em;
    padding: 0.9em 2.2em;
    cursor: pointer;
    font-family: inherit;
    transition: background-color 0.35s ease, color 0.35s ease;
}

#read-btn:hover {
    background-color: #ffffff;
    color: #000000;
}

.info .status {
    margin: 0 0.4em;
    line-height: 1.55;
    font-size: 0.92em;
}

.info .status .story-title {
    font-size: 1.25em;
    font-weight: 600;
    margin-bottom: 0.55em;
    line-height: 1.3;
}

.info .synopsis {
    margin: 0.9em 0.4em 0;
    font-size: 0.88em;
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.9);
}

.chapters {
    flex: 1;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.ch-container {
    margin-top: 1.2em;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.65em;
    width: min(500px, 90%);
}

#sort-toggle {
    background: transparent;
    border: none;
    padding: 0.45em;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

#sort-toggle svg {
    transform: scale(1.35);
    transition: transform 0.25s ease;
}

#sort-toggle.is-reversed svg {
    transform: scale(1.35) rotateX(180deg);
}

.ch-container input {
    flex: 1;
    padding: 0.55em 1em;
    border: 0.1em solid rgba(255, 255, 255, 0.85);
    border-radius: 0.7em;
    background: rgba(0, 0, 0, 0.45);
    color: #ffffff;
    font-family: inherit;
    font-size: 0.95em;
}

.ch-container input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.chapter-list {
    width: 100%;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.4em 0 2.5em;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.chapter-list::-webkit-scrollbar {
    display: none;
}

.chapter_item {
    width: min(500px, 90%);
    margin: 0.35em 0;
    border: 0.1em solid rgba(255, 255, 255, 0.88);
    border-radius: 1em;
    background: rgba(0, 0, 0, 0.22);
    transition: background-color 0.2s ease;
}

.chapter_item:hover {
    background: rgba(255, 255, 255, 0.12);
}

.chapter_item a {
    display: block;
    width: 100%;
    padding: 0.9em 1em;
    text-decoration: none;
    color: #ffffff;
}

.chapter_item p {
    margin: 0;
    font-size: 0.95em;
    line-height: 1.4;
}

@media screen and (min-width: 701px) {
    .story-layout {
        height: 100dvh;
    }

    .info {
        width: clamp(250px, 40vw, 400px);
        overflow-y: auto;
    }

    .chapters {
        height: 100dvh;
        overflow: hidden;
    }

    .chapter-list {
        flex: 1;
    }
}

@media screen and (max-width: 700px) {
    .story-layout {
        flex-direction: column;
        height: auto;
    }

    .info {
        width: 100%;
        height: auto;
        overflow: visible;
    }

    .chapters {
        width: 100%;
        margin-top: 0.5em;
    }

    .chapter-list {
        overflow-y: visible;
    }
}
