body {
    text-align: center;
    font-family: sans-serif;
}

/* ゲームタイトルロゴのスタイルを追加 */
#game-title-logo {
    display: block; /* ブロック要素として配置 */
    margin: 10px auto 20px auto; /* 上下マージンと中央揃え */
    max-width: 400px; /* 最大幅を設定（必要に応じて調整） */
    height: auto; /* 高さ自動調整で縦横比を維持 */
}

#game-container {
    position: relative;
    width: 800px; /* ゲームの表示幅 */
    height: 500px; /* ゲームの表示高さ */
    border: 2px solid #333;
    margin: 0 auto;
    overflow: hidden;

    /* 背景ループのスタイル */
    background-image: url('background.png'); /* 準備した背景画像のパス */
    background-repeat: repeat-x; /* 横方向にリピート */
    background-position: 0 bottom; /* 背景画像をコンテナの下端に合わせる */
    background-size: auto 100%; /* 高さに合わせて画像を拡大縮小し、幅は自動調整 */
    animation: background-scroll 20s linear infinite; /* アニメーションを適用 */
}

/* 背景ループのアニメーション */
@keyframes background-scroll {
    from {
        background-position: 0 bottom;
    }
    to {
        background-position: -775px bottom; /* ゲームコンテナの幅分だけ左にずらす */
    }
}

/* インフォメーションバーのスタイル（ファミコンマリオ風に調整） */
#info-bar {
    position: absolute; /* game-container を基準に絶対配置 */
    top: 10px; /* 上からの位置 */
    left: 0;
    right: 0;
    margin: auto; /* 水平方向の中央揃え */
    width: 90%; /* game-containerの幅に合わせる（調整可能） */
    display: flex;
    justify-content: space-around; /* 要素を均等に配置 */
    font-family: 'Press Start 2P', cursive; /* マリオっぽいフォント */
    color: white; /* 文字色を白に */
    font-size: 20px; /* フォントサイズを調整 */
    z-index: 50; /* 他の要素より手前に表示 */
    text-shadow: 2px 2px 0px #000; /* 黒い影を追加して視認性アップ */
}

/* スコア表示たちの個別のスタイル（黒枠を削除） */
#score-board,
#high-score-board,
#timer-board {
    background-color: transparent; /* 背景色を透明に */
    border: none; /* 枠線を削除 */
    padding: 0; /* パディングを削除 */
    border-radius: 0; /* 角丸を削除 */
    min-width: unset; /* 最小幅をリセット */
    text-align: center; /* テキストを中央揃え */
    display: block; /* ブロック要素にして縦に並べる */
    line-height: 1; /* 行の高さを調整して詰める */
}

/* スコアや時間の数字部分 */
#score-board span#score,
#high-score-board span#high-score,
#timer-board span#time-left {
    display: block; /* 数字部分を新しい行に表示 */
    font-size: 1.5em; /* 数字を大きく */
    font-weight: bold; /* 太字 */
    margin-top: 5px; /* ラベルとの間隔 */
}

#cat {
    position: absolute;
    width: 250px;
    height: 250px; 
    
    background-image: url('cat_animation.png');
    background-repeat: no-repeat;
    background-position: 0 0;
    background-size: 2000px auto; 
    
    left: 50px;
    bottom: -85px; 

    animation: cat-run 0.5s steps(8) infinite; 
}

/* ★ここから追加★ */
/* ジャンプアニメーション用のクラス */
#cat.cat-jump {
    background-image: url('cat_jump_animation.png'); /* ジャンプ時の画像 */
    background-size: 750px auto; /* 3フレーム * 250px = 750px */
    animation: cat-jump-anim 0.1s steps(3) infinite; /* ジャンプアニメーション */
    /* forwards: アニメーションの最後の状態を維持 */
}

@keyframes cat-jump-anim {
    from {
        background-position: 0px 0px;
    }
    to {
        background-position: -750px 0px; /* 3フレームの合計幅 */
    }
}
/* ★ここまで追加★ */

.fish {
    position: absolute;
    width: 50px;
    height: 30px;
    background-image: url("fish.png");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

/* ゲームオーバーメッセージのスタイル */
#game-over-message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    z-index: 100;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    display: none;
}

