* {
    margin: 0;
    padding: 0;
}

body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

h2,p {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 34px;
    color: red;
    display: none;
}

button {
    position: absolute;
    width: 100px;
    height: 35px;
    border: 1.8px solid #69F;
    color: #69F;
    border-radius: 6px;
    letter-spacing: .1em;
    background-color: transparent;
    font-size: 18px;
    font-weight: 700;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    cursor: pointer;
    display: none;
}

#game {
    width: 600px;
    height: 300px; /* 增加游戏区域高度 */
    border: 1px solid;
    position: relative;
    overflow: hidden;
}

.role {
    width: 50px; /* 将人物宽度从 70px 减小到 50px */
    position: absolute;
    bottom: 0;
    left: 50px;
    transition: none;
}

.tree {
    height: 50px; /* 将障碍物高度从 75px 减小到 50px */
    width: 50px; /* 将障碍物宽度从 75px 减小到 50px */
    background-image: url('./tree.png'); /* 使用 tree.png 作为背景 */
    background-size: contain; /* 确保图片适应元素大小 */
    background-repeat: no-repeat; /* 防止图片重复 */
    background-position: center; /* 居中图片 */
    position: absolute;
    right: 0;
    bottom: 0;
}

@keyframes stop {
    0% {
        right: -50px; /* 调整起始位置以匹配新的宽度 */
    }

    100% {
        right: 630px;
    }
}

.animate {
    animation: jump 1s ease-in-out; /* 增加动画时间到1秒，使用 ease-in-out 缓动函数 */
}

@keyframes jump {
    0%, 100% {
        bottom: 0;
    }
    25% {
        bottom: 75px; /* 增加跳跃高度 */
    }
    50% {
        bottom: 150px; /* 增加最高点 */
    }
    75% {
        bottom: 75px; /* 增加跳跃高度 */
    }
}
