
#contest .header {
  background: #e6e6e6;
  height: 72px;
  display:flex; align-items:center; padding:0 20px;
  border-radius: 12px; margin: 16px;
}
#contest .header h1 { font-size: 20px; margin: 0; }
#contest .notice {
  display:flex; align-items:center; gap:10px;
  background: #fff3cd;
  color:#5c4701;
  padding: 12px 16px;
  border: 1px solid #ffe69c;
  border-radius: 10px;
  margin: 12px 16px 4px;
  font-size: 14px;
}
#contest .notice .icon { font-size: 18px; }
#contest .filters {
  display:flex; gap:10px; flex-wrap: wrap;
  margin: 8px 16px 12px;
}
#contest .chip {
  border: 1px solid #ddd;
  background: #fff;
  color: #444;
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 14px;
}
#contest .chip-active {
  background: #7a1e2b;
  color: #fff;
  border-color: #7a1e2b;
}
#contest .grid {
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  gap: 30px;
  padding: 8px 30px 24px;
  max-width: 1200px;
  margin: auto;
}
@media (min-width: 700px) {
  #contest .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
  #contest .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
#contest .card {
  background:#fff;
  border-radius:15px;
  overflow:hidden;
  box-shadow: 0 4px 16px rgba(0,0,0,.06);
  display:flex; flex-direction:column;
}
#contest .card-top {  
  color:#fff;
  padding:0px 5px;
  display:flex; align-items:center; justify-content:space-between;
  font-size:13px;
}

#contest .card .card-top {
  background-color: #535353; /* 기본색 */
  transition: background-color 0.3s ease; /* 부드럽게 전환 */
}

#contest .card:hover .card-top,
#contest .card:hover .thumb {
  background-color: #A01749; /* 마우스오버시 */
}

#contest .badge {
  /* background:#535353; */
  padding:6px 10px;
  border-radius:8px;
}
#contest .tag {
  background:#eee;
  color:#333;
  border-radius:12px;
  font-size:12px;
  padding:4px 10px;
}
#contest .thumb { 
  background:#535353; display:flex; 
  transition: background-color 0.3s ease; /* 부드럽게 전환 */
}
#contest .thumb-placeholder { width: 100%;
  overflow: hidden; height: 202px; align-items:center; justify-content:center; 
  border-top-left-radius: 10px;
  border-top-right-radius: 10px;  
  aspect-ratio: 16 / 9; /* 원하는 비율: 16:9 */
}

#contest .thumb-placeholder img { 
    display: block;   
    width: 100%;       
    height: 100%;
    object-fit: cover; /* 잘라서 꽉 채우기 */
}

#contest .card-body { background:#fff; height:126px; padding: 8px; cursor: pointer;}
#contest .card-body h3 { margin:0; font-size:15px; font-family: Noto Sans KR; line-height: 26px;}
#contest .card-body .card-content { margin-top:10px;  font-family: Noto Sans KR; color:#808080; font-size: 13px; font-weight: normal; line-height: 19px;}




/* 카드 하단 영역 */ 

#contest .card-foot {
  background:#fff;
  display:flex; align-items:center; gap:10px;
  justify-content: space-between; /* ✅ 양끝 정렬 */
  padding: 12px 14px;
  border-top:1px solid #eee;
}

#contest .stat {
  display:inline-flex; align-items:center; gap:6px;
  /* background:#fff; */
  border:1px solid #eee;
  border-radius:10px;
  padding:8px 15px;
  font-size:14px;
}

#contest .stat .la-comment {
  display:inline-flex; align-items:center; gap:6px;   
  font-size:20px;
}

#contest .like-btn{
    display:inline-flex; align-items:center; gap:8px; padding:6px 12px; border:1px solid #f2c9d4;
    border-radius:8px; background:#808080; color:var(--accent); cursor:pointer; font-weight:700;
    color: #fff;
}
#contest .like-btn .la-heart{ font-size:16px; color:#fff}

@media (hover: hover) and (pointer: fine) {
    #contest .like-btn:hover{ background:#A01749; }
}

#contest .like-btn.liked {
    background: #A01749;
}
#contest .page-foot {
  text-align:center; color:#888; font-size:12px; padding-bottom:24px;
}



/* 페이지 롤링처리 */ 

