* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #2c3e50, #34495e);
    color: #ecf0f1;
    overflow: hidden;
}

#gameContainer {
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

#mainMenu {
    text-align: center;
    background: rgba(44, 62, 80, 0.9);
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

#mainMenu h1 {
    font-size: 3em;
    margin-bottom: 30px;
    color: #e74c3c;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

button {
    padding: 15px 30px;
    font-size: 1.2em;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.3);
}

button:hover {
    background: linear-gradient(135deg, #c0392b, #a93226);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(231, 76, 60, 0.4);
}

button:active {
    transform: translateY(0);
}

#gameArea {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#gameUI {
    width: 800px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    background: rgba(44, 62, 80, 0.8);
    border-radius: 10px;
    margin-bottom: 10px;
}

#gameUI span {
    font-weight: bold;
    font-size: 1.1em;
}

#timeDisplay {
    text-align: center;
    font-size: 1.3em;
    color: #f39c12;
}

#gameCanvas {
    border: 3px solid #34495e;
    border-radius: 5px;
    background: #2d3748;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.7);
}

#gameSettings {
    background: rgba(44, 62, 80, 0.9);
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    max-width: 500px;
}

#gameSettings h2 {
    margin-bottom: 20px;
    color: #e74c3c;
}

.setting-item {
    margin: 15px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.setting-item label {
    font-weight: bold;
}

select, input[type="checkbox"] {
    padding: 5px;
    border-radius: 5px;
    border: 1px solid #34495e;
}

.controls-info {
    margin-top: 25px;
    text-align: left;
    background: rgba(52, 73, 94, 0.3);
    padding: 20px;
    border-radius: 10px;
}

.controls-info h3 {
    color: #3498db;
    text-align: center;
    margin-bottom: 15px;
}

.control-section {
    margin: 15px 0;
    padding: 10px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
}

.control-section h4 {
    color: #f39c12;
    margin-bottom: 8px;
    font-size: 1.1em;
}

.control-section p {
    margin: 5px 0;
    color: #ecf0f1;
    font-size: 0.9em;
}

#gameOver {
    background: rgba(44, 62, 80, 0.95);
    padding: 40px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
}

#gameOver h2 {
    font-size: 2.5em;
    margin-bottom: 20px;
    color: #e74c3c;
}

#finalScore {
    font-size: 1.5em;
    margin-bottom: 30px;
    color: #f39c12;
}

/* 移动端控制 */
#mobileControls {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 200px;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    padding: 20px;
    justify-content: space-between;
    align-items: center;
}

.control-area {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.joystick {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 3px solid rgba(255, 255, 255, 0.3);
    position: relative;
    cursor: pointer;
}

.joystick-knob {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e74c3c;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.1s ease;
}

.action-buttons {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
}

.action-btn {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    font-size: 1em;
    font-weight: bold;
}

/* 响应式设计 */
@media (max-width: 768px) {
    #gameCanvas {
        max-width: 100vw;
        max-height: 60vh;
    }
    
    #gameUI {
        width: 100%;
        font-size: 0.9em;
    }
    
    #mainMenu {
        padding: 20px;
        margin: 20px;
    }
    
    #mainMenu h1 {
        font-size: 2em;
    }
    
    #mobileControls {
        display: flex;
    }
    
    body {
        overflow: auto;
    }
}

@media (max-width: 480px) {
    #gameCanvas {
        width: 100vw;
        height: auto;
        max-height: 50vh;
    }
    
    #mobileControls {
        height: 150px;
    }
    
    .joystick {
        width: 80px;
        height: 80px;
    }
    
    .joystick-knob {
        width: 25px;
        height: 25px;
    }
    
    .action-btn {
        width: 60px;
        height: 60px;
        font-size: 0.8em;
    }
}