:root {
    --bubu-white: #FFFFFF;
    --bubu-shadow: #E8E8E8;
    --bubu-ear: #8B4513;
    --bubu-cheek: #FFB6C1;
    --dudu-brown: #A0522D;
    --dudu-dark: #6B4423;
    --dudu-cheek: #FFD700;
    --heart-red: #FF4D6D;
    --glow-pink: rgba(255, 182, 193, 0.6);
    --glow-yellow: rgba(255, 215, 0, 0.4);
}

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

body {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f0f23 100%);
    font-family: 'Quicksand', sans-serif;
    overflow: hidden;
}

.container {
    width: 100%;
    max-width: 1000px;
    height: 100vh;
    max-height: 800px;
    position: relative;
    display: flex;
    flex-direction: column;
}

header {
    text-align: center;
    padding: 15px;
    z-index: 10;
}

.title {
    font-size: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    font-weight: 700;
    letter-spacing: 3px;
}

.title-bubu {
    color: var(--bubu-white);
    text-shadow: 0 0 20px var(--glow-pink), 0 0 40px var(--glow-pink);
}

.title-dudu {
    color: var(--dudu-brown);
    text-shadow: 0 0 20px var(--glow-yellow), 0 0 40px var(--glow-yellow);
}

.title-hug {
    font-size: 2rem;
    animation: hugPulse 1.2s ease-in-out infinite;
    filter: drop-shadow(0 0 10px rgba(255, 200, 150, 0.8));
}

@keyframes hugPulse {
    0%, 100% { transform: scale(1) rotate(0deg); }
    25% { transform: scale(1.1) rotate(-5deg); }
    50% { transform: scale(1.15) rotate(5deg); }
    75% { transform: scale(1.1) rotate(-5deg); }
}

.scene-container {
    flex: 1;
    position: relative;
    border-radius: 25px;
    overflow: hidden;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6),
                inset 0 0 60px rgba(255, 255, 255, 0.03);
}

#bg-canvas, #particle-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Characters Container */
.characters-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    gap: 60px;
    z-index: 5;
}

.blob-wrapper {
    position: relative;
    cursor: pointer;
}

.blob {
    width: 160px;
    height: 200px;
    position: relative;
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Squish/Jiggly Idle Animation */
.blob-svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 20px 30px rgba(0, 0, 0, 0.3));
    animation: squishIdle 2s ease-in-out infinite;
}

@keyframes squishIdle {
    0%, 100% {
        transform: scale(1, 1) translateY(0);
    }
    15% {
        transform: scale(1.03, 0.97) translateY(2px);
    }
    30% {
        transform: scale(0.97, 1.03) translateY(-3px);
    }
    45% {
        transform: scale(1.02, 0.98) translateY(1px);
    }
    60% {
        transform: scale(0.98, 1.02) translateY(-2px);
    }
    75% {
        transform: scale(1.01, 0.99) translateY(0);
    }
}

#bubu .blob-svg {
    animation-delay: 0s;
}

#dudu .blob-svg {
    animation-delay: 0.5s;
}

/* Arm wiggling */
#bubu-arm-left, #dudu-arm-left {
    animation: armWiggleLeft 1.5s ease-in-out infinite;
    transform-origin: top center;
}

#bubu-arm-right, #dudu-arm-right {
    animation: armWiggleRight 1.5s ease-in-out infinite;
    transform-origin: top center;
    animation-delay: 0.2s;
}

@keyframes armWiggleLeft {
    0%, 100% { transform: rotate(-20deg) translateY(0); }
    50% { transform: rotate(-25deg) translateY(3px); }
}

@keyframes armWiggleRight {
    0%, 100% { transform: rotate(20deg) translateY(0); }
    50% { transform: rotate(25deg) translateY(3px); }
}

/* Hover effects */
.blob-wrapper:hover .blob {
    transform: scale(1.1) translateY(-10px);
}

.blob-wrapper:hover .blob-svg {
    animation: squishExcited 0.3s ease-in-out infinite;
}

@keyframes squishExcited {
    0%, 100% { transform: scale(1.05, 0.95); }
    50% { transform: scale(0.95, 1.05); }
}

