body {
    margin: 0;
    font-family: sans-serif;
    background: black;
    color: white;
}

/* HOME */
.gallery {
    display: flex;
    flex-direction: column;
}

.item {
    display: flex;
    align-items: center;
    padding: 10px;
    text-decoration: none;
    color: white;
}

.item img {
    width: 150px;
    margin-right: 15px;
}

/* ヘッダー */
#header {
    position: fixed;
    top: 0;
    width: 100%;
    text-align: center;
    background: rgba(0,0,0,0.7);
    padding: 10px;
    transition: opacity 0.3s;

    z-index: 1000;
}

.back {
    position: absolute;
    left: 10px;
    top: 10px;
    color: white;
    text-decoration: none;
}

/* ビュー */
#viewer {
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    width: 100%;
    height: 100vh;
    position: relative;
}

#pages {
    display: flex;
    flex-direction: row-reverse;
    height: 100%;
    transition: transform 0.3s ease;
}

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

.page img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

#slider {
    transform: scaleX(-1);
    width: 80%; /* ←ここで長さ調整（おすすめ80〜90%） */
    max-width: 800px; /* PCで伸びすぎ防止 */
}

/* フッター */
#footer {
    position: fixed;
    bottom: 0;
    width: 100%;
    text-align: center;
    background: rgba(0,0,0,0.7);
    padding-top: 10px;
    padding-bottom: 10px;
    transition: opacity 0.3s;

    z-index: 1000;
}

/* 非表示 */
.hide {
    opacity: 0;
    pointer-events: none;
}

#overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;

    background: rgba(0,0,0,0.8);
    display: flex;
    justify-content: center;
    align-items: center;

    z-index: 9999;
    opacity: 1;
    transition: opacity 0.5s ease;
}

#overlay.hide {
    opacity: 0;
    pointer-events: none;
}

/* ナビ画像 */
#navi {
    max-width: 90%;
    max-height: 90%;
    animation: fadeIn 0.8s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@media (max-width: 768px) {

    #header h1 {
        font-size: 20px;
    }

    .back {
        font-size: 24px;
        left: 15px;
        top: 15px;
    }

    #footer {
        padding-bottom: 20px;
    }

    #slider {
        width: 60%;
    }

    #slider::-webkit-slider-thumb {
        width: 24px;
        height: 24px;
    }

    #pageNum {
        font-size: 18px;
    }
}