:root {
    --bg: #E5EAEC;
    --surface: #1a1a1a;
    --surface2: #252525;
    --border: #333;
    --accent: #e8c547;
    --accent2: #ff6b6b;
    --text: #f0f0f0;
    --text-muted: #888;
    --radius: 4px;
    --nav-h: 56px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Noto Sans JP', 'Hiragino Kaku Gothic ProN', sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-user-select: none;
    user-select: none;
}

/* =============================================
       コンテンツ全体ラッパー
    ============================================= */
#content-wrapper {
    max-width: 1000px;
    margin: 3rem auto;
    background: var(--bg);
}

/* =============================================
       ナビゲーションバー
    ============================================= */
#navbar {
    height: auto;
    background: #00357D;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 16px;
    gap: 12px;
}

#under-navbar {
    height: auto;
    background: #00357D;
    border-bottom: 1px solid var(--border);
    display: flex;
    place-content: center;
    align-items: center;
    padding: 16px;
    gap: 16px;
}

.nav-container {
    width: 100%;
    margin: auto;
    display: flex;
    justify-content: space-between;
    padding: 1.5rem 0;
}

div#nav-title {
    display: flex;
    gap: 30px;
}

div#site-title a {
    color: #fff;
    text-decoration: none;
}

#site-title {
    font-size: 18px;
    font-weight: 900;
    letter-spacing: 0.08em;
    color: var(--accent);
    text-transform: uppercase;
    white-space: nowrap;
    cursor: pointer;
}

#episode-title {
    flex: 1;
    font-size: 16px;
    color: #fff;
    white-space: pre-line;
    line-height: 1.3;
    min-width: 0;
}

#nav-btns {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.nav-btn {
    background: var(--surface2);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 6px 14px;
    border-radius: var(--radius);
    font-size: 12px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    white-space: nowrap;
}

.nav-btn:hover {
    background: var(--accent);
    color: #000;
    border-color: var(--accent);
}

.nav-btn:disabled {
    opacity: 0.3;
    cursor: default;
    pointer-events: none;
}

/* =============================================
       エピソードリスト（トップページ）
    ============================================= */
#home-view {
    padding: 32px 16px 40px;
}

.hero-title {
    font-size: clamp(28px, 7vw, 56px);
    font-weight: 900;
    letter-spacing: -0.02em;
    line-height: 1.1;
    margin-bottom: 8px;
}

.hero-sub {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 40px;
}

.episode-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.episode-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: var(--surface);
    border: 1px solid transparent;
    border-radius: var(--radius);
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    text-decoration: none;
    color: inherit;
}

.episode-card:hover {
    border-color: var(--accent);
    background: var(--surface2);
}

.ep-number {
    font-size: 11px;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: 0.1em;
    min-width: 40px;
}

.ep-info {
    flex: 1;
    min-width: 0;
}

.ep-name {
    font-size: 15px;
    font-weight: 600;
}

.ep-meta {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.ep-arrow {
    color: var(--text-muted);
    font-size: 18px;
    transition: transform 0.15s, color 0.15s;
}

.episode-card:hover .ep-arrow {
    transform: translateX(4px);
    color: var(--accent);
}

/* =============================================
       漫画ビューア本体
    ============================================= */
#reader-view {
    display: none;
    padding-top: 0;
}

#pages-container {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.page-wrapper {
    width: 100%;
    position: relative;
    overflow: hidden;
    touch-action: pan-y;
}

/* ダミー画像オーバーレイ（右クリック保護） */
.page-wrapper::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 10;
    background: transparent;
}

.manga-page {
    width: 100%;
    height: auto;
    display: block;
    -webkit-user-drag: none;
    user-drag: none;
    pointer-events: none;
    /* 直接クリック不可 */
}

/* ズームレイヤー */
#zoom-layer {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 200;
    background: #0f0f0f;
    touch-action: none;
    overflow: hidden;
}

