@charset "UTF-8";

/* ========================================================
   1. Base & Reset
   ======================================================== */
body {
  font-family: 'Helvetica Neue', Arial, 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', Meiryo, sans-serif;
  background-color: #f7f9fc;
  color: #333;
  padding: 20px;
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  margin: 0;
  box-sizing: border-box;
}

/* マイページなど、上端揃えにしたいページ用 */
body.justify-start {
  justify-content: flex-start;
  padding-top: 40px;
}

/* ========================================================
   2. Layout & Containers
   ======================================================== */
.container {
  width: 100%;
  max-width: 600px;
  background: #fff;
  padding: 40px 30px;
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  box-sizing: border-box;
  margin-bottom: 20px;
}

/* ページごとの幅・余白調整用ユーティリティ */
.container-narrow { max-width: 500px; padding: 50px 30px; text-align: center; } /* トップ、エラー用 */
.container-wide { max-width: 650px; } /* クイズ、解説用 */

/* ========================================================
   3. Typography
   ======================================================== */
h1 {
  font-size: 1.8rem;
  color: #007bff;
  margin-top: 0;
  margin-bottom: 20px;
  text-align: center;
}

h2 {
  font-size: 1.25rem;
  color: #444;
  border-bottom: 2px solid #007bff;
  padding-bottom: 6px;
  margin-top: 30px;
  margin-bottom: 20px;
}

/* ========================================================
   4. Buttons
   ======================================================== */
.btn {
  display: block;
  width: 100%;
  padding: 12px 24px;
  font-size: 1rem;
  font-weight: bold;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  transition: background-color 0.2s;
  box-sizing: border-box;
}

.btn-large {
  padding: 15px;
  font-size: 1.2rem;
}

