/* support.css */
.support-container {
    padding: 2rem 1rem;
    text-align: center;
    background-color: rgba(255, 255, 255, 0.8);
    /* 흰색 배경 투명도 80% */
    border-radius: 15px;
    margin: 10px;
}

.support-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1.5rem;
    max-width: 1000px;
    margin: 0 auto;
}

.support-card {
    background-color: #ffffff;
    background-size: cover;
    background-position: center;
    border-radius: 4px 25px 4px 4px;
    border: 2px solid #bbb;
    overflow: hidden;
    transition: transform 0.2s ease;
    transform: translateZ(0);
    /* GPU 레이어 미리 확보 */
    cursor: pointer;
    display: flex;
    flex-direction: column;
    position: relative;
    /* GPU 가속 및 렌더링 최적화 */
    will-change: transform;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    contain: layout style paint;
    content-visibility: auto;
    contain-intrinsic-size: 150px 100px;
}

/* 비활성화 상태 서포트 카드 스타일 */
.support-card.is-disabled {
    filter: brightness(0.6) grayscale(0.5);
}

.support-card.is-disabled::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.45);
    pointer-events: none;
    border-radius: inherit;
    z-index: 100;
}

.support-card.rarity-ssr {
    border-color: #d991c7;
    /* 상단 85%는 흰색, 하단 15%는 그라데이션 바 */
    background-image: linear-gradient(#fff, #fff),
        linear-gradient(90deg, #ffeb7a 0%, #ff8bad 35%, #c293ff 70%, #73e8ff 100%);
    background-size: 100% 92%, 100% 8%;
    background-position: top, bottom;
    background-repeat: no-repeat, no-repeat;
    background-color: #fff;
}

.support-card.rarity-sr {
    border-color: #ffe082;
    /* 상단 92% 흰색, 하단 8% 3단 컬러 (하이라이트 좌측 25% 이동) */
    background-image: linear-gradient(#fff, #fff),
        linear-gradient(90deg, #fff44f 0%, #fffde6 25%, #ffcc00 50%);
    background-size: 100% 92%, 100% 8%;
    background-position: top, bottom;
    background-repeat: no-repeat, no-repeat;
    background-color: #fff;
}

.support-card.rarity-r {
    background-color: #f8f9fa;
    border-color: #ced4da;
}

.support-card:hover {
    transform: translateY(-5px);
}

.card-image-wrapper {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    /* 16:9 비율 강제 고정 */
    background: transparent;
    overflow: hidden;
}

.card-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-plan-icon {
    position: absolute;
    top: 5px;
    left: 5px;
    width: 22px;
    height: 22px;
    z-index: 10;
}

.card-type-icon {
    position: absolute;
    bottom: 5px;
    right: 5px;
    width: 22px;
    height: 22px;
    object-fit: contain;
    z-index: 10;
}

.card-info {
    padding: 5px;
    text-align: left;
    background: transparent;
}

.card-limit-break {
    position: absolute;
    bottom: 5px;
    left: 5px;
    right: auto;
    display: flex;
    gap: 3px;
    z-index: 10;
}

.card-star {
    width: 1.3rem;
    height: 1.3rem;
    content: url('../icons/flowerback.webp');
    cursor: pointer;
    transition: transform 0.2s;
    display: inline-block;
}

.card-star.active {
    content: url('../icons/flower.webp');
}

.card-star:hover {
    transform: scale(1.2);
}

.card-type {
    font-size: 0.75rem;
    font-weight: bold;
    text-transform: uppercase;
    color: #777;
}

/* Type Colors */
.type-vocal,
.highlight-vocal,
.title-vocal {
    color: #f766a4;
}

.type-dance,
.highlight-dance,
.title-dance {
    color: #5aa6f0;
}

.type-visual,
.highlight-visual,
.title-visual {
    color: #fdc361;
}

.type-assist,
.highlight-assist,
.title-assist {
    color: #72da49;
}

.highlight-vocal,
.highlight-dance,
.highlight-visual,
.highlight-assist {
    white-space: nowrap;
}

/* Filter Styles */
.filter-container {
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    align-items: center;
}

/* 보댄비 필터 전용 (원형 스타일) */
#filter-attr {
    gap: 0.6rem;
    /* 버튼 사이 간격 복구 */
    position: relative;
    z-index: 1000;
    /* Ensure tooltip appears above other filter groups */
}

#filter-attr .filter-btn {
    border-radius: 50%;
    /* 완전 원형 */
    width: 3.2rem;
    /* 고정 너비 (정원 유지) */
    height: 3.2rem;
    /* 고정 높이 */
    padding: 0;
    margin-left: 0;
}

.filter-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    justify-content: center;
    border-radius: 4px;
}

.filter-toggle-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px 0;
    width: 100%;
    color: #ccc;
    font-size: 0.6rem;
    transition: all 0.2s;
    margin-top: 0.1rem;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.filter-toggle-btn::before,
.filter-toggle-btn::after {
    content: '';
    flex: 1;
    height: 1px;
    background-color: #eee;
    transition: background-color 0.2s;
}

.filter-toggle-btn.active::before,
.filter-toggle-btn.active::after {
    background-color: #e0e0e0;
}



.filter-toggle-btn.active {
    color: #666;
}

.filter-toggle-btn .toggle-icon {
    display: inline-block;
    transition: transform 0.2s;
    font-size: 0.5rem;
}

.filter-toggle-btn.active .toggle-icon {
    transform: rotate(180deg);
}

.plan-filter-box {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 16px;
    padding: 0.6rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: auto;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
    gap: 0.2rem;
}

.plan-filter-left {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 0.3rem;
}

@media (min-width: 769px) {
    .plan-filter-box {
        min-width: 650px;
        /* 2열 구조를 위해 너비 조금 더 확보 */
        flex-direction: row;
        align-items: stretch;
        padding: 1rem 1.5rem;
        gap: 1.5rem;
    }

    .plan-filter-left {
        flex: 45;
        border-right: 1px solid #eee;
        padding-right: 1.5rem;
        gap: 0.4rem;
        justify-content: center;
    }

    .filter-toggle-btn {
        display: none !important;
    }

    .extra-filters-wrapper {
        display: flex !important;
        /* PC에서는 항상 표시 */
        flex: 55;
        margin-top: 0;
        justify-content: center;
    }
}

.filter-divider-h {
    width: 100%;
    height: 1px;
    background-color: #eee;
    margin: 2px 0;
}

#filter-plan {
    gap: 12px;
    align-items: center;
}

