@charset "UTF-8";

/* =========================
   基本設定
========================= */

html,
body {
    margin: 0;
    width: 100%;
    height: 100%;
    overflow-x: hidden;
}

body {
    background-color: #999;
    font-family: sans-serif;
}

/* =========================
   背景
========================= */
.home-container{
    position: relative;

    width: 430px;
    height: 932px;

    margin: 0 auto;

    overflow: hidden;
}
.container{
    background-image: url("images/background.JPG");
    background-size: cover;
    background-position: center;
}
.bg{
    width:100%;
    height:100%;

    object-fit:cover;
}


/* =========================
   キャラクター
========================= */

.character {
    position: absolute;
    left: 50%;
    top: 100px;

    width: 95%;
    max-width: 450px;

    opacity: 0;
    transform: translateX(-50%) translateY(30px);

    animation: characterAppear 2s ease forwards;
}


@keyframes characterAppear {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(80px);
    }

    to {
        opacity: 1;
        transform: translateX(-50%) translateY(-60px);
    }
}

/* =========================
   アイコン
========================= */

.icon,
.icon2,
.icon3 {
    position: absolute;
    left: 20px;

    width: clamp(40px, 6vw, 70px);

    z-index: 20;
    cursor: pointer;
}

.icon {
    top: 30px;
}

.icon2 {
    top: 100px;
}

.icon3 {
    top: 170px;
}

/* =========================
   スタートボタン
========================= */

.starticon {
    position: absolute;
    left: 50%;
    top: 450px;

    transform: translateX(-50%);

    width: 70%;
    max-width: 300px;

    z-index: 20;
}
/* =========================
   モーダル背景
========================= */

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    inset: 0;

    background: rgba(0, 0, 0, 0.7);

    justify-content: center;
    align-items: center;

    padding: 20px;
    box-sizing: border-box;
}

.modal.show {
    display: flex;
}

/* =========================
   モーダル本体
========================= */

.modal-content {
    position: relative;

    width: min(90%, 700px);
    height: min(80vh, 700px);

    background: #fff;
    border-radius: 12px;

    padding: 25px;
    box-sizing: border-box;

    overflow-y: auto;

    animation: fadeIn 0.4s ease;
}

/* =========================
   閉じるボタン
========================= */

.close-btn {
    position: sticky;
    top: 0;

    float: right;

    border: none;
    background: #444;
    color: white;

    font-size: 18px;

    padding: 8px 12px;

    border-radius: 6px;
    cursor: pointer;

    z-index: 10;
}

/* =========================
   スクロールバー
========================= */

.modal-content::-webkit-scrollbar {
    width: 10px;
}

.modal-content::-webkit-scrollbar-thumb {
    background: #999;
    border-radius: 5px;
}

.modal-content::-webkit-scrollbar-track {
    background: #eee;
}

.mode{
    display: flex;
    justify-content: center;
}

.mode-container{
    position: relative;
    width: 430px;      /* スマホ幅くらい */
    height: 1000px;    /* 要調整 */
}
.modeselect1,
.modeselect4{
    position: absolute;
    width: 50%;
    left: 20px;
}
.modeselect2,
.modeselect3{
    position: absolute;
    width: 38%;
    left: 0px;
}

.modeselect2{
   
    top: 65px;
    left: 250px;
}
.modeselect3{
 
  top: 310px; 
   left: 20px;
}
.modeselect4{
  
    top: 320px;
    left: 200px;
}
.modeselect5{
    position: absolute;
    width: 35%;
    top: 560px;
    left: 20px;
}

.husen1{
    position: absolute;
    width: 50%;
    left: 200px;
    top: 0px;
    transform: rotate(-15deg);
}

.husen2{
    position: absolute;
    width: 50%;
    left: 220px;
    top: 80px;
    transform: rotate(-15deg);
}

.husen3{
    position: absolute;
    width: 50%;
    top: 640px;
    left: -10px;
    transform: rotate(15deg);
}

.husen4{
    position: absolute;
    width: 50%;
    top: 720px;
    left: -30px;
    transform: rotate(15deg);
}
/* =========================
   アニメーション
========================= */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}


    .icon,
    .icon2,
    .icon3 {
        width: 50px;
        left: 15px;
    }

    .icon {
        top: 20px;
    }

    .icon2 {
        top: 85px;
    }

    .icon3 {
        top: 150px;
    }



    .modal-content {
        width: 95%;
        height: 85vh;
        padding: 15px;
    }

    .close-btn {
        font-size: 16px;
        padding: 6px 10px;
    }


.bg2{
    position: fixed;
    inset: 0;

    width: 100%;
    height: 100%;

    object-fit: cover;

    z-index: -1;
}

/* アニメーションエリア */
#animationArea{
    display:flex;
    justify-content:center;
    align-items:center;
    height:300px;
}

/* キャラ */
#fortuneCharacter{
    width:300px;
    animation:bounce 0.5s ease-in-out infinite alternate;
}

#fortuneCharacter.result-image{
    width:320px;
}

/* 考え中テキスト */
#loadingText{
    text-align:center;
    font-size:2rem;
    color:white;
    margin-top:-30px;
}

/* 結果 */
#result{
    text-align:center;
    font-size:3rem;
    color:white;

    opacity:0;
    transition:opacity 1s;
}

#result.show{
    opacity:1;
}

/* ぴょんぴょん */
@keyframes bounce{
    from{
        transform:translateY(0);
    }
    to{
        transform:translateY(-20px);
    }
}

/* ボタン配置 */
.button-area{
    display: flex;
    justify-content: center;
    gap: 20px; /* ボタン同士の間隔 */

    margin-top: 30px;
}

/* ボタン画像 */
.back-btn img{
    width: 150px; /* 好きな大きさに調整 */
    height: auto;
    bottom: 200px;

    transition: transform 0.2s;

}

/* ホバー時 */
.back-btn img:hover{
    transform: scale(1.05);
}

.title-image{
    display: block;
    width: clamp(350px, 40vw, 500px);
    height: auto;

    margin: 50px auto;

    z-index: 10;
}
#result{
    text-align:center;
    font-size:3rem;
    color:white;

    font-family: "Yomogi", cursive;

    opacity:0;
    transition:opacity 1s;
}

/* モード選択画像 */
.mode-container img {
    transition: transform 0.3s ease;
    cursor: pointer;
}

/* カーソルを乗せたとき */
.mode-container img:hover {
    transform: scale(1.08);
}

#animationArea{
    display: flex;
    justify-content: center;
    align-items: center;
    height: 300px;

    margin-top: 100px; /* 結果画像だけ下へ */
}

#result{
    text-align: center;
    font-size: 3rem;
    color: white;
    font-family: "Yomogi", cursive;

    margin-top: 100px; /* 文字も少し下へ */

    opacity: 0;
    transition: opacity 1s;
}