:root {
    --pink: #ff2e63;
    --pink2: #ff4d7d;
    --bg: #0b0b0d;
    --panel: #151519;
    --panel2: #1d1d22;
    --text: #f5f5f7;
    --muted: #9b9ba5;
    --line: #292930;
}

/* RESET */

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

html,
body {
    margin: 0;
    min-height: 100%;
    background: var(--bg);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui,
        -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
    min-height: 100vh;
}

img {
    max-width: 100%;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select,
textarea {
    font: inherit;
}

button {
    cursor: pointer;
}

.container {
    width: min(1180px, 92%);
    margin-inline: auto;
}

.grow {
    flex: 1;
}

/* NAVIGATION */

.nav {
    height: 70px;
    border-bottom: 1px solid var(--line);
    background: #0e0e10ed;
    backdrop-filter: blur(16px);
    position: sticky;
    top: 0;
    z-index: 50;
}

.navin {
    height: 100%;
    display: flex;
    align-items: center;
    gap: 26px;
}

.logo {
    font-weight: 900;
    font-size: 23px;
    letter-spacing: -1px;
}

.logo b {
    color: var(--pink);
}

.links {
    display: flex;
    gap: 20px;
    color: #c9c9d0;
}

.links a:hover {
    color: #fff;
}

.search {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 10px 13px;
    color: #fff;
    min-width: 190px;
    outline: none;
}

.search:focus,
.field:focus {
    border-color: var(--pink);
}

/* BUTTONS */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 11px;
    padding: 10px 15px;
    background: var(--pink);
    color: white;
    font-weight: 750;
    text-align: center;
    transition: background .2s, transform .2s;
}

.btn:hover {
    background: var(--pink2);
}

.btn:active {
    transform: scale(.98);
}

.btn.secondary {
    background: var(--panel2);
    border: 1px solid var(--line);
}

.btn.secondary:hover {
    background: #292930;
}

/* HOMEPAGE HERO */

.hero {
    padding: 56px 0 40px;
    background: radial-gradient(
        circle at 20% 10%,
        #4d1024 0,
        #0b0b0d 48%
    );
}

.hero h1 {
    font-size: clamp(36px, 6vw, 68px);
    line-height: .98;
    margin: 0 0 18px;
    max-width: 760px;
}

.hero p {
    color: #b7b7c0;
    max-width: 680px;
    font-size: 17px;
    line-height: 1.7;
}

/* SECTIONS */

.section {
    padding: 28px 0;
}

.sectionhead {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 17px;
}

.section h2 {
    margin: 0;
    font-size: 24px;
}

.library-section {
    margin-top: 30px;
}

.library-section h3 {
    margin: 0 0 16px;
    font-size: 19px;
}

/* MANHWA GRID */

.grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 16px;
    align-items: start;
}

.card {
    min-width: 0;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 14px;
    overflow: hidden;
    transition: transform .18s, border-color .18s;
}

.card:hover {
    transform: translateY(-3px);
    border-color: #4a4a55;
}

.cover {
    aspect-ratio: 2 / 3;
    background: #222;
    overflow: hidden;
}

.cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.cardbody {
    padding: 11px;
}

.title {
    font-weight: 750;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.meta {
    font-size: 12px;
    color: var(--muted);
    margin-top: 6px;
}

.badge {
    display: inline-block;
    font-size: 11px;
    padding: 4px 7px;
    border-radius: 999px;
    background: #29111a;
    color: #ff7e9d;
    margin-top: 7px;
}

/* GENERAL PAGES */

.page {
    padding: 34px 0;
}

.muted {
    color: var(--muted);
}

.empty {
    grid-column: 1 / -1;
    padding: 35px 20px;
    text-align: center;
    background: var(--panel);
    border: 1px dashed var(--line);
    border-radius: 15px;
    color: var(--muted);
}

/* =========================================
   ACCOUNT / PROFILE PAGE
   ========================================= */

.account-header {
    display: flex;
    align-items: center;
    gap: 24px;
    width: 100%;
    min-width: 0;
    padding: 25px;
    margin-bottom: 30px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 18px;
}

/* Avatar container */
.account-avatar {
    width: 96px;
    height: 96px;
    min-width: 96px;
    min-height: 96px;
    flex: 0 0 96px;
    overflow: hidden;
    border-radius: 50%;
    background: var(--panel2);
    border: 3px solid var(--pink);
}

/* Actual profile image */
.account-avatar #profileAvatar {
    display: block;
    width: 100% !important;
    height: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: cover;
    object-position: center;
    border-radius: 50%;
}

/* Username, email and account buttons */
.account-info {
    flex: 1;
    min-width: 0;
}

