body {
    font-family: 'Arial', sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    margin: 0;
    background-color: #f0f0f0;
    color: #333;
    text-align: center;
    cursor: grab;
    overflow-x: hidden; 
}

/* 画面全体を揺らすためのクラス */
.shake-screen {
    animation: shake 0.2s cubic-bezier(.36,.07,.19,.97) both;
}

@keyframes shake {
    10%, 90% { transform: translate3d(-2px, 0, 0); }
    20%, 80% { transform: translate3d(4px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-6px, 0, 0); }
    40%, 60% { transform: translate3d(6px, 0, 0); }
}

/* 💥 新規追加: フラッシュオーバーレイのスタイル 💥 */
#flash-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: white;
    opacity: 0;
    pointer-events: none;
    z-index: 9999;
}
.flash-active {
    animation: flash 0.1s ease-in forwards;
}
@keyframes flash {
    0% { opacity: 1; }
    100% { opacity: 0; }
}
/* ---------------------------------------------------- */

#game-container {
    padding: 20px;
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden; 
}

#level-display {
    font-size: 1.4em;
    font-weight: bold;
    color: #cc0000;
    margin-bottom: 10px;
    position: absolute; 
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    z-index: 10;
}

/* コンボ表示のスタイル */
#combo-display {
    position: absolute;
    top: 50px;
    right: 20px;
    font-size: 2em;body {
    font-family: 'Arial', sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    margin: 0;
    background-color: #f0f0f0;
    color: #333;
    text-align: center;
    cursor: grab;
    overflow-x: hidden; 
}

/* 画面全体を揺らすためのクラス */
.shake-screen {
    animation: shake 0.2s cubic-bezier(.36,.07,.19,.97) both;
}

@keyframes shake {
    10%, 90% { transform: translate3d(-2px, 0, 0); }
    20%, 80% { transform: translate3d(4px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-6px, 0, 0); }
    40%, 60% { transform: translate3d(6px, 0, 0); }
}

/* 💥 フラッシュオーバーレイのスタイル (一撃必殺・爆発共通) 💥 */
#flash-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.9); /* 強い白フラッシュ */
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.05s ease-in-out; /* 瞬時のエフェクトを滑らかにする */
    z-index: 9999;
}
#flash-overlay.flash-active {
    opacity: 1;
}
/* ---------------------------------------------------- */

#game-container {
    padding: 20px;
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden; 
}

#level-display {
    font-size: 1.4em;
    font-weight: bold;
    color: #cc0000;
    margin-bottom: 10px;
    position: absolute; 
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    z-index: 10;
}

/* コンボ表示のスタイル */
#combo-display {
    position: absolute;
    top: 50px;
    right: 20px;
    font-size: 2em;
    font-weight: 900;
    font-style: italic;
    color: #ffaa00;
    text-shadow: 2px 2px 0 #fff, 4px 4px 0 #000;
    pointer-events: none;
    opacity: 0;
    transform: scale(0.5);
    transition: transform 0.1s, opacity 0.2s;
    z-index: 5;
}
.combo-active {
    opacity: 1 !important;
    transform: scale(1.2) !important;
}

#block {
    width: 200px;
    height: 200px;
    background-color: #ffcc99; 
    margin: 30px auto; 
    display: flex; 
    align-items: center;
    justify-content: center;
    cursor: pointer; 
    border: 5px solid #e0b080;
    border-radius: 50%;
    transition: transform 0.05s ease-out, background-color 0.3s ease; 
    user-select: none;
    position: relative;
    overflow: hidden;
    z-index: 1; 

    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
}

/* クリック時の視覚効果 */
#block:active {
    transform: scale(0.90) rotate(2deg); 
    background-color: #e6b38a;
    cursor: grabbing;
}

#block-hp {
    font-size: 1.5em;
    font-weight: bold;
    color: #333;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.5);
    position: absolute; 
    bottom: 20px; 
    width: 100%; 
    text-align: center;
}

/* 顔のパーツ */
.eye {
    width: 30px;
    height: 30px;
    background-color: #333;
    border-radius: 50%;
    position: absolute;
    top: 60px;
    transition: width 0.3s ease, height 0.3s ease;
}

#left-eye {
    left: 50px;
}

#right-eye {
    right: 50px;
}

#nose {
    width: 20px;
    height: 20px;
    background-color: #333;
    border-radius: 50%;
    position: absolute;
    top: 95px;
    left: 50%;
    transform: translateX(-50%);
    display: block;
}

#mouth {
    width: 80px;
    height: 20px;
    background-color: #333;
    border-radius: 0 0 20px 20px;
    position: absolute;
    top: 120px;
    transition: border-radius 0.3s ease, height 0.3s ease, top 0.3s ease;
}


#message {
    font-size: 1.2em;
    color: #4CAF50;
    min-height: 25px;
    margin-top: 20px;
}

#control-panel {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 15px;
}

#restart-button {
    padding: 10px 20px;
    font-size: 1em;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    margin: 0 5px;
}

#restart-button:hover {
    background-color: #0056b3;
}

/* ガラス破片エフェクトのコンテナ */
#shatter-effect-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
    overflow: hidden;
}

