@charset "UTF-8";

body {
    font-family: "Hiragino Kaku Gothic ProN", "Meiryo", sans-serif;
    background-color: #f0f8ff;
    margin: 0;
    padding: 20px;
    color: #333;
}

.game-wrapper {
    max-width: 600px;
    margin: 0 auto;
    background: #fff;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    padding: 20px;
    text-align: center;
}

.game-header h1 {
    font-size: 1.5rem;
    margin-bottom: 5px;
    color: #007bff;
}

.game-header p {
    font-size: 0.9rem;
    color: #666;
    margin-top: 0;
}

/* 画面切り替え用 */
.screen {
    display: none;
    animation: fadeIn 0.5s;
}
.screen.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* スタート画面 */
.intro-box {
    background: #fff3cd;
    padding: 15px;
    border-radius: 10px;
    border: 2px dashed #ffeeba;
    margin-bottom: 20px;
}

/* ボタン共通 */
.action-btn {
    background-color: #ff6b6b;
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: 1.2rem;
    font-weight: bold;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 4px 0 #d9534f;
    transition: transform 0.1s;
}
.action-btn:active {
    transform: translateY(4px);
    box-shadow: none;
}

/* クイズ画面 */
.status-bar {
    display: flex;
    justify-content: space-between;
    font-weight: bold;
    margin-bottom: 15px;
    color: #555;
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
}

.situation-card {
    margin-bottom: 20px;
}

/* 状況画像（問題画像）のスタイル */
#question-image {
    max-width: 100%;
    height: auto;
    max-height: 200px;
    border-radius: 8px;
    margin: 10px 0;
    border: 1px solid #ddd;
    object-fit: contain;
}

.category-label {
    display: inline-block;
    background: #e9ecef;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.85rem;
    color: #555;
    margin-bottom: 5px;
}

#question-text {
    font-size: 1.4rem;
    color: #333;
    min-height: 3.5rem;
}

/* 選択肢ボタンエリア */
.options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr; /* 横並び */
    gap: 15px;
}

.option-btn {
    background: #f8f9fa;
    border: 2px solid #dee2e6;
    padding: 15px;
    border-radius: 10px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s;
    height: 100%;
    display: flex;
    flex-direction: column; /* 縦並び */
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 120px;
}

.option-btn:hover {
    background: #e2e6ea;
    border-color: #adb5bd;
}

/* 選択肢の画像・絵文字スタイル */
.card-img {
    max-width: 100%;
    max-height: 80px;
    object-fit: contain;
}

.card-emoji {
    font-size: 3rem;
    line-height: 1;
}

.card-text {
    font-weight: bold;
    font-size: 1rem;
}

/* スマホレイアウト */
@media (max-width: 480px) {
    .options-grid {
        grid-template-columns: 1fr; /* スマホは縦1列 */
    }
}

/* 解説エリア */
.feedback-box {
    margin-top: 20px;
    padding: 15px;
    border-radius: 10px;
    background: #f1f1f1;
    border: 2px solid #ddd;
}

.feedback-box.correct {
    background: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

.feedback-box.wrong {
    background: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

.next-btn {
    background: #17a2b8;
    color: white;
    border: none;
    padding: 10px 25px;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
    margin-top: 10px;
}

/* 結果画面 */
.score-display h1 {
    font-size: 3.5rem;
    margin: 10px 0;
    color: #ff6b6b;
}

/* --------------------------------------------------
   ボタンのアニメーション・ホバー追加
-------------------------------------------------- */

/* 1. メインボタン（スタート・もう一度）のホバー */
.action-btn {
    /* 既存のスタイルに追加：変化をなめらかにする */
    transition: all 0.2s ease;
}

.action-btn:hover {
    background-color: #ff8787;    /* 色を少し明るく */
    transform: translateY(-3px);  /* 少し上に浮き上がる */
    box-shadow: 0 7px 0 #d9534f;  /* 影を伸ばして浮遊感を出す */
}

/* クリックした瞬間の動き（既存があれば上書き） */
.action-btn:active {
    transform: translateY(4px);   /* 押し込む */
    box-shadow: none;             /* 影をなくす */
}


/* 2. サブボタン（ゲームを終了する）のスタイル */
/* インラインスタイルをここに移動しました */
.secondary-btn {
    color: #666;
    background: #f4f4f4;
    border: 1px solid #ccc;
    border-radius: 8px;
    padding: 10px 24px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease; /* なめらかに変化 */
    font-weight: bold;
}

/* サブボタンのホバー */
.secondary-btn:hover {
    background: #e2e2e2;   /* 背景を少し濃いグレーに */
    color: #333;           /* 文字を濃く */
    border-color: #999;    /* 枠線を濃く */
    transform: translateY(-2px); /* ほんの少し浮かす */
}

.secondary-btn:active {
    transform: translateY(0);
    background: #d4d4d4;
}

/* --- コース選択ボタンのレイアウト --- */
.course-select {
    display: flex;
    flex-direction: column; /* 縦並び */
    gap: 15px;             /* ボタン同士の間隔 */
    margin-top: 20px;
    align-items: center;   /* 中央揃え */
}

/* コースボタン個別の調整 */
.course-btn {
    width: 100%;           /* 幅を広げる */
    max-width: 300px;      /* 広がりすぎないように */
    padding: 12px;
    font-size: 1.1rem;
}

/* 全問チャレンジボタンだけ少し豪華に */
.course-btn[data-mode="all"] {
    background-color: #f5a12b; /* 金色っぽいオレンジ */
    box-shadow: 0 5px 0 #d8871d;
}
.course-btn[data-mode="all"]:hover {
    background-color: #e6a141;
    box-shadow: 0 7px 0 #e69b3a;
}