@charset "utf-8";

html {
    background: #000;
}

body {
    display: flex;
    justify-content: center;
    align-items: center;
    background: url(../img/bg_quest.webp) no-repeat #000;
    background-size: cover;
    background-position: center center;
    overflow: hidden;
    min-height: 100dvh; /* iOS のアドレスバー考慮 */
}

canvas {
    width: 240px;
    height: 428px;
    display: block;
    background-image: url('../img/canvas.png');
    background-size: cover;
    background-position: center;
}

#gameCanvas {
    position: relative;
}

/* スコア表示のコンテナ */
.score-display {
    position: absolute;
    top: 50%;
    margin-top: -200px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    font-size: 24px;
    font-weight: bold;
    color: white;
}

/* スコアの数字画像 */
.score-digit {
    width: 24px;  /* 必要に応じて調整 */
    height: 32px; /* 必要に応じて調整 */
    object-fit: contain;
    margin-left: 2px; /* 画像の間隔 */
}

/* ホーム画面全体 */
.home-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: url(../img/bg.png) repeat #000;
    background-position: center center;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    z-index: 2;
}

@media screen and (max-width:768px) {
    .home-screen {
        background-size: 30%;
    }

}

/* ゲームタイトル */
.game-title {
    max-width: 260px;
    margin: 0 auto;
    margin-bottom: 20px;
}

/* スタートボタン */
.start-button {
    max-width: 260px;
    margin: 0 auto;
    cursor: pointer;
    transition: background 0.3s ease;
}


/* 背景画像を適用する要素（親要素） */
.next-fruit-display-bg {
    position: absolute;
    top: 50%;
    margin-top: -150px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;  /* 2倍サイズ(344px)の半分 */
    height: 100px; /* 2倍サイズ(344px)の半分 */
    background-image: url('../img/next.png'); /* 飾り画像を背景に */
    background-size: contain; /* 画像全体を表示 */
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* 次のフルーツのプレビュー（画像） */
.next-fruit-display {
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center center;
    display: block;
}


/* ゲームオーバーモーダルのスタイル */
.game-over-modal {
    position: fixed;
    top: 0;
    left: 0;
    display: none; /* 初期は非表示 */
    width: 100%;
    height: 100vh;
}

.game-over-modal_in {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 250px;
    padding: 40px;
    background-color: rgba(0,0,0,0.5);
    text-align: center;
    border-radius: 10px;
    animation: fadeIn 0.3s ease-in-out;
    
}

/* GAME OVER のテキスト */
.game-over-text {
    max-width: 200px;
    margin: 0 auto;
    margin-bottom: 15px;
}

/* リトライボタン */
.retry-button {
    cursor: pointer;
    transition: background 0.3s ease;
}



/* フェードインアニメーション */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -55%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}


/*合体エフェクト*/

.merge-effect {
    animation: popEffect 0.3s ease, glowEffect 0.3s ease;
}

@keyframes popEffect {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

@keyframes glowEffect {
    0% { box-shadow: 0 0 0 rgba(255, 255, 0, 0); }
    50% { box-shadow: 0 0 15px rgba(255, 255, 0, 0.8); }
    100% { box-shadow: 0 0 0 rgba(255, 255, 0, 0); }
}

.particle {
    position: absolute;
    width: 5px;
    height: 5px;
    background: gold;
    border-radius: 50%;
    animation: particleEffect 0.5s ease-out;
}

@keyframes particleEffect {
    0% { opacity: 1; transform: scale(1) translateY(0); }
    100% { opacity: 0; transform: scale(1.5) translateY(-20px); }
}

.glow-overlay {
    position: absolute;
    width: 50px;
    height: 50px;
    background: radial-gradient(circle, rgba(255, 255, 0, 0.8) 0%, rgba(255, 255, 0, 0) 80%);
    border-radius: 50%;
    pointer-events: none;
    animation: glowFade 0.2s ease-out;
}

@keyframes glowFade {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(1.5); opacity: 0; }
}

    
  

.sound-toggle {
    position: absolute;
    max-width: 20px;
    top: 10px;
    right: 20px;
    width: 50px;
    height: 50px;
    cursor: pointer;
    opacity: 1; /* 初期状態はアクティブ */
    transition: opacity 0.3s ease;
}

.sound-toggle img {
    width: 100%;
}

.close-button {
    position: absolute;
    top: 30px;
    right: 30px;
    width: 20px;
    height: 20px;
    cursor: pointer;
    transition: opacity 0.3s ease;
    z-index: 1; /* **他の要素より前面に表示** */
}

.close-button img {
    width: 100%;
    height: 100%;
}


@media screen and (max-width:768px) {


}