/* HSK 4択クイズ用CSS */
.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

h1 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 30px;
}

/* クイズ設定 */
.quiz-settings {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 10px;
    flex-wrap: wrap;
}

.setting-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.setting-group label {
    font-weight: bold;
    color: #495057;
}

.setting-group select {
    padding: 8px 12px;
    border: 2px solid #ced4da;
    border-radius: 5px;
    background-color: white;
    font-size: 14px;
}

/* ボタンスタイル */
.btn-primary,
.btn-secondary,
.btn-danger,
.btn-toggle {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background-color: #007bff;
    color: white;
    display: block;
    margin: 20px auto;
    padding: 15px 40px;
    font-size: 18px;
}

.btn-primary:hover {
    background-color: #0056b3;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background-color: #545b62;
}

.btn-danger {
    background-color: #dc3545;
    color: white;
}

.btn-danger:hover {
    background-color: #c82333;
}

.btn-toggle {
    background-color: #6c757d;
    color: white;
    min-width: 60px;
}

.btn-toggle.active {
    background-color: #28a745;
}

/* スペースキー説明 */
.spacebar-instruction {
    text-align: center;
    margin: 15px 0;
}

.spacebar-instruction p {
    color: #6c757d;
    font-size: 14px;
}

/* クイズエリア */
.quiz-area {
    background-color: #f8f9fa;
    padding: 30px;
    border-radius: 10px;
    margin-bottom: 20px;
}

/* 進行状況 */
.progress-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    font-size: 18px;
    font-weight: bold;
    color: #495057;
}

/* 問題カード */
.question-card {
    background-color: white;
    padding: 40px;
    border-radius: 10px;
    text-align: center;
    margin-bottom: 30px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.question-text {
    font-size: 2.5em;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 10px;
    font-family: "Microsoft YaHei", "SimHei", sans-serif;
}

.question-subtitle {
    font-size: 1.2em;
    color: #6c757d;
}

/* 選択肢グリッド */
.choices-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 30px;
}

.choice-button {
    background-color: white;
    border: 3px solid #ced4da;
    border-radius: 10px;
    padding: 20px;
    font-size: 1.2em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.choice-button:hover:not(.disabled) {
    background-color: #e7f3ff;
    border-color: #007bff;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.choice-button.correct {
    background-color: #d4edda;
    border-color: #28a745;
    animation: correctPulse 0.5s ease;
}

.choice-button.incorrect {
    background-color: #f8d7da;
    border-color: #dc3545;
    animation: shake 0.5s ease;
}

.choice-button.disabled {
    pointer-events: none;
    opacity: 0.7;
}

.choice-button.show-correct {
    background-color: #d4edda;
    border-color: #28a745;
}

@keyframes correctPulse {
    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.03);
    }
}

@keyframes shake {
    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-8px);
    }

    75% {
        transform: translateX(8px);
    }
}

/* クイズコントロール */
.quiz-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
}

/* 結果エリア */
.result-area {
    background-color: #f8f9fa;
    padding: 30px;
    border-radius: 10px;
    text-align: center;
}

.result-area h2 {
    color: #2c3e50;
    margin-bottom: 25px;
}

.result-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.stat-item {
    background-color: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.stat-label {
    display: block;
    font-size: 13px;
    color: #6c757d;
    margin-bottom: 8px;
}

.stat-item span:last-child {
    font-size: 22px;
    font-weight: bold;
    color: #2c3e50;
}

/* 間違えた問題一覧 */
.wrong-answers {
    margin-bottom: 20px;
    text-align: left;
}

.wrong-answers h3 {
    color: #dc3545;
    margin-bottom: 15px;
    text-align: center;
}

.wrong-answer-item {
    background-color: white;
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 5px;
    border-left: 4px solid #dc3545;
}

.wrong-answer-question {
    font-size: 1.2em;
    font-weight: bold;
    margin-bottom: 5px;
    color: #2c3e50;
}

.wrong-answer-correct {
    color: #28a745;
    font-weight: bold;
}

.wrong-answer-user {
    color: #dc3545;
}

.all-correct-message {
    color: #28a745;
    font-weight: bold;
    font-size: 1.2em;
    padding: 20px;
}

/* レスポンシブ */
@media (max-width: 768px) {
    .quiz-settings {
        flex-direction: column;
        gap: 15px;
    }

    .question-text {
        font-size: 2em;
    }

    .choices-grid {
        grid-template-columns: 1fr;
    }

    .choice-button {
        font-size: 1.1em;
        padding: 15px;
        min-height: 60px;
    }

    .result-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* フッター */
.quiz-footer {
    text-align: center;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #dee2e6;
}

.quiz-footer a {
    display: inline-block;
    padding: 10px 20px;
    background-color: #6c757d;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    transition: background-color 0.3s ease;
}

.quiz-footer a:hover {
    background-color: #5a6268;
}