#contest .data-item {
    padding: 5px 0;
    border-bottom: 1px solid #eee;
    opacity: 0;                /* 처음에 보이지 않음 */
    transition: opacity 0.6s;  /* CSS 트랜지션 */
}

#contest .data-item.show {
    opacity: 1;                /* 표시될 때 서서히 나타남 */
}

#contest #loading {
    text-align: center;
    padding: 10px;
    display: none;
}

#contest #modal {
    display: flex;                 /* 항상 flex 구조 */
    justify-content: center;
    align-items: center;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000000000;
    opacity: 0;                    /* 초기 상태 투명 */
    visibility: hidden;            /* 보이지 않게 처리 */
    transition: opacity 0.2s ease; /* 부드러운 전환 */
}

#contest #modal.show {
    opacity: 1;
    visibility: visible;
}

/* 카드 본문 */ 

#contest #modal .top-row{
    display:flex; align-items:center; gap:12px; margin-bottom:10px;
}
#contest #modal .chip{
    display:inline-flex; align-items:center; gap:6px; padding:6px 10px; border-radius:999px;
    background:var(--chip); color:#666; font-weight:600; font-size:14px;
}
#contest #modal .title-row{
    display:flex; align-items:flex-end; justify-content:space-between; gap:16px; margin:4px 0 12px;
}
#contest #modal .title{
    font-size:20px; font-weight:800; color:var(--txt);
}
#contest #modal .view{
    color:#999; font-size:13px; white-space:nowrap;
}

/* 닫기 버튼 (우상단) */
#contest #modal .close-btn{
    position:absolute; top:10px; right:12px; font-size:24px; line-height:1; cursor:pointer; color:#666;
user-select:none;
}
#contest #modal .close-btn:hover{color:#000;}

/* 미디어 박스(회색) */
#contest #modal .media{
    width:100%; aspect-ratio:16/9; background:#d9d9d9; border-radius:8px;
    display:flex; align-items:center; justify-content:center; color:#666; font-weight:700;
}

/* 작품 텍스트 */
#contest #modal .work-text{
    margin:16px 2px 24px; color:#333; min-height:40px;
    white-space: normal;       /* 텍스트 자동 줄내림 */
    word-break: break-word;    /* 긴 단어도 강제로 줄바꿈 */
    line-height: 1.5;
}

#contest #modal .work-text img {
    max-width: 100%;    /* 부모 영역(.work-text)의 100%까지만 */
    height: auto;       /* 비율 유지 */
    display: block;     /* inline-block이 아닌 블록으로 */
    margin: 10px 0;
}

/* work-text 내부 iframe (유튜브 등) */
#contest #modal .work-text iframe {
    max-width: 100%;     /* 모달 너비 안에서 제한 */
    width: 100%;         /* 반응형 크기 */
    height: auto;        /* 기본 높이는 자동 */
    aspect-ratio: 16/9;  /* 최신 브라우저: 16:9 비율 유지 */
    display: block;
    margin: 10px 0;
}

/* aspect-ratio 미지원 브라우저 fallback */
#contest #modal .work-text .video-wrapper {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 비율 */
    height: 0;
    overflow: hidden;
}
#contest #modal .work-text .video-wrapper iframe {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
}

/* 좋아요 & 댓글 수 */
#contest #modal .action-bar{
  display:flex; align-items:center; justify-content:space-between;   
  padding-left: 12px; padding-right: 24px; padding-top: 12px; padding-bottom: 12px;  
  background:#F6F6F6; border-top: 1px solid #DADADA;
}
#contest #modal .comment-count{ color:#444; font-weight:700; font-size: 17px;}
#contest #modal #cmt-count{color: #7a1e2b;}

/* 모달창내 댓글 */ 
#contest #modal #comment-form{
    display:flex; gap:8px; background:#F6F6F6;
    padding-left: 24px; padding-right: 24px; padding-top: 12px; padding-bottom: 12px;
    border-bottom: 2px solid #DADADA;
}
#contest #modal #comment-input{
    flex:1; height:44px; border:1px solid var(--line); border-radius:6px; padding:0 14px; font-size:14px;
}
#contest #modal #comment-form button{
    height:44px; padding:0 18px; border:none; border-radius:10px; background:#9d2b4b; color:#fff; font-weight:700; cursor:pointer;
}
#contest #modal #comment-form button:hover{ filter:brightness(.95); }

