/* ===== Reset & Base Styles ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Elements.html 스타일 반영 - 다크 퍼플/블루 톤 */
    --primary-gradient: linear-gradient(135deg, #5e42a6 0%, #b74e91 100%);
    --secondary-gradient: linear-gradient(135deg, #b74e91 0%, #5e42a6 100%);
    --dark-bg: #312450;
    --card-bg: rgba(255, 255, 255, 0.05);
    --border-color: rgba(255, 255, 255, 0.15);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --accent-pink: #b74e91;
    --accent-purple: #5e42a6;
    --hover-color: #b74e91;
    
    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    
    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 1rem;
    --radius-xl: 2rem;
}

/* ===== Header Override (prevent conflicts with main.css) ===== */
#header {
    position: fixed !important;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 10001 !important;
}

#wrapper {
    padding-top: 5rem;
}

body {
    font-family: "Source Sans Pro", Helvetica, sans-serif;
    background: var(--dark-bg);
    color: var(--text-primary);
    line-height: 1.65;
    font-weight: 300;
    font-size: 16pt;
    min-height: 100vh;
    overflow-x: hidden;
}

/* 2분할 레이아웃: 채팅 패널 활성화 시 */
body.chat-open {
    display: flex;
    flex-direction: row;
    height: 100vh;
    overflow: hidden;
}

html.chat-open-html {
    height: 100vh;
    overflow: hidden;
}

body.chat-open > * {
    flex-shrink: 0;
}

/* ===== Main Container (2분할 레이아웃 대응) ===== */
.avatar-container {
    max-width: 100%;
    margin: 0 auto;
    padding: var(--spacing-lg) var(--spacing-sm);
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    transition: width 0.3s ease;
    box-sizing: border-box;
}

/* 채팅 패널 활성화 시 너비 조정 - 기본값 (모바일: 0%, 채팅만) */
body.chat-open .avatar-container {
    width: 0%;
    padding: var(--spacing-sm) 0.75rem;
    overflow-y: auto;
    height: auto;
    box-sizing: border-box;
    min-width: 0;
    display: none;
}

/* 태블릿 레이아웃 (481px ~ 768px: 60% 메인 : 40% 채팅) */
@media (min-width: 481px) and (max-width: 768px) {
    body.chat-open .avatar-container {
        width: 60%;
        display: flex;
        height: auto;
        padding: var(--spacing-sm) 0.75rem;
        overflow-y: auto;
        overflow-x: hidden;
        margin: 0;
        flex-direction: column;
    }
}

/* PC 레이아웃 (769px 이상: 70% 메인 : 30% 채팅) */
@media (min-width: 769px) {
    body.chat-open .avatar-container {
        width: 70%;
        display: flex;
        height: auto;
        padding: var(--spacing-md);
        overflow-y: auto;
        overflow-x: hidden;
        margin: 0;
        flex-direction: column;
    }
}



/* ===== Header ===== */
.avatar-header {
    text-align: center;
    margin-bottom: var(--spacing-xl);
    padding: var(--spacing-md) 0;
    border-bottom: solid 1px var(--border-color);
    width: 100%;
}

/* 뒤로가기 버튼 (타이틀 인라인) */
.page-back-btn {
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: 10px;
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.18s, border-color 0.18s;
    vertical-align: middle;
    margin-right: 10px;
}
.page-back-btn:hover {
    background: rgba(255,255,255,0.13);
    border-color: rgba(255,255,255,0.22);
}
@media (max-width: 768px) {
    .page-back-btn {
        display: none;
    }
}

.title {
    font-size: 2.5rem;
    font-weight: 300;
    letter-spacing: 0.075em;
    margin-bottom: var(--spacing-sm);
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    color: var(--text-primary);
}

.beta-badge {
    display: inline-block;
    padding: 0.3rem 0.8rem;
    background: var(--accent-pink);
    border-radius: 0.35rem;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    vertical-align: middle;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.15);
}

.subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    font-weight: 300;
    letter-spacing: 0.05em;
}

/* ===== Avatar Display Section - 19.png Hedra 스타일 ===== */
.avatar-display-section {
    margin-bottom: var(--spacing-xl);
}

/* 채팅 패널이 열렸을 때 높이 제약 */
body.chat-open .avatar-display-section {
    overflow: visible;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

/* 채팅 패널 활성화 시 hedra-container 조정 */
body.chat-open .hedra-container {
    padding: var(--spacing-sm) 0.75rem;
    margin: 0;
    max-width: 100%;
    width: 100%;
    max-height: none;
    overflow: visible;
    flex: 1;
}

/* 태블릿 레이아웃 (481px ~ 768px) */
@media (min-width: 481px) and (max-width: 768px) {
    body.chat-open .hedra-container {
        padding: var(--spacing-sm) 0.75rem;
        max-height: none;
        overflow: visible;
        flex: 1;
    }
}

/* PC 레이아웃 (769px 이상) */
@media (min-width: 769px) {
    body.chat-open .hedra-container {
        padding: var(--spacing-md);
        max-height: none;
        overflow: visible;
        flex: 1;
    }
}

/* 모바일(480px 이하)에서 chat-open 상태: 콘텐츠 숨김 */
@media (max-width: 480px) {
    body.chat-open .hedra-container {
        max-height: none;
        overflow: visible;
        padding: 0;
        display: none;
    }
}

/* 41.png 스타일: Hedra 컨테이너 */
.hedra-container {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding: 2rem;
    width: 100%;
    box-sizing: border-box;
    overflow: visible;
}

/* 상단 컨트롤 래퍼 (이미지 밖) */
.top-controls-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.9375rem; /* 15px - 3개 컨트롤을 650px에 딱 맞게 배치 */
    margin-bottom: var(--spacing-lg);
    /* 이미지 영역과 동일한 너비로 정렬 */
    width: 100%;
    max-width: 650px;
    margin-left: auto;
    margin-right: auto;
    flex-wrap: nowrap; /* 한 줄에 배치 */
}

/* 채팅 패널 활성화 시 top-controls-wrapper 조정 */
body.chat-open .top-controls-wrapper {
    max-width: 100%;
    padding: 0 0.5rem;
}

/* 좌측: 카테고리 드롭다운 (1단계) */
.top-left-control {
    flex: 0 0 200px; /* 고정 너비 200px */
}

/* 중앙: 옵션 드롭다운 (2단계) */
.top-center-control {
    flex: 0 0 200px; /* 고정 너비 200px */
}

/* 중앙: 아바타 이미지 영역 (3:4 비율) - ✅ 크기 고정 강화 */
.avatar-image-wrapper {
    position: relative; /* 오버레이 포지셔닝을 위해 필수 */
    width: 100%;
    max-width: 650px;
    height: 867px;
    min-height: 867px; /* ✅ 최소 높이 고정 - 가로로 늘어나는 것 방지 */
    margin: 0 auto;
    background: rgba(0, 0, 0, 0.4); /* 여백 배경색 - 이미지 비율 유지 시 여백 표시 */
    border: solid 1px var(--border-color);
    border-radius: var(--radius-md);
    overflow: visible;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0; /* ✅ 축소 방지 */
    aspect-ratio: 3 / 4; /* ✅ 비율 강제 고정 */
}

.style-image-wrapper > .background-img,
.avatar-image-wrapper > .background-img {
    border-radius: var(--radius-md);
}

