/* ============================================================
   chat.css  v6  – 길드 채팅 플로팅 패널
   · 우측 하단 토글 버튼 (💬 아이콘) 항상 표시
   · 360 × 580 플로팅 패널
   · 헤더 내 탭 바: 💬 채팅 / 🖼️ 사진 전송
   · Step 화면: 비밀번호 → 닉네임 → 채팅 (flex 중앙 정렬)
   ============================================================ */

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   토글 버튼 (항상 화면에 표시)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
#chat-toggle-btn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1001;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 22px;
    cursor: pointer;
    box-shadow: 0 4px 18px rgba(102,126,234,.55);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform .2s, box-shadow .2s;
    flex-shrink: 0;
}
#chat-toggle-btn:hover {
    transform: scale(1.11);
    box-shadow: 0 6px 24px rgba(102,126,234,.7);
}

/* 읽지 않은 뱃지 */
#chat-unread-badge {
    position: absolute;
    top: -3px; right: -3px;
    background: #ef4444;
    color: white;
    font-size: 11px;
    font-weight: 700;
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    border: 2px solid white;
    pointer-events: none;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   플로팅 패널 CSS는 팝업 모드로 전환되어 제거됨
   (채팅창은 chat-popup.html 팝업 창으로 동작)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

/* ── 헤더 ── */
#chat-header {
    flex-shrink: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    flex-direction: column;
    padding: 0;
    cursor: grab;           /* 드래그 가능 커서 */
    user-select: none;      /* 드래그 중 텍스트 선택 방지 */
}
#chat-header:active { cursor: grabbing; }
#chat-header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px 10px;
}
#chat-header-top h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.3;
}
#chat-close-btn {
    background: rgba(255,255,255,.2);
    border: none;
    color: white;
    font-size: 15px;
    width: 28px; height: 28px;
    border-radius: 50%;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background .15s;
    padding: 0;
    flex-shrink: 0;
}
#chat-close-btn:hover { background: rgba(255,255,255,.38); }

/* 헤더 내 탭 바 */
#chat-tab-bar {
    display: flex;
    padding: 0 8px 0;
    gap: 4px;
}
.chat-tab-btn {
    flex: 1;
    padding: 8px 0 9px;
    border: none;
    background: rgba(255,255,255,.15);
    color: rgba(255,255,255,.8);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 8px 8px 0 0;
    transition: background .15s, color .15s;
    white-space: nowrap;
}
.chat-tab-btn:hover  { background: rgba(255,255,255,.28); color: white; }
.chat-tab-btn.active { background: white; color: #667eea; }

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   Step 화면 (공통)
   – 비밀번호 / 닉네임 / 차단
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.chat-step {
    flex: 1;
    display: flex;          /* showCorrectStep()에서 flex로 전환 */
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px 24px;
    background: #fafbff;
    gap: 14px;
    min-height: 0;
    overflow-y: auto;
}
.chat-step-icon { font-size: 40px; line-height: 1; }
.chat-step h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: #1e293b;
    text-align: center;
}
.chat-step-desc {
    margin: 0;
    font-size: 12.5px;
    color: #64748b;
    text-align: center;
    line-height: 1.7;
}
/* 입력 행 */
.chat-auth-row {
    display: flex;
    width: 100%;
    max-width: 280px;
    gap: 8px;
}
.chat-auth-row input {
    flex: 1;
    border: 1.5px solid #c7d2fe;
    border-radius: 10px;
    padding: 9px 13px;
    font-size: 14px;
    outline: none;
    min-width: 0;
    transition: border-color .2s;
    background: white;
}
.chat-auth-row input:focus { border-color: #667eea; }
.chat-auth-row button {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 10px;
    padding: 9px 16px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: opacity .15s;
    flex-shrink: 0;
}
.chat-auth-row button:hover    { opacity: .88; }
.chat-auth-row button:disabled { opacity: .5; cursor: not-allowed; }
/* 오류 메시지 */
.chat-step-err {
    width: 100%;
    max-width: 280px;
    padding: 8px 13px;
    background: #fee2e2;
    color: #b91c1c;
    border-radius: 8px;
    font-size: 12.5px;
    font-weight: 600;
    text-align: center;
    animation: msgIn .2s ease;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   탭 패널 공통
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.chat-tab-panel {
    display: none;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
    background: white;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   채팅 탭 패널 (#chat-tab-chat)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
/* 닉네임 바 */
#chat-nickname-bar {
    flex-shrink: 0;
    background: #f0f0ff;
    border-bottom: 1px solid #e0e0f4;
    padding: 7px 14px;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* 플로팅 채팅 나가기 버튼 */
#chat-leave-btn {
    margin-left: auto;
    background: none;
    border: 1px solid #fca5a5;
    border-radius: 6px;
    padding: 3px 9px;
    font-size: 11px;
    cursor: pointer;
    color: #ef4444;
    font-weight: 600;
    white-space: nowrap;
    transition: background .15s, color .15s;
}
#chat-leave-btn:hover {
    background: #fee2e2;
    color: #b91c1c;
}
#chat-nickname-display {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
    color: #444;
    flex: 1;
}
#chat-nickname-display .nick-name {
    font-weight: 700;
    color: #667eea;
}
#chat-nickname-change-btn {
    background: none;
    border: 1px solid #c7d2fe;
    border-radius: 6px;
    padding: 3px 9px;
    font-size: 11px;
    cursor: pointer;
    color: #667eea;
    transition: background .15s;
    white-space: nowrap;
}
#chat-nickname-change-btn:hover { background: #e0e7ff; }

