/* ベースのスタイル */
body {
    font-family: "Arial", sans-serif;
    text-align: center;
    margin: 0;
    padding: 0;
    background-color: #f0f0f0;
}

#game-container {
    width: 100%;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

#game-title {
    font-size: 24px;
    margin-bottom: 10px;
}

/* ゲームエリア */
#game-screen {
    width: 400px;
    height: 400px;
    position: relative;
    background: linear-gradient(to bottom, #87ceeb, #2DFF57); /* 空から海へのグラデーション */
    border: 2px solid #1e90ff; /* 海の色の枠線 */
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    z-index: 1; /* ゲームエリアを他の要素より下に配置 */
}

/* プレイヤー */
#player {
    position: absolute;
    bottom: 10px;
    height: 40px;
    width: auto;
}

#player img {
    height: 100%;
    width: auto;
}

/* スコア表示 */
#score {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 20px;
    z-index: 2; /* スコア表示をゲームエリアの上に配置 */
}

/* ゲームオーバー表示 */
#game-over {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-0%, 0%);
    font-size: 48px;
    color: red;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    z-index: 4; /* ゲームオーバーのテキストを最上層に配置 */
}

/* 障害物 */
.obstacle {
    position: absolute;
    width: 40px;
    height: 40px;
    background-image: url('images/2.png'); /* 2.pngを障害物として指定 */
    background-size: cover;
    background-position: center;
    z-index: 2; /* 障害物をゲームエリアより上に表示 */
}

/* オーバーレイ */
#overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.3); /* 半透明度をさらに薄く */
    z-index: 3; /* オーバーレイをゲームエリアより上に配置 */
    display: none; /* 初期表示時には非表示 */
}

/* はじめるボタン */
#start-btn {
    margin-top: 10px;
    padding: 10px 20px;
    font-size: 18px;
    background-color: green;
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
}

#start-btn.hidden {
    display: none;
}

/* ハイライト */
.highlight {
    font-size: 24px;
    color: red;
    animation: highlight 0.5s ease;
}

@keyframes highlight {
    0% { color: red; }
    50% { color: yellow; }
    100% { color: red; }
}

/* 画面を揺らすアニメーション */
.shake {
    animation: shake 0.5s ease forwards;
}

@keyframes shake {
    0% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    50% { transform: translateX(10px); }
    75% { transform: translateX(-10px); }
    100% { transform: translateX(0); }
}

.highlight {
    font-size: 24px;
    color: red;
    animation: highlight 0.5s ease;
}

@keyframes highlight {
    0% { color: red; }
    50% { color: yellow; }
    100% { color: red; }
}