#filter-plan>* {
    position: relative;
}

#filter-plan>*:not(:last-child)::after {
    content: '';
    position: absolute;
    right: -6px;
    /* gap 12px의 절반 위치 */
    top: 20%;
    height: 60%;
    width: 1px;
    background-color: #e0e0e0;
    pointer-events: none;
}

#filter-plan .filter-btn,
#filter-plan .filter-toggle-btn {
    border: none;
    background: transparent;
    box-shadow: none;
    margin-left: 0;
}

#filter-plan .filter-btn {
    padding: 0 0.8rem;
}

#filter-plan .filter-btn.active {
    background: #e8e8e8;
    border-radius: 12px;
}

/* 시각적 중앙 보정 */
#filter-plan .filter-btn[data-val="free"] .filter-icon,
#filter-plan .filter-btn[data-val="logic"] .filter-icon {
    transform: translateX(-1px);
}

.extra-filters-wrapper {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
    margin-top: 0.2rem;
    padding: 0;
    box-sizing: border-box;
}

#filter-rarity {
    background: rgba(247, 102, 164, 0.1);
}

#filter-source {
    background: rgba(90, 166, 240, 0.1);
}

#filter-ability {
    background: rgba(253, 195, 97, 0.12);
}

#filter-rarity,
#filter-source,
#filter-ability {
    display: flex;
    width: 100%;
    gap: 2px;
}

#filter-rarity .filter-btn,
#filter-source .filter-btn,
#filter-ability .filter-btn {
    font-size: 0.65rem !important;
    border-radius: 0 !important;
    position: relative;
    padding: 0 !important;
    min-height: 2.1rem !important;
    height: 2.1rem !important;
}

#filter-rarity .filter-btn:first-child,
#filter-source .filter-btn:first-child {
    border-radius: 8px 0 0 8px !important;
}

