
/* 구분선 스타일 */
.separator {
    width: 100%;
    height: 2px;
    background-color: #c0945c;
    margin: 30px 0;
}
/* 그리드는 main으로 옮기기 */
.ego-main-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.ego-main-grid {
    position: relative;
    cursor: pointer;
    transition: transform 0.2s;
}

/* 새로운 카드 스타일 */
.ego-main-card {
    position: relative;
    height: 270px;
    background-color: #1a1a1a;
    border: 2px solid #c0945c;  /* 3px에서 2px로 변경 */
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    transition: transform 0.2s;
    cursor: pointer;
}

.ego-main-card:hover {
    transform: scale(1.05);
}

.ego-main-card-header {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 40px;
    background: linear-gradient(45deg, #2a2a2a, #333333);
    border-bottom: 2px solid #c0945c;
    display: flex;
    align-items: center;
    justify-content: flex-end;  /* space-between에서 flex-end로 변경 */
    padding: 0 10px;
    box-sizing: border-box;
}

.card-icon {
    width: 24px;
    height: 24px;
}

.card-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.korean-letters {
    position: absolute;
    top: 50px;
    left: 5%;
    right: 5%;
    height: calc(100% - 60px);
    display: flex;
    flex-direction: column;
    justify-content: space-evenly;
    align-items: center;
}

.letter-row {
    width: 100%; /* 부모 컨테이너 전체 사용 */
    position: relative; /* position 컨텍스트 */
    height: 35px;
    background-color: #222222;
    border: 1px solid #333333;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;  /* 1.3rem에서 0.9rem으로 변경 */
    color: #c0945c;
    font-weight: bold;
}

/* E.G.O Modal Styles */
.ego-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
}

.ego-modal-content {
    position: relative;
    background-color: #0a0a0a;
    margin: 5% auto;
    padding: 20px;
    border: 2px solid #c0945c;
    border-radius: 10px;
    /*width: 80%;*/
    /*max-width: 1200px;*/
    /*max-height: 80vh;*/
    width: 85%; /* 너비 증가 */
    max-width: 1300px; /* 최대 너비 증가 */
    max-height: 85vh; /* 높이 증가 */
    overflow-y: auto;
    box-shadow: 0 0 50px rgba(192, 148, 92, 0.5);
    min-height: 680px;
}

/* 모달 내부 레이아웃 - 조정된 그리드 */
.ego-modal-inner {
    /*display: grid;*/
    /*grid-template-columns: 2fr;  !* 오른쪽 열을 고정 너비로 *!*/
    grid-template-columns: 2fr 1fr;  /* 오른쪽 열을 더 넓게 */
    grid-template-rows: auto 1fr;   /* 두 행 모두 250px 고정 */
    grid-template-areas:
        "frame identity"
        "frame egolist";
    gap: 15px;
    /*height: 70vh;*/
    height: 75vh; /* 높이 증가 */

    display: flex;
    justify-content: space-between;
    /*gap: 20px;*/
}

/* E.G.O 프레임 영역 */
/*.ego-frame-area {*/
/*    grid-area: frame;*/
/*    display: flex;*/
/*    justify-content: center;*/
/*    align-items: center;*/
/*    padding: 20px;*/
/*    overflow: hidden;*/
/*}*/

.ego-frame-area {
    grid-area: frame;
    display: flex;
    justify-content: center;
    align-items: flex-start;  /* center에서 flex-start로 변경 */
    padding: 10px;
    overflow-y: auto;  /* 세로 스크롤 추가 */
    overflow-x: hidden;  /* 가로 스크롤 숨김 */
    flex: 1;
}

