
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600;700;800&display=swap');

body {
    margin: 0;
    padding: 0;
    background: #0e0e0e;
    font-family: 'Poppins', Arial, sans-serif;
    color: white;
}

:root, *, *::before, *::after {
    -webkit-tap-highlight-color: transparent;
}

a, button {
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

input, textarea, select {
    -webkit-tap-highlight-color: transparent;
}

.reader-container {
    max-width: 820px;
    margin: auto;
    padding: 90px 15px 140px;
}


img.page {
    width: 100%;
    height: auto;
    display: block;
    margin: 0 auto 0 auto;
    background: #1a1a1a;
    transition: opacity .3s ease;
}


.lazy {
    filter: blur(12px);
}


.reader-topbar {
    position: fixed;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    width: min(1100px, 92vw);
    background: rgba(15,15,15,0.92);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 14px;
    padding: 10px 14px;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 10px;
    z-index: 50;
    backdrop-filter: blur(6px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}
.reader-topbar.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, -8px);
}
.rt-left, .rt-right {
    display: flex;
    align-items: center;
}
.rt-right {
    justify-content: flex-end;
}
.rt-btn {
    width: 48px;
    height: 48px;
    background: #1f1f1f;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 50%;
    color: #f5f5f5;
    text-decoration: none;
    font-weight: 700;
    font-size: 13px;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}
.rt-btn:hover {
    background: #f05454;
    border-color: #f05454;
    color: #fff;
    transform: translateY(-1px);
}
.rt-center {
    text-align: center;
    line-height: 1.2;
}
.rt-title {
    color: #fff;
    font-weight: 800;
    text-decoration: none;
}
.rt-title:hover {
    color: #f05454;
}
.rt-sub {
    color: #cfcfcf;
    font-size: 13px;
}


.reader-bottombar {
    position: fixed;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    width: auto;
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 50;
    backdrop-filter: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}
.reader-bottombar.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, 8px);
}
.rb-left, .rb-right, .rb-center {
    display: flex;
    justify-content: center;
}
.rb-btn {
    width: 48px;
    height: 48px;
    background: #1f1f1f;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 50%;
    color: #f5f5f5;
    text-decoration: none;
    font-weight: 700;
    font-size: 13px;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease, color 0.15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}
.rb-btn:hover {
    background: #f05454;
    border-color: #f05454;
    color: #fff;
    transform: translateY(-1px);
}
.rb-btn.disabled {
    opacity: 0.35;
    pointer-events: none;
}
.rb-list {
    background: #30475e;
    border-color: #30475e;
}
.rb-list:hover {
    background: #3d5c7d;
    border-color: #3d5c7d;
}


.reader-scrollfab {
    position: fixed;
    right: 16px;
    bottom: 90px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 55;
    transition: opacity 0.2s ease, transform 0.2s ease;
}
.reader-scrollfab button {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.28);
    background: rgba(15,15,15,0.85);
    color: #fff;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(0,0,0,0.45);
    transition: transform 0.15s ease, background 0.15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.reader-scrollfab.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(6px);
}
.reader-scrollfab button:hover {
    background: #f05454;
    transform: translateY(-1px);
}


.chapter-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 70;
    backdrop-filter: blur(2px);
}
.chapter-modal-backdrop.active {
    display: flex;
}
.chapter-modal {
    width: min(720px, 92vw);
    max-height: min(80vh, 640px);
    background: #111;
    border: 1px solid #222;
    border-radius: 14px;
    box-shadow: 0 20px 46px rgba(0,0,0,0.4);
    display: flex;
    flex-direction: column;
    padding: 16px;
    gap: 12px;
}
.chapter-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.chapter-modal-header h3 {
    margin: 0;
    color: #fff;
}
.chapter-modal-close {
    border: none;
    background: #222;
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 10px;
    cursor: pointer;
}
.chapter-modal-close:hover {
    background: #f05454;
}
.chapter-modal-search input {
    width: 100%;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid #222;
    background: #1a1a1a;
    color: #fff;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    box-sizing: border-box;
}
.chapter-modal-search input:focus {
    border-color: #f05454;
    box-shadow: 0 0 0 1px #f05454;
}
.chapter-modal-list {
    padding-top: 2px;
    overflow-y: auto;
    max-height: 480px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-right: 4px;
}
.chapter-modal-item {
    display: block;
    padding: 12px;
    border-radius: 12px;
    background: #1a1a1a;
    border: 1px solid #222;
    text-decoration: none;
    color: #f5f5f5;
    font-weight: 700;
    transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}
