/* 全体ベース：淡いレインボー背景 */
body {
  font-family: 'M PLUS Rounded 1c', system-ui, sans-serif;
  margin: 0;
  padding: 0;
  background: linear-gradient(
    135deg,
    #e7f9ed 0%,
    #dff7f5 15%,
    #dff0ff 30%,
    #f3e8ff 50%,
    #ffe8f0 70%,
    #fff4e0 85%,
    #f7ffe5 100%
  );
  background-attachment: fixed;
  color: #333;
}

/* アプリ全体の幅 */
#app {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 16px 32px;
  box-sizing: border-box;
}

/* 固定ヘッダー */
#appHeader {
  position: sticky;
  top: 0;
  z-index: 10;
  text-align: center;
  background: rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(6px);
  padding: 10px;
  border-bottom: none;
  margin: 0 auto;
  border-radius: 40px;
  max-width: 100%;
  width: 100%;
  box-sizing: border-box;
}

/* タイトル帯 */
.title-banner {
  background: linear-gradient(90deg, #cce6ff, #f0ccff);
  padding: 16px 28px;
  border-radius: 32px;
  font-size: 22px;
  font-weight: 500;
  color: #4a4a4a;
  text-align: center;
  font-family: 'M PLUS Rounded 1c', sans-serif;
  box-shadow: none;
  margin: 0;
  border: none;
}

.subtitle {
  font-size: 14px;
  color: #666;
  font-weight: normal;
  display: block;
  margin-top: 6px;
}

/* 現在の級ラベル */
#currentGradeLabel {
  margin-top: 6px;
  font-size: 14px;
  color: #4a90e2;
  font-weight: 600;
}

/* メインセクション */
main {
  margin-top: 18px;
}

/* セクションタイトル */
.section-title {
  text-align: center;
  font-size: 20px;
  margin: 10px 0 4px;
  color: #2c3e50;
}

.section-desc {
  text-align: center;
  font-size: 14px;
  color: #607d8b;
  margin: 0 0 16px;
}

/* 級選択エリア */
#gradeSelector {
  margin-top: 10px;
}

.grade-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 10px;
}

/* 級カード */
.grade-card {
  background: rgba(255, 255, 255, 0.9);
  border-radius: 16px;
  padding: 16px 18px;
  border: none;
  width: 100%;
  text-align: left;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
  cursor: pointer;
  box-sizing: border-box;
  transition: transform 0.08s ease, box-shadow 0.12s ease, background 0.12s ease;
}

.grade-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
  background: rgba(255, 255, 255, 0.95);
}

