:root {
    --bg-color: #ffe6ea;
    /* Light pastel pink background */
    --pattern-color: #ffffff;

    --text-pink: #e91e63;
    --text-blue: #00bcd4;
    --text-teal: #009688;

    --cloud-white: #ffffff;
    --cloud-border: #b3e5fc;
}

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

body {
    font-family: 'Indie Flower', cursive;
    background-color: var(--bg-color);
    /* Quatrefoil-ish pattern approximation */
    background-image:
        radial-gradient(circle, transparent 20%, var(--bg-color) 20%, var(--bg-color) 80%, transparent 80%, transparent),
        radial-gradient(circle, transparent 20%, var(--bg-color) 20%, var(--bg-color) 80%, transparent 80%, transparent);
    background-size: 30px 30px;
    background-position: 0 0, 15px 15px;
    background-color: var(--pattern-color);
    /* Actually better to just set bg color and use gradients for pattern */
    background:
        radial-gradient(circle, transparent 35%, var(--bg-color) 36%) 0 0,
        radial-gradient(circle, transparent 35%, var(--bg-color) 36%) 25px 25px,
        radial-gradient(circle, transparent 35%, var(--bg-color) 36%) 0 50px;
    background-size: 50px 50px;
    background-color: #ffffff;

    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-x: hidden;
    position: relative;
    color: var(--text-teal);
}



/* Inner cut text area */

/* Main Container */
.container {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 600px;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 120px;
    /* Space for rainbow */
    text-align: center;
}

/* Clouds */
.cloud-wrapper {
    position: relative;
    width: 320px;
    height: 100px;
    background: white;
    border-radius: 100px;
    margin-bottom: 2rem;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
    /* This creates a unified shadow around the composite shape */
    filter: drop-shadow(0 10px 10px rgba(179, 229, 252, 0.5));
}

.cloud-wrapper::before,
.cloud-wrapper::after {
    content: '';
    position: absolute;
    background: white;
    border-radius: 50%;
    z-index: -1;
}

.cloud-wrapper::before {
    width: 140px;
    height: 140px;
    top: -60px;
    left: 40px;
}

.cloud-wrapper::after {
    width: 160px;
    height: 160px;
    top: -80px;
    right: 40px;
}

/* Title text inside cloud */
.title-content {
    position: relative;
    z-index: 10;
    transform: translateY(-25px);
    /* Ajuste para centrar visualmente en la nube */
}

.main-title {
    font-family: 'Pacifico', cursive;
    font-size: 3.5rem;
    color: var(--text-pink);
    line-height: 1.2;
    text-shadow: 2px 2px 0px white;
    margin-bottom: -10px;
}

.sub-title {
    font-family: 'Fredoka One', cursive;
    /* Using Montserrat if Fredoka doesn't load well, but imported Fredoka */
    font-size: 1.5rem;
    color: var(--text-blue);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Invitation Text */
.invitation-text {
    margin-top: 2rem;
    font-size: 1.3rem;
    line-height: 1.5;
    font-weight: 600;
}

.highlight-text {
    margin-top: 1rem;
    color: var(--text-pink);
    font-size: 1.4rem;
}



/* Bears Footer */
.bears-container {
    margin-top: auto;
    /* Push to bottom */
    width: 100%;
    max-width: 600px;
    height: 250px;
    /* Space for images */
    position: relative;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    padding-bottom: 20px;
    z-index: 5;
}

.bear {
    height: auto;
    filter: drop-shadow(0 5px 10px rgba(0, 0, 0, 0.2));
    transition: transform 0.3s ease;
}

.bear:hover {
    transform: translateY(-10px);
}

.bear-left {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 320px;
    z-index: 100;
    transform: none;
    margin: 0;
}



/* Stars */
.star {
    position: absolute;
    color: #ffd700;
    /* Gold */
    font-size: 2rem;
    animation: twinkle 3s infinite ease-in-out;
    z-index: 0;
}

.star-1 {
    top: 15%;
    left: 10%;
    animation-delay: 0s;
    font-size: 2.5rem;
}

.star-2 {
    top: 25%;
    right: 15%;
    animation-delay: 1s;
}

.star-3 {
    top: 50%;
    left: 15%;
    animation-delay: 0.5s;
    color: #ffeb3b;
}

.star-4 {
    top: 60%;
    right: 10%;
    animation-delay: 1.5s;
    font-size: 1.5rem;
}

.star-5 {
    top: 10%;
    right: 30%;
    animation-delay: 2s;
    font-size: 1.2rem;
}

@keyframes twinkle {

    0%,
    100% {
        opacity: 0.6;
        transform: scale(1) rotate(0deg);
    }

    50% {
        opacity: 1;
        transform: scale(1.2) rotate(20deg);
    }
}



/* Responsive */
@media (max-width: 480px) {
    .cloud-wrapper {
        width: 280px;
        height: 160px;
    }

    .main-title {
        font-size: 3rem;
    }


    .bears-container {
        height: 200px;
    }

    .bear-left {
        width: 200px;
    }


}

/* Nuevo estilo para el contenedor de la imagen superpuesta */
/* Nuevo estilo para el contenedor de la imagen superpuesta */
.overlay-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    /* Centrado fluido */
    background-color: white;
    /* Div blanco */
    padding: 30px;
    /* Espacio amplio */
    border-radius: 20px;
    /* Esquinas redondeadas suaves */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    /* Sombra elegante */
    z-index: 2000;
    /* Siempre encima */
    display: flex;
    flex-direction: column;
    /* Columna */
    justify-content: center;
    align-items: center;
    width: auto;
    height: 90vh;
    /* Altura del 90% de la ventana */
    max-width: 90vw;
}

