/* 重置样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 基础设置 */
body {
    font-family: Arial, sans-serif;
    overflow: hidden;
    background-color: #000;
}

/* 游戏容器 */
.game-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    max-width: 100%;
    max-height: 100%;
}

/* 游戏区域 - 上三分之二 */
.game-area {
    position: relative;
    width: 100%;
    height: 66.67vh;
    background-color: #4CAF50;
    overflow: hidden;
}

/* 游戏画布 */
#gameCanvas {
    display: block;
    width: 100%;
    height: 100%;
}

/* 游戏信息 */
.game-info {
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    display: flex;
    justify-content: space-between;
    color: white;
    font-weight: bold;
    text-shadow: 1px 1px 2px black;
}

/* 操控区 - 下三分之一 */
.control-area {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    height: 33.33vh;
    background-color: #333;
    padding: 15px;
}

/* 主控制区 */
.main-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    flex: 1;
}

/* 额外控制区 */
.extra-controls {
    display: flex;
    gap: 15px;
    justify-content: center;
    width: 100%;
    padding-top: 10px;
}

/* 左侧操控按钮 */
.left-controls {
    display: flex;
    gap: 20px;
}

/* 右侧加速按钮 */
.right-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: flex-end;
}

/* 档位按钮行 */
.gear-row {
    display: flex;
    gap: 10px;
}

/* 档位按钮样式 */
.gear-btn {
    width: 80px;
    height: 40px;
    border-radius: 20px;
    border: none;
    font-size: 16px;
    font-weight: bold;
    color: white;
    background-color: #555;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    transition: all 0.2s ease;
}

.gear-btn:hover {
    transform: scale(1.05);
}

.gear-btn:active {
    transform: scale(0.95);
}

.gear-btn.active {
    background-color: #4CAF50;
    box-shadow: 0 0 10px #4CAF50;
}

/* 按钮样式 */
button {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: none;
    font-size: 24px;
    font-weight: bold;
    color: white;
    background-color: #555;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    transition: all 0.2s ease;
}

button:hover {
    transform: scale(1.05);
}

button:active {
    transform: scale(0.95);
}



/* 额外按钮样式 */
.extra-btn {
    width: 120px;
    height: 40px;
    border-radius: 20px;
    border: none;
    font-size: 14px;
    font-weight: bold;
    color: white;
    background-color: #666;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    transition: all 0.2s ease;
}

.extra-btn:hover {
    transform: scale(1.05);
}

.extra-btn:active {
    transform: scale(0.95);
}

#endGameBtn {
    background-color: #f44336;
}

#musicToggleBtn {
    background-color: #2196F3;
}

/* 屏幕样式 */
.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    z-index: 10;
}

.screen h1 {
    font-size: 48px;
    margin-bottom: 20px;
}

.screen h2 {
    font-size: 32px;
    margin-bottom: 30px;
}

.screen p {
    font-size: 18px;
    margin-bottom: 10px;
}

.screen button {
    width: 200px;
    height: 60px;
    border-radius: 30px;
    font-size: 20px;
    margin-top: 30px;
    background-color: #4CAF50;
}

/* 数学题界面样式 */
#mathScreen input {
    width: 200px;
    height: 60px;
    font-size: 24px;
    text-align: center;
    margin: 20px 0;
    border-radius: 10px;
    border: none;
}

#heartMathScreen input {
    width: 200px;
    height: 60px;
    font-size: 24px;
    text-align: center;
    margin: 20px 0;
    border-radius: 10px;
    border: none;
}

#mathScreen button {
    width: 200px;
    height: 60px;
    border-radius: 30px;
    font-size: 20px;
    margin-top: 10px;
}

#mathResult {
    margin-top: 60px;
    font-size: 20px;
    color: #FF5722;
    font-weight: bold;
}

/* 响应式调整 */
@media screen and (max-width: 768px) {
    .control-area {
        padding: 10px;
    }
    
    button {
        width: 80px;
        height: 80px;
        font-size: 20px;
    }
    
    .left-controls {
        gap: 10px;
    }
    
    .gear-btn {
        width: 70px;
        height: 35px;
        font-size: 14px;
    }
    
    .screen h1 {
        font-size: 36px;
    }
    
    .screen h2 {
        font-size: 24px;
    }
    
    .screen p {
        font-size: 18px;
    }
    
    .screen button {
        width: 160px;
        height: 50px;
        font-size: 18px;
    }
    
    #mathScreen input,
    #heartMathScreen input {
        width: 160px;
        height: 50px;
        font-size: 20px;
    }
}

@media screen and (max-width: 480px) {
    button {
        width: 60px;
        height: 60px;
        font-size: 18px;
    }
    
    #accelerateBtn {
        font-size: 14px;
    }
    
    .screen h1 {
        font-size: 28px;
    }
    
    .screen h2 {
        font-size: 20px;
    }
    
    .screen p {
        font-size: 18px;
    }
    
    .screen button {
        width: 140px;
        height: 40px;
        font-size: 16px;
    }
    
    #mathScreen input,
    #heartMathScreen input {
        width: 140px;
        height: 45px;
        font-size: 18px;
    }
}