@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans+KR:wght@300;400;500;700&display=swap');

@font-face {
    font-family: 'Ownglyph_kimkonghae';
    src: url('https://fastly.jsdelivr.net/gh/projectnoonnu/2408@1.0/Ownglyph_kimkonghae.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
}

:root {
    --background-color: #E0F2F1;
    --primary-color: #FFCDD2;
    --secondary-color: #80CBC4;
    --text-color: #37474F;
    --button-color: #FF80AB;
    --disabled-color: #BDBDBD;
}

body {
    font-family: 'Ownglyph_kimkonghae', sans-serif;
    font-size: 25px;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    margin: 0;
    padding: 20px;
    word-break: keep-all;
    overflow-wrap: break-word;
}

#intro {
    position: relative;
    height: 100vh;
    display: none;
    justify-content: center;
    align-items: center;
    background-color: white;
}

#nickname-insert {
    position: relative;
    height: 100vh; /* 화면 전체 높이 사용 */
    display: none;
    justify-content: center;
    align-items: center;
    background-color: white; /* 흰 배경으로 설정 */
}

#main-container {
    display: none;
}

.message {
    color: black;
    font-size: 2em;
    opacity: 0;
    text-align: center;
    position: absolute;
    transition: opacity 0.75s ease-in-out;
    top: 15%;
}

.sub-message {
    font-size: 0.5em;
    margin-top: 1em;
    color: #666;
}

#click-guide {
    position: fixed;
    bottom: 20px;
    font-size: 1em;
    color: #666;
}

.container {
    display: none;
    max-width: 1200px;
    margin: 0 auto;
    background-color: white;
    padding: 5%;
    border-radius: 20px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    align-items: center;
}

.divider {
    border: 0;
    height: 1px;
    background: #ccc; /* 원하는 색상으로 변경 가능 */
    margin: 20px 0; /* 상하 마진을 통해 버튼과의 간격 조절 */
}

h1,
h2,
h3 {
    color: var(--text-color);
    text-align: center;
    margin-bottom: 20px;
    font-family: 'Ownglyph_kimkonghae', sans-serif;
    line-height: 1.1;
}

h1 {
    font-size: 50px;
    font-weight: 700;
    line-height: 1.1;
    color: var(--secondary-color);
}

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: var(--text-color);
}

select {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--secondary-color);
    border-radius: 50px;
    font-size: 16px;
    font-family: 'Ownglyph_kimkonghae', sans-serif;
    color: var(--text-color);
    background-color: white;
}

.button-group {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.button-group button {
    flex: 1;
}

button {
    font-family: 'Ownglyph_kimkonghae', sans-serif;
    background-color: var(--button-color);
    color: white;
    border: none;
    padding: 12px 24px;
    margin: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 50px;
    font-size: 25px;
    font-weight: 500;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

button:hover {
    background-color: #FF4081;
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15);
}

button.selected {
    background-color: var(--button-color);
}

button:not(.selected) {
    background-color: var(--disabled-color);
}

button:not(:disabled):not(.selected) {
    background-color: var(--disabled-color); /* 회색으로 설정 */
}

button:not(:disabled) {
    background-color: var(--button-color);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

button:disabled {
    background-color: var(--disabled-color); /* 회색 또는 비활성화 색상 */
    cursor: not-allowed;
}

.button-container {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px; /* 버튼 사이의 간격 */
    margin-top: 20px;
}

#submit-button {
    display: block;
    width: auto;
    margin: 0 auto;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

#submit-button:disabled {
    background-color: var(--disabled-color);
    cursor: not-allowed;
}

#submit-button:not(:disabled) {
    background-color: var(--button-color);
}

#gender-selection {
    text-align: center;
}

.error-message {
    color: var(--button-color);
    font-size: 14px;
    margin-top: 5px;
}

#candidates {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
    justify-content: center;
}

.candidate {
    text-align: center;
    transition: all 0.3s ease;
    align-self: start;
}

