/* =========================================================
   [달팁 시크릿 힌트] 스타일 통합 파일 (secret-profile.css)
   ========================================================= */

/* ---------------------------------------------------------
   1. [공통] 캔버스 및 프로필 영역 
   --------------------------------------------------------- */
.secret-canvas-wrapper {
    padding: 20px 16px 10px;
    background: transparent;
    display: flex;
    justify-content: center;
    align-items: center;
}
@media (min-width: 768px) {
    .secret-canvas-wrapper { padding: 30px 24px 20px; }
}

.secret-canvas-container {
    width: 320px;
    height: 440px;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    transform-origin: center center; 
}

.secret-profile-canvas { 
    width: 320px; height: 440px; 
    position: relative; 
    border-radius: 24px; 
    box-shadow: 0 10px 40px rgba(0,0,0,0.08);
    overflow: hidden; 
    background-color: #fff; 
}

.canvas-element {
    position: absolute; top: 0; left: 0; 
    user-select: none;
    padding: 6px 10px; 
}
.el-text { 
    font-size: 20px; font-weight: 700; color: #111; 
    line-height: 1.4; white-space: pre-wrap; word-break: break-all; 
}
.el-image { 
    padding: 4px; display: flex; justify-content: center; align-items: center; 
}
.el-image img { 
    width: 100%; height: auto; pointer-events: none; 
}




/* ---------------------------------------------------------
   2. [MAIN] 메인 화면 전용 (피드, 바텀시트, 모달 등)
   --------------------------------------------------------- */
.main-app-wrap {
    position: fixed; top: 0; left: 50%; transform: translateX(-50%);
    width: 100%; max-width: 600px; height: 100%; z-index: 9999; 
    background: #0f0f0f; overflow: hidden;
    display: flex; flex-direction: column;
    box-shadow: 0 0 0 100vw rgba(0, 0, 0, 0.8), 0 0 40px rgba(0,0,0,0.5); 
    font-family: -apple-system, BlinkMacSystemFont, "Pretendard", "Apple SD Gothic Neo", sans-serif; 
}

