@charset "UTF-8";


.mainvisual {
    top: 110px;
}

.button {
    margin-bottom: 50px;
    text-align: center;
}


#character .img2,
#character .img3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    /* 3列で均等に分割 */
    gap: 20px;
    /* カード同士の隙間 */
    max-width: 1000px;
    /* 全体の最大幅（任意） */
    margin: 0 auto;
    /* 中央寄せ */
    padding-bottom: 30px;
}

#character .img2 div,
#character .img3 div {
    text-align: center;
    /* 画像とテキストを中央に */
    border: 1px solid #eee;
    /* 枠線（任意） */
    padding: 10px;
}

/* 画像のサイズ調整 */
#character img {
    width: 100%;
    /* 親要素の幅に合わせる */
    height: auto;
    display: block;
    margin-bottom: 10px;
    /* 画像と名前の間の隙間 */
}




#modal-desc {
    white-space: pre-wrap;
    /* これで属性内の「改行」がそのまま画面に出ます */
}

#character img {
    width: 300px;
    /* お好みの横幅 */
    height: 300px;
    /* 横幅と同じにして正方形にする */
    object-fit: cover;
    /* 縦横比を維持して枠を埋める */
    object-position: top;
    /* 画像の上側（顔）を優先して表示 */
    cursor: pointer;
    transition: transform 0.3s;
}

.img1 img:hover {
    transform: scale(1.05);
    /* ホバー時に少し大きくしてボタン感を出す */
}

.modal {
    display: none !important;
    position: fixed;
    z-index: 99999;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    justify-content: center;
    align-items: center;
}


#close-btn {
    max-width: 120px;
    top: 50px;
}

.preview-layout {
    top: 100px;
    gap: 30px;
    width: 100%;
}

.preview-img {
    max-width: 100%;
    height: 100%;
    /* 正方形にする */
    object-fit: cover;
    /* 縦横比を維持して切り抜く */
    object-position: center top;
    /* デフォルトは上揃え */
    cursor: pointer;
    border: 1px solid #ccc;
}

/* 右側のテキストを入れる箱 */
.preview-info {

    margin: 0 !important;
    /* 変な余白をリセット */
}

.preview-info #modal-name {
    font-size: 40px;
}

.preview-info #modal-desc {
    font-size: 20px;
}


.modal-content {
    background-color: rgba(255, 255, 255, 0.95) !important;
    /* ほぼ真っ白にする */
    color: #333 !important;
    /* 文字を絶対黒にする */
    padding: 40px;
    width: 90%;
    max-width: 1000px;
    max-height: 09vh !important;
    overflow-y: auto !important;
    /* 中身がはみ出したらスクロールバーを出す */
    min-height: 700px;
    /* ★中身がなくても高さを確保 */
    border-radius: 15px;
    position: relative;
    z-index: 10001;
    /* 背景よりさらに手前に */
    display: block !important;
    /* 一旦、確実に表示させるためにblockにする */
}



#modal-img {
    width: 100% !important;
    height: auto !important;
    max-height: 70vh !important;
    /* 画面の高さの7割までに制限 */
    object-fit: contain;
}

#novel {
    background-color: #0b0e3b;
}

.text {
    color: #fff;
}

.button {
    margin: 30px 0; 
    text-align: center;
}

@media (max-width: 768px) {

    #character .img2,
    #character .img3 {
        grid-template-columns: repeat(2, 2fr);
        /* スマホでは1列 */
    }

    .img1-sf {
        display: none;
    }

    .ruby {
        font-size: 14px;
    }

    #character img {
        width: 100px;
        /* お好みの横幅 */
        height: 100px;
        /* 横幅と同じにして正方形にする */
        object-fit: cover;
        /* 縦横比を維持して枠を埋める */
        object-position: top;
        /* 画像の上側（顔）を優先して表示 */
        cursor: pointer;
        transition: transform 0.3s;
        font-size: 24px;
    }

    .modal-content {
        .modal-content {
            max-height: 90vh;
            /* 画面の9割までに抑える */
            overflow-y: auto;
            /* ★中身が長すぎたらスクロールを出す */
        }
    }

    .preview-layout {
        display: flex !important;
        flex-direction: column !important;
        /* 縦並び */
        align-items: center !important;
        gap: 10px !important;
        /* ★画像と文字の間の隙間を強制 */
        padding-bottom: 20px;
    }

    .preview-img {
        background-color: #fff;
        width: 100% !important;
        height: 300px;
        display: flex !important;
        justify-content: center !important;
        /* 画像が下の要素を圧迫しないよう、最低限の「器」を確保する */
        margin-bottom: 10px !important;
    }

    #modal-img {
        /* 画面の高さ（vh）に合わせてサイズを制限 */
        max-height: 60vh !important;
        width: auto !important;
        max-width: 100% !important;
        object-fit: contain !important;
        /* 画像が浮かないよう、下の要素との境界を明確にする */
        display: block !important;
    }

    .preview-info {
        width: 100% !important;
        /* 文字が画像の下に潜り込まないよう、マージンで押し下げる */
        margin-top: 10px !important;
        padding: 0 10px;
    }


    .modal-content {
        /* ...既存の設定... */
        max-height: 90vh;
        /* 画面の9割までに抑える */
        overflow: hidden;
        /* 中身のはみ出しを隠す（内部でスクロールさせるため） */
        display: flex;
        flex-direction: column;
    }

    #modal-name {
        font-size: 18px !important;
        font-weight: bold !important;
        color: #333 !important;
    }

    /* 説明文（data-info）のサイズ */
    #modal-desc {
        font-size: 14px !important;
        line-height: 1.6 !important;
        white-space: pre-wrap !important;
    }

}