/* ゲーム一覧ページ専用スタイル */
.games-page-container {
    min-height: 100vh;
    background: linear-gradient(to bottom, #0b0d2b, #1a1f4b); /* 深い宇宙グラデ */
    background-image: url('img/tree-woods_00006.jpg'); /* 無料星空背景例（任意で変更） */
    background-size: cover;
    background-attachment: fixed;
    padding: 40px 20px;
    color: #eee;
    position: relative;
    z-index: 1;
}

.games-page-title {
    text-align: center;
    font-size: 3em;
    margin-bottom: 50px;
    color: #ffffff;
    text-shadow: 0 0 20px #4a90e2;
}

.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
    max-width: 1400px;
    margin: 0 auto;
}

.game-card {
    background: rgba(20, 25, 60, 0.7);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
    transition: all 0.4s ease;
    backdrop-filter: blur(5px);
    position: relative;     /* スタッキングコンテキストを明示的に作成 */
    z-index: 1;             /* 低い値に設定（ヘッダーは通常z-index: 1000くらいなので、これで下になる） */
}



.game-card:hover {
    transform: translateY(-15px) scale(1.03);
    box-shadow: 0 20px 50px rgba(74, 144, 226, 0.5);
}

.card-image {
    width: 100%;
    height: 250px; /* 高さを少し増やして余裕を持たせ（お好みで220px→250pxに調整） */
    overflow: hidden;
    border-radius: 20px 20px 0 0;
    background: #0a0a1a; /* 余白部分の背景色（宇宙風に暗く） */
    display: flex;
    justify-content: center;
    align-items: center;
}

.card-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;   /* これが大事！全体表示モード */
    object-position: center;
    transition: transform 0.4s ease;
}

/* ホバー時のズームエフェクト（全体が見えたまま少し拡大） */
.game-card:hover .card-image img {
    transform: scale(1.08);
}

.card-body {
    padding: 25px;
}

.card-title {
    font-size: 1.8em;
    margin: 0 0 15px;
    color: #4a90e2;
}

.card-title a {
    color: inherit;
    text-decoration: none;
}

.card-title a:hover {
    text-shadow: 0 0 10px #4a90e2;
}

.card-description {
    line-height: 1.6;
    margin-bottom: 25px;
    font-size: 1.05em;
}

.card-actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.btn-play {
    flex: 1;
    min-width: 160px;
    padding: 14px 20px;
    background: linear-gradient(45deg, #ff8c00, #ffd700);
    color: #000;
    font-weight: bold;
    text-align: center;
    border-radius: 50px;
    text-decoration: none;
    transition: all 0.3s;
    box-shadow: 0 5px 15px rgba(255, 140, 0, 0.4);
}

.btn-play:hover {
    transform: scale(1.02);
    box-shadow: 0 10px 25px rgba(255, 140, 0, 0.6);
}

.btn-instructions {
    padding: 14px 20px;
    background: rgba(74, 144, 226, 0.3);
    color: #4a90e2;
    font-weight: bold;
    text-align: center;
    border: 2px solid #4a90e2;
    border-radius: 50px;
    text-decoration: none;
    transition: all 0.3s;
}

.btn-instructions:hover {
    background: #4a90e2;
    color: #fff;
    box-shadow: 0 0 20px #4a90e2;
}

/* スマホ対応 */
@media (max-width: 768px) {
    .games-page-title { font-size: 2.2em; }
    .card-actions { flex-direction: column; }
    .btn-play, .btn-instructions { min-width: auto; }
}