/* 메시지 목록 */
#chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: #f9f9fb;
    min-height: 0;
}
#chat-messages::-webkit-scrollbar       { width: 4px; }
#chat-messages::-webkit-scrollbar-thumb { background: #ccc; border-radius: 2px; }

/* 메시지 말풍선 */
.chat-msg {
    display: flex;
    flex-direction: column;
    max-width: 82%;
    animation: msgIn .18s ease;
}
@keyframes msgIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}
.chat-msg.other { align-self: flex-start; }
.chat-msg.mine  { align-self: flex-end;   }

.chat-msg-nick {
    font-size: 11px;
    font-weight: 700;
    color: #94a3b8;
    margin-bottom: 3px;
}
.chat-msg.mine .chat-msg-nick { text-align: right; color: #818cf8; }

.chat-msg-bubble {
    padding: 8px 12px;
    border-radius: 14px;
    font-size: 13.5px;
    line-height: 1.5;
    word-break: break-word;
}
.chat-msg.other .chat-msg-bubble {
    background: white;
    border: 1.5px solid #e2e8f0;
    color: #1e293b;
    border-radius: 4px 14px 14px 14px;
}
.chat-msg.mine .chat-msg-bubble {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border-radius: 14px 4px 14px 14px;
}

/* 이미지 버블 */
.chat-msg-bubble--img {
    padding: 4px !important;
    background: transparent !important;
    border: none !important;
    border-radius: 10px !important;
}
.chat-img-wrap  { position: relative; display: inline-block; }
.chat-img-thumb {
    display: block;
    max-width: 200px;
    max-height: 200px;
    border-radius: 10px;
    cursor: zoom-in;
    object-fit: cover;
    border: 2px solid #e2e8f0;
    transition: opacity .2s;
}
.chat-msg.mine .chat-img-thumb { border-color: #a5b4fc; }
.chat-img-thumb:hover { opacity: .88; }
.chat-img-size {
    position: absolute; bottom: 4px; right: 4px;
    background: rgba(0,0,0,.5);
    color: white; font-size: 10px;
    padding: 2px 5px; border-radius: 4px;
    pointer-events: none;
}

.chat-msg-time {
    font-size: 10px;
    color: #94a3b8;
    margin-top: 3px;
    align-self: flex-end;
}
.chat-msg.other .chat-msg-time { align-self: flex-start; }

/* ── 내 메시지 삭제 버튼 (플로팅 채팅) ── */
.chat-msg-del-btn {
    display: none;
    align-self: flex-end;
    margin-top: 3px;
    background: none;
    border: none;
    font-size: 13px;
    cursor: pointer;
    opacity: 0.45;
    padding: 0 2px;
    line-height: 1;
    transition: opacity .15s, transform .15s;
}
.chat-msg.mine:hover .chat-msg-del-btn {
    display: block;
}
.chat-msg-del-btn:hover {
    opacity: 1;
    transform: scale(1.15);
}
.chat-msg-del-btn:disabled {
    opacity: 0.2;
    cursor: not-allowed;
}

/* ── 내 메시지 삭제 버튼 (인라인 채팅) ── */
.ic-msg-del-btn {
    display: none;
    align-self: flex-end;
    margin-top: 3px;
    background: none;
    border: none;
    font-size: 13px;
    cursor: pointer;
    opacity: 0.45;
    padding: 0 2px;
    line-height: 1;
    transition: opacity .15s, transform .15s;
}
.ic-msg-row.mine:hover .ic-msg-del-btn {
    display: block;
}
.ic-msg-del-btn:hover {
    opacity: 1;
    transform: scale(1.15);
}
.ic-msg-del-btn:disabled {
    opacity: 0.2;
    cursor: not-allowed;
}

.chat-system-msg {
    align-self: center;
    background: #efefef;
    color: #aaa;
    font-size: 11px;
    padding: 3px 12px;
    border-radius: 20px;
    margin: 4px 0;
}

#chat-empty {
    text-align: center;
    color: #cbd5e1;
    font-size: 13px;
    padding: 40px 0;
    line-height: 1.8;
}

/* 이미지 미리보기 줄 (채팅 탭 하단) */
#chat-img-preview-area {
    flex-shrink: 0;
    display: none;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: #f5f0ff;
    border-top: 1.5px solid #e9d5ff;
    animation: msgIn .2s ease;
}
#chat-img-preview-thumb {
    width: 50px; height: 50px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid #c4b5fd;
    flex-shrink: 0;
}
#chat-img-preview-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
#chat-img-preview-label {
    font-size: 12px;
    font-weight: 600;
    color: #7c3aed;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
