:root {
    --bg-gradient: linear-gradient(135deg, #fdfbfb 0%, #ebedee 100%);
    --soft-pink: #ffdae9;
    --soft-lavender: #e6e6fa;
    --deep-pink: #ff9ec3;
    --text-color: #555;
    --white-trans: rgba(255, 255, 255, 0.8);
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Outfit', sans-serif;
    background: linear-gradient(to bottom, #ffe2e2, #e2e2ff);
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    color: var(--text-color);
}

.container {
    width: 100%;
    max-width: 500px;
    height: 100%;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.scene {
    position: absolute;
    width: 100%;
    transition: opacity 1s ease-in-out;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.hidden {
    opacity: 0;
    pointer-events: none;
    z-index: -1;
}

.active {
    opacity: 1;
    pointer-events: all;
    z-index: 10;
}

/* Music Button */
.music-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.5);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 20px;
    cursor: pointer;
    z-index: 100;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* CSS Flower */
.flower-container {
    height: 300px;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    position: relative;
    cursor: pointer;
    transition: transform 0.5s ease;
}

.flower-container:hover {
    transform: scale(1.05);
}

.flower-wrapper {
    position: relative;
    width: 60px;
    /* Stem width base reference */
    height: 100%;
    display: flex;
    justify-content: center;
}

/* Stem */
.stem {
    width: 8px;
    height: 200px;
    background: linear-gradient(to right, #88d498, #6bb97b);
    border-radius: 4px;
    position: absolute;
    bottom: 0;
    z-index: 1;
}

/* Leaves */
.leaf {
    position: absolute;
    bottom: 80px;
    width: 40px;
    height: 20px;
    background: linear-gradient(135deg, #a8e6cf, #88d498);
    border-radius: 0 50% 0 50%;
    z-index: 0;
    transform-origin: 0 50%;
    transition: transform 1s ease-in-out;
}

.leaf-left {
    left: 20px;
    /* Center relative */
    transform: rotate(-120deg) scale(0.5);
    /* Bud state */
    border-radius: 50% 0 50% 0;
    transform-origin: 100% 50%;
    left: -32px;
}

.leaf-right {
    left: 30px;
    transform: rotate(120deg) scale(0.5);
    /* Bud state */
    transform-origin: 0% 50%;
}

/* Flower Head (Container for Petals) */
.flower-head {
    position: absolute;
    bottom: 190px;
    width: 0;
    height: 0;
    z-index: 2;
    transition: transform 1.5s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}

.petal {
    position: absolute;
    width: 50px;
    height: 80px;
    background: linear-gradient(to bottom, #ffc3a0, #ffafbd);
    /* Pastel Peach to Pink */
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    bottom: 0;
    left: -25px;
    /* Center horizontally */
    transform-origin: bottom center;
    box-shadow: 0 4px 10px rgba(255, 175, 189, 0.5);
    transition: all 1.5s ease-in-out;
    opacity: 0.9;
}

.center {
    position: absolute;
    width: 30px;
    height: 30px;
    background: #ffeb99;
    /* Soft Yellow */
    border-radius: 50%;
    bottom: -15px;
    left: -15px;
    z-index: 10;
    box-shadow: 0 0 10px rgba(255, 235, 153, 0.8);
    transform: scale(0);
    transition: transform 1s 0.5s ease;
}

/* Bud State (Default) */
.petal {
    transform: rotate(0deg) scale(0.5) translateY(10px);
    background: linear-gradient(to bottom, #ff9a9e, #fecfef);
    /* Darker pink for bud */
}

/* Blooms State */
.flower-wrapper.bloom .stem {
    height: 220px;
    transition: height 1.5s ease;
}

.flower-wrapper.bloom .leaf-left {
    transform: rotate(-30deg) scale(1);
}

.flower-wrapper.bloom .leaf-right {
    transform: rotate(30deg) scale(1);
}

.flower-wrapper.bloom .center {
    transform: scale(1);
}

.flower-wrapper.bloom .petal {
    background: linear-gradient(to bottom, #ffe2e2, #ffcad4);
    /* Lighter pastel on bloom */
}

.flower-wrapper.bloom .p1 {
    transform: rotate(0deg) translateY(-20px) scale(1);
}

.flower-wrapper.bloom .p2 {
    transform: rotate(60deg) translateY(-20px) scale(1);
}

.flower-wrapper.bloom .p3 {
    transform: rotate(120deg) translateY(-20px) scale(1);
}

.flower-wrapper.bloom .p4 {
    transform: rotate(180deg) translateY(-20px) scale(1);
}

.flower-wrapper.bloom .p5 {
    transform: rotate(240deg) translateY(-20px) scale(1);
}

.flower-wrapper.bloom .p6 {
    transform: rotate(300deg) translateY(-20px) scale(1);
}

/* Glow on bloom */
.flower-wrapper.bloom .flower-head {
    filter: drop-shadow(0 0 20px rgba(255, 192, 203, 0.8));
}

.instruction-text {
    margin-top: 20px;
    font-size: 1.2rem;
    color: #888;
    animation: fadeIn 2s infinite alternate;
}

@keyframes fadeIn {
    from {
        opacity: 0.6;
    }

    to {
        opacity: 1;
    }
}

/* Floating Particles (CSS Only for simplicity, or JS for robust) */
.particle {
    position: absolute;
    background: white;
    border-radius: 50%;
    opacity: 0.8;
    pointer-events: none;
}

/* Scene 2 & Buttons */
.soft-btn {
    padding: 15px 30px;
    background-color: white;
    border: 2px solid var(--deep-pink);
    color: var(--deep-pink);
    border-radius: 30px;
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(255, 182, 193, 0.4);
    animation: pulse 2s infinite;
    font-family: 'Outfit', sans-serif;
    font-weight: 500;
    transition: all 0.3s ease;
}

.soft-btn:hover {
    background-color: var(--deep-pink);
    color: white;
    transform: translateY(-2px);
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 158, 195, 0.4);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(255, 158, 195, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(255, 158, 195, 0);
    }
}

/* Scene 3: Rabbit */
.floating-name {
    font-family: 'Dancing Script', cursive;
    font-size: 2rem;
    color: var(--deep-pink);
    margin-bottom: 20px;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-10px);
    }

    100% {
        transform: translateY(0px);
    }
}

.rabbit-container {
    position: relative;
    width: 250px;
    height: 250px;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* CSS Rabbit */
.rabbit-wrapper {
    position: relative;
    width: 200px;
    height: 200px;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.3s ease;
    cursor: pointer;
}

.ears {
    position: absolute;
    top: -40px;
    width: 100%;
    z-index: 0;
}

.ear {
    position: absolute;
    width: 50px;
    height: 120px;
    background: #fff;
    border: 4px solid #f0f0f0;
    /* Soft border */
    border-radius: 50% 50% 0 0;
    top: 0;
    box-shadow: inset 10px 10px 20px rgba(0, 0, 0, 0.05);
}

.ear::after {
    content: '';
    position: absolute;
    width: 25px;
    height: 80px;
    background: #ffdae9;
    /* Pink inner ear */
    border-radius: 50% 50% 0 0;
    top: 20px;
    left: 12px;
}

.ear.left {
    left: 40px;
    transform: rotate(-10deg);
}

.ear.right {
    right: 40px;
    transform: rotate(10deg);
}

.head {
    position: relative;
    width: 160px;
    height: 140px;
    background: #fff;
    border-radius: 50% 50% 45% 45%;
    z-index: 1;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: center;
}

.eyes {
    position: absolute;
    top: 50px;
    width: 100px;
    display: flex;
    justify-content: space-between;
}

.eye {
    width: 18px;
    height: 24px;
    background: #333;
    border-radius: 50%;
    position: relative;
    transition: all 0.3s;
}

.eye::after {
    /* Sparkle */
    content: '';
    position: absolute;
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
    top: 4px;
    left: 4px;
}

.cheeks {
    position: absolute;
    top: 70px;
    width: 120px;
    display: flex;
    justify-content: space-between;
}

.cheek {
    width: 30px;
    height: 20px;
    background: #ffdae9;
    border-radius: 50%;
    opacity: 0.5;
    filter: blur(2px);
}

.snout {
    position: absolute;
    bottom: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.nose {
    width: 12px;
    height: 8px;
    background: #ff9ec3;
    border-radius: 40%;
    margin-bottom: 5px;
}

.mouth {
    width: 20px;
    height: 10px;
    border-bottom: 2px solid #555;
    border-radius: 0 0 50% 50%;
    transition: all 0.3s;
}

.tears {
    position: absolute;
    top: 65px;
    width: 100px;
    display: flex;
    justify-content: space-between;
    opacity: 0;
    transition: opacity 0.3s;
}

.tear {
    width: 10px;
    height: 15px;
    background: #a2d9ff;
    border-radius: 50% 50% 40% 40%;
}

/* STATE: HAPPY */
.rabbit-wrapper.happy .eye {
    height: 10px;
    background: transparent;
    border-top: 3px solid #333;
    border-radius: 50% 50% 0 0;
    transform: translateY(5px);
}

.rabbit-wrapper.happy .eye::after {
    display: none;
}

.rabbit-wrapper.happy .cheeks {
    opacity: 0.8;
}

.rabbit-wrapper.happy .mouth {
    width: 25px;
    height: 15px;
    border-bottom: 3px solid #555;
}

/* STATE: CRYING / HURT */
.rabbit-wrapper.hurt .eye {
    background: #333;
    transform: rotate(0deg);
}

.rabbit-wrapper.hurt .mouth {
    width: 10px;
    height: 5px;
    border-top: 2px solid #555;
    border-bottom: none;
    border-radius: 50% 50% 0 0;
    margin-top: 5px;
}

.rabbit-wrapper.hurt .tears {
    opacity: 1;
}

.rabbit-wrapper.hurt .ear.left {
    transform: rotate(-25deg) translateY(10px);
}

.rabbit-wrapper.hurt .ear.right {
    transform: rotate(25deg) translateY(10px);
}

.shake {
    animation: shake 0.5s cubic-bezier(.36, .07, .19, .97) both;
}

@keyframes shake {

    10%,
    90% {
        transform: translate3d(-1px, 0, 0);
    }

    20%,
    80% {
        transform: translate3d(2px, 0, 0);
    }

    30%,
    50%,
    70% {
        transform: translate3d(-4px, 0, 0);
    }

    40%,
    60% {
        transform: translate3d(4px, 0, 0);
    }
}

.emoji-overlay {
    position: absolute;
    font-size: 3rem;
    pointer-events: none;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 0.5s;
}

.options-container {
    margin-top: 30px;
    display: flex;
    gap: 20px;
}

.tool-btn {
    font-size: 2rem;
    background: white;
    border: none;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s;
}

.tool-btn:hover {
    transform: scale(1.1);
}

.tool-selected {
    border: 3px solid var(--deep-pink);
    background-color: #fff0f5;
}

/* Scene 4: Final Message */
.message-paper {
    background: rgba(255, 255, 255, 0.9);
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    max-width: 80%;
    max-height: 80vh;
    overflow-y: auto;
    text-align: left;
}

.typewriter-text {
    font-family: 'Dancing Script', cursive;
    /* Handwritten feel */
    font-size: 1.5rem;
    line-height: 1.6;
    color: #444;
    white-space: pre-wrap;
    /* Preserve line breaks */
}

/* Responsive */
@media (max-width: 400px) {
    .flower-img {
        width: 150px;
    }

    .rabbit-img {
        width: 200px;
    }
}

/* Floating Hearts Animation Class */
.heart {
    position: absolute;
    color: red;
    font-size: 1.5rem;
    animation: floatUp 2s ease-out forwards;
}

@keyframes floatUp {
    0% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }

    100% {
        transform: translateY(-100px) scale(0.5);
        opacity: 0;
    }
}