.account-info h1 {
    margin: 0 0 8px;
    font-size: clamp(22px, 4vw, 30px);
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.account-info p {
    margin: 0 0 16px;
    font-size: 14px;
    overflow-wrap: anywhere;
}

.account-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.account-actions .btn {
    min-height: 40px;
}

/* =========================================
   SERIES DETAILS
   ========================================= */


/* Series page */
.series {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 30px;
}

.series .cover {
    border-radius: 15px;
}

.series h1 {
    font-size: 42px;
    margin: 0 0 10px;
}

/* Tags */
.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 18px 0;
}

.tag {
    background: var(--panel2);
    border: 1px solid var(--line);
    padding: 6px 9px;
    border-radius: 999px;
    font-size: 12px;
}

/* Chapter list */
.chapterlist {
    margin-top: 25px;
    border: 1px solid var(--line);
    border-radius: 14px;
    overflow: hidden;
}

.chapter {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 17px;
    border-bottom: 1px solid var(--line);
    background: var(--panel);
}

.chapter:last-child {
    border: 0;
}

.chapter:hover {
    background: var(--panel2);
}

/* Tablet */
@media (max-width: 900px) {
    .series {
        grid-template-columns: 170px 1fr;
    }
}

/* Mobile */
@media (max-width: 600px) {
    .series {
        grid-template-columns: 1fr;
    }

    .series .cover {
        width: 210px;
    }
}


/* =========================================
   MANHWA READER
   ========================================= */

.reader {
    background: #050505;
    min-height: 100vh;
}

.readerbar {
    position: sticky;
    top: 0;
    z-index: 10;
    background: #090909ee;
    border-bottom: 1px solid #222;
    padding: 12px;
}

.readerin {
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 1000px;
    margin: auto;
}

.readerin .grow {
    font-weight: 700;
}

.pages {
    width: min(900px, 100%);
    margin: auto;
}

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

/* =========================================
   LOGIN AND REGISTER
   ========================================= */

.authbox {
    width: min(440px, 92%);
    margin: 70px auto;
    background: var(--panel);
    border: 1px solid var(--line);
    padding: 28px;
    border-radius: 16px;
}

.field {
    display: block;
    width: 100%;
    padding: 12px;
    margin: 7px 0;
    background: #0e0e10;
    border: 1px solid var(--line);
    color: #fff;
    border-radius: 10px;
    outline: none;
}

textarea.field {
    resize: vertical;
}

.field::placeholder {
    color: #777780;
}

/* =========================================
   ADMIN PANEL
   ========================================= */

.adminbox {
    background: var(--panel);
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 15px;
    margin: 15px 0;
}

.notice {
    padding: 12px 15px;
    background: #25101a;
    border: 1px solid #542036;
    border-radius: 10px;
    color: #ff9db4;
    margin-bottom: 15px;
}

.uploadlabel {
    display: block;
    padding: 12px;
    background: #0e0e10;
    border: 1px dashed var(--line);
    border-radius: 10px;
    margin: 8px 0;
    color: #bbb;
}

.uploadlabel input {
    display: block;
    max-width: 100%;
    margin-top: 8px;
}

/* =========================================
   REACTIONS AND COMMENTS
   ========================================= */

.reader-social {
    padding: 35px 0 70px;
}

.reactionbox,
.comments {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 15px;
    padding: 20px;
    margin-top: 18px;
}

.reactions {
    display: flex;
    gap: 9px;
    flex-wrap: wrap;
}

.reaction {
    background: var(--panel2);
    border: 1px solid var(--line);
    color: #fff;
    border-radius: 999px;
    padding: 9px 14px;
}

.reaction.active {
    border-color: var(--pink);
    background: #351321;
}

