
/* 全体のスタイル */
body {
  font-family: sans-serif;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow-y: auto; /* コンテンツがはみ出た場合に縦方向にスクロールバーを表示。完全に非表示にする場合はhidden */
}

header {
  position: fixed; /* 常に画面上に固定 */
  top: 0; /* 画面の一番上に配置 */
  left: 0;
  right: 0;
  height: 60px; /* 必要に応じて高さを明示 */
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  background-color: #f8f9fa;
  border-bottom: 1px solid #e2e6ea;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  z-index: 10;
  flex-wrap: wrap;
  gap: 10px;
}

.category-info {
  display: flex;
  flex-direction: row; /* 横並びに変更 */
  align-items: center;
  gap: 0.5rem; /* 適度な間隔 */
}

#category-name {
  font-size: 1.2rem;
  font-weight: bold;
  color: #343a40;
}

.word-counter {
  font-size: 0.9rem;
  color: #6c757d;
}

.toggle-container {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.toggle-switch {
  width: 40px;
  height: 20px;
  background-color: #ccc;
  border-radius: 10px;
  position: relative;
  cursor: pointer;
  transition: background-color 0.3s;
}

.toggle-switch::before {
  content: '';
  width: 18px;
  height: 18px;
  background-color: white;
  border-radius: 50%;
  position: absolute;
  top: 1px;
  left: 1px;
  transition: transform 0.3s;
}

.toggle-switch.active {
  background-color: #007bff;
}

.toggle-switch.active::before {
  transform: translateX(20px);
}

/* スライダー（Swiper）のスタイル */
.swiper {
  width: 100%;
  height: calc(100vh - 120px); /* ヘッダーとフッターの高さを考慮 */
  display: flex; /* flexboxを使って中央配置を容易に */
  justify-content: center;
  align-items: center;
  flex-grow: 1; /* 残りのスペースを埋める */



}

.vertical-swiper {
  height: calc(100vh - 120px); /* ヘッダーとフッターの高さに基づいて調整 */
}

.swiper-slide {
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 2rem;
  text-align: center;
  flex-direction: column; /* 単語と選択肢を縦に並べる */
  padding: 1rem;
  box-sizing: border-box;
  background-color: #f0f2f5;

  
  
  
}

.inner-swiper {
  width: 100%;
  height: 100%;
}




.word {
  /* 以下、既存のスタイルとルーズリーフ風のスタイルを統合 */
  -webkit-tap-highlight-color: transparent; /* iOS Safari */
  -webkit-touch-callout: none; /* iOS Safariの長押しメニューを無効化（関連する場合） */
  -webkit-user-select: none; /* テキスト選択を無効化 */
  -moz-user-select: none; /* Firefox */
  -ms-user-select: none; /* Internet Explorer/Edge */
  user-select: none; /* 標準 */
  font-size: 2.4rem;
  font-weight: bold;
  color: #333;
  cursor: pointer;
  transition: color 0.3s;
  min-height: 70px; /* 例えば、最低の高さを250pxに設定 */
  /*max-height: 70px; /* 例えば、最大の高さを350pxに設定 */

   width: 80%; /* 親要素の幅いっぱいに広げる */
  /* 便箋全体のスタイル */
    /* ここに追加 */
  margin-top: 20px;  /* 上から20px下げる */

  background-color: #FFFACD;
  padding: 5rem 2.5rem;
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  position: relative;
  overflow: hidden;
  /* 罫線と縦線のスタイル */
  background-image: linear-gradient(
      to bottom,
      transparent 90%,
      #e0e0e0 90%,
      #e0e0e0 99%,
      transparent 99%
    ),
    linear-gradient(
      to right,
      transparent 98%,
      #e0e0e0 98%,
      #e0e0e0 99%,
      transparent 99%
    );
  background-size: 100% 30px, 30px 100%;
  background-repeat: repeat-y, repeat-x;
  background-position: 0 0, 0 0;
  line-height: 30px; /* 罫線の高さに合わせる */

  /* 便箋のサイズを明示的に指定する場合（例：A4サイズなど） */
  /* width: 210mm; */ /* A4の幅 */
  /* height: 297mm; */ /* A4の高さ */


/* ルーズリーフの穴 */
.word::before {
  content: '';
  position: absolute;
  left: 15px; /* 左端からの位置 */
  top: 15px; /* 上端からの位置 */
  width: 10px;
  height: 100%; /* 高さを100%にして、穴が複数あるように見せる */
  background-image: radial-gradient(
    circle at center,
    #ccc 20%,
    transparent 20%
  ); /* 穴の見た目 */
  background-size: 100% 30px; /* 穴の間隔を罫線に合わせる */
  background-repeat: repeat-y;
  z-index: 1; /* 内容より下に表示 */

    
  
}

   
}





.word .highlighted {
  white-space: nowrap; /* 改行させない */
  display: inline-block; /* 必要に応じて */
}



/* style.css */

.word-image {
  max-width: 100%; /* 親要素の幅に合わせて最大幅を設定 */
  height: auto; /* アスペクト比を維持 */
  display: block; /* 画像をブロック要素として扱い、中央寄せできるようにする */
  margin: 15px auto; /* 上下に15px、左右に自動マージンで中央寄せ（wordと選択肢の間隔） */
  border-radius: 8px; /* 角を丸くする */
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); /* 軽い影を追加 */
  object-fit: contain; /* 画像が要素に収まるように調整 */
  max-height: 230px; /* 画像の最大高さを設定（必要に応じて調整）。swiper-slideの高さと相談 */
  align-self: center; /* 親がflexの場合に中央寄せ */
}