/* Style Image Wrapper (getstyle.html용) - ✅ 크기 고정 강화 */
.style-image-wrapper {
    position: relative; /* AI Feature Icons 포지셔닝을 위해 필수 */
    width: 100%;
    max-width: 650px;
    height: 867px;
    min-height: 867px; /* ✅ 최소 높이 고정 - 가로로 늘어나는 것 방지 */
    margin: 0 auto;
    background: rgba(0, 0, 0, 0.4);
    border: solid 1px var(--border-color);
    border-radius: var(--radius-md);
    overflow: visible;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0; /* ✅ 축소 방지 */
    aspect-ratio: 3 / 4; /* ✅ 비율 강제 고정 */
}

/* 아바타/스타일 배경 이미지 - ✅ 원본 비율 유지 */
.background-img {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: contain !important; /* ✅ 원본 비율 유지 (왜곡 방지) */
    object-position: center !important;
    display: block !important;
    transition: filter 0.3s ease; /* 블러 전환 효과 */
    position: absolute !important; /* ✅ wrapper 기준 절대 위치 */
    top: 0 !important;
    left: 0 !important;
}

/* ✅ FIX: 분할 화면 레이아웃 추가 */
.style-image-wrapper.split-view {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: stretch;
}

.style-image-wrapper.split-view > * {
    width: 50% !important;
    height: 100% !important;
    object-fit: cover !important; /* 분할 화면에서는 꽉 채우기 */
}

/* ✅ FIX: 메인 영역의 <video> 요소도 동일하게 처리 */
.style-image-wrapper video {
    width: 100%;
    height: 100%;
    object-fit: cover; /* 프레임 꽉 채우기 */
    object-position: center;
    display: block;
    border-radius: 8px;
}

/* 업로드된 사용자 이미지: 프레임 꽉 채우기, 비율 유지 (일부 크롭 허용) */
.background-img.user-uploaded {
    object-fit: cover; /* 프레임 꽉 채우기 - 비율 유지하며 필요시 일부 크롭 */
}

/* 로딩 중 이미지 블러 효과 */
.avatar-image-wrapper.loading .background-img {
    filter: blur(8px);
}

/* ===== 참고 이미지 오버레이 (Take Photo) ===== */
.reference-image-overlay {
    position: absolute;
    /* ✅ 메인 이미지 wrapper의 오른쪽 하단에 정확히 배치 */
    bottom: 12px; /* 약간의 여백으로 이미지 테두리와 구분 */
    right: 12px; /* 약간의 여백으로 이미지 테두리와 구분 */
    width: 140px;
    background: rgba(255, 255, 255, 0.98);
    border-radius: 12px;
    overflow: visible; /* 닫기 버튼이 밖으로 나갈 수 있도록 */
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3),
                0 0 0 2px rgba(183, 78, 145, 0.5);
    z-index: 50;
    animation: fadeInUp 0.4s ease;
    /* ✅ 부모 wrapper 내에서 정확한 위치 보장 */
    box-sizing: border-box;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.reference-image-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: linear-gradient(135deg, #5e42a6 0%, #b74e91 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.reference-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #ffffff;
}

.btn-remove-reference {
    width: 24px;
    height: 24px;
    min-width: 24px; /* 정원형 유지 */
    min-height: 24px; /* 정원형 유지 */
    background: rgba(255, 255, 255, 0.25);
    border: none;
    border-radius: 50%; /* 완전한 원형 */
    color: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    transition: all 0.2s ease;
    aspect-ratio: 1 / 1; /* 정원형 보장 */
    padding: 0;
    flex-shrink: 0; /* 크기 고정 */
    box-sizing: border-box;
}

.btn-remove-reference i {
    line-height: 1;
}

.btn-remove-reference:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.btn-remove-reference:active {
    transform: scale(0.9);
}

.reference-image-body {
    position: relative;
    width: 140px;
    height: 187px; /* 3:4 비율 유지 (140 * 4/3) */
    background: rgba(0, 0, 0, 0.05);
    cursor: pointer;
    overflow: hidden;
}

.reference-image-body img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    transition: transform 0.3s ease;
}

.reference-image-body:hover img {
    transform: scale(1.05);
}

.reference-zoom-hint {
    position: absolute;
    bottom: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    border-radius: 50%;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.reference-image-body:hover .reference-zoom-hint {
    opacity: 1;
}

/* ===== 참고 이미지 확대 모달 ===== */
.reference-image-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

.reference-image-modal.active {
    display: flex;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.reference-modal-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    animation: zoomIn 0.3s ease;
}

@keyframes zoomIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.reference-modal-content img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.btn-close-reference-modal {
    position: absolute;
    top: -40px;
    right: 0;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    transition: all 0.2s ease;
}

.btn-close-reference-modal:hover {
    background: rgba(183, 78, 145, 0.8);
    border-color: rgba(183, 78, 145, 1);
    transform: rotate(90deg) scale(1.1);
}

.btn-close-reference-modal:active {
    transform: rotate(90deg) scale(0.95);
}

/* 하단: 채팅 래퍼 (이미지 밖) - Deprecated, kept for compatibility */
.bottom-chat-wrapper {
    width: 100%;
    max-width: 650px; /* 이미지와 동일한 너비 */
    margin: 0 auto;
    z-index: 100;
    display: none; /* 소셜 공유로 대체됨 */
}

/* ===== 소셜 공유 버튼 영역 ===== */
.social-share-wrapper {
    width: 100%;
    max-width: 650px; /* 메인 이미지와 동일한 너비 */
    margin: 0.4rem auto 0.4rem; /* ✅ 갤러리와의 간격 축소 */
    padding: 0 0.5rem;
    z-index: 100;
}

.social-share-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    flex-wrap: nowrap; /* ✅ 반드시 한 줄로 배치 */
}

.social-share-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.15rem;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    transition: all 0.3s ease;
    flex: 0 0 auto;
    width: 60px;
    min-width: 60px;
    max-width: 60px;
    height: auto;
    box-sizing: border-box;
}

.social-share-btn:hover {
    transform: translateY(-3px);
}

.social-share-btn:active {
    transform: translateY(0) scale(0.95);
}

.share-icon-circle {
    width: 46px !important;
    height: 46px !important;
    min-width: 46px !important;
    min-height: 46px !important;
    max-width: 46px !important;
    max-height: 46px !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: #ffffff;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    aspect-ratio: 1 / 1 !important;
    flex-shrink: 0 !important;
    flex-grow: 0 !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    padding: 0 !important;
    margin: 0 !important;
    position: relative !important;
}

