:root {
    --bg: #020403;
    --panel: #07100b;
    --panel-2: #0b1510;
    --line: rgba(255,255,255,.10);
    --text: #f5f7f5;
    --muted: #9da8a0;
    --green: #63ed84;
    --green-bright: #a0ffb6;
    --red: #ff5362;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    min-height: 100%;
    background: var(--bg);
    color: var(--text);
    font-family: Arial, Helvetica, sans-serif;
}

body {
    background:
        radial-gradient(circle at top, rgba(33,111,57,.15), transparent 34%),
        #020403;
}

button, select { font: inherit; }
button { color: inherit; }

.reader-header {
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--line);
    background: rgba(2,4,3,.94);
    backdrop-filter: blur(12px);
}

.reader-header-inner {
    width: min(1380px, 96%);
    min-height: 66px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 20px;
}

.back-link {
    justify-self: start;
    color: var(--green-bright);
    text-decoration: none;
    font-weight: 900;
}

.issue-heading {
    text-align: center;
    line-height: 1.15;
}

.issue-heading strong,
.issue-heading span { display: block; }

.issue-heading strong {
    color: var(--green);
    letter-spacing: 1.4px;
}

.issue-heading span {
    color: #cbd3cd;
    font-size: .88rem;
    margin-top: 4px;
}

.free-badge {
    justify-self: end;
    padding: 6px 9px;
    border-radius: 999px;
    background: var(--green-bright);
    color: #031007;
    font-size: .72rem;
    font-weight: 900;
    letter-spacing: .8px;
}

.reader-shell {
    width: min(1460px, 98%);
    margin: 0 auto;
    padding: 12px 0 40px;
}

.reader-toolbar {
    position: sticky;
    top: 66px;
    z-index: 90;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 10px 10px 0 0;
    background: rgba(7,16,11,.96);
    backdrop-filter: blur(10px);
}

.toolbar-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.control-btn,
.zoom-readout,
.page-picker {
    min-height: 39px;
    border: 1px solid rgba(255,255,255,.13);
    border-radius: 7px;
    background: #111a14;
    color: #eef4ef;
    font-weight: 800;
}

.control-btn,
.zoom-readout {
    padding: 8px 12px;
    cursor: pointer;
}

.control-btn:hover:not(:disabled),
.zoom-readout:hover {
    border-color: rgba(99,237,132,.48);
    color: var(--green-bright);
}

.control-btn:disabled {
    opacity: .32;
    cursor: default;
}

.control-btn.compact {
    min-width: 41px;
    font-size: 1.25rem;
}

.zoom-readout {
    min-width: 66px;
    color: var(--green-bright);
}

.page-picker {
    padding: 7px 30px 7px 10px;
}

.page-picker-label {
    color: var(--muted);
    font-size: .82rem;
    font-weight: 800;
}

.page-status {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    padding: 9px 13px;
    border-left: 1px solid var(--line);
    border-right: 1px solid var(--line);
    color: #c9d0cb;
    background: #050906;
    font-size: .82rem;
}

.dot {
    padding: 0 7px;
    color: #536057;
}

.reader-tip {
    color: var(--green-bright);
    font-weight: 800;
}