/* PC（タブレットを含む広い画面）用のスタイル */
@media (min-width: 768px) { /* 768px以上の画面幅に適用 */
  .word-image {
    max-width: 310px; /* 例えば、付箋の幅の60%に制限 */
    max-height: none; /* または、例えば 400px など、より大きな値を設定 */
    /* あるいは、より具体的な最大ピクセル値を指定する場合 */
    /* max-width: 400px; */
  }
}


/* style.css 例文の文字サイズを小さくするCSS */
.word[data-example="1"] {
  font-size: 1.5rem; /* 通常の単語より小さめのサイズ */
}

/* 単語の下にだす意味のスタイル */
.word-meaning {
  font-size: 1.2rem;
  margin-top: 0.5rem; /* ここで位置を調整できます */
  color: #666;
  text-align: center; /* 必要に応じて中央揃え */
  width: 100%; /* 親要素の幅いっぱいに広げる */
}

/* 三択選択肢のスタイル */
.choices-container {
  display: flex;
  flex-direction: column; /* 縦に並べる */
  gap: 0.8rem; /* ボタン間の隙間 */
  margin-top: 1.5rem;
  width: 80%; /* ボタンの幅を調整 */
  max-width: 300px; /* 最大幅を設定 */
}

.choice-button {
  padding: 0.8rem 1.5rem;
  font-size: 1.2rem;
  background-color: #007bff;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.2s, opacity 0.2s;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.choice-button:hover:not(:disabled) {
  background-color: #0056b3;
}

.choice-button.correct {
  background-color: #28a745; /* 緑色 */
}

.choice-button.incorrect {
  background-color: #dc3545; /* 赤色 */
}

.choice-button:disabled {
  cursor: not-allowed;
}

/* メニュー画面のスタイル */
#menu-screen {
  padding: 3.5rem;
  gap: 0; /* ここを0にすることで、メニュー項目間の隙間がなくなります */
  background-color: #e9ecef;
  height: 100vh; /* 画面全体に広がるように */
  overflow-y: auto;
  box-sizing: border-box;
}

.menu-tile {
  background-color: #ffffff;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1.2rem;
  font-weight: bold;
  color: #495057;
  cursor: pointer;
  padding: 1.5rem;
  transition: background-color 0.2s, transform 0.2s;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
  text-align: center;
}

.menu-tile:hover {
  background-color: #e2e6ea;
  transform: translateY(-2px);
}

/* フッターのスタイル */
footer {
  position: fixed;
  bottom: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  padding: 0.5rem 1rem; /* 上下0.5rem、左右1remに設定 */
  text-align: center;
  cursor: pointer;
  font-weight: bold;
  color: #333;
  transition: background 0.3s ease;
  z-index: 20; /* クリックできるように、他の要素より手前に配置 */

  /* フッター要素自体を中央に配置するためのスタイル */
  width: max-content; /* コンテンツの幅に合わせる */
  left: 50%; /* 左端を画面の50%の位置に */
  transform: translateX(-50%); /* 要素の幅の半分だけ左に移動して中央揃え */
  white-space: nowrap; /* テキストが折り返さないようにする */
  border-radius: 10px 10px 0 0; /* デザインのため角を丸める */
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1); /* 影を追加 */
  display: flex; /* 中央配置がうまくいくように */
  justify-content: center; /* フッター内のコンテンツを中央に */
  align-items: center; /* フッター内のコンテンツを中央に */
}

footer:hover {
  background: rgba(255, 255, 255, 1);
}