* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: #f0f0f0;
    font-family: Arial, sans-serif;
}

.game-container {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.game-header {
    margin-bottom: 20px;
}

.score-container {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.controls {
    display: flex;
    gap: 10px;
}

#game-canvas {
    border: 2px solid #333;
    background: #fff;
}

.mobile-controls {
    display: none;
    flex-direction: column;
    align-items: center;
    margin-top: 20px;
    width: 100%;
    max-width: 300px;
    margin: 20px auto;
}

.horizontal-controls {
    display: flex;
    gap: 120px;
    margin: 10px 0;
    width: 100%;
    justify-content: center;
}

button {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    background: #4CAF50;
    color: white;
    cursor: pointer;
}

button:hover {
    background: #45a049;
}

select {
    padding: 10px;
    border-radius: 5px;
}

/* 移动端控制按钮样式 */
.mobile-controls button {
    width: 80px;
    height: 80px;
    padding: 0;
    font-size: 24px;
    border-radius: 50%;
    background: #4CAF50;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: manipulation;
}

.mobile-controls button:active {
    transform: translateY(2px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* 上下按钮样式 */
#up, #down {
    margin: 10px auto;
}

@media (max-width: 768px) {
    .mobile-controls {
        display: flex;
    }
    
    .game-container {
        padding: 10px;
        width: 100%;
    }
    
    #game-canvas {
        max-width: 100%;
        height: auto;
    }

    /* 在较小屏幕上调整按钮大小 */
    .mobile-controls button {
        width: 70px;
        height: 70px;
    }

    /* 在较小屏幕上相应调整间距 */
    .horizontal-controls {
        gap: 100px;
    }
}

/* 在更小的屏幕上进一步调整 */
@media (max-width: 360px) {
    .mobile-controls button {
        width: 60px;
        height: 60px;
        font-size: 20px;
    }

    .horizontal-controls {
        gap: 80px;
    }
}

/* 音效按钮样式 */
#sound-btn {
    position: relative;
    min-width: 80px;
}

#sound-btn.sound-off {
    background-color: #888;
}

/* 排行榜弹窗样式 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
}

.modal-content {
    position: relative;
    background-color: white;
    margin: 15% auto;
    padding: 20px;
    width: 80%;
    max-width: 500px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.modal h2 {
    text-align: center;
    margin-bottom: 20px;
    color: #333;
}

#leaderboard-list {
    max-height: 300px;
    overflow-y: auto;
}

.leaderboard-item {
    display: flex;
    justify-content: space-between;
    padding: 10px;
    border-bottom: 1px solid #eee;
    align-items: center;
}

.leaderboard-item:nth-child(1) {
    background-color: #ffd700;
    font-weight: bold;
}

.leaderboard-item:nth-child(2) {
    background-color: #c0c0c0;
}

.leaderboard-item:nth-child(3) {
    background-color: #cd7f32;
}

.leaderboard-item small {
    color: #666;
    margin-left: 10px;
    font-size: 0.8em;
}

.modal-footer {
    text-align: center;
    margin-top: 20px;
}

#show-leaderboard-btn {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
}

#show-leaderboard-btn:hover {
    background-color: #45a049;
}

/* 添加加载状态样式 */
.leaderboard-loading {
    text-align: center;
    padding: 20px;
    color: #666;
}

/* 添加错误状态样式 */
.leaderboard-error {
    text-align: center;
    padding: 20px;
    color: #ff4444;
} 