  /* ── TOP メニュー ── */
  #menu {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding:0 20px;
  }
  .banner-list {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
    margin-top: 20px;
  }
  .banner {
    background: none;
    border: none;
    cursor: pointer;
  }
  .banner img {
    width: 300px;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    transition: transform 0.2s;
  }
  .banner img:hover {
    transform: scale(1.05);
  }

  /* ── フラッシュカード画面 ── */
  #flashcard-app { padding: 18px; }

  /* style/style.css */
  body {
    /* display: flex;
    flex-direction: column;
    align-items: center;*/
    font-family: sans-serif;
    margin: 0;
    /*padding: 20px;*/
  }

  h1 {
    font-size: 2rem;
    margin: 0;
    padding: 0;
    margin-bottom: 12px;
  }

  .shuffle-icon {
    background: #ffffff;
    border: 1px solid #cccccc;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
    transition: transform 0.2s, background 0.2s;
  }
  .shuffle-icon:hover {
    background: #f5f5f5;
    transform: scale(1.1);
  }

  /* ───── カード本体 ───── */
  .card {
    /* 画面幅の 90% を使う */
    width: 90vw;

    /* 最大横幅は 600px に制限 */
    max-width: 600px;

    /* 黄金比（幅 ÷ 高さ = φ）を維持 */
    aspect-ratio: 1.618 / 1;

    /* 余白・見た目はお好みで */
    margin: 0 auto 20px;
    cursor: pointer;
    perspective: 1000px;
  }

  .card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    text-align: center;
    transition: transform 0.6s;
    transform-style: preserve-3d;
  }
  .card.flipped .card-inner {
    transform: rotateY(180deg);
  }
  .card-face {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 3vw;
    border-radius: 12px;
    padding: 10px;
    box-sizing: border-box;
  }
  .card-back {
    transform: rotateY(180deg);
  }
  /* コントロール＋意味テキストを包むコンテナ */
  .controls-container {
    position: relative;
    width: 90vw;       /* ビューポート幅の90% */
    max-width: 600px;  /* 上限600px */
    margin: 0 auto 20px;
  }

  /* ───── コントロールボタン ───── */
  .controls {
    display: flex;
    align-items: center;
  justify-content: space-around;
    gap: 12px;
    height: 48px;
  }

  .controls button {
    background: #ffffff;
    border: 1px solid #cccccc;
    border-radius: 6px;
    padding: 15px 30px;
    font-size: 1rem;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
    transition: background 0.2s, transform 0.1s;
    display: flex;
  }
  .controls button:hover {
    background: #f5f5f5;
    transform: translateY(-2px);
  }

  /* ───── 画像フィット ───── */
  .card-face img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
  }
  /* ──── アイコンボタン共通スタイル ──── */
  .icon-button {
    background: #ffffff;
    border: 1px solid #cccccc;
    border-radius: 6px;
    padding: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
    transition: background 0.2s, transform 0.1s;
  }
  .icon-button:hover {
    background: #f5f5f5;
    transform: translateY(-2px);
  }
  .icon-button img {
    width: 24px;
    height: 24px;
  }
  #prev img{
  width: 24px;
  height: 24px;
  }
  #next img{
  width: 24px;
  height: 24px;
  }
  /* ──── シャッフルコンテナ ──── */
  .shuffle-container {
    width: 90vw;
    max-width: 600px;
    margin: 0 auto 12px;
    display: flex;
    justify-content: space-between;  /* ← ここを追加 */
    align-items: center;
  }

  /* 音声＋意味ボタン縦並び */
  .audio-meaning {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    margin: 0 12px; /* 前後のボタンとの間隔 */
  }

  /* 意味ボタン */
  .meaning-controls-btn {
    background: #ffffff;
    border: 1px solid #cccccc;
    border-radius: 6px;
    padding: 10px 14px;
    font-size: 0.9rem;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
    transition: background 0.2s, transform 0.1s;
    margin: 1vw 0;
  }
  .meaning-controls-btn:hover {
    background: #f5f5f5;
    transform: translateY(-1px);
  }
  .meaning-controls-btn-main {
  text-align: center;
  }
  /* 意味テキスト領域を絶対配置 */
  .meaning-text {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;       /* 親 (.controls-container) の幅にフィット */
    display: none;     /* JSでトグル */
    margin-top: 8px;
    padding: 10px;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    box-sizing: border-box;
    text-align: center;
    font-size: 1rem;
    line-height: 1.4;
  }
  /* ──── モーダルオーバーレイ ──── */
  .meaning-modal {
    display: none;               /* JS で切り替え */
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    z-index: 100;
    padding-left: 200px;
  }

  /* モーダル内コンテンツ */
  .meaning-modal-content {
    background: #fff;
      border: 4px solid #000000;    /* ← ここで枠線の太さと色を指定 */

    border-radius: 8px;
    padding: 20px;
    box-sizing: border-box;

    /* 横幅は 80vw／最大600px のまま */
    width: 60vw;
    max-width: 600px;

    /* 黄金比（幅 ÷ 高さ = φ）を維持 */
    aspect-ratio: 1.618 / 1;

    /* モーダル内のテキストがはみ出す場合はスクロール */
    overflow-y: auto;
  }

  /* カウンターの見た目 */
  #counter {
    font-size: 1rem;
    font-weight: bold;
    color: #333;
    /* アイコンボタンとバランスを合わせるため、適度にパディングを入れてもOK */
    padding: 4px 8px;
      text-align: center;
  }

  .category-filter {
    padding: 6px 10px;
    font-size: 1rem;
    border-radius: 6px;
    border: 1px solid #ccc;
    margin: 0 12px;
  }

  .back-filter{
    display: flex;
  }


  /* ── レスポンシブ：デスクトップ用に only モーダル表示 ── */
  @media (min-width: 768px) {
    /* モバイルで使っていたインライン意味テキストは非表示に */
    .meaning-text {
      display: none !important;
    }
  }

  /* ───────── モバイル（幅767px以下） ───────── */
  @media (max-width: 767px) {
    /* 下に展開：意味テキストを親幅いっぱいに */
    .meaning-text {
      position: absolute;
      top: 100%;              /* ボタン行の下に */
      left: 0;
      width: 100%;
      margin-top: 15px;
    }
    .banner img {
    width: 80vw;
    }
    .controls button {
    padding: 10px 14px;
  }
  }
  /* ipadmini用*/
  @media (max-width: 770px) {
    .card-face {
      font-size: 4.5vw; /* 小さい画面時の最小フォントサイズ */
    }
      .meaning-modal {
    padding-left: 0;
      }
      .meaning-modal-content{
    width: 90vw;
  }
  }
  @media (max-width: 480px) {
    .card-face {
      font-size: 6vw; /* 小さい画面時の最小フォントサイズ */
    }
  }
  /* タッチデバイスではホバー効果を無効化*/ 
  /* @media (hover: none) {
    button:hover,
    .icon-button:hover,
    .controls-btn:hover {
      background: #fff !important;
      transform: none !important;
      box-shadow: 0 2px 4px rgba(0,0,0,0.15) !important;
    }
  }*/

  /* 表（front）の背景色 */
  .card-front {
    background-color: #fff; /* 表は白色（お好きな色に変更可） */
      border: 10px solid #b3deff;
  }

  /* 裏（back）の背景色 */
  .card-back {
    background-color: #fff; /* 裏は淡い黄色など（お好きな色に変更可） */
  }