* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    display: flex;
    justify-content: flex-start;  /* 从顶部开始显示 */
    align-items: center;
    height: 100vh;
    background: linear-gradient(45deg, #fbc2eb, #a6c1ee);
    color: #fff;
    flex-direction: column;
    overflow: auto; /* 确保页面可以滚动 */
}

.title {
    font-size: 2em;
    margin-bottom: 10px;
    font-weight: bold;
    color: #ff6b6b;
    text-shadow: 2px 2px 5px rgba(255, 255, 255, 0.7);
}

#startBtn {
    background-color: #ff6b6b;
    color: #fff;
    padding: 10px 20px;
    border: none;
    font-size: 1.2em;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
    position: fixed;
    top: 20px; /* 将按钮固定在顶部 */
    left: 50%;
    transform: translateX(-50%); /* 使按钮水平居中 */
    z-index: 999; /* 确保按钮位于最前面 */
}

#startBtn:hover {
    background-color: #ff4c4c;
}

.game-container {
    text-align: center;
    width: 80vw;  /* 使用视口宽度来自动适应屏幕 */
    height: 70vh; /* 游戏区域占据屏幕的70%，剩余30%给按钮预留空间 */
    max-width: 600px; /* 设置最大宽度 */
    max-height: 600px; /* 设置最大高度 */
    margin-top: 80px; /* 为了避免游戏区域与顶部固定按钮重叠，设置顶部外边距 */
}

canvas {
    border: 5px solid #ff6b6b;
    background-color: #fefefe;
    width: 100%;
    height: 100%;
}

button {
    background-color: #ff6b6b;
    color: #fff;
    padding: 10px 20px;
    border: none;
    font-size: 1.2em;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 999;
}

button:hover {
    background-color: #ff4c4c;
}
