/* js/script.js で設定されている変数や引数を勝手に変更してはいけません。 */

/* --- 全体・共通設定 --- */
html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: "Helvetica Neue", Arial, "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo, sans-serif;
    background-color: #ffffff; /* ロゴに合わせて白 */
}

.index-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center; /* 左右の中央 */
    justify-content: center; /* 上下の中央 */
    min-height: 100vh;
    padding: 40px 20px;
    box-sizing: border-box;
}

/* --- ロゴエリア --- */
.logo-area {
    margin-bottom: -10px;
    text-align: center;
}

.main-logo {
    max-width: 300px;
    width: 90%;
    height: auto;
}

/* --- モード選択エリア（カードレイアウト） --- */
.mode-container {
    display: flex;
    justify-content: center;
    gap: 40px; /* カード間の隙間 */
    flex-wrap: wrap; /* スマホでは縦並び */
    margin-bottom: 20px;
}

/* モードカード共通設定 */
.mode-card {
    width: 350px;
    height: 480px; /* 高さを固定 */
    padding: 50px 30px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    background-size: 100% 100%; /* フレーム画像を全体にフィット */
    background-repeat: no-repeat;
    background-position: center;
    color: #ffffff; /* サイバーな背景に合わせて白文字 */
    transition: background-image 0.3s ease; /* ホバー時の切り替えをふわっと */
}

.mode-title {
    margin: 0 0 15px 0;
    font-size: 1.8rem;
    font-weight: bold;
}

.mode-desc {
    margin: 0 0 30px 0;
    font-size: 1rem;
    line-height: 1.5;
    text-align: center;
}

/* --- 模擬試験モード（青） --- */
.exam-blue {
    background-image: url('../images/testframe.png');
}

/* 試験問題ボタン（青） */
.btn-group {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: auto; /* 下側に配置 */
    align-items: center; /* これでタイトルや説明文も中央 */
}

.btn-exam {
    width: 100px;
    height: 30px;
    border: none;
    background-color: transparent;
    background-image: url('../images/button_short.png');
    background-size: 100% 100%;
    color: #ffffff;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: transform 0.1s;
}

.btn-exam.long-btn {
    width: 150px;
    background-image: url('../images/button_long.png');
}

/* 模擬試験モードのボタン */
.btn-exam:hover {
    color: #ff0033 !important; /* 文字の色を赤に変更 */
    /* おまけ：少し光らせるともっとサイバーになるよ！不要なら消してね */
    text-shadow: 0 0 8px rgba(255, 0, 51, 0.5);
}

.btn-exam:active {
    transform: scale(0.95);
}

/* --- 勉強モード（緑） --- */
.study-green {
    background-image: url('../images/stadyframe.png');
}

/*.study-green:hover {
    background-image: url('../images/stadyframe_red.png');
}*/

/* 目標正答率入力エリア全体 */
.goal-area {
    display: flex;             /* 横並びにする */
    align-items: center;       /* 縦方向のセンター合わせ */
    justify-content: center;   /* 横方向の中央寄せ */
    margin-top: auto;          /* 上側に余白を作って押し下げる */
    margin-bottom: -20px;       /* ボタンとの隙間 */
    gap: 10px;                 /* 文字と数字の間の隙間 */
}

/* 「目標正答率」の文字スタイル */
.goal-label {
    margin: 0;
    font-size: 1.0rem;
    font-weight: bold;
    color: #333;               /* 文字色はお好みで調整してね */
}

/* 入力数字のスタイル（巨大さはキープ！） */
#target-rate {
    font-size: 3rem;           /* 横並びにするから少しだけ調整（お好みで！） */
    font-weight: bold;
    color: #ff0033;
    width: 120px;
    background: transparent;
    border: none;
    text-align: center;          /* 左詰めにすると文字と繋がりがいいよ */
    font-family: 'Arial Black', sans-serif;
    line-height: 1;
}

#target-rate:focus {
    outline: none;
}

/* 学科選択ボタングリッド（位置調整用） */
.btn-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 10px;       /* フレーム下部との余白 */
}

/* 学科選択ボタン（緑） */
.btn-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-top: 20px;
    align-items: center; /* これでタイトルや説明文も中央 */
}

.btn-study {
    width: 100px;
    height: 30px;
    border: none;
    background-color: transparent;
    background-image: url('../images/button_short.png');
    background-size: 100% 100%;
    color: #ffffff;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: transform 0.1s;
}

/* 勉強モードのボタン */
.btn-study:hover {
    color: #ff0033 !important; /* 文字の色を赤に変更 */
    text-shadow: 0 0 8px rgba(255, 0, 51, 0.5);
}

.btn-study:active {
    transform: scale(0.95);
}

/* --- フッター --- */
.index-footer {
    width: 100%;
    text-align: center;
    /*margin-top: auto;  下に張り付かせる */
    margin-top: 20px;
    color: #333333;
    font-weight: bold;
    font-size: 1rem;
}

/* --- レスポンシブ対応（修正版） --- */
@media (max-width: 768px) {
    .mode-container {
        gap: 30px;
        padding: 0 15px;
    }

    .mode-card {
        /* 1. 横幅を画面に合わせつつ、最大幅は維持 */
        width: 100%;
        max-width: 350px;

        /* 2. ★ここが最重要！高さを固定せず、アスペクト比（縦横比）を固定 */
        /* testframe.png が 350x480 なら 480/350 = 約1.37 */
        aspect-ratio: 350 / 480;
        height: auto;

        /* 3. ★背景を潰さない設定に変更 */
        background-size: contain; /* 縦横比を維持して収める */
        background-position: top center;

        /* 4. スマホで文字が溢れないように余白とサイズを微調整 */
        padding: 45px 25px;
    }

    /* 5. 文字とはみ出しを抑える調整 */
    .mode-title {
        font-size: 1.5rem;
        margin-bottom: 8px;
    }
    .mode-desc {
        font-size: 0.9rem;
        margin-bottom: 15px;
    }

    /* 6. 目標正答率エリアをギュッと詰める */
    .goal-area {
        margin-top: 190px;
        margin-bottom: 5px;
    }
    #target-rate {
        font-size: 2.5rem;
        width: 80px;
    }

    /* 7. ボタンも少しだけ小ぶりにして枠内に収める */
    .btn-exam, .btn-study {
        transform: scale(0.9); /* 全体を少し縮小して安全に収める */
    }
    .btn-grid {
        gap: 10px;
        margin-top: 2px;
    }
    .btn-group {
        margin-top: 230px;
        margin-bottom: 5px;
    }
}