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

body {
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #fff;
}

.game-container {
    width: 100%;
    max-width: 900px;
    padding: 20px;
}

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

.header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    text-shadow: 0 0 20px rgba(0, 255, 150, 0.5);
}

.stats {
    display: flex;
    justify-content: center;
    gap: 25px;
    font-size: 1.1em;
    background: rgba(255,255,255,0.1);
    padding: 10px 25px;
    border-radius: 25px;
    backdrop-filter: blur(10px);
}

.stats span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.menu {
    text-align: center;
    padding: 40px 20px;
}

.menu h2 {
    font-size: 1.8em;
    margin-bottom: 30px;
    color: #00ff96;
}

.mode-buttons {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 500px;
    margin: 0 auto 30px;
}

.mode-btn {
    padding: 25px 30px;
    border: 2px solid transparent;
    border-radius: 15px;
    background: rgba(255,255,255,0.08);
    color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    backdrop-filter: blur(10px);
}

.mode-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.mode-btn.easy {
    border-color: #00ff96;
}
.mode-btn.easy:hover {
    background: rgba(0, 255, 150, 0.15);
    box-shadow: 0 10px 30px rgba(0, 255, 150, 0.2);
}

.mode-btn.medium {
    border-color: #ffd700;
}
.mode-btn.medium:hover {
    background: rgba(255, 215, 0, 0.15);
    box-shadow: 0 10px 30px rgba(255, 215, 0, 0.2);
}

.mode-btn.hard {
    border-color: #ff4757;
}
.mode-btn.hard:hover {
    background: rgba(255, 71, 87, 0.15);
    box-shadow: 0 10px 30px rgba(255, 71, 87, 0.2);
}

.mode-title {
    font-size: 1.4em;
    font-weight: bold;
    margin-bottom: 8px;
}

.mode-desc {
    font-size: 0.95em;
    opacity: 0.8;
}

.controls-info {
    margin-top: 30px;
    padding: 20px;
    background: rgba(255,255,255,0.05);
    border-radius: 10px;
    font-size: 0.9em;
    line-height: 1.8;
}

.controls-info p {
    opacity: 0.7;
}

.game-area {
    display: flex;
    justify-content: center;
    position: relative;
}

#gameCanvas {
    border: 3px solid #00ff96;
    border-radius: 8px;
    background: #0a0a1a;
    box-shadow: 0 0 40px rgba(0, 255, 150, 0.15);
}

.warning-overlay {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 800px;
    height: 800px;
    border-radius: 8px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
    box-shadow: inset 0 0 100px rgba(255, 0, 0, 0.6);
}

.warning-overlay.active {
    opacity: 1;
    animation: pulseWarning 0.5s infinite alternate;
}

@keyframes pulseWarning {
    from { box-shadow: inset 0 0 50px rgba(255, 0, 0, 0.4); }
    to { box-shadow: inset 0 0 150px rgba(255, 0, 0, 0.8); }
}

.game-over {
    text-align: center;
    padding: 50px 20px;
    background: rgba(0,0,0,0.8);
    border-radius: 15px;
    backdrop-filter: blur(10px);
}

.game-over h2 {
    font-size: 2.5em;
    margin-bottom: 20px;
}

.game-over.win h2 {
    color: #00ff96;
}

.game-over.lose h2 {
    color: #ff4757;
}

.game-over p {
    font-size: 1.2em;
    margin-bottom: 20px;
    opacity: 0.9;
}

.final-stats {
    margin: 20px 0;
    padding: 20px;
    background: rgba(255,255,255,0.05);
    border-radius: 10px;
    font-size: 1.1em;
    line-height: 2;
}

.restart-btn {
    padding: 15px 50px;
    font-size: 1.2em;
    border: none;
    border-radius: 30px;
    background: linear-gradient(135deg, #00ff96, #00d4aa);
    color: #1a1a2e;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.restart-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 255, 150, 0.3);
}

.pause-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 100;
    backdrop-filter: blur(5px);
}

.pause-text {
    font-size: 3em;
    margin-bottom: 20px;
}

.pause-overlay p {
    font-size: 1.2em;
    opacity: 0.7;
}

/* 响应式 */
@media (max-width: 850px) {
    #gameCanvas {
        width: 90vw;
        height: 90vw;
    }
    .stats {
        flex-wrap: wrap;
        gap: 10px;
        font-size: 0.9em;
    }
}
