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

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #0a0a2a 0%, #1e1e3f 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    overflow: hidden;
}

/* 背景星星动画 */
body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(2px 2px at 20px 30px, #eee, rgba(0,0,0,0)),
        radial-gradient(2px 2px at 40px 70px, #fff, rgba(0,0,0,0)),
        radial-gradient(1px 1px at 90px 40px, #fff, rgba(0,0,0,0)),
        radial-gradient(1px 1px at 130px 80px, #fff, rgba(0,0,0,0)),
        radial-gradient(3px 3px at 160px 120px, #fff, rgba(0,0,0,0));
    background-repeat: repeat;
    background-size: 200px 200px;
    animation: stars-move 20s linear infinite;
}

@keyframes stars-move {
    from { background-position: 0 0; }
    to { background-position: 0 1000px; }
}

.game-container {
    text-align: center;
    background: rgba(0, 0, 0, 0.7);
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    max-width: 550px;
    width: 90%;
    position: relative;
    z-index: 1;
}

h1 {
    margin-bottom: 1rem;
    font-size: 2.5rem;
    background: linear-gradient(to right, #00f2fe, #4facfe, #00f2fe);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    animation: title-shine 3s linear infinite;
}

@keyframes title-shine {
    0% { background-position: -200px 0; }
    100% { background-position: 200px 0; }
}

.game-info {
    display: flex;
    justify-content: space-around;
    margin-bottom: 1rem;
    font-size: 1.2rem;
    font-weight: bold;
}

.score, .lives, .level {
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.game-board {
    margin: 1rem 0;
    display: flex;
    justify-content: center;
    position: relative;
}

#gameCanvas {
    border: 3px solid #00f2fe;
    border-radius: 10px;
    background: #0a0a2a;
    box-shadow: 0 0 20px rgba(0, 242, 254, 0.3);
}

.game-controls {
    margin: 1.5rem 0;
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    padding: 0.8rem 2rem;
    font-size: 1rem;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
    background: linear-gradient(45deg, #00f2fe, #4facfe);
    color: white;
    box-shadow: 0 4px 15px rgba(0, 242, 254, 0.2);
}

.btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 242, 254, 0.4);
}

.btn:disabled {
    background: #333;
    cursor: not-allowed;
    box-shadow: none;
}

.btn-large {
    padding: 1rem 3rem;
    font-size: 1.2rem;
}

/* 游戏屏幕 */
.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 15px;
    z-index: 10;
    animation: fadeIn 0.5s ease;
}

.screen.hidden {
    display: none;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.screen-content {
    text-align: center;
    padding: 2rem;
}

.screen-content h2 {
    margin-bottom: 1.5rem;
    font-size: 2rem;
    color: #00f2fe;
}

.screen-content p {
    margin-bottom: 2rem;
    font-size: 1.2rem;
    color: #fff;
}

/* 移动设备控制 */
.mobile-controls {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 200px;
    background: rgba(0, 0, 0, 0.5);
    z-index: 5;
}

.joystick {
    position: absolute;
    left: 50px;
    bottom: 50px;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: none;
}

.joystick-inner {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(0, 242, 254, 0.5);
    position: relative;
}

.fire-btn {
    position: absolute;
    right: 50px;
    bottom: 50px;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(45deg, #ff6b6b, #ee5a24);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    font-weight: bold;
    touch-action: none;
    box-shadow: 0 4px 20px rgba(255, 107, 107, 0.3);
}

.fire-btn:active {
    transform: scale(0.95);
    box-shadow: 0 2px 10px rgba(255, 107, 107, 0.5);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .game-container {
        padding: 1rem;
        margin: 1rem;
        height: 100vh;
        max-width: none;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
    }
    
    h1 {
        font-size: 1.8rem;
        margin-bottom: 0.5rem;
    }
    
    .game-info {
        font-size: 1rem;
        margin-bottom: 0.5rem;
    }
    
    #gameCanvas {
        width: 100%;
        height: auto;
        max-height: 60vh;
    }
    
    .game-controls {
        display: none;
    }
    
    .mobile-controls {
        display: block;
    }
}

/* 爆炸效果 */
@keyframes explode {
    0% { transform: scale(0); opacity: 1; }
    100% { transform: scale(1.5); opacity: 0; }
}

/* 击中效果 */
@keyframes hit {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* 闪烁效果（无敌状态） */
@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0.3; }
}

/* 胜利动画 */
@keyframes victory {
    0% { transform: scale(1); }
    25% { transform: scale(1.1); }
    50% { transform: scale(1); }
    75% { transform: scale(1.1); }
    100% { transform: scale(1); }
}