.shard {
    position: absolute;
    background-color: rgba(200, 230, 255, 0.8); 
    border: 1px solid rgba(255, 255, 255, 0.5); 
    pointer-events: none;
    opacity: 0;
}

@keyframes shatter {
    0% { opacity: 1; transform: translate(-50%, -50%) scale(1) rotate(0deg); }
    100% { opacity: 0; transform: translate(var(--end-x), var(--end-y)) scale(0) rotate(var(--end-rotate)); }
}

/* ヒットエフェクト（火花）のスタイル */
#hit-effect-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 3;
    overflow: hidden;
}

.hit-particle {
    position: absolute;
    width: 8px;
    height: 8px;
    background-color: #ffdd00;
    border-radius: 50%;
    pointer-events: none;
    animation: fly-particle 0.5s ease-out forwards;
}

@keyframes fly-particle {
    0% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
    100% { transform: translate(var(--tx), var(--ty)) scale(0); opacity: 0; }
}

/* 💥 新規追加: 破壊時の爆発エフェクト用のスタイル 💥 */
.explosion-particle {
    position: fixed; /* 画面全体に広がるようにfixed */
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: white; /* デフォルトは白、JSで色を変更 */
    transform: translate(-50%, -50%); /* 中央を基準にする */
    pointer-events: none; /* クリックを邪魔しない */
    opacity: 0; /* 最初は非表示 */
    animation: explode 1.5s ease-out forwards var(--delay);
    z-index: 100; /* 他のエフェクトの上に表示 */
}

@keyframes explode {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    10% {
        opacity: 1;
        transform: translate(var(--tx), var(--ty)) scale(1.2);
    }
    100% {
        opacity: 0;
        transform: translate(var(--tx), var(--ty)) scale(0);
    }
}
    font-weight: 900;
    font-style: italic;
    color: #ffaa00;
    text-shadow: 2px 2px 0 #fff, 4px 4px 0 #000;
    pointer-events: none;
    opacity: 0;
    transform: scale(0.5);
    transition: transform 0.1s, opacity 0.2s;
    z-index: 5;
}
.combo-active {
    opacity: 1 !important;
    transform: scale(1.2) !important;
}

#block {
    width: 200px;
    height: 200px;
    background-color: #ffcc99; 
    margin: 30px auto; 
    display: flex; 
    align-items: center;
    justify-content: center;
    cursor: pointer; 
    border: 5px solid #e0b080;
    border-radius: 50%;
    transition: transform 0.05s ease-out, background-color 0.3s ease; 
    user-select: none;
    position: relative;
    overflow: hidden;
    z-index: 1; 

    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
}

/* クリック時の視覚効果 */
#block:active {
    transform: scale(0.90) rotate(2deg); 
    background-color: #e6b38a;
    cursor: grabbing;
}

#block-hp {
    font-size: 1.5em;
    font-weight: bold;
    color: #333;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.5);
    position: absolute; 
    bottom: 20px; 
    width: 100%; 
    text-align: center;
}

/* 顔のパーツ */
.eye {
    width: 30px;
    height: 30px;
    background-color: #333;
    border-radius: 50%;
    position: absolute;
    top: 60px;
    transition: width 0.3s ease, height 0.3s ease;
}

#left-eye {
    left: 50px;
}

#right-eye {
    right: 50px;
}

#nose {
    width: 20px;
    height: 20px;
    background-color: #333;
    border-radius: 50%;
    position: absolute;
    top: 95px;
    left: 50%;
    transform: translateX(-50%);
    display: block;
}

#mouth {
    width: 80px;
    height: 20px;
    background-color: #333;
    border-radius: 0 0 20px 20px;
    position: absolute;
    top: 120px;
    transition: border-radius 0.3s ease, height 0.3s ease, top 0.3s ease;
}


#message {
    font-size: 1.2em;
    color: #4CAF50;
    min-height: 25px;
    margin-top: 20px;
}

#control-panel {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 15px;
}

#restart-button {
    padding: 10px 20px;
    font-size: 1em;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    margin: 0 5px;
}

#restart-button:hover {
    background-color: #0056b3;
}

/* ガラス破片エフェクトのコンテナ */
#shatter-effect-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
    overflow: hidden;
}

.shard {
    position: absolute;
    background-color: rgba(200, 230, 255, 0.8); 
    border: 1px solid rgba(255, 255, 255, 0.5); 
    pointer-events: none;
    opacity: 0;
}

@keyframes shatter {
    0% { opacity: 1; transform: translate(-50%, -50%) scale(1) rotate(0deg); }
    100% { opacity: 0; transform: translate(var(--end-x), var(--end-y)) scale(0) rotate(var(--end-rotate)); }
}

/* ヒットエフェクト（火花）のスタイル */
#hit-effect-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 3;
    overflow: hidden;
}

.hit-particle {
    position: absolute;
    width: 8px;
    height: 8px;
    background-color: #ffdd00;
    border-radius: 50%;
    pointer-events: none;
    animation: fly-particle 0.5s ease-out forwards;
}

@keyframes fly-particle {
    0% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
    100% { transform: translate(var(--tx), var(--ty)) scale(0); opacity: 0; }
}