#filter-rarity .filter-btn:last-child,
#filter-source .filter-btn:last-child {
    border-radius: 0 8px 8px 0 !important;
}

#filter-rarity .filter-btn.active {
    background: rgba(247, 102, 164, 0.15) !important;
    color: #e0458a !important;
    /* Vocal dark */
    border-color: #f766a4 !important;
}

#filter-source .filter-btn.active {
    background: rgba(90, 166, 240, 0.15) !important;
    color: #3b8edb !important;
    /* Dance dark */
    border-color: #5aa6f0 !important;
}

#filter-ability .filter-btn.active {
    background: rgba(253, 195, 97, 0.2) !important;
    color: #d18e15 !important;
    /* Visual dark */
    border-color: #fdc361 !important;
}



#filter-rarity,
#filter-source,
#filter-ability {
    position: relative;
}

#filter-rarity .filter-btn {
    flex: 1;
    border: 1px solid #ddd !important;
}

#filter-source .filter-btn {
    flex: 1;
    padding: 0;
    border: 1px solid #ddd !important;
}

#filter-ability .filter-btn {
    flex: 1;
    padding: 0;
    border: 1px solid #ddd !important;
}

.extra-filters-wrapper.hidden {
    display: none;
}

.filter-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 2.2rem;
    /* 세로 높이 고정 */
    padding: 0 1.2rem;
    border: 1px solid #ddd;
    margin-left: -1px;
    background: transparent;
    border-radius: 0;
    cursor: pointer;
    font-size: 1rem;
    color: #666;
    transition: all 0.2s;
    line-height: 1;
    /* 줄 간격 고정 */
}

/* 첫 번째와 마지막 버튼의 외곽만 살짝 둥글게 (선택사항) */
.filter-btn:first-child {
    border-radius: 4px 0 0 4px;
    margin-left: 0;
}

.filter-btn:last-child {
    border-radius: 0 4px 4px 0;
}

.filter-btn.active {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
    font-weight: bold;
    z-index: 1;
}

/* 슬롯 관리 UI */
.slot-management {
    max-width: 1000px;
    margin: 0 auto 1.5rem;
    background: #fff;
    padding: 1rem;
    border-radius: 12px;
    border: 1px solid #eee;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.slot-header {
    font-weight: bold;
    color: #ff4d8d;
    margin-bottom: 0.8rem;
    font-size: 0.9rem;
    text-align: left;
    padding-left: 5px;
}

.slot-group {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.slot-item {
    background: #f9f9f9;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #eee;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.slot-name {
    font-weight: bold;
    font-size: 0.8rem;
    color: #555;
}

.slot-date {
    font-size: 0.65rem;
    color: #999;
    margin-bottom: 5px;
}

.slot-btns {
    display: flex;
    gap: 5px;
}

.slot-btn {
    flex: 1;
    border: none;
    padding: 5px 0;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
}

.slot-btn.save {
    background: #e1f5fe;
    color: #0288d1;
}

.slot-btn.load {
    background: #f1f8e9;
    color: #558b2f;
}

.slot-btn:hover:not(:disabled) {
    filter: brightness(0.9);
}

.slot-btn:active:not(:disabled) {
    transform: scale(0.95);
}

@media (max-width: 768px) {
    .slot-group {
        grid-template-columns: 1fr;
    }

    .slot-item {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }

    .slot-btns {
        width: 120px;
    }
}

/* Preset button specific color override */
#btn-open-slot-modal {
    background-color: #0288d1;
    color: white;
    border-color: #0288d1;
}

#btn-open-slot-modal:hover {
    background-color: #0277bd;
    filter: brightness(1.1);
}

/* 슬롯 관리 모달 스타일 */
.slot-modal-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 10px;
    max-height: 65vh;
    overflow-y: auto;
    padding-right: 4px;
}

.slot-modal-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: #f9f9f9;
    border-radius: 10px;
    border: 1px solid #eee;
}

.slot-modal-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
    text-align: left;
}

.slot-modal-name {
    font-weight: bold;
    font-size: 0.95rem;
    color: #333;
}

.slot-modal-date {
    font-size: 0.75rem;
    color: #888;
}

