:root {
  --card-radius: 14px;
  --accent: #FFB6C1;
  --text: #222;
  --text-sub: #666;
  --bg: #fff;
}

.grade-box {
  text-decoration: none;
  /* 下線を消す */
  color: inherit;
  /* 文字色を親要素から引き継ぐ */
  display: block;
  /* ボックス全体をクリック可能にする */
  transition: transform 0.2s;
  /* ホバー時に動かすとおしゃれ */
}

.grade-box:hover {
  transform: translateY(-5px);
  /* 少し浮き上がる演出 */
}

h2 {
  font-size: 1.7rem;
  text-align: center;
}

/* main wrapper */
.top-main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 28px 16px;
}

.hero-inner {
  display: flex;
  gap: 20px;
  align-items: center;
  justify-content: space-around;
  padding: 20px;
}

.hero-text {
  width: 100%;
  text-align: center;
}

.hero-title {
  font-size: 1.5rem;
  margin: 0 0 8px;
  color: var(--text);
}

.hero-lead {
  color: var(--text-sub);
  margin: 0 0 14px;
}

.hero-ctas {
  display: flex;
  gap: 10px;
  justify-content: space-around;
}

.btn {
  display: inline-block;
  padding: 10px 14px;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 600;
  transition: background 0.3s ease, color 0.3s ease;
}

.btn.primary {
  background: var(--akari-bg);
  color: var(--akari-text);
  box-shadow: 0 8px 18px rgba(255, 182, 193, 0.18);
}

.btn.ghost {
  background: transparent;
  color: var(--manabu-text);
  border: inset;
  background: var(--manabu-bg);
}

/* hero visual */
.hero-visual {
  width: 36%;
  text-align: right;
}

.hero-illust {
  max-width: 100%;
  height: auto;
  display: inline-block;
}

/* subjects grid */
.sitemap-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(4, 1fr);
  margin-bottom: 28px;
}

/* card uses CSS variables for light/dark */
.sitemap-card {
  background: var(--card-bg, #fff);
  border-radius: var(--card-radius);
  padding: 22px 12px;
  text-align: center;
  text-decoration: none;
  color: var(--text);
  box-shadow: 0 6px 14px rgba(255, 182, 193, 0.18);
  transition: transform .28s cubic-bezier(.2, .9, .2, 1), box-shadow .28s;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.sitemap-card .icon {
  font-size: 2.2rem;
  margin-bottom: 8px;
}

.sitemap-card .label {
  font-weight: 700;
  font-size: 1rem;
}

/* hover */
.sitemap-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 14px 30px rgba(255, 182, 193, 0.18);
}

/* featured */
.featured-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, 1fr);
  margin-bottom: 28px;
}

.featured-card {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
  transition: transform .22s;
}

.featured-card a {
  display: flex;
  text-decoration: none;
  color: inherit;
}

.thumb-wrap {
  width: 40%;
  min-height: 100px;
  background: rgba(0, 0, 0, 0.03);
  display: flex;
  align-items: center;
  justify-content: center;
}

.thumb-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.featured-body {
  padding: 12px;
  width: 60%;
}

.featured-title {
  margin: 0 0 6px;
  font-size: 1rem;
}

.featured-excerpt {
  margin: 0;
  color: var(--text-sub);
  font-size: 0.9rem;
}

/* responsive */
@media (max-width:900px) {
  .hero-inner {
    flex-direction: column-reverse;
    text-align: center;
  }

  .hero-lead {
    font-size: 12px;
  }

  .hero-visual {
    width: 100%;
    order: -1;
  }

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

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

  .hero-illust {
    max-width: 44%;
    display: block;
    margin: auto;
  }
}

