* {
    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: 20px;
}

.container {
    max-width: 500px;
    width: 100%;
}

.game-header {
    background: rgba(255, 255, 255, 0.95);
    padding: 20px;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.1);
    position: relative;
}

.game-header h1 {
    text-align: center;
    color: #667eea;
    font-size: 2em;
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.music-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 45px;
    height: 45px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 1.5em;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(102, 126, 234, 0.3);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.music-btn:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 15px rgba(102, 126, 234, 0.5);
}

.music-btn:active {
    transform: translateY(0) scale(0.95);
}

.score-board {
    display: flex;
    justify-content: space-around;
    gap: 10px;
}

.score-item {
    text-align: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 10px 15px;
    border-radius: 10px;
    color: white;
    flex: 1;
}

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

.score-item .value {
    display: block;
    font-size: 1.3em;
    font-weight: bold;
    margin-top: 5px;
}

.game-wrapper {
    position: relative;
    background: white;
    border-radius: 0 0 20px 20px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

#gameCanvas {
    display: block;
    width: 100%;
    height: auto;
    background: #2d3436;
    transition: transform 0.05s ease-out;
}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
    backdrop-filter: blur(5px);
}

.overlay.hidden {
    display: none;
}

.overlay-content {
    text-align: center;
    color: white;
    padding: 30px 40px;
    max-width: 90%;
    max-height: 95%;
    overflow-y: auto;
}

.overlay-content h2 {
    font-size: 2em;
    margin-bottom: 15px;
    color: #fff;
    text-shadow: 0 0 20px rgba(102, 126, 234, 0.8);
}

.overlay-content p {
    font-size: 0.95em;
    margin: 8px 0;
    line-height: 1.5;
    opacity: 0.9;
}

.final-score {
    font-size: 1.5em !important;
    font-weight: bold;
    color: #ffd700;
    margin: 20px 0 !important;
}

.high-score-msg {
    color: #4ecca3;
    font-weight: bold;
    font-size: 1.2em !important;
}

.btn {
    padding: 12px 35px;
    font-size: 1em;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    margin: 8px;
    font-weight: bold;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 7px 20px rgba(102, 126, 234, 0.6);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid white;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.controls-info {
    background: rgba(255, 255, 255, 0.95);
    padding: 20px;
    border-radius: 15px;
    margin-top: 20px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.control-item {
    text-align: center;
    margin: 10px 0;
    color: #2d3436;
    font-size: 1em;
}

kbd {
    display: inline-block;
    padding: 5px 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 5px;
    font-weight: bold;
    margin: 0 3px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    font-family: 'Courier New', monospace;
}

@media (max-width: 600px) {
    .game-header h1 {
        font-size: 1.5em;
    }
    
    .score-item {
        padding: 8px 10px;
    }
    
    .score-item .value {
        font-size: 1.1em;
    }
    
    .overlay-content {
        padding: 20px 15px;
        font-size: 0.9em;
    }
    
    .overlay-content h2 {
        font-size: 1.6em;
    }
    
    .overlay-content p {
        font-size: 0.9em;
    }
    
    .btn {
        padding: 10px 25px;
        font-size: 0.9em;
        margin: 6px;
    }
}

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

.btn-primary {
    animation: pulse 2s infinite;
}

.btn-primary:hover {
    animation: none;
}


