/* 追従するトップメニュー */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    background-color: rgba(0, 0, 0, 0.8); /* 半透明の黒 */
    color: white;
    padding: 0px 0; /* 上下の余白を狭くする */
    text-align: center;
    z-index: 100;
    display: flex; /* Flexboxを使用してアイテムを並べる */
    justify-content: center; /* 横並び */
    align-items: center; /* アイテムを縦方向に中央揃え */
    height: auto; /* 高さを自動調整 */
}

nav a {
    color: white;
    padding: 14px 20px;
    text-decoration: none;
    font-size: 18px;
    font-weight: bold;
}

nav a:hover {
    background-color: #4b7a41; /* 濃い緑 */
}

/* ハンバーガーアイコン */
.hamburger-icon {
    display: none; /* デスクトップでは非表示 */
    cursor: pointer;
    font-size: 30px;
    color: white;
    position: absolute; /* アイコンを固定位置に配置 */
    right: 20px; /* 右端に配置 */
    top: 10px; /* 上端に配置 */
    background-color: rgba(0, 0, 0, 0.5); /* 黒で50%透過の背景 */
    padding: 10px; /* アイコン周りの余白 */
    border-radius: 5px; /* 角を丸める */
    pointer-events: auto; /* アイコンがクリックできるように */
    z-index: 1001; /* メニューの上に表示 */
}

/* モバイル向けの最適化 */
@media (max-width: 768px) {
    /* メニューアイテムを非表示にする */
    .nav-links {
        display: none;
        list-style: none;
        width: 100%;
        text-align: left; /* 左寄せに変更 */
        padding: 0; /* 上下の余白をなくす */
    }

    /* ハンバーガーアイコンの表示 */
    .hamburger-icon {
        display: block; /* モバイルで表示 */
        right: 20px; /* 右端に固定 */
        top: 10px; /* 上端に配置 */
    }

    /* メニューが表示された時に適用する */
    .nav-links.show {
        display: block;
        width: 100%; /* メニュー幅を100%に広げる */
    }

    /* メニュー項目を縦に並べる */
    .nav-links li {
        width: 100%;
    }

    .nav-links a {
        display: block;
        padding: 12px 20px;
        font-size: 16px;
    }
}
/* フッター */
footer {
    text-align: center;
    padding: 20px;
    background-color: #1b2a1f; /* ダークグリーン */
    color: white;
    font-size: 0.9rem;
    margin-top: 40px;
}