.commentcomposer {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.commentcomposer .field {
    margin: 0;
}

.commentlist {
    margin-top: 15px;
}

.comment {
    padding: 15px 0;
    border-top: 1px solid var(--line);
    line-height: 1.6;
    overflow-wrap: anywhere;
}

.commenthead {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 5px;
}

.linkbtn {
    border: 0;
    background: none;
    color: var(--pink2);
    padding: 5px 0;
}

/* =========================================
   LEGAL AND STATUS PAGES
   ========================================= */

.legal {
    max-width: 900px;
}

.legal h1 {
    font-size: 42px;
}

.legal h2 {
    margin-top: 30px;
}

.statusrow {
    display: flex;
    gap: 15px;
    align-items: center;
    background: var(--panel);
    border: 1px solid var(--line);
    padding: 16px;
    border-radius: 12px;
    margin: 10px 0;
}

.statusrow span:last-child {
    margin-left: auto;
    color: #9be7b0;
}

.dot {
    width: 10px;
    height: 10px;
    flex: 0 0 10px;
    border-radius: 50%;
    background: #55d477;
}

/* =========================================
   FOOTER
   ========================================= */

.footer {
    padding: 50px 0;
    color: #777;
    border-top: 1px solid var(--line);
    margin-top: 40px;
}

.footergrid {
    display: flex;
    justify-content: space-between;
    gap: 30px;
    align-items: flex-start;
}

.footergrid strong {
    font-size: 18px;
}

.footergrid strong b {
    color: var(--pink);
}

.footerlinks {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 20px;
    justify-content: flex-end;
}

.footerlinks a:hover {
    color: #fff;
}

.newpill {
    font-size: 9px;
    padding: 3px 5px;
    border-radius: 5px;
    background: var(--pink);
    color: #fff;
    font-weight: 800;
}

.copyright {
    margin-top: 30px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
    font-size: 12px;
    color: #666;
}

/* Footer fallback */
.site-footer {
    display: block;
    width: 100%;
    margin-top: 40px;
    padding: 30px 20px;
    background: #1a1a1a;
    color: #aaa;
    text-align: center;
    box-sizing: border-box;
    position: relative;
    z-index: 10;
}

.site-footer a {
    color: #aaa;
    text-decoration: none;
    margin: 0 8px;
}

.site-footer a:hover {
    color: var(--pink);
}

.site-footer .footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-bottom: 15px;
}

.site-footer .footer-bottom {
    font-size: 13px;
    color: #777;
}

/* =========================================
   TABLET
   ========================================= */

@media (max-width: 900px) {
    .grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .links {
        display: none;
    }

    .search {
        min-width: 0;
        width: 150px;
    }

    .series {
        grid-template-columns: 170px minmax(0, 1fr);
        gap: 22px;
    }

    .account-header {
        gap: 20px;
    }
}

/* =========================================
   MOBILE
   ========================================= */

@media (max-width: 600px) {
    .container {
        width: 92%;
    }

    .grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .series {
        grid-template-columns: minmax(0, 1fr);
    }

    .series .cover {
        width: 210px;
        max-width: 100%;
    }

    .series h1 {
        font-size: 30px;
    }

    .hero {
        padding-top: 35px;
    }

    .hero h1 {
        font-size: 42px;
    }

    .hero p {
        font-size: 15px;
    }

    .search {
        width: 120px;
        padding: 9px;
    }

    .navin {
        gap: 10px;
    }

    .logo {
        font-size: 20px;
    }

    .page {
        padding: 22px 0;
    }

    /* ACCOUNT PAGE: COMPACT MOBILE HEADER */
    .account-header {
        padding: 18px;
        gap: 15px;
        border-radius: 15px;
        align-items: center;
    }

    .account-avatar {
        width: 64px;
        height: 64px;
        min-width: 64px;
        min-height: 64px;
        flex-basis: 64px;
        border-width: 2px;
    }

    .account-avatar #profileAvatar {
        width: 100% !important;
        height: 100% !important;
        max-width: 100% !important;
        max-height: 100% !important;
    }

    .account-info h1 {
        font-size: 22px;
        margin-bottom: 5px;
    }

    .account-info p {
        font-size: 12px;
        margin-bottom: 12px;
    }

    .account-actions {
        gap: 8px;
    }

    .account-actions .btn {
        padding: 9px 11px;
        font-size: 13px;
        min-height: 36px;
    }

    .footergrid {
        flex-direction: column;
    }

    .footerlinks {
        justify-content: flex-start;
    }

    .site-footer {
        padding: 25px 15px;
    }

    .site-footer .footer-links {
        gap: 10px;
        line-height: 1.8;
    }

    .site-footer a {
        margin: 0 4px;
    }

    .commentcomposer {
        flex-direction: column;
        align-items: stretch;
    }

    .commentcomposer .btn {
        width: 100%;
    }

    .authbox {
        margin: 35px auto;
        padding: 22px;
    }

    .legal h1 {
        font-size: 32px;
    }

    .readerin {
        flex-wrap: wrap;
    }

    .reactionbox,
    .comments {
        padding: 15px;
    }
}

/* VERY SMALL PHONES */

@media (max-width: 360px) {
    .account-header {
        padding: 13px;
        gap: 11px;
    }

    .account-avatar {
        width: 54px;
        height: 54px;
        min-width: 54px;
        min-height: 54px;
        flex-basis: 54px;
    }

    .account-info h1 {
        font-size: 19px;
    }

    .account-actions .btn {
        padding: 8px;
        font-size: 12px;
    }

    .logo {
        font-size: 17px;
    }
}



/* Maru Manhwa threaded comments */
.comment-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin: 18px 0;
}

