* { margin: 0; padding: 0; }
body { font-family: 'Helvetica', sans-serif; }
li { list-style: none; }
a { color : white; text-decoration: none; }

a.special-link {
    color: black;
}

#main_header > h4 {
    color: white;
}
#main_header > a, #main_header > label {
    display: block;
    height: 32px;
    position: absolute;
}

/* 토글 구현 */
#toggle { display: none; }
#toggle + #wrap > #toggle_gnb_wrap { display: none; }
#toggle:checked + #wrap > #toggle_gnb_wrap { display: block; }

/* 레이아웃 색상 */
#toggle_gnb_wrap {
    background: #363636;
    padding: 15px;
}
#toggle_gnb {
    background: #FFFFFF;
    padding: 15px;
}

/* 토글 목록 */
#toggle_gnb > ul { overflow: hidden; }
#toggle_gnb > ul > li {
    width: 80px; float: left;
}

#top_gnb { 
    overflow: hidden;
    border-bottom: 1px solid black;
    /* background: #B42111; */
    background: #008080;
    font-weight: bold;
    /* background: url('source/ch_6/header_background_3.png'); */
    display: flex;
    flex-wrap: wrap; /* 항목이 줄바꿈되도록 설정 */
    /* justify-content: space-around; */ /* 항목 간격을 균등하게 배치 */
}
/* #top_gnb > div {
    flex-grow: 1; 모든 항목이 동일한 너비를 갖도록 함
} */

#top_gnb > div > a {
    /* 수평 정렬 */
    /* float: left; width: 33.3%; */
    /* float: left; width: 20%; */

    /* 크기 및 색상, 정렬 */
    height: 35px;
    line-height: 35px;
    color: white;
    font-size: min(3.5vw, 18px); /* 화면 크기에 따라 조정하되 최대 18px 유지 */
    white-space: nowrap;
    /* padding: 0 12px; */ /* 좌우 여백 */
    display: block; /* a 태그를 블록 레벨 요소로 만들어 너비를 차지하게 함 */
    width: 100%; /* 부모 div의 전체 너비를 차지하도록 설정 */
    text-align: center; /* 텍스트를 가운데 정렬 */
}

#top_gnb > div > a.active {
    color: #00BFFF;
    font-weight: bold;
}

/*
#top_gnb > div:nth-child(1) { flex-basis: 20%; text-align: center; }
#top_gnb > div:nth-child(2) { flex-basis: 35%; text-align: center; }
#top_gnb > div:nth-child(3) { flex-basis: 25%; text-align: center; }
#top_gnb > div:nth-child(4) { flex-basis: 20%; text-align: center; }
*/
#top_gnb > div:nth-child(1) { flex-basis: 20%; text-align: center; }
#top_gnb > div:nth-child(2) { flex-basis: 20%; text-align: center; }
#top_gnb > div:nth-child(3) { flex-basis: 20%; text-align: center; }
#top_gnb > div:nth-child(4) { flex-basis: 20%; text-align: center; }
#top_gnb > div:nth-child(5) { flex-basis: 20%; text-align: center; }

#bottom_gnb {
    display: table;
    width: 100%;
    border-bottom: 1px solid black;
}

#bottom_gnb > div {
    display: table-cell;
    position: relative;
}

#bottom_gnb > div > a {
    display: block;
    height: 35px;
    line-height: 35px;
    text-align: center;
}

#bottom_gnb > div > a::before {
    display: block;
    position: absolute;
    top: 9px; left: -1px;
    width: 1px; height: 15px;
    border-left: 1px solid black;
    content: '';
}