.grade-main {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.grade-label {
  font-size: 20px;
  font-weight: 700;
  color: #2c3e50;
}

.grade-type {
  font-size: 13px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #e3f2fd;
  color: #1565c0;
}

.grade-note {
  margin: 6px 0 0;
  font-size: 13px;
  color: #607d8b;
}

/* 問題カード */
.card {
  background: rgba(255, 255, 255, 0.92);
  border-radius: 18px;
  padding: 18px 16px;
  margin-top: 18px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
  box-sizing: border-box;
}

.card h2 {
  margin-top: 0;
  font-size: 18px;
  line-height: 1.5;
  margin-bottom: 14px;
  color: #2c3e50;
}

/* 記述式入力 */
.card input[type="text"] {
  width: 100%;
  padding: 10px 12px;
  font-size: 15px;
  border-radius: 10px;
  border: 1px solid #cfd8dc;
  box-sizing: border-box;
  margin-bottom: 10px;
}

/* 選択肢ボタン */
.card button {
  display: block;
  width: 100%;
  margin: 6px 0;
  padding: 10px 12px;
  font-size: 15px;
  border-radius: 10px;
  border: 1px solid #cfd8dc;
  background: #ffffff;
  text-align: left;
  cursor: pointer;
  box-sizing: border-box;
  transition: background 0.12s ease, transform 0.06s ease, box-shadow 0.1s ease;
}

.card button:hover {
  background: #f5f9ff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  transform: translateY(-1px);
}

/* 正解・不正解ポップアップ（旧） */
.popup button {
  padding: 10px 20px;
  margin-top: 10px;
  font-size: 15px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
}

/* 終了画面・チェックポイント画面 */
.end-actions button {
  margin: 6px 0;
  padding: 10px 20px;
  font-size: 15px;
  border-radius: 10px;
  border: none;
  background: #4a90e2;
  color: white;
  cursor: pointer;
}

/* 🌱 問題カードの下に表示する芽のイラスト */
.reef-icon {
  display: block;
  margin: 16px auto 0;
  max-width: 120px;
  opacity: 0.9;
}

/* 🐦 トップ画面キャラクター */
.top-character {
  display: block;
  width: 220px;
  max-width: 70%;
  margin: 20px auto 10px;
  animation: float 4s ease-in-out infinite;
  opacity: 0.95;
}

/* ゆっくり浮かぶアニメーション */
@keyframes float {
  0% { transform: translateY(0px); }
  50% { transform: translateY(-12px); }
  100% { transform: translateY(0px); }
}

/* フッター */
.app-footer {
  text-align: center;
  font-size: 12px;
  color: #607d8b;
  margin: 30px 0 10px;
  opacity: 0.8;
}

/* トップに戻る */
.back-to-top-area {
  text-align: center;
  margin: 20px 0;
}

.back-to-top-btn {
  background: linear-gradient(135deg, #f6eaff, #e0f7ff);
  border: none;
  padding: 12px 26px;
  border-radius: 30px;
  font-size: 15px;
  color: #4a4a4a;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0,0,0,0.12);
  transition: 0.25s ease;
  font-weight: 600;
}

.back-to-top-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 14px rgba(0,0,0,0.18);
}

/* スマホ向けレスポンシブ */
@media (max-width: 600px) {
  #app {
    padding: 0 10px 24px;
  }

  .title-banner {
    font-size: 18px;
    padding: 12px 18px;
  }

  .subtitle {
    font-size: 12px;
  }

  #currentGradeLabel {
    font-size: 13px;
  }

  .section-title {
    font-size: 18px;
  }

  .section-desc {
    font-size: 13px;
  }

  .grade-card {
    padding: 12px 12px;
    border-radius: 14px;
  }

  .grade-label {
    font-size: 18px;
  }

  .card {
    padding: 14px 12px;
    border-radius: 14px;
  }

  .card h2 {
    font-size: 16px;
    margin-bottom: 10px;
  }

  .card button {
    font-size: 14px;
    padding: 9px 10px;
  }

  .popup {
    font-size: 13px;
  }
}

/* フェードアウトアニメーション */
.fade-out {
  animation: fadeOut 0.25s ease forwards;
}

@keyframes fadeOut {
  from { opacity: 1; transform: scale(1); }
  to { opacity: 0; transform: scale(0.97); }
}

/* 🌈 中央ポップアップ（カルナちゃん用に背景を強化） */
.popup-center {
  background:
    radial-gradient(circle at top left, rgba(255,240,250,0.7) 0%, transparent 60%),
    radial-gradient(circle at bottom right, rgba(230,255,255,0.7) 0%, transparent 60%),
    linear-gradient(135deg, #fff7e6, #ffeef7, #f0f4ff, #e8fff4);
  border-radius: 18px;
  padding: 24px 20px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.15);
  text-align: center;
  max-width: 90%;
  margin: 60px auto;
  animation: fadeIn 0.25s ease;
}

/* ポップアップ内ボタンを縦並びにする（サイズは元に戻す） */
.popup-center button {
  display: block;
  width: auto;
  margin: 12px auto 0;
  padding: 12px 20px;
  font-size: 16px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
}

/* 正解確認ボタン（オレンジ） */
.btn-check-answer {
  background: #ffb74d;
  color: #4a4a4a;
  border: none;
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 16px;
  cursor: pointer;
  margin-top: 10px;
  margin-bottom: 12px;
}

.btn-check-answer:hover {
  background: #ffa726;
}

/* 次へボタン（青） */
.btn-next {
  background: #4a90e2;
  color: white;
  border: none;
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 16px;
  cursor: pointer;
  margin-top: 12px;
}

.btn-next:hover {
  background: #3b7ac9;
}
#currentGradeLabel {
  font-size: 24px;       /* 文字サイズ */
  font-weight: bold;     /* 太字 */
  margin-top: 10px;
  text-align: center;
  color: #4682B4;


;           /* ← 青に変更 */
}