.comment-items,
#commentItems {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.comment {
    min-width: 0;
    overflow-wrap: anywhere;
    padding: 16px;
    margin: 12px 0;
    background: #1a1a1a;
    border: 1px solid #303030;
    border-radius: 12px;
}

.commenthead {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 10px;
}

.comment-body {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    line-height: 1.6;
}

.comment-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 12px;
}

.linkbtn {
    padding: 4px 0;
    color: #aaa;
    background: transparent;
    border: 0;
    cursor: pointer;
    font: inherit;
}

.linkbtn:hover,
.linkbtn.active {
    color: #ff4d7d;
}

.reply-composer {
    margin-top: 14px;
    display: grid;
    gap: 10px;
}

.comment-replies {
    margin: 14px 0 0 12px;
    padding-left: 14px;
    border-left: 2px solid #393939;
}

.reply-comment {
    background: #202020;
}

.commentcomposer {
    display: grid;
    gap: 12px;
}

.commentcomposer textarea,
.reply-composer textarea {
    box-sizing: border-box;
    width: 100%;
    resize: vertical;
}

@media (max-width: 600px) {
    .comment {
        padding: 12px;
    }

    .comment-replies {
        margin-left: 4px;
        padding-left: 9px;
    }
}

.reader-social .comment-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.reader-social .vote-button {
    appearance: none;
    -webkit-appearance: none;

    display: inline-flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: center !important;
    flex-wrap: nowrap !important;
    gap: 6px !important;

    width: auto !important;
    min-width: 48px !important;
    height: 34px !important;
    min-height: 34px !important;

    padding: 0 9px !important;
    margin: 0 !important;

    background: #222226 !important;
    color: #a5a5ad !important;

    border: 1px solid #35353d !important;
    border-radius: 9px !important;

    box-shadow: none !important;
    outline: none !important;

    font: inherit;
    font-size: 13px;
    line-height: 1 !important;
    white-space: nowrap !important;

    cursor: pointer;
    transition: background .15s ease, color .15s ease,
                border-color .15s ease;
}

.reader-social .vote-button .vote-icon {
    display: block !important;
    width: 17px !important;
    height: 17px !important;
    flex: 0 0 17px !important;

    margin: 0 !important;
    padding: 0 !important;

    fill: none !important;
    stroke: currentColor !important;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.reader-social .vote-button span {
    display: inline-block !important;
    flex: 0 0 auto !important;

    width: auto !important;
    margin: 0 !important;
    padding: 0 !important;

    color: inherit !important;
    line-height: 1 !important;
    white-space: nowrap !important;
}

.reader-social .vote-button:hover {
    background: #303037 !important;
    border-color: #50505a !important;
    color: #ffffff !important;
}

.reader-social .vote-button.active {
    background: rgba(255, 77, 125, .12) !important;
    border-color: rgba(255, 77, 125, .35) !important;
    color: #ff4d7d !important;
}

.reader-social .vote-button.dislike-active {
    background: rgba(143, 169, 255, .12) !important;
    border-color: rgba(143, 169, 255, .35) !important;
    color: #8fa9ff !important;
}

.reader-social .vote-button:focus-visible {
    outline: 2px solid #ff4d7d !important;
    outline-offset: 2px !important;
}

.reader-social .vote-button:active {
    transform: scale(.97);
}

.reader-social .vote-button:disabled {
    opacity: .55;
    cursor: not-allowed;
}

/* Comment profile pictures and role badges */
.reader-social .commenthead {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 10px !important;
    margin-bottom: 12px;
    width: 100%;
}

.reader-social .comment-avatar {
    width: 42px !important;
    height: 42px !important;
    flex: 0 0 42px !important;
    margin: 0 !important;
    object-fit: cover;
    border-radius: 50%;
}

.reader-social .comment-author {
    display: flex !important;
    flex: 0 1 auto !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    justify-content: center !important;
    gap: 4px !important;
    min-width: 0;
    width: auto !important;
    margin: 0 !important;
}

.reader-social .comment-author-line {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    flex-wrap: wrap;
    gap: 7px;
    width: auto !important;
}

.reader-social .comment-author-line strong {
    margin: 0 !important;
}

.reader-social .comment-role {
    display: inline-flex;
    align-items: center;
    padding: 3px 7px;
    border-radius: 5px;
    background: #292930;
    border: 1px solid #3a3a43;
    color: #bdbdc8;
    font-size: 10px;
    font-weight: 600;
    line-height: 1.2;
}

.reader-social .comment-role.role-admin {
    background: rgba(255, 77, 125, .12);
    border-color: rgba(255, 77, 125, .35);
    color: #ff4d7d;
}

.reader-social .comment-time {
    font-size: 12px;
}