.btn-primary { background-color: #007bff; color: white; }
.btn-primary:hover:not(:disabled) { background-color: #0056b3; }
.btn-primary:disabled { background-color: #b8daff; cursor: not-allowed; }

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

.btn-success { background-color: #28a745; color: white; border-color: #28a745; }
.btn-success:hover { background-color: #218838; }

.btn-danger { background-color: #dc3545; color: white; }
.btn-danger:hover:not(:disabled) { background-color: #c82333; }

/* ========================================================
   5. Quiz & Study Components
   ======================================================== */
.quiz-meta {
  display: flex;
  justify-content: space-between;
  color: #6c757d;
  font-size: 0.85rem;
  margin-bottom: 20px;
  border-bottom: 1px solid #dee2e6;
  padding-bottom: 5px;
}

.question-box {
  font-size: 1.15rem;
  font-weight: bold;
  margin-bottom: 30px;
  white-space: pre-wrap;
}

.options-group {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-bottom: 30px;
}

.option-btn {
  display: block;
  width: 100%;
  padding: 15px 20px;
  font-size: 1rem;
  text-align: left;
  border: 2px solid #dee2e6;
  border-radius: 6px;
  background-color: #fff;
  cursor: pointer;
  transition: all 0.2s;
  box-sizing: border-box;
}
.option-btn:hover:not(:disabled) { background-color: #f1f3f5; border-color: #007bff; }
.option-btn.selected { background-color: #e2e6ea; border-color: #007bff; box-shadow: 0 0 0 2px rgba(0,123,255,.25); }
.option-btn.correct { background-color: #d4edda; border-color: #28a745; color: #155724; font-weight: bold; }
.option-btn.incorrect { background-color: #f8d7da; border-color: #dc3545; color: #721c24; }
.option-btn:disabled { cursor: not-allowed; }

/* 解説ヘッダー */
.result-header { font-size: 1.8rem; font-weight: bold; margin-top: 0; margin-bottom: 15px; text-align: center; }
.result-title { font-size: 1.3rem; font-weight: bold; margin-top: 0; margin-bottom: 15px; }
.success-text { color: #28a745; }
.danger-text { color: #dc3545; }

.selection-info {
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 5px;
  padding: 15px;
  margin-bottom: 30px;
  text-align: center;
}
.selection-info strong { font-size: 1.1rem; color: #007bff; display: block; margin-top: 5px; }

.correct-exp-block {
  background: #eafbee;
  border-left: 5px solid #28a745;
  padding: 20px;
  border-radius: 4px;
  margin-bottom: 30px;
}
.correct-exp-block h3 { margin-top: 0; color: #155724; font-size: 1.2rem; }

.other-exp-section-title {
  border-bottom: 2px solid #dee2e6;
  padding-bottom: 8px;
  margin-bottom: 20px;
  font-size: 1.2rem;
  color: #495057;
}

.other-exp-block { margin-bottom: 25px; padding-bottom: 15px; border-bottom: 1px dashed #dee2e6; }
.other-exp-block:last-child { border-bottom: none; margin-bottom: 0; }
.other-exp-block h4 { margin: 0 0 5px 0; color: #6c757d; font-size: 1rem; }

.explanation-card {
  display: none;
  background: #f8f9fa;
  border-left: 4px solid #007bff;
  padding: 20px;
  border-radius: 4px;
  margin-bottom: 30px;
}
.exp-section-title { font-weight: bold; margin-top: 15px; margin-bottom: 5px; color: #495057; }
.exp-body { font-size: 0.95rem; color: #333; margin-bottom: 10px; }

/* Navigation Buttons */
.nav-actions { display: flex; justify-content: space-between; gap: 15px; margin-top: 40px; }

/* ========================================================
   6. Modals (間違い報告)
   ======================================================== */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  justify-content: center;
  align-items: center;
}
.modal-content {
  background: #fff;
  padding: 20px;
  border-radius: 8px;
  width: 90%;
  max-width: 500px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}
.modal-content textarea {
  width: 100%;
  height: 100px;
  margin: 15px 0;
  padding: 10px;
  border: 1px solid #dee2e6;
  border-radius: 4px;
  resize: vertical;
  box-sizing: border-box;
  font-family: inherit;
}
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; }
.report-link {
  font-size: 0.85rem;
  color: #dc3545;
  text-decoration: underline;
  cursor: pointer;
  display: inline-block;
  margin-top: 20px;
}

/* ========================================================
   7. Top Page (Index) & About
   ======================================================== */
.btn-group-vertical { display: flex; flex-direction: column; gap: 25px; }
.btn-item { display: flex; flex-direction: column; align-items: center; }
.btn-desc { font-size: 0.85rem; color: #666; margin-top: 8px; }

.notice-area {
  background: #fff;
  border: 1px solid #ddd;
  padding: 15px;
  border-radius: 5px;
  margin-bottom: 25px;
  text-align: left;
}
.notice-area h3 { margin-top: 0; font-size: 1rem; color: #666; border-bottom: 1px solid #eee; }
.notice-area ul { list-style: none; padding: 0; margin: 0; }
.notice-area li { font-size: 0.9rem; margin-bottom: 5px; }

.chapter-select-wrapper {
  background: #e9ecef;
  border: 1px solid #ced4da;
  padding: 15px;
  border-radius: 5px;
  margin-bottom: 25px;
  text-align: left;
}
.chapter-select-wrapper label { display: block; font-weight: bold; color: #495057; margin-bottom: 8px; }
.chapter-select-wrapper select {
  width: 100%;
  padding: 12px;
  font-size: 1rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  background-color: #fff;
  box-sizing: border-box;
}

/* ========================================================
   8. MyPage (学習分析)
   ======================================================== */
.subtitle { font-size: 0.9rem; color: #6c757d; text-align: center; margin-bottom: 35px; }
.data-card {
  background: #f8f9fa;
  padding: 16px 20px;
  border-radius: 6px;
  margin-bottom: 15px;
  border: 1px solid #e9ecef;
}
.data-header { display: flex; justify-content: space-between; align-items: center; font-weight: bold; margin-bottom: 10px; }
.data-name { color: #333; font-size: 1.05rem; }
.data-pct { color: #007bff; font-size: 1.1rem; }
.progress-bar-bg {
  background: #e9ecef;
  border-radius: 10px;
  height: 12px;
  width: 100%;
  overflow: hidden;
  margin-bottom: 6px;
}
.progress-bar-fill {
  background: linear-gradient(90deg, #28a745, #20c997);
  height: 100%;
  border-radius: 10px;
  transition: width 0.4s ease;
}
.progress-bar-fill.low-accuracy { background: linear-gradient(90deg, #dc3545, #ffc107); }
.data-meta { font-size: 0.85rem; color: #6c757d; text-align: right; }
.no-data {
  color: #6c757d;
  font-style: italic;
  text-align: center;
  padding: 30px 20px;
  background: #f8f9fa;
  border-radius: 6px;
  border: 1px dashed #dee2e6;
}
.btn-group-center { margin-top: 40px; display: flex; justify-content: center; }

/* ========================================================
   9. Error Page
   ======================================================== */
.error-icon { font-size: 4rem; margin-bottom: 10px; }
.error-title { font-size: 1.6rem; color: #dc3545; font-weight: bold; margin-top: 0; margin-bottom: 15px; }
.error-message { font-size: 1.05rem; color: #555; margin-bottom: 25px; white-space: pre-wrap; }
.redirect-message { font-size: 0.9rem; color: #888; margin-bottom: 30px; background: #f8f9fa; padding: 12px; border-radius: 4px; }
.countdown-number { font-weight: bold; color: #007bff; font-size: 1.2rem; margin: 0 4px; }

/* ========================================================
   10. Ads & Footer
   ======================================================== */
.ad-top-lead { width: 100%; max-width: 500px; margin: 10px auto 20px; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.ad-wrapper { display: flex; flex-direction: column; align-items: center; gap: 6px; margin: 30px auto; max-width: 100%; }
.ad-label { font-size: 0.75rem; color: #777; letter-spacing: 1px; font-weight: 500; }
.ad-box-banner { width: 100%; max-width: 468px; height: 60px; background-color: #e9ecef; color: #6c757d; display: flex; align-items: center; justify-content: center; font-size: 0.85rem; font-weight: bold; border: 2px dashed #ced4da; border-radius: 4px; box-sizing: border-box; }
.ad-box-rect { width: 336px; height: 280px; background-color: #e9ecef; color: #6c757d; display: flex; align-items: center; justify-content: center; font-size: 0.9rem; font-weight: bold; border: 2px dashed #ced4da; border-radius: 4px; box-sizing: border-box; }

.site-footer { margin-top: 30px; text-align: center; font-size: 0.8rem; color: #6c757d; padding-bottom: 20px; }