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

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

.game-container {
    text-align: center;
    padding: 20px;
}

h1 {
    color: #ff6b6b;
    font-size: 2.5rem;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

/* 难度选择 */
.difficulty-selector {
    margin-bottom: 20px;
}

.difficulty-selector label {
    font-size: 1.2rem;
    color: #555;
    margin-right: 10px;
}

.diff-btn {
    padding: 8px 20px;
    margin: 0 5px;
    border: none;
    border-radius: 20px;
    font-size: 1rem;
    cursor: pointer;
    background: #ddd;
    color: #555;
    transition: all 0.3s;
}

.diff-btn:hover {
    background: #ccc;
}

.diff-btn.active {
    background: #ff6b6b;
    color: white;
}

/* 自定义难度输入 */
.custom-difficulty {
    display: none;
    margin: 15px 0;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 15px;
    animation: fadeIn 0.3s ease;
}

.custom-difficulty.active {
    display: inline-block;
}

.custom-difficulty label {
    font-size: 1.1rem;
    color: #555;
}

.custom-difficulty input {
    width: 60px;
    padding: 5px 10px;
    margin: 0 5px;
    border: 2px solid #ff6b6b;
    border-radius: 10px;
    font-size: 1rem;
    text-align: center;
    outline: none;
}

.custom-difficulty input:focus {
    border-color: #2193b0;
    box-shadow: 0 0 5px rgba(33, 147, 176, 0.5);
}

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

/* 游戏区域 */
.game-area {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 20px;
    min-height: 400px;
    margin: 20px 0;
}

/* 小熊 */
.bear {
    position: relative;
    width: 120px;
    height: 140px;
}

.bear-face {
    width: 120px;
    height: 120px;
    background: #c4a484;
    border-radius: 50% 50% 45% 45%;
    position: relative;
    box-shadow: inset -10px -10px 20px rgba(0, 0, 0, 0.1);
}

.bear-ear {
    width: 40px;
    height: 40px;
    background: #c4a484;
    border-radius: 50%;
    position: absolute;
    top: 0;
}

.bear-ear.left {
    left: 5px;
}

.bear-ear.right {
    right: 5px;
}

.bear-ear::after {
    content: '';
    width: 24px;
    height: 24px;
    background: #e8d4c4;
    border-radius: 50%;
    position: absolute;
    top: 8px;
    left: 8px;
}

.bear-eye {
    width: 16px;
    height: 16px;
    background: #333;
    border-radius: 50%;
    position: absolute;
    top: 35px;
}

.bear-eye.left {
    left: 25px;
}

.bear-eye.right {
    right: 25px;
}

.bear-eye::after {
    content: '';
    width: 5px;
    height: 5px;
    background: white;
    border-radius: 50%;
    position: absolute;
    top: 3px;
    left: 3px;
}

.bear-nose {
    width: 25px;
    height: 18px;
    background: #333;
    border-radius: 50%;
    position: absolute;
    top: 55px;
    left: 50%;
    transform: translateX(-50%);
}

.bear-mouth {
    width: 20px;
    height: 15px;
    border: 3px solid #333;
    border-top: none;
    border-radius: 0 0 50% 50%;
    position: absolute;
    top: 75px;
    left: 50%;
    transform: translateX(-50%);
    transition: all 0.2s;
}

/* 吹气状态的嘴巴 */
.bear.blowing .bear-mouth {
    width: 18px;
    height: 18px;
    background: #333;
    border-radius: 50%;
    border: none;
}

.bear-cheek {
    width: 20px;
    height: 12px;
    background: rgba(255, 150, 150, 0.5);
    border-radius: 50%;
    position: absolute;
    top: 65px;
}

.bear-cheek.left {
    left: 10px;
}

.bear-cheek.right {
    right: 10px;
}

/* 气球容器 */
.balloon-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    min-height: 350px;
    position: relative;
}

/* 气球 */
.balloon {
    --balloon-size: 50px;
    width: var(--balloon-size);
    height: calc(var(--balloon-size) * 1.2);
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a5a 50%, #cc4444 100%);
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    position: relative;
    transition: width 0.1s, height 0.1s;
    box-shadow: inset -15px -15px 30px rgba(0, 0, 0, 0.2),
                inset 10px 10px 20px rgba(255, 255, 255, 0.3);
}