.slot-modal-actions {
    display: flex;
    gap: 8px;
}

.slot-modal-actions .slot-btn {
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    border: none;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.slot-modal-actions .slot-btn.save {
    background: #e3f2fd;
    color: #1976d2;
}

.slot-modal-actions .slot-btn.load {
    background: #f1f8e9;
    color: #689f38;
}

.slot-modal-actions .slot-btn.load:disabled {
    background: #eee;
    color: #ccc;
    cursor: not-allowed;
}

.slot-modal-actions .slot-btn.delete {
    background: #ffebee;
    color: #ef5350;
    padding: 0;
    width: 28px;
    height: 28px;
    font-size: 1.2rem;
    line-height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.slot-modal-actions .slot-btn:hover:not(:disabled) {
    filter: brightness(0.9);
}

@media (max-width: 768px) {
    .slot-modal-item {
        padding: 8px 10px;
        gap: 5px;
    }

    .slot-modal-info {
        gap: 2px;
    }

    .slot-modal-name {
        font-size: 0.8rem;
    }

    .slot-modal-date {
        font-size: 0.65rem;
    }

    .slot-modal-actions {
        gap: 5px;
    }

    .slot-modal-actions .slot-btn {
        padding: 4px 6px;
        font-size: 0.7rem;
        white-space: nowrap;
    }

    .slot-modal-actions .slot-btn.delete {
        width: 24px;
        height: 24px;
        line-height: 24px;
        font-size: 1rem;
    }

    /* Support sort controls mobile sizing */
    .sort-select,
    .sort-order-btn-toggle {
        height: 22px !important;
        min-height: 22px !important;
        font-size: 0.65rem !important;
        padding: 0 2px !important;
        margin: 0 !important;
        line-height: 1 !important;
        border-radius: 4px !important;
        border: 1px solid #ddd !important;
        background: #fff !important;
        width: auto !important;
        min-width: 30px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 0 !important;
    }

    #sort-order-arrow {
        font-size: 0.85rem !important;
    }

    .sort-order-icon {
        width: 10px !important;
        height: 10px !important;
        margin-top: 6px !important;
    }

    .sort-controls {
        padding: 0 4px !important;
        margin-bottom: 0.8rem;
    }
}

/* 정렬 컨트롤 */
.sort-controls {
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    /* 좌우 끝으로 정렬 */
    align-items: center;
    width: 100%;
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 1rem;
}

.sort-group {
    display: flex;
    align-items: center;
    gap: 5px;
}

.sort-select,
.sort-order-btn-toggle {
    padding: 4px 8px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fff;
    font-size: 0.75rem;
    font-weight: bold;
    color: #333;
    cursor: pointer;
    outline: none;
    height: 27px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

select.sort-select {
    padding-right: 20px;
    display: inline-block;
}

.sort-select,
.sort-order-btn-toggle {
    padding: 4px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fff;
    font-size: 0.75rem;
    font-weight: bold;
    color: #333;
    cursor: pointer;
    outline: none;
    height: 27px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    gap: 0;
}

.sort-order-btn-toggle {
    width: auto;
    min-width: 34px;
}

#sort-order-arrow {
    font-size: 1rem;
    font-weight: bold;
    color: #333;
}

.sort-select:hover,
.sort-order-btn-toggle:hover {
    border-color: #bbb;
    background: #f9f9f9;
}

.sort-order-icon {
    width: 12px;
    height: 12px;
    margin-top: 7px;
    filter: brightness(0) saturate(100%) invert(20%) sepia(0%) saturate(0%) hue-rotate(0deg) brightness(95%) contrast(90%);
}

.filter-icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
    filter: drop-shadow(0 0 1px rgba(0, 0, 0, 0.2));
}

.filter-icon-rarity {
    height: 20px;
    width: auto;
    object-fit: contain;
}

@media (max-width: 768px) {
    .filter-icon-rarity {
        height: 16px;
    }
}

/* 보댄비 활성화 시 고유 색상 */
#filter-attr .filter-btn[data-val="vocal"] {
    color: #f766a4;
    border-color: #f766a4;
}

#filter-attr .filter-btn[data-val="dance"] {
    color: #5aa6f0;
    border-color: #5aa6f0;
}