article {
    box-sizing: border-box; /* 핵심! padding과 border를 width에 포함 */
    width: calc(100% - 30px); /* 좌우 여백 15px씩 확보 */
    max-width: 600px;
    margin: 7px auto;
    background: #fefefe;
    border: 1px solid #ccc;
    border-radius: 8px;
    padding: 10px;
    font-family: 'Segoe UI', sans-serif;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

#section_header { padding: 20px; }
/* #section_header2 { padding: 10px; } */
/* #section_article_1_index { margin: 4px; padding: 20px; text-align: center; border: 1px solid black; color: rgb(192, 7, 7); } */
#section_article_1_index { text-align: center; color: red; }
/* #section_article_2_index { padding: 20px; } */
#section_article_2_index { border: none; box-shadow: none; }
/* #section_article_3 { padding: 20px; text-align: center; border: 1px solid black; } */

/* #section_article_1_a { margin: 4px; padding: 16px; text-align: center; border: 1px solid black; color: #334D10; }
#section_article_2_a { margin: 4px; padding: 16px; text-align: center; border: 1px solid black; color: #334D10; }
#section_article_3_a { margin: 4px; padding: 16px; text-align: center; border: 1px solid black; color: #334D10; }
#section_article_4_a { margin: 4px; padding: 16px; text-align: center; border: 1px solid black; color: #334D10; }
#section_article_5_a { margin: 4px; padding: 16px; text-align: center; border: 1px solid black; color: #334D10; } */
#section_article_1_a { text-align: center; }
#section_article_2_a { text-align: center; }
#section_article_3_a { text-align: center; }
#section_article_4_a { text-align: center; }
#section_article_5_a { text-align: center; }
#section_article_6 { padding: 20px; text-align: left; border: none; box-shadow: none; }

/* 출력 버튼 자리 */
#section_article_7 { padding: 0; margin: 0 auto; text-align: center; border: none; box-shadow: none; }

#section_article_2_i { padding: 10px; text-align: center; font-size: 12px; color: gray; }
#section_article_4_i { padding: 10px; text-align: center; font-size: 12px; color: gray; }

#section_article_1_i_i { padding: 20px; text-align: center; }
#section_article_2_i_i { padding: 40px; text-align: center; }
/* #section_article_3 { padding: 20px; text-align: center; border: 1px solid black; } */
#section_article_4_i_i { padding: 20px; text-align: left; }
/* ------------------------------------------------------------------------------------------------ */    
#section_article_l1 { margin: 10px; text-align: center; }

/* ML예측 로또공 이미지 모바일 환경에 따라 반응형으로 줄바꿈 되지 않게 변경 */
.lotto-row {
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.lotto-row img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  display: block;
  /* 모바일에서 전체 너비에 맞게 줄어듦 */
  max-width: 10vw; /* 6개 볼 x 10vw = 60vw 이하 */
  min-width: 24px;  /* 너무 작아지는 것 방지 */
  height: auto;
  transition: width 0.2s;
}

/* 모바일 슬림 처리 */
@media (max-width: 600px) {
  .lotto-row img {
    width: 12vw;   /* 6개 볼: 72vw, 패딩여유 포함 */
    max-width: 44px; /* 너무 커지는 것 방지 */
    min-width: 20px;
  }
  .lotto-row {
    gap: 4px;
  }
}

#sad_1 { font-size: 11px; color: gray; }
#sad_2 { font-size: 11px; color: gray; }
#sad_3 { font-size: 11px; color: gray; }
#sad_4 { font-size: 11px; color: gray; }
#sad_5 { font-size: 11px; color: gray; }


/* #stats_t { margin: 10px; text-align: right; border-top: 1px solid #334D10; border-collapse: collapse; } */
#stats_t { margin: 10px auto; text-align: right; border-top: 1px solid #334D10; border-collapse: collapse; box-sizing: border-box; width: calc(100% - 30px); max-width: 600px; }
#stats_t th { padding: 4px; border-bottom: 1px solid #334D10; font-size: 12px; background-color: #334D10; color: white; }
#stats_t td { padding: 4px; border-bottom: 1px solid #334D10; font-size: 12px; }
.red { color: red; }
.blue { color: blue; }

#main_footer {
    padding: 10px;
    border-top: 3px solid black;
    text-align: center;
}

