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

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #333;
}

.game-container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    max-width: 500px;
    width: 100%;
}

.game-header {
    text-align: center;
    margin-bottom: 30px;
}

.game-header h1 {
    font-size: 2.5em;
    margin-bottom: 20px;
    background: linear-gradient(45deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.score-board {
    display: flex;
    justify-content: space-around;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    padding: 15px;
    border-radius: 15px;
    color: white;
    font-weight: bold;
}

.score-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.score-item .label {
    font-size: 0.9em;
    opacity: 0.9;
}

.score-item span:last-child {
    font-size: 1.5em;
}

.game-area {
    position: relative;
    margin-bottom: 30px;
    display: flex;
    justify-content: center;
}

#gameCanvas {
    border: 3px solid #667eea;
    border-radius: 10px;
    background: #f8f9fa;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.game-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 10px;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.game-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.overlay-content {
    text-align: center;
    color: white;
    padding: 30px;
}

.overlay-content h2 {
    font-size: 2em;
    margin-bottom: 15px;
    color: #f093fb;
}

.overlay-content p {
    font-size: 1.1em;
    margin-bottom: 25px;
    opacity: 0.9;
}

.game-button {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 25px;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.game-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.controls {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.control-section h3 {
    text-align: center;
    margin-bottom: 15px;
    color: #667eea;
    font-size: 1.3em;
}

.control-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
    margin-bottom: 20px;
}

.control-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.key {
    background: #667eea;
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-weight: bold;
    min-width: 30px;
    text-align: center;
}

.action {
    font-weight: 500;
}

.mobile-controls {
    display: none;
}

.mobile-control-grid {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.mobile-row {
    display: flex;
    gap: 20px;
}

.mobile-btn {
    width: 60px;
    height: 60px;
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 1.5em;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.mobile-btn:active {
    transform: scale(0.95);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .game-container {
        padding: 20px;
        margin: 10px;
    }
    
    .game-header h1 {
        font-size: 2em;
    }
    
    #gameCanvas {
        width: 300px;
        height: 300px;
    }
    
    .control-section {
        display: none;
    }
    
    .mobile-controls {
        display: block;
    }
    
    .score-board {
        flex-direction: column;
        gap: 10px;
    }
}

@media (max-width: 480px) {
    #gameCanvas {
        width: 250px;
        height: 250px;
    }
    
    .mobile-btn {
        width: 50px;
        height: 50px;
        font-size: 1.2em;
    }
}

/* 动画效果 */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.game-button:active {
    animation: pulse 0.2s ease;
}