#filter-attr .filter-btn[data-val="visual"] {
    color: #fdc361;
    border-color: #fdc361;
}

#filter-attr .filter-btn[data-val="vocal"].active {
    background: #f766a4;
    color: #fff;
}

#filter-attr .filter-btn[data-val="dance"].active {
    background: #5aa6f0;
    color: #fff;
}

#filter-attr .filter-btn[data-val="visual"].active {
    background: #fdc361;
    color: #fff;
}

/* 출처 및 등급 필터 크기 추가 축소 */
#filter-source .filter-btn,
#filter-rarity .filter-btn {
    height: 1.8rem;
    /* 더 작은 고정 높이 */
    padding: 0 0.7rem;
    font-size: 0.85rem;
}

/* Modal Styles */
.modal {
    position: fixed;
    z-index: 30000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: #fff;
    padding: 20px;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    position: relative;
}

.close-modal {
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 28px;
    cursor: pointer;
    color: #aaa;
}

.close-modal:hover {
    color: #000;
}

.modal-body {
    text-align: center;
    width: 100%;
}

.modal-img-container {
    position: relative;
    display: inline-block;
    max-width: 100%;
}

/* 모달 메인 이미지만 크게 설정 */
#modal-img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

/* 모달 내 등급 및 속성 아이콘 */
.modal-rarity-icon {
    position: absolute !important;
    bottom: 18px;
    /* 등급만 이 위치 유지 */
    left: 15px;
    height: 45px !important;
    width: auto !important;
    object-fit: contain;
    filter: drop-shadow(1px 1px 2px rgba(0, 0, 0, 0.5));
    z-index: 15;
}

.modal-plan-icon {
    position: absolute !important;
    bottom: 68px;
    /* 등급 아이콘(45px + 18px) 위로 이동 */
    left: 15px;
    width: 32px !important;
    height: 32px !important;
    object-fit: contain;
    filter: drop-shadow(1px 1px 2px rgba(0, 0, 0, 0.5));
    z-index: 15;
}

.modal-type-icon {
    position: absolute !important;
    top: 10px;
    left: 10px;
    width: 32px !important;
    height: 32px !important;
    object-fit: contain;
    filter: drop-shadow(1px 1px 2px rgba(0, 0, 0, 0.5));
    z-index: 15;
}

/* Star Rating */
.star-rating {
    position: absolute;
    bottom: 15px;
    right: 15px;
    font-size: 1.6rem;
    color: rgba(255, 255, 255, 0.7);
    display: flex;
    gap: 6px;
    z-index: 10;
}

.star {
    width: 1.6rem;
    height: 1.6rem;
    content: url('../icons/flowerback.webp');
    cursor: pointer;
    transition: all 0.2s;
    display: inline-block;
}

.star.active {
    content: url('../icons/flower.webp');
}

.star:hover {
    transform: scale(1.1);
}

#modal-title {
    position: absolute;
    top: 8px;
    /* PC 위치 상향 */
    right: 15px;
    font-size: 1.1rem;
    margin: 0;
    color: #fff;
    /* 검정색 테두리 효과 (더 뚜렷하게 보강) */
    text-shadow:
        -1.2px -1.2px 0 #000,
        1.2px -1.2px 0 #000,
        -1.2px 1.2px 0 #000,
        1.2px 1.2px 0 #000,
        -1.2px 0 0 #000,
        1.2px 0 0 #000,
        0 -1.2px 0 #000,
        0 1.2px 0 #000,
        0px 0px 4px rgba(0, 0, 0, 0.8);
    background: none;
    padding: 0;
    border-radius: 0;
    z-index: 20;
    pointer-events: none;
    max-width: 80%;
    text-align: right;
}

@media (max-width: 768px) {
    #modal-title {
        font-size: 0.75rem;
        top: 5px;
        /* 모바일 위치 상향 */
        right: 8px;
    }
}

/* Extra Info Boxes */
.modal-extra-outer-container {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 0.8rem;
    /* 여백을 0.8rem으로 축소 */
    margin-bottom: 1.2rem;
    padding: 0 5px;
}

