*{
    image-rendering: pixelated;
}


body{
    background:#111;
    display:flex;
    justify-content:center;
    align-items:center;
    height:100vh;
    font-family:Arial;
    overflow-y: hidden;
}

/* === Pokeball === */

.contenedor{
    text-align:center;
    position: absolute;
    top: calc(50% - 60px);
}

.pokebola{
    width:200px;
    height:200px;
    position:relative;
    cursor:pointer;
    left: calc(100% - 70%);
    top: 120px
}

.parte{
    width:200px;
    height:100px;
    left:0;
}

.pokebola.loveball .arriba{
    background: radial-gradient(
        circle at 35% 30%,
        #ff9ad1 0%,
        #ff4fa3 40%,
        #b30059 100%
    );
    border-radius: 200px 200px 0 0;
}

/* Corazón en la parte superior */
.pokebola.loveball .arriba::after{
    content:"❤";
    position:absolute;
    top:20px;
    left:50%;
    transform:translateX(-50%);
    font-size:40px;
    color:#ff004c;
    text-shadow:0 0 10px rgba(255,0,100,0.6);
    border-radius: 200px 200px 0 0;
    
}

.abajo{
    background: radial-gradient(
        circle at 40% 20%,
        #ffffff 0%,
        #dddddd 60%,
        #b5b5b5 100%
    );
    border-radius:0 0 200px 200px;
    position:absolute;
    bottom:0;
    transition:0.6s;
    z-index: -1;
}

.linea{
    width:200px;
    height:10px;
    background:black;
    position:absolute;
    top:95px;
}

.boton{
    width:40px;
    height:40px;
    background:white;
    border:8px solid black;
    border-radius:50%;
    position:absolute;
    top:75px;
    left:75px;
}

.mensaje{
    margin-top:30px;
    color:white;
    opacity:0;
    transform:translateY(20px);
    transition:0.6s;
}

.mensaje.mostrar{
    opacity:1;
    transform:translateY(0);
}

.pokebola::before{
    content:"";
    position:absolute;
    width:70px;
    height:50px;
    top:25px;
    left:35px;

    background:radial-gradient(
        circle,
        rgba(255,255,255,0.9),
        rgba(255,255,255,0.3),
        transparent
    );

    border-radius:50%;
    filter:blur(2px);
}

.pokebola::after{
    content:"";
    position:absolute;
    width:160px;
    height:30px;

    bottom:-25px;
    left:20px;

    background:rgba(0,0,0,0.5);
    border-radius:50%;

    filter:blur(8px);
}

.pokebola:hover{
    transform:rotateX(10deg) rotateY(-10deg) scale(1.05);
}


.rayo-salida{
    position:absolute;
    bottom:50%;
    left:50%;
    transform:translateX(-50%);

    width:120px;
    height:0;

    border-radius:50%;

    opacity:0;
    pointer-events:none;

   background:linear-gradient(
        to top,
        rgba(255,255,255,1),
        rgba(255,255,255,0.9),
        rgba(255,255,255,0.5),
        transparent
    );

    filter:blur(3px);

    box-shadow:
        0 0 30px white,
        0 0 80px rgba(255,255,255,0.6);

}


.rayo-salida.activo{
    animation:rayoSube 0.8s ease-out forwards;
}

@keyframes rayoSube{
    0%{
        height:0;
        opacity:0;
    }

    30%{
        height:60vh;
        opacity:1;
    }

    100%{
        height:100vh;
        opacity:0;
    }
}

/* ==== Carta ==== */

.carta{
    width:500px;
    padding:25px;

    background:linear-gradient(
        #f5e6cc,
        #e8d3a1
    );

    color:#4b2e1e;
    border-radius:12px;

    box-shadow:
        0 15px 30px rgba(0,0,0,0.5),
        inset 0 0 15px rgba(0,0,0,0.1);

    position:absolute;
    transform:translateX(-50%) translateY(40px) scale(0.8);

    opacity:0;
    transition:0.7s;

    font-family: 'Georgia', serif;
    top: calc(50% - 60%);
    left: calc(100% - 50%);
}

.carta::before{
    content:"";
    position:absolute;
    inset:0;

    border-radius:12px;

    background:radial-gradient(
        circle at center,
        transparent 70%,
        rgba(0,0,0,0.15)
    );

    pointer-events:none;
}

.carta::after{
    content:"❤";
    position:absolute;
    bottom:10px;
    right:15px;
    font-size:18px;
    color:rgba(150,0,0,0.4);
}

.carta h2{
    text-align:center;
    margin-bottom:15px;
    color:#6b3e26;
    font-size:22px;
}

#texto{
    font-size:15px;
    line-height:1.6;
    text-align:justify;
}

.carta.mostrar{
    opacity:1;
    transform:translateX(-50%) translateY(-120px) scale(1);
}

#texto::after{
    content:"|";
    animation: parpadeo 1s infinite;
    margin-left:5px;
}

@keyframes parpadeo{
    0%, 50%, 100%{ opacity:1; }
    25%, 75%{ opacity:0; }
}

/* ==== Animacion ==== */

@keyframes sacudir {

0% { transform: rotate(0deg); }
10% { transform: rotate(-25deg); }
25% { transform: rotate(25deg); }
35% { transform: rotate(0deg); }
45% { transform: rotate(-15deg); }
60% { transform: rotate(15deg); }
75% { transform: rotate(-10deg); }
90% { transform: rotate(10deg); }
100% { transform: rotate(0deg); }

}

.pokebola.animar{
    animation: sacudir 1.5s ease;
}


@keyframes desaparecerPokebola {

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

50% {
    transform: scale(1.2);
    opacity: 0.7;
}

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

}