@media (min-width:1200px) {
  .sitemap-grid {
    grid-template-columns: repeat(4, 1fr);
  }

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



body[data-theme="dark"] .featured-card {
  background: #2a2a2a;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.6);
  color: var(--text);
}

/* card background in dark mode uses --card-bg-dark if provided */
body[data-theme="dark"] .sitemap-card {
  background: var(--card-bg-dark, #333);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.6);
  color: var(--text);
}

/* ensure contrast for label on light backgrounds */
.sitemap-card .label {
  color: inherit;
}

/* small accessibility focus */
.sitemap-card:focus {
  outline: 3px solid rgba(255, 182, 193, 0.25);
  outline-offset: 4px;
}



/* 未ログインのバナー：少し強調しつつ、ボタンとの重複を避ける */
.guest-welcome-banner {
  background: var(--pastel-yellow);
  /* 社会の黄色を薄く */
  border: 2px solid #ffcf40;
  border-radius: 20px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  text-align: center;
}



/* ヒーローエリアのボタン調整 */
.hero-ctas {
  margin-top: 1.5rem;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ==========================
   学習まとめページ用
========================== */

.summary-edu {
  background: var(--container-bg);
  padding: 20px;
  border-radius: 20px;
}

.summary-edu h1 {
  font-size: 24px;
  margin-bottom: 20px;
  border-left: 6px solid var(--accent-main, #ff9d00);
  padding-left: 12px;
}

.summary-edu h2 {
  margin-top: 30px;
  font-size: 20px;
  padding-left: 10px;
  border-left: 4px solid var(--math-c);
}

.grade-list {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 15px 20px;
  margin: 15px 0;
  list-style: none;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.grade-list li {
  margin: 8px 0;
  font-size: 15px;
}

/* ==========================
   HERO ダーク対応
========================== */

.hero-card {
  background: linear-gradient(180deg, #FFF8F9, #FFF);
  border-radius: 16px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
  transition: background .3s ease, box-shadow .3s ease;
  position: relative;
}

/* ダークモード */
body[data-theme="dark"] .hero-card {
  background: linear-gradient(180deg, #2a2a2a, #1f1f1f);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.6);
}

.user-greeting-bubble {
  background: var(--card-bg);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: space-evenly;

}

body[data-theme="dark"] .user-greeting-bubble {
  background: #333;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.6);
}

.well-come-back {
  font-size: 0.85rem;
  color: var(--text-sub);
}

.user-name {
  margin: 4px 0 0;
  font-size: 2.0rem;
  color: var(--text);
}

.guest-welcome-banner h3 {
  margin-top: 8px;
  margin-bottom: 6px;
}

.btn.primary {
  background: var(--akari-bg);
  color: var(--akari-text);
  transition: transform .2s ease, box-shadow .2s ease;
  border: inset;
}

.btn.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(255, 182, 193, 0.3);
}

body[data-theme="dark"] .btn.primary {
  background: #8A6FB3;
  color: #fff;
}


body[data-theme="dark"] .btn.ghost {
  background: #2e3b45;
  color: #d6f0ff;

}


body[data-theme="dark"] .hero-lead {
  color: #bbb;
}

body[data-theme="dark"] .hero-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top right, rgba(138, 111, 179, 0.15), transparent 60%);
  border-radius: 16px;
  pointer-events: none;
}

.kids-btn-primary {
  color: var(--manabu-text);
  border: inset;
  padding: 6px;
  border-radius: 22px;
  background: var(--manabu-bg);
}

/* --- 同意バナー（ふわふわアニメ） --- */
#cookie-banner {
  position: fixed;
  bottom: 30px;
  /* 少し浮かせる */
  right: 5px;
  z-index: 10000;
  transition: opacity 0.8s ease-out, transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.15));
}

/* 非表示状態 */
.banner-hidden {
  opacity: 0;
  transform: translateY(50px) scale(0.9);
  pointer-events: none;
}

/* 表示状態（ふわふわアニメ） */
.banner-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  animation: floating-soft 3s ease-in-out infinite;
}

/* ゆらゆらアニメ */
@keyframes floating-soft {
  0% {
    transform: translateY(0px);
  }

  50% {
    transform: translateY(-10px);
  }

  100% {
    transform: translateY(0px);
  }
}

/* --- キャラ配置 --- */
.character-container {
  display: flex;
  align-items: flex-end;
}

/* 博士のゆらゆらアニメ */
#dr-owl {
  width: 120px;
  height: auto;
  animation: owl-nod 4s ease-in-out infinite;
}

@keyframes owl-nod {

  0%,
  100% {
    transform: rotate(-2deg);
  }

  50% {
    transform: rotate(2deg);
  }
}

/* --- 吹き出し --- */
.speech-bubble {
  position: relative;
  border: 4px solid var(--manabu-bg);
  background: var(--bg);
  border-radius: 25px;
  padding: 18px 22px;
  margin-left: 10px;
  margin-bottom: 30px;
  max-width: 300px;
}

/* 吹き出しの三角（白） */
.speech-bubble::after {
  content: '';
  position: absolute;
  left: -18px;
  bottom: 15px;
  border-width: 12px 20px 12px 0;
  border-style: solid;
  border-color: transparent var(--bg) transparent transparent;
  z-index: 2;
}

/* 吹き出しの三角（枠） */
.speech-bubble::before {
  content: '';
  position: absolute;
  left: -26px;
  bottom: 14px;
  border-width: 13px 22px 13px 0;
  border-style: solid;
  border-color: transparent var(--manabu-bg) transparent transparent;
  z-index: 1;
}