.right-column {
    width: 280px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* 인격 사진영역 */
.identity-area {
    grid-area: identity;
    background-color: #1a1a1a;
    border: 2px solid #c0945c;
    border-radius: 8px;
    padding: 10px;
    width: 250px;
    /*height: 320px;*/

    /*width: 300px; !* 더 넓게 *!*/
    height: 360px; /* 더 높게 */
}

.identity-header {
    text-align: center;
    color: #c0945c;
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 5px;
}

.identity-frame {
    position: relative;
    overflow: hidden;
    /*border: 1px solid #c0945c;*/
    border-radius: 5px;
    height: calc(100% - 30px);  /* 헤더 높이를 고려한 프레임 높이 */
    padding: 0 0 3px 0;
    display: flex; /* 추가 */
    justify-content: center; /* 추가 */
    align-items: center; /* 추가 */
}

.identity-image {
    /*width: 100%;*/
    /*height: 100%;*/
    /*object-fit: cover;*/

    /*width: auto; !* 원본 비율 유지를 위해 변경 *!*/
    /*height: auto; !* 원본 비율 유지를 위해 변경 *!*/
    /*max-width: 100%; !* 프레임을 넘지 않도록 제한 *!*/
    /*max-height: 100%; !* 프레임을 넘지 않도록 제한 *!*/
    /*object-fit: contain; !* cover에서 contain으로 변경 *!*/
    width: 90%;
    height: 300px;
    border: 1px solid #c0945c;
}


/* 인격 정보 컨테이너 */
.identity-info-container {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(to top, rgba(10, 10, 10, 0.9), rgba(10, 10, 10, 0.5) 70%, transparent);
    padding: 10px 0 5px 0;
    text-align: center;
}

.identity-type {
    display: inline-block;
    background-color: rgba(153, 102, 204, 0.7);  /* r1 색상과 유사하게 */
    color: white;
    font-size: 0.9rem;
    padding: 2px 8px;
    border-radius: 4px;
    margin-bottom: 5px;
}

.identity-name {
    color: white;
    font-size: 1.2rem;
    font-weight: bold;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.8);
}


/* E.G.O 목록 영역 */
.ego-list-area {
    grid-area: egolist;
    background-color: #1a1a1a;
    border: 2px solid #c0945c;
    border-radius: 8px;
    padding: 10px;
    width: 250px;
    /*min-height: 270px;*/

    /*width: 300px; !* 넓이 증가 *!*/
    min-height: 290px; /* 높이 증가 */
}

.ego-list-header {
    text-align: center;
    color: #c0945c;
    font-size: 1.2rem;
    font-weight: bold;
    margin: 5px 0 10px 0;
}

.ego-list-items {
    display: flex;
    flex-direction: column;
    gap: 15px;
    height: calc(100% - 35px);  /* 헤더 높이를 고려한 목록 영역 높이 */
    overflow-y: auto;  /* 내용이 많을 경우 스크롤 추가 */
}

.ego-list-row {
    background-color: #222222;
    border: 1px solid #333333;
    border-radius: 4px;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #c0945c;
    font-weight: bold;
    height: 39px;
}

.ego-tier-icon {
    color: #ffaa66;
    margin-right: 10px;
}

.ego-level {
    color: #e0e0e0;
}

.ego-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.ego-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 15px;
    width: 100%;
    height: 100%;
    padding: 10px;
    box-sizing: border-box;
}

/* E.G.O 카드 크기 조정 */
.ego-card {
    position: relative;
    cursor: pointer;
    transition: transform 0.2s;
    display: flex;
    width: calc(25% - 15px);  /* 4열 레이아웃에서 gap 고려 */
    min-width: 120px;  /* 최소 너비 설정 */
    max-width: 180px;  /* 최대 너비 설정 */
}

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

.ego-frame {
    position: relative;
    width: 200px;
    height: 260px;
}

.ego-circle {
    position: relative;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    border: 0 solid #C0945C4C;  /* 테두리 두께도 조금 줄임 */
    background-color: #1a1a1a;
    overflow: hidden;
    box-shadow: 0 0 5px rgba(192, 148, 92, 0.3);
}