/* リンクの色 */
footer a {
    color: #a1c349;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}
/* フッターのスタイル */
.footer {
    background-color: black; /* 背景色を黒に */
    padding: 20px 0;
    text-align: center; /* リンクを中央揃え */
}

.footer-container {
    max-width: 1200px; /* 最大幅を1200pxに設定 */
    margin: 0 auto; /* 中央に配置 */
    padding: 0 20px; /* 左右に少し余白 */
}

.footer-links {
    list-style: none; /* リストマーカーを削除 */
    padding: 0;
    margin: 0;
    display: flex; /* 横並びに */
    flex-wrap: wrap; /* 画面幅に応じて折り返し */
    justify-content: center; /* 中央揃え */
}

.footer-links li {
    margin: 10px 15px; /* リンク間に適切なマージンを設定 */
}

.footer-link {
    text-decoration: none; /* 下線を消す */
    color: white; /* 文字色を白に */
    font-size: 1.2rem;
    transition: color 0.3s ease-in-out; /* ホバー時の色変更をスムーズに */
}

.footer-link:hover {
    color: #a1c349; /* ホバー時に色を変更 */
}

.copyright {
    margin-top: 20px; /* 上に少し余白 */
    color: white; /* 文字色を白に */
    font-size: 1rem; /* 少し小さめのフォント */
}
/* モバイル用の最適化 */
@media (max-width: 768px) {
    .footer-links {
        display: block; /* リンクを縦並びに */
        margin-top: 20px; /* 上に少し余白を追加 */
    }

    .footer-links li {
        margin: 10px 0; /* リンク間に少し余白を追加 */
    }

    .footer-link {
        font-size: 1.1rem; /* モバイルでは少し小さく */
        margin-bottom: 10px; /* ボタンの下に少し余白 */
    }

    .copyright {
        font-size: 0.9rem; /* モバイルでは少し小さく */
        margin-top: 30px; /* 上に余白を追加 */
    }
}
@media (max-width: 768px) {
  img {
    width: 100%;
    height: auto;
  }
}










/* ヘッダー */
header {
    background-color: #2b3e2f; /* ダークグリーン */
    color: #f1f1f1; /* 明るい文字色 */
    padding: 30px;
    margin-top: 80px;
    text-align: center;
    border-bottom: 5px solid #4b7a41; /* 濃い緑のボーダー */
}
@media (max-width: 768px) {
  header {
    margin-top: 0px;
  }
  }

header h1 {
    font-size: 3rem;
    margin-bottom: 10px;
    font-family: 'Cursive', sans-serif; /* 手書き風のフォント */
}

header h2 {
    font-size: 2rem;
    color: #f1f1f1;
    font-weight: normal;
    margin-top: 10px;
}



/* 基本スタイル */
body {
    font-family: 'Noto Sans JP', sans-serif;
    font-size: 18px;
    color: #333;
    background-color: #f9f9f9;
    margin: 0;
    padding: 0;
}
/* 難易度選択フォーム */
form[action=""] {
    background-color: #f4f4f9;  /* 柔らかい背景色 */
    padding: 40px;
    border-radius: 10px;
    width: 350px;
    margin: 0px auto;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* ラジオボタンのラベル（文字） */
form[action=""] label {
    font-size: 1.8em;  /* 文字を大きく */
    padding: 12px;
    display: block;
    cursor: pointer;  /* クリック可能にする */
    text-align: center;
    background-color: #ffffff;
    border: 2px solid #cccccc;
    border-radius: 8px;
    transition: background-color 0.3s, transform 0.3s, color 0.3s;
    width: 100%;
}

/* ラジオボタン非表示 */
form[action=""] input[type="radio"] {
    display: none;
}

/* ラジオボタンが選ばれたときのスタイル */
form[action=""] input[type="radio"]:checked + label {
    background-color: #00796b;
    color: #ffffff;
    border-color: #004d40;
}

/* ラジオボタンの選択肢にマウスオーバー時のスタイル */
form[action=""] label:hover {
    background-color: #00796b;
    color: white;
    transform: scale(1.05);
}

/* ボタンのスタイル */
form[action=""] button {
    background-color: #4CAF50;
    color: white;
    padding: 12px 30px;
    border: none;
    border-radius: 5px;
    font-size: 1.2em;
    cursor: pointer;
    margin-top: 20px;
    transition: background-color 0.3s;
}

/* ボタンホバー時 */
form[action=""] button:hover {
    background-color: #45a049;
}
/* スマホ版のスタイル調整 */
@media (max-width: 768px) {
    /* フォームの幅とパディング */
    form[action=""] {
        width: 90%;
        padding: 15px;
    }

    /* ラベルの文字サイズ調整 */
    form[action=""] label {
        font-size: 1.4em;  /* さらに文字を小さく調整 */
        margin-bottom: 10px;
        padding: 10px;
    }

    /* ボタンのサイズ調整 */
    form[action=""] button {
        font-size: 1.2em;
        padding: 10px 20px;
    }
}
/* クイズ部分 */
.quiz-container {
    background-color: #ffffff;
    padding: 20px;  /* パディングを少し減らす */
    border-radius: 10px;
    width: 100%;  /* 幅を100%にして、親要素に合わせる */
    max-width: 700px;  /* 最大幅を設定 */
    margin: 20px auto;  /* 中央揃え */
}

#question {
    font-size: 1.3em;  /* フォントサイズを少し小さく */
    margin-bottom: 20px;
    text-align: center;
}

/* 選択肢部分 */
#answers {
    display: grid;
    grid-template-columns: 1fr 1fr;  /* 横に2列 */
    gap: 10px;  /* 各選択肢の間隔を設定 */
    width: 100%;  /* 親要素の幅に合わせて100%に設定 */
    justify-items: center;  /* 横方向で中央揃え */
    align-items: center;  /* 縦方向で中央揃え */
    padding: 0 10px;  /* 親要素に余白を追加 */
}

/* 選択肢のラベル */
#answers label {
    font-size: 1.2em;  /* フォントサイズを少し小さく */
    padding: 15px;  /* パディングを少し大きめに */
    background-color: #ffffff;
    border: 2px solid #cccccc;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.3s;
    width: 100%;  /* 親要素の100%に設定してボックスを横いっぱいに広げる */
    max-width: 300px;  /* 最大幅を設定（調整可能） */
    text-align: center;  /* ラベル内のテキストを中央揃え */
    display: flex;
    justify-content: center;  /* ラベル内のコンテンツを横方向で中央揃え */
    align-items: center;  /* ラベル内のコンテンツを縦方向で中央揃え */
}
/* ラジオボタンを非表示 */
#answers input[type="radio"] {
    display: none;
}

/* 選択肢ホバー時 */
#answers label:hover {
    background-color: #00796b;
    color: #ffffff;
    transform: scale(1.05);
}

/* 選択肢が選ばれたとき */
#answers input[type="radio"]:checked + label {
    background-color: #00796b;
    color: #ffffff;
    border-color: #004d40;
}

/* 画像のサイズ調整 */
#question img {
    width: 100%;  /* 親要素に合わせて幅を設定 */
    height: auto;  /* アスペクト比を保つ */
    max-width: 650px; /* 最大幅を指定（必要に応じて変更） */
    display: block;  /* 画像をブロック要素として扱い、余白を削除 */
    margin: 0 auto;  /* 画像を中央に配置 */
}

/* 結果部分 */
#result {
    font-size: 1.3em;  /* フォントサイズを少し小さく */
    background-color: #ffeb3b;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    margin-top: 20px;
}

#result p {
    margin: 10px 0;
}

#score {
    font-weight: bold;
}

/* モバイル向けの調整 */
@media (max-width: 768px) {
    .quiz-container {
        width: 90%;  /* スマホでも中央に収める */
        padding: 15px;  /* パディングを減らす */
    }

    #question {
        font-size: 1.1em;  /* フォントサイズを少し小さく */
    }

    #answers label {
        font-size: 1em;  /* 選択肢のラベルのフォントサイズを小さく */
        padding: 8px;
        max-width: 160px; /* パディングを減らして圧縮 */
    }
    #question img{
      max-width: 500px;
    }
    #result {
        font-size: 1.2em;  /* 結果部分のフォントサイズ */
    }
}
