* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px;
    overflow-x: hidden;
}

.container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    text-align: center;
    max-width: 500px;
    width: 100%;
}

h1 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.8em;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.info {
    display: flex;
    justify-content: space-around;
    margin-bottom: 15px;
    font-size: 1em;
    font-weight: bold;
}

.score, .highscore {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    font-size: 0.9em;
}

.speed-control {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 15px;
    font-size: 0.95em;
    font-weight: bold;
    color: #555;
    flex-wrap: wrap;
}

.speed-control label {
    color: #333;
}

.speed-control input[type="range"] {
    width: 120px;
    cursor: pointer;
    accent-color: #667eea;
    flex: 1;
    min-width: 80px;
}

.speed-control #speedValue {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    min-width: 25px;
    text-align: center;
    font-size: 0.9em;
}

#gameCanvas {
    border: 3px solid #333;
    border-radius: 8px;
    background: #f0f0f0;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    display: block;
    margin: 0 auto 15px;
    max-width: 100%;
    height: auto;
}

.controls {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

button {
    padding: 10px 25px;
    font-size: 1em;
    font-weight: bold;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

#startBtn {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
}

#startBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(17, 153, 142, 0.5);
}

#pauseBtn {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

#pauseBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245, 87, 108, 0.5);
}

.instructions {
    background: #f8f9fa;
    padding: 12px;
    border-radius: 10px;
    margin-top: 15px;
}

.instructions p {
    color: #555;
    margin: 6px 0;
    font-size: 0.85em;
}

.game-over {
    color: #f5576c;
    font-size: 2em;
    font-weight: bold;
    margin: 20px 0;
    animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* 响应式设计 */
@media (max-width: 480px) {
    body {
        padding: 5px;
    }
    
    .container {
        padding: 15px;
    }
    
    h1 {
        font-size: 1.5em;
        margin-bottom: 12px;
    }
    
    .info {
        font-size: 0.9em;
        gap: 8px;
    }
    
    .score, .highscore {
        padding: 6px 12px;
        font-size: 0.85em;
    }
    
    .speed-control {
        font-size: 0.85em;
        gap: 6px;
    }
    
    .speed-control input[type="range"] {
        width: 100px;
    }
    
    button {
        padding: 8px 20px;
        font-size: 0.9em;
    }
    
    .instructions p {
        font-size: 0.8em;
    }
}

@media (max-width: 380px) {
    .info {
        flex-direction: column;
        gap: 8px;
    }
    
    .controls {
        flex-direction: column;
        width: 100%;
    }
    
    button {
        width: 100%;
    }
}
