body {
    font-family: 'Arial', sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    /* justify-content: center; */
    height: 100vh;
    background-color: #f0f7ff;
    margin: 0;
    touch-action: none;
}

h2 {
    color: #333;
}

#game-container {
    width: 320px; /* スマホ画面を想定 */
    height: 500px;
    /* 空の色 */
    /* background-color: #87ceeb; */
    /* 地面と空 */
    /* background-image: linear-gradient(to top, #d2b48c 30%, #87ceeb 30%); */
    /* 崖の枠 */
    /* border: 3px solid #654321;  */
    background-image: url(./img/背景.jpeg);
    background-position: center;
    background-size: cover;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    cursor: grab;
    user-select: none; /* テキスト選択を無効化 */
}

#player {
    width: 60px;
    height: 130px;
    background-image: url(./img/anim.gif);
    background-size: cover;
    border-radius: 10px 10px 0 0;
    position: absolute;
    bottom: 15px; /* 地面より少し上 */
    left: 140px; /* 中央初期位置 */
    transition: left 0.05s linear; /* スムーズな移動 */
}

/* ヘルメット装着時の見た目 */
#helmet-visual {
    width: 37px;
    height: 30px;
    background-image: url(./img/ヘルメット装着.png);
    background-size: cover;
    border-radius: 10px 10px 0 0;
    position: absolute;
    top: -10px;
    left: 5.5px;
    display: none; /* 通常は非表示 */
}

/* 落ちてくる石 */
.stone {
    width: 25px;
    height: 25px;
    /* 石の色 (グレー) */
    /* background-color: #808080;
    border: 2px solid #404040; */
    background-image: url(./img/石.png);
    background-size: cover;
    border-radius: 50%; /* 丸い石 */
    position: absolute;
    top: -30px;
}

/* 落ちてくるヘルメットアイテム */
.helmet-item {
    width: 30px;
    height: 25px;
    background-image: url(./img/ヘルメット.png);
    background-size: cover;
    border-radius: 12px 12px 0 0;
    position: absolute;
    top: -30px;
}

/* UI関連 */
#ui-container {
    width: 320px;
    margin-top: 10px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-around;
    align-items: center;
    background-color: #eee;
    padding: 10px;
    border-radius: 8px;
}

.status-bar {
    display: flex;
    align-items: center;
}

#hp-bar-container {
    width: 80px;
    height: 15px;
    background-color: #ddd;
    border: 1px solid #aaa;
    border-radius: 5px;
    margin: 0 5px;
}

#hp-bar {
    width: 100%; /* JSで操作 */
    height: 100%;
    background-color: #4caf50; /* 元気な緑 */
    border-radius: 4px;
    transition: width 0.2s;
}

.status-item {
    font-size: 16px;
    font-weight: bold;
}

/* メッセージ表示 */
#message-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

#message-box {
    background-color: white;
    padding: 30px 40px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

#message-text {
    font-size: 24px;
    white-space: pre-wrap;
    margin-bottom: 20px;
}

#start-button {
    padding: 10px 20px;
    font-size: 18px;
    cursor: pointer;
    background-color: #4caf50;
    color: white;
    border: none;
    border-radius: 5px;
}

.hidden {
    display: none;
}