@charset "utf-8";

/* スムーススクロールを有効にする */
html {
    scroll-behavior: smooth;
}


body {
    margin: 0;
    padding: 0;
    background: 
        url("../img/repeat.png") repeat, /* 繰り返し表示 */
        linear-gradient(45deg, #0b0f2b, #1a237e, #2a3a8c, #102a44, #020c12); /* 紺色のグラデーション */
    background-size: auto, cover; /* repeat.pngはそのまま、グラデーションは画面全体をカバー */
    background-attachment: fixed, fixed; /* グラデーションを固定 */
    color: white;

    /* アニメーションの追加 */
    animation: movePattern 10s linear infinite;
}

/* repeat.png のみを上に移動させる */
@keyframes movePattern {
    from {
        background-position: 0 0, center;
    }
    to {
        background-position: 0 -500px, center;
    }
}

/* 土星のボタン全体 */
.saturn-button {
    display: flex;
    justify-content: center;
    align-items: center;
    text-decoration: none;
    transform: translate(-450px, -200px); /* 左に 300px、上に 50px */
}

/* 土星の本体 */
.saturn {
    position: relative;
    width: 120px;
    height: 120px;
    background: radial-gradient(circle, #c668e0 10%, #d40524 60%, #d1c46c 100%);
    border-radius: 50%;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.3);
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

/* 土星の輪 */
.ring {
    position: absolute;
    width: 580px;
    height: 50px;
    background: radial-gradient(ellipse at center, #13a3dc 10%, #0ef777 50%, rgba(0,0,0,0) 100%);
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotateX(75deg);
    animation: rotateRing 4s linear infinite;
}

/* 土星の輪の回転アニメーション */
@keyframes rotateRing {
    0% { transform: translate(-50%, -50%) rotateX(75deg) rotateZ(0deg); }
    100% { transform: translate(-50%, -50%) rotateX(75deg) rotateZ(360deg); }
}

/* ボタンのテキスト */
.button-text {
    position: absolute;
    color: white;
    font-size: 14px;
    font-weight: bold;
    text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.5);
    z-index: 2;
}

/* ホバーで少し浮き上がる */
.saturn:hover {
    transform: scale(1.1);
    transition: transform 0.3s ease-in-out;
}


#header-container {
    position: relative;
    z-index: 100; /* ヘッダーを最前面に */
}

.hero {
    position: relative; /* overlay-box の基準 */
    text-align: center;
    width: 100%;
}

.hero img {
    width: 100%;
    height: auto;
    display: block;
}

/* 共通のスタイル（黒いテキストボックス） */
.overlay-box {
    position: absolute;
    top: 110%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 2vw;
    border-radius: 20px;
    text-align: center;
    font-size: 1.5vw;
    width: 60%;
    max-width: 800px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 3px solid yellow;
}


.overlay-box h3, .overlay-box h2, .overlay-box p {
    margin: 0 0 10px;
}

/* `.panel` を `.overlay-box` の下10px に配置 */
.panel {
    position: absolute;
    top: calc(130%);
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    max-width: 800px;
}

.panel img {
    width: 100%;
    height: auto;
    display: block;
}

/* 画像の上に動画を重ねる */
.overlay-video {
    position: absolute;
    top: 44%;
    left: 45%;
    transform: translate(-50%, -50%);
    width: 50%; /* 画像より少し小さめに調整 */
    max-width: 500px;
    height: auto;
    z-index: 2; /* 画像より前面に表示 */
    border-radius: 10px; /* 角を丸くする（不要なら削除） */
}

.animation-categories {
    position: relative;
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    margin: 630px auto 0; /* 上に 800px の余白を追加 */
    text-align: center;
}

.category h2 {
    background: rgba(0, 0, 0, 0.7); /* `.overlay-box` と同じ半透明背景 */
    color: white;
    padding: 20px;
    border-radius: 20px;
    text-align: center;
    font-size: 2vw;
    width: 80%; /* 幅を広げる */
    max-width: 800px; /* 最大幅を設定 */
    margin: 20px auto; /* 中央揃え */
    border: 3px solid yellow; /* `.overlay-box` と同じ枠線 */
    display: flex;
    align-items: center;
    justify-content: center;
}


.crater {
    position: relative;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.crater img {
    width: 100%;
    height: auto;
}

.button_set {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 70%;
    max-width: 750px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8%;
    transform: translate(-50%, -50%);
}

.button-image {
    width: calc(100% + 5px); /* 5px 大きくする */
    max-width: 255px; /* 250px から5px拡大 */
    height: auto;
}

/* ポンと跳ねるアニメーション */
@keyframes bounce {
    0% { transform: translateY(0); }
    30% { transform: translateY(-10px); } /* 上に跳ねる */
    50% { transform: translateY(0); } /* 元に戻る */
    70% { transform: translateY(-5px); } /* 軽く跳ねる */
    100% { transform: translateY(0); } /* 完全に戻る */
}

/* カーソルを合わせたときにポンと跳ねる */
.button-image:hover {
    animation: bounce 0.5s ease-in-out;
}

/* ブルブル震えるアニメーション */
@keyframes shake {
    0% { transform: translateX(0); }
    20% { transform: translateX(-5px); }
    40% { transform: translateX(5px); }
    60% { transform: translateX(-5px); }
    80% { transform: translateX(5px); }
    100% { transform: translateX(0); }
}

/* ボタンをクリックしたときにブルブル震える */
.button-image:active {
    animation: shake 0.3s ease-in-out;
    filter: brightness(1.5); /* ほんの少し明るく */
}

/* 上へ戻るボタンのスタイル */
#back-to-top {
    position: fixed;
    bottom: 50px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: rgba(152, 238, 141, 0.8);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    text-decoration: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s, transform 0.3s;
}

#back-to-top .arrow-up {
    font-size: 36px;
    color: #333;
}

/* ボタンをホバーすると少し拡大 */
#back-to-top:hover {
    transform: scale(1.1);
    background: rgb(223, 16, 223);
}

/* ボタンの表示 */
#back-to-top.show {
    opacity: 1;
    visibility: visible;
}



/* レスポンシブ対応 */
@media screen and (max-width: 768px) {
    .overlay-box {
        width: 80%;
        max-width: 500px;
        font-size: 3vw;
    }
    .panel {
        width: 80%;
        max-width: 700px; /* 最大幅を調整 */
        top: calc(100% + 210px); /* `.overlay-box` の下 10px + 100px で合計 110px 下げる */
        left: 50%;
        transform: translateX(-50%);
    }

    .button_set {
        width: 120%;
        max-width: 300px;
        grid-template-columns: 1fr 1fr;
        gap: 5%;
    }
    .button-image {
        max-width: 160px;
    }

        .animation-categories {
            margin-top: 600px; /* 800px - 200px = 600px に変更 */
        }

    .category h2 {
        width: 60%;
        font-size: 3vw;
        max-width: 100%;
    }

    .overlay-video {
        width: 50%;
        max-width: 300px;
    }
}
