body {
    background-color: #8BCDE7;
    margin: 0;
    padding: 0;
    
}

.fortune {
    width: 500px;
    display: flex;
    flex-wrap: wrap;
    margin: auto;
    align-items: center;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

#moving-img {
    max-width: 100%;
    max-height: 100%;
    display: block;
    object-fit: cover;
    margin: auto;
    transform-origin: center bottom;
    animation: shake 2s ease-in-out infinite alternate;

    }
    @keyframes shake {
        0%, 100% {
            transform: rotateZ(0deg);
        }
        25% {
            transform: rotateZ(-10deg);
        }
        75% {
            transform: rotateZ(10deg);
        }
}

#read {
    background-color: #FAB5E1;
    margin: 0;
    padding: 0;
    height: 100%;
}

.fortune {
    width: 500px;
    display: flex;
    flex-wrap: wrap;
    margin: auto;
    align-items: center;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

img {
    max-width: 100%;
    max-height: 100%;
    display: block;
    object-fit: cover;
    margin: auto;
}
 
.main {
    display: flex;
    flex-direction: column;
    align-items: center;
}

#img_read {
    max-width: 70%;
    max-height: 70%;
    display: block;
    object-fit: cover;
    margin: auto;
}

.read-fortune {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.message {
    margin-top: 150px;
    text-align: center;
    display: flex;
    justify-content: center;
}

#message {
    font-size: 20px;
    font-family: 'Times New Roman', Times, serif;
    font-weight: 400;
    text-align: center;
    background: rgb(255, 253, 253);
    padding: 12px 22px;
    border-radius: 6px;
    display: inline-block;
    box-shadow: 0 3px 6px rgba(0,0,0,0.25);
    opacity: 0;   /* keep hidden initially */
}

#message.show {
    animation: slipOut 1s ease forwards;
}

@keyframes slipOut {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.8);
    }
    60% {
        opacity: 1;
        transform: translateY(-5px) scale(1.03);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}
/* Footer for homepage */

.footer_r {
    position: fixed;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    font-size: 0.85rem;
    font-family: "Lato", sans-serif;
    font-weight: 300;
    font-style: normal;
    color: black;
}

/* ── Grow button ── */
 
.grow-button {
    background-color: transparent;
    color:#72243E;
    border: 1px solid #72243E;
    border-radius: 6px; /* matches message box */
    padding: 10px 15px;
    margin: 20px auto 25px;
    cursor: pointer;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease-in-out;
    display: block;
    font-size: 16px;
    font-weight: 400;
    margin-bottom: 150px;
}
 
.grow-button:hover {
    transform: scale(1.1);
}

/* Smooth cookie opening animation */
#moving-img.open {
    animation: none; /* stop shaking */
    transform: scale(1.2) rotate(20deg);
    transition: transform 0.6s ease;
}

/* Mobile Styles (for screens smaller than 600px) */
@media (max-width: 600px) {
    .fortune {
        width: 90%; /* Use percentage instead of fixed pixels */
        max-width: 320px;
    }

    #moving-img {
        width: 100%; /* Scale the cookie to fit the container */
        height: auto;
    }

    #message {
        font-size: 16px; /* Slightly smaller text for small screens */
        width: 80%;      /* Prevent the message from hitting the edges */
    }

    #go-back {
        font-size: 20px; /* Make the button easier to tap */
        margin-left: 20px;
        margin-top: 20px;
    }
}