body {
    font-family: 'Noto Sans KR', sans-serif;
    background-color: #1b1b1b;
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 30px 10px;
    margin: 0;
}

.background-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background-image: url(bg.webp);
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center center;
    opacity: 0.8;
    filter: grayscale(100%);
}

.header {
    display: flex;
    justify-content: space-between;
    width: 100%;
    max-width: 560px;
    margin-bottom: 20px;
}

#lang-toggle,
#usage-guide,
#ai-service,
.fortune-button {
    background-color: #8d6aff;
    color: white;
    border: none;
    border-radius: 5px;
    padding: 10px 20px;
    cursor: pointer;
    transition: background-color 0.3s;
    font-size: 16px; /* 버튼 크기 일치 */
}

#lang-toggle:hover,
#usage-guide:hover,
#ai-service:hover,
.fortune-button:hover {
    background-color: #4b2f91;
}

.chat-container {
    background-color: rgba(0, 0, 0, 0.7);
    border-radius: 20px;
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
    padding: 20px;
    width: 100%;
    max-width: 560px; /* 수정된 width */
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 20px;
}

.chat-content {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.intro-container {
    text-align: center;
    width: 100%;
    display: flex;
    flex-direction: column;
}

.fortune-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    justify-content: center;
    flex-wrap: wrap; /* Flex wrap을 추가하여 줄바꿈이 되도록 함 */
}

.fortune-buttons a,
.fortune-buttons button {
    background-color: #8d6aff;
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    text-decoration: none;
    font-size: 16px; /* 버튼 크기 일치 */
    transition: background-color 0.3s;
}

.fortune-buttons a:hover,
.fortune-buttons button:hover {
    background-color: #4b2f91;
}

.question-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    width: 100%;
    margin-top: 20px;
}

.input-group {
    width: 48%;
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    margin-bottom: 5px;
    font-size: 16px;
}

.input-group input,
/* 기존 코드 유지 */

.input-group select {
    width: 100%;
    padding: 10px;
    font-size: 16px;
    border-radius: 5px;
    border: none;
}

#surname, #gender {
    width: 94%; /* 생년, 월, 일과 동일한 크기 */
}

/* 추가 스타일 */
.input-group.full-width {
    width: 100%;
    display: flex;
    justify-content: center;
}

#start-btn {
    font-weight: bold;
    width: 80%;
    border-radius: 20px;
    padding: 15px 0;
    background-color: #8d6aff;
    color: white;
    border: none;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s;
}

#start-btn:hover {
    background-color: #4b2f91;
}

.full-width {
    width: 100%;
    display: flex;
    justify-content: center;
}

h1 {
    font-size: 28px;
    text-shadow: 2px 2px #000;
    margin-bottom: 10px;
}

p {
    font-size: 18px;
    margin-bottom: 20px;
}

#intro-message {
    font-size: 24px;
    margin-bottom: 20px;
}

#start-btn {
    font-weight: bold;
    width: 80%;
    border-radius: 20px;
    padding: 15px 0;
    background-color: #8d6aff; /* 버튼 크기 및 스타일 일치 */
    color: white;
    border: none;
    font-size: 16px; /* 버튼 크기 일치 */
    cursor: pointer;
    transition: background-color 0.3s;
}

#start-btn:hover {
    background-color: #4b2f91;
}

#chat {
    margin-top: 25px;
    width: 100%;
    display: none;
    background-color: rgb(0 0 0 / 70%); /* 가독성을 높이기 위한 다른 배경색 */
}

.messages {
    flex-grow: 1;
    overflow-y: auto;
    width: 100%;
    margin-bottom: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.message {
    margin-bottom: 10px;
    padding: 10px;
    border-radius: 20px;
    margin-left: 15px;
    max-width: 80%;
    word-wrap: break-word;
    font-size: 16px;
    line-height: 1.5;
    color: #333;
    background-color: #fff;
    align-self: flex-start;
}

.message.me {
    margin-top: 20px;
    align-self: flex-end;
    margin-right: 15px;
    background-color: #8d6aff;
    color: #fff;
}

.input-container {
    display: flex;
    width: 100%;
    align-items: center;
}

.input-container input {
    padding: 10px;
    border-radius: 20px;
    border: none;
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
    font-size: 16px;
    background-color: rgba(255, 255, 255, 0.8);
    color: #333;
    width: calc(100% - 70px);
    margin-right: 10px;
}

.input-container button {
    padding: 10px;
    background-color: #8d6aff;
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 24px;
    transition: all 0.3s ease;
    width: 50px;
    height: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.input-container button:hover {
    background-color: #4b2f91;
}

#loading {
    padding-bottom: 10px;
    display: none;
}

#send-btn i {
    color: white;
    font-size: 24px;
}

#kakao-ad {
    min-width: 320px;
    z-index: 2;
    display: flex;
    justify-content: center;
    margin-top: 25px;
    margin-bottom: 5px;
}

.share-container {
    display: flex;
    gap: 5px;
    margin-top: 10px;
}

.share-container button {
    background-color: #8d6aff;
    color: white;
    border: none;
    border-radius: 5px;
    padding: 5px 10px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
}

.share-container button:hover {
    background-color: #4b2f91;
}

#aiServiceButtons {
    display: none;
    width: 100%;
    margin-top: 20px;
}

.service-buttons-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    width: 100%;
}

.service-button {
    background-color: #8d6aff;
    color: white;
    border: none;
    border-radius: 5px;
    padding: 15px 20px; /* 버튼 크기 조정 */
    cursor: pointer;
    transition: background-color 0.3s;
    font-size: 14px; /* 버튼 글꼴 크기 조정 */
    flex: 1 1 calc(25% - 20px); /* 반응형 그리드 레이아웃 PC에서 4개 */
    box-sizing: border-box;
    text-align: center;
}

.service-button:hover {
    background-color: #4b2f91;
}

@media screen and (max-width: 768px) {
    .service-button {
        flex: 1 1 calc(50% - 20px); /* 반응형 그리드 레이아웃 모바일에서 2개 */
    }
    .input-group {
        width: 100%;
    }
}

.fortune-buttons button {
    background-color: #8d6aff;
    color: white;
    border: none;
    border-radius: 5px;
    padding: 10px 20px;
    cursor: pointer;
    transition: background-color 0.3s;
    font-size: 16px;
    margin: 5px;
}

.fortune-buttons button:hover {
    background-color: #4b2f91;
}
.footer-copy {
    font-family: 'Noto Sans KR', sans-serif;
    font-size: 14px;
    color: #aaaaaa; /* 차분한 색상 */
    text-align: center;
    margin-top: 10px;
    margin-bottom: 20px;
    background-color: rgba(0, 0, 0, 0.050); /* 배경색을 약간 더 어둡게 */
    padding: 5px 10px;
    border-radius: 5px;
}