.balloon::before {
    content: '';
    width: 30%;
    height: 30%;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    position: absolute;
    top: 15%;
    left: 20%;
}

.balloon-knot {
    width: 15px;
    height: 15px;
    background: #cc4444;
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
}

.balloon-string {
    width: 2px;
    height: 60px;
    background: #888;
    position: absolute;
    bottom: -68px;
    left: 50%;
    transform: translateX(-50%);
}

/* 气球爆炸效果 */
.balloon.popped {
    animation: pop 0.15s ease-out forwards;
}

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

/* 爆炸容器 */
.explosion-container {
    position: absolute;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

/* 气球碎片 - 橡胶质感 */
.balloon-piece {
    position: absolute;
    border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
    opacity: 0.9;
    animation: piece-explode 1.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
    box-shadow: inset -3px -3px 8px rgba(0, 0, 0, 0.2),
                inset 2px 2px 5px rgba(255, 255, 255, 0.3);
}

@keyframes piece-explode {
    0% {
        transform: translate(0, 0) rotate(0deg) scale(1);
        opacity: 1;
    }
    30% {
        transform: translate(var(--mid-x), var(--mid-y)) rotate(var(--rotation)) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(var(--end-x), var(--end-y)) rotate(calc(var(--rotation) * 2)) scale(0.5);
        opacity: 0;
    }
}

/* 冲击波效果 */
.shockwave {
    position: absolute;
    width: 20px;
    height: 20px;
    border: 4px solid rgba(255, 107, 107, 0.8);
    border-radius: 50%;
    animation: shockwave-expand 0.8s ease-out forwards;
}

@keyframes shockwave-expand {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(15);
        opacity: 0;
    }
}

/* 彩色纸屑 - 基础样式 */
.confetti {
    position: absolute;
    width: 12px;
    height: 12px;
    animation: confetti-burst 2.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
    z-index: 10;
}

.confetti-circle {
    border-radius: 50%;
}

.confetti-square {
    border-radius: 2px;
}

.confetti-triangle {
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 12px solid currentColor;
    background: none !important;
}

.confetti-star {
    clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
}

@keyframes confetti-burst {
    0% {
        transform: translate(0, 0) rotate(0deg) scale(1);
        opacity: 1;
    }
    20% {
        transform: translate(var(--x), var(--y)) rotate(calc(var(--rotation) * 0.3)) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(var(--x), calc(var(--y) + var(--fall))) rotate(var(--rotation)) scale(0.3);
        opacity: 0;
    }
}

/* 闪光星星 */
.sparkle {
    position: absolute;
    width: 8px;
    height: 8px;
    background: #fff;
    clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
    animation: sparkle-burst 1s ease-out forwards;
    z-index: 20;
}

@keyframes sparkle-burst {
    0% {
        transform: translate(0, 0) scale(0) rotate(0deg);
        opacity: 1;
    }
    50% {
        transform: translate(var(--x), var(--y)) scale(1.5) rotate(180deg);
        opacity: 1;
    }
    100% {
        transform: translate(var(--x), var(--y)) scale(0) rotate(360deg);
        opacity: 0;
    }
}

/* 状态区域 */
.status {
    margin-top: 20px;
}

.instruction {
    font-size: 1.2rem;
    color: #555;
    margin-bottom: 15px;
}

.start-btn {
    padding: 15px 40px;
    font-size: 1.3rem;
    background: linear-gradient(135deg, #6dd5ed 0%, #2193b0 100%);
    color: white;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 15px rgba(33, 147, 176, 0.4);
}

.start-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(33, 147, 176, 0.5);
}

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

/* 音量指示器 */
.volume-meter {
    width: 200px;
    height: 20px;
    background: #ddd;
    border-radius: 10px;
    margin: 20px auto;
    overflow: hidden;
    display: none;
}

.volume-meter.active {
    display: block;
}

.volume-bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #6dd5ed, #2193b0);
    border-radius: 10px;
    transition: width 0.05s;
}

.progress-text {
    font-size: 1.1rem;
    color: #555;
    display: none;
}

.progress-text.active {
    display: block;
}

/* 成功消息 */
.success-message {
    font-size: 2rem;
    color: #ff6b6b;
    animation: bounce 0.5s ease infinite;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}