#contest #modal .reply-input{
    flex:1; height:44px; border:1px solid #DADADA; border-radius:6px; padding:0 14px; font-size:14px;
    width:100%;
}
#contest #modal .edit-input{
    flex:1; height:44px; border:1px solid #DADADA; border-radius:6px; padding:0 14px; font-size:14px;
    width:100%;
}


/* 모달 콘텐츠 */
#contest .modal-content {
    background: #fff;        
    position: relative;        
    z-index: 10000;                
    width:min(1200px, 100%);         
    border-radius:10px;
    box-shadow:0 20px 40px rgba(0,0,0,.18); 
    padding:28px 28px 20px;
    height: 80%;
    max-height:calc(100dvh - 48px); 
    overflow:auto;
    margin: 0 auto;
    word-wrap: break-word; /* 긴 단어도 줄바꿈 */
    overflow-wrap: break-word;
}

/* 애니메이션 */
@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to   { opacity: 1; transform: scale(1); }
}

/* 📱 반응형 - 모바일 화면 대응 */
@media (max-width: 640px) {
    #contest .modal-content {
        width: 90%;       /* 화면의 90% 차지 */
        padding: 15px;
    }
}


/* 댓글 영역 */
#contest #comment-list {
    margin-top: 15px;
    max-height: 400px;
    overflow-y: auto;
    /* border: 1px solid #ddd; */
    padding: 10px;
}
#contest .comment-item, .reply-item {
    padding-top: 15px;
    padding-bottom : 26px;
    border-bottom: 1px solid #eee;
}

#contest .comment-item .reply-item:last-child {
    border-bottom: none;
}


#contest .comment-header {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  justify-content: space-between;
}
#contest .comment-name { font-weight: bold; }
#contest .comment-date { color: #888; font-size: 12px; }
#contest .comment-actions button {
  margin-left: 5px;
  font-size: 12px;
  cursor: pointer;
}
#contest .comment-text { margin-top: 5px; margin-left: 7px; font-size: 14px; white-space: pre-line; }
#contest .reply-form input {
  padding: 4px;
  font-size: 13px;
}
#contest .reply-form button {
  margin-left: 5px; font-size: 13px; height:24px; padding:0 10px; border:none; border-radius:10px; background:#9d2b4b; color:#fff; font-weight:700; cursor:pointer;
}

#contest .edit-form button {
  margin-left: 5px; font-size: 13px; height:24px; padding:0 10px; border:none; border-radius:10px; background:#9d2b4b; color:#fff; font-weight:700; cursor:pointer;
}

#contest .comment-actions .reply-btn {
    height:24px; padding:0 10px; border:none; border-radius:10px; background:#9d2b4b; color:#fff; font-weight:700; cursor:pointer;
}

#contest .comment-actions .edit-btn {
    height:24px; padding:0 10px; border:none; border-radius:10px; background:#9d2b4b; color:#fff; font-weight:700; cursor:pointer;
}

#contest .comment-actions .delete-btn {
    height:24px; padding:0 10px; border:none; border-radius:10px; background:#9d2b4b; color:#fff; font-weight:700; cursor:pointer;
}

#contest .comment-actions button:hover{ filter:brightness(.65); }





/* 상단 영역 CSS */ 

#contest .contest-container {
  width: 100%;
  height: auto;
  padding: 36px 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-start; /* 기본은 위쪽 */
  align-items: center;
  gap: 16px;
}

#contest .contest-container .event-badge {
  width: 242px;
  height: auto;
  padding: 12px 20px;
  background: var(--Purple500, #A01749);
  border-radius: 50px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-top : 20px;
}

#contest .contest-container .event-badge-text {
  text-align: center;
  color: var(--White, #fff);
  font-size: 17px;
  font-family: 'Noto Sans KR', sans-serif;
  font-weight: 700;
  line-height: 26px;
  word-wrap: break-word;
}

#contest .contest-container .event-description {
  align-self: stretch;
  text-align: center;
  padding: 0 10px; /* 모바일에서 양옆 여백 */
}

#contest .contest-container .event-title {
  color: #000;
  font-size: 32px;
  font-family: 'Noto Sans KR', sans-serif;
  font-weight: 700;
  line-height: 36px;
  word-wrap: break-word;
}

#contest .contest-container .event-subtitle {
  color: #000;
  font-size: 24px;
  font-family: 'Noto Sans KR', sans-serif;
  font-weight: 400;
  line-height: 36px;
  word-wrap: break-word;
}

