body {
    font-family: 'Noto Sans KR', sans-serif; /* 한국어 폰트 추가 */
    background: linear-gradient(to right, #8EC5FC, #E0C3FC); /* 그라데이션 배경 */
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    color: #333;
}

.container {
    background-color: #ffffff;
    padding: 40px;
    border-radius: 15px; /* 모서리 둥글게 */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15); /* 그림자 강화 */
    width: 90%;
    max-width: 650px; /* 최대 너비 증가 */
    text-align: center;
    box-sizing: border-box; /* 패딩 포함 너비 계산 */
}

h1 {
    color: #4A90E2; /* 파란색 계열 강조 */
    margin-bottom: 30px;
    font-size: 2.5em; /* 폰트 크기 증가 */
    font-weight: 700; /* 볼드체 */
}

h2 {
    color: #5CB85C; /* 초록색 계열 강조 - 빌런 이름에 적용될 색상. 테마에 맞춰 수정 가능 */
    margin-bottom: 20px;
    font-size: 2em;
    font-weight: 600;
}

p {
    font-size: 1.15em; /* 폰트 크기 미세 증가 */
    line-height: 1.7; /* 줄 간격 넓힘 */
    margin-bottom: 25px;
    color: #555; /* 글씨 색상 약간 진하게 */
}

.question {
    font-size: 1.4em; /* 질문 폰트 크기 증가 */
    margin-bottom: 25px;
    font-weight: bold;
    color: #333;
}

.options button {
    display: block;
    width: 100%;
    padding: 18px; /* 패딩 증가 */
    margin-bottom: 12px;
    background-color: #f8f8f8; /* 배경색 밝게 */
    border: 1px solid #eee; /* 테두리 연하게 */
    border-radius: 10px; /* 모서리 둥글게 */
    font-size: 1.2em; /* 폰트 크기 증가 */
    cursor: pointer;
    transition: all 0.3s ease; /* 모든 속성 전환 효과 */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05); /* 은은한 그림자 */
}

.options button:hover {
    background-color: #eef7ff; /* 호버 시 배경색 변경 */
    border-color: #A0D3F7; /* 호버 시 테두리 색 변경 */
    transform: translateY(-3px); /* 살짝 위로 움직이는 효과 */
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1); /* 그림자 강화 */
}

.options button.selected {
    background-color: #4A90E2; /* 선택 시 파란색 */
    color: white;
    border-color: #4A90E2;
    box-shadow: 0 4px 10px rgba(74, 144, 226, 0.3); /* 선택 시 그림자 */
}

/* 모든 일반 버튼의 기본 스타일 */
.btn {
    background-color: #6C7BEE; /* 통일된 파란색 계열 버튼 */
    color: white;
    padding: 15px 35px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.2em;
    margin-top: 30px;
    transition: background-color 0.3s ease, transform 0.2s ease;
    display: inline-block; /* 기본적으로 인라인 블록으로 유지하여 가로 배치 가능 */
    box-sizing: border-box; /* 패딩과 보더 포함 너비 계산 */
}

.btn:hover {
    background-color: #5A6ADF;
    transform: translateY(-2px);
}

.home-btn {
    background-color: #F44336;
}

.home-btn:hover {
    background-color: #DA190B;
}

/* 뒤로 가기 버튼 스타일 */
#back-btn {
    width: 80%; /* 다른 버튼과 일관되게 */
    max-width: 300px;
    margin-left: auto;
    margin-right: auto;
    display: block; /* 중앙 정렬 */
    margin-top: 30px;
    font-size: 1.3em;
    padding: 18px 0;
    background-color: #6c757d; /* 회색 계열로 변경 */
    color: white; /* 텍스트 색상 */
}

#back-btn:hover {
    background-color: #5a6268;
}

#share-link-input {
    background-color: #f9f9f9;
    border-radius: 6px;
    font-size: 1em;
}

/* 카카오톡 공유 버튼 스타일 */
#kakao-share-btn {
    background-color: #FEE500;
    color: #3C1E1E;
    font-weight: bold;
}

#kakao-share-btn:hover {
    background-color: #FADA00;
}

/* 결과 페이지 버튼 그룹 스타일 */
.result-buttons {
    display: flex;
    flex-wrap: wrap; /* 버튼이 넘치면 다음 줄로 */
    justify-content: center; /* 가운데 정렬 */
    gap: 15px; /* 버튼 사이 간격 */
    margin-top: 30px;
}

.result-buttons .btn {
    flex-grow: 1; /* 버튼이 남은 공간을 균등하게 차지 */
    min-width: 180px; /* 버튼 최소 너비 설정 (모바일에서 너무 작아지는 것 방지) */
    max-width: 250px; /* 버튼 최대 너비 설정 (데스크탑에서 너무 커지는 것 방지) */
    margin: 0; /* 개별 버튼의 마진 초기화, gap으로 간격 제어 */
    padding: 15px 20px; /* 패딩 조정 */
    font-size: 1.1em; /* 폰트 크기 조정 */
}

/* 공유 링크 입력 필드 및 복사 버튼 그룹 */
.share-link-container {
    display: flex;
    align-items: center;
    margin-top: 20px;
    flex-wrap: wrap; /* 모바일에서 요소들이 다음 줄로 넘어가도록 */
    gap: 10px; /* 요소들 사이 간격 */
}

.share-link-container #share-link-input {
    flex-grow: 1; /* 입력 필드가 가능한 공간을 채우도록 */
    min-width: 180px; /* 모바일에서 입력 필드가 너무 작아지는 것 방지 */
}

.share-link-container #copy-btn {
    flex-shrink: 0; /* 복사 버튼이 줄어들지 않도록 */
    margin-left: 0; /* 기존 마진 초기화 */
}

/* 미디어 쿼리: 모바일 환경에서 버튼이 세로로 나열되도록 */
@media (max-width: 600px) {
    .container {
        padding: 25px 15px; /* 모바일에서 패딩 줄임 */
    }

    h1 {
        font-size: 2em;
    }

    h2 {
        font-size: 1.7em;
    }

    p {
        font-size: 1em;
    }

    .question {
        font-size: 1.2em;
    }

    .options button {
        padding: 15px;
        font-size: 1.1em;
    }

    /* 퀴즈 페이지의 뒤로 가기 버튼 */
    #back-btn {
        width: 90%;
        font-size: 1.2em;
    }

    /* 결과 페이지 버튼들을 세로로 정렬 */
    .result-buttons {
        flex-direction: column; /* 세로 정렬 */
        align-items: center; /* 가운데 정렬 */
    }

    .result-buttons .btn {
        width: 80%; /* 모바일에서 버튼 너비 증가 */
        max-width: 300px; /* 최대 너비 제한 */
        font-size: 1.2em; /* 폰트 크기 약간 증가 */
    }

    /* 공유 링크 입력 필드와 복사 버튼도 세로 정렬 */
    .share-link-container {
        flex-direction: column;
        align-items: center;
    }

    .share-link-container #share-link-input {
        width: 80%; /* 모바일에서 너비 증가 */
        max-width: 300px;
    }

    .share-link-container #copy-btn {
        width: 80%; /* 모바일에서 너비 증가 */
        max-width: 300px;
    }
}