@keyframes loading-spinner-animation {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}
.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #ccc;
    border-top: 4px solid #2d2d2d;
    border-radius: 50%;
    animation: loading-spinner-animation 0.4s linear infinite;
}
.card-list-wrapper {
    position: relative;
    .card-list-label {
        margin: 10px;

        a {
            color: #222;
            text-decoration: none;
            font-weight: bold;
            font-size: large;
        }
    }

    .card-list::-webkit-scrollbar {
        display: none;
    }
    .card-list {
        display: flex;
        gap: 5px;
        overflow-x: scroll;
        width: 100%;

        -ms-overflow-style: none;
        scrollbar-width: none;

        .card a {
            display: block;
            text-decoration: none;
            color: #222;
            height: 100%;
            -webkit-user-drag:none;
            -khtml-user-drag:none;
        }
        .card {
            height: 320px; width: 200px;
            padding: 6px 10px;
            cursor: pointer;
            transition: background-color 0.15s;
            -webkit-user-drag:none;
            -khtml-user-drag:none;
            border-radius: 6px;
            position: relative;

            .card-desc {
                width: 180px; height: calc(180px * (9 / 16));
                padding: 10px;
                border-radius: 6px;
                color: white;
                overflow: hidden;
                font-size: small;
                line-height: 1.3em;
            }
            .card-thumb {
                width: 180px; height: calc(180px * (9 / 16));
                object-fit: cover;
                border-radius: 6px;
            }
            .card-title {
                width: 100%; height: fit-content;
                min-height: 40px; max-height: 80px;
                margin-bottom: 6px;
                
                font-size: small; font-weight: bold;

                text-overflow: ellipsis;
                display: -webkit-box;
                -webkit-box-orient: vertical;
                -webkit-line-clamp: 3;
                overflow: hidden;
            }


            .card-meta-container-up {
                display: flex;
                gap: 10px;

                .cat-indicator, .edt-indicator {
                    border-radius: 14px;
                    font-size: small;
                    padding: 2px 10px;
                    /* color: white; */
                    height: 28px;
                    transition: all 0.15s;
                }
                .je, .be, .mc {
                    color: white;
                }
                :not(.je, .be, .mc) {
                    background-color: #f5f5f5;
                }
                .be { background-color: #38895b; }
                .je { background-color: #6fa73b; }
                .mc { background-color: #3b9aa7; }

                /* .server { background-color: #385155; }
                .blog { background-color: #d57c4f; }
                .pack { background-color: #704481; }
                .world { background-color: #2c6726; }
                .skin { background-color: #8a2f2f; } */
            }
            .card-meta-container-md {
                display: flex;
                justify-content: space-between;
                margin: 7px 0;
                font-size: small;

                .counter-container {
                    display: flex;
                    gap: 10px;
                    .counter {
                        display: flex;
                        gap: 5px;
                    }
                    .file-counter {
                        .icon {
                            font-size: 2.2em;
                            position: absolute;
                            width: 60px; height: 60px;
                            right: 0px; top: 0px;
                            display: flex;
                            justify-content: center;

                            div {
                                margin: auto 0;
                            }
                        }
                        .count {
                            color: white;
                            position: absolute;
                            width: 60px; height: 60px;
                            right: 0px; top: 0px;
                            display: flex;
                            justify-content: center;
                            margin: auto 0;

                            div {
                                margin-top: 22px;
                            }
                        }
                    }
                }
                

                .card-date {
                    text-align: right;
                }
            }
            .card-meta-container-dw {
                display: grid;
                grid-template-rows: 25px;
                grid-template-columns: 25px 25px 1fr;
                gap: 5px;

                .rank_badge_bg {
                    grid-row: 1 / 2;
                    grid-column: 1 / 2;
                    width: 25px; height: 25px;

                    .rank_badge_text {
                        font-size: small;
                    }
                }
                .card-avatar {
                    grid-row: 1 / 2;
                    grid-column: 2 / 3;
                    border-radius: 50%;
                }
                .card-lab-name {
                    line-height: 20px;
                    grid-row: 1 / 2;
                    grid-column: 3 / 4;
                    font-size: small;
                }
            }
        }
        .card.thumb {
            flex: 0 0 auto; /* ← shrinkさせない & 幅固定 */
        }
        .infload-observer.loading-spinner-wrapper {
            flex: 0 0 auto;
            width: 100px;
        }
    }
    .empty-card-message-container {
        height: 200px; width: 200px;
        padding: 10px;
    }
    .loading-spinner-wrapper {
        height: 320px; width: 200px;
        padding: 10px;
        position: relative;
    }
    .loading-spinner-wrapper > div{
        position: absolute;
        right: 50%; top: 50%;
        transform: translate(50%, -50%);
    }
    .scroll-button-wrapper {
        position: absolute;

        button {
            width: 40px; height: 40px;
            border-radius: 50%;
            background-color: white;
            box-shadow: 0px 0px 3px 3px rgba(0,0,0,0.2);
            font-size: 1.5em;
            border: none;
            color: #2d2d2d;
            text-align: center;
        }
        a:hover .scroll-button {
            color: #a4a4a4;
        }

        
    }
    .scroll-button-wrapper:has(.scroll-button-right) {
        right: 0; top: 155px;

    }
    .scroll-button-wrapper:has(.scroll-button-left) {
        left: 0; top: 155px;
    }
    .scroll-button-wrapper.scrolled {
        opacity: 0;
        pointer-events: none;
    }
    
}

.card-list-wrapper.loading {
    .card-list {
        display: none;
    }
}
.card-list-wrapper.empty {
    .card-list {
        display: none;
    }
    .loading-spinner-wrapper {
        display: none;
    }
}
/* 直下は無限ロード用ではないスピナー、これはロード後非表示にする */
.card-list-wrapper:not(.loading) > .loading-spinner-wrapper {
    display: none;
}
.card-list-wrapper:not(.empty) .empty-card-message-container {
    display: none;
}
.card-list-wrapper.end {
    .loading-spinner-wrapper {
        display: none;
    }
}
.content-end-message {
    flex: 0 0 auto;
    width: 100px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    justify-content: center;

    div {
        display: block;
        text-align: center;
        font-size: small;
        color: #888888
    }
    

}
.card-list-wrapper.empty {
    .scroll-button-wrapper {
        display: none;
    }
}
body:not(.--CLIENT-USE-TOUCH, .--CLIENT-USE-PEN) .card-list-wrapper .card-list-label a:hover {
    color: #a4a4a4;
}
body:not(.--CLIENT-USE-TOUCH, .--CLIENT-USE-PEN) .card-list-wrapper .scroll-button-wrapper a:hover .scroll-button {
    color: #a4a4a4;
}