.comic-stage {
    position: relative;
    border: 1px solid var(--line);
    background:
        linear-gradient(rgba(0,0,0,.14), rgba(0,0,0,.14)),
        repeating-linear-gradient(45deg, #050806 0 12px, #040604 12px 24px);
    box-shadow: 0 28px 80px rgba(0,0,0,.50);
}

.page-scroll {
    position: relative;
    width: 100%;
    height: calc(100vh - 190px);
    min-height: 580px;
    overflow: auto;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 18px 56px 32px;
    scrollbar-color: #36543e #09100b;
}

.comic-page {
    display: block;
    width: 100%;
    max-width: 1024px;
    height: auto;
    margin: 0 auto;
    box-shadow: 0 16px 48px rgba(0,0,0,.58);
    transition: opacity .12s ease;
    background: #111;
}

.comic-page.fit-page {
    width: auto !important;
    max-width: calc(100vw - 145px) !important;
    height: calc(100vh - 235px) !important;
    max-height: calc(100vh - 235px) !important;
    object-fit: contain;
}

.comic-page.is-loading { opacity: .2; }

.loading-message {
    display: none;
    position: absolute;
    top: 35px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 5;
    padding: 8px 11px;
    border-radius: 6px;
    background: rgba(0,0,0,.78);
    color: #fff;
    font-size: .82rem;
}

.loading-message.is-visible { display: block; }

.page-hotspot {
    position: absolute;
    z-index: 20;
    top: 0;
    bottom: 0;
    width: 48px;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.page-hotspot:hover {
    background: rgba(99,237,132,.035);
}

.hotspot-left { left: 0; }
.hotspot-right { right: 0; }

.bottom-nav {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 16px;
    padding: 18px 4px;
}

.big-nav {
    min-height: 49px;
    padding: 10px 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #0d1510;
    color: #e7eee9;
    font-weight: 900;
    cursor: pointer;
}

.big-nav:first-child { justify-self: start; }
.big-nav:last-child { justify-self: end; }

.big-nav.primary {
    color: #031007;
    background: linear-gradient(135deg, var(--green-bright), var(--green));
    border-color: transparent;
}

.big-nav:disabled {
    opacity: .3;
    cursor: default;
}

.bottom-center { text-align: center; }

.bottom-center strong,
.bottom-center span { display: block; }

.bottom-center strong { color: var(--green-bright); }

.bottom-center span {
    margin-top: 3px;
    color: var(--muted);
    font-size: .78rem;
}

.issue-footer-note {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 16px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    text-align: center;
}

.issue-footer-note strong { color: #e7eee9; }

.reader-shell:fullscreen {
    width: 100%;
    padding: 0;
    background: #010201;
    overflow: hidden;
}

.reader-shell:fullscreen .reader-toolbar {
    top: 0;
    border-radius: 0;
}

.reader-shell:fullscreen .page-scroll {
    height: calc(100vh - 104px);
    min-height: 0;
}

.reader-shell:fullscreen .comic-page.fit-page {
    height: calc(100vh - 120px) !important;
    max-height: calc(100vh - 120px) !important;
    max-width: calc(100vw - 120px) !important;
}

.reader-shell:fullscreen .bottom-nav,
.reader-shell:fullscreen .issue-footer-note,
.reader-shell:fullscreen .page-status {
    display: none;
}

@media (max-width: 850px) {
    .reader-header-inner { grid-template-columns: auto 1fr; }
    .issue-heading { text-align: right; }
    .free-badge { display: none; }

    .reader-toolbar {
        position: static;
        flex-direction: column;
        align-items: stretch;
    }

    .toolbar-group { justify-content: center; }

    .page-status {
        flex-direction: column;
        text-align: center;
        gap: 3px;
    }

    .page-scroll {
        height: auto;
        min-height: 70vh;
        padding: 12px 36px 22px;
    }

    .comic-page.fit-page {
        height: auto !important;
        max-height: none !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    .bottom-nav { grid-template-columns: 1fr 1fr; }

    .bottom-center {
        grid-column: 1 / -1;
        grid-row: 1;
    }

    .big-nav { width: 100%; }
}

@media (max-width: 520px) {
    .reader-header-inner {
        width: 94%;
        min-height: 60px;
    }

    .issue-heading strong { font-size: .86rem; }
    .issue-heading span { font-size: .72rem; }

    .reader-shell {
        width: 100%;
        padding-top: 0;
    }

    .reader-toolbar {
        border-left: 0;
        border-right: 0;
        border-radius: 0;
    }

    .control-btn {
        padding: 7px 9px;
        font-size: .82rem;
    }

    .page-picker-label { display: none; }

    .page-scroll {
        padding-left: 28px;
        padding-right: 28px;
    }

    .page-hotspot { width: 28px; }
}
