* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    overflow: hidden;
    background-color: #00a2ff; /* 蓝色背景 */
    height: 100vh;
    width: 100vw;
    position: relative;
    cursor: default;
    background-size: cover;
    background-position: center;
}

/* 自定义鼠标样式 */
#custom-cursor {
    position: fixed;
    width: 70px;
    height: 70px;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    transition: transform 0.05s ease;
}

.cursor-hammer {
    background-image: url('images/hammer.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    width: 70px;
    height: 70px;
}

.cursor-chainsaw {
    background-image: url('images/chainsaw.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    width: 70px;
    height: 70px;
}

.cursor-machinegun {
    background-image: url('images/machinegun.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    width: 70px;
    height: 70px;
}

/* 鼠标动画效果 */
.animate-hammer {
    animation: hammer-hit 0.3s ease-in-out;
    background-image: url('images/hammer.png') !important;
}

.animate-chainsaw {
    animation: chainsaw-cut 0.3s ease-out;
    background-image: url('images/chainsaw.png') !important;
}

.animate-machinegun {
    animation: machinegun-fire 0.3s ease-out;
    background-image: url('images/machinegun.png') !important;
}

#game-area {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

#toolbar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: #1a0058; /* 深紫色工具栏 */
    display: flex;
    justify-content: center;
    padding: 10px;
    z-index: 10;
}

.tool, .settings-btn, #recycle-bin {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0 20px;
    cursor: pointer;
    color: white;
}

.tool img, .settings-btn img, #recycle-bin img {
    width: 50px;
    height: 50px;
    margin-bottom: 5px;
}

.tool.active {
    border-bottom: 3px solid #ff0000;
}

.crack {
    position: absolute;
    pointer-events: none;
    z-index: 2;
}

.hammer-effect {
    width: 100px;
    height: 100px;
    background-size: contain;
    background-repeat: no-repeat;
}

.hammer-effect-1 {
    background-image: url('images/crack1.png');
}

.hammer-effect-2 {
    background-image: url('images/crack2.png');
}

.hammer-effect-3 {
    background-image: url('images/crack3.png');
}

.chainsaw-effect {
    width: 150px;
    height: 150px;
    background-image: url('images/saw-cut.svg');
    background-size: contain;
    background-repeat: no-repeat;
}

.machinegun-effect {
    background-image: url('images/bullet-hole.png');
    background-size: contain;
    background-repeat: no-repeat;
}

/* 子弹壳 */
.bullet-shell {
    position: absolute;
    width: 10px;
    height: 15px;
    background-color: #FFD700;
    border-radius: 2px 2px 0 0;
    z-index: 4;
    animation: shell-eject 1s ease-in forwards;
}

/* 火花效果 */
.muzzle-flash {
    position: absolute;
    width: 30px;
    height: 30px;
    background-image: url('images/muzzle-flash.svg');
    background-size: contain;
    background-repeat: no-repeat;
    z-index: 4;
    animation: flash 0.2s ease-out;
}

/* 动画关键帧 */
@keyframes hammer-hit {
    0% {
        transform: translate(-50%, -50%) rotate(0deg) scale(1);
    }
    20% {
        transform: translate(-50%, -50%) rotate(-30deg) scale(1.3);
    }
    40% {
        transform: translate(-50%, -50%) rotate(-60deg) scale(1.5);
    }
    70% {
        transform: translate(-50%, -50%) rotate(-20deg) scale(1.2);
    }
    100% {
        transform: translate(-50%, -50%) rotate(0deg) scale(1);
    }
}

@keyframes chainsaw-cut {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
    }
    25% {
        transform: translate(-52%, -48%) rotate(5deg);
    }
    50% {
        transform: translate(-50%, -52%) rotate(-5deg);
    }
    75% {
        transform: translate(-48%, -50%) rotate(3deg);
    }
    100% {
        transform: translate(-50%, -50%) rotate(0deg);
    }
}

@keyframes machinegun-fire {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
    }
    20% {
        transform: translate(-52%, -52%) rotate(2deg);
    }
    40% {
        transform: translate(-48%, -48%) rotate(-2deg);
    }
    60% {
        transform: translate(-50%, -52%) rotate(1deg);
    }
    80% {
        transform: translate(-52%, -50%) rotate(-1deg);
    }
    100% {
        transform: translate(-50%, -50%) rotate(0deg);
    }
}

@keyframes shell-eject {
    0% {
        transform: translate(0, 0) rotate(0deg);
        opacity: 1;
    }
    20% {
        transform: translate(10px, -15px) rotate(45deg);
        opacity: 1;
    }
    100% {
        transform: translate(30px, 30px) rotate(360deg);
        opacity: 0;
    }
}

