body {
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background-color: #f7f7f7;
    font-family: 'Courier New', Courier, monospace;
    transition: background-color 0.5s; /* 昼夜の切り替えを滑らかに */
}

/* 昼夜切り替え時のダークモード */
body.dark-mode {
    background-color: #202124;
    color: #fff;
}

#game-container {
    position: relative;
    width: 95%;        /* 横幅いっぱいに広げる */
    max-width: 800px;  /* でも最大サイズは固定 */
    margin: 0 auto;
    touch-action: none; /* ブラウザ独自のズームやスクロールを無効化 */
}

canvas {
    width: 100%;       /* 画面幅に合わせて自動リサイズ */
    height: auto;      /* アスペクト比を維持 */
    border-bottom: 2px solid #535353; /* 地面 */
    display: block;
}

body.dark-mode canvas {
    border-bottom: 2px solid #acacac;
}

#score {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 20px;
    font-weight: bold;
    color: #535353;
}

body.dark-mode #score {
    color: #acacac;
}

#gameOverMsg {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    font-size: 24px;
    font-weight: bold;
    color: #535353;
}

body.dark-mode #gameOverMsg {
    color: #acacac;
}

#controls {
    display: flex;
    justify-content: space-around;
    margin-top: 20px;
}

#controls button {
    width: 40%;
    padding: 20px;
    font-size: 18px;
    font-weight: bold;
    border: 2px solid #535353;
    background: #eee;
    border-radius: 10px;
    outline: none;
    user-select: none; /* 長押しでテキスト選択されないようにする */
    -webkit-tap-highlight-color: transparent; /* タップ時の青い枠を消す */
}

/* ダークモード時のボタン */
body.dark-mode #controls button {
    background: #3c4043;
    color: white;
    border-color: #acacac;
}

/* PCではボタンを隠す（お好みで） */
@media (min-width: 801px) {
    #controls {
        display: none;
    }
}