.modal-extra-icon {
    width: 56px;
    height: 56px;
    flex-shrink: 0;
    object-fit: contain;
    background: #fff;
    border-radius: 6px;
    padding: 2px;
    border: 1px solid #e0e0e0;
}

.modal-extra-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.modal-extra-box {
    width: 100%;
    min-height: 34px;
    background: #f7f9ff;
    border: 1px solid #dbe2ff;
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    color: #444;
    display: flex;
    align-items: center;
    text-align: left;
    /* 왼쪽 정렬 강제 */
}

/* Abilities */
.modal-abilities-container {
    margin-top: 1.5rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.8rem;
    text-align: left;
}

.ability-item {
    background: #f9f9f9;
    padding: 12px 10px;
    border-radius: 8px;
    border-left: 4px solid #ccc;
    min-height: 60px;
    display: flex;
    align-items: center;
}

.ability-text {
    font-size: 0.85rem;
    line-height: 1.3;
    word-break: break-all;
}

.ability-text.shrink {
    font-size: 0.72rem;
    line-height: 1.2;
}

/* Attribute Specific Colors */
.border-vocal {
    border-left-color: #f766a4 !important;
}

.border-dance {
    border-left-color: #5aa6f0 !important;
}

.border-visual {
    border-left-color: #fdc361 !important;
}

.border-assist {
    border-left-color: #72da49 !important;
}

@media (max-width: 768px) {
    .support-container {
        padding: 1rem 0.5rem;
    }

    .support-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }

    .support-card {
        border-width: 1px !important;
        /* 모바일은 1px 고정 */
        box-shadow: none !important;
        /* 그림자 제거로 스크롤 성능 향상 */
    }

    /* 모바일에서 필터 버튼 크기 다시 축소 */
    .filter-btn {
        height: 1.8rem;
        padding: 0 0.8rem;
        font-size: 0.8rem;
    }

    /* 보댄비 원형 필터 모바일 크기 */
    #filter-attr .filter-btn {
        width: 2.5rem;
        height: 2.5rem;
        padding: 0;
    }

    .sort-select {
        padding: 0.2rem 0.5rem;
        font-size: 0.75rem;
    }

    #filter-source .filter-btn,
    #filter-rarity .filter-btn,
    #filter-ability .filter-btn {
        height: 1.5rem !important;
        min-height: 1.5rem !important;
        padding: 0 !important;
        font-size: 0.7rem;
    }

    .card-info {
        padding: 2px !important;
    }

    .card-name {
        font-size: 0.55rem;
        line-height: 1.1;
    }

    .card-type,
    .card-rarity {
        font-size: 0.45rem !important;
        line-height: 1;
    }

    .card-rarity {
        height: 12px;
        /* 모바일 등급 아이콘 크기 축소 */
        bottom: 3px;
        left: 3px;
    }

    .card-plan-icon {

        width: 16px;
        height: 16px;
        top: 3px;
        /* 왼쪽 위로 이동 */
        left: 3px;
        bottom: auto;
    }

    .card-type-icon {
        position: absolute;
        bottom: 3px;
        right: 3px;
        width: 16px;
        height: 16px;
        object-fit: contain;
        filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.5));
        z-index: 10;
    }

    /* Mobile Star Sizes */
    .card-star {
        width: 0.7rem !important;
        height: 0.7rem !important;
    }

    .card-limit-break {
        bottom: 2px !important;
        left: 3px !important;
        right: auto !important;
        gap: 2px;
    }

    /* Mobile Ability Text Sizes */
    .ability-text {
        font-size: 0.65rem !important;
        line-height: 1.2;
    }

    .ability-text.shrink {
        font-size: 0.55rem !important;
        line-height: 1.1;
    }

    .modal-extra-box {
        font-size: 0.65rem !important;
        padding: 4px 8px;
        min-height: 28px;
    }

    .modal-extra-icon {
        width: 50px;
        height: 50px;
    }

    .modal-abilities-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
        margin-top: 0.8rem !important;
        /* 0.5에서 0.8로 약간 늘림 */
    }

    .modal-extra-outer-container {
        margin-top: 0.4rem !important;
        margin-bottom: 0.4rem !important;
        /* 0.2에서 0.4로 약간 늘림 */
    }

    /* 모바일 모달 내 아이콘 크기 조정 */
    .modal-rarity-icon {
        height: 30px !important;
        bottom: 15px !important;
        /* 위로 올림 */
        left: 10px !important;
    }

    .modal-plan-icon {
        width: 24px !important;
        height: 24px !important;
        bottom: 48px !important;
        /* 모바일 등급 아이콘(30px + 15px) 위로 이동 */
        left: 10px !important;
        top: auto !important;
        /* 기존 top 제거 */
    }

    .modal-type-icon {
        width: 24px !important;
        height: 24px !important;
        top: 8px !important;
        left: 8px !important;
    }
}

