/* ============================================================
 * game.css - GAME ページ（/game/, /game/{id}/）専用
 * g-page-v2 と同じ仕様。アクセントを nfx の赤系（#e63946）に変更
 * ============================================================ */

/* ========================================
 *  フルスクリーンモード（/game/{id}/ でゲーム起動時）
 * ======================================== */
body.game-fullscreen {
    overflow: hidden;
    margin: 0;
}

body.game-fullscreen .site-header,
body.game-fullscreen .nfx-header,
body.game-fullscreen .breadcrumb,
body.game-fullscreen .nfxv2-related-links,
body.game-fullscreen .site-footer,
body.game-fullscreen .game-page .page-header {
    display: none !important;
}

body.game-fullscreen #main,
body.game-fullscreen #primary,
body.game-fullscreen .game-page,
body.game-fullscreen main.site-main {
    margin: 0 !important;
    padding: 0 !important;
    max-width: none !important;
    width: 100vw !important;
}

body.game-fullscreen .page-game-host {
    width: 100vw;
    height: 100vh;
    border-radius: 0;
    box-shadow: none;
}

body.game-fullscreen #page-game-container {
    width: 100vw;
    height: 100vh;
    min-height: 0;
}

body.game-fullscreen .game-back-btn {
    top: 12px;
    right: 12px;
    width: 44px;
    height: 44px;
    font-size: 22px;
    background: rgba(0, 0, 0, 0.7);
    border-color: rgba(255, 255, 255, 0.4);
    z-index: 10000;
}

/* ========================================
 *  Page header
 * ======================================== */
.game-page {
    max-width: 980px;
    margin: 0 auto;
    padding: 16px;
    color: var(--color-text);
}

/* ========================================
 *  ゲームホスト
 * ======================================== */
.page-game-host {
    position: relative;
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    background: #0a0a0d;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
    margin-bottom: 32px;
}

#page-game-container {
    position: relative;
    width: 100%;
    min-height: 600px;
    overflow: hidden;
}

/* ========================================
 *  ゲーム選択メニュー
 * ======================================== */
.game-menu {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 600px;
    padding: 24px 16px;
    box-sizing: border-box;
    background: radial-gradient(ellipse at center, #14141a 0%, #0a0a0d 100%);
}

.game-menu__title {
    font-size: clamp(18px, 4vw, 28px);
    font-weight: bold;
    color: #e63946;
    letter-spacing: 6px;
    margin: 0 0 28px;
    text-shadow: 0 0 20px rgba(230, 57, 70, 0.5);
}

.game-menu__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
    width: 100%;
    max-width: 640px;
}

.game-menu__card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 24px 14px;
    background: linear-gradient(145deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
    border: 1px solid rgba(255,255,255,0.12);
    border-top-color: rgba(255,255,255,0.22);
    border-left: 3px solid var(--card-color, #e63946);
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
    color: inherit;
    font-family: inherit;
}

.game-menu__card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.5), 0 0 12px var(--card-color, #e63946);
    background: linear-gradient(145deg, rgba(255,255,255,0.10), rgba(255,255,255,0.04));
    color: inherit;
    text-decoration: none;
}

.game-menu__icon {
    font-size: 36px;
    line-height: 1;
}

.game-menu__name {
    font-size: 14px;
    font-weight: bold;
    color: #e8e8e8;
    letter-spacing: 1px;
}

.game-menu__desc {
    font-size: 11px;
    color: #888;
    text-align: center;
    line-height: 1.4;
}

/* ========================================
 *  戻るボタン（フルスクリーン時に右上）
 * ======================================== */
.game-back-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 9999;
    width: 36px;
    height: 36px;
    background: rgba(0, 0, 0, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 6px;
    color: #fff;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    font-family: inherit;
}

.game-back-btn:hover {
    background: rgba(0, 0, 0, 0.85);
}

/* ========================================
 *  音源 ON/OFF ボタン（戻るボタンの左隣）
 * ======================================== */
.game-mute-btn {
    position: absolute;
    top: 8px;
    right: 52px;
    z-index: 9999;
    width: 36px;
    height: 36px;
    background: rgba(0, 0, 0, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 6px;
    color: #fff;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    font-family: inherit;
}

.game-mute-btn:hover {
    background: rgba(0, 0, 0, 0.85);
}

.game-mute-btn[aria-pressed="true"] {
    color: #ff7676;
    border-color: rgba(255, 118, 118, 0.5);
}

body.game-fullscreen .game-mute-btn {
    top: 12px;
    right: 68px;
    width: 44px;
    height: 44px;
    font-size: 20px;
    background: rgba(0, 0, 0, 0.7);
    border-color: rgba(255, 255, 255, 0.4);
    z-index: 10000;
}

/* ========================================
 *  ゲーム（フルスクリーン）中は、フローティングの
 *  設定ボタン・チャットボックスを隠す（ゲーム操作ボタンとの干渉防止）
 * ======================================== */
body.game-fullscreen .nfxv2-setting-toggle,
body.game-fullscreen .nfxv2-chat-toggle,
body.game-fullscreen .setting-frame,
body.game-fullscreen .setting-container,
body.game-fullscreen .chat-box-container {
    display: none !important;
}
