#a {
  font-family: Arial, sans-serif;
  background-color: #f9f9f9;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  margin: 0;
}

.container {
  max-width: 800px;
  width: 100%;
  margin: 0 auto;
  text-align: center;
  padding: 50px;
}

/* 全問題数表示エリア */
.quiz-info {
  font-size: 1.2rem;
  color: white;
  margin-bottom: 20px;
  max-width: 100px;
  margin-left: auto;
  margin-right: auto;
  padding: 5px;
  border: 2px solid #333;
  border-radius: 5px;
  background-color: dimgrey;
}

.quiz-container,
.result-section,
.final-section {
  display: none;
  margin: 20px auto;
}

.question-number {
  font-weight: bold;
  margin-bottom: 10px;
}

.question {
  font-weight: bold;
  margin-bottom: 10px;
  padding: 15px;
  border: 2px solid black;
  border-radius: 10px;
  box-shadow: 0px 0px 8px rgba(0, 0, 0, 0.5);
  background-color: #ffffff;
}

.grid-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-gap: 10px;
}

.choice {
  padding: 15px;
  background-color: #ffffff;
  text-align: center;
  cursor: pointer;
  border: 2px solid black;
  border-radius: 10px;
  box-shadow: 0px 0px 8px rgba(0, 0, 0, 0.5);
  transition: background-color 0.3s;
}

.choice:hover {
  background-color: #d0d0d0;
}

.result-section {
  padding: 20px;
  border: 2px solid black;
  border-radius: 10px;
  box-shadow: 5px 5px 10px rgba(0, 0, 0, 0.5);
  background-color: #f1f1f1;
}

#answer-result {
  font-size: 2rem;
  margin-bottom: 10px;
}

.correct {
  color: green;
}

.wrong {
  color: red;
}

#next-question {
  margin-top: 20px;
  padding: 10px;
  background-color: #e0e0e0;
  text-align: center;
  cursor: pointer;
  border: 2px solid black;
  border-radius: 10px;
  box-shadow: 0px 0px 8px rgba(0, 0, 0, 0.5);
  transition: background-color 0.3s;
  max-width: 300px;
  margin-left: auto;
  margin-right: auto;
}

#next-question:hover {
  background-color: #d0d0d0;
}

.final-section {
  padding: 20px;
  border: 2px solid black;
  border-radius: 10px;
  box-shadow: 5px 5px 10px rgba(0, 0, 0, 0.5);
  background-color: #f9f9f9;
  margin: 20px auto;
  max-width: 800px;
}

#restart-quiz {
  margin-top: 20px;
  padding: 10px;
  background-color: #e0e0e0;
  text-align: center;
  cursor: pointer;
  border: 2px solid black;
  border-radius: 10px;
  box-shadow: 0px 0px 8px rgba(0, 0, 0, 0.5);
  transition: background-color 0.3s;
  max-width: 300px;
  margin-left: auto;
  margin-right: auto;
}

#restart-quiz:hover {
  background-color: #d0d0d0;
}

#b {
  position: fixed;
  bottom: 20px; /* 画面の下から20pxの位置に配置 */
  left: 50%;
  transform: translateX(-50%); /* 中央寄せ */
  background-color: #f0f0f0;
  padding: 10px 20px;
  border-radius: 10px;
  text-decoration: none;
  color: #333;
  font-weight: bold;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}
#b:hover {
  background-color: #ddd;
}

#a {
  background-color: #e0ffff; /* 水色 (lightblue) + 透明度50% */
}

/* === ハンバーガーメニュー本体 === */
.hamburger {
  position: fixed;
  top: 10px;
  right: 20px;
  width: 35px;
  height: 25px;
  cursor: pointer;
  z-index: 1001;
}

.hamburger .bar {
  height: 4px;
  width: 100%;
  background-color: #333;
  border-radius: 2px;
  margin: 5px 0;
  transition: 0.4s;
}

/* === メニュー内容 === */
.menu {
  position: fixed;
  top: 0;
  right: -250px; /* 初期状態では隠す */
  width: 250px;
  height: 100%;
  background-color: #f8f9fa;
  box-shadow: -3px 0 10px rgba(0, 0, 0, 0.1);
  transition: right 0.4s ease;
  padding-top: 60px;
  z-index: 1000;
}

.menu ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.menu ul li {
  margin: 20px 0;
  text-align: center;
}

.menu ul li a {
  text-decoration: none;
  color: #333;
  font-size: 18px;
  font-weight: bold;
}

.menu ul li a:hover {
  color: #0078ff;
}

/* === 開いた状態 === */
.menu.active {
  right: 0;
}

.hamburger.active .bar:nth-child(1) {
  transform: rotate(45deg) translateY(10px);
}
.hamburger.active .bar:nth-child(2) {
  opacity: 0;
}
.hamburger.active .bar:nth-child(3) {
  transform: rotate(-45deg) translateY(-10px);
}

/* === サブメニュー === */
.submenu {
  position: absolute;
  top: 0;
  right: -250px;
  width: 250px;
  height: 100%;
  background-color: #f8f9fa;
  transition: right 0.4s ease;
  padding-top: 60px;
  list-style: none;
  margin: 0;
  padding-left: 0;
}

.submenu li {
  text-align: center;
  margin: 20px 0;
}

