/* ============================================================
   CATEGORY FILTER (ACCORDION) - カテゴリーフィルター専用
   ============================================================ */

.chara-filter-console {
    max-width: 1400px;
    margin: 40px auto 20px;
    padding: 0 40px;
    display: flex;
    justify-content: center;
}

.filter-details {
    width: 100%;
    max-width: 1000px;
    background: rgba(0, 0, 0, 0.8);
    border-bottom: 2px solid #333;
    transition: background 0.4s ease, border-color 0.4s ease;
    overflow: hidden;
}

.filter-details[open] {
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(8, 8, 8, 0.95);
}

.filter-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    cursor: pointer;
    list-style: none;
    outline: none;
    z-index: 10;
}

.filter-summary::-webkit-details-marker { display: none; }

.filter-status {
    display: flex;
    align-items: baseline;
    gap: 20px;
}

.status-label {
    font-family: 'Anton', sans-serif;
    font-size: 1.2rem;
    letter-spacing: 0.1em;
    color: #fff;
}

.status-count {
    font-size: 0.85rem;
    color: #888;
}

.filter-icon {
    position: relative;
    width: 20px;
    height: 20px;
}

.filter-icon::before,
.filter-icon::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 2px;
    background: #ff8800;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.filter-icon::after {
    transform: rotate(90deg);
}

/* フィルター開閉時のアイコン変化 */
.filter-details[open] .filter-icon::after {
    transform: rotate(180deg);
    opacity: 0;
}

/* 重要：スライドアニメーションのロジック 
   JSで計算したheightを反映させるため、初期値は0、溢れはhiddenにします
*/
.filter-panel {
    height: 0; 
    overflow: hidden;
    padding: 0 20px;
    transition: height 0.4s cubic-bezier(0.4, 0, 0.2, 1), padding 0.4s ease;
}

.filter-details[open] .filter-panel {
    padding-bottom: 20px;
    /* heightはJSによりインラインで付与されます */
}

.filter-groups-wrapper {
    min-height: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    padding-top: 10px;
}

.group-title {
    font-family: 'Anton', sans-serif;
    font-size: 0.9rem;
    color: #ff8800;
    margin-bottom: 15px;
    border-left: 3px solid #ff8800;
    padding-left: 10px;
}

.checkbox-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.check-item {
    cursor: pointer;
    font-size: 0.9rem;
    color: #ccc;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: color 0.2s;
}

.check-item:hover {
    color: #fff;
}

.filter-actions {
    margin-top: 30px;
    text-align: center;
    border-top: 1px solid #333;
    padding-top: 20px;
}

.filter-reset-btn {
    background: transparent;
    border: 1px solid #ff8800;
    color: #ff8800;
    padding: 8px 25px;
    cursor: pointer;
    font-family: 'Anton', sans-serif;
    transition: all 0.3s;
}

.filter-reset-btn:hover {
    background: #ff8800;
    color: #000;
}

/* ============================================================
   CHARACTERS SECTION (GRID & SELECTION)
   ============================================================ */

.character-hub-section {
    padding: 40px 0 60px;
    width: 100%;
}

.chara-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr); 
    justify-content: center;
    column-gap: 0; 
    row-gap: 20px; 
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 4vw; 
    box-sizing: border-box;
}

.chara-card {
    position: relative;
    display: block;
    width: 112%; 
    margin-left: -6%; 
    aspect-ratio: 10 / 19;
    background: #080808;
    text-decoration: none;
    z-index: 1;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), clip-path 0.3s ease, opacity 0.5s ease;
    clip-path: polygon(20% 0, 100% 0, 80% 100%, 0% 100%);
    overflow: hidden;
    animation: charaFadeIn 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    opacity: 0;
}

@keyframes charaFadeIn {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.chara-card::before {
    content: "";
    position: absolute;
    inset: 0;
    border: 1px solid rgba(255, 255, 255, 0.2);
    clip-path: polygon(20% 0, 100% 0, 80% 100%, 0% 100%);
    z-index: 5;
    pointer-events: none;
    transition: all 0.3s;
}

.chara-card:hover {
    z-index: 10;
    clip-path: polygon(10% 0, 100% 0, 90% 100%, 0% 100%);
    transform: scale(1.1) translateY(-5px);
}

.chara-card:hover::before {
    border: 2px solid #ff8800; 
    background: rgba(255, 136, 0, 0.1);
    box-shadow: inset 0 0 15px rgba(255, 136, 0, 0.5);
    clip-path: polygon(10% 0, 100% 0, 90% 100%, 0% 100%);
}

.chara-img-wrapper {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: 2;
}

.chara-img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform 0.4s;
}

.chara-card:hover .chara-img {
    transform: scale(1.05);
}

.chara-name-en {
    position: absolute;
    left: 80% !important; 
    bottom: -5% !important;
    writing-mode: horizontal-tb;
    white-space: nowrap;
    font-size: clamp(0.8rem, 4vw, 2.55rem); 
    font-weight: 900;
    color: #fff;
    font-family: 'Anton', sans-serif;
    text-shadow: 
        0 0 10px rgba(0,0,0,1),
        0 0 5px rgba(0,0,0,1),
        2px 2px 2px rgba(0,0,0,1);
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
    transform-origin: left center;
    transform: rotate(-90deg) skewY(3deg);
}

.chara-card:hover .chara-name-en {
    opacity: 1;
    transform: rotate(-90deg) skewY(3deg) translate(5px, 0);
}

.loading-text {
    grid-column: 1 / -1;
    text-align: center;
    color: #ff8800;
    font-family: 'Anton', sans-serif;
    letter-spacing: 0.2em;
}

/* ============================================================
   RESPONSIVE ADJUSTMENTS
   ============================================================ */

@media (max-width: 1024px) {
    .chara-grid { padding: 0 2vw; }
}

@media (max-width: 768px) {
    .chara-filter-console { padding: 0 15px; }
    
    .chara-grid {
        grid-template-columns: repeat(6, 1fr) !important;
        padding: 0 10px;
        row-gap: 10px;
    }

    .chara-card {
        width: 115%; 
        margin-left: -7.5%;
    }

    .chara-name-en {
        font-size: clamp(0.6rem, 3vw, 1rem);
        text-shadow: 0 0 5px rgba(0,0,0,1);
    }

    .filter-groups-wrapper {
        grid-template-columns: 1fr 1fr; 
        gap: 15px;
    }
}