#t_dr { margin: auto; text-align: center; border-collapse: collapse; font-size: 12px; }
#t_dr td { vertical-align: top; }

  /* 2024.1.26 눈 내리는 효과 추가 */
  /*Keyframes*/
  @keyframes snow {
  0% {background-position: 0px 0px, 0px 0px, 0px 0px;}
   100% {background-position: 500px 1000px, 400px 400px, 300px 300px;}
  }
  
  @-moz-keyframes snow {
  0% {background-position: 0px 0px, 0px 0px, 0px 0px;}
  100% {background-position: 500px 1000px, 400px 400px, 300px 300px;}
  }
  
  @-webkit-keyframes snow {
  0% {background-position: 0px 0px, 0px 0px, 0px 0px;}
   50% {background-color:#b4cfe0;}
   100% {background-position: 500px 1000px, 400px 400px, 300px 300px; background-color:#6b92b9;}
  }
  
  @-ms-keyframes snow {
  0% {background-position: 0px 0px, 0px 0px, 0px 0px;}
   100% {background-position: 500px 1000px, 400px 400px, 300px 300px;}
  }
  
      /* background-color: #6b92b9;  */
  /* #main_header {
      background-color: #1f4061; 
      background-image: url('../img/flower1.png'), url('../img/snow3.png'), url('../img/snow2.png');
      
      -webkit-animation: snow 20s linear infinite;
      -moz-animation: snow 20s linear infinite;
      -ms-animation: snow 20s linear infinite;
      animation: snow 20s linear infinite;
  } */

  /* 2024.3.31 눈을 꽃으로 변경 */
/*
#main_header {
*/
    /* background-color: #6b92b9;  */
/*    background-color: #1f4061; 
    background-image: url('../img/flower1.png'), url('../img/snow3.png'), url('../img/snow2.png');

    -webkit-animation: snow 20s linear infinite;
    -moz-animation: snow 20s linear infinite;
    -ms-animation: snow 20s linear infinite;
    animation: snow 20s linear infinite;
}  
*/

#main_header {
    background-image: url('../img/beach_scene_pixelart_with_palm_hermitcrab.gif'), url('../img/beach_scene_pixelart_with_palm_hermitcrab_add.gif');
    background-repeat: no-repeat, repeat-x; /* 첫 번째 이미지는 반복 안함, 두 번째 이미지는 가로로 반복 */
    /* background-position: center; */
    /* background-size: cover; */ /* 화면 크기에 맞게 확대 */
    /* background-size: 100% 45px; */ /* 가로 100%, 세로 45px 고정 */
    background-size: 400px 45px, auto 45px; /* 첫 번째 이미지는 고정 크기, 두 번째 이미지는 높이 고정, 가로 자동 조절 */
    /* 자손 위치 지정 */
    position: relative;
    text-align: center;
    line-height: 45px;
}

.chat-container {
    max-width: 600px;
    width: 100%;
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    margin: 0 auto;
    box-sizing: border-box;
}

#chat-box, #ai-chat-box {
    height: 400px;
    overflow-y: auto;
    border: 1px solid #ccc;
    padding: 10px;
    padding-top: 5px; /* 상단 패딩 제거 */
    margin-bottom: 10px;
    box-sizing: border-box;

    /* 아래 속성 추가: chat-box 내부 콘텐츠를 Flexbox로 관리하여 위에서부터 정렬 */
    display: flex;         /* Flexbox 컨테이너로 설정 */
    flex-direction: column; /* 자식 요소들을 세로로 정렬 */
    align-items: flex-start; /* 자식 요소들을 가로축(이 경우 수평)의 시작점(왼쪽)에 정렬 */
    justify-content: flex-start; /* 자식 요소들을 주축(이 경우 수직)의 시작점(위쪽)에 정렬 */
}

/* 채팅 입력창과 버튼을 Flexbox로 정렬 */
.chat-container input[type="text"],
.chat-container button {
    box-sizing: border-box;
    font-size: 16px;
}

.chat-input-group {
    display: flex;
    gap: 10px; /* 요소들 사이의 간격 유지 */
    align-items: stretch; /* 높이를 동일하게 맞춤 (선택 사항) */
}