/* Support Info Button & Tooltip */
.support-info-wrapper {
    position: absolute;
    left: 6px;
    top: 6px;
    display: flex;
    align-items: center;
    z-index: 1000;
}

.support-info-btn {
    width: 17px;
    height: 17px;
    border-radius: 50%;
    border: 1px solid #ccc;
    background: #fff;
    color: #999;
    font-size: 10px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-family: serif;
    padding: 0;
    line-height: 1;
}



.support-info-tooltip {
    visibility: hidden;
    position: absolute;
    top: 130%;
    /* Show BELOW the button */
    left: -10px;
    /* transform: translateX(-50%); 제거 */
    background: #fff;
    color: #000;
    padding: 10px 14px;
    border-radius: 8px;
    border: 2px solid var(--idol-theme-color, #ff4d8d);
    font-size: 0.65rem;
    white-space: normal;
    /* Allow wrapping */
    min-width: 325px;
    /* Wider for PC */
    z-index: 100010;
    opacity: 0;
    transition: opacity 0.2s, visibility 0.2s, transform 0.2s;
    pointer-events: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    text-align: left;
}

.support-info-tooltip p {
    margin: 6px 0;
    line-height: 1.5;
    white-space: normal;
}



.support-info-tooltip.visible {
    visibility: visible;
    opacity: 1;
}

.support-info-wrapper:hover .support-info-tooltip {
    /* 기존 호버 기능 비활성화 */
}

@media (max-width: 768px) {
    .support-info-wrapper {
        left: 4px;
        top: 4px;
    }

    .support-info-btn {
        width: 15px;
        height: 15px;
        font-size: 8px;
    }

    .support-info-tooltip {
        font-size: 0.52rem;
        padding: 6px 8px;
        top: 130%;
        min-width: 240px;
        /* Keep mobile compact */
    }
}

/* Ability filter dropdown */
#filter-ability {
    position: relative;
}

#filter-ability #btn-ability-dropdown {
    border-radius: 8px !important;
    cursor: pointer;
    transition: all 0.2s;
}

#btn-ability-dropdown.has-active {
    background: rgba(253, 195, 97, 0.2) !important;
    color: #d18e15 !important;
    border-color: #fdc361 !important;
}

.ability-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 50%;
    transform: translateX(-50%);
    width: max-content;
    max-width: 90vw;
    background: #fff;
    border: 1.5px solid #fdc361;
    border-radius: 8px;
    padding: 6px;
    z-index: 100020;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
}

.ability-dropdown.hidden {
    display: none;
}

#filter-ability .ability-dropdown .ability-sub-btn {
    border-radius: 6px !important;
    border: 1px solid #eee !important;
    font-size: 0.7rem !important;
    height: 1.8rem !important;
    min-height: 1.8rem !important;
    width: 100%;
    justify-content: center;
    margin: 0;
}

.ability-dropdown .ability-reset-btn {
    grid-column: 1 / -1;
    background: #f5f5f5;
    font-weight: bold;
}

.ability-dropdown .ability-sub-btn.active {
    background: rgba(253, 195, 97, 0.2) !important;
    color: #d18e15 !important;
    border-color: #fdc361 !important;
}

@media (max-width: 768px) {
    .ability-dropdown {
        width: 75vw;
    }
    #filter-ability .ability-dropdown .ability-sub-btn {
        height: 1.5rem !important;
        min-height: 1.5rem !important;
        font-size: 0.4rem !important;
    }
}

@media (min-width: 769px) {
    .ability-dropdown {
        min-width: 400px;
    }
}