.candidate img {
    width: 100%;
    min-width: 150px;  /* 최소 너비 추가 */
    height: auto;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 15px;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    margin-bottom: 0;
}

.candidate:hover {
    transform: translateY(-5px);
}

.candidate.selected img {
    border: 4px solid var(--primary-color);
    box-shadow: 0 8px 16px rgba(255, 205, 210, 0.4);
}

#candidate-description {
    line-height: 1.0;
    font-size: 20px;
    margin-top: 2px;
    margin-bottom: 3px;
}

.tournament-candidates {
    display: flex;
    justify-content: space-around;
    align-items: center;
    gap: 20px;
}

.vs {
    font-size: 36px;
    font-weight: bold;
    color: var(--secondary-color);
    display: block; /* 필요한 경우 block으로 설정 */
    width: 50px; /* VS 텍스트의 너비를 명확하게 지정 */
    text-align: center;
}

#round-info {
    text-align: center;
    font-size: 36px;
    margin-bottom: 30px;
    color: var(--text-color);
    font-weight: 500;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#round-info div:first-child {
    font-weight: bold;
    margin-bottom: 5px; /* 제목과 선택 정보 사이의 간격 조정 */
}

#round-info div:last-child {
    font-size: 0.9em; /* 선택 정보의 글자 크기를 약간 줄임 */
    color: #666; /* 선택 정보의 색상을 약간 연하게 설정 */
}

#statistics {
    margin-top: 30px;
    text-align: center;
    font-size: 1.1em;
}

#winner-container {
    display: flex;           /* Flexbox 레이아웃 사용 */
    position: relative;
    flex-direction: column;  /* 요소들을 세로로 배열 */
    justify-content: center; /* 세로 방향 중앙 정렬 */
    align-items: center;     /* 가로 방향 중앙 정렬 */
}

#winner-img-container {
    position: relative;
    display: flex;
    width: 325px;
    height: 325px;
    align-items: center;
    justify-content: center;
}

#winner-id {
    position: absolute;
    top: 11%;
    left: 51%;
    transform: translate(-50%, -50%);
    font-size: 1.1em;
    z-index: 10;
    letter-spacing: 5px;
}

#winner-image {
    position: absolute;
    width: 250px;
    height: 250px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

#winner-decoration {
    position: absolute;
    width: 100%;
    height: auto;
    object-fit: cover;
}

#winner-info {
    text-align: center; /* 텍스트를 가운데 정렬 */
}

#next-group {
    display: block;
    margin: 20px auto;
    font-size: 16px;
    cursor: pointer;
    background-color: var(--button-color);
    width: auto;
}

#next-group:disabled {
    background-color: var(--disabled-color); /* 비활성화 시 색상 */
    cursor: not-allowed;
    font-size: 16px;
    cursor: pointer;
    width: auto;
}

#intermediate-start-button {
    background-color: var(--button-color);
    font-size: 16px;
    cursor: pointer;
    width: auto;
}

#intermediate {
    text-align: center;
}

#intermediate button {
    display: block;
    margin: 20px auto;
}

#restart-button,
#try-button,
#view-ranking-button,
#share-result-button {
    background-color: var(--button-color);
    padding: 10px 20px;
    border: none;
    border-radius: 20px;
    color: white;
    font-size: 16px;
    cursor: pointer;
    white-space: nowrap;
    width: auto; /* 버튼 너비를 내용에 맞게 조정 */
    min-width: 150px; /* 최소 너비 설정 */
    max-width: 250px; /* 최대 너비 설정 */
}

#try-button {
    display: none;
}

.tournament-candidates {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 40px;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
}

.tournament-candidates .candidate {
    width: 40%;
    max-width: 300px;
}

.image-center {
    display: block;
    margin-left: auto;
    margin-right: auto;
    width: 50%;
}

.text-wrap-control {
    word-break: keep-all;
    overflow-wrap: break-word;
}

#shareModal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
}