/* user-input (8 비율) */
/* .chat-input-group input[type="text"], */
.chat-input-group textarea, #ai-message-input {
    flex: 8; /* 8의 비율을 차지 */
    padding: 10px;
    resize: none;
    min-height: 44px;
    box-sizing: border-box;
    line-height: 1.5;
    height: auto;
    overflow-y: hidden;
    font-size: 16px;
    /* 다른 기존 스타일 유지 */
}

/* 전송 버튼 (1 비율) */
.chat-input-group #send-btn {
    flex: 1; /* 1의 비율을 차지 */
    padding: 0; /* 내부 아이콘이 있으므로 패딩을 0으로 하고 아이콘 크기로 조절 */
    /* 기존 스타일 유지 */
    /* background: #007bff; */
    color: #DAA520;
    border: none;
    cursor: pointer;
    white-space: nowrap; /* 텍스트가 있다면 줄바꿈 방지 */

    /* 아이콘을 위한 정렬 */
    display: flex;
    justify-content: center;
    align-items: center;
}

/* 음성 인식 버튼 (1 비율) */
.chat-input-group #speechToggleButton {
    flex: 1; /* 1의 비율을 차지 */
    padding: 0; /* 내부 아이콘이 있으므로 패딩을 0으로 하고 아이콘 크기로 조절 */
    /* 기존 스타일 유지 */
    border: none;
    border-radius: 5px; /* 기존 radius 유지 */
    cursor: pointer;
    transition: background-color 0.3s ease;
    /* background-color: #007bff; */
    color: #DAA520;

    /* 아이콘을 위한 정렬 */
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 20px; /* 아이콘 크기 (버튼 크기에 맞춰 조절) */
    /* width와 height는 flex 속성에 의해 조절되므로 제거하거나 0으로 설정 */
    width: auto;
    height: auto;
}

/* 음성 인식 중일 때 버튼 스타일 */
.speech-button.active {
    background-color: #28a745; /* 활성 상태: 녹색 */
}

/* 반응형 처리: 모바일 화면에서는 버튼이 줄바꿈되지 않도록 함 */
/* @media 쿼리는 flex 비율이 적용된 후 다시 비율을 재정의하게 되므로 주의 */
/* 8:1:1 비율을 유지하려면 @media 안의 width 설정을 제거해야 합니다. */
@media (max-width: 480px) {
    .chat-container {
        padding: 10px;
    }

    .chat-input-group {
        flex-direction: row; /* 이미 row이므로 유지 */
        /* gap: 5px;  필요하다면 모바일에서 간격을 줄일 수 있음 */
    }
}

#chat-box, #ai-chat-box {
    white-space: normal;/* pre-wrap; */ /* 줄바꿈과 공백을 유지 */
}

.user-msg {
    max-width: 70%;
    margin: 5px 0 5px auto; /* 오른쪽 정렬 */
    padding: 10px;
    background-color: #dcf8c6; /* 연한 초록 (WhatsApp 느낌) */
    border-radius: 15px 15px 0 15px;
    text-align: left;
    color: #000;
}

.bot-msg {
    max-width: 70%;
    margin: 5px auto 5px 0; /* 왼쪽 정렬 */
    padding: 10px;
    background-color: #f1f0f0;
    border-radius: 15px 15px 15px 0;
    text-align: left;
    color: #000;
}

#send-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 10px;
    font-size: 24px;  /* 아이콘 크기 */
    color: #0816B5;   /* 두산색 -> 너무 어두워서 변경함 */
}

#send-btn i {
    pointer-events: none; /* 클릭 이벤트 무시, 버튼만 클릭되게 */
}

.lotto-btn {
    display: inline-block;
    margin-top: 10px;
    padding: 10px 20px;
    font-size: 16px;
    font-weight: 600;
    background-color: #ffc107;
    color: #212529;
    border: none;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: all 0.2s ease;
    cursor: pointer;
}

