*{margin:0;padding:0;box-sizing:border-box;font-family:Segoe UI,sans-serif;}
html,body{height:100%;background:#0f1117;color:#e4e6eb;}

.layout{display:flex;height:100vh;}

.server-title{font-size:18px;font-weight:700;color:#fff;margin-bottom:15px;padding:10px;}
.menu{list-style:none;}
.menu li{padding:10px 12px;border-radius:6px;margin-bottom:4px;cursor:pointer;color:#b5bac1;transition:.15s;}
.menu li:hover{background:#1f2633;color:#fff;}

body.page-chat .menu li:nth-child(1),
body.page-board .menu li:nth-child(2),
body.page-guide .menu li:nth-child(3){
    background:#262d3b;color:#fff;
}

.main{flex:1;display:flex;flex-direction:column;}

.topbar{
    height:60px;
    background:#151922;
    display:flex;
    align-items:center;
    padding:0 20px;
    border-bottom:1px solid #222;
}

/* ===== USER BTN ===== */
#ht-user-btn-wrap{margin-left:auto;position:relative;}
#ht-user-btn{
    display:flex;
    align-items:center;
    gap:8px;
    cursor:pointer;
    padding:4px 8px;
    border-radius:20px;
    transition:background .2s;
}
#ht-user-btn:hover{background:rgba(255,255,255,.08);}
#ht-user-btn img{width:34px;height:34px;border-radius:50%;}
#ht-user-btn span{font-weight:600;color:#ffd44d;}

/* ===== USER PANEL (단일 정의) ===== */
#ht-user-panel{
    display:none;
    position:absolute;
    top:calc(100% + 10px);
    right:-20px;
    width:320px;
    background:linear-gradient(180deg,#0b1f2c,#061822);
    border:1px solid rgba(120,180,220,.25);
    border-radius:10px;
    box-shadow:0 20px 40px rgba(0,0,0,.6);
    padding:16px;
    z-index:10000;
}
#ht-user-panel.open{display:block;}

.ht-user-info{display:flex;align-items:center;gap:12px;padding-bottom:14px;border-bottom:1px solid rgba(255,255,255,.08);margin-bottom:14px;}
.ht-user-info strong{font-size:16px;color:#fff;}
.ht-user-info span{font-size:12px;color:#9bb6c9;}

.ht-user-list,.ht-user-list-tow{list-style:none;padding:0;margin:0;}
.ht-user-list li{display:flex;justify-content:space-between;padding:8px 0;color:#cfe7f7;}
.ht-user-list-tow{display:flex;gap:14px;}
.ht-user-list-tow li{display:flex;gap:6px;white-space:nowrap;color:#cfe7f7;}
.ht-user-list b,.ht-user-list-tow b{color:#ffd44d;}

.ht-user-actions{display:flex;gap:10px;margin-top:16px;}
.ht-user-actions a{flex:1;text-align:center;padding:8px 0;font-weight:600;text-decoration:none;border-radius:6px;}
.ht-user-actions a:first-child{background:linear-gradient(to right,#1e90ff,#4db8ff);color:#fff;}
.ht-user-actions a:last-child{background:#2a2a2a;color:#ccc;}
.ht-user-actions a:hover{filter:brightness(1.15);}

/* ===== 디스코드 채팅 구조 ===== */
.dc-app{flex:1;display:flex;height:100%;}
.dc-chat{flex:1;display:flex;flex-direction:column;background:#2b2d31;}
.dc-chat-header{height:50px;flex-shrink:0;padding:12px;border-bottom:1px solid #1e1f22;}
.dc-messages{flex:1;overflow-y:auto;padding:15px;}
.dc-input{flex-shrink:0;padding:10px;border-top:1px solid #1e1f22;background:#313338;}
.dc-input input{width:100%;padding:10px;background:#383a40;border:none;border-radius:5px;color:white;}

.dc-users{
    width:220px;
    flex-shrink:0;
    background:#16181f;
    padding:14px;
    border-left:1px solid #111;
}
.dc-user-title{font-size:14px;margin-bottom:8px;color:#8e9297;}

/* ===== 모바일 ===== */
@media(max-width:768px){
    .dc-users{display:none;}
    .dc-input{position:fixed;bottom:0;left:0;right:0;}
    .dc-messages{margin-bottom:70px;}
}
.main { 
    flex:1;
    display:flex;
    flex-direction:column;
}

.content {
    flex:1;
    display:flex;
    overflow:hidden;
}

.dc-app {
    flex:1;
    display:flex;
    height:100%;
}
.dc-chat {
    flex:1;
    display:flex;
    flex-direction:column;
    min-height:0;
}
.dc-messages {
    flex:1;
    overflow-y:auto;
    padding:15px;
    min-height:0;
}
.dc-input {
    flex-shrink:0;
    padding:12px;
    border-top:1px solid #1e1f22;
    background:#313338;
}

.dc-input input {
    width:100%;
    padding:12px;
    background:#383a40;
    border:none;
    border-radius:6px;
    color:#fff;
}


/* 입력창 영역 */
.dc-input {
    flex-shrink:0;
    padding:14px;
    background:#2b2d31;
    border-top:1px solid #1e1f22;
}

/* 인풋 박스 */
.dc-input input {
    width:100%;
    padding:14px 16px;
    font-size:14px;
    background:#383a40;
    border:1px solid #202225;
    border-radius:8px;
    color:#dcddde;
    outline:none;
    transition:0.15s;
}

/* 포커스 효과 */
.dc-input input:focus {
    border-color:#5865f2;
    box-shadow:0 0 0 2px rgba(88,101,242,0.2);
}

/* placeholder 색 */
.dc-input input::placeholder {
    color:#72767d;
}



/* 채팅 전체 배경 */
.dc-app {
    background:#0f1117;
}

/* 메시지 영역 */
.dc-chat {
    background:#12151c;
}

/* 메시지 스크롤 영역 */
.dc-messages {
    background:#12151c;
}

/* 입력창 배경 */
.dc-input {
    background:#0f131a;
    border-top:1px solid #1b2230;
}

/* 입력창 안쪽 */
.dc-input input {
    background:#0b0e13;
    border:1px solid #1e2633;
    color:#e6e9ef;
}


/* ===== Chrome, Edge, Safari ===== */
.dc-messages::-webkit-scrollbar {
    width:10px;
}

.dc-messages::-webkit-scrollbar-track {
    background:#0f131a;   /* 스크롤 배경 */
}

.dc-messages::-webkit-scrollbar-thumb {
    background:#1e2633;   /* 스크롤 막대 */
    border-radius:8px;
    border:2px solid #0f131a;
}

.dc-messages::-webkit-scrollbar-thumb:hover {
    background:#2b3647;
}


/* ===== Firefox ===== */
.dc-messages {
    scrollbar-width:thin;
    scrollbar-color:#1e2633 #0f131a;
}
.dc-messages::-webkit-scrollbar-thumb {
    background:#2b3647;
}


.avatar {
    width:40px;
    height:40px;
    border-radius:50%;
    background:#5865f2;
    flex-shrink:0;
}

.msg-body {
    display:flex;
    flex-direction:column;
}

.msg-header {
    display:flex;
    align-items:center;
    gap:8px;
    margin-bottom:4px;
}

.name {
    font-weight:600;
    color:#fff;
    font-size:15px;
}

.time {
    font-size:12px;
    color:#72767d;
}

.text {
    color:#dcddde;
    font-size:14px;
    line-height:1.4;
    white-space:pre-wrap;
}

@keyframes fadeIn {
    from {opacity:0; transform:translateY(4px);}
    to {opacity:1; transform:none;}
}




.msg.compact .avatar { visibility:hidden; }

.msg-body { display:flex; flex-direction:column; }
.msg-header { display:flex; gap:8px; margin-bottom:4px; }

.name { font-weight:600; color:#fff; font-size:15px; }
.time { font-size:12px; color:#72767d; }

.text { color:#dcddde; font-size:14px; line-height:1.5; }
.text {
    color:#dcddde;
    font-size:14px;
    line-height:1.5;

    
    white-space:pre-wrap;      /* \n 줄바꿈 유지 */
    word-break:break-word;     /* 긴 단어 줄바꿈 */
    overflow-wrap:break-word;  /* URL 같은 긴 텍스트 처리 */
}
.text {
    max-width:800px; /* 너무 긴 줄 방지 */
}
.dc-input textarea {
    width:100%;
    min-height:44px;
    max-height:160px;   /* 이 이상이면 스크롤 */
    resize:none;
    padding:12px 14px;
    background:#0b0e13;
    border:1px solid #1e2633;
    border-radius:8px;
    color:#e6e9ef;
    font-size:14px;
    line-height:1.5;
    outline:none;
    overflow-y:auto;
}

.dc-input textarea:focus {
    border-color:#5865f2;
    box-shadow:0 0 0 2px rgba(88,101,242,.2);
}
.text {
    white-space:pre-wrap;
    word-break:break-word;
    overflow-wrap:break-word;
}


/* =========================================
   DC CHAT MESSAGE STYLE (통합 수정본)
   ========================================= */

/* 1. 기본 메시지 (프사 + 텍스트) */
.msg {
    display: flex;
    width: 100%;
    padding: 2px 16px;  /* 전체 여백 */
    margin-top: 20px;   /* 유저들 대화 메시지 사이 간격 */
    position: relative; /* 시간 hover 용 */
    
    /* 중요: 위쪽 코드의 gap:12px가 간격을 망치고 있음. 0으로 초기화 */
    gap: 0 !important; 
}

/* 2. 프사 스타일 */
.msg .avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #5865f2; /* 기본 색상 */
    
    /* ⭐ 간격 계산: 프사(40) + 마진(16) = 56px 공간 차지 */
    margin-right: 16px; 
    
    flex-shrink: 0;  /* 찌그러짐 방지 */
    margin-top: 4px; /* 텍스트랑 높이 시각적 보정 (살짝 내림) */
    
    /* 혹시 위쪽에서 visibility:hidden 등이 먹혔을까봐 초기화 */
    display: block; 
    visibility: visible;
}

/* 3. 메시지 내용 영역 */
.msg-body {
    flex: 1;      /* 남은 공간 차지 */
    min-width: 0; /* 텍스트 넘침 방지용 필수 */
    display: flex;
    flex-direction: column;
}

/* 4. 헤더 (닉네임 + 시간) */
.msg-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 5px; /* 텍스트랑 간격 */
}

/* 5. ⭐ 핵심: 연속 메시지 (Compact Mode) */
.msg.compact {
    margin-top: 0;       /* 위 메시지랑 딱 붙이기 */
    padding-top: 0px;    /* 미세 간격 조정 */
    padding-bottom: 0px;
    
    /* [칼각 계산 공식]
       왼쪽 패딩(16px) + 프사 너비(40px) + 프사 마진(16px) = 72px
       !important로 기존 스타일 무시하고 강제 적용
    */
    padding-left: 72px !important; 
}

/* 연속 메시지에서는 프사를 아예 없애서 공간을 확보 */
.msg.compact .avatar {
    display: none !important;
}

/* 6. 디스코드 디테일: 숨겨진 시간 (Hover) */
.timestamp-hover {
    display: none;
    position: absolute;
    left: 16px; /* 왼쪽 라인 16px에 맞춤 */
    top: 5px;   /* 높이 조절 */
    width: 40px; /* 프사 너비만큼 */
    text-align: center;
    font-size: 10px;
    color: #b9bbbe;
}

/* 마우스 올렸을 때만 시간 보이기 */
.msg.compact:hover .timestamp-hover {
    display: block;
}

/* 마우스 올렸을 때 배경색 변경 */
.msg:hover {
    background-color: rgba(4, 4, 5, 0.07);
}

/* 7. 코드 블럭 스타일 (아까 추가한 거) */
.dc-code {
    background-color: #2f3136;
    border-radius: 3px;
    padding: 2px 4px;
    font-family: Consolas, monospace;
    font-size: 85%;
}


/*
.dc-date-separator {
    text-align:center;
    margin:20px 0;
    position:relative;
    color:#72767d;
    font-size:12px;
}

.dc-date-separator::before,
.dc-date-separator::after {
    content:'';
    position:absolute;
    top:50%;
    width:40%;
    height:1px;
    background:#2b3647;
}

.dc-date-separator::before { left:0; }
.dc-date-separator::after  { right:0; }
*/




/*최근대화 점프*/
.jump-latest-btn {
    position: absolute;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: #5865F2;
    color: white;
    border: none;
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    display: none;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    z-index: 10;
}
.jump-latest-btn:hover {
    background: #4752c4;
}


/* 기본 구조 */
.layout {
    display: flex;
    height: 100vh;
    overflow: hidden;
}


.main {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* 데스크탑에서는 조글버튼 숨김 */
#menuToggle {
    display: none;
}


/* 모바일 햄버거 버튼 - 강제 표시/최상위 */
#menuToggle.mobile-menu-btn{
  position: fixed !important;
  top: 12px !important;
  left: 12px !important;
  z-index: 2147483647 !important; /* 최상위 */
  display: none;
  width: 44px;
  height: 44px;
  line-height: 44px;
  text-align: center;
  font-size: 22px;
  background: #5865F2;
  color: #fff;
  border: 0;
  border-radius: 10px;
  box-shadow: 0 8px 20px rgba(0,0,0,.45);
}

/* 모바일에서만 표시 */
@media (max-width: 768px){
  #menuToggle.mobile-menu-btn{ display:block; }
  .topbar{ padding-left: 64px; }
}

/* 모바일 사이드바 */
@media (max-width: 768px){
  .sidebar{
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: 240px;
    transform: translateX(-100%);
    transition: transform .25s ease;
    z-index: 2147483000;
  }
  .sidebar.active{ transform: translateX(0); }
}
@media (max-width: 768px){

  .content {
    padding-top: 25px;   /* ☰ 버튼 높이만큼 밀기 */
  }

  .mobile-menu-btn{
    top: 10px;
    left: 10px;
    z-index: 2000;
  }

}
@media (max-width: 768px){

  #messages {
    padding-bottom: 60px;  /* 입력창 높이 + 여유 */
  }

  .dc-input {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 1500;
  }

}
/*모바일 최근대화 이동*/
@media (max-width: 768px){

  .jump-latest-btn{
    position: fixed;
    bottom: 90px; /* 입력창 위로 띄움 */
    left: 50%;
    transform: translateX(-50%);
    z-index: 1600;
    padding: 10px 18px;
    border-radius: 20px;
    font-size: 14px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
  }

}

/****************/
.modal{
    position:fixed;
    inset:0;
    background:rgba(0,0,0,0.6);
    display:none;
    justify-content:center;
    align-items:center;
    z-index:9999;
}

.modal-box{
    width:800px;
    height:500px;
    background:#111822;
    border-radius:8px;
    display:flex;
    overflow:hidden;
}

.modal-left{
    width:180px;
    background:#0d141d;
    border-right:1px solid #1e2a3a;
}

.menu-item{
    padding:14px;
    cursor:pointer;
    border-bottom:1px solid #182333;
}

.menu-item.active{
    background:#182333;
}

.modal-right{
    flex:1;
    padding:20px;
}

.hidden{ display:none; }

.modal-close{
    position:absolute;
    top:10px;
    right:20px;
    cursor:pointer;
}



.msg-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 10px;
}
.msg { display: flex; }


/* =========================================
   [수정] 프사 및 텍스트 정렬 스타일
   ========================================= */

/* 2. 프사 스타일 (이름을 .msg-avatar로 정확히 맞춤) */
.msg .msg-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    /*background-color: #5865f2;*/
    object-fit: cover; /* 이미지 찌그러짐 방지 */
    
    /* 위치 보정 (여기가 핵심) */
    margin-right: 16px; /* 텍스트와의 간격 */
    margin-top: 4px;    /* 프사를 살짝 내려서 닉네임이랑 눈높이 맞춤 */
    
    flex-shrink: 0;
    display: block; 
}

/* 3. 메시지 내용 영역 */
.msg-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center; /* 텍스트 수직 정렬 보조 */
}

/* 5. Compact 모드 (프사 숨김) 수정 */
.msg.compact .msg-avatar {
    display: none !important;
}

.dc-user{
    display:flex;
    align-items:center;
    gap:10px;
    padding:8px 10px;
}

.dc-user-avatar{
    width:28px;
    height:28px;
    border-radius:50%;
    object-fit:cover;
}

.dc-user-name{
    font-size:14px;
}
/* 우측 접속자 목록 스타일 */
.dc-user-item {
    display: flex;
    align-items: center; /* 수직 중앙 정렬 */
    padding: 6px 8px;
    margin-bottom: 2px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
}

.dc-user-item:hover {
    background-color: rgba(255, 255, 255, 0.05); /* 마우스 올리면 살짝 밝게 */
}

/* 접속자 프사 */
.dc-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    margin-right: 10px; /* 이름이랑 간격 */
    object-fit: cover;
    /*background-color: #5865f2;*/ /* 이미지 로딩 전 배경 */
}

/* 접속자 이름 */
.dc-user-name {
    font-size: 14px;
    color: #96989d;
    font-weight: 500;
}

/* 접속 중인 본인 이름 강조 (선택사항) */
.dc-user-item:hover .dc-user-name {
    color: #fff;
}



/* ---------- index.php ---------- */
:root{
  --bg0:#05060a;
  --bg1:#080a12;
  --bg2:#0b1020;

  --glass: rgba(18, 20, 28, .62);
  --glass2: rgba(12, 14, 20, .78);
  --panel: rgba(16, 18, 24, .72);

  --line: rgba(255,255,255,.08);
  --line2: rgba(255,255,255,.05);
  --engrave: rgba(0,0,0,.72);

  --txt:#e9edf5;
  --muted:#9aa3b2;
  --muted2:#6f7888;

  --a1:#7cf5ff;      /* cyan */
  --a2:#9b7bff;      /* purple */
  --a3:#35ff9e;      /* green */
  --a4:#5865f2;      /* blue */

  --shadow: 0 18px 65px rgba(0,0,0,.62);
  --shadow2: 0 10px 35px rgba(0,0,0,.45);
  --inset: inset 0 1px 0 rgba(255,255,255,.06), inset 0 -1px 0 rgba(0,0,0,.65);

  --radius: 18px;
  --radius2: 14px;

  --sidebar-w: 282px;
  --topbar-h: 54px;
}

/* ---------- RESET ---------- */
*{ box-sizing:border-box; }
html, body{
  width:100%;
  height:100%;
  margin:0;
  padding:0;
  overflow:hidden;
  color:var(--txt);
  background: var(--bg0);
  font-family: Pretendard, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  -webkit-text-size-adjust: 100%;
}

/* Smooth-ish scroll on iOS inside .content */
.content{
  -webkit-overflow-scrolling: touch;
}

.sidebar.active ~ #menuToggle,
.sidebar.active + #menuToggle,
body:has(.sidebar.active) #menuToggle {
  display: none;
}


/* ---------- BACKGROUND: aurora + vignette + noise ---------- */
body{
  background:
    radial-gradient(900px 700px at 12% 18%, rgba(124,245,255,.14), transparent 60%),
    radial-gradient(1000px 760px at 86% 24%, rgba(155,123,255,.12), transparent 62%),
    radial-gradient(900px 700px at 62% 86%, rgba(53,255,158,.10), transparent 62%),
    linear-gradient(135deg, var(--bg0), var(--bg2));
  position:relative;
}
body:before{
  content:"";
  position:fixed;
  inset:0;
  pointer-events:none;
  z-index:-1;
  background:
    radial-gradient(1200px 800px at 50% -10%, rgba(255,255,255,.06), transparent 60%),
    radial-gradient(1200px 900px at 50% 120%, rgba(0,0,0,.58), transparent 60%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='320' height='320'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.7' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.16'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
  opacity:.30;
  transform: translateZ(0);
}
body:after{
  content:"";
  position:fixed;
  inset:-20%;
  pointer-events:none;
  z-index:-2;
  background:
    radial-gradient(700px 340px at 25% 25%, rgba(124,245,255,.22), transparent 65%),
    radial-gradient(700px 340px at 70% 35%, rgba(155,123,255,.18), transparent 65%),
    radial-gradient(700px 340px at 58% 85%, rgba(53,255,158,.14), transparent 65%);
  filter: blur(26px);
  opacity:.55;
  animation: auroraFlow 18s ease-in-out infinite;
  transform: translateZ(0);
}
@keyframes auroraFlow{
  0%   { transform: translate(-1%, -1%) scale(1.02); }
  50%  { transform: translate(1%,  1%) scale(1.08); }
  100% { transform: translate(-1%, -1%) scale(1.02); }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce){
  body:after{ animation:none; }
  *{ transition:none !important; }
}

/* ---------- SCROLLBAR ---------- */
::-webkit-scrollbar{ width: 7px; height: 7px; }
::-webkit-scrollbar-track{ background: rgba(12,13,16,.72); }
::-webkit-scrollbar-thumb{
  background: rgba(255,255,255,.16);
  border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover{
  background: rgba(88,101,242,.55);
}

/* ---------- LAYOUT ---------- */
.layout{
  width:100%;
  height:100%;
  display:flex;
  perspective: 1400px;
}
.main{
  flex:1;
  min-width: 0;
  height:100%;
  display:flex;
  flex-direction:column;
  position:relative;
  overflow:hidden;
  transform-style: preserve-3d;
}
.content{
  flex:1;
  min-height:0;
  overflow:auto;
  position:relative;
  background: transparent;
}

/* ---------- TOPBAR ---------- */
.topbar{
  height: var(--topbar-h);
  flex-shrink:0;
  display:flex;
  align-items:center;
  justify-content:flex-end;
  padding: 0 18px;
  position:relative;
  z-index:60;

  background:
    radial-gradient(160px 70px at 22% 12%, rgba(255,255,255,.10), transparent 65%),
    linear-gradient(180deg, rgba(18,20,26,.92), rgba(10,11,14,.78));
  border-bottom: 1px solid rgba(255,255,255,.08);
  box-shadow:
    0 1px 0 rgba(255,255,255,.05),
    0 14px 45px rgba(0,0,0,.42);
  backdrop-filter: blur(14px) saturate(135%);
}
.topbar:after{
  content:"";
  position:absolute;
  left:0; right:0; bottom:-1px;
  height:2px;
  background: linear-gradient(90deg, transparent, rgba(124,245,255,.18), rgba(155,123,255,.16), transparent);
  opacity:.75;
  filter: blur(.2px);
}

/* login/join */
.ht-login-btn, .ht-join-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  text-decoration:none;
  font-weight: 900;
  font-size: 13px;
  padding: 9px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.04);
  color: var(--txt);
  box-shadow: 0 10px 26px rgba(0,0,0,.28), var(--inset);
  backdrop-filter: blur(10px);
  transition: transform .16s ease, border-color .16s ease, filter .16s ease;
  margin-left: 8px;
}
.ht-login-btn:hover, .ht-join-btn:hover{
  transform: translateY(-1px);
  border-color: rgba(124,245,255,.22);
  filter: brightness(1.08);
}
.ht-join-btn{
  background:
    radial-gradient(120px 70px at 28% 25%, rgba(255,255,255,.20), transparent 62%),
    linear-gradient(135deg, rgba(88,101,242,1), rgba(155,123,255,.92));
  border-color: rgba(88,101,242,.35);
  box-shadow:
    0 16px 40px rgba(88,101,242,.25),
    0 8px 22px rgba(155,123,255,.14);
}

/* user button */
#ht-user-btn-wrap{ position:relative; }
#ht-user-btn{
  display:flex;
  align-items:center;
  gap:10px;
  padding: 6px 10px;
  border-radius: 12px;
  cursor:pointer;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.03);
  box-shadow: 0 12px 28px rgba(0,0,0,.26), var(--inset);
  backdrop-filter: blur(12px);
  transition: transform .16s ease, border-color .16s ease;
}
#ht-user-btn:hover{
  transform: translateY(-1px);
  border-color: rgba(124,245,255,.22);
}
.chat-avatar{
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,.12);
  box-shadow: 0 0 0 3px rgba(88,101,242,.10);
}

/* dropdown */
#ht-user-panel{
  display:none;
  position:absolute;
  top: calc(var(--topbar-h) - 6px);
  right: 0;
  width: 270px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.10);
  background:
    radial-gradient(240px 120px at 20% 0%, rgba(124,245,255,.10), transparent 65%),
    radial-gradient(240px 120px at 80% 0%, rgba(155,123,255,.08), transparent 65%),
    linear-gradient(180deg, rgba(14,16,22,.92), rgba(10,10,12,.78));
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px) saturate(140%);
  transform-origin: top right;
  animation: panelIn .18s ease;
  z-index: 2000;
}
#ht-user-btn-wrap:hover #ht-user-panel{ display:block; }
@keyframes panelIn{
  from{ opacity:0; transform: translateY(-8px) scale(.98); }
  to{ opacity:1; transform: translateY(0) scale(1); }
}
.ht-user-info{
  padding-bottom: 10px;
  margin-bottom: 10px;
  border-bottom: 1px solid rgba(255,255,255,.10);
}
.ht-user-info strong{ display:block; font-size: 15px; color: #fff; }
.ht-user-info span{ display:block; margin-top: 2px; font-size: 12px; color: rgba(233,237,245,.70); }
.ht-user-list{ list-style:none; margin:0; padding:0; }
.ht-user-list li{
  display:flex;
  justify-content:space-between;
  padding: 6px 0;
  font-size: 13px;
  color: rgba(233,237,245,.78);
}
.ht-user-list li b{
  color: #ffd36b;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  text-shadow: 0 0 12px rgba(255,211,107,.22);
}
.ht-user-actions{
  display:flex;
  gap:8px;
  margin-top: 12px;
}
.ht-user-actions a{
  flex:1;
  text-align:center;
  text-decoration:none;
  font-weight: 900;
  font-size: 12px;
  padding: 9px 10px;
  border-radius: 12px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.10);
  color: #fff;
  box-shadow: 0 12px 28px rgba(0,0,0,.20), var(--inset);
  transition: transform .16s ease, border-color .16s ease, filter .16s ease;
}
.ht-user-actions a:hover{
  transform: translateY(-1px);
  border-color: rgba(124,245,255,.22);
  filter: brightness(1.06);
}
.ht-user-actions a:last-child{
  background: rgba(231,76,60,.12);
  border-color: rgba(231,76,60,.22);
  color: rgba(255,120,120,.95);
}

/* ---------- SIDEBAR: Starforge glass metal ---------- */
.sidebar{
  width: var(--sidebar-w);
  height:100%;
  display:flex;
  flex-direction:column;
  position:relative;
  z-index:80;

  background:
    radial-gradient(320px 180px at 20% 0%, rgba(124,245,255,.10), transparent 60%),
    radial-gradient(320px 180px at 80% 0%, rgba(155,123,255,.08), transparent 60%),
    linear-gradient(180deg, rgba(14,16,22,.92), rgba(10,10,12,.92));
  border-right: 1px solid rgba(255,255,255,.10);
  box-shadow: 8px 0 40px rgba(0,0,0,.45);
  backdrop-filter: blur(14px) saturate(140%);
  transform: translateZ(0);
  overflow:hidden;
}
.sidebar:before{
  content:"";
  position:absolute;
  inset:-2px;
  pointer-events:none;
  background:
    conic-gradient(from 180deg at 50% 50%,
      rgba(124,245,255,.0),
      rgba(124,245,255,.22),
      rgba(155,123,255,.18),
      rgba(53,255,158,.14),
      rgba(124,245,255,.0)
    );
  filter: blur(12px);
  opacity:.55;
}
.sidebar:after{
  content:"";
  position:absolute;
  inset:0;
  pointer-events:none;
  background:
    repeating-linear-gradient(180deg,
      rgba(255,255,255,.05),
      rgba(255,255,255,.05) 1px,
      transparent 2px,
      transparent 7px
    );
  opacity:.14;
  mix-blend-mode: overlay;
}

.server-title{
  height: var(--topbar-h);
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight: 1000;
  letter-spacing: 1.2px;
  color:#fff;
  position:relative;
  z-index:2;

  background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(0,0,0,.20));
  border-bottom: 1px solid rgba(255,255,255,.08);
  box-shadow: 0 1px 0 rgba(255,255,255,.06);
  text-shadow:
    0 0 10px rgba(88,101,242,.30),
    0 0 22px rgba(124,245,255,.18),
    0 0 30px rgba(155,123,255,.12);
}
/* categories */
.channel-category{
  display:flex;
  align-items:center;
  gap:10px;
  padding: 14px 14px 8px;
  margin-top: 8px;
  color: rgba(233,237,245,.55);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .8px;
  text-transform: uppercase;
  position:relative;
  z-index:2;
}
.channel-category:after{
  content:"";
  flex:1;
  height:1px;
  background: linear-gradient(90deg, rgba(255,255,255,.10), transparent);
  opacity:.65;
}
.channel-category span{
  padding: 0;
}

/* menu list */
.sidebar ul{
  list-style:none;
  margin:0;
  padding: 6px 10px 10px;
  flex:1;
  overflow:auto;
  position:relative;
  z-index:2;
}
.menu-item-board{ margin: 2px 0; }

.menu-link-board{
  --mx: 50%;
  position:relative;
  display:flex;
  align-items:center;
  gap:10px;
  padding: 11px 12px;
  border-radius: 14px;
  text-decoration:none;

  color: rgba(233,237,245,.72);
  border: 1px solid rgba(255,255,255,.06);
  background:
    radial-gradient(240px 120px at var(--mx) 50%, rgba(88,101,242,.18), transparent 62%),
    linear-gradient(180deg, rgba(255,255,255,.04), rgba(0,0,0,.10));
  box-shadow: 0 10px 26px rgba(0,0,0,.22), var(--inset);
  transition: transform .16s ease, border-color .16s ease, filter .16s ease;
  overflow:hidden;
}
.menu-link-board:before{
  content:"";
  position:absolute;
  inset:-2px;
  background: linear-gradient(90deg, transparent, rgba(124,245,255,.35), transparent);
  transform: translateX(-120%);
  filter: blur(1px);
  opacity:.8;
  pointer-events:none;
}
.menu-link-board:hover{
  transform: translateY(-1px);
  border-color: rgba(124,245,255,.18);
  filter: brightness(1.08);
}
.menu-link-board:hover:before{
  transform: translateX(120%);
  transition: transform .65s ease;
}
.menu-link-board.active{
  border-color: rgba(88,101,242,.35);
  background:
    radial-gradient(260px 140px at 40% 50%, rgba(88,101,242,.26), transparent 62%),
    linear-gradient(135deg, rgba(88,101,242,.20), rgba(155,123,255,.12));
}
.menu-link-board.active:after{
  content:"";
  position:absolute;
  left:0;
  top: 12%;
  bottom: 12%;
  width: 3px;
  border-radius: 0 8px 8px 0;
  background: linear-gradient(180deg, rgba(124,245,255,.80), rgba(88,101,242,.95));
  box-shadow: 0 0 18px rgba(88,101,242,.38);
}
.ch-icon{
  font-size: 16px;
  filter: saturate(.9);
  opacity:.92;
}
.ch-name{
  font-size: 13.5px;
  font-weight: 900;
  letter-spacing: -.2px;
  flex:1;
}

/* bottom user card */
.user-card{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding: 12px 12px;
  border-top: 1px solid rgba(255,255,255,.08);
  background: linear-gradient(180deg, rgba(255,255,255,.03), rgba(0,0,0,.20));
  position:relative;
  z-index:2;
}
.user-status{
  font-size: 16px;
  font-weight: 900;
  color: rgba(233,237,245,.75);
  letter-spacing: .2px;
}
.icon-btn{
  border:none;
  background: rgba(255,255,255,.05);
  color: rgba(233,237,245,.75);
  width: 38px;
  height: 34px;
  border-radius: 12px;
  cursor:pointer;
  border: 1px solid rgba(255,255,255,.08);
  box-shadow: 0 10px 24px rgba(0,0,0,.22), var(--inset);
  transition: transform .16s ease, border-color .16s ease, filter .16s ease;
}
.icon-btn:hover{
  transform: translateY(-1px) rotate(10deg);
  border-color: rgba(124,245,255,.18);
  filter: brightness(1.06);
}

/* ---------- MAIN: depth reaction when sidebar active (mobile) ---------- */
.sidebar.active ~ .main{
  transform: translateX(0) rotateY(-7deg) translateZ(-10px) scale(.985);
  transform-origin: left center;
  transition: transform .28s cubic-bezier(.4,0,.2,1), filter .28s cubic-bezier(.4,0,.2,1);
  filter: blur(1.5px) brightness(.78) saturate(.95);
}
.sidebar.active ~ .main:before{
  content:"";
  position:absolute;
  inset:0;
  background: rgba(0,0,0,.55);
  z-index: 55;
}

/* ---------- MOBILE MENU BUTTON ---------- */
#menuToggle.mobile-menu-btn-site{
  position: fixed;
  top: 10px;
  left: 12px;
  width: 38px;
  height: 38px;
  display:none;
  align-items:center;
  justify-content:center;
  z-index: 2147483647;

  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.10);
  background:
    radial-gradient(120px 70px at 30% 20%, rgba(255,255,255,.14), transparent 62%),
    rgba(0,0,0,.35);
  color: rgba(233,237,245,.92);
  font-size: 18px;
  font-weight: 900;
  cursor:pointer;
  box-shadow: 0 14px 38px rgba(0,0,0,.42), var(--inset);
  backdrop-filter: blur(10px);
  transition: transform .16s ease, border-color .16s ease, filter .16s ease;
}
#menuToggle.mobile-menu-btn-site:hover{
  transform: translateY(-1px);
  border-color: rgba(124,245,255,.18);
  filter: brightness(1.08);
}

