@charset "UTF-8";

/* ==========================================================================
   bg
   ========================================================================== */

body {
    background-color: var(--color-bg-tertiary);
}

/* 2. 動くノイズの層（オーバーレイ）を作る */
body::before {
    content: "";
    position: fixed;
    /* 画面に固定 */
    top: -100px;
    /* 動かした時に端が見えないよう、画面より大きく作る */
    left: -100px;
    width: calc(100% + 200px);
    height: calc(100% + 200px);
    z-index: 0;
    /* 常に一番手前に配置 */
    pointer-events: none;
    /* 重要：下のボタンやリンクをクリックできるようにする */

    /* 用意した1枚のノイズ画像を敷き詰める */
    background-image: url('../../images/common/noise.webp');
    background-repeat: repeat;

    /* 濃さの調整（0.03〜0.08くらいが最もプロっぽく見えます） */
    opacity: 0.16;

    /* アニメーションの指定 */
    animation: noise-jump 2s steps(2) infinite;
}

/* 3. ノイズをガクガク動かすアニメーション */
@keyframes noise-jump {
    0% {
        transform: translate(0, 0);
    }

    100% {
        transform: translate(30px, -10px);
    }
}

/* ==========================================================================
   Projects / ミニゲーム
   ========================================================================== */
.p-game {
    width: 100%;
    margin: var(--section-margin) 0;
}

/* 見出し・操作説明は読みやすい幅を保ち中央寄せ。ステージだけ画面の端から端まで広げる */
.p-game__header,
.p-game__help {
    width: 70%;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.p-game__header {
    margin-bottom: 2em;
}

/* のぞき窓。中の<canvas>は固定の内部解像度を持ち、ここでは見た目のサイズだけを決める。
   width:100vw + 左マージンの調整で、ページの左右の余白を無視して画面幅いっぱいに広げる */
.p-game__stage {
    position: relative;
    width: 100vw;
    margin-left: calc(50% - 50vw);
    aspect-ratio: 1200 / 360;
    background-color: var(--color-bg-tertiary);
    overflow: hidden;
    /* スマホでタップした時にスクロール・ズームなどのブラウザ標準操作が起きないようにする */
    touch-action: none;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    cursor: pointer;
}

.p-game__canvas {
    display: block;
    width: 100%;
    height: 100%;
}

/* スコア表示 */
.p-game__score,
.p-game__highscore {
    position: absolute;
    top: .75em;
    font-family: var(--En-font);
    color: var(--color-Primary);
    line-height: 1;
    display: flex;
    align-items: baseline;
    gap: .4em;
    pointer-events: none;
}

.p-game__score {
    right: .9em;
}

.p-game__highscore {
    right: .9em;
    top: 2.2em;
    opacity: .6;
}

.p-game__score-label {
    font-size: var(--font-size-Text-S);
    font-weight: 700;
    letter-spacing: .1em;
}

.p-game__score-value {
    font-size: var(--font-size-Text-M);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

/* スタート画面・ゲームオーバー画面 */
.p-game__overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .5em;
    background-color: rgba(249, 248, 238, .78);
    /* --color-bg-main を半透明に */
    text-align: center;
    padding: 1em;
}

.p-game__overlay[hidden] {
    display: none;
}

.p-game__overlay-heading {
    font-family: var(--En-font);
    font-size: var(--font-size-Text-L);
    font-weight: 800;
    letter-spacing: .1em;
    color: var(--color-NUMATA-Orange);
}

.p-game__overlay-text {
    font-size: var(--font-size-Text-R);
    font-weight: 600;
    color: var(--color-Primary);
}

.p-game__help {
    margin-top: 1.5em;
    text-align: center;
    font-size: var(--font-size-Text-S);
    color: var(--color-gray);
}

@media screen and (max-width: 767px) {

    .p-game__header,
    .p-game__help {
        width: 100%;
        padding: 0 25px;
    }
}