/* --- ボタン --- */
#accept-btn {
  background: #ff9800;
  color: white;
  border: none;
  padding: 10px 25px;
  border-radius: 50px;
  cursor: pointer;
  font-weight: bold;
  font-size: 16px;
  box-shadow: 0 4px 0 #e68a00;
  transition: all 0.2s;
}

#accept-btn:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #e68a00;
}

/* --- ポリシーリンク --- */
.policy-link {
  color: #999;
  font-size: 11px;
  text-decoration: underline;
}

/* --- スマホ対応 --- */
@media (max-width: 480px) {
  #cookie-banner {
    left: 10px;
    right: 10px;
  }

  .speech-bubble {
    max-width: 220px;
  }
}

/* --- スマホ対応 --- */
@media (max-width: 1000px) {
  .banner-actions {
    flex-direction: column;
    gap: 12px;
    font-size: 14px;
  }
}

/* --- レイアウト基本 --- */
.grade-guide-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  margin: 24px 0;
}

/* --- 学年ボックス共通 --- */
.grade-box {
  background: var(--bg);
  border-radius: var(--card-radius);
  padding: 20px;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border: 2px solid transparent;
  display: flex;
  flex-direction: column;
}

.grade-box:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
}

.grade-box h3 {
  margin: 0 0 10px;
  font-size: 1.4rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.grade-box p {
  font-size: 1.4rem;
  color: var(--text-sub);
  line-height: 1.5;
  margin-bottom: 15px;
  flex-grow: 1;
}

/* --- 科目ミニボタン --- */
.sub-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.sub-links a {
  text-decoration: none;
  background: #f8f9fa;
  color: var(--text);
  padding: 6px 14px;
  border-radius: 50px;
  font-size: 1.4rem;
  font-weight: bold;
  border: 1px solid #eee;
  transition: all 0.2s;
}

.sub-links a:hover {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
  transform: scale(1.05);
}

/* --- 学年ごとのアクセント（例） --- */
.g0 {
  border-color: #ffeeb2;
}

/* 入学準備：黄 */
.g1 {
  border-color: #d1f7c4;
}

/* 1年：緑 */
.g2 {
  border-color: #ffd1dc;
}

/* 2年：ピンク */
.g3 {
  border-color: #cde7ff;
}

/* 3年：水色 */
.g4 {
  border-color: #e4d1ff;
}

/* 4年：ラベンダー */
.g5 {
  border-color: #ffd8b2;
}

/* 5年：オレンジ */
.g6 {
  border-color: #d1fff3;
}

/* 6年：ミント */
/* 2年：ピンク */

/* --- ダークモード対応 --- */
body[data-theme="dark"] .grade-box {
  background: #2a2a2a;
  border-color: #444;
}

.sub-links a {
  background: var(--menu-bg);
}

body[data-theme="dark"] .sub-links a {
  background: var(--menu-bg-dark);
  color: #ddd;
  border-color: #555;
}

body[data-theme="dark"] .sub-links a:hover {
  background: var(--accent);
  color: #fff;
}

body[data-theme="dark"] .ja {
  background: var(--menu-bg-dark);
}

.disabled-link {
  /* クリックを無効化 
  pointer-events: none;*/

  /* 暗転・非活性化（薄くグレーにするなど） 
  color: #a0a0a0;*/
  /* 文字色を薄く */
  /* opacity: 0.5;
  透明度を下げてさらに薄く */

  /* カーソルをデフォルトのままにする（クリック不可であることを示す） 
  cursor: default;*/

  /* 必要であれば下線を消す */
  text-decoration: none;
}

.faq-section {
  padding: 60px 20px;

  /* フッターとの境目を出すために少し色を変える */
}

.section-title {
  text-align: center;
  font-size: 1.8rem;

  margin-bottom: 40px;
  position: relative;
}

.section-title::after {
  content: "";
  display: block;
  width: 50px;
  height: 4px;
  background: #ff9800;
  /* サイトのメインカラーに合わせて調整 */
  margin: 10px auto;
  border-radius: 2px;
}

.faq-container {
  max-width: 800px;
  margin: 0 auto;
}

.faq-item {

  border-radius: 12px;
  margin-bottom: 20px;
  box-shadow: 0 4px 6px rgba(255, 223, 83, 0.05);
  overflow: hidden;
}

.faq-question {
  width: 100%;
  padding: 20px;
  text-align: left;
  background: none;
  border: none;
  font-weight: bold;
  font-size: 1.7rem;
  color: var(--text);
  display: flex;
  align-items: center;
}

.faq-question::before {
  content: "Q.";
  color: #ff9800;
  font-size: 1.4rem;
  margin-right: 15px;
}

.faq-answer {
  padding: 0 20px 20px 55px;
  line-height: 1.6;
}

.faq-answer strong {
  color: #e91e63;
}