@charset "UTF-8";

        body, html {
            margin: 0;
            padding: 0;
            font-family: "Helvetica Neue", Arial, sans-serif;
            box-sizing: border-box;
			text-align: center;
        	  /* 背景設定 */
			background-color:#09001B;
            background-image: url('../images/star.webp'); 
            background-repeat: repeat;
            background-position: center;
            background-blend-mode: screen; 
            animation: starScroll 120s linear infinite;
            -webkit-tap-highlight-color: transparent;
			position: relative;
			overflow-x: hidden;
        }
		

        *, *:before, *:after {
            box-sizing: inherit;
        }

        img {
            max-width: 100%;
            height: auto;
            vertical-align: bottom;
        }


@keyframes starScroll {
            from { background-position: 0 0; }
            to { background-position: -1000px 1000px; }
        }

        .canvas-layer {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            pointer-events: none;
        }

        #fireworks-canvas { z-index: 0; }
        #confetti-canvas { z-index: 1; }


        /* -----------------------------------------
           フォント・テキストスタイル設定
           ----------------------------------------- */
     .kaisei-text {
            font-family: 'Kaisei Opti', serif;
            font-weight: 700;
            /* 修正: 境界線を太くするためにtext-shadowを多重に重ねる */
             -webkit-text-stroke: 8px #520303; /* 縁取りの太さと色 */
            paint-order: stroke fill; /* 縁取りを文字の下に描画して文字痩せを防ぐ */
            color: #fff;
            letter-spacing: 0em; /* 0emに戻す場合もありますが、微調整可 */
        }

        /* -----------------------------------------
           アニメーション定義 (共通)
           ----------------------------------------- */
        @keyframes floatUpDown {
            0%, 100% { transform: translateY(0); }
            50% { transform: translateY(-20px); }
        }

        /* -----------------------------------------
           ユーティリティクラス
           ----------------------------------------- */
        @media (min-width: 600px) {
            .invisible-pc { display: none !important; }
        }
        @media (max-width: 600px) {
            .invisible-sp { display: none !important; }
        }

        /* -----------------------------------------
           ポップアップ (モーダル) スタイル
           ----------------------------------------- */
        .popup-overlay {
            position: fixed;
            top: 0; left: 0;
            width: 100%; height: 100%;
            background: rgba(0, 0, 0, 0.8);
            z-index: 9999;
            display: none;
            justify-content: center;
            align-items: center;
            opacity: 0;
            transition: opacity 0.3s ease;
        }
        .popup-overlay.active {
            display: flex;
            opacity: 1;
        }
        .popup-content {
            position: relative;
            max-width: 100%;
            max-height: 100%;
            transform: scale(0.8);
            transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
        }
        .popup-overlay.active .popup-content {
            transform: scale(1);
        }
        .popup-content img {
            max-height: 100vh;
            box-shadow: 0 0 10px rgba(0,0,0,0.5);
        }
        .close-btn {
            position: absolute;
            top: -40px; right: 0;
            color: #fff;
            font-size: 30px;
            cursor: pointer;
            font-weight: bold;
        }


       