.ego-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ego-nameplate {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 140px;
    height: 40px;
    background: linear-gradient(to bottom, #c0945c, #8a6941);
    border: 2px solid #d4a76a;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 10px;
    box-shadow: 0 0 10px rgba(192, 148, 92, 0.5);
    z-index: 1;
}

.ego-name {
    color: white;
    font-weight: bold;
    font-size: 0.8rem; /* 기본 크기를 조금 줄임 */
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
    margin: 0;
    padding-left: 20px; /* tier 공간 확보 */
    padding-right: 8px; /* 오른쪽 여백 */
    flex: 1;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ego-nameplate-tier {
    color: #ffaa66;
    font-weight: bold;
    font-size: 0.9rem;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
    position: absolute;
    left: 8px; /* 컨테이너가 작으므로 여백 줄임 */
    z-index: 2;
}

/* 텍스트 길이에 따른 자동 크기 조절 */
.ego-name.medium-text {
    font-size: 0.7rem;
}

.ego-name.long-text {
    font-size: 0.6rem;
}

.ego-effect {
    position: absolute;
    width: 210px;
    height: 210px;
    border-radius: 50%;
    /*border: 1px solid rgba(192, 148, 92, 0.3);*/
    left: -5px;
    /*animation: pulseEffect 2s infinite;*/
}


/* 스크롤바 스타일링 */
.ego-frame-area::-webkit-scrollbar {
    width: 8px;
}

.ego-frame-area::-webkit-scrollbar-track {
    background: #1a1a1a;
    border-radius: 4px;
}

.ego-frame-area::-webkit-scrollbar-thumb {
    background: #c0945c;
    border-radius: 4px;
}

.ego-frame-area::-webkit-scrollbar-thumb:hover {
    background: #d4a76a;
}



@keyframes pulseEffect {
    0% {
        transform: scale(1);
        opacity: 0.5;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.2;
    }
    100% {
        transform: scale(1);
        opacity: 0.5;
    }
}

/* 미디어 쿼리 추가 */
@media (max-width: 1200px) {
    .ego-card {
        width: calc(33.33% - 15px);  /* 3열 레이아웃 */
    }
}

@media (max-width: 900px) {
    .ego-card {
        width: calc(50% - 15px);  /* 2열 레이아웃 */
    }
}

@media (max-width: 600px) {
    .ego-card {
        width: calc(50% - 15px);  /* 2열 유지 */
        min-width: 100px;  /* 더 작은 최소 너비 */
        display: flex;
        flex-wrap: wrap;
    }

    .ego-frame {
        width: 100px;  /* 더 작은 프레임 */
        height: 130px;
    }

    .ego-circle {
        width: 100px;
        height: 100px;
    }

    .ego-nameplate {
        width: 80px;
        height: 25px;
    }

    .ego-name {
        font-size: 0.8rem;
    }

    .ego-nameplate-tier {
        font-size: 0.8rem;
    }
}

/* 4-28 EGO MODAL 반응형 */
@media (max-width: 1200px) {
    .ego-grid {
        grid-template-columns: repeat(3, 1fr); /* 4열에서 3열로 변경 */
    }
}

@media (max-width: 1024px) {
    .ego-modal-inner {
        flex-direction: column; /* 가로 배치에서 세로 배치로 변경 */
    }

    .right-column {
        width: 100%; /* 전체 너비로 변경 */
        flex-direction: row; /* 가로 배치로 변경 */
    }

    .identity-area, .ego-list-area {
        width: 50%; /* 각각 50% 너비 */
    }
}

@media (max-width: 768px) {
    .right-column {
        flex-direction: column; /* 다시 세로 배치로 */
    }

    .identity-area, .ego-list-area {
        width: 100%; /* 전체 너비 */
    }

    .ego-grid {
        grid-template-columns: repeat(1, 1fr); /* 1열로 변경 */
    }
}

@media (max-width: 480px) {
    .ego-modal-content {
        padding: 10px;
        margin: 0;
        width: 100%;
        height: 100%;
        max-height: 100vh;
        border-radius: 0;
    }
}