/* 基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    overflow: hidden;
    touch-action: none;
    background-color: #333;
    color: #fff;
}

#game-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

/* 游戏场景样式 */
#game-scene {
    position: absolute;
    width: 10000px; /* 初始宽度，将通过JS动态调整 */
    height: 4000px; /* 初始高度，将通过JS动态调整 */
    background-color: #1a6bb0;
}

#sky-area {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 200px; /* 天空高度，将通过JS动态调整 */
    background-color: #87CEEB;
    z-index: 1;
}

#water-line {
    position: absolute;
    top: 200px; /* 与天空高度相同 */
    left: 0;
    width: 100%;
    height: 10px;
    background: linear-gradient(to bottom, rgba(135, 206, 235, 0.8), rgba(26, 107, 176, 0.8));
    z-index: 2;
}

#water-area {
    position: absolute;
    top: 210px; /* 天空高度 + 水面线高度 */
    left: 0;
    width: 100%;
    height: calc(100% - 210px);
    z-index: 3;
}

/* 游戏UI样式 */
#game-ui {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 100;
}

.ui-top {
    position: absolute;
    top: 10px;
    left: 10px;
    display: flex;
    gap: 20px;
    pointer-events: auto;
}

.ui-bottom {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 15px;
    pointer-events: auto;
}

.ui-btn {
    padding: 8px 15px;
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s;
}

.ui-btn:hover {
    background-color: rgba(0, 0, 0, 0.7);
    border-color: rgba(255, 255, 255, 0.7);
}

.score-display, .level-display, .lives-display {
    background-color: rgba(0, 0, 0, 0.5);
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 18px;
}

/* 消息提示样式 */
#message-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    pointer-events: none;
}

.message {
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 18px;
    text-align: center;
    opacity: 0;
    transition: opacity 0.3s;
    max-width: 80%;
    word-wrap: break-word;
}

.message.show {
    opacity: 1;
}

/* 菜单样式 */
.menu-screen {
    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: 200;
}

.menu-screen.hidden {
    display: none;
}

.menu-content {
    background-color: rgba(0, 0, 0, 0.7);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    padding: 30px;
    max-width: 90%;
    max-height: 90%;
    overflow-y: auto;
    text-align: center;
}

.menu-content h1 {
    margin-bottom: 20px;
    color: #4fc3f7;
    font-size: 2.5rem;
}

.menu-btn {
    display: block;
    width: 200px;
    padding: 12px;
    margin: 10px auto;
    background-color: rgba(76, 175, 80, 0.7);
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s;
}

.menu-btn:hover {
    background-color: rgba(76, 175, 80, 0.9);
    transform: scale(1.05);
}

/* 设置选项样式 */
.settings-option {
    margin: 15px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.settings-option label {
    margin-right: 10px;
    font-size: 16px;
}

.settings-option select, .settings-option input {
    padding: 5px;
    border-radius: 5px;
    border: 1px solid #ccc;
    background-color: rgba(255, 255, 255, 0.9);
}

/* 帮助内容样式 */
.help-content {
    text-align: left;
    margin: 20px 0;
    max-height: 60vh;
    overflow-y: auto;
}

.help-content h3 {
    margin: 15px 0 10px;
    color: #4fc3f7;
}

.help-content p, .help-content ul {
    margin-bottom: 10px;
    line-height: 1.5;
}

.help-content ul {
    padding-left: 20px;
}

/* 排行榜样式 */
.leaderboard-content {
    margin: 20px 0;
    max-height: 60vh;
    overflow-y: auto;
}

#leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

#leaderboard-table th, #leaderboard-table td {
    padding: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    text-align: center;
}

#leaderboard-table th {
    background-color: rgba(0, 0, 0, 0.5);
    color: #4fc3f7;
}

#leaderboard-table tr:nth-child(even) {
    background-color: rgba(255, 255, 255, 0.1);
}

/* 触摸控制区域 */
#touch-controls {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 50;
    pointer-events: none;
}

#touch-area {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: auto;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .menu-content {
        padding: 20px;
    }
    
    .menu-content h1 {
        font-size: 2rem;
    }
    
    .menu-btn {
        width: 160px;
        padding: 10px;
        font-size: 16px;
    }
    
    .ui-top {
        flex-direction: column;
        gap: 5px;
    }
    
    .score-display, .level-display, .lives-display {
        font-size: 16px;
        padding: 3px 8px;
    }
    
    .ui-btn {
        padding: 6px 12px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .menu-content {
        padding: 15px;
    }
    
    .menu-content h1 {
        font-size: 1.8rem;
    }
    
    .menu-btn {
        width: 140px;
        padding: 8px;
        font-size: 15px;
    }
}