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

body {
    font-family: 'Comic Sans MS', cursive, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
}

#gameContainer {
    width: 90%;
    max-width: 1000px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    padding: 20px;
    position: relative;
}

#gameTitle {
    text-align: center;
    margin-bottom: 20px;
}

#gameTitle h1 {
    color: #4a5568;
    font-size: 2.5em;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

.screen {
    animation: fadeIn 0.5s ease-in;
}

.hidden {
    display: none !important;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 设置界面样式 */
#setupScreen h2 {
    text-align: center;
    color: #2d3748;
    margin-bottom: 20px;
    font-size: 1.8em;
}

.item-category {
    margin-bottom: 25px;
    padding: 15px;
    background: linear-gradient(145deg, #f7fafc, #edf2f7);
    border-radius: 15px;
    box-shadow: inset 2px 2px 5px rgba(0, 0, 0, 0.1);
}

.item-category h3 {
    color: #4a5568;
    margin-bottom: 15px;
    text-align: center;
    font-size: 1.3em;
}

.item-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
}

.item-btn {
    padding: 12px 8px;
    border: 3px solid #e2e8f0;
    border-radius: 12px;
    background: linear-gradient(145deg, #ffffff, #f1f5f9);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9em;
    font-weight: bold;
    color: #4a5568;
    box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.1);
}

.item-btn:hover {
    transform: translateY(-2px);
    box-shadow: 4px 4px 12px rgba(0, 0, 0, 0.2);
    border-color: #4299e1;
}

.item-btn.selected {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    transform: scale(1.1);
    transition: transform 0.3s ease;
}

#selectedItems, #bombSelection {
    margin: 20px 0;
    padding: 15px;
    background: linear-gradient(145deg, #e6fffa, #b2f5ea);
    border-radius: 12px;
    min-height: 60px;
}

#selectedItems h3, #bombSelection h3 {
    color: #2d3748;
    margin-bottom: 10px;
}

#selectedList {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.bomb-control {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
}

.bomb-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(145deg, #ff6b6b, #ff4757);
    color: white;
    font-size: 1.5em;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.bomb-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15);
}

#bombCount {
    font-size: 1.8em;
    font-weight: bold;
    color: #ff4757;
    min-width: 40px;
    text-align: center;
}

.selected-item {
    background: #4299e1;
    color: white;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.9em;
    display: flex;
    align-items: center;
    gap: 5px;
}

.big-btn {
    display: block;
    margin: 20px auto;
    padding: 15px 30px;
    font-size: 1.2em;
    font-weight: bold;
    color: white;
    background: linear-gradient(145deg, #48bb78, #38a169);
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(72, 187, 120, 0.4);
}

.big-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(72, 187, 120, 0.6);
}

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

/* 游戏界面样式 */
#gameInfo {
    display: flex;
    justify-content: space-around;
    background: linear-gradient(145deg, #2d3748, #4a5568);
    color: white;
    padding: 15px;
    border-radius: 12px;
    margin-bottom: 15px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.info-item {
    font-size: 1.1em;
    font-weight: bold;
    text-align: center;
}

#gameCanvas {
    width: 100%;
    max-width: 800px;
    height: 400px;
    border: 4px solid #4a5568;
    border-radius: 12px;
    background: linear-gradient(180deg, 
        #87ceeb 0%, 
        #98d8e8 30%, 
        #90ee90 60%, 
        #228b22 100%);
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.1);
    display: block;
    margin: 0 auto 15px;
    position: relative;
}

#controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    background: linear-gradient(145deg, #f7fafc, #edf2f7);
    padding: 15px;
    border-radius: 12px;
    margin-bottom: 15px;
}

#aimControl {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: bold;
    color: #4a5568;
}

#aimSlider {
    width: 200px;
    height: 8px;
    border-radius: 4px;
    background: #e2e8f0;
    outline: none;
    cursor: pointer;
}

#aimSlider::-webkit-slider-thumb {
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #4299e1;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.control-hint {
    font-size: 0.8em;
    color: #718096;
    margin-top: 5px;
    text-align: center;
}

#gameHints {
    background: linear-gradient(145deg, #fff5f5, #fed7d7);
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 10px;
}

.hint-item {
    font-size: 0.9em;
    color: #744210;
    font-weight: bold;
    text-align: center;
    padding: 5px 10px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 15px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#shootBtn {
    background: linear-gradient(145deg, #e53e3e, #c53030);
    box-shadow: 0 4px 15px rgba(229, 62, 62, 0.4);
}

#shootBtn:hover {
    box-shadow: 0 6px 20px rgba(229, 62, 62, 0.6);
}

#shootBtn:disabled {
    background: #a0aec0;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

#hitItems {
    background: linear-gradient(145deg, #fef5e7, #fed7aa);
    padding: 15px;
    border-radius: 12px;
    min-height: 80px;
}

#hitItems h3 {
    color: #744210;
    margin-bottom: 10px;
}

#hitList {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.hit-item {
    background: #ed8936;
    color: white;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: bold;
    animation: popIn 0.5s ease;
}

@keyframes popIn {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* 结束界面样式 */
#endScreen {
    text-align: center;
}

#endScreen h2 {
    color: #2d3748;
    margin-bottom: 25px;
    font-size: 2.2em;
}

#finalStats {
    background: linear-gradient(145deg, #e6fffa, #b2f5ea);
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 20px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 10px 0;
    font-size: 1.2em;
}

.stat-label {
    font-weight: bold;
    color: #2d3748;
}

.stat-value {
    font-weight: bold;
    color: #38a169;
    font-size: 1.3em;
}

#achievements {
    background: linear-gradient(145deg, #fef5e7, #fed7aa);
    padding: 15px;
    border-radius: 12px;
    margin-bottom: 20px;
}

#achievements h3 {
    color: #744210;
    margin-bottom: 10px;
}

.achievement {
    background: #ed8936;
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    margin: 5px;
    display: inline-block;
    font-weight: bold;
    animation: glow 2s infinite;
}

@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(237, 137, 54, 0.5);
    }
    50% {
        box-shadow: 0 0 20px rgba(237, 137, 54, 0.8);
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    #gameContainer {
        width: 95%;
        padding: 15px;
    }
    
    #gameTitle h1 {
        font-size: 2em;
    }
    
    .item-grid {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    }
    
    #gameCanvas {
        height: 300px;
    }
    
    #controls {
        flex-direction: column;
        gap: 15px;
    }
    
    #aimSlider {
        width: 150px;
    }
}