/* ========================================
   GAME ROOM PAGE
   page-game.php 用スタイル
   ======================================== */
.page-game {
    --gr-accent: #F5C800;
    --gr-bg: #FAF6EE;
    --gr-bg2: #F0EAD8;
    --gr-dark: #2a2015;
    --gr-mid: #7a6830;
    --gr-card-border: 3px solid var(--gr-dark);
    --gr-shadow: 4px 4px 0px var(--gr-dark);
    font-family: 'DotGothic16', monospace;
}

/* ========================================
   タイトル画面
   ======================================== */

.page-game__title-screen {
    font-family: 'Press Start 2P', monospace;
    background: #000;
    color: var(--gr-accent);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    aspect-ratio: 16 / 9;
    padding: 1rem 1rem 1.5rem;
    position: relative;
    overflow: hidden;
}

/* スキャンライン */
.page-game__title-screen::before {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(to bottom,
            transparent,
            transparent 3px,
            rgba(255, 255, 255, 0.025) 3px,
            rgba(255, 255, 255, 0.025) 4px);
    pointer-events: none;
    z-index: 1;
}

/* CRTグロー風ノイズ */
.page-game__title-screen::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, rgba(245, 200, 0, 0.04) 0%, transparent 70%);
    pointer-events: none;
    z-index: 1;
}

.page-game__title-screen>* {
    position: relative;
    z-index: 2;
}

/* ========== ロゴ ========== */
.page-game__logo {
    text-align: center;
}

.page-game__logo-main {
    font-size: clamp(1.8rem, 6vw, 3rem);
    letter-spacing: 0.1em;
    color: var(--gr-accent);
    text-shadow:
        0 0 10px var(--gr-accent),
        0 0 30px rgba(245, 200, 0, 0.5),
        4px 4px 0 #7a4a00,
        8px 8px 0 #3a2000;
    animation: gr-logo-pulse 4s ease-in-out infinite;
    line-height: 1.1;
}

@keyframes gr-logo-pulse {

    0%,
    100% {
        text-shadow: 0 0 10px var(--gr-accent), 0 0 30px rgba(245, 200, 0, 0.5), 4px 4px 0 #7a4a00, 8px 8px 0 #3a2000;
    }

    50% {
        text-shadow: 0 0 20px var(--gr-accent), 0 0 60px rgba(245, 200, 0, 0.7), 4px 4px 0 #7a4a00, 8px 8px 0 #3a2000;
    }
}

.page-game__logo-sub {
    font-size: 0.8rem;
    letter-spacing: 0.5em;
    color: #aaa;
    margin-top: 0.5rem;
}

/* ========== メニュー ========== */
.page-game__menu {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    margin-top: 0.6rem;
}

.page-game__menu-item {
    font-size: 0.6rem;
    letter-spacing: 0.2em;
    color: #fff;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: color 0.1s;
}

.page-game__menu-item--active {
    color: var(--gr-accent);
}

.page-game__menu-item--active:hover {
    color: #fff;
    text-decoration: none;
}

.page-game__menu-item--disabled {
    color: #555;
    pointer-events: none;
}

/* ③ カーソル：JSで visibility を切り替える */
.page-game__cursor::before {
    content: '';
    display: inline-block;
    width: 0;
    height: 0;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    border-left: 10px solid #fff;
    vertical-align: 1px;
}

/* ========== 歩行キャラ ========== */
.page-game__walker {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 48px;
    z-index: 3;
    pointer-events: none;
}

/* ① キャラ本体はクリック受け取る */
.page-game__walker-char {
    position: absolute;
    width: 32px;
    height: 32px;
    bottom: 8px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    image-rendering: pixelated;
    pointer-events: auto;
}

.page-game__walker-zzz {
    position: absolute;
    width: 16px;
    height: 16px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    image-rendering: pixelated;
    display: none;
}

/* ========================================
   ゲーム一覧
   ======================================== */