/* ---------- CONTENT CONTAINER: safe-area + stable vh ---------- */
.content{
  padding: 0;
  min-height: 0;
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 768px){
  .layout{ display:block; }
  #menuToggle.mobile-menu-btn-site{ display:flex; }

  .topbar{
    padding-left: 60px;
    justify-content:flex-end;
  }

  .server-title{ display:none !important; }

  .sidebar{
    position: fixed;
    top: 0;
    left: -100vw;
    width: 100vw;
    height: 100svh; /* stable viewport height */
    z-index: 2000;
    border-right: none;
    box-shadow: 0 26px 80px rgba(0,0,0,.62);
    transition: left .26s cubic-bezier(.4,0,.2,1);
  }
  .sidebar.active{ left: 0; }

  .main{
    width: 100%;
    height: 100svh;
  }
  .content{
    height: calc(100svh - var(--topbar-h));
    padding-bottom: calc(18px + env(safe-area-inset-bottom));
  }
}

/* ---------- OPTIONAL: make inner board containers look premium by default ---------- */
.board-container{
  width:100%;
  min-height: 100%;
  padding: 18px;
}
.board-header{
  border-radius: var(--radius);
  border: 1px solid rgba(255,255,255,.10);
  background:
    radial-gradient(520px 240px at 18% 0%, rgba(124,245,255,.10), transparent 60%),
    radial-gradient(520px 240px at 82% 0%, rgba(155,123,255,.08), transparent 60%),
    linear-gradient(180deg, rgba(16,18,24,.70), rgba(10,10,12,.40));
  box-shadow: var(--shadow2), var(--inset);
  overflow:hidden;
}
.board-title{
  background: linear-gradient(90deg, #fff, rgba(124,245,255,.95), rgba(155,123,255,.92));
  -webkit-background-clip:text;
  -webkit-text-fill-color:transparent;
  text-shadow:
    0 0 22px rgba(124,245,255,.18),
    0 0 34px rgba(155,123,255,.12);
}

/* Fix last-line clipping on mobile */
.view-box{
  overflow: visible;
  padding-bottom: calc(60px + env(safe-area-inset-bottom));
  word-break: break-word;
  line-height: 1.7;
}

/* Keep generic buttons consistent if reused */
.btn-write{
  border:none;
  cursor:pointer;
  font-weight: 1000;
  border-radius: 999px;
  background:
    radial-gradient(120px 70px at 30% 20%, rgba(255,255,255,.20), transparent 62%),
    linear-gradient(135deg, rgba(88,101,242,1), rgba(155,123,255,.92));
  color:#fff;
  box-shadow:
    0 16px 44px rgba(88,101,242,.26),
    0 10px 24px rgba(155,123,255,.14);
  transition: transform .16s ease, filter .16s ease;
}
.btn-write:hover{ transform: translateY(-1px); filter: brightness(1.08); }

.btn-back{
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.04);
  color: rgba(233,237,245,.78);
  border-radius: 999px;
  cursor:pointer;
  box-shadow: 0 12px 28px rgba(0,0,0,.22), var(--inset);
  backdrop-filter: blur(10px);
}

