html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    position: fixed;
}

body {
    min-height: 100vh;
    min-height: -webkit-fill-available;
    background: linear-gradient(135deg, #ffafbd, #ffc3a0);
    background-size: 400% 400%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: Arial, sans-serif;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    animation: gradient 15s ease infinite;
    -webkit-animation: gradient 15s ease infinite;
}

/* 修复 iOS Safari 100vh 问题 */
@supports (-webkit-touch-callout: none) {
    body {
        min-height: -webkit-fill-available;
        background: -webkit-linear-gradient(135deg, #ffafbd, #ffc3a0);
        -webkit-background-size: 400% 400%;
    }
}

@-webkit-keyframes gradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes gradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.container {
    width: 100%;
    height: 100%;
    position: relative;
    max-width: 100vw;
    margin: 0 auto;
    overflow: hidden;
}

.playground {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.balloon, .star, .animal {
    position: absolute;
    cursor: pointer;
    transition: transform 0.3s ease;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    z-index: 1;
}

.balloon {
    font-size: clamp(2.5rem, 8vmin, 4rem);
    animation: float 3s infinite ease-in-out;
}

.star {
    font-size: clamp(2rem, 6vmin, 3rem);
    animation: twinkle 2s infinite ease-in-out;
}

.animal {
    font-size: clamp(2.5rem, 8vmin, 4rem);
    animation: bounce 2s infinite ease-in-out;
}

.achievements {
    position: fixed;
    top: max(10px, 2vh);
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: clamp(10px, 3vw, 20px);
    background: rgba(255, 255, 255, 0.2);
    padding: clamp(5px, 2vw, 10px) clamp(10px, 3vw, 20px);
    border-radius: 20px;
    backdrop-filter: blur(5px);
    z-index: 2;
    font-size: clamp(1rem, 4vmin, 1.5rem);
}

.achievement {
    color: white;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3);
}

.music-toggle {
    position: fixed;
    bottom: max(10px, 2vh);
    right: max(10px, 2vh);
    width: clamp(40px, 10vmin, 50px);
    height: clamp(40px, 10vmin, 50px);
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(5px);
    font-size: clamp(1.2rem, 4vmin, 1.5rem);
    cursor: pointer;
    transition: transform 0.3s ease;
    z-index: 2;
}

.music-toggle:hover {
    transform: scale(1.1);
}

.music-toggle.active {
    background: rgba(255, 255, 255, 0.4);
}

#particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.particle {
    position: absolute;
    pointer-events: none;
    animation: particle-animation 1s ease-out forwards;
}

@keyframes particle-animation {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 0;
    }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

@keyframes twinkle {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.8; }
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes achievement-popup {
    0% { transform: scale(0); opacity: 0; }
    50% { transform: scale(1.2); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

/* 移动端适配的位置调整 - 使用视口单位 */
@media (max-width: 768px) {
    #balloon1 { top: 10vh; left: 15vw; }
    #balloon2 { top: 20vh; left: 45vw; }
    #balloon3 { top: 15vh; left: 75vw; }

    #star1 { top: 35vh; left: 30vw; }
    #star2 { top: 40vh; left: 70vw; }

    #animal1 { bottom: 20vh; left: 10vw; }
    #animal2 { bottom: 30vh; left: 30vw; }
    #animal3 { bottom: 25vh; left: 50vw; }
    #animal4 { bottom: 20vh; left: 70vw; }
    #animal5 { bottom: 30vh; left: 85vw; }
    #animal6 { bottom: 35vh; left: 40vw; }
}

/* 桌面端位置 - 使用视口单位 */
@media (min-width: 769px) {
    #balloon1 { top: 15vh; left: 20vw; }
    #balloon2 { top: 25vh; left: 50vw; }
    #balloon3 { top: 20vh; left: 80vw; }

    #star1 { top: 10vh; left: 35vw; }
    #star2 { top: 35vh; left: 65vw; }

    #animal1 { bottom: 15vh; left: 15vw; }
    #animal2 { bottom: 25vh; left: 35vw; }
    #animal3 { bottom: 20vh; left: 55vw; }
    #animal4 { bottom: 30vh; left: 75vw; }
    #animal5 { bottom: 15vh; left: 90vw; }
    #animal6 { bottom: 35vh; left: 45vw; }
}

/* 横屏模式优化 */
@media (orientation: landscape) and (max-height: 500px) {
    .balloon { font-size: clamp(2rem, 6vmin, 3rem); }
    .star { font-size: clamp(1.5rem, 5vmin, 2.5rem); }
    .animal { font-size: clamp(2rem, 6vmin, 3rem); }
    
    .achievements {
        top: 5px;
        transform: translateX(-50%) scale(0.8);
    }
    
    .music-toggle {
        width: 35px;
        height: 35px;
        font-size: 1.2rem;
    }
} 