/* 基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background-color: #0a0e17;
    color: #e0e0e0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow: hidden;
    background-image: radial-gradient(circle at center, #1a2035 0%, #0a0e17 100%);
}

.game-container {
    position: relative;
    width: 800px;
    height: 600px;
    margin: 20px auto;
    box-shadow: 0 0 30px rgba(0, 100, 255, 0.3);
    border-radius: 10px;
    overflow: hidden;
}

.game-header {
    text-align: center;
    padding: 10px;
    background-color: rgba(10, 20, 40, 0.8);
    border-bottom: 2px solid #2a4a8a;
}

.game-header h1 {
    font-size: 28px;
    color: #4a9aff;
    text-shadow: 0 0 10px rgba(74, 154, 255, 0.7);
    letter-spacing: 2px;
}

/* 画布样式 */
#gameCanvas {
    display: block;
    background-color: #000;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
}

/* 游戏菜单 */
.game-menu, .game-over, .pause-menu, .instructions {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(10, 20, 40, 0.9);
    z-index: 10;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    text-align: center;
}

.menu-content, .game-over-content, .pause-content, .instructions-content {
    background-color: rgba(20, 30, 60, 0.8);
    padding: 30px;
    border-radius: 10px;
    border: 2px solid #2a4a8a;
    max-width: 80%;
    box-shadow: 0 0 20px rgba(0, 100, 255, 0.3);
}

.hidden {
    display: none;
}

/* 按钮样式 */
button {
    padding: 12px 24px;
    margin: 10px;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-primary {
    background-color: #4a9aff;
    color: white;
    box-shadow: 0 0 10px rgba(74, 154, 255, 0.7);
}

.btn-primary:hover {
    background-color: #3a8aee;
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(74, 154, 255, 0.9);
}

.btn-secondary {
    background-color: #2a4a8a;
    color: white;
}

.btn-secondary:hover {
    background-color: #1a3a7a;
    transform: scale(1.05);
}

.btn-control {
    background-color: rgba(42, 74, 138, 0.7);
    color: white;
    padding: 8px 12px;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.btn-control:hover {
    background-color: rgba(74, 154, 255, 0.7);
}

/* 游戏UI */
.game-ui {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    padding: 10px;
    z-index: 5;
    pointer-events: none;
}

.game-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: rgba(10, 20, 40, 0.7);
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 10px;
}

.stat-item {
    display: flex;
    align-items: center;
    margin: 0 10px;
}

.stat-icon {
    width: 24px;
    height: 24px;
    margin-right: 8px;
    background-size: contain;
    background-repeat: no-repeat;
}

.score-icon {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%234a9aff"><path d="M12 2L15.09 8.26L22 9.27L17 14.14L18.18 21.02L12 17.77L5.82 21.02L7 14.14L2 9.27L8.91 8.26L12 2Z"/></svg>');
}

.health-icon {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23ff4a4a"><path d="M12 21.35L10.55 20.03C5.4 15.36 2 12.27 2 8.5C2 5.41 4.42 3 7.5 3C9.24 3 10.91 3.81 12 5.08C13.09 3.81 14.76 3 16.5 3C19.58 3 22 5.41 22 8.5C22 12.27 18.6 15.36 13.45 20.03L12 21.35Z"/></svg>');
}

.ammo-icon {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23ffaa00"><path d="M7,15L11.5,9L15,13.5L17.5,10.5L21,15H7M22,6V18C22,19.1 21.1,20 20,20H4C2.9,20 2,19.1 2,18V6C2,4.9 2.9,4 4,4H20C21.1,4 22,4.9 22,6Z"/></svg>');
}

.special-icon {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23aa4aff"><path d="M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20,12C20,16.41 16.41,20 12,20M15,12A3,3 0 0,1 12,15A3,3 0 0,1 9,12A3,3 0 0,1 12,9A3,3 0 0,1 15,12Z"/></svg>');
}

.health-bar, .special-bar {
    width: 100px;
    height: 10px;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 5px;
    overflow: hidden;
}

#health-fill {
    width: 100%;
    height: 100%;
    background-color: #ff4a4a;
    transition: width 0.3s ease;
}

#special-fill {
    width: 0%;
    height: 100%;
    background-color: #aa4aff;
    transition: width 0.3s ease;
}

.game-controls {
    position: absolute;
    top: 10px;
    right: 10px;
    pointer-events: auto;
}

/* 角色选择 */
.character-selection {
    margin: 20px 0;
}

.characters {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 15px;
}

.character {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    padding: 10px;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.character:hover {
    background-color: rgba(74, 154, 255, 0.2);
}

.character.active {
    background-color: rgba(74, 154, 255, 0.4);
    box-shadow: 0 0 10px rgba(74, 154, 255, 0.7);
}

.character-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    margin-bottom: 10px;
    background-color: #2a4a8a;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.soldier {
    background-color: #4a9aff;
}

.sniper {
    background-color: #ff4a4a;
}

.engineer {
    background-color: #4aff4a;
}

/* 游戏说明 */
.instructions ul {
    text-align: left;
    margin: 15px 0;
    list-style-position: inside;
}

.instructions li {
    margin: 8px 0;
}

/* 响应式设计 */
@media (max-width: 850px) {
    .game-container {
        width: 95%;
        height: auto;
        aspect-ratio: 4/3;
    }
}

@media (max-width: 600px) {
    .game-stats {
        flex-wrap: wrap;
    }
    
    .stat-item {
        margin: 5px;
    }
    
    .characters {
        flex-direction: column;
        gap: 10px;
    }
    
    .character {
        flex-direction: row;
        justify-content: flex-start;
        gap: 15px;
    }
    
    .character-icon {
        margin-bottom: 0;
    }
}

/* 动画效果 */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.btn-primary {
    animation: pulse 2s infinite;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.game-menu, .game-over, .pause-menu, .instructions {
    animation: fadeIn 0.5s ease-in-out;
}