/* テーブル */
table {
    border-collapse: collapse;
}

table,
th,
td {
    border: 1px solid rgba(0, 0, 0, 0.2);
    background: rgba(255, 255, 255, 0.8);
    color: #222;
}

/* ヘッダー */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 140px;
    background: rgba(28, 182, 44, 0.4);
    /* ← ここで色 + 透明度 */
    color: #222;
    padding: 15px;
    text-align: center;
    z-index: 1000;
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

/* ヘッダー内中央配置 */
.center-box {
    display: flex;
    justify-content: center;
    /* justify-content: space-between; */
    height: auto;
    /* height: 100%; */
    position: relative;
    z-index: 1;
    /* max-height: 500px; */
    /* overflow-y: auto; */
}

/* メインコンテンツ */
main {
    margin-top: 140px;
    padding: 20px;
}

/* 3区画レイアウト */
.container {
    display: flex;
    /* height: 100vh; */
    align-items: flex-start;
    height: auto;
}

.left,
.center,
.right {
    padding: 20px;
    margin: 10px;
    box-sizing: border-box;
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    color: #222;
}

/* 区画の比率 */
.left {
    flex: 1;
}

.center {
    flex: 2;
    display: flex;
    flex-direction: column;
    /* justify-content: center; */
    justify-content: flex-start;
    /* justify-content: space-between; */
    min-height: 7vh;
    height: auto;
    position: relative;
    z-index: 1;
    /* max-height: 500px; */
    /* overflow-y: auto; */
}

.right {
    flex: 1;
}

/* 入力欄 */
input[type="text"] {
    width: 100%;
    max-width: 400px;
    padding: 10px 12px;
    font-size: 16px;
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.6);
    color: #222;
    outline: none;
    box-sizing: border-box;
    backdrop-filter: blur(5px);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

input[type="text"]:focus {
    border-color: #66afe9;
    box-shadow: 0 0 5px rgba(102, 175, 233, 0.5);
}

/* 入力欄 */
input[type="password"] {
    width: 100%;
    max-width: 400px;
    padding: 10px 12px;
    font-size: 16px;
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.6);
    color: #222;
    outline: none;
    box-sizing: border-box;
    backdrop-filter: blur(5px);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

input[type="password"]:focus {
    border-color: #66afe9;
    box-shadow: 0 0 5px rgba(102, 175, 233, 0.5);
}

/* 入力欄 */
input[type="email"] {
    width: 100%;
    max-width: 400px;
    padding: 10px 12px;
    font-size: 16px;
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.6);
    color: #222;
    outline: none;
    box-sizing: border-box;
    backdrop-filter: blur(5px);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

input[type="email"]:focus {
    border-color: #66afe9;
    box-shadow: 0 0 5px rgba(102, 175, 233, 0.5);
}

/* 入力欄 */
input[type="number"] {
    width: 100%;
    max-width: 400px;
    padding: 10px 12px;
    font-size: 16px;
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.6);
    color: #222;
    outline: none;
    box-sizing: border-box;
    backdrop-filter: blur(5px);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

input[type="number"]:focus {
    border-color: #66afe9;
    box-shadow: 0 0 5px rgba(102, 175, 233, 0.5);
}

textarea {
    width: 100%;
    max-width: 400px;
    padding: 10px 12px;
    font-size: 16px;
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.6);
    color: #222;
    outline: none;
    box-sizing: border-box;
    backdrop-filter: blur(5px);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

textarea:focus {
    border-color: #66afe9;
    box-shadow: 0 0 5px rgba(102, 175, 233, 0.5);
}

select {
    width: 100%;
    max-width: 400px;
    padding: 10px 12px;
    font-size: 16px;
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.6);
    color: #222;
    outline: none;
    box-sizing: border-box;
    backdrop-filter: blur(5px);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

select:focus {
    border-color: #66afe9;
    box-shadow: 0 0 5px rgba(102, 175, 233, 0.5);
}


/* ボタン */
button,
.button1 {
    background: rgba(255, 255, 255, 0.6);
    color: #222;
    padding: 10px 20px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    cursor: pointer;
    backdrop-filter: blur(5px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    transition: background-color 0.3s, transform 0.2s;
}

/* 機能一覧のボタン行だけに適用する想定 */
.center-box.wrap-buttons {
    display: flex;
    flex-wrap: wrap;
    /* ← 枠内で折り返す */
    gap: 10px;
    /* ボタン間の余白 */
    align-items: stretch;
}

/* 各 form を“等分しつつ折り返し可能”にする */
.center-box.wrap-buttons form {
    flex: 1 1 220px;
    /* 伸縮可: 初期幅220px、狭くなれば次行へ */
    min-width: 180px;
    /* 無理な極小化を防ぐ */
}

/* ボタンは form 幅いっぱい、テキストは折り返さない */
.center-box.wrap-buttons button {
    width: 100%;
    white-space: nowrap;
    /* ← ボタン内の改行禁止 */
    overflow: hidden;
    /* はみ出し対策（任意） */
    text-overflow: ellipsis;
    /* 長文は…で省略（任意） */
}

button:hover,
.button1:hover {
    background-color: rgba(255, 255, 255, 0.8);
    transform: scale(1.03);
}

/* ハンバーガーメニュー */
.hamburger {
    display: none;
    font-size: 28px;
    cursor: pointer;
    position: absolute;
    right: 20px;
    top: 20px;
    color: #030303;
}

#toast {
    visibility: hidden;
    min-width: 250px;
    background-color: #333;
    color: #fff;
    text-align: center;
    padding: 10px;
    border-radius: 5px;
    position: fixed;
    z-index: 1;
    left: 50%;
    bottom: 30px;
    transform: translateX(-50%);
}