#chat-img-preview-cancel {
    flex-shrink: 0;
    width: 22px; height: 22px;
    background: #ef4444;
    color: white; border: none;
    border-radius: 50%; cursor: pointer;
    font-size: 11px;
    display: flex; align-items: center; justify-content: center;
    padding: 0;
    transition: background .15s;
}
#chat-img-preview-cancel:hover { background: #dc2626; }

/* 업로드 진행 줄 (채팅 탭) */
#chat-upload-progress {
    flex-shrink: 0;
    display: none;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    background: #eff6ff;
    border-top: 1px solid #bfdbfe;
}
#chat-upload-bar-wrap {
    flex: 1;
    height: 6px;
    background: #dbeafe;
    border-radius: 3px;
    overflow: hidden;
}
#chat-upload-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 3px;
}
#chat-upload-label {
    font-size: 11.5px;
    color: #3b82f6;
    white-space: nowrap;
    font-weight: 600;
}

/* 입력 영역 */
#chat-input-area {
    flex-shrink: 0;
    border-top: 1px solid #f1f5f9;
    padding: 8px 10px;
    display: flex;
    gap: 6px;
    align-items: flex-end;
    background: white;
}
#chat-img-btn {
    flex-shrink: 0;
    width: 36px; height: 36px;
    border: 1.5px solid #e2e8f0;
    border-radius: 9px;
    background: white;
    font-size: 17px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: border-color .2s, background .2s;
    padding: 0;
}
#chat-img-btn:hover { border-color: #667eea; background: #f0f0ff; }