.lotto-btn:hover {
    background-color: #ffb300;
    box-shadow: 0 6px 10px rgba(0,0,0,0.15);
}

.lotto-btn:active {
    background-color: #ffa000;
    transform: translateY(2px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* 2025.5.28 game01 추가 */
#game01Screen {
    width: 100vw;
    height: 40vh;
    background-color: red;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 24px;
    font-weight: bold;
    color: white;
    cursor: pointer;
}

#restartButton {
    display: none; /* 초기에는 숨김 */
    margin: 10px auto 10px; /* 위아래 여백 각 10px, 좌우 가운데 정렬 */
    padding: 10px 20px;
    font-size: 18px;
    cursor: pointer;
    border: none;
    background-color: #B42111;
    color: white;
    border-radius: 5px;
    text-align: center;
}

#restartButton:hover {
    background-color: #880000;
}

#scoreBoard {
    display: none; /* 처음에는 숨김 */
    text-align: center;
    margin-top: 10px;
}

#playerName {
    padding: 8px;
    font-size: 16px;
    width: 60%;
    margin-top: 5px;
}


/* 2025.5.30 랭킹 테이블 스타일 */
.rank-table-container {
    display: flex;
    justify-content: center; /* 완전한 가운데 정렬 */
    align-items: center;
    width: 90%;
    margin: 20px auto; /* 좌우 마진 적용 */
}

