:root {
    --primary-color: #A2D2FF;
    --secondary-color: #BDE0FE;
    --accent-color: #FFC8DD;
    --correct-color: #C8E6C9; 
    --incorrect-color: #FFCDD2;
    --text-color: #333;
    --bg-color: #FDF7F9;
    --white: #FFFFFF;
    --gray: #f0f0f0;
    --dark-gray: #666;
    --border-radius: 12px;
    --box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

body {
    font-family: 'Helvetica Neue', 'Arial', 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', 'Meiryo', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    box-sizing: border-box;
}

.container {
    background-color: var(--white);
    padding: 30px 40px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    width: 100%;
    max-width: 800px;
    text-align: center;
    box-sizing: border-box;
}

h1 {
    color: var(--primary-color);
    font-size: 2.5rem;
    margin-bottom: 10px;
}

p {
    font-size: 1.1rem;
    line-height: 1.6;
}

.btn {
    display: inline-block;
    background-color: var(--primary-color);
    color: var(--white);
    padding: 15px 40px;
    border: none;
    border-radius: 50px;
    font-size: 1.2rem;
    font-weight: bold;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.3s;
    margin-top: 20px;
}

.btn:hover {
    background-color: var(--accent-color);
    transform: translateY(-3px);
}

/* Quiz Specific Styles */
.quiz-container {
    text-align: left;
}

#question-counter {
    font-size: 1rem;
    font-weight: bold;
    color: var(--dark-gray);
    margin-bottom: 15px;
}

#question {
    font-size: 1.4rem;
    font-weight: bold;
    margin-bottom: 25px;
}

.options {
    list-style: none;
    padding: 0;
    margin: 0;
}

.options li {
    margin-bottom: 15px;
}

.option-btn {
    width: 100%;
    padding: 15px 20px;
    background-color: var(--gray);
    border: 2px solid var(--gray);
    border-radius: var(--border-radius);
    text-align: left;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s;
}

.option-btn:hover {
    border-color: var(--secondary-color);
}

.option-btn.selected {
    border-color: var(--primary-color);
    background-color: var(--secondary-color);
}

.text-input {
    width: 100%;
    padding: 15px;
    font-size: 1.1rem;
    border-radius: var(--border-radius);
    border: 2px solid var(--gray);
    box-sizing: border-box;
}

#feedback {
    margin-top: 20px;
    padding: 15px;
    border-radius: var(--border-radius);
    display: none;
}

#feedback.correct {
    background-color: var(--correct-color);
}

#feedback.incorrect {
    background-color: var(--incorrect-color);
}

#feedback h3 {
    margin-top: 0;
}

#next-btn {
    float: right;
}

/* Result Page */
.result-summary {
    margin-bottom: 40px;
}

.result-summary h2 {
    font-size: 2rem;
}

.result-summary p {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
}

.result-details li {
    background-color: var(--gray);
    padding: 20px;
    margin-bottom: 15px;
    border-radius: var(--border-radius);
    text-align: left;
}

.result-details .question-title {
    font-weight: bold;
}

.result-details .user-answer.correct {
    color: #388E3C;
}

.result-details .user-answer.incorrect {
    color: #D32F2F;
    text-decoration: line-through;
}

.result-details .correct-answer {
    font-weight: bold;
}

.explanation {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #ccc;
    color: var(--dark-gray);
}

.certificate-info {
    margin-top: 30px;
    padding: 20px;
    background-color: var(--secondary-color);
    border-radius: var(--border-radius);
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    position: relative;
    background-color: var(--white);
    padding: 40px 50px;
    border-radius: var(--border-radius);
    text-align: center;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
    overflow: hidden;
    max-width: 600px;
    width: 90%;
}

.modal-content .explanation {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--gray);
    text-align: left;
    font-size: 1rem;
    color: var(--dark-gray);
}

.modal-content h2 {
    color: var(--accent-color);
    font-size: 2.5rem;
}

/* Confetti Animation */
#confetti-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
}

.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    background-color: #f00;
    opacity: 0.7;
    animation: fall 5s linear forwards;
}

@keyframes fall {
    0% {
        transform: translateY(-10vh) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(110vh) rotate(720deg);
        opacity: 0;
    }
}

#speech-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: var(--primary-color);
    color: var(--white);
    padding: 15px 25px;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: bold;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.3s;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    z-index: 1001;
}


#speech-btn:hover {
    background-color: var(--accent-color);
    transform: translateY(-3px);
}
