/* 基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    touch-action: manipulation;
}

body {
    font-family: 'Arial', sans-serif;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: url('../../assets/images/background.jpeg') no-repeat center center fixed;
    background-size: cover;
    position: relative;
    padding: 20px;
    overflow: hidden;
}

/* 游戏容器 */
.game-container {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 800px;
    text-align: center;
    position: relative;
}

h1 {
    color: #333;
    margin-bottom: 15px;
    font-size: clamp(20px, 5vw, 28px);
}

.game-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    font-size: clamp(14px, 4vw, 18px);
    font-weight: bold;
}

/* 游戏画布 */
canvas {
    background: rgba(0, 0, 0, 0.1);
    display: block;
    width: 100%;
    height: auto;
    max-height: 60vh;
    aspect-ratio: 4/3;
    margin: 0 auto;
    border-radius: 5px;
}

/* 在原有样式基础上添加 */
#backBtn {
    background-color: #9C27B0;
}

#backBtn:hover {
    background-color: #7B1FA2;
}

/* 调整控制按钮布局 */
.controls {
    margin-top: 15px;
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

button {
    padding: 8px 15px;
    font-size: clamp(14px, 4vw, 16px);
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    min-width: 80px;
    transition: background-color 0.3s;
}

button:hover {
    background-color: #45a049;
}

#pauseBtn {
    background-color: #f44336;
}

#pauseBtn:hover {
    background-color: #d32f2f;
}

#restartBtn {
    background-color: #2196F3;
}

#restartBtn:hover {
    background-color: #0b7dda;
}

/* 移动端触摸控制 */
.touch-area {
    display: none;
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100px;
    background: transparent;
    z-index: 10;
    touch-action: none;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .touch-area {
        display: block;
    }
    
    .game-container {
        padding-bottom: 80px;
    }
    
    canvas {
        max-height: 50vh;
    }
}

@media (max-height: 500px) {
    canvas {
        max-height: 40vh;
    }
}