/* =============================================
   Gamesite - カタログ & ゲームページ スタイル
   ============================================= */

/* ---- カタログページ ---- */

.catalog-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 24px;
}

.catalog-header {
    margin-bottom: 36px;
    text-align: center;
}

.catalog-title {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin: 0;
    text-align: center;
}

.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 28px;
}

.catalog-empty {
    grid-column: 1 / -1;
    text-align: center;
    color: #888;
    padding: 60px 0;
}

/* ---- フロントページ：エディタコンテンツ ---- */

.catalog-editor-content {
    margin-bottom: 40px;
    text-align: center;
}

.catalog-editor-content h1,
.catalog-editor-content h2 {
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin: 0 0 0.4em;
}

.catalog-editor-content p {
    color: #555;
    margin: 0.5em 0 0;
}

/* ---- ゲームカード ---- */

.game-card {
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.game-card:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.game-card__link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.game-card__thumb {
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: #f0f0f0;
}

.game-card__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.game-card:hover .game-card__thumb img {
    transform: scale(1.04);
}

.game-card__no-thumb {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #aaa;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
}

.game-card__title {
    padding: 10px 12px 12px;
    font-size: 0.95rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ---- ゲームページ：エディタコンテンツ ---- */

.game-content-before {
    margin-bottom: 20px;
}

.game-content-before h1,
.game-content-before h2,
.game-content-before h3 {
    font-weight: 800;
    margin-bottom: 0.4em;
}

.game-content-after {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #e5e5e5;
    color: #444;
    line-height: 1.7;
}

/* ---- ゲームページ ---- */

.game-page-container {
    max-width: 100%;
    margin: 0 auto;
    padding: 24px 16px;
    box-sizing: border-box;
}

.game-iframe-wrapper {
    width: 100%;
    border-radius: 6px;
    overflow: hidden;
    background: #000;
    display: flex;
    justify-content: center;
}

.game-iframe {
    max-width: 100%;
    height: 400px; /* JS読み込み前のフォールバック */
    border: none;
    display: block;
}

.game-page-nav {
    margin-top: 20px;
    text-align: left;
}

.game-page-nav a {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.9rem;
    color: #555;
    text-decoration: none;
    padding: 6px 0;
    transition: color 0.15s;
}

.game-page-nav a:hover {
    color: #000;
}

.game-error {
    padding: 60px;
    text-align: center;
    color: #888;
}

/* ---- レスポンシブ ---- */

@media (max-width: 600px) {
    .game-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 16px;
    }

    .catalog-container {
        padding: 24px 16px;
    }

    .game-iframe {
        height: 300px; /* JS読み込み前のフォールバック（JS後は上書きされる） */
    }
}