.social-share-btn:hover .share-icon-circle {
    transform: scale(1.08);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

/* 개별 소셜 아이콘 색상 */
.share-download {
    background: linear-gradient(135deg, #b74e91 0%, #5e42a6 100%);
}

.share-other {
    background: linear-gradient(135deg, #555555 0%, #333333 100%);
}

/* 삭제: 저장(퍼플) 계열과 조화 — 차분한 뮤트 퍼플·슬레이트 (순회색과 구분) */
.share-delete {
    background: linear-gradient(135deg, #585070 0%, #453d5c 45%, #342e48 100%);
    color: rgba(255, 255, 255, 0.96);
}
.social-share-btn[data-share="delete"]:hover .share-delete {
    background: linear-gradient(135deg, #645c7c 0%, #504868 45%, #3e3658 100%);
}
/* 솔리드 휴지통(fas) — 저장·기타(1.25rem)와 동일 계열, 살짝만 크게 */
.share-delete i {
    font-size: 1.32rem;
    line-height: 1;
    opacity: 1;
}

.share-instagram {
    background: linear-gradient(135deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
}

.share-kakao {
    background: #FEE500;
    color: #3C1E1E !important;
}

.share-whatsapp {
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
}

.share-facebook {
    background: linear-gradient(135deg, #1877F2 0%, #0D5BC9 100%);
}

.share-telegram {
    background: linear-gradient(135deg, #0088cc 0%, #006699 100%);
}

.share-label {
    display: none !important;
    visibility: hidden !important;
}

.social-share-btn:hover .share-label {
    color: rgba(255, 255, 255, 1);
}

/* 채팅 입력 행 - Deprecated */
.chat-input-row {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    width: 100%;
}

/* STYLE 버튼 (라운드 형태, 분홍색) - Deprecated */
.btn-style-label {
    background: var(--primary-gradient);
    color: #ffffff !important;
    border: none;
    padding: 0 1.5rem;
    height: 2.75rem;
    border-radius: 0.375rem;
    cursor: default;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.075em;
    text-transform: uppercase;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.15);
    opacity: 0.9;
    flex-shrink: 0;
    min-width: 80px;
}

.btn-style-label:disabled {
    cursor: default;
    opacity: 0.9;
}

/* 커스텀 스타일 입력 필드 - Deprecated */
.chat-input-hedra {
    flex: 1 1 auto;
    min-width: 0;
    padding: 0.7rem 1.25rem;
    background: rgba(255, 255, 255, 0.03);
    border: solid 1px rgba(255, 255, 255, 0.08);
    border-radius: 1.5rem;
    color: var(--text-primary);
    font-size: 0.95rem;
    outline: none;
    transition: all 0.25s ease;
}

.chat-input-hedra:focus {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--accent-pink);
    box-shadow: 0 0 0 3px rgba(183, 78, 145, 0.15);
}

.chat-input-hedra::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

/* Deprecated: 기존 오버레이 컨테이너 */
.avatar-background-image {
    display: none !important;
}

.background-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

/* 스타일 드롭다운 디자인 */
.style-dropdown-top {
    width: 100%; /* 부모 컨테이너 너비에 맞춤 */
    height: 44px;
    padding: 0 2.5rem 0 1.2rem;
    background: rgba(49, 36, 80, 0.35);
    backdrop-filter: blur(25px);
    border: solid 1px rgba(183, 78, 145, 0.25);
    border-radius: 22px;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%23b74e91' d='M5 6L0 0h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
}

.style-dropdown-top:hover {
    background: rgba(94, 66, 166, 0.45);
    border-color: var(--accent-pink);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(183, 78, 145, 0.3);
}

.style-dropdown-top:focus {
    background: rgba(94, 66, 166, 0.5);
    border-color: var(--accent-pink);
    box-shadow: 0 0 0 3px rgba(183, 78, 145, 0.2);
}

.style-dropdown-top option {
    background: rgba(49, 36, 80, 0.98);
    backdrop-filter: blur(10px);
    color: var(--text-primary);
    padding: 1rem;
    font-size: 0.9rem;
    font-weight: 500;
    border-bottom: solid 1px rgba(183, 78, 145, 0.1);
}

/* 우측: Create Style 버튼 */
.top-right-control {
    flex: 0 0 220px; /* 고정 너비 220px - 버튼 텍스트 + 아이콘에 충분한 공간 */
}

/* Create Style 버튼 디자인 */
.btn-create-top {
    width: 100%; /* 부모 컨테이너 너비에 맞춤 */
    height: 44px;
    padding: 0 1.2rem;
    background: var(--primary-gradient);
    border: none;
    border-radius: 22px;
    color: var(--text-primary);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(183, 78, 145, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    white-space: nowrap;
}

.btn-create-top:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(183, 78, 145, 0.6);
}

.btn-create-top:active {
    transform: translateY(0);
}

.btn-create-top i {
    font-size: 0.9rem;
}

/* Empty State */
.empty-state {
    display: none !important;
}

/* Sample State (초기 샘플 이미지) */
.sample-state {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sample-image-container {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: var(--radius-md);
    overflow: hidden;
}

.sample-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

/* 16.png: sample overlay 제거, 컨트롤만 표시 */
.sample-overlay {
    display: none;
}

.sample-image-container:hover {
    opacity: 0.95;
}

.sample-text {
    font-size: 1.5rem;
    font-weight: 300;
    letter-spacing: 0.075em;
    color: #ffffff;
    text-align: center;
    padding: 2rem;
    margin: 0;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.gallery-item:hover {
    transform: translateY(-5px);
    border-color: var(--hover-color);
    box-shadow: 0 0 20px rgba(183, 78, 145, 0.3);
}

.gallery-item:hover img {
    opacity: 0.8;
}

.gallery-item.active {
    border-color: var(--accent-pink);
    box-shadow: 0 0 0 3px rgba(183, 78, 145, 0.3);
}

/* Gallery Add Button */
.gallery-add {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--card-bg);
    border: solid 1px var(--border-color);
    transition: all 0.2s ease-in-out;
}

.add-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
    transition: all 0.2s ease-in-out;
}

.add-text {
    font-size: 1rem;
    font-weight: 400;
    letter-spacing: 0.05em;
    color: var(--text-primary);
    transition: all 0.2s ease-in-out;
}

.gallery-add:hover {
    background-color: var(--hover-color);
    border-color: var(--hover-color);
}

.gallery-add:hover .add-icon {
    transform: scale(1.1);
}

.gallery-add:hover .add-text {
    color: #ffffff;
}

/* ===== Upload Modal ===== */
.upload-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
}

.upload-modal.active {
    display: flex;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(49, 36, 80, 0.95);
    backdrop-filter: blur(10px);
}

.modal-content {
    position: relative;
    background: var(--dark-bg);
    border: solid 1px var(--border-color);
    border-radius: var(--radius-md);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    z-index: 10001;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.5);
}

/* Modal Header */
.modal-header {
    display: flex;
    flex-direction: column;
    align-items: center; /* 중앙정렬 */
    text-align: center; /* 텍스트 중앙정렬 */
    padding: 2.5rem 2rem 1.5rem;
    border-bottom: solid 1px var(--border-color);
    position: relative;
    background: linear-gradient(135deg, rgba(94, 66, 166, 0.05) 0%, rgba(183, 78, 145, 0.05) 100%);
}

.modal-header h2 {
    font-size: 1.75rem;
    font-weight: 300;
    letter-spacing: 0.075em;
    color: var(--text-primary);
    margin: 0 0 0.5rem 0;
    display: flex;
    align-items: center;
    justify-content: center; /* 중앙정렬 */
    gap: 0.5rem;
    width: 100%;
}

.modal-header h2::before {
    content: "✨";
    font-size: 1.5rem;
    opacity: 0.8;
}

.modal-subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 300;
    letter-spacing: 0.05em;
    margin: 0;
    padding-left: 0; /* 중앙정렬을 위해 패딩 제거 */
    text-align: center;
}

/* 닫기 버튼 */
.btn-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0;
    line-height: 1;
    opacity: 0.6;
    z-index: 100;
}

.btn-close:hover {
    background: rgba(183, 78, 145, 0.15);
    color: var(--accent-pink);
    transform: rotate(90deg);
    opacity: 1;
}

.btn-close:active {
    transform: rotate(90deg) scale(0.95);
}

/* Upload Area (3:4 비율 - 세로가 더 긴 직사각형) */
.upload-area {
    position: relative;
    width: 100%;
    height: 533px;
    max-width: 400px;
    margin: 2rem auto;
    background: rgba(0, 0, 0, 0.3); /* 여백 배경색 */
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem;
    transition: all 0.3s ease-in-out;
    cursor: pointer;
}

.upload-area:hover {
    border-color: var(--accent-pink);
    background: rgba(183, 78, 145, 0.05);
}

.upload-area:hover .upload-icon {
    transform: scale(1.1);
    color: var(--accent-pink);
}

.upload-icon {
    font-size: 4rem;
    color: rgba(255, 255, 255, 0.4);
    margin-bottom: 1.5rem;
    transition: all 0.3s ease-in-out;
}

.upload-text {
    font-size: 1.2rem;
    font-weight: 300;
    color: var(--text-primary);
    margin-bottom: 1rem;
    line-height: 1.4;
}

.upload-link {
    color: var(--accent-pink);
    text-decoration: underline;
    cursor: pointer;
    font-weight: 400;
}

.upload-link:hover {
    color: var(--accent-purple);
}

.upload-hint {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 300;
    line-height: 1.4;
    font-style: italic;
    margin-top: 0.5rem;
}

/* 이미지 미리보기 (3:4 비율) - 점선 테두리까지 꽉 차게 */
.image-preview {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: var(--radius-md);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
}

.image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* 박스에 꽉 차게 표시 */
    object-position: center;
    display: block;
}

.btn-remove-preview {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(183, 78, 145, 0.9);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    z-index: 10;
}

.btn-remove-preview:hover {
    background: var(--accent-pink);
    transform: scale(1.1);
}

.upload-area.has-image .upload-icon,
.upload-area.has-image .upload-text,
.upload-area.has-image .upload-hint {
    display: none;
}

.upload-area.has-image {
    padding: 0;
    border: solid 1px var(--border-color);
    border-style: solid;
    background: transparent;
}

.upload-area.has-image .image-preview {
    margin: 0;
    border-radius: var(--radius-md);
    border: none;
    box-shadow: none;
}

/* ===== Modal Actions (16.png Style Enhanced) ===== */
.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    padding: 2rem;
    position: relative;
    z-index: 1000;
}

