
.code-scroll::-webkit-scrollbar {
    height: 8px;
}
.code-scroll::-webkit-scrollbar-track {
    background: #1e1e1e;
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
}
.code-scroll::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 4px;
}
.code-scroll::-webkit-scrollbar-thumb:hover {
    background: #666;
}

body { 
    background-color: #050505; 
    color: white; 
    margin: 0; 
    width: 100vw; 
    height: 100vh; 
    height: 100dvh; 
    overflow: hidden; 
    display: flex; 
    flex-direction: column; 
    transition: all 0.5s ease;
    padding-bottom: env(safe-area-inset-bottom, 20px); 
}

body.started #middle-zone { 
    flex: 0 0 auto; 
    justify-content: flex-end; 
    padding-bottom: clamp(20px, 5dvh, 40px); 
}

#app-container {
    width: 100%;
    padding: 0 4px;
    margin-top: 8px;
    margin-bottom: 4px;
}

.island-box {
    margin-bottom: 10px;
}

        #star-canvas { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; }
        
        .no-scrollbar::-webkit-scrollbar { display: none; }
        .no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

        #custom-scrollbar { position: absolute; right: 6px; top: 20px; bottom: 20px; width: 4px; z-index: 60; display: none; pointer-events: none; }
        #scroll-thumb { position: absolute; width: 8px; height: 8px; right: -2px; background: white; border-radius: 50%; box-shadow: 0 0 10px 2px rgba(255,255,255,0.8); cursor: pointer; pointer-events: auto; transition: transform 0.1s; }
        #scroll-thumb:hover, #scroll-thumb.dragging { transform: scale(1.5); }

        #main-layout { display: flex; width: 100%; height: 100%; position: relative; transition: all 0.5s ease; }
        
        #left-panel { flex: 1; display: flex; flex-direction: column; height: 100%; position: relative; transition: all 0.5s ease; justify-content: center; }
        #right-panel { flex: 0; width: 0; opacity: 0; overflow: hidden; border-left: 1px solid rgba(255,255,255,0.1); background: #0a0a0a; transition: all 0.5s ease; display: flex; flex-direction: column; }
        
        body.mode-code #left-panel { flex: 0 0 50%; }
        body.mode-code #right-panel { flex: 1; opacity: 1; width: auto; padding: 20px; }

        body:not(.started) #top-zone { flex: 0 0 0; opacity: 0; height: 0; padding: 0; overflow: hidden; }
        body:not(.started) #middle-zone { flex: 1; justify-content: center; padding-bottom: 20px; } 

        body.started #top-zone { flex: 1; min-height: 0; opacity: 1; padding-bottom: 12px; } 
        body.started #middle-zone { flex: 0 0 auto; justify-content: flex-end; padding-bottom: 20px; } 

        #top-zone { width: 100%; max-width: 600px; margin: 0 auto; display: flex; flex-direction: column; position: relative; transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1); }
        
        #middle-zone { width: 90%; max-width: 600px; margin: 0 auto; display: flex; flex-direction: column; z-index: 50; transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1); }

        .island-box {
            width: 100%; background: rgba(10, 10, 10, 0.85); backdrop-filter: blur(40px);
            box-shadow: 0 0 25px rgba(255, 255, 255, 0.12); border-radius: 28px;
            position: relative; overflow: hidden; transition: transform 0.3s;
			border: 1px solid rgba(255, 255, 255, 0.1)
        }

        #loader-overlay { position: absolute; inset: 0; border-radius: 28px; background: rgba(255, 255, 255, 0.9); display: flex; align-items: center; justify-content: center; z-index: 100; opacity: 0; pointer-events: none; transition: opacity 0.3s; box-shadow: 0 0 50px 10px rgba(255,255,255,0.6); }
        #loader-overlay.active { opacity: 1; pointer-events: auto; animation: white-glow 1.5s infinite alternate; }
        @keyframes white-glow { from { box-shadow: 0 0 20px rgba(255,255,255,0.5); } to { box-shadow: 0 0 60px rgba(255,255,255,0.9); } }

        .app-grid {
            width: 100%; 
            display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); 
            gap: 12px; justify-items: center;
            max-height: 100px; overflow: hidden; 
            margin-top: 20px; 
            transition: opacity 0.3s;
        }
        
        .app-item { width: 44px; height: 44px; border-radius: 50%; box-shadow: 0 0 5px rgba(255, 255, 255, 0.12); background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.08); display: flex; align-items: center; justify-content: center; cursor: pointer; transition: all 0.2s; }
        .app-item:hover { background: rgba(255,255,255,0.2)}
        .app-item img { width: 22px; height: 22px; border-radius: 50%; opacity: 0.85; }

        .btn-icon { color: rgba(255,255,255,0.3); transition: all 0.2s; display: flex; align-items: center; justify-content: center; }
        .btn-icon:hover, .btn-icon.active { color: white; transform: scale(1.1); text-shadow: 0 0 10px white; }
        .btn-submit { background: white; color: black; border-radius: 50%; transition: all 0.2s; }
        .btn-submit:hover { transform: scale(1.05); box-shadow: 0 0 15px rgba(255,255,255,0.5); }
        .btn-submit.stop-mode { background: #ff4444; color: white; }

        .modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.7); backdrop-filter: blur(5px); z-index: 100; display: flex; align-items: center; justify-content: center; opacity: 0; pointer-events: none; transition: opacity 0.3s; }
        .modal-overlay.show { opacity: 1; pointer-events: auto; }
        .modal-box { background: #151515; border: 1px solid rgba(255,255,255,0.15); border-radius: 24px; padding: 24px; width: 90%; max-width: 320px; text-align: center; transform: scale(0.95); transition: transform 0.3s; box-shadow: 0 20px 50px rgba(0,0,0,0.8); }
        .modal-overlay.show .modal-box { transform: scale(1); }
        
.toast {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(-10px);
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
    color: #333;
    padding: 10px 20px;
    border-radius: 99px;
    font-weight: 400;
    font-size: 0.8rem;
    letter-spacing: 0.03em;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
    z-index: 200;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

        #img-preview-container { margin-top: 15px; width: 100%; display: none; animation: fadeIn 0.3s ease; }
        #img-preview-container.active { display: block; }
        @keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

        .custom-scrollbar-code::-webkit-scrollbar { height: 6px; }
        .custom-scrollbar-code::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 3px; }
        .custom-scrollbar-code::-webkit-scrollbar-track { background: transparent; }

#progress-bar { 
    height: 100%; 
    background: white; 
    width: 0; 
    transition: all 0.3s; 
    box-shadow: 0 0 15px 2px rgba(255, 255, 255, 0.8);
}