#zoom-layer.active {
    display: block;
}

#zoom-layer-img {
    position: absolute;
    top: 0;
    left: 0;
    transform-origin: 0 0;
    max-width: none;
    pointer-events: none;
    -webkit-user-drag: none;
}

#zoom-close {
    position: fixed;
    top: 12px;
    right: 16px;
    background: rgba(30, 30, 30, 0.9);
    border: 1px solid var(--border);
    color: var(--text);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 22px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 201;
    touch-action: manipulation;
}

/* プログレスバー */
#progress-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--surface);
    z-index: 100;
}

#progress-fill {
    height: 100%;
    background: #00357D;
    transition: width 0.2s;
    width: 0%;
}

/* スクロールトップボタン */
#scroll-top {
    position: fixed;
    bottom: 20px;
    right: 16px;
    width: 44px;
    height: 44px;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 50%;
    color: var(--text);
    font-size: 18px;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 99;
    transition: background 0.15s;
}

#scroll-top:hover {
    background: #00357D;
    color: #fff;
}

/* ローディング */
.loading-indicator {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
    font-size: 14px;
}

/* =============================================
       テキストブロック（画像間に挿入するテキスト）
    ============================================= */
.text-block {
    width: 100%;
    padding: 36px 72px;
    background: #fff;
    box-sizing: border-box;
    -webkit-user-select: text;
    user-select: text;
}

.text-block.style-caption {
    font-size: 13px;
    padding: 16px 24px;
}

.text-block.style-column {
    border-left-color: var(--accent);
}

.text-block-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 10px;
    opacity: 0.8;
}

.text-block.style-narration .text-block-label {
    color: #a99fe0;
}

.text-block.style-caption .text-block-label {
    color: #4caf72;
}

.text-block-heading {
    font-size: 24px;
    font-weight: 800;
    line-height: 1.5;
    margin-bottom: 14px;
    color: #000;
    white-space: pre-wrap;
}

.text-block-body {
    font-size: 16px;
    line-height: 1.5;
    color: #000;
    white-space: pre-wrap;
}

.text-block-body a {
    color: var(--accent);
    text-decoration: underline;
}

.content-box {
    text-align: center;
    padding: 3rem 0;
}

.content-box .btn {
    background-color: #062857;
    padding: 20px 50px;
    color: #fff;
    text-decoration: none;
    max-width: 300px;
    margin: auto;
}



/* =============================================
       レスポンシブ
    ============================================= */

@media (max-width: 480px) {

    #content-wrapper {
        margin: 0 auto;
    }

    .nav-container {
        display: block;
        padding: 1rem 0;
    }

    div#nav-title {
        text-align: left;
        display: block;
        padding: 0 2rem;
        margin-bottom: 1rem;
    }

    #episode-title {
        font-size: 13px;
    }

    #navbar {
        flex-direction: column;
        padding: 8px 0;
        min-height: 110px;
        height: auto;
    }

    #site-title {
        flex: 1;
        font-size: 18px;
        margin-bottom: 0.5rem;
    }

    .content-box {
        padding-bottom: 50px;
    }

    #nav-btns {
        justify-content: center;
    }

    .nav-btn {
        padding: 5px 10px;
        font-size: 11px;
    }

    .page-wrapper {
        max-width: 100%;
    }
}


@media (max-width: 768px) {
    .text-block-heading {
        font-size: 16px;
        line-height: 1.5;
    }

    .text-block {
        padding: 24px 24px;
    }

    .text-block-body {
        font-size: 14px;
        line-height: 1.5;
    }
}

@media (min-width: 768px) {
    #home-view {
        padding-left: 24px;
        padding-right: 24px;
    }

    .episode-card {
        padding: 20px 24px;
    }
}

/* 2026.0415下の余白調整 */
@media screen and (max-width: 768px) {

    div#page-top {
        bottom: 20px;
    }
}