.page-game__main {
    max-width: 900px;
    margin: 0 auto;
    padding: 1.2rem 1.5rem 3rem;
}

/* ゲーム一覧の説明 */
.page-game__about {
    max-width: 600px;
    margin-bottom: 20px;
}

.page-game__about-title {
    font-size: 20px;
    color: #F5C800;
    margin: 14px 0 14px;
    letter-spacing: 0.2rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
}

.page-game__about-title::before,
.page-game__about-title::after {
    content: '';
    flex: 1;
    border-top: 3px solid #F5C800;
    border-bottom: 1px solid #F5C800;
    height: 6px;
}

.page-game__about-text {
    font-size: 11px;
    line-height: 1.5;
    color: #c4c4c4;
    margin: 0 0 12px 5px;
}

.page-game__about-text:last-child {
    margin-bottom: 0;
}

.page-game__about-text strong {
    color: var(--gr-accent, #F5C800);
    font-weight: normal;
}

/* ========== ゲームグリッド ========== */
.page-game__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.5rem;
}

.page-game__card {
    background: #fff;
    border: var(--gr-card-border);
    box-shadow: var(--gr-shadow);
    text-decoration: none;
    color: var(--gr-dark);
    display: flex;
    flex-direction: column;
    transition: transform 0.1s, box-shadow 0.1s;
    position: relative;
    overflow: hidden;
}

.page-game__card:hover {
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0px var(--gr-dark);
    color: var(--gr-dark);
    text-decoration: none;
}

.page-game__card:active {
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0px var(--gr-dark);
}

.page-game__card-status {
    position: absolute;
    top: 0.6rem;
    right: 0.6rem;
    font-size: 0.55rem;
    letter-spacing: 0.15em;
    padding: 0.2rem 0.5rem;
    border: 1.5px solid var(--gr-dark);
    background: var(--gr-accent);
    z-index: 2;
}

.page-game__card-status--soon {
    background: var(--gr-bg2);
    color: var(--gr-mid);
}

.page-game__card-thumb {
    aspect-ratio: 16 / 9;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    position: relative;
    overflow: hidden;
}

.page-game__card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    image-rendering: pixelated;
}

/* カード別カラー */
.page-game__card--tetris .page-game__card-thumb {
    background: #c8f0d8;
}

.page-game__card--reversi .page-game__card-thumb {
    background: #c8e0f0;
}

.page-game__card--puzzle .page-game__card-thumb {
    background: #f0e0c8;
}

.page-game__card--memory .page-game__card-thumb {
    background: #e8c8f0;
}

.page-game__card-info {
    padding: 0.9rem 1rem;
    border-top: var(--gr-card-border);
    flex: 1;
}

.page-game__card-name {
    font-family: 'DotGothic16', monospace;
    font-size: 1.05rem;
    letter-spacing: 0.1em;
    margin-bottom: 0.3rem;
}

.page-game__card-desc {
    font-family: 'DotGothic16', monospace;
    font-size: 0.65rem;
    color: var(--gr-mid);
    line-height: 1.6;
    letter-spacing: 0.05em;
}

.page-game__card-meta {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.6rem;
}

.page-game__tag {
    font-size: 0.55rem;
    letter-spacing: 0.1em;
    padding: 0.15rem 0.4rem;
    border: 1.5px solid var(--gr-dark);
    background: var(--gr-bg);
}

/* COMING SOON */
.page-game__card--coming {
    opacity: 0.6;
    pointer-events: none;
}

.page-game__card--coming .page-game__card-thumb {
    filter: grayscale(0.5);
}

@media (min-width: 640px) {
    .page-game__title-screen {
        aspect-ratio: unset;
        height: 280px;
    }

    .page-game__about {
        margin-left: auto;
        margin-right: auto;
    }

    .page-game__about-text {
        text-align: center;
        margin-left: 0;
    }
}