.submenu li a {
  text-decoration: none;
  color: #333;
  font-size: 18px;
  font-weight: bold;
}

.submenu li a:hover {
  color: #0078ff;
}

.submenu.active {
  right: 0;
}

/* 戻るボタン */
.back-btn {
  cursor: pointer;
  font-weight: bold;
  color: #0078ff;
}

/* メインメニューが左にスライドするアニメーション */
.menu.slide-left #main-menu {
  transform: translateX(-250px);
  transition: transform 0.4s ease;
}

/* 行事メニュー項目（クリック可能スタイル） */
#events-link {
  cursor: pointer;
  color: #333;
  font-size: 18px;
  font-weight: bold;
  position: relative;
  transition: all 0.3s ease;
  display: inline-block;
  padding: 8px 16px;
  border-radius: 8px;
}

#events-link::after {
  content: "▶";
  font-size: 14px;
  margin-left: 8px;
  transition: transform 0.3s ease;
}

/* ホバー時のアニメーション */
#events-link:hover {
  background-color: #0078ff;
  color: white;
  box-shadow: 0 2px 8px rgba(0, 120, 255, 0.4);
}

#events-link:hover::after {
  transform: translateX(4px);
}

/* 行事メニューを中央寄せに */
#events-link {
  cursor: pointer;
  color: #333;
  font-size: 18px;
  font-weight: bold;
  position: relative;
  transition: all 0.3s ease;
  display: inline-block;
  padding: 12px 20px;
  border-radius: 8px;
  text-align: center;
  left: 50%;
  transform: translateX(-50%); /* 中央寄せ */
}

/* 矢印のアニメーション */
#events-link::after {
  content: "▶";
  font-size: 14px;
  margin-left: 8px;
  transition: transform 0.3s ease;
}

/* ホバー時（押せそうな動き） */
#events-link:hover {
  background-color: #0078ff;
  color: white;
  box-shadow: 0 2px 8px rgba(0, 120, 255, 0.4);
  transform: translateX(-50%) scale(1.05);
}

#events-link:hover::after {
  transform: translateX(4px);
}

/* === 一番上に戻るボタン === */
#back-to-top {
  position: fixed;
  bottom: 30px;      /* 画面下から30px */
  right: 30px;       /* 画面右から30px */
  width: 50px;
  height: 50px;
  border: none;
  border-radius: 50%;
  background-color: #0078ff;
  color: white;
  font-size: 20px;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  opacity: 0;             /* 最初は非表示 */
  visibility: hidden;
  transition: all 0.4s ease;
  z-index: 1000;
}

/* ホバー時の見た目 */
#back-to-top:hover {
  background-color: #005fcc;
  transform: scale(1.1);
}

/* 表示状態 */
#back-to-top.show {
  opacity: 1;
  visibility: visible;
}

/* === 固定ヘッダー === */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background-color: #0078ff;
  color: white;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  font-family: "Segoe UI", "メイリオ", sans-serif;
}

/* === ヘッダー内部の配置 === */
.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1000px;
  margin: 0 auto;
  padding: 10px 20px;
}

/* === タイトル === */
.site-title {
  font-size: 20px;
  margin: 0;
}

/* === ナビゲーションリンク === */
.nav-links {
  display: flex;
  align-items: center;
}

.nav-links a {
  color: white;
  text-decoration: none;
  margin-left: 20px;
  padding: 8px 14px;
  border-radius: 6px;
  transition: 0.3s;
  font-weight: bold;
}

.nav-links a:hover {
  background-color: white;
  color: #0078ff;
}

/* === ドロップダウン基本設定 === */
.dropdown {
  position: relative;
  display: inline-block;
}

.dropbtn {
  cursor: pointer;
}

/* === サブメニュー === */
.dropdown-content {
  display: none;
  position: absolute;
  top: 30px;
  left: 0;
  background-color: white;
  min-width: 180px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  border-radius: 8px;
  overflow: hidden;
  z-index: 999;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.25s ease;
  pointer-events: none; /* 非表示時にクリック無効 */
}

.dropdown-content a {
  color: #0078ff;
  padding: 10px 15px;
  text-decoration: none;
  display: block;
  transition: 1s;
  white-space: nowrap;
  overflow: hidden;
}

.dropdown-content a:hover {
  background-color: #f0f0f0;
}

/* === ホバーで展開（スライド風アニメ付き） === */
.dropdown:hover .dropdown-content {
  display: block;
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* === ヘッダーがコンテンツを隠さないように === */
.c {
  margin: 0;
  padding-top: 60px;
}
#explanation-box {
  font-size: 26px;
}

.explanation-box {
  position: absolute;
  padding: 12px;
  background-color: #ffffff;
  border: 2px solid #333;
  border-radius: 10px;
  box-shadow: 0 0 10px rgba(0,0,0,0.3);
  font-size: 14px;
  opacity: 0;
  z-index: 2000;
  pointer-events: none;
  display: none;
}
/* フェードイン */
.explanation-fade-in {
  animation: fadeIn 0.5s forwards;
}

/* フェードアウト */
.explanation-fade-out {
  animation: fadeOut 0.5s forwards;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes fadeOut {
  from { opacity: 1; }
  to   { opacity: 0; }
}