.pokebola.desaparecer{
    animation: desaparecerPokebola 0.6s ease forwards;
}


.pokebola.flash::before{
    content:"";
    position:absolute;
    width:200px;
    height:200px;
    top:0;
    left:0;

    background:radial-gradient(
        circle,
        rgba(255,255,255,0.9),
        transparent
    );

    border-radius:50%;
    animation: flash 0.3s ease;
}

@keyframes flash{
    0%{ opacity:1; transform:scale(0.5); }
    100%{ opacity:0; transform:scale(2); }
}

/* ==== Paisaje ==== */

.paisaje{
    position:fixed;
    width:100%;
    height:100%;
    top:0;
    left:0;
    z-index:-1;
}

/* Cielo */
.cielo{
    position:absolute;
    width:100%;
    height:100%;
        background:linear-gradient(
        #78cfff 0%,
        #78cfff 40%,
        #a6e1ff 70%,
        #c9ecff 70%
    );
    transition:2s;
}

/* Noche */
.cielo.noche{
    background:linear-gradient(#0b132b, #1c2541);
}

/* Nubes */

.nube{
    position:absolute;
    width:8px;
    height:8px;
    background:white;

    box-shadow:
    8px 0 white,
    16px 0 white,
    24px 0 white,

    0 8px white,
    8px 8px white,
    16px 8px white,
    24px 8px white,
    32px 8px white,

    8px 16px white,
    16px 16px white,
    24px 16px white;

    transform:scale(3);

}

.nube1{
    top:80px;
    left:-100px;
    animation:moverNube 40s linear infinite;
}

.nube2{
    top:150px;
    left:-200px;
    animation:moverNube 60s linear infinite;
}

.nube3{
    top:50px;
    left:-300px;
    animation:moverNube 50s linear infinite;
}

@keyframes moverNube{
    from{ transform:translateX(0) scale(3); }
    to{ transform:translateX(120vw) scale(3); }
}

/* mar */

.mar{
    position:absolute;
    bottom:25%;
    width:100%;
    height:20%;
    background:linear-gradient(#3a86ff, #1d3557);
}

.ola{
    position:absolute;
    width:100%;
    height:2px;

    background:rgba(255,255,255,0.4);

    opacity:0.8;

    animation: bajarOla linear forwards;
}

@keyframes bajarOla{
    0%{
        transform:translateY(0);
        opacity:0.8;
    }

    70%{
        opacity:0.5;
    }

    100%{
        transform:translateY(60px);
        opacity:0;
    }
}

/* Prado */

.pasto{
    position:absolute;
    bottom:0;
    width:100%;
    height:25%;
    background:linear-gradient(
        #2ecc71,
        #27ae60,
        #1e8449
    );

}

.hierba{
    position:absolute;
    bottom:0;
    width:4px;
    height:8px;
    background:#2ecc71;

    transform-origin:bottom;
    animation:viento 2s infinite ease-in-out alternate;
}

@keyframes viento{
    from{ transform:rotate(-5deg); }
    to{ transform:rotate(5deg); }
}

/* estrellas */

.estrellas{
    position:absolute;
    width:100%;
    height: calc(100% - 45%);
    pointer-events:none;
    opacity:0;
    transition:2s;
    overflow:hidden; /* 🔥 evita que algo se salga visualmente */
}

.estrellas.activar{
    opacity:1;
}

.estrella{
    position:absolute;
    width:2px;
    height:2px;
    background:white;

    box-shadow:0 0 6px white;

    animation:parpadeoEstrella 2s infinite alternate;
}

@keyframes parpadeoEstrella{
    from{ opacity:0.3; }
    to{ opacity:1; }
}

/* Activar estrellas */
.estrellas.activar{
    opacity:1;
}


/* Imagenes */

.pika_L {
    background-image: url(./piplup_Gif.gif);
    background-size: cover;
    background-repeat: no-repeat;
    height: 300px;
    width: 450px;
    position: absolute;
    top: calc(100% - 50%);
    right: calc(100% - 93%);
    z-index: 2;
}

.pika_L::before{
    content: "";
    position: absolute;
    width: 160px;
    height: 30px;
    top: calc(100% - 7%);
    right: calc(100% - 79%);
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    filter: blur(8px);
    z-index: 1;
    transform: rotate(3deg);
}

/* arbusto */

.arbusto{
    
    background-image: url(./Arbusto.png);
    background-size: cover;
    background-repeat: no-repeat;
    height: 300px;
    width: 300px;

    position: absolute;
    top: calc(100% - 40%);
    right: calc(75%);
}


.arbusto::before{
    content: "";
    position: absolute;
    width: 251px;
    height: 30px;
    top: calc(100% - 28%);
    right: calc(100% - 93%);
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    filter: blur(8px);
    z-index: 1;
}

/* Sun and Moon */

.sol{
    position:absolute;
    top:calc(100% - 85%);
    right:calc(50% - 36%);

    width:120px;
    height:120px;

    background:radial-gradient(circle, #fff176, #fbc02d);
    border-radius:50%;

    box-shadow:
        0 0 30px rgba(255, 235, 59, 0.8),
        0 0 60px rgba(255, 235, 59, 0.4);

    transition:2s;
}

.luna{
    position:absolute;
    top:calc(100% - 85%);
    right:calc(50% - 36%);

    width:120px;
    height:120px;

    background:#f1f1f1;
    border-radius:50%;

    box-shadow:
        -10px 0 0 0 #0b132b; /* recorte para hacer media luna */

    opacity:0;
    transition:2s;
}

.cielo.noche ~ .sol{
    opacity:0;
    transform:translateY(-50px);
}

.cielo.noche ~ .luna{
    opacity:1;
    transform:translateY(0);
}