/* General Styles */
body {
    margin: 0;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: radial-gradient(circle, #ffdde1, #ee9ca7, #9d50bb);
    font-family: 'Comic Sans MS', 'Arial', sans-serif;
    color: #fff;
    overflow: hidden;
    cursor: pointer;
}

.poem-container {
    text-align: center;
    position: relative;
    z-index: 10;
    padding: 0 1rem; /* Add padding for small screens */
}

#poem-line {
    font-size: 2.5rem;
    font-weight: bold;
    text-shadow: 0 0 5px #fff, 0 0 10px #ff87ab, 0 0 15px #ff3d8b;
    opacity: 0;
    animation: fadeInOut 4s ease-in-out infinite;
    transition: all 0.3s ease-in-out;
}

/* Glitter Effect */
.glitter {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
}

.glitter span {
    position: absolute;
    display: block;
    width: 5px;
    height: 5px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    animation: sparkle 2s infinite ease-in-out;
    pointer-events: none;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.8), 0 0 20px rgba(255, 182, 193, 0.5);
}

/* Kawaii Images */
.kawaii-images img {
    position: absolute;
    width: 50px;
    animation: float 10s infinite ease-in-out;
    pointer-events: none;
    z-index: 6;
    opacity: 1;
    transition: opacity 0.3s ease-in-out, transform 3s ease-in-out, filter 2s ease-in-out;
}

.kawaii-images img.fade-out {
    opacity: 0;
    transform: scale(0.1);
    filter: blur(12px);
}

.kawaii-images img.fade-in {
    opacity: 0.2;
    transform: scale(3);
    filter: blur(0.2px);
}

/* Floating Animation */
@keyframes float {
    0% { transform: translateY(0) rotate(0deg); opacity: 0.8; }
    50% { transform: translateY(-50px) rotate(10deg); opacity: 1; }
    100% { transform: translateY(0) rotate(-10deg); opacity: 0.8; }
}

/* Glitter Animation */
@keyframes sparkle {
    0%, 100% {
        transform: translateY(0) scale(1);
        opacity: 0.7;
    }
    50% {
        transform: translateY(-10px) scale(1.5);
        opacity: 1;
    }
}

/* Fade-In and Out Animation */
@keyframes fadeInOut {
    0% { opacity: 0; transform: scale(0.8); }
    50% { opacity: 1; transform: scale(1); }
    100% { opacity: 0; transform: scale(1.2); }
}

/* Responsive Styles */
@media (max-width: 768px) {
    #poem-line {
        font-size: 1.8rem; /* Adjust text size */
    }

    .kawaii-images img {
        width: 40px; /* Reduce kawaii image size */
    }

    .glitter span {
        width: 4px; /* Smaller glitter for mobile */
        height: 4px;
    }
}

@media (max-width: 480px) {
    #poem-line {
        font-size: 1.5rem; /* Further reduce text size for smaller devices */
    }

    .kawaii-images img {
        width: 30px; /* Further reduce kawaii image size */
    }
}

.central-animation {
    position: fixed;
    top: 50%;
    left: 50%;
    width: 150px;
    height: 170px;
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
    z-index: 20;
    pointer-events: none;
    animation: popUp 20s ease-out forwards;
}

@keyframes popUp {
    0% {
        transform: translate(-50%, -50%) scale(0.5);
        opacity: 0;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.2);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0;
    }
}