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

body {
    font-family: Arial, sans-serif;
    background-color: #f0f0f0;
    color: #333;
    overflow: hidden;
}

/* 游戏容器 */
#game-container {
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* 屏幕通用样式 */
.screen {
    width: 100%;
    max-width: 800px;
    height: 100%;
    max-height: 600px;
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    transition: all 0.3s ease;
}

.hidden {
    display: none !important;
}

/* 开始界面 */
h1 {
    font-size: 3rem;
    color: #ff6b35;
    margin-bottom: 40px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

/* 菜单按钮 */
.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 40px;
    width: 80%;
    max-width: 300px;
}

.menu-btn {
    padding: 15px 20px;
    font-size: 1.1rem;
    border: 2px solid #3a86ff;
    border-radius: 5px;
    background-color: #fff;
    color: #3a86ff;
    cursor: pointer;
    transition: all 0.3s ease;
}

.menu-btn:hover {
    background-color: #3a86ff;
    color: #fff;
    transform: translateY(-2px);
}

.menu-btn.primary {
    background-color: #ff6b35;
    border-color: #ff6b35;
    color: #fff;
    font-weight: bold;
}

.menu-btn.primary:hover {
    background-color: #e55a2b;
    transform: translateY(-2px);
}

/* 游戏模式选择 */
.game-mode-section {
    width: 80%;
    margin-bottom: 30px;
    text-align: center;
}

.game-mode-section h3 {
    font-size: 1.3rem;
    margin-bottom: 15px;
    color: #4a4a4a;
}

.game-mode {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-bottom: 20px;
}

.mode-btn {
    padding: 10px 20px;
    font-size: 1rem;
    border: 2px solid #3a86ff;
    border-radius: 5px;
    background-color: #fff;
    color: #3a86ff;
    cursor: pointer;
    transition: all 0.3s ease;
}

.mode-btn:hover {
    background-color: #3a86ff;
    color: #fff;
}

.mode-btn.active {
    background-color: #3a86ff;
    color: #fff;
}

/* 面板样式 */
.panel {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    max-width: 500px;
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
    padding: 20px;
    z-index: 100;
}

.panel h3 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: #4a4a4a;
    text-align: center;
}

/* 设置面板 */
.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 5px;
}

.setting-btn {
    padding: 8px 16px;
    font-size: 0.9rem;
    border: 1px solid #4a4a4a;
    border-radius: 5px;
    background-color: #fff;
    color: #4a4a4a;
    cursor: pointer;
    transition: all 0.3s ease;
}

.setting-btn:hover {
    background-color: #4a4a4a;
    color: #fff;
}

.setting-select {
    padding: 8px 12px;
    font-size: 0.9rem;
    border: 1px solid #4a4a4a;
    border-radius: 5px;
    background-color: #fff;
    color: #4a4a4a;
    cursor: pointer;
}

/* 操作说明面板 */
.controls-content {
    text-align: left;
    margin-bottom: 20px;
    line-height: 1.5;
}

.controls-content p {
    margin-bottom: 8px;
}

/* 关于面板 */
.about-content {
    text-align: center;
    margin-bottom: 20px;
    line-height: 1.5;
}

/* 关闭按钮 */
.close-btn {
    display: block;
    margin: 0 auto;
    padding: 10px 20px;
    font-size: 1rem;
    border: 1px solid #4a4a4a;
    border-radius: 5px;
    background-color: #fff;
    color: #4a4a4a;
    cursor: pointer;
    transition: all 0.3s ease;
}

.close-btn:hover {
    background-color: #4a4a4a;
    color: #fff;
}

/* 游戏界面 */
.scoreboard {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

.score, .high-score, .timer {
    font-size: 1.1rem;
    font-weight: bold;
}

.game-area {
    flex: 1;
    width: 100%;
    position: relative;
    overflow: hidden;
}

#game-canvas {
    width: 100%;
    height: 100%;
    background-color: #e8f5e8;
}

.power-indicator {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    height: 20px;
    background-color: rgba(255, 255, 255, 0.8);
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.power-bar {
    width: 0%;
    height: 100%;
    background-color: #ff6b35;
    transition: width 0.1s ease;
}

.power-text {
    position: absolute;
    top: 25px;
    font-size: 0.9rem;
    font-weight: bold;
}

.control-panel {
    width: 100%;
    display: flex;
    justify-content: center;
    gap: 20px;
    padding: 10px;
    background-color: #f8f9fa;
    border-top: 1px solid #dee2e6;
}

.control-btn {
    padding: 8px 16px;
    font-size: 0.9rem;
    border: 1px solid #4a4a4a;
    border-radius: 5px;
    background-color: #fff;
    color: #4a4a4a;
    cursor: pointer;
    transition: all 0.3s ease;
}

.control-btn:hover {
    background-color: #4a4a4a;
    color: #fff;
}

/* 结束界面 */
h2 {
    font-size: 2.5rem;
    color: #ff6b35;
    margin-bottom: 30px;
}

.final-score, .final-high-score {
    font-size: 1.5rem;
    margin-bottom: 15px;
    font-weight: bold;
}

.restart-btn, .menu-btn {
    padding: 12px 24px;
    font-size: 1rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 10px;
}

.restart-btn {
    background-color: #ff6b35;
    color: #fff;
}

.restart-btn:hover {
    background-color: #e55a2b;
    transform: scale(1.05);
}

.menu-btn {
    background-color: #3a86ff;
    color: #fff;
}

.menu-btn:hover {
    background-color: #2a76ef;
    transform: scale(1.05);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .screen {
        max-width: 100vw;
        max-height: 100vh;
        border-radius: 0;
    }

    h1 {
        font-size: 2.5rem;
    }

    .game-rules {
        width: 90%;
    }

    .game-mode {
        flex-direction: column;
        align-items: center;
    }

    .scoreboard {
        flex-direction: column;
        gap: 5px;
        padding: 10px;
    }

    .control-panel {
        flex-wrap: wrap;
    }

    .power-indicator {
        width: 150px;
    }
}