@media (max-width: 768px) {
    body.mode-code #left-panel {
        flex: 1 0 100% !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    #right-panel {
        display: none !important;
        width: 0 !important;
        flex: 0 !important;
    }

    #right-panel.mobile-active {
        display: flex !important;
        position: fixed !important;
        top: 0; left: 0; right: 0; bottom: 0;
        width: 100% !important;
        height: 100% !important;
        z-index: 9999 !important;
        background: #151515;
        opacity: 1 !important;
        padding: 0 !important;
        margin: 0 !important;
    }
}







.store-item, .fixed-app-item {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.05);
    border-radius: 12px;
    width: 100%;
    aspect-ratio: 1/1;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid rgba(255,255,255,0.05);
}

.fixed-app-item {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
}

.store-item:hover, .fixed-app-item:hover { 
    background: rgba(255,255,255,0.15); 
    transform: scale(1.05); 
    border-color: rgba(255,255,255,0.2);
}

.store-item img, .fixed-app-item img, .fixed-app-item i {
    width: 50%;
    height: 50%; 
    object-fit: contain; 
    transition: transform 0.2s;
    filter: brightness(0) invert(1);
    opacity: 0.8;
}

.store-item:hover img, .fixed-app-item:hover img {
    opacity: 1;
}

.store-item span { display: none; }

.fixed-delete-btn {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 18px;
    height: 18px;
    background: #ef4444; 
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0; 
    transform: scale(0.8);
    transition: all 0.2s;
    z-index: 10;
    border: 1px solid rgba(255,255,255,0.2);
}

.fixed-delete-btn i {
    font-size: 12px;
    width: auto !important;
    height: auto !important;
    filter: none !important; 
}

.fixed-app-item:hover .fixed-delete-btn {
    opacity: 1;
    transform: scale(1);
}

#store-panel {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: all 0.3s ease-in-out;
    margin: 0;
    padding: 0 16px;
}

#store-panel.open {
    max-height: 800px;
    opacity: 1;
    margin-top: 8px;
    margin-bottom: 8px;
    padding-bottom: 8px;
}

#store-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr)); 
    gap: 10px;
    max-height: 350px; 
    overflow-y: auto;
    padding: 4px;
    padding-right: 8px;
}

#store-grid::-webkit-scrollbar {
    width: 6px;
    display: block; 
}
#store-grid::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.05);
    border-radius: 3px;
}
#store-grid::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.3);
    border-radius: 3px;
}
#store-grid::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.5);
}
/* [추가] 첫 글자 아이콘 스타일 */
.app-letter-icon {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 800;
    color: white;
    border-radius: 12px;
    text-transform: uppercase;
    position: absolute; /* 겹치기 위해 절대 위치 */
    top: 0;
    left: 0;
    z-index: 0; /* 이미지 뒤에 위치 */
}

/* 이미지는 글자 위에 떠야 함 */
.store-item img, .fixed-app-item img {
    /* 기존: filter: brightness(0) invert(1);  <-- 이거 삭제하거나 아래처럼 덮어쓰기 */
    filter: none !important; 
    width: 100%;
    height: 100%;
    object-fit: cover; /* 꽉 차게 */
    opacity: 1;
}

/* (참고) 삭제 버튼 아이콘 등은 여전히 흰색이어야 할 수 있으므로 확인 필요 */
.fixed-delete-btn i {
    filter: none;
}
/* [수정] 카테고리 필터 버튼 (아이콘 전용 스타일) */
.store-filter-btn {
    width: 36px;          /* 고정 너비 */
    height: 36px;         /* 고정 높이 */
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;  /* 둥근 사각형 */
    color: #888;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.05);
    transition: all 0.2s;
    flex-shrink: 0;       /* 찌그러짐 방지 */
}

.store-filter-btn:hover {
    background: rgba(255,255,255,0.15);
    color: white;
    transform: scale(1.05); /* 살짝 커지는 효과 */
}

.store-filter-btn.active {
    background: white;
    color: black;
    border-color: white;
}


body {
    width: 100%;
    overflow-x: hidden;
}

@media (max-width: 768px) {
    #middle-zone {
        width: 100%;
        max-width: 100vw;
        margin: 0 auto;
        padding-left: 12px;
        padding-right: 12px;
    }

    .island-box, textarea, #store-category-filters {
        max-width: 100%;
    }
}