/* 상단 헤더 (공통 .app-header 간섭 완전 분리) */
.main-top-header {
    flex-shrink: 0; height: 48px;
    display: flex; justify-content: space-between; align-items: center;
    padding: 0 16px; background: #0f0f0f; z-index: 50;
}
.main-top-header .title { font-size: 0.95rem; font-weight: 800; margin: 0; color: #f1f1f1; }
.btn-close-app { background: none; border: none; font-size: 1.4rem; color: #f1f1f1; cursor: pointer; padding: 4px; line-height: 1; }

/* 🌟 1. 프로필 영역: 상단 공간의 정중앙에 배치 (잘림 방지) */
.profile-fixed-area {
    position: relative; z-index: 10;
    width: 100%; 
    display: flex; justify-content: center; align-items: center;
    overflow: hidden;
}

/* 메인 화면 안에서만 공통 wrapper 패딩 제거 및 정중앙 정렬 유지 */
.main-app-wrap .secret-canvas-wrapper { 
    width: 100%; height: 100%; padding: 0; 
    display: flex; justify-content: center; align-items: center;
}

/* 우측 플로팅 버튼 그룹 */
.floating-action-group {
    position: absolute; right: 14px; top: 50%; transform: translateY(-50%); z-index: 40;
    display: flex; flex-direction: column; gap: 12px;
}
.floating-btn {
    width: 40px; height: 40px; border-radius: 50%;
    background: rgba(24, 24, 27, 0.75); backdrop-filter: blur(8px);
    color: #fff; border: 1px solid rgba(255,255,255,0.18);
    display: flex; justify-content: center; align-items: center;
    font-size: 1.05rem; cursor: pointer; box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    transition: transform 0.2s; text-decoration: none;
}
.floating-btn:active { transform: scale(0.9); }
.floating-btn-label {
    font-size: 0.68rem; font-weight: 700; color: #e4e4e7; text-shadow: 0 1px 3px rgba(0,0,0,0.9);
    margin-top: 3px; text-align: center;
}
.floating-item { display: flex; flex-direction: column; align-items: center; }

/* 🌟 2. 바텀 시트 (댓글 피드 영역) */
.feed-bottom-sheet {
    position: absolute; bottom: 0; left: 0; right: 0;
    height: 42vh;
    background: #212121;
    border-top-left-radius: 20px; border-top-right-radius: 20px;
    z-index: 50; display: flex; flex-direction: column;
    transition: height 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    box-shadow: 0 -10px 40px rgba(0,0,0,0.5);
}
.feed-bottom-sheet.expanded { height: 90vh !important; }

.sheet-header-handle {
    width: 100%; padding: 12px 0 16px; display: flex; justify-content: center; align-items: center;
    cursor: pointer; flex-shrink: 0; position: relative;
}
.sheet-handle-bar {
    width: 36px; height: 4px; background: rgba(255, 255, 255, 0.3); border-radius: 4px; transition: 0.2s;
}
.sheet-header-handle:active .sheet-handle-bar { background: rgba(255, 255, 255, 0.6); width: 44px; }

.feed-header-info { 
    display: flex; justify-content: space-between; align-items: center; 
    padding: 0 20px 10px; border-bottom: 1px solid rgba(255,255,255,0.05); flex-shrink: 0;
}
.feed-title { font-size: 1rem; font-weight: 800; color: #f1f1f1; margin: 0; }
.coin-badge { 
    background: rgba(255,255,255,0.08); color: #fde047; font-size: 0.8rem; font-weight: 800; 
    padding: 5px 10px; border-radius: 12px; text-decoration: none; display: flex; align-items: center; 
}

.feed-scroll-content {
    flex: 1; overflow-y: auto; padding-bottom: 40px;
    -ms-overflow-style: none; scrollbar-width: none;
}
.feed-scroll-content::-webkit-scrollbar { display: none; }

.msg-list-item { padding: 8px 16px; border-bottom: 1px solid rgba(255,255,255,0.05); }
.msg-content-flex { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.msg-text-bubble { 
    flex: 1; background: transparent; padding: 0;
    font-size: 0.88rem; font-weight: 600; color: #e4e4e7; line-height: 1.45; word-break: break-word; margin: 0;
}

.btn-unlock-icon {
    flex-shrink: 0; width: 32px; height: 32px; border-radius: 8px;
    background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1);
    color: #f87171; display: flex; justify-content: center; align-items: center;
    cursor: pointer; transition: 0.2s; font-size: 0.9rem;
}
.btn-unlock-icon:active { transform: scale(0.9); background: rgba(255,255,255,0.15); }
.btn-unlock-icon.opened { 
    color: #3ea6ff; 
    background: rgba(62, 166, 255, 0.1); 
    border-color: rgba(62, 166, 255, 0.3); 
}

.hint-badge-group { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.hint-badge.opened { 
    background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.1); color: #ccc; 
    font-size: 0.7rem; font-weight: 700; padding: 4px 10px; border-radius: 8px; display: inline-flex; align-items: center; 
}
.hint-badge.opened i { margin-right: 4px; font-size: 0.75rem; color: #3ea6ff; } 

/* 해금 & 전체보기 모달 */
.unlock-modal-content { background: #212121; color: #fff; border: 1px solid rgba(255,255,255,0.1); border-radius: 16px; }
.unlock-modal-header { border-bottom: 1px solid rgba(255,255,255,0.1); padding: 14px 16px; }
.unlock-modal-title { font-size: 0.95rem; font-weight: 800; }
.unlock-item { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-bottom: 1px solid rgba(255,255,255,0.05); cursor: pointer; }
.unlock-item:active { background: rgba(255,255,255,0.05); }
.unlock-item:last-child { border-bottom: none; }
.unlock-text { font-size: 0.9rem; font-weight: 700; color: #f1f1f1; }
.unlocked-done { 
    background: rgba(62, 166, 255, 0.06) !important; 
    cursor: default; 
    opacity: 1; 
}
.unlocked-done .unlock-text { color: #ffffff; }

.full-profile-modal-body {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 16px 12px 24px; background: #141417; border: 1px solid rgba(255,255,255,0.12);
    border-radius: 24px; position: relative; box-shadow: 0 20px 50px rgba(0,0,0,0.6);
}




/* ---------------------------------------------------------
   3. [EDIT] 편집 화면 전용 (바텀시트 오버레이 적용)
   --------------------------------------------------------- */
.edit-master-wrap { 
    position: fixed; top: 0; bottom: 0; left: 50%; transform: translateX(-50%);
    width: 100%; max-width: 600px; z-index: 9999; 
    font-family: -apple-system, BlinkMacSystemFont, "Pretendard", "Apple SD Gothic Neo", sans-serif; 
    background: #f8fafc; 
    display: flex; flex-direction: column;
    box-shadow: 0 0 0 100vw rgba(0, 0, 0, 0.7), 0 0 40px rgba(0,0,0,0.2); 
}

.app-header {
    flex-shrink: 0; display: flex; justify-content: space-between; align-items: center;
    padding: 10px 16px; background: rgba(255, 255, 255, 0.95); backdrop-filter: blur(12px);
    border-bottom: 1px solid #e2e8f0; z-index: 10;
}
.app-header .title { font-size: 0.95rem; font-weight: 800; margin: 0; color: #111; }
.app-header .btn-text { background: none; border: none; font-size: 0.9rem; font-weight: 700; cursor: pointer; padding: 4px 8px; }
.btn-cancel { color: #64748b; }
.btn-save { color: #2563eb; }

/* 🌟 프리뷰 영역 (패널에 영향 받지 않고 전체 공간 차지) */
.canvas-section {
    flex: 1; position: relative;
    background: #e2e8f0; 
    overflow: hidden; 
    touch-action: none;
}

.canvas-section .secret-profile-canvas {
    position: absolute;
    /* 패널(190px)의 절반만큼 위로 올려서 시각적인 정중앙에 배치 */
    top: calc(50% - 95px); 
    left: 50%;
    transform-origin: center center;
    touch-action: none;
}

.canvas-section .canvas-element {
    touch-action: none; user-select: none; -webkit-user-select: none;
    cursor: grab; border: 1.5px dashed transparent; border-radius: 8px;
}
.canvas-section .canvas-element:active { cursor: grabbing; }
.canvas-section .canvas-element.is-active {
    border-color: #3b82f6; background: rgba(59, 130, 246, 0.12); z-index: 100 !important;
}

.el-text { min-width: 60px; min-height: 30px; }
.el-text:empty::before { content: attr(data-placeholder); color: #94a3b8; opacity: 0.7; }

/* 🔥 하단 컨트롤 독: 반투명 오버레이 바텀시트(Bottom Sheet)로 전면 개편 */
.control-panel-wrap {
    position: absolute; bottom: 0; left: 0; right: 0;
    height: 190px; /* 닫혔을 때 기본 높이 */
    background: rgba(15, 15, 18, 0.85); /* 반투명 다크 톤 */
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); /* 2중 레이어 블러 효과 */
    border-top-left-radius: 24px; border-top-right-radius: 24px;
    border-top: 1px solid rgba(255,255,255,0.1);
    z-index: 20; color: #ffffff;
    display: flex; flex-direction: column; box-sizing: border-box;
    transition: height 0.3s cubic-bezier(0.2, 0.8, 0.2, 1); /* 부드러운 슬라이드 애니메이션 */
    box-shadow: 0 -10px 40px rgba(0,0,0,0.1);
}

/* 확장(Expanded) 모드 시 화면의 65%까지 쑥 올라옴 */
.control-panel-wrap.expanded { height: 65vh; }

/* 바텀시트 스와이프 핸들 영역 */
.panel-handle-area {
    width: 100%; height: 20px;
    display: flex; justify-content: center; align-items: center;
    cursor: pointer; flex-shrink: 0;
}
.panel-handle {
    width: 40px; height: 5px;
    background: rgba(255, 255, 255, 0.3); border-radius: 4px;
    transition: background 0.2s, width 0.2s;
}
.panel-handle-area:active .panel-handle { background: rgba(255, 255, 255, 0.6); width: 48px; }

.editor-tabs {
    display: flex; align-items: center; gap: 2px;
    padding: 0 10px; border-bottom: 1px solid rgba(255,255,255,0.05);
    overflow-x: auto; white-space: nowrap; flex-shrink: 0; height: 38px;
    -ms-overflow-style: none; scrollbar-width: none;
}
.editor-tabs::-webkit-scrollbar { display: none; }

.editor-tab-btn {
    background: transparent; border: none; color: #71717a;
    font-size: 0.8rem; font-weight: 700; padding: 8px 12px;
    cursor: pointer; position: relative; transition: color 0.15s;
    display: inline-flex; align-items: center; gap: 5px;
}
.editor-tab-btn.active { color: #ffffff; }
.editor-tab-btn.active::after {
    content: ''; position: absolute; bottom: 0; left: 8px; right: 8px;
    height: 2px; background: #3b82f6; border-radius: 2px;
}

.editor-tab-body {
    flex: 1; padding: 4px 14px 14px;
    overflow-y: hidden; position: relative;
    display: flex; flex-direction: column; justify-content: flex-start;
}

.property-panel { display: none; width: 100%; height: 100%; flex-direction: column; }
.property-panel.show { display: flex; }

.prop-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; flex-shrink: 0; }
.prop-row:last-child { margin-bottom: 0; }

.custom-input { 
    flex: 1; height: 34px; padding: 0 12px; border: 1px solid rgba(255,255,255,0.1); border-radius: 8px; 
    font-size: 0.85rem; background: rgba(0,0,0,0.3); color: #fff; outline: none; 
}
.custom-input:focus { border-color: #3b82f6; background: rgba(0,0,0,0.6); }

.btn-icon-sq {
    width: 34px; height: 34px; border-radius: 8px; border: 1px solid rgba(255,255,255,0.1);
    background: rgba(0,0,0,0.3); color: #e4e4e7; font-size: 0.95rem;
    display: inline-flex; justify-content: center; align-items: center; cursor: pointer; transition: 0.15s;
}
.btn-icon-sq:active { transform: scale(0.92); }
.btn-icon-sq.primary { background: #2563eb; border-color: #2563eb; color: #fff; }
.btn-icon-sq.danger { background: rgba(220, 38, 38, 0.2); border-color: rgba(220, 38, 38, 0.3); color: #f87171; }

.custom-color { width: 24px; height: 24px; border: none; border-radius: 50%; cursor: pointer; padding: 0; background: none; }
.custom-color::-webkit-color-swatch-wrapper { padding: 0; }
.custom-color::-webkit-color-swatch { border: 1.5px solid rgba(255,255,255,0.2); border-radius: 50%; }

.custom-range { flex: 1; height: 4px; accent-color: #3b82f6; cursor: pointer; }
.size-badge {
    font-size: 0.75rem; font-weight: 700; color: #e4e4e7;
    background: rgba(0,0,0,0.3); border: 1px solid rgba(255,255,255,0.1); border-radius: 6px;
    padding: 2px 6px; min-width: 36px; text-align: center;
}

.theme-palette-wrap {
    display: flex; flex-wrap: wrap; gap: 10px; padding: 4px 2px; width: 100%;
    max-height: 110px; overflow-y: auto; align-content: flex-start;
    -ms-overflow-style: none; scrollbar-width: none;
}
.theme-palette-wrap::-webkit-scrollbar { display: none; }
.theme-btn {
    width: 28px; height: 28px; border-radius: 50%; border: 1.5px solid rgba(255,255,255,0.2); 
    cursor: pointer; transition: transform 0.15s;
}
.theme-btn.active { border-color: #fff; transform: scale(1.18); box-shadow: 0 0 0 2px rgba(59,130,246,0.6); }

.sticker-top-bar { display: flex; gap: 6px; margin-bottom: 6px; flex-shrink: 0; }
.sticker-cat-group { display: flex; gap: 5px; overflow-x: auto; -ms-overflow-style: none; scrollbar-width: none; }
.sticker-cat-group::-webkit-scrollbar { display: none; }
.cat-pill {
    background: rgba(255,255,255,0.1); color: #a1a1aa; border: none;
    border-radius: 14px; padding: 3px 9px; font-size: 0.72rem; font-weight: 700; cursor: pointer; white-space: nowrap;
}
.cat-pill.active { background: #fff; color: #09090b; }

/* 패널이 확장될 때 스티커 갤러리도 세로로 쫙 늘어나도록 flex: 1 적용 */
.sticker-gallery {
    display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px;
    flex: 1; overflow-y: auto; padding: 2px 2px 10px; align-content: flex-start;
    -ms-overflow-style: none; scrollbar-width: none;
}
.sticker-gallery::-webkit-scrollbar { display: none; } 
.sticker-item {
    background: rgba(0,0,0,0.4); border-radius: 8px; padding: 4px; cursor: pointer;
    display: flex; justify-content: center; align-items: center; transition: 0.15s;
    aspect-ratio: 1/1; border: 1px solid rgba(255,255,255,0.05);
}
.sticker-item:active { transform: scale(0.9); }
.sticker-item img { width: 100%; height: 100%; object-fit: contain; pointer-events: none; }





/* ---------------------------------------------------------
   4. [ASK] 방문자 질문 화면 전용
   --------------------------------------------------------- */
.ask-master-wrap {
    max-width: 600px; margin: 0 auto; background: #fafafa;
    font-family: -apple-system, BlinkMacSystemFont, "Pretendard", "Apple SD Gothic Neo", sans-serif; 
    min-height: 100vh;
    display: flex; flex-direction: column;
}
@media (min-width: 768px) {
    .ask-master-wrap {
        margin: 40px auto 80px; border-radius: 24px; border: 1px solid #efefef; 
        box-shadow: 0 10px 40px rgba(0,0,0,0.05); min-height: 600px;
        background: #fff;
    }
}

/* 상단 영역이 너무 딱 붙는 현상 해결을 위해 공통 wrapper 오버라이딩 (선택사항) */
.ask-master-wrap .secret-canvas-wrapper { padding-top: 30px; padding-bottom: 24px; }

/* 작성 폼 영역 (상용화 수준 UI) */
.ask-form-section {
    background: #fff; border-top-left-radius: 24px; border-top-right-radius: 24px;
    padding: 30px 20px 40px; box-shadow: 0 -4px 10px rgba(0,0,0,0.02);
    flex: 1; /* 하단 빈 공간 꽉 채움 */
}

.ask-form-title {
    font-size: 15px; font-weight: 800; color: #1e293b; margin-bottom: 12px;
    text-align: center; letter-spacing: -0.3px;
}

.ask-textarea-wrap { position: relative; margin-bottom: 16px; }
.ask-textarea {
    width: 100%; height: 140px; resize: none;
    background: #f8fafc; border: 2px solid #e2e8f0; border-radius: 16px;
    padding: 16px; font-size: 15px; font-weight: 600; color: #111;
    outline: none; transition: border-color 0.2s, box-shadow 0.2s;
}
.ask-textarea:focus {
    border-color: #3b82f6; background: #fff; box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}
.ask-textarea::placeholder { color: #94a3b8; font-weight: 500; }

/* 글자 수 카운터 */
.char-counter {
    position: absolute; bottom: 12px; right: 16px;
    font-size: 12px; font-weight: 700; color: #94a3b8;
}

.btn-submit-ask {
    width: 100%; background: #111; color: #fff; font-size: 16px; font-weight: 800;
    padding: 16px; border: none; border-radius: 16px; cursor: pointer;
    transition: 0.2s; display: flex; justify-content: center; align-items: center; gap: 8px;
}
.btn-submit-ask:active { transform: scale(0.98); background: #333; }
.btn-submit-ask:disabled { background: #cbd5e1; cursor: not-allowed; transform: none; }

/* NGL 핵심: 오가닉 바이럴 유도 배너 */
.viral-banner {
    margin-top: 40px; text-align: center; padding: 20px;
    background: #f1f5f9; border-radius: 16px;
}
.viral-banner p { margin: 0 0 12px; font-size: 14px; font-weight: 700; color: #475569; line-height: 1.4; }
.viral-btn {
    display: inline-block; background: #fff; color: #3b82f6;
    font-weight: 800; font-size: 14px; padding: 12px 24px;
    border-radius: 12px; text-decoration: none; border: 1px solid #e2e8f0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02); transition: 0.2s;
}
.viral-btn:active { transform: scale(0.96); }