.game-section{
    background-image: url(../../images/background.png);
    background-repeat: no-repeat;
    background-size: cover;
    background-color: #ffffffcc;
    background-blend-mode: saturation;
    background-position: center;
}

.game-section .game-top{
    display: flex;
}
.game-section .game-logo{
    width: 150px;
    height: auto;
    display: block;
    margin: auto;
    margin-right: 20px;
}
.game-section .game-description{
    padding: 2rem;
    background-color: white;
    color: black;
    border-radius: 10px;
    opacity: 1;
    border: solid black 4px;
}

.game-section .game-images{
    display: flex;
    width: fit-content;
    margin: auto;
    margin-top: 20px;
    gap: 1rem;
    overflow-x: auto; /* iOSでの慣性スクロール */
    max-width: 100%;
    padding: 10px 10px;
}

/* --- サムネ コンテナ（div.game-pic と直置き img.game-pic を同じ見た目に） --- */
.game-section .game-images .game-pic,
.game-section .game-images > img.game-pic{
    flex: 0 0 auto;
    width: 200px;
    aspect-ratio: 1242 / 2688;
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    box-shadow: gray 6px 6px 4px;
    display: block;
    cursor: zoom-in;
    transition: transform .15s ease;
}

/* 以前の高さ固定を無効化（崩れの原因） */
.game-section .game-images .game-pic { height: auto; }

/* ホバー拡大（モバイルは実質無視される） */
.game-section .game-images .game-pic:hover,
.game-section .game-images > img.game-pic:hover{
    transform: scale(1.05);
}

/* コンテナ内の画像/動画を“はめ込み” */
.game-section .game-images .game-pic img,
.game-section .game-images .game-pic video{
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;   /* はみ出しをトリミングして比率維持（iOSで安定） */
    display: block;
    border-radius: 10px;
}

/* 直置きの img.game-pic も同じ見た目（上の共通指定でOKだが明示） */
.game-section .game-images > img.game-pic{
    object-fit: cover;
}

/* 再生ボタンは中央固定・タップは親へ通す */
.game-section .game-images .game-pic .play-button{
    position: absolute;
    width: 32%;
    height: auto;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

/* ボタン群 */
.game-section .links{
    display: flex;
    margin: auto;
    margin-top: 20px;
    gap: 1rem;
    justify-content: center;
}
.game-section .links a{
    text-decoration: none;
    font-weight: bold;
}
.game-section .links a:hover{
    transform: scale(1.05);
}
.game-section .hp-button, .game-section .store-button{
    width: fit-content;
    border-radius: 10px;
    font-size: 18px;
    padding: 10px 60px;
    display: block;
    align-content: center;
    box-shadow: #777777 2px 2px 4px;
}
.game-section .links a img{
    height: 45px;
    width: 45px;
    border: solid black 1px;
    border-radius: 10px;
    box-shadow: #777777 2px 2px 4px;
}
.game-section .hp-button{
    background-color: white;
    color: black;
    border: solid black 2px;
}
.game-section .store-button{
    background-color: black;
    color: white;
    border: solid black 2px;
}
.game-section .links .sns-buttons {
    display: flex;
    gap: 10px;
}

/* ===== モーダル ===== */
.media-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    inset: 0;
    padding-top: 40px;
    background-color: rgba(0,0,0,0.9);
    cursor: zoom-out; /* 背景は閉じる */
}
.media-modal .media-content {
    margin: auto;
    display: flex;
    justify-content: center;
    align-items: center;
    max-width: 90%;
    max-height: 90%;
    cursor: auto; /* 中央は通常 */
}
.modal-media {
    max-width: 80vw;
    max-height: 80vh;
    margin-top: 10vh;
    border-radius: 10px;
}
.media-modal .close {
    position: absolute;
    top: 100px;
    right: 100px;
    color: white;
    font-size: 45px;
    font-weight: bold;
    cursor: pointer;
}

/* 矢印ナビ */
.media-modal .nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(2px);
    color: #fff;
    font-size: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: grid;
    place-items: center;
    user-select: none;
}
.media-modal .nav-btn:hover {
    background: rgba(255,255,255,0.25);
}
.media-modal .nav-btn.prev { left: 20px; }
.media-modal .nav-btn.next { right: 20px; }
.media-modal .hidden { display: none !important; }

/* ===== モバイル調整 ===== */
@media screen and (max-width: 767px) {
    .game-section .game-top {
        flex-direction: column;
        margin: 0 3vw;
        gap: 6vw;
    }
    .game-section .game-logo {
        display: none;
    }
    .game-section .game-description {
        padding: 6vw 5vw;
        font-size: 4vw;
        line-height: 1.8;
    }

    /* サムネ幅をやや広めに、比率は維持 */
    .game-section .game-images .game-pic,
    .game-section .game-images > img.game-pic{
        width: 30vw;
    }
    .game-section .game-images {
        gap: 3vw;
        padding: 4vw 3vw;
    }

    .game-section .links {
        flex-direction: column;
        width: 90vw;
        gap: 4vw;
    }
    .game-section .links .hp-button, .game-section .links .store-button {
        width: -webkit-fill-available;
        height: auto;
        text-align: center;
        margin: auto;
        font-size: 4vw;
        padding: 4vw 6vw;
    }

    .media-modal .close {
        top: 100px;
        right: 10px;
        color: white;
        font-size: 45px;
        font-weight: bold;
        cursor: pointer;
    }

    .game-section .links .sns-buttons {
        display: flex;
        flex-direction: row;
        gap: 1vw;
        justify-content: center;
        flex-wrap: wrap;
    }
    .game-section .links .sns-buttons a img {
        width: 12vw;
        height: 12vw;
    }
}