#chat-input {
    flex: 1;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    padding: 7px 11px;
    font-size: 13.5px;
    line-height: 1.4;
    resize: none;
    min-height: 36px;
    max-height: 90px;
    outline: none;
    transition: border-color .2s;
    font-family: inherit;
    overflow-y: auto;
}
#chat-input:focus { border-color: #667eea; }

#chat-send-btn {
    flex-shrink: 0;
    width: 36px; height: 36px;
    border-radius: 9px;
    border: none;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    font-size: 15px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: transform .15s, opacity .15s;
    padding: 0;
}
#chat-send-btn:hover    { transform: scale(1.08); }
#chat-send-btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   사진 탭 패널 (#chat-tab-photo)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
#chat-photo-tab-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 20px 16px;
    gap: 14px;
    overflow-y: auto;
    background: #f9f9fb;
}

/* 드롭존 */
#chat-photo-dropzone {
    width: 100%;
    border: 2.5px dashed #c4b5fd;
    border-radius: 14px;
    background: #faf5ff;
    padding: 28px 16px;
    text-align: center;
    cursor: pointer;
    transition: border-color .2s, background .2s;
    flex-shrink: 0;
    user-select: none;
}
#chat-photo-dropzone:hover,
#chat-photo-dropzone.drag-over {
    border-color: #7c3aed;
    background: #f3e8ff;
}
#chat-photo-dropzone .dz-icon  { font-size: 34px; margin-bottom: 8px; }
#chat-photo-dropzone .dz-text  { font-size: 13px; color: #7c3aed; font-weight: 600; }
#chat-photo-dropzone .dz-sub   {
    font-size: 11.5px; color: #a78bfa; margin-top: 6px; line-height: 1.7;
}

/* 미리보기 */
#chat-photo-preview-wrap {
    width: 100%;
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}
#chat-photo-preview-img {
    max-width: 100%;
    max-height: 220px;
    border-radius: 12px;
    object-fit: contain;
    border: 2px solid #e9d5ff;
    box-shadow: 0 2px 12px rgba(124,58,237,.15);
}
#chat-photo-preview-info {
    font-size: 12.5px;
    color: #64748b;
    text-align: center;
    line-height: 1.6;
    word-break: break-all;
}
.chat-photo-action-row {
    display: flex;
    gap: 8px;
    width: 100%;
}
.chat-photo-action-row button {
    flex: 1;
    padding: 10px 0;
    border-radius: 10px;
    border: none;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: opacity .15s;
}
#chat-photo-send-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}
#chat-photo-send-btn:hover { opacity: .88; }
#chat-photo-send-btn:disabled { opacity: .5; cursor: not-allowed; }
#chat-photo-cancel-btn {
    background: #f1f5f9;
    color: #64748b;
    border: 1.5px solid #e2e8f0 !important;
}
#chat-photo-cancel-btn:hover { background: #e2e8f0; }