/* ゲームオーバー画像そのもののスタイル */
#game-over-image {
    max-width: 100%; /* 親要素（ゲームコンテナ）の幅の100%まで */
    max-height: 75%; /* 親要素（ゲームコンテナ）の高さの75%まで */
    width: auto; /* 縦横比を維持 */
    height: auto; /* 縦横比を維持 */
    margin-bottom: 0px; /* ボタンとの間にスペース */
}

#game-over-message p {
    display: none; /* ゲームオーバーテキストは画像に置き換えるため非表示 */
}

#game-over-message button#restart-button {
    padding: 0;
    cursor: pointer;
    margin-top: 20px;
    width: 200px;
    height: 80px;
    background-image: url("restart_button.png");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    border: none;
    background-color: transparent;
    text-indent: -9999px;
    overflow: hidden;
}

/* 隠すためのクラス */
.hidden {
    display: none;
}

/* 乗ることができるブロックのスタイル */
.block {
    position: absolute;
    width: 130px;
    height: 20px;
    background-image: url("block.png");
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
}

/* 白い缶のスタイル */
.can {
    position: absolute;
    width: 30px;
    height: 40px;
    background-image: url("whitecan.png");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

/* 黄色い缶のスタイル */
.yellow-can {
    position: absolute;
    width: 30px;
    height: 40px;
    background-image: url("yellowcan.png");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

/* 黒い缶のスタイル */
.black-can {
    position: absolute;
    width: 30px;
    height: 40px;
    background-image: url("blackcan.png");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

/* 鳥のスタイル */
.bird {
    position: absolute;
    width: 60px;
    height: 40px;
    background-image: url("bird.png");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

/* 警告サインのスタイル */
.warning-sign {
    position: absolute;
    width: 100px;
    height: 100px;
    background-image: url("exclamation_mark.png"); 
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    z-index: 10; 
    opacity: 1; 
    transition: opacity 0.3s ease-out; 
}

/* アニメーションの定義 */
@keyframes cat-run {
    from {
        background-position: 0px 0px;
    }
    to {
        background-position: -2000px 0px;
    }
}

/* ゲーム説明文のスタイル */
#game-description {
    width: 800px;
    margin: 20px auto;
    text-align: left;
    padding: 15px;
    border: 1px solid #ccc;
    border-radius: 8px;
    background-color: #f9f9f9;
}

#game-description h2 {
    text-align: center;
    color: #333;
    margin-bottom: 15px;
}

#game-description p {
    font-size: 1.1em;
    line-height: 1.6;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
}

/* 説明文内の小さなアイコンのスタイル */
.icon-small {
    width: 40px;
    height: 25px;
    vertical-align: middle;
    margin-right: 10px;
}

/* コンボ表示のスタイル */
#cat #combo-display {
    position: absolute;
    top: -50px; /* 猫の頭の上あたりに配置 */
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Press Start 2P', cursive; /* スコアと同じフォント */
    font-size: 1.2em; /* 適切なサイズに調整 */
    color: yellow; /* 目立つ色 */
    text-shadow: 2px 2px 0px #000; /* 影をつけて見やすく */
    white-space: nowrap; /* テキストが折り返さないように */
    z-index: 60; /* info-barより手前に表示 */
    pointer-events: none; /* クリックイベントを透過 */
    opacity: 1; /* 初期表示は完全な不透明度 */
    transition: opacity 0.3s ease-out; /* フェードアウトアニメーション */
}

/* コンボ表示を隠すためのクラス */
#cat #combo-display.hidden {
    opacity: 0;
}

/* コンボ表示のアニメーション */
@keyframes combo-flash {
    0% { transform: translateX(-50%) scale(1); opacity: 1; }
    50% { transform: translateX(-50%) scale(1.1); opacity: 1; }
    100% { transform: translateX(-50%) scale(1); opacity: 1; }
}

#cat #combo-display.combo-flash {
    animation: combo-flash 0.3s ease-out;
}

/* ★ここから追加★ */

/* 星のスタイル */
.star {
    position: absolute;
    width: 60px; /* 星の幅 */
    height: 60px; /* 星の高さ */
    background-image: url("star.png"); /* 星の画像パス (要準備) */
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    z-index: 20; /* 魚や缶より手前に表示 */
}