/* 📱 모바일 (≤600px) : 세로 가운데 정렬 + 글자 축소 */
@media (max-width: 600px) {
  #contest .contest-container {
    justify-content: center;  /* ✅ 세로 가운데 정렬 */
    padding: 0;               /* 상하 여백 제거 */
  }

  #contest .contest-container .event-badge {
    width: auto;
    padding: 10px 16px;
  }

  #contest .contest-container .event-badge-text {
    font-size: 14px;
    line-height: 20px;
  }

  #contest .contest-container .event-title {
    font-size: 22px;
    line-height: 28px;
  }

  #contest .contest-container .event-subtitle {
    font-size: 16px;
    line-height: 22px;
  }
}

/* 📱 더 작은 화면 (≤400px) */
@media (max-width: 400px) {
  #contest .contest-container .event-title {
    font-size: 18px;
    line-height: 24px;
  }

  #contest .contest-container .event-subtitle {
    font-size: 14px;
    line-height: 20px;
  }
}

  
/* 상단 영역 CSS 종료 */ 




/* 안내영역 */ 

#contest .contest-info {
  width: 100%;
  padding: 12px 0;
  background: #FFF9E5;
  text-align: center;
}

#contest .contest-info .info-text {
  color: var(--Purple500, #A01749);
  font-size: 17px;
  font-family: 'Noto Sans KR', sans-serif;
  font-weight: 400;
  line-height: 26px;
}



/* 상단 카테고리 탭 매뉴 */ 

#contest .contest-categories {
  width: 100%;
  padding: 24px 0;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap; /* 모바일 대응 */
}

#contest .contest-categories .show_media {
  padding: 12px 20px;
  border-radius: 100px;
  font-size: 15px;
  font-family: 'Noto Sans KR', sans-serif;
  line-height: 26px;
  cursor: pointer;
  border: 1px solid var(--Grey200, #DADADA);
  background: var(--Grey100, #F6F6F6);
  color: var(--Grey700, #535353);
  font-weight: 400;
  text-align: center;
  min-width: 80px;
  transition: all 0.2s ease;
}

/* 📱 모바일 (≤600px) : 세로 가운데 정렬 + 글자 축소 */
@media (max-width: 600px) {

    #contest .contest-categories {
        width: 100%;
        padding: 20px 0;
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 10px;
        flex-wrap: wrap; /* 모바일 대응 */
    }

    #contest .contest-categories .show_media {
        padding: 5px 5px;
        border-radius: 100px;
        font-size: 15px;
        font-family: 'Noto Sans KR', sans-serif;
        line-height: 26px;
        cursor: pointer;        
        text-align: center;
        min-width: 70px;
        transition: all 0.2s ease;
    }
}





#contest .contest-categories .show_media:hover {
  background: #e0e0e0;
  color: #000;
}
#contest .contest-categories .show_media.active {
  background: var(--Purple500, #A01749);
  color: #fff;
  font-weight: 700;
  border: none;
}
#contest .contest-categories .show_media.initial-active {
  box-shadow: 0 0 0 2px var(--Purple500, #A01749);
  position: relative;
  z-index: 1; /* 다른 hover 효과 위에 오도록 */
}
/* 상단 카테고리 탭 매뉴 종료  */


/* 맨 하단 유의사항  */ 
#contest .notice-wrapper {  
  max-width: 1200px;
  background: var(--Grey100, #F6F6F6);
  border-top: 2px solid var(--Grey200, #DADADA);
  padding: 24px 36px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-bottom: 50px;
}
#contest .notice-title {
  text-align: left;
  color: var(--Grey800, #333333);
  font-size: 20px;
  font-family: "Noto Sans KR", sans-serif;
  font-weight: 700;
  line-height: 26px;
}
#contest .notice-list {
  list-style: disc;
  padding-left: 20px;
  margin: 0;
}
#contest .notice-list li {
  color: var(--Grey800, #333333);
  font-size: 13px;
  font-family: "Noto Sans KR", sans-serif;
  font-weight: 400;
  line-height: 19px;
  margin-bottom: 8px;
}
#contest .notice-wrapper .notice-list .la-heart{ font-size:14px; color:#A01749}
#contest .notice-wrapper li {
  list-style-type: decimal; /* 점(●) 목록 표시 */
}