/* .rank-table { margin: 20px; text-align: right; border-top: 1px solid #334D10; border-collapse: collapse; } */
.rank-table {
    width: 90%; /* 화면 크기에 맞게 자동 조정 */
    max-width: 800px; /* 너무 커지는 걸 방지 */
    margin: 0 auto; /* 좌우 마진이 div를 통해 적용됨 */
    border-collapse: collapse;
    text-align: center;
    display: table; /* 테이블의 display 명확히 설정 */
}
.rank-table caption { text-align: left;}
.rank-table th { padding: 4px; border-bottom: 1px solid #334D10; font-size: 12px; background-color: #334D10; color: white; }
.rank-table td { padding: 4px; border-bottom: 1px solid #334D10; font-size: 12px; }

/* lotto print 스타일 */

.container {
    max-width: 1400px;
    margin: 0 auto;
    background-color: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.input-section {
    margin-bottom: 30px;
}

.input-section h2 {
    color: #333;
    margin-bottom: 15px;
}

#lottoNumbers {
    width: 100%;
    /* height: 150px; */
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    resize: vertical;
}

/* .button-group {
    margin-top: 15px;
} */
.button-group {
    margin: 10px;
}

.btn-primary {
    width: 60px;
    height: 37px;
    color: #fff;
    border-radius: 5px;
    /* padding: 0 25px; */
    font-family: 'Lato', sans-serif;
    font-weight: 500;
    background: transparent;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    /* display: inline-block; */
    display: block;
    margin: auto;
    /* box-shadow: inset 2px 2px 2px 0px rgba(255,255,255,.5), 7px 7px 20px, 0px rgba(0,0,0,.1), 4px 4px 5px 0px, rgba(0,0,0,.1); */
    outline: none;
}


.btn-primary {
    background-color: #daa520;
    background-image: linear-gradient(315deg, #daa520 0%, #e3ac21 74%);
    line-height: 30px;
    padding: 0;
    border: none;
}


.btn-primary:hover {
    background-color: #c2931c;
    background-image: linear-gradient(315deg, #c2931c 0%, #b0851a 74%);
}

.btn-secondary {
    background-color: #008CBA;
    color: white;
}

.btn-secondary:hover {
    background-color: #007399;
}

.calibration-section {
    background-color: #fff3cd;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
    border: 1px solid #ffeaa7;
}

.calibration-section h3 {
    margin-top: 0;
    color: #856404;
}


.position-up, .position-down {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

/* 중앙 영역 (이미지 및 좌우 컨트롤) 특별 처리 */
.position-center {
    display: flex;
    /* justify-content: space-between;  기존 코드 (이것 때문에 이미지가 왼쪽으로 치우침) */
    justify-content: center; /* 이미지와 좌우 컨트롤 전체를 수평 중앙에 정렬 */
    width: 100%;
    align-items: center;
    gap: 20px; /* 좌우 컨트롤과 이미지 사이의 간격 추가 (필요에 따라 조절) */
}

/* 좌측/우측 컨트롤의 패딩을 제거하거나 줄여서 이미지에 더 가깝게 만들 수 있습니다. */
.position-left, .position-right {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px; /* input과 label 사이 간격 */
    /* padding: 0 10px; 이 부분은 제거해도 됩니다. */
}

/* 필요한 경우 전체 position-control의 max-width를 조정하여 중앙 정렬이 더 잘 보이도록 합니다. */
.position-control {
    max-width: 450px; /* 이미지 너비 (268px) + 좌우 컨트롤 너비 + gap을 고려하여 충분히 넓게 설정 */
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px; /* 각 섹션 간의 수직 간격 */
}

.position-control input {
    width: 40px;
    padding: 5px;
    border: 1px solid #ddd;
    border-radius: 3px;
    text-align: center;
}

.position-control label {
    font-size: 12px;
    color: #666;
}

.position-apply {
    margin-top: 10px;
}

.preview-section {
    margin-top: 30px;
    text-align: center;
}

#lottoCanvas {
    border: 1px solid #ddd;
    display: inline-block;
    background-color: white;
}

.instructions {
    background-color: #f0f0f0;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.instructions h3 {
    margin-top: 0;
    color: #333;
}

.instructions ul {
    color: #666;
    line-height: 1.6;
}

.warning {
    background-color: #ffe6e6;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
    border-left: 4px solid #ff4444;
}

.warning h3 {
    margin-top: 0;
    color: #cc0000;
}

@media print {
    body {
        margin: 0;
        background-color: white;
    }
    .container {
        box-shadow: none;
        padding: 0;
        max-width: none;
    }
    .input-section, .instructions, .button-group, .calibration-section, .warning, h1, h2 {
        display: none;
    }
    #canvasSection {
        display: none;
    }
    #lottoCanvas {
        display: block !important;
        border: none;
        position: absolute;
        top: 0;
        left: 0;
        page-break-after: avoid;
    }
    @page {
        size: A4;
        margin: 0;
    }
}

.initial-image {
    text-align: center;
    padding-bottom: 20px; /* 이미지 아래 여백은 유지 (필요에 따라 조절) */
}

/* 게시판 스타일 */
.simple-board {
    box-sizing: border-box; /* 핵심! padding과 border를 width에 포함 */
    width: calc(100% - 30px); /* 좌우 여백 15px씩 확보 */
    max-width: 600px;
    margin: 20px auto;
    background: #fefefe;
    border: 1px solid #ccc;
    border-radius: 8px;
    padding: 15px;
    font-family: 'Segoe UI', sans-serif;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.board-title {
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 10px;
    color: #222;
}

.input-area {
    display: flex;
    gap: 8px;
    margin-bottom: 15px;
}

.input-area input {
    flex: 1;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.95rem;
}

/*
.input-area button {
    padding: 8px 12px;
    background-color: #4a90e2;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.input-area button:hover {
    background-color: #357abd;
}
*/

.board-list {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.board-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid #eee;
    font-size: 0.95rem;
    color: #333;
}

.msg-text {
    flex: 1;
    word-break: break-word;
}

.msg-time {
    font-size: 0.8rem;
    color: #888;
    margin-left: 10px;
    white-space: nowrap;
}

.notice-box {
    box-sizing: border-box; /* 핵심! padding과 border를 width에 포함 */
    width: calc(100% - 30px); /* 좌우 여백 15px씩 확보 */
    max-width: 600px;
    margin: 10px auto;
    background-color: #fff9e6;
    border: 1px solid #ffd966;
    border-radius: 6px;
    padding: 10px;
    font-size: 0.9em;
    /* margin: 10px 0; */
    color: #333;
    line-height: 1.5em;
}

.hidden-text {
    color: #999;
    /* font-style: italic; */
    opacity: 0.7;
    font-size: 0.9rem;
    flex: 1;
    word-break: break-word;
}

/* 게시판 더보기 버튼 스타일 */
/* 버튼 감싸는 div를 가운데 정렬 */
.load-more-wrap {
    text-align: center;
    margin-top: 10px;
}

/* 버튼을 텍스트처럼 보이게 */
.btn-more {
    display: block; /* 버튼을 블록 레벨 요소로 만듭니다. */
    margin: 0 auto; /* 좌우 마진을 자동으로 설정하여 가운데 정렬합니다. */
    background: none;
    border: none;
    color: #8b8b8b;         /* 회색 텍스트처럼 */
    font-size: 16px;
    cursor: pointer;
    padding: 5px 10px;
    font-family: inherit;
}

/* 마우스 오버 시 색상 살짝 바꾸기 */
.btn-more:hover {
    text-decoration: underline;
    color: #5f5f5f;
}

.image-custa {
    text-align: center;
}
.custa {
  display: block;
  margin: 0 auto;
  width: 140px;
  height: 140px;
}

.custa-link {
  display: inline-block; /* 링크를 이미지 크기만큼만 */
}

/* "친구 추가" 글씨색을 검정색으로 유지 */
.kakao-text {
    color: black;
}

/* "카톡" 글씨색을 카카오톡 상징색으로 변경 */
.kakao-color {
    color: #FAE100; /* 카카오톡 상징색 (노란색) */
    /* font-weight: bold; */
    /* 글씨 테두리 효과 (검정색) */
    text-shadow:
        -1px -1px 0 #000, /* 좌상 */
         1px -1px 0 #000, /* 우상 */
        -1px  1px 0 #000, /* 좌하 */
         1px  1px 0 #000; /* 우하 */
    /* 필요에 따라 테두리 두께 조절 (예: 2px -2px 0 #000 등) */    
}

/* "1등 당첨금액"의 두번째 h4에만 하단 마진 적용 */
#section_article_2_index > h4:nth-of-type(2) {
    margin-bottom: 50px; /* 이 값을 조절하여 원하는 간격을 설정하세요 */
}

/* AI챗봇 */
.chat-header {
    text-align: center;
    margin-bottom: 30px;
    padding: 10px;
    /* background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); */
    background: transparent;
    color: black;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.chat-header h2 {
    margin: 0;
    font-size: 1.5em;
}

.chat-header p {
    margin: 0 0 0 0;
    opacity: 0.9;
}

.chat-header a {
    color: black;
    text-decoration: none;
    font-size: 0.7em; /* 작게 만들기 */
    font-family: 'Comic Sans MS', cursive, sans-serif;
}

.loading {
    display: none;
    text-align: center;
    padding: 10px;
    color: #667eea;
    font-style: italic;
}

.loading::after {
    content: '';
    animation: dots 1.5s infinite;
}

@keyframes dots {
    0%, 20% { content: ''; }
    40% { content: '.'; }
    60% { content: '..'; }
    80%, 100% { content: '...'; }
}

.gombo-image {
    max-width: 100%; /* 원본 크기의 40% */
    height: auto;      /* 비율 유지 */
    display: block;
    margin: 0;    /* 중앙 정렬 */
}



/* AI챗봇 메시지 스타일 */
/* 채팅 메시지 컨테이너 */
.chat-message {
    display: flex;
    margin-bottom: 20px;
    clear: both;
    width: 98%;
}

/* AI 메시지 (왼쪽 정렬) */
.chat-message.ai {
    justify-content: flex-start;
}

/* 사용자 메시지 (오른쪽 정렬) */
.chat-message.user {
    justify-content: flex-end;
}

/* 메시지 버블 기본 스타일 */
.message-bubble {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 18px;
    word-wrap: break-word;
    line-height: 1.2;
    position: relative;
}

/* 사용자 메시지 버블 */
.message-bubble.user {
    background: #e3f2fd;
    color: #1565c0;
    border-bottom-right-radius: 4px;
}

/* 사용자 메시지 말풍선 꼬리 */
.message-bubble.user::before {
    content: '';
    position: absolute;
    bottom: 0;
    right: -8px;
    width: 0;
    height: 0;
    border: 8px solid transparent;
    border-left-color: #e3f2fd;
    border-bottom-color: #e3f2fd;
    /* border-right: none; */
    border-top: none;
}

/* AI 메시지 컨테이너 */
.ai-message-container {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    max-width: 90%;
}

/* AI 아바타 */
.ai-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    flex-shrink: 0;
    object-fit: cover;
    border: 2px solid #ddd;
}

.ai-avatar.speaking {
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* AI 메시지 버블 */
.message-bubble.ai {
    background: #f5f5f5;
    color: #333;
    border-top-left-radius: 4px;
    flex: 1;
}

/* AI 메시지 말풍선 꼬리 */
.message-bubble.ai::before {
    content: '';
    position: absolute;
    top: 0;
    left: -8px;
    width: 0;
    height: 0;
    border: 8px solid transparent;
    border-right-color: #f5f5f5;
    border-bottom-color: #f5f5f5;
    /* border-left: none; */
    border-top: none;
}

/* 마크다운 스타일 */
.message-bubble.ai h1, 
.message-bubble.ai h2, 
.message-bubble.ai h3 {
    margin: 10px 0 5px 0;
    color: #333;
}

.message-bubble.ai h1 { font-size: 1.3em; }
.message-bubble.ai h2 { font-size: 1.2em; }
.message-bubble.ai h3 { font-size: 1.1em; }

.message-bubble.ai p {
    margin: 8px 0;
    line-height: 1.6;
}

.message-bubble.ai ul, 
.message-bubble.ai ol {
    margin: 8px 0;
    padding-left: 20px;
}

.message-bubble.ai li {
    margin: 4px 0;
}

.message-bubble.ai strong {
    font-weight: bold;
    color: #2c3e50;
}

.message-bubble.ai em {
    font-style: italic;
    color: #7f8c8d;
}

.message-bubble.ai code {
    background: #f8f9fa;
    padding: 2px 4px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

.message-bubble.ai blockquote {
    border-left: 4px solid #ddd;
    margin: 10px 0;
    padding-left: 15px;
    color: #666;
    font-style: italic;
}

/* 모바일 반응형 - 더 넓게 */
@media (max-width: 768px) {
    .message-bubble {
        max-width: 95%; /* 모바일에서 95% */
    }
    
    .ai-message-container {
        max-width: 100%; /* 모바일에서 전체 너비 */
    }
    
    .message-bubble.ai {
        max-width: 100%; /* AI 버블을 최대한 넓게 */
    }
}

/* 태블릿 크기 */
@media (max-width: 1024px) and (min-width: 769px) {
    .message-bubble {
        max-width: 90%;
    }
    
    .ai-message-container {
        max-width: 95%;
    }
}

/* 로딩 메시지 스타일 */
.loading-bubble {
    background: #f0f0f0 !important;
    border: 2px dashed #ccc !important;
}

.loading-text {
    color: #666;
    font-style: italic;
    animation: loadingDots 1.5s infinite;
}

@keyframes loadingDots {
    0%, 20% { 
        opacity: 1;
    }
    50% { 
        opacity: 0.5;
    }
    80%, 100% { 
        opacity: 1;
    }
}

/* 로딩 메시지에 점점점 애니메이션 */
.loading-text::after {
    content: '';
    animation: dots 1.5s infinite;
}

@keyframes dots {
    0%, 20% { content: ''; }
    40% { content: '.'; }
    60% { content: '..'; }
    80%, 100% { content: '...'; }
}

.lotto-numbers {
    font-family: 'Menlo', 'Monaco', 'Consolas', monospace;
    font-size: 1.1em;
    margin-top: 1.5em;
    margin-bottom: 1.5em;
    line-height: 1.6;
    text-align: left;
}