/* 追従キャラクターのスタイル 

*/
#follower {
            position: fixed;
            top: 0;
            left: 0;
            width: 84px; 
            height: 100px;
            pointer-events: none;
            z-index: 9999;
           
            transform: translate(-100px, -100px);
            will-change: transform;
 }

      
        .character-body {
            width: 100%;
            height: 100%;
            animation: float 2s ease-in-out infinite;
        }

        .facing-left .character-body {
            transform: scaleX(-1);
        }
        
        .facing-right .character-body {
            transform: scaleX(1);
        }

        @keyframes float {
            0%, 100% { transform: translateY(0); }
            50% { transform: translateY(-10px); }
        }

        svg {
            width: 100%;
            height: 100%;
            fill: #ff6b6b; 
            filter: drop-shadow(0px 4px 6px rgba(0,0,0,0.1));
        }



  @media (max-width: 600px) {
           #follower {
            position: fixed;
            top: 0;
            left: 0;
            width: 84px; 
            height: 100px;
            pointer-events: none;
            z-index: 9999;
           
            transform: translate(-100px, -100px);
            will-change: transform;
 }

      
        .character-body {
            width: 85%;
            height: 85%;
            animation: float 2s ease-in-out infinite;
        }

        .facing-left .character-body {
            transform: scaleX(-1);
        }
        
        .facing-right .character-body {
            transform: scaleX(1);
        }

        @keyframes float {
            0%, 100% { transform: translateY(0); }
            50% { transform: translateY(-10px); }
        }

        svg {
            width: 100%;
            height: 100%;
            fill: #ff6b6b; 
            filter: drop-shadow(0px 4px 6px rgba(0,0,0,0.1));
        }
         }



   /* =========================================
           パーティクル
           ========================================= */

        @keyframes starScroll {
            from { background-position: 0 0; }
            to { background-position: -1000px 1000px; }
        }

        .canvas-layer {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            pointer-events: none;
        }

        #fireworks-canvas { z-index: 0; }
        #confetti-canvas { z-index: 0; }




        /* =========================================
           宝箱ゲーム
           ========================================= */
        #game-area {
            position: absolute;
            top: 0;
            /* ★重要: PCで中央寄せにするための設定 */
            left: 50%;
            transform: translateX(-50%);
            width: 100%;
            max-width: 1000px; /* コンテンツ幅に合わせる */
            height: 100%;
            z-index: 9999; 
            pointer-events: none;
        }

        .chest-container {
            position: absolute; 
            width: 120px; 
            height: auto;
            cursor: pointer;
            pointer-events: auto; /* 宝箱はクリック可能 */
             /* ★修正ポイント: 揺れの基準点を「底（bottom）」に戻し、接地感を出す */
        transform-origin: bottom center; 
        
        user-select: none;
        /* 中央配置のためのズレ補正 */
        transform: translate(-50%, -50%);
        }

        @media (max-width: 600px) {
			
			#game-area {
                /* スマホでは左端基準・全幅に戻す */
                left: 0;
                transform: none;
                max-width: 100%;
            }
			
            .chest-container {
                width:30%; 
            }
        }

        .chest-img {
            width: 100%;
            height: auto;
            display: block;
            filter: drop-shadow(0 5px 10px rgba(0,0,0,0.5));
            transition: transform 0.2s;
        }

        @media (hover: hover) {
            .chest-container:hover .chest-img {
                transform: scale(1.05);
            }
        }

        .bubble-img {
            position: absolute;
            bottom: 80%; /* 初期位置も少し下げる */
            left: 50%;
            transform: translateX(-50%) scale(0.5);
            width: 100%; /* 140% -> 80% に変更して小さく */
            max-width: 150px; /* max-widthも少し小さく調整 */
            opacity: 0; 
            pointer-events: none;
            transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); 
            z-index: 20;
            filter: drop-shadow(0 2px 5px rgba(0,0,0,0.3));
        }

        .bubble-show {
            opacity: 1;
            bottom: 60%; /* 110% -> 95% に変更して「乗っかる」位置へ */
            transform: translateX(-50%) scale(0.9); /* scale(1) -> scale(0.9) に変更して少し控えめに */
        }

        @keyframes rattle {
            0% { transform: translate(-50%, -50%) rotate(0deg); }
            25% { transform: translate(-50%, -50%) rotate(5deg); }
            50% { transform: translate(-50%, -50%) rotate(0deg); }
            75% { transform: translate(-50%, -50%) rotate(-5deg); }
            100% { transform: translate(-50%, -50%) rotate(0deg); }
        }
        
       
        .rattling {
            animation: rattle 0.1s linear infinite;
        }





/* --- #movie セクションの基本 --- */
#movie {
    position: relative;
    width: 100%;
    overflow: hidden;
    /* セクションの高さ（必要に応じて調整してください） */
    height:100%; /* 画面いっぱいに広げる場合 */
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 背景動画の配置 */
.movie-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: 0; /* 最背面 */
}

.movie-bg::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* 黒色(0,0,0)で、透明度を0.5(50%)に設定 */
    /* この数値を変更して暗さを調整できます（例：0.3=薄い、0.7=濃い） */
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1; /* 動画より手前に表示 */
    pointer-events: none; /* マウス操作を透過させる */
}


.movie-bg video {
    width: 100%;
    height: 100%;
    object-fit: cover; /* これによりSPではトリミングされ縦長になります */
}

/* コンテンツ（タイトル・ボタン）を動画の上に配置 */
.movie-content {
	margin:0px auto 0px auto;
    position: relative;
    z-index: 1;
    text-align: center;
    width: 100%;
}

.btn {
    cursor: pointer;
    transition: opacity 0.3s;
}
.btn:hover {
    opacity: 0.8;
}




/* --- モーダル（ポップアップ）の設定 --- */

.modal-overlay {
display: none;
position: fixed;
z-index: 9999;
left: 0;
top: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.8);
}


.modal-content {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%) !important;
width: 90%;
max-width: 1000px;
aspect-ratio: 16 / 9;
margin: 0;
padding: 0;
background: #000;
}

.modal-content video {
width: 100%;
height: 100%;
display: block;
}

.close-btn {
position: absolute;
top: -50px;
right: 0;
color: #fff;
font-size: 40px;
cursor: pointer;
line-height: 1;
}


/* モーダル背景 */
.yt-overlay {
display: none;
position: fixed;
z-index: 9999;
left: 0;
top: 0;
width: 100%;
height: 100%;
background-color: rgba(0,0,0,0.8);
}
/* 動画コンテナ（中央配置・レスポンシブ） */
.yt-content {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: 90%;
max-width: 960px;
aspect-ratio: 16 / 9;
background: #000;
}
/* iframe本体 */
.yt-content iframe {
width: 100%;
height: 100%;
}
/* 閉じるボタン */
.yt-close {
position: absolute;
top: -40px;
right: 0;
color: #fff;
font-size: 40px;
line-height: 1;
cursor: pointer;
}