@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600;700&display=swap');

:root {
    --primary-color: #3498db;
    --selected-color: #f1c40f;
    --correct-color: #2ecc71;
    --incorrect-color: #e74c3c;
    --bg-color: #2c3e50;
    --text-color: #ecf0f1;
    --container-bg: #34495e;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    padding: 20px 0;
    overflow-y: auto;
}

/* ▼▼▼ ここからメニューのスタイルを追加 ▼▼▼ */
.menu-btn {
    position: fixed;
    top: 15px;
    right: 25px;
    font-size: 2.2rem;
    background: none;
    border: none;
    color: var(--text-color);
    cursor: pointer;
    z-index: 1100;
    transition: color 0.3s;
}
.menu-btn:hover {
    color: var(--primary-color);
}

.sidenav {
    height: 100%;
    width: 0; /* 初期状態では幅0で見えない */
    position: fixed;
    z-index: 1200;
    top: 0;
    left: 0;
    background-color: #1a252f;
    overflow-x: hidden;
    transition: 0.5s;
    padding-top: 60px;
    box-shadow: 3px 0 15px rgba(0,0,0,0.5);
}

.sidenav a {
    padding: 10px 15px 10px 32px;
    text-decoration: none;
    font-size: 1.4rem;
    color: #a7b4c2;
    display: block;
    transition: 0.3s;
}

.sidenav a:hover {
    color: #fff;
}

.sidenav .close-btn {
    position: absolute;
    top: 10px;
    right: 25px;
    font-size: 2.5rem;
}
/* ▲▲▲ ここまでメニューのスタイル ▲▲▲ */


.quiz-container {
    background-color: var(--container-bg);
    border-radius: 15px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
    width: 600px;
    max-width: 95%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative; 
    margin: 20px 0;
}

#result-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    font-size: 10rem;
    font-weight: 700;
    opacity: 0;
    transition: transform 0.4s ease, opacity 0.4s ease;
    z-index: 10;
    pointer-events: none;
}

#result-indicator.show {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0.8;
}

#result-indicator.correct {
    color: var(--correct-color);
}

#result-indicator.incorrect {
    color: var(--incorrect-color);
}

.quiz-header {
    padding: 2rem 2.5rem;
}

.quiz-progress {
    text-align: center;
    margin-bottom: 20px;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary-color);
    background-color: rgba(52, 152, 219, 0.1);
    padding: 10px;
    border-radius: 8px;
    border: 2px solid var(--primary-color);
}

h2 {
    padding: 1rem 0;
    text-align: center;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

/* 問題文内のコードブロックは左寄せにする */
h2 pre, h2 code {
    text-align: left;
    display: block;
    margin: 1rem 0;
}

ul {
    list-style-type: none;
    padding: 0;
}

li {
    margin: 1rem 0;
}

.choice-btn {
    background-color: var(--primary-color);
    border: 2px solid transparent;
    color: white;
    display: block;
    width: 100%;
    cursor: pointer;
    font-size: 1.1rem;
    font-family: inherit;
    padding: 1rem;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.choice-btn:hover:not([disabled]) {
    background-color: #2980b9;
    transform: translateY(-2px);
}

.choice-btn:focus {
    outline: none;
}

.choice-btn.selected {
    background-color: var(--selected-color);
    border-color: #fff;
}

.choice-btn.correct {
    background-color: var(--correct-color);
}

.choice-btn.incorrect {
    background-color: var(--incorrect-color);
}

#submit-btn {
    background-color: var(--primary-color);
    border: none;
    color: white;
    display: block;
    width: 100%;
    cursor: pointer;
    font-size: 1.3rem;
    font-weight: bold;
    font-family: inherit;
    padding: 1.3rem;
    transition: background-color 0.3s ease;
}

#submit-btn:hover:not(:disabled) {
    background-color: #2980b9;
}

#submit-btn:disabled {
    background-color: #7f8c8d;
    cursor: not-allowed;
}

/* 解説のスタイル */
.explanation {
    background-color: #2c3e50;
    border-left: 4px solid var(--primary-color);
    margin: 1rem 2.5rem;
    padding: 1.5rem;
    border-radius: 8px;
    font-size: 1rem;
    line-height: 1.6;
    color: #ecf0f1;
    animation: slideIn 0.5s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* コードブロックのスタイル */
pre {
    background-color: #1a1a1a;
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
    overflow-x: auto;
    border: 1px solid #333;
    text-align: left;
    white-space: pre;
}

code {
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    color: #e6e6e6;
    background-color: #1a1a1a;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
}

pre code {
    background-color: transparent;
    padding: 0;
    color: #e6e6e6;
    text-align: left;
    white-space: pre;
}

/* インラインコードのスタイル */
p code, li code {
    background-color: #2c3e50;
    color: #f39c12;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-size: 0.9rem;
}

/* 問題文内のコードブロックを左寄せにする */
h2 pre {
    text-align: left;
    white-space: pre;
    margin: 1rem auto;
    max-width: 100%;
}