.overlay-title {
    font-family: 'Pacifico', cursive;
    color: var(--text-pink);
    font-size: 2rem;
    text-align: center;
    margin-bottom: 15px;
    line-height: 1.2;
}

.bear-overlay {
    flex: 1;
    /* Ocupar espacio libre */
    min-height: 0;
    /* Permitir encoger */
    width: auto;
    height: auto;
    max-width: 100%;
    object-fit: contain;
    /* Mantener proporciones */
    border-radius: 10px;
    display: block;
    margin-bottom: 20px;
}

.age-input {
    padding: 10px 15px;
    font-size: 1.5rem;
    border: 2px solid var(--cloud-border);
    border-radius: 50px;
    /* Estilo píldora */
    text-align: center;
    width: 120px;
    font-family: 'Fredoka One', cursive;
    color: var(--text-teal);
    outline: none;
    transition: border-color 0.3s;
}

.age-input:focus {
    border-color: var(--text-pink);
}

/* Ocultar flechas del input number */
.age-input::-webkit-outer-spin-button,
.age-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.error-msg {
    color: #ff5722;
    font-size: 1.2rem;
    font-family: 'Fredoka One', cursive;
    margin-top: 10px;
    animation: shake 0.5s;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    10%,
    30%,
    50%,
    70%,
    90% {
        transform: translateX(-5px);
    }

    20%,
    40%,
    60%,
    80% {
        transform: translateX(5px);
    }
}

/* Ajuste responsive para la superposición */
@media (max-width: 600px) {
    .overlay-container {
        padding: 15px;
        width: 90%;
    }

    .bear-overlay {
        width: 100%;
        /* La imagen ocupa el ancho disponible */
    }
}

/* Clase para ocultar elementos (se usará con JS) */
.hidden {
    display: none !important;
}

/* El gruñonsito de la esquina empieza oculto, pero lo controlaremos con JS */
.bear-left {
    /* Clases auxiliares controlan la visibilidad */
    transition: transform 0.3s ease;
}

@keyframes popIn {
    0% {
        transform: scale(0) translateY(100px);
        opacity: 0;
    }

    60% {
        transform: scale(1.1) translateY(-10px);
    }

    100% {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

/* Confetti Styles */
.confetti {
    position: fixed;
    width: 10px;
    height: 10px;
    border-radius: 2px;
    z-index: 1500;
    pointer-events: none;
    animation: fall linear forwards;
}

@keyframes fall {
    to {
        transform: translateY(120vh) rotate(720deg);
    }
}

/* Music Control Button */
.music-controls {
    margin-top: 2rem;
    display: flex;
    justify-content: center;
}

.play-btn {
    background-color: var(--text-pink);
    color: white;
    font-family: 'Fredoka One', cursive;
    border: none;
    padding: 10px 20px;
    font-size: 1.2rem;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(233, 30, 99, 0.4);
    transition: transform 0.2s, background-color 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}

.play-btn:hover {
    transform: scale(1.05);
    background-color: #d81b60;
}

.play-btn:active {
    transform: scale(0.95);
}

.play-btn.playing {
    background-color: var(--text-teal);
    box-shadow: 0 4px 15px rgba(0, 150, 136, 0.4);
}

/* Cursor Sparkle Effect */
.sparkle {
    position: absolute;
    pointer-events: none;
    z-index: 9999;
    font-size: 1.2rem;
    animation: sparkleAnim 1s ease-out forwards;
    user-select: none;
}

@keyframes sparkleAnim {
    0% {
        transform: scale(0) rotate(0deg);
        opacity: 1;
    }

    100% {
        transform: scale(1.5) rotate(180deg) translateY(-30px);
        opacity: 0;
    }
}