.chapter-modal-item:hover {
    border-color: #f05454;
    background: #222;
    transform: translateY(-1px);
}

.rt-icon, .rb-icon, .fab-icon {
    width: 22px;
    height: 22px;
    object-fit: contain;
    filter: invert(1) brightness(1.2);
    display: block;
}
.rb-icon.rotate-left { transform: rotate(-90deg); }
.rb-icon.rotate-right { transform: rotate(90deg); }
.fab-icon.rotate-down { transform: rotate(180deg); }

.progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: #4da3ff;
    z-index: 300;
}



.comment-box {
    background: #111;
    padding: 20px;
    border-radius: 12px;
}

.comment-text {
    width: 100%;
    background: #222;
    color: #fff;
    padding: 8px;
    border-radius: 6px;
}

.comment-btn {
    background: #6c63ff;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    margin-top: 4px;
}

.comment-item {
    background: #181818;
    padding: 10px 14px;
    border-radius: 8px;
    margin-bottom: 10px;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    margin-bottom: 4px;
}

.comment-time {
    color: #777;
    font-size: 11px;
}

.comment-body {
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 6px;
}

.comment-actions {
    display: flex;
    gap: 10px;
}

.comment-reply-btn,
.comment-delete-btn {
    background: transparent;
    border: none;
    color: #aaa;
    font-size: 11px;
    cursor: pointer;
    padding: 0;
}

.comment-reply-btn:hover,
.comment-delete-btn:hover {
    color: #fff;
}

.comment-reply-box {
    margin-top: 6px;
}



.reaction-box {
    display: flex;
    justify-content: center;
    margin: 30px 0;
}

.react-flex {
    display: flex;
    gap: 18px;
}

.react-item span {
    font-weight: 600;
}




.react-item {
    background: #111;
    color: #fff;
    padding: 10px 18px;
    border-radius: 14px;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    user-select: none;
    border: 1px solid #222;
    transition: 
        background 0.25s ease,
        transform 0.2s ease,
        box-shadow 0.25s ease,
        border-color 0.25s ease;
}

.react-item:hover {
    background: #1b1b1b;
    transform: translateY(-2px);
}



.react-item.active-upvote {
    background: #ffcc00;
    border-color: #ffe680;
    box-shadow: 0 0 12px rgba(255, 220, 0, 0.5);
    color: #4a3800;
    transform: translateY(-2px) scale(1.05);
}

.react-item.active-suki {
    background: #ff4d4d;
    border-color: #ff9999;
    box-shadow: 0 0 14px rgba(255, 60, 60, 0.5);
    color: #fff;
    transform: translateY(-2px) scale(1.05);
}

.react-item.active-apsih {
    background: #3da9ff;
    border-color: #8ccfff;
    box-shadow: 0 0 14px rgba(60, 170, 255, 0.4);
    color: #062033;
    transform: translateY(-2px) scale(1.05);
}


