/* TOPページ固有スタイル */
.top-bookshelf {
    width: 700px;
    margin: 0 auto;
    /* background-color: var(--color-bg); */
    position: relative;
}

/* 柱 */
.top-bookshelf__pillar {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 35px;
    z-index: 10;
    pointer-events: none;
}

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

.top-bookshelf__pillar--left  { left: 0; }
.top-bookshelf__pillar--right { right: 0; }

.top-shelf {
    padding: 0 35px;
}

/* 上段 */
.top-shelf--upper {
    height: 200px;
    min-height: 180px;
}

.top-shelf__diary {
    background-image: url("../img/top/dairly.png");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    height: 190px;
    width: 170px;
    position: relative;
}

.top-shelf__hidden-link {
    position: absolute;
    top: 13px;
    left: 17px;
    display: block;
}

@keyframes paso-flicker {
    0%   { filter: brightness(1); }
    10%  { filter: brightness(1.5); }
    15%  { filter: brightness(1); }
    20%  { filter: brightness(1.4); }
    25%  { filter: brightness(1); }
    100% { filter: brightness(1); }
}

.top-shelf__paso {
    width: 50px;
    height: auto;
    display: block;
    animation: paso-flicker 3s ease-in-out infinite;
}

.top-shelf__paso:hover {
    opacity: 0.75;
    animation-play-state: paused;
}

.top-shelf__nui-pen {
    background-image: url("../img/top/nui_pen.png");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    height: 150px;
    width: 170px;
    position: relative;
    right: 15px;
}

.top-shelf__title-area {
    background-image: url("../img/top/title_2.png");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    height: 120px;
    width: 420px;
    position: absolute;
    left: 50%;
    top: 40%;
    transform: translate(-50%, -50%);
    z-index: 3;
}

.top-shelf__deco {
    background-image: url("../img/top/book_2dan.png");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    height: 140px;
    width: 280px;
    margin-left: auto;
    position: relative;
}

.top-shelf__nui-link {
    position: absolute;
    top: -80px;
    right: 20px;
    display: block;
    transition: opacity 0.2s;
}

.top-shelf__nui-link:hover {
    opacity: 0.85;
}

.top-shelf__nui {
    height: 110px;
    width: 110px;
    display: block;
    object-fit: contain;
}

/* 中段 */
.top-shelf--center {
    height: 280px;
    /* height: 400px; */
    overflow: hidden;
    background-image: url("../img/top/mokume.png");
    /* background-size: 100% 100%; */
    background-repeat: no-repeat;
}

/* 下段 */
.top-shelf--lower {
    /* background-color: var(--color-bg); */
    height: 280px;
}

.top-shelf__books {
    background-image: url("../img/top/mokume.png");
    background-size: cover;
    background-repeat: no-repeat;
    /* background-position: bottom center; */
    display: flex;
    gap: 4px;
    align-items: flex-end;
    /* height: 200px; */
    height: 100%;
    position: relative;
    z-index: 1;
}

.top-shelf__item {
    margin-left: auto;
    display: flex;
    align-items: flex-end;
}

.top-shelf__okimono {
    height: 230px;
    width: auto;
    display: block;
    top: 5px;
}

.top-shelf__books-oshidana {
    background-image: url("../img/top/osikatudana.png");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    position: relative;
    /* height: 300px; */
    height: 100%;
    width: 100%;
    z-index: 2;
    background-position: bottom center;
}

.top-shelf__books-object {
    background-image: url("../img/top/book_object.png");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    position: relative;
    /* height: 300px; */
    height: 100%;
    width: 100%;
    z-index: 2;
}

/* 本の背表紙 */
.top-book {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 270px;
    /* height: 100%; */
    /* background-color: var(--color-secondary); */
    /* border: 2px solid var(--color-accent); */
    color: var(--color-text);
    writing-mode: vertical-rl;
    font-size: 0.9rem;
    letter-spacing: 0.1em;
    transition: transform 0.15s, filter 0.15s;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.top-book:hover {
    transform: translateY(-8px);
    filter: brightness(1.2);
}

.top-book--nenpyou {
    background-image: url("../img/top/book_nenpyou.png");
    background-size: cover;
    background-position: center;
    border-radius: 2px;
}

.top-book--message {
    background-image: url("../img/top/book_message.png");
    background-size: cover;
    background-position: center;
    border-radius: 2px;
}
.top-book--oshikatsu {
    background-image: url("../img/top/book_oshikatsu.png");
    background-size: cover;
    background-position: center;
    border-radius: 2px;
}
.top-book--desuwa {
    background-image: url("../img/top/book_desuwa.png");
    background-size: cover;
    background-position: center;
    border-radius: 2px;
}
.top-book--henshukoki {
    background-image: url("../img/top/book_hensyukoki.png");
    background-size: cover;
    background-position: center;
    left: 13px;
    transform: rotate(-7deg);
    top: -5px;
    border-radius: 2px;
}

.top-book__label {
    font-family: var(--font-title);
    font-size: 0.85rem;
    pointer-events: none;
}

/* タイトルテキスト（仮） */
.top-shelf__title-text {
    font-family: var(--font-title);
    font-size: 1.3rem;
    text-align: center;
    line-height: 1.4;
    color: var(--color-text);
}

.top-shelf__title-text span {
    font-size: 1rem;
    color: var(--color-primary);
}

/* ドット絵 */
.top-dotart {
    position: absolute;
    bottom: 16px;
    right: 16px;
    pointer-events: none;
}

.tenban {
    background-image: url("../img/top/hondana_tenban.jpg");
    /* background-size: contain; */
    background-repeat: no-repeat;
    background-position: center;
    border-top: 1px black solid;
    height: 30px;
}

/* ============================================================
   レスポンシブ（768px 以下）
   ============================================================ */
@media screen and (max-width: 768px) {
    .top-bookshelf {
        width: 100%;
    }

    /* 上段：最大要素（diary 140px）に合わせる */
    .top-shelf--upper {
        height: 140px;
        min-height: unset;
    }

    .top-shelf__diary {
        height: 110px;
        width: 120px;
    }

    .top-shelf__paso {
        height: auto;
        width: 35%;
    }

    .top-shelf__nui-pen {
        height: 65px;
        width: 100px;
    }

    .top-shelf__title-area {
        width: 230px;
        height: 80px;
    }

    .top-shelf__deco {
        height: 65px;
        width: 170px;
    }

    .top-shelf__nui-link {
        top: -55px;
        right: -5px;
    }

    .top-shelf__nui {
        height: 75px;
        width: 75px;
    }

    /* 中段：本の背表紙 */
    .top-shelf--center {
        height: 200px;
    }

    .top-book--henshukoki {
        left: 8px;
        transform: rotate(-10deg);
        top: -2px;
    }

    .top-book {
        width: 40px;
        height: 140px;
        font-size: 0.65rem;
    }

    .top-shelf__okimono {
        height: 140px;
    }

    /* 下段 */
    .top-shelf--lower {
        height: 200px;
    }

    .top-shelf__books-object {
        background-position: bottom center;
    }
}