.modal-content {
    background: white;
    padding: 5px 30px 30px 30px;
    border-radius: 8px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    width: 60%;
    max-width: 300px;
}

.modal-content .share-buttons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: 30px;
}

.share-button {
    width: 40px;  /* 버튼의 너비 */
    height: 40px;  /* 버튼의 높이 */
    display: inline-block;  /* 요소를 인라인 블록으로 설정 */
    border: none;  /* 테두리 없음 */
    background: none;  /* 배경 없음 */
    cursor: pointer;
    touch-action: manipulation;
    position: relative;
}

#closeModalBtn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 24px;
    height: 24px;
    background: none;
    border: none;
    cursor: pointer;
    touch-action: manipulation;
}

#copyLinkBtn {
    width: 32px;  /* 버튼의 너비 */
    height: 32px;  /* 버튼의 높이 */
}

#twitterShareBtn {
    width: 45px;  /* 버튼의 너비 */
    height: 45px;  /* 버튼의 높이 */
}

.share-button img {
    width: 100%; 
    height: 100%; 
    display: block;
}

#notification {
    display: none;
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--secondary-color);
    color: white;
    padding: 15px 25px;
    border-radius: 5px;
    z-index: 2000;
    font-size: 16px;
}

#share-result-description {
    font-size: 1.5em; /* h2와 유사한 크기 설정 */
    font-weight: normal; /* 기본 굵기를 일반으로 설정 */
    margin-top: 20px; /* 필요에 따라 마진 조정 */
    margin-bottom: 18px; /* 필요에 따라 마진 조정 */
    line-height: 1.1;
    text-align: center;
    word-break: keep-all;
    word-wrap: break-word; /* 단어가 넘칠 경우 자동으로 줄바꿈 */
    overflow-wrap: break-word;
}

#loading {
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
    background: rgba(0, 0, 0, 0.5); /* 반투명 검은색 배경 */
    width: 100%;
    height: 100%;
}

#cloneArea {
    display: none; /* 처음에는 보이지 않게 설정 */
    width: 300px;
    height: 300px;
    background-color: white;
    border: 1px solid black;
    text-align: center;
    padding: 20px;
}

.contact-footer {
    background-color: #f3f4f6;
    padding: 2rem 0;
    margin-top: 2rem;
    text-align: center;
  }
  
.contact-footer h3 {
font-size: 1.5rem;
font-weight: bold;
color: #374151;
margin-bottom: 5px;
}

.contact-details {
display: flex;
justify-content: center;
flex-wrap: wrap;
gap: 0.5rem;
}

.contact-item {
display: flex;
align-items: center;
}

.contact-item span, .contact-item a {
    color: #4b5563;
}

.contact-icon {
    width: 24px;  /* 원하는 크기로 조정 */
    height: 24px;  /* 원하는 크기로 조정 */
    margin-right: 10px;
}



@media (max-width: 1000px) {
    #candidates {
        grid-template-columns: repeat(3, 1fr);
    }

    .responsive-button {
        font-size: 22px;
        margin: 8px;
        padding: 8px 16px;
    }
}

@media (max-width: 768px) {
    .responsive-button {
        font-size: 18px;
        margin: 4px;
        padding: 6px 8px;
    }
}

@media (max-width: 600px) {
    .responsive-button {
        font-size: 15px;
        margin: 0px;
        padding: 6px 4px;
    }

    #candidates {
        grid-template-columns: repeat(2, 150px);
    }

    .tournament-candidates {
        flex-direction: column;
        justify-content: center;
    }

    .tournament-candidates .candidate {
        width: 80%;
        align-self: center;
    }

    .button-container {
        flex-direction: column;
        align-items: center;
        gap: 20px; /* 세로 배치일 때 버튼 사이의 간격 */
    }

    #restart-button,
    #try-button,
    #view-ranking-button,
    #share-result-button {
        width: 80%; /* 모바일에서의 버튼 너비 */
        max-width: none; /* 최대 너비 제한 해제 */
    }
}

