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

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a2e 50%, #16213e 100%);
    overflow: hidden;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0;
}

.game-container {
    position: relative;
    width: 100%;
    height: 100%;
    margin: 0;
    overflow: hidden;
    touch-action: none; /* 防止触摸时的默认行为（如滚动、缩放） */
}

#gameCanvas {
    display: block;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(0, 255, 255, 0.1) 0%, transparent 70%);
}

/* 触摸控制按钮 */
.touch-controls {
    position: absolute;
    bottom: 30px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    padding: 0 30px;
    z-index: 30;
    opacity: 0.7;
}

.control-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(0, 255, 255, 0.5);
    color: #00ffcc;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    cursor: pointer;
    user-select: none;
    touch-action: manipulation; /* 防止触摸时的默认行为 */
    -webkit-tap-highlight-color: transparent; /* 移除点击时的高亮效果 */
}

.control-group {
    display: flex;
    gap: 10px;
}

.game-info {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none; /* 防止遮挡触摸事件 */
}

#score, #lives, #weapon, #weaponTime {
    font-size: clamp(12px, 4vw, 18px); /* 响应式字体大小 */
    font-weight: bold;
    color: #00ffcc;
    text-shadow: 0 0 10px #00ffcc, 0 0 20px #00ffcc;
    background: rgba(0, 0, 0, 0.5); /* 降低透明度 */
    padding: clamp(4px, 1vw, 8px) clamp(8px, 2vw, 16px);
    border-radius: 5px;
    border: 1px solid rgba(0, 255, 255, 0.3);
    white-space: nowrap; /* 防止换行 */
}

#lives {
    color: #00ff00;
    text-shadow: 0 0 10px #00ff00, 0 0 20px #00ff00;
    border-color: rgba(0, 255, 0, 0.5);
}

#weapon {
    color: #ff0066;
    text-shadow: 0 0 10px #ff0066, 0 0 20px #ff0066;
    border-color: rgba(255, 0, 102, 0.5);
}

#weaponTime {
    color: #ffff00;
    text-shadow: 0 0 10px #ffff00, 0 0 20px #ffff00;
    border-color: rgba(255, 255, 0, 0.5);
}

.game-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%); /* 居中定位 */
    width: 80%;
    max-width: 600px;
    height: auto;
    padding: 40px;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 20;
    border-radius: 10px;
    box-shadow: 0 0 30px rgba(0, 255, 255, 0.5);
    pointer-events: none; /* 让点击穿透到canvas，通过JS控制显示隐藏 */
}

.game-overlay h1 {
    font-size: clamp(24px, 8vw, 48px);
    color: #ff0066;
    text-shadow: 0 0 20px #ff0066, 0 0 40px #ff0066;
    margin-bottom: 30px;
    animation: pulse 2s infinite;
    text-align: center;
}

.game-overlay p {
    font-size: clamp(14px, 4vw, 20px);
    color: #00ffcc;
    text-shadow: 0 0 10px #00ffcc;
    margin: 10px 0;
    text-align: center;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes glow {
    0% {
        box-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
    }
    50% {
        box-shadow: 0 0 20px rgba(0, 255, 255, 0.8), 0 0 30px rgba(0, 255, 255, 0.5);
    }
    100% {
        box-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
    }
}

.game-container {
    animation: glow 3s infinite;
}