.btn-modal-action {
    padding: 14px 24px;
    border-radius: 28px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid transparent;
    min-width: 160px;
    justify-content: center;
    text-align: center;
    text-transform: none;
    letter-spacing: 0.025em;
    position: relative;
    z-index: 1001;
    line-height: 1;
}

.btn-capture-image {
    background: var(--primary-gradient);
    color: white;
    border: none;
    box-shadow: 0 4px 15px rgba(183, 78, 145, 0.35);
}

.btn-capture-image:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(183, 78, 145, 0.5);
}

.btn-take-photo {
    background: var(--accent-pink);
    color: white;
    border: none;
    box-shadow: 0 4px 15px rgba(183, 78, 145, 0.35);
}

.btn-take-photo:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(183, 78, 145, 0.5);
}

.btn-retake-photo {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    border: 2px solid rgba(255, 255, 255, 0.25);
}

.btn-retake-photo:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-2px);
}

.btn-use-image {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border: none;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.35);
    z-index: 10002 !important;
}

.btn-use-image:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(40, 167, 69, 0.5);
}

.btn-modal-action:active {
    transform: translateY(0) scale(0.97);
}

.btn-modal-action i {
    font-size: 1.1rem;
}

/* ===== Loading Overlay ===== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(49, 36, 80, 0.98);
    z-index: 20000;
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
}

.loading-overlay.active {
    display: flex;
}

.loading-spinner {
    text-align: center;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--accent-purple);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto var(--spacing-md);
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-spinner p {
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 300;
    letter-spacing: 0.05em;
}

/* ===== Animations ===== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes flash {
    0% { opacity: 0; }
    50% { opacity: 1; }
    100% { opacity: 0; }
}

@keyframes pulse {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.05);
        opacity: 0.8;
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

/* Face Guide */
.face-guide {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 200px;
    height: 320px;
    border: 3px dashed rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    pointer-events: none;
    z-index: 5;
    animation: pulse 2s infinite;
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.4);
}

/* ===== Camera Area (with Face Guide - getavata.css와 동일) ===== */
#cameraArea {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: #000;
    z-index: 10;
}

#cameraVideo {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    -webkit-object-fit: cover;
    display: block;
}

.face-guide-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 20;
}

.face-guide-circle {
    width: 280px;
    height: 350px;
    border: 3px solid rgba(183, 78, 145, 0.8);
    border-radius: 50%;
    box-shadow: 
        0 0 0 9999px rgba(0, 0, 0, 0.5),
        0 0 20px rgba(183, 78, 145, 0.6),
        inset 0 0 20px rgba(183, 78, 145, 0.3);
    animation: pulse-guide 2s ease-in-out infinite;
}

@keyframes pulse-guide {
    0%, 100% {
        transform: scale(1);
        opacity: 0.8;
    }
    50% {
        transform: scale(1.02);
        opacity: 1;
    }
}

.face-guide-text {
    display: none; /* 텍스트 숨김 처리 */
    margin-top: var(--spacing-lg);
    font-size: 1rem;
    color: var(--text-primary);
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
    background: rgba(0, 0, 0, 0.6);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
}

