/* =====================================================
   ブラウザゲーム一覧ページ専用スタイル
   スコープ: .bg-page 以下のみ
   ===================================================== */

/* ==================== ベーススタイル ==================== */
.bg-page {
    background-color: #f5f7fa;
    min-height: 100vh;
    padding-bottom: 60px;
}

/* ==================== ヒーローセクション ==================== */
.bg-hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 80px 20px;
    text-align: center;
    color: white;
    position: relative;
    overflow: hidden;
}

.bg-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

.bg-hero__title {
    position: relative;
    z-index: 1;
    font-size: 3rem;
    font-weight: 700;
    margin: 0 0 20px 0;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    animation: fadeInUp 0.8s ease-out;
}

.bg-hero__lead {
    position: relative;
    z-index: 1;
    font-size: 1.2rem;
    margin: 0;
    opacity: 0.95;
    font-weight: 400;
    line-height: 1.6;
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

/* ==================== セクション ==================== */
.bg-section {
    max-width: 1200px;
    margin: 40px auto 0;
    padding: 0 20px;
}

/* ==================== ゲームグリッド ==================== */
.bg-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

/* ==================== ゲームカード ==================== */
.bg-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    display: block;
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.6s ease-out forwards;
}

.bg-card:nth-child(1) { animation-delay: 0.1s; }
.bg-card:nth-child(2) { animation-delay: 0.2s; }
.bg-card:nth-child(3) { animation-delay: 0.3s; }
.bg-card:nth-child(4) { animation-delay: 0.4s; }
.bg-card:nth-child(5) { animation-delay: 0.5s; }
.bg-card:nth-child(6) { animation-delay: 0.6s; }
.bg-card:nth-child(n+7) { animation-delay: 0.7s; }

.bg-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(102, 126, 234, 0.2);
}

.bg-card__link {
    text-decoration: none;
    color: inherit;
    display: block;
    height: 100%;
}

.bg-card__link:focus {
    outline: 3px solid #667eea;
    outline-offset: 2px;
}

/* サムネイル */
.bg-card__thumb {
    width: 100%;
    height: 200px;
    background-size: cover;
    background-position: center;
    background-color: #f0f3f9;
    position: relative;
    background-repeat: no-repeat;
    display: block;
}

/* 画像がある場合は::afterを非表示 */
.bg-card__thumb[style*="background-image"]::after {
    display: none !important;
}

/* 画像がない場合のみフォールバックを表示 */
.bg-card__thumb:not([style*="background-image"])::after {
    content: '\f11b';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 4rem;
    color: #ddd;
}

/* タイトル */
.bg-card__title {
    font-size: 1.3rem;
    font-weight: 700;
    margin: 0;
    padding: 20px 20px 10px 20px;
    color: #333;
    line-height: 1.4;
}

/* 説明文 */
.bg-card__desc {
    font-size: 0.9rem;
    color: #666;
    margin: 0;
    padding: 0 20px 15px 20px;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 遊ぶボタン */
.bg-card__cta {
    display: inline-block;
    margin: 0 20px 20px 20px;
    padding: 12px 28px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    text-align: center;
}

.bg-card:hover .bg-card__cta {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

/* ==================== 空状態 ==================== */
.bg-empty {
    text-align: center;
    padding: 80px 20px;
    color: #666;
    font-size: 1.1rem;
}

.bg-empty::before {
    content: '\f119';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    display: block;
    font-size: 5rem;
    color: #ddd;
    margin-bottom: 20px;
}

/* ==================== アニメーション ==================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==================== レスポンシブ ==================== */
@media (max-width: 992px) {
    .bg-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 25px;
    }
    
    .bg-hero__title {
        font-size: 2.5rem;
    }
}

@media (max-width: 768px) {
    .bg-hero {
        padding: 60px 20px;
    }
    
    .bg-hero__title {
        font-size: 2rem;
    }
    
    .bg-hero__lead {
        font-size: 1rem;
    }
    
    .bg-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .bg-card__thumb {
        height: 180px;
    }
    
    .bg-section {
        margin-top: 30px;
    }
}

@media (max-width: 480px) {
    .bg-hero__title {
        font-size: 1.7rem;
    }
    
    .bg-hero__lead {
        font-size: 0.9rem;
    }
    
    .bg-card__title {
        font-size: 1.1rem;
        padding: 15px 15px 10px 15px;
    }
    
    .bg-card__desc {
        font-size: 0.85rem;
        padding: 0 15px 12px 15px;
    }
    
    .bg-card__cta {
        margin: 0 15px 15px 15px;
        padding: 10px 24px;
        font-size: 0.9rem;
    }
}

/* ==================== アクセシビリティ ==================== */
@media (prefers-reduced-motion: reduce) {
    .bg-card,
    .bg-hero__title,
    .bg-hero__lead {
        animation: none;
        opacity: 1;
        transform: none;
    }
}

/* ==================== 印刷スタイル ==================== */
@media print {
    .bg-hero {
        background: none;
        color: black;
        padding: 20px;
    }
    
    .bg-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .bg-card__cta {
        display: none;
    }
}