.buildlist-controls {
    display: flex;
    gap: 20px;
    margin-bottom: 2rem;
    align-items: center;
}

.buildlist-controls .search-container {
    flex-grow: 1;
    margin-bottom: 0;
}

.sort-container select {
    padding: 12px;
    font-size: 1rem;
    background-color: #1e1e1e;
    border: 1px solid #555;
    border-radius: 5px;
    color: #e0e0e0;
}

.build-card-grid {
    display: grid;
    /* [핵심 수정] 각 열의 최소 너비를 0으로 강제하여 자식 요소의 크기 요구를 무시 */
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.build-card {
    display: flex;
    gap: 15px;
    background-color: #2a2a2a;
    border: 1px solid #444;
    border-radius: 8px;
    padding: 15px;
    transition: all 0.2s ease-in-out;
    text-decoration: none;
    color: inherit;
    align-items: center;
}

.build-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
    border-color: #00aaff;
}

.build-card-portrait {
    width: 80px;
    height: 140px;
    flex-shrink: 0;
    border-radius: 8px;
    object-fit: cover;
    object-position: top;
}

.build-card-info {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
    /* [핵심 1] 그리드 너비 계산 문제를 해결합니다. */
}

.info-header .build-name {
    font-size: 1.2rem;
    font-weight: bold;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.info-header .author-name {
    font-size: 0.8rem;
    color: #aaa;
}

/* [신규] 빌드 설명 미리보기 스타일 */
.build-description-preview {
    font-size: 0.9rem;
    color: #ccc;
    line-height: 1.5;
    margin: 4px 0 0 0; /* 위 아래 간격 조정 */
    
    /* PC: 한 줄 말줄임표 */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.info-items {
    display: flex;
    flex-direction: column;
    gap: 5px;
    justify-content: center;
    min-height: 150px;
    overflow-x: auto;
    /* [핵심 2] 각 그룹이 개별적으로 스크롤됩니다. */
    padding-bottom: 5px;
    /* 스크롤바 공간 확보 */
}

.info-items::-webkit-scrollbar {
    height: 6px;
}

.info-items::-webkit-scrollbar-track {
    background: transparent;
}

.info-items::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 3px;
}

.info-items::-webkit-scrollbar-thumb:hover {
    background: #888;
}

.info-item-group {
    display: flex;
    gap: 8px;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8rem;
    background-color: #333;
    padding: 2px 5px;
    border-radius: 4px;
    white-space: nowrap;
}

.info-item img {
    width: 18px;
    height: 18px;
}

.info-item.highlight-dejavu {
    box-shadow: inset 0 0 0 2px #e67e22;
}

.info-item.highlight-core {
    box-shadow: inset 0 0 0 2px #f1c40f;
}

.info-footer {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: #888;
}

.traveler-filter {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
    flex-grow: 1;
}

.filter-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    border: 3px solid #444;
    transition: all 0.2s;
    background-color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.9rem;
}

.filter-icon img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.filter-icon:hover {
    border-color: #888;
}

.filter-icon.active {
    border-color: #00aaff;
    box-shadow: 0 0 10px #00aaff88;
}

/* [신규] 카드 내 액션 버튼 스타일 */
.info-footer {
    align-items: center;
    /* 내부 요소 세로 정렬 */
}

.card-actions {
    margin-left: auto;
    /* 버튼들을 오른쪽으로 밀어냄 */
    display: flex;
    gap: 8px;
}

.card-action-btn {
    font-size: 0.8rem;
    padding: 4px 8px;
    background-color: #444;
    color: #ddd;
    border: 1px solid #666;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.card-action-btn:hover {
    background-color: #007bff;
    border-color: #007bff;
    color: white;
}

.card-action-btn.delete-btn:hover {
    background-color: #e74c3c;
    border-color: #e74c3c;
}


@media (max-width: 768px) {
    .build-card-grid {
        grid-template-columns: 1fr;
    }

    .buildlist-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .info-header .build-name {
        white-space: normal;
        /* 줄바꿈 허용 */
        overflow: hidden;
        text-overflow: ellipsis;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        /* 최대 2줄까지 표시 */
        -webkit-box-orient: vertical;
        word-break: break-all;
        /* 긴 영어/숫자 단어 강제 줄바꿈 */
    }

    /* [신규] 모바일: 두 줄 말줄임표 */
    .build-description-preview {
        white-space: normal;
        overflow: hidden;
        text-overflow: ellipsis;
        display: -webkit-box;
        -webkit-line-clamp: 2; /* 최대 2줄 */
        -webkit-box-orient: vertical;
    }

    /* [신규] 아이템 이름(텍스트) 숨기기 */
    .build-card .info-item span {
        display: none;
    }

    /* [신규] 아이템의 배경 및 패딩 조정 */
    .build-card .info-item {
        padding: 2px;
        background-color: transparent;
        /* 배경 제거 */
    }

    .build-card .info-item img {
        width: 22px;
        /* 아이콘 크기 약간 증가 */
        height: 22px;
    }

    /* [신규] 하이라이트 효과를 테두리 대신 배경색으로 변경 */
    .build-card .info-item.highlight-dejavu {
        box-shadow: none;
        background-color: #e67e2244;
        border-radius: 4px;
    }

    .build-card .info-item.highlight-core {
        box-shadow: none;
        background-color: #f1c40f44;
        border-radius: 4px;
    }

    .build-card .info-items {
        margin: auto;
    }

    /* [신규] 기억 그룹에 테두리 추가 */
    .build-card .info-item-group {
        border: 1px solid #555;
        border-radius: 6px;
        padding: 5px;
        background-color: #333;
        width: fit-content;
    }
}