/* Camera Container */
.camera-container {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: var(--radius-md);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Success Feedback */
.success-feedback {
    position: fixed;
    top: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    padding: 1rem 2rem;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    box-shadow: 0 8px 25px rgba(40, 167, 69, 0.4);
    z-index: 30000;
    animation: slideInUp 0.3s ease;
}

/* ===== Gallery Section ===== */
.avatar-gallery-section {
    padding: 0.4rem 0 var(--spacing-lg) 0; /* ✅ 상단 패딩 축소 */
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.gallery-header {
    text-align: center;
    margin-bottom: var(--spacing-lg);
    padding-bottom: var(--spacing-md);
    border-bottom: solid 1px var(--border-color);
    width: 100%;
    max-width: 1200px;
}

.gallery-header h3 {
    font-size: 1.5rem;
    font-weight: 300;
    letter-spacing: 0.075em;
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.gallery-header i {
    color: var(--accent-pink);
}

/* ===== Gallery Grid Layout ===== */
.avatar-gallery {
    display: grid;
    /* PC: 6개 한 줄에 표시 (customize + 5개 이미지), 6개 미만일 때 중앙 정렬 */
    grid-template-columns: repeat(auto-fit, minmax(150px, 180px));
    justify-content: center;
    gap: var(--spacing-md);
    width: 100%;
    max-width: 1200px;
}

.gallery-item {
    position: relative;
    aspect-ratio: 1;
    background: var(--card-bg);
    border: solid 1px var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease-in-out;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Responsive - 41.png 스타일 (3:4 비율 유지) */
@media (max-width: 980px) {
    .hedra-container {
        max-width: 100%;
        padding: 1.5rem 1rem;
        gap: 1.25rem;
    }
    
    .avatar-image-wrapper {
        height: 700px;
        min-height: 700px; /* ✅ 최소 높이 고정 */
        max-width: 525px;
        aspect-ratio: 3 / 4; /* ✅ 비율 강제 고정 */
    }
    
    .style-image-wrapper {
        height: 700px;
        min-height: 700px; /* ✅ 최소 높이 고정 */
        max-width: 525px;
        aspect-ratio: 3 / 4; /* ✅ 비율 강제 고정 */
    }
    
    .bottom-chat-wrapper {
        max-width: 525px;
    }
    
    .social-share-wrapper {
        max-width: 525px;
    }
    
    /* 태블릿: 갤러리 5컬럼으로 조정 */
    .avatar-gallery {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    
    .style-dropdown-top {
        min-width: 150px;
        font-size: 0.85rem;
        padding: 0.5rem 2rem 0.5rem 0.85rem;
    }
    
    .btn-create-top {
        padding: 0.5rem 1.25rem;
        font-size: 0.8rem;
    }
    
    .chat-input-row {
        gap: 0.5rem;
    }
    
    .chat-input-hedra {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }
    
    .btn-voice-mic {
        width: 44px;
        height: 40px;
        font-size: 1rem;
        border-radius: 10px;
    }
    
    .btn-chat-send {
        padding: 0 1.5rem;
        font-size: 0.9rem;
        height: 40px;
        border-radius: 20px;
    }
    
    .modal-content {
        width: 95%;
    }
    
    /* 모바일에서도 버튼 가로 배치 유지 (아바타 서비스와 동일) */
    .modal-actions {
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .btn-modal-action {
        flex: 1;
        min-width: 120px;
    }
    
    /* 모달 내부 업로드 영역 반응형 (3:4 비율 유지) - 아바타 서비스와 동일 */
    .upload-area {
        height: 450px;
        max-width: 100%;
        width: calc(100% - 2rem);
        margin: 1rem auto;
        padding: 1.5rem;
    }
    
    /* image-preview는 absolute로 부모를 꽉 채우므로 별도 크기 지정 불필요 */
    
    .face-guide-circle {
        width: 180px;
        height: 230px;
    }

    /* ===== 태블릿 업로드 모달 텍스트 중앙 정렬 (아바타 서비스와 동일) ===== */
    .modal-header {
        align-items: center;
        text-align: center;
    }

    .modal-header h2 {
        justify-content: center;
    }

    .modal-subtitle {
        padding-left: 0;
        text-align: center;
    }
}

@media (max-width: 736px) {
    .avatar-image-wrapper {
        height: 600px;
        min-height: 600px; /* ✅ 최소 높이 고정 */
        max-width: 450px;
        aspect-ratio: 3 / 4; /* ✅ 비율 강제 고정 */
    }
    
    .style-image-wrapper {
        height: 600px;
        min-height: 600px; /* ✅ 최소 높이 고정 */
        max-width: 450px;
        aspect-ratio: 3 / 4; /* ✅ 비율 강제 고정 */
    }
    
    .bottom-chat-wrapper {
        max-width: 450px;
    }
    
    .social-share-wrapper {
        max-width: 450px;
    }
    
    .style-dropdown-top {
        min-width: 120px;
        font-size: 0.8rem;
        padding: 0.45rem 1.75rem 0.45rem 0.75rem;
    }
    
    .btn-create-top {
        padding: 0.45rem 1rem;
        font-size: 0.75rem;
    }
    
    .btn-create-top i {
        display: none;
    }
    
    .chat-input-row {
        gap: 0.4rem;
    }
    
    .chat-input-hedra {
        padding: 0.55rem 0.85rem;
        font-size: 0.85rem;
    }
    
    .btn-voice-mic {
        width: 38px;
        height: 36px;
        font-size: 0.95rem;
        border-radius: 9px;
    }
    
    .btn-chat-send {
        padding: 0 1.25rem;
        font-size: 0.85rem;
        height: 36px;
        border-radius: 18px;
    }
    
    .title {
        font-size: 1.75rem;
        flex-direction: row;
        flex-wrap: nowrap;
        gap: 0.35rem;
        align-items: flex-start;
    }
    
    /* ✅ 모바일: BETA 뱃지를 윗첨자처럼 표시 */
    .title .beta-badge {
        font-size: 0.5rem;
        padding: 0.15rem 0.4rem;
        align-self: flex-start;
        margin-top: 0.15rem;
    }
    
    .avatar-gallery {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    
    /* 모달 내부 업로드 영역 반응형 (3:4 비율 유지) */
    .upload-area {
        height: 400px;
        max-width: 100%;
        width: calc(100% - 2rem);
    }
    
    /* image-preview는 absolute로 부모를 꽉 채우므로 별도 크기 지정 불필요 */
    
    .face-guide-circle {
        width: 200px;
        height: 255px;
    }
}

/* 추가: 모바일 화면 (768px 이하) */
@media (max-width: 768px) {
    .avatar-container {
        overflow: visible;
    }

    .hedra-container {
        padding: 1rem 0.5rem;
        gap: 1rem;
        overflow: visible;
    }
    
    .avatar-image-wrapper {
        height: 500px;
        min-height: 500px; /* ✅ 최소 높이 고정 */
        max-width: 375px;
        aspect-ratio: 3 / 4; /* ✅ 비율 강제 고정 */
        overflow: hidden;
    }
    
    .style-image-wrapper {
        height: 500px;
        min-height: 500px; /* ✅ 최소 높이 고정 */
        max-width: 375px;
        aspect-ratio: 3 / 4; /* ✅ 비율 강제 고정 */
        overflow: hidden;
    }

    .main-image-stage {
        overflow: visible;
    }
    
    .bottom-chat-wrapper {
        max-width: 375px;
    }
    
    .social-share-wrapper {
        max-width: 375px;
    }
    
    .share-icon-circle {
        width: 44px !important;
        height: 44px !important;
        min-width: 44px !important;
        min-height: 44px !important;
        max-width: 44px !important;
        max-height: 44px !important;
        font-size: 1.2rem;
    }
    
    .share-label {
        font-size: 0.55rem;
        letter-spacing: -0.03em;
    }
    
    .chat-input-row {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }

    .btn-style-label {
        width: 100%;
        text-align: center;
    }
    
    .chat-input-hedra {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }
    
    .btn-voice-mic {
        width: 36px;
        height: 34px;
        font-size: 0.9rem;
    }
    
    .btn-chat-send {
        padding: 0 1rem;
        font-size: 0.8rem;
        height: 34px;
    }
    
    /* 모달 내부 업로드 영역 반응형 (3:4 비율 유지) */
    .upload-area {
        height: 450px;
        max-width: 100%;
        width: calc(100% - 2rem);
        padding: 1.5rem;
    }
    
    /* image-preview는 absolute로 부모를 꽉 채우므로 별도 크기 지정 불필요 */
    
    .face-guide-circle {
        width: 180px;
        height: 230px;
    }
    
    .upload-icon {
        font-size: 3rem;
    }
    
    .upload-text {
        font-size: 1rem;
    }
    
    .avatar-gallery {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: var(--spacing-sm);
    }
}

/* ===== 반응형: 참고 이미지 오버레이 ===== */
@media (max-width: 768px) {
    /* 참고 이미지 오버레이만 조정 (style-image-wrapper 크기는 상위 미디어 쿼리에서 설정) */
    .reference-image-overlay {
        width: 100px;
        bottom: 10px;
        right: 10px; /* ✅ 메인 이미지 우측 끝에서 약간 여백 */
    }
    
    .reference-image-body {
        width: 100px;
        height: 133px; /* 3:4 비율 유지 */
    }
    
    .reference-label {
        font-size: 0.55rem;
    }
    
    .btn-remove-reference {
        width: 20px;
        height: 20px;
        min-width: 20px;
        min-height: 20px;
        font-size: 0.6rem;
        aspect-ratio: 1 / 1;
        box-sizing: border-box;
    }
    
    .reference-image-header {
        padding: 5px 8px;
    }
    
    .reference-zoom-hint {
        width: 20px;
        height: 20px;
        font-size: 0.55rem;
    }
    
    .btn-close-reference-modal {
        width: 35px;
        height: 35px;
        top: -35px;
        font-size: 1.3rem;
    }
}

/* ===== 반응형: 더 작은 모바일 화면 ===== */
@media (max-width: 480px) {
    /* ✅ 480px 이하에서 아바타 서비스와 동일한 크기 */
    .style-image-wrapper {
        height: 450px;
        min-height: 450px;
        max-width: 340px;
        aspect-ratio: 3 / 4;
    }

    .bottom-chat-wrapper {
        max-width: 340px;
    }
    
    .social-share-wrapper {
        max-width: 340px;
        padding: 0 0.15rem;
    }
    
    .social-share-btn {
        width: 45px;
        min-width: 45px;
        max-width: 45px;
    }
    
    .share-icon-circle {
        width: 32px !important;
        height: 32px !important;
        min-width: 32px !important;
        min-height: 32px !important;
        max-width: 32px !important;
        max-height: 32px !important;
        font-size: 0.9rem;
    }
    
    .share-label {
        font-size: 0.42rem;
        letter-spacing: -0.05em;
    }
    
    .social-share-row {
        gap: 0.15rem;
    }

    .reference-image-overlay {
        width: 85px;
        bottom: 8px;
        right: 8px; /* ✅ 모바일에서도 일관된 여백 */
    }
    
    .reference-image-body {
        width: 85px;
        height: 113px; /* 3:4 비율 유지 */
    }
    
    .reference-label {
        font-size: 0.5rem;
    }
    
    .btn-remove-reference {
        width: 18px;
        height: 18px;
        min-width: 18px;
        min-height: 18px;
        font-size: 0.55rem;
        aspect-ratio: 1 / 1;
        box-sizing: border-box;
    }
    
    .reference-image-header {
        padding: 4px 6px;
    }

    /* 480px 이하에서 face-guide-circle 크기 (getavata.css와 동일) */
    .face-guide-circle {
        width: 160px;
        height: 200px;
    }

    /* ===== 모바일 업로드 모달 텍스트 중앙 정렬 및 한 줄 표시 ===== */
    .modal-header {
        align-items: center;
        text-align: center;
        padding: 1.25rem 2.5rem 1rem 2.5rem; /* 좌우 균형 맞춤 */
        flex-direction: column;
        flex-wrap: nowrap;
        justify-content: center;
        position: relative;
    }

    .modal-header h2 {
        font-size: 1.3rem;
        justify-content: center;
        white-space: nowrap;
        width: 100%;
        padding-right: 0;
        margin-bottom: 0.25rem;
        text-align: center;
    }

    .modal-subtitle {
        padding-left: 0;
        text-align: center;
        white-space: nowrap;
        width: 100%;
    }

    /* X 버튼: h2 타이틀과 같은 수평선에, 최대한 우측 배치 (아바타 서비스와 동일) */
    .btn-close {
        position: absolute;
        top: 1.25rem;
        right: 0.5rem;
        width: 32px;
        height: 32px;
        font-size: 1.25rem;
    }

    /* image-preview는 absolute로 부모를 꽉 채우므로 별도 크기 지정 불필요 */

    /* 모달 전체: 카메라/프리뷰 모드와 동일한 70vh 높이 유지 */
    .modal-content {
        max-height: 80vh;
        height: 70vh;
        min-height: 400px;
        overflow-y: hidden;
        padding: 0;
        display: flex;
        flex-direction: column;
    }

    .modal-header {
        padding: 1rem 2.5rem 0.5rem 2.5rem;
        flex-shrink: 0;
    }

    /* 업로드 영역: 남은 공간을 채우고 내용 세로 중앙 정렬 */
    .upload-area {
        flex: 1;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        height: auto;
        min-height: 0;
        max-width: 100%;
        width: calc(100% - 1.5rem);
        margin: 0.5rem auto;
        padding: 0.75rem;
    }

    .modal-actions {
        padding: 0.5rem 0.75rem 0.75rem;
        gap: 0.5rem;
        flex-shrink: 0;
    }

    /* Capture Image 버튼 - 전체 너비, 높이 52px */
    .btn-capture-image {
        height: 52px;
        min-height: 52px;
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
        box-sizing: border-box;
    }

    .btn-cancel,
    .btn-upload {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }

    .upload-text {
        font-size: 0.95rem;
        white-space: nowrap;
    }

    .upload-hint {
        font-size: 0.75rem;
        white-space: nowrap;
    }
}

/* ===== 반응형: 매우 작은 화면 (350px 이하) ===== */
@media (max-width: 350px) {
    .social-share-wrapper {
        max-width: 310px;
        padding: 0 0.1rem;
    }
    
    .social-share-btn {
        width: 40px;
        min-width: 40px;
        max-width: 40px;
    }
    
    .share-icon-circle {
        width: 28px !important;
        height: 28px !important;
        min-width: 28px !important;
        min-height: 28px !important;
        max-width: 28px !important;
        max-height: 28px !important;
        font-size: 0.8rem;
    }
    
    .share-label {
        font-size: 0.38rem;
        letter-spacing: -0.06em;
    }
    
    .social-share-row {
        gap: 0.1rem;
    }
}

/* ===== 반응형: 모바일에서 3개 컨트롤 세로 스택 ===== */
@media (max-width: 768px) {
    .top-controls-wrapper {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .top-left-control,
    .top-center-control,
    .top-right-control {
        flex: 1 1 100%;
        width: 100%;
    }
    
    .style-dropdown-top,
    .btn-create-top {
        width: 100%;
    }

    /* ===== 태블릿 업로드 모달 텍스트 중앙 정렬 ===== */
    .modal-header {
        align-items: center;
        text-align: center;
    }

    .modal-header h2 {
        justify-content: center;
    }

    .modal-subtitle {
        padding-left: 0;
        text-align: center;
    }
}

/* getstyle.html 햄버거 메뉴 및 모바일 네비게이션 스타일 (파일 하단에 추가) */
.mobile-hamburger-wrapper {
  position: fixed;
  top: 1.2rem;
  right: 1.2rem;
  left: auto;
  z-index: 2001;
  display: none;
}
.mobile-hamburger-btn {
  background: none;
  border: none;
  border-radius: 0.6rem;
  width: 32px;
  height: 32px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  box-shadow: none;
  padding: 0;
  transition: transform 0.35s cubic-bezier(0.4,0.2,0.2,1);
}
.mobile-hamburger-btn.rotated {
  transform: rotate(90deg);
}
.hamburger-bar {
  width: 24px;
  height: 0.7px;
  background: rgba(255,255,255,0.7);
  margin: 4px 0;
  border-radius: 2px;
  transition: background 0.18s;
}
.mobile-hamburger-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  max-width: 100vw;
  height: 220px;
  background: linear-gradient(90deg, #8B5CF6 0%, #EC4899 100%);
  backdrop-filter: blur(8px);
  box-shadow: 0 8px 32px rgba(139,92,246,0.13);
  border-bottom-left-radius: 24px;
  border-bottom-right-radius: 24px;
  z-index: 9999;
  display: none;
  animation: fadeInMenu 0.3s ease;
}
@keyframes fadeInMenu {
  from { opacity: 0; transform: translateY(-16px); }
  to { opacity: 1; transform: translateY(0); }
}
.mobile-hamburger-content {
  padding: 28px 18px 0 18px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-height: 140px;
  justify-content: flex-start;
}
.mobile-hamburger-list {
  list-style: none;
  padding: 0;
  margin: 0;
  width: 100%;
  max-width: 100vw;
}
.mobile-hamburger-list li {
  margin-bottom: 0;
  padding: 0;
  width: 100%;
}
.mobile-hamburger-list a {
  font-family: 'Pretendard', 'Montserrat', 'Apple SD Gothic Neo', 'Noto Sans KR', Arial, sans-serif;
  font-size: 1.05rem;
  font-weight: 500;
  color: #fff;
  display: flex;
  align-items: center;
  padding: 12px 0 10px 0;
  letter-spacing: 0.01em;
  border-bottom: none;
  background: none;
  transition: background 0.18s, color 0.18s, box-shadow 0.18s;
  position: relative;
  max-width: 92vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mobile-hamburger-list a:hover {
  background: rgba(255,255,255,0.10);
  color: #E3D6FF;
}
.menu-close-x {
  position: absolute;
  top: 12px;
  right: 18px;
  color: #fff;
  font-size: 1.5rem;
  font-weight: 600;
  background: none;
  border: none;
  box-shadow: none;
  cursor: pointer;
  line-height: 1;
  text-align: center;
  z-index: 1001;
}
@media (max-width: 900px) {
  .mobile-hamburger-wrapper { display: block; }
  .mobile-hamburger-list a.active {
    font-weight: 800;
    color: #fff !important;
    background: rgba(162,89,255,0.13);
    border-radius: 0.9em;
    position: relative;
    box-shadow: none;
    padding-left: 1.2em;
    /* 좌측 컬러 바 */
  }
  .mobile-hamburger-list a.active::before {
    content: '';
    display: block;
    position: absolute;
    left: 0.3em;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 1.7em;
    border-radius: 3px;
    background: linear-gradient(180deg, #a259ff 0%, #6a00f4 100%);
    box-shadow: 0 0 6px 1px #a259ff44;
  }
}

/* ================================================================
   📸 카메라/미리보기 모드 - 전 해상도 공통 (Galaxy Z Fold 포함)
   .camera-active / .preview-active 클래스가 있을 때만 적용되므로
   일반 모달 레이아웃에는 영향 없음
   ================================================================ */

/* ===== 카메라 모드 (공통) ===== */
.upload-modal.camera-active .modal-content {
    overflow: hidden;
    width: min(600px, 90vw);
    max-width: none;
    aspect-ratio: 3 / 4;
    height: auto;
    min-height: unset;
    max-height: 90vh;
}

.upload-modal.camera-active .modal-header {
    display: none !important;
}

.upload-modal.camera-active .btn-close {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10100;
    display: flex !important;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    width: 36px;
    height: 36px;
    font-size: 1.3rem;
    opacity: 1;
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
}

.upload-modal.camera-active .btn-close:hover {
    background: rgba(0, 0, 0, 0.7);
}

.upload-modal.camera-active .upload-area {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    border-radius: inherit;
    background: #000;
    display: flex;
    flex-direction: column;
}

.upload-modal.camera-active #cameraArea {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    border-radius: inherit;
    display: flex !important;
    align-items: center;
    justify-content: center;
    background: #000;
}

.upload-modal.camera-active #cameraArea video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    -webkit-object-fit: cover;
    transform: scaleX(-1); /* 전면 카메라 좌우 반전 (거울 효과) */
}

.upload-modal.camera-active .face-guide-circle {
    width: 230px;
    height: 310px;
    border: 2px solid rgba(183, 78, 145, 0.8);
    box-shadow: 
        0 0 0 9999px rgba(0, 0, 0, 0.3),
        0 0 15px rgba(183, 78, 145, 0.5),
        inset 0 0 15px rgba(183, 78, 145, 0.2);
}

.upload-modal.camera-active .modal-actions {
    position: absolute !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    padding: 15px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.6) 0%, transparent 100%);
    border: none !important;
    z-index: 10050;
    display: flex;
    justify-content: center;
    gap: 15px;
    border-radius: 0 0 inherit inherit;
}

.upload-modal.camera-active .btn-take-photo {
    flex: 0 0 auto;
    min-width: 220px;
    height: 52px;
    padding: 0 40px;
    font-size: 1rem;
    border-radius: 25px;
    background: linear-gradient(135deg, #5e42a6 0%, #b74e91 100%);
    color: white;
    border: none;
    font-weight: 500;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
}

.upload-modal.camera-active .btn-capture-image {
    display: none !important;
}

/* ===== 미리보기 모드 (공통) ===== */
.upload-modal.preview-active .modal-content {
    overflow: hidden;
    width: min(600px, 90vw);
    max-width: none;
    aspect-ratio: 3 / 4;
    height: auto;
    min-height: unset;
    max-height: 90vh;
}

.upload-modal.preview-active .modal-header {
    display: none !important;
}

.upload-modal.preview-active .btn-close {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10100;
    display: flex !important;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    width: 36px;
    height: 36px;
    font-size: 1.3rem;
    opacity: 1;
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
}

.upload-modal.preview-active .upload-area {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    border-radius: inherit;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.upload-modal.preview-active .image-preview {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    border-radius: inherit;
    display: flex !important;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.upload-modal.preview-active .image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: inherit;
}

.upload-modal.preview-active .modal-actions {
    position: absolute !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    padding: 15px 20px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7) 0%, transparent 100%);
    border: none !important;
    z-index: 10050;
    display: flex;
    flex-direction: row;
    justify-content: center;
    gap: 12px;
    border-radius: 0 0 inherit inherit;
}

.upload-modal.preview-active .btn-retake-photo {
    flex: 1;
    max-width: 160px;
    height: 52px;
    padding: 0 20px;
    font-size: 0.95rem;
    font-weight: 500;
    border-radius: 25px;
    background: rgba(94, 66, 166, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    backdrop-filter: blur(5px);
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
}

.upload-modal.preview-active .btn-retake-photo:hover {
    background: rgba(94, 66, 166, 0.5);
}

.upload-modal.preview-active .btn-use-image {
    flex: 1;
    max-width: 160px;
    height: 52px;
    padding: 0 20px;
    font-size: 0.95rem;
    font-weight: 500;
    border-radius: 25px;
    background: linear-gradient(135deg, #5e42a6 0%, #b74e91 100%);
    border: none;
    color: white;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
}

.upload-modal.preview-active .btn-use-image:hover {
    background: linear-gradient(135deg, #6b4db8 0%, #c45a9e 100%);
}

/* ===== 모바일 카메라/미리보기 모드 - 작은 화면 세부 조정 ===== */
@media (max-width: 768px) {
    
    /* ===== 카메라 모드 ===== */
    /* 모달 컨텐츠 - 모바일에서는 너비 기반 + 세로 비율 */
    .upload-modal.camera-active .modal-content {
        overflow: hidden;
        width: 92vw;
        max-width: none;
        aspect-ratio: 3 / 4;
        height: auto;
        min-height: unset;
        max-height: 90vh;
    }
    
    /* 모달 헤더 숨김 */
    .upload-modal.camera-active .modal-header {
        display: none !important;
    }

    /* X 버튼 - 모달 내부 우측 상단에 표시 (헤더 밖에 있으므로 항상 보임) */
    .upload-modal.camera-active .btn-close {
        position: absolute;
        top: 10px;
        right: 10px;
        z-index: 10100;
        display: flex !important;
        background: rgba(0, 0, 0, 0.5);
        color: white;
        width: 36px;
        height: 36px;
        font-size: 1.3rem;
        opacity: 1;
        border-radius: 50%;
        align-items: center;
        justify-content: center;
        border: none;
        cursor: pointer;
    }

    .upload-modal.camera-active .btn-close:hover {
        background: rgba(0, 0, 0, 0.7);
    }

    /* 업로드 영역이 모달 전체를 채움 (헤더 영역 포함) */
    .upload-modal.camera-active .upload-area {
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100% !important;
        height: 100% !important;
        max-width: none !important;
        max-height: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        border: none !important;
        border-radius: inherit;
        background: #000;
        display: flex;
        flex-direction: column;
    }

    /* 카메라 영역 스타일 */
    .upload-modal.camera-active #cameraArea {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        height: 100%;
        border-radius: inherit;
        display: flex !important;
        align-items: center;
        justify-content: center;
        background: #000;
    }
    
    .upload-modal.camera-active #cameraArea video {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    /* 분홍색 얼굴 가이드 */
    .upload-modal.camera-active .face-guide-circle {
        width: 200px;
        height: 280px;
        border: 2px solid rgba(183, 78, 145, 0.8);
        box-shadow: 
            0 0 0 9999px rgba(0, 0, 0, 0.3),
            0 0 15px rgba(183, 78, 145, 0.5),
            inset 0 0 15px rgba(183, 78, 145, 0.2);
    }

    /* 액션 버튼 영역 - 모달 하단에 위치 */
    .upload-modal.camera-active .modal-actions {
        position: absolute !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        padding: 15px;
        background: linear-gradient(to top, rgba(0, 0, 0, 0.6) 0%, transparent 100%);
        border: none !important;
        z-index: 10050;
        display: flex;
        justify-content: center;
        gap: 15px;
        border-radius: 0 0 inherit inherit;
    }

    /* Take Photo 버튼 스타일 - 가로 더 넓게, 높이 통일 */
    .upload-modal.camera-active .btn-take-photo {
        flex: 0 0 auto;
        min-width: 220px;
        height: 52px;
        padding: 0 40px;
        font-size: 1rem;
        border-radius: 25px;
        background: linear-gradient(135deg, #5e42a6 0%, #b74e91 100%);
        color: white;
        border: none;
        font-weight: 500;
        box-sizing: border-box;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Capture Image 버튼 숨김 (카메라 모드에서는 Take Photo만 표시) */
    .upload-modal.camera-active .btn-capture-image {
        display: none !important;
    }

    /* ===== 미리보기 모드 ===== */
    /* 모달 컨텐츠 - 모바일에서는 너비 기반 + 세로 비율 */
    .upload-modal.preview-active .modal-content {
        overflow: hidden;
        width: 92vw;
        max-width: none;
        aspect-ratio: 3 / 4;
        height: auto;
        min-height: unset;
        max-height: 90vh;
    }
    
    /* 모달 헤더 숨김 */
    .upload-modal.preview-active .modal-header {
        display: none !important;
    }

    /* X 버튼 - 모달 내부 우측 상단에 표시 */
    .upload-modal.preview-active .btn-close {
        position: absolute;
        top: 10px;
        right: 10px;
        z-index: 10100;
        display: flex !important;
        background: rgba(0, 0, 0, 0.5);
        color: white;
        width: 36px;
        height: 36px;
        font-size: 1.3rem;
        opacity: 1;
        border-radius: 50%;
        align-items: center;
        justify-content: center;
        border: none;
        cursor: pointer;
    }

    /* 업로드 영역이 모달 전체를 채움 */
    .upload-modal.preview-active .upload-area {
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100% !important;
        height: 100% !important;
        max-width: none !important;
        max-height: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        border: none !important;
        border-radius: inherit;
        background: #000;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* 미리보기 이미지 스타일 - 모달 전체를 채움 */
    .upload-modal.preview-active .image-preview {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        height: 100%;
        border-radius: inherit;
        display: flex !important;
        align-items: center;
        justify-content: center;
        overflow: hidden;
    }

    .upload-modal.preview-active .image-preview img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        border-radius: inherit;
    }

    /* 미리보기 모드 액션 버튼 - 모달 하단에 위치, 일렬 배치 */
    .upload-modal.preview-active .modal-actions {
        position: absolute !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        padding: 15px 20px;
        background: linear-gradient(to top, rgba(0, 0, 0, 0.7) 0%, transparent 100%);
        border: none !important;
        z-index: 10050;
        display: flex;
        flex-direction: row;
        justify-content: center;
        gap: 12px;
        border-radius: 0 0 inherit inherit;
    }

    /* Retake Photo 버튼 - 반투명 어두운 배경 (서비스 색상 조화) */
    .upload-modal.preview-active .btn-retake-photo {
        flex: 1;
        max-width: 160px;
        height: 52px;
        padding: 0 20px;
        font-size: 0.95rem;
        font-weight: 500;
        border-radius: 25px;
        background: rgba(94, 66, 166, 0.3);
        border: 1px solid rgba(255, 255, 255, 0.3);
        color: white;
        backdrop-filter: blur(5px);
        box-sizing: border-box;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .upload-modal.preview-active .btn-retake-photo:hover {
        background: rgba(94, 66, 166, 0.5);
    }

    /* Use Image 버튼 - Take Photo와 동일한 그라데이션 */
    .upload-modal.preview-active .btn-use-image {
        flex: 1;
        max-width: 160px;
        height: 52px;
        padding: 0 20px;
        font-size: 0.95rem;
        font-weight: 500;
        border-radius: 25px;
        background: linear-gradient(135deg, #5e42a6 0%, #b74e91 100%);
        border: none;
        color: white;
        box-sizing: border-box;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .upload-modal.preview-active .btn-use-image:hover {
        background: linear-gradient(135deg, #6b4db8 0%, #c45a9e 100%);
    }
}

/* ================================================================
   📱 Galaxy Z Fold7 폴더블 - getstyle 페이지 최적화
   펼친 화면에서 레이아웃 조정 (화면 전체 활용)
   ================================================================ */

/* 폴더블 펼친 화면: 가로 모드 (landscape) - 헤더 텍스트 너비에 맞춤 */
@media screen and (min-width: 600px) and (max-width: 1000px) and (orientation: landscape) {
    /* 컨테이너를 화면 중앙에 배치 */
    .avatar-container {
        max-width: 100% !important;
        width: 100% !important;
        padding: 1rem 2rem !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
    }
    
    /* hedra-container - 헤더 텍스트 너비에 맞춤 (Create AI Style + BETA 뱃지) */
    .hedra-container {
        max-width: 560px !important;
        width: 100% !important;
        padding: 1rem !important;
        margin: 0 auto !important;
    }
    
    /* 이미지 래퍼 - 헤더 텍스트 너비에 맞추고 3:4 비율 유지 */
    .style-image-wrapper,
    .avatar-image-wrapper {
        max-width: 560px !important;
        width: 100% !important;
        height: auto !important;
        min-height: unset !important;
        max-height: 70vh !important;
        aspect-ratio: 3 / 4 !important;
        margin: 0 auto !important;
    }
    
    /* 컨트롤 래퍼 - 이미지와 같은 너비, 가로 배치 강제 */
    .top-controls-wrapper {
        max-width: 560px !important;
        width: 100% !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        gap: 0.75rem !important;
        justify-content: space-between !important;
        margin-bottom: 1rem !important;
    }
    
    /* 드롭다운 - 여유있게, 가로 배치 */
    .top-left-control,
    .top-center-control {
        flex: 1 1 auto !important;
        width: auto !important;
        min-width: 140px !important;
        max-width: 180px !important;
    }
    
    /* CREATE 버튼 */
    .top-right-control {
        flex: 1 1 auto !important;
        width: auto !important;
        min-width: 150px !important;
        max-width: 180px !important;
    }
    
    /* 드롭다운과 버튼 너비 자동 */
    .style-dropdown-top,
    .btn-create-top {
        width: 100% !important;
    }
    
    /* 헤더 조정 */
    .avatar-header {
        margin-bottom: 1rem !important;
        padding: 1rem 0 !important;
        width: 100% !important;
    }
    
    .title {
        font-size: 2rem !important;
    }
    
    .subtitle {
        font-size: 1rem !important;
    }
}

/* 폴더블: 채팅 열렸을 때 - 전체화면 채팅 */
@media screen and (min-width: 600px) and (max-width: 1000px) and (orientation: landscape) {
    body.chat-open .avatar-container {
        display: none !important;
        width: 0 !important;
    }
    
    body.chat-open .chat-slide-panel {
        width: 100% !important;
    }
}

/* 스타일 서비스: 채팅 버튼 비표시 (로직 유지, 화면만 숨김). 다시 보이게 하려면 getstyle.html에서 .hide-chat-icon 제거 */
.icon-menu-container.hide-chat-icon .icon-menu-btn.chat-icon {
    display: none !important;
}