/* Gesture Animations */

/* Kiss */
.blob.kiss .blob-svg {
    animation: kissSquish 1.5s ease-in-out forwards;
}

#bubu-wrapper.kissing {
    animation: kissMoveLeft 1.5s ease-in-out forwards;
}

#dudu-wrapper.kissing {
    animation: kissMoveRight 1.5s ease-in-out forwards;
}

@keyframes kissMoveLeft {
    0% { transform: translateX(0); }
    30% { transform: translateX(70px) scaleX(0.9); }
    60% { transform: translateX(70px) scaleX(0.85); }
    100% { transform: translateX(0); }
}

@keyframes kissMoveRight {
    0% { transform: translateX(0); }
    30% { transform: translateX(-70px) scaleX(0.9); }
    60% { transform: translateX(-70px) scaleX(0.85); }
    100% { transform: translateX(0); }
}

@keyframes kissSquish {
    0%, 100% { transform: scale(1, 1); }
    30%, 60% { transform: scale(1.1, 0.85); }
}

/* Hug */
#bubu-wrapper.hugging {
    animation: hugSquishLeft 1.5s ease-in-out forwards;
}

#dudu-wrapper.hugging {
    animation: hugSquishRight 1.5s ease-in-out forwards;
}

@keyframes hugSquishLeft {
    0% { transform: translateX(0); }
    20% { transform: translateX(55px) scaleX(0.7); }
    50% { transform: translateX(55px) scaleX(0.6); }
    80% { transform: translateX(55px) scaleX(0.7); }
    100% { transform: translateX(0); }
}

@keyframes hugSquishRight {
    0% { transform: translateX(0); }
    20% { transform: translateX(-55px) scaleX(0.7); }
    50% { transform: translateX(-55px) scaleX(0.6); }
    80% { transform: translateX(-55px) scaleX(0.7); }
    100% { transform: translateX(0); }
}

/* Wave */
.blob.wave .blob-svg {
    animation: waveBounce 0.4s ease-in-out 3;
}

#bubu-wrapper.waving .blob-svg,
#dudu-wrapper.waving .blob-svg {
    animation: waveSquish 0.4s ease-in-out 3;
}

@keyframes waveSquish {
    0%, 100% { transform: translateX(0) rotate(0deg); }
    25% { transform: translateX(-5px) rotate(-5deg); }
    75% { transform: translateX(5px) rotate(5deg); }
}

#bubu-wrapper.waving #bubu-arm-right,
#dudu-wrapper.waving #dudu-arm-right {
    animation: waveArm 0.15s ease-in-out 8;
}

@keyframes waveArm {
    0%, 100% { transform: rotate(20deg); }
    50% { transform: rotate(-30deg); }
}

/* Chat - happy jiggle */
.blob.chat .blob-svg {
    animation: chatJiggle 0.2s ease-in-out 10;
}

@keyframes chatJiggle {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    25% { transform: translateY(-8px) rotate(-3deg); }
    75% { transform: translateY(-4px) rotate(3deg); }
}

/* Dance */
#bubu-wrapper.dancing {
    animation: danceLeft 2s ease-in-out infinite;
}

#dudu-wrapper.dancing {
    animation: danceRight 2s ease-in-out infinite;
    animation-delay: 0.15s;
}

@keyframes danceLeft {
    0%, 100% { transform: translateY(0) rotate(-8deg); }
    25% { transform: translateY(-25px) rotate(8deg); }
    50% { transform: translateY(0) rotate(-8deg); }
    75% { transform: translateY(-15px) rotate(5deg); }
}

@keyframes danceRight {
    0%, 100% { transform: translateY(0) rotate(8deg); }
    25% { transform: translateY(-15px) rotate(-5deg); }
    50% { transform: translateY(0) rotate(8deg); }
    75% { transform: translateY(-25px) rotate(-8deg); }
}

#bubu-wrapper.dancing .blob-svg,
#dudu-wrapper.dancing .blob-svg {
    animation: danceSquish 0.5s ease-in-out infinite;
}

@keyframes danceSquish {
    0%, 100% { transform: scale(1.05, 0.95); }
    50% { transform: scale(0.95, 1.05); }
}