/* ---------- SAFETY: prevent layout blowups ---------- */
img{ max-width:100%; height:auto; }
a{ color: inherit; }


@media (max-width: 768px){
  .sidebar ul{
    padding-top: 60px;   /* 원하는 만큼 조절 (50~80px 사이 추천) */
  }
}

body{
  background:#0f1115;
  color:#e6edf3;
}
/*      홈버튼      */
.server-title{
  display:flex;
  align-items:center;
  gap:12px;
  font-size:20px;
  font-weight:600;
}

.home-btn{
  width:38px;
  height:38px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius:12px;
  background:#1a1f2b;
  border:1px solid #222938;
  text-decoration:none;
  transition:all .25s ease;
}

.home-ico{
  width:20px;
  height:20px;
  fill:#fff;
  transition:all .25s ease;
}

/* hover 네온 발광 */
.home-btn:hover{
  border-color:#00e0ff;
  box-shadow:
    0 0 8px rgba(0,224,255,.6),
    0 0 18px rgba(0,224,255,.5),
    0 0 30px rgba(0,224,255,.4);
  transform:translateY(-2px);
}

.home-btn:hover .home-ico{
  fill:#00e0ff;
  filter:drop-shadow(0 0 6px #00e0ff);
}

.home-btn:active{
  transform:translateY(0);
  box-shadow:
    0 0 6px rgba(0,224,255,.4);
}




/* ---------- setting_info.php ---------- */
#settingsModal * { 
box-sizing:border-box; }
#settingsModal{position:fixed;inset:0;background:rgba(0,0,0,.6);display:flex;align-items:center;justify-content:center;z-index:9999;}
.settings-modal{display:flex;width:800px;height:500px;background:#111;border-radius:12px;overflow:hidden;}
.settings-sidebar{width:180px;background:#0d1117;padding:15px;}
.menu-item{padding:12px;color:#ccc;cursor:pointer;}
.menu-item.active{background:#1f6feb;color:#fff;}
.settings-content{flex:1;padding:20px;overflow:auto;}
.avatar-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:10px;}
.avatar-item{width:80px;border-radius:50%;cursor:pointer;}
.tab{display:none;} .tab.active{display:block;}

.msg-delete {
  display: flex;
  gap: 6px;
  align-items: center;
}

.msg-toolbar {
  display: flex;
  gap: 6px;
  align-items: center;
}

.msg-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: none;
  background: rgba(0,0,0,0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.msg-btn:hover {
  background: rgba(0,0,0,0.1);
  transform: translateY(-1px);
}

.msg-btn:active {
  transform: scale(0.96);
}

.msg-btn:focus-visible {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

/* reply는 조금 중립 */
.msg-reply {
  color: #fff;
}

/* emoji는 강조 */
.msg-emoji {
  color: #FF0000;
  background: rgba(37,99,235,0.1);
}

.msg-emoji:hover {
  background: rgba(37,99,235,0.18);
}




/* 카테고리 구분선 */
.channel-category {
    display: flex; align-items: center; justify-content: center;
    color: var(--text-muted); font-size: 11px; font-weight: 700;
    margin: 24px 0 12px 0; letter-spacing: 0.5px; text-transform: uppercase;
}
.channel-category span { padding: 0 10px; background: transparent; position: relative; z-index: 1; }
.channel-category::before, .channel-category::after {
    content: ''; flex: 1; height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
}

/* 아이콘 & 텍스트 */
.ch-icon { margin-right: 10px; font-size: 16px; filter: grayscale(100%); transition: 0.2s; }
.ch-name { font-size: 14px; font-weight: 600; flex: 1; }
.message-icon-board, .message-icon-notice { display:none; } /* 기존 아이콘 숨김 (깔끔하게 텍스트 아이콘 사용) */

/* 메뉴 호버/활성 효과 */
.menu-link-board:hover, .menu-link-board.active {
    background: rgba(255,255,255,0.06); color: #fff;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.05);
}
.menu-link-board.active { background: rgba(88, 101, 242, 0.2); }
.menu-link-board:hover .ch-icon, .menu-link-board.active .ch-icon { filter: grayscale(0); transform: scale(1.1); text-shadow: 0 0 8px var(--accent-glow); }
.menu-link-board.active::before {
    content: ""; position: absolute; left: 0; top: 10%; bottom: 10%; width: 3px;
    background: var(--accent-primary); border-radius: 0 4px 4px 0;
    box-shadow: 0 0 10px var(--accent-primary);
}
