/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background-color: #f0f0f0;
    color: #333;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

/* 游戏容器 */
.game-container {
    width: 100%;
    max-width: 500px;
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    margin-bottom: 20px;
}

/* 游戏头部 */
.game-header {
    padding: 15px;
    background-color: #4a6baf;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.score-container {
    display: flex;
    gap: 15px;
}

.control-mode {
    display: flex;
    gap: 5px;
    margin-top: 10px;
    width: 100%;
}

.mode-btn {
    padding: 5px 10px;
    background-color: #5a7bbf;
    border: none;
    border-radius: 5px;
    color: white;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
}

.mode-btn.active {
    background-color: #2c4a8c;
    font-weight: bold;
}

.mode-btn:disabled {
    background-color: #a0a0a0;
    cursor: not-allowed;
    opacity: 0.7;
}

/* 游戏区域 */
.game-area {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 180%; /* 宽高比约为10:18 */
    background-color: #000;
}

#game-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000;
}

/* 游戏结束界面 */
#game-over {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
}

.game-over-content {
    background-color: white;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
}

#restart-btn {
    margin-top: 15px;
    padding: 10px 20px;
    background-color: #4a6baf;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
}

/* 控制区域 */
.game-controls {
    padding: 15px;
    background-color: #e9ecf2;
}

.touch-controls {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.single-row-controls {
    display: flex;
    gap: 10px;
    justify-content: space-between;
    width: 100%;
    max-width: 400px;
}

.control-btn {
    width: 18%;
    height: 60px;
    background-color: #4a6baf;
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: transform 0.1s, background-color 0.2s;
}

.control-btn:active {
    transform: scale(0.95);
    background-color: #2c4a8c;
}

/* 语音控制区域 */
.voice-controls {
    text-align: center;
    padding: 15px 0;
}

#voice-status {
    font-weight: bold;
    margin-bottom: 10px;
    color: #4a6baf;
}

.voice-tips {
    margin-top: 15px;
    padding: 10px;
    background-color: #f0f5ff;
    border-radius: 5px;
    font-size: 14px;
    color: #666;
}

.voice-tips p {
    margin: 5px 0;
}

/* 游戏说明 */
.instructions {
    width: 100%;
    max-width: 500px;
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    padding: 15px;
}

.instructions h3 {
    margin-bottom: 10px;
    color: #4a6baf;
}

.instructions p {
    margin-bottom: 8px;
}

/* 工具类 */
.hidden {
    display: none !important;
}

/* 响应式调整 */
@media (min-width: 768px) {
    .game-container {
        max-width: 400px;
    }
    
    .game-area {
        padding-bottom: 160%;
    }
    
    .control-btn {
        height: 70px;
    }
}

/* 移动设备优化 */
@media (max-width: 480px) {
    .game-controls {
        padding: 10px;
    }
    
    .control-btn {
        height: 50px;
        font-size: 16px;
    }
    
    .single-row-controls {
        gap: 5px;
    }
}