@keyframes flash {
    0% {
        opacity: 1;
        transform: scale(0.5);
    }
    50% {
        opacity: 1;
        transform: scale(1.2);
    }
    100% {
        opacity: 0;
        transform: scale(1);
    }
}

@keyframes fall-rotate {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100px) rotate(360deg);
        opacity: 0;
    }
}

/* 设置面板样式 */
#settings-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 300px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    z-index: 20;
}

#settings-panel.hidden {
    display: none;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background-color: #1a0058;
    color: white;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}

.close-btn {
    font-size: 24px;
    cursor: pointer;
}

.panel-body {
    padding: 15px;
}

.setting-item {
    margin-bottom: 15px;
}

.setting-item label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.setting-item input, .setting-item select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

/* 碎玻璃动画样式 */
.glass-shard {
    position: absolute;
    width: 10px;
    height: 10px;
    background-color: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.9);
    pointer-events: none;
    z-index: 3;
    animation: fall-rotate 1s ease-in forwards;
}

/* 铅笔绘制点和线 */
.pencil-dot {
    position: absolute;
    width: 5px;
    height: 5px;
    background-color: #000;
    border-radius: 50%;
    pointer-events: none;
    z-index: 3;
}

.pencil-line {
    position: absolute;
    background-color: #000;
    height: 3px;
    transform-origin: left center;
    pointer-events: none;
    z-index: 3;
}

.chainsaw-vibrate {
    animation: chainsaw-vibration 0.1s linear infinite;
}

@keyframes chainsaw-vibration {
    0% {
        transform: translate(-50%, -50%) rotate(-2deg);
    }
    25% {
        transform: translate(-51%, -49%) rotate(0deg);
    }
    50% {
        transform: translate(-50%, -50%) rotate(2deg);
    }
    75% {
        transform: translate(-49%, -51%) rotate(0deg);
    }
    100% {
        transform: translate(-50%, -50%) rotate(-2deg);
    }
}

/* 木头碎屑样式 */
.wood-chip {
    position: absolute;
    width: 6px;
    height: 6px;
    background-color: #8B4513;
    border-radius: 2px;
    pointer-events: none;
    z-index: 3;
    animation: wood-fall 1s ease-in forwards;
}

.wood-chip.small {
    width: 3px;
    height: 3px;
    background-color: #A0522D;
}

.wood-chip.medium {
    width: 5px;
    height: 5px;
    background-color: #8B4513;
}

.wood-chip.large {
    width: 7px;
    height: 7px;
    background-color: #6B2A00;
}

@keyframes wood-fall {
    0% {
        transform: translate(0, 0) rotate(0deg);
        opacity: 1;
    }
    25% {
        opacity: 1;
    }
    100% {
        transform: translate(0, 100px) rotate(720deg);
        opacity: 0;
    }
}

/* 真实子弹 */
.bullet {
    position: absolute;
    width: 5px;
    height: 15px;
    background: linear-gradient(to bottom, #FFD700 0%, #B8860B 60%, #8B4513 100%);
    border-top-left-radius: 2px;
    border-top-right-radius: 2px;
    pointer-events: none;
    z-index: 4;
    transform-origin: center;
}

.bullet::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 30%;
    background-color: #B22222;
    border-top-left-radius: 2px;
    border-top-right-radius: 2px;
}

/* 真实子弹壳 */
.real-bullet-shell {
    position: absolute;
    width: 6px;
    height: 12px;
    background: linear-gradient(to bottom, #FFD700 0%, #DAA520 70%, #B8860B 100%);
    border-radius: 1px;
    box-shadow: inset 0 0 2px rgba(0,0,0,0.3);
    pointer-events: none;
    z-index: 4;
    transform-origin: center;
}

.real-bullet-shell::after {
    content: '';
    position: absolute;
    top: 1px;
    left: 50%;
    transform: translateX(-50%);
    width: 3px;
    height: 3px;
    background-color: #B22222;
    border-radius: 50%;
}

.machinegun-vibrate {
    animation: machinegun-vibration 0.05s linear infinite;
}

@keyframes machinegun-vibration {
    0% {
        transform: translate(-50%, -50%) rotate(-1deg);
    }
    25% {
        transform: translate(-51%, -49%) rotate(0deg);
    }
    50% {
        transform: translate(-50%, -50%) rotate(1deg);
    }
    75% {
        transform: translate(-49%, -51%) rotate(0deg);
    }
    100% {
        transform: translate(-50%, -50%) rotate(-1deg);
    }
} 