/* 업로드 진행 (사진 탭) */
#chat-photo-upload-progress {
    width: 100%;
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}
#chat-photo-upload-bar-wrap {
    width: 100%;
    height: 8px;
    background: #dbeafe;
    border-radius: 4px;
    overflow: hidden;
}
#chat-photo-upload-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 4px;
    transition: width 8s cubic-bezier(0.1,0.9,0.3,1);
}
#chat-photo-upload-label {
    font-size: 12.5px;
    color: #7c3aed;
    font-weight: 600;
    text-align: center;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   라이트박스
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
#chat-lightbox {
    position: fixed; inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
}
#chat-lb-bg {
    position: absolute; inset: 0;
    background: rgba(0,0,0,.82);
    backdrop-filter: blur(4px);
}
#chat-lb-box {
    position: relative; z-index: 1;
    max-width: 92vw; max-height: 90vh;
    display: flex;
    align-items: center; justify-content: center;
    padding-bottom: 52px;
}
#chat-lb-img {
    max-width: 88vw; max-height: 82vh;
    border-radius: 12px;
    box-shadow: 0 8px 40px rgba(0,0,0,.6);
    object-fit: contain;
    display: block;
}
#chat-lb-close {
    position: absolute; top: -14px; right: -14px;
    width: 32px; height: 32px;
    border-radius: 50%; border: none;
    background: #ef4444; color: white;
    font-size: 14px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,.3);
    padding: 0; transition: background .2s;
}
#chat-lb-close:hover { background: #dc2626; }
#chat-lb-dl {
    position: absolute;
    bottom: -42px; left: 50%; transform: translateX(-50%);
    background: rgba(255,255,255,.15);
    color: white; text-decoration: none;
    border: 1.5px solid rgba(255,255,255,.4);
    border-radius: 20px;
    padding: 6px 18px;
    font-size: 13px; font-weight: 600;
    white-space: nowrap;
    transition: background .2s;
    backdrop-filter: blur(4px);
}
#chat-lb-dl:hover { background: rgba(255,255,255,.28); }

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   반응형 (모바일)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
@media (max-width: 480px) {
    #chat-toggle-btn { right: 16px; bottom: 16px; width: 50px; height: 50px; }
    .chat-img-thumb  { max-width: 160px; max-height: 160px; }
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   참가자 목록 탭 (#chat-tab-members)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
#chat-tab-members {
    flex: 1;
    display: none;
    flex-direction: column;
    min-height: 0;
    background: #fff;
}

/* 검색 헤더 */
/* ── 참가자 탭 헤더 (검색 최소화) ── */
#chat-members-header {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px 7px;
    background: #f8f9fb;
    border-bottom: 1px solid #e8eaf0;
}
#chat-members-count {
    flex-shrink: 0;
    font-size: 11.5px;
    font-weight: 700;
    color: #667eea;
    background: #eef0ff;
    padding: 3px 9px;
    border-radius: 20px;
    white-space: nowrap;
}
#chat-members-search {
    width: 80px;
    flex-shrink: 0;
    border: 1.5px solid #e2e8f0;
    border-radius: 20px;
    padding: 3px 8px;
    font-size: 11px;
    outline: none;
    background: #fff;
    transition: border-color .2s, width .2s;
    min-width: 0;
}
#chat-members-search:focus {
    border-color: #667eea;
    width: 130px;
}

/* ── 바둑판 그리드 컨테이너 ── */
#chat-members-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px 10px;
    min-height: 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    align-content: start;
}
#chat-members-list::-webkit-scrollbar       { width: 4px; }
#chat-members-list::-webkit-scrollbar-thumb { background: #ccc; border-radius: 2px; }

.chat-members-empty {
    grid-column: 1 / -1;
    text-align: center;
    color: #cbd5e1;
    font-size: 13px;
    padding: 40px 0;
}

/* ── 바둑판 카드 ── */
.chat-member-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 10px 6px 8px;
    background: white;
    border-radius: 10px;
    border: 1.5px solid #f1f5f9;
    transition: border-color .15s, box-shadow .15s;
    cursor: default;
    position: relative;
    text-align: center;
    min-width: 0;
}
.chat-member-item:hover {
    border-color: #c7d2fe;
    box-shadow: 0 2px 8px rgba(102,126,234,.12);
}
.chat-member-item.me {
    border-color: #a7f3d0;
    background: #f0fdf9;
}
.chat-member-item.blocked {
    opacity: .45;
}