/* Speech Bubble */
.speech-bubble {
    position: absolute;
    top: 12%;
    left: 50%;
    transform: translateX(-50%) scale(0);
    background: linear-gradient(135deg, #fff, #FFF5F7);
    padding: 18px 30px;
    border-radius: 25px;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 15;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3),
                0 0 20px rgba(255, 107, 157, 0.2);
    min-width: 180px;
    text-align: center;
}

.speech-bubble::before {
    content: '';
    position: absolute;
    bottom: -18px;
    left: 50%;
    transform: translateX(-50%);
    border: 12px solid transparent;
    border-top-color: #fff;
    border-bottom: none;
}

.speech-bubble.show {
    opacity: 1;
    transform: translateX(-50%) scale(1);
    animation: bubbleFloat 2s ease-in-out infinite;
}

@keyframes bubbleFloat {
    0%, 100% { transform: translateX(-50%) scale(1) translateY(0); }
    50% { transform: translateX(-50%) scale(1) translateY(-5px); }
}

.bubble-content {
    font-size: 1.2rem;
    color: #444;
    font-weight: 600;
}

/* Gesture Panel */
.gesture-panel {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 20;
}

.gesture-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.gesture-btn {
    width: 55px;
    height: 55px;
    border-radius: 18px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(10px);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    justify-content: center;
}

.gesture-btn:hover {
    transform: scale(1.15) translateX(-5px);
    background: linear-gradient(135deg, rgba(255, 107, 157, 0.7), rgba(255, 142, 159, 0.7));
    border-color: var(--heart-red);
    box-shadow: 0 10px 25px rgba(255, 107, 157, 0.5);
}

.gesture-btn:active {
    transform: scale(0.9);
}

.btn-icon {
    font-size: 1.5rem;
}

.gesture-btn.active {
    background: linear-gradient(135deg, var(--heart-red), #FF758F);
    border-color: var(--heart-red);
    box-shadow: 0 0 25px rgba(255, 77, 109, 0.6);
    animation: btnPulse 1s ease-in-out infinite;
}

@keyframes btnPulse {
    0%, 100% { box-shadow: 0 0 15px rgba(255, 77, 109, 0.5); }
    50% { box-shadow: 0 0 35px rgba(255, 77, 109, 0.8); }
}

/* Sound Toggle */
.sound-toggle {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-size: 1.3rem;
}

.sound-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.sound-toggle.muted {
    opacity: 0.6;
}

/* Scene Selector */
.scene-selector {
    display: flex;
    justify-content: center;
    gap: 12px;
    padding: 15px;
    z-index: 10;
}

.scene-btn {
    width: 55px;
    height: 55px;
    border-radius: 15px;
    border: 2px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.08);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
}

.scene-btn:hover {
    transform: translateY(-8px);
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 107, 157, 0.5);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.3);
}

.scene-btn.active {
    background: linear-gradient(135deg, var(--heart-red), #FF8FAB);
    border-color: var(--heart-red);
    box-shadow: 0 8px 25px rgba(255, 77, 109, 0.4);
    transform: translateY(-5px);
}

/* Responsive */
@media (max-width: 800px) {
    .characters-container {
        gap: 30px;
    }
    
    .blob {
        width: 130px;
        height: 165px;
    }
    
    .gesture-panel {
        right: 10px;
    }
    
    .gesture-btn {
        width: 48px;
        height: 48px;
    }
}

@media (max-width: 550px) {
    .container {
        max-height: 100vh;
    }
    
    .title {
        font-size: 2rem;
        gap: 12px;
    }
    
    .characters-container {
        gap: 15px;
    }
    
    .blob {
        width: 100px;
        height: 130px;
    }
    
    .gesture-panel {
        top: auto;
        bottom: 90px;
        right: 50%;
        transform: translateX(50%);
    }
    
    .gesture-buttons {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        max-width: 250px;
    }
    
    .gesture-btn {
        width: 42px;
        height: 42px;
    }
    
    .scene-btn {
        width: 45px;
        height: 45px;
        font-size: 1.3rem;
    }
    
    .scene-selector {
        gap: 8px;
    }
}