.center-box.flash-table {
    flex-direction: column;
    align-items: center;
}

.flash-area {
    margin-bottom: 20px;
}

#toast.show {
    visibility: visible;
    animation: fadein 0.5s, fadeout 0.5s 2.5s;
}

@keyframes fadein {
    from {
        bottom: 0;
        opacity: 0;
    }

    to {
        bottom: 30px;
        opacity: 1;
    }
}

@keyframes fadeout {
    from {
        bottom: 30px;
        opacity: 1;
    }

    to {
        bottom: 0;
        opacity: 0;
    }
}

/* 一問一答選択肢レイアウト */
#choices {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.choice {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 10px;
    cursor: pointer;
}

.choice:hover {
    background: #f6f6f6;
}

.flash-messages {
    width: 100%;
    text-align: center;
    margin: 20px 0;
    color: green;
    font-weight: bold;
}

.image-quiz-container {
    width: min(92%, 600px);
    margin: 30px auto;
    padding: 24px;
    text-align: center;
}

.image-quiz-container h1 {
    margin-bottom: 16px;
    font-size: 28px;
}

.quiz-description {
    margin-bottom: 20px;
}

.quiz-image-area {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 280px;
    margin-bottom: 20px;
}

.quiz-image {
    display: block;
    width: 100%;
    max-width: 400px;
    max-height: 400px;
    object-fit: contain;
    border-radius: 12px;
}

.letter-hint {
    margin: 20px 0;
}

.letter-hint p {
    margin-bottom: 12px;
    font-weight: bold;
}

.letter-boxes {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

.letter-box {
    display: inline-block;
    width: 30px;
    height: 38px;
    border-bottom: 3px solid #333;
}

.quiz-form {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-top: 24px;
}

.quiz-form label {
    font-weight: bold;
}

.quiz-form input[type="text"] {
    width: min(100%, 350px);
    padding: 12px;
    border: 2px solid #888;
    border-radius: 8px;
    font-size: 22px;
    text-align: center;
}

.quiz-form input[type="text"]:focus {
    border-color: #333;
    outline: none;
}

.input-count {
    margin: 0;
    font-size: 14px;
}

.quiz-form button,
.next-button {
    display: inline-block;
    padding: 10px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    text-decoration: none;
    cursor: pointer;
}

.answer-result {
    margin: 24px 0;
    padding: 20px;
    border-radius: 10px;
}

.correct-result {
    background-color: #e8f7e8;
}

.incorrect-result {
    background-color: #fdeaea;
}

.result-title {
    margin-bottom: 12px;
    font-size: 24px;
    font-weight: bold;
}

.correct-answer {
    font-size: 28px;
    font-weight: bold;
}

.back-link-area {
    margin-top: 30px;
}

@media screen and (max-width: 480px) {
    .image-quiz-container {
        margin: 10px auto;
        padding: 16px 8px;
    }

    .quiz-image-area {
        min-height: 220px;
    }

    .letter-box {
        width: 24px;
        height: 32px;
    }
}

/* モバイル時のレイアウト変更 */
@media (max-width: 1024px) {

    html {
        font-size: 100%;
    }

    .pc_only {
        display: none;
    }

    .hamburger {
        width: 48px;
        /* ← ここを広げる */
        height: 48px;
        /* ← ここを広げる */
        display: flex;
        align-items: center;
        justify-content: center;
        position: fixed;
        right: 12px;
        top: 12px;
        z-index: 9999;
    }

    .login-user {
        display: block;
        margin-top: 20px;
        text-align: right;
    }

    .container {
        flex-direction: column;
    }

    .left {
        position: fixed;
        top: 120px;
        left: 0;
        width: 100%;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(10px);
        border-top: 1px solid rgba(0, 0, 0, 0.1);
        z-index: 999;

        /* アニメーションのための初期状態 */
        transform: translateX(-120%);
        transition: transform 0.3s ease-in-out;
    }

    .left.open {
        display: block;
        transform: translateX(0);
        /* 表示位置 */
    }

    .center,
    .right {
        width: 100%;
    }

    body {
        font-size: 15px;
        /* ← 通常より少し大きめに */
    }

    h1 {
        font-size: 24px;
    }

    h2 {
        font-size: 20px;
    }

    h3 {
        font-size: 18px;
    }

    button {
        font-size: 15px;
        padding: 14px 24px;
        /* タップしやすく */
    }

    .toggle-btn {
        font-size: 12px;
        padding: 2px 6px;
        width: 80px;
    }

    input[type="text"] {
        font-size: 18px;
        padding: 14px 16px;
    }
}