/* 아바타 원형 */
.chat-member-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    user-select: none;
}
.chat-member-item.me .chat-member-avatar {
    background: linear-gradient(135deg, #10b981, #059669);
}
.chat-member-item.blocked .chat-member-avatar {
    background: #94a3b8;
}

/* 닉네임 & 시간 */
.chat-member-info {
    width: 100%;
    min-width: 0;
}
.chat-member-nick {
    font-size: 11.5px;
    font-weight: 700;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
}
.chat-member-time {
    font-size: 10px;
    color: #94a3b8;
    margin-top: 1px;
    text-align: center;
}

/* 뱃지들 */
.chat-member-me-badge {
    display: inline-flex;
    align-items: center;
    font-size: 9.5px;
    font-weight: 700;
    background: #d1fae5;
    color: #065f46;
    padding: 1px 5px;
    border-radius: 8px;
    margin-left: 3px;
    vertical-align: middle;
}
.chat-member-block-badge {
    display: inline-flex;
    align-items: center;
    font-size: 9.5px;
    font-weight: 700;
    background: #fee2e2;
    color: #b91c1c;
    padding: 1px 5px;
    border-radius: 8px;
    margin-left: 3px;
    vertical-align: middle;
}

/* DM 버튼 */
.chat-member-dm-btn {
    width: 100%;
    border: none;
    border-radius: 7px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 5px 0;
    cursor: pointer;
    transition: opacity .15s, transform .1s;
    white-space: nowrap;
    margin-top: 2px;
}
.chat-member-dm-btn:hover {
    opacity: .85;
    transform: scale(1.03);
}

/* ── 개인 코드 발급 박스 ── */
#chat-code-box {
    margin-top: 16px;
    background: linear-gradient(135deg, #f0f4ff, #e8f0fe);
    border: 2px solid #667eea;
    border-radius: 14px;
    padding: 16px;
    text-align: center;
    animation: codeBoxIn .3s ease;
}
@keyframes codeBoxIn {
    from { opacity:0; transform:translateY(8px); }
    to   { opacity:1; transform:translateY(0); }
}
.chat-code-label {
    font-size: 12px;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 10px;
}
.chat-code-value {
    font-size: 32px;
    font-weight: 900;
    letter-spacing: 8px;
    color: #1e1b4b;
    background: white;
    border-radius: 10px;
    padding: 10px 16px;
    margin: 0 auto 10px;
    border: 2px dashed #a5b4fc;
    font-family: 'Courier New', monospace;
    user-select: all;
}
.chat-code-desc {
    font-size: 11.5px;
    color: #64748b;
    line-height: 1.6;
    margin-bottom: 12px;
}
.chat-code-copy-btn,
.chat-code-enter-btn {
    display: inline-block;
    margin: 4px;
    padding: 7px 14px;
    border-radius: 8px;
    border: none;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: opacity .15s, transform .1s;
}
.chat-code-copy-btn {
    background: #e0e7ff;
    color: #4338ca;
}
.chat-code-enter-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}
.chat-code-copy-btn:hover,
.chat-code-enter-btn:hover {
    opacity: .85;
    transform: scale(1.04);
}

/* 입장 힌트 텍스트 */
.chat-step-hint {
    font-size: 11px;
    color: #94a3b8;
    margin-top: 10px;
    line-height: 1.6;
    text-align: center;
}

/* ── 인라인 채팅 코드 박스 ── */
.ic-code-box {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #f0f4ff, #e8f0fe);
    border: 2px solid #667eea;
    border-radius: 14px;
    padding: 14px 16px;
    width: 90%;
    max-width: 280px;
    text-align: center;
    animation: codeBoxIn .3s ease;
    margin-top: 8px;
}
.ic-code-label {
    font-size: 12px;
    font-weight: 700;
    color: #667eea;
}
.ic-code-value {
    font-size: 28px;
    font-weight: 900;
    letter-spacing: 6px;
    color: #1e1b4b;
    background: white;
    border-radius: 8px;
    padding: 8px 14px;
    border: 2px dashed #a5b4fc;
    font-family: 'Courier New', monospace;
    user-select: all;
}
.ic-code-desc {
    font-size: 11px;
    color: #64748b;
    line-height: 1.5;
}
.ic-code-copy-btn,
.ic-code-enter-btn {
    display: inline-block;
    margin: 3px;
    padding: 6px 14px;
    border-radius: 8px;
    border: none;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: opacity .15s, transform .1s;
    width: 85%;
}
.ic-code-copy-btn {
    background: #e0e7ff;
    color: #4338ca;
}
.ic-code-enter-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}
.ic-code-copy-btn:hover,
.ic-code-enter-btn:hover {
    opacity: .85;
    transform: scale(1.03);
}