.react-item.active-upvote { background:#ffcc00; }
.react-item.active-suki { background:#ff4d4d; }
.react-item.active-apsih { background:#3da9ff; }


.comment-section {
    margin-top: 35px;
}

.comment-item {
    display: flex;
    gap: 12px;
    padding: 14px 0;
    border-bottom: 1px solid #222;
}

.comment-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #333;
    object-fit: cover;
}

.comment-body {
    flex-grow: 1;
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 8px;
}

.comment-username {
    font-weight: 600;
    color: #fff;
    font-size: 15px;
}

.comment-time {
    color: #888;
    font-size: 13px;
}

.comment-message {
    margin-top: 5px;
    color: #ddd;
    font-size: 15px;
    line-height: 1.45;
}

.comment-actions {
    margin-top: 6px;
    display: flex;
    gap: 12px;
}

.comment-action-btn {
    background: none;
    border: none;
    color: #49a4ff;
    font-size: 13px;
    cursor: pointer;
    padding: 0;
}

.comment-action-btn:hover {
    text-decoration: underline;
}

.reply-box {
    margin-top: 10px;
}

.reply-box textarea {
    width: 100%;
    background: #111;
    border: 1px solid #333;
    padding: 8px;
    border-radius: 6px;
    color: white;
}

.reply-box button {
    margin-top: 6px;
    padding: 6px 12px;
    background: #006eff;
    border: none;
    border-radius: 6px;
    color: white;
    cursor: pointer;
}


.comment-indent {
    margin-left: 46px;
    border-left: 2px solid #222;
    padding-left: 14px;
    margin-top: 4px;
}


@media (max-width: 1280px) {
    .reader-container {
        max-width: 780px;
        padding: 88px 16px 130px;
    }
    .reader-topbar {
        width: min(1040px, 94vw);
    }
    .reader-bottombar {
        gap: 10px;
    }
    .chapter-modal {
        width: min(680px, 90vw);
    }
}

@media (max-width: 1024px) {
    .reader-container {
        max-width: 720px;
        padding: 84px 14px 126px;
    }
    .reader-topbar,
    .reader-bottombar {
        
    }
    .rt-btn, .rb-btn {
        width: 46px;
        height: 46px;
    }
    .reader-scrollfab {
        right: 14px;
        bottom: 82px;
    }
    .chapter-modal {
        width: min(620px, 92vw);
    }
    .chapter-modal-list {
        max-height: 420px;
    }
}

@media (max-width: 768px) {
    .reader-container {
        max-width: 680px;
        padding: 78px 12px 120px;
    }
    .reader-topbar,
    .reader-bottombar {
        
        grid-template-columns: auto 1fr auto;
        gap: 8px;
    }
    .rt-btn, .rb-btn {
        width: 44px;
        height: 44px;
    }
    .rt-title {
        font-size: 15px;
    }
    .rt-sub {
        font-size: 12px;
    }
    .reader-scrollfab {
        right: 12px;
        bottom: 80px;
    }
    .chapter-modal {
        width: 92vw;
        padding: 14px;
    }
    .chapter-modal-item {
        padding: 11px;
    }
}

@media (max-width: 640px) {
    .reader-container {
        padding: 74px 10px 112px;
    }
    .reader-topbar,
    .reader-bottombar {
        
    }
    .rt-btn, .rb-btn {
        width: 42px;
        height: 42px;
    }
    .rt-icon, .rb-icon, .fab-icon {
        width: 20px;
        height: 20px;
    }
    .reader-scrollfab {
        right: 10px;
        bottom: 78px;
    }
    .chapter-modal {
        max-height: 72vh;
    }
}

@media (max-width: 480px) {
    .reader-container {
        padding: 70px 10px 106px;
    }
    .reader-topbar {
        padding: 10px 12px;
    }
    .rt-title {
        font-size: 14px;
    }
    .rt-sub {
        font-size: 11px;
    }
    .rt-btn, .rb-btn {
        width: 40px;
        height: 40px;
    }
    .reader-scrollfab button {
        width: 44px;
        height: 44px;
    }
    .chapter-modal {
        padding: 12px;
    }
    .chapter-modal-item {
        padding: 10px;
    }
}

@media (max-width: 360px) {
    .reader-container {
        padding: 66px 8px 100px;
    }
    .reader-topbar,
    .reader-bottombar {
        
    }
    .rt-btn, .rb-btn {
        width: 38px;
        height: 38px;
    }
    .reader-scrollfab {
        right: 8px;
        bottom: 72px;
    }
    .reader-scrollfab button {
        width: 40px;
        height: 40px;
    }
    .chapter-modal {
        padding: 10px;
    }
}
